query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Load Composer's autoloader / require 'vendor/autoload.php';
function alert($msg) { echo "<script type='text/javascript'>alert('$msg');</script>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function composerAutoload(): void\n {\n self::require(ROOT . '/vendor/autoload.php');\n }", "public function registerAutoloader() : void\n {\n require_once __DIR__ . '/../vendor/autoload.php';\n }", "public static function autoload()\n {\n if (file_exists(__DIR__ . '/Stringprep/vendor/autoload.php')) {\n require_once __DIR__ . '/Stringprep/vendor/autoload.php';\n } else {\n require_once __DIR__ . '/../../bundle/vendor/autoload.php';\n }\n }", "function loadDependencies() {\n if (strpos(TERMINUS_ROOT, 'phar:') === 0) {\n require TERMINUS_ROOT . '/vendor/autoload.php';\n return;\n }\n\n $has_autoload = false;\n\n foreach (getVendorPaths() as $vendor_path) {\n if (file_exists($vendor_path . '/autoload.php')) {\n require $vendor_path . '/autoload.php';\n $has_autoload = true;\n break;\n }\n }\n\n if (!$has_autoload) {\n fputs(STDERR, \"Internal error: Can't find Composer autoloader.\\n\");\n exit(3);\n }\n}", "protected function loadDependencies()\n {\n // See: https://github.com/concrete5/concrete5-5.7.0/issues/360\n $filesystem = new Filesystem();\n $filesystem->getRequire(__DIR__ . '/vendor/autoload.php');\n }", "private function registerComposerAutoloader()\n {\n if (class_exists(ClassLoader::class, false)) {\n return;\n }\n \n if (file_exists(__DIR__ . '/../vendor/autoload.php')) {\n require_once __DIR__ . '/../vendor/autoload.php';\n } elseif (file_exists(__DIR__ . '/../../../../vendor/autoload.php')) {\n require_once __DIR__ . '/../../../../vendor/autoload.php';\n } elseif (file_exists(__DIR__ . '/../../vendor/autoload.php')) {\n require_once __DIR__ . '/../../vendor/autoload.php';\n } else {\n throw new \\Exception('Could not find composer autoloader');\n }\n }", "protected function loadAutoloader()\n {\n new Autoloader();\n }", "function requireAutoloader(): void\n{\n if (file_exists(__DIR__ . \"/../../vendor/autoload.php\")) {\n require_once __DIR__ . \"/../../vendor/autoload.php\";\n\n return;\n }\n\n $dir = __DIR__;\n $prev_dir = \"\";\n\n while ($dir != $prev_dir) {\n\n $prev_dir = $dir;\n $dir = dirname($dir);\n\n if (file_exists($dir . \"/autoload.php\")) {\n require_once $dir . \"/autoload.php\";\n\n return;\n }\n }\n\n throw new RuntimeException(\"autoload.php not found!\");\n}", "public function setupAutoload()\n {\n static::$autoload or spl_autoload_register(\n $this->psr4LoaderFor(__NAMESPACE__, __DIR__),\n true,\n true\n );\n\n static::$autoload = true;\n }", "function autoloader()\n {\n spl_autoload_register(function ($className) {\n\n # DIRECTORY SEPARATORS varies in various platforms\n $ds = DIRECTORY_SEPARATOR;\n\n # Current Working Directory\n $dir = __DIR__;\n\n # replace namespace separator with directory separator (prolly not required)\n $className = str_replace('\\\\', $ds, $className);\n\n # get full name of file containing the required class\n $file = \"{$dir}{$ds}{$className}.php\";\n\n # get file if it is readable\n if (is_readable($file)) {\n require_once $file;\n }\n });\n }", "static public function autoload() {\n spl_autoload_register(array(__CLASS__, 'loader'));\n }", "public static function registerAutoloader(){\n\t\tspl_autoload_register(__NAMESPACE__ . \"\\\\Jolt::autoload\");\n\t}", "private static function vendor() {\n $file = Storange::getPathFile('vendor/autoload.php');\n if (file_exists($file)) {\n include_once $file;\n } else {\n throw new exceptions\\LoadFiles('Error to load vendor autoload. Check the composer libs', 0);\n }\n }", "public static function registerAutoloader() {\n spl_autoload_register(__NAMESPACE__ . \"\\\\Framework::autoload\");\n }", "public static function register_autoloader()\n {\n }", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "private function setAutoLoader() {\n \n spl_autoload_register(array('self', 'autoLoader'));\n \n }", "public static function init_autoload() {\n spl_autoload_register(function ($class) {\n self::autoload_path($class);\n });\n }", "private static function libAutoload(): void\n {\n \\spl_autoload_register('self::autoload');\n }", "private function registerAutoloader() {\n\t\t\t// register autoloader\n\t\t\tspl_autoload_extensions(EXT);\n\t\t\tspl_autoload_register(array($this, 'autoload'));\n\t\t}", "function rum_class_loader() {\n $loader = new UniversalClassLoader();\n $loader->registerNamespace('Rum', __DIR__ . '/lib');\n $loader->register();\n}", "public static function registerAutoloader()\n\t{\n\t\tspl_autoload_register(__NAMESPACE__.'\\\\Core::autoload');\n\t}", "public static function autoload() {\n spl_autoload_register(function($class) {\n $prefix = __CLASS__ . '\\\\';\n if (strpos($class, $prefix) === 0) {\n // Remove vendor from name.\n $class = substr($class, strlen(__NAMESPACE__) + 1);\n // Convert namespace separator to directory ones.\n $class = str_replace('\\\\', DIRECTORY_SEPARATOR, $class);\n // Prefix with this file's directory.\n $class = __DIR__ . DIRECTORY_SEPARATOR . $class;\n\n require \"$class.php\";\n\n return true;\n }\n\n return false;\n });\n }", "public function auto_load() {\n\n spl_autoload_register(function ($class) {\n\n // Getting the file path for checking if it exists.\n\n require_once ROOT . '/app/controllers/' . $class . '.php';\n\n });\n }", "public function registerAutoload()\n {\n return spl_autoload_register(array('Proem\\Loader', 'load'));\n }", "function my_autoloader($class) {\r\n\t require_once ($class.'.php');\r\n\t}", "public function registerAutoloader()\n {\n spl_autoload_register(array($this,'loadClass'),true, false);\n }", "protected function registerComposerAutoload(): void\n {\n $autoloadFiles = [\n __DIR__.'/../../../../autoload.php',\n __DIR__.'/../../../autoload.php',\n __DIR__.'/../../vendor/autoload.php',\n __DIR__.'/../../../vendor/autoload.php',\n ];\n\n $autoloadFile = current(array_filter($autoloadFiles, function (string $path) {\n return file_exists($path);\n }));\n\n if (false === $autoloadFile) {\n throw new RuntimeException('Composer autoload not found!');\n }\n\n require $autoloadFile;\n }", "public function RegisterAutoload()\n {\n spl_autoload_register(array(__CLASS__,'autoload'));\n }", "public static function chainload() {\n require_once self::BASE_PATH . \"/vendor/autoload.php\";\n foreach (scandir(dirname(__FILE__)) as $filename) {\n $path = dirname(__FILE__) . \"/\" . $filename;\n if (is_file($path) && substr_compare($path, \".php\", strlen($path) - strlen(\".php\"), strlen(\".php\")) === 0) {\n require_once $path;\n }\n }\n }", "private function load_dependencies() {\n\n\t\t//For CHAOS lib\n\t\tset_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ .\"/lib/chaos-client/src/\");\n\t\trequire(\"CaseSensitiveAutoload.php\");\n\t\tspl_autoload_extensions(\".php\");\n\t\tspl_autoload_register(\"CaseSensitiveAutoload\");\n\n\t\trequire(\"wpportalclient.php\");\n\t\trequire(\"wpchaosobject.php\");\n\t\trequire(\"widgets/chaoswidget.php\");\n\t\trequire(\"widgets/attribute.php\");\n\t\trequire(\"widgets/multiattribute.php\");\n\t}", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "public static function start()\n\t{\n\t\tspl_autoload_register('Autoloader::init', true, true);\n\t}", "public function registerAutoloaders()\n {\n }", "protected function _initAutoloader()\n {\n $loader = new StandardAutoloader();\n $loader->registerNamespace('Doctrine', PROJECT_PATH.'/library/Doctrine')\n ->registerNamespace('App', PROJECT_PATH.'/library/App')\n ->registerNamespace('Domain', PROJECT_PATH.'/library/Domain')\n ->registerNamespace('Gedmo', PROJECT_PATH.'/library/Doctrine/Extension/Gedmo');\n $loader->register();\n }", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n }", "function my_autoloader($class) {\r\n require 'libs/' . $class . '.php';\r\n}", "function my_autoloader($class) {\n require_once './../../classes/' . $class . '.php';\n}", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "public static function load() {\n self::initialLoad();\n self::vendor();\n self::loadLibs();\n //registra o SLP AUTO LOAD\n spl_autoload_register(array('\\wow\\Loader','autLoad'));\n }", "final public function __construct()\n {\n // Mengecek folder vendor jika sudah ada\n // Untuk memuat Autoload yang di buat oleh composer.\n $vendor = getProjectDirectory() . DIRECTORY_SEPARATOR . '/vendor';\n \n if ( is_dir( $vendor ) ) {\n if ( file_exists( $vendor . $this->autoload ) ) {\n require $vendor . $this->autoload;\n }\n return false;\n }\n spl_autoload_register( 'Autoload', 'loadClassBySplAutoload' );\n }", "function my_custom_autoloader($class_name) {\n $file = __DIR__ . \"/includes/\" . $class_name . \".php\";\n\n if (file_exists($file)) {\n require_once $file;\n }\n}", "function setComposerLoader($file)\r\n {\r\n }", "public function registerAutoloaders()\n {\n $loader = new Loader();\n \n $loader->setNamespaces(array(\n 'App\\Install\\Controllers' => __DIR__ . '/controllers/',\n 'App\\Install\\Tags' => __DIR__ . '/tags/'\n ));\n $loader->register();\n }", "public function registerAutoLoad() {\n spl_autoload_register(array($this, \"load\"), true, true);\n }", "private function load_dependencies() {\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-ttr66-loader.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-ttr66-admin.php';\n\t\t$this->loader = new TTR66_Loader();\n\t}", "function my_autoloader($class)\n{\n $filename = BASE_PATH . '/'. str_replace('\\\\', '/', $class) . '.php';\n include($filename);\n}", "function autoloader_perso($className)\n{\n //var_dump($className);\n require_once($className . '.php');\n //die('Test autoloader');\n}", "public static function register() {\r\n spl_autoload_register('Zeeye\\Util\\Autoloader\\Autoloader::autoload');\r\n }", "public static function AutoLoad(){\n spl_autoload_register(function ($file_name){\n $name = preg_replace('~(.*[\\\\\\\\]([A-Z]\\w+))~im', '$2', $file_name);\n MyAutoload::loadControllers($name);//'HomeController'\n MyAutoload::loadModules($name);//'Controller'\n MyAutoload::loadModules($name);//'Model'\n MyAutoload::loadModules($name);//'Config'\n MyAutoload::loadModels($name);//'Tasks'\n MyAutoload::loadRoutes();//'Tasks'\n });\n }", "public function __construct()\n {\n self::autoload();\n }", "protected function _initAutoload () {\n\t\t// configure new autoloader\n\t\t$autoloader = new Zend_Application_Module_Autoloader (array ('namespace' => 'Admin', 'basePath' => APPLICATION_PATH.\"/modules/admin\"));\n\n\t\t// autoload validators definition\n\t\t$autoloader->addResourceType ('Validate', 'validators', 'Validate_');\n\t}", "public function autoLoad($name){\n\t\t$path = NULL;\n\t\t$namespaceParts = explode('\\\\', $name);\n\t\t$pathTail = implode(DIRECTORY_SEPARATOR, $namespaceParts) . '.php';\n\t\t\n\t\t$tryPath = $this->rootPath . '/' . $pathTail;\n\t\t\n\t\tif(is_readable($tryPath)){\n\t\t\t$path = $tryPath;\n\t\t}\n\t\t\n\t\t// this must not throw an exception or do any kind of error as if it does\n\t\t// then when you use class_exists it will error instead of returning false\n\t\tif ($path) {\n\t\t\trequire_once($path); \n\t\t}\n\t}", "function __autoload($class) {\n require ($class . '.php');\n}", "public function boot()\n {\n require_once __DIR__ . '/../thirdparty/src/autoload.php';\n }", "public static function registerAutoload()\n\t{\n\t\tspl_autoload_register(array('AgileProfiler', 'autoload'));\n\t}", "function gb_load() {\n require_once( 'vendor/autoload.php' );\n \\Carbon_Fields\\Carbon_Fields::boot();\n}", "public static function __autoload()\n\t{\n\t\tself::$FPATH = dirname(__DIR__);\n\t\tself::$APATH = self::detect_project();\n\n\t\tspl_autoload_register(array(__CLASS__, 'load'));\n\n\t\tself::cache_files();\n\t\tself::import_initializers();\n\t}", "private function load_dependencies() {\n\n\t\t$this->loader = new Service_Tracker_Loader();\n\n\t}", "private function load_dependencies()\n\t{\n\t\t$dependencies = [\n\t\t\t'Routing',\n\t\t\t'Loader',\n\t\t\t'Base',\n\t\t];\n\n\t\tforeach($dependencies as $file)\n\t\t{\n\t\t\trequire_once plugin_dir_path(__FILE__) . $file . '.php';\n\t\t}\n\t}", "function autoloader($className) {\n\t$file = __DIR__ \t. '/../models/' . $className . '.php';\t\n\t// $file = __DIR__ \t. '/classes/' . $className . '.php';\t\n\tinclude $file;\t\t\n}", "function my_autoloader($class_name) \n\t{\n \tinclude '../classes/' . $class_name . '.class.php';\n\t}", "public static function register(): void\r\n {\r\n // Run the SPL autoloader\r\n spl_autoload_register([self::class, 'loadClass']);\r\n\r\n // Iterate through the PSR4 namespace array\r\n $namespaces = array_filter(self::$psr4);\r\n if ( ! empty($namespaces) ) {\r\n foreach ( self::$psr4 as $psr4 => $path ) {\r\n self::addNamespace($psr4, $path);\r\n }\r\n }\r\n // Iterate through the PSR4 classmap array\r\n $classmap = array_filter(self::$classmap);\r\n if ( ! empty($classmap) ) {\r\n foreach ( self::$classmap as $class => $file) {\r\n self::requireFiles(strpos($file, '.php')? $file: $file . '.php');\r\n }\r\n }\r\n }", "function my_autoloader($classname)\n{\n\tchdir('challenge/are_you_serial');\n\trequire_once './'.str_replace('.', '', $classname).'.php';\n\tchdir('../../');\n}", "function __autoload($className)\n\t{\n\t\t// Load class using Loader\n\t\tLoad($className);\n\t}", "function __autoload($name) {\n $file = str_replace(\"\\\\\", \"/\", $name);\n $file = ROOT . '/' . $file . '.php';\n\n if (!file_exists($file)) {\n return;\n }\n\n require_once $file;\n}", "protected function includeAndStartCoreBootstrap() {}", "private function bootload(): void\n {\n $this->bootloader->bootload(static::LOAD);\n }", "protected function composerAutoloadDev() :void\n {\n $file = app_path('composer.json');\n $contents = Storage::get($file);\n\n $json = json_decode($contents, true);\n $json['autoload-dev'] = [\n 'classmap' => [\n 'tests/'\n ]\n ];\n $json = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n Storage::put($file, $json);\n }", "public static function register() {\n spl_autoload_register([Autoloader::class, 'tryLoadClass']);\n }", "private function _enableAutoloader()\n {\n Zend_Loader_Autoloader::getInstance()->pushAutoloader(array('P4Cms_Loader', 'autoload'));\n }", "public function enableYiiAutoload()\n\t{\n\t // enable Yii autoloader\n\t spl_autoload_register(array('YiiBase','autoload'));\n\t}", "function __autoload($className)\r\n{\r\n require_once $className . '.php';\r\n}", "protected function includeAndStartCoreBootstrap()\n {\n $classLoaderFilepath = $this->getClassLoaderFilepath();\n\n $classLoader = require $classLoaderFilepath;\n\n $this->bootstrap->initializeClassLoader($classLoader)\n ->baseSetup()\n ->loadConfigurationAndInitialize(true)\n ->loadTypo3LoadedExtAndExtLocalconf(true)\n ->initializeBackendRouter()\n ->setFinalCachingFrameworkCacheConfiguration()\n ->defineLoggingAndExceptionConstants()\n ->unsetReservedGlobalVariables();\n }", "protected function registerAutoload()\n {\n spl_autoload_register(function($class)\n {\n foreach ($this->foldersToAutoload as $folder)\n {\n if (file_exists(getcwd() . \"/$folder/$class.php\"))\n {\n /** @noinspection PhpIncludeInspection */\n require_once getcwd() . \"/$folder/$class.php\";\n }\n }\n });\n }", "protected function _initAutoloader()\n {\n require_once APPLICATION_PATH . DIRECTORY_SEPARATOR . 'Autoloader.php';\n $this->_autoloader = new \\App\\Autoloader();\n $this->_autoloader\n ->addNamespaces($this->_getAutoloaderNamespaces())\n ->register(true)\n ;\n }", "function autoload($name) {\r\n require strtolower($name) . '.php';\r\n}", "static function _shfw_autoloader()\n {\n\t\tinclude_once(BASEPATH.'config'.DIRECTORY_SEPARATOR.'autoload.php');\n\n\t\tif ( ! isset($autoload))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Autoload helpers.\n\t\tforeach ($autoload['helper'] as $type)\n\t\t{\t\t\t\n\t\t\tself::loadHelper($type);\n\t\t}\n\n\t\t// Autoload core components.\n\t\tforeach ($autoload['core'] as $type)\n\t\t{\t\t\t\n\t\t\tself::initCoreComponent($type);\n\t\t}\n\n\t\t/*\n\t\tif(SHIN_Core::$_benchmark){\n\t\t\tSHIN_Core::$_benchmark->mark('code_start');\n\t\t}\n\t\t*/\n\t\t\n\t\t// Autoload libraries.\n\t\tforeach ($autoload['libraries'] as $type)\n\t\t{\n\t\t\tself::loadLibrary($type, TRUE);\n\t\t}\n\n\t\t// Autoload models.\n\t\tforeach ($autoload['models'] as $type)\n\t\t{\n\t\t\tself::loadModel($type, TRUE);\n\t\t}\n\t}", "function vehicleAutoloader($className)\n\t{\n\t\t$path = 'Classes/Vehicles/' . $className . '.php';\n\t\tif (file_exists($path)) {\n\t\t\trequire_once($path);\n\t\t}\n\t}", "function autoloader($class_name) {\n\n $array_paths = [\n '/models/',\n '/components/',\n '/controllers/',\n ];\n\n foreach ($array_paths as $path) {\n\n $path = ROOT . $path . $class_name . '.php';\n\n if (is_file($path)) {\n include_once $path;\n }\n }\n}", "public static function setUpBeforeClass()\n {\n $vendorDir = __DIR__ . '/../vendor';\n $vendorAutoload = $vendorDir . '/autoload.php';\n if (file_exists($vendorAutoload)) {\n require_once($vendorAutoload);\n } else {\n throw new NotSupportedException(\"Vendor autoload file '{$vendorAutoload}' is missing.\");\n }\n require_once($vendorDir . '/yiisoft/yii2/Yii.php');\n Yii::setAlias('@vendor', $vendorDir);\n }", "protected function registerClassLoader()\n {\n $namespace = $this->active()->get('namespace');\n $loader = new ClassLoader();\n\n $loader->addPsr4(\"Themes\\\\{$namespace}\\\\\", theme_path(\"{$namespace}/src\"));\n $loader->register();\n }", "public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }", "function autoload ($className) {\n \n $file = dirname(__FILE__) . '/' . $className . '.php';\n if (file_exists($file)) {\n require $file;\n }\n}", "public function registerAutoloaders()\n {\n\n $loader = new Loader();\n\n $loader->registerNamespaces(array(\n 'Ns\\Core\\Controllers' => __DIR__ . '/controllers/',\n 'Ns\\Core\\Models' => __DIR__ . '/models/',\n 'Ns\\Core\\Libraries' => __DIR__ . '/libraries/',\n ));\n\n $loader->register();\n }", "public function registerAutoloader()\n {\n if (!$this->isLoaderRegistered()) {\n $this->_loaderRegistered = spl_autoload_register(array($this, 'loadClass'));\n }\n }", "public function addAutoloader()\n {\n if (! $this->autoloaderRegistered) {\n spl_autoload_unregister(array(Varien_Autoload::instance(), 'autoload'));\n require_once Mage::getBaseDir('lib') . '/Wallee/Sdk/autoload.php';\n spl_autoload_register(array(Varien_Autoload::instance(), 'autoload'));\n\n set_include_path(get_include_path() . PATH_SEPARATOR . Mage::helper('wallee_payment')->getGenerationDirectoryPath());\n\n spl_autoload_register(\n function ($class) {\n if (strpos($class, 'Wallee_Payment_Model_PaymentMethod') === 0) {\n $file = Mage::helper('wallee_payment')->getGenerationDirectoryPath() . DS . uc_words($class, DIRECTORY_SEPARATOR) . '.php';\n if (file_exists($file)) {\n require $file;\n }\n }\n }, true, true\n );\n $this->autoloaderRegistered = true;\n }\n }", "public static final function register()\n {\n\tspl_autoload_register('PathAutoload::loadClass');\n }", "function autoloader($classname){\n $lastSlash = strpos($classname, '\\\\') + 1;\n $classname = substr($classname, $lastSlash);\n $directory = str_replace('\\\\' , '/' , $classname);\n $filename = __DIR__ . '/' . $directory . '.php';\n\n require_once $filename;\n }", "function class_autoloader($class_name) {\n include 'classes/' .$class_name . '.php';\n}", "function class_autoloader($class)\n{\n $filename = dirname(__FILE__) . DS . '..' . DS . 'includes' . DS . 'class-' . strtolower($class) . '.php';\n\n if (file_exists($filename)) {\n require $filename;\n }\n}", "public function init() {\n if (!class_exists(TableBuilderManager::class)) {\n $loader = new ClassLoader();\n $loader->addPsr4('Drush\\\\dmt_structure_export\\\\', __DIR__ . '/src');\n $loader->register();\n }\n }", "function _autoload($class)\r {\r $class = str_replace(\"\\\\\", \"/\", $class);\r $class = str_replace('yqn/sdkmiddle/', 'src/', $class);\r $file = __DIR__ . '/../' . $class . '.php';\r require_once $file;\r }", "function __autoload($class)\n{\n\trequire_once $class . '.php';\n}", "function __autoload($className) {\r\n\t$className = strtolower($className);\r\n\t$className = basename(str_replace(\"\\\\\", \"/\", $className ));\r\n\t//echo $className. PHP_EOL;\r\n\r\n\tif (file_exists(__DIR__.'/'. $className . '.class.php')) {\r\n\t\trequire_once( __DIR__.'/'.$className . '.class.php' );\r\n\t}else{\r\n\t\tthrow new \\Exception('Class \"' . $className . '.class.php\" could not be autoloaded');\r\n\t}\r\n\r\n}", "function medialib_autoloader($class_name)\n{\n $class_name = str_replace('\\\\', '/', $class_name) . '.php';\n require_once $class_name;\n}", "protected function _initAutoload() {\r\n// \t\t\t'basePath' => APPLICATION_PATH,\r\n// \t\t\t'namespace' => '',\r\n// \t\t\t'resourceTypes' => array(\r\n// \t\t\t\t'model' => array(\r\n// \t\t\t\t\t'path' => 'models/',\r\n// \t\t\t\t\t'namespace' => 'Model_'\r\n// \t\t\t\t)\r\n// \t\t\t)\r\n// \t\t));\r\n\r\n\t\tZend_Loader::loadFile('Respon.php', LIBRARY_PATH . '/Base');\r\n\r\n\t}", "protected function bootstrap()\n {\n }", "protected static function getClassLoader() {}", "public static function register($composer = null)\n {\n if ( ! static::$registered)\n {\n static::$registered = spl_autoload_register(array('\\Iyoworks\\Support\\ClassLoader', 'load'));\n if ($composer) static::setComposer($composer);\n }\n }" ]
[ "0.8108314", "0.79612625", "0.7651757", "0.73787105", "0.7307755", "0.7286799", "0.7226856", "0.7189157", "0.70951647", "0.7038505", "0.7011923", "0.69768107", "0.695545", "0.68612665", "0.6843742", "0.6836808", "0.6702543", "0.66696", "0.66640794", "0.6656659", "0.65958613", "0.6578127", "0.6572044", "0.6551459", "0.65353346", "0.65336955", "0.6531216", "0.65252405", "0.6524018", "0.65055424", "0.649255", "0.64850765", "0.6465566", "0.6451305", "0.64510024", "0.64129823", "0.63729", "0.6362084", "0.63601947", "0.63557994", "0.6351469", "0.63436097", "0.6326404", "0.6314199", "0.63084507", "0.629559", "0.62496316", "0.62491554", "0.6238286", "0.62197816", "0.62124324", "0.6212148", "0.6204582", "0.6191247", "0.6188753", "0.61847407", "0.6176068", "0.6166056", "0.61625427", "0.61568785", "0.6155772", "0.61517096", "0.6148053", "0.6135858", "0.6125302", "0.6118486", "0.6118429", "0.6113246", "0.61068124", "0.6101894", "0.60888165", "0.60806566", "0.60697174", "0.6067451", "0.6065786", "0.60559356", "0.60436666", "0.6034311", "0.60176027", "0.60155964", "0.60126525", "0.6003559", "0.6001154", "0.59991646", "0.59975886", "0.59925395", "0.59910256", "0.5987883", "0.59748197", "0.59678346", "0.5964346", "0.596393", "0.5959932", "0.59587604", "0.59583753", "0.59574133", "0.59476143", "0.59435517", "0.5937909", "0.5935423", "0.59285223" ]
0.0
-1
This function is called on event "onExtensionRegistration" and it's used for collect known extensions in CMS environment. Valid extension is extension which implements ICustomExtension interface and is instantiable.
public function registerExtensionNames(array $extensionNames) { $tmp = []; foreach ($extensionNames as $extensionName) { $tmp[md5($extensionName)] = (new $extensionName)->getExtensionInfo(); } $this->extensions = $tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _extensionLoaded() {}", "protected function registerExtensions()\n {\n $apiResult = Event::fire('editor.extension.register');\n\n if (!is_array($apiResult)) {\n return;\n }\n\n foreach ($apiResult as $extensionClassName) {\n if (!is_string($extensionClassName)) {\n continue;\n }\n\n $this->extensionClassNames[] = $extensionClassName;\n }\n }", "private function loadExtensions(){\n\n // CSRF Extension\n $csrfGenerator = new UriSafeTokenGenerator();\n $csrfStorage = new NativeSessionTokenStorage();\n $csrfManager = new CsrfTokenManager($csrfGenerator, $csrfStorage); \n $csrfExtension = new CsrfExtension($csrfManager);\n \n $this->extensions[] = $csrfExtension;\n \n // HttpFoundation Extension\n $httpFoundation = new HttpFoundationExtension();\n $this->extensions[] = $httpFoundation;\n \n //Core\n $core = new CoreExtension();\n $this->extensions[] = $core;\n \n }", "protected function getExtensionsToLoad() {}", "protected function _loadExtensions()\n {\n }", "protected function setAvailableExtensions() {}", "public function getExtension() {}", "public function getExtension() {}", "public static function getExtensions()\n {\n }", "protected static function _registerCoreExtensions()\n {\n self::registerExtension('DublinCore');\n self::registerExtension('Content');\n self::registerExtension('Atom');\n self::registerExtension('Slash');\n self::registerExtension('WellFormedWeb');\n self::registerExtension('Thread');\n self::registerExtension('Podcast');\n }", "public function getExtensions() {}", "public function getExtensions() {}", "public function getAvailableExtensions() {}", "public abstract function getExtension();", "function gsCustomPageExtensions() {\r\n /* Load Langauge Files */\r\n $langDir = dirname(plugin_basename(__FILE__)) . '/lang';\r\n load_plugin_textdomain('custom-page-extensions', false, $langDir, $langDir);\r\n\r\n /* Set the plugin name to use the selected language. */\r\n $this->pluginName = __('Custom Page Extensions', 'custom-page-extensions');\r\n\r\n global $wp_rewrite;\r\n\r\n /* Plugin paths */\r\n $this->pluginPath = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));\r\n $this->pluginURL = WP_PLUGIN_URL . '/' . basename(dirname(__FILE__));\r\n\r\n // Get the extension.\r\n $this->load_settings();\r\n\r\n /* Add Options Pages and Links */\r\n add_action('admin_menu', array(&$this, 'admin_menu'));\r\n add_action('admin_init', array(&$this, 'admin_init'));\r\n add_action('update_option_' . $this->optionsName, array(&$this, 'update_option'), 10);\r\n add_action('wp_loaded', array(&$this, 'flush_rules'));\r\n\r\n add_filter('plugin_action_links', array(&$this, \"plugin_action_links\"), 10, 2);\r\n add_filter('user_trailingslashit', array(&$this, 'no_page_slash'), 66, 2);\r\n }", "protected function loadBaseExtensions() {}", "public function __construct()\n {\n $this->extensions = collect();\n }", "public function extensions();", "public function getValidExtensions();", "function getExtension() ;", "public function get_extension()\n {\n }", "public function extension() {}", "protected function initializeExtensionFiles() {}", "protected function registerExtensions()\n {\n $this->app['extensions'] = $this->app->share(function ($app) {\n return new ExtensionBag($app['files'], $app['extensions.finder'], $app, [], $app['cache']);\n });\n\n $this->app->alias('extensions', 'Cartalyst\\Extensions\\ExtensionBag');\n }", "public function activate_extension(){}", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function getExtensionPoint();", "public function getAvailableAndInstalledExtensionsWithAdditionalInformation() {}", "protected function addInitialExtensionInformation()\n {\n $repository = ExtensionInformationRepositoryFactory::create();\n $packages = $this->packageManager->getAvailablePackages();\n $repository->addExtensionInformation($packages);\n }", "public function getLocalExtensions() {}", "protected function init()\n {\n $this->registerExtensions();\n }", "public function getExtensions();", "private function getExtensionsObject()\n {\n if(!is_object($this->extObj) && !($this->extObj instanceof Extensions)) {\n $this->extObj = GeneralUtility::makeInstance('PITS\\\\Snowbabel\\\\Record\\\\Extensions', $this->confObj);\n }\n }", "function add_extension() {\n\n require_once( dirname( __FILE__ ) . '/LFAPPS_Comments_Extension.php' );\n $this->ext = new LFAPPS_Comments_Extension();\n }", "protected static function getActiveExtensionPackages() {}", "protected function assignExtensionSettings() {}", "public function getAllowedExtensions(){\n return $this->allowedExtensions;\n }", "public function update_extension(){}", "public function reloadAvailableExtensions() {}", "public function reloadAvailableExtensions() {}", "static protected function setup_extensions()\n\t{\n\t\treturn array('anavaro/eventmedals');\n\t}", "public function load_extensions()\n\t{\n\t\t$this->extensions = array();\n\n\t\t// Do not try to load any extensions if the extension table\n\t\t// does not exist or when installing or updating.\n\t\t// Note: database updater invokes this code, and in 3.0\n\t\t// there is no extension table therefore the rest of this function\n\t\t// fails\n\t\tif (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = 'SELECT *\n\t\t\tFROM ' . $this->extension_table;\n\n\t\t$result = $this->db->sql_query($sql);\n\t\t$extensions = $this->db->sql_fetchrowset($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tforeach ($extensions as $extension)\n\t\t{\n\t\t\t$extension['ext_path'] = $this->get_extension_path($extension['ext_name']);\n\t\t\t$this->extensions[$extension['ext_name']] = $extension;\n\t\t}\n\n\t\tksort($this->extensions);\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->put($this->cache_name, $this->extensions);\n\t\t}\n\t}", "public function addExtension(string $extension);", "public function activate_extension()\n\t{\n\n\t $data = array(\n\t 'class' => __CLASS__,\n\t 'method' => 'template_types',\n\t 'hook' => 'template_types',\n\t 'settings' => serialize($this->settings),\n\t 'priority' => 10,\n\t 'version' => $this->version,\n\t 'enabled' => 'y'\n\t );\t\n\t ee()->db->insert('extensions', $data);\n\t \n\t}", "public function Extension();", "private function getExtensions(): void\n {\n\n $localExtensionFiles = glob(base_path('extensions/*/*/composer.json'));\n $localExtensions = collect();\n\n $localCache = resolve('extensions')->getCache();\n\n foreach ($localExtensionFiles as $file) {\n $composer = json_decode(file_get_contents($file));\n\n if (!$composer) {\n continue;\n }\n\n $nameEx = explode('/', $composer->name);\n $author = $nameEx[0];\n $packageName = $nameEx[1];\n\n $slug = \\Str::kebab(str_replace('\\\\', '', $composer->extra->titan->namespace));\n\n $temp = collect();\n $temp->put('name', $composer->extra->titan->name);\n $temp->put('description', $composer->description);\n $temp->put('version', '1.0.0');\n $temp->put('authors', $composer->authors);\n $temp->put('slug', $slug);\n $temp->put('rating', '4.0');\n $temp->put('ratings', 20);\n $temp->put('installs', 3237);\n $temp->put('local', true);\n $temp->put('enabled', $localCache->where('name', $composer->extra->titan->name)->first()['enabled'] ?? false);\n $temp->put('namespace', $composer->extra->titan->namespace);\n $localExtensions[] = $temp;\n\n $this->info(\"Found new extension {$composer->extra->titan->name}\");\n\n }\n\n\n cache()->put('local_extensions', json_encode($localExtensions));\n $this->info('Local extension cache refreshed');\n\n\n try {\n\n $http = new Client([\n 'timeout' => 3\n ]);\n $res = $http->get('https://titan.pbbg.io/api/extensions')->getBody()->getContents();\n $extensions = json_decode($res);\n\n $this->schema['date'] = new Carbon();\n $this->schema['remote_extensions'] = $extensions;\n $this->schema['local_extensions'] = $localExtensions;\n\n cache()->put('remote_extensions', json_encode($extensions));\n\n \\Storage::disk('local')->put('extensions.json', json_encode($this->schema));\n $this->info(\"Extensions have been reloaded\");\n } catch (\\Exception $exception) {\n $this->warn(\"Unable to retrieve remote extension cache, falling back to previous version\");\n dump($exception);\n }\n }", "public function getName(): string\n {\n return 'Extension';\n }", "public function activate_extension() {\n $hooks = array(\n 'template_post_parse' => 'template_post_parse'\n );\n foreach($hooks as $hook => $method) {\n $data = array(\n 'class' => __CLASS__,\n 'method' => $method,\n 'hook' => $hook,\n 'priority' => 10,\n 'version' => $this->version,\n 'enabled' => 'y',\n 'settings' => ''\n );\n ee()->db->insert('exp_extensions', $data);\n }\n return true;\n }", "protected function getExtensions()\r\n {\r\n return array(new ValidatorExtension(Validation::createValidator()));\r\n }", "public function getExtensions()\n {\n return $this->extension;\n }", "public function loadExtensions(): void\n {\n /**\n * @var ConfigStorageInterface $configStorage\n */\n $configStorage = $this->di->get(ConfigStorageInterface::class);\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $autoLoadPaths = [];\n $autoLoadPathsPsr4 = [];\n $configPaths = [];\n\n $dependencyPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['loaded'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n if (!empty($config['paths']['src'])) {\n $autoLoadPaths[] = $path . $config['paths']['src'];\n }\n\n if (!empty($config['paths']['configs'])) {\n $configPaths[] = $path . $config['paths']['configs'] . '/';\n }\n\n if (!empty($config['paths']['dependency'])) {\n $dependencyPaths[] = $path . $config['paths']['dependency'];\n }\n\n /*\n * @todo implement extension locales and templates\n\n if (!empty($modCfg['autoloader-psr-4'])) {\n foreach ($modCfg['autoloader-psr-4'] as $ns =>$classPath) {\n $autoLoadPathsPsr4[$ns] = str_replace('./', $path, $classPath);\n }\n }\n\n */\n $this->loadedExtensions[$index]['load'] = true;\n }\n\n // Add autoloader paths\n if (!empty($autoLoadPaths)) {\n $autoloaderConfig = $configStorage->get('autoloader.php');\n $autoloaderCfg = $autoloaderConfig->__toArray();\n $newChain = $autoloaderCfg['priority'];\n\n foreach ($autoLoadPaths as $path) {\n $newChain[] = $path;\n }\n $currentAutoloadPaths = $this->autoloader->getRegisteredPaths();\n foreach ($currentAutoloadPaths as $path) {\n if (!in_array($path, $newChain, true)) {\n $newChain[] = $path;\n }\n }\n\n $autoloaderCfg['psr-4'] = array_merge($autoLoadPathsPsr4, $autoloaderCfg['psr-4']);\n $autoloaderCfg['paths'] = $newChain;\n\n // update autoloader paths\n $this->autoloader->setConfig(['paths' => $autoloaderCfg['paths'], 'psr-4' => $autoloaderCfg['psr-4']]);\n // update main configuration\n $autoloaderConfig->setData($autoloaderCfg);\n }\n // Add Config paths\n if (!empty($configPaths)) {\n $writePath = $configStorage->getWrite();\n $applyPath = $configStorage->getApplyTo();\n\n $paths = $configStorage->getPaths();\n $resultPaths = [];\n\n foreach ($paths as $path) {\n if ($path !== $writePath && $path !== $applyPath) {\n $resultPaths[] = $path;\n }\n }\n foreach ($configPaths as $path) {\n \\array_unshift($resultPaths, $path);\n }\n\n \\array_unshift($resultPaths, $applyPath);\n $resultPaths[] = $writePath;\n $configStorage->replacePaths($resultPaths);\n }\n // register dependencies\n if (!empty($dependencyPaths)) {\n foreach ($dependencyPaths as $file) {\n if ($this->di instanceof DependencyContainer || method_exists($this->di, 'bindArray')) {\n $this->di->bindArray(include $file);\n }\n }\n }\n }", "public function testExtensionLoaded(): void\n {\n $info = $this->createProvider(false)->getInformation();\n $this->assertEquals(true, $info['extension_loaded']);\n }", "private function registerSubscribers()\n {\n $extensions = $this->dataGridFactory->getExtensions();\n\n foreach ($extensions as $extension) {\n $extension->registerSubscribers($this);\n }\n }", "abstract public function getExtensionName();", "protected function createFakeExtension() {}", "public function getExtensions()\n {\n $form = new ChangePasswordType($this->authorizationChecker);\n\n return [\n new PreloadedExtension([$form],[]),\n ];\n }", "public function Extensions($extensions){\r\n foreach($extensions as $extension ){\r\n $this->Extension($extension);\r\n }\r\n }", "public function extension();", "public function getExtensionName() {}", "protected function getExtensions() {\n $listing = new ExtensionDiscovery($this->root);\n // Ensure that tests in all profiles are discovered.\n $listing->setProfileDirectories([]);\n $extensions = $listing->scan('module', TRUE);\n $extensions += $listing->scan('profile', TRUE);\n $extensions += $listing->scan('theme', TRUE);\n return $extensions;\n }", "public function registerExtension(string $extension): void\n {\n if ($this->booted) {\n // We throw an exception here to prevent the developer from registering aa extension after the Kernel has been booted.\n // The reason we do this is because at this point all the source files have already been discovered and parsed.\n // If we allowed new classes after this point, we would have to reboot everything which adds complexity.\n\n throw new BadMethodCallException('Cannot register an extension after the Kernel has been booted.');\n }\n\n if (! is_subclass_of($extension, HydeExtension::class)) {\n // We want to make sure that the extension class extends the HydeExtension class,\n // so that we won't have to check the methods we need to call exist later on.\n\n throw new InvalidArgumentException(\"Extension [$extension] must extend the HydeExtension class.\");\n }\n\n if (in_array($extension, $this->getRegisteredExtensions(), true)) {\n // While throwing an exception here is not required since we are using an associative array,\n // it may be helpful for the developer to know that their registration logic may be flawed.\n\n throw new InvalidArgumentException(\"Extension [$extension] is already registered.\");\n }\n\n $this->extensions[$extension] = new $extension();\n }", "protected function load_extensions()\n\t{\n\t\tif ($this->config_php_file !== null)\n\t\t{\n\t\t\t// Build an intermediate container to load the ext list from the database\n\t\t\t$container_builder = new container_builder($this->phpbb_root_path, $this->php_ext);\n\t\t\t$ext_container = $container_builder\n\t\t\t\t->without_cache()\n\t\t\t\t->without_extensions()\n\t\t\t\t->with_config($this->config_php_file)\n\t\t\t\t->with_config_path($this->get_config_path())\n\t\t\t\t->with_environment('production')\n\t\t\t\t->without_compiled_container()\n\t\t\t\t->get_container()\n\t\t\t;\n\n\t\t\t$ext_container->register('cache.driver', '\\\\phpbb\\\\cache\\\\driver\\\\dummy');\n\t\t\t$ext_container->compile();\n\n\t\t\t$extensions = $ext_container->get('ext.manager')->all_enabled();\n\n\t\t\t// Load each extension found\n\t\t\t$autoloaders = '<?php\n/**\n * Loads all extensions custom auto-loaders.\n *\n * This file has been auto-generated\n * by phpBB while loading the extensions.\n */\n\n';\n\t\t\tforeach ($extensions as $ext_name => $path)\n\t\t\t{\n\t\t\t\t$extension_class = '\\\\' . str_replace('/', '\\\\', $ext_name) . '\\\\di\\\\extension';\n\n\t\t\t\tif (!class_exists($extension_class))\n\t\t\t\t{\n\t\t\t\t\t$extension_class = '\\\\phpbb\\\\extension\\\\di\\\\extension_base';\n\t\t\t\t}\n\n\t\t\t\t$this->container_extensions[] = new $extension_class($ext_name, $path);\n\n\t\t\t\t// Load extension autoloader\n\t\t\t\t$filename = $path . 'vendor/autoload.php';\n\t\t\t\tif (file_exists($filename))\n\t\t\t\t{\n\t\t\t\t\t$autoloaders .= \"require('{$filename}');\\n\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$configCache = new ConfigCache($this->get_autoload_filename(), false);\n\t\t\t$configCache->write($autoloaders);\n\n\t\t\trequire($this->get_autoload_filename());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// To load the extensions we need the database credentials.\n\t\t\t// Automatically disable the extensions if we don't have them.\n\t\t\t$this->use_extensions = false;\n\t\t}\n\t}", "protected function registerExtension()\n {\n $this->app->make('view')->addExtension($this->app->make('twig.extension'), 'twig', function () {\n return $this->app->make('twig.engine');\n });\n }", "public function getExtensions(): array;", "public function getExtension()\n {\n \treturn $this->_extension;\n }", "public function getAllowedExtensions()\n {\n return $this->_allowedExtensions;\n }", "public function getExtension() {\n \n return $this->extension;\n \n }", "public function addCheckExtension($checkExtension) {\n $this->checkExtensions[] = $checkExtension;\n }", "public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }", "public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }", "public function getExtension()\n\t{\n\t\treturn null;\n\t}", "public function getExtension()\n\t{\n\t\treturn null;\n\t}", "public function getExtensions()\n {\n return $this->extensions;\n }", "public function getExtensions()\n {\n return $this->extensions;\n }", "public function getExtensions()\n {\n return $this->extensions;\n }", "public function getExtensions()\n {\n return $this->extensions;\n }", "protected function getContainerExtensions()\n {\n return array(\n new TruelabKottiSecurityExtension()\n );\n }", "function _addInstalledExtension($result) {\r\n\t\t\t$this->_installedExtensions[] = $result;\r\n\t\t}", "protected function registerExtDirectComponents() {}", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "protected function updateExtensionAction() {}", "public static function getExtensions()\n {\n return self::$_extensions;\n }", "function setupExtensionsInstall() {\r\n\t\t\t// We need to find the files to install\r\n\t\t\tif (!$this->_findExtensionFiles()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "private function initializeExtbuilder() {\n $this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n $this->classParser = t3lib_div::makeInstance('Tx_ExtensionBuilder_Utility_ClassParser');\n\t\t$this->roundTripService = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_RoundTrip');\n\t\t$this->classBuilder = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_ClassBuilder');\n\t\t$this->templateParser =t3lib_div::makeInstance('Tx_Fluid_Core_Parser_TemplateParser');\n\t\t$this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n\t\t$this->codeGenerator->setSettings(array(\n\t\t\t\t'codeTemplateRootPath' => PATH_typo3conf.'ext/extension_builder/Resources/Private/CodeTemplates/Extbase/',\n ));\n\n if (class_exists('Tx_Extbase_Object_ObjectManager')) {\n\t\t\t$this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');\n\t\t\t$this->codeGenerator->injectObjectManager($this->objectManager);\n\t\t\t$this->templateParser->injectObjectManager($this->objectManager);\n\t\t}\n\n\t\t$this->roundTripService->injectClassParser($this->classParser);\n\t\t$this->classBuilder->injectRoundtripService($this->roundTripService);\n\t\t$this->codeGenerator->injectTemplateParser($this->templateParser);\n\t\t$this->codeGenerator->injectClassBuilder($this->classBuilder);\n }", "public function getExtension() : string;", "public function getExtension()\n {\n return $this->_extension;\n }", "public function testExtensionBasics()\n {\n $app = $this->getApp(false);\n $extension = new MenueditorExtension($app);\n\n $name = $extension->getName();\n $this->assertSame($name, 'Menueditor');\n $this->assertInstanceOf('\\Bolt\\Extension\\ExtensionInterface', $extension);\n }", "public function getExtension($name) {}", "public function extension()\n\t{\n\t\t$type = $this->type();\n\t\treturn self::getExtension($type);\n\t}", "public function extension($ext)\r\n {\r\n self::getInstance();\r\n $loaded = extension_loaded($ext) ? \"TRUE\" : \"FALSE\";\r\n self::queue(\"Extension Loaded\", \"{$ext}: {$loaded}\");\r\n\r\n return self::$instance;\r\n }", "public function setExtension($ext);", "protected function initializeCompatibilityLoadedExtArray() {}", "public static function getLoadedExtensionListArray() {}" ]
[ "0.7343308", "0.7219582", "0.71467435", "0.6934941", "0.6911223", "0.68460965", "0.6644261", "0.66428065", "0.66148937", "0.66126", "0.6572917", "0.6572773", "0.65639096", "0.6553949", "0.648416", "0.64338577", "0.6432452", "0.6411984", "0.6405628", "0.6402253", "0.63889235", "0.6381076", "0.63765305", "0.63725895", "0.6359706", "0.6352901", "0.6352901", "0.6352901", "0.633399", "0.6320886", "0.62920046", "0.6274983", "0.6266273", "0.62192667", "0.6200267", "0.619334", "0.6155716", "0.6153316", "0.61530864", "0.6151705", "0.61422306", "0.61422306", "0.60963964", "0.6089925", "0.6070192", "0.6064676", "0.6063022", "0.6049582", "0.60196173", "0.60182166", "0.60112256", "0.6002263", "0.59990865", "0.59825635", "0.59817", "0.5975137", "0.5971617", "0.5965204", "0.59517425", "0.59465766", "0.5930791", "0.5928632", "0.59101933", "0.5906693", "0.58964163", "0.58963966", "0.58939683", "0.5893876", "0.58901405", "0.5885896", "0.5875577", "0.5875577", "0.5857343", "0.5857343", "0.5856171", "0.5856171", "0.5856171", "0.5856171", "0.5849641", "0.5849611", "0.5841493", "0.5815663", "0.5815663", "0.5815663", "0.5815663", "0.5815663", "0.5815663", "0.5815663", "0.58017576", "0.5791698", "0.578353", "0.57792515", "0.5765941", "0.57643354", "0.5762563", "0.5757882", "0.5754495", "0.57484037", "0.5740037", "0.57391965", "0.57321846" ]
0.0
-1
TODO: check if it's allready installed
public function installExtension($md5) { $extension = $this->getExtensionNames($md5); $extension[0]->setHash($md5); $this->em->persist($extension[0]); $this->em->flush($extension[0]); if (isset($extension[1])) { $installer = $this->serviceLocator->getByType($extension[1]); $this->em->transactional(function () use ($installer) { $installer->install(); }); $this->em->flush(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function install(){ return true;}", "function install() {}", "public static function install(){\n\t}", "function install(){}", "public function install();", "public function install();", "public function install() {\r\n \r\n }", "function install()\n {\n }", "public function install(){\r\n\t\t\r\n\t}", "public function is_installed() {\n\n }", "public function install(){\n\n return true;\n\n }", "public function install()\n {\n }", "public function install()\n {\n }", "function getInstalled();", "public function isInstalled(){\n return true;\n }", "public function install() {\n\n\n }", "public function preInstall()\n {\n }", "public function beforeInstall()\n\t{}", "public function install()\n\t{\n\t\treturn true;\n\t}", "function insta_f_install(){\n}", "protected function afterInstall()\n {\n }", "public function install(): bool;", "public function afterInstall()\n\t{}", "function test_install(){\n \t}", "public function install () {\n\t\t$this->_log_version_number();\n\t}", "public function install()\n {\n // initialisation successful\n return true;\n }", "protected function get_installed_plugins()\n {\n }", "public function hasInstall();", "public function installPlugin()\n\t{\n\t\treturn true;\t\n\t}", "function install_plugin_information()\n {\n }", "protected function beforeInstall(): bool\n {\n return true;\n }", "function install()\n {\n \t// Creating tables\n\t\t\tinclude('db/tables.php');\n }", "abstract function is_plugin_new_install();", "function wp_installing($is_installing = \\null)\n {\n }", "public function library()\n\t{\n\t\n\t}", "function is_installed()\n{\n return has_account() && has_meta();\n}", "private function _require()\n {\n }", "public function install () {\n $this->_log_version_number();\n }", "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}", "function install_site() {\n \n}", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "public static function installToolEnableFileExists() {}", "public static function is_installed() {\n\t\t\n if (!file_exists(APPPATH . 'config/database.php')) {\n\t\t\treturn false;\n }\n\n if (!file_exists(APPPATH . 'cache')) {\n return false;\n }\n\n $cache = Cache::instance();\n if ($cache->get('njiandan_installed')) {\n return true;\n } else {\n return false;\n }\n }", "function _isInstalled()\n\t{\n\t\t$success = false;\n\t\t\n\t\tjimport('joomla.filesystem.file');\n\t\tif (JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_phplist'.DS.'defines.php')) \n\t\t{\n\t\t\t// Check the registry to see if our Tienda class has been overridden\r\n\t\t\tif ( !class_exists('Phplist') )\r\n\t\t\t\tJLoader::register( \"Phplist\", JPATH_ADMINISTRATOR.DS.\"components\".DS.\"com_phplist\".DS.\"defines.php\" );\r\n\t\t\tif ( !class_exists('PhplistConfigPhplist') )\r\n\t\t\t\tJLoader::register( \"PhplistConfigPhplist\", JPATH_ADMINISTRATOR.DS.\"components\".DS.\"com_phplist\".DS.\"defines.php\" );\r\n\t\t\t\t\n\t\t\t\n\t\t\tPhplist::load( 'PhplistHelperNewsletter', 'helpers.newsletter' );\n\t\t\tPhplist::load( 'PhplistHelperMessage', 'helpers.message' );\n\t\t\tPhplist::load( 'PhplistHelperEmail', 'helpers.email' );\n\t\t\tPhplist::load( 'PhplistHelperPhplist', 'helpers.phplist' );\n\t\t\tPhplist::load( 'PhplistHelperConfigPhplist', 'helpers.configphplist' );\n\t\t\t\n\t\t\t$success = true;\n\t\t}\n\t\t\n\t\tif ($success == true) {\n\t\t\t// Also check that DB is setup\n\t\t\t$database = PhplistHelperPhplist::getDBO();\n\t\t\tif (!isset($database->error)) \n\t\t\t{\n\t\t\t\t$success = true;\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}", "private function isInstalled()\n\t{\n\t\tif(file_exists(ITEMDATA) && file_exists(IM_DATABASE_DIR.IM_DATABASE)){return true;}\n\t\telse return false;\n\t}", "public function allow_auto_install()\n\t{\n\t\treturn TRUE;\n\t}", "public function install()\n {\n $this->installClasses();\n $this->command();\n $this->markInstalled();\n //or call parent::install(); \n }", "abstract public function installPhp();", "function on_install_module($module_name) {\n include('application.setup.php');\n return true;\n }", "public function loadRequirements()\n {\n }", "function __construct() {\n\t\t$this->__checkInstall();\n\t\tparent::__construct();\n\t}", "public function is_installed() {\n return function_exists('solr_get_version');\n }", "function isInstalled() {\r\n return extension_loaded('memcache');\r\n }", "public function install_strings()\n {\n }", "public function install_strings()\n {\n }", "function install($data='') {\r\n parent::install();\r\n }", "function install($data='') {\r\n parent::install();\r\n }", "public function effectively_installed()\n {\n return isset($this->config['oxcom_phpbbch_format_only']);\n }", "public function needsToBeInstalledWithAllDependencies(): bool\n {\n return false;\n }", "function xh_install($db_name)\r\n\t{\r\n\t}", "public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }", "function sloodle_is_installed()\n {\n // Is there a Sloodle entry in the modules table?\n return sloodle_record_exists('modules', 'name', 'sloodle');\n }", "function crepInstallation() {\r\n\t// Check to see if it has already been installed\r\n\tif(get_option('crep-installed') != '1') {\r\n\t\tcrepInsertDefaultOptions();\r\n\t}\r\n}", "function install($data='') {\n parent::install();\n\n\n }", "function unsinstall()\n\t\t{\n\t\t}", "private function setup()\r\n\t{ }", "function InstallFiles() {\n\t\n\t\treturn true;\n\t}", "protected function isInstalled()\n\t{\n\t\treturn File::exists('public/assets/css/bootstrap.min.css') ? true : false;\n\t}", "public function install()\n {\n Configuration::updateValue('MF_TITLE', 'Our Favourite Brands');\n Configuration::updateValue('MF_DESCRIPTION', 'Browse our favourite brands');\n Configuration::updateValue('MF_MAN_NUMBER', 0);\n Configuration::updateValue('MF_PER_ROW_DESKTOP', 4);\n Configuration::updateValue('MF_PER_ROW_TABLET', 3);\n Configuration::updateValue('MF_PER_ROW_MOBILE', 1);\n Configuration::updateValue('MF_MAN_ORDER', 'name_asc');\n Configuration::updateValue('MF_SHOW_MAN_NAME', 0);\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('displayHome');\n }", "function wp_default_packages_vendor($scripts)\n {\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "function install($data='') {\n parent::install();\n }", "public function needs_installing() {\n\t\t$settings = red_get_options();\n\n\t\tif ( $settings['database'] === '' && $this->get_old_version() === false ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function edithistory_is_installed()\n{\n\tglobal $db;\n\tif($db->table_exists(\"edithistory\"))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function startup();", "function fastQuote_install() {\n require_once('fastQuote.settings.php');\n fastQuoteInstaller::install();\n\n rebuild_settings();\n}", "function register_all_installed_packages() {\n\t$pkg_info = get_pkg_info('all', true, true);\n\n\tforeach ($pkg_info as $pkg) {\n\t\tpkg_remove_prefix($pkg['name']);\n\n\t\tif (is_package_installed($pkg['name'])) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tupdate_status(sprintf(gettext(\n\t\t \"Running last steps of %s installation.\") . \"\\n\",\n\t\t $pkg['name']));\n\t\tinstall_package_xml($pkg['name']);\n\t}\n}", "public static function isInstalled(){\n $localxml = BP . DS . self::CLIENT_DIR . DS . self::getClientCode() . DS . 'etc'. DS . 'local.xml';\n \n if(!file_exists($localxml))\n return false;\n\n $xmlObj = new Varien_Simplexml_Config($localxml); \n $date = (string)$xmlObj->getNode('global/install/date');\n if(!strtotime($date))\n return false;\n \n return true;\n }", "function installation () {\n require_once dirname(__FILE__).'/classes/ajax.php';\n new WPUF_Ajax_QR_Code();\n }", "public function install()\n {\n Configuration::updateValue('WI_WEATHER_ENABLED', '0');\n Configuration::updateValue('WI_WEATHER_PROVIDER', '');\n Configuration::updateValue('WI_WEATHER_KEY', '');\n Configuration::updateValue('WI_WEATHER_CITY', '');\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayNav') &&\n $this->registerHook('displayNav1');\n }", "function is_initial_install() : bool {\n\t// Support for PHPUnit & direct calls to install.php.\n\t// phpcs:ignore -- Ignoring requirement for isset on $_SERVER['PHP_SELF'] and wp_unslash().\n\tif ( php_sapi_name() === 'cli' && basename( $_SERVER['PHP_SELF'] ) === 'install.php' ) {\n\t\treturn true;\n\t}\n\n\tif ( ! defined( 'WP_CLI' ) ) {\n\t\treturn false;\n\t}\n\n\t$runner = WP_CLI::get_runner();\n\n\t// Check it's the core command.\n\tif ( $runner->arguments[0] !== 'core' ) {\n\t\treturn false;\n\t}\n\n\t// If it's the is-installed command and --network is set then\n\t// allow MULTISITE to be defined.\n\tif ( $runner->arguments[1] === 'is-installed' && isset( $runner->assoc_args['network'] ) ) {\n\t\treturn false;\n\t}\n\n\t// Check it's an install related command.\n\t$commands = [ 'is-installed', 'install', 'multisite-install', 'multisite-convert' ];\n\tif ( ! in_array( $runner->arguments[1], $commands, true ) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "protected function install()\n {\n $this->modx->runProcessor('workspace/packages/scanLocal');\n $answer = $this->modx->runProcessor('workspace/packages/install',\n ['signature' => join('-', [self::PKG_NAME, self::PKG_VERSION, self::PKG_RELEASE])]\n );\n\n if ($answer) {\n $response = $answer->getResponse();\n echo $response['message'] . PHP_EOL;\n }\n\n $this->modx->getCacheManager()->refresh();\n $this->modx->reloadConfig();\n }", "function isInstalled($moduleName);", "protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}", "public function install()\n {\n Configuration::updateValue('APISFACT_PRESTASHOP_TOKEN', '');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEF', 'F001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROF', '0');\n\n Configuration::updateValue('APISFACT_PRESTASHOP_SERIEB', 'B001');\n Configuration::updateValue('APISFACT_PRESTASHOP_NUMEROB', '0');\n\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayAdminOrderLeft') &&\n $this->registerHook('displayAdminOrderMain');\n }", "public function getInstalledVersion() {}", "private function __construct() {\n // Open source version.\n }", "public function install()\n {\n include(dirname(__FILE__).'/sql/install.php');\n\n return parent::install() &&\n $this->registerHook('header') &&\n $this->registerHook('backOfficeHeader') &&\n $this->registerHook('displayHome');\n }", "public function setup() {}", "function setup() {}", "function myimg_is_installed()\r\n{\r\n global $db, $mybb, $cache;\r\n \r\n\t$info = myimg_info();\r\n $installed = $cache->read(\"poeja_plugins\");\r\n if ($installed[$info['name']]) {\r\n return true;\r\n }\r\n\t\r\n if (isset($mybb->settings['myimg_id'])\r\n && isset($mybb->settings['myimg_api'])\r\n && isset($mybb->settings['myimg_authdomain'])\r\n && isset($mybb->settings['myimg_databaseurl'])\r\n && isset($mybb->settings['myimg_storagebucket'])\r\n && isset($mybb->settings['myimg_messagingsenderid'])\r\n && isset($mybb->settings['myimg_groups'])\r\n && $db->table_exists('myimg')\r\n ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n}", "function amt_wsc_team_install(){\n}", "function getPackagePath() ;", "protected function install() \r\n {\r\n new tablamarcas();\r\n return '';\r\n }", "public function installPhp()\n { \n $this->span(\"Option not supported for this Linux distribution and version.\", 'error');\n }", "function top10_install() {\r\n/* Creates new database field */\r\n//add_option('omekafeedpull_omekaroot', '/omeka', '', 'yes');\r\n}", "public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}", "function bootstrap() {\n\tif ( is_initial_install() ) {\n\t\tdefine( 'WP_INITIAL_INSTALL', true );\n\t\terror_reporting( E_ALL & ~E_STRICT & ~E_DEPRECATED & ~E_USER_WARNING );\n\t}\n}" ]
[ "0.7216974", "0.70817006", "0.7080014", "0.70672673", "0.69406015", "0.69406015", "0.69080216", "0.68557906", "0.6826307", "0.6778526", "0.6753635", "0.6742046", "0.6742046", "0.6688592", "0.66843444", "0.6680182", "0.66611874", "0.66304624", "0.65409654", "0.65337306", "0.6472984", "0.6385364", "0.6279383", "0.6241332", "0.6166878", "0.6147777", "0.61432314", "0.6063102", "0.60495436", "0.6049388", "0.60401046", "0.602415", "0.60223824", "0.6017416", "0.6011016", "0.6005261", "0.59948534", "0.5993443", "0.59309506", "0.59076774", "0.5892505", "0.5891763", "0.5866781", "0.5861829", "0.5858289", "0.5857867", "0.58554316", "0.5834068", "0.5827781", "0.58270866", "0.581788", "0.58164865", "0.5797808", "0.5786264", "0.5786264", "0.5782148", "0.5782148", "0.5775081", "0.5770105", "0.57634723", "0.576223", "0.5759109", "0.5743082", "0.5742267", "0.57265794", "0.57207894", "0.5718838", "0.57105213", "0.5696279", "0.56946254", "0.56879246", "0.56879246", "0.56879246", "0.56879246", "0.56879246", "0.56878614", "0.5687455", "0.5681691", "0.5674548", "0.5674003", "0.5663981", "0.56637776", "0.56603163", "0.5658607", "0.5658193", "0.56581587", "0.56509995", "0.5648682", "0.56340337", "0.56308854", "0.56299263", "0.56287795", "0.5626155", "0.56237984", "0.56181824", "0.5616665", "0.5600371", "0.5596622", "0.5595649", "0.55856514", "0.5583471" ]
0.0
-1
// only send purchase receipt when is paypal, the others are sending their own emails
function getfaircoin_trigger_purchase_receipt( $payment_id ) { remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1 ); // Make sure we don't send a purchase receipt while editing a payment if ( isset( $_POST['edd-action'] ) && 'edit_payment' == $_POST['edd-action'] ) return; $gateway = edd_get_payment_gateway( $payment_id ); if( $gateway == 'paypal'){ // Send email with secure download link edd_email_purchase_receipt( $payment_id ); } else { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function email_buyer_service_purchase(){\n\t\t$data = array('workstream'=>$this,'from' => NOTIFICATION_EMAIL,'from_name' => NOTIFICATION_NAME,'to' =>$this->buyer->email,'fname' =>$this->buyer->fname,'sender_name'=> $this->seller->fname,'subject' => $this->buyer->fname.' your service purchase order is successful.');\n\t\tMail::send('emails.workstream/buyer_service_purchase', $data, function($message) use ($data)\n\t\t{\n\t\t $message->to($data['to'], $data['fname'])->subject($data['subject']);\n\t\t\t$message->from($data['from'],$data['from_name']);\n\t\t});\n\t\treturn TRUE;\n\t\t\n\t}", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "function mailPaymentReceipt($invoice_no,$payment_date=\"\",$payment_amount=0)\n {\n $data_array = array();\n $cycle = $this->props->cycles;\n $temp = $this->BL->invoices->get(\"WHERE `invoice_no`=\".intval($invoice_no));\n $invoice = $temp[0];\n $data_array1= $this->BL->mailWelcome($invoice['order_id'],true);\n $data_array2= $this->BL->invoices->mailInvoice($invoice_no, true, true);\n $data_array = array_merge($data_array1,$data_array2);\n if(empty($payment_date))\n {\n $payment_date = date('Y-m-d');\n }\n if(empty($payment_amount))\n {\n $payment_amount = $invoice['gross_amount'];\n }\n\n if(empty($payment_amount) || empty($invoice_no) || !count($invoice))\n return false;\n\n $reciept_template = $this->BL->emails->getByKey(3);\n $subject = $this->BL->conf['company_name'] . \" \" . $this->props->lang['payment_confirmation'];\n $body = $this->utils->entity_decode($this->utils->htmlspecialchars_decode($reciept_template['email_text']));\n if(!empty($reciept_template['email_subject']))\n {\n $subject = $this->utils->entity_decode($this->utils->htmlspecialchars_decode($reciept_template['email_subject']));\n }\n foreach($invoice as $key=>$data)\n {\n $data_array[$key] = $data;\n }\n $data_array['payment_date'] = $this->BL->fDate($payment_date);\n $data_array['amount_paid'] = $this->BL->toCurrency($payment_amount, null, 1);\n $data_array['due_date'] = $this->BL->fDate($invoice['due_date']);\n $data_array['invoice_no'] = $this->BL->conf['invoice_prefix'] . $invoice['invoice_no'] . $this->BL->conf['invoice_suffix'];\n $data_array['company_email']= $this->BL->conf['comp_email'];\n $data_array['company_name'] = $this->BL->conf['company_name'];\n $data_array['company_address']= $this->BL->conf['company_address'];\n $data_array['description'] = $this->BL->getFriendlyDesc($invoice['desc'],$invoice['sub_id'],$invoice['domain_name']);\n\n $body = $this->BL->etp->parseEmail($data_array,$body);\n $subject= $this->BL->etp->parseEmail($data_array,$subject);\n\n $this->BL->notice_to = $invoice['email'];\n $this->BL->msg = $body;\n $this->BL->ALPmail->AddAddress($invoice['email'], $this->BL->getCustomerFieldValue(\"name\",$invoice['id']));\n $this->BL->ALPmail->AddCC($this->BL->conf['comp_email'], $this->BL->conf['company_name']);\n $this->BL->ALPmail->Subject = $subject;\n $this->BL->ALPmail->Body = $body;\n $return = $this->BL->ALPmail->sendMail();\n $this->BL->runCS('A_PP',$invoice['sub_id'], $invoice['invoice_no']);\n return $return;\n }", "public function sendCart(Mage_Sales_Model_Quote $quote, $email = null, $eventType = null)\n {\n try{\n\n if ($eventType){\n $this->_eventType = $eventType;\n }\n\n if (!$email) {\n if(!$email = $quote->getCustomerEmail()) {\n Mage::logException(\"Unable to post purchase: customer email is not defined.\");\n return false;\n }\n }\n\n $data = array(\n 'email' => $email,\n 'items' => $this->_getItems($quote->getAllVisibleItems()),\n 'incomplete' => 1,\n 'reminder_time' => '+' . Mage::helper('sailthruemail')->getReminderTime() . ' min',\n 'reminder_template' => Mage::getStoreConfig('sailthru/email/abandoned_cart_template', $quote->getStoreId()),\n 'message_id' => $this->getMessageId()\n );\n\n $response = $this->apiPost('purchase', $data);\n\n if (array_key_exists('error',$response)){\n return $this->handleError($response, $quote, $email);\n }\n \n\t\t\t/*****Add product sku in following items for price alert*****/\n $productSku = array();\n\t\t\t/*$sailthru_userdata = $this->apiGet('user', array('id' => $email));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items'])) {\n\t\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t\t$productSku = array_values($sailthru_followingItems);\n\t\t\t}*/\n\t\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n\t\t\t#if($productSku) {\n\t\t\t$productSku = array_unique($productSku);\n\t\t\t$data = array(\n\t\t\t\t\t\"id\" => $email,\n\t\t\t\t\t\"vars\" => array(\"following_items\" => $productSku)\n\t\t\t\t\t);\n\t\t\t$response = $this->apiPost('user', $data);\n\t\t\tif (array_key_exists('error',$response)){\n\t\t\t\treturn $this->handleError($response, $quote, $email);\n\t\t\t}\n\t\t\t#}\n\t\t\t/********************************************************/\n\n\t\t\t\n\t\t\t\n Mage::getSingleton('checkout/session')->setSailthuAbandonedCartId($quote->getId());\n \n return true;\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }", "function paid_sendEmail_owner($details) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\t\t\t\t$sitetitle = \"\";\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Booking Paid Successfully</b></h4>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "function dsf_send_sagepay_mail($savedorder, $address_confirmations=''){\nglobal $basket, $customer_id, $payment, $currencies;\n\n\t\t\t\t\t$good_mail_id = '3';\n\t\t\t\t\t$bad_mail_id = '6';\n\n\n\t\t\t\t\tif ($address_confirmations == 'OK'){ // status OK and addresses OK\n\t\t\t\t\t\t\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }elseif (MODULE_PAYMENT_PROTXCC_CHECK_ADDRESS == 'false'){\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t}elseif ($address_confirmations == 'ALLOW'){ // status OK Adress failed under threshold.\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }else{\n\t\t\t\t\t $email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $bad_mail_id .\"'\");\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\n// lets start with the email confirmation\n\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$email_details = dsf_db_fetch_array($email_query);\n\t\t\t\t\t\t\t\t\t\t$signature_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='1'\");\n\t\t\t\t\t\t\t\t\t $signature_details = dsf_db_fetch_array($signature_query);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_subject = $email_details['subject'];\n\t\t\t\t\t\t\t\t\t $email_footer = $signature_details['details'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// overwrite subject as per Christian emails 2011-09-28\n\t\t\t\t\t\t\t\t\t $email_subject = TRANSLATION_EMAIL_YOUR_ORDER . ' ' . SAP_ORDER_PREFIX . $savedorder->info['id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// plain text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"\\n\\n\" . $email_details['details'] . \"\\n\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t// get products ordered by doing email function.\n\t\t\t\t\t\t\t\t\t $products_ordered = dsf_order_email_items($savedorder, 'true');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= $products_ordered['plain'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= \"\\n\" .EMAIL_SEPARATOR .\"\\n\" . $email_footer;\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \t\t// html\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t $html_order .= $email_details['details'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order .= $products_ordered['html'] . '<br /><br />';\n\t\t\t\t\t\t\t\t\t $html_order .= $email_footer;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $email_order);\n\t\t\t\t\t\t\t\t\t $html_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $html_order);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t // end of email.\n\t\t\t\t\t\t \n\n\n \n\t\t\t\t\t dsf_send_email($savedorder->customer['name'], $savedorder->customer['email_address'], $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_TO != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_DUPLICATE != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_DUPLICATE, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\n\n\n// just for consistancy.\n\nreturn true;\n\n\n\n\n}", "function sendShipmentConfirmationEmail($email_address, $name, $delivery_address, $purchase_id_arr, $auction_title_arr, $auction_qtys_arr, $tracking_num){\r\n\r\n\t\t/* Generate option banner image for dispaly as header of email */\r\n\t\t$banner_image_url = \"\";\t\t\t\t\t\t\t\t\t\t// Shop logo image or similar, eg \"http://farm6.static.flickr.com/123.img\"\r\n\t\t$banner_link = \"<img src=\\\"\".$banner_image_url.\"\\\">\";\r\n\t\tif(strcmp($banner_image_url,\"\") == 0){\t\t\t\t\t\t// If no image url, remove image source tag\r\n\t\t\t$banner_link = \"\";\r\n\t\t}\r\n\r\n\t\t/* Generate tracking url */\r\n\t\t$tracking_num_val = '<a href=\"https://www.nzpost.co.nz/tools/tracking/item/'.$tracking_num.'\">'.$tracking_num.'</a>';\r\n\t\tif(strcmp($tracking_num,\"\") == 0){\t\t\t\t\t\t\t// If tracking box was left empty, then no tracking number\r\n\t\t\t$tracking_num_val = \"none\";\r\n\t\t}\r\n\t\t\r\n\t\t/* Begin HTML email content */\r\n\t\t$content = <<<HEADER\r\n\t\t<html>\r\n\t\t<head>\r\n\t\t</head>\r\n\t\t<body>\r\n\t\t<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\" cellspacing=\"0\">\r\n\t\t<td bgcolor=\"#000000\" colspan=3 height=\"150\" width=\"759\">\r\nHEADER;\r\n\t\t$content .= $banner_link;\r\n\t\t$content .= <<<HEADERCONT\r\n\t\t</td>\r\n\t\t<tr><td bgcolor=\"#7CB342\" height=\"6\" colspan=\"3\"></td></tr>\r\n\t\t<tr><td width=\"7\" bgcolor=\"#7CB342\"></td>\r\n\t\t<td bgcolor=\"#FAFAFA\" style=\"padding:20px\">\r\n\t\t<br>\r\nHEADERCONT;\r\n\r\n\t\t$content .= \"Hi \".$name;\r\n\t\t$content .= <<<MSG\r\n\t\t<br><br>\r\n\t\tGreat news! Your payment has been received, and your item(s) are being prepared for shipping.<br>\r\n\t\tOrders are usually <b>dispatched within 24 hours</b> - Monday to Friday, of receiving this shipping confirmation.<br><br><br>\r\nMSG;\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 16px\" bgcolor=\"#EEEEEE\" cellpadding=\"5\">';\r\n\t\t$pos = 0;\r\n\t\twhile($pos < sizeof($auction_title_arr)){\r\n\t\t\t$content .= \"<tr><td>&nbsp;&nbsp;&nbsp;\".$auction_title_arr[$pos].\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>Qty: \".$auction_qtys_arr[$pos].\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>\".createURLLink($purchase_id_arr[$pos]).\"&nbsp;&nbsp;&nbsp;</td></tr>\";\r\n\t\t\t$pos += 1;\r\n\t\t}\r\n\t\t$content .= '</table><br>';\r\n\r\n\t\t$content .= \"<table><tr><td>\";\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\"><tr><td><b>Delivery address:</b></td></tr></table>';\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\"><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;';\r\n\t\t$pos = 0;\r\n\t\t$addy = str_replace(\"\\n\",\"<br>&nbsp;&nbsp;&nbsp;&nbsp;\",$delivery_address);\r\n\t\t$content .= $addy;\r\n\t\t$content .= '</td></tr></table><br><br>';\r\n\t\t$content .= '</td><td width=\"100\"></td><td>';\r\n\t\t$content .= '<table style=\"font-family:Trebuchet MS, sans-serif; font-size: 14px\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr><td><br>Shipping company:&nbsp;&nbsp;</td><td><br>NZ Post</td></tr>\r\n\t\t\t\t\t <tr><td>Delivery target:</td><td>1 - 3 working days</td></tr>\r\n\t\t\t\t\t <tr><td>Tracking number:</td><td>';\r\n\t\t$content .= $tracking_num_val;\r\n\t\t$content .= \"</td></tr>\r\n\t\t\t\t\t </table><br><br>\";\r\n\t\t$content .= \"</td></tr></table>\";\r\n\r\n\t\t$content .= <<<FOOTER\r\n\t\tThanks for your order<br>\r\n\t\tKind regards<br>\r\n\t\tYour Name\r\n\r\n\t\t</td>\r\n\t\t<td width=\"7\" bgcolor=\"#7CB342\"></td></tr>\r\n\t\t<tr><td bgcolor=\"#7CB342\" height=\"6\" colspan=\"3\"></td></tr>\r\n\t\t</table>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\nFOOTER;\r\n\r\n\t\t/* Generate email subject line */\r\n\t\t$subject_auction_number = 0;\t\t\t\t\t\t\t\t// default for non-Trademe sales\r\n\t\t$pos = 0;\r\n\t\twhile($pos < sizeof($purchase_id_arr)){\r\n\t\t\tif($purchase_id_arr[$pos] != '0'){\r\n\t\t\t\t$subject_auction_number = $purchase_id_arr[$pos];\t// set purchase ID number for email subject, \r\n\t\t\t\t$pos = sizeof($purchase_id_arr);\t\t\t\t\t// use first if more than one\r\n\t\t\t}\r\n\t\t\t$pos += 1;\r\n\t\t}\r\n\r\n\t\t$subject_auction_title = \"\";\t\t\t\t\t\t\t\t// default for non-Trademe sales\r\n\t\t$pos = 0;\r\n\t\twhile($pos < sizeof($auction_title_arr)){\r\n\t\t\tif(strcmp($auction_title_arr[$pos], \"\") != 0){\r\n\t\t\t\t$subject_auction_title = $auction_title_arr[$pos];\t// set auction title for email subject, \r\n\t\t\t\t$pos = sizeof($auction_title_arr);\t\t\t\t\t// use first if more than one\r\n\t\t\t}\r\n\t\t\t$pos += 1;\r\n\t\t}\r\n\r\n\t\t$subject = \"Shipping Confirmation - Trademe #\".$subject_auction_number.\" - \".$subject_auction_title;\r\n\r\n\t\t/* Send Email */\r\n\t\t$email_sent = Send_Email_Content($email_address, $name, $subject, $content);\r\n\r\n\t\treturn $email_sent;\r\n\t}", "function makeReceipt($money, $source_id, $destin_id, $payment_type, $pdo){\n\t\t\n\t\t/**********NOTIFY SYSTEM***********/\n\t\t//Notify shipment service\n\t\tif($payment_type==0) {\n\t\t\t//Send notification that shipping fee has been payed and process tracking number\n\t\t\t\n\t\t}\n\t\t//Notify advertising\n\t\telseif($payment_type==1) {\n\t\t\t//Send notification of the payment completed start advertising product\n\t\t\t\n\t\t}\n\t\t//Notify auction entrance\n\t\telseif($payment_type==2 || $payment_type==4) {\n\t\t\t//Send notification that entrance payment has been made and user can start bidding\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t/**********GENERATE RECEIPT(INSERT INTO DATABASE TABLE)**********/\n\t\tif($payment_type==0) {\n\t\t\t//fetch information from database tables\n\t\t\t //fetch buyer name from customer table\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT user_name from customer where user_id=:userId\");\n\t\t\t\t$stmt->execute([\"userId\"=>$source_id]);\n\t\t\t\t$buyer = $stmt->fetchAll();\n\t\t\t //fecth item name, price, quantity and seller's user_id\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT item_name, price, quantity, user_id from items where item_id=:itemId\");\n\t\t\t\t$stmt->execute([\"itemId\"=>$destin_id]);\n\t\t\t\t$item = $stmt->fetchAll();\n\t\t\t //from above seller user_id fetch seller_name\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT user_name from customer where user_id=:userId\");\n\t\t\t\t$stmt->execute([\"userId\"=>$item[0][\"user_id\"]]);\n\t\t\t\t$seller = $stmt->fetchAll();\n\t\t\t //fetch shipment fee, tracking number and arrival date from shpping\n\t\t\t\t$stmt = $pdo->prepare(\"SELECT shipping_price, tracking_number, arrival_date from shipping where item_id=:itemId\");\n\t\t\t\t$stmt->execute([\"itemId\"=>$destin_id]);\n\t\t\t\t$ship = $stmt->fetchAll();\n\t\t\t//insert values into database table of buyer_reciept\n\t\t\t\t$stmt = $pdo->prepare(\"INSERT INTO buyer_receipt( item_id, item_name, item_cost, item_quantity, \n\t\t\t\t\t\t\t\t\tseller_name, seller_address, user_id, buyer_name, buyer_address, \n\t\t\t\t\t\t\t\t\tshipment_arrival, tracking_number, shipment_fee, total_price) \n\t\t\t\t\t\t\t\t\tVALUES(':item_id',':item_name',:item_cost,:item_quantity,\n\t\t\t\t\t\t\t\t\t':seller_name',':seller_address',':user_id',':buyer_name', ':buyer_address', \n\t\t\t\t\t\t\t\t\t:tracking_number, :shipment_fee, :total_price)\");\n\t\t\t\t$stmt->execute([\"item_id\" =>$destin_id, \"item_name\"=>$item[0][\"item_name\"], \"item_cost\"=>$item[0][\"price\"],\n\t\t\t\t\t\t\t\t\"item_quantity\"=>$item[0][\"quantity\"],\"seller_name\"=>$seller[0][\"user_name\"],\"seller_address\"=>\"seller place\",\n\t\t\t\t\t\t\t\t\"user_id\"=>$source_id,\"buyer_name\"=>$buyer[0][\"user_name\"],\"buyer_address\"=>\"buyer place\",\"tracking_number\"=>$ship[0][\"tracking_number\"],\n\t\t\t\t\t\t\t\t\"shipment_fee\"=>$ship[0][\"shipping_price\"],\"total_price\"=>$money]);\n\t\t\t//insert values into database table of seller_reciept\n\t\t\t\t$stmt = $pdo->prepare(\"INSERT INTO seller_receipt( item_id, item_name, item_cost, item_quantity, \n\t\t\t\t\t\t\t\t\ttime_of_purchase, seller_name, seller_address, user_id, buyer_name, buyer_address)\n\t\t\t\t\t\t\t\t\tVALUES(':item_id',':item_name',:item_cost,:item_quantity,null,\n\t\t\t\t\t\t\t\t\t':seller_name',':seller_address',':user_id',':buyer_name', ':buyer_address')\");\n\t\t\t\t$stmt->execute([\"item_id\" =>$destin_id, \"item_name\"=>$item[0][\"item_name\"], \"item_cost\"=>$item[0][\"price\"],\n\t\t\t\t\t\t\t\t\"item_quantity\"=>$item[0][\"quantity\"],\"seller_name\"=>$seller[0][\"user_name\"],\"seller_address\"=>\"seller place\",\n\t\t\t\t\t\t\t\t\"user_id\"=>$item[0][\"user_id\"],\"buyer_name\"=>$buyer[0][\"user_name\"],\"buyer_address\"=>\"buyer place\"]);\n\t\t}\n\t\t\n\t\t\n\t}", "function emailUserOrder($email, $orderid)\n{\n if(!isset($email)) { return \"<p>Email for sending was empty</p>\"; }\n $validateEmail = validateEmail($email);\n if (!is_bool($validateEmail) || $validateEmail != 1) { return $validateEmail; }\n\n if(!isset($orderid)) { return \"<p>No order id was given to the server in sending a receipt to $email.</p>\"; }\n\n //Need to get order\n $order = getOrder($orderid);\n if(!isset($order) || !is_array($order) || !isset($order['orderid'])) { return \"<p>Couldn't get order details when trying to create email to send receipt to $email.</p>\"; }\n\n //Need to get each inorder of the order:\n $inorders = getAllInOrderForOrder($order['orderid']);\n if(!isset($inorders) || !is_array($inorders)) { return \"<p>Couldn't get ordered products when trying to create email to send receipt to $email.</p>$inorders\"; }\n\n\n //Now generate email\n\n global $siteURL;\n\n //We have a valid email to send a first time hello to\n $subject = \"Order Reciept at H.E.L.P. for order {$order['orderid']}\";\n\n $body = \"<html><body><h1>Hello {$_SESSION['fullName']},</h1>\n\n <p>This email concludes your order with H.E.L.P.</p>\n <p>Below is your receipt:</p>\";\n\n $body .= \"<table><thead><th>Item #</th><th>Product Description</th><th>Quantity</th><th>Price Per</th></thead>\";\n $i = 1;\n foreach($inorders as $inorder)\n {\n $product = getProduct($inorder[1]);\n if(!isset($product) || !is_array($product)) { return \"<p>Couldn't find an item when creating order receipt to send to $email.</p>\"; }\n //print_r($product);\n $body .= \"<tr><td>Item $i: </td><td>\\\"{$product['drugName']}\\\"<td>{$inorder[2]}</td><td>\\${$inorder[3]}</td></tr>\";\n $i++;\n }\n\n //Add order total:\n $body .= \"<tr></tr><tr><td>Total: </td><td>\\$${order['totalPrice']}</td></tr></table>\\n\\n\";\n\n $body .= \"<p>If you did not make this order, please contact the H.E.L.P. support immediately! (Do not reply to this email)</p>\n\n <p>Thank you for shopping at H.E.L.P.! Your order should be shipped within the next few business days.</p>\n <br>\n <p>Sincerely,</p>\n <p>Customer Service at \" . $siteURL .\"</p></body></html>\";\n\n $from = \"help@help.com\";\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-Type: text/html; charset=ISO-8859-1' . \"\\r\\n\";\n $headers .= \"From:$from\\r\\n\";\n\n ini_set('display_errors', 1);\n mail($email, $subject, $body, $headers);\n //echo $body;\n return true;\n}", "function paid_sendEmail_supplier($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidsupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidsupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function sendMailToNotifiyMerchant($observer) {\r\n\r\n //check if Enable out of stock \r\n $enableOutOfStock = Mage::getStoreConfig('Outofstocknotification/general/activate_apptha_outofstock_enable');\r\n\r\n //check if Enable out of stock threshod qty of product stock\r\n $enableOutOfStockAdminNotify = Mage::getStoreConfig('Outofstocknotification/general/merchant_apptha_outofstock_mail');\r\n\r\n // store currency code eg. USD, INR\r\n $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode();\r\n\r\n // store currency symbol eg. $ \r\n $currency_symbol = Mage::app()->getLocale()->currency($currency_code)->getSymbol();\r\n\r\n if (intval($enableOutOfStockAdminNotify) > 0 && intval($enableOutOfStock) > 0) {\r\n\r\n // get threshold qty as mentioned by Merchant\r\n $thresholdQty = Mage::getStoreConfig('Outofstocknotification/general/stocklimit_apptha_outofstock_mail');\r\n\r\n $orderIds = $observer->getData('order_ids');\r\n foreach ($orderIds as $_orderId) {\r\n $order = Mage::getModel('sales/order')->load($_orderId);\r\n $items = $order->getAllItems();\r\n foreach ($items as $itemId => $item) {\r\n $ids[] = $item->getProductId();\r\n }\r\n }\r\n\r\n foreach ($ids as $pid) {\r\n\r\n $products = Mage::getModel('catalog/product')->load($pid);\r\n\r\n $producttype = $products->getTypeId();\r\n\r\n if ($producttype == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { // check if product is configurable\r\n $flag = 1;\r\n } else {\r\n $flag = 0;\r\n }\r\n\r\n\r\n $qty = $products->getStockItem()->getQty();\r\n\r\n if ($thresholdQty >= $qty && $flag != 1) {\r\n\r\n $emailTemplateVariables = array();\r\n\r\n $emailTemplateVariables['productName'] = $products->getName();\r\n $emailTemplateVariables['productPrice'] = $currency_symbol . $products->getPrice();\r\n $emailTemplateVariables['productUrl'] = $products->getProductUrl();\r\n $emailTemplateVariables['productImg'] = $products->getImageUrl();\r\n $emailTemplateVariables['productQty'] = $qty;\r\n $emailTemplateVariables['thresholdQty'] = $thresholdQty;\r\n $emailTemplateVariables['productDesc'] = $products->getDescription();\r\n $marchentNotificationMailId = Mage::getStoreConfig('Outofstocknotification/outofstock_email/outofstock_sender_email_identity');\r\n $senderMailId = Mage::getStoreConfig(\"trans_email/ident_$marchentNotificationMailId/email\");\r\n $senderName = Mage::getStoreConfig(\"trans_email/ident_$marchentNotificationMailId/name\");\r\n $templeId = (int) Mage::getStoreConfig('Outofstocknotification/general/outofstock_admin_template');\r\n\r\n //if it is user template then this process is continue\r\n if ($templeId) {\r\n $emailTemplate = Mage::getModel('core/email_template')->load($templeId);\r\n } else { // we are calling default template\r\n $emailTemplate = Mage::getModel('core/email_template')\r\n ->loadDefault('Outofstocknotification_general_outofstock_admin_template');\r\n }\r\n\r\n $emailTemplateVariables['storeName'] = Mage::getStoreConfig(\"general/store_information/name\");\r\n $emailTemplateVariables['siteLink'] = Mage::getBaseUrl();\r\n\r\n $toMailId = $senderMailId;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n $emailTemplate->setSenderName($senderName); //mail sender name\r\n $emailTemplate->setSenderEmail($senderMailId); //mail sender email id\r\n $emailTemplate->setTemplateSubject('Out of stock Notification from ' . $emailTemplateVariables['storeName']);\r\n $emailTemplate->setDesignConfig(array('area' => 'frontend'));\r\n $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables); //it return the temp body\r\n\t\t\t\t\t\r\n $emailTemplate->send($toMailId, $senderName, $emailTemplateVariables); //send mail to admin email ids\r\n }\r\n }\r\n }\r\n }", "public function SendMailUSers($PrdList,$SellList){\n\t\n\t//echo '<pre>';print_r($SellList->result()); die;\n\t\n\t$shipAddRess = $this->order_model->get_all_details(SHIPPING_ADDRESS,array( 'id' => $PrdList->row()->shippingid ));\n\t\n\t$subject = 'From: '.$this->config->item('email_title').' Product :: Order Confirmation';\n\t$message = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width\"/></head>\n<title>Product Order Confirmation</title>\n<body>\n<div style=\"width:1012px;background:#FFFFFF; margin:0 auto;\">\n<div style=\"width:100%;background:#454B56; float:left; margin:0 auto;\">\n <div style=\"padding:20px 0 10px 15px;float:left; width:50%;\"><a href=\"'.base_url().'\" target=\"_blank\" id=\"logo\"><img src=\"'.base_url().'images/logo/'.$this->data['logo'].'\" alt=\"'.$this->data['WebsiteTitle'].'\" title=\"'.$this->data['WebsiteTitle'].'\"></a></div>\n\t\n</div>\t\t\t\n<!--END OF LOGO-->\n \n <!--start of deal-->\n <div style=\"width:970px;background:#FFFFFF;float:left; padding:20px; border:1px solid #454B56; \">\n \n\t<div style=\" float:right; width:35%; margin-bottom:20px; margin-right:7px;\">\n\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #cecece;\">\n\t\t\t <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:center; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Order Id</span></td>\n <td width=\"100\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$PrdList->row()->dealCodeNumber.'</span></td>\n </tr>\n <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:center; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Order Date</span></td>\n <td width=\"100\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.date(\"F j, Y g:i a\",strtotime($PrdList->row()->created)).'</span></td>\n </tr>\n\t\t\t \n </table>\n \t</div>\n\t\t\n <div style=\"float:left; width:100%;\">\n\t\n <div style=\"width:49%; float:left; border:1px solid #cccccc; margin-right:10px;\">\n \t<span style=\" border-bottom:1px solid #cccccc; background:#f3f3f3; width:95.8%; float:left; padding:10px; font-family:Arial, Helvetica, sans-serif; font-size:13px; font-weight:bold; color:#000305;\">Shipping Address</span>\n \t\t<div style=\"float:left; padding:10px; width:96%; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#030002; line-height:28px;\">\n \t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr><td>Full Name</td><td>:</td><td>'.stripslashes($shipAddRess->row()->full_name).'</td></tr>\n <tr><td>Address</td><td>:</td><td>'.stripslashes($shipAddRess->row()->address1).'</td></tr>\n\t\t\t\t\t<tr><td>Address 2</td><td>:</td><td>'.stripslashes($shipAddRess->row()->address2).'</td></tr>\n\t\t\t\t\t<tr><td>City</td><td>:</td><td>'.stripslashes($shipAddRess->row()->city).'</td></tr>\n\t\t\t\t\t<tr><td>Country</td><td>:</td><td>'.stripslashes($shipAddRess->row()->country).'</td></tr>\n\t\t\t\t\t<tr><td>State</td><td>:</td><td>'.stripslashes($shipAddRess->row()->state).'</td></tr>\n\t\t\t\t\t<tr><td>Zipcode</td><td>:</td><td>'.stripslashes($shipAddRess->row()->postal_code).'</td></tr>\n\t\t\t\t\t<tr><td>Phone Number</td><td>:</td><td>'.stripslashes($shipAddRess->row()->phone).'</td></tr>\n \t</table>\n </div>\n </div>\n \n <div style=\"width:49%; float:left; border:1px solid #cccccc;\">\n \t<span style=\" border-bottom:1px solid #cccccc; background:#f3f3f3; width:95.7%; float:left; padding:10px; font-family:Arial, Helvetica, sans-serif; font-size:13px; font-weight:bold; color:#000305;\">Billing Address</span>\n \t\t<div style=\"float:left; padding:10px; width:96%; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#030002; line-height:28px;\">\n \t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr><td>Full Name</td><td>:</td><td>'.stripslashes($PrdList->row()->full_name).'</td></tr>\n <tr><td>Address</td><td>:</td><td>'.stripslashes($PrdList->row()->address).'</td></tr>\n\t\t\t\t\t<tr><td>Address 2</td><td>:</td><td>'.stripslashes($PrdList->row()->address2).'</td></tr>\n\t\t\t\t\t<tr><td>City</td><td>:</td><td>'.stripslashes($PrdList->row()->city).'</td></tr>\n\t\t\t\t\t<tr><td>Country</td><td>:</td><td>'.stripslashes($PrdList->row()->country).'</td></tr>\n\t\t\t\t\t<tr><td>State</td><td>:</td><td>'.stripslashes($PrdList->row()->state).'</td></tr>\n\t\t\t\t\t<tr><td>Zipcode</td><td>:</td><td>'.stripslashes($PrdList->row()->postal_code).'</td></tr>\n\t\t\t\t\t<tr><td>Phone Number</td><td>:</td><td>'.stripslashes($PrdList->row()->phone_no).'</td></tr>\n \t</table>\n </div>\n </div>\n</div> \n\t \n<div style=\"float:left; width:100%; margin-right:3%; margin-top:10px; font-size:14px; font-weight:normal; line-height:28px; font-family:Arial, Helvetica, sans-serif; color:#000; overflow:hidden;\"> \n\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n \t<td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #cecece; width:99.5%;\">\n <tr bgcolor=\"#f3f3f3\">\n \t<td width=\"17%\" style=\"border-right:1px solid #cecece; text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Bag Items</span></td>\n <td width=\"43%\" style=\"border-right:1px solid #cecece;text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Product Name</span></td>\n <td width=\"12%\" style=\"border-right:1px solid #cecece;text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Qty</span></td>\n <td width=\"14%\" style=\"border-right:1px solid #cecece;text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Unit Price</span></td>\n <td width=\"15%\" style=\"text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Sub Total</span></td>\n </tr>';\t \n\t\t\t\n$disTotal =0; $grantTotal = 0;\nforeach ($PrdList->result() as $cartRow) { $InvImg = @explode(',',$cartRow->image); \n$unitPrice = ($cartRow->price*(0.01*$cartRow->product_tax_cost))+$cartRow->product_shipping_cost+$cartRow->price; \n$uTot = $unitPrice*$cartRow->quantity;\nif($cartRow->attr_name != ''){ $atr = '<br>'.$cartRow->attr_name; }else{ $atr = '';}\n$message.='<tr>\n <td style=\"border-right:1px solid #cecece; text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\"><img src=\"'.base_url().PRODUCTPATH.$InvImg[0].'\" alt=\"'.stripslashes($cartRow->product_name).'\" width=\"70\" /></span></td>\n\t\t\t<td style=\"border-right:1px solid #cecece;text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.stripslashes($cartRow->product_name).$atr.'</span></td>\n <td style=\"border-right:1px solid #cecece;text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.strtoupper($cartRow->quantity).'</span></td>\n <td style=\"border-right:1px solid #cecece;text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.$this->data['currencySymbol'].number_format($unitPrice,2,'.','').'</span></td>\n <td style=\"text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.$this->data['currencySymbol'].number_format($uTot,2,'.','').'</span></td>\n </tr>';\n\t$grantTotal = $grantTotal + $uTot;\n}\n\t$private_total = $grantTotal - $PrdList->row()->discountAmount;\n\t$private_total = $private_total + $PrdList->row()->tax + $PrdList->row()->shippingcost;\n\t\t\t\t \n$message.='</table></td> </tr><tr><td colspan=\"3\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin:10px 0px; width:99.5%;\"><tr>\n\t\t\t<td width=\"460\" valign=\"top\" >';\n\t\t\tif($PrdList->row()->note !=''){\n$message.='<table width=\"97%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>\n <td width=\"87\" ><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:left; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Note:</span></td>\n \n </tr>\n\t\t\t<tr>\n <td width=\"87\" style=\"border:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:left; width:97%; color:#000000; line-height:24px; float:left; margin:10px;\">'.stripslashes($PrdList->row()->note).'</span></td>\n </tr></table>';\n\t\t\t}\n\t\t\t\n\t\t\tif($PrdList->row()->order_gift == 1){\n$message.='<table width=\"97%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-top:10px;\"><tr>\n <td width=\"87\" style=\"border:1px solid #cecece;\"><span style=\"font-size:16px; font-weight:bold; font-family:Arial, Helvetica, sans-serif; text-align:center; width:97%; color:#000000; line-height:24px; float:left; margin:10px;\">This Order is a gift</span></td>\n </tr></table>';\n\t\t\t}\n\t\t\t\n$message.='</td>\n <td width=\"174\" valign=\"top\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #cecece;\">\n <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;border-bottom:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:center; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Sub Total</span></td>\n <td style=\"border-bottom:1px solid #cecece;\" width=\"69\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$this->data['currencySymbol'].number_format($grantTotal,'2','.','').'</span></td>\n </tr>\n\t\t\t<tr>\n <td width=\"87\" style=\"border-right:1px solid #cecece;border-bottom:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:center; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Discount Amount</span></td>\n <td style=\"border-bottom:1px solid #cecece;\" width=\"69\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$this->data['currencySymbol'].number_format($PrdList->row()->discountAmount,'2','.','').'</span></td>\n </tr>\n\t\t<tr bgcolor=\"#f3f3f3\">\n <td width=\"31\" style=\"border-right:1px solid #cecece;border-bottom:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:center; width:100%; color:#000000; line-height:38px; float:left;\">Shipping Cost</span></td>\n <td style=\"border-bottom:1px solid #cecece;\" width=\"69\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$this->data['currencySymbol'].number_format($PrdList->row()->shippingcost,2,'.','').'</span></td>\n </tr>\n\t\t\t <tr>\n <td width=\"31\" style=\"border-right:1px solid #cecece;border-bottom:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; text-align:center; width:100%; color:#000000; line-height:38px; float:left;\">Shipping Tax</span></td>\n <td style=\"border-bottom:1px solid #cecece;\" width=\"69\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$this->data['currencySymbol'].number_format($PrdList->row()->tax ,2,'.','').'</span></td>\n </tr>\n\t\t\t <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">Grand Total</span></td>\n <td width=\"31\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$this->data['currencySymbol'].number_format($private_total,'2','.','').'</span></td>\n </tr>\n </table></td>\n </tr>\n </table></td>\n </tr>\n </table>\n </div>\n \n <!--end of left--> \n\t\t<div style=\"width:50%; float:left;\">\n \t<div style=\"float:left; width:100%;font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; width:100%; color:#000000; line-height:38px; \"><span>'.stripslashes($PrdList->row()->full_name).'</span>,thank you for your purchase.</div>\n <ul style=\"width:100%; margin:10px 0px 0px 0px; padding:0; list-style:none; float:left; font-size:12px; font-weight:normal; line-height:19px; font-family:Arial, Helvetica, sans-serif; color:#000;\">\n <li>If you have any concerns please contact us.</li>\n <li>Email: <span>'.stripslashes($this->data['siteContactMail']).' </span></li>\n </ul>\n \t</div>\n \n <div style=\"width:27.4%; margin-right:5px; float:right;\">\n \n \n </div>\n \n <div style=\"clear:both\"></div>\n \n </div>\n </div></body></html>';\t\n\t\t//echo $message;\n\t\t//echo '<br>'.$PrdList->row()->email;\n\n\t\t\n\t\tif($template_values['sender_name']=='' && $template_values['sender_email']==''){\n\t\t\t$sender_email=$this->config->item('site_contact_mail');\n\t\t\t$sender_name=$this->config->item('email_title');\n\t\t}else{\n\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t$sender_email=$template_values['sender_email'];\n\t\t}\n\n\t\t$email_values = array('mail_type'=>'html',\n\t\t\t\t\t\t\t'from_mail_id'=>$sender_email,\n\t\t\t\t\t\t\t'mail_name'=>$sender_name,\n\t\t\t\t\t\t\t'to_mail_id'=>$PrdList->row()->email,\n\t\t\t\t\t\t\t'cc_mail_id'=>$this->config->item('site_contact_mail'),\n\t\t\t\t\t\t\t'subject_message'=>$subject,\n\t\t\t\t\t\t\t'body_messages'=>$message\n\t\t\t\t\t\t\t);\n\t\t$email_send_to_common = $this->product_model->common_email_send($email_values);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//echo $this->email->print_debugger(); die; \n\t\t\n\t\t/**********************************************seller Product Confirmation Mail Sent ************************************************/\n\t\t\n\t\tforeach($SellList->result() as $sellRow){\n\t\t\n\t\t//echo '<pre>';print_r($sellRow->email);\n\t\t$message1 = '';\n\t\t$subject1 = 'From: Your '.$this->config->item('email_title').' Product :: Order Confirmation';\n\t$message1 = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width\"/></head>\n<title>Product Order Confirmation</title>\n<body>\n<div style=\"width:1012px;background:#FFFFFF; margin:0 auto;\">\n<div style=\"width:100%;background:#454B56; float:left; margin:0 auto;\">\n <div style=\"padding:20px 0 10px 15px;float:left; width:50%;\"><a href=\"'.base_url().'\" target=\"_blank\" id=\"logo\"><img src=\"'.base_url().'images/logo/'.$this->data['logo'].'\" alt=\"'.$this->data['WebsiteTitle'].'\" title=\"'.$this->data['WebsiteTitle'].'\"></a></div>\n\t\n</div>\t\t\t\n<!--END OF LOGO-->\n \n <!--start of deal-->\n <div style=\"width:970px;background:#FFFFFF;float:left; padding:20px; border:1px solid #454B56; \">\n \n\t<div style=\" float:right; width:35%; margin-bottom:20px; margin-right:7px;\">\n\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #cecece;\">\n\t\t\t <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:center; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Order Id</span></td>\n <td width=\"100\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$PrdList->row()->dealCodeNumber.'</span></td>\n </tr>\n <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:center; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Order Date</span></td>\n <td width=\"100\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.date(\"F j, Y g:i a\",strtotime($PrdList->row()->created)).'</span></td>\n </tr>\n\t\t\t \n </table>\n \t</div>\n\t\t\n <div style=\"float:left; width:100%;\">\n\t\n <div style=\"width:49%; float:left; border:1px solid #cccccc; margin-right:10px;\">\n \t<span style=\" border-bottom:1px solid #cccccc; background:#f3f3f3; width:95.8%; float:left; padding:10px; font-family:Arial, Helvetica, sans-serif; font-size:13px; font-weight:bold; color:#000305;\">Shipping Address</span>\n \t\t<div style=\"float:left; padding:10px; width:96%; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#030002; line-height:28px;\">\n \t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr><td>Full Name</td><td>:</td><td>'.stripslashes($shipAddRess->row()->full_name).'</td></tr>\n <tr><td>Address</td><td>:</td><td>'.stripslashes($shipAddRess->row()->address1).'</td></tr>\n\t\t\t\t\t<tr><td>Address 2</td><td>:</td><td>'.stripslashes($shipAddRess->row()->address2).'</td></tr>\n\t\t\t\t\t<tr><td>City</td><td>:</td><td>'.stripslashes($shipAddRess->row()->city).'</td></tr>\n\t\t\t\t\t<tr><td>Country</td><td>:</td><td>'.stripslashes($shipAddRess->row()->country).'</td></tr>\n\t\t\t\t\t<tr><td>State</td><td>:</td><td>'.stripslashes($shipAddRess->row()->state).'</td></tr>\n\t\t\t\t\t<tr><td>Zipcode</td><td>:</td><td>'.stripslashes($shipAddRess->row()->postal_code).'</td></tr>\n\t\t\t\t\t<tr><td>Phone Number</td><td>:</td><td>'.stripslashes($shipAddRess->row()->phone).'</td></tr>\n \t</table>\n </div>\n </div>\n \n <div style=\"width:49%; float:left; border:1px solid #cccccc;\">\n \t<span style=\" border-bottom:1px solid #cccccc; background:#f3f3f3; width:95.7%; float:left; padding:10px; font-family:Arial, Helvetica, sans-serif; font-size:13px; font-weight:bold; color:#000305;\">Billing Address</span>\n \t\t<div style=\"float:left; padding:10px; width:96%; font-family:Arial, Helvetica, sans-serif; font-size:13px; color:#030002; line-height:28px;\">\n \t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n \t<tr><td>Full Name</td><td>:</td><td>'.stripslashes($PrdList->row()->full_name).'</td></tr>\n <tr><td>Address</td><td>:</td><td>'.stripslashes($PrdList->row()->address).'</td></tr>\n\t\t\t\t\t<tr><td>Address 2</td><td>:</td><td>'.stripslashes($PrdList->row()->address2).'</td></tr>\n\t\t\t\t\t<tr><td>City</td><td>:</td><td>'.stripslashes($PrdList->row()->city).'</td></tr>\n\t\t\t\t\t<tr><td>Country</td><td>:</td><td>'.stripslashes($PrdList->row()->country).'</td></tr>\n\t\t\t\t\t<tr><td>State</td><td>:</td><td>'.stripslashes($PrdList->row()->state).'</td></tr>\n\t\t\t\t\t<tr><td>Zipcode</td><td>:</td><td>'.stripslashes($PrdList->row()->postal_code).'</td></tr>\n\t\t\t\t\t<tr><td>Phone Number</td><td>:</td><td>'.stripslashes($PrdList->row()->phone_no).'</td></tr>\n \t</table>\n </div>\n </div>\n</div> \n\t \n<div style=\"float:left; width:100%; margin-right:3%; margin-top:10px; font-size:14px; font-weight:normal; line-height:28px; font-family:Arial, Helvetica, sans-serif; color:#000; overflow:hidden;\"> \n\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n \t<td colspan=\"3\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #cecece; width:99.5%;\">\n <tr bgcolor=\"#f3f3f3\">\n \t<td width=\"17%\" style=\"border-right:1px solid #cecece; text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Bag Items</span></td>\n <td width=\"43%\" style=\"border-right:1px solid #cecece;text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Product Name</span></td>\n <td width=\"12%\" style=\"border-right:1px solid #cecece;text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Qty</span></td>\n <td width=\"14%\" style=\"border-right:1px solid #cecece;text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Unit Price</span></td>\n <td width=\"15%\" style=\"text-align:center;\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center;\">Sub Total</span></td>\n </tr>';\t \n\t\t\t\n$disTotal =0; $grantTotal = 0;\nforeach ($PrdList->result() as $cartRow) { \nif($cartRow->sell_id == $sellRow->sell_id ){\n\n$InvImg = @explode(',',$cartRow->image); \n$unitPrice = ($cartRow->price*(0.01*$cartRow->product_tax_cost))+$cartRow->product_shipping_cost+$cartRow->price; \n$uTot = $unitPrice*$cartRow->quantity;\nif($cartRow->attr_name != ''){ $atr = '<br>'.$cartRow->attr_name; }else{ $atr = '';}\n$message1.='<tr>\n <td style=\"border-right:1px solid #cecece; text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\"><img src=\"'.base_url().PRODUCTPATH.$InvImg[0].'\" alt=\"'.stripslashes($cartRow->product_name).'\" width=\"70\" /></span></td>\n\t\t\t<td style=\"border-right:1px solid #cecece;text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.stripslashes($cartRow->product_name).$atr.'</span></td>\n <td style=\"border-right:1px solid #cecece;text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.strtoupper($cartRow->quantity).'</span></td>\n <td style=\"border-right:1px solid #cecece;text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.$this->data['currencySymbol'].number_format($unitPrice,2,'.','').'</span></td>\n <td style=\"text-align:center;border-top:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:30px; text-align:center;\">'.$this->data['currencySymbol'].number_format($uTot,2,'.','').'</span></td>\n </tr>';\n\t$grantTotal = $grantTotal + $uTot;\n} }\n\t\t\t\t \n$message1.='</table></td> </tr><tr><td colspan=\"3\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\" margin:10px 0px; width:99.5%;\"><tr>\n\t\t\t<td width=\"460\" valign=\"top\" >';\n\t\t\tif($PrdList->row()->note !=''){\n$message1.='<table width=\"97%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>\n <td width=\"87\" ><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:left; width:100%; font-weight:bold; color:#000000; line-height:38px; float:left;\">Note:</span></td>\n \n </tr>\n\t\t\t<tr>\n <td width=\"87\" style=\"border:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; text-align:left; width:97%; color:#000000; line-height:24px; float:left; margin:10px;\">'.stripslashes($PrdList->row()->note).'</span></td>\n </tr></table>';\n\t\t\t}\n\t\t\t\n\t\t\tif($PrdList->row()->order_gift == 1){\n$message1.='<table width=\"97%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin-top:10px;\"><tr>\n <td width=\"87\" style=\"border:1px solid #cecece;\"><span style=\"font-size:16px; font-weight:bold; font-family:Arial, Helvetica, sans-serif; text-align:center; width:97%; color:#000000; line-height:24px; float:left; margin:10px;\">This Order is a gift</span></td>\n </tr></table>';\n\t\t\t}\n\t\t\t\n$message1.='</td>\n <td width=\"174\" valign=\"top\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #cecece;\">\n <tr bgcolor=\"#f3f3f3\">\n <td width=\"87\" style=\"border-right:1px solid #cecece;\"><span style=\"font-size:13px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">Grand Total</span></td>\n <td width=\"31\"><span style=\"font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; color:#000000; line-height:38px; text-align:center; width:100%; float:left;\">'.$this->data['currencySymbol'].number_format($grantTotal,'2','.','').'</span></td>\n </tr>\n </table></td>\n </tr>\n </table></td>\n </tr>\n </table>\n </div>\n \n <!--end of left--> \n\t\t<div style=\"width:50%; float:left;\">\n \t<div style=\"float:left; width:100%;font-size:12px; font-family:Arial, Helvetica, sans-serif; font-weight:normal; width:100%; color:#000000; line-height:38px; \"><span>'.stripslashes($PrdList->row()->full_name).'</span>,thank you for your purchase.</div>\n <ul style=\"width:100%; margin:10px 0px 0px 0px; padding:0; list-style:none; float:left; font-size:12px; font-weight:normal; line-height:19px; font-family:Arial, Helvetica, sans-serif; color:#000;\">\n <li>If you have any concerns please contact us.</li>\n <li>Email: <span>'.stripslashes($this->data['siteContactMail']).' </span></li>\n </ul>\n \t</div>\n \n <div style=\"width:27.4%; margin-right:5px; float:right;\">\n \n \n </div>\n \n <div style=\"clear:both\"></div>\n \n </div>\n </div></body></html>';\t\n\t\n\t\t\n\t\t$email_values1 = array('mail_type'=>'html',\n\t\t\t\t\t\t\t'from_mail_id'=>$this->config->item('site_contact_mail'),\n\t\t\t\t\t\t\t'mail_name'=>$this->config->item('email_title'),\n\t\t\t\t\t\t\t'to_mail_id'=>$sellRow->email,\n\t\t\t\t\t\t\t'subject_message'=>$subject1,\n\t\t\t\t\t\t\t'body_messages'=>$message1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t$email_send_to_common = $this->product_model->common_email_send($email_values1);\n\t\t\n\t}\n\n\t\n\t\treturn;\n\t}", "function mme_send_mail(){\n\tglobal $woocommerce;\n $items = $woocommerce->cart->get_cart();\n //print_r( $items );\n $msg = \"Description\\n\";\n $msg .= \"------------------------------------------------------------\\n\";\n $msg .= \"Name\\t\\tQuantity\\tAmount\\tNetamount\\n\";\n $msg .= \"------------------------------------------------------------\\n\";\n foreach( $items as $item ) {\n $_product = $item[ 'data' ]->post;\n $msg .= $_product->post_title.\"\\t\\t\".$item['quantity'];\n $price = get_post_meta( $item['product_id'] , '_price', true );\n $msg .= \"\\t\\t\".$price;\n $msg .= \"\\t\\t\".$item['line_total'];\n $msg .=\"\\n\";\n }\n $totalamount = floatval( preg_replace( '#[^\\d.]#', '', $woocommerce->cart->get_cart_total() ) );\n $msg .= \"\\n------------------------------------------------------------\\n\";\n $msg .= \"Total amount\\t:\".$totalamount;\n $to = explode( ',', get_option( 'custom_emails' ) );\n $subject = \"Acknowledgement\";\n wp_mail( $to, $subject, $msg );\n}", "public function sendtransactionemails($tranId){\r\n\r\n $bodyhead=\"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\r\n <html xmlns='http://www.w3.org/1999/xhtml'>\r\n <head>\r\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\r\n <title>\".$this->getsettings('sitetitle','text').\"</title>\r\n </head><body>\";\r\n if( $this->getsettings('email','logoshow') == '1' ) {\r\n $body = \"<img src='\".$this->getsettings('logo','url').\"' alt='\".$this->getsettings('sitetitle','text').\"' title='\".$this->getsettings('sitetitle','text').\"'/>\";\r\n }\r\n else {\r\n $body = '';\r\n }\r\n $transactionDetails = $this->CI->DatabaseModel->access_database('ts_paymentdetails','select','',array('payment_id'=>$tranId));\r\n\r\n if( !empty($transactionDetails) ) {\r\n\r\n $userDetails = $this->CI->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$transactionDetails[0]['payment_uid']));\r\n\r\n $custom = trim($transactionDetails[0]['payment_pid']);\r\n $customArr = explode(',',$custom);\r\n\r\n $productStr = '';\r\n for($i=0;$i<count($customArr);$i++) {\r\n\r\n $pId = $customArr[$i];\r\n $findPlan = $this->CI->DatabaseModel->access_database('ts_plans','select','',array('plan_id'=>$pId,'plan_status'=>1));\r\n\r\n $findProduct = $this->CI->DatabaseModel->access_database('ts_products','select','',array('prod_uniqid'=>$pId,'prod_status'=>1));\r\n\r\n if(!empty($findPlan) || !empty($findProduct)) {\r\n if(!empty($findPlan)) {\r\n // Update Plan\r\n $productStr .= '<p> Product Name : '.$findPlan[0]['plan_name'].'</p> <p> Product Amount : '.$this->getsettings('portalcurreny','symbol').' '.$findPlan[0]['plan_amount'].'</p>';\r\n }\r\n\r\n if(!empty($findProduct)) {\r\n // Add Products to purchase\r\n $productStr .= '<p> Product Name : '.$findProduct[0]['prod_name'].'</p> <p> Product Amount : '.$this->getsettings('portalcurreny','symbol').' '.$findProduct[0]['prod_price'].'</p>';\r\n }\r\n\r\n }\r\n }\r\n\r\n $to = $userDetails[0]['user_email'];\r\n $bodyUser = $body;\r\n $bodyUser .=\"<p>Hi \".$userDetails[0]['user_uname'].\",</p> <p> Congratulations, your purchase is successfull. <br/> Below is the product detail : </p> <hr/> \".$productStr.\"<br/><p> Here is the Purchase Code for this transaction : \".$transactionDetails[0]['payment_uniqid'].\"</p> <p> You can get your product from the download section.</p> <p>Thanks, <br/> \".$this->getsettings('sitename','text').\" Team</p>\";\r\n\r\n $bodyAdmin = $body;\r\n $bodyAdmin .=\"<p>Hi Admin,</p> <p> User has done a successfull purchase. <br/> User details who has done the transaction <p> Username : \".$userDetails[0]['user_uname'].\" </p> <p> User Email : \".$userDetails[0]['user_email'].\" </p> <p> Transaction mode : \".$transactionDetails[0]['payment_mode'].\" </p> Below is the product detail : </p> <hr/> \".$productStr.\"<br/><p> Here is the Purchase Code for this transaction : \".$transactionDetails[0]['payment_uniqid'].\"</p> <p> You can get the transaction details from Admin dashboard, transaction history section.</p> <p>Thanks, <br/> \".$this->getsettings('sitename','text').\" Team</p>\";\r\n\r\n $from = $this->getsettings('email','fromname');\r\n $from_add = $this->getsettings('email','fromemail');\r\n $admin_add = $this->getsettings('email','contactemail');\r\n\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\r\n $headers .= \"From: =?UTF-8?B?\". base64_encode($from) .\"?= <$from_add>\\r\\n\" .\r\n 'Reply-To: '.$from_add . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n\r\n $subject = 'Details of purchase on '.$this->getsettings('sitename','text');\r\n\r\n mail($to,$subject,$bodyhead.$bodyUser.'</body></html>',$headers, '-f'.$from_add);\r\n\r\n mail($admin_add,$subject,$bodyhead.$bodyAdmin.'</body></html>',$headers, '-f'.$from_add);\r\n return 1;\r\n }\r\n\r\n\r\n die();\r\n\t}", "function sendPurchaseMail($dealID, $travelerID, $purchaseID, $template) {\n\t\t$this->loadModel('Traveler');\n\t\t$this->loadModel('Venue');\n\t\t$deal = $this->Deal->read(null, $dealID);\n\t\t$dealPurchase = $this->Deal->DealPurchase->read(null, $purchaseID);\n\t\t$venue = $this->Venue->read(null, $deal['Deal']['venue_id']);\n\t\t$traveler = $this->Traveler->read(null, $travelerID); //Used for email address\n\t\t$this->set(compact('deal', 'traveler', 'dealPurchase', 'venue')); //Used for Deal info\n\t\n\t\t$this->Notification->sendHtmlTravelerMail($traveler, $template);\n\t}", "public function sendOrderEmail($orderEmailData) {\r\n\r\n\r\n $sellerIds = array();\r\n $displayProductCommission = Mage::helper('marketplace')->__('Seller Commission Fee');\r\n $displaySellerAmount = Mage::helper('marketplace')->__('Seller Amount');\r\n $displayProductImage = Mage::helper('marketplace')->__('Product Image');\r\n $displayProductName = Mage::helper('marketplace')->__('Product Name');\r\n $displayProductQty = Mage::helper('marketplace')->__('Product QTY');\r\n $displayProductAmt = Mage::helper('marketplace')->__('Product Amount');\r\n $displayProductStatus = Mage::helper('marketplace')->__('Product Status');\r\n foreach ($orderEmailData as $data) {\r\n if (!in_array($data ['seller_id'], $sellerIds)) {\r\n $sellerIds [] = $data ['seller_id'];\r\n }\r\n }\r\n\r\n foreach ($sellerIds as $key => $id) {\r\n $totalProductAmt = $totalCommissionFee = $totalSellerAmt = 0;\r\n $productDetails = '<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"650\" style=\"border:1px solid #eaeaea\">';\r\n $productDetails .= '<thead><tr>';\r\n $productDetails .= '<th align=\"left\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displayProductImage . '</th><th align=\"left\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displayProductName . '</th><th align=\"center\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displayProductQty . '</th><th align=\"center\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displayProductAmt . '</th>';\r\n $productDetails .= '<th align=\"center\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displayProductCommission . '</th><th align=\"center\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displaySellerAmount . '</th><th align=\"center\" bgcolor=\"#EAEAEA\" style=\"font-size:13px;padding:3px 9px;\">' . $displayProductStatus . '</th></tr></thead>';\r\n $productDetails .= '<tbody bgcolor=\"#F6F6F6\">';\r\n $currencySymbol = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();\r\n foreach ($orderEmailData as $data) {\r\n if ($id == $data ['seller_id']) {\r\n $sellerId = $data ['seller_id'];\r\n $incrementId = $data ['increment_id'];\r\n $groupId = Mage::helper('marketplace')->getGroupId();\r\n $productId = $data ['product_id'];\r\n $simpleProductId = $data ['product_id_simple'];\r\n $product = Mage::helper('marketplace/marketplace')->getProductInfo($productId);\r\n $productGroupId = $product->getGroupId();\r\n $productName = $product->getName();\r\n $productamt = $data ['product_amt'] * $data ['product_qty'];\r\n $productStatus = $data['is_buyer_confirmation'];\r\n //$product_img = $product->getImageUrl();\r\n\r\n $content = \"order Details\\n Seller Id \".$sellerId.\"\\n\";\r\n $content .= \"Order Increment Id \".$incrementId.\"\\n\";\r\n $content .= \"Product Name \".$productName.\"\\n\";\r\n $content .= \"Product Amount \".$productamt.\"\\n\";\r\n\r\n\r\n $products_new = Mage::getModel('catalog/product')->load($productId);\r\n $product_img = $products_new->getImageUrl();\r\n if($products_new->getTypeId() == \"configurable\"){\r\n $products_new = Mage::getModel('catalog/product')->load($productId);\r\n if($products_new->getSupplierSku() != \"\"){\r\n $product_sku = $products_new->getSupplierSku();\r\n }else{\r\n $product_sku = $products_new->getSku();\r\n }\r\n $product_img = $products_new->getImageUrl();\r\n $product_color = $products_new->getAttributeText('color');\r\n $product_size = $products_new->getAttributeText('size');\r\n }\r\n else{\r\n if($products_new->getSupplierSku() != \"\"){\r\n $product_sku = $products_new->getSupplierSku();\r\n }else{\r\n $product_sku = $products_new->getSku();\r\n }\r\n $product_color = $products_new->getAttributeText('color');\r\n $product_size = $products_new->getAttributeText('size');\r\n }\r\n if ($product_sku) {\r\n $product_sku = \"<br/>SKU:&nbsp;\" . $product_sku;\r\n }else{\r\n $product_sku=\"\";\r\n }\r\n\r\n if ($product_size) {\r\n $product_size = \"<br/>Size:&nbsp;\" . $product_size;\r\n }else{\r\n $product_size=\"\";\r\n }\r\n\r\n if ($product_color) {\r\n $product_color = \"<br/>Color:&nbsp;\" . $product_color;\r\n\r\n }else{\r\n $product_color=\"\";\r\n }\r\n\r\n //removed echo\r\n $productOptions = $product_sku.$product_size.$product_color;\r\n $productDetails .= '<tr>';\r\n $productDetails .= '<td align=\"cenetr\" valign=\"center\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\"><img src=\"' . $product_img . '\" width=\"70px\"></td><td align=\"left\" valign=\"top\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\">' . $productName . '<br/>'. $productOptions.'</td><td align=\"center\" valign=\"top\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\">' . round($data ['product_qty']) . '</td>';\r\n $productDetails .= '<td align=\"center\" valign=\"top\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\">' . $currencySymbol . round($productamt, 2) . '</td><td align=\"center\" valign=\"top\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\">' . $currencySymbol . round($data ['commission_fee'], 2) . '</td>';\r\n $productDetails .= '<td align=\"center\" valign=\"top\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\">' . $currencySymbol . round($data ['seller_amount'], 2) . '</td>';\r\n $productDetails .= '<td align=\"center\" valign=\"top\" style=\"font-size:11px;padding:3px 9px;border-bottom:1px dotted #cccccc;\">' . $productStatus . '</td>';\r\n\r\n $totalProductAmt = $totalProductAmt + $productamt;\r\n $totalCommissionFee = $totalCommissionFee + $data ['commission_fee'];\r\n $totalSellerAmt = $totalSellerAmt + $data ['seller_amount'];\r\n $orderTotal = $data ['order_total'];\r\n\r\n $customerEmail = $data ['customer_email'];\r\n $customerFirstname = $data ['customer_firstname'];\r\n $productDetails .= '</tr>';\r\n }\r\n }\r\n $productDetails .= '</tbody><tfoot>\r\n <tr><td colspan=\"4\" align=\"right\" style=\"padding:3px 9px\">Seller Commision Fee</td><td align=\"center\" style=\"padding:3px 9px\"><span>' . $currencySymbol . round($totalCommissionFee, 2) . '</span></td></tr>\r\n <tr><td colspan=\"4\" align=\"right\" style=\"padding:3px 9px\">Total Amount</td><td align=\"center\" style=\"padding:3px 9px\"><span>' . $currencySymbol . round($totalProductAmt, 2) . '</span></td></tr>';\r\n $productDetails .= '</tfoot></table>';\r\n\r\n if ($groupId == $productGroupId) {\r\n $templateId = (int) Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification_template_selection');\r\n\r\n $adminEmailId = Mage::getStoreConfig('marketplace/marketplace/admin_email_id');\r\n $toName = Mage::getStoreConfig(\"trans_email/ident_$adminEmailId/name\");\r\n $toMailId = Mage::getStoreConfig(\"trans_email/ident_$adminEmailId/email\");\r\n\r\n if ($templateId) {\r\n $emailTemplate = Mage::helper('marketplace/marketplace')->loadEmailTemplate($templateId);\r\n } else {\r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('marketplace_admin_approval_seller_registration_sales_notification_template_selection');\r\n }\r\n $customer = Mage::helper('marketplace/marketplace')->loadCustomerData($sellerId);\r\n $sellerName = $customer->getName();\r\n $sellerEmail = $customer->getEmail();\r\n $recipient = $toMailId;\r\n $sellerStore = Mage::app()->getStore()->getName();\r\n $recipientSeller = $sellerEmail;\r\n $emailTemplate->setSenderName($toName);\r\n $emailTemplate->setSenderEmail($toMailId);\r\n $emailTemplateVariablesValue = (array(\r\n 'ownername' => $toName,\r\n 'productdetails' => $productDetails,\r\n 'order_id' => $incrementId,\r\n 'seller_store' => $sellerStore,\r\n 'customer_email' => $customerEmail,\r\n 'customer_firstname' => $customerFirstname\r\n ));\r\n $emailTemplate->setDesignConfig(array(\r\n 'area' => 'frontend'\r\n ));\r\n $emailTemplate->getProcessedTemplate($emailTemplateVariablesValue);\r\n /**\r\n * Send email to the recipient\r\n */\r\n $emailTemplate->send($recipient, $toName, $emailTemplateVariablesValue);\r\n $emailTemplateVariablesValue = (array(\r\n 'ownername' => $sellerName,\r\n 'productdetails' => $productDetails,\r\n 'order_id' => $incrementId,\r\n 'seller_store' => $sellerStore,\r\n 'customer_email' => $customerEmail,\r\n 'customer_firstname' => $customerFirstname\r\n ));\r\n\r\n $content .= \"Seller Name \".$sellerName.\"\\n\";\r\n $content .= \"Seller Name \".$sellerName.\"\\n\";\r\n $content .= \"Seller Email \".$sellerEmail.\"\\n\";\r\n $content .= \"Seller Store \".$sellerStore.\"\\n\";\r\n $content .= \"Email Recepient \".$recipientSeller.\"\\n\";\r\n\r\n $emailTemplate->send($recipientSeller, $sellerName, $emailTemplateVariablesValue);\r\n }\r\n }\r\n\r\n }", "function verify_and_retrieve_payment()\r\n\t{\r\n\t\t$email = $_GET['ipn_email']; \r\n\t\t$header = \"\"; \r\n\t\t$emailtext = \"\"; \r\n\t\t// Read the post from PayPal and add 'cmd' \r\n\t\t$req = 'cmd=_notify-validate';\r\n\r\n\t\tif(function_exists('get_magic_quotes_gpc')) \r\n\t\t{ \r\n\t\t\t$get_magic_quotes_exits = true;\r\n\t\t}\r\n\r\n\t\tforeach ($_POST as $key => $value)\r\n\t\t// Handle escape characters, which depends on setting of magic quotes \r\n\t\t{ \r\n\t\t\tif($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode(stripslashes($value)); \r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{ \r\n\t\t\t\t$value = urlencode($value); \r\n\t\t\t} \r\n\t\t \r\n\t\t\t$req .= \"&$key=$value\"; \r\n\t\t} // Post back to PayPal to validate \r\n\t\t \r\n\t\t$header .= \"POST /cgi-bin/webscr HTTP/1.0\\r\\n\"; \r\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\"; \r\n\t\t$header .= \"Content-Length: \" . strlen($req) . \"\\r\\n\\r\\n\"; \r\n\r\n\t\t$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); \r\n\r\n\t\t // Process validation from PayPal\r\n\t\tif (!$fp) \r\n\t\t{ // HTTP ERROR \r\n\t\t} \r\n\t\telse \r\n\t\t{ // NO HTTP ERROR \r\n\t\t\tfputs ($fp, $header . $req); \r\n\t\t \r\n\t\t\twhile (!feof($fp)) \r\n\t\t\t{ \r\n\t\t\t\t$res = fgets ($fp, 1024); \r\n\t\t\t\tif (strcmp ($res, \"VERIFIED\") == 0) \r\n\t\t\t\t{ \r\n\t\t\t\t\t// TODO: // Check the payment_status is Completed \r\n\t\t\t\t\t// Check that txn_id has not been previously processed \r\n\t\t\t\t\t// Check that receiver_email is your Primary PayPal email \r\n\t\t\t\t\t// Check that payment_amount/payment_currency are correct \r\n\t\t\t\t\t// Process payment \r\n\t\t\t\t\t// If 'VERIFIED', send an email of IPN variables and values to the \r\n\t\t\t\t\t// specified email address \r\n\t\t \r\n\t\t\t\t\t$f_result = array( true, $_POST );\r\n\t\t\t\t\t\r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t\t//$emailtext .= $key . \" = \" .$value .\"\\n\\n\";\r\n\t\t\t\t\t//} \r\n\t\t\t \r\n\t\t\t\t\t//mail($email, \"Live-VERIFIED IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t} \r\n\t\t\t\telse if (strcmp ($res, \"INVALID\") == 0) \r\n\t\t\t\t{ // If 'INVALID', send an email. TODO: Log for manual investigation. \r\n\t\t\t\t\t//foreach ($_POST as $key => $value)\r\n\t\t\t\t\t//{ \r\n\t\t\t\t\t//\t$emailtext .= $key . \" = \" .$value .\"\\n\\n\"; \r\n\t\t\t\t\t//} \r\n\t\t\t\t\t\r\n\t\t\t\t\t//mail($email, \"Live-INVALID IPN\", $emailtext . \"\\n\\n\" . $req); \r\n\t\t\t\t\t$f_result = array( false, $_POST );\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t \r\n\t\t\tfclose ($fp); \r\n\t\t}\r\n\t\r\n\t\treturn $f_result;\r\n\t}", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "public function send_order($order_info,$supplier_info) {\n\t\t$attachments = array();\n\t\t$attachments = apply_filters('wc_dropship_manager_send_order_attachments',$attachments,$order_info,$supplier_info); // create a pdf packing slip file\n\t\t$options = get_option( 'wc_dropship_manager' );\n\t\t$text = '';\n\n\t\t$hdrs = array();\n\t\t$hdrs['From'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['To'] = $supplier_info['order_email_addresses'].','.get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['CC'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['Subject'] = 'New Order #'.$order_info['id'].' From '.get_option( 'woocommerce_email_from_name' );\n\t\t$hdrs['Content-Type'] = 'multipart/mixed';\n\t\tif (strlen($supplier_info['account_number']) > 0)\n\t\t{\n\t\t\t$text .= get_option( 'woocommerce_email_from_name' ).' account number: '.$supplier_info['account_number'].'<br/>';\n\t\t}\n\t\t$text = $this->get_packingslip_html($order_info,$supplier_info);\n\t\t$text = $options['email_order_note'] . $text;\n\t\t$html = apply_filters('wc_dropship_manager_send_order_email_html',$text);\n\n\t\t // Filters for the email\n\t\tadd_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tadd_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tadd_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t\twp_mail( $hdrs['To'], $hdrs['Subject'], $html, $hdrs, $attachments );\n\n\t\t// Unhook filters\n\t\tremove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tremove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tremove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t}", "public function testEmail() {\n $items = array(); \n $invoice_details = array();\n $sub_total = 0;\n //$invoice_items = $invoice->invoice_items; //the invoice items object\n //foreach ($invoice_items as $invoice_item) {\n //Item details array\n array_push($items, [\n 'name' => 'Item_1',\n 'price' => '20',\n 'qty' => '1',\n 'carrier_name' => 'Carrier_1',\n 'recharge_number' => '1111111111'\n ]);\n\n $sub_total = 20 * 1;\n //(add discount if needed) \n //}\n\n // Add handling fee\n $handling_fee_val = ((floatval($sub_total) * 0.034) + 0.30);\t\t\t\t\t\t\t\t\t\t\n $handling_fee = number_format($handling_fee_val, 2, '.', '');\t\n $total = $sub_total + $handling_fee;\n\n // customer details\n //$customer_email = User::where('id', $invoice->user_id)->pluck('email');\n $customer_email = 'shafna@witellsolutions.com';\n //dd($customer_email);\n\n $invoice_details = [\n 'customer_email' => $customer_email,\n 'items' => $items,\n 'subtotal' => $sub_total,\n 'handling' => $handling_fee,\n 'total' => $total\n ];\n\n $transaction_details = [\n 'customer_email' => $customer_email,\n 'customer_name' => $customer_name,\n 'items' => $items,\n 'subtotal' => $sub_total,\n 'handling' => $handling_fee,\n 'total' => $total\n ];\n\n //send order email to customer\n Mail::to($customer_email)->send(new CustomerInvoiceMail($invoice_details));\n //send order email to wirelessshop\n Mail::send(new WShopInvoiceMail($transaction_details));\n\n return 'success';\n }", "function storeallpayment(){\n // $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n // $from = \"support@globalfitness.net\";\n // $to = \"labistour@gmail.com\";\n // // $to = \"labistour@gmail.com\";\n // $subject = 'Price Inquiry';\n // $message = $body;\n // $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n\n // mail($to,$subject,$message,$headers);\n\t$piece= implode(\",,,,\",$_SESSION['sale']);\n\t\t$products= implode(\",,,,\",$_SESSION['productDetail']['addtocart']);\n\t\t$userId = $_SESSION['userId'];\n\t\t// print_r($userId);die;\n\t\t$last_id = $this->db->query(\"SELECT ID FROM dbo.order_detail ORDER BY ID DESC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY\")->row();\n\t\t// print_r();die;\n\t\t$new_id = $last_id->ID +1;\n\t\tif(empty($userId) || $userId == 0){\n\t\t\t$userId = 0;\n\t\t\t$_SESSION['userId'] = 0;\n\t\t}\n\n\t$newstring = substr($_SESSION['payment']['cardnumber'], -4);\n\t$data = array(\n\t\t// \"ID\" =>$new_id,\n\t\t'guest_userid'=>$new_id,\n\t\t\"order_date\"=>date(\"Y-m-d h:i:s\"),\n\t\t\t\t\t\"ListID\"=>$products,\n\t\t\t\t\t\"UserId\"=>$userId,\n\t\t\t\t\t\"piece\"=>$piece,\n\t\t\t\t\t\"shippingfirstname\"=>$_SESSION['shipping']['firstname'],\n\t\t\t\t\t\"shippinglastname\"=>$_SESSION['shipping']['lastname'],\n\t\t\t\t\t\"shippingcompanyname\"=>$_SESSION['shipping']['companyname'],\n\t\t\t\t\t\"shippingareacode\"=>$_SESSION['shipping']['areacode'],\n\t\t\t\t\t\"shippingprimaryphone\"=>$_SESSION['shipping']['primaryphone'],\n\t\t\t\t\t\"shippingstreetadress\"=>$_SESSION['shipping']['streetadress'],\n\t\t\t\t\t\"shippingstate\"=>$_SESSION['shipping']['state'],\n\t\t\t\t\t\"shippingcity\"=>$_SESSION['shipping']['city'],\n\t\t\t\t\t\"shippingzipcode\"=>$_SESSION['shipping']['zipcode'],\n\t\t\t\t\t\"shippinghome\"=>$_SESSION['shipping']['home'],\n\t\t\t\t\t\"transactionId\"=>$_SESSION['shipping']['transactionId'],\n\t\t\t\t\t\"billingfirstname\"=>$_SESSION['payment']['firstname'],\n\t\t\t\t\t\"billinglastnames\"=>$_SESSION['payment']['lastnames'],\n\t\t\t\t\t\"billingareacodes\"=>$_SESSION['payment']['areacodes'],\n\t\t\t\t\t\"billingprimaryphone\"=>$_SESSION['payment']['primaryphone'],\n\t\t\t\t\t\"billingemail\"=>$_SESSION['payment']['email'],\n\t\t\t\t\t\"billingcompanys\"=>$_SESSION['payment']['companys'],\n\t\t\t\t\t\"billingstreetadd\"=>$_SESSION['payment']['streetadd'],\n\t\t\t\t\t\"billingsuite\"=>$_SESSION['payment']['suite'],\n\t\t\t\t\t\"billingstates\"=>$_SESSION['payment']['states'],\n\t\t\t\t\t\"billingcity\"=>$_SESSION['payment']['city'],\n\t\t\t\t\t\"billingzipcode\"=>$_SESSION['payment']['zipcode'],\n\t\t\t\t\t\"billingallpayment\"=>$_SESSION['payment']['allpayment'],\n\t\t\t\t\t\"paymenttype\"=>$_SESSION['payment']['paymenttype'],\n\t\t\t\t\t\"cardtype\"=>$_SESSION['payment']['cardtype'],\n\t\t\t\t\t\"cardholder\"=>$_SESSION['payment']['cardholder'],\n\t\t\t\t\t\"cardnumber\"=>$newstring,\n\t\t\t\t\t\"cardcvv\"=>$_SESSION['payment']['cardcvv'],\n\t\t\t\t\t\"cardmonth\"=>$_SESSION['payment']['cardmonth'],\n\t\t\t\t\t\"cardyear\"=>$_SESSION['payment']['cardyear'],\n\t\t\t\t\t\"allshipcharge\"=>$_SESSION['payment']['allshipcharge'],\n\t\t\t\t\t\"allmainpayment\"=>$_SESSION['payment']['allmainpayment'],\n\t\t\t);\n\t\tif(isset($_SESSION['shipping']['buisness'])){\n\t\t\t$data['buisness'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$data['buisness'] = 0;\n\t\t}\n\n\t\t$this->db->insert(\"dbo.order_detail\",$data);\n\t\t$_SESSION['insert_id'] = $this->db->insert_id();\n\t\t\t $order = $this->orderall();\n\n\t$body = \"<p>Thank you for placing your order with Global Fitness!</p>\n <p style=''>This email is to confirm your recent order.</p>\n <p> Date \".date('m/d/Y').\"</p>\n <p> Order Number : \".$order[0]->ID.\" </p>\n \";\n\n if($_SESSION['shipping']['home']!=2)\n {\n\t $body.=\"<p><b>Shipping address</b></p>\n\t\t <p>\".$_SESSION['shipping']['firstname'].\" \".$_SESSION['shipping']['lastname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['areacode'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['shipping']['companyname'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['shipping']['state'].\", \".$_SESSION['shipping']['city'].\" \".$_SESSION['shipping']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n }\n\n $body.=\"<p><b>Billing address</b></p>\n \t\t\t <p>\".$_SESSION['payment']['firstname'].\" \".$_SESSION['payment']['lastnames'].\"</p>\n \t\t\t <p>\".$_SESSION['payment']['areacodes'].\"-\".$_SESSION['shipping']['primaryphone'].\"</p>\n\t\t <p style=''>\".$_SESSION['payment']['companys'].\"</p>\n\t\t <p>\".$_SESSION['payment']['streetadress'].\"</p>\n\t\t <p>\".$_SESSION['payment']['states'].\", \".$_SESSION['payment']['city'].\" \".$_SESSION['payment']['zipcode'].\"</p>\n\t\t <p>United States</p>\n\t\t <p></p>\";\n\n\n\n\n\n for($i=0; $i<$_SESSION['productDetail']['count'];$i++){\n\t $product = $this->Site_model->productdetail($_SESSION['productDetail']['addtocart'][$i]);\n\t\tforeach($product as $live){\n\t\t\t$thisPrice = preg_replace('/[^A-Za-z0-9\\-(.)]/', '', $live->Price);\n\n\t\t\t $body.=\"<p style=''>\".$_SESSION['sale'][$i].\"x \".$live->ProductName.\" for $\".$thisPrice.\" each</p>\";\n\t\t}\n }\n\n\n\n\t$body.=\"<p style=''>Subtotal : $\".$_SESSION['payment']['allmainpayment'].\" USD</p>\n\n <p style=''>Shipping : $\".$_SESSION['payment']['allshipcharge'].\" USD</p>\";\n\n if($_SESSION['shipping']['home']==\"0\"){\n\t\t\t$body.=\"<p style=''>$300 USD White Glove Delivery</p>\";\n\t\t}\n\n $body.=\"<p style=''>Total : $\".$_SESSION['payment']['allpayment'].\" USD</p>\n <p> Please allow 1 - 2 business days to process through our warehouse. Please note that most U.S. orders ship within 3-7 business days from receipt unless contacted by our staff otherwise. </p><p><a href='\".base_url('site/orderall?orderID=').base64_encode($_SESSION['insert_id']).\"'>View Your Order Here.</a></p>\" ;\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"support@globalfitness.net\";\n if (isset($_SESSION['email'])) {\n \t# code...\n \t$to = $_SESSION['email'];\n }else{\n \t$to = $_SESSION['payment']['email'];\n }\n // $cc =\"labistour@gmail.com\";\n $subject = 'Global Fitness Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n //$headers .= 'Bcc: '.$cc.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type:text/html;charset=UTF-8' . \"\\r\\n\";\n\n $from = \"support@globalfitness.net\";\n $to = \"email@globalfitness.net\";\n //$to =\"labistour@gmail.com\";\n $subject = 'Online Order Confirmation';\n $message = $body;\n // More headers\n $headers .= 'From: '.$from. \"\\r\\n\".\"X-Mailer: PHP/\" . phpversion();\n $headers .= 'Bcc: '.$to.\"\\r\\n\";\n mail($to,$subject,$message,$headers);\n\n\n\t\tunset($_SESSION['productDetail']);\n\t\tunset($_SESSION['sale']);\n\t\tunset($_SESSION['shipping']);\n\t\tunset($_SESSION['payment']);\n\t}", "public function successAfter($observer) {\r\n $sellerDefaultCountry = '';\r\n $nationalShippingPrice = $internationalShippingPrice = 0;\r\n $orderIds = $observer->getEvent()->getOrderIds();\r\n $order = Mage::getModel('sales/order')->load($orderIds [0]);\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $getCustomerId = $customer->getId();\r\n $grandTotal = $order->getGrandTotal();\r\n $status = $order->getStatus();\r\n $itemCount = 0;\r\n $shippingCountryId = '';\r\n $items = $order->getAllItems();\r\n $orderEmailData = array();\r\n foreach ($items as $item) {\r\n\r\n $getProductId = $item->getProductId();\r\n $createdAt = $item->getCreatedAt();\r\n $is_buyer_confirmation_date = '0000-00-00 00:00:00';\r\n $paymentMethodCode = $order->getPayment()->getMethodInstance()->getCode();\r\n $products = Mage::helper('marketplace/marketplace')->getProductInfo($getProductId);\r\n $products_new = Mage::getModel('catalog/product')->load($item->getProductId());\r\n if($products_new->getTypeId() == \"configurable\")\r\n {\r\n $options = $item->getProductOptions() ;\r\n\r\n $sku = $options['simple_sku'] ;\r\n $getProductId = Mage::getModel('catalog/product')->getIdBySku($sku);\r\n }\r\n else{\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n\r\n\r\n $sellerId = $products->getSellerId();\r\n $productType = $products->getTypeID();\r\n /**\r\n * Get the shipping active status of seller\r\n */\r\n $sellerShippingEnabled = Mage::getStoreConfig('carriers/apptha/active');\r\n if ($sellerShippingEnabled == 1 && $productType == 'simple') {\r\n /**\r\n * Get the product national shipping price\r\n * and international shipping price\r\n * and shipping country\r\n */\r\n $nationalShippingPrice = $products->getNationalShippingPrice();\r\n $internationalShippingPrice = $products->getInternationalShippingPrice();\r\n $sellerDefaultCountry = $products->getDefaultCountry();\r\n $shippingCountryId = $order->getShippingAddress()->getCountry();\r\n }\r\n /**\r\n * Check seller id has been set\r\n */\r\n if ($sellerId) {\r\n $orderPrice = $item->getBasePrice() * $item->getQtyOrdered();\r\n $productAmt = $item->getBasePrice();\r\n $productQty = $item->getQtyOrdered();\r\n if ($paymentMethodCode == 'paypaladaptive') {\r\n $credited = 1;\r\n } else {\r\n $credited = 0;\r\n }\r\n\r\n /* check for checking if payment method is credit card or cash on delivery and if method\r\n is cash on delivery then it will check if the order status of previous orders are complete or not\r\n no need to disable sending email from admin*/\r\n\r\n /*-----------------Adding Failed Delivery Value--------------------------*/\r\n Mage::helper('progos_ordersedit')->getFailedDeliveryStatus($order);\r\n /*----------------------------------------------------------------------*/\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n $is_buyer_confirmation = 'No';\r\n $is_buyer_confirmation_date = $createdAt;\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n /*\r\n * Elabelz-2057\r\n */\r\n /*$product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();*/\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"):\r\n $counter = $counter + 1;\r\n endif;\r\n }\r\n if ($counter != 0) {\r\n $is_buyer_confirmation = 'Yes';\r\n $is_buyer_confirmation_yes = \"Accepted\";\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n $product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } else {\r\n $is_buyer_confirmation = 'No';\r\n $item_order_status = 'pending';\r\n $tel = $order->getBillingAddress()->getTelephone();\r\n $nexmoActivated = Mage::getStoreConfig('marketplace/nexmo/nexmo_activated');\r\n $nexmoStores = Mage::getStoreConfig('marketplace/nexmo/nexmo_stores');\r\n $nexmoStores = explode(',', $nexmoStores);\r\n $currentStore = Mage::app()->getStore()->getCode();\r\n #check nexmo sms module is active or not and check on which store its enabled\r\n $reservedOrderId = $order->getIncrementId();\r\n $mdlEmapi = Mage::getModel('restmob/quote_index');\r\n $id = $mdlEmapi->getIdByReserveId($reservedOrderId);\r\n if ($nexmoActivated == 1 && in_array($currentStore, $nexmoStores) && !$id) {\r\n # code...\r\n $data = Mage::helper('marketplace/marketplace')->sendVerify($tel);\r\n $data = $data['request_id'];\r\n\r\n }\r\n //$data = 0;\r\n\r\n }\r\n }\r\n\r\n\r\n // $orderPriceToCalculateCommision = $products_new->getPrice() * $item->getQtyOrdered();\r\n $shippingPrice = Mage::helper('marketplace/market')->getShippingPrice($sellerDefaultCountry, $shippingCountryId, $orderPrice, $nationalShippingPrice, $internationalShippingPrice, $productQty);\r\n /**\r\n * Getting seller commission percent\r\n */\r\n $sellerCollection = Mage::helper('marketplace/marketplace')->getSellerCollection($sellerId);\r\n $percentperproduct = $sellerCollection ['commission'];\r\n $commissionFee = $orderPrice * ($percentperproduct / 100);\r\n\r\n // Product price after deducting\r\n // $productAmt = $products_new->getPrice() - $commissionFee;\r\n\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n\r\n if($item->getProductType() == 'simple')\r\n {\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n /**\r\n * Storing commission information in database table\r\n */\r\n\r\n if ($commissionFee > 0 || $sellerAmount > 0) {\r\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($getProductId);\r\n $parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);\r\n\r\n if ($parent_product->getSpecialPrice()) {\r\n $orderPrice_sp = $parent_product->getSpecialPrice() * $item->getQtyOrdered();\r\n $orderPrice_base = $parent_product->getPrice() * $item->getQtyOrdered();\r\n\r\n $commissionFee = $orderPrice_sp * ($percentperproduct / 100);\r\n $sellerAmount = $orderPrice_sp - $commissionFee;\r\n } else {\r\n $orderPrice_base = $item->getBasePrice() * $item->getQtyOrdered();\r\n $commissionFee = $orderPrice_base * ($percentperproduct / 100);\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n }\r\n\r\n $commissionDataArr = array(\r\n 'seller_id' => $sellerId,\r\n 'product_id' => $getProductId,\r\n 'product_qty' => $productQty,\r\n 'product_amt' => $productAmt,\r\n 'commission_fee' => $commissionFee,\r\n 'seller_amount' => $sellerAmount,\r\n 'order_id' => $order->getId(),\r\n 'increment_id' => $order->getIncrementId(),\r\n 'order_total' => $grandTotal,\r\n 'order_status' => $status,\r\n 'credited' => $credited,\r\n 'customer_id' => $getCustomerId,\r\n 'status' => 1,\r\n 'created_at' => $createdAt,\r\n 'payment_method' => $paymentMethodCode,\r\n 'item_order_status' => $item_order_status,\r\n 'is_buyer_confirmation' => $is_buyer_confirmation,\r\n 'sms_verify_code' => $data,\r\n 'is_buyer_confirmation_date'=> $is_buyer_confirmation_date,\r\n 'is_seller_confirmation_date'=> '0000-00-00 00:00:00',\r\n 'shipped_from_elabelz_date'=> '0000-00-00 00:00:00',\r\n 'successful_non_refundable_date'=> '0000-00-00 00:00:00',\r\n 'commission_percentage' => $sellerCollection ['commission']\r\n );\r\n\r\n $commissionId = $this->storeCommissionData($commissionDataArr);\r\n $orderEmailData [$itemCount] ['seller_id'] = $sellerId;\r\n $orderEmailData [$itemCount] ['product_qty'] = $productQty;\r\n $orderEmailData [$itemCount] ['product_id'] = $getProductId;\r\n $orderEmailData [$itemCount] ['product_amt'] = $productAmt;\r\n $orderEmailData [$itemCount] ['commission_fee'] = $commissionFee;\r\n $orderEmailData [$itemCount] ['seller_amount'] = $sellerAmount;\r\n $orderEmailData [$itemCount] ['increment_id'] = $order->getIncrementId();\r\n $orderEmailData [$itemCount] ['customer_firstname'] = $order->getCustomerFirstname();\r\n $orderEmailData [$itemCount] ['customer_email'] = $order->getCustomerEmail();\r\n $orderEmailData [$itemCount] ['product_id_simple'] = $getProductId;\r\n $orderEmailData [$itemCount] ['is_buyer_confirmation'] = $is_buyer_confirmation_yes;\r\n $orderEmailData [$itemCount] ['itemCount'] = $itemCount;\r\n $itemCount = $itemCount + 1;\r\n }\r\n }\r\n // if ($paymentMethodCode == 'paypaladaptive') {\r\n // $this->updateCommissionPA($commissionId);\r\n // }\r\n }\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n /*if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n $this->sendOrderEmail($orderEmailData);\r\n }*/\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"){\r\n $counter = $counter + 1;\r\n }\r\n }\r\n if ($counter != 0) {\r\n if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n\r\n $this->sendOrderEmail($orderEmailData);\r\n }\r\n }\r\n }\r\n\r\n //$this->enqueueDataToFareye($observer);\r\n\r\n }", "function afterPaypalNotification($txnId){\r\n //for example, you could now mark an order as paid, a subscription, or give the user premium access.\r\n //retrieve the transaction using the txnId passed and apply whatever logic your site needs.\r\n \r\n $transaction = ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->findById($txnId);\r\n $this->log(\"transsaction: \" . $transaction['InstantPaymentNotification']['id'] . \r\n \" Order ID: \" . $transaction['InstantPaymentNotification']['custom'], 'paypal');\r\n\r\n //Tip: be sure to check the payment_status is complete because failure transactions \r\n // are also saved to your database for review.\r\n\r\n if($transaction['InstantPaymentNotification']['payment_status'] == 'Completed'){\r\n App::import('Model', 'Order');\r\n $thisOrder = new Order;\r\n $thisOrder->read(null, $transaction['InstantPaymentNotification']['custom']);\r\n\t\t\t$thisOrder->set(array('is_paid' => 1, 'status_id' =>TYPE_ORDER_PAID));\r\n\t\t\t$thisOrder->save();\r\n\r\n $thisOrder->unbindModel(array('belongsTo' => array('Status', 'Invoice')));\r\n\t\t$thisOrder->User->unbindModel(array(\r\n\t\t\t'hasAndBelongsToMany' => array('Group'),\r\n\t\t\t'hasMany' => array('Contact', 'Order'),\r\n\t\t\t'hasOne' => array('Supplier')\r\n\t\t));\r\n\t\t$thisOrder->hasAndBelongsToMany['Product']['fields'] = array('id', 'name', 'serial_no');\r\n\t\t$thisOrder->Product->unbindModel(array(\r\n\t\t\t\t'hasMany' => array('Media', 'Document', 'Feature'),\r\n\t\t\t\t'hasAndBelongsToMany' => array('Category', 'Type')\r\n\t\t));\r\n\t\t$thisOrder->Product->hasMany['Image']['conditions']['is_default'] = 1;\r\n\r\n\t\t$params = array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Order.id' => $transaction['InstantPaymentNotification']['custom'],\r\n\t\t\t\t\t'Order.status_id' => TYPE_ORDER_PAID\r\n\t\t\t\t),\r\n\t\t\t\t'recursive' => 2\r\n\t\t);\r\n\t\tif ($order = $thisOrder->find('first', $params)) {\r\n\t\t\t$this->sendPaymentEmail($order);\r\n\t\t}\r\n }\r\n else {\r\n //Oh no, better look at this transaction to determine what to do; like email a decline letter.\r\n }\r\n }", "function payment_success()\n {\n\t\t\t/*log_message('INFO', 'Inside order2/payment_success');\n\t\t\t$this->morder->equateProductsQuantities();\n\t\t\tlog_message('INFO', 'end equateProductsQuantities()______________________________________________________');*/\n\t\t\t/* END ADDED BY SHAMMI SHAILAJ */\n\t\t\t\n //print \"<p>inside payments success</p>\";\n include('header_include.php');\n $data['email'] = $this->session->userdata('email');\n $this->session->unset_userdata('email');\n $txnid= $this->session->userdata('e_txn_id');\n $data['transID'] = $txnid;\n //print \"<p>transID = \".$txnid.\"</p>\";\n if(is_null($this->session->userdata('e_txn_id')) || strcmp($this->session->userdata('e_txn_id'), \"\") === 0)\n {\n $data['transID'] = NULL;\n }\n $this->session->unset_userdata('e_txn_id');\n \n //purchase email\n $this->load->model('vc_orders');\n /* following code added by shammi to generate data for sokrati and ecommerce tracking */\n if(!is_null($data['transID']))\n {\n $transDataDB = $this->vc_orders->orderDetails($data['transID']);\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n //exit();\n if($transDataDB !== FALSE)\n {\n $data['prodsCount'] = count($transDataDB);\n $data ['buyerFName'] = $transDataDB[0]->shipping_fname;\n $data ['buyerLName'] = $transDataDB[0]->shipping_lname;\n $data['buyerAddress'] = $transDataDB[0]->shipping_address;\n $data['buyerCity'] = $transDataDB[0]->shipping_city;\n $data['buyerPinCode'] = $transDataDB[0]->shipping_pincode;\n $data['buyerState'] = $transDataDB[0]->shipping_state;\n $data['buyerCountry'] = $transDataDB[0]->shipping_country;\n $data['buyerUserID'] = $transDataDB[0]->user_id;\n $data['tax'] = 0;\n $grandTotal = 0;\n $products = array();\n if(is_array($products))\n {\n for($j=0;$j < $data['prodsCount']; $j++)\n {\n $product = new productInfo;\n $product->storeID = $transDataDB[$j]->store_id;\n $product->storeName = $transDataDB[$j]->store_name;\n $order_no = $transDataDB[$j]->order_id;\n $product->orderID = $transDataDB[$j]->order_id;\n $product->productName = $transDataDB[$j]->product_name;\n $product->vSize = $transDataDB[$j]->vsize;\n $product->vColor = $transDataDB[$j]->vcolor;\n $product->unitPrice = $transDataDB[$j]->amt_paid;\n $product->quantity = $transDataDB[$j]->quantity;\n $grandTotal += $transDataDB[$j]->amt_paid * $transDataDB[$j]->quantity;\n $product->productID = $transDataDB[$j]->product_id; \n $product->cid = $transDataDB[$j]->couponid;\n $products[$j] = $product;\n /* ADDED BY SHAMMI SHAILAJ to keep quantities in the new and old products table EQUAL (NEW METHOD)*/\n\t\t\t\t\t\t\t//log_message('INFO', 'Inside order2/payment_success');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' => 1, 'msg' => 'Inside order2/payment_success'));\n\t\t\t\t\t\t\t$this->morder->equateProductsQuantities2($product->productID);\n\t\t\t\t\t\t\t//log_message('INFO', 'end equateProductsQuantities2()______________________________________________________');\n\t\t\t\t\t\t\t$this->load->model('slog');\n\t\t\t\t\t\t\t$this->slog->write(array('level' =>1, 'msg' => 'end equateProductsQuantities2()______________________________________________________'));\n /* END ADDED BY SHAMMI SHAILAJ */\n }\n }\n else\n {\n $product = new productInfo;\n $product->storeID = $transDataDB->store_id;\n $product->storeName = $transDataDB->store_name;\n $order_no = $transDataDB->order_id;\n $product->orderID = $transDataDB->order_id;\n $product->productName = $transDataDB->product_name;\n $product->vSize = $transDataDB->vsize;\n $product->vColor = $transDataDB->vcolor;\n $product->unitPrice = $transDataDB->amt_paid;\n $product->quantity = $transDataDB->quantity;\n $product->productID = $transDataDB->product_id;\n $product->cid = $transDataDB->couponid;\n $grandTotal += $transDataDB->amt_paid * $transDataDB->quantity;\n $products[] = $product;\n }\n $data['grandTotal'] = $grandTotal;\n $data['products'] = $products;\n }\n //print \"<pre>\";print_r($transDataDB);print \"</pre>\";\n }\n /* end code added by shammi to generate data for sokrati and ecommerce tracking */\n $base_url = base_url();\n $ip_address = (string)$this->input->ip_address();\n //log_message('Info',\"Ipaddress = $ip_address\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Ipaddress = $ip_address\"));\n if($ip_address!='127.0.0.1')\n {\n //log_message('Info',\"Allow mail as the Ip is not 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' =>1, 'msg' => \"Allow mail as the Ip is not 127.0.0.1\"));\n $mail_info = $this->vc_orders->purchaseMailDetails($txnid);\n $this->slog->write(array('level' =>1 ,'msg' => \"mail_info FROM ORDERS2/PAYMENT_SUCCESS_____\".print_r($mail_info, TRUE)));\n if($mail_info!=0)\n {\n $count_prod = count($mail_info);\n $buyer_name = $mail_info[0]['shipping_fname'].' '.$mail_info[0]['shipping_lname'];\n $shipping_address = $mail_info[0]['shipping_address'];\n $shipping_city = $mail_info[0]['shipping_city'];\n $pin_code = $mail_info[0]['shipping_pincode'];\n $couponcode = $mail_info[0]['couponid'];\n $payment_mode = $mail_info[0]['pg_type'];\n if ($payment_mode=='COD')\n {\n $payment_mode = 'Cash on Delivery';\n }\n elseif ($payment_mode=='CC')\n {\n $payment_mode = 'Credit Card';\n }\n elseif ($payment_mode=='DC')\n {\n $payment_mode = 'Debit Card';\n }\n elseif ($payment_mode=='NB')\n {\n $payment_mode = 'Net Banking';\n }\n \n for($j=0;$j<$count_prod;$j++)\n {\n $order_no = $mail_info[$j]['order_id'];\n $product_name = $mail_info[$j]['product_name'];\n $variant_size = \"Size: \".$mail_info[$j]['variant_size'];\n $variant_color = \"Color: \".$mail_info[$j]['variant_color'];\n $variant_details = \"\";\n $this->slog->write(array('level' => 1,'msg' => \"INDEX MAIL VALUE\".print_r($mail_info[$j]['sent_email_id'],TRUE)));\n if ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \"\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']==\"0\")\n {\n $variant_details = \" - (\".$variant_size.\")\";\n }\n elseif ($mail_info[$j]['variant_size']==\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_color.\")\";\n }\n elseif ($mail_info[$j]['variant_size']!=\"0\" and $mail_info[$j]['variant_color']!=\"0\")\n {\n $variant_details = \" - (\".$variant_size.\",\".$variant_color.\")\";\n }\n $process_days = (int)$mail_info[$j]['process_days'];\n $productImagePath = './assets/images/stores/'.$mail_info[$j]['store_id'].'/'.$mail_info[$j]['product_id'].'/';\n if(file_exists($productImagePath.'fancy3.jpg'))\n {\n $productImage = $productImagePath.'fancy3.jpg';\n }\n elseif(file_exists($productImagePath.'fancy3.JPG'))\n {\n $productImage = $productImagePath.'fancy3.JPG';\n }\n else\n {\n $productImage = '';\n }\n //log_message('INFO', 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => 'NOW queueing buyer EMAIL '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']));\n include 'mail_4.php';\n //Buyer Purchase Email\n $this->load->model('automate_model');\n\t\t\t\t\t\t\t$jobType = 1; // an email job\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate email\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 66); // current time + 1 minute 6 seconds\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => $mail_info[$j]['sent_email_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => 'neworders@buynbrag.com,shammishailaj@gmail.com',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $purchase_message\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>An Email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A (P)', $jobScheduledTime).\" </p>\" ) );\n\n\t\t\t\t\t\t\t$smsMsg = \"Dear \".$mail_info[$j]['shipping_fname'].' '.$mail_info[$j]['shipping_lname'].\", \\r\\n Thank you for placing an order with us. Your order ID \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$smsMsg .= \" will be dispatched by \".date( \"d-M-Y\", ( strtotime($mail_info[$j]['date_of_pickup']) ) ).\". Once dispatched, it will reach you in 1-5 working days. Contact us on +91-8130878822 or ops@buynbrag.com \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$smsNo = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\tif($smsNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$smsNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->load->model('smsc');\n\t\t\t\t\t\t\t$this->smsc->sendSMS($smsNo, $smsMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent an SMS to '.json_encode($smsNo).'. The msg sent is <p>'.$smsMsg.'</p>' ) );\n\n\t\t\t\t\t\t\t// now set an email job to be executed only after 24 hours if the seller has not sent the mail\n\t\t\t\t\t\t\t$orderEmail11Data = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerName'] = $mail_info[$j]['owner_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['orderID'] = $mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['dispatchDate'] = $mail_info[$j]['date_of_pickup'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeOwnerEmail'] = $mail_info[$j]['contact_email'];\n\t\t\t\t\t\t\t$orderEmail11Data['storeName'] = $mail_info[$j]['store_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productName'] = $mail_info[$j]['product_name'];\n\t\t\t\t\t\t\t$orderEmail11Data['productID'] = $mail_info[$j]['product_id'];\n\t\t\t\t\t\t\t$orderEmail11Data['bnbProductCode'] = $mail_info[$j]['bnb_product_code'];\n\t\t\t\t\t\t\t$orderEmail11Data['amountPaid'] = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n\t\t\t\t\t\t\t$orderEmail11Data['paymentType'] = $mail_info[$j]['pg_type'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerName'] = $mail_info[$j]['shipping_fname'].\" \".$mail_info[$j]['shipping_lname'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerAddress'] = $mail_info[$j]['shipping_address'].\"<br/>\".$mail_info[$j]['shipping_city'].\"<br/>\".$mail_info[$j]['shipping_pincode'];\n\t\t\t\t\t\t\t$orderEmail11Data['buyerContactNumber'] = $mail_info[$j]['shipping_phoneno'];\n\t\t\t\t\t\t\t$orderEmail11Data['processingTime'] = $mail_info[$j]['process_days'];\n\n\t\t\t\t\t\t\t$orderEmail11 = $this->load->view('emailers/orderEmail11', $orderEmail11Data, TRUE);\n\n\t\t\t\t\t\t\t$jobType = 4; // a check and then send email job depending upon the result of the check\n\t\t\t\t\t\t\t$jobCommand = \"/usr/bin/php5 \".__DIR__.\"/../../index.php automate index\";\n\t\t\t\t\t\t\t/* $jobScheduledTime = mktime(20, 37, 00, 10, 21, 2013); // 4:35:00 pm 12th October 2013 */\n\t\t\t\t\t\t\t$jobScheduledTime = (time() + 86460); // current time + 1 day (24 hrs 1 minute)\n\t\t\t\t\t\t\t$jobDetails = array\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t'orderID' => $order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'to' => ( (empty($mail_info[$j]['contact_email']) )? $mail_info[$j]['contact_email'] : 'ops@buynbrag.com'),\n\t\t\t\t\t\t\t\t\t\t\t\t'bcc' => 'ops@buynbrag.com,prt@buynbrag.com,shammishailaj@gmail.com',\n\t\t\t\t\t\t\t\t\t\t\t\t'subject' => \"Your order with BuynBrag.com for order ID \".$order_no,\n\t\t\t\t\t\t\t\t\t\t\t\t'msg' => $orderEmail11\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->automate_model->createJob($jobType, $jobCommand, $jobScheduledTime, $jobDetails);\n\t\t\t\t\t\t\t$this->slog->write( array('level' => 1, 'msg' => \"<p>A check and then email job has been created and will be executed on or after \".date('l, F jS, Y', $jobScheduledTime).\" at \".date('g:i:s A T (P)', $jobScheduledTime).\" </p>\" ) );\n\t\t\t\t\t\t\t/* OLD EMAIL SENDING CODE\n $this->load->library('email');\n $mailArraylog = array();\n $this->email->from('support@buynbrag.com','BuynBrag');\n $this->email->to($mail_info[$j]['sent_email_id']);\n $this->email->bcc('neworders@buynbrag.com,shammishailaj@gmail.com');\n $this->email->subject(\"BuynBrag: Order Success,Order Id:$order_no\");\n\n $this->email->message($purchase_message);\n $this->email->set_newline(\"\\r\\n\");\n if($this->email->send())\n {\n log_message('Info', 'SUCCESSFULLY SENT EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n $mailArraylog = array('level' => 1, 'send status' => 1,'to' => $mail_info[$j]['sent_email_id'],'bcc' =>'neworders@buynbrag.com,shammishailaj@gmail.com','From' => 'support@buynbrag.com','mail content' => $purchase_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog);\n }\n else\n {\n log_message('Info', 'FAILED SENDING EMAIL to buyer '.$mail_info[$j]['sent_email_id'].' for order no '.$mail_info[$j]['order_id']);\n }*/\n\n //////////////////////////////\n $owner_name = $mail_info[$j]['owner_name'];\n $owner_email = $mail_info[$j]['contact_email'];\n $total_amount = $mail_info[$j]['amt_paid'] * $mail_info[$j]['quantity'];\n include 'mail_7.php';\n\n $sellerSMSMsg = \"Dear \".$mail_info[$j]['owner_name'].\", \\r\\n You have recieved a new order for \".$mail_info[$j]['product_name'].\". The order ID is \".$mail_info[$j]['order_id'];\n\t\t\t\t\t\t\t$sellerSMSMsg .= \" and the quantity ordered is \".$mail_info[$j]['quantity'].\". Please make sure that the product is dispatched by \".date( \"d-M-Y\", ( ( strtotime($mail_info[$j]['date_of_pickup']) ) - 86400) ).\". Contact us on +91-8130878822 or ops@buynbrag.com \\r\\n Team BuynBrag\";\n\n\t\t\t\t\t\t\t$sellerSMSNo = $mail_info[$j]['contact_number'];\n\t\t\t\t\t\t\tif($sellerSMSNo == '' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sellerSMSNo = NULL;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->smsc->sendSMS($sellerSMSNo, $sellerSMSMsg);\n\t\t\t\t\t\t\t$this->slog->write( array( 'level' => 1, 'msg' => 'Just sent seller SMS to '.json_encode($sellerSMSNo).'. The msg sent is <p>'.$sellerSMSMsg.'</p>' ) );\n\n //Seller New Order Email\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*$config['protocol'] = 'smtp';\n\t\t\t\t\t\t\t$config['smtp_host'] = 'ssl://smtp.googlemail.com';\n\t\t\t\t\t\t\t$config['smtp_port'] = 465;\n\t\t\t\t\t\t\t$config['smtp_user'] = 'info@buynbrag.com';\n\t\t\t\t\t\t\t$config['smtp_pass'] = '';*/\n\n $this->load->library('email');\n $mailArraylog2 = array();\n $this->email->clear(TRUE);\n $this->email->from('support@buynbrag.com','BuynBrag');\n if(empty($owner_email))\n {\n \t//log_message('INFO', 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to neworders@buynbrag.com');\n \t$this->load->model('slog');\n \t$this->slog->write(array('level' => 1 , 'msg' => 'Seller email ('.$mail_info[$j]['contact_email'].') is empty. Sellers EMAIL will be sent to neworders@buynbrag.com'));\n $owner_email = 'neworders@buynbrag.com';\n }\n\n $this->email->to($owner_email);\n $this->email->bcc('shammishailaj@gmail.com,rajat.bhagat@buynbrag.com,prt@buynbrag.com,ayushjain@buynbrag.com,lucky@buynbrag.com,finance@buynbrag.com');\n $this->email->subject(\"New Order from BuynBrag,Order Id:\".$order_no);\n $this->email->message($new_order_message);\n $this->email->attach('./invoice/'.$txnid.'/buyer_invoice_order_'.$order_no.'.pdf');\n \n if(!empty($productImage))\n {\n $this->email->attach($productImage);\n }\n\n $this->email->set_newline(\"\\r\\n\");\n \n if($this->email->send())\n {\n //log_message('Info',\"Seller eMail sent to $owner_email for order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1 , 'msg' => \"Seller eMail sent to $owner_email for order no: $order_no\" ));\n $mailArraylog2 = array('level' => 1, 'send status' => 1,'to' => $owner_email,'bcc' =>'rajat.bhagat@buynbrag.com,prt@buynbrag.com,ayushjain@buynbrag.com,lucky@buynbrag.com,finance@buynbrag.com,shammishailaj@gmail.com','From' => 'support@buynbrag.com','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n if($j==($count_prod-1))\n {\n $this->vc_orders->purchase_mail_success($txnid);\n }\n }\n else\n {\n //log_message('Info',\"ERROR occurred while sending Seller email to $owner_email order no: $order_no\");\n $this->load->model('slog');\n $this->slog->write( array('level' => 1, 'msg' => \"ERROR occurred while sending Seller email to $owner_email order no: \".$order_no, 'debug' => $this->email->print_debugger() ) );\n $mailArraylog2 = array('level' => 1, 'send status' => 0,'to' => $owner_email,'bcc' =>'rajat.bhagat@buynbrag.com,prt@buynbrag.com,ayushjain@buynbrag.com,lucky@buynbrag.com,finance@buynbrag.com,shammishailaj@gmail.com','From' => 'support@buynbrag.com','emsg' => $new_order_message);\n $this->load->model('slog');\n $this->slog->write($mailArraylog2);\n \n }\n $this->email->clear(TRUE);\n //end email send\n }//end for\n \n }//end if mail_info !=0\n }\n else\n {\n log_message('Info',\"Don't Allow mail as the Ip is 127.0.0.1\");\n $this->load->model('slog');\n $this->slog->write(array('level' => 1, 'msg' => \"Don't Allow mail as the Ip is 127.0.0.1\"));\n }\n $this->load->view('order_success',$data);\n }", "function success()\r\n\t{\r\n $paypalInfo = $this->input->get(); \r\n\t\t $tx = $paypalInfo[\"tx\"];\t\r\n\t\t if(isset($tx))\r\n\t\t {\t\r\n\t\t $paypalURL = $this->paypal_lib->paypal_url; \r\n\t $result = $this->paypal_lib->PDT($paypalURL,$tx);\r\n\t if(!empty($result))\r\n\t {\t \r\n\t\t $data['txn_id'] = $result[\"txn_id\"];\r\n\t\t $data['payment_amt'] = $result[\"payment_gross\"];\r\n\t\t $data['currency_code'] = $result[\"mc_currency\"];\r\n\t\t $data['status'] = $result[\"payment_status\"]; \r\n\t\t $order_id=$result['custom']; \r\n\t\t \r\n\t\t //sending order details on email\r\n\t\t\t\t$order=$this->Order_model->get_order_details($order_id);\t\t\r\n\t\t\t\t$subtotal=0;\r\n\t\t\t\tforeach ($order as $order)\r\n\t\t\t\t{\r\n\t\t\t\t\t$Emaildata =array(\r\n\t\t\t\t\t\t\t 'logo' => base_url().'upload/site/original/'.get_logo(),\r\n\t\t\t\t\t 'name'=>ucfirst($order->FName).' '.ucfirst($order->LName),\r\n\t\t\t\t\t\t\t 'order_id'=>$order->Order_number,\r\n\t\t\t\t\t 'bill_add'=> $order->Address,\r\n\t\t\t\t\t 'bill_city' => $order->City,\r\n\t\t\t\t\t\t\t 'bill_state' =>$order->State,\r\n\t\t\t\t\t\t\t 'bill_zip'=> $order->Zip_code,\r\n\t\t\t\t\t\t\t 'bill_country'=>$order->Country,\r\n\t\t\t\t\t\t\t 'email' => $order->EmailId,\r\n\t\t\t\t\t\t\t 'bill_phone' => $order->Phone\r\n\t\t\t\t\t );\r\n\t\t\t\t\t \r\n\t\t\t\t\t if(!empty($order->Shipping_FName))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$Emaildata['ship_name']=ucfirst($order->Shipping_FName).' '.ucfirst($order->Shipping_LName);\r\n\t\t\t\t\t\t\t $Emaildata['ship_add'] = $order->Shipping_Address;\r\n\t\t\t\t\t $Emaildata['ship_city'] = $order->Shipping_City;\r\n\t\t\t\t\t\t\t $Emaildata['ship_state'] =$order->Shipping_State;\r\n\t\t\t\t\t\t\t $Emaildata['ship_zip']= $order->Shipping_ZipCode;\r\n\t\t\t\t\t\t\t $Emaildata['ship_country'] =$order->Shipping_Country;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else \r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$Emaildata['ship_name']=ucfirst($order->FName).' '.ucfirst($order->LName);\r\n\t\t\t\t\t\t\t $Emaildata['ship_add'] =$order->Address;\r\n\t\t\t\t\t $Emaildata['ship_city'] =$order->City;\r\n\t\t\t\t\t\t\t $Emaildata['ship_state'] =$order->State;\r\n\t\t\t\t\t\t\t $Emaildata['ship_zip']= $order->Zip_code;\r\n\t\t\t\t\t\t\t $Emaildata['ship_country'] =$order->Country;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t foreach ($order->products as $product)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$options=unserialize($product->Option);\r\n\t\t\t\t\t $option='';\t\t\t\t\t \r\n\t\t\t\t\t $i=1;\r\n\t\t\t\t\t if(!empty($options))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$count=count($options);\r\n\t\t\t\t\t\t\t\t foreach ($options as $key=>$value)\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t \tif($i == $count)\r\n\t\t\t\t\t\t\t\t \t\t$option .= $value;\r\n\t\t\t\t\t\t\t\t \telse\r\n\t\t\t\t\t\t\t\t \t\t$option .= $value.\",\";\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t }\r\n\t\t\t\t\t $sku='';\r\n\t\t\t\t\t if(!empty($product->SKU))\r\n\t\t\t\t\t $sku=$product->SKU;\r\n\t\t\t\t\t else\r\n\t\t\t\t\t $sku='-';\r\n\t\t\t\t\t \r\n\t\t\t\t\t \t$Emaildata['products'][]=array('sku'=>$sku,'pname'=>$product->Product_name,'option'=>$option,'price'=>price($product->Price),'quantity'=>$product->Quantity,'total'=>price($product->Total));\r\n\t\t\t\t\t \t$subtotal +=$product->Total;\r\n\t\t\t\t\t }\t\t\t \t\t\t \t\r\n\t\t\t\t}\r\n\t\t\t\t$Emaildata['subtotal']=price($subtotal);\r\n\t\t\t\t$Emaildata['ship_charg']=0;\r\n\t\t\t\t$Emaildata['total_price']=price($Emaildata['ship_charg']+$subtotal);\r\n\t\t\t\t$Emaildata['base_url']=base_url();\r\n\t\t\t\t\r\n\t\t\t\t$content = $this->Email_template_model->get_temp_by_id(6);\r\n\t\t\t\t$this->load->library('parser');\t\t\r\n\t\t\t\t$subject = $content[0]->template_title;\r\n\t\t\t\t$content = $content[0]->content;\r\n\t\t\t\t$from = 'supportntest@gmail.com';\r\n\t\t\t\t$site_settings=$this->Member_model->get_site_settings();\t\t\r\n\t\t\t\t$EmailId=array($Emaildata['email'],$site_settings[0]->super_admin_email_id);\t\t\r\n\t\t\t\t\r\n\t\t\t\t$this->Email_template_model->sendmail_template($from,$EmailId,$subject,$content,$subject,$Emaildata);\r\n\t\t\t\tredirect('paypal/received_order/'.$order_id);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\techo \"transcation id \".$tx.\" does not exists,Please contact to admin\";\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\techo \"something went wrong.Please contact to admin\";\t\r\n\t\t\t}\t\r\n \r\n }", "function dsf_protx_decline_order($order_number){\n\nglobal $VoidURL, $AbortURL, $Verify, $ProtocolVersion;\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please decline the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'invalid protx item';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as declined however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please decline the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'more than one protx item found';\n\tbreak;\n }\n \t\n\n // we must have a valid transaction item if we are here.\n \n // we therefore need to check our logs to see if the item has been previously charged.\n \n $check_history_query = dsf_db_query(\"select orders_id, orders_status_id from \" . DS_DB_SHOP . \".orders_status_history where orders_id='\" . $order_number . \"' and orders_status_id='90006'\");\n \n if (dsf_db_num_rows($check_history_query)==0){\n \t$TargetURL = $AbortURL; // never charged.\n\t$TxType = 'ABORT';\n }else{\n \t$TargetURL = $VoidURL; // has been charged\n\t$TxType = 'VOID';\n }\n \n \n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$VerifyServer = $Verify;\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => $TxType,\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been voided / aborted witin protx.\n\n\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '50005');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '50005', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t\t\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases except failed\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn 'error';\n}", "public function testOrderReceiptDisabled() {\n $order_type = OrderType::load($this->order->bundle());\n $order_type->setSendReceipt(FALSE);\n $order_type->save();\n\n $this->order->getState()->applyTransitionById('place');\n $this->order->save();\n\n $this->assertCount(0, $this->getMails());\n }", "public function sendOrder(Mage_Sales_Model_Order $order)\n {\n try{\n\t\t\t$this->_eventType = 'placeOrder';\n\t\t\t$amount\t\t= number_format($order->getGrandTotal(),2);\n\t\t\t$samount\t= number_format($order->getSubtotal(),2);\n\t\t\t$tax \t\t= number_format($order->getBaseTaxAmount(),2);\n\t\t\t$shipping \t= number_format($order->getBaseShippingAmount(),2);\n\t\t\t$discounts \t= number_format($order->getDiscountAmount(),2);\n\t\t\t$shippingAddressData \t= $order->getShippingAddress()->getData();\n\t\t\t$billingAddressData \t= $order->getBillingAddress()->getData();\n\t\t\t$shippingMethod \t \t= $order->_data[\"shipping_description\"];\n\t\t\t$paymentMethod \t \t \t= $order->getPayment()->getMethodInstance()->getTitle();\n\t\t\t$customerId \t\t\t= $order->getCustomerId();\n\t\t\t$websiteId \t\t\t\t= 1;\n\t\t\t$balanceModel \t\t\t= Mage::getModel('enterprise_customerbalance/balance')\n\t\t \t\t\t\t \t->setCustomerId($customerId)\n\t\t \t\t\t\t \t->setWebsiteId($websiteId)\n\t\t \t\t\t\t\t->loadByCustomer();\t\n\t\t $storeCredit\t\t\t= ($balanceModel->getId())? number_format($balanceModel->getAmount(),2) :'0' ; \t\t\t\t\t\t\n $data = array(\n 'email' => $order->getCustomerEmail(),\n 'items' => $this->_getItems($order->getAllVisibleItems()),\n 'adjustments' => $this->_getAdjustments($order),\n 'message_id' => $this->getMessageId(),\n 'send_template' => 'Purchase Receipt',\n 'tenders' => $this->_getTenders($order),\n 'vars'\t=> array ( 'order#'=> $order->getIncrementId(),\n\t\t\t\t\t\t\t\t\t'subtotal'=> $samount,\n\t\t\t\t\t\t\t\t\t'shipping_and_handling'=> $shipping,\n\t\t\t\t\t\t\t\t\t'sale_tax'=> $tax,\n\t\t\t\t\t\t\t\t\t'billing_address'=> $shippingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_address'=> $billingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_method'=> $shippingMethod,\n\t\t\t\t\t\t\t\t\t'payment_method'=> $paymentMethod,\n\t\t\t\t\t\t\t\t\t'store_credit' => $storeCredit\n\t\t\t ),\n \t);\n /**\n * Send order data to purchase API\n */\n $responsePurchase = $this->apiPost('purchase', $data);\n\t\t\t\n\t\t\t/****Update product sku in following items for price alert****/\n $productSku = array();\n\t\t\tforeach ($order->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n $sailthru_userdata = $this->apiGet('user', array('id' => $order->getCustomerEmail()));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items']) && $productSku) {\n\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t$sailthru_followingItems = array_values($sailthru_followingItems);\n\t\t\t\t$sailthru_followingItems = array_diff($sailthru_followingItems,$productSku);\n\t\t\t\t$sailthru_followingItems = array_unique($sailthru_followingItems);\n\t\t\t\t$data = array(\n\t\t\t\t\t\t\"id\" => $order->getCustomerEmail(),\n\t\t\t\t\t\t\"vars\" => array(\"following_items\" => $sailthru_followingItems)\n\t\t\t\t\t\t);\n\t\t\t\t$response = $this->apiPost('user', $data);\n\t\t\t}\n /*************************************************/\n\t\t\t\n /**\n * Send customer data to user API\n */\n //$responseUser = Mage::getModel('sailthruemail/client_user')->sendCustomerData($customer);\n }catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }", "public function processPayment($order)\n {\n $shipping = sprintf('%0.2f', 0);\n // Add any tax amount if you want to apply any tax rule\n $tax = sprintf('%0.2f', 0);\n\n // Create a new instance of Payer class\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Adding items to the list\n $items = array();\n foreach ($order->items as $item) {\n $orderItems[$item->order_item_id] = new Item();\n $orderItems[$item->order_item_id]->setName($item->film->film_name)\n ->setCurrency(config('settings.currency_code'))\n ->setQuantity($item->order_item_quantity)\n ->setPrice(sprintf('%0.2f', $item->order_item_price));\n\n array_push($items, $orderItems[$item->order_item_id]);\n }\n\n $itemList = new ItemList();\n $itemList->setItems($items);\n\n // Setting Shipping Details\n $details = new Details();\n $details->setShipping($shipping)\n ->setTax($tax)\n ->setSubtotal(sprintf('%0.2f', $order->order_grand_total));\n\n // Setup currency payment\n // Create chargeable amout\n $amount = new Amount();\n $amount->setCurrency(config('settings.currency_code'))\n ->setTotal(sprintf('%0.2f', $order->order_grand_total))\n ->setDetails($details);\n\n\n // Creating a transaction\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($itemList)\n ->setDescription($order->user->full_name)\n ->setInvoiceNumber($order->order_number);\n\n // This class takes two values, return URL (after successful completion where PayPal will redirect the user) and the cancel URL (if the user cancels the payment where he should be redirected).\n // Setting up redirection urls\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl(route('checkout.payment.complete'))\n ->setCancelUrl(route('booking.book_tickets_post'));\n\n // Creating payment instance\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n try {\n\n $payment->create($this->payPal);\n } catch (PayPalConnectionException $exception) {\n echo $exception->getCode(); // Prints the Error Code\n echo $exception->getData(); // Prints the detailed error message\n exit(1);\n } catch (Exception $e) {\n echo $e->getMessage();\n exit(1);\n }\n\n $approvalUrl = $payment->getApprovalLink();\n\n header(\"Location: {$approvalUrl}\");\n exit;\n }", "function edd_pup_ajax_send_email( $payment_id, $email_id, $test_mode = null ) {\n\n\t$userid \t = get_current_user_id();\n\t$emailpost \t = get_post( $email_id );\n\t$emailmeta \t = get_post_custom( $email_id );\n\t$payment_data = edd_get_payment_meta( $payment_id );\n\t$email = isset( $payment_data['user_info']['email'] ) ? $payment_data['user_info']['email'] : $payment_data['email'];\n\t$from_name \t = $emailmeta['_edd_pup_from_name'][0];\n\t$from_email = $emailmeta['_edd_pup_from_email'][0];\n\t$attachments = apply_filters( 'edd_pup_attachments', array(), $payment_id, $payment_data );\n\t$lognotes\t = edd_get_option( 'edd_pup_log_notes' );\n\n\tadd_filter('edd_email_template', 'edd_pup_template' );\n\n\t/* If subject doesn't use tags (and thus is the same for each customer)\n\t * then store it in a transient for quick access on subsequent loops. */\n\t$subject = get_transient( 'edd_pup_subject_'. $userid );\n\n\tif ( false === $subject || $emailmeta['_edd_pup_subject'][0] != $subject ) {\n\n\t\tif ( empty( $emailmeta['_edd_pup_subject'][0] ) ) {\n\n\t\t\t$subject = '(no subject)';\n\t\t\twp_update_post( array( 'ID' => $email_id, 'post_excerpt' => $subject ) );\n\t\t\tupdate_post_meta ( $email_id, '_edd_pup_subject', $subject );\n\t\t\tset_transient( 'edd_pup_subject_'. $userid, $subject, 60 * 60 );\n\n\t\t} else {\n\n\t\t\t$subject = edd_do_email_tags( $emailmeta['_edd_pup_subject'][0], $payment_id );\n\n\t\t\tif ( $subject == $emailmeta['_edd_pup_subject'][0] ) {\n\t\t\t\tset_transient( 'edd_pup_subject_'. $userid, $subject, 60 * 60 );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( version_compare( get_option( 'edd_version' ), '2.1' ) >= 0 ) {\n\n\t\t$edd_emails = new EDD_emails();\n\n\t\t$updated_links = edd_pup_products_links_tag( $payment_id, null, $email_id);\n\t\t$updated_products = edd_pup_products_tag( $payment_id, null, $email_id );\n\n\t\tif( $updated_links || $updated_products ){\n\t\t\t$message = str_replace( '{updated_products_links}', $updated_links, $emailpost->post_content );\n\t\t\t$replaced_products = str_replace( '{updated_products}', $updated_products, $message );\n\n\n\n\t\t\t$message = edd_do_email_tags( $replaced_products, $payment_id );\n\t\t\t$edd_emails->__set( 'from_name', $from_name );\n\t\t\t$edd_emails->__set( 'from_address', $from_email );\n\t\t\t$stripped_message = stripslashes( $message );\n\n\t\t\t$mailresult = ( isset( $test_mode ) && $test_mode == true ) ? compact( 'email', 'subject', 'stripped_message', 'headers', 'attachments' ) : $edd_emails->send( $email, $subject, $stripped_message, $attachments );\n\t\t} else {\n\t\t\t$mailresult = 'nothig';\n\t\t}\n\n\t} else {\n\t\t$updated_links = edd_pup_products_links_tag( $payment_id, null, $email_id);\n\t\t$updated_products = edd_pup_products_tag( $payment_id, null, $email_id );\n\n\t\tif( $updated_links || $updated_products ){\n\n\t\t\t$email_body_header = get_transient( 'edd_pup_email_body_header_'. $userid );\n\n\t\t\tif ( false === $email_body_header ) {\n\n\t\t\t\t$email_body_header = edd_get_email_body_header();\n\n\t\t\t\tset_transient( 'edd_pup_email_body_header_'. $userid, $email_body_header, 60 * 60 );\n\t\t\t}\n\n\t\t\t$email_body_footer = get_transient( 'edd_pup_email_body_footer_'. $userid );\n\n\t\t\tif ( false === $email_body_footer ) {\n\n\t\t\t\t$email_body_footer = edd_get_email_body_footer();\n\n\t\t\t\tset_transient( 'edd_pup_email_body_footer_'. $userid, $email_body_footer, 60 * 60 );\n\t\t\t}\n\n\t\t\t$headers = \"From: \" . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . \" <$from_email>\\r\\n\";\n\t\t\t$headers .= \"Reply-To: \". $from_email . \"\\r\\n\";\n\t\t\t$headers .= \"Content-Type: text/html; charset=utf-8\\r\\n\";\n\n\t\t\t$message = $email_body_header;\n\n\t\t\t$_message = str_replace( '{updated_products_links}', $updated_links, $emailpost->post_content );\n\t\t\t$replaced_products = str_replace( '{updated_products}', $updated_products, $_message );\n\n\t\t\t$message .= apply_filters( 'edd_pup_message', edd_email_template_tags( $replaced_products, $payment_data, $payment_id ), $payment_id, $payment_data );\n\n\t\t\t$message .= $email_body_footer;\n\t\t\t$stripped_message = stripslashes( $message );\n\n\t\t\t$mailresult = ( isset( $test_mode ) && $test_mode == true ) ? compact( 'email', 'subject', 'stripped_message', 'headers', 'attachments' ) : wp_mail( $email, $subject, $stripped_message, $headers, $attachments );\n\t\t} else {\n\t\t\t$mailresult = 'nothig';\n\t\t}\n\t}\n\n\t// Update payment notes to log this email being sent\n\tif ( !isset( $lognotes['sent'] ) ) {\n\t\tedd_insert_payment_note( $payment_id, 'Sent product update email \"'. $subject .'\" <a href=\"'.admin_url( 'edit.php?post_type=download&page=edd-prod-updates&view=view_pup_email&id='.$email_id ).'\">View Email</a>' );\n\t}\n\n\n return $mailresult;\n}", "private function emailSerialNumbers()\n {\n if (!$this->individual_purchase) {\n $subject = $this->upgrade_purchase ? \"Upgrade Confirmation\" : \"New \"\n . $this->user->getCurrentRoleName() . \" \"\n . $this->payment_method->name . \" order\";\n\n $template = $this->upgrade_purchase ? \"upgrade-confirmation.phtml\" : \"serial-numbers-multiple.phtml\";\n\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo($this->user->email)\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('salesEmail', false)\n ->sendHtmlTemplate($template);\n\n //Send email to fisdap-sales@fisdap.net\n if (APPLICATION_ENV != \"production\") {\n $subject = ucfirst(APPLICATION_ENV) . \" - \" . $subject;\n }\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo(\"fisdap-sales@fisdap.net\")\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('salesEmail', true)\n ->sendHtmlTemplate($template);\n\n // send out a seperate email to those who have accounts that are being upgraded\n if ($this->upgrade_purchase) {\n foreach ($this->order_configurations as $config) {\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo($config->upgraded_user->email)\n ->setSubject(\"Your Fisdap account has been upgraded\")\n ->setViewParam('config', $config)\n ->setViewParam('orderer', $this->user->first_name . \" \" . $this->user->last_name)\n ->sendHtmlTemplate('account-upgrade.phtml');\n }\n }\n } elseif ($this->individual_purchase) {\n $subject = $this->upgrade_purchase ? \"Upgrades to your Fisdap account\" : \"Your new Fisdap account\";\n\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo($this->email)\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('urlRoot', \\Util_HandyServerUtils::getCurrentServerRoot())\n ->setViewParam('salesEmail', false)\n ->sendHtmlTemplate('individual-purchase-order.phtml');\n\n //Send email to fisdap-sales@fisdap.net\n if (APPLICATION_ENV != \"production\") {\n $subject = ucfirst(APPLICATION_ENV) . \" - \" . $subject;\n }\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo(\"fisdap-sales@fisdap.net\")\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('urlRoot', \\Util_HandyServerUtils::getCurrentServerRoot())\n ->setViewParam('salesEmail', true)\n ->sendHtmlTemplate('individual-purchase-order.phtml');\n }\n }", "function mail_payout($email, $user, $amount, $wallet, $txid)\n{\n global $mail_headers;\n\n $message = \"Hello,\\n\\nThis is a BTC withdrawal notification from https://www.bitjack21.com for $user.\\n\\n$amount BTC has just been sent to your Bitcoin wallet $wallet\\n\\nYou can track this payout on blockexplorer.com using the transaction ID $txid as per below:\\n\\nhttp://blockexplorer.com/tx/$txid\\n\\nThanks for playing!\\n\\n--\\nbitjack21.com\";\n\n mail($email, \"[BitJack21] Withdrawal Notification\", $message, $mail_headers);\n}", "function paid_sendEmail_admin($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$additionaNotes = $details->additionaNotes;\t\t\t\t\n\t\t\t\t$sendto = $this->adminemail;\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidadmin\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidadmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function action_paypal_callback()\n\t{\n $post = $this->request->post();\n\t\t$type = $this->request->param('id');\n\t\t$payment = new Model_Realexpayments; // Not actually \"Realex\"\n\t\t$data['purchase_time'] = date('Y-m-d H:i:s');\n\n\t\tIbHelpers::htmlspecialchars_array($post);\n\n\t\t$data['cart_details'] = json_encode(IbHelpers::iconv_array($post));\n\n try\n\t\t{\n $is_booking = ($type == 'booking' AND isset($post['custom']));\n\t\t\t$is_product = ($type == 'product' AND isset($post['custom']));\n\t\t\t$is_invoice = ($type == 'invoice' AND isset($post['custom']));\n\t\t\t$data['paid'] = 1;\n\t\t\t$data['payment_type'] = 'PayPal';\n\t\t\t$data['payment_amount'] = isset($post['mc_gross']) ? $post['mc_gross'] : '';\n\n\t\t\tif ($is_booking)\n\t\t\t{\n\t\t\t\t// Use contact details from the booking, which should also be the data filled out in the checkout form\n\t\t\t\t$booking = Model_CourseBookings::load(trim($post['custom'], '|'));\n $data['customer_name'] = $booking['student']['first_name'].' '.$booking['student']['last_name'];\n\t\t\t\t$data['customer_telephone'] = $booking['student']['phone'];\n\t\t\t\t$data['customer_address'] = $booking['student']['address'];\n\t\t\t\t$data['customer_email'] = $booking['student']['email'];\n\t\t\t}\n\t\t\telseif ($is_product OR $is_invoice)\n\t\t\t{\n\t\t\t\t$cart = new Model_Cart($post['custom']);\n\n\t\t\t\t// Set the cart item as paid\n\t\t\t\t$cart->set_paid(1)->save();\n\n\t\t\t\t// Send the emails\n\t\t\t\t$cart = $cart->get_instance();\n\t\t\t\t$form_data = json_decode($cart['form_data']);\n\t\t\t\t$cart_data = json_decode($cart['cart_data']);\n\t\t\t\t$cart_data = isset($cart_data->data) ? $cart_data->data : new stdClass();\n $cart_data->payment_type = 'Paypal';\n\n\t\t\t\t$data['customer_name'] = isset($form_data->ccName) ? $form_data->ccName : '';\n\t\t\t\t$data['customer_telephone'] = isset($form_data->phone) ? $form_data-> phone : '';\n\t\t\t\t$data['customer_address'] = isset($form_data->address_1) ? $form_data->address_1 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_2) ? ', '.$form_data->address_2 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_3) ? ', '.$form_data->address_3 : '';\n\t\t\t\t$data['customer_address'] .= isset($form_data->address_4) ? ', '.$form_data->address_4 : '';\n\t\t\t\t$data['customer_email'] = isset($form_data->email) ? $form_data->email : '';\n\t\t\t\t$data['cart_id'] = isset($cart_data->id) ? $cart_data->id : '';\n\n\t\t\t\t$payment->send_mail_seller($form_data, (array) $cart_data);\n\t\t\t\t$payment->send_mail_customer($form_data, NULL, (array) $cart_data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Use contact details from the buyer's PayPal account\n\t\t\t\t$data['customer_name'] = trim((isset($post['first_name'])?$post['first_name']:'').' '.(isset($post['last_name'])?$post['last_name']:''));\n\t\t\t\t$data['customer_telephone'] = isset($post['contact_phone']) ? $post['contact_phone'] : '';;\n\t\t\t\t$data['customer_address'] = \"\".\n\t\t\t\t\t(isset($post['address_name']) ? $post['address_name'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_street']) ? $post['address_street'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_city']) ? $post['address_city'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_state']) ? $post['address_state'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_zip']) ? $post['address_zip'] .\"\\n\" : '').\n\t\t\t\t\t(isset($post['address_country']) ? $post['address_country'].\"\\n\" : '');\n\t\t\t\t$data['customer_email'] = isset($post['payer_email']) ? $post['payer_email'] : '';\n\t\t\t}\n\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\n if ($is_booking)\n\t\t\t{\n\t\t\t\tModel_CourseBookings::paypal_handler_old($booking['id'], $post['mc_gross'], $post['txn_id']);\n\n\t\t\t\t// send success emails regarding bookings\n\t\t\t\t$payment->send_mail_seller_bookings($post);\n\t\t\t\t$payment->send_mail_customer_bookings($post);\n\t\t\t}\n\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().\"\\n\".$e->getTraceAsString());\n\t\t\t$data['payment_type'] = 'Test/failed payment';\n\t\t\tModel_Errorlog::save($e);\n\t\t\tDB::insert('plugin_payments_log')->values($data)->execute();\n\t\t}\n\t}", "public function email($order, $type) {\r\n\r\n switch ($type) {\r\n case 'shipping_confirmation':\r\n if ($order['status'] == 'shipped' && !empty($order['shipping_tracking_number'])) {\r\n // Send Shipping Confirmation email to customer\r\n $templateId = config('custom.emails.templates.shipping_confirmation');\r\n\r\n if (!empty($order['user_id'])) {\r\n $user = $order->user;\r\n }\r\n\r\n $sub = [\r\n 'customer_name' => !empty($order['user_id']) ? $user['first_name'] : $order['billing_name'],\r\n 'order_number' => $order['order_number'],\r\n 'shipping_carrier' => !empty($order['shipping_carrier']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.name') : '',\r\n 'shipping_plan' => !empty($order['shipping_plan']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.plans.' . $order['shipping_plan'] . '.plan') : '',\r\n 'tracking_url' => 'https://tools.usps.com/go/TrackConfirmAction?tLabels=' . $order['shipping_tracking_number'],\r\n 'tracking_number' => $order['shipping_tracking_number'],\r\n 'delivery_address' => [\r\n 'name' => $order['delivery_name'],\r\n 'phone' => $order['delivery_phone'],\r\n 'address_1' => $order['delivery_address_1'],\r\n 'address_2' => $order['delivery_address_2'],\r\n 'city' => $order['delivery_city'],\r\n 'state' => $order['delivery_state'],\r\n 'zipcode' => $order['delivery_zipcode']\r\n ]\r\n ];\r\n\r\n foreach ($order->inventoryItems as $item) {\r\n $tmp = [\r\n 'name' => $item->product['name'],\r\n 'url' => route('shop.product', [$item->product['uri'], $item->product['id']]),\r\n 'unit_price' => number_format($item->pivot['price'], 2),\r\n 'quantity' => $item->pivot['quantity'],\r\n 'price' => number_format($item->pivot['price'] * $item->pivot['quantity'], 2)\r\n ];\r\n\r\n if ($item->options()->count() > 0) {\r\n $tmp['options'] = [];\r\n\r\n foreach ($item->options()->get() as $option) {\r\n $tmp['options'][] = [\r\n 'attribute' => $option->attribute['name'],\r\n 'value' => $option['name']\r\n ];\r\n }\r\n }\r\n\r\n if ($item->product->defaultPhoto()->count() > 0) {\r\n $tmp['image'] = CustomHelper::image($item->product->defaultPhoto['name'], true);\r\n }\r\n\r\n $sub['items'][] = $tmp;\r\n }\r\n\r\n $recipients = [\r\n [\r\n 'address' => !empty($order['contact_email']) ? $order['contact_email'] : $user['email'],\r\n 'name' => $sub['customer_name'],\r\n 'substitution_data' => $sub\r\n ]\r\n ];\r\n\r\n SparkPostHelper::sendTemplate($templateId, $recipients);\r\n\r\n return back()->with('alert-success', 'You have successfully sent a Shipping Confirmation email to the customer.');\r\n } else {\r\n return back()->with('alert-danger', 'You need to change the status to Shipped and add a Tracking Number first in order to send this Shipping Confirmation email to the customer.');\r\n }\r\n\r\n break;\r\n }\r\n }", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "function sendEmail_owner($details, $sitetitle) {\n\n\t\t\t $currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Order Information</b></h4>\";\n\t\t\t\t$message .= \"Date :\" . $date . \".<br>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//\t$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\tif(!empty($country)){\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice visit at: <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('New Booking Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function sendCustomerReceipt($sendReceipt = TRUE) {\n $receipt = array(\n 'x_email_customer'=>(int)$sendReceipt,\n );\n $this->NVP = array_merge($this->NVP, $receipt); \n }", "public function sendMailToNotifiedCustomerOk($observer) {\r\n\r\n\r\n $enableOutOfStock = Mage::getStoreConfig('Outofstocknotification/general/activate_apptha_outofstock_enable'); //backend you given module status in off then dont exe this codings\r\n $product = $observer->getProduct(); //get the current product\r\n $isInStock = $product['stock_data']['is_in_stock'];\r\n $enableOutOfStock = intval($enableOutOfStock); //if the product is out of stock val = 0 , that time dont send mails\r\n $productUrl = $product->getUrlInStore();\r\n $stockLevel = (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();\r\n $status = $product->getStatus();\r\n\r\n //echo \"<pre>\"; \tprint_r($product);echo \"</pre>\";die;\r\n $product_id = $product->getId();\r\n $products = Mage::getModel('catalog/product')->load($product_id);\r\n\r\n $this->productPrice = $product->getPrice();\r\n\r\n if ($product->_isObjectNew) {\r\n return 1;\r\n }\r\n\r\n if (!$isInStock) { //if it is a out of stock product no need to do any task\r\n return 1;\r\n }\r\n if (!$enableOutOfStock) { // if out of stock is disable then dont do any task just return\r\n return 1; //if outof stock notifi status is no then dont exe all funs\r\n }\r\n $this->storeName = Mage::getStoreConfig(\"general/store_information/name\");\r\n $this->productDescr = $product->getDescription();\r\n\r\n $getProductImageList = json_decode($product->_data['media_gallery']['images']); //get images\r\n for ($i = 0; $i < count($getProductImageList); $i++) {\r\n if (!$getProductImageList[$i]->removed) {\r\n if (!$getProductImageList[$i]->disabled && $getProductImageList[$i]->position == 1 && !$getProductImageList[$i]->removed) {\r\n $prodcutImageIs = $getProductImageList[$i]->url;\r\n break;\r\n } else if (!$getProductImageList[$i]->disabled && !$getProductImageList[$i]->removed) {\r\n $prodcutImageIs = $getProductImageList[$i]->url;\r\n }\r\n }\r\n }\r\n $this->prodcutImg = $product->getImageUrl(); \r\n\t\t\r\n\t\t$product = Mage::getModel('catalog/product')->load($product_id);\r\n\t\t//echo Mage::helper('checkout/cart')->getAddUrl($product);\r\n\t\t//echo $product_id;\r\n\t\t//echo Mage::helper('checkout/cart')->getAddUrl($product_id);\r\n\t\t//echo Mage::getUrl('checkout/cart/add', array('product' => $product_id));\r\n\t\t//exit;\r\n\r\n if (!strlen($this->prodcutImg)) {\r\n\r\n $this->prodcutImg = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . DS . 'frontend' . DS . 'default' . DS . 'default' . DS . 'outofstocknotification' . DS . 'defaultimage.jpg';\r\n }\r\n\r\n\r\n if (trim($product->_data['type_id']) == 'grouped' || trim($product->_data['type_id']) == 'bundle') {\r\n $stockLevel = 2; //quantity is not check for grouped\r\n }\r\n\r\n if ($status && ($stockLevel > 0)) {\r\n $productId = $product->getId();\r\n $mailFunCallOrNot = $this->isProductInNotifiyList($productId); //find this product in notify list or not\r\n if ($mailFunCallOrNot) {\r\n $this->_sendNotificationEmail($this->bcc);\r\n $this->updateMailAndStatusOfNotifiy($productId); //changes the status of mailsend_status and status\r\n }\r\n } else {\r\n\r\n return false; //product is out of stock\r\n }\r\n }", "public function notifyPayment()\n {\n }", "private function _sendNotificationEmail($message, $origMessage = false, $_product = false)\r\n {\r\n /*\r\n\t\tarray(10) {\r\n\t\t [\"message\"] => string(31) \"raspuns test la al doilea mesaj\"\r\n\t\t [\"sender_firstname\"] => string(4) \"Bugs\"\r\n\t\t [\"sender_lastname\"] => string(5) \"Bunny\"\r\n\t\t [\"replay_to\"] => string(28) \"bugs.bunny@nuntainimagini.ro\"\r\n\t\t [\"is_first\"] => int(0)\r\n\t\t [\"first_message_id\"] => string(2) \"26\"\r\n\t\t [\"subject\"] => string(55) \"RE: Detalii despre oferta Oferta foto-video BB's Agency\"\r\n\t\t [\"sender_id\"] => string(2) \"93\"\r\n\t\t [\"recever_id\"] => string(2) \"94\"\r\n\t\t [\"message_id\"] => string(2) \"38\"\r\n\t\t} \r\n\t\t\r\n $message = array(9) {\r\n [\"sender_id\"] => string(2) \"94\"\r\n [\"recever_id\"] => string(2) \"93\"\r\n [\"sender_firstname\"] => string(4) \"Nicu\"\r\n [\"sender_lastname\"] => string(5) \"Popan\"\r\n [\"subject\"] => string(51) \"Detalii despre oferta Oferta foto-video BB's Agency\"\r\n [\"message\"] => string(20) \"Prmiul mesaj de test\"\r\n [\"replay_to\"] => string(19) \"nicupopan@gmail.com\"\r\n [\"is_first\"] => int(1)\r\n [\"message_id\"] => string(2) \"15\"\r\n }\r\n */\r\n \r\n $sender = $message->getSenderId() ? Mage::getModel('customer/customer')->load($message->getSenderId()) : false;\r\n $receiver = $message->getReceverId() ? Mage::getModel('customer/customer')->load($message->getReceverId()) : false;\r\n \r\n $senderDetails = array();\r\n $receiverDetails = array();\r\n $emailVariables = array();\r\n \r\n if ($sender) {\r\n if ($sender->getGroupId() == 4) {\r\n // furnizor\r\n $senderDetails['sender_fullname'] = ucwords(strtolower($sender->getData('furnizor_contact_firstname') . ' ' . $sender->getData('furnizor_contact_lastname')));\r\n $senderDetails['sender_email'] = $sender->getData('furnizor_contact_email');\r\n $senderDetails['sender_phone'] = $sender->getData('furnizor_contact_phone') ? $sender->getData('furnizor_contact_phone') : '';\r\n $senderDetails['sender_company'] = $sender->getData('business_descriptions_title');\r\n $subject = 'RE: ' . $message->getSubject(); \r\n } else {\r\n // regular customer => get data from form\r\n $senderDetails['sender_fullname'] = ucwords(strtolower($message->getData('sender_firstname') . ' ' . $message->getData('sender_lastname')));\r\n $senderDetails['sender_email'] = $message->getData('replay_to');\r\n $senderDetails['sender_phone'] = false;\r\n $subject = $message->getSubject(); \r\n }\r\n } else {\r\n // regular customer => get data from form\r\n $senderDetails['sender_fullname'] = ucwords(strtolower($message->getData('sender_firstname') . ' ' . $message->getData('sender_lastname')));\r\n $senderDetails['sender_email'] = $message->getData('replay_to');\r\n $senderDetails['sender_phone'] = false;\r\n $subject = $message->getSubject(); \r\n }\r\n \r\n if ($receiver) {\r\n if ($receiver->getGroupId() == 4) {\r\n // furnizor\r\n $receiverDetails['receiver_fullname'] = ucwords(strtolower($receiver->getData('furnizor_contact_firstname') . ' ' . $receiver->getData('furnizor_contact_lastname')));\r\n $receiverDetails['receiver_email'] = $receiver->getData('furnizor_contact_email');\r\n $receiverDetails['receiver_phone'] = $receiver->getData('furnizor_contact_phone') ? $receiver->getData('furnizor_contact_phone') : false;\r\n \r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('provider_notification_email');\r\n $emailSubject = $senderDetails['sender_fullname'] . ' ți-a trimis un mesaje prin nuntainimagini.ro';\r\n } else {\r\n // regular customer\r\n $receiverDetails['receiver_fullname'] = ucwords(strtolower($receiver->getData('firstname') . ' ' . $receiver->getData('lastname')));\r\n $receiverDetails['receiver_email'] = $receiver->getData('email');\r\n $receiverDetails['receiver_phone'] = false;\r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('customer_notification_email');\r\n $emailSubject = $senderDetails['sender_fullname'] . ' de la ' . $senderDetails['sender_company'] . ' ți-a trimis un mesaje prin NuntaInImagini.ro';\r\n }\r\n } else {\r\n // unregistered regular customer => get data from orig message\r\n $receiverDetails['receiver_fullname'] = ucwords(strtolower($origMessage->getData('sender_firstname') . ' ' . $origMessage->getData('sender_lastname')));\r\n $receiverDetails['receiver_email'] = $origMessage->getData('replay_to');\r\n $receiverDetails['receiver_phone'] = false;\r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('customer_notification_email');\r\n $emailSubject = $senderDetails['sender_fullname'] . ' de la ' . $senderDetails['sender_company'] . ' ți-a trimis un mesaje prin NuntaInImagini.ro';\r\n $emailVariables['phone_entry'] = ' sau la telefon ' . $senderDetails['sender_phone'] . '.';\r\n }\r\n \r\n //Zend_Debug::dump($emailTemplate); die();\r\n \r\n // set email template variables\r\n $emailVariables = array_merge($emailVariables, $senderDetails);\r\n $emailVariables = array_merge($emailVariables, $receiverDetails);\r\n $emailVariables['created_at'] = date('d.m.Y | H:i:s', Mage::getModel('core/date')->timestamp(time()));\r\n $emailVariables['store_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\r\n $emailVariables['message'] = $message->getMessage();\r\n \r\n $emailVariables['product'] = '';\r\n \r\n //Zend_Debug::dump($_product->getData()); die();\r\n \r\n if ($_product) {\r\n $productName = $_product->getName();\r\n $productUrl = $_product->getProductUrl();\r\n $productType = $_product->getResource()->getAttribute('ofg_tip_oferta')->getFrontend()->getValue($_product);\r\n $productFinalPrice = Mage::helper('core')->currency($_product->getFinalPrice(), true, false);\r\n $regions = '';\r\n $regionsArr = explode(',', $_product->getOfgZonaPersonalizata());\r\n foreach ($regionsArr as $region) {\r\n $regions .= Mage::getModel('directory/region')->load($region)->getName() .', ';\r\n }\r\n $productAvailability = trim($regions, ', ');\r\n $producctFotografi = $_product->getOfgNrFotografi();\r\n $productCameramani = $_product->getOfgNrCameramani();\r\n $productTransport = $_product->getResource()->getAttribute('ofg_cheltuieli_transport')->getFrontend()->getValue($_product);\r\n $productCazare = $_product->getResource()->getAttribute('ofg_cheltuieli_cazare')->getFrontend()->getValue($_product);\r\n $productTimpAlocat = $_product->getResource()->getAttribute('ofg_disponibilitate')->getFrontend()->getValue($_product);\r\n \r\n $emailVariables['product'] = '<p style=\"font-size:12px; line-height:16px; margin:0 0 16px 0;\">Mesajul a fost trimis de pe pagina <a href=\"' . $productUrl . '\">' . $productName . '</a>. ';\r\n $emailVariables['product'] .= 'Îți transmitem în continuare câteva detalii despre ofertă, așa cum erau la data ' . $emailVariables['created_at'] . ':</p>';\r\n $emailVariables['product'] .= '<ul style=\"font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;\">';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Tip oferta</strong>: ' . $productType . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Preț / Tarif</strong>: ' . $productFinalPrice . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Nr. Fotografi</strong>: ' . $producctFotografi . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Nr. Cameramani</strong>: ' . $productCameramani . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Valabila pentru</strong>: ' . $productAvailability . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Cheltuieli transport</strong>: ' . $productTransport . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Cheltuieli cazare</strong>: ' . $productCazare . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Timp alocat evenimentului</strong>: ' . $productTimpAlocat . '</li>';\r\n $emailVariables['product'] .= '</ul>'; \r\n }\r\n\t\t\r\n //load the custom template to the email \r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_custom1/name', Mage::app()->getStore()->getId()));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_custom1/email', Mage::app()->getStore()->getId()));\r\n $emailTemplate->setReplyTo($message->getReplayTo());\r\n $emailTemplate->setTemplateSubject($emailSubject);\r\n\t\t\r\n\t\ttry {\r\n // send email\r\n $emailTemplate->send($receiverDetails['receiver_email'], $receiverDetails['receiver_fullname'], $emailVariables);\r\n return true;\r\n \r\n } catch (Exception $e) {\r\n $errorMessage = $e->getMessage();\r\n //Zend_Debug::dump($errorMessage);\r\n return $errorMessage;\r\n }\r\n \r\n }", "function sendrstmail($data, $txn_id)\n{\n//print_r($data);\n $rst_options = get_option(RSTPLN_OPTIONS);\n if(isset($rst_options['rst_disable_admin_email']))\n\t\t$stopadminemails = $rst_options['rst_disable_admin_email'];\t\t\n\telse\n\t\t$stopadminemails = \"\";\n $rst_options = get_option(RSTPLN_OPTIONS);\n $rst_paypal_options = get_option(RSTPLN_PPOPTIONS);\n //$symbol = $rst_paypal_options['currencysymbol'];\n\t$symbol = get_option('rst_currencysymbol');\n $symbols = array(\n \"0\" => \"$\",\n \"1\" => \"&pound;\",\n \"2\" => \"&euro;\",\n \"3\" => \"&#3647;\",\n \"4\" => \"&#8362;\",\n \"5\" => \"&yen;\",\n \"6\" => \"&#8377;\",\n \"7\" => \"R$\",\n \"8\" => \"kr\",\n \"9\" => \"zl\",\n \"10\" => \"Ft\",\n \"11\" => \"Kc\",\n \"12\" => \"&#1088;&#1091&#1073;\",\n \"13\" => \"&#164;\",\n \"14\" => \"&#x20B1;\",\n \"15\" => \"Fr\",\n \"16\" => \"RM\");\n $symbol = $symbols[$symbol];\n $useremailtemp = $rst_options['rst_etemp'];\n\t$useremailtemp = html_entity_decode(stripslashes(apply_filters( 'the_content', $useremailtemp )));\n//$wplanguagesoptions = get_option(RSTLANGUAGES_OPTIONS);\n//if($wplanguagesoptions['rst_enable_languages']==\"on\" && $wplanguagesoptions['languages_event_user_email_template'])\n//{\n//$useremailtemp=$wplanguagesoptions['languages_event_user_email_template'];\n//}\t\n $adminemailtemp = $rst_options['rst_adminetemp'];\n\t$adminemailtemp = html_entity_decode(stripslashes(apply_filters( 'the_content', $adminemailtemp )));\n $search = array(\"<username>\", \"<showname>\", \"<showdate>\", \"<bookedseats>\", \"<downloadlink>\", \"<showtime>\", \"<venue>\",\"[username]\", \"[showname]\", \"[showdate]\", \"[bookedseats]\", \"[downloadlink]\", \"[showtime]\", \"[venue]\");\n // $downloadlink = RSTTICKETDOWNURL . '?id=' . $txn_id;\n $txn_id_enc=base64_encode($txn_id);\n\t$downloadlink = get_bloginfo(\"wpurl\"). '/?mybookingticket=' . $txn_id_enc;\n $dlink = 'Please click <a href=\"' . $downloadlink . '\">here</a> to download your tickets';\n $adminsearch = array(\"<blogname>\", \"<username>\", \"<showname>\", \"<showdate>\", \"<bookedseats>\", \"<availableseats>\", \"<showtime>\", \"<totalshowcount>\", \"<totalbookedcount>\", \"<venue>\",\"[blogname]\", \"[username]\", \"[showname]\", \"[showdate]\", \"[bookedseats]\", \"[availableseats]\", \"[showtime]\", \"[totalshowcount]\", \"[totalbookedcount]\", \"[venue]\");\n $adminsearch=apply_filters('row_seats_custom_field_shortcode_key',$adminsearch);\n $showid = $data[0]['show_id'];\n $availableseats = getavailableseatsbyshow($showid);\n\t$bookedseats = getbookedseatsbyshow($showid);\n\t$totalseats = gettotalseatsbyshow($showid);\n $username = $data[0]['name'];\n $useremail = $data[0]['email'];\n $showdate = $data[0]['show_date'];\n\t$show_start_time = $data[0]['show_start_time'];\n $showdate = date('F j, Y', strtotime($showdate));\n $showtime = date('jS \\of F Y h:i:s A', strtotime($show_start_time));\n $showname = stripslashes($data[0]['show_name']);\n\t$venue = stripslashes($data[0]['venue']);\n $seatdetails = '';\n for ($i = 0; $i < count($data); $i++) {\n\t\t$seattitle = $data[$i]['ticket_seat_no'] ;\n\t\t$seattitle = apply_filters('row_seats_generel_admission_hideticketnumber', $seattitle,$i+1,$showid);\n $seatdetails .= $seattitle . ' - ' . $symbol . $data[$i]['seat_cost'] . '<br/>';\n }\n $replace = array($username, $showname, $showdate, $seatdetails, $dlink,$showtime,$venue,$username, $showname, $showdate, $seatdetails, $dlink,$showtime,$venue);\n $blogname = get_option('blogname');\n $adminreplace = array($blogname, $username, $showname, $showdate, $seatdetails, $availableseats,$showtime,$totalseats,$bookedseats,$venue,$blogname, $username, $showname, $showdate, $seatdetails, $availableseats,$showtime,$totalseats,$bookedseats,$venue);\n $adminreplace=apply_filters('row_seats_custom_field_shortcode_value',$adminreplace,$data[0]['booking_id']); \n $mailBodyText = str_replace($search, $replace, $useremailtemp);\n $mailBodyTextadmin = str_replace($adminsearch, $adminreplace, $adminemailtemp);\n $rst_options = get_option(RSTPLN_OPTIONS);\n if(isset($rst_options['rst_email']))\n\t\t$fromAddr = $rst_options['rst_email'];\n\telse\n\t\t$fromAddr = \"\";\n if(isset($rst_options['rst_esub']))\n\t\t$esub = $rst_options['rst_esub'];\n\telse\n\t\t$esub = \"\";\n if(isset($rst_options['rst_off_esub']))\t\t\n\t\t$offlineesub = $rst_options['rst_off_esub'];\n\telse\n\t\t$offlineesub = \"\";\n if ($fromAddr == '') {\n $fromAddr = get_option('admin_email');\n }\n // the address to show in From field.\n $recipientAddr = $useremail;\n $mailstring = \"\";\n $from = \"\";\n $attachments =\"\";\n\t\t\t\t\t\tforeach($data as $key=>$value)\n\t\t\t\t{\n\t\t\t\t\tif(is_array($key))\n\t\t\t\t\t\t$key=implode(\",\",$key);\n\t\t\t\t\tif(is_array($value))\n\t\t\t\t\t\t$value=implode(\",\",$value);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$mailstring.=\"<br>\".$key.\"=\".$value;\n\t\t\t\t}\t\n\t\t\t\t$mailstring.=\"<br>GET varaibles<br>\";\n\t\t\t\tforeach($_GET as $key=>$value)\n\t\t\t\t{\n\t\t\t\t\tif(is_array($key))\n\t\t\t\t\t\t$key=implode(\",\",$key);\n\t\t\t\t\tif(is_array($value))\n\t\t\t\t\t\t$value=implode(\",\",$value);\t\t\t\t\t\t\t\n\t\t\t\t$mailstring.=\"<br>\".$key.\"=\".$value;\n\t\t\t\t}\t\n\t\t\t\t$mailstring.=\"<br>To email address=\".$recipientAddr;\n\t\n //$headers = \"From: $from\\r\\n\";\n $headers = \"From: $from\\r\\n\";\n $headers .= \"Content-type: text/html\\r\\n\";\n //mail($to, $subject, $mailstring, $headers);\t\t\t\n//print $mailstring.\"<br><br><br>\";\n if ($txn_id == 'Offline Reservation' && $offlineesub != '')\n $subjectStr = $offlineesub;\n else if ($esub != '')\n $subjectStr = $esub;\n else\n $subjectStr = 'Bookings';\n $recipientAddradmin = $fromAddr;\n $subjectStradmin = get_option('blogname') . ' Bookings';\n $filePath=\"\";\n if(isset($attachments[$i]))\n\t\t$filePath = $attachments[$i];\n $fileName = basename($filePath);\n $fileType = 'pdf/pdf';\n $headers = \"From: $recipientAddradmin\\r\\n\";\n $headers .= \"Content-type: text/html\\r\\n\";\n //mail($recipientAddr, $subjectStr, $mailBodyText, $headers); // commented to enable default wp_mail\n\tadd_filter( 'wp_mail_content_type', 'set_html_content_type' );\n wp_mail($recipientAddr, $subjectStr, $mailBodyText, $headers); \n if ($stopadminemails != 'off') {\n //mail($recipientAddradmin, $subjectStradmin, $mailBodyTextadmin, $headers);// commented to enable default wp_mail\n\t\twp_mail($recipientAddradmin, $subjectStradmin, $mailBodyTextadmin, $headers);\n\t\tif(isset($rst_options['rst_email_copy'])) \n\t\t\t$email_copy = $rst_options['rst_email_copy'];\n\t\telse\n\t\t\t$email_copy = \"\";\t\n\t\tif($email_copy)\n\t\t{\n\t\t\t$email_copy_array=explode(\",\",$email_copy);\n\t\t\tif(count($email_copy_array)>0)\n\t\t\t{\n\t\t\t foreach($email_copy_array as $ademail)\n\t\t\t {\n\t\t\t\t\tif (is_email($ademail) )\n\t\t\t\t\t{\n\t\t\t\t\twp_mail($ademail, $subjectStradmin, $mailBodyTextadmin, $headers); \n\t\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t}\n }\n\tremove_filter( 'wp_mail_content_type', 'set_html_content_type' );\n}", "public function send_mpesa_receipt_email($invoice_id)\n\t{\n\t\t$this->load->library('Mandrill', $this->config->item('mandrill_key'));\n\t\t$this->load->model('site/email_model');\n\t\t\n\t\t//get member details\n\t\t$where = \"member.member_id = invoice.member_id AND invoice.invoice_id = '\".$invoice_id.\"'\";\n\t\t$this->db->select('member.*, invoice.invoice_number');\n\t\t$this->db->where($where);\n\t\t$query = $this->db->get('member, invoice');\n\t\t\n\t\t//get dobi details\n\t\t$where = \"dobi.dobi_id = invoice.dobi_id AND invoice.invoice_id = '\".$invoice_id.\"'\";\n\t\t$this->db->select('dobi.*, invoice.invoice_number');\n\t\t$this->db->where($where);\n\t\t$query_dobi = $this->db->get('dobi, invoice');\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\tif($query_dobi->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$row2 = $query_dobi->row();\n\t\t\t\t$dobi_email = $row2->dobi_email;\n\t\t\t\t$dobi_first_name = $row2->dobi_first_name;\n\t\t\t\t$dobi_phone = $row2->dobi_phone;\n\t\t\t\t$location = $row2->location;\n\t\t\t\t$street = $row2->street;\n\t\t\t\t$estate = $row2->estate;\n\t\t\t\t$house = $row2->house;\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$dobi_email = '';\n\t\t\t\t$dobi_first_name = '';\n\t\t\t\t$dobi_phone = '';\n\t\t\t\t$location = '';\n\t\t\t\t$street = '';\n\t\t\t\t$estate = '';\n\t\t\t\t$house = '';\n\t\t\t}\n\t\t\t\n\t\t\t$clothes = '<table binvoice=\"1\">';\n\t\t\t//get dobi details\n\t\t\t$where = \"invoice_item.category_id = category.category_id AND invoice_item.invoice_id = '\".$invoice_id.\"'\";\n\t\t\t$this->db->select('invoice_item.*, category.category_name');\n\t\t\t$this->db->where($where);\n\t\t\t$query_clothes = $this->db->get('category, invoice_item');\n\t\t\t\n\t\t\tif($query_clothes->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$clothes .= '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>#</th>\n\t\t\t\t\t\t<th>Item</th>\n\t\t\t\t\t\t<th>Unit price</th>\n\t\t\t\t\t\t<th>Quantity</th>\n\t\t\t\t\t\t<th>Total</th>\n\t\t\t\t\t</tr>\n\t\t\t\t';\n\t\t\t\t$count = 0;\n\t\t\t\t$grand_total = 0;\n\t\t\t\tforeach($query_clothes->result() as $res)\n\t\t\t\t{\n\t\t\t\t\t$count++;\n\t\t\t\t\t$category_name = $res->category_name;\n\t\t\t\t\t$invoice_item_quantity = $res->invoice_item_quantity;\n\t\t\t\t\t$invoice_item_price = $res->invoice_item_price;\n\t\t\t\t\t$total = $invoice_item_quantity * $invoice_item_price;\n\t\t\t\t\t$count++;\n\t\t\t\t\t$grand_total += $total;\n\t\t\t\t\t\n\t\t\t\t\t$clothes .= '\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>'.$count.'</td>\n\t\t\t\t\t\t\t<td>'.$category_name.'</td>\n\t\t\t\t\t\t\t<td>'.$invoice_item_price.'</td>\n\t\t\t\t\t\t\t<td>'.$invoice_item_quantity.'</td>\n\t\t\t\t\t\t\t<td>'.$total.'</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$clothes .= '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"5\" align=\"right\">'.$grand_total.'</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t';\n\t\t\t}\n\t\t\t\n\t\t\t$row = $query->row();\n\t\t\t$client_email = $row->member_email;\n\t\t\t$client_username = $row->member_first_name;\n\t\t\t$client_username = $row->member_first_name;\n\t\t\t$invoice_number = $row->invoice_number;\n\t\t\t$sender_email = 'info@dobi.co.ke';\n\t\t\t$subject = 'Your payment has been received';\n\t\t\t$message = '\n\t\t\t\t<p>Your payment for invoice number '.$invoice_number.' has been received and your clothes queued for washing. Here is your invoice summary:</p>\n\t\t\t\t'.$clothes.'\n\t\t\t\t<p>Your dobi is '.$dobi_first_name.' , '.$location.' '.$street.' '.$estate.' '.$house.' phone number is '.$dobi_phone.'. Kindly be in touch with them to schedule laundry delivery and cleaning.</p>\n\t\t\t\t\t\t\t\t\n\t\t\t\t<p>To review your invoice please log into your account on '.site_url().'</p>\n\t\t\t';\n\t\t\t$shopping = \"<p>Happy washing<br/>The Dobi Team</p>\";\n\t\t\t$from = 'Dobi';\n\t\t\t\n\t\t\t$button = '<a class=\"mcnButton \" title=\"Find a dobi\" href=\"'.site_url().'member-login\" target=\"_blank\" style=\"font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;\">Find a dobi</a>';\n\t\t\t$response = $this->email_model->send_mandrill_mail($client_email, \"Hi \".$client_username, $subject, $message, $sender_email, $shopping, $from, $button, $cc = $dobi_email);\n\t\t\t\n\t\t\treturn $response;\n\t\t}\t\t\n\t}", "public function send_notification(Request $request)\n\t\t{\t\n\t\t\t$quote_review = $request->quote_review;\n\t\t\t$phone_number = $request->phone_number;\n\t\t\t$recipient = $request->recipient;\n\t\t\t$pdf_data = base64_decode($request->pdf_base64_data);\n\t\t\t$quote_annotations = $request->quote_annotations;\n\t\t\t$quote_guid = $request->quote_guid;\n\t\t\t$to_company = is_null($request->company) ? '' : 'to ' . $request->company;\n\t\t\t \n\t\t\t$user_data = array(\n\t\t\t\t'phone_number' => $phone_number,\n\t\t\t\t'pdf_data' => $pdf_data,\n\t\t\t\t'quote_annotations' => $quote_annotations,\n\t\t\t\t'quote_guid' => $quote_guid,\n\t\t\t\t'to_company' => $to_company\n\t\t\t);\n\t\t\t \n\t\t\tswitch ($recipient) {\n\t\t\t\tcase \"laine\":\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => 'laine@pahoda.com',\n\t\t\t\t\t\t'sales_rep' => 'Laine Dobson',\n\t\t\t\t\t);\n\t\t\t\t\t$user_data = array_merge($user_data, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"greg\":\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => 'greg@pahoda.com',\n\t\t\t\t\t\t'sales_rep' => 'Greg Bentz'\n\t\t\t\t\t);\n\t\t\t\t\t$user_data = array_merge($user_data, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"jesse\":\n\t\t\t\tdefault:\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => 'jesse@pahoda.com', \n\t\t\t\t\t\t'sales_rep' => 'Jesse Harwell'\n\t\t\t\t\t);\n\t\t\t\t\t$user_data = array_merge($user_data, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($quote_review) {\n\t\t\t\tcase \"needs\":\n\t\t\t\t\tMail::send(\n\t\t\t\t\t\t'emails.notification_template_rejected',\n\t\t\t\t\t\t$user_data,\n\t\t\t\t\t\tfunction ($message) use ($user_data) {\n\t\t\t\t\t\t\t$message->from('noreply@perfectcopier.com', 'Pahoda Image Products');\n\t\t\t\t\t\t\t$message->to($user_data['mail'], $user_data['sales_rep'])->subject('Perfectcopier notification: Quote Rejected');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$message->attachData($user_data['pdf_data'], 'PahodaImageQuote_' . $user_data['quote_guid'] . '.pdf');\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"perfect\":\n\t\t\t\tdefault:\t\t\t\t\n\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t'phone_number' => $phone_number,\n\t\t\t\t\t\t'pdf_data' => $pdf_data,\n\t\t\t\t\t\t'quote_annotations' => $quote_annotations,\n\t\t\t\t\t\t'quote_guid' => $quote_guid,\n\t\t\t\t\t\t'to_company' => $to_company\n\t\t\t\t\t);\n\t\t\t\t\t//Send message to all three reps\n\t\t\t\t\t$sales_rep_data = array (\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => 'jesse@pahoda.com', \n\t\t\t\t\t\t\t'sales_rep' => 'Jesse Harwell'\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => 'greg@pahoda.com', \n\t\t\t\t\t\t\t'sales_rep' => 'Greg Bentz'\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => 'laine@pahoda.com', \n\t\t\t\t\t\t\t'sales_rep' => 'Laine Dobson'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t\tforeach ($sales_rep_data as $sales_rep_array) {\t\t\t\t\t\t\n\t\t\t\t\t\t$new_user_data = array_merge($user_data, $sales_rep_array);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMail::send(\n\t\t\t\t\t\t\t'emails.notification_template_accepted',\n\t\t\t\t\t\t\t$new_user_data,\n\t\t\t\t\t\t\tfunction ($message) use ($new_user_data) {\n\t\t\t\t\t\t\t\t$message->from('noreply@perfectcopier.com', 'Pahoda Image Products');\n\t\t\t\t\t\t\t\t$message->to($new_user_data['mail'], $new_user_data['sales_rep'])->subject('Perfectcopier notification: Quote Accepted');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$message->attachData($new_user_data['pdf_data'], 'PahodaImageQuote_' . $new_user_data['quote_guid'] . '.pdf');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\treturn response()->json(array('message' => $quote_annotations));\n\t\t}", "function offer_mail($recharge_user_id) {\n\t\t$recharge_user_id = $recharge_user_id;\n\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t$user_name = $frnd_records['0']['user_name'];\n\t\t$user_email = $frnd_records['0']['user_email'];\n\t\t// $frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t//\t$offer_records = $this -> conn -> get_table_row_byidvalue('add_cart_offer', 'cart_user_id', 12);\n\t\t$offer_records = $this -> conn -> get_table_field_doubles('add_cart_offer', 'cart_user_id', $recharge_user_id, 'cart_offer_status', 2);\n\n\t\tif (!empty($offer_records)) {\n\n\t\t\tforeach ($offer_records as $value) {\n\n\t\t\t\t$coupon_id = $value['cart_offer_id'];\n\t\t\t\t$frnd_records = $this -> conn -> join_two_table('free_coupon_list', 'free_coupon_category', 'fee_coupon_category_id', 'free_coupon_category_id', 'free_coupon_id', $coupon_id);\n\t\t\t\t//$transaction = $this->login_model->join_two_table('free_coupon_list','free_coupon_category', 'fee_coupon_category_id', 'free_coupon_category_id','free_coupon_id',$coupon_id);\n\n\t\t\t\t$free_coupon_id = $frnd_records['0']['free_coupon_id'];\n\t\t\t\t$coupon_name = $frnd_records['0']['coupon_name'];\n\t\t\t\t$coupon_discount = $frnd_records['0']['coupon_discount'];\n\t\t\t\t$coupon_code = $frnd_records['0']['coupon_code'];\n\t\t\t\t$coupon_expiry_date = $frnd_records['0']['coupon_expiry_date'];\n\t\t\t\t$coupon_refference_url = $frnd_records['0']['refference_website'];\n\t\t\t\t$coupon_image_url = coupon_logo . '/' . $frnd_records['0']['coupon_img'];\n\t\t\t\t// $to='blm.ypsilon@gmail.com';\n\t\t\t\t$to = $user_email;\n\n\t\t\t\t$subject = \"Promotional offer code details\";\n\t\t\t\t$path = mail_logo;\n\t\t\t\t$message = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Untitled Document</title></head>\n\n<body bgcolor=\"#f1f1f1\">\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"background:#fff; border:1px solid #cbcbcb; margin:0 auto; font-family:Arial, Helvetica, sans-serif; font-size:12px;\">\n\t<thead class=\"header\">\n \t<tr>\n \t<td style=\"background:#FFFFFF; height:62px; width:100%; padding:5px; border-bottom:1px solid #DDD;\" valign=\"middle\">\n \t<a href=\"#\" style=\"margin-left:10px;\"><img width=\"100\" src=\"' . $path . '\" alt=\"...\"/></a>\n \n </td>\n </tr>\n </thead>\n <tbody style=\" background:#FEFEFE; border-bottom:1px solid #ddd;\">\n \t<tr>\n \t<td style=\"padding:10px 15px;\">\n \t<h1 style=\"margin-bottom:0px; color:#337d75;\">RECHARGE </h1>\n \t<p >Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since</p>';\n\t\t\t\t$message .= '<p>Coupon name:<strong>' . $coupon_name;\n\t\t\t\t'</strong></p>';\n\t\t\t\t$message .= '<p>Coupon Discount:<strong>' . $coupon_discount;\n\t\t\t\t'</strong></p></td></tr>';\n\t\t\t\t$message .= '<p>Coupon Code:<strong>' . $coupon_code;\n\t\t\t\t'</strong></p>';\n\t\t\t\t$message .= '<p>Coupon Expiry Date:<strong>' . $coupon_expiry_date;\n\t\t\t\t'</strong></p></td></tr>';\n\t\t\t\t$message .= '<p>Refference Website:<strong>' . $coupon_refference_url;\n\t\t\t\t'</strong></p></td></tr>';\n\t\t\t\t$message .= '<tr><td style=\"background:#ddd; height:1px; width:100%;\"></td></tr></tbody>';\n\n\t\t\t\t$message .= '<tfoot style=\"background:#337d75; text-align:center; color:#fff;\"><tr><td><p> Copyright © 2016 Recharge All right reserved </p></td><tr></tfoot></table></body></html>';\n\n\t\t\t\t//\n\t\t\t\t// $message= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t\t\t// <html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t// <head>\n\t\t\t\t// <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t\t\t// <title>Untitled Document</title>\n\t\t\t\t// </head>\n\t\t\t\t//\n\t\t\t\t// <body>\n\t\t\t\t// <table width=\"550\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"width:550px; font-family:Arial, Helvetica, sans-serif; border:1px solid #ddd;\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr bgcolor=\"#60c4ba\">\n\t\t\t\t// <td align=\"left\"><img src=\"'.$path.'\" width=\"150\" alt=\"...\"/></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// &nbsp;\n\t\t\t\t// <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"padding:10px;\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td valign=\"bottom\" style=\"font-size:14px;text-align:left;font-family:arial;text-transform:capitalize\">Dear \"'.$user_name\t.'\",</td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// <p style=\"margin:0;min-height:20px padding:10px;\">&nbsp;</p>\n\t\t\t\t// <p style=\"margin:0 0 0 0;color:#000000; padding:10px;text-align:left;font-size:14px;font-weight:normal;line-height:20px\">Your recharge has officially been made free! Your free coupons have been listed below. Please note, e-coupons can be redeemed instantly.</p>\n\t\t\t\t// <p style=\"font-size:14px;padding:10px;margin:0;color:#000000;text-align:justify;line-height:18px\">If theres anything else we can do to make you smile, please dont hesitate to get in touch with us.</p>\n\t\t\t\t// <p style=\"font-size:14px;padding:10px;margin:0;text-align:left;font-weight:bold\"><span style=\"text-transform:uppercase\">Insta coupon(s)</span> - <span style=\"font-weight:normal;padding:10px;color:#666;font-size:12px\">Delivered instantly via email to your registered email id.</span></p>\n\t\t\t\t// <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:2px dashed #0d2651;padding:10px;background:#fefdf5\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td colspan=\"5\"><div style=\"min-height:10px\">&nbsp;</div></td>\n\t\t\t\t// </tr>\n\t\t\t\t// <tr>\n\t\t\t\t// <td width=\"10\" rowspan=\"2\">&nbsp;</td>\n\t\t\t\t// <td width=\"95\" align=\"center\" style=\"font-size:11px;padding:0px\" rowspan=\"2\"><a style=\"text-decoration:none;border:0;font-size:11px;color:#000000\" rel=\"external\"><img width=\"95\" height=\"50\" title=\"Dominos.co.in 15% OFF\" style=\"min-height:50px;display:block;text-decoration:none;border:0;word-break:break-all\" src=\".$coupon_image_url.\" alt=\"Dominos.co.in 15% OFF\" class=\"CToWUd\"></a></td>\n\t\t\t\t// <td width=\"290\" valign=\"top\" style=\"text-align:left;padding:0px;padding-left:7px\"><span style=\"color:#999;font-size:14px;font-weight:bold;display:block\"><a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://Dominos.co.in&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNGti07GxKef8IQLYh-4J9SikJsGZQ\" target=\"_blank\" rel=\"external\" href=\"http://Dominos.co.in\">Dominos.co.in</a> 15% OFF</span></td>\n\t\t\t\t// <td width=\"135\" style=\"text-align:right;padding:0\"><strong style=\"color:#0d2651;font-size:28px;font-weight:bold;text-align:center\"><span style=\"font-size:17px\">Rs.</span> 50</strong></td>\n\t\t\t\t// <td width=\"10\" rowspan=\"2\">&nbsp;</td>\n\t\t\t\t// </tr>\n\t\t\t\t// <tr>\n\t\t\t\t// <td style=\"padding:0;margin:0\"><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td width=\"90\" valign=\"middle\" style=\"text-align:left;padding:0px;padding-left:7px\"><span style=\"color:#999;font-size:12px;line-height:18px\">Coupon Code:</span></td>\n\t\t\t\t// <td width=\"200\"><div style=\"background:none repeat scroll 0 0 #eee;border:1px dashed #333333;font-size:16px;font-weight:bold;padding:1px 0px;display:block;text-align:center;width:185px;margin:0 5px\">Frchr01</div></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table></td>\n\t\t\t\t// <td style=\"text-align:right;padding:0;font-size:16px;color:#000000\"><p style=\"margin:0;padding:0;font-size:11px;color:#999\">Expire on: &nbsp; <span data-term=\"goog_1872809791\" class=\"aBn\" tabindex=\"0\"><span class=\"aQJ\">31 Aug 2016</span></span></p></td>\n\t\t\t\t// </tr>\n\t\t\t\t// <tr>\n\t\t\t\t// <td colspan=\"5\"><div style=\"min-height:18px\">&nbsp;</div></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// <table cellspacing=\"0\" cellpadding=\"0\" style=\"padding:10px;\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td style=\"padding:15px 0px;background:#fff;border-bottom:3px solid #f9f9f9\" colspan=\"\"><p style=\"font-size:11px;color:#999;line-height:16px;margin:0;padding:0\"><strong>Terms &amp; Conditions:</strong> Offer Highlights: Enjoy flat 15% discount on minimum billing of Rs. 350 at <a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://www.dominos.co.in&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNHKk0HpqXE9TW5R1pA62PZ9rbGT2Q\" target=\"_blank\" rel=\"external\" href=\"http://www.dominos.co.in\">www.dominos.co.in</a> How to redeem this Offer: You will receive an coupon code via e-mail as soon as your transaction is successful. You need to apply the coupon code at the time of placing the order on <a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://www.dominos.co.in&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNHKk0HpqXE9TW5R1pA62PZ9rbGT2Q\" target=\"_blank\" rel=\"external\" href=\"http://www.dominos.co.in\">www.dominos.co.in</a> Terms of this Offer: Offer not valid on Simply Veg, Simply Non Veg Pizzas, Pizza Mania Combos and Beverages. Only one Coupon Code is valid per transaction and cannot be clubbed with any other offer or promotion. Offer valid only on orders placed ONLINE. Offer valid till <span data-term=\"goog_1872809792\" class=\"aBn\" tabindex=\"0\"><span class=\"aQJ\">31st August, 2016</span></span>.</p></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// <p style=\"font-size:12px;margin:0;color:#000000;padding:10px;text-align:left\">Lots of love,</p>\n\t\t\t\t// <p style=\"font-size:12px;margin:0;color:#000000;padding:10px;text-align:left\">The OyaCharge Family</p>\n\t\t\t\t// <p style=\"font-size:12px;margin:0;color:#000000;padding:10px;text-align:left;font-weight:normal\">This is a system-generated mail, please do not respond to this e-mail Id. Got a question or need clarifications? You can either visit <a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://support.freecharge.in/&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNEm1EolVTUsdJj69XGVn3lMVSSUeg\" target=\"_blank\" rel=\"external\" href=\"http://support.freecharge.in/\">support.Oyacharge.in</a> or write in to <a target=\"_blank\" href=\"mailto:care@freecharge.com\">care@oyacharge.com</a> we will get in touch with you asap.</p></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// </body>\n\t\t\t\t// </html>';\n\t\t\t\t//\n\t\t\t\t$headers = \"Organization: OyaCharge\\r\\n\";\n\t\t\t\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t\t$headers .= \"Content-type: text/plain; charset=iso-8859-1\\r\\n\";\n\t\t\t\t$headers .= \"X-Priority: 3\\r\\n\";\n\t\t\t\t$headers .= \"X-Mailer: PHP\" . phpversion() . \"\\r\\n\";\n\t\t\t\t$header = \"From:blm.ypsilon@gmail.com \\r\\n\";\n\t\t\t\t$header .= \"Cc:blm.ypsilon@gmail.com \\r\\n\";\n\t\t\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t\t$header .= \"Content-type: text/html\\r\\n\";\n\t\t\t\t$retval = mail($to, $subject, $message, $header);\n\t\t\t\t$data_frnd['cart_offer_status'] = 1;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'cart_offer_id', $coupon_id, $data_frnd);\n\t\t\t}\n\n\t\t}\n\t}", "public function sendIntimationEmail($quote_id,$bo_user_type,$comments,$prod_only=NULL)\n\t{\n\n\t\t//Getting SEO/TECH/Prod users\n\n\t\t\t$salesObj=new Ep_Quote_Quotes();\n\t\t\t$QuoteDetails=$salesObj->getQuoteDetails($quote_id);\n\t\t\tif($QuoteDetails)\n\t\t\t{\n\t\t\t\t$sales_user=$QuoteDetails[0]['created_by'];\n\t\t\t\t$quote_title=$QuoteDetails[0]['title'];\n\t\t\t}\t\t\n\n\n\t\t\t$techObj=new Ep_Quote_TechMissions();\n\t\t\t$techParameters['quote_id']=$quote_id;\n\t\t\t$techMissionDetails=$techObj->getTechMissionDetails($techParameters,1);\n\t\t\tif($techMissionDetails)\n\t\t\t{\n\t\t\t\t$tech_user=$techMissionDetails[0]['created_by'];\n\t\t\t}\n\n\t\t\t$seoObj=new Ep_Quote_QuoteMissions();\n\t\t\t$seoParameters['quote_id']=$quote_id;\n\t\t\t$seoParameters['misson_user_type']='seo';\n\t\t\t$seoMissionDetails=$seoObj->getMissionDetails($seoParameters,1);\n\t\t\tif($seoMissionDetails)\n\t\t\t{\n\t\t\t\t$seo_user=$seoMissionDetails[0]['created_by'];\n\t\t\t}\n\n\n\t\t\t$prodObj=new Ep_Quote_ProdMissions();\t\t\t\n\t\t\t$prodMissionDetails=$prodObj->getProdQuoteDetails($quote_id);\n\t\t\tif($prodMissionDetails)\n\t\t\t{\n\t\t\t\t$prod_user=$prodMissionDetails[0]['created_by'];\n\t\t\t}\t\n\n\t\t\t//send email to sales\n\t\t\t$mail_obj=new Ep_Message_AutoEmails();\n\t\t\t$mail_parameters['bo_user']=$this->adminLogin->userId;\n\t\t\t$mail_parameters['quote_title']=$quote_title;\n\t\t\t$mail_parameters['bo_user_comments']=$comments;\n\t\t\t$mail_parameters['validate_link']='/quote/sales-quotes-list?submenuId=ML13-SL2';\t\t\t\n\n\t\t\tif($bo_user_type!='sales' && $sales_user)\n\t\t\t{\t\t\t\t\n\t\t\t\t$receiver_id=$sales_user;\n\t\t\t\t$mail_parameters['sales_user']=$sales_user;\t\t\t\t\n\t\t\t\t\n\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,140,$mail_parameters);\n\t\t\t}\n\t\t\tif($bo_user_type!='tech' && $tech_user)\n\t\t\t{\t\t\t\t\n\t\t\t\t$receiver_id=$tech_user;\n\t\t\t\t$mail_parameters['sales_user']=$tech_user;\t\n\t\t\t\t\n\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,140,$mail_parameters);\n\t\t\t}\n\t\t\tif($bo_user_type!='seo' && $seo_user)\n\t\t\t{\t\t\t\t\n\t\t\t\t$receiver_id=$seo_user;\n\t\t\t\t$mail_parameters['sales_user']=$seo_user;\n\t\t\t\t\n\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,140,$mail_parameters);\n\t\t\t}\n\t\t\tif($bo_user_type!='prod' && $prod_user)\n\t\t\t{\t\t\t\t\n\t\t\t\t$receiver_id=$prod_user;\n\t\t\t\t$mail_parameters['sales_user']=$prod_user;\n\t\t\t\tif($prod_only)\n\t\t\t\t{\n\t\t\t\t\t$mail_parameters['prod_only_text']='yes';\n\t\t\t\t}\n\t\t\t\t$mail_obj->sendQuotePersonalEmail($receiver_id,140,$mail_parameters);\n\t\t\t}\t\n\n\t\t\t//echo $sales_user.\"--\".$tech_user.\"--\".$seo_user.\"--\".$prod_user.$mail_parameters['prod_only_text'];\n\t}", "function buy($garageID){\n if($garageID!=''){ \n if(isset($_SESSION['USERID']) && $_SESSION['USERID']!=''){ \n $productData = $this->Order->CheckGarageDataByID($garageID);\n if(!empty($productData)){\n $returnURL = DOMAIN_URL.'/'.'paypal/success'; //payment success url\n $cancelURL = DOMAIN_URL.'/'.'paypal/cancel'; //payment cancel url\n $notifyURL = DOMAIN_URL.'/'.'paypal/ipn'; //ipn url\n //get particular product data\n\n $userID = $_SESSION['USERID']; //current user id\n \n $userData=$this->Order->getUserDataByID($userID);\n if($userData['iWalletMoney']>0){\n $FInalAmount=$productData['vCoupenPrice']-$userData['iWalletMoney'];\n if($FInalAmount<=0){\n $userWalletamount=$productData['vCoupenPrice'];\n $FInalAmount=0;\n }else{\n $userWalletamount=$productData['vCoupenPrice']-$FInalAmount;\n }\n\n }else{\n $FInalAmount=$productData['vCoupenPrice'];\n $userWalletamount=0;\n }\n \n $logo =DOMAIN_URL.'/files/uploads/logo.png';\n $custom=$userID.','.$userWalletamount;\n\n $this->paypal_lib->add_field('return', $returnURL);\n $this->paypal_lib->add_field('cancel_return', $cancelURL);\n $this->paypal_lib->add_field('notify_url', $notifyURL);\n $this->paypal_lib->add_field('item_name', $productData['vGarageName']);\n $this->paypal_lib->add_field('custom', $custom);\n $this->paypal_lib->add_field('item_number', $productData['iGarageId']);\n $this->paypal_lib->add_field('amount', $FInalAmount); \n $this->paypal_lib->image($logo);\n \n $this->paypal_lib->paypal_auto_form();\n }else{\n $this->viewData['module'] = \"errors/front/404\";\n $this->load->view('template', $this->viewData); \n } \n }else{\n $this->session->set_userdata('last_page', 'order/summary/'.$garageID.'');\n redirect('../user/login'); \n }\n }else{\n $this->viewData['module'] = \"errors/front/404\";\n $this->load->view('template', $this->viewData);\n } \n }", "public function processPayment();", "public function createAbandonedCartEmail($quote,$email)\n {\n try{\n $this->_eventType = 'abandonedCart';\n\n $storeId = $quote->getStoreId();\n $reminderTemplate = Mage::getStoreConfig('sailthru/email/abandoned_cart_template', $storeId);\n\n $newTemplate = array(\n 'template' => $reminderTemplate,\n 'content_html' => $this->_getContent(),\n 'subject' => Mage::getStoreConfig('sailthru/email/abandoned_subject', $storeId),\n 'from_name' => Mage::getStoreConfig('sailthru/email/abandoned_cart_sender_name', $storeId),\n 'from_email' => Mage::getStoreConfig('sailthru/email/abandoned_cart_sender_email', $storeId),\n 'is_link_tracking' => 1,\n 'is_google_analytics' => 1\n );\n\n $templateResponse = $this->apiPost('template', $newTemplate);\n\n //Send Purchase Data\n $data = array(\n 'email' => $email,\n 'incomplete' => 1,\n 'items' => $this->_getItems($quote->getAllVisibleItems()),\n 'reminder_template' => $reminderTemplate\n );\n $response = $this->apiPost(\"purchase\", $data);\n return true;\n } catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }", "public function SendMailUSersSubscribe($PrdList){\n\n\t\t$subject = 'From: '.$this->config->item('email_title').' Subscription';\n\n\t\t$message = '<!DOCTYPE HTML>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n\t\t\t<meta name=\"viewport\" content=\"width=device-width\"/>\n\t\t\t<title>Gift Card</title>\n\t\t\t</head>\n\t\t\t<body marginheight=\"0\" topmargin=\"0\" marginwidth=\"0\" leftmargin=\"0\">\n\t\t\t<table width=\"640\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#7da2c1\">\n\t\t\t<tr>\n\t\t\t<td style=\"padding:40px;\">\n\t\t\t<table width=\"610\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border:#1d4567 1px solid; font-family:Arial, Helvetica, sans-serif;\">\n\t\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t<a href=\"'.base_url().'\"><img src=\"'.base_url().'images/logo/'.$this->data['logo'].'\" alt=\"'.$this->config->item('meta_title').'\" style=\"margin:15px 5px 0; padding:0px; border:none;\"></a>\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td valign=\"top\" style=\"background-color:#FFFFFF;\">\n\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t<h3 style=\"padding:10px 15px; margin:0px; color:#0d487a;\">Subscription for '.ucfirst($this->config->item('email_title')).'</h3>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>';\n \n\t\t\t\t\n $message.= '<table width=\"611\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n \t\t <th width=\"37%\" align=\"left\">Product Title</th>\n\t\t <th width=\"30%\">Quantity</th>\n \t\t <th width=\"33%\">Amount</th>\n \t\t\t</tr>';\n $grantTotal = 0;\n foreach ($PrdList->result() as $cartRow) { \n\n $message.= '\n <tr style=\"font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#292881; padding: 0px 4px 0px 5px;\">\n <td width=\"38%\">'.stripslashes($cartRow->name).'</td>\n <td width=\"23%\" align=\"center\">'.strtoupper($cartRow->quantity).'</td>\n <td width=\"28%\" align=\"center\">'.$this->data['currencySymbol'].$cartRow->indtotal.'</td>\n </tr>\n ';\n \t$grantTotal = $grantTotal + $cartRow->indtotal;\n }\n $private_total = $grantTotal;\n $private_total = $private_total + ($private_total * $cartRow->tax * 0.01) + $PrdList->row()->shippingcost;\n $message.='\n <tr>\n <td>&nbsp;</td>\n </tr>\n ';\n\n $message.='\n <tr>\n <td width=\"30%\">&nbsp;</td>\n <td width=\"30%\" style=\"font-size:14px; font-weight:bold; color:#000000;\" > Subscription Date</td>\n <td width=\"40%\" align=\"left\" style=\"font-size:12px; font-weight:bold; color:#000000;\">'.date(\"F j, Y, g:i a\",strtotime($PrdList->row()->created)).'</td>\n </tr>';\n\t\t\t\t\n\t\t\t\t$shipAddRess = $this->order_model->get_all_details(SHIPPING_ADDRESS,array( 'id' => $PrdList->row()->shippingid ));\n\t\t\t\t\n\n $message.='<tr>\n <td width=\"30%\">&nbsp;</td>\n <td width=\"30%\" style=\"font-size:14px; font-weight:bold; color:#000000;\" > Tax</td>\n <td width=\"40%\" align=\"left\" style=\"font-size:12px; font-weight:bold; color:#000000;\">$ '.$PrdList->row()->tax.' </td>\n </tr>\n <tr>\n <td>&nbsp;</td>\n <td width=\"20%\" style=\"font-size:14px; font-weight:bold; color:#000000;\" > Total </td>\n <td width=\"28%\" align=\"left\" style=\"font-size:18px; font-weight:bold; color:#000000;\">$ '.number_format($private_total+$tax, 2, '.', ' ').'</td>\n </tr>\n\t\t\t\t</table>\n\t\t\t\t\n<div style=\"display:inline-block; float:left; width:100%; font-size:12px;\">\n\t<div style=\"display:inline-block; float:left; width:50%;\">\n\n\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr style=\"border:1px solid #7DA2C1;\">\n <td style=\" font:bold 14px/34px Arial, Helvetica, sans-serif;\tcolor:#000;\tbackground:#7DA2C1; border-bottom:1px solid #b6b3b3;\">Billing Details</td>\n </tr>\n </table>\n \n \n <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-left:15px; font-family:Verdana, Arial, Helvetica, sans-serif;\">\n <tr>\n <td width=\"100\" style=\"color:#000000;\"><strong>Full name </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->full_name).'</td>\n </tr>\n \n <tr>\n <td style=\"color:#000000;\"><strong>Address</strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->address).'</td>\n </tr>\n \n <tr>\n <td style=\"color:#000000;\"><strong>Country</strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->country).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>State</strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->state).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>City </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->city).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>postal code </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->postal_code).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>Phone </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($PrdList->row()->phone_no).'</td>\n </tr>\n <tr>\n <td>&nbsp;</td>\n </tr>\n <tr>\n <td><b>Support Team</b></td>\n </tr>\n <tr>\n <td style=\"font-size:16px; font-weight:bold; color:#935435;\"><strong> '.$this->config->item('email_title').' Team</strong></td>\n </tr>\n </table>\n</div>\n<div style=\"display:inline-block; float:left; width:50%;\">\n<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr style=\"border:1px solid #b6b3b3;\">\n <td style=\" font:bold 14px/34px Arial, Helvetica, sans-serif;\tcolor:#000;\tbackground:#7DA2C1; border-bottom:1px solid #b6b3b3;\">Shipping Details</td>\n </tr>\n </table>\n \n \n <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-left:15px; font-family:Verdana, Arial, Helvetica, sans-serif;\">\n <tr>\n <td width=\"120\" style=\"color:#000000;\"><strong>Full name </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->full_name).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>Address</strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->address1).'</td>\n </tr>\n \n <tr>\n <td style=\"color:#000000;\"><strong>Country</strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->country).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>State/province </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->state).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>City </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->city).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>Zip/postal code </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->postal_code).'</td>\n </tr>\n <tr>\n <td style=\"color:#000000;\"><strong>Phone </strong></td>\n <td>:</td>\n <td style=\"color:#000000; font-weight:bold;\">'.stripslashes($shipAddRess->row()->phone).'</td>\n </tr>\n <tr>\n <td>&nbsp;</td>\n </tr>\n </table>\n</div>\n</div>\n </div>\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">\t\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td width=\"50%\" valign=\"top\" style=\"font-size:12px; padding:10px 15px;\">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td width=\"50%\" valign=\"top\" style=\"font-size:12px; padding:10px 15px;\">\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</body>\n\t\t\t</html>';\n\t\techo $message;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$email_values = array('mail_type'=>'html',\n\t\t\t\t\t\t\t'from_mail_id'=>$this->config->item('site_contact_mail'),\n\t\t\t\t\t\t\t'mail_name'=>$this->config->item('email_title'),\n\t\t\t\t\t\t\t'to_mail_id'=>$PrdList->row()->email,\n\t\t\t\t\t\t\t'cc_mail_id'=>$this->config->item('site_contact_mail'),\n\t\t\t\t\t\t\t'subject_message'=>$subject,\n\t\t\t\t\t\t\t'body_messages'=>$message\n\t\t\t\t\t\t\t);\n\t\t$email_send_to_common = $this->product_model->common_email_send($email_values);\n\t\t\n\t\t\n\t\n\t\treturn;\n\t\n\t}", "function process($handler)\n {\n $c = &$this->c;\n // Instantiate models\n $PaidTxnLog = ClassRegistry::getClass('PaidTxnLogModel');\n $PaidOrder = ClassRegistry::getClass('PaidOrderModel');\n\n $posts = '';\n $res = '';\n $this->handler = $handler;\n $post_vars = Sanitize::getVar($c->params,'form',array());\n\n if(empty($post_vars)) return;\n\n isset($post_vars['merchant_return_link']) and Configure::write('PaidListings.email',true); // Don't send email on return to site because it's already triggered via IPN post - This is a Paypal thing\n\n // Verify if this is really a Paypal post\n $req = 'cmd=_notify-validate';\n\n foreach($post_vars AS $key => $value)\n {\n if(!in_array($key,array('CONTEXT','myAllTextSubmitID','cmd','form_charset')))\n {\n if (@get_magic_quotes_gpc()) {\n $value = stripslashes($value);\n }\n $req .= \"&$key=\".urlencode($value);\n $posts .= \"$key => $value\\r\\n\"; // Used in file log\n }\n }\n\n // post back to PayPal system to validate\n if ($post_vars['test_ipn'] == 1) {\n $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n } else {\n $url = 'https://www.paypal.com/cgi-bin/webscr';\n }\n\n $ch = curl_init(); // Starts the curl handler\n curl_setopt($ch, CURLOPT_URL,$url); // Sets the paypal address for curl\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1); // Set curl to send data using post\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Returns result to a variable instead of echoing\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req); // Add the request parameters to the post\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5); // Sets a time limit for curl in seconds (do not set too low)\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // Enabling certificate verification makes the curl call fail on some servers\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n $res = curl_exec($ch); // run the curl process (and return the result to $result\n curl_close($ch);\n\n // Extract custom fields\n $custom = json_decode($post_vars['custom'],true);\n $order_id = $custom['order_id']; // Local transaction id\n $order = $PaidOrder->findRow(array(\n 'conditions'=>array('PaidOrder.order_id = ' . $order_id)\n ));\n\n if (!preg_match(\"/VERIFIED/\", $res)) {\n // if (strcmp (trim($res), \"VERIFIED\") == 0) {\n\n $PaidTxnLog->addNote(\"Payment status: INVALID return.\");\n\n $PaidOrder->updateOrder($order,array('order_status'=>'Failed'));\n\n $PaidTxnLog->save($order,$post_vars,Sanitize::getString($post_vars,'txn_id'));\n\n die();\n }\n\n $order['txn_id'] = Sanitize::getString($post_vars,'txn_id'); // Make txn_id available in other methods where only the order is passed as a parameter\n\n switch(Sanitize::getString($post_vars,'txn_type'))\n {\n case 'web_accept':\n\n $success = $this->processOneTimePlan($order,$post_vars);\n\n break;\n\n case 'subscr_signup':\n case 'subscr_payment':\n case 'subscr_cancel':\n case 'subscr_failed':\n case 'recurring_payment_suspended_due_to_max_failed_payment':\n\n $success = $this->processSubscriptionPlan($order,$post_vars);\n\n break;\n default:\n\n $success = false;\n\n break;\n }\n\n if(!isset($post_vars['txn_type']))\n {\n switch($post_vars['reason_code'])\n {\n case 'chargeback':\n $PaidOrder->updateOrder($order,array('order_status'=>'Fraud'));\n $c->Paidlistings->processFailedOrder($order);\n break;\n }\n $PaidTxnLog->addNote(\"Reason code: {$post_vars['reason_code']}.\");\n }\n\n $PaidTxnLog->save($order, $post_vars, Sanitize::getString($post_vars,'txn_id'), $success);\n\n return $order;\n }", "function make_transaction_button($product,$item_name,$purchase_id,$amount,$currency)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\t\t$ipn_url=$this->get_ipn_url();\n\n $user_details=array();\n\t\tif (!is_guest())\n\t\t{\n\t\t\t$user_details['first_name']=get_ocp_cpf('firstname');\n\t\t\t$user_details['last_name']=get_ocp_cpf('lastname');\n\t\t\t$user_details['address1']=get_ocp_cpf('building_name_or_number');\n\t\t\t$user_details['city']=get_ocp_cpf('city');\n\t\t\t$user_details['state']=get_ocp_cpf('state');\n\t\t\t$user_details['zip']=get_ocp_cpf('post_code');\n\t\t\t$user_details['country']=get_ocp_cpf('country');\n\n\t\t\tif (($user_details['address1']=='') || ($user_details['city']=='') || ($user_details['zip']=='') || ($user_details['country']==''))\n\t\t\t{\n\t\t\t\t$user_details=array(); // Causes error on PayPal due to it crashing when trying to validate the address\n\t\t\t}\n\t\t}\n\n\t\treturn do_template('ECOM_BUTTON_VIA_PAYPAL',array('_GUID'=>'b0d48992ed17325f5e2330bf90c85762','PRODUCT'=>$product,'ITEM_NAME'=>$item_name,'PURCHASE_ID'=>$purchase_id,'AMOUNT'=>float_to_raw_string($amount),'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url,'MEMBER_ADDRESS'=>$user_details));\n\t}", "public function notificationAction() {\n global $CFG;\n\n // Full strength error logging\n error_reporting(E_ALL);\n ini_set('display_errors', 0);\n ini_set('log_errors', 1);\n\n // Library stuff\n $sagepay = new sagepayserverlib();\n $sagepay->setController($this);\n\n // POST data from SagePay\n $data = $sagepay->getNotification();\n\n // Log the notification data to debug file (in case it's interesting)\n $this->log(var_export($data, true));\n\n // Get the VendorTxCode and use it to look up the purchase\n $VendorTxCode = $data['VendorTxCode'];\n if (!$purchase = $this->bm->getPurchaseFromVendorTxCode($VendorTxCode)) {\n $url = $this->Url('booking/fail') . '/' . $VendorTxCode . '/' . urlencode('Purchase record not found');\n $this->log('SagePay notification: Purchase not found - ' . $url);\n $sagepay->notificationreceipt('INVALID', $url, 'Purchase record not found');\n die;\n }\n\n // Now that we have the purchase object, we can save whatever we got back in it\n $purchase = $this->bm->updateSagepayPurchase($purchase, $data);\n\n // Mailer\n $mail = new maillib();\n $mailpurchase = clone $purchase;\n $mail->initialise($this, $mailpurchase, $this->bm);\n $mail->setExtrarecipients($CFG->backup_email);\n\n // Check VPSSignature for validity\n if (!$sagepay->checkVPSSignature($purchase, $data)) {\n $purchase->status = 'VPSFAIL';\n $purchase->save();\n $url = $this->Url('booking/fail') . '/' . $VendorTxCode . '/' . urlencode('VPSSignature not matched');\n $this->log('SagePay notification: VPS sig no match - ' . $url);\n $sagepay->notificationreceipt('INVALID', $url, 'VPSSignature not matched');\n die;\n }\n\n // Check Status.\n // Work out what next action should be\n $status = $purchase->status;\n if ($status == 'OK' || ($status == 'OK REPEATED')) {\n\n // Send confirmation email\n $url = $this->Url('booking/complete') . '/' . $VendorTxCode;\n $mail->confirm();\n $this->log('SagePay notification: Confirm sent - ' . $url);\n $sagepay->notificationreceipt('OK', $url, '');\n } else if ($status == 'ERROR') {\n $url = $this->Url('booking/fail') . '/' . $VendorTxCode . '/' . urlencode($purchase->statusdetail);\n $this->log('SagePay notification: Booking fail - ' . $url);\n $mail->decline();\n $sagepay->notificationreceipt('OK', $url, $purchase->statusdetail);\n } else {\n $url = $this->Url('booking/decline') . '/' . $VendorTxCode;\n $this->log('SagePay notification: Booking decline - ' . $url);\n $mail->decline();\n $sagepay->notificationreceipt('OK', $url, $purchase->statusdetail);\n }\n\n $purchase->completed = 1;\n $purchase->save();\n\n die;\n }", "function sendsms_tm_unshipped_products($invoices='')\r\n\t{\r\n\t\t\r\n\t\t$sql_trans = \"select inv.invoice_no,a.id,e.franchise_id,a.itemid,group_concat(concat(b.print_name,'-',pnh_id)) as itemname,i_orgprice,login_mobile1,i_price,i_coup_discount,i_discount,group_concat(a.quantity) as qty,c.menuid,a.transid,f.franchise_id,f.franchise_name\r\n\t\t\t\t\t\t\tfrom king_invoice inv\r\n\t\t\t\t\t\t\tjoin king_orders a on a.id=inv.order_id\r\n\t\t\t\t\t\t\tjoin king_dealitems b on a.itemid = b.id\r\n\t\t\t\t\t\t\tjoin king_deals c on b.dealid = c.dealid \r\n\t\t\t\t\t\t\tjoin pnh_menu d on d.id = c.menuid \r\n\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid\r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\twhere inv.invoice_no in ($invoices)\r\n\t\t\t\t\t\t\tgroup by inv.invoice_no\";\r\n\t\t\r\n\t\t$res_trans = $this->db->query($sql_trans);\r\n\t\r\n\t\t$sms_msg = '';\r\n\t\t$datetime = new DateTime('tomorrow');\r\n\t\t\r\n\t\tif($res_trans->num_rows())\r\n\t\t{\r\n\t\t\tforeach($res_trans->result_array() as $row_trans)\r\n\t\t\t{\r\n\t\t\t\t$sms_msg=\"Dear \".$row_trans['franchise_name'].\", your invoice no(\".$row_trans['invoice_no'].\") with \".$row_trans['itemname'].\" products and \".$row_trans['qty'].\" qty is shipped successfully, please expect delivery on \".$datetime->format('d/m/Y');\r\n\t\t\t\t$this->erpm->pnh_sendsms($row_trans['login_mobile1'],$sms_msg,$row_trans['franchise_id'],0,12);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t}", "function handle_transaction()\n\t{\t\n\t\tif ((file_exists(get_file_base().'/data_custom/ecommerce.log')) && (is_writable_wrap(get_file_base().'/data_custom/ecommerce.log')))\n\t\t{\n\t\t\t$myfile=fopen(get_file_base().'/data_custom/ecommerce.log','at');\n\t\t\tfwrite($myfile,serialize($_POST).chr(10));\n\t\t\tfclose($myfile);\n\t\t}\n\n\t\t// assign posted variables to local variables\n\t\t$purchase_id=post_param('custom','-1');\n\n\t\t$txn_type=post_param('txn_type',NULL);\n\n\t\tif ($txn_type=='cart')\n\t\t{\t\n\t\t\trequire_lang('shopping');\n\t\t\t$item_name=do_lang('CART_ORDER',$purchase_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item_name=(substr(post_param('txn_type',''),0,6)=='subscr')?'':post_param('item_name','');\n\t\t}\n\n\t\t$payment_status=post_param('payment_status',''); // May be blank for subscription\n\t\t$reason_code=post_param('reason_code','');\n\t\t$pending_reason=post_param('pending_reason','');\n\t\t$memo=post_param('memo','');\n\t\t$mc_gross=post_param('mc_gross',''); // May be blank for subscription\n\t\t$tax=post_param('tax','');\n\t\tif (($tax!='') && (intval($tax)>0) && ($mc_gross!='')) $mc_gross=float_to_raw_string(floatval($mc_gross)-floatval($tax));\n\t\t$mc_currency=post_param('mc_currency',''); // May be blank for subscription\n\t\t$txn_id=post_param('txn_id',''); // May be blank for subscription\n\t\t$parent_txn_id=post_param('parent_txn_id','-1');\n\t\t$receiver_email=post_param('receiver_email',null);\n\t\tif ($receiver_email===null) $receiver_email=post_param('business');\n\n\t\t// post back to PayPal system to validate\n\t\tif (!ecommerce_test_mode())\n\t\t{\n\t\t\trequire_code('files');\n\t\t\t$pure_post=isset($GLOBALS['PURE_POST'])?$GLOBALS['PURE_POST']:$_POST;\n\t\t\t$x=0;\n\t\t\t$res=mixed();\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$res=http_download_file('https://'.(ecommerce_test_mode()?'www.sandbox.paypal.com':'www.paypal.com').'/cgi-bin/webscr',NULL,false,false,'ocPortal',$pure_post+array('cmd'=>'_notify-validate'));\n\t\t\t\t$x++;\n\t\t\t}\n\t\t\twhile ((is_null($res)) && ($x<3));\n\t\t\tif (is_null($res)) my_exit(do_lang('IPN_SOCKET_ERROR'));\n\t\t\tif (!(strcmp($res,'VERIFIED')==0))\n\t\t\t{\n\t\t\t\tif (post_param('txn_type','')=='send_money') exit('Unexpected'); // PayPal has been seen to mess up on send_money transactions, making the IPN unverifiable\n\t\t\t\tmy_exit(do_lang('IPN_UNVERIFIED').' - '.$res.' - '.flatten_slashed_array($pure_post),strpos($res,'<html')!==false);\n\t\t\t}\n\t\t}\n\n\t\t$txn_type=str_replace('-','_',post_param('txn_type'));\n\t\tif ($txn_type=='subscr-modify')\n\t\t{\n\t\t\t$payment_status='SModified';\n\t\t\t$txn_id=post_param('subscr_id').'-m';\n\t\t}\n\t\telseif ($txn_type=='subscr_signup')\n\t\t{\n\t\t\t$payment_status='Completed';\n\t\t\t$mc_gross=post_param('mc_amount3');\n\t\t\tif (post_param_integer('recurring')!=1) my_exit(do_lang('IPN_SUB_RECURRING_WRONG'));\n\t\t\t$txn_id=post_param('subscr_id');\n\t\t}\n\t\telseif ($txn_type=='subscr_eot' || $txn_type=='recurring_payment_suspended_due_to_max_failed_payment')\n\t\t{\n\t\t\t$payment_status='SCancelled';\n\t\t\t$txn_id=post_param('subscr_id').'-c';\n\t\t}\n\t\telseif ($txn_type=='subscr_payment' || $txn_type=='subscr_failed' || $txn_type=='subscr_cancel')\n\t\t{\n\t\t\texit();\n\t\t}\n\n\t\t$primary_paypal_email=get_value('primary_paypal_email');\n\n\t\tif (!is_null($primary_paypal_email))\n\t\t{\n\t\t\tif ($receiver_email!=$primary_paypal_email) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t} else\n\t\t{\n\t\t\tif ($receiver_email!=$this->_get_payment_address()) my_exit(do_lang('IPN_EMAIL_ERROR'));\n\t\t}\n\n\t\tif (addon_installed('shopping'))\n\t\t{\n\t\t\tif (preg_match('#'.str_replace('xxx','.*',preg_quote(do_lang('shopping:CART_ORDER','xxx'),'#')).'#',$item_name)!=0)\n\t\t\t{\n\t\t\t\t$this->store_shipping_address($purchase_id);\n\t\t\t}\n\t\t}\n\n\t\treturn array($purchase_id,$item_name,$payment_status,$reason_code,$pending_reason,$memo,$mc_gross,$mc_currency,$txn_id,$parent_txn_id);\n\t}", "public function send($tipe)\n {\n if ($tipe == 'all') {\n return TransOrder::sendEmail();\n }else{\n return TransOrder::sendSingleEmail($tipe);\n }\n }", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "public function payWayPurchase()\n\t{\n\t}", "function email_notification($blog_id, $action, $email = false) {\r\n\t global $wpdb;\r\n\t\t\r\n\t\tif (!$email)\r\n\t\t\t$email = get_blog_option($blog_id, 'admin_email');\r\n\t\t\r\n\t if ($action == 'success') {\r\n\r\n $message = str_replace( 'LEVEL', $this->get_level_setting($this->get_level($blog_id), 'name'), $this->get_setting('success_msg') );\r\n\t\t\t$message = str_replace( 'SITEURL', get_site_url( $blog_id ), $message );\r\n\t\t\t$message = str_replace( 'SITENAME', get_blog_option($blog_id, 'blogname'), $message );\r\n\r\n\t wp_mail( $email, $this->get_setting('success_subject'), $message );\r\n\r\n\t $this->log_action( $blog_id, sprintf(__('Signup success email sent to %s', 'psts'), $email) );\r\n\r\n\t } else if ($action == 'receipt') {\r\n\t\t\t//grab default payment info\r\n $result = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'\");\r\n if ($result->term == 1 || $result->term == 3 || $result->term == 12)\r\n $term = sprintf(__('Every %s Month(s)', 'psts'), $result->term);\r\n else\r\n $term = $result->term;\r\n\r\n if ($result->gateway)\r\n $payment_info .= sprintf(__('Payment Method: %s', 'psts'), $result->gateway).\"\\n\";\r\n if ($term)\r\n \t$payment_info .= sprintf(__('Payment Term: %s', 'psts'), $term).\"\\n\";\r\n $payment_info .= sprintf(__('Payment Amount: %s', 'psts'), $result->amount . ' ' . $this->get_setting('currency')).\"\\n\";\r\n\r\n\t $message = str_replace( 'PAYMENTINFO', apply_filters('psts_payment_info', $payment_info, $blog_id), $this->get_setting('receipt_msg') );\r\n $message = str_replace( 'LEVEL', $this->get_level_setting($this->get_level($blog_id), 'name'), $message );\r\n\t\t\t$message = str_replace( 'SITEURL', get_site_url( $blog_id ), $message );\r\n\t\t\t$message = str_replace( 'SITENAME', get_blog_option($blog_id, 'blogname'), $message );\r\n\r\n\t wp_mail( $email, $this->get_setting('receipt_subject'), $message );\r\n\r\n $this->log_action( $blog_id, sprintf(__('Payment receipt email sent to %s', 'psts'), $email) );\r\n\r\n\t } else if ($action == 'canceled') {\r\n\r\n\t //get end date from expiration\r\n\t $end_date = date_i18n(get_blog_option($blog_id, 'date_format'), $this->get_expire($blog_id));\r\n\r\n\t $message = str_replace( 'ENDDATE', $end_date, $this->get_setting('canceled_msg') );\r\n\t $message = str_replace( 'LEVEL', $this->get_level_setting($this->get_level($blog_id), 'name'), $message );\r\n\t\t\t$message = str_replace( 'SITEURL', get_site_url( $blog_id ), $message );\r\n\t\t\t$message = str_replace( 'SITENAME', get_blog_option($blog_id, 'blogname'), $message );\r\n\r\n\t wp_mail( $email, $this->get_setting('canceled_subject'), $message );\r\n\r\n $this->log_action( $blog_id, sprintf(__('Subscription canceled email sent to %s', 'psts'), $email) );\r\n\r\n\t } else if ($action == 'failed') {\r\n\r\n\t $message = str_replace( 'LEVEL', $this->get_level_setting($this->get_level($blog_id), 'name'), $this->get_setting('failed_msg') );\r\n\t\t\t$message = str_replace( 'SITEURL', get_site_url( $blog_id ), $message );\r\n\t\t\t$message = str_replace( 'SITENAME', get_blog_option($blog_id, 'blogname'), $message );\r\n\t\t\twp_mail( $email, $this->get_setting('failed_subject'), $this->get_setting('failed_msg') );\r\n\r\n\t $this->log_action( $blog_id, sprintf(__('Payment failed email sent to %s', 'psts'), $email) );\r\n\r\n\t }\r\n\t}", "public function sellerConfirm() {\n\t\tLog::info ( 'Seller has confirmed the payment:' . $this->user_pk, array (\n\t\t\t\t'c' => '1' \n\t\t) );\n\t\tif (isset ( $_POST ['time'] ) && $_POST ['time'] != '') {\n\t\t\t$timePeriod = $_POST ['time'];\n\t\t\t$subscriptionStartsAt = date ( 'Y-m-d H:i:s' );\n\t\t\t$subscriptionEndsAt = '';\n\t\t\t\n\t\t\tif ($timePeriod == 'quarterPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+3 months' ) );\n\t\t\t} else if ($timePeriod == 'halfannualPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+6 months' ) );\n\t\t\t} else if ($timePeriod == 'annualPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+1 years' ) );\n\t\t\t} else if ($timePeriod == 'phantomPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+5 years' ) );\n\t\t\t} else if ($timePeriod == 'freeTrail') {\n\t\t\t\t$subscriptionEndsAt = date(\"2016-12-31 00:00:00\");\n\t\t\t}\n\t\t\t\n\t\t\t$userRecord = \\DB::table ( 'users' )->where ( 'id', '=', $this->user_pk )->first ();\n\t\t\t$is_business = $userRecord->is_business;\n\t\t\t\n\t\t\t// add subscription start and end date to seller\n\t\t\t$subscription = ThankyouController::addSubscription ( $subscriptionStartsAt, $subscriptionEndsAt, $is_business );\n\t\tif($subscription==1){\n\t\t\tCommonComponent::activityLog ( \"SELLER_CONFIRM_PAYMENT\", SELLER_CONFIRM_PAYMENT, 0, HTTP_REFERRER, CURRENT_URL );\n\t\t\t$stored_uid = $this->user_pk;\n\t\t\t\t\n\t\t\ttry{\n\t\t\t\tif(isset(Auth::User()->lkp_role_id) && (Auth::User()->lkp_role_id == '1')){\n\t\t\t\t\t\n\t\t\t\t\tDB::table ( 'users' )->where ( 'id', $this->user_pk )->update ( array (\n\t\t\t\t\t'is_active' => 1,\n\t\t\t\t\t'is_confirmed' => 1,\n\t\t\t\t\t'is_approved' => 1,\n\t\t\t\t\t'secondary_role_id'=>'2',\n\t\t\t\t\t'is_buyer_paid'=>1,\n\t\t\t\t\t'mail_sent' => 1\n\t\t\t\t\t) );\n\t\t\t\t\tSession::put('last_login_role_id','2');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\tDB::table ( 'users' )->where ( 'id', $this->user_pk )->update ( array (\n\t\t\t'lkp_role_id' => 2,\n\t\t\t'is_active' => 1,\n\t\t\t'is_confirmed' => 1,\n\t\t\t'is_approved' => 1,\n\t\t\t'is_buyer_paid'=>1,\n\t\t\t'mail_sent' => 1\n\t\t\t) );\n\t\t\t\t}\n\t\t\t}catch(Exception $ex){\n\t\t\t}\n\t\t\t// Information email to seller after payment\n\t\t\t\t\n\t\t\t$userData = DB::table ( 'users' )->where ( 'id', $this->user_pk )->select ( 'users.*' )->get ();\n\t\t\t\t\n\t\t\tCommonComponent::send_email ( SELLER_PAYMENT_INFO_MAIL, $userData );\n\t\t\t\n\t\t}\n\t\t\t\n\t\t}\n\t}", "public function paypal_Cancelpayment_property()\n\t{\n\t\tif ($this->checkLogin('A') == '')\n\t\t{\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\t$this->load->library('paypal_class');\n\t\t\t$return_url = base_url().'admin/dispute/paypal_cancelAmount_success_property';\n\t\t\t$cancel_url = base_url().'admin/dispute/paypal_cancelAmount_cancel_property'; \n\t\t\t$notify_url = base_url().'admin/dispute/paypal_cancelAmount_notify_property';\t\n\t\t\t$item_name = $this->config->item('email_title').' Cancel Property Booking Payment';\n\t\t\t$totalAmount = $this->input->post('amount_to_pay');\n\t\t\t$guestEmail = $this->input->post('GuestEmail');\t\t\t\n\t\t\t$BookingNumber = $this->input->post('booking_number');\n\t\t\t$guestPayPalEmail = $this->input->post('guestPayPalEmail');\n $loginUserId = $this->checkLogin('A');\n\t\t\t$quantity = 1;\n\t\t\t$paypal_settings=unserialize($this->config->item('payment_0'));\n\t\t\t$paypal_settings=unserialize($paypal_settings['settings']);\n\n\t\t\tif($paypal_settings['mode'] == 'sandbox')\n\t\t\t{\n\t\t\t\t$this->paypal_class->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->paypal_class->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';\n\t\t\t}\n\n\t\t\t$ctype = ($paypal_settings['mode'] == 'sandbox')?\"USD\":\"USD\";\n\t\t\t$logo = base_url().'images/logo/'.$this->data['logo_img'];\n\n\t\t\t$this->paypal_class->add_field('currency_code', 'USD'); \n\t\t\t$this->paypal_class->add_field('image_url',$logo);\n\t\t\t$this->paypal_class->add_field('business',trim($guestPayPalEmail)); /* Business Email -for pay to guest*/\n\t\t\t$this->paypal_class->add_field('return',$return_url); /*Return URL*/\n\t\t\t$this->paypal_class->add_field('cancel_return', $cancel_url); /*Cancel URL*/\n\t\t\t$this->paypal_class->add_field('notify_url', $notify_url); /*Notify url*/\n\t\t\t$this->paypal_class->add_field('custom', $guestEmail.'|'.$totalAmount.'|'.$BookingNumber); /*Custom Values*/\n\t\t\t$this->paypal_class->add_field('item_name', $item_name); /*Product Name*/\n\t\t\t$this->paypal_class->add_field('user_id', $loginUserId);\n\t\t\t$this->paypal_class->add_field('quantity', $quantity); /*Quantity*/\n\t\t\t$this->paypal_class->add_field('amount', $totalAmount); /*Price*/\n\t\t\t$this->paypal_class->submit_paypal_post(); \n\t\t}\n\t}", "public static function hook_transactional_emails() {\n\n\t\t// Don't send subscription\n\t\tif ( WC_Subscriptions::is_duplicate_site() && ! defined( 'WCS_FORCE_EMAIL' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( 'woocommerce_subscription_status_updated', __CLASS__ . '::send_cancelled_email', 10, 2 );\n\t\tadd_action( 'woocommerce_subscription_status_expired', __CLASS__ . '::send_expired_email', 10, 2 );\n\t\tadd_action( 'woocommerce_customer_changed_subscription_to_on-hold', __CLASS__ . '::send_on_hold_email', 10, 2 );\n\t\tadd_action( 'woocommerce_subscriptions_switch_completed', __CLASS__ . '::send_switch_order_email', 10 );\n\n\t\t$order_email_actions = array(\n\t\t\t'woocommerce_order_status_pending_to_processing',\n\t\t\t'woocommerce_order_status_pending_to_completed',\n\t\t\t'woocommerce_order_status_pending_to_on-hold',\n\t\t\t'woocommerce_order_status_failed_to_processing',\n\t\t\t'woocommerce_order_status_failed_to_completed',\n\t\t\t'woocommerce_order_status_failed_to_on-hold',\n\t\t\t'woocommerce_order_status_completed',\n\t\t\t'woocommerce_generated_manual_renewal_order',\n\t\t\t'woocommerce_order_status_failed',\n\t\t);\n\n\t\tforeach ( $order_email_actions as $action ) {\n\t\t\tadd_action( $action, __CLASS__ . '::maybe_remove_woocommerce_email', 9 );\n\t\t\tadd_action( $action, __CLASS__ . '::send_renewal_order_email', 10 );\n\t\t\tadd_action( $action, __CLASS__ . '::maybe_reattach_woocommerce_email', 11 );\n\t\t}\n\t}", "public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = 'owner@domain.com'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = 'customer@email.com'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"paul@gmail.com\" ] )\n ->addTo('paul@gmail.com')\n ->setReplyTo('paul@gmail.com')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }", "public function sendReceipt()\n {\n $subject = _t(\n 'SilverShop\\ShopEmail.ReceiptSubject',\n 'Order #{OrderNo} receipt',\n '',\n ['OrderNo' => $this->order->Reference]\n );\n\n return $this->sendEmail(\n 'SilverShop/Model/Order_ReceiptEmail',\n $subject,\n self::config()->bcc_receipt_to_admin\n );\n }", "public function customcheckout($userid,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteId)\n\t {\n\t\t/* $parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\tif($lastname=='')\n\t\t{\n\t\t\t$lastname='@';\n\t\t}\n $firstname = implode(\" \", $parts);\n\t\tif($firstname=='')\n\t\t{\n\t\t\t$firstname='@';\n\t\t} */\n\t\t\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t\n\t\t//exit;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>'5','qty'=>1,'price'=>'50'],\n\t\t\t\t\t\t ['product_id'=>'6','qty'=>2,'price'=>'100']\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\n\n /*for sote 4 */\t\t\t\n\t\t /* $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t $helper = $objectManager->get('Webkul\\Marketplace\\Helper\\Data');\n\t\t $helper->setCurrentStore(4); */\n\t\t /* end for sote 4 */\n\t\t\n\t\t\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\t\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t\n\t\t//$quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=4 and is_active=1 order by entity_id ASC limit 1\";\n\t\t$quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 order by entity_id ASC limit 1\";\n\t \n\n\t\t$result_result_cart = $connection->fetchAll($quote_sql_latest);\n\t\t // print_r($result_result_cart); \n\t\t\n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and entity_id='$quoteId' and is_active=1\";\n\t\t//$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=4 and entity_id='$quoteId' and is_active=1\";\n\t\t\n\t\t\n\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\tif(!empty($result_result))\n\t\t{\n\t\t\n\t\t\t $quoteId2=$result_result[0]['entity_id'];\n\t\t\t $quote = $this->quote->create()->load($quoteId2);\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId2);\n\t\t \n\t\t \n\t\t //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress(); \n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n //->setShippingMethod('freeshipping_freeshipping'); //shipping method\n\t\t\t\t\t\t->setShippingMethod($shipping); //shipping method\n\t\t\t\t\t\t\n //$quote->setPaymentMethod('cashondelivery'); //payment method\n\t\t$quote->setPaymentMethod($payment);\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n //$quote->getPayment()->importData(['method' => 'cashondelivery']);\n $quote->getPayment()->importData(['method' => $payment]);\n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n $quote->getId();\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t //$order->setEmailSent(1);\n $increment_id = $order->getRealOrderId();\n\t $lastOrderId = $increment_id;\n\t\t\n\t\t$helper = $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Data'\n );\n\t\t\n\t\t$getProductSalesCalculation = $objectManager->get(\n 'Webkul\\Marketplace\\Observer\\SalesOrderPlaceAfterObserver'\n );\n $getProductSalesCalculation->getProductSalesCalculation($order);\n\n /*send placed order mail notification to seller*/\n\n $salesOrder = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Seller\\Collection'\n )->getTable('sales_order');\n $salesOrderItem = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Seller\\Collection'\n )->getTable('sales_order_item');\n\t\t\n\t\t\n\t\t\n\t\t $paymentCode = '';\n if ($order->getPayment()) {\n $paymentCode = $order->getPayment()->getMethod();\n }\n\n $shippingInfo = '';\n $shippingDes = '';\n\n $billingId = $order->getBillingAddress()->getId();\n\n $billaddress = $objectManager->create(\n 'Magento\\Sales\\Model\\Order\\Address'\n )->load($billingId);\n $billinginfo = $billaddress['firstname'].'<br/>'.\n $billaddress['street'].'<br/>'.\n $billaddress['city'].' '.\n $billaddress['region'].' '.\n $billaddress['postcode'].'<br/>'.\n $objectManager->create(\n 'Magento\\Directory\\Model\\Country'\n )->load($billaddress['country_id'])->getName().'<br/>T:'.\n $billaddress['telephone'];\n\n $payment = $order->getPayment()->getMethodInstance()->getTitle();\n\n\t\t\n\t\t\n\t\t if ($order->getShippingAddress()) {\n $shippingId = $order->getShippingAddress()->getId();\n $address = $objectManager->create(\n 'Magento\\Sales\\Model\\Order\\Address'\n )->load($shippingId);\n $shippingInfo = $address['firstname'].'<br/>'.\n $address['street'].'<br/>'.\n $address['city'].' '.\n $address['region'].' '.\n $address['postcode'].'<br/>'.\n $objectManager->create(\n 'Magento\\Directory\\Model\\Country'\n )->load($address['country_id'])->getName().'<br/>T:'.\n $address['telephone'];\n $shippingDes = $order->getShippingDescription();\n }\n\t\t\n\t\t\n\t\t$adminStoremail = $helper->getAdminEmailId();\n $adminEmail = $adminStoremail ? $adminStoremail : $helper->getDefaultTransEmailId();\n $adminUsername = 'Admin';\n\n $customerModel = $objectManager->create(\n 'Magento\\Customer\\Model\\Customer'\n );\n\n $sellerOrder = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Orders'\n )\n ->getCollection()\n ->addFieldToFilter('order_id', $lastOrderId)\n ->addFieldToFilter('seller_id', ['neq' => 0]);\n\t\t\n\t \n\t foreach ($sellerOrder as $info) {\n $userdata = $customerModel->load($info['seller_id']);\n $username = $userdata['firstname'];\n $useremail = $userdata['email'];\n\n $senderInfo = [];\n $receiverInfo = [];\n\n $receiverInfo = [\n 'name' => $username,\n 'email' => $useremail,\n ];\n $senderInfo = [\n 'name' => $adminUsername,\n 'email' => $adminEmail,\n ];\n $totalprice = '';\n $totalTaxAmount = 0;\n $codCharges = 0;\n $shippingCharges = 0;\n $orderinfo = '';\n\n $saleslistIds = [];\n $collection1 = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Saleslist'\n )->getCollection()\n ->addFieldToFilter('order_id', $lastOrderId)\n ->addFieldToFilter('seller_id', $info['seller_id'])\n ->addFieldToFilter('parent_item_id', ['null' => 'true'])\n ->addFieldToFilter('magerealorder_id', ['neq' => 0])\n ->addFieldToSelect('entity_id');\n\n $saleslistIds = $collection1->getData();\n\n $fetchsale = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Saleslist'\n )\n ->getCollection()\n ->addFieldToFilter(\n 'entity_id', \n ['in' => $saleslistIds]\n );\n $fetchsale->getSelect()->join(\n $salesOrder.' as so', \n 'main_table.order_id = so.entity_id', \n ['status' => 'status']\n );\n\n $fetchsale->getSelect()->join(\n $salesOrderItem.' as soi', \n 'main_table.order_item_id = soi.item_id AND main_table.order_id = soi.order_id', \n [\n 'item_id' => 'item_id', \n 'qty_canceled' => 'qty_canceled', \n 'qty_invoiced' => 'qty_invoiced', \n 'qty_ordered' => 'qty_ordered', \n 'qty_refunded' => 'qty_refunded', \n 'qty_shipped' => 'qty_shipped', \n 'product_options' => 'product_options', \n 'mage_parent_item_id' => 'parent_item_id'\n ]\n );\n foreach ($fetchsale as $res) {\n $product = $objectManager->create(\n 'Magento\\Catalog\\Model\\Product'\n )->load($res['mageproduct_id']);\n\n /* product name */\n $productName = $res->getMageproName();\n $result = [];\n if ($options = unserialize($res->getProductOptions())) {\n if (isset($options['options'])) {\n $result = array_merge($result, $options['options']);\n }\n if (isset($options['additional_options'])) {\n $result = array_merge($result, $options['additional_options']);\n }\n if (isset($options['attributes_info'])) {\n $result = array_merge($result, $options['attributes_info']);\n }\n }\n if ($_options = $result) {\n $proOptionData = '<dl class=\"item-options\">';\n foreach ($_options as $_option) {\n $proOptionData .= '<dt>'.$_option['label'].'</dt>';\n\n $proOptionData .= '<dd>'.$_option['value'];\n $proOptionData .= '</dd>';\n }\n $proOptionData .= '</dl>';\n $productName = $productName.'<br/>'.$proOptionData;\n } else {\n $productName = $productName.'<br/>';\n }\n /* end */\n\n $sku = $product->getSku();\n $orderinfo = $orderinfo.\"<tbody><tr>\n <td class='item-info'>\".$productName.\"</td>\n <td class='item-info'>\".$sku.\"</td>\n <td class='item-qty'>\".($res['magequantity'] * 1).\"</td>\n <td class='item-price'>\".\n $order->formatPrice(\n $res['magepro_price'] * $res['magequantity']\n ).\n '</td>\n </tr></tbody>';\n $totalTaxAmount = $totalTaxAmount + $res['total_tax'];\n $totalprice = $totalprice + ($res['magepro_price'] * $res['magequantity']);\n\n /*\n * Low Stock Notification mail to seller\n */\n if ($helper->getlowStockNotification()) {\n $stockItemQty = $product['quantity_and_stock_status']['qty'];\n if ($stockItemQty <= $helper->getlowStockQty()) {\n $orderProductInfo = \"<tbody><tr>\n <td class='item-info'>\".$productName.\"</td>\n <td class='item-info'>\".$sku.\"</td>\n <td class='item-qty'>\".($res['magequantity'] * 1).'</td>\n </tr></tbody>';\n\n $emailTemplateVariables = [];\n $emailTempVariables['myvar1'] = $orderProductInfo;\n $emailTempVariables['myvar2'] = $username;\n\n $this->_objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Email'\n )->sendLowStockNotificationMail(\n $emailTemplateVariables,\n $senderInfo,\n $receiverInfo\n );\n }\n }\n }\n $shippingCharges = $info->getShippingCharges();\n $totalCod = 0;\n\n if ($paymentCode == 'mpcashondelivery') {\n $totalCod = $info->getCodCharges();\n $codRow = \"<tr class='subtotal'>\n <th colspan='3'>\".__('Cash On Delivery Charges').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($totalCod).\n '</span></td>\n </tr>';\n } else {\n $codRow = '';\n }\n\n $orderinfo = $orderinfo.\"<tfoot class='order-totals'>\n <tr class='subtotal'>\n <th colspan='3'>\".__('Shipping & Handling Charges').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($shippingCharges).\"</span></td>\n </tr>\n <tr class='subtotal'>\n <th colspan='3'>\".__('Tax Amount').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($totalTaxAmount).'</span></td>\n </tr>'.$codRow.\"\n <tr class='subtotal'>\n <th colspan='3'>\".__('Grandtotal').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice(\n $totalprice + \n $totalTaxAmount + \n $shippingCharges + \n $totalCod\n ).'</span></td>\n </tr></tfoot>';\n\n $emailTemplateVariables = [];\n if ($shippingInfo != '') {\n $isNotVirtual = 1;\n } else {\n $isNotVirtual = 0;\n }\n $emailTempVariables['myvar1'] = $order->getRealOrderId();\n $emailTempVariables['myvar2'] = $order['created_at'];\n $emailTempVariables['myvar4'] = $billinginfo;\n $emailTempVariables['myvar5'] = $payment;\n $emailTempVariables['myvar6'] = $shippingInfo;\n $emailTempVariables['isNotVirtual'] = $isNotVirtual;\n $emailTempVariables['myvar9'] = $shippingDes;\n $emailTempVariables['myvar8'] = $orderinfo;\n $emailTempVariables['myvar3'] = $username;\n\n $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Email'\n )->sendPlacedOrderEmail(\n $emailTempVariables,\n $senderInfo,\n $receiverInfo\n );\n }\n\t \n\t \n if($order->getEntityId())\n\t\t {\n // $result['order_id']= $order->getRealOrderId();\n\t\t \n\t\t \n/* \t\t $quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 order by entity_id ASC limit 1\";\n\t $result_result = $connection->fetchAll($quote_sql);\n\t\t print_r($result_result); */\n\t\t\t\tif(!empty($result_result_cart))\n\t\t\t\t{\n\t\t\t\t\t $quoteId3=$result_result_cart[0]['entity_id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($quoteId3==$quoteId)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $quote_sql3 = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 and entity_id !=$quoteId3\";\n\t\t\t\t\t\t\t\t $result_result3 = $connection->fetchAll($quote_sql3);\n\t\t\t\t\t\t\t\t if(!empty($result_result3))\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t foreach ($result_result3 as $qt)\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t$qtid=$qt['entity_id'];\n\t\t\t\t\t\t\t\t\t\t $quote_sql = \"delete FROM quote where entity_id=$qtid \";\n\t\t\t\t\t\t\t\t\t\t $connection->rawQuery($quote_sql); \n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t$quote_sql2 = \"Select * FROM quote_item where quote_id=$quoteId limit 1\";\n\t\t\t\t\t\t\t\t $result_result2 = $connection->fetchAll($quote_sql2);\n\t\t\t\t\t\t\t\t\t//print_r($result_result2);\n\t\t\t\t\t\t\t\t\tif(!empty($result_result2))\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t\t\t\t\t\t\t\t$checkoutSession->setQuoteId($quoteId3);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$quote_item_id=$result_result2[0]['item_id'];\n\t\t\t\t\t\t\t\t\t\t$quote_item_productid=$result_result2[0]['product_id'];\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$quote_sql24 = \"Select * FROM quote_item where quote_id=$quoteId3 and product_id=$quote_item_productid\";\n\t\t\t\t\t\t\t\t $result_result24 = $connection->fetchAll($quote_sql24);\n\t\t\t\t\t\t\t\t\t\tif(!empty($result_result24))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$quote_item_id=$result_result24[0]['item_id'];\n\t\t\t\t\t\t\t\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();//instance of object manager\n\t\t\t\t\t\t\t\t\t\t\t$itemModel = $objectManager->create('Magento\\Quote\\Model\\Quote\\Item');//Quote item mode\n\t\t\t\t\t\t\t\t\t\t\t$quoteItem=$itemModel->load($quote_item_id);//load particular item which you want to delete by his item id\n\t\t\t\t\t\t\t\t\t\t\t$quoteItem->delete();//deletes the item\n\t\t\t\t\t\t\t\t\t\t\t$this->cart->removeItem($quote_item_id);\n\t\t\t\t\t\t\t\t\t\t $this->cart->save();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"error\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n }else{\n $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n } \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t // $result[]=array('satus'=>'error');\n\t\t \n\t\t \n\t\t \n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t}\t\t\t\n\t\t\n \t\t\t\n\t return $result; \n\t\n\t }", "function sendEmail_supplier($details, $sitetitle) {\n\t\t\t$currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingordersupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingordersupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingorderadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingorderadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\n\t\t\t\n\t\t}", "function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}", "function EmailCart(){\n if(isset($_REQUEST['email']) && isset($_REQUEST['carturl'])){\n if(!is_email($_REQUEST['email'])) return;\n $admin_email = get_bloginfo(\"admin_email\");\n $email = array();\n $subject = __(\"Someone sent you a cart!\",\"wpdm-premium-packages\");\n\n $message = file_get_contents(WPDMPP_BASE_DIR.'templates/email-templates/wpdm-pp-email-cart.html');\n\n $email['subject'] = $subject;\n $email['body'] = $message;\n $email['headers'] = 'From: '.$admin_email.'' . \"\\r\\nContent-type: text/html\\r\\n\";\n\n $params = array(\n '[#date#]' => date(get_option('date_format'),time()),\n '[#homeurl#]' => home_url('/'),\n '[#sitename#]' => get_bloginfo('name'),\n '[#cartdata#]' => $_REQUEST['carturl'],\n '[#carturl#]' => $_REQUEST['carturl'],\n '[#support_email#]' => $admin_email,\n '[#logo#]' => has_site_icon() ? '<img src='.get_site_icon_url().'>' : ''\n );\n\n $email['body'] = str_replace(array_keys($params), array_values($params), $email['body']);\n\n $email = apply_filters(\"email_saved_cart\", $email, $_REQUEST);\n\n wp_mail($_REQUEST['email'],$email['subject'],$email['body'],$email['headers']);\n\n do_action(\"wpdm_pp_emailed_cart\", $_REQUEST['carturl']);\n\n die('sent');\n }\n }", "public function sendOfferMail($variables)\r\n {\r\n\r\n $shopContext = Shopware()->Container()->get('shopware_storefront.context_service')->getShopContext();\r\n\r\n $context = array(\r\n 'sOrderDetails' => $variables[\"sOrderDetails\"],\r\n\r\n 'billingaddress' => $variables[\"billingaddress\"],\r\n 'shippingaddress' => $variables[\"shippingaddress\"],\r\n 'additional' => $variables[\"additional\"],\r\n\r\n 'sTaxRates' => $variables[\"sTaxRates\"],\r\n 'sShippingCosts' => $variables[\"sShippingCosts\"],\r\n 'sAmount' => $variables[\"sAmount\"],\r\n 'sAmountNet' => $variables[\"sAmountNet\"],\r\n\r\n 'sOrderNumber' => $variables[\"ordernumber\"],\r\n 'sOrderDay' => $variables[\"sOrderDay\"],\r\n 'sOrderTime' => $variables[\"sOrderTime\"],\r\n 'sComment' => $variables[\"customerComment\"],\r\n\r\n 'attributes' => $variables[\"attributes\"],\r\n 'sCurrency' => $this->admin->sSYSTEM->sCurrency[\"currency\"],\r\n\r\n 'sLanguage' => $shopContext->getShop()->getId(),\r\n\r\n 'sSubShop' => $shopContext->getShop()->getId(),\r\n\r\n 'sEsd' => $variables[\"sEsd\"],\r\n 'sNet' => $this->admin->sNet\r\n );\r\n\r\n // Support for individual payment means with custom-tables\r\n if ($variables[\"additional\"][\"payment\"][\"table\"]) {\r\n $paymentTable = $this->db->fetchRow(\"\r\n SELECT * FROM {$variables[\"additional\"][\"payment\"][\"table\"]}\r\n WHERE userID=?\",\r\n array($variables[\"additional\"][\"user\"][\"id\"])\r\n );\r\n $context[\"sPaymentTable\"] = $paymentTable ? : array();\r\n } else {\r\n $context[\"sPaymentTable\"] = array();\r\n }\r\n\r\n if ($variables[\"sDispatch\"]) {\r\n $context['sDispatch'] = $variables[\"sDispatch\"];\r\n }\r\n\r\n $mail = null;\r\n\r\n if (!($mail instanceof \\Zend_Mail)) {\r\n $mail = Shopware()->TemplateMail()->createMail('sOfferMail', $context);\r\n }\r\n\r\n $mail->addTo($mail->getFrom());\r\n if (!($mail instanceof \\Zend_Mail)) {\r\n return;\r\n }\r\n $mail->send();\r\n\r\n }", "public function PaypalGetAndDoExpressCheckout($oPaypal){\n if (!isset($_GET['token'])){\n header('Location:'.'http://localhost/PHPScripts_website/live_demo/buy_ticket.php?c=cancel'); \n }\n\n // *** Checkout process (get and do expresscheckout) \n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n\n // GetExpressCheckoutDetails (get orders, buyer, transaction informations)\n $response = $oPaypal->request('GetExpressCheckoutDetails', array(\n 'TOKEN' => $_GET['token']\n ));\n\n //Store buyer information\n $oPaypal->RecordPaypalPayer($response); \n\n // Store order\n $oOrder = new Order();\n\n //Record order\n $id_cat = 1;\n $sIdOrder = $oOrder->RecordOrder($response, $id_cat);\n\n if($response){\n // if checkout success\n if($response['CHECKOUTSTATUS'] == 'PaymentActionCompleted'){\n die('This payment has already been validated');\n }\n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n die();\n }\n\n // DoExpressCheckoutPayment setting\n $params = array(\n 'TOKEN' => $response['TOKEN'],\n 'PAYERID'=> $response['PAYERID'],\n 'PAYMENTREQUEST_0_PAYMENTACTION'=>'Sale',\n 'PAYMENTREQUEST_0_AMT' => $response['AMT'],\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $response['ITEMAMT'],\n );\n\n foreach($_SESSION['tickets'] as $k => $ticket){\n // Send again order informations to paypal for the history buyer purchases.\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // DoExpressCheckoutPayment\n $response = $oPaypal->request('DoExpressCheckoutPayment',$params );\n\n if($response){\n // DoExpressCheckoutPayment is success then update order in database ('Transaction ID', 'paymentstatus'...=\n $oOrder->updateOrder($sIdOrder, $response);\n\n if ($response['PAYMENTINFO_0_PAYMENTSTATUS'] == 'Completed'){\n // Send mail confirmation (with order information and ticket pdf link). A FAIRE\n echo \"<br>the transaction n°{$response['PAYMENTINFO_0_TRANSACTIONID']} was successful\";\n } \n }else{\n $oPaypal->recordErrorOrder($oPaypal->errors, $sIdOrder);\n }\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n\n}", "public function paypalRequest() {\r\n $this->dashboard_p_model->paypalConfig();\r\n if ($_POST) {\r\n $ItemName = $_POST[\"itemname\"]; //Item Name\r\n $ItemPrice = $_POST[\"itemprice\"]; //Item Price\r\n $ItemNumber = $_POST[\"itemnumber\"]; //Item Number\r\n $ItemDesc = $_POST[\"itemdesc\"]; //Item Number\r\n //$ItemQty = $_POST[\"itemQty\"]; // Item Quantity\r\n $ItemQty = 1;\r\n //$ItemTotalPrice = ($ItemPrice * $ItemQty); //(Item Price x Quantity = Total) Get total amount of product; \r\n $ItemTotalPrice = $ItemPrice;\r\n //call the paypal API \r\n\r\n $GrandTotal = $ItemTotalPrice;\r\n $TotalTaxAmount = 0;\r\n $ShippinCost = 0;\r\n $HandalingCost = 0;\r\n $ShippinDiscount = 0;\r\n $InsuranceCost = 0;\r\n\r\n //Parameters for SetExpressCheckout, which will be sent to PayPal\r\n $padata = '&METHOD=SetExpressCheckout' .\r\n '&RETURNURL=' . urlencode(PayPalReturnURL) .\r\n '&CANCELURL=' . urlencode(PayPalCancelURL) .\r\n '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode(\"SALE\") .\r\n '&L_PAYMENTREQUEST_0_NAME0=' . urlencode($ItemName) .\r\n '&L_PAYMENTREQUEST_0_NUMBER0=' . urlencode($ItemNumber) .\r\n '&L_PAYMENTREQUEST_0_DESC0=' . urlencode($ItemDesc) .\r\n '&L_PAYMENTREQUEST_0_AMT0=' . urlencode($ItemPrice) .\r\n '&L_PAYMENTREQUEST_0_QTY0=' . urlencode($ItemQty) .\r\n '&NOSHIPPING=0' . //set 1 to hide buyer's shipping address, in-case products that does not require shipping\r\n\r\n '&PAYMENTREQUEST_0_ITEMAMT=' . urlencode($ItemTotalPrice) .\r\n '&PAYMENTREQUEST_0_TAXAMT=' . urlencode($TotalTaxAmount) .\r\n '&PAYMENTREQUEST_0_SHIPPINGAMT=' . urlencode($ShippinCost) .\r\n '&PAYMENTREQUEST_0_HANDLINGAMT=' . urlencode($HandalingCost) .\r\n '&PAYMENTREQUEST_0_SHIPDISCAMT=' . urlencode($ShippinDiscount) .\r\n '&PAYMENTREQUEST_0_INSURANCEAMT=' . urlencode($InsuranceCost) .\r\n '&PAYMENTREQUEST_0_AMT=' . urlencode($GrandTotal) .\r\n '&PAYMENTREQUEST_0_CURRENCYCODE=' . urlencode(PayPalCurrencyCode) .\r\n '&LOCALECODE=GB' . //PayPal pages to match the language on your website.\r\n '&LOGOIMG=http://www.sanwebe.com/wp-content/themes/sanwebe/img/logo.png' . //site logo\r\n '&CARTBORDERCOLOR=FFFFFF' . //border color of cart\r\n '&ALLOWNOTE=1';\r\n ############# set session variable we need later for \"DoExpressCheckoutPayment\" #######\r\n $_SESSION['ItemName'] = $ItemName; //Item Name\r\n $_SESSION['ItemPrice'] = $ItemPrice; //Item Price\r\n $_SESSION['ItemNumber'] = $ItemNumber; //Item Number\r\n $_SESSION['ItemDesc'] = $ItemDesc; //Item Number\r\n $_SESSION['ItemQty'] = $ItemQty; // Item Quantity\r\n $_SESSION['ItemTotalPrice'] = $ItemTotalPrice; //(Item Price x Quantity = Total) Get total amount of product; \r\n $_SESSION['TotalTaxAmount'] = $TotalTaxAmount; //Sum of tax for all items in this order. \r\n $_SESSION['HandalingCost'] = $HandalingCost; //Handling cost for this order.\r\n $_SESSION['InsuranceCost'] = $InsuranceCost; //shipping insurance cost for this order.\r\n $_SESSION['ShippinDiscount'] = $ShippinDiscount; //Shipping discount for this order. Specify this as negative number.\r\n $_SESSION['ShippinCost'] = $ShippinCost; //Although you may change the value later, try to pass in a shipping amount that is reasonably accurate.\r\n $_SESSION['GrandTotal'] = $GrandTotal;\r\n\r\n //We need to execute the \"SetExpressCheckOut\" method to obtain paypal token\r\n\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('SetExpressCheckout', $padata, PayPalApiUsername, PayPalApiPassword, PayPalApiSignature, PayPalMode);\r\n /* echo '-------------------------';\r\n echo(\"<pre>\");\r\n print_r($httpParsedResponseAr);\r\n echo(\"</pre>\");*/\r\n //Respond according to message we receive from Paypal\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n //Redirect user to PayPal store with Token received.\r\n $paypalurl = 'https://www.'.PayPalMode.'.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . $httpParsedResponseAr[\"TOKEN\"] . '';\r\n // echo $paypalurl;\r\n header('Location: ' . $paypalurl);\r\n return true;\r\n } else {\r\n //Show error message\r\n $this->session->userdata[\"paypal_msg\"] = ' <div style=\"color:red\"><b>Error : </b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n redirect(base_url().'dasboardProfessional');\r\n\t\t\t /* echo '<pre>';\r\n print_r($httpParsedResponseAr);\r\n echo '</pre>';*/\r\n // return false;\r\n }\r\n }\r\n //***\r\n //Paypal redirects back to this page using ReturnURL, We should receive TOKEN and Payer ID\r\n if (isset($_GET[\"token\"]) && isset($_GET[\"PayerID\"])) {\r\n //we will be using these two variables to execute the \"DoExpressCheckoutPayment\"\r\n //Note: we haven't received any payment yet.\r\n $token = $_GET[\"token\"];\r\n $payer_id = $_GET[\"PayerID\"];\r\n //get session variables\r\n $ItemName = $_SESSION['ItemName']; //Item Name\r\n $ItemPrice = $_SESSION['ItemPrice']; //Item Price\r\n $ItemNumber = $_SESSION['ItemNumber']; //Item Number\r\n $ItemDesc = $_SESSION['ItemDesc']; //Item Number\r\n $ItemQty = $_SESSION['ItemQty']; // Item Quantity\r\n $ItemTotalPrice = $_SESSION['ItemTotalPrice']; //(Item Price x Quantity = Total) Get total amount of product; \r\n $TotalTaxAmount = $_SESSION['TotalTaxAmount']; //Sum of tax for all items in this order. \r\n $HandalingCost = $_SESSION['HandalingCost']; //Handling cost for this order.\r\n $InsuranceCost = $_SESSION['InsuranceCost']; //shipping insurance cost for this order.\r\n $ShippinDiscount = $_SESSION['ShippinDiscount']; //Shipping discount for this order. Specify this as negative number.\r\n $ShippinCost = $_SESSION['ShippinCost']; //Although you may change the value later, try to pass in a shipping amount that is reasonably accurate.\r\n $GrandTotal = $_SESSION['GrandTotal'];\r\n\r\n $padata = '&TOKEN=' . urlencode($token) .\r\n '&PAYERID=' . urlencode($payer_id) .\r\n '&PAYMENTREQUEST_0_PAYMENTACTION=' . urlencode(\"SALE\") .\r\n //set item info here, otherwise we won't see product details later\t\r\n '&L_PAYMENTREQUEST_0_NAME0=' . urlencode($ItemName) .\r\n '&L_PAYMENTREQUEST_0_NUMBER0=' . urlencode($ItemNumber) .\r\n '&L_PAYMENTREQUEST_0_DESC0=' . urlencode($ItemDesc) .\r\n '&L_PAYMENTREQUEST_0_AMT0=' . urlencode($ItemPrice) .\r\n '&L_PAYMENTREQUEST_0_QTY0=' . urlencode($ItemQty) .\r\n /*\r\n //Additional products (L_PAYMENTREQUEST_0_NAME0 becomes L_PAYMENTREQUEST_0_NAME1 and so on)\r\n '&L_PAYMENTREQUEST_0_NAME1='.urlencode($ItemName2).\r\n '&L_PAYMENTREQUEST_0_NUMBER1='.urlencode($ItemNumber2).\r\n '&L_PAYMENTREQUEST_0_DESC1=Description text'.\r\n '&L_PAYMENTREQUEST_0_AMT1='.urlencode($ItemPrice2).\r\n '&L_PAYMENTREQUEST_0_QTY1='. urlencode($ItemQty2).\r\n */\r\n\r\n '&PAYMENTREQUEST_0_ITEMAMT=' . urlencode($ItemTotalPrice) .\r\n '&PAYMENTREQUEST_0_TAXAMT=' . urlencode($TotalTaxAmount) .\r\n '&PAYMENTREQUEST_0_SHIPPINGAMT=' . urlencode($ShippinCost) .\r\n '&PAYMENTREQUEST_0_HANDLINGAMT=' . urlencode($HandalingCost) .\r\n '&PAYMENTREQUEST_0_SHIPDISCAMT=' . urlencode($ShippinDiscount) .\r\n '&PAYMENTREQUEST_0_INSURANCEAMT=' . urlencode($InsuranceCost) .\r\n '&PAYMENTREQUEST_0_AMT=' . urlencode($GrandTotal) .\r\n '&PAYMENTREQUEST_0_CURRENCYCODE=' . urlencode($PayPalCurrencyCode);\r\n\r\n //We need to execute the \"DoExpressCheckoutPayment\" at this point to Receive payment from user.\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('DoExpressCheckoutPayment', $padata, PayPalApiUsername, PayPalApiPassword, PayPalApiSignature, PayPalMode);\r\n\r\n //Check if everything went ok..\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n\r\n //echo '<h2>Success</h2>';\r\n // echo 'Your Transaction ID : ' . urldecode($httpParsedResponseAr[\"PAYMENTINFO_0_TRANSACTIONID\"]);\r\n\r\n /*\r\n //Sometimes Payment are kept pending even when transaction is complete.\r\n //hence we need to notify user about it and ask him manually approve the transiction\r\n */\r\n\r\n if ('Completed' == $httpParsedResponseAr[\"PAYMENTINFO_0_PAYMENTSTATUS\"]) {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:green\">Payment Received! Your product will be sent to you very soon!</div>';\r\n\t\t\t\t\t// do data insertions here\r\n } elseif ('Pending' == $httpParsedResponseAr[\"PAYMENTINFO_0_PAYMENTSTATUS\"]) {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\">Transaction Complete, but payment is still pending! ' .\r\n 'You need to manually authorize this payment in your <a target=\"_new\" href=\"http://www.paypal.com\">Paypal Account</a></div>';\r\n }\r\n\r\n // we can retrive transection details using either GetTransactionDetails or GetExpressCheckoutDetails\r\n // GetTransactionDetails requires a Transaction ID, and GetExpressCheckoutDetails requires Token returned by SetExpressCheckOut\r\n $padata = '&TOKEN=' . urlencode($token);\r\n\r\n $httpParsedResponseAr = $this->dashboard_p_model->PPHttpPost('GetExpressCheckoutDetails', $padata, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode);\r\n\r\n if (\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\r\n\r\n \t\t\t\t\t\r\n\t\t\t\t\t$buyerName = $httpParsedResponseAr[\"FIRSTNAME\"].' '.$httpParsedResponseAr[\"LASTNAME\"];\r\n\t\t\t\t\t$buyerEmail = urldecode($httpParsedResponseAr[\"EMAIL\"]);\r\n\t\t\t\t\t$transactionID =urldecode($httpParsedResponseAr[\"PAYMENTREQUEST_0_TRANSACTIONID\"]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$insert_row = $this->dashboard_p_model->savePaypalTransaction($buyerName,$buyerEmail,$transactionID,$ItemName,$ItemNumber, $ItemTotalPrice,$ItemQTY,$ItemDesc);\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($insert_row){\r\n\t\t\t\t\t \t\t\r\n\t\t\t\t\t \tredirect(base_url().'dasboardProfessional');\r\n\t\t\t\t\t}\r\n\r\n // return true;\r\n } else {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\"><b>GetTransactionDetails failed:</b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n\t\t\t\t\tredirect(base_url().'dasboardProfessional');\r\n \r\n\t\t\t\t // echo '<pre>';\r\n // print_r($httpParsedResponseAr);\r\n // echo '</pre>';\r\n // return false;\r\n }\r\n \r\n } else {\r\n $this->session->userdata[\"paypal_msg\"] = '<div style=\"color:red\"><b>Error : </b>' . urldecode($httpParsedResponseAr[\"L_LONGMESSAGE0\"]) . '</div>';\r\n redirect(base_url().'dasboardProfessional');\r\n\t\t\t\t//echo '<pre>';\r\n //print_r($httpParsedResponseAr);\r\n //echo '</pre>';\r\n //return false;\r\n }\r\n\r\n //*** \r\n }\r\n }", "public function processPayment(){\r\n return true;\r\n }", "public static function sendEmail($data)\n {\n $invoiceData = Invoice::where('id', '=', $data['invoice_id'])->first();\n $profileInfo = User::where('id', '=', Auth::user()->id)->first();\n $data['last_id'] = $data['invoice_id'];\n $data['invoice_data'] = $invoiceData;\n\n if (trim($invoiceData->additional_email) != '') {\n $additionEmail = $invoiceData->email . ',' . $invoiceData->additional_email;\n } else {\n $additionEmail = $invoiceData->email;\n }\n\n $dataToEmail['item'] = InvoiceItem::where('invoice_id', '=', $data['invoice_id'])->get();\n\n Session::flash('email', $additionEmail);\n $additionEmail = explode(',', $additionEmail);\n\n if ($data['payment_method'] == 'paypal') {\n $data['paypalurl'] = $data['pay_pal_config']['paypal_invoice_link'] . $data['invoice_url'];\n } else {\n $data['paypalurl'] = url('') . '/pay/' . $data['invoice_url'];\n }\n \n \n $dataToEmail['profile_info'] = $profileInfo;\n $dataToEmail['invoice_data'] = $invoiceData;\n $dataToEmail['to'] = $invoiceData->email;\n $dataToEmail['subject'] = 'New Invoice from ' . $data['invoice_data']->company_name;\n $dataToEmail['body'] = view('emails.invoice', compact('data'));\n $dataToEmail['sender'] = env('NO_REPLY_EMAIL', 'noreply@invoyce.me');\n $dataToEmail['cc'] = $invoiceData->addition_email;\n\n $dataToEmailSecond['to'] = $profileInfo->email;\n $dataToEmailSecond['subject'] = 'Invoice Sent to ' . $data['invoice_data']->company_name;\n $dataToEmailSecond['body'] = view('emails.invoice_user', compact('data'));\n $dataToEmailSecond['sender'] = env('NO_REPLY_EMAIL', 'noreply@invoyce.me');\n if ($data['payment_method'] == 'paypal'){\n\n } else{\n _mail($dataToEmail);\n }\n\n _mail($dataToEmailSecond);\n }", "function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}", "public function payments()\n {\n $users = User::where([['total_paid', '<', '110'],['active','1']])->get();\n foreach ($users as $user){\n Mail::to($user->email)->cc(['lemay.ryan@gmail.com','rlemay1@msn.com'])->send(new OutStandingPayment($user));\n }\n\n }", "public function onAfterPayment($context, &$transaction, $params, $project, $reward) {\n \n $app = JFactory::getApplication();\n /** @var $app JSite **/\n \n if($app->isAdmin()) {\n return;\n }\n\n $doc = JFactory::getDocument();\n /** @var $doc JDocumentHtml **/\n \n // Check document type\n $docType = $doc->getType();\n if(strcmp(\"raw\", $docType) != 0){\n return;\n }\n \n if(strcmp(\"com_crowdfunding.notify.paypal\", $context) != 0){\n return;\n }\n \n // Send mails\n $this->sendMails($project, $transaction);\n }", "public function onSendMail(OrderItemStateEvent $event) {\n $line = $event->getOrderItem();\n if ($line->get('field_estado')->value == 'enviado') {\n $order = $line->getOrder();\n if ($this->checkOrderSent($order)) {\n $commerce_order = new OrderController($order);\n /** @var User $proveedor */\n $proveedor = User::load($this->account->id());\n $lines = $commerce_order->getOrderItemsProvider($proveedor);\n\n $mail = Mail::load(Mail::TYPE_SENT_ORDER_PROVIDER);\n if ($mail instanceof Mail) {\n $subject = $mail->getSubject();\n $body = $mail->getBody();\n\n if ($customer = $order->getCustomer()) {\n $langcode = $customer->getPreferredLangcode();\n }\n else {\n $langcode = $this->languageManager->getDefaultLanguage()->getId();\n }\n\n $to = $order->getEmail();\n\n $profiles = $order->collectProfiles();\n $envio = '';\n if (isset($profiles['shipping']) && $profiles['shipping'] instanceof Profile) {\n $envio = [\n '#theme' => 'correo_informacion_envio',\n '#profile' => $profiles['shipping'],\n ];\n $envio = \\Drupal::service('renderer')->render($envio);\n }\n\n $token_service = \\Drupal::token();\n $subject = $token_service->replace($subject, [\n 'commerce_order' => $order\n ]);\n $body = $token_service->replace($body, [\n 'commerce_order' => $order\n ]);\n $body = str_replace('[datos_envio]', $envio, $body);\n\n $resumen = [\n '#theme' => 'correo_resumen_pedido_proveedor',\n '#order_items' => $lines,\n ];\n $resumen = \\Drupal::service('renderer')->render($resumen);\n $body = str_replace('[resumen]', $resumen, $body);\n $params = [\n 'from' => $order->getStore()->getEmail(),\n 'subject' => $subject,\n 'body' => ['#markup' => Markup::create($body)],\n ];\n\n $this->mailManager->mail('commerce', 'receipt', $to, $langcode, $params);\n\n \\Drupal::logger('correo')->info('Pedido #' . $order->id() . ' enviado a ' . $to);\n\n }\n }\n $this->checkOrderCompleted($order);\n }\n }", "public function confirmPayment(){\n $response = $this->client->queryTransaction(Input::get('AccessCode'));\n $transactionResponse = $response->Transactions[0];\n\n if ($transactionResponse->TransactionStatus) {\n //echo 'Payment successful! ID: '.$transactionResponse->TransactionID;\n /*\n echo $transactionResponse->Options[0]['Value'].' <br/>';\n echo $transactionResponse->Options[1]['Value'].' <br/>';\n echo $transactionResponse->Options[2]['Value'];\n */\n $transaction = new IcePayTransaction();\n $transaction->user_id = Auth::user()->id;\n $transaction->tid = $transactionResponse->TransactionID; //transaction id or transaction bordereaux\n $transaction->sender_email = Auth::user()->email;//$payer['email']; //sender's email\n $transaction->receiver_email = $transactionResponse->Options[1]['Value']; //receiver's email or number\n $transaction->type = 'EWAY_'.$transactionResponse->Options[0]['Value'];\n $transaction->status = 'pending';//$transaction_json['related_resources'][0]['sale']['state'];\n $transaction->amount = $transactionResponse->TotalAmount / 100; //total amount deducted and transferred\n $transaction->currency = $transactionResponse->Options[2]['Value'];\n $transaction->save();\n \n $email = Auth::user()->email;//$payer['email'];\n $username = Auth::user()->username;\n \n Mail::send(['html'=>'emails.auth.transactions'], array('tdate' => date('Y-m-d H:i:s'),\n 'tid' => $transactionResponse->TransactionID,\n 'sender_email'=>Auth::user()->email,\n 'sender_number'=>Auth::user()->number,\n 'receiver_email'=>$transaction->receiver_email,\n 'receiver_number'=>$transaction->receiver_email,\n 'status'=>'PENDING',\n 'amount'=> ($transaction->amount - $transactionResponse->Options[3]['Value'] ) .' '.$transaction->currency,\n 'charge'=>$transactionResponse->Options[3]['Value'].' '.$transaction->currency,\n 'total'=>$transaction->amount . ' '.$transaction->currency,\n 'mode'=>$transaction->type)\n , function($message) use ($email, $username){\n\t\t \t\t\t$message->to(array($email,'larryakah@gmail.com','service@iceteck.com', 'rocardpp@gmail.com'), $username)->subject('Transaction Receipt');\n\t\t\t \t});\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertMessage', 'EWAY Transaction Successful');\n \n } else {\n $errors = str_split($transactionResponse->ResponseMessage); //previously splitte the string at the ', ' points\n foreach ($errors as $error) {\n $errmsg .= \"Payment failed: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n }\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', $errmsg);\n }\n }", "private function _generateInvoice()\n {\n $order = $this->_getOrder();\n if ($order->canInvoice()) {\n $invoice = $order->prepareInvoice();\n\n $invoice->register();\n Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder())\n ->save();\n \n $invoice->pay()->save();\n\n $order->save();\n\n $invoice->sendEmail(\n (boolean) Mage::getStoreConfig(\n 'payment/paymentnetwork_pnsofortueberweisung/send_mail', \n Mage::app()->getStore()->getStoreId()\n ), ''\n );\n }\n }", "function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {\n\tif (SEND_EMAILS != 'true') return false;\n $headers[\"From\"] = $from_email_address;\n $headers[\"To\"] = $to_email_address;\n $headers[\"Subject\"] = $email_subject;\n $mail_object =& Mail::factory(\"sendmail\");\n\tif (EMAIL_USE_HTML == 'true') {\n $headers[\"Content-Type\"] = \"text/html; charset=utf-8\";\n $message = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), \"<br />\",$email_text);\n }else{\n $headers[\"Content-Type\"] = \"text/plain; charset=utf-8\";\n $message = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), \"\\r\\n\",strip_tags($email_text));\n }\n\ttep_bh_transac_mail($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject, $message);\n\t// Send message\n //$mail_object->send($to_email_address, $headers, $message);\n}", "function resend_invoice($details) {\n\t\t\t\t$name = $details[0]->ai_first_name . \" \" . $details[0]->ai_last_name;\n\t\t\t\t$invoiceid = $details[0]->booking_id;\n\t\t\t\t$refno = $details[0]->booking_ref_no;\n\t\t\t\t$sendto = $details[0]->accounts_email;\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"Dear \" . $name . \",<br>\";\n\t\t\t\t$message .= \"You may review your invoice by visiting at: <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Invoice');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function bookingcustomcheckout($userid,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteId)\n\t {\n\t\t/* $parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\tif($lastname=='')\n\t\t{\n\t\t\t$lastname='@';\n\t\t}\n $firstname = implode(\" \", $parts);\n\t\tif($firstname=='')\n\t\t{\n\t\t\t$firstname='@';\n\t\t} */\n\t\t\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t\n\t\t//exit;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>'5','qty'=>1,'price'=>'50'],\n\t\t\t\t\t\t ['product_id'=>'6','qty'=>2,'price'=>'100']\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\n\n /*for sote 4 */\t\t\t\n\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t $helper = $objectManager->get('Webkul\\Marketplace\\Helper\\Data');\n\t\t $helper->setCurrentStore(4); \n\t\t /* end for sote 4 */\n\t\t\n\t\t\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\t\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t\n\t\t/* $quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=4 and is_active=1 order by entity_id ASC limit 1\";\n\t\t$result_result_cart = $connection->fetchAll($quote_sql_latest); */\n\t\t // print_r($result_result_cart); \n\t\t\n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=4 and entity_id='$quoteId' and is_active=1\";\n\t\t\n\t\t\n\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\tif(!empty($result_result))\n\t\t{\n\t\t\n\t\t\t $quoteId2=$result_result[0]['entity_id'];\n\t\t\t $quote = $this->quote->create()->load($quoteId2);\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId2);\n\t\t \n\t\t \n\t\t //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress(); \n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n //->setShippingMethod('freeshipping_freeshipping'); //shipping method\n\t\t\t\t\t\t->setShippingMethod($shipping); //shipping method\n\t\t\t\t\t\t\n //$quote->setPaymentMethod('cashondelivery'); //payment method\n\t\t$quote->setPaymentMethod($payment);\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n //$quote->getPayment()->importData(['method' => 'cashondelivery']);\n $quote->getPayment()->importData(['method' => $payment]);\n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n $quote->getId();\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t //$order->setEmailSent(1);\n echo $increment_id = $order->getRealOrderId();\n\t $lastOrderId = $increment_id;\n\t\t\n\t\t$helper = $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Data'\n );\n\t\t\n\t\t$getProductSalesCalculation = $objectManager->get(\n 'Webkul\\Marketplace\\Observer\\SalesOrderPlaceAfterObserver'\n );\n $getProductSalesCalculation->getProductSalesCalculation($order); \n\t \n\t \n\t \n\t \n\t \n\t\t\t if($order->getEntityId())\n\t\t\t {\n\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>$lastOrderId));\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t\t} \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t}\t\t\t\n\t\t\n \t\t\t\n\t return $result; \n\t\n\t }", "function sendMailForWishlistProductPromotion($promoId, $productIdPromotion, $con) {\n if (in_array('all', $productIdPromotion)) {\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email, tu.username FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id\";\n } else {\n $pids = implode(',', $productIdPromotion);\n $qq = \"SELECT DISTINCT(tw.user_id), tu.email FROM tbl_user_wishlist tw LEFT JOIN tbl_user tu ON tu.user_id = tw.user_id WHERE tw.product_id IN ($pids)\";\n }\n $rs = exec_query($qq, $con);\n if (mysqli_num_rows($rs)) {\n $emails = array();\n while ($row = mysqli_fetch_object($rs)) {\n $emails[] = $row->email;\n }\n\n /* fetch promotion details */\n $rsPromo = exec_query(\"SELECT * FROM tbl_promotion WHERE promo_id = '$promoId'\", $con);\n $promotion = mysqli_fetch_object($rsPromo);\n if ($promotion->percent_or_amount == 'percent') {\n $detail = \"FLAT $promotion->promo_value % OFF !!!\";\n } elseif ($promotion->percent_or_amount == 'amount') {\n $detail = \"SAVE $ $promotion->promo_value !!!\";\n }\n\n\n /* fetch emaiul template */\n $rsEmail = exec_query(\"SELECT * FROM tbl_email_template WHERE type = 'promotion'\", $con);\n $rowEmail = mysqli_fetch_object($rsEmail);\n $content = $rowEmail->content;\n\n $contentHTML = html_entity_decode($content);\n $contentHTML = str_replace('{jhm :', '', $contentHTML); // replace all '{jhm : '\n $arraySearch = array(' promotion_title}', ' promotion_detail}'); // isko replace krna h\n $arrayReplace = array($promotion->title, $detail); // isse replace krna h\n $content = str_replace($arraySearch, $arrayReplace, $contentHTML); // yha milega sb\n // now send mail\n sendMail('New Promotion!!! Check it out on ' . siteName, $content, $emails, $con);\n }\n}", "public function sendPaymentNotificationMail($sLang, $sComments, $iOrderNo)\n {\n $oMail = oxNew('oxEmail');\n $oLang = oxNew('oxLang');\n $oLang->setBaseLanguage($sLang);\n $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);\n $sShopName = $this->oConfig->getActiveShop()->oxshops__oxname->rawValue;\n $sQuery = \"SELECT OXUSERID from oxorder where OXORDERNR = '\".$iOrderNo.\"'\";\n $sRow = $oDb->getRow($sQuery);\n $sSelectQuery = \"SELECT OXFNAME, OXLNAME, OXUSERNAME from oxuser where OXID = '\".$sRow['OXUSERID'].\"'\";\n $aCustomerData = $oDb->getRow($sSelectQuery);\n\n if (!empty($aCustomerData['OXUSERNAME'])) {\n $sSubject = $oLang->translateString('NOVALNET_ORDER_CONFIRMATION') . $iOrderNo. $oLang->translateString('NOVALNET_ORDER_CONFIRMATION1') .$sShopName. $oLang->translateString('NOVALNET_ORDER_CONFIRMATION2') ;\n $email_content = '<body style=\"background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:14px; margin:0; padding:0;\">\n <div style=\"width:55%;height:auto;margin: 0 auto;background:rgb(247, 247, 247);border: 2px solid rgb(223, 216, 216);border-radius: 5px;box-shadow: 1px 7px 10px -2px #ccc;\">\n <div style=\"min-height: 300px;padding:20px;\">\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">\n\n <tr><b>Dear Mr./Ms./Mrs.</b> '.$aCustomerData['OXFNAME'].' '.$aCustomerData['OXLNAME'].' </tr></br></br>\n\n <tr>'.$oLang->translateString('NOVALNET_ORDER_CONFIRMATION3').'</tr></br></br>\n <tr>'. $oLang->translateString('NOVALNET_PAYMENT_INFORMATION') .'</br>\n '.$sComments.'\n </tr></br>\n\n </table>\n </div>\n <div style=\"width:100%;height:20px;background:#00669D;\"></div>\n </div>\n </body>';\n $oShop = $oMail->getShop();\n $oMail->setFrom($oShop->oxshops__oxorderemail->value);\n $oMail->setRecipient($aCustomerData['OXUSERNAME']);\n $oMail->setSubject( $sSubject );\n $oMail->setBody( $email_content );\n $oMail->send();\n } else {\n return 'Mail not sent<br>';\n }\n }", "public function onRsformBeforeUserEmail(array $args): void\n\t{\n\t\t$form = $args['form'];\n\n\t\tif (!$this->hasRopaymentsFields($form->FormId))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$settings = $this->loadFormSettings((int) $form->FormId);\n\t\t$total = RSFormProHelper::componentExists($form->FormId, 5577);\n\n\t\tif (empty($total))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(\n\t\t\t\tText::_('PLG_RSFP_JDIDEAL_TOTAL_FIELD_IS_MISSING')\n\t\t\t);\n\t\t}\n\n\t\t$totalDetails = RSFormProHelper::getComponentProperties($total[0]);\n\n\t\t$price = (float) $this->getSubmissionValue(\n\t\t\t$args['submissionId'], $totalDetails['componentId']\n\t\t);\n\n\t\tif ($price === 0.00\n\t\t\t&& (int) $settings->get('allowEmpty', 0) === 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$userEmail = (int) $settings->get('userEmail', 0);\n\n\t\tif ($userEmail === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$status = $this->loadSubmissionValues($args['submissionId']);\n\t\t$isValid = $this->isPaymentValid($args);\n\n\t\tif (!isset($status->FieldValue))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Defer sending if\n\t\t * - user email is deferred && the payment is not confirmed (send email only when payment is confirmed)\n\t\t */\n\t\tif ($userEmail === 1 && (int) $status->FieldValue === 0)\n\t\t{\n\t\t\t$args['userEmail']['to'] = '';\n\t\t}\n\n\t\t/**\n\t\t * Defer sending if\n\t\t * - user email is not deferred && the payment is confirmed (don't send the email once again, it has already been sent)\n\t\t */\n\t\tif ($userEmail === 0 && (int) $status->FieldValue === 1)\n\t\t{\n\t\t\t$args['userEmail']['to'] = '';\n\t\t}\n\n\t\t/**\n\t\t * Do not send any emails if the payment has been cancelled or failed otherwise\n\t\t */\n\t\tif (!$isValid\n\t\t\t&& (int) $settings->get('sendEmailOnFailedPayment', 0) === 0)\n\t\t{\n\t\t\t$args['userEmail']['to'] = '';\n\t\t}\n\t}", "public function toMail($notifiable)\n {\n $vendor = Vendor::where('id', '=', session('LoggedVendor'))->first();\n\n $addsem = 0;\n $regamount = 500;\n $freeusers = 0;\n if ($vendor->plan->plan == \"A\"){\n $addsem = 2;\n $regamount = 2000;\n $freeusers = 0;\n } else if ($vendor->plan->plan == \"B\") {\n $addsem = 1;\n $regamount = 1000;\n $freeusers = 1;\n }\n\n $pdf = PDF::loadView('mails', [\n 'companyName' => $vendor->name,\n 'address' => $vendor->form->address,\n 'country' => $vendor->form->country,\n 'state' => $vendor->form->state,\n 'city' => $vendor->form->city,\n 'zipcode' => $vendor->form->zipcode,\n 'primaryContact' => $vendor->form->primaryContact,\n 'primaryEmail' => $vendor->form->primaryEmail,\n 'primaryTelephone' => $vendor->form->primaryTelephone,\n 'primaryMobile' => $vendor->form->primaryMobile,\n 'primaryFax' => $vendor->form->primaryFax, \n\n 'plan' => $vendor->plan->plan,\n 'discount' => $vendor->plan->discount,\n 'discountAdditional'=> $vendor->plan->discountAdditional,\n 'dating' => $vendor->plan->dating,\n 'datingOthers' => $vendor->plan->datingOthers.\"\",\n 'showBuy1' => $vendor->plan->showBuy1,\n 'showBuy2' => $vendor->plan->showBuy2,\n 'incentive' => $vendor->plan->incentive, \n 'incentiveOthers' => $vendor->plan->incentiveOthers.\"\",\n 'promoFlyer' => $vendor->plan->promoFlyer,\n 'promoflyerPages' => $vendor->plan->promoflyerPages+0,\n 'brandRecognition' => $vendor->plan->brandRecognition,\n\n 'participants' => $vendor->participants,\n \n 'hotbuys' => $vendor->hotbuys,\n\n 'freeproducts' => $vendor->freeproducts,\n\n 'addsem' => $addsem,\n 'regamount' => $regamount,\n 'freeusers' => $freeusers,\n\n 'seminardays' => $vendor->seminardays,\n\n 'seminarCount' => (isset($vendor->seminar->seminarCount)?$vendor->seminar->seminarCount:0),\n 'seminarName' => (isset($vendor->seminar->seminarName)?$vendor->seminar->seminarName:\"\"),\n 'seminarEmail' => (isset($vendor->seminar->seminarEmail)?$vendor->seminar->seminarEmail:\"\"),\n 'seminarPhone' => (isset($vendor->seminar->seminarPhone)?$vendor->seminar->seminarPhone:\"\"),\n\n 'presenters' => $vendor->presenters\n ]);\n\n\n\n file_put_contents($vendor->name.\".pdf\", $pdf->output()); \n \n //Load Composer's autoloader\nrequire base_path('vendor/autoload.php');\n\n//Create an instance; passing `true` enables exceptions\n$mail = new PHPMailer(true);\n\ntry {\n //Server settings\n // $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n // $mail->isSMTP(); //Send using SMTP\n // $mail->Host = 'smtp.googlemail.com'; //Set the SMTP server to send through\n // $mail->SMTPAuth = true; //Enable SMTP authentication\n // $mail->Username = ''; //SMTP username\n // $mail->Password = ''; //SMTP password\n // $mail->SMTPSecure = 'ssl'; //Enable implicit TLS encryption\n // $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`\n\n //Recipients\n $mail->setFrom('info@atlasvirtualshow.com', 'Atlas Virtual Show Admin');\n $mail->addAddress($vendor->email, $vendor->name); //Add a recipient\n // $mail->addReplyTo('info@example.com', 'Information');\n $mail->addBCC('michael.habib@atlastrailer.com', \"Michael Habib\");\n\n //Attachments\n $mail->addAttachment($vendor->name.\".pdf\", $vendor->name.\"_\".$vendor->vendor_code.\".pdf\"); //Optional name\n \n //Content\n $mail->isHTML(true); //Set email format to HTML\n $mail->Subject = 'Atlas Virtual Show 2021 Registration';\n $mail->Body = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta name=\"color-scheme\" content=\"light\">\n <meta name=\"supported-color-schemes\" content=\"light\">\n <style>\n @media only screen and (max-width: 600px) {\n .inner-body {\n width: 100% !important;\n }\n \n .footer {\n width: 100% !important;\n }\n }\n \n @media only screen and (max-width: 500px) {\n .button {\n width: 100% !important;\n }\n }\n </style>\n </head> \n \n <body style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -webkit-text-size-adjust: none; background-color: #ffffff; color: #718096; height: 100%; line-height: 1.4; margin: 0; padding: 0; width: 100% !important;\">\n \n <table class=\"wrapper\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; background-color: #edf2f7; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative;\">\n <table class=\"content\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td class=\"header\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; padding: 25px 0; text-align: center;\">\n <a href=\"https://atlasvirtualshow.ca/form2021\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; color: #3d4852; font-size: 19px; font-weight: bold; text-decoration: none; display: inline-block;\">\n Atlas Virtual Show\n </a>\n </td>\n </tr>\n \n <!-- Email Body -->\n <tr>\n <td class=\"body\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; background-color: #edf2f7; border-bottom: 1px solid #edf2f7; border-top: 1px solid #edf2f7; margin: 0; padding: 0; width: 100%;\">\n <table class=\"inner-body\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 570px; background-color: #ffffff; border-color: #e8e5ef; border-radius: 2px; border-width: 1px; box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015); margin: 0 auto; padding: 0; width: 570px;\">\n <!-- Body content -->\n <tr>\n <td class=\"content-cell\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; max-width: 100vw; padding: 32px;\">\n <h1 style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; color: #3d4852; font-size: 18px; font-weight: bold; margin-top: 0; text-align: left;\">\n \n Dear '.$vendor->form->primaryContact.',</h1>\n \n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;\">\n \n Thank you for registering for the Atlas Virtual Show 2021.\n </p>\n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;\">\n \n Find attached a PDF copy of your registration details.\n </p>\n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;\">\n \n Regards,<br>\n Atlas Virtual Show\n </p>\n \n \n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr>\n <td style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative;\">\n <table class=\"footer\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 570px; margin: 0 auto; padding: 0; text-align: center; width: 570px;\">\n <tr>\n <td class=\"content-cell\" align=\"center\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; max-width: 100vw; padding: 32px;\">\n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; line-height: 1.5em; margin-top: 0; color: #b0adc5; font-size: 12px; text-align: center;\">© 2021 Atlas Virtual Show. All rights reserved.</p>\n \n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>\n </html>';\n \n \n $mail->AltBody = '[Atlas Virtual Show](https://atlasvirtualshow.ca/form2021)\n\n # Dear '. $vendor->form->primaryContact.'Ray Delgado,\n \n Thank you for registering for the Atlas Virtual Show 2021.\n \n Find attached a PDF copy of your registration details.\n \n Regards,\n Atlas Virtual Show\n \n © 2021 Atlas Virtual Show. All rights reserved.';\n\n $mail->send();\n\n unlink($vendor->name.\".pdf\");\n\n\n return redirect()->route('print')\n ->with('success', \"Your registration has been submitted. \n Kindly check your email or click print for your copy.\");\n\n\n} catch (Exception $e) {\n \n return redirect()\n ->back()->withInput()\n ->with('error', \"We are sorry something went wrong. Please check your details and try again.\");\n \n // echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n}\n\n\n // return (new MailMessage)\n // ->subject('Atlas Virtual Show Vendor Registration')\n // ->greeting('Dear '.$this->registrationData['company'].',')\n // ->line('Thank you for registering for the Atlas Virtual Show 2021.')\n // ->line('Find attached a PDF copy of your registration details.')\n // ->attachData($pdf->output(), $this->registrationData['company'].\"-\".$this->registrationData['vendor_code'].\".pdf\")\n // ->cc('michael.habib@atlastrailer.com');\n\n dd(\"Fail!\");\n }", "function _do_price_mail()\n\t{\n\t\t$i=0;\n\t\twhile (array_key_exists('pop3_'.strval($i),$_POST))\n\t\t{\n\t\t\t$price=post_param_integer('pop3_'.strval($i));\n\t\t\t$name='pop3_'.post_param('dpop3_'.strval($i));\n\t\t\t$name2='pop3_'.post_param('ndpop3_'.strval($i));\n\t\t\tif (post_param_integer('delete_pop3_'.strval($i),0)==1)\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_delete('prices',array('name'=>$name),'',1);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_update('prices',array('price'=>$price,'name'=>$name2),array('name'=>$name),'',1);\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\t}", "function it_exchange_paypal_pro_addon_process_webhook( $request ) {\n\n\t$general_settings = it_exchange_get_option( 'settings_general' );\n\t$settings = it_exchange_get_option( 'addon_paypal_pro' );\n\n\t$subscriber_id = !empty( $request['subscr_id'] ) ? $request['subscr_id'] : false;\n\t$subscriber_id = !empty( $request['recurring_payment_id'] ) ? $request['recurring_payment_id'] : $subscriber_id;\n\n\tif ( !empty( $request['txn_type'] ) ) {\n\n\t\tswitch( $request['txn_type'] ) {\n\n\t\t\tcase 'web_accept':\n\t\t\t\tswitch( strtolower( $request['payment_status'] ) ) {\n\n\t\t\t\t\tcase 'completed' :\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_transaction_status( $request['txn_id'], $request['payment_status'] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'reversed' :\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_transaction_status( $request['parent_txn_id'], $request['reason_code'] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_payment':\n\t\t\t\tswitch( strtolower( $request['payment_status'] ) ) {\n\t\t\t\t\tcase 'completed' :\n\t\t\t\t\t\tif ( !it_exchange_paypal_pro_addon_update_transaction_status( $request['txn_id'], $request['payment_status'] ) ) {\n\t\t\t\t\t\t\t//If the transaction isn't found, we've got a new payment\n\t\t\t\t\t\t\tit_exchange_paypal_pro_addon_add_child_transaction( $request['txn_id'], $request['payment_status'], $subscriber_id, $request['mc_gross'] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//If it is found, make sure the subscriber ID is attached to it\n\t\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_id( $request['txn_id'], $subscriber_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'active' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_signup':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'active' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'recurring_payment_suspended':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'suspended' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_cancel':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'cancelled' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'subscr_eot':\n\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'deactivated' );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t} else {\n\n\t\t//These IPNs don't have txn_types, why PayPal!? WHY!?\n\t\tif ( !empty( $request['reason_code'] ) ) {\n\n\t\t\tswitch( $request['reason_code'] ) {\n\n\t\t\t\tcase 'refund' :\n\t\t\t\t\tit_exchange_paypal_pro_addon_update_transaction_status( $request['parent_txn_id'], $request['payment_status'] );\n\t\t\t\t\tit_exchange_paypal_pro_addon_add_refund_to_transaction( $request['parent_txn_id'], $request['mc_gross'] );\n\t\t\t\t\tif ( $subscriber_id )\n\t\t\t\t\t\tit_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, 'refunded' );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}", "public function sendMail($order, $auth_call, $shipments_type) {\r\n $storeId = $order->getStore()->getId();\r\n $copyTo = Mage::helper('aramex_core')->getEmails(self:: XML_PATH_SHIPMENT_EMAIL_COPY_TO, $storeId);\r\n $copyMethod = Mage::getStoreConfig(self::XML_PATH_SHIPMENT_EMAIL_COPY_METHOD, $storeId);\r\n $templateId = Mage::getStoreConfig(self::XML_PATH_SHIPMENT_EMAIL_TEMPLATE, $storeId);\r\n\r\n if ($order->getCustomerIsGuest()) {\r\n $customerName = $order->getBillingAddress()->getName();\r\n } else {\r\n $customerName = $order->getCustomerName();\r\n }\r\n $shipments_id = $auth_call->Shipments->ProcessedShipment->ID;\r\n $mailer = Mage::getModel('core/email_template_mailer');\r\n\r\n $emailInfo = Mage::getModel('core/email_info');\r\n $emailInfo->addTo($order->getCustomerEmail(), $customerName);\r\n\r\n if ($copyTo && $copyMethod == 'bcc') {\r\n /* Add bcc to customer email */\r\n foreach ($copyTo as $email) {\r\n $emailInfo->addBcc($email);\r\n }\r\n }\r\n $mailer->addEmailInfo($emailInfo);\r\n /* Email copies are sent as separated emails if their copy method is 'copy' */\r\n if ($copyTo && $copyMethod == 'copy') {\r\n foreach ($copyTo as $email) {\r\n $emailInfo = Mage::getModel('core/email_info');\r\n $emailInfo->addTo($email);\r\n $mailer->addEmailInfo($emailInfo);\r\n }\r\n }\r\n $senderName = Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_NAME, $storeId);\r\n $senderEmail = Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_EMAIL, $storeId);\r\n\r\n /* Set all required params and send emails */\r\n $mailer->setSender(array('name' => $senderName, 'email' => $senderEmail));\r\n $mailer->setStoreId($storeId);\r\n $mailer->setTemplateId($templateId);\r\n $mailer->setTemplateParams(array(\r\n 'order' => $order,\r\n 'shipments_id' => $shipments_id,\r\n 'shipments_type' => $shipments_type\r\n )\r\n );\r\n try {\r\n $mailer->send();\r\n } catch (Exception $ex) {\r\n Mage::getSingleton('core/session')\r\n ->addError('Unable to send email.');\r\n }\r\n }", "public function send_purchaseorder($ponbr) {\n\t\t\tif ($this->does_concurpoexist($ponbr)) {\n\t\t\t\treturn $this->update_purchaseorder($ponbr);\n\t\t\t} else {\n\t\t\t\treturn $this->create_purchaseorder($ponbr);\n\t\t\t}\n\t\t}", "function sendEmail_customer($details, $sitetitle) {\n\t\t\t/*echo json_encode($details);\n\t\t\texit();*/\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = $details->thumbnail;\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$invoicelink = '<tr><td colspan=\"2\"><strong>Pay now link : </strong><a href=\"' . base_url() . 'invoice?id=' . $invoiceid . '&sessid=' . $refno . '\" >' . base_url() . 'invoice?id=' . $invoiceid . '&sessid=' . $refno . '</a></td>\n </tr>';\n\t\t\t\t$template = $this->shortcode_variables(\"bookingordercustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingordercustomer\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingordercustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $refno, $deposit, $totalamount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes);\n\n\t\t\t\t$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);\n\t\t\t\t/*echo $message;\n\t\t\t\texit();*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingordercustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Details and Invoice');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t/*echo $message;\n\t\t\t\texit();*/\n\t\t}", "public static function sendEmail($data) {\r\n\r\n // get user data to fill in automatically\r\n $user = Auth::getUser();\r\n // Email Settings\r\n // Send email back to user and the home store \r\n $cc[] = $user->email;\r\n\r\n // Live Address\r\n $to = 'disposal@chetsrentall.com';\r\n // Test address\r\n //$to = 'jgransden@chetsrentall.com';\r\n\r\n // getting the From store email\r\n $allStores = Helpers::getStores();\r\n foreach ($allStores as $store) {\r\n if ($store['storeNumber'] == $user->storeNumber){\r\n //uncomment for Live\r\n //$cc[] = ($store['storeEmail']);\r\n $storeName = $store['storeName'];\r\n }\r\n\r\n }\r\n // HTML Email Version\r\n $partCount = count($data['catNum']);\r\n $msgHeader = '<b>Store Requesting: &emsp;</b>' . $storeName . '<br />';\r\n $msgHeader .= '<b>Requestor: &emsp;</b>' . $user->name . '<br />';\r\n $msgHeader .= '<b><h3>If Stolen</h3></b>';\r\n $msgHeader .= '<b>Police Department: &emsp;</b>' . $data['policeDepartment'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Police: &emsp;</b>' . $data['policeDate'] . '<br />';\r\n $msgHeader .= '<b>Police Report Number: &emsp;</b>' . $data['reportNum'] . '<br />';\r\n $msgHeader .= '<b>Reported to NER by: &emsp;</b>' . $data['nerReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to NER: &emsp;</b>' . $data['nerDate'] . '<br />';\r\n $msgHeader .= '<b>Reported to Manufacturer by: &emsp;</b>' . $data['mfgReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Manufacturer: &emsp;</b>' . $data['mfgDate'] . '<br />';\r\n\r\n $msgFooter = '<h3>Details of the Disposal</h3>' . $data['disposal_comments'];\r\n $msg = '<h3>Disposal Item Line Details</h3>';\r\n $msg .= '<table border=\"1\"><tr><b><td>Cat Num</td><td>Item Num</td><td>Serial Num</td><td>Manufacturer</td><td>Qty</td><td>Disposal Type</td></b></tr>';\r\n for ($i = 0;$i<$partCount; $i++){\r\n $msg .= \"<tr>\";\r\n $msg .= \"<td>\" . $data['catNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['itmNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['serialNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['mfg'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['quantity'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['disposalCode'][$i] . \"</td>\";\r\n $msg .= \"</tr>\";\r\n }\r\n $msg .=\"</table>\";\r\n\r\n // Text only part of the email\r\n\r\n $textHeader = \"Store Requesting: \" . $storeName . \"\\r\\n\";\r\n $textHeader .= \"Requestor: \" . $user->name . \"\\r\\n\\r\\n\";\r\n $textHeader .= \"If Stolen: \\r\\n\\r\\n\";\r\n $textHeader .= \"Police Department: \" . $data['policeDepartment'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Police\" . $data['policeDate'] . \"\\r\\n\";\r\n $textHeader .= \"Police Report Number: \" . $data['reportNum'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to NER by: \" . $data['nerReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to NER\" . $data['nerDate'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to Manufacturer by: \" . $data['mfgReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Manufacturer: \" . $data['mfgDate'] . \"\\r\\n\";\r\n\r\n $textFooter = 'Details of the Disposal \\r\\n' . $data['disposal_comments'];\r\n $textBody = \"Cat # Item # Serial # Manufacturer Quantity Disposal Type\";\r\n\r\n for ($i = 0; $i<$partCount; $i++){\r\n $textBody .= $data['catNum'][$i] . ' ';\r\n $textBody .= $data['itmNum'][$i] . ' ';\r\n $textBody .= $data['serialNum'][$i] . ' ';\r\n $textBody .= $data['mfg'][$i] . ' ';\r\n $textBody .= $data['quantity'][$i] . ' ';\r\n $textBody .= $data['disposalCode'][$i] . ' ';\r\n }\r\n\r\n $subject = 'New Disposal Request';\r\n $text = $textHeader . $textBody . $textFooter;\r\n $html = $msgHeader . $msg . $msgFooter;\r\n\r\n Mail::send($to, $subject, $text, $html, $cc);\r\n \r\n // remove after saveDisposal() is written\r\n\r\n }", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "function dsf_process_sagepay($savedorder){\n\nglobal $protx_order,$GiftAidPayment, $ApplyAVSCV2, $CAVV, $XID, $ECI, $ClientNumber, $cc_issue_number, $cc_ccv_number, $cc_owner, $cc_number, $cc_start_month, $cc_start_year, $cc_expires_month, $cc_expires_year, $cc_ctype, $protx_attempts, $currencies, $ProtocolVersion, $DefaultCurrency,$PurchaseURL,$Verify, $VendorTxCode;\n\n \t\t\t\t\t$protx_ipn_currency = MODULE_PAYMENT_PROTXCC_DEFAULT_CURRENCY;\n\n\t\t\t\t\t\t // ORDER VALUE\n\t\t\t\t\t\t $strip_values_array = array(\"£\",\",\");\n\t\t\t\t\t\t \n\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['deposit_value']);\n\t\t\t\t\t\t }else{ // full order value\n\t\t\t\t\t\t \t\t$protx_ipn_order_amount = str_replace($strip_values_array,'',$savedorder->info['total_value']);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t $protx_ipn_order_amount = number_format($protx_ipn_order_amount , 2,'.','');\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t// CREATE ALL values to be passed through to Protx.\n\t\t\t\t\t\t$VendorTxCode= SAP_ORDER_PREFIX . $savedorder->info['id'] . '--' . date('YmdHis');\n\t\t\t\t\t\t$Amount= $protx_ipn_order_amount;\n\t\t\t\t\t\t$Currency= $protx_ipn_currency;\n\t\t\t\t\t\t$Description= 'Basket ID ' . $savedorder->info['id'] . ' - ' . dsf_get_ip_address();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( strtoupper($savedorder->customer['email_address']) <> strtoupper(TELEPHONE_ORDER)){\n\t\t\t\t\t\t\t$CustomerEMail= $savedorder->customer['email_address'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$CustomerEMail='';\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 (($savedorder->customer['telephone']) && (strlen($savedorder->customer['telephone']) >5)){\n\t\t\t\t\t\t$ContactNumber= substr($savedorder->customer['telephone'],20);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$ContactNumber= substr(dsf_lookup_mobile($savedorder->customer['id']),20);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// BILLING INFORMATION\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingSurname= substr($savedorder->customer['lastname'],0,200);\n\t\t\t\t\t\t$BillingFirstnames= substr($savedorder->customer['firstname'],0,200);\n\n\t\t\t\t\t\t if (isset($savedorder->customer['house']) && strlen($savedorder->customer['house']) > 0){\n\t\t\t\t\t\t \t $BillingAddress1 = $savedorder->customer['house'] . ', ';\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$BillingAddress1 = '';\n\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingAddress1 .= $savedorder->customer['street'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['district']) && strlen($savedorder->customer['district']) > 1){\n\t\t\t\t\t\t\t$BillingAddress2 = $savedorder->customer['district'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingCity = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->customer['town']) && strlen($savedorder->customer['town']) > 1){\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['town'];\n\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t$BillingCity .= $savedorder->customer['county'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\tif (strlen($BillingCity) < 1){\n\t\t\t\t\t\t\t$BillingCity = 'Not Supplied';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$BillingPostCode= $savedorder->customer['postcode'];\n\n\n\t\t\t\t\t\tif ($savedorder->customer['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t$BillingCountry = 'GB';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// DELIVERY INFO - if no delivery address has been supplied, then we need to populate the variables\n\t\t\t\t\t\t// with the same values as billing.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($savedorder->delivery['postcode']) && strlen($savedorder->delivery['postcode'])>4){ // delivery address exists\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get customers name and split it into firstname, lastname\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (strpos($savedorder->delivery['name'],' ') > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$splits = explode(' ', trim($savedorder->delivery['name']));\n\t\t\t\t\t\t\t\t\t\t\t\t// take into account that the customer could have put mr, mrs etc.. therefore use only the last two splits\n\t\t\t\t\t\t\t\t\t\t\t\t$total_splits = sizeof($splits);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($total_splits > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = $total_splits - 2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = $total_splits -1;\n\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$first_split = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$second_split = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $splits[$first_split];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $splits[$second_split];\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t// no breaks, ensure something is there\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Surname = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t\t\t$Delivery_Firstnames = $savedorder->customer['name'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t if (isset($savedorder->delivery['house']) && strlen($savedorder->delivery['house']) > 0){\n\t\t\t\t\t\t\t\t\t\t $DeliveryAddress1 = $savedorder->delivery['house'] . ', ';\n\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = '';\n\t\t\t\t\t\t\t\t\t }\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryAddress1 .= $savedorder->delivery['street'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['district']) && strlen($savedorder->delivery['district']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $savedorder->delivery['district'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryCity = '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif (isset($savedorder->delivery['town']) && strlen($savedorder->delivery['town']) > 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['town'];\n\t\t\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity .= $savedorder->delivery['county'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t// put somthing in billing city if nothing supplied.\n\t\t\t\t\t\t\t\t\tif (strlen($DeliveryCity) < 1){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCity = 'Not Supplied';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\t\t\t$DeliveryPostCode= $savedorder->delivery['postcode'];\n\n\t\t\t\t\t\t\t\t\tif ($savedorder->delivery['country'] == 'United Kingdom'){\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t// No alternative more the minute\n\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = 'GB';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else { // we havent got a delivery address so we need to duplicate the billing information.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliverySurname = $BillingSurname;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryFirstnames = $BillingFirstnames;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress1 = $BillingAddress1;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryAddress2 = $BillingAddress2;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCity = $BillingCity;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryPostCode = $BillingPostCode;\n\t\t\t\t\t\t\t\t\t\t\t\t$DeliveryCountry = $BillingCountry;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $pagerows = (sizeof($savedorder->products));\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $prod_basket = '';\n\t\t\t\t\t\t\t\t\t $tot_basket = '';\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=($pagerows+1); $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($savedorder->products[$i]['price']){ // there are records\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// products options code added 09-may-2006\n\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \"\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t if (sizeof($savedorder->products[$i]['attributes']) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attributes_exist = '1';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes = \" (\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($j = 0, $k = sizeof($savedorder->products[$i]['attributes']); $j < $k; $j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $products_ordered_attributes .= ' '. $savedorder->products[$i]['attributes'][$j]['option'] . '-> ' . $savedorder->products[$i]['attributes'][$j]['value'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$products_ordered_attributes .= \" )\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t// end of products options section.\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . str_replace(':', ' ', $savedorder->products[$i]['model'] . ' - ' . $savedorder->products[$i]['name'] . ' ' . $products_ordered_attributes); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $savedorder->products[$i]['qty']; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$prod_basket .= ':' . $currencies->format(dsf_add_tax($savedorder->products[$i]['final_price'] * $savedorder->products[$i]['qty'], $savedorder->products[$i]['tax']), true, $savedorder->info['currency'], $savedorder->info['currency_value']); // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($i=0, $n=sizeof($savedorder->totals)+1; $i<$n; $i++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$totalclass = $savedorder->totals[$i]['class'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (strlen($savedorder->totals[$i]['class']) > 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$order_total[$totalclass] = array('title' => $savedorder->totals[$i]['title'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'text' => $savedorder->totals[$i]['text'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'value' => $savedorder->totals[$i]['value']\n\t\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\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// discount if necessary\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_discount']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_discount']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':-' . $order_total['ot_discount']['value']; // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t // delivery charge (0.00 if necessary);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($order_total['ot_shipping']['value'] > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . str_replace(':', ' ', $order_total['ot_shipping']['title']); // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $order_total['ot_shipping']['value']; // line total\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t if ($savedorder->info['deposit_value'] > 0){ // deposit value required\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pagerows ++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . 'Deposit Required'; // name\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // quantity\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item value\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item tax\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':'; // item total\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tot_basket .= ':' . $savedorder->info['deposit_value']; // line total\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// make new basket\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $basket = $pagerows . $prod_basket . $tot_basket;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// end of basket creation details.\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t// register this order so we don't create an other one if this fails.\n\t\t\n\t\t\t$protx_order = $savedorder->info['id'];\n\t\t\tdsf_session_register('protx_order');\n \t\t\t\n\t\t\t// register the txCode created - we use this to allocate the payment to order\n\t\t\tdsf_session_register('VendorTxCode');\n\t\t\n\n\n// submit the information to SagePay\n\n\t\t\t\t\t// Set some variables\n\t\t\t\t\t$TargetURL = $PurchaseURL;\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t$VerifyServer = $Verify;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Specified in init-includes.php\n\t\t\t\t\t\n\t\t\t\t\tif ($Description){\n\t\t\t\t\t\t$Description = substr($Description,0,100);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$Description = $DefaultDescription;\t\t\t\t\t\t\t\t// Specified in init-protx.php\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Create an array of values to send\n\t\t\t\t\t$required = array (\n\t\t\t\t\t\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t\t\t\t\t\t'TxType' => MODULE_PAYMENT_PROTXCC_TXTYPE,\t\t\t\t\t\t\t\t\t\t\t// Transaction type\n\t\t\t\t\t\t\t'Vendor' => MODULE_PAYMENT_PROTXCC_ID,\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t\t\t\t\t\t'VendorTxCode' => $VendorTxCode,\t\t\t\t\t// Unique transaction code (generated by vendor)\n\t\t\t\t\t\t\t'Amount' => $Amount,\t\t\t\t\t\t\t\t\t\t\t// Value of order (supplied by vendor)\n\t\t\t\t\t\t\t'Currency' => $DefaultCurrency,\t\t\t\t\t\t\t\t\t// Currency of order (default specified in init-protx.php)\n\t\t\t\t\t\t\t'Description' => $Description,\t\t\t\t\t\t\t\t\t// Description of order \n\t\t\t\t\t\t\t 'BillingSurname' => $BillingSurname,\n\t\t\t\t\t\t\t 'BillingFirstnames' => $BillingFirstnames,\n\t\t\t\t\t\t\t 'BillingAddress1' => $BillingAddress1,\n\t\t\t\t\t\t\t 'BillingAddress2' => $BillingAddress2,\n\t\t\t\t\t\t\t 'BillingCity' => $BillingCity,\n\t\t\t\t\t\t\t 'BillingPostCode' => $BillingPostCode,\n\t\t\t\t\t\t\t 'BillingCountry' => $BillingCountry,\n\t\t\t\t\t\t\t 'DeliverySurname' => $DeliverySurname,\n\t\t\t\t\t\t\t 'DeliveryFirstnames' => $DeliveryFirstnames,\n\t\t\t\t\t\t\t 'DeliveryAddress1' => $DeliveryAddress1,\n\t\t\t\t\t\t\t 'DeliveryAddress2' => $DeliveryAddress2,\n\t\t\t\t\t\t\t 'DeliveryCity' => $DeliveryCity,\n\t\t\t\t\t\t\t 'DeliveryPostCode' => $DeliveryPostCode,\n\t\t\t\t\t\t\t 'DeliveryCountry' => $DeliveryCountry\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// add optional fields to the data array only if they've been set\n\t\t\t\t\t\n\t\t\t\t\t$optional_fields = array('ContactNumber' => $ContactNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'ContactFax' => $ContactFax,\n\t\t\t\t\t\t\t\t\t\t\t 'CustomerEMail' => $CustomerEMail,\n\t\t\t\t\t\t\t\t\t\t\t 'GiftAidPayment' => $GiftAidPayment,\n\t\t\t\t\t\t\t\t\t\t\t 'ApplyAVSCV2' => $ApplyAVSCV2,\n\t\t\t\t\t\t\t\t\t\t\t 'CAVV' => $CAVV,\n\t\t\t\t\t\t\t\t\t\t\t 'XID' => $XID,\n\t\t\t\t\t\t\t\t\t\t\t 'ECI' => $ECI,\n\t\t\t\t\t\t\t\t\t\t\t '3DSecureStatus' => '',\n\t\t\t\t\t\t\t\t\t\t\t 'Basket' => $Basket,\n\t\t\t\t\t\t\t\t\t\t\t 'ClientNumber' => $ClientNumber,\n\t\t\t\t\t\t\t\t\t\t\t 'IssueNumber' => $cc_issue_number,\n\t\t\t\t\t\t\t\t\t\t\t 'CV2' => $cc_ccv_number\n\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t// add the optional fields to the required array only if there are values set.\n\t\t\t\t\t$data = addOptionalFields( $optional_fields, $required, array ( \n\t\t\t\t\t 'ContactNumber',\n\t\t\t\t\t 'ContactFax',\n\t\t\t\t\t 'CustomerEMail',\n\t\t\t\t\t 'GiftAidPayment',\n\t\t\t\t\t 'ApplyAVSCV2',\n\t\t\t\t\t 'ClientIPAddress',\n\t\t\t\t\t 'CAVV',\n\t\t\t\t\t 'XID',\n\t\t\t\t\t 'ECI',\n\t\t\t\t\t '3DSecureStatus',\n\t\t\t\t\t 'Basket',\n\t\t\t\t\t 'ClientNumber', \n\t\t\t\t\t 'IssueNumber', \n\t\t\t\t\t 'CV2', \n\t\t\t\t\t) );\n\t\t\t\t\t\n\t\t\t\t\t$data['CardHolder'] =\t$cc_owner;\n\t\t\t\t\t$data['CardNumber'] = \t$cc_number;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Check if start date is supplied\n\t\t\t\t\tif($cc_start_month){\n\t\t\t\t\t\t// If so, add start date to data array to be appended to POST\n\t\t\t\t\t\t$data['StartDate'] = $cc_start_month . $cc_start_year;\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t// Add expiry date\n\t\t\t\t\t$data['ExpiryDate'] = $cc_expires_month . $cc_expires_year;\n\t\t\t\t\t\n\t\t\t\t\t// Add card type\n\t\t\t\t\t$data['CardType'] = $cc_ctype;\n\n\n\t\t\t\t\t$ipnum = dsf_get_ip_address();\n\n\t\t\t\t\t\t$data['Apply3DSecure'] = '0';\n\t\t\t\t\t\n\t\t\t\t\t$posted_data = $data;\n\t\t\t\t\t\n\t\t\t\t\t$data = formatData($data);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$sage_response = requestPost($TargetURL, $data);\t\n\n\n\n\t\t\t\t\t// (1) add 1 to attempts counter\n\t\t\t\t\t\n\t\t\t\t\t\t$protx_attempts ++;\n\t\t\t\t\t\tdsf_session_unregister('protx_attempts');\n\t\t\t\t\t\tdsf_session_register('protx_attempts');\n\n\n\n\n\n\t// return the response back to the calling script.\n\t\treturn $sage_response;\n\t\t\n\n\n}", "public function customerProductReview($observer)\n{ \n \n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n if ($telephone){\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/customer_review');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n // $text = str_replace('{{name}}', $customer_name, $text);\n }\n array_push($settings['order_noficication_recipients'], $telephone);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return($result);\n}", "function _sendPassMail($item)\r\n {\r\n App::import('Model', 'EmailTemplate');\r\n $this->EmailTemplate = new EmailTemplate();\r\n App::import('Core', 'ComponentCollection');\r\n $collection = new ComponentCollection();\r\n App::import('Component', 'Email');\r\n $this->Email = new EmailComponent($collection);\r\n /* sending pass to all item users and vendor starts here */\r\n $is_mail_sent = '';\r\n $emailFindReplace = array();\r\n if (!empty($item['ItemUser'])) {\r\n foreach($item['ItemUser'] as $item_user) {\r\n if ($item_user['is_paid']) {\r\n if (empty($item_user['is_canceled'])) {\r\n $barcode = Router::url(array(\r\n 'controller' => 'items',\r\n 'action' => 'barcode',\r\n $item_user['id'],\r\n 'admin' => false\r\n ) , true);\r\n //for normal bought items send Item Pass mail\r\n $i = 1;\r\n $content = '';\r\n\t\t\t\t\t\t$is_mail_sent = $item['Item']['is_pass_mail_sent'];\r\n\t\t\t\t\t\t$language_code = $this->getUserLanguageIso($item_user['User']['id']);\r\n\t\t\t\t\t\t$template = $this->EmailTemplate->selectTemplate('Item Pass', $language_code);\r\n\t\t\t\t\t\t$emailFindReplace = array(\r\n\t\t\t\t\t\t\t'##SITE_URL##' => Cache::read('site_url_for_shell', 'long') ,\r\n\t\t\t\t\t\t\t'##ITEM_NAME##' => $item['Item']['name'],\r\n\t\t\t\t\t\t\t'##SITE_NAME##' => Configure::read('site.name') ,\r\n\t\t\t\t\t\t\t'##QUANTITY##' => 1,\r\n\t\t\t\t\t\t\t'##MERCHANT_ADDRESS##' => $content,\r\n\t\t\t\t\t\t\t'##PASS_PURCHASED_DATE##' => strftime(Configure::read('site.datetime.format') , strtotime($item_user['created'])) ,\r\n\t\t\t\t\t\t\t'##FROM_EMAIL##' => $this->changeFromEmail(($template['from'] == '##FROM_EMAIL##') ? Configure::read('EmailTemplate.from_email') : $template['from']) ,\r\n\t\t\t\t\t\t\t'##SITE_LOGO##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', Router::url(array(\r\n\t\t\t\t\t\t\t\t'controller' => 'img',\r\n\t\t\t\t\t\t\t\t'action' => 'blue-theme',\r\n\t\t\t\t\t\t\t\t'logo-black.png',\r\n\t\t\t\t\t\t\t\t'admin' => false\r\n\t\t\t\t\t\t\t) , false) , 1) ,\r\n\t\t\t\t\t\t\t'##CONTACT_URL##' => Cache::read('site_url_for_shell', 'long') . preg_replace('/\\//', '', 'contactus', 1) ,\r\n\t\t\t\t\t\t\t'##CONTACT_LINK##' => \"<a href='mailto:\" . Configure::read('site.contact_email') . \"'>\" . Configure::read('site.contact_email') . \"</a>\",\r\n\t\t\t\t\t\t\t'##GOOGLE_MAP##' => $this->formGooglemap($item['Merchant'], '340x250')\r\n\t\t\t\t\t\t); //is_enable_payment_advance, payment_remaining\r\n\t\t\t\t\t\tif (!empty($item['Item']['is_enable_payment_advance'])) {\r\n\t\t\t\t\t\t\t$emailFindReplace['##PENDING_AMOUNT##'] = \"<strong style=\\\"color:#000; font-size:16px;display:block;margin:6px 0px 0px 0px; padding:0px 0px 0px 0px;display:block;\\\">Pending Amount:</strong>\r\n\t\t\t\t\t\t\t\t<p style=\\\"margin:0px;padding:0px;font-size:13px;color:#000;\\\">\" . Configure::read('site.currency') . $item['Item']['payment_remaining'] . \"</p>\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$emailFindReplace['##PENDING_AMOUNT##'] = '';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Multiple pass - sending mail for each pass //\r\n\t\t\t\t\t\tif (!empty($item_user['ItemUserPass'])) {\r\n\t\t\t\t\t\t\tforeach($item_user['ItemUserPass'] as $item_user_pass) {\r\n\t\t\t\t\t\t\t\t$emailFindReplace['##PASS_CODE##'] = '#' . $item_user_pass['pass_code'];\r\n\t\t\t\t\t\t\t\t$emailFindReplace['##USER_NAME##'] = $item_user_pass['guest_name'];\r\n\t\t\t\t\t\t\t\t$parsed_url = parse_url(Router::url('/', true));\r\n\t\t\t\t\t\t\t\t$qr_code = str_ireplace($parsed_url['host'], 'm.' . $parsed_url['host'], Router::url(array(\r\n\t\t\t\t\t\t\t\t\t'controller' => 'item_user_passes',\r\n\t\t\t\t\t\t\t\t\t'action' => 'check_qr',\r\n\t\t\t\t\t\t\t\t\t$item_user_pass['pass_code'],\r\n\t\t\t\t\t\t\t\t\t$item_user_pass['unique_pass_code'],\r\n\t\t\t\t\t\t\t\t\t'admin' => false\r\n\t\t\t\t\t\t\t\t) , true));\r\n\t\t\t\t\t\t\t\t$display_barcode = '';\r\n\t\t\t\t\t\t\t\tif (Configure::read('barcode.is_barcode_enabled')) {\r\n\t\t\t\t\t\t\t\t\t$barcode_width = Configure::read('barcode.width');\r\n\t\t\t\t\t\t\t\t\t$barcode_height = Configure::read('barcode.height');\r\n\t\t\t\t\t\t\t\t\tif (Configure::read('barcode.symbology') == 'qr') {\r\n\t\t\t\t\t\t\t\t\t\t$display_barcode = '<img src=\"http://chart.apis.google.com/chart?cht=qr&chs=' . $barcode_width . 'x' . $barcode_height . '&chl=' . $qr_code . '\" alt=\"[Image: Item qr code]\" />';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (Configure::read('barcode.symbology') == 'c39') {\r\n\t\t\t\t\t\t\t\t\t\t$display_barcode = '<img src=\"' . $barcode . '\" alt=\"[Image: barcode]\" />';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$display_barcode.= '<br><b>' . $item_user_pass['unique_pass_code'] . '</b>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$emailFindReplace['##BARCODE##'] = $display_barcode;\r\n\t\t\t\t\t\t\t\t$this->Email->from = ($template['from'] == '##FROM_EMAIL##') ? Configure::read('EmailTemplate.from_email') : $template['from'];\r\n\t\t\t\t\t\t\t\t$this->Email->replyTo = ($template['reply_to'] == '##REPLY_TO_EMAIL##') ? Configure::read('EmailTemplate.reply_to_email') : $template['reply_to'];\r\n\t\t\t\t\t\t\t\t$this->Email->to = $item_user_pass['guest_name'] . ' <' . $item_user_pass['guest_email'] . '>';\r\n\t\t\t\t\t\t\t\t$this->Email->subject = strtr($template['subject'], $emailFindReplace);\r\n\t\t\t\t\t\t\t\t$this->Email->content = strtr($template['email_content'], $emailFindReplace);\r\n\t\t\t\t\t\t\t\t$this->Email->sendAs = ($template['is_html']) ? 'html' : 'text';\r\n\t\t\t\t\t\t\t\t$this->Email->send($this->Email->content);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n }\r\n }\r\n }\r\n }\r\n }", "public function customcheckoutdirect($userid,$productid,$price,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteid)\n\t {\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>$productid,'qty'=>1,'price'=>$price]\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\t\n\t\t\t\n\t\t\t\n\t\t/* \t $store=$this->_storeManager->getStore();\n $websiteId = $this->_storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n $customer->loadByEmail($orderData['email']);// load customet by email address\n if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\n\t $quote = $this->quote->create()->load($quoteid);\n $quote=$this->quote->create(); //Create object of quote\n $quote->setStore($store); //set store for which you create quote\n // if you have allready buyer id then you can load customer directly \n $customer= $this->customerRepository->getById($customer->getEntityId());\n $quote->setCurrency();\n $quote->assignCustomer($customer); //Assign quote to customer\n \n //add items in quote\n foreach($orderData['items'] as $item){\n $product=$this->_product->load($item['product_id']);\n $product->setPrice($item['price']);\n $quote->addProduct(\n $product,\n intval($item['qty'])\n );\n }\n \n //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress();\n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n ->setShippingMethod('freeshipping_freeshipping'); //shipping method\n $quote->setPaymentMethod('cashondelivery'); //payment method\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n $quote->getPayment()->importData(['method' => 'cashondelivery']);\n \n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n //$quoteid=$quote->getId();\n\t\t // $result['quoteid']= $quoteid;\n\t\t $quoteid=$quote->getId();\n\t\t /* if($quoteid)\n\t\t {\n\t\t\t $result['quoteid']= $quoteid;\n\t\t }\n\t\t else\n\t\t {\n\t\t\t $result=['error'=>1,'msg'=>'Your custom message'];\n\t\t } */\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t\t\n\t\t\n\t\t\n\t\t$increment_id = $order->getRealOrderId();\n \n\t\tif($order->getEntityId()){\n // $result['order_id']= $order->getRealOrderId();\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n }else{\n $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n } \n return $result;\n\t\t\t \n\t\t\t\n\t\n\t }", "function appthemes_bank_transfer_pending_email( $post ) {\n\n\t$content = '';\n\n\t$content .= html( 'p', __( 'A new order is waiting to be processed. Once you receive payment, you should mark the order as completed.', APP_TD ) );\n\n\t$order_link = html_link( get_edit_post_link( $post ), __( 'Review this order', APP_TD ) );\n\n\t$all_orders = html_link(\n\t\tadmin_url( 'edit.php?post_status=tr_pending&post_type=transaction' ),\n\t\t__( 'review all pending orders', APP_TD ) );\n\n\t// translators: <Single Order Link> or <Link to All Orders>\n\t$content .= html( 'p', sprintf( __( '%1$s or %2$s', APP_TD ), $order_link, $all_orders ) );\n\n\t$blogname = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );\n\n\t$subject = sprintf( __( '[%1$s] Pending Order #%2$d', APP_TD ), $blogname, $post->ID );\n\n\tif( ! function_exists( 'appthemes_send_email' ) )\n\t\treturn false;\n\n\t$email = array( 'to' => get_option( 'admin_email' ), 'subject' => $subject, 'message' => $content );\n\t$email = apply_filters( 'appthemes_email_admin_bt_pending', $email, $post );\n\n\tappthemes_send_email( $email['to'], $email['subject'], $email['message'] );\n}", "function take_payment_details()\r\n\t\t{\r\n\t\t\tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,\r\n\t\t\t\t\t$Captions_arr,$inlineSiteComponents,$sitesel_curr,$default_Currency_arr,$ecom_testing,\r\n\t\t\t\t\t$ecom_themename,$components,$ecom_common_settings,$vImage,$alert,$protectedUrl;\r\n\t\t\t$customer_id \t\t\t\t\t\t= get_session_var(\"ecom_login_customer\"); // get the id of current customer from session\r\n\t\t\t\r\n if($_REQUEST['pret']==1) // case if coming back from PAYPAL with token.\r\n {\r\n if($_REQUEST['token'])\r\n {\r\n $address = GetShippingDetails($_REQUEST['token']);\r\n $ack = strtoupper($address[\"ACK\"]);\r\n if($ack == \"SUCCESS\" ) // case if address details obtained correctly\r\n {\r\n $_REQUEST['payer_id'] = $address['PAYERID'];\r\n $_REQUEST['rt'] = 5;\r\n }\r\n else // case if address not obtained from paypay .. so show the error msg in cart\r\n {\r\n $msg = 4;\r\n echo \"<form method='post' action='http://$ecom_hostname/mypayonaccountpayment.html' id='cart_invalid_form' name='cart_invalid_form'><input type='hidden' name='rt' value='\".$msg.\"' size='1'/><div style='position:absolute; left:0;top:0;padding:5px;background-color:#CC0000;color:#FFFFFF;font-size:12px;font-weight:bold'>Loading...</div></form><script type='text/javascript'>document.cart_invalid_form.submit();</script>\";\r\n exit;\r\n }\r\n } \r\n }\r\n // Get the zip code for current customer\r\n\t\t\t$sql_cust = \"SELECT customer_postcode \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_cust);\r\n\t\t\tif ($db->num_rows($ret_cust))\r\n\t\t\t{\r\n\t\t\t\t$row_cust \t\t\t\t\t= $db->fetch_array($ret_cust);\r\n\t\t\t\t$cust_zipcode\t\t\t\t= stripslashes($row_cust['customer_postcode']);\r\n\t\t\t}\t\r\n\t\t\t$Captions_arr['PAYONACC'] \t= getCaptions('PAYONACC'); // Getting the captions to be used in this page\r\n\t\t\t$sess_id\t\t\t\t\t\t\t\t= session_id();\r\n\t\t\t\r\n\t\t\tif($protectedUrl)\r\n\t\t\t\t$http = url_protected('index.php?req=payonaccountdetails&action_purpose=payment',1);\r\n\t\t\telse \t\r\n\t\t\t\t$http = url_link('payonaccountpayment.html',1);\t\r\n\t\t\t\r\n\t\t\t// Get the details from payonaccount_cartvalues for current site in current session \r\n\t\t\t$pay_cart = payonaccount_CartDetails($sess_id);\t\t\t\t\t\t\t\r\n\t\t\tif($_REQUEST['rt']==1) // This is to handle the case of returning to this page by clicking the back button in browser\r\n\t\t\t\t$alert = 'PAYON_ERROR_OCCURED';\t\t\t\r\n\t\t\telseif($_REQUEST['rt']==2) // case of image verification failed\r\n\t\t\t\t$alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n elseif($_REQUEST['rt']==3) // case of image verification failed\r\n $alert = 'PAYON_IMAGE_VERIFICATION_FAILED';\r\n\t\t\telseif($_REQUEST['rt']==4) // case if paypal address verification failed\r\n $alert = 'PAYON_PAYPAL_EXP_NO_ADDRESS_RET';\r\n elseif($_REQUEST['rt']==5) // case if paypal address verification successfull need to click pay to make the payment \r\n $alert = 'PAYON_PAYPAL_EXP_ADDRESS_DON';\r\n\t\t\t$sql_comp \t\t\t= \"SELECT customer_title,customer_fname,customer_mname,customer_surname,customer_email_7503,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_status,customer_payonaccount_maxlimit,customer_payonaccount_usedlimit,\r\n\t\t\t\t\t\t\t\t\t\t(customer_payonaccount_maxlimit - customer_payonaccount_usedlimit) as remaining,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day,customer_payonaccount_rejectreason,customer_payonaccount_laststatementdate,\r\n\t\t\t\t\t\t\t\t\t\tcustomer_payonaccount_billcycle_day \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tcustomers \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\tcustomer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_cust = $db->query($sql_comp);\r\n\t\t\tif ($db->num_rows($ret_cust)==0)\r\n\t\t\t{\t\r\n\t\t\t\techo \"Sorry!! Invalid input\";\r\n\t\t\t\texit;\r\n\t\t\t}\t\r\n\t\t\t$row_cust \t\t= $db->fetch_array($ret_cust);\r\n\t\t\t// Getting the previous outstanding details from orders_payonaccount_details \r\n\t\t\t$sql_payonaccount = \"SELECT pay_id,pay_date,pay_amount \r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\torder_payonaccount_details \r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustomers_customer_id = $customer_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND pay_transaction_type ='O' \r\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpay_id DESC \r\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_payonaccount = $db->query($sql_payonaccount);\r\n\t\t\tif ($db->num_rows($ret_payonaccount))\r\n\t\t\t{\r\n\t\t\t\t$row_payonaccount \t= $db->fetch_array($ret_payonaccount);\r\n\t\t\t\t$prev_balance\t\t\t\t= $row_payonaccount['pay_amount'];\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= $row_payonaccount['pay_id'];\r\n\t\t\t\t$prev_date\t\t\t\t\t= $row_payonaccount['pay_date'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$prev_balance\t\t\t\t= 0;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$prev_id\t\t\t\t\t\t= 0;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$paying_amt \t\t= ($_REQUEST['pay_amt'])?$_REQUEST['pay_amt']:$pay_cart['pay_amount'];\r\n\t\t\t$additional_det\t= ($_REQUEST['pay_additional_details'])?$_REQUEST['pay_additional_details']:$pay_cart['pay_additional_details'];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t // Check whether google checkout is required\r\n\t\t\t$sql_google = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n\t\t\t\t\t\t\t\t\t\t a.paymethod_takecarddetails,a.payment_minvalue,\r\n\t\t\t\t\t\t\t\t\t\t b.payment_method_sites_caption \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\tpayment_methods a,\r\n\t\t\t\t\t\t\t\t\t\tpayment_methods_forsites b \r\n\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\ta.paymethod_id=b.payment_methods_paymethod_id \r\n\t\t\t\t\t\t\t\t\t\tAND a.paymethod_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\tAND sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\tAND b.payment_method_sites_active = 1 \r\n\t\t\t\t\t\t\t\t\t\tAND paymethod_key='GOOGLE_CHECKOUT' \r\n\t\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t\t1\";\r\n\t\t\t$ret_google = $db->query($sql_google);\r\n\t\t\tif($db->num_rows($ret_google))\r\n\t\t\t{\r\n\t\t\t\t$google_exists = true;\r\n\t\t\t}\r\n\t\t\telse \t\r\n\t\t\t\t$google_exists = false;\r\n\t\t\t// Check whether google checkout is set for current site\r\n\t\t\tif($ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['paymethod_key'] == \"GOOGLE_CHECKOUT\")\r\n\t\t\t{\r\n\t\t\t\t$google_prev_req \t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_preview_req'];\r\n\t\t\t\t$google_recommended\t\t= $ecom_common_settings['paymethodKey']['GOOGLE_CHECKOUT']['payment_method_google_recommended'];\r\n\t\t\t\tif($google_recommended ==0) // case if google checkout is set to work in the way google recommend\r\n\t\t\t\t\t$more_pay_condition = \" AND paymethod_key<>'GOOGLE_CHECKOUT' \";\r\n\t\t\t\telse\r\n\t\t\t\t\t$more_pay_condition = '';\r\n\t\t\t}\r\n\t\t\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_showinpayoncredit = 1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND b.sites_site_id=$ecom_siteid \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t\t\t$ret_paymethods = $db->query($sql_paymethods);\r\n\t\t\t$totpaycnt = $totpaymethodcnt = $db->num_rows($ret_paymethods);\t\t\t\r\n\t\t\tif ($totpaycnt==0)\r\n\t\t\t{\r\n\t\t\t\t$paytype_moreadd_condition = \" AND a.paytype_code <> 'credit_card'\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t$paytype_moreadd_condition = '';\r\n\t\t\t$cc_exists \t\t\t= 0;\r\n\t\t\t$cc_seq_req \t\t= check_Paymethod_SSL_Req_Status('payonaccount');\r\n\t\t\t$sql_paytypes \t= \"SELECT a.paytype_code,b.paytype_forsites_id,a.paytype_id,a.paytype_name,b.images_image_id,\r\n\t\t\t\t\t\t\t\tb.paytype_caption \r\n\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\tpayment_types a, payment_types_forsites b \r\n\t\t\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\t\t\tb.sites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_active=1 \r\n\t\t\t\t\t\t\t\t\t\t\tAND paytype_forsites_userdisabled=0 \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_id=b.paytype_id \r\n\t\t\t\t\t\t\t\t\t\t\tAND a.paytype_showinpayoncredit=1 \r\n\t\t\t\t\t\t\t\t\t\t\t$paytype_moreadd_condition \r\n\t\t\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\ta.paytype_order\";\r\n\t\t\t$ret_paytypes = $db->query($sql_paytypes);\r\n\t\t\t$paytypes_cnt = $db->num_rows($ret_paytypes);\t\r\n\t\t\tif($paytypes_cnt==1 && $totpaymethodcnt>=1)\r\n\t\t\t\t$card_req = 1;\r\n\t\t\telse\r\n\t\t\t\t$card_req = '';\t\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t/* Function to be triggered when selecting the credit card type*/\r\nfunction sel_credit_card_payonaccount(obj)\r\n{\r\n\tif (obj.value!='')\r\n\t{\r\n\t\tobjarr = obj.value.split('_');\r\n\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t{\r\n\t\t\tvar key \t\t\t= objarr[0];\r\n\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\tvar seccount \t= objarr[2];\r\n\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\tif (issuereq==1)\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_normal';\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.className = 'inputissue_disabled';\t\r\n\t\t\t\tdocument.frm_payonaccount_payment.checkoutpay_issuenumber.disabled\t= true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\nfunction handle_paytypeselect_payonaccount(obj)\r\n{\r\n\tvar curpaytype = paytype_arr[obj.value];\r\n\tvar ptypecnts = <?php echo $totpaycnt?>;\r\n\tif (curpaytype=='credit_card')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = 1;\r\n\t\tif (document.getElementById('payonaccount_paymethod'))\r\n\t\t{\r\n\t\t\tvar lens = document.getElementById('payonaccount_paymethod').length;\t\r\n\t\t\tif(lens==undefined && ptypecnts==1)\r\n\t\t\t{\r\n\t\t\t\tvar curval\t = document.getElementById('payonaccount_paymethod').value;\r\n\t\t\t\tcur_arr \t\t= curval.split('_');\r\n\t\t\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t}\t\r\n\t}\r\n\telse if(curpaytype=='cheque')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = '';\t\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\t\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='invoice')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse if(curpaytype=='pay_on_phone')\r\n\t{\r\n\t\tif(document.getElementById('payonaccount_paymethod_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_paymethod_tr').style.display = 'none';\t\t\r\n\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\tdocument.getElementById('payonaccount_self_tr').style.display = 'none';\r\n\t\tif(document.getElementById('paymentmethod_req'))\r\n\t\t\tdocument.getElementById('paymentmethod_req').value = '';\r\n\t}\r\n\telse \r\n\t{\r\n\t\tcur_arr = obj.value.split('_');\r\n\t\tif ((cur_arr[0]=='SELF' || cur_arr[0]=='PROTX') && cur_arr.length<=2)\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_cheque_tr').style.display = 'none';\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= '';\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(document.getElementById('payonaccount_self_tr'))\r\n\t\t\t\tdocument.getElementById('payonaccount_self_tr').style.display \t= 'none';\r\n\t\t}\t\r\n\t}\r\n}\r\n</script>\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<div class=\"treemenu\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a> >> <?=\"Pay on Account Payment\"?></div>\r\n\t\t\r\n\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" class=\"emailfriendtable\">\r\n\t\t\t<form method=\"post\" action=\"<?php echo $http?>\" name='frm_payonaccount_payment' id=\"frm_payonaccount_payment\" class=\"frm_cls\" onsubmit=\"return validate_payonaccount(this)\">\r\n\t\t\t<input type=\"hidden\" name=\"paymentmethod_req\" id=\"paymentmethod_req\" value=\"<?php echo $card_req?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_unique_key\" id=\"payonaccount_unique_key\" value=\"<?php echo uniqid('')?>\" />\r\n\t\t\t<input type=\"hidden\" name=\"save_payondetails\" id=\"save_payondetails\" value=\"\" />\r\n\t\t\t<input type=\"hidden\" name=\"nrm\" id=\"nrm\" value=\"1\" />\r\n\t\t\t<input type=\"hidden\" name=\"action_purpose\" id=\"action_purpose\" value=\"buy\" />\r\n\t\t\t<input type=\"hidden\" name=\"checkout_zipcode\" id=\"checkout_zipcode\" value=\"<?php echo $cust_zipcode?>\" />\r\n\t\t\t<?php \r\n\t\t\tif($alert){ \r\n\t\t\t?>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan=\"4\" class=\"errormsg\" align=\"center\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t\tif($Captions_arr['PAYONACC'][$alert])\r\n\t\t\t\t\t\t\techo $Captions_arr['PAYONACC'][$alert];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t \t\techo $alert;\r\n\t\t\t\t?>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t<?php } ?>\r\n <tr>\r\n <td colspan=\"4\" class=\"emailfriendtextheader\"><?=$Captions_arr['EMAIL_A_FRIEND']['EMAIL_FRIEND_HEADER_TEXT']?> </td>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CURRENTACC_BALANCE']?> </td>\r\n <td width=\"22%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_usedlimit'])?> </td>\r\n <td width=\"27%\" align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_LIMIT']?></td>\r\n <td width=\"18%\" align=\"left\" class=\"regiconent\">:<?php echo print_price($row_cust['customer_payonaccount_maxlimit'])?> </td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['LAST_STATE_BALANCE']?> </td>\r\n <td align=\"left\" class=\"regiconent\">:<?php echo print_price($prev_balance)?> </td>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['CREDIT_REMAINING']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo print_price(($row_cust['customer_payonaccount_maxlimit']-$row_cust['customer_payonaccount_usedlimit']))?></td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td align=\"left\" class=\"regiconent\"><?php echo $Captions_arr['PAYONACC']['AMT_BEING_PAID']?> </td>\r\n <td align=\"left\" class=\"regiconent\">: <?php echo get_selected_currency_symbol()?><?php echo $paying_amt?> <input name=\"pay_amt\" id=\"pay_amt\" type=\"hidden\" size=\"10\" value=\"<?php echo $paying_amt?>\" /></td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n <td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n <?php\r\n \tif($additional_det!='')\r\n\t{\r\n ?>\r\n\t\t<tr>\r\n\t\t<td align=\"left\" class=\"regiconent\" valign=\"top\"><?php echo $Captions_arr['PAYONACC']['ADDITIONAL_DETAILS']?> </td>\r\n\t\t<td align=\"left\" class=\"regiconent\">: <?php echo nl2br($additional_det)?> <input name=\"pay_additional_details\" id=\"pay_additional_details\" type=\"hidden\" value=\"<?php echo $additional_det?>\" /></td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t\t<td align=\"left\" class=\"regiconent\">&nbsp;</td>\r\n\t </tr>\r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"regiconent\">&nbsp;</td>\r\n </tr>\r\n\t <? if($Settings_arr['imageverification_req_payonaccount'] and $_REQUEST['pret']!=1)\r\n\t \t {\r\n\t ?>\r\n <tr>\r\n <td colspan=\"4\" align=\"center\" class=\"emailfriendtextnormal\"><img src=\"<?php url_verification_image('includes/vimg.php?size=4&pass_vname=payonaccountpayment_Vimg')?>\" border=\"0\" alt=\"Image Verification\"/>&nbsp;\t</td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"6\" align=\"center\" class=\"emailfriendtextnormal\"><?=$Captions_arr['PAYONACC']['PAYON_VERIFICATION_CODE']?>&nbsp;<span class=\"redtext\">*</span><span class=\"emailfriendtext\">\r\n\t <?php \r\n\t\t// showing the textbox to enter the image verification code\r\n\t\t$vImage->showCodBox(1,'payonaccountpayment_Vimg','class=\"inputA_imgver\"'); \r\n\t?>\r\n\t</span> </td>\r\n </tr>\r\n <? }?>\r\n <?php\r\n \tif($google_exists && $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG'] && google_recommended==0 && $totpaymethodcnt>1 && $_REQUEST['pret']!=1)\r\n\t{\t\r\n ?>\r\n <tr>\r\n \t<td colspan=\"4\" align=\"left\" class=\"google_header_text\"><?php echo $Captions_arr['PAYONACC'] ['PAYON_PAYMENT_MULTIPLE_MSG']?>\r\n \t</td>\r\n </tr>\r\n <?php\r\n }\r\n ?> \r\n <tr>\r\n <td colspan=\"4\">\r\n <table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n <?php\r\nif($_REQUEST['pret']!=1)\r\n{\r\n?>\r\n \r\n <tr>\r\n <td colspan=\"2\">\r\n\t\t\t<?php\r\n\t\t\t\tif ($db->num_rows($ret_paytypes))\r\n\t\t\t\t{\r\n\t\t\t\t\tif($db->num_rows($ret_paytypes)==1 && $totpaymethodcnt<=1)// Check whether there are more than 1 payment type. If no then dont show the payment option to user, just use hidden field\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t$row_paytypes = $db->fetch_array($ret_paytypes);\r\n\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//if($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t$single_curtype = $row_paytypes['paytype_code'];\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" />\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t <div class=\"shoppaymentdiv\">\r\n\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYTYPE']?></td>\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t\tpaytype_arr = new Array();\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t</script>';\r\n\t\t\t\t\t\t\t\t\twhile ($row_paytypes = $db->fetch_array($ret_paytypes))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_code']=='credit_card')\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif($row_paytypes['paytype_id']==$row_cartdet['paytype_id'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cc_exists = true;\r\n\t\t\t\t\t\t\t\t\t\t\tif (($protectedUrl==true and $cc_seq_req==false) or ($protectedUrl==false and $cc_seq_req==true))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\telse // if pay type is not credit card.\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif ($protectedUrl==true)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paytype_onclick = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\techo '<script type=\"text/javascript\">';\r\n\t\t\t\t\t\t\t\t\t\techo \"paytype_arr[\".$row_paytypes['paytype_id'].\"] = '\".$row_paytypes['paytype_code'].\"';\";\r\n\t\t\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t\t// image to shown for payment types\r\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_thumbpath';\r\n\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\r\n\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('paytype',$row_paytypes['paytype_forsites_id'],$pass_type,0,0,1);\r\n\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_paytypes['paytype_name'],$row_paytypes['paytype_name']);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src=\"<?php url_site_image('cash.gif')?>\" alt=\"Payment Type\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t<?php\t\r\n\t\t\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paytype\" id=\"payonaccount_paytype\" value=\"<?php echo $row_paytypes['paytype_id']?>\" onclick=\"<?php echo $paytype_onclick?>\" <?php echo ($_REQUEST['payonaccount_paytype']==$row_paytypes['paytype_id'])?'checked=\"checked\"':''?> /><?php echo stripslashes($row_paytypes['paytype_caption'])?>\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t?>\t\r\n\t\t\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t?>\t\t</td>\r\n </tr>\r\n \t<?php \r\n\t$self_disp = 'none';\r\n\tif($_REQUEST['payonaccount_paytype'])\r\n\t{\r\n\t\t// get the paytype code for current paytype\r\n\t\t$sql_pcode = \"SELECT paytype_code \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tpayment_types \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tpaytype_id = \".$_REQUEST['payonaccount_paytype'].\" \r\n\t\t\t\t\t\t\t\tLIMIT \r\n\t\t\t\t\t\t\t\t\t1\";\r\n\t\t$ret_pcode = $db->query($sql_pcode);\r\n\t\tif ($db->num_rows($ret_pcode))\r\n\t\t{\r\n\t\t\t$row_pcode \t= $db->fetch_array($ret_pcode);\r\n\t\t\t$sel_ptype \t= $row_pcode['paytype_code'];\r\n\t\t}\r\n\t}\r\n\tif($sel_ptype=='credit_card' or $single_curtype=='credit_card')\r\n\t\t$paymethoddisp_none = '';\r\n\telse\r\n\t\t$paymethoddisp_none = 'none';\r\n\tif($sel_ptype=='cheque')\r\n\t\t$chequedisp_none = '';\r\n\telse\r\n\t\t$chequedisp_none = 'none';\t\r\n\t$sql_paymethods = \"SELECT a.paymethod_id,a.paymethod_name,a.paymethod_key,\r\n a.paymethod_takecarddetails,a.payment_minvalue,a.paymethod_secured_req,a.paymethod_ssl_imagelink,\r\n b.payment_method_sites_caption \r\n FROM \r\n payment_methods a,\r\n payment_methods_forsites b \r\n WHERE \r\n b.sites_site_id = $ecom_siteid \r\n AND paymethod_showinpayoncredit =1 \r\n AND b.payment_method_sites_active = 1 \r\n $more_pay_condition \r\n AND a.paymethod_id=b.payment_methods_paymethod_id \r\n AND a.paymethod_key<>'PAYPAL_EXPRESS'\";\r\n\t$ret_paymethods = $db->query($sql_paymethods);\r\n\tif ($db->num_rows($ret_paymethods))\r\n\t{\r\n\t\tif ($db->num_rows($ret_paymethods)==1)\r\n\t\t{\r\n\t\t\t$row_paymethods = $db->fetch_array($ret_paymethods);\r\n\t\t\tif ($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX')\r\n\t\t\t{\r\n\t\t\t\tif($paytypes_cnt==1 or $sel_ptype =='credit_card')\r\n\t\t\t\t\t$self_disp = '';\r\n\t\t\t}\t\r\n\t\t\t?>\r\n\t\t\t<input type=\"hidden\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" />\r\n\t\t\t<?php\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*if($db->num_rows($ret_paytypes)==1 and $cc_exists == true)\r\n\t\t\t\t$disp = '';\r\n\t\t\telse\r\n\t\t\t\t$disp = 'none';\r\n\t\t\t*/\t\t\r\n\t\t\t?>\r\n\t\t\t<tr id=\"payonaccount_paymethod_tr\" style=\"display:<?php echo $paymethoddisp_none?>\">\r\n\t\t\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\r\n\t\t\t\t<div class=\"shoppayment_type_div\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$pay_maxcnt = 2;\r\n\t\t\t\t\t\t$pay_cnt\t= 0;\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t\t<td colspan=\"<?php echo $pay_maxcnt?>\" class=\"cart_payment_header\"><?php echo $Captions_arr['PAYONACC']['PAYON_SEL_PAYGATEWAY']?></td>\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t <tr>\r\n\t\t\t\t\t <?php\r\n\t\t\t\t\t\twhile ($row_paymethods = $db->fetch_array($ret_paymethods))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$caption = ($row_paymethods['payment_method_sites_caption'])?$row_paymethods['payment_method_sites_caption']:$row_paymethods['paymethod_name'];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==true) // if secured is required for current pay method and currently in secured. so no reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==1 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==false) // case if secured is required and current not is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telseif ($row_paymethods['paymethod_secured_req']==0 and $protectedUrl==true) // case if secured is not required and current is secured. so reload is required\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = \"handle_form_submit(document.frm_payonaccount_payment,'','')\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$on_paymethod_click = 'handle_paytypeselect_payonaccount(this)';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$curname = $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id'];\r\n\t\t\t\t\t\t\tif($curname==$_REQUEST['payonaccount_paymethod'])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (($row_paymethods['paymethod_key']=='SELF' or $row_paymethods['paymethod_key']=='PROTX') and $sel_ptype=='credit_card')\r\n\t\t\t\t\t\t\t\t\t$self_disp = '';\r\n\t\t\t\t\t\t\t\tif($sel_ptype=='credit_card')\t\r\n\t\t\t\t\t\t\t\t\t$sel = 'checked=\"checked\"';\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$sel = '';\r\n\t\t\t\t\t\t\t$img_path=\"./images/\".$ecom_hostname.\"/site_images/payment_methods_images/\".$row_paymethods['paymethod_ssl_imagelink'];\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t if(file_exists($img_path))\r\n\t\t\t\t\t\t\t\t$caption = '<img src=\"'.$img_path.'\" border=\"0\" alt=\"'.$caption.'\" />';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t ?>\r\n\t\t\t\t\t\t\t<td width=\"25%\" align=\"left\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"top\" width=\"2%\">\r\n\t\t\t\t\t\t\t\t<input class=\"shoppingcart_radio\" type=\"radio\" name=\"payonaccount_paymethod\" id=\"payonaccount_paymethod\" value=\"<?php echo $row_paymethods['paymethod_key'].'_'.$row_paymethods['paymethod_id']?>\" <?php echo $sel ?> onclick=\"<?php echo $on_paymethod_click?>\" />\r\n\t\t\t\t\t\t\t\t<td align=\"left\">\r\n\t\t\t\t\t\t\t\t<?php echo stripslashes($caption)?>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$pay_cnt++;\r\n\t\t\t\t\t\t\tif ($pay_cnt>=$pay_maxcnt)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"</tr><tr>\";\r\n\t\t\t\t\t\t\t\t$pay_cnt = 0;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($pay_cnt<$pay_maxcnt)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\techo \"<td colspan=\".($pay_maxcnt-$pay_cnt).\">&nbsp;</td>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t?>\t\r\n\t\t\t\t\t </tr>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</div>\t\t\t\t</td>\r\n\t\t\t</tr>\t\r\n\t\t\t<?php\r\n\t\t}\r\n\t}\r\n\tif($paytypes_cnt==1 && $totpaymethodcnt==0 && $single_curtype=='cheque')\r\n\t{\r\n\t\t$chequedisp_none = '';\r\n\t}\t\r\n\t?>\r\n\t<tr id=\"payonaccount_cheque_tr\" style=\"display:<?php echo $chequedisp_none?>\">\r\n\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAY_ON_CHEQUE_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CHEQUE' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t$chkoutadd_Req[]\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t$chkoutadd_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\" valign=\"top\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?>\r\n\t\t\t</table>\t\t</td>\r\n\t </tr>\t\r\n\t<tr id=\"payonaccount_self_tr\" style=\"display:<?php echo $self_disp?>\">\r\n\t\t<td colspan=\"2\" align=\"left\" valign=\"middle\">\t\r\n\t\t<table width=\"100%\" cellpadding=\"1\" cellspacing=\"1\" border=\"0\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" align=\"left\" class=\"shoppingcartheader\"><?php echo $Captions_arr['PAYONACC']['PAYON_CREDIT_CARD_DETAILS']?></td>\r\n\t\t</tr>\r\n\t\t<?php\r\n\t\t\t$cur_form = 'frm_payonaccount_payment';\r\n\t\t\t// Get the list of credit card static fields to be shown in the checkout out page in required order\r\n\t\t\t$sql_checkout = \"SELECT field_det_id,field_key,field_name,field_req,field_error_msg \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tgeneral_settings_site_checkoutfields \r\n\t\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t\t\tsites_site_id = $ecom_siteid \r\n\t\t\t\t\t\t\t\t\tAND field_hidden=0 \r\n\t\t\t\t\t\t\t\t\tAND field_type='CARD' \r\n\t\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\tfield_order\";\r\n\t\t\t$ret_checkout = $db->query($sql_checkout);\r\n\t\t\tif($db->num_rows($ret_checkout))\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\twhile($row_checkout = $db->fetch_array($ret_checkout))\r\n\t\t\t\t{\t\t\t\r\n\t\t\t\t\t// Section to handle the case of required fields\r\n\t\t\t\t\tif($row_checkout['field_req']==1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($row_checkout['field_key']=='checkoutpay_expirydate' or $row_checkout['field_key']=='checkoutpay_issuedate')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_month'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"_year'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$chkoutcc_Req[]\t\t\t= \"'\".$row_checkout['field_key'].\"'\";\r\n\t\t\t\t\t\t\t$chkoutcc_Req_Desc[]\t= \"'\".$row_checkout['field_error_msg'].\"'\"; \r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php echo stripslashes($row_checkout['field_name']); if($row_checkout['field_req']==1) { echo '&nbsp;<span class=\"redtext\">*</span>';}?>\t\t\t\t\t</td>\r\n\t\t\t\t\t<td align=\"left\" width=\"50%\" class=\"emailfriendtextnormal\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\techo get_Field($row_checkout['field_key'],$saved_checkoutvals,$cartData,$cur_form);\r\n\t\t\t\t\t?>\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t?> \r\n\t\t</table>\t</td>\r\n\t</tr>\r\n\t<?php\r\n $google_displayed = false;\r\n\tif(!($google_exists && $google_recommended ==0) or $paytypes_cnt>0)\r\n\t{\r\n\t?>\t\r\n\t\t<tr>\r\n\t\t<td colspan=\"4\" align=\"right\" class=\"emailfriendtext\"><input name=\"payonaccount_payment_Submit\" type=\"submit\" class=\"buttongray\" id=\"payonaccount_payment_Submit\" value=\"<?=\"Make Payment\"?>\"/></td>\r\n\t\t</tr>\r\n\t<?php\r\n\t}\r\n }\r\n if($ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_key'] == \"PAYPAL_EXPRESS\" and $_REQUEST['pret']!=1) // case if paypal express is active in current website\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0' class=\"shoppingcarttable\">\r\n <?php\r\n if($totpaycnt>0 or $google_displayed==true)\r\n {\r\n ?>\r\n <tr>\r\n <td align=\"right\" valign=\"middle\" class=\"google_or\" colspan=\"2\">\r\n <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n </td>\r\n </tr> \r\n <?php\r\n }\r\n ?>\r\n <tr>\r\n <td align=\"left\" valign=\"top\" class=\"google_td\" width=\"60%\"><?php echo stripslashes($Captions_arr['CART']['CART_PAYPAL_HELP_MSG']);?></td>\r\n <td align=\"right\" valign=\"middle\" class=\"google_td\">\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input type='button' name='submit_express' style=\"background:url('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'); width:145px;height:42px;cursor:pointer\" border='0' align='top' alt='PayPal' onclick=\"validate_payonaccount_paypal(document.frm_payonaccount_payment)\"/>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n <?php\r\n }\r\n elseif($_REQUEST['pret']==1) // case if returned from paypal so creating input types to hold the payment type and payment method ids\r\n {\r\n ?>\r\n <tr>\r\n <td colspan=\"2\">\r\n <table width='100%' cellpadding='0' cellspacing='0' border='0'>\r\n <tr>\r\n <td colspan=\"2\" align=\"right\" class=\"gift_mid_table_td\">\r\n <input type='hidden' name='payonaccount_paytype' id = 'payonaccount_paytype' value='<?php echo $ecom_common_settings['paytypeCode']['credit_card']['paytype_id']?>'/>\r\n <input type='hidden' name='payonaccount_paymethod' id = 'payonaccount_paymethod' value='PAYPAL_EXPRESS_<?php echo $ecom_common_settings['paymethodKey']['PAYPAL_EXPRESS']['paymethod_id']?>'/>\r\n <input type='hidden' name='override_paymethod' id = 'override_paymethod' value='1'/>\r\n <input type='hidden' name='token' id = 'token' value='<?php echo $_REQUEST['token']?>'/>\r\n <input type='hidden' name='payer_id' id = 'payer_id' value='<?php echo $_REQUEST['payer_id']?>'/>\r\n <input type='hidden' name='for_paypal' id='for_paypal' value='0'/>\r\n <input name=\"buypayonaccountpayment_Submit\" type=\"button\" class=\"buttongray\" id=\"buypayonaccountpayment_Submit\" value=\"<?=$Captions_arr['PAYONACC']['PAYON_PAY']?>\" onclick=\"validate_payonaccount(document.frm_payonaccount_payment)\" /></td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \r\n <?php\r\n }\r\n\t?>\r\n\t\t\t</form>\r\n\t<?php\r\n\t\t \t// Check whether the google checkout button is to be displayed\r\n\t\tif($google_exists && $google_recommended ==0 && $_REQUEST['pret']!=1)\r\n\t\t{\r\n\t\t\t$row_google = $db->fetch_array($ret_google);\r\n\t?>\r\n\t<tr>\r\n\t<td colspan=\"2\">\r\n\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shoppingcarttable\">\r\n\t\t<?php \r\n\t\tif($paytypes_cnt>0)\r\n\t\t{\r\n $google_displayed = true;\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td align=\"right\" valign=\"middle\" class=\"google_or\">\r\n\t\t\t <img src=\"<?php echo url_site_image('gateway_or.gif')?>\" alt=\"Or\" border=\"0\" />\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t<?php\r\n\t\t}\r\n\t\t?>\t\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"6\" align=\"right\" valign=\"middle\" class=\"google_td\">\r\n\t\t\t<?php\r\n\t\t\t\t$display_option = 'ALL';\r\n\t\t\t\t// Get the details of current customer to pass to google checkout\r\n\t\t\t\t$pass_type \t= 'payonaccount';\r\n\t\t\t\t$cust_details \t= stripslashes($row_cust['customer_title']).stripslashes($row_cust['customer_fname']).' '.stripslashes($row_cust['customer_surname']).' - '.stripslashes($row_cust['customer_email_7503']).' - '.$ecom_hostname;\r\n\t\t\t\t$cartData[\"totals\"][\"bonus_price\"] = $paying_amt;\r\n\t\t\t\trequire_once('includes/google_library/googlecart.php');\r\n\t\t\t\trequire_once('includes/google_library/googleitem.php');\r\n\t\t\t\trequire_once('includes/google_library/googleshipping.php');\r\n\t\t\t\trequire_once('includes/google_library/googletax.php');\r\n\t\t\t\tinclude(\"includes/google_checkout.php\");\r\n\t\t\t?>\t\r\n\t\t\t</td>\r\n\t\t</tr>\t\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<?php\r\n\t\t\t}\r\n\t?>\t\r\n\t</table>\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n\t\t<script type=\"text/javascript\">\r\n\t\tfunction validate_payonaccount(frm)\r\n\t\t{\r\n if(document.getElementById('for_paypal').value!=1)\r\n {\r\n\t\t<?php\r\n\t\t\tif(count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqadd_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req)?>);\r\n\t\t\t\treqadd_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutadd_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif(count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\t\treqcc_arr \t\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req)?>);\r\n\t\t\t\treqcc_arr_str\t\t= new Array(<?php echo implode(\",\",$chkoutcc_Req_Desc)?>);\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\tfieldRequired\t\t= new Array();\r\n\t\t\tfieldDescription\t= new Array();\r\n\t\t\tvar i=0;\r\n\t\t\t<?php\r\n\t\t\tif($Settings_arr['imageverification_req_payonaccount'])\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tfieldRequired[i] \t\t= 'payonaccountpayment_Vimg';\r\n\t\t\tfieldDescription[i]\t = 'Image Verification Code';\r\n\t\t\ti++;\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutadd_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_cheque_tr').style.display=='') /* do the following only if checque is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqadd_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqadd_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqadd_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t\tif (count($chkoutcc_Req))\r\n\t\t\t{\r\n\t\t\t?>\r\n\t\t\tif(document.getElementById('payonaccount_self_tr').style.display=='') /* do the following only if protx or self is selected */\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<reqcc_arr.length;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tfieldRequired[i] \t= reqcc_arr[j];\r\n\t\t\t\t\tfieldDescription[i] = reqcc_arr_str[j];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t<?php\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Email))\r\n\t\t\t{\r\n\t\t\t$chkout_Email_Str \t\t= implode(\",\",$chkout_Email);\r\n\t\t\techo \"fieldEmail \t\t= Array(\".$chkout_Email_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\techo \"fieldEmail \t\t= Array();\";\r\n\t\t\t// Password checking\r\n\t\t\tif (count($chkout_Confirm))\r\n\t\t\t{\r\n\t\t\t$chkout_Confirm_Str \t= implode(\",\",$chkout_Confirm);\r\n\t\t\t$chkout_Confirmdesc_Str\t= implode(\",\",$chkout_Confirmdesc);\r\n\t\t\techo \"fieldConfirm \t\t= Array(\".$chkout_Confirm_Str.\");\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array(\".$chkout_Req_Desc_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\techo \"fieldConfirm \t\t= Array();\";\r\n\t\t\techo \"fieldConfirmDesc \t= Array();\";\r\n\t\t\t}\t\r\n\t\t\tif (count($chkout_Numeric))\r\n\t\t\t{\r\n\t\t\t\t$chkout_Numeric_Str \t\t= implode(\",\",$chkout_Numeric);\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array(\".$chkout_Numeric_Str.\");\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\techo \"fieldNumeric \t\t\t= Array();\";\r\n\t\t\t?>\r\n\t\t\tif(Validate_Form_Objects(frm,fieldRequired,fieldDescription,fieldEmail,fieldConfirm,fieldConfirmDesc,fieldNumeric))\r\n\t\t\t{\r\n\t\t\t/* Check whether atleast one payment type is selected */\r\n\t\t\tvar atleastpay = false;\r\n\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t{\r\n\t\t\t\tif(frm.elements[k].name=='payonaccount_paytype')\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\tatleastpay = true; /* Done to handle the case of only one payment type */\r\n\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\tatleastpay = true;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\tif(atleastpay==false)\r\n\t\t\t{\r\n\t\t\t\talert('Please select payment type');\r\n\t\t\t\treturn false;\t\r\n\t\t\t}\r\n\t\t\tif (document.getElementById('paymentmethod_req').value==1)\r\n\t\t\t{\r\n\t\t\t\tvar atleast = false;\r\n\t\t\t\tfor(k=0;k<frm.elements.length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(frm.elements[k].name=='payonaccount_paymethod')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(frm.elements[k].type=='hidden')\r\n\t\t\t\t\t\t\tatleast = true; /* Done to handle the case of only one payment method */\r\n\t\t\t\t\t\telse if(frm.elements[k].checked==true)\r\n\t\t\t\t\t\t\tatleast = true;\t\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\t\r\n\t\t\t\tif(atleast ==false)\r\n\t\t\t\t{\r\n\t\t\t\t\talert('Please select a payment method');\r\n\t\t\t\t\treturn false;\t\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\t{\r\n if(document.getElementById('override_paymethod'))\r\n {\r\n if(document.getElementById('override_paymethod').value!=1)\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n document.getElementById('payonaccount_paymethod').value = 0; \r\n }\r\n }\r\n else\r\n {\r\n if (document.getElementById('payonaccount_paymethod'))\r\n\t\t\t\t\tdocument.getElementById('payonaccount_paymethod').value = 0;\r\n }\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/* Handling the case of credit card related sections*/\r\n\t\t\tif(frm.checkoutpay_cardtype)\r\n\t\t\t{\r\n\t\t\t\tif(frm.checkoutpay_cardtype.value)\r\n\t\t\t\t{\r\n\t\t\t\t\tobjarr = frm.checkoutpay_cardtype.value.split('_');\r\n\t\t\t\t\tif(objarr.length==4) /* if the value splitted to exactly 4 elements*/\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar key \t\t= objarr[0];\r\n\t\t\t\t\t\tvar issuereq \t= objarr[1];\r\n\t\t\t\t\t\tvar seccount \t= objarr[2];\r\n\t\t\t\t\t\tvar cc_count \t= objarr[3];\r\n\t\t\t\t\t\tif (isNaN(frm.checkoutpay_cardnumber.value))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should be numeric');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_cardnumber.value.length>cc_count)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Credit card number should not contain more than '+cc_count+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_cardnumber.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (frm.checkoutpay_securitycode.value.length>seccount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert('Security Code should not contain more than '+seccount+' digits');\r\n\t\t\t\t\t\t\tfrm.checkoutpay_securitycode.focus();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t/* If reached here then everything is valid \r\n\t\t\t\tchange the action of the form to the desired value\r\n\t\t\t*/\r\n\t\t\t\tif(document.getElementById('save_payondetails'))\r\n\t\t\t\t\tdocument.getElementById('save_payondetails').value \t= 1;\r\n if(document.getElementById('payonaccount_payment_Submit'))\r\n\t\t\t\tshow_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n\t\t\t\t/*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n\t\t\t\tfrm.action = 'payonaccount_payment_submit.php';\r\n\t\t\t\tfrm.submit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\t\r\n\t\t\telse\r\n\t\t\treturn false;\r\n }\r\n else\r\n {\r\n if(document.getElementById('save_payondetails'))\r\n document.getElementById('save_payondetails').value = 1;\r\n show_wait_button(document.getElementById('payonaccount_payment_Submit'),'Please wait...');\r\n /*frm.action = 'payonaccount_payment_submit.php?bsessid=<?php //echo base64_encode($ecom_hostname)?>';*/\r\n frm.action = 'payonaccount_payment_submit.php';\r\n frm.submit();\r\n return true;\r\n }\r\n\t\t}\r\n function validate_payonaccount_paypal(frm)\r\n {\r\n if(document.getElementById('for_paypal'))\r\n document.getElementById('for_paypal').value = 1;\r\n validate_payonaccount(frm);\r\n }\r\n\t\t</script>\t\r\n\t\t<?php\t\r\n\t\t}", "private function sendEmail($data_ipn, $oggetto) {\n // TEST EMAIL RICEZIONE DATI PAGAMENTO PAYPAL\n $this->load->library('email');\n //CONFIG EMAIL\n $config['protocol'] = 'mail';\n $config['smtp_host'] = 'smtp.1und1.de';\n $config['smtp_port'] = '465';\n $config['mailtype'] = 'html';\n $config['mailpath'] = '/usr/sbin/sendmail';\n $config['charset'] = 'utf-8';\n $config['wordwrap'] = TRUE;\n $this->email->initialize($config);\n\n // SEND EMAIL WITH POST DATA\n $this->email->from('abosupport@tuunes.co', 'WebHoock BrainTree Tuunes.co');\n $this->email->to('dev@whitepointprojects.com');\n //$oggetto = 'Subscription Paypal';\n $this->email->subject($oggetto);\n $html = ('\n <div style:\"font-size: 16px\">\n <p>NOTIFICA BRAINTREE<br><br><br>'.var_export($data_ipn, true).'</p>\n <p><br></p>\n <p><br></p>\n <p>JSON ENCODE <br><br></p>\n <p>'.json_encode($data_ipn).'</p>\n </div>\n ');\n $this->email->message($html);\n $this->email->send(); // SEND EMAIL\n }" ]
[ "0.6799806", "0.67965186", "0.67521703", "0.67317563", "0.66334337", "0.6628375", "0.6599239", "0.65218854", "0.6512071", "0.6488888", "0.6421714", "0.63494885", "0.6312783", "0.6306745", "0.6209183", "0.6170638", "0.615291", "0.6120368", "0.6115444", "0.6101425", "0.607831", "0.6072129", "0.6051557", "0.6010162", "0.5997576", "0.59844065", "0.5970675", "0.59676087", "0.5966588", "0.5961696", "0.59391165", "0.5924365", "0.59150827", "0.5913772", "0.5913461", "0.5908897", "0.590159", "0.5893572", "0.58883166", "0.58849365", "0.58844244", "0.5871454", "0.5870701", "0.58648396", "0.58646667", "0.5833769", "0.58304596", "0.58147675", "0.58013034", "0.57784355", "0.5777555", "0.57773674", "0.57767165", "0.5762816", "0.5758228", "0.5755362", "0.57450134", "0.5730562", "0.57258815", "0.57233715", "0.57160246", "0.5712605", "0.5708633", "0.57058936", "0.5702617", "0.5699174", "0.56895876", "0.56830275", "0.5678163", "0.567775", "0.5674034", "0.5667648", "0.5664641", "0.5660841", "0.5655931", "0.5654969", "0.565375", "0.56530654", "0.5653006", "0.5647032", "0.5642588", "0.5636732", "0.5631866", "0.5626358", "0.5625983", "0.56257325", "0.56185627", "0.5613444", "0.56124693", "0.56117004", "0.56076324", "0.56011534", "0.5595567", "0.5591101", "0.557869", "0.55748767", "0.5571732", "0.5569819", "0.55662036", "0.5560129" ]
0.69227797
0
To get the new customer id, when there's no meta key, then use the email edited in the EDD includes/payments/functions.php line 1045 !! //
function getfaircoin_price($price){ global $edd_options; if( $price == 0 ) { // <span style="font-family:arial">ƒ</span> $price = '1 Fair = '.number_format($edd_options['faircoin_price'], 2, '.', ',').' EUR'; } return $price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _lookupCustomerId()\n {\n return $this->_customerFactory->create()\n ->loadByEmail($this->_quote->getCustomerEmail())\n ->getId();\n }", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }", "public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }", "public function getCustomerId()\n {\n return Mage::getSingleton('customer/session')->getCustomerId();\n }", "public function getExtCustomerId();", "public function getCustomerId() {\n return $this->customerID;\n }", "function customer_id($customer_id=null)\n {\n if (isset($customer_id)) $this->customer_id = intval($customer_id);\n return $this->customer_id;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "function jpid_next_customer_id() {\n\treturn JPID()->db_customers->get_next_id();\n}", "public function getNewCustomerInvoice(){\n\t\t// $invoice_counter = \\DB::table('appsetting')->where('name','invoice_counter')->first()->value;\n\t\t// $invoice_number = 'INV/' . date('Y') . '/000' . $invoice_counter++;\n\t\t// // update invoice counter\n\t\t// \\DB::table('appsetting')->where('name','invoice_counter')->update(['value'=>$invoice_counter]);\n\n\t\treturn Helper::GenerateCustomerInvoiceNumber();\n\t}", "public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }", "public function getCustomerId()\n {\n return $this->getSavedCustomer()->id;\n }", "function getCustomeruuid()\n {\n return $this->customer_uuid;\n }", "public static function fakeCustomerId() {\n\t\t\t\n\t\t\t$lastCustomerId = Customer::select('customer_id')->orderBy('customer_id', 'desc')->take(1)->get()->first();\n\t\t\tif ($lastCustomerId == null) {\n\t\t\t\t$lastCustomerId = 0;\n\t\t\t}\n\t\t\treturn ++$lastCustomerId;\n\t\t}", "function edd_pup_get_customer_updates( $payment_id, $email_id ) {\r\n\r\n\tif ( empty( $payment_id ) || empty( $email_id ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tglobal $wpdb;\r\n\t$payment_id = absint( $payment_id );\r\n\t$email_id = absint( $email_id );\r\n\r\n\treturn unserialize( trim( $wpdb->get_var( $wpdb->prepare( \"SELECT products FROM $wpdb->edd_pup_queue WHERE email_id = %d AND customer_id = %d\", $email_id, $payment_id ) ) ) );\r\n}", "public function getCustomer_Id() {\n return $this->customer_Id; \n }", "public function customerId(): int\n {\n return $this->customerId;\n }", "private function getCustomerId()\n {\n $customerSession = \\Magento\\Framework\\App\\ObjectManager::getInstance()->get(\\Magento\\Customer\\Model\\SessionFactory::class);\n return $customerSession->create()->getId();\n }", "public function getCustomerId(): ?string\n {\n if (count($this->customerId) == 0) {\n return null;\n }\n return $this->customerId['value'];\n }", "public function getCustomerId()\n {\n return $this->getValue('nb_customer_id');\n }", "function add_customer()\n\t{\n\t\t$table = \"customer\";\n\t\t$where = \"customer_email = '\".$this->input->post('user_email').\"'\";\n\t\t$items = \"customer_id\";\n\t\t$order = \"customer_id\";\n\t\t\n\t\t$result = $this->select_entries_where($table, $where, $items, $order);\n\t\t\n\t\tif(count($result) > 0)\n\t\t{\n\t\t\t$customer_id = $result[0]->customer_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'customer_email'=>$this->input->post('user_email'),\n\t\t\t\t'customer_name'=>$this->input->post('seller_name'),\n\t\t\t\t'customer_phone'=>$this->input->post('user_phone')\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"customer\";\n\t\t\t$customer_id = $this->insert($table, $data);\n\t\t}\n\t\t\n\t\treturn $customer_id;\n\t}", "public function getCustomerId()\n {\n return $this->getParameter('customerId');\n }", "protected function getCustomerId()\n {\n return $this->customerSession->getCustomer()->getId();\n }", "function firstdata_create_saved_profile($db,$customer_id,&$error)\n{\n return $customer_id;\n}", "public function getCustid()\n {\n return $this->custid;\n }", "protected function get_customer_id() {\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\treturn null;\n\t\t}\n\t\t$current = get_current_user_id();\n\t\tif ( 0 == $current ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $current;\n\t}", "function carton_paying_customer( $order_id ) {\n\n\t$order = new CTN_Order( $order_id );\n\n\tif ( $order->user_id > 0 ) {\n\t\tupdate_user_meta( $order->user_id, 'paying_customer', 1 );\n\n\t\t$old_count = absint( get_user_meta( $order->user_id, '_order_count', true ) );\n\t\tupdate_user_meta( $order->user_id, '_order_count', $old_count + 1 );\n\t}\n\n}", "public function getCustomerId()\n {\n $value = $this->get(self::customer_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getCustomerId()\n {\n if (is_null($this->customerId)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_CUSTOMER_ID);\n if (is_null($data)) {\n return null;\n }\n $this->customerId = (string) $data;\n }\n\n return $this->customerId;\n }", "public function getCustomerId()\n {\n return $this->_customerSession->getCustomerId();\n }", "function getStripeCustomerId(){\n\n $getCusId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n if($getCusId){\n return $getCusId->stripeCustomerId;\n }else{\n return FALSE;\n }\n\n }", "function get_id() : string {\n\t$current_user = wp_get_current_user();\n\treturn sha1( $current_user->user_email );\n}", "private function getCustomerId()\n {\n $customer_id = session('customer_id');\n\n return (int) $customer_id;\n }", "function getCustomerNo() {\n return $this->customerNo;\n }", "public function getStripeCustomerId() {\n return $this->stripe_customer_id;\n\n }", "public function getCustomerOrderId();", "protected function _getIdentifier()\n\t{\n\t\treturn $this->_getCookieValue(Df_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');\n\t}", "public function getCustomerEmail(){\n return $this->customer_email;\n }", "function check_customer($email) {\n\n\tglobal $cxn;\n\t\n\t$the_id=0;\n\t\n\t$sql=\"select id from customers where email='$email'\";\n\t$query=$cxn->query($sql);\n\t$count=$query->num_rows;\n\tif($count>0)\n\t{\n\t\t//echo \"hello\";\n\t\t$row=$query->fetch_object();\n\t\t$the_id=$row->id;\n\t}\n\telse\n\t{\n\t\t\n\t$first_name=$cxn->real_escape_string(trim($_POST['first_name']));\n\t$last_name=$cxn->real_escape_string(trim($_POST['last_name']));\n\t$street_address_one=$cxn->real_escape_string(trim($_POST['street_address_one']));\n\t$street_address_two=$cxn->real_escape_string(trim($_POST['street_address_two']));\n\t$city=$cxn->real_escape_string(trim($_POST['city']));\n\t$state=$cxn->real_escape_string(trim($_POST['state']));\n\t$zip=$cxn->real_escape_string(trim($_POST['zip']));\n\t$cell_phone=$cxn->real_escape_string(trim($_POST['cell_phone']));\n\t$billing_first_name=$cxn->real_escape_string(trim($_POST['billing_first_name']));\n\t$billing_last_name=$cxn->real_escape_string(trim($_POST['billing_last_name']));\n\t$billing_street_address_one=$cxn->real_escape_string(trim($_POST['billing_street_address_one']));\n\t$billing_street_address_two=$cxn->real_escape_string(trim($_POST['billing_street_address_two']));\n\t$billing_city=$cxn->real_escape_string(trim($_POST['billing_city']));\n\t$billing_state=$cxn->real_escape_string(trim($_POST['billing_state']));\n\t$billing_zip=$cxn->real_escape_string(trim($_POST['billing_zip']));\n\t$email=$cxn->real_escape_string(trim($_POST['email_address']));\n\t$password=$cxn->real_escape_string(trim($_POST['password']));\n\t\n\t$sql=\"INSERT into customers (first_name, last_name, street_one, street_two, city, state, zip, shipping_first_name, shipping_last_name, shipping_address_one, shipping_address_two, shipping_city, shipping_state, shipping_zip, cell_phone, email, password) VALUES ('$billing_first_name', '$billing_last_name', '$billing_street_address_one', '$billing_street_address_two', '$billing_city', '$billing_state', '$billing_zip', '$first_name', '$last_name', '$street_address_one', '$street_address_two', '$city', '$state', '$zip', '$cell_phone', '$email', '$password')\";\n\t\tif(!$query=$cxn->query($sql))\n\t\t{\n\t\t\t$err='query_failure:'\n\t\t\t.'ERRNO: '\n\t\t\t.$mysqli->errno\n\t\t\t.'ERROR: '\n\t\t\t.$mysqli->error\n\t\t\t.PHP_EOL\n\t\t\t.' QUERY: '\n\t\t\t.$query\n\t\t\t.PHP_EOL;\n\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t}\n\t\n\t$the_id = $cxn->insert_id;\n\t\t\n\t}\n\t\n\treturn $the_id;\n}", "public function getAutoPurchaseCustomerId($customerData) {\n //Get last purchase Id\n $purchaseOrderData = DB::table('purchase_order')->select('id')->orderBy('id', 'desc')->first();\n\n //Generate Po_id\n if ($purchaseOrderData == null) {\n $autoId = str_pad(1, 4, '0', STR_PAD_LEFT);\n } else {\n $autoId = str_pad($purchaseOrderData->id + 1, 4, '0', STR_PAD_LEFT);\n }\n return $customerData->id . \"-\" . $autoId;\n }", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function getCustomerIdentity()\n {\n return $this->customerIdentity;\n }", "protected function _getAuthenticatedCustomerId()\n {\n // get customer session object\n $session = $this->_getCustomerSession();\n\n // return authenticated customer ID, if any\n return $session->getCustomerId();\n }", "protected function getCustomerId()\n {\n $_customerSession = Mage::getSingleton('customer/session');\n \n if ($_customerSession->isLoggedIn())\n return $_customerSession->getCustomer()->getId();\n\n return false;\n }", "public function saveExtraRegistrationData($customerId)\n {\n if (isset($_POST['billing_first_name'])) {\n update_user_meta($customerId, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n if (isset($_POST['billing_last_name'])) {\n update_user_meta($customerId, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n if (isset($_POST['billing_address_1'])) {\n update_user_meta($customerId, 'billing_address_1', sanitize_text_field($_POST['billing_address_1']));\n }\n if (isset($_POST['billing_city'])) {\n update_user_meta($customerId, 'billing_city', sanitize_text_field($_POST['billing_city']));\n }\n if (isset($_POST['billing_postcode'])) {\n update_user_meta($customerId, 'billing_postcode', sanitize_text_field($_POST['billing_postcode']));\n }\n if (isset($_POST['billing_phone'])) {\n update_user_meta($customerId, 'billing_phone', sanitize_text_field($_POST['billing_phone']));\n }\n if (isset($_POST['billing_country'])) {\n update_user_meta($customerId, 'billing_country', sanitize_text_field($_POST['billing_country']));\n }\n }", "public function getExternalCustomerId()\n {\n return $this->external_customer_id;\n }", "function getMetafieldCustomer($customerId, $key) {\n\n try {\n $client = HttpClient::create();\n $response = $client->request('GET', shopifyApiurl . 'customers/'.$customerId.'/metafields.json?key='.$key);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n\n return $response->getContent();\n }", "public function getGravityCustomerId()\n {\n return $this->getGravityHelper()->getApiUser();\n }", "function add_customer($customer_info){\n\n\t if(check_token($customer_info['crf_code'],'check')){\n\t\tif(mysqli_result_(mysqli_query_(\"select count('customer_id') from customers where customer_id='\".sanitize($customer_info['customer_id']).\"'\"), 0) != '1'){\n\n \t\t\t\t$cust_id = mysqli_result_(mysqli_query_(\"select customer_id from customers where customer_name='\".sanitize($customer_info['customer_name']).\"' and mobile='\".sanitize($customer_info['mobile']).\"' LIMIT 1 \"), 0);\n\t\t\t\tif($cust_id && sanitize($customer_info['mobile']) !=''){ // if exist return id \n\t\t\t\t\treturn $cust_id;\n\t\t\t\t }else{ // create then return id not dublicate \n\n\t\t\t\t\t\tif(mysqli_result_(mysqli_query_(\"select count(customer_id) from customers where customer_name='\".sanitize($customer_info['customer_name']).\"' and customer_name!='' and mobile='' \"), 0) != '0' && sanitize($customer_info['mobile']) ==''){\n\t\t\t\t\t\t\tdie(\" <strong> write fullname or add mobile because this \".sanitize($customer_info['customer_name']).\" is already exist </strong>\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t \tmysqli_query_(\"insert into customers (customer_id,customer_name,mobile,delete_status) values('','\".sanitize($customer_info['customer_name']).\"','\".sanitize($customer_info['mobile']).\"','0')\");\n\t\t\t\t\t\t\treturn mysqli_result_(mysqli_query_(\"SELECT customer_id FROM customers ORDER BY customer_id DESC LIMIT 1\"),0);\n\t\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t}else{\n\n\t\t\t\t$cust_name = (sanitize($customer_info['customer_name']) != '')?\"customer_name='\".sanitize($customer_info['customer_name']).\"', \":'';\n\t\t\t\tmysqli_query_(\"update customers set $cust_name mobile='\".sanitize($customer_info['mobile']).\"' where customer_id=\".sanitize($customer_info['customer_id']));\n\t\t\t\treturn sanitize($customer_info['customer_id']);\n\t\t\t}\n\t\t}else{\n \t\t\tdie('login'); \n\t\t}\n}", "abstract public function getMailCrmId();", "function saveCustomerId($customer_id){\n\n $where = array('userId'=>$this->session->userdata('userId'));\n $isUpdated = $this->common_model->updateFields(USERS, array('stripeCustomerId'=>$customer_id),$where);\n\n if($isUpdated){\n return TRUE;\n }\n\n }", "function set_customer_id($blog_id, $customer_id) {\n\t\tglobal $wpdb;\n\t\t\n\t\t$exists = $wpdb->get_var( $wpdb->prepare(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}pro_sites_stripe_customers WHERE blog_id = %d\", $blog_id) );\t\t\t\t\t\t\t\t\t\n\t\tif ( $exists ) {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET customer_id = %s WHERE blog_id = %d\", $customer_id, $blog_id) );\t\t\t\t\t\t\t\n\t\t} else {\t\t\t\n\t\t\t$wpdb->query($wpdb->prepare(\"INSERT INTO {$wpdb->base_prefix}pro_sites_stripe_customers(blog_id, customer_id) VALUES (%d, %s)\", $blog_id, $customer_id) );\t\t\t\t\t\t\t\n\t\t}\n\t}", "public function getCustomerEmail();", "public function getCustomerEmail();", "public function getCustomerEmail();", "public function paymentId() : string;", "public function getCustomerId(): ?int\n {\n return $this->customerId;\n }", "public function getCustomerId() : int\n {\n return (int)$this->session->getCustomerId();\n }", "protected function _getCustomer()\n {\n return Mage::registry('current_customer');\n }", "protected function getProfileId($_customer, $payment=null) {\r\n\t\tif( $this->_debug ) Mage::log('getProfileId()', null, 'authnetcim.log');\r\n\t\t\r\n\t\t$profile_id = $_customer->getAuthnetcimProfileId();\r\n\t\tif( intval($profile_id) < 1 ) {\r\n\t\t\t$profile_id\t= $this->createCustomerProfile( $_customer, $payment );\r\n\t\t}\r\n\t\t\r\n\t\treturn !empty($profile_id) ? $profile_id : 0;\r\n\t}", "function cb_custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {\n\tif ($order->get_payment_method() == 'coinbase') {\n\t\t$fields['coinbase_commerce_reference'] = array(\n\t\t\t'label' => __( 'Coinbase Commerce Reference #' ),\n\t\t\t'value' => $order->get_meta( '_coinbase_charge_id' ),\n\t\t);\n\t}\n\n\treturn $fields;\n}", "private function saveCustomer($customer){\n \n $customermodel = new CustomerModel();\n $customermodel->save($customer);\n return $this->insertID();\n }", "function getfaircoin_edd_store_usermeta( $payment_id ) {\r\n // return if user is not logged in\r\n if ( ! is_user_logged_in() )\r\n return;\r\n // get the user's ID\r\n $user_id = get_current_user_id();\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['edd_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['edd_fairsaving'] );\r\n}", "public function getOrderId($customer_id);", "private function GetUser()\r\n\t\t{\r\n\t\t\tif (!empty($_POST['customer_id']))\r\n\t\t\t\treturn $_POST['customer_id'];\r\n\t\t\t\r\n\t\t\tif (!empty($_GET['customer_id']))\r\n\t\t\t\treturn $_GET['customer_id'];\r\n\t\t}", "public function getCustomerEmail()\n {\n return $this->customerEmail;\n }", "public function add_customer($order) {\n\n $customerData = array(\n 'name' => $order->billing_first_name,\n 'last_name' => $order->billing_last_name,\n 'email' => $order->billing_email,\n 'requires_account' => false,\n 'phone_number' => $order->billing_phone, \n );\n\n if($this->hasAddress($order)) {\n $customerData['address'] = array(\n 'line1' => substr($order->billing_address_1, 0, 200),\n 'line2' => substr($order->billing_address_2, 0, 50),\n 'line3' => '',\n 'state' => $order->billing_state,\n 'city' => $order->billing_city,\n 'postal_code' => $order->billing_postcode,\n 'country_code' => $order->billing_country\n );\n }\n \n $response = $this->openpay_request($customerData, 'customers');\n\n if (!isset($response->error_code)) {\n // Store the ID on the user account\n if (is_user_logged_in()) {\n update_user_meta(get_current_user_id(), '_openpay_customer_id', $response->id);\n }\n\n // Store the ID in the order\n update_post_meta($order->id, '_openpay_customer_id', $response->id);\n\n return $response->id;\n } else {\n $msg = $this->handleRequestError($response->error_code);\n return new WP_Error('error', __($response->error_code.' '.$msg, 'openpay-woosubscriptions'));\n }\n }", "public function saveIdentDataForNewCustomer(Varien_Event_Observer $observer)\n {\n if (!Mage::getModel('postident/config')->isEnabled()) {\n return;\n }\n \n $quote = $observer->getEvent()->getOrder()->getQuote();\n $customer = $observer->getEvent()->getOrder()->getCustomer();\n $checkoutMethod = $quote->getCheckoutMethod();\n \n if (!is_null($quote)\n && !is_null($quote->getPostidentVerificationData())\n && $checkoutMethod != Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST\n ) {\n $customer = Mage::Helper('postident/data')->saveIdentDataToCustomer($customer, $quote);\n \n //This updates the customer object in the session - ensures that it has the postident data\n Mage::getSingleton('customer/session')->setCustomer($customer);\n }\n }", "public function getUserCustomerEmail($customerId)\n {\n $query = craft()->db->createCommand()\n ->select('email')\n ->from('customerpoints_user')\n ->where('id=' . $customerId)\n ->queryAll();\n\n return (count($query) == 0) ? 0 : $query[0]['email'];\n }", "public function getCustomerNumber(): ?string\n {\n return $this->data->customerNumber;\n }", "function cs_wc_save_extra_register_fields( $customer_id ) {\r\n if ( isset( $_POST['billing_first_name'] ) ) {\r\n // WordPress default first name field.\r\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n // WooCommerce billing first name.\r\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n }\r\n if ( isset( $_POST['billing_last_name'] ) ) {\r\n // WordPress default last name field.\r\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n // WooCommerce billing last name.\r\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n }\r\n}", "function add_voucher($order_id){\n\t$order = wc_get_order( $order_id );\n\terror_log($order_id);\n\t//echo \"<script language='javascript'>alert('$order_id');</script>\";\n\t//$order = new WC_Order($order_id);\n\t$items = $order->get_items();\n\t$customer = $order->get_user_id();\n\terror_log($customer);\n\t//echo \"<script language='javascript'>alert('$customer');</script>\";\n\tforeach ( $items as $item ) {\n $product_name = $item->get_name();\n $product_id = $item->get_product_id();\n $product_variation_id = $item->get_variation_id();\n\t}\n\t\n\t/* query */\n\t$mylink = $wpdb->get_row( \"\n\tSELECT * FROM $table_name WHERE art_id = $product_id AND used_by = '' ORDER BY created ASC LIMIT 1\n\t\" );\n\t\n\tif ($mylink !== null) {\n\t\n\t\t/* write to db */\n\t\t$wpdb->update( \n\t\t\t$table_name, \n\t\t\tarray( \n\t\t\t\t'used_by' => $customer,\t// string\n\t\t\t\t'order_id' => $order_id\t// integer (number) \n\t\t\t), \n\t\t\tarray( 'ID' => $mylink->id ), \n\t\t\tarray( \n\t\t\t\t'%d',\t// value1\n\t\t\t\t'%d'\t// value2\n\t\t\t), \n\t\t\tarray( '%d' ) \n\t\t);\n\t\t\n\t\t\n\t\t/* send mail */\n\t\n\t\n\t}\n}", "public function getCustomerCode(): string\n {\n return $this->getData(self::CUSTOMER_CODE);\n }", "private static function extractCustomerId(Message $request): string\n {\n // Most requests contain customer ID in the request, so we aim to extract that.\n if (method_exists($request, 'getCustomerId')) {\n return $request->getCustomerId();\n } elseif (method_exists($request, 'getResourceName')) {\n // In some cases, customer ID is available in the form of resource name, such as many\n // Get requests.\n $resourceName = $request->getResourceName();\n $segments = explode('/', $resourceName);\n if ($segments[0] === 'customers') {\n return $segments[1];\n }\n }\n return '\"No customer ID could be extracted from the request\"';\n }", "function get_emailaddress ($connID,$data_base,$table_name,$custid) {\n\t$custid=intval($custid);\n\t$command = \"select * from $table_name where custid = $custid\";\n $result = mysql_query($command);\n if ($result) {\n $emailaddress = mysql_result($result, 0, cust_email);\n // next alert message print 'alert(\"new_orderid command is \\n\\n'.$command.'\\n\")';\n print '<script type=\"text/javascript\">';\n print 'alert(\"Retrieved emailaddress from '.$table_name.' for custid '\n\t\t .$custid.'\\n\\nMessage being emailed to '.$emailaddress.'\\n\")';\n print '</script>'; \n\n return $emailaddress; // return customer email address\n } else {\n print '<script type=\"text/javascript\">';\n print 'alert(\"query result mysql_errno is = '.mysql_errno($connID).' !\\nmysql_errormsg = '\n .mysql_error($connID).'\\nNo results found - Returning empty!\\n\")';\n print '</script>'; \n // exit(); \n return 0;\n }\n}", "public function buildCustomerId($prefix,$customer_id)\n {\n return $prefix.'_ps_'.$customer_id.'_'.date('YmdHis');\n }", "public function generateAndSetInvoiceNumber();", "private function getRandomCustomer(): int {\n $rand_key = array_rand($this->customers, 1);\n return $this->customers[$rand_key];\n }", "function getNewEmailId($id_user) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT * FROM scuola.email_store WHERE isnull(data_email)\" .\n \" AND id_user = %s\", $id_user);\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error($GLOBALS['link']));\n }\n }\n $this->closeConnection();\n return $result;\n }", "function add_payment_campaign_meta( $payment_id ){//, $new_status, $old_status ) {\n $cart_items = edd_get_payment_meta_cart_details( $payment_id );\n if( !isset($cart_items[0]['id']) ) {\n\n } else {\n $product = $cart_items[0]['id'];\n $product_meta = get_post_meta( $payment_id, '_edd_payment_campaign');\n if(!$product_meta || $product_meta != $product){\n update_post_meta( $payment_id, '_edd_payment_campaign', $product);\n }\n }\n}", "public function getCustomerEmail(){\n return $this->_getData(self::CUSTOMER_EMAIL);\n }", "function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\n }", "public function checkout_billing_email_field() {\n\t\t\t$lost_password_url = get_site_url() . '/my-account/lost-password/';\n\t\t\t$current_user_name = wp_get_current_user()->display_name;\n\t\t\t$current_user_email = wp_get_current_user()->user_email;\n\t\t\t$is_allow_login = 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' );\n\n\t\t\t?>\n\t\t\t\t<div class=\"ast-customer-info\" id=\"customer_info\">\n\t\t\t\t\t<div class=\"ast-customer-info__notice woocommerce-error\"></div>\n\t\t\t\t\t<div class=\"woocommerce-billing-fields-custom\">\n\t\t\t\t\t<?php $customer_title = __( 'Customer information', 'astra-addon' ); ?>\n\t\t\t\t\t\t<div class=\"ast-checkout-form-heading\">\n\t\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t\t<?php esc_html_e( apply_filters( 'astra_addon_modern_checkout_customer_info_title', $customer_title ), 'astra-addon' ); // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText ?>\n\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t<?php if ( ! is_user_logged_in() && $is_allow_login ) { ?>\n\t\t\t\t\t\t\t\t<div class=\"woocommerce-billing-fields__customer-login-label\"><?php /* translators: %1$s: Link HTML start, %2$s Link HTML End */ echo sprintf( __( 'Already have an account? %1$1s Log in%2$2s', 'astra-addon' ), '<a href=\"javascript:\" id=\"ast-customer-login-url\">', '</a>' ); ?></div> <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"woocommerce-billing-fields__customer-info-wrapper\">\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( ! is_user_logged_in() ) {\n\t\t\t\t\t\t\tdo_action( 'astra_checkout_login_field_before' );\n\t\t\t\t\t\t\t\twoocommerce_form_field(\n\t\t\t\t\t\t\t\t\t'billing_email',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'type' => 'email',\n\t\t\t\t\t\t\t\t\t\t'class' => array( 'form-row-fill' ),\n\t\t\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t\t\t'label' => __( 'Email Address', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t'placeholder' => __( 'Email Address', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t'autocomplete' => 'email username',\n\t\t\t\t\t\t\t\t\t\t'default' => isset( $_COOKIE['ast_modern_checkout_useremail'] ) ? esc_attr( $_COOKIE['ast_modern_checkout_useremail'] ) : '',\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div id=\"ast-customer-login-section\" style=\"display:none\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ast-customer-login-inner-wrap\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\twoocommerce_form_field(\n\t\t\t\t\t\t\t\t\t\t\t\t'billing_password',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'password',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => array( 'form-row-fill', 'ast-password-field' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'label' => __( 'Password', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'placeholder' => __( 'Password', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\tdo_action( 'astra_checkout_login_field_after' );\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<div class=\"ast-customer-login-actions\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\techo \"<input type='button' name='ast-customer-login-btn' class='button ast-customer-login-section__login-button' id='ast-customer-login-section__login-button' value='\" . esc_html( __( 'Login', 'astra-addon' ) ) . \"'>\";\n\t\t\t\t\t\t\t\t\t\t\techo \"<a href='$lost_password_url' class='ast-customer-login-lost-password-url'>\" . esc_html( __( 'Lost your password?', 'astra-addon' ) ) . '</a>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tdo_action( 'astra_checkout_login_after' );\n\t\t\t\t\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_enable_guest_checkout', false ) ) {\n\t\t\t\t\t\t\t\t\t\techo \"<p class='ast-login-section-message'>\" . esc_html( __( 'Login is optional, you can continue with your order below.', 'astra-addon' ) ) . '</p>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ( 'yes' === get_option( 'woocommerce_enable_signup_and_login_from_checkout' ) ) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ast-create-account-section\" hidden>\n\t\t\t\t\t\t\t\t\t<?php if ( 'yes' === get_option( 'woocommerce_enable_guest_checkout' ) ) { ?>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"form-row form-row-wide create-account\">\n\t\t\t\t\t\t\t\t\t\t\t\t<label class=\"woocommerce-form__label woocommerce-form__label-for-checkbox checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<input class=\"woocommerce-form__input woocommerce-form__input-checkbox input-checkbox\" id=\"createaccount\" type=\"checkbox\" name=\"createaccount\" value=\"1\" /> <span><?php esc_html_e( 'Create an account?', 'astra-addon' ); ?></span>\n\t\t\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t\t\t\t\t<div class=\"create-account\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\tif ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) {\n\t\t\t\t\t\t\t\t\t\t\twoocommerce_form_field(\n\t\t\t\t\t\t\t\t\t\t\t\t'account_username',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => array( 'form-row-fill' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'id' => 'account_username',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'label' => __( 'Account username', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'placeholder' => __( 'Account username', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif ( 'no' === get_option( 'woocommerce_registration_generate_password' ) ) {\n\t\t\t\t\t\t\t\t\t\t\twoocommerce_form_field(\n\t\t\t\t\t\t\t\t\t\t\t\t'account_password',\n\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'type' => 'password',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'id' => 'account_password',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'class' => array( 'form-row-fill' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'label' => __( 'Create account password', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'placeholder' => __( 'Create account password', 'astra-addon' ),\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t<?php } else { ?>\n\t\t\t\t\t\t\t\t\t<div class=\"ast-logged-in-customer-info\"> <?php /* translators: %1$s: username, %2$s emailid */ echo apply_filters( 'astra_addon_logged_in_customer_info_text', sprintf( __( ' Welcome Back %1$s (%2$s)', 'astra-addon' ), esc_attr( $current_user_name ), esc_attr( $current_user_email ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>\n\t\t\t\t\t\t\t\t\t\t<div><input type=\"hidden\" class=\"ast-email-address\" id=\"billing_email\" name=\"billing_email\" value=\"<?php echo esc_attr( $current_user_email ); ?>\"/></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<?php } ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}", "function wooc_save_extra_register_fields( $customer_id ) {\n if ( isset( $_POST['billing_first_name'] ) ) {\n // WordPress default first name field.\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n // WooCommerce billing first name.\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n }\n if ( isset( $_POST['billing_last_name'] ) ) {\n // WordPress default last name field.\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n // WooCommerce billing last name.\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n }\n}", "function generate_receipt_no()\n {\n return m_setting('evaluation.receipt_prefix') . date('dmyHis');\n }", "function payment_id($payment_id=null)\n {\n if (isset($payment_id)) $this->payment_id = $payment_id;\n return $this->payment_id;\n }", "public function getID()\n {\n return $this->billingId;\n }", "function ciniki_fatt_certCustomerUpdate(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'certcustomer_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Certification'), \n 'cert_id'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Certification'), \n 'customer_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Customer'), \n 'date_received'=>array('required'=>'no', 'blank'=>'no', 'type'=>'date', 'name'=>'Certification Date'), \n 'flags'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Options'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'fatt', 'private', 'checkAccess');\n $rc = ciniki_fatt_checkAccess($ciniki, $args['tnid'], 'ciniki.fatt.certCustomerUpdate'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the time information for tenant and user\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n date_default_timezone_set($intl_timezone);\n\n //\n // Get the existing cert customer\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectGet');\n $rc = ciniki_core_objectGet($ciniki, $args['tnid'], 'ciniki.fatt.certcustomer', $args['certcustomer_id']);\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n if( !isset($rc['certcustomer']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.fatt.71', 'msg'=>'Certfication not found'));\n }\n $certcustomer = $rc['certcustomer'];\n\n //\n // Check if expiry date should be updated\n //\n if( (isset($args['cert_id']) && $args['cert_id'] != $certcustomer['cert_id']) // Did the cert change?\n || (isset($args['date_received']) && $args['date_received'] != '') // Did the date received changed?\n ) {\n if( isset($args['date_received']) && $args['date_received'] != '' ) {\n $dt = new DateTime($args['date_received'], new DateTimeZone($intl_timezone));\n } else {\n $dt = new DateTime($certcustomer['date_received'], new DateTimeZone($intl_timezone));\n }\n if( isset($args['cert_id']) && $args['cert_id'] != '' ) {\n $rc = ciniki_core_objectGet($ciniki, $args['tnid'], 'ciniki.fatt.cert', $args['cert_id']);\n } else {\n $rc = ciniki_core_objectGet($ciniki, $args['tnid'], 'ciniki.fatt.cert', $certcustomer['cert_id']);\n }\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['cert']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.fatt.72', 'msg'=>'The certification does not exist'));\n }\n $cert = $rc['cert'];\n \n //\n // Setup the expiry date, based on date received and years_valid from cert \n //\n if( $cert['years_valid'] > 0 ) {\n $dt->add(new DateInterval('P' . $cert['years_valid'] . 'Y'));\n $args['date_expiry'] = $dt->format('Y-m-d');\n } else {\n $args['date_expiry'] = '';\n }\n }\n\n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.fatt');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Update the cert in the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.fatt.certcustomer', $args['certcustomer_id'], $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.fatt');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.fatt');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'fatt');\n\n return array('stat'=>'ok');\n}", "function wp_generate_user_request_key($request_id)\n {\n }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "function InfGetContactId($email) {\n\t\n\t$object_type = \"Contact\";\n $class_name = \"Infusionsoft_\" . $object_type;\n $object = new $class_name();\n // Order by most recent contact with that Email\n#\t$objects = Infusionsoft_DataService::query(new $class_name(), array('ContactId' => $payment['ContactId']));\n $objects = Infusionsoft_DataService::queryWithOrderBy(new $class_name(), array('Email' => $email), 'DateCreated', false);\n $contact_array = array();\n foreach ($objects as $i => $object) {\n $contact_array[$i] = $object->toArray();\n }\n foreach ($contact_array as $i => $contact) {\n\t\treturn $contact['Id'];\n\t}\n\treturn \"\";\n}", "public function getCurrentContactId(): int\n {\n return $this->accountService->getAccountContactId();\n }", "public function getCustomerStoreId(Mage_Customer_Model_Customer $customer){\r\n\t\tif(!($storeId = $customer->getSendemailStoreId())){\r\n\t\t\t/*\r\n\t\t\t* store_id might be zero if the account was created in the admin interface\r\n\t\t\t*/\r\n\t\t\t$storeId = $customer->getStoreId();\r\n\t\t\tif(!$storeId && $customer->getWebsiteId()){\r\n\t\t\t\t/*\r\n\t\t\t\t* Use the default store groups store of the customers website\r\n\t\t\t\t*/\r\n\t\t\t\tif($store = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()){\r\n\t\t\t\t\t$storeId = $store->getId();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// In case the website_id is not yet set on the customer, and the\r\n\t\t\t// current store is a frontend store, use the current store ID\r\n\t\t\tif(!$storeId && !Mage::app()->getStore()->isAdmin()){\r\n\t\t\t\t$storeId = Mage::app()->getStore()->getId();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $storeId;\r\n\t}", "protected function save_subscription_meta( $order_id, $customer_id ) {\n\t\tupdate_post_meta( $order_id, '_simplify_customer_id', wc_clean( $customer_id ) );\n\t}", "function getpurchaseuuid()\n {\n return $this->purchase_uuid;\n }", "public function getCustomerNote();", "public function getEcrRegistrationNumber()\n {\n return array_key_exists('ecr_registration_number', $this->data) ? $this->data['ecr_registration_number'] : null;\n }" ]
[ "0.6771996", "0.6672954", "0.6672954", "0.6672954", "0.6672414", "0.6652171", "0.6652171", "0.6585821", "0.65795696", "0.6568585", "0.65485704", "0.65485704", "0.65449065", "0.65175074", "0.6506866", "0.648252", "0.64372087", "0.64064616", "0.63907295", "0.63876206", "0.62923324", "0.6270374", "0.6244752", "0.62019044", "0.62013733", "0.6200132", "0.6196752", "0.61614996", "0.6150022", "0.61458045", "0.61414015", "0.6125226", "0.6110303", "0.6110073", "0.6080066", "0.60693556", "0.6067373", "0.60642546", "0.60635924", "0.60632515", "0.6013777", "0.60103065", "0.6002742", "0.6002657", "0.5998844", "0.5984005", "0.5956381", "0.5948743", "0.5934573", "0.5928085", "0.5921746", "0.59039426", "0.5867341", "0.5864536", "0.5836504", "0.5816727", "0.5798771", "0.5798771", "0.5798771", "0.57656074", "0.57486546", "0.5744354", "0.5737823", "0.5729883", "0.5714197", "0.570175", "0.5679029", "0.5678277", "0.5660906", "0.563016", "0.56280863", "0.562186", "0.5608431", "0.5587938", "0.5584497", "0.5575333", "0.5573889", "0.55728877", "0.5571511", "0.5549086", "0.5541302", "0.55378914", "0.55311537", "0.5524115", "0.552017", "0.55153626", "0.54936415", "0.54887897", "0.54794395", "0.54677856", "0.546165", "0.54590285", "0.54484105", "0.5429679", "0.542855", "0.54258305", "0.5416114", "0.54129165", "0.54061174", "0.5401412", "0.5396828" ]
0.0
-1
add_filter( 'edd_eur_currency_filter_before', 'getfaircoin_currency_filter' ); //edd_eur_currency_filter_after
function getfaircoin_currency_filter_before($formated, $currency, $price){ //$price_arr = explode(' ', $price); //if( count( $price_arr ) > 1 ) { echo 'FORMATED: '.$formated.' PRICE: '.$price; //} //return $price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acadp_currency_filter( $price = '', $currency_settings = array() ) {\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$position = $currency_settings['position'];\n\n\t$negative = $price < 0;\n\n\tif( $negative ) {\n\t\t$price = substr( $price, 1 ); // Remove proceeding \"-\" -\n\t}\n\n\t$symbol = acadp_currency_symbol( $currency );\n\n\tif( $position == 'before' ) {\n\n\t\tswitch( $currency ) {\n\t\t\tcase \"GBP\" :\n\t\t\tcase \"BRL\" :\n\t\t\tcase \"EUR\" :\n\t\t\tcase \"USD\" :\n\t\t\tcase \"AUD\" :\n\t\t\tcase \"CAD\" :\n\t\t\tcase \"HKD\" :\n\t\t\tcase \"MXN\" :\n\t\t\tcase \"NZD\" :\n\t\t\tcase \"SGD\" :\n\t\t\tcase \"JPY\" :\n\t\t\t\t$formatted = $symbol . $price;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$formatted = $currency . ' ' . $price;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$formatted = apply_filters( 'acadp_' . strtolower( $currency ) . '_currency_filter_before', $formatted, $currency, $price );\n\n\t} else {\n\n\t\tswitch( $currency ) {\n\t\t\tcase \"GBP\" :\n\t\t\tcase \"BRL\" :\n\t\t\tcase \"EUR\" :\n\t\t\tcase \"USD\" :\n\t\t\tcase \"AUD\" :\n\t\t\tcase \"CAD\" :\n\t\t\tcase \"HKD\" :\n\t\t\tcase \"MXN\" :\n\t\t\tcase \"SGD\" :\n\t\t\tcase \"JPY\" :\n\t\t\t\t$formatted = $price . $symbol;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$formatted = $price . ' ' . $currency;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$formatted = apply_filters( 'acadp_' . strtolower( $currency ) . '_currency_filter_after', $formatted, $currency, $price );\n\n\t}\n\n\tif( $negative ) {\n\t\t// Prepend the mins sign before the currency sign\n\t\t$formatted = '-' . $formatted;\n\t}\n\n\treturn $formatted;\n\n}", "function get_ffd_currency() {\r\n\treturn apply_filters( 'ffd_currency', get_option( 'ffd_currency' ) );\r\n}", "function acadp_payment_currency_filter( $price = '' ) {\n\n\treturn acadp_currency_filter( $price, acadp_get_payment_currency_settings() );\n\n}", "function erp_get_currencies() {\n return apply_filters( 'erp_currencies', [\n 'AFN' => __( 'Afghan Afghani', 'erp' ),\n 'ALL' => __( 'Albanian Lek', 'erp' ),\n 'DZD' => __( 'Algerian Dinar', 'erp' ),\n 'ADP' => __( 'Andorran Peseta', 'erp' ),\n 'AOA' => __( 'Angolan Kwanza', 'erp' ),\n 'ARA' => __( 'Argentine Austral', 'erp' ),\n 'ARS' => __( 'Argentine Peso', 'erp' ),\n 'AMD' => __( 'Armenian Dram', 'erp' ),\n 'AWG' => __( 'Aruban Florin', 'erp' ),\n 'AUD' => __( 'Australian Dollar', 'erp' ),\n 'ATS' => __( 'Austrian Schilling', 'erp' ),\n 'AZN' => __( 'Azerbaijani Manat', 'erp' ),\n 'BSD' => __( 'Bahamian Dollar', 'erp' ),\n 'BHD' => __( 'Bahraini Dinar', 'erp' ),\n 'BDT' => __( 'Bangladeshi Taka', 'erp' ),\n 'BBD' => __( 'Barbadian Dollar', 'erp' ),\n 'BYR' => __( 'Belarusian Ruble', 'erp' ),\n 'BEF' => __( 'Belgian Franc', 'erp' ),\n 'BZD' => __( 'Belize Dollar', 'erp' ),\n 'BMD' => __( 'Bermudan Dollar', 'erp' ),\n 'BTN' => __( 'Bhutanese Ngultrum', 'erp' ),\n 'BOB' => __( 'Bolivian Boliviano', 'erp' ),\n 'BOV' => __( 'Bolivian Mvdol', 'erp' ),\n 'BOP' => __( 'Bolivian Peso', 'erp' ),\n 'BAM' => __( 'Bosnia-Herzegovina Convertible Mark', 'erp' ),\n 'BWP' => __( 'Botswanan Pula', 'erp' ),\n 'BRL' => __( 'Brazilian Real', 'erp' ),\n 'GBP' => __( 'British Pound Sterling', 'erp' ),\n 'BND' => __( 'Brunei Dollar', 'erp' ),\n 'BGN' => __( 'Bulgarian Lev', 'erp' ),\n 'BUK' => __( 'Burmese Kyat', 'erp' ),\n 'BIF' => __( 'Burundian Franc', 'erp' ),\n 'KHR' => __( 'Cambodian Riel', 'erp' ),\n 'CAD' => __( 'Canadian Dollar', 'erp' ),\n 'CVE' => __( 'Cape Verdean Escudo', 'erp' ),\n 'KYD' => __( 'Cayman Islands Dollar', 'erp' ),\n 'XOF' => __( 'CFA Franc BCEAO', 'erp' ),\n 'XAF' => __( 'CFA Franc BEAC', 'erp' ),\n 'XPF' => __( 'CFP Franc', 'erp' ),\n 'CLP' => __( 'Chilean Peso', 'erp' ),\n 'CNY' => __( 'Chinese Yuan', 'erp' ),\n 'COP' => __( 'Colombian Peso', 'erp' ),\n 'KMF' => __( 'Comorian Franc', 'erp' ),\n 'CDF' => __( 'Congolese Franc', 'erp' ),\n 'CRC' => __( 'Costa Rican Colón', 'erp' ),\n 'HRK' => __( 'Croatian Kuna', 'erp' ),\n 'CUP' => __( 'Cuban Peso', 'erp' ),\n 'CYP' => __( 'Cypriot Pound', 'erp' ),\n 'CZK' => __( 'Czech Republic Koruna', 'erp' ),\n 'DKK' => __( 'Danish Krone', 'erp' ),\n 'DJF' => __( 'Djiboutian Franc', 'erp' ),\n 'DOP' => __( 'Dominican Peso', 'erp' ),\n 'NLG' => __( 'Dutch Guilder', 'erp' ),\n 'XCD' => __( 'East Caribbean Dollar', 'erp' ),\n 'ECS' => __( 'Ecuadorian Sucre', 'erp' ),\n 'EGP' => __( 'Egyptian Pound', 'erp' ),\n 'GQE' => __( 'Equatorial Guinean Ekwele', 'erp' ),\n 'ERN' => __( 'Eritrean Nakfa', 'erp' ),\n 'EEK' => __( 'Estonian Kroon', 'erp' ),\n 'ETB' => __( 'Ethiopian Birr', 'erp' ),\n 'EUR' => __( 'Euro', 'erp' ),\n 'FKP' => __( 'Falkland Islands Pound', 'erp' ),\n 'FJD' => __( 'Fijian Dollar', 'erp' ),\n 'FIM' => __( 'Finnish Markka', 'erp' ),\n 'FRF' => __( 'French Franc', 'erp' ),\n 'GMD' => __( 'Gambian Dalasi', 'erp' ),\n 'GEL' => __( 'Georgian Lari', 'erp' ),\n 'DEM' => __( 'German Mark', 'erp' ),\n 'GHS' => __( 'Ghanaian Cedi', 'erp' ),\n 'GIP' => __( 'Gibraltar Pound', 'erp' ),\n 'GRD' => __( 'Greek Drachma', 'erp' ),\n 'GTQ' => __( 'Guatemalan Quetzal', 'erp' ),\n 'GWP' => __( 'Guinea-Bissau Peso', 'erp' ),\n 'GNF' => __( 'Guinean Franc', 'erp' ),\n 'GYD' => __( 'Guyanaese Dollar', 'erp' ),\n 'HTG' => __( 'Haitian Gourde', 'erp' ),\n 'HNL' => __( 'Honduran Lempira', 'erp' ),\n 'HKD' => __( 'Hong Kong Dollar', 'erp' ),\n 'HUF' => __( 'Hungarian Forint', 'erp' ),\n 'ISK' => __( 'Icelandic Króna', 'erp' ),\n 'INR' => __( 'Indian Rupee', 'erp' ),\n 'IDR' => __( 'Indonesian Rupiah', 'erp' ),\n 'IRR' => __( 'Iranian Rial', 'erp' ),\n 'IQD' => __( 'Iraqi Dinar', 'erp' ),\n 'IEP' => __( 'Irish Pound', 'erp' ),\n 'ILS' => __( 'Israeli New Sheqel', 'erp' ),\n 'ITL' => __( 'Italian Lira', 'erp' ),\n 'JMD' => __( 'Jamaican Dollar', 'erp' ),\n 'JPY' => __( 'Japanese Yen', 'erp' ),\n 'JOD' => __( 'Jordanian Dinar', 'erp' ),\n 'KZT' => __( 'Kazakhstani Tenge', 'erp' ),\n 'KES' => __( 'Kenyan Shilling', 'erp' ),\n 'KWD' => __( 'Kuwaiti Dinar', 'erp' ),\n 'KGS' => __( 'Kyrgystani Som', 'erp' ),\n 'LAK' => __( 'Laotian Kip', 'erp' ),\n 'LVL' => __( 'Latvian Lats', 'erp' ),\n 'LBP' => __( 'Lebanese Pound', 'erp' ),\n 'LSL' => __( 'Lesotho Loti', 'erp' ),\n 'LRD' => __( 'Liberian Dollar', 'erp' ),\n 'LYD' => __( 'Libyan Dinar', 'erp' ),\n 'LTL' => __( 'Lithuanian Litas', 'erp' ),\n 'LTT' => __( 'Lithuanian Talonas', 'erp' ),\n 'LUF' => __( 'Luxembourgian Franc', 'erp' ),\n 'MOP' => __( 'Macanese Pataca', 'erp' ),\n 'MKD' => __( 'Macedonian Denar', 'erp' ),\n 'MGA' => __( 'Malagasy Ariary', 'erp' ),\n 'MWK' => __( 'Malawian Kwacha', 'erp' ),\n 'MYR' => __( 'Malaysian Ringgit', 'erp' ),\n 'MVR' => __( 'Maldivian Rufiyaa', 'erp' ),\n 'MLF' => __( 'Malian Franc', 'erp' ),\n 'MTL' => __( 'Maltese Lira', 'erp' ),\n 'MRO' => __( 'Mauritanian Ouguiya', 'erp' ),\n 'MUR' => __( 'Mauritian Rupee', 'erp' ),\n 'MXN' => __( 'Mexican Peso', 'erp' ),\n 'MDL' => __( 'Moldovan Leu', 'erp' ),\n 'MCF' => __( 'Monegasque Franc', 'erp' ),\n 'MNT' => __( 'Mongolian Tugrik', 'erp' ),\n 'MAD' => __( 'Moroccan Dirham', 'erp' ),\n 'MZN' => __( 'Mozambican Metical', 'erp' ),\n 'MMK' => __( 'Myanmar Kyat', 'erp' ),\n 'NAD' => __( 'Namibian Dollar', 'erp' ),\n 'NPR' => __( 'Nepalese Rupee', 'erp' ),\n 'ANG' => __( 'Netherlands Antillean Guilder', 'erp' ),\n 'TWD' => __( 'New Taiwan Dollar', 'erp' ),\n 'NZD' => __( 'New Zealand Dollar', 'erp' ),\n 'NIO' => __( 'Nicaraguan Córdoba', 'erp' ),\n 'NGN' => __( 'Nigerian Naira', 'erp' ),\n 'KPW' => __( 'North Korean Won', 'erp' ),\n 'NOK' => __( 'Norwegian Krone', 'erp' ),\n 'OMR' => __( 'Omani Rial', 'erp' ),\n 'PKR' => __( 'Pakistani Rupee', 'erp' ),\n 'PAB' => __( 'Panamanian Balboa', 'erp' ),\n 'PGK' => __( 'Papua New Guinean Kina', 'erp' ),\n 'PYG' => __( 'Paraguayan Guarani', 'erp' ),\n 'PEI' => __( 'Peruvian Inti', 'erp' ),\n 'PHP' => __( 'Philippine Peso', 'erp' ),\n 'PLN' => __( 'Polish Zloty', 'erp' ),\n 'PTE' => __( 'Portuguese Escudo', 'erp' ),\n 'QAR' => __( 'Qatari Rial', 'erp' ),\n 'RHD' => __( 'Rhodesian Dollar', 'erp' ),\n 'RON' => __( 'Romanian Leu', 'erp' ),\n 'RUB' => __( 'Russian Ruble', 'erp' ),\n 'RWF' => __( 'Rwandan Franc', 'erp' ),\n 'SVC' => __( 'Salvadoran Colón', 'erp' ),\n 'WST' => __( 'Samoan Tala', 'erp' ),\n 'STD' => __( 'São Tomé & Príncipe Dobra', 'erp' ),\n 'SAR' => __( 'Saudi Riyal', 'erp' ),\n 'RSD' => __( 'Serbian Dinar', 'erp' ),\n 'SCR' => __( 'Seychellois Rupee', 'erp' ),\n 'SLL' => __( 'Sierra Leonean Leone', 'erp' ),\n 'SGD' => __( 'Singapore Dollar', 'erp' ),\n 'SKK' => __( 'Slovak Koruna', 'erp' ),\n 'SIT' => __( 'Slovenian Tolar', 'erp' ),\n 'SBD' => __( 'Solomon Islands Dollar', 'erp' ),\n 'SOS' => __( 'Somali Shilling', 'erp' ),\n 'ZAR' => __( 'South African Rand', 'erp' ),\n 'KRW' => __( 'South Korean Won', 'erp' ),\n 'SSP' => __( 'South Sudanese Pound', 'erp' ),\n 'ESP' => __( 'Spanish Peseta', 'erp' ),\n 'LKR' => __( 'Sri Lankan Rupee', 'erp' ),\n 'SHP' => __( 'St. Helena Pound', 'erp' ),\n 'SDG' => __( 'Sudanese Pound', 'erp' ),\n 'SRD' => __( 'Surinamese Dollar', 'erp' ),\n 'SZL' => __( 'Swazi Lilangeni', 'erp' ),\n 'SEK' => __( 'Swedish Krona', 'erp' ),\n 'CHF' => __( 'Swiss Franc', 'erp' ),\n 'SYP' => __( 'Syrian Pound', 'erp' ),\n 'TJS' => __( 'Tajikistani Somoni', 'erp' ),\n 'TZS' => __( 'Tanzanian Shilling', 'erp' ),\n 'THB' => __( 'Thai Baht', 'erp' ),\n 'TPE' => __( 'Timorese Escudo', 'erp' ),\n 'TOP' => __( 'Tongan Paʻanga', 'erp' ),\n 'TTD' => __( 'Trinidad & Tobago Dollar', 'erp' ),\n 'TND' => __( 'Tunisian Dinar', 'erp' ),\n 'TRY' => __( 'Turkish Lira', 'erp' ),\n 'TMT' => __( 'Turkmenistani Manat', 'erp' ),\n 'UGX' => __( 'Ugandan Shilling', 'erp' ),\n 'UAH' => __( 'Ukrainian Hryvnia', 'erp' ),\n 'AED' => __( 'United Arab Emirates Dirham', 'erp' ),\n 'UYU' => __( 'Uruguayan Peso', 'erp' ),\n 'USD' => __( 'US Dollar', 'erp' ),\n 'UZS' => __( 'Uzbekistan Som', 'erp' ),\n 'VUV' => __( 'Vanuatu Vatu', 'erp' ),\n 'VEF' => __( 'Venezuelan Bolívar', 'erp' ),\n 'VND' => __( 'Vietnamese Dong', 'erp' ),\n 'YER' => __( 'Yemeni Rial', 'erp' ),\n 'ZMW' => __( 'Zambian Kwacha', 'erp' ),\n 'ZWL' => __( 'Zimbabwean Dollar', 'erp' ),\n ] );\n}", "function get_carton_currency() {\n\treturn apply_filters( 'carton_currency', get_option('carton_currency') );\n}", "public function organique_price_filter_init() {\n\t\t\t\tif ( is_active_widget( false, false, 'organique_price_filter', true ) && ! is_admin() ) {\n\n\t\t\t\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\t\t\t\t\twp_register_script( 'wc-price-slider', WC()->plugin_url() . '/assets/js/frontend/price-slider' . $suffix . '.js', array( 'jquery-ui-slider' ), WC_VERSION, true );\n\n\t\t\t\t\twp_localize_script( 'wc-price-slider', 'woocommerce_price_slider_params', array(\n\t\t\t\t\t\t'currency_symbol' => get_woocommerce_currency_symbol(),\n\t\t\t\t\t\t'currency_pos' => get_option( 'woocommerce_currency_pos' ),\n\t\t\t\t\t\t'min_price' => isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : '',\n\t\t\t\t\t\t'max_price' => isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : ''\n\t\t\t\t\t) );\n\n\t\t\t\t\tadd_filter( 'loop_shop_post_in', array( $this, 'price_filter' ) );\n\t\t\t\t}\n\t\t\t}", "function add_filters()\n {\n }", "function tmpl_fetch_currency(){\r\n\t$currency = get_option('currency_symbol');\r\n\tif($currency){\r\n\t\treturn $currency;\r\n\t}else{\r\n\t\treturn '$';\r\n\t}\t\r\n}", "public function _post_filter()\n {\n }", "function es_custom_product_filters( $output ) {\n\tglobal $wp_query;\n\t\n\tforeach ( $wp_query->query_vars['meta_query'] as $key => $value ) {\n\t\tif ( $value['key'] == '_backorders' ) {\n\t\t\t$current_backorders_value = isset( $value['value'] ) ? $value['value'] : '';\n\t\t}\n\t\telseif ( $value['key'] == 'member_price' ) {\n\t\t\t$curent_price_value = isset( $value['value'] ) ? $value['value'] : '';\n\t\t\t$current_price_key = $value['key'];\n\t\t}\n\t\telseif ( $value['key'] == '_sale_price' ) {\n\t\t\t$curent_price_value = isset( $value['value'] ) ? $value['value'] : '';\n\t\t\t$current_price_key = $value['key'];\n\t\t}\n\t}\n\t\n\t//$current_backorders_value = isset( $wp_query->query_vars['meta_value'] ) ? $wp_query->query_vars['meta_value'] : '';\n\t\n\t$output .= '<select id=\"allow-backorders-filter\" class=\"backorders\" name=\"allow_backorders_filter\">';\n\t$output .= '<option value=\"\" ' . selected( $current_backorders_value, '', false ) . '>' . __( 'Allow backorders?', 'woocommerce' ) . '</option>';\n\t//<option selected=\"selected\" value=\"\">Allow backorders?</option>';\n\n\t$options = array(\n\t\t'no' => __( 'Do not allow', 'woocommerce' ),\n\t\t'notify' => __( 'Allow, but notify customer', 'woocommerce' ),\n\t\t'yes' => __( 'Allow', 'woocommerce' )\n\t);\n\t\n\tforeach ( $options as $key => $value ) {\n\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\"' . selected( $current_backorders_value, $key, false ) . '>'. $value .'</option>';\n\t}\n\t\n\t$output .= '</select>';\n\t\n\t$output .='<select id=\"price-filter\" class=\"\" name=\"price_filter\">\n\t\t\t\t<option value=\"\" ' . selected( $curent_price_value, '', false ) . '>Show All Prices</option>\n\t\t\t\t<option value=\"member-price\" ' . selected( $current_price_key, 'member_price', false ) . '>Member Prices</option>\n\t\t\t\t<option value=\"sale-price\" ' . selected( $current_price_key, '_sale_price', false ) . '>Sale Prices</option>\n\t\t\t\t</select>';\n\t\n\treturn $output;\n}", "function fetch_currency_with_symbol($amount,$currency = '')\r\n{\r\n\t$amt_display = '';\r\n\tif($amount==''){ $amount =0; }\r\n\t$decimals=get_option('tmpl_price_num_decimals');\r\n\t$decimals=($decimals!='')?$decimals:2;\r\n\tif($amount >=0 )\r\n\t{\r\n\t\tif(@$amount !='')\r\n\t\t\t$amount = $amount;\r\n\t\t\t$currency = get_option('currency_symbol');\r\n\t\t\t$position = get_option('currency_pos');\r\n\t\tif($position == '1')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.$amount;\r\n\t\t}\r\n\t\telse if($position == '2')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.' '.$amount;\r\n\t\t}\r\n\t\telse if($position == '3')\r\n\t\t{\r\n\t\t\t$amt_display = $amount.$currency;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$amt_display = $amount.' '.$currency;\r\n\t\t}\r\n\t\treturn apply_filters('tmpl_price_format',$amt_display,$amount,$currency);\r\n\t}\r\n}", "function getfaircoin_price($price){\r\n global $edd_options;\r\n\r\n if( $price == 0 ) { // <span style=\"font-family:arial\">ƒ</span>\r\n $price = '1 Fair = '.number_format($edd_options['faircoin_price'], 2, '.', ',').' EUR';\r\n }\r\n return $price;\r\n}", "function acf_disable_filters()\n{\n}", "public function run()\n {\n $collection = Mage::getResourceModel('aw_layerednavigation/filter_collection')\n ->addFieldToFilter('type', array('eq' => AW_Layerednavigation_Model_Source_Filter_Type::DECIMAL_PRICE_CODE))\n ;\n $priceFilterModel = $collection->getFirstItem();\n\n if (!$priceFilterModel->getId()) {\n $priceFilterData = array(\n 'title' => Mage::helper('aw_layerednavigation')->__('Price'),\n 'type' => AW_Layerednavigation_Model_Source_Filter_Type::DECIMAL_PRICE_CODE,\n 'is_enabled' => 1,\n 'is_enabled_in_search' => 1,\n 'code' => $this->getUniqueCode('price'),\n 'position' => 0,\n 'display_type' => AW_Layerednavigation_Model_Source_Filter_Display_Type::RANGE_CODE,\n 'image_position' => AW_Layerednavigation_Model_Source_Filter_Image_Position::TEXT_ONLY_CODE,\n 'is_row_count_limit_enabled' => self::IS_ROW_COUNT_LIMIT_STATUS,\n 'row_count_limit' => self::ROW_COUNT_LIMIT,\n 'additional_data' => array(),\n );\n $priceFilterModel->setData($priceFilterData)->save();\n }\n }", "function acadp_get_currency() {\n\n\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\n\treturn strtoupper( $currency );\n\n}", "function current_filter()\n {\n }", "function acf_enable_filter($name = '')\n{\n}", "function acf_get_filters()\n{\n}", "function templatic_get_currency_type()\r\n{\r\n\tglobal $wpdb;\r\n\t$option_value = get_option('currency_code');\r\n\tif($option_value)\r\n\t{\r\n\t\treturn stripslashes($option_value);\r\n\t}else\r\n\t{\r\n\t\treturn 'USD';\r\n\t}\r\n\t\r\n}", "function acf_enable_filters($filters = array())\n{\n}", "function _wpsc_fix_latvia_currency() {\n\t$country = new WPSC_Country( array(\n\t\t'isocode' => 'LV',\n\t\t'currency' => __( 'Euro', 'wpsc' ),\n\t\t'symbol' => __( '€', 'wpsc' ),\n\t\t'symbol_html' => __( '&#8364;', 'wpsc' ),\n\t\t'code' => __( 'EUR', 'wpsc' )\n\t) );\n\n}", "function beforeFilter() {\n }", "function pms_get_currency_symbol( $currency_code ) {\r\n\r\n $currencies = apply_filters('pms_currency_symbols',\r\n array(\r\n 'AED' => '&#1583;.&#1573;', // ?\r\n 'AFN' => '&#65;&#102;',\r\n 'ALL' => '&#76;&#101;&#107;',\r\n 'AMD' => '',\r\n 'ANG' => '&#402;',\r\n 'AOA' => '&#75;&#122;', // ?\r\n 'ARS' => '&#36;',\r\n 'AUD' => '&#36;',\r\n 'AWG' => '&#402;',\r\n 'AZN' => '&#1084;&#1072;&#1085;',\r\n 'BAM' => '&#75;&#77;',\r\n 'BBD' => '&#36;',\r\n 'BDT' => '&#2547;', // ?\r\n 'BGN' => '&#1083;&#1074;',\r\n 'BHD' => '.&#1583;.&#1576;', // ?\r\n 'BIF' => '&#70;&#66;&#117;', // ?\r\n 'BMD' => '&#36;',\r\n 'BND' => '&#36;',\r\n 'BOB' => '&#36;&#98;',\r\n 'BRL' => '&#82;&#36;',\r\n 'BSD' => '&#36;',\r\n 'BTN' => '&#78;&#117;&#46;', // ?\r\n 'BWP' => '&#80;',\r\n 'BYR' => '&#112;&#46;',\r\n 'BZD' => '&#66;&#90;&#36;',\r\n 'CAD' => '&#36;',\r\n 'CDF' => '&#70;&#67;',\r\n 'CHF' => '&#67;&#72;&#70;',\r\n 'CLF' => '', // ?\r\n 'CLP' => '&#36;',\r\n 'CNY' => '&#165;',\r\n 'COP' => '&#36;',\r\n 'CRC' => '&#8353;',\r\n 'CUP' => '&#8396;',\r\n 'CVE' => '&#36;', // ?\r\n 'CZK' => '&#75;&#269;',\r\n 'DJF' => '&#70;&#100;&#106;', // ?\r\n 'DKK' => '&#107;&#114;',\r\n 'DOP' => '&#82;&#68;&#36;',\r\n 'DZD' => '&#1583;&#1580;', // ?\r\n 'EGP' => '&#163;',\r\n 'ETB' => '&#66;&#114;',\r\n 'EUR' => '&#8364;',\r\n 'FJD' => '&#36;',\r\n 'FKP' => '&#163;',\r\n 'GBP' => '&#163;',\r\n 'GEL' => '&#4314;', // ?\r\n 'GHS' => '&#162;',\r\n 'GIP' => '&#163;',\r\n 'GMD' => '&#68;', // ?\r\n 'GNF' => '&#70;&#71;', // ?\r\n 'GTQ' => '&#81;',\r\n 'GYD' => '&#36;',\r\n 'HKD' => '&#36;',\r\n 'HNL' => '&#76;',\r\n 'HRK' => '&#107;&#110;',\r\n 'HTG' => '&#71;', // ?\r\n 'HUF' => '&#70;&#116;',\r\n 'IDR' => '&#82;&#112;',\r\n 'ILS' => '&#8362;',\r\n 'INR' => '&#8377;',\r\n 'IQD' => '&#1593;.&#1583;', // ?\r\n 'IRR' => '&#65020;',\r\n 'ISK' => '&#107;&#114;',\r\n 'JEP' => '&#163;',\r\n 'JMD' => '&#74;&#36;',\r\n 'JOD' => '&#74;&#68;', // ?\r\n 'JPY' => '&#165;',\r\n 'KES' => '&#75;&#83;&#104;', // ?\r\n 'KGS' => '&#1083;&#1074;',\r\n 'KHR' => '&#6107;',\r\n 'KMF' => '&#67;&#70;', // ?\r\n 'KPW' => '&#8361;',\r\n 'KRW' => '&#8361;',\r\n 'KWD' => '&#1583;.&#1603;', // ?\r\n 'KYD' => '&#36;',\r\n 'KZT' => '&#1083;&#1074;',\r\n 'LAK' => '&#8365;',\r\n 'LBP' => '&#163;',\r\n 'LKR' => '&#8360;',\r\n 'LRD' => '&#36;',\r\n 'LSL' => '&#76;', // ?\r\n 'LTL' => '&#76;&#116;',\r\n 'LVL' => '&#76;&#115;',\r\n 'LYD' => '&#1604;.&#1583;', // ?\r\n 'MAD' => '&#1583;.&#1605;.', //?\r\n 'MDL' => '&#76;',\r\n 'MGA' => '&#65;&#114;', // ?\r\n 'MKD' => '&#1076;&#1077;&#1085;',\r\n 'MMK' => '&#75;',\r\n 'MNT' => '&#8366;',\r\n 'MOP' => '&#77;&#79;&#80;&#36;', // ?\r\n 'MRO' => '&#85;&#77;', // ?\r\n 'MUR' => '&#8360;', // ?\r\n 'MVR' => '.&#1923;', // ?\r\n 'MWK' => '&#77;&#75;',\r\n 'MXN' => '&#36;',\r\n 'MYR' => '&#82;&#77;',\r\n 'MZN' => '&#77;&#84;',\r\n 'NAD' => '&#36;',\r\n 'NGN' => '&#8358;',\r\n 'NIO' => '&#67;&#36;',\r\n 'NOK' => '&#107;&#114;',\r\n 'NPR' => '&#8360;',\r\n 'NZD' => '&#36;',\r\n 'OMR' => '&#65020;',\r\n 'PAB' => '&#66;&#47;&#46;',\r\n 'PEN' => '&#83;&#47;&#46;',\r\n 'PGK' => '&#75;', // ?\r\n 'PHP' => '&#8369;',\r\n 'PKR' => '&#8360;',\r\n 'PLN' => '&#122;&#322;',\r\n 'PYG' => '&#71;&#115;',\r\n 'QAR' => '&#65020;',\r\n 'RON' => '&#108;&#101;&#105;',\r\n 'RSD' => '&#1044;&#1080;&#1085;&#46;',\r\n 'RUB' => '&#1088;&#1091;&#1073;',\r\n 'RWF' => '&#1585;.&#1587;',\r\n 'SAR' => '&#65020;',\r\n 'SBD' => '&#36;',\r\n 'SCR' => '&#8360;',\r\n 'SDG' => '&#163;', // ?\r\n 'SEK' => '&#107;&#114;',\r\n 'SGD' => '&#36;',\r\n 'SHP' => '&#163;',\r\n 'SLL' => '&#76;&#101;', // ?\r\n 'SOS' => '&#83;',\r\n 'SRD' => '&#36;',\r\n 'STD' => '&#68;&#98;', // ?\r\n 'SVC' => '&#36;',\r\n 'SYP' => '&#163;',\r\n 'SZL' => '&#76;', // ?\r\n 'THB' => '&#3647;',\r\n 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)\r\n 'TMT' => '&#109;',\r\n 'TND' => '&#1583;.&#1578;',\r\n 'TOP' => '&#84;&#36;',\r\n 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)\r\n 'TTD' => '&#36;',\r\n 'TWD' => '&#78;&#84;&#36;',\r\n 'TZS' => '',\r\n 'UAH' => '&#8372;',\r\n 'UGX' => '&#85;&#83;&#104;',\r\n 'USD' => '&#36;',\r\n 'UYU' => '&#36;&#85;',\r\n 'UZS' => '&#1083;&#1074;',\r\n 'VEF' => '&#66;&#115;',\r\n 'VND' => '&#8363;',\r\n 'VUV' => '&#86;&#84;',\r\n 'WST' => '&#87;&#83;&#36;',\r\n 'XAF' => '&#70;&#67;&#70;&#65;',\r\n 'XCD' => '&#36;',\r\n 'XDR' => '',\r\n 'XOF' => '',\r\n 'XPF' => '&#70;',\r\n 'YER' => '&#65020;',\r\n 'ZAR' => '&#82;',\r\n 'ZMK' => '&#90;&#75;', // ?\r\n 'ZWL' => '&#90;&#36;',\r\n )\r\n );\r\n\r\n $currency_symbol = ( isset( $currencies[$currency_code] ) ? $currencies[$currency_code] : $currency_code );\r\n\r\n return $currency_symbol;\r\n\r\n }", "function cosmetro_top_currency_switcher( $format = '%s' ) {\n\n\t$is_enabled = get_theme_mod( 'top_currency_switcher', cosmetro_theme()->customizer->get_default( 'top_currency_switcher' ) );\n\n\tif ( ! $is_enabled ) {\n\t\treturn;\n\t}\n\n\tprintf( $format, cosmetro_currency_switcher() );\n\n}", "public function off_canvas_applied_filters() {\n\t\t\tthe_widget( 'WC_Widget_Layered_Nav_Filters' );\n\t\t}", "function add_filter($name, $callback, $priority = 10)\n{\n if ($pluginBroker = get_plugin_broker()) {\n $pluginBroker->addFilter($name, $callback, $priority);\n }\n}", "function acf_disable_filter($name = '')\n{\n}", "protected function register_filters(){\n\t\tadd_filter(\"the_content\", array($this, \"filter_single_content_after\"), 0);\n\t}", "function acadp_currency_symbol( $currency = '' ) {\n\n\tswitch( $currency ) {\n\t\tcase \"GBP\" :\n\t\t\t$symbol = '&pound;';\n\t\t\tbreak;\n\t\tcase \"BRL\" :\n\t\t\t$symbol = 'R&#36;';\n\t\t\tbreak;\n\t\tcase \"EUR\" :\n\t\t\t$symbol = '&euro;';\n\t\t\tbreak;\n\t\tcase \"USD\" :\n\t\tcase \"AUD\" :\n\t\tcase \"NZD\" :\n\t\tcase \"CAD\" :\n\t\tcase \"HKD\" :\n\t\tcase \"MXN\" :\n\t\tcase \"SGD\" :\n\t\t\t$symbol = '&#36;';\n\t\t\tbreak;\n\t\tcase \"JPY\" :\n\t\t\t$symbol = '&yen;';\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$symbol = $currency;\n\t\t\tbreak;\n\t}\n\n\treturn apply_filters( 'acadp_currency_symbol', $symbol, $currency );\n\n}", "public function afterFilter()\n\t{\n\n\t}", "function ndf_category_5_filter_settings_callback() {\n\techo '<p></p>';\n}", "function _dotgo_filter_prepare() {\n\n}", "private function model_custom_wp_filters() {\n\t\t$this->add_filter( 'prso_mailchimp_listSubscribe', 'list_subscribe', 1, 2 );\n\t\t\n\t}", "protected function before_filter() {\n\t}", "function learndash_coupons_init() {\n\t\tadd_action( 'wp_ajax_learndash_apply_coupon', 'learndash_apply_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_remove_coupon', 'learndash_remove_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_enroll_with_zero_price', 'learndash_enroll_with_zero_price' );\n\t\tadd_action( 'learndash_transaction_created', 'learndash_process_coupon_after_transaction' );\n\t\tadd_filter( 'learndash_get_price_by_coupon', 'learndash_get_price_by_coupon', 10, 3 );\n\t}", "function after_filter($action, $args) {\n }", "function pms_get_currencies() {\r\n\r\n $currencies = array(\r\n 'USD' => __( 'US Dollar', 'paid-member-subscriptions' ),\r\n 'EUR' => __( 'Euro', 'paid-member-subscriptions' ),\r\n 'GBP' => __( 'Pound Sterling', 'paid-member-subscriptions' ),\r\n 'CAD' => __( 'Canadian Dollar', 'paid-member-subscriptions' ),\r\n 'AUD' => __( 'Australian Dollar', 'paid-member-subscriptions' ),\r\n 'BRL' => __( 'Brazilian Real', 'paid-member-subscriptions' ),\r\n 'CZK' => __( 'Czech Koruna', 'paid-member-subscriptions' ),\r\n 'DKK' => __( 'Danish Krone', 'paid-member-subscriptions' ),\r\n 'HKD' => __( 'Hong Kong Dollar', 'paid-member-subscriptions' ),\r\n 'HUF' => __( 'Hungarian Forint', 'paid-member-subscriptions' ),\r\n 'ILS' => __( 'Israeli New Sheqel', 'paid-member-subscriptions' ),\r\n 'JPY' => __( 'Japanese Yen', 'paid-member-subscriptions' ),\r\n 'MYR' => __( 'Malaysian Ringgit', 'paid-member-subscriptions' ),\r\n 'MXN' => __( 'Mexican Peso', 'paid-member-subscriptions' ),\r\n 'NOK' => __( 'Norwegian Krone', 'paid-member-subscriptions' ),\r\n 'NZD' => __( 'New Zealand Dollar', 'paid-member-subscriptions' ),\r\n 'PHP' => __( 'Philippine Peso', 'paid-member-subscriptions' ),\r\n 'PLN' => __( 'Polish Zloty', 'paid-member-subscriptions' ),\r\n 'RUB' => __( 'Russian Ruble', 'paid-member-subscriptions' ),\r\n 'SGD' => __( 'Singapore Dollar', 'paid-member-subscriptions' ),\r\n 'SEK' => __( 'Swedish Krona', 'paid-member-subscriptions' ),\r\n 'CHF' => __( 'Swiss Franc', 'paid-member-subscriptions' ),\r\n 'TWD' => __( 'Taiwan New Dollar', 'paid-member-subscriptions' ),\r\n 'THB' => __( 'Thai Baht', 'paid-member-subscriptions' ),\r\n 'TRY' => __( 'Turkish Lira', 'paid-member-subscriptions' )\r\n );\r\n\r\n return apply_filters( 'pms_currencies', $currencies );\r\n\r\n }", "function getWithCurrency($amount, $decimals = 2)\n{\n return FormatNumber($amount, $decimals) . \\Config::get('website.currency');\n}", "function _wpsc_db_upgrade_14() {\n\t_wpsc_fix_latvia_currency();\n}", "function crypton_blog_cryptocurrency_prepare_js($js='', $remove_spaces=true) {\n\t\treturn apply_filters( 'cryptocurrency_filter_prepare_js', $js, $remove_spaces );\n\t}", "public function smart_coupons_discount_total_filters() {\n\t\t\tif ( WCS_SC_Compatibility::is_cart_contains_subscription() && WCS_SC_Compatibility::is_wcs_gte( '2.0.0' ) ) {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t} else {\n\t\t\t\tadd_action( 'woocommerce_after_calculate_totals', array( $this, 'smart_coupons_after_calculate_totals' ), 999 );\n\t\t\t\tglobal $current_screen;\n\t\t\t\tif ( ! empty( $current_screen ) && 'edit-shop_order' !== $current_screen ) {\n\t\t\t\t\tadd_filter( 'woocommerce_order_get_total', array( $this, 'smart_coupons_order_discounted_total' ), 10, 2 );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getCurrency(): string;", "public function getCurrency(): string;", "function get_ffd_currencies() {\r\n\tstatic $currencies;\r\n\r\n\tif ( ! isset( $currencies ) ) {\r\n\t\t$currencies = array_unique(\r\n\t\t\tapply_filters(\r\n\t\t\t\t'ffd_currencies',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'AED' => __( 'United Arab Emirates dirham', 'ffd-integration' ),\r\n\t\t\t\t\t'AFN' => __( 'Afghan afghani', 'ffd-integration' ),\r\n\t\t\t\t\t'ALL' => __( 'Albanian lek', 'ffd-integration' ),\r\n\t\t\t\t\t'AMD' => __( 'Armenian dram', 'ffd-integration' ),\r\n\t\t\t\t\t'ANG' => __( 'Netherlands Antillean guilder', 'ffd-integration' ),\r\n\t\t\t\t\t'AOA' => __( 'Angolan kwanza', 'ffd-integration' ),\r\n\t\t\t\t\t'ARS' => __( 'Argentine peso', 'ffd-integration' ),\r\n\t\t\t\t\t'AUD' => __( 'Australian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'AWG' => __( 'Aruban florin', 'ffd-integration' ),\r\n\t\t\t\t\t'AZN' => __( 'Azerbaijani manat', 'ffd-integration' ),\r\n\t\t\t\t\t'BAM' => __( 'Bosnia and Herzegovina convertible mark', 'ffd-integration' ),\r\n\t\t\t\t\t'BBD' => __( 'Barbadian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BDT' => __( 'Bangladeshi taka', 'ffd-integration' ),\r\n\t\t\t\t\t'BGN' => __( 'Bulgarian lev', 'ffd-integration' ),\r\n\t\t\t\t\t'BHD' => __( 'Bahraini dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'BIF' => __( 'Burundian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'BMD' => __( 'Bermudian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BND' => __( 'Brunei dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BOB' => __( 'Bolivian boliviano', 'ffd-integration' ),\r\n\t\t\t\t\t'BRL' => __( 'Brazilian real', 'ffd-integration' ),\r\n\t\t\t\t\t'BSD' => __( 'Bahamian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BTC' => __( 'Bitcoin', 'ffd-integration' ),\r\n\t\t\t\t\t'BTN' => __( 'Bhutanese ngultrum', 'ffd-integration' ),\r\n\t\t\t\t\t'BWP' => __( 'Botswana pula', 'ffd-integration' ),\r\n\t\t\t\t\t'BYR' => __( 'Belarusian ruble (old)', 'ffd-integration' ),\r\n\t\t\t\t\t'BYN' => __( 'Belarusian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'BZD' => __( 'Belize dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'CAD' => __( 'Canadian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'CDF' => __( 'Congolese franc', 'ffd-integration' ),\r\n\t\t\t\t\t'CHF' => __( 'Swiss franc', 'ffd-integration' ),\r\n\t\t\t\t\t'CLP' => __( 'Chilean peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CNY' => __( 'Chinese yuan', 'ffd-integration' ),\r\n\t\t\t\t\t'COP' => __( 'Colombian peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CRC' => __( 'Costa Rican col&oacute;n', 'ffd-integration' ),\r\n\t\t\t\t\t'CUC' => __( 'Cuban convertible peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CUP' => __( 'Cuban peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CVE' => __( 'Cape Verdean escudo', 'ffd-integration' ),\r\n\t\t\t\t\t'CZK' => __( 'Czech koruna', 'ffd-integration' ),\r\n\t\t\t\t\t'DJF' => __( 'Djiboutian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'DKK' => __( 'Danish krone', 'ffd-integration' ),\r\n\t\t\t\t\t'DOP' => __( 'Dominican peso', 'ffd-integration' ),\r\n\t\t\t\t\t'DZD' => __( 'Algerian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'EGP' => __( 'Egyptian pound', 'ffd-integration' ),\r\n\t\t\t\t\t'ERN' => __( 'Eritrean nakfa', 'ffd-integration' ),\r\n\t\t\t\t\t'ETB' => __( 'Ethiopian birr', 'ffd-integration' ),\r\n\t\t\t\t\t'EUR' => __( 'Euro', 'ffd-integration' ),\r\n\t\t\t\t\t'FJD' => __( 'Fijian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'FKP' => __( 'Falkland Islands pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GBP' => __( 'Pound sterling', 'ffd-integration' ),\r\n\t\t\t\t\t'GEL' => __( 'Georgian lari', 'ffd-integration' ),\r\n\t\t\t\t\t'GGP' => __( 'Guernsey pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GHS' => __( 'Ghana cedi', 'ffd-integration' ),\r\n\t\t\t\t\t'GIP' => __( 'Gibraltar pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GMD' => __( 'Gambian dalasi', 'ffd-integration' ),\r\n\t\t\t\t\t'GNF' => __( 'Guinean franc', 'ffd-integration' ),\r\n\t\t\t\t\t'GTQ' => __( 'Guatemalan quetzal', 'ffd-integration' ),\r\n\t\t\t\t\t'GYD' => __( 'Guyanese dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'HKD' => __( 'Hong Kong dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'HNL' => __( 'Honduran lempira', 'ffd-integration' ),\r\n\t\t\t\t\t'HRK' => __( 'Croatian kuna', 'ffd-integration' ),\r\n\t\t\t\t\t'HTG' => __( 'Haitian gourde', 'ffd-integration' ),\r\n\t\t\t\t\t'HUF' => __( 'Hungarian forint', 'ffd-integration' ),\r\n\t\t\t\t\t'IDR' => __( 'Indonesian rupiah', 'ffd-integration' ),\r\n\t\t\t\t\t'ILS' => __( 'Israeli new shekel', 'ffd-integration' ),\r\n\t\t\t\t\t'IMP' => __( 'Manx pound', 'ffd-integration' ),\r\n\t\t\t\t\t'INR' => __( 'Indian rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'IQD' => __( 'Iraqi dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'IRR' => __( 'Iranian rial', 'ffd-integration' ),\r\n\t\t\t\t\t'IRT' => __( 'Iranian toman', 'ffd-integration' ),\r\n\t\t\t\t\t'ISK' => __( 'Icelandic kr&oacute;na', 'ffd-integration' ),\r\n\t\t\t\t\t'JEP' => __( 'Jersey pound', 'ffd-integration' ),\r\n\t\t\t\t\t'JMD' => __( 'Jamaican dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'JOD' => __( 'Jordanian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'JPY' => __( 'Japanese yen', 'ffd-integration' ),\r\n\t\t\t\t\t'KES' => __( 'Kenyan shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'KGS' => __( 'Kyrgyzstani som', 'ffd-integration' ),\r\n\t\t\t\t\t'KHR' => __( 'Cambodian riel', 'ffd-integration' ),\r\n\t\t\t\t\t'KMF' => __( 'Comorian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'KPW' => __( 'North Korean won', 'ffd-integration' ),\r\n\t\t\t\t\t'KRW' => __( 'South Korean won', 'ffd-integration' ),\r\n\t\t\t\t\t'KWD' => __( 'Kuwaiti dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'KYD' => __( 'Cayman Islands dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'KZT' => __( 'Kazakhstani tenge', 'ffd-integration' ),\r\n\t\t\t\t\t'LAK' => __( 'Lao kip', 'ffd-integration' ),\r\n\t\t\t\t\t'LBP' => __( 'Lebanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'LKR' => __( 'Sri Lankan rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'LRD' => __( 'Liberian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'LSL' => __( 'Lesotho loti', 'ffd-integration' ),\r\n\t\t\t\t\t'LYD' => __( 'Libyan dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'MAD' => __( 'Moroccan dirham', 'ffd-integration' ),\r\n\t\t\t\t\t'MDL' => __( 'Moldovan leu', 'ffd-integration' ),\r\n\t\t\t\t\t'MGA' => __( 'Malagasy ariary', 'ffd-integration' ),\r\n\t\t\t\t\t'MKD' => __( 'Macedonian denar', 'ffd-integration' ),\r\n\t\t\t\t\t'MMK' => __( 'Burmese kyat', 'ffd-integration' ),\r\n\t\t\t\t\t'MNT' => __( 'Mongolian t&ouml;gr&ouml;g', 'ffd-integration' ),\r\n\t\t\t\t\t'MOP' => __( 'Macanese pataca', 'ffd-integration' ),\r\n\t\t\t\t\t'MRO' => __( 'Mauritanian ouguiya', 'ffd-integration' ),\r\n\t\t\t\t\t'MUR' => __( 'Mauritian rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'MVR' => __( 'Maldivian rufiyaa', 'ffd-integration' ),\r\n\t\t\t\t\t'MWK' => __( 'Malawian kwacha', 'ffd-integration' ),\r\n\t\t\t\t\t'MXN' => __( 'Mexican peso', 'ffd-integration' ),\r\n\t\t\t\t\t'MYR' => __( 'Malaysian ringgit', 'ffd-integration' ),\r\n\t\t\t\t\t'MZN' => __( 'Mozambican metical', 'ffd-integration' ),\r\n\t\t\t\t\t'NAD' => __( 'Namibian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'NGN' => __( 'Nigerian naira', 'ffd-integration' ),\r\n\t\t\t\t\t'NIO' => __( 'Nicaraguan c&oacute;rdoba', 'ffd-integration' ),\r\n\t\t\t\t\t'NOK' => __( 'Norwegian krone', 'ffd-integration' ),\r\n\t\t\t\t\t'NPR' => __( 'Nepalese rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'NZD' => __( 'New Zealand dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'OMR' => __( 'Omani rial', 'ffd-integration' ),\r\n\t\t\t\t\t'PAB' => __( 'Panamanian balboa', 'ffd-integration' ),\r\n\t\t\t\t\t'PEN' => __( 'Peruvian nuevo sol', 'ffd-integration' ),\r\n\t\t\t\t\t'PGK' => __( 'Papua New Guinean kina', 'ffd-integration' ),\r\n\t\t\t\t\t'PHP' => __( 'Philippine peso', 'ffd-integration' ),\r\n\t\t\t\t\t'PKR' => __( 'Pakistani rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'PLN' => __( 'Polish z&#x142;oty', 'ffd-integration' ),\r\n\t\t\t\t\t'PRB' => __( 'Transnistrian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'PYG' => __( 'Paraguayan guaran&iacute;', 'ffd-integration' ),\r\n\t\t\t\t\t'QAR' => __( 'Qatari riyal', 'ffd-integration' ),\r\n\t\t\t\t\t'RON' => __( 'Romanian leu', 'ffd-integration' ),\r\n\t\t\t\t\t'RSD' => __( 'Serbian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'RUB' => __( 'Russian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'RWF' => __( 'Rwandan franc', 'ffd-integration' ),\r\n\t\t\t\t\t'SAR' => __( 'Saudi riyal', 'ffd-integration' ),\r\n\t\t\t\t\t'SBD' => __( 'Solomon Islands dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SCR' => __( 'Seychellois rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'SDG' => __( 'Sudanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SEK' => __( 'Swedish krona', 'ffd-integration' ),\r\n\t\t\t\t\t'SGD' => __( 'Singapore dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SHP' => __( 'Saint Helena pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SLL' => __( 'Sierra Leonean leone', 'ffd-integration' ),\r\n\t\t\t\t\t'SOS' => __( 'Somali shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'SRD' => __( 'Surinamese dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SSP' => __( 'South Sudanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'STD' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra', 'ffd-integration' ),\r\n\t\t\t\t\t'SYP' => __( 'Syrian pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SZL' => __( 'Swazi lilangeni', 'ffd-integration' ),\r\n\t\t\t\t\t'THB' => __( 'Thai baht', 'ffd-integration' ),\r\n\t\t\t\t\t'TJS' => __( 'Tajikistani somoni', 'ffd-integration' ),\r\n\t\t\t\t\t'TMT' => __( 'Turkmenistan manat', 'ffd-integration' ),\r\n\t\t\t\t\t'TND' => __( 'Tunisian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'TOP' => __( 'Tongan pa&#x2bb;anga', 'ffd-integration' ),\r\n\t\t\t\t\t'TRY' => __( 'Turkish lira', 'ffd-integration' ),\r\n\t\t\t\t\t'TTD' => __( 'Trinidad and Tobago dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'TWD' => __( 'New Taiwan dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'TZS' => __( 'Tanzanian shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'UAH' => __( 'Ukrainian hryvnia', 'ffd-integration' ),\r\n\t\t\t\t\t'UGX' => __( 'Ugandan shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'USD' => __( 'United States (US) dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'UYU' => __( 'Uruguayan peso', 'ffd-integration' ),\r\n\t\t\t\t\t'UZS' => __( 'Uzbekistani som', 'ffd-integration' ),\r\n\t\t\t\t\t'VEF' => __( 'Venezuelan bol&iacute;var', 'ffd-integration' ),\r\n\t\t\t\t\t'VND' => __( 'Vietnamese &#x111;&#x1ed3;ng', 'ffd-integration' ),\r\n\t\t\t\t\t'VUV' => __( 'Vanuatu vatu', 'ffd-integration' ),\r\n\t\t\t\t\t'WST' => __( 'Samoan t&#x101;l&#x101;', 'ffd-integration' ),\r\n\t\t\t\t\t'XAF' => __( 'Central African CFA franc', 'ffd-integration' ),\r\n\t\t\t\t\t'XCD' => __( 'East Caribbean dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'XOF' => __( 'West African CFA franc', 'ffd-integration' ),\r\n\t\t\t\t\t'XPF' => __( 'CFP franc', 'ffd-integration' ),\r\n\t\t\t\t\t'YER' => __( 'Yemeni rial', 'ffd-integration' ),\r\n\t\t\t\t\t'ZAR' => __( 'South African rand', 'ffd-integration' ),\r\n\t\t\t\t\t'ZMW' => __( 'Zambian kwacha', 'ffd-integration' ),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\treturn $currencies;\r\n}", "function wp_render_duotone_filter_preset($preset)\n {\n }", "function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "function atcf_theme_variable_pricing() {\n\tremove_action( 'edd_purchase_link_top', 'edd_purchase_variable_pricing' );\n\tadd_action( 'edd_purchase_link_top', 'atcf_purchase_variable_pricing' );\n}", "function crypton_blog_cryptocurrency_frontend_scripts() {\n\t\tif (crypton_blog_is_on(crypton_blog_get_theme_option('debug_mode')) && crypton_blog_get_file_dir('plugins/cryptocurrency-prices/cryptocurrency-prices.css')!='')\n\t\t\twp_enqueue_style( 'crypton_blog-cryptocurrency-prices', crypton_blog_get_file_url('plugins/cryptocurrency-prices/cryptocurrency-prices.css'), array(), null );\n\t\tif (crypton_blog_is_on(crypton_blog_get_theme_option('debug_mode')) && crypton_blog_get_file_dir('plugins/cryptocurrency-prices/cryptocurrency-prices.js')!='')\n\t\t\twp_enqueue_script( 'crypton_blog-cryptocurrency-prices', crypton_blog_get_file_url('plugins/cryptocurrency-prices/cryptocurrency-prices.js'), array('jquery'), null, true );\n\t}", "function wp_store_ticker_cb(){\r\n\t//Check if ticker is enabled\r\n\t\t$wp_store_ticker = get_theme_mod('wp_store_header_setting_ticker_option','0');\r\n\t\tif($wp_store_ticker==1)\r\n\t\t{\r\n\t\t\t$ticker_title = get_theme_mod('wp_store_header_setting_ticker_title',__('Latest','wp-store'));\r\n\t\t\t$ticker_category = get_theme_mod('wp_store_header_setting_ticker_category');\r\n\t\t\tif(empty($ticker_title)){$ticker_title=\"Latest\";}\r\n\t\t\tif( !empty($ticker_category)) {\r\n\t\t\t\t?>\r\n\t\t\t\t<div class=\"top-ticker\">\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\tjQuery(document).ready(function($){\r\n\t\t\t\t\t\t\t$('#ticker').slick({\r\n\t\t\t\t\t\t\t\tslidesToShow: 1,\r\n\t\t\t\t\t\t\t\tslidesToScroll: 1,\r\n\t\t\t\t\t\t\t\tautoplay: true,\r\n\t\t\t\t\t\t\t\tautoplaySpeed: 3000,\r\n\t\t\t\t\t\t\t\tspeed:2000,\r\n\t\t\t\t\t\t\t\tcssEase:'ease',\r\n\t\t\t\t\t\t\t\tarrows:false\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}); //jquery close\r\n\t\t\t\t\t</script> <!-- close script -->\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t$loop = new WP_Query(array(\r\n\t\t\t\t\t\t'cat' => $ticker_category,\r\n\t\t\t\t\t\t'posts_per_page' => -1 \r\n\t\t\t\t\t\t));\r\n\t\t\t\t\tif($loop->have_posts()) {\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<span class=\"ticker-title\"><?php echo $ticker_title;?></span>\r\n\t\t\t\t\t\t<ul id=\"ticker\" class=\"hidden\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$i=0;\r\n\t\t\t\t\t\t\twhile($loop->have_posts()){\r\n\t\t\t\t\t\t\t\t$loop->the_post();\r\n\t\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t\t<h5 class=\"ticker_tick ticker-h5-<?php echo esc_attr($i); ?>\"><a href=\"<?php the_permalink();?>\"><?php the_title(); ?> </a></h5>\r\n\t\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\twp_reset_query();\r\n\t\t\t\t\t?>\r\n\t\t\t\t</div>\r\n\t\t\t\t<?php\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function render_currency_meta() {\n\n\t\t?>\n\t\t<p><label for=\"country_symbol\" style=\"width:145px; margin-top:6px; float:left; display: block\"><?php _e( 'Currency', 'countries' ); ?></label> <input class=\"regular-text\" name=\"country_currency\" value=\"<?php ?>\" /></p>\n\t<?php\n\t}", "function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "public static function getSiteCurrency(){\n return 'SAR';\n }", "function dacig_register_filters( $output ) {\n\tadd_filter( 'pre_get_posts', 'dacig_allow_filters' );\n\tadd_filter( 'the_posts', 'dacig_modify_the_posts' );\n\n\treturn $output;\n}", "function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}", "function acadp_sanitize_amount( $amount, $currency_settings = array() ) {\n\n\t$is_negative = false;\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$thousands_sep = ! empty( $currency_settings[ 'thousands_separator' ] ) ? $currency_settings[ 'thousands_separator' ] : ',';\n\t$decimal_sep = ! empty( $currency_settings[ 'decimal_separator' ] ) ? $currency_settings[ 'decimal_separator' ] : '.';\n\n\t// Sanitize the amount\n\tif( $decimal_sep == ',' && false !== ( $found = strpos( $amount, $decimal_sep ) ) ) {\n\t\tif( ( $thousands_sep == '.' || $thousands_sep == ' ' ) && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t\t} else if( empty( $thousands_sep ) && false !== ( $found = strpos( $amount, '.' ) ) ) {\n\t\t\t$amount = str_replace( '.', '', $amount );\n\t\t}\n\n\t\t$amount = str_replace( $decimal_sep, '.', $amount );\n\t} else if( $thousands_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t}\n\n\tif( $amount < 0 ) {\n\t\t$is_negative = true;\n\t}\n\n\t$amount = preg_replace( '/[^0-9\\.]/', '', $amount );\n\t$decimals = acadp_currency_decimal_count( 2, $currency );\n\t$amount = number_format( (double) $amount, $decimals, '.', '' );\n\n\tif( $is_negative ) {\n\t\t$amount *= -1;\n\t}\n\n\treturn apply_filters( 'acadp_sanitize_amount', $amount );\n\n}", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "protected function currency_switcher() {\n\t\treturn WC_Aelia_CurrencySwitcher::instance();\n\t}", "function atcf_theme_custom_variable_pricing() {\n\tif ( ! current_theme_supports( 'appthemer-crowdfunding' ) )\n\t\treturn;\n\n\tadd_action( 'init', 'atcf_theme_variable_pricing' );\n}", "public function getSourceCurrency();", "function genesisawesome_custom_filters( $filters ) {\n\n\t$filters['email'] = 'sanitize_email';\n\t$filters['integer'] = 'genesisawesome_intval';\n\n\treturn $filters;\n\n}", "function getfair_currency_menu_item( $item ) {\r\n if($item->title == 'Your Currency'){\r\n $item->title = 'from: '.edd_currency_get_stored_currency();\r\n }\r\n return $item;\r\n}", "public function template_redirect(){\n\t\tremove_filter( 'woocommerce_get_price_html', array( TM_EPO(), 'get_price_html' ), 10, 2 );\n\t\tremove_filter( 'woocommerce_product_get_price', array( $this, 'tm_woocommerce_get_price' ), 1, 2 );\n\t}", "public function register_filters() {\n\n\t\t}", "public function getCurrency();", "public function getCurrency();", "public function register_hooks() {\n\t\tadd_filter( 'pre_update_option_block_lab_license_key', array( $this, 'save_license_key' ) );\n\t}", "function filter_to_url ($filter) \n{\n /* Turns a filter into a usable URL, must provide url formatted $filter in \n order to work properly. Use the translate_filter function. */\n \n foreach ($filter as $key=>$param) $url[] = $key.'='.$param;\n $url = implode('&',$url);\n return '?'.$url;\n}", "function process_product_variable_countries_prices( $post_id ) {\r\n\r\n\t\t}", "protected function setup_filters() {\n\n /*\n * Co-Authors Plus tweaks\n */\n add_filter( 'coauthors_guest_authors_enabled', '__return_false' );\n add_filter( 'coauthors_plus_should_query_post_author', '__return_false' );\n add_filter( 'coauthors_guest_author_avatar_sizes', '__return_empty_array' );\n add_filter( 'coauthors_guest_author_manage_cap', function() {\n // Allow editors and above\n return 'edit_others_posts';\n });\n\n add_filter( 'wp_mail_from', function( $original_var ) {\n if ( PEDESTAL_EMAIL_NEWS ) {\n return PEDESTAL_EMAIL_NEWS;\n }\n return $original_var;\n });\n\n add_filter( 'wp_mail_from_name', function( $original_var ) {\n if ( PEDESTAL_EMAIL_FROM_NAME ) {\n return PEDESTAL_EMAIL_FROM_NAME;\n }\n return $original_var;\n });\n\n add_filter( 'pre_option_blogdescription', function( $original_var ) {\n if ( PEDESTAL_BLOG_DESCRIPTION ) {\n return PEDESTAL_BLOG_DESCRIPTION;\n }\n return $original_var;\n });\n\n add_filter( 'pre_option_date_format', function( $date_format ) {\n if ( PEDESTAL_DATE_FORMAT ) {\n $date_format = PEDESTAL_DATE_FORMAT;\n }\n return $date_format;\n } );\n\n add_filter( 'pre_option_time_format', function( $time_format ) {\n if ( PEDESTAL_TIME_FORMAT ) {\n $time_format = PEDESTAL_TIME_FORMAT;\n }\n return $time_format;\n } );\n\n add_filter( 'pre_option_show_avatars', '__return_true' );\n add_filter( 'pre_option_blog_public', '__return_true' );\n add_filter( 'pre_option_timezone_string', function() {\n return PEDESTAL_SITE_TIMEZONE;\n });\n\n add_filter( 'pre_option_default_role', function() {\n return 'subscriber';\n });\n\n add_filter( 'pre_option_rss_use_excerpt', '__return_zero' );\n\n /**\n * Limit post revisions\n */\n add_filter( 'wp_revisions_to_keep', function( $num, $post ) {\n return 5;\n }, 10, 2 );\n\n // Override oEmbed with our embed shortcodes\n add_filter( 'oembed_result', [ $this, 'filter_oembed_result' ], 10, 3 );\n\n /**\n * Add image size where largest possible proportional size is generated\n *\n * @link http://wordpress.stackexchange.com/questions/212768/add-image-size-where-largest-possible-proportional-size-is-generated\n */\n add_filter( 'intermediate_image_sizes_advanced', function( $sizes, $metadata ) {\n if ( ! empty( $metadata['width'] ) && ! empty( $metadata['height'] ) ) {\n\n // Calculate the max width and height for the 4:3 ratio\n $ratio = new \\Pedestal\\Utils\\Image_Ratio( 4, 3 );\n list( $width, $height ) = $ratio->get_largest_size(\n $metadata['width'],\n $metadata['height']\n );\n\n // Add the new custom size\n $sizes['max-4-3'] = [\n 'width' => $width,\n 'height' => $height,\n 'crop' => true,\n ];\n }\n\n return $sizes;\n }, 10, 2 );\n\n // Serve static assets through a CDN, if available\n if ( $this->get_cdn_url() ) {\n add_filter( 'wp_resource_hints', [ $this, 'filter_resource_hints_for_cdn' ], 10, 2 );\n add_filter( 'style_loader_src', [ $this, 'filter_rewrite_url_for_cdn' ], 10, 1 );\n add_filter( 'script_loader_src', [ $this, 'filter_rewrite_url_for_cdn' ], 10, 1 );\n add_filter( 'template_directory_uri', [ $this, 'filter_rewrite_url_for_cdn' ], 10, 1 );\n add_filter( 'stylesheet_directory_uri', [ $this, 'filter_rewrite_url_for_cdn' ], 10, 1 );\n add_filter( 'compressed_emoji_url', [ $this, 'filter_rewrite_url_for_cdn' ], 10, 1 );\n add_filter( 'compressed_emoji_svg_url', [ $this, 'filter_rewrite_url_for_cdn' ], 10, 1 );\n }\n\n // Add some Twig functions and filters\n add_filter( 'timber/twig', [ $this, 'filter_timber_twig_add_basic_filters' ] );\n add_filter( 'timber/twig', [ $this, 'filter_timber_twig_add_markdown_support' ] );\n add_filter( 'timber/twig', [ $this, 'filter_timber_twig_add_functions' ], 99 );\n\n // Since we don't have comments, skip running the query to count all of the comments on every load\n add_filter( 'wp_count_comments', function( $count, $post_id ) {\n if ( 0 === $post_id ) {\n $stats = [\n 'approved' => 0,\n 'moderated' => 0,\n 'spam' => 0,\n 'trash' => 0,\n 'post-trashed' => 0,\n 'total_comments' => 0,\n 'all' => 0,\n ];\n return (object) $stats;\n }\n }, 10, 2 );\n }", "public function getCurrencyCode();", "public function getCurrencyCode();", "public function getCurrencyCode();", "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 calculateCurrency($prijs, $country)\r\n {\r\n }", "function is_currency( $v,$round=0 )\r\n{\r\n$v = preg_replace(\"/[^0-9.]+/\",\"\",$v);\r\nreturn round($v,$round);\r\n}", "function wp_filter_kses($data)\n {\n }", "function adrotate_licensed_update() {\n\tadd_filter('site_transient_update_plugins', 'adrotate_update_check');\n\tadd_filter('plugins_api', 'adrotate_get_plugin_information', 20, 3);\n}", "function spreadshop_checkout()\n{\ninclude(plugin_dir_path(__FILE__).'/checkout.php');\nadd_filter('wp_head', 'sources');\n}", "protected function _getFilterField()\n {\n $websiteId = Mage::app()->getStore()->getWebsiteId();\n $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();\n $priceField = 'price_' . $customerGroupId . '_' . $websiteId;\n\n return $priceField;\n }", "function beforeFilter() {\r\n parent::beforeFilter();\r\n }", "function acf_add_deprecated_filter($deprecated, $version, $replacement)\n{\n}", "function filter_method_name()\r\n\t{\r\n\t\t// TODO:\tDefine your filter method here\r\n\t}", "public function getCurrencies();", "function fn_get_yandex_checkpoint_price($price = 0.00, $currency = 'RUB')\n{\n return array(\n 'amount' => (float) fn_format_rate_value((float) $price, 'F', 2, '.', '', ''),\n 'currency' => $currency\n );\n}", "function wdm_auction_listing() {\n wp_enqueue_style('wdm_auction_front_end_styling', plugins_url('css/ua-front-end.css', __FILE__));\n\n ob_start();\n //check the permalink from database and append variable to the auction single pages accordingly\n $perma_type = get_option('permalink_structure');\n\n //get currency code\n $currency_code = substr(get_option('wdm_currency'), -3);\n $currency_code_display = '';\n preg_match('/-([^ ]+)/', get_option('wdm_currency'), $matches);\n $currency_symbol = $matches[1];\n\n if (empty($currency_symbol)) {\n $currency_symbol = $currency_code . ' ';\n } else {\n if ($currency_symbol == '$' || $currency_symbol == 'kr') {\n $currency_code_display = $currency_code;\n }\n }\n\n //get Login url if set\n $wdm_login_url = get_option('wdm_login_page_url');\n if (empty($wdm_login_url)) {\n $wdm_login_url = wp_login_url($_SERVER['REQUEST_URI']);\n }\n\n if (is_front_page() || is_home())\n $set_char = \"?\";\n elseif (empty($perma_type))\n $set_char = \"&\";\n else\n $set_char = \"?\";\n\n $auc_time = '';\n\n if (is_user_logged_in() && isset($_GET[\"ult_auc_id\"]) && !empty($_GET[\"ult_auc_id\"]) && isset($_GET[\"mt\"]) && !empty($_GET[\"mt\"])) {\n\n $wdm_auction = get_post($_GET[\"ult_auc_id\"]);\n $curr_user = wp_get_current_user();\n $buyer_email = $curr_user->user_email;\n //$winner_name = $curr_user->user_login;\n $ret_url = get_permalink() . $set_char . \"ult_auc_id=\" . $wdm_auction->ID;\n\n $check_method = get_post_meta($_GET[\"ult_auc_id\"], 'wdm_payment_method', true);\n\n _e('Thank you for buying this product.', 'wdm-ultimate-auction');\n echo \"<br /><br />\";\n\n //$auc_post = get_post($_GET[\"ult_auc_id\"]);\n //$auction_author_id = $auc_post->post_author;\n //$auction_author = new WP_User($auction_author_id);\n\n if ($check_method === 'method_wire_transfer') {\n $mthd = __('Wire Transfer', 'wdm-ultimate-auction');\n\n //if(in_array('administrator', $auction_author->roles))\n $det = get_option('wdm_wire_transfer');\n //else\n //\t$det = get_user_meta($auction_author_id, 'wdm_wire_transfer', true);\n } elseif ($check_method === 'method_mailing') {\n $mthd = __('Cheque', 'wdm-ultimate-auction');\n\n //if(in_array('administrator', $auction_author->roles))\n $det = get_option('wdm_mailing_address');\n //else\n //\t$det = get_user_meta($auction_author_id, 'wdm_mailing_address', true);\n } elseif ($check_method === 'method_cash') {\n $mthd = __('Cash', 'wdm-ultimate-auction');\n\n //if(in_array('administrator', $auction_author->roles))\n $det = get_option('wdm_cash');\n //else\n //\t$det = get_user_meta($auction_author_id, 'wdm_cash', true);\n }\n\n $mthd = \"<strong>\" . $mthd . \"</strong>\";\n\n printf(__('You can make the payment by %s', 'wdm-ultimate-auction'), $mthd);\n\n if (!empty($det))\n echo \"<br /><br /><strong>\" . __('Details') . \":</strong> <br/>\" . $det;\n\n echo '<br /><br /><a href=\"' . get_permalink() . $set_char . 'ult_auc_id=' . $_GET['ult_auc_id'] . '\">' . __('Go Back', 'wdm-ultimate-auction') . '</a>';\n\n $buy_now_price = get_post_meta($wdm_auction->ID, 'wdm_buy_it_now', true);\n\n ultimate_auction_email_template($wdm_auction->post_title, $wdm_auction->ID, $wdm_auction->post_content, $buy_now_price, $buyer_email, $ret_url);\n }\n elseif (isset($_GET[\"ult_auc_id\"]) && $_GET[\"ult_auc_id\"]) {\n\n //if single auction page is found do the following\n global $wpdb;\n $wpdb->hide_errors();\n $wdm_auction = get_post($_GET[\"ult_auc_id\"]);\n if ($wdm_auction) {\n\n $auction_author_id = $wdm_auction->post_author;\n $auction_author = new WP_User($auction_author_id);\n //update single auction page url on single auction page visit - if the permalink type is updated we should have appropriate url to be sent in email \t\n update_post_meta($wdm_auction->ID, 'current_auction_permalink', get_permalink() . $set_char . \"ult_auc_id=\" . $wdm_auction->ID);\n\n //check if start price/opening bid price is set\n $to_bid = get_post_meta($wdm_auction->ID, 'wdm_opening_bid', true);\n\n //check if buy now price is set\n $to_buy = get_post_meta($wdm_auction->ID, 'wdm_buy_it_now', true);\n\n //latest highest/current price\n //$wdm_price_flag=false;\n $query = \"SELECT MAX(bid) FROM \" . $wpdb->prefix . \"wdm_bidders WHERE auction_id =\" . $wdm_auction->ID;\n $curr_price = $wpdb->get_var($query);\n if (empty($curr_price))\n $curr_price = get_post_meta($wdm_auction->ID, 'wdm_opening_bid', true);\n\n //total no. of bids\t\n $qry = \"SELECT COUNT(bid) FROM \" . $wpdb->prefix . \"wdm_bidders WHERE auction_id =\" . $wdm_auction->ID;\n $total_bids = $wpdb->get_var($qry);\n\n //buy now price\n $buy_now_price = get_post_meta($wdm_auction->ID, 'wdm_buy_it_now', true);\n\n //get currency code\n $currency_code = substr(get_option('wdm_currency'), -3);\n\n $bef_auc = '';\n $bef_auc = apply_filters('wdm_ua_before_single_auction', $bef_auc, $wdm_auction->ID);\n echo $bef_auc;\n ?>\n\n <!--main forms container of single auction page-->\n <div class=\"wdm-ultimate-auction-container clearfix\">\n\n <div class=\"wdm-image-container clearfix\">\n <?php\n $images = '';\n\n $mnimg = get_post_meta($wdm_auction->ID, 'wdm-main-image', true);\n $img_arr = array('png', 'jpg', 'jpeg', 'gif', 'bmp', 'ico');\n $vid_arr = array('mpg', 'mpeg', 'avi', 'mov', 'wmv', 'wma', 'mp4', '3gp', 'ogm', 'mkv', 'flv');\n\n $flg = 0;\n\n $images .= '<div class=\"auction-main-img-cont\">';\n\n for ($c = 1; $c <= 4; $c++) {\n if ($mnimg === 'main_image_' . $c)\n $img_show = \"display: block\";\n else\n $img_show = \"display: none\";\n\n $imgURL = get_post_meta($wdm_auction->ID, 'wdm-image-' . $c, true);\n $imgMime = wdm_get_mime_type($imgURL);\n $img_ext = explode(\".\", $imgURL);\n $img_ext = end($img_ext);\n\n if (strpos($img_ext, '?') !== false)\n $img_ext = strtolower(strstr($img_ext, '?', true));\n\n if (empty($imgURL)) {\n $images .= '';\n } else {\n $flg = 1;\n\n $images .= '<a href=\"' . get_post_meta($wdm_auction->ID, 'wdm-image-' . $c, true) . '\" class=\"auction-main-img-a auction-main-img' . $c . '\" rel=\"gallery\" style=\"' . $img_show . '\">';\n\n if (strstr($imgMime, \"image/\") || in_array($img_ext, $img_arr))\n $images .= '<img class=\"auction-main-img\" src=\"' . get_post_meta($wdm_auction->ID, 'wdm-image-' . $c, true) . '\" />';\n\n elseif (strstr($imgMime, \"video/\") || in_array($img_ext, $vid_arr))\n $images .= '<video class=\"auction-main-img\" style=\"margin-bottom:0;\" controls>\n\t\t\t\t <source src=\"' . get_post_meta($wdm_auction->ID, 'wdm-image-' . $c, true) . '\">\n\t\t\t\t\t Your browser does not support the video tag.\n\t\t\t\t </video>';\n elseif (strstr($imgURL, \"youtube.com\") || strstr($imgURL, \"vimeo.com\"))\n $images .= '<img class=\"auction-main-img\" src=\"' . plugins_url('img/film.png', __FILE__) . '\" />';\n else\n $images .= '<img class=\"auction-main-img\" src=\"' . wp_mime_type_icon($imgMime) . '\" />';\n\n $images .= '</a>';\n }\n }\n\n $images .= '</div>';\n\n if ($flg == 0)\n echo '<style> .wdm-image-container{display: none;} </style>';\n\n $images .= '<div class=\"auction-small-img-cont-wrap\"><div class=\"auction-small-img-cont\">';\n\n for ($c = 1; $c <= 4; $c++) {\n\n $imgURL = get_post_meta($wdm_auction->ID, 'wdm-image-' . $c, true);\n $imgMime = wdm_get_mime_type($imgURL);\n $img_ext = explode(\".\", $imgURL);\n $img_ext = end($img_ext);\n\n if (strpos($img_ext, '?') !== false)\n $img_ext = strtolower(strstr($img_ext, '?', true));\n\n if (empty($imgURL)) {\n $images .= '';\n } else {\n if (strstr($imgMime, \"image/\") || in_array($img_ext, $img_arr))\n $images .= '<img class=\"auction-small-img auction-small-img' . $c . '\" src=\"' . $imgURL . '\" />';\n elseif (strstr($imgMime, \"video/\") || in_array($img_ext, $vid_arr) || strstr($imgURL, \"youtube.com\") || strstr($imgURL, \"vimeo.com\"))\n $images .= '<img class=\"auction-small-img auction-small-img' . $c . '\" src=\"' . plugins_url('img/film.png', __FILE__) . '\" />';\n else\n $images .= '<img class=\"auction-small-img auction-small-img' . $c . '\" src=\"' . wp_mime_type_icon($imgMime) . '\" />';\n }\n }\n $images .= '</div>';\n\n echo $images;\n ?>\n </div> </div><!--wdm-image-container ends here-->\n\n <div class=\"wdm_single_prod_desc clearfix\">\n\n <div class=\"wdm-single-auction-title\">\n <?php echo $wdm_auction->post_title; ?>\n </div> <!--wdm-single-auction-title ends here-->\n\n <?php\n $ext_html = '';\n $ext_html = apply_filters('wdm_ua_text_before_bid_section', $ext_html, $wdm_auction->ID);\n echo $ext_html;\n\n //get auction-status taxonomy value for the current post - live/expired\n $active_terms = wp_get_post_terms($wdm_auction->ID, 'auction-status', array(\"fields\" => \"names\"));\n\n //incremented price value\n $inc_price = $curr_price + get_post_meta($wdm_auction->ID, 'wdm_incremental_val', true);\n\n //if the auction has reached it's time limit, expire it\n if ((time() >= strtotime(get_post_meta($wdm_auction->ID, 'wdm_listing_ends', true)))) {\n if (!in_array('expired', $active_terms)) {\n $check_term = term_exists('expired', 'auction-status');\n wp_set_post_terms($wdm_auction->ID, $check_term[\"term_id\"], 'auction-status');\n }\n }\n\n $now = time();\n $ending_date = strtotime(get_post_meta($wdm_auction->ID, 'wdm_listing_ends', true));\n\n //display message for expired auction\n if ((time() >= strtotime(get_post_meta($wdm_auction->ID, 'wdm_listing_ends', true))) || in_array('expired', $active_terms)) {\n\n $seconds = $now - $ending_date;\n\n $rem_tm = wdm_ending_time_calculator($seconds);\n\n $auc_time = 'exp';\n ?>\n <div class=\"wdm-auction-ending-time\"><?php printf(__('Ended at', 'wdm-ultimate-auction') . ': ' . __('%s ago', 'wdm-ultimate-auction'), '<span class=\"wdm-single-auction-ending\">' . $rem_tm . '</span>'); ?></div>\n\n <?php if (!empty($to_bid)) { ?>\n\n <div class=\"wdm_bidding_price wdm-align-left\">\n <strong><?php echo $currency_symbol . number_format($curr_price, 2, '.', ',') . \" \" . $currency_code_display; ?></strong>\n </div>\n <div id=\"wdm-auction-bids-placed\" class=\"wdm_bids_placed wdm-align-right\">\n <a href=\"#wdm-tab-anchor-id\" id=\"wdm-total-bids-link\"><?php\n echo $total_bids . \" \";\n echo ($total_bids == 1) ? __(\"Bid\", \"wdm-ultimate-auction\") : __(\"Bids\", \"wdm-ultimate-auction\");\n ?></a>\n </div>\n\n <br />\n\n <?php\n }\n\n $bought = get_post_meta($wdm_auction->ID, 'auction_bought_status', true);\n\n if ($bought === 'bought') {\n $buyer_id = get_post_meta($wdm_auction->ID, 'wdm_auction_buyer', true);\n $buyer = get_user_by('id', $buyer_id);\n printf('<div class=\"wdm-mark-red\">' . __('This auction has been bought by %s at %s', 'wdm-ultimate-auction') . '</div>', $buyer->user_login, '[' . $currency_symbol . number_format($buy_now_price, 2, '.', ',') . ' ' . $currency_code_display . ']');\n } else {\n $cnt_qry = \"SELECT COUNT(bid) FROM \" . $wpdb->prefix . \"wdm_bidders WHERE auction_id =\" . $wdm_auction->ID;\n $cnt_bid = $wpdb->get_var($cnt_qry);\n if ($cnt_bid > 0) {\n $res_price_met = get_post_meta($wdm_auction->ID, 'wdm_lowest_bid', true);\n\n $win_bid = \"\";\n $bid_q = \"SELECT MAX(bid) FROM \" . $wpdb->prefix . \"wdm_bidders WHERE auction_id =\" . $wdm_auction->ID;\n $win_bid = $wpdb->get_var($bid_q);\n\n if ($win_bid >= $res_price_met) {\n $winner_name = \"\";\n $name_qry = \"SELECT name FROM \" . $wpdb->prefix . \"wdm_bidders WHERE bid =\" . $win_bid . \" AND auction_id =\" . $wdm_auction->ID . \" ORDER BY id DESC\";\n $winner_name = $wpdb->get_var($name_qry);\n printf('<div class=\"wdm-mark-red\">' . __('This auction has been sold to %1$s at %2$s.', 'wdm-ultimate-auction') . '</div>', $winner_name, $currency_symbol . number_format($win_bid, 2, '.', ',') . \" \" . $currency_code_display);\n } else {\n echo '<div class=\"wdm-mark-red\">' . __('Auction has expired without reaching its reserve price.', 'wdm-ultimate-auction') . '</div>';\n }\n } else {\n if (empty($to_bid))\n echo '<div class=\"wdm-mark-red\">' . __('Auction has expired without buying.', 'wdm-ultimate-auction') . '</div>';\n else\n echo '<div class=\"wdm-mark-red\">' . __('Auction has expired without any bids.', 'wdm-ultimate-auction') . '</div>';\n }\n }\n }\n\n else {\n //prepare a format and display remaining time for current auction\n\n $seconds = $ending_date - $now;\n\n $rem_tm = wdm_ending_time_calculator($seconds);\n\n $auc_time = \"live\";\n\n if (is_user_logged_in()) {\n $curr_user = wp_get_current_user();\n $auction_bidder_name = $curr_user->user_login;\n $auction_bidder_email = $curr_user->user_email;\n }\n //else\n //{\n //\t$auction_bidder_name = $curr_user->user_login;\n //\t$auction_bidder_email = $curr_user->user_email;\n //}\n ?>\n\n\n <div class=\"wdm-auction-ending-time\"><?php printf(__('Ending in: %s', 'wdm-ultimate-auction'), '<span class=\"wdm-single-auction-ending\">' . $rem_tm . '</span>'); ?></div>\n\n <?php if (!empty($to_bid)) { ?>\n <div id=\"wdm_place_bid_section\" class=\"clearfix\">\n <div class=\"wdm_bidding_price wdm-align-left\">\n <strong><?php echo $currency_symbol . number_format($curr_price, 2, '.', ',') . \" \" . $currency_code_display; ?></strong>\n </div>\n <div id=\"wdm-auction-bids-placed\" class=\"wdm_bids_placed wdm-align-right\">\n <a href=\"#wdm-tab-anchor-id\" id=\"wdm-total-bids-link\"><?php\n echo $total_bids . \" \";\n echo ($total_bids == 1) ? __(\"Bid\", \"wdm-ultimate-auction\") : __(\"Bids\", \"wdm-ultimate-auction\");\n ?></a>\n </div>\n <?php\n if ($curr_price >= get_post_meta($wdm_auction->ID, 'wdm_lowest_bid', true)) {\n ?>\n <div class=\"wdm_reserved_note wdm-mark-green wdm-align-left\">\n <em><?php _e('Reserve price has been met.', 'wdm-ultimate-auction'); ?></em>\n </div>\n <?php\n } else {\n ?>\n <div class=\"wdm_reserved_note wdm-mark-red wdm-align-left\">\n <em><?php _e('Reserve price has not been met by any bid.', 'wdm-ultimate-auction'); ?></em>\n </div>\n <?php\n }\n\n if (is_user_logged_in()) {\n //$curr_user = wp_get_current_user();\n //$auction_bidder_name = $curr_user->user_login;\n //$auction_bidder_email = $curr_user->user_email;\n\n if ($curr_user->ID != $wdm_auction->post_author) {\n ?>\n <?php\n $curr_auc_id = $_GET['ult_auc_id'];\n parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $queries);\n $wdm_redirect_url = $queries['redirect_to'];\n $str = \"ult_auc_id=$curr_auc_id\";\n\n $pos = strpos($wdm_redirect_url, $str);\n if ($pos !== false) {\n $bid_val = $queries['wdm-bid-val'];\n if (!empty($bid_val)) {\n $curr_bid_val = $bid_val;\n }\n } else {\n $curr_bid_val = \"\";\n }\n ?>\n <form action=\"<?php echo dirname(__FILE__); ?>\" class=\"wdmua-singleauc-bidform\">\n <div class=\"clearfix wdmua-clear\">\n <div class=\"wdm_bid_val clearfix wdm-align-left\">\n <label for=\"wdm-bidder-bidval\" class=\"wdm-align-left wdmua-singleauc-label wdmua-singleauc-label-alt\"><?php _e('Bid Value', 'wdm-ultimate-auction'); ?>: </label>\n <input type=\"text\" id=\"wdm-bidder-bidval\" placeholder=\"<?php printf(__('in %s', 'wdm-ultimate-auction'), $currency_symbol . $currency_code_display); ?>\" value=\"<?php echo $curr_bid_val ?>\" class=\"wdm-align-left wdmua-singleauc-input wdmua-singleauc-input-alt\"/>\n <span class=\"wdm_enter_val_text wdm-align-right\">\n <small>(<?php printf(__('Enter %.2f or more', 'wdm-ultimate-auction'), $inc_price); ?>)\n <?php\n $ehtml = '';\n $ehtml = apply_filters('wdm_ua_text_after_bid_form', $ehtml, $wdm_auction->ID);\n echo $ehtml;\n ?>\n </small>\n </span>\n </div>\n <div class=\"wdm_place_bid wdm-align-right clearfix\">\n <input type=\"submit\" value=\"<?php _e('Place Bid', 'wdm-ultimate-auction'); ?>\" id=\"wdm-place-bid-now\" />\n </div>\n </div>\n </form>\n <?php\n require_once('ajax-actions/place-bid.php'); //file to handle ajax requests related to bid placing form\n }\n } else {\n $check = get_option('wdm_users_login');\n if ($check == 'without_login') {\n $auction_bidder_name = '';\n $auction_bidder_email = '';\n ?>\n <br />\n <div class=\"wdmua-singleauc-fieldmain\">\n\n </div>\n <div class=\"wdm_bidder_name wdmua-singleauc-fieldwrap clearfix\">\n <label for=\"wdm-bidder-name\" class=\"wdmua-singleauc-label wdm-align-left\"><?php _e('Name', 'wdm-ultimate-auction'); ?>: </label>\n <input type=\"text\" id=\"wdm-bidder-name\" name=\"wdm-bidder-name\" class=\"wdm-align-left wdmua-singleauc-input\"/>\n </div>\n\n <div class=\"wdm_bidder_email wdmua-singleauc-fieldwrap clearfix\">\n <label for=\"wdm-bidder-email\" class=\"wdmua-singleauc-label wdm-align-left\"><?php _e('Email', 'wdm-ultimate-auction'); ?>: </label>\n <input type=\"text\" id=\"wdm-bidder-email\" name=\"wdm-bidder-email\" class=\"wdm-align-left wdmua-singleauc-input\"/>\n </div>\n <div class=\"clearfix\">\n <div class=\"wdm_bid_val wdmua-singleauc-fieldwrap clearfix wdm-align-left\">\n <label for=\"wdm-bidder-bidval\" class=\"wdmua-singleauc-label wdm-align-left wdmua-singleauc-label-alt\"><?php _e('Bid Value', 'wdm-ultimate-auction'); ?>: </label>\n <input type=\"text\" id=\"wdm-bidder-bidval\" placeholder=\"<?php printf(__('in %s', 'wdm-ultimate-auction'), $currency_symbol . $currency_code_display); ?>\" class=\"wdm-align-left wdmua-singleauc-input wdmua-singleauc-input-alt\"/>\n <span class=\"wdm_enter_val_text wdm-align-right\">\n <small>(<?php printf(__('Enter %.2f or more', 'wdm-ultimate-auction'), $inc_price); ?>)\n <?php\n $ehtml = '';\n $ehtml = apply_filters('wdm_ua_text_after_bid_form', $ehtml, $wdm_auction->ID);\n echo $ehtml;\n ?>\n\n </small>\n </span>\n </div>\n <div class=\"wdm_place_bid clearfix wdm-align-right\">\n <input type=\"submit\" value=\"<?php _e('Place Bid', 'wdm-ultimate-auction'); ?>\" id=\"wdm-place-bid-now\" class=\"wdm-align-right\" />\t\n </div>\n </div>\n\n <?php\n } else {\n ?>\n <div>\n\n </div>\n <div class=\"clearfix wdmua-clear\">\n <div class=\"wdm_bid_val clearfix wdm-align-left\">\n <label for=\"wdm-bidder-bidval\" class=\"wdm-align-left wdmua-singleauc-label wdmua-singleauc-label-alt\"><?php _e('Bid Value', 'wdm-ultimate-auction'); ?>: </label>\n <input type=\"text\" id=\"wdm-bidder-bidval\" placeholder=\"<?php printf(__('in %s', 'wdm-ultimate-auction'), $currency_symbol . $currency_code_display); ?>\" class=\"wdm-align-left wdmua-singleauc-input wdmua-singleauc-input-alt\"/>\n <span class=\"wdm_enter_val_text wdm-align-right\">\n <small>(<?php printf(__('Enter %.2f or more', 'wdm-ultimate-auction'), $inc_price); ?>)</small>\n </span>\n </div>\n <div class=\"wdm_place_bid clearfix wdm-align-right\">\n <a class=\"wdm-login-to-place-bid wdm-align-right\" href=\"#\" title=\"<?php _e('Login', 'wdm-ultimate-auction'); ?>\" data-login-url=\"<?php echo $wdm_login_url; ?>\">\n <?php _e('Place Bid', 'wdm-ultimate-auction'); ?></a>\n </div>\n </div>\n <?php\n }\n require_once('ajax-actions/place-bid.php');\n }\n ?>\n </div> <!--wdm_place_bid_section ends here-->\n <?php }\n ?>\n <?php\n if (!empty($to_buy) || $to_buy > 0) {\n $a_key = get_post_meta($wdm_auction->ID, 'wdm-auth-key', true);\n\n $acc_mode = get_option('wdm_account_mode');\n\n if ($acc_mode == 'Sandbox')\n $pp_link = \"https://sandbox.paypal.com/cgi-bin/webscr\";\n else\n $pp_link = \"https://www.paypal.com/cgi-bin/webscr\";\n if (is_user_logged_in()) {\n\n $check_method = get_post_meta($wdm_auction->ID, 'wdm_payment_method', true);\n\n if ($check_method == 'method_paypal') {\n ?>\n <!--buy now button-->\n <div id=\"wdm_buy_now_section\" class=\"clearfix\">\n <?php if ($curr_user->ID != $wdm_auction->post_author) { ?>\n <div id=\"wdm-buy-line-above\" class=\"clearfix\">\n <form action=\"<?php echo $pp_link; ?>\" method=\"post\" target=\"_top\">\n <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n <input type=\"hidden\" name=\"charset\" value=\"utf-8\" />\n <input type=\"hidden\" name=\"business\" value=\"<?php echo get_option('wdm_paypal_address'); ?>\">\n <!--<input type=\"hidden\" name=\"lc\" value=\"US\">-->\n <input type=\"hidden\" name=\"item_name\" value=\"<?php echo $wdm_auction->post_title; ?>\">\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $buy_now_price; ?>\">\n <?php\n $shipping_field = '';\n echo apply_filters('ua_product_shipping_cost_field', $shipping_field, $wdm_auction->ID);\n ?>\n <input type=\"hidden\" name=\"currency_code\" value=\"<?php echo $currency_code; ?>\">\n <input type=\"hidden\" name=\"return\" value=\"<?php echo get_permalink() . $set_char . \"ult_auc_id=\" . $wdm_auction->ID; ?>\">\n <input type=\"hidden\" name=\"button_subtype\" value=\"services\">\n <input type=\"hidden\" name=\"no_note\" value=\"0\">\n <input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest\">\n <input type=\"submit\" value=\"<?php printf(__('Buy it now for %s%s %s', 'wdm-ultimate-auction'), $currency_symbol, number_format($buy_now_price, 2, '.', ','), $currency_code_display); ?>\" id=\"wdm-buy-now-button\">\n </form>\n </div>\n <?php }\n ?>\n </div> <!--wdm_buy_now_section ends here-->\n\n <script type=\"text/javascript\">\n jQuery(document).ready(function () {\n jQuery(\"#wdm_buy_now_section form\").click(function () {\n var cur_val = jQuery(\"#wdm_buy_now_section form input[name='return']\").val();\n jQuery(\"#wdm_buy_now_section form input[name='return']\").val(cur_val + \"&wdm=\" + \"<?php echo $a_key; ?>\");\n });\n\n });\n </script>\n <?php\n } else {\n if ($check_method === 'method_wire_transfer') {\n $mthd = __('Wire Transfer', 'wdm-ultimate-auction');\n } elseif ($check_method === 'method_mailing') {\n $mthd = __('Cheque', 'wdm-ultimate-auction');\n } elseif ($check_method === 'method_cash') {\n $mthd = __('Cash', 'wdm-ultimate-auction');\n }\n\n $bn_text = sprintf(__('Buy it now for %s%s %s', 'wdm-ultimate-auction'), $currency_symbol, number_format($buy_now_price, 2, '.', ','), $currency_code_display);\n\n $shipAmt = 0;\n $shipAmt = apply_filters('ua_shipping_data_invoice', $shipAmt, $wdm_auction->ID, $auction_bidder_email);\n\n if ($shipAmt > 0) {\n $bn_text = sprintf(__('Buy it now for %s%s %s + %s%s %s(shipping)', 'wdm-ultimate-auction'), $currency_symbol, number_format($buy_now_price, 2, '.', ','), $currency_code_display, $currency_symbol, number_format($shipAmt, 2, '.', ','), $currency_code_display);\n }\n ?>\n <div id=\"wdm_buy_now_section\" class=\"clearfix\">\n <?php if ($curr_user->ID != $wdm_auction->post_author) { ?>\n <div id=\"wdm-buy-line-above\" class=\"clearfix\">\n <form action=\"<?php echo add_query_arg(array('mt' => 'bn', 'wdm' => $a_key), get_permalink() . $set_char . \"ult_auc_id=\" . $wdm_auction->ID); ?>\" method=\"post\">\n <input type=\"submit\" value=\"<?php echo $bn_text; ?>\" id=\"wdm-buy-now-button\">\n </form>\n </div>\n <?php } ?>\n </div>\n\n <script type=\"text/javascript\">\n jQuery(document).ready(function ($) {\n $(\"#wdm-buy-now-button\").click(function () {\n var bcnf = confirm('<?php printf(__(\"You need to pay %s %.2f amount via %s to %s. If you choose OK, you will receive an email with payment details and auction will expire. Choose Cancel to ignore this buy now transaction.\", \"wdm-ultimate-auction\"), $currency_code, $buy_now_price + $shipAmt, $mthd, $auction_author->user_login); ?>');\n if (bcnf == true) {\n return true;\n }\n return false;\n });\n });\n </script>\n <?php\n }\n } else {\n ?>\n <div id=\"wdm_buy_now_section\" class=\"clearfix\">\n <div id=\"wdm-buy-line-above\" class=\"clearfix\">\n <a class=\"wdm-login-to-buy-now\" href=\"<?php echo $wdm_login_url; ?>\" title=\"<?php _e('Login', 'wdm-ultimate-auction'); ?>\">\n <?php printf(__('Buy it now for %s%s %s', 'wdm-ultimate-auction'), $currency_symbol, number_format($buy_now_price, 2, '.', ','), $currency_code_display); ?>\n </a>\n </div>\n\n </div>\n <?php\n }\n }\n\n if (is_user_logged_in() && $curr_user->ID == $wdm_auction->post_author) {\n echo \"<span class='wdm-align-left wdmua-clear wdmua-loggedin-error'>\" . __('Sorry, you can not bid on your own item.', 'wdm-ultimate-auction') . \"</span>\";\n }\n\n do_action('wdm_ua_ship_short_link', $wdm_auction->ID);\n\n //do_action('ua_add_shipping_cost_view_field', $wdm_auction->ID); //SHP-ADD hook to add new product data\n }\n ?>\n </div> <!--wdm_single_prod_desc ends here-->\n\n </div> <!--wdm-ultimate-auction-container ends here-->\n\n <!--<div id=\"wdm_auction_desc_section\">\n <div class=\"wdm-single-auction-description\">\n <strong><?php //_e('Description', 'wdm-ultimate-auction'); ?></strong>\n <br />\n <?php //echo apply_filters('the_content', $wdm_auction->post_content); ?>\n </div>\n \n </div>--> <!--wdm_auction_desc_section ends here-->\n\n <?php\n require_once('auction-description-tabs.php'); //file to display current auction description tabs section\n ?>\n <!--script to show small images in main image container-->\n <script type=\"text/javascript\">\n jQuery(document).ready(function ($) {\n\n $('.wdm-image-container .auction-small-img').each(function (i) {\n $('.auction-small-img' + (i + 1)).click(function () {\n $('.auction-main-img-a').css('display', 'none');\n $('.auction-main-img' + (i + 1)).css('display', 'block');\n });\n });\n\n //jQuery(\".auction-main-img-a\").boxer({'fixed': true});\n\n var eDays = jQuery('#wdm_days');\n var eHours = jQuery('#wdm_hours');\n var eMinutes = jQuery('#wdm_minutes');\n var eSeconds = jQuery('#wdm_seconds');\n\n var timer;\n timer = setInterval(function () {\n var vDays = parseInt(eDays.html(), 10);\n var vHours = parseInt(eHours.html(), 10);\n var vMinutes = parseInt(eMinutes.html(), 10);\n var vSeconds = parseInt(eSeconds.html(), 10);\n\n var ac_time = '<?php echo $auc_time; ?>';\n\n if (ac_time == 'live') {\n\n vSeconds--;\n if (vSeconds < 0) {\n vSeconds = 59;\n vMinutes--;\n if (vMinutes < 0) {\n vMinutes = 59;\n vHours--;\n if (vHours < 0) {\n vHours = 23;\n vDays--;\n }\n }\n }\n else {\n if (vSeconds == 0 &&\n vMinutes == 0 &&\n vHours == 0 &&\n vDays == 0) {\n clearInterval(timer);\n window.location.reload();\n }\n }\n }\n else if (ac_time == 'exp') {\n vSeconds++;\n if (vSeconds > 59) {\n vSeconds = 0;\n vMinutes++;\n if (vMinutes > 59) {\n vMinutes = 0;\n vHours++;\n if (vHours > 23) {\n vHours = 0;\n vDays++;\n }\n }\n } else {\n if (vSeconds == 0 &&\n vMinutes == 0 &&\n vHours == 0 &&\n vDays == 0) {\n clearInterval(timer);\n window.location.reload();\n }\n }\n }\n\n eSeconds.html(vSeconds);\n eMinutes.html(vMinutes);\n eHours.html(vHours);\n eDays.html(vDays);\n\n if (vDays == 0) {\n eDays.hide();\n jQuery('#wdm_days_text').html(' ');\n }\n else if (vDays == 1 || vDays == -1) {\n eDays.show();\n jQuery('#wdm_days_text').html(' <?php _e(\"day\", \"wdm-ultimate-auction\"); ?> ');\n }\n else {\n eDays.show();\n jQuery('#wdm_days_text').html(' <?php _e(\"days\", \"wdm-ultimate-auction\"); ?> ');\n }\n\n if (vHours == 0) {\n eHours.hide();\n jQuery('#wdm_hrs_text').html(' ');\n }\n else if (vHours == 1 || vHours == -1) {\n eHours.show();\n jQuery('#wdm_hrs_text').html(' <?php _e(\"hour\", \"wdm-ultimate-auction\"); ?> ');\n }\n else {\n eHours.show();\n jQuery('#wdm_hrs_text').html(' <?php _e(\"hours\", \"wdm-ultimate-auction\"); ?> ');\n }\n\n if (vMinutes == 0) {\n eMinutes.hide();\n jQuery('#wdm_mins_text').html(' ');\n }\n else if (vMinutes == 1 || vMinutes == -1) {\n eMinutes.show();\n jQuery('#wdm_mins_text').html(' <?php _e(\"minute\", \"wdm-ultimate-auction\"); ?> ');\n }\n else {\n eMinutes.show();\n jQuery('#wdm_mins_text').html(' <?php _e(\"minutes\", \"wdm-ultimate-auction\"); ?> ');\n }\n\n if (vSeconds == 0) {\n eSeconds.hide();\n jQuery('#wdm_secs_text').html(' ');\n }\n else if (vSeconds == 1 || vSeconds == -1) {\n eSeconds.show();\n jQuery('#wdm_secs_text').html(' <?php _e(\"second\", \"wdm-ultimate-auction\"); ?>');\n }\n else {\n eSeconds.show();\n jQuery('#wdm_secs_text').html(' <?php _e(\"seconds\", \"wdm-ultimate-auction\"); ?>');\n }\n\n }, 1000);\n\n });\n </script>\n <?php\n }\n } else {\n //file auction listing page\n require_once('auction-feeder-page.php');\n }\n\n $auc_sc = ob_get_contents();\n\n ob_end_clean();\n\n return $auc_sc;\n}", "public function testFilterUserByCurrency()\n {\n $expected = $this->usersFilter->filterByCurrency(\"AED\",\"AED\");\n $this->assertTrue($expected);\n }", "function god(){\n print_r( current_filter() );\n echo '<br />';\n }", "function CurrencyFormat($fSum=0, $strCurrency=\"RUB\") {\n\t\tif (!isset($fSum) || strlen($fSum)<=0) return false;\n\t\tif (!in_array($strCurrency,array(\"RUB\",\"RUR\"))) return false;\n\t\t\n\t\t$bExclude = false;\n\t\t\n\t\t// Skip if defined W_RUBLE_SKIP_FLAG\n\t\tif (defined('W_RUBLE_SKIP_FLAG') && W_RUBLE_SKIP_FLAG===true) {\n\t\t\t$bExclude = true;\n\t\t}\n\t\t\n\t\t// Skip POST\n\t\tif (!isset($GLOBALS[\"web.ruble\"][\"web_ruble_skip_post\"])) {\n\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_skip_post\"] = COption::GetOptionString(\"web.ruble\", \"web_ruble_skip_post\");\n\t\t}\n\t\tif ($GLOBALS[\"web.ruble\"][\"web_ruble_skip_post\"]==\"Y\" && isset($_POST) && !empty($_POST)) {\n\t\t\t$bExclude = true;\n\t\t}\n\t\t\n\t\t// Exclude by REGEX\n\t\tif (!isset($GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"])) {\n\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"] = COption::GetOptionString(\"web.ruble\", \"web_ruble_regex_exclude\");\n\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"] = explode(\"\\n\", $GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"]);\n\t\t}\n\t\tif (!is_array($GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"])) {\n\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"] = array();\n\t\t}\n\t\tforeach ($GLOBALS[\"web.ruble\"][\"web_ruble_regex_exclude\"] as $Key => $Row) {\n\t\t\t$Row = trim($Row);\n\t\t\tif ($Row != '' && preg_match($Row, $_SERVER[\"REQUEST_URI\"], $M)) {\n\t\t\t\t$bExclude = true;\n\t\t\t}\n\t\t}\n\t\tif ($bExclude) {\n\t\t\tif (!isset($GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"])) {\n\t\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"] = COption::GetOptionString(\"web.ruble\", \"web_ruble_regex_include\");\n\t\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"] = explode(\"\\n\", $GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"]);\n\t\t\t}\n\t\t\tif (!is_array($GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"])) {\n\t\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"] = array();\n\t\t\t}\n\t\t\tforeach ($GLOBALS[\"web.ruble\"][\"web_ruble_regex_include\"] as $Key => $Row) {\n\t\t\t\t$Row = trim($Row);\n\t\t\t\tif ($Row != '' && preg_match($Row, $_SERVER[\"REQUEST_URI\"], $M)) {\n\t\t\t\t\t$bExclude = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($bExclude) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Additional code (eval)\n\t\tif (!isset($GLOBALS[\"web.ruble\"][\"web_ruble_additional_code\"])) {\n\t\t\t$GLOBALS[\"web.ruble\"][\"web_ruble_additional_code\"] = COption::GetOptionString(\"web.ruble\", \"web_ruble_additional_code\").\";\";\n\t\t}\n\t\tif (trim($GLOBALS[\"web.ruble\"][\"web_ruble_additional_code\"])!=\"\") {\n\t\t\t$Eval = eval($GLOBALS[\"web.ruble\"][\"web_ruble_additional_code\"]);\n\t\t\tif ($Eval===\"\" || $Eval===false) return false;\n\t\t}\n\t\t\n\t\t// If in SEO\n\t\t$arBacktrace = debug_backtrace(0);\n\t\tforeach($arBacktrace as $arFunction) {\n\t\t\tif ($arFunction['function']=='loadFromDatabase' && $arFunction['class']=='Bitrix\\Iblock\\Template\\Entity\\ElementPrice') {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$arCurFormat = CCurrencyLang::GetCurrencyFormat($strCurrency);\n\n\t\tif (!isset($arCurFormat[\"DECIMALS\"]))\n\t\t\t$arCurFormat[\"DECIMALS\"] = 2;\n\t\t$arCurFormat[\"DECIMALS\"] = IntVal($arCurFormat[\"DECIMALS\"]);\n\t\tif ($arCurFormat[\"HIDE_ZERO\"]=='Y' && Round($fSum,$arCurFormat[\"DECIMALS\"])==Round($fSum,0)) {\n\t\t\t$arCurFormat[\"DECIMALS\"] = 0;\n\t\t}\n\t\t\n\n\t\tif (!isset($arCurFormat[\"DEC_POINT\"]))\n\t\t\t$arCurFormat[\"DEC_POINT\"] = \".\";\n\t\tif(!empty($arCurFormat[\"THOUSANDS_VARIANT\"]))\n\t\t{\n\t\t\tif($arCurFormat[\"THOUSANDS_VARIANT\"] == \"N\")\n\t\t\t\t$arCurFormat[\"THOUSANDS_SEP\"] = \"\";\n\t\t\telseif($arCurFormat[\"THOUSANDS_VARIANT\"] == \"D\")\n\t\t\t\t$arCurFormat[\"THOUSANDS_SEP\"] = \".\";\n\t\t\telseif($arCurFormat[\"THOUSANDS_VARIANT\"] == \"C\")\n\t\t\t\t$arCurFormat[\"THOUSANDS_SEP\"] = \",\";\n\t\t\telseif($arCurFormat[\"THOUSANDS_VARIANT\"] == \"S\")\n\t\t\t\t$arCurFormat[\"THOUSANDS_SEP\"] = chr(32);\n\t\t\telseif($arCurFormat[\"THOUSANDS_VARIANT\"] == \"B\")\n\t\t\t\t$arCurFormat[\"THOUSANDS_SEP\"] = chr(32);\n\t\t}\n\t\t\n\t\t$Title = COption::GetOptionString(\"web.ruble\", \"web_ruble_title\");\n\t\tif ($Title) $Title = ' title=\\''.$Title.'\\'';\n\t\t// Get letter for selected char\n\t\t$num = number_format($fSum, $arCurFormat[\"DECIMALS\"], $arCurFormat[\"DEC_POINT\"], $arCurFormat[\"THOUSANDS_SEP\"]);\n\t\tif($arCurFormat[\"THOUSANDS_VARIANT\"] == \"B\")\n\t\t\t$num = str_replace(\" \", \"&nbsp;\", $num);\n\t\t$Price = $num;\n\t\t$RubleChar = COption::GetOptionString(\"web.ruble\", \"web_ruble_font_char\");\n\t\t\n\t\t$OwnTag = COption::GetOptionString(\"web.ruble\", \"web_ruble_own_tag\");\n\t\tif ($OwnTag=='Y') {\n\t\t\t$RubleChar = '<ruble'.$Title.'>'.$RubleChar.'</ruble>';\n\t\t} else {\n\t\t\t$RubleChar = '<span class=\\'web-ruble-symbol\\''.$Title.'>'.$RubleChar.'</span>';\n\t\t}\n\t\t\n\t\t$Space = COption::GetOptionString(\"web.ruble\", \"web_ruble_add_space\")==\"Y\" ? \" \" : \"\";\n\t\tif (COption::GetOptionString(\"web.ruble\", \"web_ruble_symbol_location\")==\"R\") {\n\t\t\t$Price = $Price.$Space.$RubleChar;\n\t\t} else {\n\t\t\t$Price = $RubleChar.$Space.$Price;\n\t\t}\n\t\treturn $Price;\n\t}", "function acf_set_filters($filters = array())\n{\n}", "function hide_free_price_notice( $price ) {\n remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );\n return 'Preço sob consulta';\n}", "static function add_filters(): void {\r\n\r\n // Group\r\n add_action('acf/init', [__CLASS__, 'add_group']);\r\n\r\n // Board of Directors\r\n\t self::add_tab('Board of Directors Elections');\r\n\t add_action('acf/init', [__CLASS__, 'add_bods']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_date']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_finished']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_ws']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_w_name']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_vacant']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_form']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_nom_start']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_nom_end']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_statements_day']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_voting_start']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_voting_end']);\r\n\t add_action('acf/init', [__CLASS__, 'add_bod_results_day']);\r\n\r\n\t // Editorial Board\r\n\t self::add_tab('Editorial Board Elections');\r\n\t add_action('acf/init', [__CLASS__, 'add_ebs']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_date']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_finished']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_ws']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_w_name']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_w_role']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_form']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_nom_start']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_nom_end']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_forum_day']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_voting_day']);\r\n\t add_action('acf/init', [__CLASS__, 'add_eb_results_day']);\r\n }", "function disqus_override_tabs($tabs){\r\n if ( has_filter( 'comments_template', 'dsq_comments_template' ) ){\r\n remove_filter( 'comments_template', 'dsq_comments_template' );\r\n add_filter('comments_template', 'dsq_comments_template',90);//higher priority, so the filter is called after woocommerce filter\r\n }\r\n return $tabs;\r\n}", "public function admin_currency_calc($field) {\n\n\t\t/*$route=@Route::getCurrentRoute();\n\t\t\t if($route){\n\t\t\t $api_url = @$route->getPath();\n\t\t\t }else{\n\t\t\t $api_url = '';\n\t\t\t }\n\n\t\t\t $url_array=explode('/',$api_url);\n\t\t\t //Api currency conversion\n\t\t*/\n\t\tif (request()->segment(1) == 'api') {\n\t\t\t$user_details = JWTAuth::parseToken()->authenticate();\n\n\t\t\t$rate = Currency::whereCode($this->attributes['currency_code'])->first()->rate;\n\n\t\t\t$usd_amount = $this->attributes[$field] / $rate;\n\n\t\t\t$api_currency = $user_details->currency_code;\n\n\t\t\t$default_currency = Currency::where('default_currency', 1)->first()->code;\n\n\t\t\t$session_rate = Currency::whereCode($user_details->currency_code != null ? $user_details->currency_code : $default_currency)->first()->rate;\n\n\t\t\treturn round($usd_amount * $session_rate);\n\n\t\t} else {\n\n\t\t\t$rate = Currency::whereCode($this->attributes['currency_code'])->first()->rate;\n\n\t\t\t$usd_amount = @$this->attributes[$field] / @$rate;\n\n\t\t\t$default_currency = Currency::where('default_currency', 1)->first()->code;\n\n\t\t\t$session_rate = Currency::whereCode($default_currency)->first()->rate;\n\n\t\t\treturn round($usd_amount * $session_rate);\n\t\t}\n\n\t}", "function beforeFilter(){\n\t\tparent::beforeFilter(); \n\t}", "public function __construct()\n {\n Mage_Core_Block_Template::__construct();\n $this->setTemplate('sam_layerednavigation/catalog/layer/filter.phtml');\n\n $this->_filterModelName = 'catalog/layer_filter_price';\n }", "public static function init() {\n\t\tadd_filter('gb_addons', array(get_class(),'gb_merchant_meta_addon'), 10, 1);\n\t}", "public function save_currency() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_save_popup_currency\" );\n\n\t\tupdate_option( \"forminator_currency\", sanitize_text_field( $_POST['currency'] ) );\n\t\twp_send_json_success();\n\t}", "public function addFilters()\n {\n }", "private function filters() {\n\n\n\t}", "function reset_filters()\r\n{\r\n\t//uitzoeken of het in js of php gedaan word\t\r\n}" ]
[ "0.7219134", "0.71944624", "0.7111915", "0.6839904", "0.62968266", "0.6266449", "0.6111762", "0.6093072", "0.6031112", "0.5973223", "0.59014297", "0.5862251", "0.5855381", "0.5845947", "0.5829889", "0.5811546", "0.5758441", "0.57058007", "0.5698629", "0.5664962", "0.56640726", "0.56515634", "0.5631429", "0.56311435", "0.5622857", "0.5615306", "0.5604072", "0.560365", "0.5564173", "0.55526054", "0.55525887", "0.55487114", "0.5533427", "0.55280244", "0.5523627", "0.552155", "0.5498044", "0.5487922", "0.5481074", "0.54724014", "0.54616207", "0.5447643", "0.5447643", "0.5447552", "0.5442625", "0.5438986", "0.54315305", "0.54298955", "0.5424824", "0.5424596", "0.54042", "0.537895", "0.5362867", "0.5347693", "0.53469735", "0.53369796", "0.5330451", "0.532304", "0.5317699", "0.5310589", "0.5308134", "0.5294283", "0.52887887", "0.5285195", "0.5285195", "0.52835476", "0.5269072", "0.52655977", "0.52649343", "0.52621585", "0.52621585", "0.52621585", "0.5249267", "0.5246649", "0.5241302", "0.52329785", "0.52303135", "0.5228665", "0.52182233", "0.52137583", "0.5210873", "0.5209774", "0.5201845", "0.5200199", "0.5199004", "0.519855", "0.5190286", "0.51882637", "0.5184851", "0.51714414", "0.5170264", "0.51693356", "0.5157244", "0.5152226", "0.51522213", "0.5150269", "0.5149824", "0.51435006", "0.5140909", "0.51379794" ]
0.618518
6
add_filter( 'edd_currency_change_before_format', 'getfaircoin_currency_filter_before' ); // Menu items, not used now
function getfair_currency_menu_item( $item ) { if($item->title == 'Your Currency'){ $item->title = 'from: '.edd_currency_get_stored_currency(); } return $item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_ffd_currency() {\r\n\treturn apply_filters( 'ffd_currency', get_option( 'ffd_currency' ) );\r\n}", "function acadp_currency_filter( $price = '', $currency_settings = array() ) {\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$position = $currency_settings['position'];\n\n\t$negative = $price < 0;\n\n\tif( $negative ) {\n\t\t$price = substr( $price, 1 ); // Remove proceeding \"-\" -\n\t}\n\n\t$symbol = acadp_currency_symbol( $currency );\n\n\tif( $position == 'before' ) {\n\n\t\tswitch( $currency ) {\n\t\t\tcase \"GBP\" :\n\t\t\tcase \"BRL\" :\n\t\t\tcase \"EUR\" :\n\t\t\tcase \"USD\" :\n\t\t\tcase \"AUD\" :\n\t\t\tcase \"CAD\" :\n\t\t\tcase \"HKD\" :\n\t\t\tcase \"MXN\" :\n\t\t\tcase \"NZD\" :\n\t\t\tcase \"SGD\" :\n\t\t\tcase \"JPY\" :\n\t\t\t\t$formatted = $symbol . $price;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$formatted = $currency . ' ' . $price;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$formatted = apply_filters( 'acadp_' . strtolower( $currency ) . '_currency_filter_before', $formatted, $currency, $price );\n\n\t} else {\n\n\t\tswitch( $currency ) {\n\t\t\tcase \"GBP\" :\n\t\t\tcase \"BRL\" :\n\t\t\tcase \"EUR\" :\n\t\t\tcase \"USD\" :\n\t\t\tcase \"AUD\" :\n\t\t\tcase \"CAD\" :\n\t\t\tcase \"HKD\" :\n\t\t\tcase \"MXN\" :\n\t\t\tcase \"SGD\" :\n\t\t\tcase \"JPY\" :\n\t\t\t\t$formatted = $price . $symbol;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$formatted = $price . ' ' . $currency;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$formatted = apply_filters( 'acadp_' . strtolower( $currency ) . '_currency_filter_after', $formatted, $currency, $price );\n\n\t}\n\n\tif( $negative ) {\n\t\t// Prepend the mins sign before the currency sign\n\t\t$formatted = '-' . $formatted;\n\t}\n\n\treturn $formatted;\n\n}", "function cosmetro_top_currency_switcher( $format = '%s' ) {\n\n\t$is_enabled = get_theme_mod( 'top_currency_switcher', cosmetro_theme()->customizer->get_default( 'top_currency_switcher' ) );\n\n\tif ( ! $is_enabled ) {\n\t\treturn;\n\t}\n\n\tprintf( $format, cosmetro_currency_switcher() );\n\n}", "function erp_get_currencies() {\n return apply_filters( 'erp_currencies', [\n 'AFN' => __( 'Afghan Afghani', 'erp' ),\n 'ALL' => __( 'Albanian Lek', 'erp' ),\n 'DZD' => __( 'Algerian Dinar', 'erp' ),\n 'ADP' => __( 'Andorran Peseta', 'erp' ),\n 'AOA' => __( 'Angolan Kwanza', 'erp' ),\n 'ARA' => __( 'Argentine Austral', 'erp' ),\n 'ARS' => __( 'Argentine Peso', 'erp' ),\n 'AMD' => __( 'Armenian Dram', 'erp' ),\n 'AWG' => __( 'Aruban Florin', 'erp' ),\n 'AUD' => __( 'Australian Dollar', 'erp' ),\n 'ATS' => __( 'Austrian Schilling', 'erp' ),\n 'AZN' => __( 'Azerbaijani Manat', 'erp' ),\n 'BSD' => __( 'Bahamian Dollar', 'erp' ),\n 'BHD' => __( 'Bahraini Dinar', 'erp' ),\n 'BDT' => __( 'Bangladeshi Taka', 'erp' ),\n 'BBD' => __( 'Barbadian Dollar', 'erp' ),\n 'BYR' => __( 'Belarusian Ruble', 'erp' ),\n 'BEF' => __( 'Belgian Franc', 'erp' ),\n 'BZD' => __( 'Belize Dollar', 'erp' ),\n 'BMD' => __( 'Bermudan Dollar', 'erp' ),\n 'BTN' => __( 'Bhutanese Ngultrum', 'erp' ),\n 'BOB' => __( 'Bolivian Boliviano', 'erp' ),\n 'BOV' => __( 'Bolivian Mvdol', 'erp' ),\n 'BOP' => __( 'Bolivian Peso', 'erp' ),\n 'BAM' => __( 'Bosnia-Herzegovina Convertible Mark', 'erp' ),\n 'BWP' => __( 'Botswanan Pula', 'erp' ),\n 'BRL' => __( 'Brazilian Real', 'erp' ),\n 'GBP' => __( 'British Pound Sterling', 'erp' ),\n 'BND' => __( 'Brunei Dollar', 'erp' ),\n 'BGN' => __( 'Bulgarian Lev', 'erp' ),\n 'BUK' => __( 'Burmese Kyat', 'erp' ),\n 'BIF' => __( 'Burundian Franc', 'erp' ),\n 'KHR' => __( 'Cambodian Riel', 'erp' ),\n 'CAD' => __( 'Canadian Dollar', 'erp' ),\n 'CVE' => __( 'Cape Verdean Escudo', 'erp' ),\n 'KYD' => __( 'Cayman Islands Dollar', 'erp' ),\n 'XOF' => __( 'CFA Franc BCEAO', 'erp' ),\n 'XAF' => __( 'CFA Franc BEAC', 'erp' ),\n 'XPF' => __( 'CFP Franc', 'erp' ),\n 'CLP' => __( 'Chilean Peso', 'erp' ),\n 'CNY' => __( 'Chinese Yuan', 'erp' ),\n 'COP' => __( 'Colombian Peso', 'erp' ),\n 'KMF' => __( 'Comorian Franc', 'erp' ),\n 'CDF' => __( 'Congolese Franc', 'erp' ),\n 'CRC' => __( 'Costa Rican Colón', 'erp' ),\n 'HRK' => __( 'Croatian Kuna', 'erp' ),\n 'CUP' => __( 'Cuban Peso', 'erp' ),\n 'CYP' => __( 'Cypriot Pound', 'erp' ),\n 'CZK' => __( 'Czech Republic Koruna', 'erp' ),\n 'DKK' => __( 'Danish Krone', 'erp' ),\n 'DJF' => __( 'Djiboutian Franc', 'erp' ),\n 'DOP' => __( 'Dominican Peso', 'erp' ),\n 'NLG' => __( 'Dutch Guilder', 'erp' ),\n 'XCD' => __( 'East Caribbean Dollar', 'erp' ),\n 'ECS' => __( 'Ecuadorian Sucre', 'erp' ),\n 'EGP' => __( 'Egyptian Pound', 'erp' ),\n 'GQE' => __( 'Equatorial Guinean Ekwele', 'erp' ),\n 'ERN' => __( 'Eritrean Nakfa', 'erp' ),\n 'EEK' => __( 'Estonian Kroon', 'erp' ),\n 'ETB' => __( 'Ethiopian Birr', 'erp' ),\n 'EUR' => __( 'Euro', 'erp' ),\n 'FKP' => __( 'Falkland Islands Pound', 'erp' ),\n 'FJD' => __( 'Fijian Dollar', 'erp' ),\n 'FIM' => __( 'Finnish Markka', 'erp' ),\n 'FRF' => __( 'French Franc', 'erp' ),\n 'GMD' => __( 'Gambian Dalasi', 'erp' ),\n 'GEL' => __( 'Georgian Lari', 'erp' ),\n 'DEM' => __( 'German Mark', 'erp' ),\n 'GHS' => __( 'Ghanaian Cedi', 'erp' ),\n 'GIP' => __( 'Gibraltar Pound', 'erp' ),\n 'GRD' => __( 'Greek Drachma', 'erp' ),\n 'GTQ' => __( 'Guatemalan Quetzal', 'erp' ),\n 'GWP' => __( 'Guinea-Bissau Peso', 'erp' ),\n 'GNF' => __( 'Guinean Franc', 'erp' ),\n 'GYD' => __( 'Guyanaese Dollar', 'erp' ),\n 'HTG' => __( 'Haitian Gourde', 'erp' ),\n 'HNL' => __( 'Honduran Lempira', 'erp' ),\n 'HKD' => __( 'Hong Kong Dollar', 'erp' ),\n 'HUF' => __( 'Hungarian Forint', 'erp' ),\n 'ISK' => __( 'Icelandic Króna', 'erp' ),\n 'INR' => __( 'Indian Rupee', 'erp' ),\n 'IDR' => __( 'Indonesian Rupiah', 'erp' ),\n 'IRR' => __( 'Iranian Rial', 'erp' ),\n 'IQD' => __( 'Iraqi Dinar', 'erp' ),\n 'IEP' => __( 'Irish Pound', 'erp' ),\n 'ILS' => __( 'Israeli New Sheqel', 'erp' ),\n 'ITL' => __( 'Italian Lira', 'erp' ),\n 'JMD' => __( 'Jamaican Dollar', 'erp' ),\n 'JPY' => __( 'Japanese Yen', 'erp' ),\n 'JOD' => __( 'Jordanian Dinar', 'erp' ),\n 'KZT' => __( 'Kazakhstani Tenge', 'erp' ),\n 'KES' => __( 'Kenyan Shilling', 'erp' ),\n 'KWD' => __( 'Kuwaiti Dinar', 'erp' ),\n 'KGS' => __( 'Kyrgystani Som', 'erp' ),\n 'LAK' => __( 'Laotian Kip', 'erp' ),\n 'LVL' => __( 'Latvian Lats', 'erp' ),\n 'LBP' => __( 'Lebanese Pound', 'erp' ),\n 'LSL' => __( 'Lesotho Loti', 'erp' ),\n 'LRD' => __( 'Liberian Dollar', 'erp' ),\n 'LYD' => __( 'Libyan Dinar', 'erp' ),\n 'LTL' => __( 'Lithuanian Litas', 'erp' ),\n 'LTT' => __( 'Lithuanian Talonas', 'erp' ),\n 'LUF' => __( 'Luxembourgian Franc', 'erp' ),\n 'MOP' => __( 'Macanese Pataca', 'erp' ),\n 'MKD' => __( 'Macedonian Denar', 'erp' ),\n 'MGA' => __( 'Malagasy Ariary', 'erp' ),\n 'MWK' => __( 'Malawian Kwacha', 'erp' ),\n 'MYR' => __( 'Malaysian Ringgit', 'erp' ),\n 'MVR' => __( 'Maldivian Rufiyaa', 'erp' ),\n 'MLF' => __( 'Malian Franc', 'erp' ),\n 'MTL' => __( 'Maltese Lira', 'erp' ),\n 'MRO' => __( 'Mauritanian Ouguiya', 'erp' ),\n 'MUR' => __( 'Mauritian Rupee', 'erp' ),\n 'MXN' => __( 'Mexican Peso', 'erp' ),\n 'MDL' => __( 'Moldovan Leu', 'erp' ),\n 'MCF' => __( 'Monegasque Franc', 'erp' ),\n 'MNT' => __( 'Mongolian Tugrik', 'erp' ),\n 'MAD' => __( 'Moroccan Dirham', 'erp' ),\n 'MZN' => __( 'Mozambican Metical', 'erp' ),\n 'MMK' => __( 'Myanmar Kyat', 'erp' ),\n 'NAD' => __( 'Namibian Dollar', 'erp' ),\n 'NPR' => __( 'Nepalese Rupee', 'erp' ),\n 'ANG' => __( 'Netherlands Antillean Guilder', 'erp' ),\n 'TWD' => __( 'New Taiwan Dollar', 'erp' ),\n 'NZD' => __( 'New Zealand Dollar', 'erp' ),\n 'NIO' => __( 'Nicaraguan Córdoba', 'erp' ),\n 'NGN' => __( 'Nigerian Naira', 'erp' ),\n 'KPW' => __( 'North Korean Won', 'erp' ),\n 'NOK' => __( 'Norwegian Krone', 'erp' ),\n 'OMR' => __( 'Omani Rial', 'erp' ),\n 'PKR' => __( 'Pakistani Rupee', 'erp' ),\n 'PAB' => __( 'Panamanian Balboa', 'erp' ),\n 'PGK' => __( 'Papua New Guinean Kina', 'erp' ),\n 'PYG' => __( 'Paraguayan Guarani', 'erp' ),\n 'PEI' => __( 'Peruvian Inti', 'erp' ),\n 'PHP' => __( 'Philippine Peso', 'erp' ),\n 'PLN' => __( 'Polish Zloty', 'erp' ),\n 'PTE' => __( 'Portuguese Escudo', 'erp' ),\n 'QAR' => __( 'Qatari Rial', 'erp' ),\n 'RHD' => __( 'Rhodesian Dollar', 'erp' ),\n 'RON' => __( 'Romanian Leu', 'erp' ),\n 'RUB' => __( 'Russian Ruble', 'erp' ),\n 'RWF' => __( 'Rwandan Franc', 'erp' ),\n 'SVC' => __( 'Salvadoran Colón', 'erp' ),\n 'WST' => __( 'Samoan Tala', 'erp' ),\n 'STD' => __( 'São Tomé & Príncipe Dobra', 'erp' ),\n 'SAR' => __( 'Saudi Riyal', 'erp' ),\n 'RSD' => __( 'Serbian Dinar', 'erp' ),\n 'SCR' => __( 'Seychellois Rupee', 'erp' ),\n 'SLL' => __( 'Sierra Leonean Leone', 'erp' ),\n 'SGD' => __( 'Singapore Dollar', 'erp' ),\n 'SKK' => __( 'Slovak Koruna', 'erp' ),\n 'SIT' => __( 'Slovenian Tolar', 'erp' ),\n 'SBD' => __( 'Solomon Islands Dollar', 'erp' ),\n 'SOS' => __( 'Somali Shilling', 'erp' ),\n 'ZAR' => __( 'South African Rand', 'erp' ),\n 'KRW' => __( 'South Korean Won', 'erp' ),\n 'SSP' => __( 'South Sudanese Pound', 'erp' ),\n 'ESP' => __( 'Spanish Peseta', 'erp' ),\n 'LKR' => __( 'Sri Lankan Rupee', 'erp' ),\n 'SHP' => __( 'St. Helena Pound', 'erp' ),\n 'SDG' => __( 'Sudanese Pound', 'erp' ),\n 'SRD' => __( 'Surinamese Dollar', 'erp' ),\n 'SZL' => __( 'Swazi Lilangeni', 'erp' ),\n 'SEK' => __( 'Swedish Krona', 'erp' ),\n 'CHF' => __( 'Swiss Franc', 'erp' ),\n 'SYP' => __( 'Syrian Pound', 'erp' ),\n 'TJS' => __( 'Tajikistani Somoni', 'erp' ),\n 'TZS' => __( 'Tanzanian Shilling', 'erp' ),\n 'THB' => __( 'Thai Baht', 'erp' ),\n 'TPE' => __( 'Timorese Escudo', 'erp' ),\n 'TOP' => __( 'Tongan Paʻanga', 'erp' ),\n 'TTD' => __( 'Trinidad & Tobago Dollar', 'erp' ),\n 'TND' => __( 'Tunisian Dinar', 'erp' ),\n 'TRY' => __( 'Turkish Lira', 'erp' ),\n 'TMT' => __( 'Turkmenistani Manat', 'erp' ),\n 'UGX' => __( 'Ugandan Shilling', 'erp' ),\n 'UAH' => __( 'Ukrainian Hryvnia', 'erp' ),\n 'AED' => __( 'United Arab Emirates Dirham', 'erp' ),\n 'UYU' => __( 'Uruguayan Peso', 'erp' ),\n 'USD' => __( 'US Dollar', 'erp' ),\n 'UZS' => __( 'Uzbekistan Som', 'erp' ),\n 'VUV' => __( 'Vanuatu Vatu', 'erp' ),\n 'VEF' => __( 'Venezuelan Bolívar', 'erp' ),\n 'VND' => __( 'Vietnamese Dong', 'erp' ),\n 'YER' => __( 'Yemeni Rial', 'erp' ),\n 'ZMW' => __( 'Zambian Kwacha', 'erp' ),\n 'ZWL' => __( 'Zimbabwean Dollar', 'erp' ),\n ] );\n}", "function fetch_currency_with_symbol($amount,$currency = '')\r\n{\r\n\t$amt_display = '';\r\n\tif($amount==''){ $amount =0; }\r\n\t$decimals=get_option('tmpl_price_num_decimals');\r\n\t$decimals=($decimals!='')?$decimals:2;\r\n\tif($amount >=0 )\r\n\t{\r\n\t\tif(@$amount !='')\r\n\t\t\t$amount = $amount;\r\n\t\t\t$currency = get_option('currency_symbol');\r\n\t\t\t$position = get_option('currency_pos');\r\n\t\tif($position == '1')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.$amount;\r\n\t\t}\r\n\t\telse if($position == '2')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.' '.$amount;\r\n\t\t}\r\n\t\telse if($position == '3')\r\n\t\t{\r\n\t\t\t$amt_display = $amount.$currency;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$amt_display = $amount.' '.$currency;\r\n\t\t}\r\n\t\treturn apply_filters('tmpl_price_format',$amt_display,$amount,$currency);\r\n\t}\r\n}", "function templatic_get_currency_type()\r\n{\r\n\tglobal $wpdb;\r\n\t$option_value = get_option('currency_code');\r\n\tif($option_value)\r\n\t{\r\n\t\treturn stripslashes($option_value);\r\n\t}else\r\n\t{\r\n\t\treturn 'USD';\r\n\t}\r\n\t\r\n}", "function getfaircoin_price($price){\r\n global $edd_options;\r\n\r\n if( $price == 0 ) { // <span style=\"font-family:arial\">ƒ</span>\r\n $price = '1 Fair = '.number_format($edd_options['faircoin_price'], 2, '.', ',').' EUR';\r\n }\r\n return $price;\r\n}", "function getfaircoin_currency_filter_before($formated, $currency, $price){\r\n //$price_arr = explode(' ', $price);\r\n //if( count( $price_arr ) > 1 ) {\r\n echo 'FORMATED: '.$formated.' PRICE: '.$price;\r\n //}\r\n //return $price;\r\n}", "function tmpl_fetch_currency(){\r\n\t$currency = get_option('currency_symbol');\r\n\tif($currency){\r\n\t\treturn $currency;\r\n\t}else{\r\n\t\treturn '$';\r\n\t}\t\r\n}", "function _wpsc_db_upgrade_14() {\n\t_wpsc_fix_latvia_currency();\n}", "function pms_format_price( $price = 0, $currency = '', $args = array() ) {\r\n\r\n $currency = pms_get_currency_symbol( $currency );\r\n\r\n //format number based on current locale with 2 decimals\r\n $price = number_format_i18n( $price, 2 );\r\n\r\n //remove any decimal 0s that are irrelevant; will match: x,00, x.00 and also x,10 or x.10\r\n $price = preg_replace('/(\\.|\\,)?0*$/', '', $price);\r\n\r\n $price = ( !empty( $args['before_price'] ) && !empty( $args['after_price'] ) ? $args['before_price'] . $price . $args['after_price'] : $price );\r\n $currency = ( !empty( $args['before_currency'] ) && !empty( $args['after_currency'] ) ? $args['before_currency'] . $currency . $args['after_currency'] : $currency );\r\n\r\n $settings = get_option( 'pms_payments_settings' );\r\n\r\n $output = ( !isset( $settings['currency_position'] ) || ( isset( $settings['currency_position'] ) && $settings['currency_position'] == 'after' ) ? $price . $currency : $currency . $price );\r\n\r\n return apply_filters( 'pms_format_price', $output, $price, $currency, $args );\r\n\r\n }", "function acadp_payment_currency_filter( $price = '' ) {\n\n\treturn acadp_currency_filter( $price, acadp_get_payment_currency_settings() );\n\n}", "function get_carton_currency() {\n\treturn apply_filters( 'carton_currency', get_option('carton_currency') );\n}", "function pms_get_currency_symbol( $currency_code ) {\r\n\r\n $currencies = apply_filters('pms_currency_symbols',\r\n array(\r\n 'AED' => '&#1583;.&#1573;', // ?\r\n 'AFN' => '&#65;&#102;',\r\n 'ALL' => '&#76;&#101;&#107;',\r\n 'AMD' => '',\r\n 'ANG' => '&#402;',\r\n 'AOA' => '&#75;&#122;', // ?\r\n 'ARS' => '&#36;',\r\n 'AUD' => '&#36;',\r\n 'AWG' => '&#402;',\r\n 'AZN' => '&#1084;&#1072;&#1085;',\r\n 'BAM' => '&#75;&#77;',\r\n 'BBD' => '&#36;',\r\n 'BDT' => '&#2547;', // ?\r\n 'BGN' => '&#1083;&#1074;',\r\n 'BHD' => '.&#1583;.&#1576;', // ?\r\n 'BIF' => '&#70;&#66;&#117;', // ?\r\n 'BMD' => '&#36;',\r\n 'BND' => '&#36;',\r\n 'BOB' => '&#36;&#98;',\r\n 'BRL' => '&#82;&#36;',\r\n 'BSD' => '&#36;',\r\n 'BTN' => '&#78;&#117;&#46;', // ?\r\n 'BWP' => '&#80;',\r\n 'BYR' => '&#112;&#46;',\r\n 'BZD' => '&#66;&#90;&#36;',\r\n 'CAD' => '&#36;',\r\n 'CDF' => '&#70;&#67;',\r\n 'CHF' => '&#67;&#72;&#70;',\r\n 'CLF' => '', // ?\r\n 'CLP' => '&#36;',\r\n 'CNY' => '&#165;',\r\n 'COP' => '&#36;',\r\n 'CRC' => '&#8353;',\r\n 'CUP' => '&#8396;',\r\n 'CVE' => '&#36;', // ?\r\n 'CZK' => '&#75;&#269;',\r\n 'DJF' => '&#70;&#100;&#106;', // ?\r\n 'DKK' => '&#107;&#114;',\r\n 'DOP' => '&#82;&#68;&#36;',\r\n 'DZD' => '&#1583;&#1580;', // ?\r\n 'EGP' => '&#163;',\r\n 'ETB' => '&#66;&#114;',\r\n 'EUR' => '&#8364;',\r\n 'FJD' => '&#36;',\r\n 'FKP' => '&#163;',\r\n 'GBP' => '&#163;',\r\n 'GEL' => '&#4314;', // ?\r\n 'GHS' => '&#162;',\r\n 'GIP' => '&#163;',\r\n 'GMD' => '&#68;', // ?\r\n 'GNF' => '&#70;&#71;', // ?\r\n 'GTQ' => '&#81;',\r\n 'GYD' => '&#36;',\r\n 'HKD' => '&#36;',\r\n 'HNL' => '&#76;',\r\n 'HRK' => '&#107;&#110;',\r\n 'HTG' => '&#71;', // ?\r\n 'HUF' => '&#70;&#116;',\r\n 'IDR' => '&#82;&#112;',\r\n 'ILS' => '&#8362;',\r\n 'INR' => '&#8377;',\r\n 'IQD' => '&#1593;.&#1583;', // ?\r\n 'IRR' => '&#65020;',\r\n 'ISK' => '&#107;&#114;',\r\n 'JEP' => '&#163;',\r\n 'JMD' => '&#74;&#36;',\r\n 'JOD' => '&#74;&#68;', // ?\r\n 'JPY' => '&#165;',\r\n 'KES' => '&#75;&#83;&#104;', // ?\r\n 'KGS' => '&#1083;&#1074;',\r\n 'KHR' => '&#6107;',\r\n 'KMF' => '&#67;&#70;', // ?\r\n 'KPW' => '&#8361;',\r\n 'KRW' => '&#8361;',\r\n 'KWD' => '&#1583;.&#1603;', // ?\r\n 'KYD' => '&#36;',\r\n 'KZT' => '&#1083;&#1074;',\r\n 'LAK' => '&#8365;',\r\n 'LBP' => '&#163;',\r\n 'LKR' => '&#8360;',\r\n 'LRD' => '&#36;',\r\n 'LSL' => '&#76;', // ?\r\n 'LTL' => '&#76;&#116;',\r\n 'LVL' => '&#76;&#115;',\r\n 'LYD' => '&#1604;.&#1583;', // ?\r\n 'MAD' => '&#1583;.&#1605;.', //?\r\n 'MDL' => '&#76;',\r\n 'MGA' => '&#65;&#114;', // ?\r\n 'MKD' => '&#1076;&#1077;&#1085;',\r\n 'MMK' => '&#75;',\r\n 'MNT' => '&#8366;',\r\n 'MOP' => '&#77;&#79;&#80;&#36;', // ?\r\n 'MRO' => '&#85;&#77;', // ?\r\n 'MUR' => '&#8360;', // ?\r\n 'MVR' => '.&#1923;', // ?\r\n 'MWK' => '&#77;&#75;',\r\n 'MXN' => '&#36;',\r\n 'MYR' => '&#82;&#77;',\r\n 'MZN' => '&#77;&#84;',\r\n 'NAD' => '&#36;',\r\n 'NGN' => '&#8358;',\r\n 'NIO' => '&#67;&#36;',\r\n 'NOK' => '&#107;&#114;',\r\n 'NPR' => '&#8360;',\r\n 'NZD' => '&#36;',\r\n 'OMR' => '&#65020;',\r\n 'PAB' => '&#66;&#47;&#46;',\r\n 'PEN' => '&#83;&#47;&#46;',\r\n 'PGK' => '&#75;', // ?\r\n 'PHP' => '&#8369;',\r\n 'PKR' => '&#8360;',\r\n 'PLN' => '&#122;&#322;',\r\n 'PYG' => '&#71;&#115;',\r\n 'QAR' => '&#65020;',\r\n 'RON' => '&#108;&#101;&#105;',\r\n 'RSD' => '&#1044;&#1080;&#1085;&#46;',\r\n 'RUB' => '&#1088;&#1091;&#1073;',\r\n 'RWF' => '&#1585;.&#1587;',\r\n 'SAR' => '&#65020;',\r\n 'SBD' => '&#36;',\r\n 'SCR' => '&#8360;',\r\n 'SDG' => '&#163;', // ?\r\n 'SEK' => '&#107;&#114;',\r\n 'SGD' => '&#36;',\r\n 'SHP' => '&#163;',\r\n 'SLL' => '&#76;&#101;', // ?\r\n 'SOS' => '&#83;',\r\n 'SRD' => '&#36;',\r\n 'STD' => '&#68;&#98;', // ?\r\n 'SVC' => '&#36;',\r\n 'SYP' => '&#163;',\r\n 'SZL' => '&#76;', // ?\r\n 'THB' => '&#3647;',\r\n 'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)\r\n 'TMT' => '&#109;',\r\n 'TND' => '&#1583;.&#1578;',\r\n 'TOP' => '&#84;&#36;',\r\n 'TRY' => '&#8356;', // New Turkey Lira (old symbol used)\r\n 'TTD' => '&#36;',\r\n 'TWD' => '&#78;&#84;&#36;',\r\n 'TZS' => '',\r\n 'UAH' => '&#8372;',\r\n 'UGX' => '&#85;&#83;&#104;',\r\n 'USD' => '&#36;',\r\n 'UYU' => '&#36;&#85;',\r\n 'UZS' => '&#1083;&#1074;',\r\n 'VEF' => '&#66;&#115;',\r\n 'VND' => '&#8363;',\r\n 'VUV' => '&#86;&#84;',\r\n 'WST' => '&#87;&#83;&#36;',\r\n 'XAF' => '&#70;&#67;&#70;&#65;',\r\n 'XCD' => '&#36;',\r\n 'XDR' => '',\r\n 'XOF' => '',\r\n 'XPF' => '&#70;',\r\n 'YER' => '&#65020;',\r\n 'ZAR' => '&#82;',\r\n 'ZMK' => '&#90;&#75;', // ?\r\n 'ZWL' => '&#90;&#36;',\r\n )\r\n );\r\n\r\n $currency_symbol = ( isset( $currencies[$currency_code] ) ? $currencies[$currency_code] : $currency_code );\r\n\r\n return $currency_symbol;\r\n\r\n }", "function __formatCurrency($value)\n {\n if ($this->__init['definitions']['currency_type'] === 'dolar') {\n if (preg_match('/(([0-9]+)\\.([0-9]{1,2}))/', $value)) {\n $value.= 00;\n list($val, $decimal) = explode('.', $value);\n $decimal = substr($decimal, 0, 2);\n return $val . $decimal;\n } else return $value . '00';\n } else if ($this->__init['definitions']['currency_type'] === 'real') {\n if (preg_match('/(([0-9]+)\\,([0-9]{1,2}))/', $value)) {\n $value.= 00;\n list($val, $decimal) = explode(',', $value);\n $decimal = substr($decimal, 0, 2);\n return $val . $decimal;\n } else return $value . '00';\n } else return $value;\n }", "function acadp_get_currency() {\n\n\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\n\treturn strtoupper( $currency );\n\n}", "function acadp_format_amount( $amount, $decimals = true, $currency_settings = array() ) {\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$thousands_sep = ! empty( $currency_settings[ 'thousands_separator' ] ) ? $currency_settings[ 'thousands_separator' ] : ',';\n\t$decimal_sep = ! empty( $currency_settings[ 'decimal_separator' ] ) ? $currency_settings[ 'decimal_separator' ] : '.';\n\n\t// Format the amount\n\tif( $decimal_sep == ',' && false !== ( $sep_found = strpos( $amount, $decimal_sep ) ) ) {\n\t\t$whole = substr( $amount, 0, $sep_found );\n\t\t$part = substr( $amount, $sep_found + 1, ( strlen( $amount ) - 1 ) );\n\t\t$amount = $whole . '.' . $part;\n\t}\n\n\t// Strip , from the amount (if set as the thousands separator)\n\tif( $thousands_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t$amount = str_replace( ',', '', $amount );\n\t}\n\n\t// Strip ' ' from the amount (if set as the thousands separator)\n\tif( $thousands_sep == ' ' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t$amount = str_replace( ' ', '', $amount );\n\t}\n\n\tif( empty( $amount ) ) {\n\t\t$amount = 0;\n\t}\n\n\tif( $decimals ) {\n\t\t$decimals = acadp_currency_decimal_count( 2, $currency );\n\t} else {\n\t\t$decimals = 0;\n\t}\n\n\t$formatted = number_format( $amount, $decimals, $decimal_sep, $thousands_sep );\n\n\treturn apply_filters( 'acadp_format_amount', $formatted, $amount, $decimals, $decimal_sep, $thousands_sep );\n\n}", "function formatcurrency($floatcurr, $curr = \"USD\")\n{\n $currencies['ARS'] = array(2,',','.'); // Argentine Peso\n $currencies['AMD'] = array(2,'.',','); // Armenian Dram\n $currencies['AWG'] = array(2,'.',','); // Aruban Guilder\n $currencies['AUD'] = array(2,'.',' '); // Australian Dollar\n $currencies['BSD'] = array(2,'.',','); // Bahamian Dollar\n $currencies['BHD'] = array(3,'.',','); // Bahraini Dinar\n $currencies['BDT'] = array(2,'.',','); // Bangladesh, Taka\n $currencies['BZD'] = array(2,'.',','); // Belize Dollar\n $currencies['BMD'] = array(2,'.',','); // Bermudian Dollar\n $currencies['BOB'] = array(2,'.',','); // Bolivia, Boliviano\n $currencies['BAM'] = array(2,'.',','); // Bosnia and Herzegovina, Convertible Marks\n $currencies['BWP'] = array(2,'.',','); // Botswana, Pula\n $currencies['BRL'] = array(2,',','.'); // Brazilian Real\n $currencies['BND'] = array(2,'.',','); // Brunei Dollar\n $currencies['CAD'] = array(2,'.',','); // Canadian Dollar\n $currencies['KYD'] = array(2,'.',','); // Cayman Islands Dollar\n $currencies['CLP'] = array(0,'','.'); // Chilean Peso\n $currencies['CNY'] = array(2,'.',','); // China Yuan Renminbi\n $currencies['COP'] = array(2,',','.'); // Colombian Peso\n $currencies['CRC'] = array(2,',','.'); // Costa Rican Colon\n $currencies['HRK'] = array(2,',','.'); // Croatian Kuna\n $currencies['CUC'] = array(2,'.',','); // Cuban Convertible Peso\n $currencies['CUP'] = array(2,'.',','); // Cuban Peso\n $currencies['CYP'] = array(2,'.',','); // Cyprus Pound\n $currencies['CZK'] = array(2,'.',','); // Czech Koruna\n $currencies['DKK'] = array(2,',','.'); // Danish Krone\n $currencies['DOP'] = array(2,'.',','); // Dominican Peso\n $currencies['XCD'] = array(2,'.',','); // East Caribbean Dollar\n $currencies['EGP'] = array(2,'.',','); // Egyptian Pound\n $currencies['SVC'] = array(2,'.',','); // El Salvador Colon\n $currencies['ATS'] = array(2,',','.'); // Euro\n $currencies['BEF'] = array(2,',','.'); // Euro\n $currencies['DEM'] = array(2,',','.'); // Euro\n $currencies['EEK'] = array(2,',','.'); // Euro\n $currencies['ESP'] = array(2,',','.'); // Euro\n $currencies['EUR'] = array(2,',','.'); // Euro\n $currencies['FIM'] = array(2,',','.'); // Euro\n $currencies['FRF'] = array(2,',','.'); // Euro\n $currencies['GRD'] = array(2,',','.'); // Euro\n $currencies['IEP'] = array(2,',','.'); // Euro\n $currencies['ITL'] = array(2,',','.'); // Euro\n $currencies['LUF'] = array(2,',','.'); // Euro\n $currencies['NLG'] = array(2,',','.'); // Euro\n $currencies['PTE'] = array(2,',','.'); // Euro\n $currencies['GHC'] = array(2,'.',','); // Ghana, Cedi\n $currencies['GIP'] = array(2,'.',','); // Gibraltar Pound\n $currencies['GTQ'] = array(2,'.',','); // Guatemala, Quetzal\n $currencies['HNL'] = array(2,'.',','); // Honduras, Lempira\n $currencies['HKD'] = array(2,'.',','); // Hong Kong Dollar\n $currencies['HUF'] = array(0,'','.'); // Hungary, Forint\n $currencies['ISK'] = array(0,'','.'); // Iceland Krona\n $currencies['INR'] = array(2,'.',','); // Indian Rupee\n $currencies['IDR'] = array(2,',','.'); // Indonesia, Rupiah\n $currencies['IRR'] = array(2,'.',','); // Iranian Rial\n $currencies['JMD'] = array(2,'.',','); // Jamaican Dollar\n $currencies['JPY'] = array(0,'',','); // Japan, Yen\n $currencies['JOD'] = array(3,'.',','); // Jordanian Dinar\n $currencies['KES'] = array(2,'.',','); // Kenyan Shilling\n $currencies['KWD'] = array(3,'.',','); // Kuwaiti Dinar\n $currencies['LVL'] = array(2,'.',','); // Latvian Lats\n $currencies['LBP'] = array(0,'',' '); // Lebanese Pound\n $currencies['LTL'] = array(2,',',' '); // Lithuanian Litas\n $currencies['MKD'] = array(2,'.',','); // Macedonia, Denar\n $currencies['MYR'] = array(2,'.',','); // Malaysian Ringgit\n $currencies['MTL'] = array(2,'.',','); // Maltese Lira\n $currencies['MUR'] = array(0,'',','); // Mauritius Rupee\n $currencies['MXN'] = array(2,'.',','); // Mexican Peso\n $currencies['MZM'] = array(2,',','.'); // Mozambique Metical\n $currencies['NPR'] = array(2,'.',','); // Nepalese Rupee\n $currencies['ANG'] = array(2,'.',','); // Netherlands Antillian Guilder\n $currencies['ILS'] = array(2,'.',','); // New Israeli Shekel\n $currencies['TRY'] = array(2,'.',','); // New Turkish Lira\n $currencies['NZD'] = array(2,'.',','); // New Zealand Dollar\n $currencies['NOK'] = array(2,',','.'); // Norwegian Krone\n $currencies['PKR'] = array(2,'.',','); // Pakistan Rupee\n $currencies['PEN'] = array(2,'.',','); // Peru, Nuevo Sol\n $currencies['UYU'] = array(2,',','.'); // Peso Uruguayo\n $currencies['PHP'] = array(2,'.',','); // Philippine Peso\n $currencies['PLN'] = array(2,'.',' '); // Poland, Zloty\n $currencies['GBP'] = array(2,'.',','); // Pound Sterling\n $currencies['OMR'] = array(3,'.',','); // Rial Omani\n $currencies['RON'] = array(2,',','.'); // Romania, New Leu\n $currencies['ROL'] = array(2,',','.'); // Romania, Old Leu\n $currencies['RUB'] = array(2,',','.'); // Russian Ruble\n $currencies['SAR'] = array(2,'.',','); // Saudi Riyal\n $currencies['SGD'] = array(2,'.',','); // Singapore Dollar\n $currencies['SKK'] = array(2,',',' '); // Slovak Koruna\n $currencies['SIT'] = array(2,',','.'); // Slovenia, Tolar\n $currencies['ZAR'] = array(2,'.',' '); // South Africa, Rand\n $currencies['KRW'] = array(0,'',','); // South Korea, Won\n $currencies['SZL'] = array(2,'.',', '); // Swaziland, Lilangeni\n $currencies['SEK'] = array(2,',','.'); // Swedish Krona\n $currencies['CHF'] = array(2,'.','\\''); // Swiss Franc \n $currencies['TZS'] = array(2,'.',','); // Tanzanian Shilling\n $currencies['THB'] = array(2,'.',','); // Thailand, Baht\n $currencies['TOP'] = array(2,'.',','); // Tonga, Paanga\n $currencies['AED'] = array(2,'.',','); // UAE Dirham\n $currencies['UAH'] = array(2,',',' '); // Ukraine, Hryvnia\n $currencies['USD'] = array(2,'.',','); // US Dollar\n $currencies['VUV'] = array(0,'',','); // Vanuatu, Vatu\n $currencies['VEF'] = array(2,',','.'); // Venezuela Bolivares Fuertes\n $currencies['VEB'] = array(2,',','.'); // Venezuela, Bolivar\n $currencies['VND'] = array(0,'','.'); // Viet Nam, Dong\n $currencies['ZWD'] = array(2,'.',' '); // Zimbabwe Dollar\n\n function formatinr($input){\n //CUSTOM FUNCTION TO GENERATE ##,##,###.##\n $dec = \"\";\n $pos = strpos($input, \".\");\n if ($pos === false){\n //no decimals \n } else {\n //decimals\n $dec = substr(round(substr($input,$pos),2),1);\n $input = substr($input,0,$pos);\n }\n $num = substr($input,-3); //get the last 3 digits\n $input = substr($input,0, -3); //omit the last 3 digits already stored in $num\n while(strlen($input) > 0) //loop the process - further get digits 2 by 2\n {\n $num = substr($input,-2).\",\".$num;\n $input = substr($input,0,-2);\n }\n return $num . $dec;\n }\n\n\n if ($curr == \"INR\"){ \n return formatinr($floatcurr);\n } else {\n return number_format($floatcurr,$currencies[$curr][0],$currencies[$curr][1],$currencies[$curr][2]);\n }\n \n\n}", "function carton_date_format() {\n\treturn apply_filters( 'carton_date_format', get_option( 'date_format' ) );\n}", "function format_currency($value, $symbol=true)\r\n{\r\n\r\n\tif(!is_numeric($value))\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t$CI = &get_instance();\r\n\t\r\n\tif($value < 0 )\r\n\t{\r\n\t\t$neg = '- ';\r\n\t} else {\r\n\t\t$neg = '';\r\n\t}\r\n\t\r\n\tif($symbol)\r\n\t{\r\n\t\t$formatted\t= number_format(abs($value), 2,'.', ',');\r\n\t\t\r\n\t\t\t$formatted\t= $neg.'$'.$formatted;\r\n\t}\r\n\telse\r\n\t{\r\n\t\r\n\t\t//traditional number formatting\r\n\t\t$formatted\t= number_format(abs($value), 2, '.', ',');\r\n\t}\r\n\t\r\n\treturn $formatted;\r\n}", "function render_currency_meta() {\n\n\t\t?>\n\t\t<p><label for=\"country_symbol\" style=\"width:145px; margin-top:6px; float:left; display: block\"><?php _e( 'Currency', 'countries' ); ?></label> <input class=\"regular-text\" name=\"country_currency\" value=\"<?php ?>\" /></p>\n\t<?php\n\t}", "function _wpsc_fix_latvia_currency() {\n\t$country = new WPSC_Country( array(\n\t\t'isocode' => 'LV',\n\t\t'currency' => __( 'Euro', 'wpsc' ),\n\t\t'symbol' => __( '€', 'wpsc' ),\n\t\t'symbol_html' => __( '&#8364;', 'wpsc' ),\n\t\t'code' => __( 'EUR', 'wpsc' )\n\t) );\n\n}", "function fetch_currency_with_position($amount,$currency = '')\r\n{\r\n\t$amt_display = '';\r\n\tif($amount==''){ $amount =0; }\r\n\t$decimals=get_option('tmpl_price_num_decimals');\r\n\t$decimals=($decimals!='')?$decimals:2;\r\n\tif($amount >=0 )\r\n\t{\r\n\t\tif(@$amount !='')\r\n\t\t\t$amount = number_format( (float)($amount),$decimals,'.','');\r\n\t\t\t$currency = get_option('currency_symbol');\r\n\t\t\t$position = get_option('currency_pos');\r\n\t\tif($position == '1')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.$amount;\r\n\t\t}\r\n\t\telse if($position == '2')\r\n\t\t{\r\n\t\t\t$amt_display = $currency.' '.$amount;\r\n\t\t}\r\n\t\telse if($position == '3')\r\n\t\t{\r\n\t\t\t$amt_display = $amount.$currency;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$amt_display = $amount.' '.$currency;\r\n\t\t}\r\n\t\treturn apply_filters('tmpl_price_format',$amt_display,$amount,$currency);\r\n\t}\r\n}", "function yourls_number_format_i18n( $number, $decimals = 0 ) {\n\tglobal $yourls_locale_formats;\n\tif( !isset( $yourls_locale_formats ) )\n\t\t$yourls_locale_formats = new YOURLS_Locale_Formats();\n\n\t$formatted = number_format( $number, abs( intval( $decimals ) ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] );\n\treturn yourls_apply_filter( 'number_format_i18n', $formatted );\n}", "function currency_format($amount) {\n\t$amount_ok = number_format($amount,2,',','.');\n\treturn $amount_ok;\n}", "function pms_get_currencies() {\r\n\r\n $currencies = array(\r\n 'USD' => __( 'US Dollar', 'paid-member-subscriptions' ),\r\n 'EUR' => __( 'Euro', 'paid-member-subscriptions' ),\r\n 'GBP' => __( 'Pound Sterling', 'paid-member-subscriptions' ),\r\n 'CAD' => __( 'Canadian Dollar', 'paid-member-subscriptions' ),\r\n 'AUD' => __( 'Australian Dollar', 'paid-member-subscriptions' ),\r\n 'BRL' => __( 'Brazilian Real', 'paid-member-subscriptions' ),\r\n 'CZK' => __( 'Czech Koruna', 'paid-member-subscriptions' ),\r\n 'DKK' => __( 'Danish Krone', 'paid-member-subscriptions' ),\r\n 'HKD' => __( 'Hong Kong Dollar', 'paid-member-subscriptions' ),\r\n 'HUF' => __( 'Hungarian Forint', 'paid-member-subscriptions' ),\r\n 'ILS' => __( 'Israeli New Sheqel', 'paid-member-subscriptions' ),\r\n 'JPY' => __( 'Japanese Yen', 'paid-member-subscriptions' ),\r\n 'MYR' => __( 'Malaysian Ringgit', 'paid-member-subscriptions' ),\r\n 'MXN' => __( 'Mexican Peso', 'paid-member-subscriptions' ),\r\n 'NOK' => __( 'Norwegian Krone', 'paid-member-subscriptions' ),\r\n 'NZD' => __( 'New Zealand Dollar', 'paid-member-subscriptions' ),\r\n 'PHP' => __( 'Philippine Peso', 'paid-member-subscriptions' ),\r\n 'PLN' => __( 'Polish Zloty', 'paid-member-subscriptions' ),\r\n 'RUB' => __( 'Russian Ruble', 'paid-member-subscriptions' ),\r\n 'SGD' => __( 'Singapore Dollar', 'paid-member-subscriptions' ),\r\n 'SEK' => __( 'Swedish Krona', 'paid-member-subscriptions' ),\r\n 'CHF' => __( 'Swiss Franc', 'paid-member-subscriptions' ),\r\n 'TWD' => __( 'Taiwan New Dollar', 'paid-member-subscriptions' ),\r\n 'THB' => __( 'Thai Baht', 'paid-member-subscriptions' ),\r\n 'TRY' => __( 'Turkish Lira', 'paid-member-subscriptions' )\r\n );\r\n\r\n return apply_filters( 'pms_currencies', $currencies );\r\n\r\n }", "function formatCurrency($number, $decimals = 2, $currency = 'Ksh')\n{\n return $currency . \" \" . format_num($number, $decimals, '.', ',');\n}", "function opaljob_price_format_position() {\n global $opaljob_options;\n $currency_pos = opaljob_options('currency_position','before');\n\n $format = '%1$s%2$s';\n switch ( $currency_pos ) {\n case 'before' :\n $format = '%1$s%2$s';\n break;\n case 'after' :\n $format = '%2$s%1$s';\n break;\n case 'left_space' :\n $format = '%1$s&nbsp;%2$s';\n break;\n case 'right_space' :\n $format = '%2$s&nbsp;%1$s';\n break;\n }\n\n return apply_filters( 'opaljob_price_format_position', $format, $currency_pos );\n}", "function format_price($price, string $currency = null)\n{\n return sprintf(\n config('vanilo.framework.currency.format'),\n $price,\n $currency ?? config('vanilo.framework.currency.sign')\n );\n}", "protected function setInitCurrencyFormatter(){\n # $fmt = new NumberFormatter('en_US', NumberFormatter::CURRENCY);\n $fmt = new NumberFormatter('en_US', NumberFormatter::DECIMAL );\n $fmt->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS ,2 );\n # $fmt->setAttribute(NumberFormatter::MAX_SIGNIFICANT_DIGITS ,25 );\n #$fmt->setAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL ,'.');\n $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS,100); #// by default some locales got max 2 fraction digits, so if there are more digi fractions these will be dropped\n $this->currencyFormatter=$fmt;\n }", "function formatPrice($price){\n$explodePrice = explode('.', $price);\n\nreturn $explodePrice[0]. '<span class =\"card-price-cents\">€'. $explodePrice[1]. '</span>';\n\n}", "public function formatCurrency($amount);", "function currencyFormat($inputID)\n\t{\n\t\t\n\t\tsetlocale(LC_MONETARY,\"en_US\");\n\t\treturn money_format('%i', $inputID) .\"\\n\";\n\t}", "function format_price($amount, $return_empty=FALSE)\n{\n\t$string = '';\n\tif($return_empty===FALSE and empty($amount))\n\t{\n\t\treturn FALSE;\n\t}\n\t\n\tif(ci_setting('price_currency'))\n\t{\n\t\tif(ci_setting('currency_position')=='before')\n\t\t{\n\t\t\treturn ci_setting('price_currency') . $amount;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $amount . ci_setting('price_currency');\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn $amount;\n\t}\n}", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "function format_money($amount) {\r\n // prefixes the result with 'GBP', we remove that here.\r\n return substr(money_format(\"%.0i\", $amount), 3);\r\n}", "static function currency_format_en($value) {\n $value = number_format($value, 2, '.', ',');\n $value = str_replace('.00', '', $value);\n return $value;\n }", "function acadp_sanitize_amount( $amount, $currency_settings = array() ) {\n\n\t$is_negative = false;\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$thousands_sep = ! empty( $currency_settings[ 'thousands_separator' ] ) ? $currency_settings[ 'thousands_separator' ] : ',';\n\t$decimal_sep = ! empty( $currency_settings[ 'decimal_separator' ] ) ? $currency_settings[ 'decimal_separator' ] : '.';\n\n\t// Sanitize the amount\n\tif( $decimal_sep == ',' && false !== ( $found = strpos( $amount, $decimal_sep ) ) ) {\n\t\tif( ( $thousands_sep == '.' || $thousands_sep == ' ' ) && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t\t} else if( empty( $thousands_sep ) && false !== ( $found = strpos( $amount, '.' ) ) ) {\n\t\t\t$amount = str_replace( '.', '', $amount );\n\t\t}\n\n\t\t$amount = str_replace( $decimal_sep, '.', $amount );\n\t} else if( $thousands_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t}\n\n\tif( $amount < 0 ) {\n\t\t$is_negative = true;\n\t}\n\n\t$amount = preg_replace( '/[^0-9\\.]/', '', $amount );\n\t$decimals = acadp_currency_decimal_count( 2, $currency );\n\t$amount = number_format( (double) $amount, $decimals, '.', '' );\n\n\tif( $is_negative ) {\n\t\t$amount *= -1;\n\t}\n\n\treturn apply_filters( 'acadp_sanitize_amount', $amount );\n\n}", "function ppom_price( $price ) {\n\t\n\t$price\t\t\t\t\t= floatval($price);\n\t\n\t$decimal_separator\t\t= wc_get_price_decimal_separator();\n\t$thousand_separator\t\t= wc_get_price_thousand_separator();\n\t$decimals\t\t\t\t= wc_get_price_decimals();\n\t$price_format\t\t\t= get_woocommerce_price_format();\n\t$negative \t\t= $price < 0;\n\t\n\t// $wc_price = number_format( $price,$decimals, $decimal_separator, $thousand_separator );\n\t$wc_price = number_format( abs($price), $decimals, $decimal_separator, $thousand_separator );\n\t$formatted_price = ( $negative ? '-' : '' ) . sprintf( $price_format, get_woocommerce_currency_symbol(), $wc_price );\n\treturn apply_filters('ppom_woocommerce_price', $formatted_price);\n}", "function acadp_currency_symbol( $currency = '' ) {\n\n\tswitch( $currency ) {\n\t\tcase \"GBP\" :\n\t\t\t$symbol = '&pound;';\n\t\t\tbreak;\n\t\tcase \"BRL\" :\n\t\t\t$symbol = 'R&#36;';\n\t\t\tbreak;\n\t\tcase \"EUR\" :\n\t\t\t$symbol = '&euro;';\n\t\t\tbreak;\n\t\tcase \"USD\" :\n\t\tcase \"AUD\" :\n\t\tcase \"NZD\" :\n\t\tcase \"CAD\" :\n\t\tcase \"HKD\" :\n\t\tcase \"MXN\" :\n\t\tcase \"SGD\" :\n\t\t\t$symbol = '&#36;';\n\t\t\tbreak;\n\t\tcase \"JPY\" :\n\t\t\t$symbol = '&yen;';\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$symbol = $currency;\n\t\t\tbreak;\n\t}\n\n\treturn apply_filters( 'acadp_currency_symbol', $symbol, $currency );\n\n}", "function product_options_countries_prices() {\r\n\r\n\t\t\tif ( count( TFLS()->get_regions() ) ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<div class=\"options_group show_if_simple show_if_external wc-metaboxes-wrapper\"\r\n\t\t\t\t style=\"margin-bottom: 25px;\">\r\n\t\t\t\t\t<p class=\"toolbar\">\r\n\t\t\t\t\t\t<a href=\"#\" class=\"close_all\"><?php _e( 'Close all', 'woocommerce' ); ?></a><a href=\"#\"\r\n\t\t\t\t\t\t class=\"expand_all\"><?php _e( 'Expand all', 'woocommerce' ); ?></a>\r\n\t\t\t\t\t\t<strong>Price Based on Country</strong>\r\n\t\t\t\t\t</p>\r\n\r\n\t\t\t\t\t<div class=\"wc-metaboxes\">\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\tforeach ( TFLS()->get_regions() as $key => $value ) {\r\n\r\n\t\t\t\t\t\t\t$_placeholder = '';\r\n\t\t\t\t\t\t\t$_description = '';\r\n\r\n\t\t\t\t\t\t\tif ( ! empty( $value['empty_price_method'] ) ) {\r\n\r\n\t\t\t\t\t\t\t\t$_placeholder = __( 'Auto', 'woocommerce-tfls' );\r\n\t\t\t\t\t\t\t\t$_description = '<span class=\"description\">' . __( 'Leave blank to apply the specified exchange rate.', 'woocommerce-tfls' ) . '</span>';\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<div class=\"wc-metabox\">\r\n\t\t\t\t\t\t\t\t<h3>\r\n\t\t\t\t\t\t\t\t\t<div class=\"handlediv\"\r\n\t\t\t\t\t\t\t\t\t title=\"<?php _e( 'Click to toggle', 'woocommerce' ); ?>\"></div>\r\n\t\t\t\t\t\t\t\t\t<strong\r\n\t\t\t\t\t\t\t\t\t\tclass=\"\"><?php echo __( 'Price for', 'woocommerce-tfls' ) . ' ' . $value['name']; ?></strong>\r\n\t\t\t\t\t\t\t\t</h3>\r\n\t\t\t\t\t\t\t\t<div class=\"wc-metabox-content\">\r\n\t\t\t\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\" class=\"\">\r\n\t\t\t\t\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<label\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"margin:0px;\"><?php echo __( 'Regular Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol( $value['currency'] ) . ')'; ?></label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"<?php echo '_' . $key . '_price'; ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t name=\"<?php echo '_' . $key . '_price'; ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t value=\"<?php echo wc_format_localized_price( get_post_meta( get_the_ID(), '_' . $key . '_price', true ) ); ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t class=\"short wc_input_price\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t placeholder=\"<?php echo $_placeholder; ?>\"/><?php echo $_description; ?>\r\n\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<label\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle=\"margin:0px;\"><?php echo __( 'Sale Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol( $value['currency'] ) . ')'; ?></label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"<?php echo '_' . $key . '_sale_price'; ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t name=\"<?php echo '_' . $key . '_sale_price'; ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t value=\"<?php echo wc_format_localized_price( get_post_meta( get_the_ID(), '_' . $key . '_sale_price', true ) ); ?>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t class=\"short wc_input_price TFLS_sale_price\"/>\r\n\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<label style=\"margin:0px;\"><?php echo __( 'Wholesale Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol( $value['currency'] ) . ')'; ?></label>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" id=\"<?php echo '_' . $key . '_wholesale_price'; ?>\" name=\"<?php echo '_' . $key . '_wholesale_price'; ?>\" value=\"<?php echo wc_format_localized_price( get_post_meta( get_the_ID(), '_' . $key . '_wholesale_price', true ) ); ?>\" class=\"short wc_input_price TFLS_sale_price\" />\r\n\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t?>\r\n\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t<?php\r\n\t\t\t}\r\n\t\t}", "function number_format( $price, $decimals = 2 ) {\n return number_format_i18n( floatval($price), $decimals );\n }", "function getWithCurrency($amount, $decimals = 2)\n{\n return FormatNumber($amount, $decimals) . \\Config::get('website.currency');\n}", "public function organique_price_filter_init() {\n\t\t\t\tif ( is_active_widget( false, false, 'organique_price_filter', true ) && ! is_admin() ) {\n\n\t\t\t\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\n\t\t\t\t\twp_register_script( 'wc-price-slider', WC()->plugin_url() . '/assets/js/frontend/price-slider' . $suffix . '.js', array( 'jquery-ui-slider' ), WC_VERSION, true );\n\n\t\t\t\t\twp_localize_script( 'wc-price-slider', 'woocommerce_price_slider_params', array(\n\t\t\t\t\t\t'currency_symbol' => get_woocommerce_currency_symbol(),\n\t\t\t\t\t\t'currency_pos' => get_option( 'woocommerce_currency_pos' ),\n\t\t\t\t\t\t'min_price' => isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : '',\n\t\t\t\t\t\t'max_price' => isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : ''\n\t\t\t\t\t) );\n\n\t\t\t\t\tadd_filter( 'loop_shop_post_in', array( $this, 'price_filter' ) );\n\t\t\t\t}\n\t\t\t}", "function format_price($number)\n{\n return number_format($number, 0, '', '&thinsp;');\n}", "public static function formatCurrencyUsing($callback)\n {\n static::$formatCurrencyUsing = $callback;\n }", "function add_text_before_price_html( $price ) {\n\tif ( ! is_admin() ) {\n\t\t$price = '<span class=\"text_price\">' . __('Price','shtheme') . ':</span> ' . $price;\n\t}\n\treturn $price;\n}", "function price () {\n global $value;\n $pricefloat = ceil($value['price']);\n\n if ($pricefloat <= 999) {\n echo $pricefloat;\n } elseif ($pricefloat >= 1000) {\n $num_format = number_format($pricefloat, 0, '.', ' ');\n echo $num_format . \" &#8381;\";\n }\n }", "function es_custom_product_filters( $output ) {\n\tglobal $wp_query;\n\t\n\tforeach ( $wp_query->query_vars['meta_query'] as $key => $value ) {\n\t\tif ( $value['key'] == '_backorders' ) {\n\t\t\t$current_backorders_value = isset( $value['value'] ) ? $value['value'] : '';\n\t\t}\n\t\telseif ( $value['key'] == 'member_price' ) {\n\t\t\t$curent_price_value = isset( $value['value'] ) ? $value['value'] : '';\n\t\t\t$current_price_key = $value['key'];\n\t\t}\n\t\telseif ( $value['key'] == '_sale_price' ) {\n\t\t\t$curent_price_value = isset( $value['value'] ) ? $value['value'] : '';\n\t\t\t$current_price_key = $value['key'];\n\t\t}\n\t}\n\t\n\t//$current_backorders_value = isset( $wp_query->query_vars['meta_value'] ) ? $wp_query->query_vars['meta_value'] : '';\n\t\n\t$output .= '<select id=\"allow-backorders-filter\" class=\"backorders\" name=\"allow_backorders_filter\">';\n\t$output .= '<option value=\"\" ' . selected( $current_backorders_value, '', false ) . '>' . __( 'Allow backorders?', 'woocommerce' ) . '</option>';\n\t//<option selected=\"selected\" value=\"\">Allow backorders?</option>';\n\n\t$options = array(\n\t\t'no' => __( 'Do not allow', 'woocommerce' ),\n\t\t'notify' => __( 'Allow, but notify customer', 'woocommerce' ),\n\t\t'yes' => __( 'Allow', 'woocommerce' )\n\t);\n\t\n\tforeach ( $options as $key => $value ) {\n\t\t$output .= '<option value=\"' . esc_attr( $key ) . '\"' . selected( $current_backorders_value, $key, false ) . '>'. $value .'</option>';\n\t}\n\t\n\t$output .= '</select>';\n\t\n\t$output .='<select id=\"price-filter\" class=\"\" name=\"price_filter\">\n\t\t\t\t<option value=\"\" ' . selected( $curent_price_value, '', false ) . '>Show All Prices</option>\n\t\t\t\t<option value=\"member-price\" ' . selected( $current_price_key, 'member_price', false ) . '>Member Prices</option>\n\t\t\t\t<option value=\"sale-price\" ' . selected( $current_price_key, '_sale_price', false ) . '>Sale Prices</option>\n\t\t\t\t</select>';\n\t\n\treturn $output;\n}", "public function formatPrice($value)\n\t{\n\t\treturn Mage::getSingleton('adminhtml/session_quote')->getStore()->formatPrice($value);\n\t}", "function init () {\n // Register the admin screen.\n add_action( 'admin_menu', array( &$this, 'register_admin_screen' ), 20 );\n \n $shortname = 'colabs';\n $options_gateways = array(); \n $currencies = colabs_get_currencies();\n foreach ($currencies as $key => $currency):\n $options_currency[$key] = $currency['name'].' ('.$currency['symbol'].')'; \n endforeach;\n $currency_symbol = colabs_get_currency_symbol(get_option('colabs_currency_code'));\n $options_gateways[] = array( \n \"name\" => __( 'Payments General', 'colabsthemes' ),\n \"icon\" => \"general\",\n \"type\" => \"heading\"); \n\n $options_gateways[] = array( \n \"name\" => __( 'Currency', 'colabsthemes' ),\n \"desc\" => sprintf( __(\"This is the currency you want to collect payments in. It applies mainly to PayPal payments since other payment gateways accept more currencies. If your currency is not listed then PayPal currently does not support it. See the list of supported <a target='_new' href='%s'>PayPal currencies</a>.\", 'colabsthemes'), 'https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside' ),\n \"id\" => $shortname.\"_currency_code\",\n \"options\" => $options_currency,\n \"type\" => \"select2\"); \n \n $options_gateways[] = array( \n \"name\" => __( \"Symbol Position\", \"colabsthemes\" ),\n \"desc\" => __( \"Some currencies place the symbol on the right side vs the left. Select how you would like your currency symbol to be displayed.\", \"colabsthemes\" ),\n \"id\" => $shortname.\"_currency_position\",\n \"std\" => \"left\",\n \"type\" => \"select2\",\n \"options\" => array( 'left' => sprintf(__('Left of Currency (%s100)', 'colabsthemes'),$currency_symbol),\n 'left_space' => sprintf(__('Left of Currency with Space (%s 100)', 'colabsthemes'),$currency_symbol),\n 'right' => sprintf(__('Right of Currency (100%s)', 'colabsthemes'),$currency_symbol),\n 'right_space' => sprintf(__('Right of Currency with Space (100 %s)', 'colabsthemes'),$currency_symbol)\n ) ); \n \n $this->default_options_gateways = $options_gateways;\n }", "function couponxl_format_price_number( $price ){\n\n\tif( !is_numeric( $price ) ){\n\t\treturn $price;\n\t}\n\t$unit_position = couponxl_get_option( 'unit_position' );\n\t$unit = '₹';\n\n\tif( $unit_position == 'front' ){\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n\telse{\n\t\treturn $unit.number_format( $price, 2 );\n\t}\n}", "public function foodbakery_general_settings() {\n\t\t\tglobal $foodbakery_settings, $foodbakery_plugin_options;\n $base_currency = isset( $foodbakery_plugin_options['foodbakery_base_currency'] ) ? $foodbakery_plugin_options['foodbakery_base_currency'] : 'USD';\n\t\t\t$currencies = array();\n\t\t\t$foodbakery_currencuies = foodbakery_get_currencies();\n\t\t\tif ( is_array($foodbakery_currencuies) ) {\n\t\t\t\tforeach ( $foodbakery_currencuies as $key => $value ) {\n\t\t\t\t\t$currencies[$key] = $value['name'] . '-' . $value['code'];\n\t\t\t\t}\n\t\t\t}\n $foodbakery_settings[] = array( \"name\" => esc_html__(\"Base Currency\", \"foodbakery\"),\n\t\t\t\t\"desc\" => \"\",\n\t\t\t\t\"hint_text\" => esc_html__(\"All the transactions will be placed in this currency.\", \"foodbakery\"),\n\t\t\t\t\"id\" => \"base_currency\",\n\t\t\t\t\"std\" => \"USD\",\n\t\t\t\t'classes' => 'dropdown chosen-select-no-single base-currency-change',\n\t\t\t\t\"type\" => \"select_values\",\n\t\t\t\t\"options\" => $currencies\n\t\t\t);\n\n $foodbakery_settings[] = array(\n \"name\" => esc_html__(\"Currency Alignment\", \"foodbakery\"),\n \"desc\" => \"\",\n \"id\" => \"currency_alignment\",\n \"std\" => \"Left\",\n 'classes' => 'dropdown chosen-select-no-single',\n \"type\" => \"select\",\n \"custom\" => true,\n \"options\" => array('Left' => 'Left', 'Right' => 'Right'),\n );\n\t\t\t\n /*$all_currencies = foodbakery_all_currencies_array( $base_currency );\n $foodbakery_settings[] = array( \"name\" => esc_html__(\"Select Currency\", \"foodbakery\"),\n\t\t\t\t\"desc\" => \"\",\n\t\t\t\t\"hint_text\" => esc_html__(\"Overall website currency to show the prices. The payments will be processed in Base Currency.\", \"foodbakery\"),\n\t\t\t\t\"id\" => \"currency_id\",\n\t\t\t\t\"std\" => \"USD\",\n\t\t\t\t'classes' => 'dropdown chosen-select-no-single ',\n\t\t\t\t\"type\" => \"select_values\",\n\t\t\t\t\"options\" => $all_currencies\n\t\t\t);*/\n\t\t\treturn $foodbakery_settings;\n\t\t}", "function money($price,$decimals = 2)\n {\n return number_format($price,$decimals);\n }", "public function getCurrency(): string;", "public function getCurrency(): string;", "function convert_price_default_currency($price,$rate=1)\n{\n\treturn sprintf('%0.2f',($price/$rate));\n}", "function pms_get_active_currency() {\r\n\r\n $settings = get_option( 'pms_payments_settings' );\r\n\r\n return !empty( $settings['currency'] ) ? $settings['currency'] : 'USD';\r\n\r\n }", "protected function currency_switcher() {\n\t\treturn WC_Aelia_CurrencySwitcher::instance();\n\t}", "function ndf_category_5_filter_settings_callback() {\n\techo '<p></p>';\n}", "public function format() {\n\t\treturn elgg_echo('payments:price', [$this->getConvertedAmount(), $this->getCurrency()]);\n\t}", "static function currency_format($value) {\n $value = number_format($value, 2, ',', '.');\n $value = str_replace(',00', '', $value);\n return $value;\n }", "public static function getSiteCurrency(){\n return 'SAR';\n }", "function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}", "function format_price($price)\n{\n $price = number_format(ceil($price), 0, \".\", \" \");\n return $price . \" \" . \"₽\";\n}", "function cjpopups_currency($symbol = '$', $amount = null, $align = 'left'){\n\t$amount = number_format($amount, 2);\n\t$return = ($align == 'left') ? $symbol.' '.$amount : $amount.' '.$symbol;\n\treturn $return;\n}", "function formatPrice2($price)\n{\n\t$price = @number_format($price, 2, '.', ' '); // Igor\n\treturn $price;\n}", "function getCurrencyRates() {\n\t// If you change these, make sure to also update any JS validation scripts\n\t// For now I'm not rounding numbers under 1 because I don't think that's a big issue and could cause issues with the max check.\n\t$currencyRates = array(\n\t\t'AED' => '4',\n\t\t'ARS' => '4',\n\t\t'AUD' => '1',\n\t\t'BBD' => '2',\n\t\t'BDT' => '76',\n\t\t'BGN' => '1',\n\t\t'BHD' => '0.4',\n\t\t'BMD' => '1',\n\t\t'BND' => '1',\n\t\t'BOB' => '7',\n\t\t'BRL' => '2',\n\t\t'BSD' => '1',\n\t\t'BZD' => '2',\n\t\t'CAD' => '1',\n\t\t'CHF' => '0.9',\n\t\t'CLP' => '494',\n\t\t'CNY' => '6',\n\t\t'COP' => '1910',\n\t\t'CRC' => '512',\n\t\t'CZK' => '18',\n\t\t'DKK' => '5',\n\t\t'DOP' => '38',\n\t\t'DZD' => '73',\n\t\t'EEK' => '11',\n\t\t'EGP' => '6',\n\t\t'EUR' => '0.7',\n\t\t'GBP' => '0.6',\n\t\t'GTQ' => '8',\n\t\t'HKD' => '8',\n\t\t'HNL' => '19',\n\t\t'HRK' => '5',\n\t\t'HUF' => '219',\n\t\t'IDR' => '8960',\n\t\t'ILS' => '4',\n\t\t'INR' => '49',\n\t\t'JMD' => '85',\n\t\t'JOD' => '0.7',\n\t\t'JPY' => '78',\n\t\t'KES' => '97',\n\t\t'KRW' => '1127',\n\t\t'KYD' => '0.8',\n\t\t'KZT' => '147',\n\t\t'LBP' => '1500',\n\t\t'LKR' => '110',\n\t\t'LTL' => '2',\n\t\t'LVL' => '0.5',\n\t\t'MAD' => '8',\n\t\t'MKD' => '45',\n\t\t'MUR' => '29',\n\t\t'MVR' => '15',\n\t\t'MXN' => '13',\n\t\t'MYR' => '3',\n\t\t'NOK' => '5',\n\t\t'NZD' => '1',\n\t\t'OMR' => '0.3',\n\t\t'PAB' => '1',\n\t\t'PEN' => '3',\n\t\t'PHP' => '43',\n\t\t'PKR' => '86',\n\t\t'PLN' => '3',\n\t\t'PYG' => '4190',\n\t\t'QAR' => '4',\n\t\t'RON' => '3',\n\t\t'RUB' => '30',\n\t\t'SAR' => '4',\n\t\t'SEK' => '6',\n\t\t'SGD' => '1',\n\t\t'SVC' => '9',\n\t\t'THB' => '30',\n\t\t'TJS' => '5',\n\t\t'TND' => '1',\n\t\t'TRY' => '2',\n\t\t'TTD' => '6',\n\t\t'TWD' => '30',\n\t\t'UAH' => '8',\n\t\t'USD' => '1',\n\t\t'UYU' => '19',\n\t\t'UZS' => '1760',\n\t\t'VND' => '21000',\n\t\t'XAF' => '470',\n\t\t'XCD' => '3',\n\t\t'XOF' => '476',\n\t\t'ZAR' => '8',\n\t);\n\t\n\treturn $currencyRates;\n}", "public function save_currency() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_save_popup_currency\" );\n\n\t\tupdate_option( \"forminator_currency\", sanitize_text_field( $_POST['currency'] ) );\n\t\twp_send_json_success();\n\t}", "function __give_sanitize_number_decimals_setting_field( $value ) {\n\t$value_changed = false;\n\t$show_notice = false;\n\t$old_value = $value;\n\n\tif ( isset( $_POST['decimal_separator'] ) ) {\n\t\t$value = ! empty( $_POST['decimal_separator'] ) ? $value : 0;\n\t\t$value_changed = true;\n\t}\n\n\tif ( $value_changed && ( $old_value !== $value ) ) {\n\t\tGive_Admin_Settings::add_error( 'give-number-decimal', __( 'The \\'Number of Decimals\\' option has been automatically set to zero because the \\'Decimal Separator\\' is not set.', 'give' ) );\n\t}\n\n\t$value = absint( $value );\n\t$is_currency_set_to_bitcoin = ( 'BTC' === give_get_option( 'currency' ) && ! isset( $_POST['currency'] ) ) || 'BTC' === $_POST['currency'];\n\n\tif ( $is_currency_set_to_bitcoin && 8 < $value) {\n\t\t$value = 8;\n\t\t$show_notice = true;\n\t}elseif ( ! $is_currency_set_to_bitcoin && 6 <= $value ) {\n\t\t$value = 5;\n\t\t$show_notice = true;\n\t}\n\n\tif( $show_notice ) {\n\t\tGive_Admin_Settings::add_error(\n\t\t\t'give-number-decimal',\n\t\t\tsprintf(\n\t\t\t\t__( 'The \\'Number of Decimals\\' option has been automatically set to %s because you entered a number higher than the maximum allowed.', 'give' ),\n\t\t\t\t$value\n\t\t\t)\n\t\t);\n\t}\n\n\treturn absint( $value );\n}", "function formatRawAmount($amount, $curr) {\n $dblAmount = $amount + 0.0;\n\n // Build Currency format table\n $curFormat = Array();\n $curFormat[\"020\"]=0;\n $curFormat[\"784\"]=2;\n $curFormat[\"044\"]=2;\n $curFormat[\"004\"]=2;\n $curFormat[\"008\"]=2;\n $curFormat[\"051\"]=2;\n $curFormat[\"532\"]=2;\n $curFormat[\"024\"]=2;\n $curFormat[\"032\"]=2;\n $curFormat[\"040\"]=2;\n $curFormat[\"036\"]=2;\n $curFormat[\"533\"]=2;\n $curFormat[\"031\"]=2;\n $curFormat[\"977\"]=2;\n $curFormat[\"052\"]=2;\n $curFormat[\"050\"]=2;\n $curFormat[\"056\"]=0;\n $curFormat[\"100\"]=2;\n $curFormat[\"048\"]=3;\n $curFormat[\"108\"]=0;\n $curFormat[\"060\"]=2;\n $curFormat[\"096\"]=2;\n $curFormat[\"068\"]=2;\n $curFormat[\"986\"]=2;\n $curFormat[\"064\"]=2;\n $curFormat[\"072\"]=2;\n $curFormat[\"974\"]=0;\n $curFormat[\"084\"]=2;\n $curFormat[\"124\"]=2;\n $curFormat[\"976\"]=2;\n $curFormat[\"756\"]=2;\n $curFormat[\"152\"]=0;\n $curFormat[\"156\"]=2;\n $curFormat[\"170\"]=2;\n $curFormat[\"188\"]=2;\n $curFormat[\"192\"]=2;\n $curFormat[\"132\"]=2;\n $curFormat[\"196\"]=2;\n $curFormat[\"203\"]=2;\n $curFormat[\"276\"]=2;\n $curFormat[\"262\"]=0;\n $curFormat[\"208\"]=2;\n $curFormat[\"214\"]=2;\n $curFormat[\"012\"]=2;\n $curFormat[\"233\"]=2;\n $curFormat[\"818\"]=2;\n $curFormat[\"232\"]=2;\n $curFormat[\"230\"]=2;\n $curFormat[\"978\"]=2;\n $curFormat[\"246\"]=2;\n $curFormat[\"242\"]=2;\n $curFormat[\"238\"]=2;\n $curFormat[\"250\"]=2;\n $curFormat[\"826\"]=2;\n $curFormat[\"981\"]=2;\n $curFormat[\"288\"]=2;\n $curFormat[\"292\"]=2;\n $curFormat[\"270\"]=2;\n $curFormat[\"324\"]=0;\n $curFormat[\"320\"]=2;\n $curFormat[\"624\"]=2;\n $curFormat[\"328\"]=2;\n $curFormat[\"344\"]=2;\n $curFormat[\"340\"]=2;\n $curFormat[\"191\"]=2;\n $curFormat[\"332\"]=2;\n $curFormat[\"348\"]=2;\n $curFormat[\"360\"]=2;\n $curFormat[\"372\"]=2;\n $curFormat[\"376\"]=2;\n $curFormat[\"356\"]=2;\n $curFormat[\"368\"]=3;\n $curFormat[\"364\"]=2;\n $curFormat[\"352\"]=2;\n $curFormat[\"380\"]=0;\n $curFormat[\"388\"]=2;\n $curFormat[\"400\"]=3;\n $curFormat[\"392\"]=0;\n $curFormat[\"404\"]=2;\n $curFormat[\"417\"]=2;\n $curFormat[\"116\"]=2;\n $curFormat[\"174\"]=0;\n $curFormat[\"408\"]=2;\n $curFormat[\"410\"]=0;\n $curFormat[\"414\"]=3;\n $curFormat[\"136\"]=2;\n $curFormat[\"398\"]=2;\n $curFormat[\"418\"]=2;\n $curFormat[\"422\"]=2;\n $curFormat[\"144\"]=2;\n $curFormat[\"430\"]=2;\n $curFormat[\"426\"]=2;\n $curFormat[\"440\"]=2;\n $curFormat[\"442\"]=0;\n $curFormat[\"428\"]=2;\n $curFormat[\"434\"]=3;\n $curFormat[\"504\"]=2;\n $curFormat[\"498\"]=2;\n $curFormat[\"450\"]=0;\n $curFormat[\"807\"]=2;\n $curFormat[\"104\"]=2;\n $curFormat[\"496\"]=2;\n $curFormat[\"446\"]=2;\n $curFormat[\"478\"]=2;\n $curFormat[\"470\"]=2;\n $curFormat[\"480\"]=2;\n $curFormat[\"462\"]=2;\n $curFormat[\"454\"]=2;\n $curFormat[\"484\"]=2;\n $curFormat[\"458\"]=2;\n $curFormat[\"508\"]=2;\n $curFormat[\"516\"]=2;\n $curFormat[\"566\"]=2;\n $curFormat[\"558\"]=2;\n $curFormat[\"528\"]=2;\n $curFormat[\"578\"]=2;\n $curFormat[\"524\"]=2;\n $curFormat[\"554\"]=2;\n $curFormat[\"512\"]=3;\n $curFormat[\"590\"]=2;\n $curFormat[\"604\"]=2;\n $curFormat[\"598\"]=2;\n $curFormat[\"608\"]=2;\n $curFormat[\"586\"]=2;\n $curFormat[\"985\"]=2;\n $curFormat[\"620\"]=0;\n $curFormat[\"600\"]=0;\n $curFormat[\"634\"]=2;\n $curFormat[\"642\"]=2;\n $curFormat[\"643\"]=2;\n $curFormat[\"810\"]=2;\n $curFormat[\"646\"]=0;\n $curFormat[\"682\"]=2;\n $curFormat[\"090\"]=2;\n $curFormat[\"690\"]=2;\n $curFormat[\"736\"]=2;\n $curFormat[\"752\"]=2;\n $curFormat[\"702\"]=2;\n $curFormat[\"654\"]=2;\n $curFormat[\"705\"]=2;\n $curFormat[\"703\"]=2;\n $curFormat[\"694\"]=2;\n $curFormat[\"706\"]=2;\n $curFormat[\"740\"]=2;\n $curFormat[\"678\"]=2;\n $curFormat[\"222\"]=2;\n $curFormat[\"760\"]=2;\n $curFormat[\"748\"]=2;\n $curFormat[\"764\"]=2;\n $curFormat[\"972\"]=2;\n $curFormat[\"795\"]=2;\n $curFormat[\"788\"]=3;\n $curFormat[\"776\"]=2;\n $curFormat[\"626\"]=0;\n $curFormat[\"792\"]=0;\n $curFormat[\"780\"]=2;\n $curFormat[\"901\"]=2;\n $curFormat[\"834\"]=2;\n $curFormat[\"980\"]=2;\n $curFormat[\"800\"]=2;\n $curFormat[\"840\"]=2;\n $curFormat[\"858\"]=2;\n $curFormat[\"860\"]=2;\n $curFormat[\"862\"]=2;\n $curFormat[\"704\"]=2;\n $curFormat[\"548\"]=0;\n $curFormat[\"882\"]=2;\n $curFormat[\"950\"]=0;\n $curFormat[\"951\"]=2;\n $curFormat[\"952\"]=0;\n $curFormat[\"953\"]=0;\n $curFormat[\"886\"]=2;\n $curFormat[\"891\"]=2;\n $curFormat[\"710\"]=2;\n $curFormat[\"894\"]=2;\n $curFormat[\"716\"]=2;\n\n $digCurr = $this->getISOCurrency(\"\" . $curr);\n $exponent = $curFormat[$digCurr];\n\n\n\n $strAmount = \"\" . Round($dblAmount, $exponent);\n $strRetVal = \"\" . $strAmount;\n\n // decimal position\n $curpos = strpos($strRetVal, \".\");\n\n // Pad with zeros\n if($curpos == true) {\n $padCount = $exponent - (strlen($strRetVal) - $curpos - 1);\n for($i=0;$i<$padCount;$i++) {\n $strRetVal .= \"0\";\n }\n }\n else {\n $padCount = $exponent;\n for($i=0;$i<$padCount;$i++) {\n $strRetVal .= \"0\";\n }\n }\n\n if($curpos !== false) {\n $strRetVal = substr($strRetVal, 0, $curpos) . substr($strRetVal, $curpos+1);\n }\n return $strRetVal;\n }", "function get_ffd_currencies() {\r\n\tstatic $currencies;\r\n\r\n\tif ( ! isset( $currencies ) ) {\r\n\t\t$currencies = array_unique(\r\n\t\t\tapply_filters(\r\n\t\t\t\t'ffd_currencies',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'AED' => __( 'United Arab Emirates dirham', 'ffd-integration' ),\r\n\t\t\t\t\t'AFN' => __( 'Afghan afghani', 'ffd-integration' ),\r\n\t\t\t\t\t'ALL' => __( 'Albanian lek', 'ffd-integration' ),\r\n\t\t\t\t\t'AMD' => __( 'Armenian dram', 'ffd-integration' ),\r\n\t\t\t\t\t'ANG' => __( 'Netherlands Antillean guilder', 'ffd-integration' ),\r\n\t\t\t\t\t'AOA' => __( 'Angolan kwanza', 'ffd-integration' ),\r\n\t\t\t\t\t'ARS' => __( 'Argentine peso', 'ffd-integration' ),\r\n\t\t\t\t\t'AUD' => __( 'Australian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'AWG' => __( 'Aruban florin', 'ffd-integration' ),\r\n\t\t\t\t\t'AZN' => __( 'Azerbaijani manat', 'ffd-integration' ),\r\n\t\t\t\t\t'BAM' => __( 'Bosnia and Herzegovina convertible mark', 'ffd-integration' ),\r\n\t\t\t\t\t'BBD' => __( 'Barbadian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BDT' => __( 'Bangladeshi taka', 'ffd-integration' ),\r\n\t\t\t\t\t'BGN' => __( 'Bulgarian lev', 'ffd-integration' ),\r\n\t\t\t\t\t'BHD' => __( 'Bahraini dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'BIF' => __( 'Burundian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'BMD' => __( 'Bermudian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BND' => __( 'Brunei dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BOB' => __( 'Bolivian boliviano', 'ffd-integration' ),\r\n\t\t\t\t\t'BRL' => __( 'Brazilian real', 'ffd-integration' ),\r\n\t\t\t\t\t'BSD' => __( 'Bahamian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'BTC' => __( 'Bitcoin', 'ffd-integration' ),\r\n\t\t\t\t\t'BTN' => __( 'Bhutanese ngultrum', 'ffd-integration' ),\r\n\t\t\t\t\t'BWP' => __( 'Botswana pula', 'ffd-integration' ),\r\n\t\t\t\t\t'BYR' => __( 'Belarusian ruble (old)', 'ffd-integration' ),\r\n\t\t\t\t\t'BYN' => __( 'Belarusian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'BZD' => __( 'Belize dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'CAD' => __( 'Canadian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'CDF' => __( 'Congolese franc', 'ffd-integration' ),\r\n\t\t\t\t\t'CHF' => __( 'Swiss franc', 'ffd-integration' ),\r\n\t\t\t\t\t'CLP' => __( 'Chilean peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CNY' => __( 'Chinese yuan', 'ffd-integration' ),\r\n\t\t\t\t\t'COP' => __( 'Colombian peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CRC' => __( 'Costa Rican col&oacute;n', 'ffd-integration' ),\r\n\t\t\t\t\t'CUC' => __( 'Cuban convertible peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CUP' => __( 'Cuban peso', 'ffd-integration' ),\r\n\t\t\t\t\t'CVE' => __( 'Cape Verdean escudo', 'ffd-integration' ),\r\n\t\t\t\t\t'CZK' => __( 'Czech koruna', 'ffd-integration' ),\r\n\t\t\t\t\t'DJF' => __( 'Djiboutian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'DKK' => __( 'Danish krone', 'ffd-integration' ),\r\n\t\t\t\t\t'DOP' => __( 'Dominican peso', 'ffd-integration' ),\r\n\t\t\t\t\t'DZD' => __( 'Algerian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'EGP' => __( 'Egyptian pound', 'ffd-integration' ),\r\n\t\t\t\t\t'ERN' => __( 'Eritrean nakfa', 'ffd-integration' ),\r\n\t\t\t\t\t'ETB' => __( 'Ethiopian birr', 'ffd-integration' ),\r\n\t\t\t\t\t'EUR' => __( 'Euro', 'ffd-integration' ),\r\n\t\t\t\t\t'FJD' => __( 'Fijian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'FKP' => __( 'Falkland Islands pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GBP' => __( 'Pound sterling', 'ffd-integration' ),\r\n\t\t\t\t\t'GEL' => __( 'Georgian lari', 'ffd-integration' ),\r\n\t\t\t\t\t'GGP' => __( 'Guernsey pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GHS' => __( 'Ghana cedi', 'ffd-integration' ),\r\n\t\t\t\t\t'GIP' => __( 'Gibraltar pound', 'ffd-integration' ),\r\n\t\t\t\t\t'GMD' => __( 'Gambian dalasi', 'ffd-integration' ),\r\n\t\t\t\t\t'GNF' => __( 'Guinean franc', 'ffd-integration' ),\r\n\t\t\t\t\t'GTQ' => __( 'Guatemalan quetzal', 'ffd-integration' ),\r\n\t\t\t\t\t'GYD' => __( 'Guyanese dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'HKD' => __( 'Hong Kong dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'HNL' => __( 'Honduran lempira', 'ffd-integration' ),\r\n\t\t\t\t\t'HRK' => __( 'Croatian kuna', 'ffd-integration' ),\r\n\t\t\t\t\t'HTG' => __( 'Haitian gourde', 'ffd-integration' ),\r\n\t\t\t\t\t'HUF' => __( 'Hungarian forint', 'ffd-integration' ),\r\n\t\t\t\t\t'IDR' => __( 'Indonesian rupiah', 'ffd-integration' ),\r\n\t\t\t\t\t'ILS' => __( 'Israeli new shekel', 'ffd-integration' ),\r\n\t\t\t\t\t'IMP' => __( 'Manx pound', 'ffd-integration' ),\r\n\t\t\t\t\t'INR' => __( 'Indian rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'IQD' => __( 'Iraqi dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'IRR' => __( 'Iranian rial', 'ffd-integration' ),\r\n\t\t\t\t\t'IRT' => __( 'Iranian toman', 'ffd-integration' ),\r\n\t\t\t\t\t'ISK' => __( 'Icelandic kr&oacute;na', 'ffd-integration' ),\r\n\t\t\t\t\t'JEP' => __( 'Jersey pound', 'ffd-integration' ),\r\n\t\t\t\t\t'JMD' => __( 'Jamaican dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'JOD' => __( 'Jordanian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'JPY' => __( 'Japanese yen', 'ffd-integration' ),\r\n\t\t\t\t\t'KES' => __( 'Kenyan shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'KGS' => __( 'Kyrgyzstani som', 'ffd-integration' ),\r\n\t\t\t\t\t'KHR' => __( 'Cambodian riel', 'ffd-integration' ),\r\n\t\t\t\t\t'KMF' => __( 'Comorian franc', 'ffd-integration' ),\r\n\t\t\t\t\t'KPW' => __( 'North Korean won', 'ffd-integration' ),\r\n\t\t\t\t\t'KRW' => __( 'South Korean won', 'ffd-integration' ),\r\n\t\t\t\t\t'KWD' => __( 'Kuwaiti dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'KYD' => __( 'Cayman Islands dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'KZT' => __( 'Kazakhstani tenge', 'ffd-integration' ),\r\n\t\t\t\t\t'LAK' => __( 'Lao kip', 'ffd-integration' ),\r\n\t\t\t\t\t'LBP' => __( 'Lebanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'LKR' => __( 'Sri Lankan rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'LRD' => __( 'Liberian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'LSL' => __( 'Lesotho loti', 'ffd-integration' ),\r\n\t\t\t\t\t'LYD' => __( 'Libyan dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'MAD' => __( 'Moroccan dirham', 'ffd-integration' ),\r\n\t\t\t\t\t'MDL' => __( 'Moldovan leu', 'ffd-integration' ),\r\n\t\t\t\t\t'MGA' => __( 'Malagasy ariary', 'ffd-integration' ),\r\n\t\t\t\t\t'MKD' => __( 'Macedonian denar', 'ffd-integration' ),\r\n\t\t\t\t\t'MMK' => __( 'Burmese kyat', 'ffd-integration' ),\r\n\t\t\t\t\t'MNT' => __( 'Mongolian t&ouml;gr&ouml;g', 'ffd-integration' ),\r\n\t\t\t\t\t'MOP' => __( 'Macanese pataca', 'ffd-integration' ),\r\n\t\t\t\t\t'MRO' => __( 'Mauritanian ouguiya', 'ffd-integration' ),\r\n\t\t\t\t\t'MUR' => __( 'Mauritian rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'MVR' => __( 'Maldivian rufiyaa', 'ffd-integration' ),\r\n\t\t\t\t\t'MWK' => __( 'Malawian kwacha', 'ffd-integration' ),\r\n\t\t\t\t\t'MXN' => __( 'Mexican peso', 'ffd-integration' ),\r\n\t\t\t\t\t'MYR' => __( 'Malaysian ringgit', 'ffd-integration' ),\r\n\t\t\t\t\t'MZN' => __( 'Mozambican metical', 'ffd-integration' ),\r\n\t\t\t\t\t'NAD' => __( 'Namibian dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'NGN' => __( 'Nigerian naira', 'ffd-integration' ),\r\n\t\t\t\t\t'NIO' => __( 'Nicaraguan c&oacute;rdoba', 'ffd-integration' ),\r\n\t\t\t\t\t'NOK' => __( 'Norwegian krone', 'ffd-integration' ),\r\n\t\t\t\t\t'NPR' => __( 'Nepalese rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'NZD' => __( 'New Zealand dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'OMR' => __( 'Omani rial', 'ffd-integration' ),\r\n\t\t\t\t\t'PAB' => __( 'Panamanian balboa', 'ffd-integration' ),\r\n\t\t\t\t\t'PEN' => __( 'Peruvian nuevo sol', 'ffd-integration' ),\r\n\t\t\t\t\t'PGK' => __( 'Papua New Guinean kina', 'ffd-integration' ),\r\n\t\t\t\t\t'PHP' => __( 'Philippine peso', 'ffd-integration' ),\r\n\t\t\t\t\t'PKR' => __( 'Pakistani rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'PLN' => __( 'Polish z&#x142;oty', 'ffd-integration' ),\r\n\t\t\t\t\t'PRB' => __( 'Transnistrian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'PYG' => __( 'Paraguayan guaran&iacute;', 'ffd-integration' ),\r\n\t\t\t\t\t'QAR' => __( 'Qatari riyal', 'ffd-integration' ),\r\n\t\t\t\t\t'RON' => __( 'Romanian leu', 'ffd-integration' ),\r\n\t\t\t\t\t'RSD' => __( 'Serbian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'RUB' => __( 'Russian ruble', 'ffd-integration' ),\r\n\t\t\t\t\t'RWF' => __( 'Rwandan franc', 'ffd-integration' ),\r\n\t\t\t\t\t'SAR' => __( 'Saudi riyal', 'ffd-integration' ),\r\n\t\t\t\t\t'SBD' => __( 'Solomon Islands dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SCR' => __( 'Seychellois rupee', 'ffd-integration' ),\r\n\t\t\t\t\t'SDG' => __( 'Sudanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SEK' => __( 'Swedish krona', 'ffd-integration' ),\r\n\t\t\t\t\t'SGD' => __( 'Singapore dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SHP' => __( 'Saint Helena pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SLL' => __( 'Sierra Leonean leone', 'ffd-integration' ),\r\n\t\t\t\t\t'SOS' => __( 'Somali shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'SRD' => __( 'Surinamese dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'SSP' => __( 'South Sudanese pound', 'ffd-integration' ),\r\n\t\t\t\t\t'STD' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra', 'ffd-integration' ),\r\n\t\t\t\t\t'SYP' => __( 'Syrian pound', 'ffd-integration' ),\r\n\t\t\t\t\t'SZL' => __( 'Swazi lilangeni', 'ffd-integration' ),\r\n\t\t\t\t\t'THB' => __( 'Thai baht', 'ffd-integration' ),\r\n\t\t\t\t\t'TJS' => __( 'Tajikistani somoni', 'ffd-integration' ),\r\n\t\t\t\t\t'TMT' => __( 'Turkmenistan manat', 'ffd-integration' ),\r\n\t\t\t\t\t'TND' => __( 'Tunisian dinar', 'ffd-integration' ),\r\n\t\t\t\t\t'TOP' => __( 'Tongan pa&#x2bb;anga', 'ffd-integration' ),\r\n\t\t\t\t\t'TRY' => __( 'Turkish lira', 'ffd-integration' ),\r\n\t\t\t\t\t'TTD' => __( 'Trinidad and Tobago dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'TWD' => __( 'New Taiwan dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'TZS' => __( 'Tanzanian shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'UAH' => __( 'Ukrainian hryvnia', 'ffd-integration' ),\r\n\t\t\t\t\t'UGX' => __( 'Ugandan shilling', 'ffd-integration' ),\r\n\t\t\t\t\t'USD' => __( 'United States (US) dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'UYU' => __( 'Uruguayan peso', 'ffd-integration' ),\r\n\t\t\t\t\t'UZS' => __( 'Uzbekistani som', 'ffd-integration' ),\r\n\t\t\t\t\t'VEF' => __( 'Venezuelan bol&iacute;var', 'ffd-integration' ),\r\n\t\t\t\t\t'VND' => __( 'Vietnamese &#x111;&#x1ed3;ng', 'ffd-integration' ),\r\n\t\t\t\t\t'VUV' => __( 'Vanuatu vatu', 'ffd-integration' ),\r\n\t\t\t\t\t'WST' => __( 'Samoan t&#x101;l&#x101;', 'ffd-integration' ),\r\n\t\t\t\t\t'XAF' => __( 'Central African CFA franc', 'ffd-integration' ),\r\n\t\t\t\t\t'XCD' => __( 'East Caribbean dollar', 'ffd-integration' ),\r\n\t\t\t\t\t'XOF' => __( 'West African CFA franc', 'ffd-integration' ),\r\n\t\t\t\t\t'XPF' => __( 'CFP franc', 'ffd-integration' ),\r\n\t\t\t\t\t'YER' => __( 'Yemeni rial', 'ffd-integration' ),\r\n\t\t\t\t\t'ZAR' => __( 'South African rand', 'ffd-integration' ),\r\n\t\t\t\t\t'ZMW' => __( 'Zambian kwacha', 'ffd-integration' ),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\r\n\treturn $currencies;\r\n}", "function international_num_format($input, $decimals = 2)\n\t{\n\t\tglobal $config;\n\n\t\tswitch ($config['number_format_style']) {\n\t\t\tcase '2': // spain, germany\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '3': // estonia\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '4': // france, norway\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', ' ');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', ' ');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '5': // switzerland\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, \",\", \"'\");\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, \",\", \"'\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '6': // kazahistan\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, ',', '.');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, ',', '.');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ($config['force_decimals'] == \"1\") {\n\t\t\t\t$output = number_format($input, $decimals, '.', ',');\n\t\t\t\t} else {\n\t\t\t\t$output = misc::formatNumber($input, $decimals, '.', ',');\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t} // end switch\n\t\treturn $output;\n\t}", "public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }", "public function formatPriceWithoutCurrency($value) {\n return Mage::getModel('directory/currency')->format($value, array('display' => Zend_Currency::NO_SYMBOL), false);\n }", "function smarty_modifier_displayPrice ($value, $pre = false, $post = false, $type = null)\n{\n\treturn geoString::displayPrice($value, $pre, $post, $type);\n}", "function carton_time_format() {\n\treturn apply_filters( 'carton_time_format', get_option( 'time_format' ) );\n}", "function pc_format_currency($amt) {\n $a = localeconv();\n \n // compute sign of $amt and then remove it\n if ($amt < 0) { $sign = -1; } else { $sign = 1; }\n $amt = abs($amt);\n // format $amt with appropriate grouping, decimal point, and fractional digits \n $amt = number_format($amt,$a['frac_digits'],$a['mon_decimal_point'],\n $a['mon_thousands_sep']);\n \n // figure out where to put the currency symbol and positive or negative signs\n $currency_symbol = $a['currency_symbol'];\n // is $amt >= 0 ? \n if (1 == $sign) {\n $sign_symbol = 'positive_sign';\n $cs_precedes = 'p_cs_precedes';\n $sign_posn = 'p_sign_posn';\n $sep_by_space = 'p_sep_by_space';\n } else {\n $sign_symbol = 'negative_sign';\n $cs_precedes = 'n_cs_precedes';\n $sign_posn = 'n_sign_posn';\n $sep_by_space = 'n_sep_by_space';\n }\n if ($a[$cs_precedes]) {\n if (3 == $a[$sign_posn]) {\n $currency_symbol = $a[$sign_symbol].$currency_symbol;\n } elseif (4 == $a[$sign_posn]) {\n $currency_symbol .= $a[$sign_symbol];\n }\n // currency symbol in front \n if ($a[$sep_by_space]) {\n $amt = $currency_symbol.' '.$amt;\n } else {\n $amt = $currency_symbol.$amt;\n }\n } else {\n // currency symbol after amount \n if ($a[$sep_by_space]) {\n $amt .= ' '.$currency_symbol;\n } else {\n $amt .= $currency_symbol;\n }\n }\n if (0 == $a[$sign_posn]) {\n $amt = \"($amt)\";\n } elseif (1 == $a[$sign_posn]) {\n $amt = $a[$sign_symbol].$amt;\n } elseif (2 == $a[$sign_posn]) {\n $amt .= $a[$sign_symbol];\n }\n return $amt;\n}", "private static function moneyFormat($price)\r\n {\r\n return addCurrency(number_format($price, 2, ',', ' '));\r\n }", "function deals_button( $args = array() ){\n global $post;\n\n /* Set up the default arguments for the button. */\n $defaults = array(\n 'container_open' => '<div id=\"price-block-'.$post->ID.'\" class=\"price-block\">',\n 'container_close' => '</div>',\n 'expired_open' => '<span class=\"expired-button\">',\n 'expired_close' => '</span>',\n 'free_open' => null,\n 'free_close' => null,\n 'buy_open' => null,\n 'buy_close' => null,\n 'link_free_class' => 'buy-button',\n 'link_buy_class' => 'buy-button',\n 'text_buy' => 'Buy now',\n 'text_free' => 'Free Download',\n 'text_expired' => 'Deal expired',\n 'show_text_buy' => true\n );\n\n /* Parse the arguments and extract them for easy variable naming. */\n $args = wp_parse_args( $args, $defaults );\n $args = apply_filters( 'deals_button_args', $args );\n $args = (object) $args;\n\n $output = '';\n\n if($args->container_open)\n $output = $args->container_open;\n\n if (deals_is_expired() == 1) :\n\n $output .= $args->expired_open;\n $output .= '<span class=\"buy-label\">'.$args->text_expired.'</span>';\n $output .= $args->expired_close;\n\n else: \n\n if ( deals_is_free() ) :\n\n $link = (is_deal())? '#subscribe_deals':get_permalink($post->ID);\n $free_class = (is_deal())? $args->link_free_class.' free':$args->link_free_class;\n\n $output .= $args->free_open;\n $output .= '<a href=\"'.$link.'\" class=\"'.$free_class.'\"><span>'.$args->text_free.'</span></a>';\n $output .= $args->free_close;\n\n else: \n\n $link = (is_deal())? wp_nonce_url(deals_get_buy_url($post->ID), 'buy-button'):get_permalink($post->ID);\n\n $output .= $args->buy_open;\n $output .= '<a href=\"'.$link.'\" class=\"'.$args->link_buy_class.'\">';\n\n if($args->show_text_buy)\n $output .= '<span class=\"buy-label\">'.$args->text_buy.'</span> ';\n\n $output .= '<span class=\"price-label\">'.deals_discount().'</span>';\n $output .= '</a>';\n $output .= $args->buy_close;\n\n endif; \n\n endif;\n\n if($args->container_close)\n $output .= $args->container_close;\n\n echo $output;\n\n}", "function atcf_theme_variable_pricing() {\n\tremove_action( 'edd_purchase_link_top', 'edd_purchase_variable_pricing' );\n\tadd_action( 'edd_purchase_link_top', 'atcf_purchase_variable_pricing' );\n}", "function update_markup_currency(& $price_summary, & $currency_obj, $no_of_nights = 1, $level_one_markup = false, $current_domain_markup = true) {\r\n $tax_service_sum = 0;\r\n $tax_removal_list = array();\r\n $markup_list = array(\r\n 'RoomPrice',\r\n 'PublishedPrice',\r\n 'PublishedPriceRoundedOff',\r\n 'OfferedPrice',\r\n 'OfferedPriceRoundedOff'\r\n );\r\n $markup_summary = array();\r\n//debug($currency_obj);\r\n foreach ($price_summary as $__k => $__v) {\r\n\r\n $ref_cur = $currency_obj->force_currency_conversion($__v); // Passing Value By Reference so dont remove it!!!\r\n $price_summary [$__k] = $ref_cur ['default_value']; // If you dont understand then go and study \"Passing value by reference\"\r\n//debug($currency_obj);\r\n if (in_array($__k, $markup_list)) {\r\n $temp_price = $currency_obj->get_currency($__v, true, $level_one_markup, $current_domain_markup, $no_of_nights);\r\n } else {\r\n $temp_price = $currency_obj->force_currency_conversion($__v);\r\n }\r\n//echo 'herre'.$tax_service_sum;\r\n// adding service tax and tax to total\r\n if (in_array($__k, $tax_removal_list)) {\r\n $markup_summary [$__k] = round($temp_price ['default_value'] + $tax_service_sum);\r\n } else {\r\n $markup_summary [$__k] = round($temp_price ['default_value']);\r\n }\r\n }\r\n//exit;\r\n return $markup_summary;\r\n }", "function edit_price_box()\r\n{\r\n\tglobal $post;\r\n\t$price = get_post_meta($post->ID, 'dish_price', true);\r\n\t$price = !$price ? '' : $price;\r\n\t?>\r\n\t<label for=\"dish_price\"><?php _e('Dish Price:')?></label>\r\n <input type=\"text\" id=\"dish_price\" name=\"dish_price\" value=\"<?php echo $price; ?>\" size=\"25\" />\r\n <small><?php _e('(Price example: £14.75)')?></small>\r\n<?php }", "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 }", "function currency_symbol() {\n\t\treturn DEFAULT_CURRENCY;\n\t}", "function Currency2Decimal($number, $reverse=0) {\n\n\n if($reverse===1) {\n $number = preg_replace('/[^0-9,]/', '', $number);\n $number = preg_replace('/[, ]/', '.', $number);\n $number = number_format($number, 2, '.', '');\n return $number;\n\n } else return number_format($number, 2, ',', '.');\n\n\n}", "public function getSourceCurrency();", "function wp_store_ticker_cb(){\r\n\t//Check if ticker is enabled\r\n\t\t$wp_store_ticker = get_theme_mod('wp_store_header_setting_ticker_option','0');\r\n\t\tif($wp_store_ticker==1)\r\n\t\t{\r\n\t\t\t$ticker_title = get_theme_mod('wp_store_header_setting_ticker_title',__('Latest','wp-store'));\r\n\t\t\t$ticker_category = get_theme_mod('wp_store_header_setting_ticker_category');\r\n\t\t\tif(empty($ticker_title)){$ticker_title=\"Latest\";}\r\n\t\t\tif( !empty($ticker_category)) {\r\n\t\t\t\t?>\r\n\t\t\t\t<div class=\"top-ticker\">\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\tjQuery(document).ready(function($){\r\n\t\t\t\t\t\t\t$('#ticker').slick({\r\n\t\t\t\t\t\t\t\tslidesToShow: 1,\r\n\t\t\t\t\t\t\t\tslidesToScroll: 1,\r\n\t\t\t\t\t\t\t\tautoplay: true,\r\n\t\t\t\t\t\t\t\tautoplaySpeed: 3000,\r\n\t\t\t\t\t\t\t\tspeed:2000,\r\n\t\t\t\t\t\t\t\tcssEase:'ease',\r\n\t\t\t\t\t\t\t\tarrows:false\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}); //jquery close\r\n\t\t\t\t\t</script> <!-- close script -->\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t$loop = new WP_Query(array(\r\n\t\t\t\t\t\t'cat' => $ticker_category,\r\n\t\t\t\t\t\t'posts_per_page' => -1 \r\n\t\t\t\t\t\t));\r\n\t\t\t\t\tif($loop->have_posts()) {\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<span class=\"ticker-title\"><?php echo $ticker_title;?></span>\r\n\t\t\t\t\t\t<ul id=\"ticker\" class=\"hidden\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$i=0;\r\n\t\t\t\t\t\t\twhile($loop->have_posts()){\r\n\t\t\t\t\t\t\t\t$loop->the_post();\r\n\t\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t\t<h5 class=\"ticker_tick ticker-h5-<?php echo esc_attr($i); ?>\"><a href=\"<?php the_permalink();?>\"><?php the_title(); ?> </a></h5>\r\n\t\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t\t<?php \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t}\r\n\t\t\t\t\twp_reset_query();\r\n\t\t\t\t\t?>\r\n\t\t\t\t</div>\r\n\t\t\t\t<?php\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function get_list_product_price() {\n\n global $product;\n\n if ( $price_html = $product->get_price_html() ) :\n \t\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n \t\n endif; \n\n }", "function get_credit_html() {\n // Get $wpdb to use in queries\n global $wpdb;\n\n $credit_html = 'N/A';\n\n if (get_credit_limit()) {\n $credit_html = '<span class=\"float-left bold\">Credit Limit:</span><span class=\"float-right\"> $' . number_format_i18n( get_credit_limit(), 2 ) . '</span><span class=\"clearfix\"></span>';\n $credit_html .= '<span class=\"float-left bold\">Current Balance:</span><span class=\"float-right\"> $' . number_format_i18n( get_credit_balance(), 2 ) . '</span><span class=\"clearfix\"></span>';\n $credit_html .= '<span class=\"float-left bold\">Remaining Balance:</span><span class=\"float-right\"> $' . number_format_i18n( get_credit_available(), 2 ) . '</span><span class=\"clearfix\"></span>';\n }\n\n return $credit_html;\n}", "function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}", "function formatCurrency($amount, $config, $currencySymbol = null) {\r\n\t\t$decimals = isset($config->decimals) ? $config->decimals : 2 ;\r\n\t\t$dec_point = isset($config->dec_point) ? $config->dec_point : '.' ;\r\n\t\t$thousands_sep = isset($config->thousands_sep) ? $config->thousands_sep : ',' ;\r\n\t\t$symbol = $currencySymbol ? $currencySymbol : $config->currency_symbol ;\r\n\t\r\n\t\treturn $config->currency_position ? (number_format($amount, $decimals, $dec_point, $thousands_sep).$symbol) : ($symbol.number_format($amount, $decimals, $dec_point, $thousands_sep)) ;\r\n\t}", "function carton_price( $price, $args = array() ) {\n\tglobal $carton;\n\n\textract( shortcode_atts( array(\n\t\t'ex_tax_label' \t=> '0'\n\t), $args ) );\n\n\t$return = '';\n\t$num_decimals = (int) get_option( 'carton_price_num_decimals' );\n\t$currency_pos = get_option( 'carton_currency_pos' );\n\t$currency_symbol = get_carton_currency_symbol();\n\t$decimal_sep = wp_specialchars_decode( stripslashes( get_option( 'carton_price_decimal_sep' ) ), ENT_QUOTES );\n\t$thousands_sep = wp_specialchars_decode( stripslashes( get_option( 'carton_price_thousand_sep' ) ), ENT_QUOTES );\n\n\t$price = apply_filters( 'raw_carton_price', (double) $price );\n\t$price = number_format( $price, $num_decimals, $decimal_sep, $thousands_sep );\n\n\tif ( get_option( 'carton_price_trim_zeros' ) == 'yes' && $num_decimals > 0 )\n\t\t$price = carton_trim_zeros( $price );\n\n\t$return = '<span class=\"amount\">' . sprintf( get_carton_price_format(), $currency_symbol, $price ) . '</span>';\n\n\tif ( $ex_tax_label && get_option( 'carton_calc_taxes' ) == 'yes' )\n\t\t$return .= ' <small>' . $carton->countries->ex_tax_or_vat() . '</small>';\n\n\treturn $return;\n}", "function atcf_theme_custom_variable_pricing() {\n\tif ( ! current_theme_supports( 'appthemer-crowdfunding' ) )\n\t\treturn;\n\n\tadd_action( 'init', 'atcf_theme_variable_pricing' );\n}", "function alm_filters_settings_callback() {\n\t $html = '<p>' . __('Customize your installation of the <a href=\"http://connekthq.com/plugins/ajax-load-more/filters/\">Filters</a> add-on.', 'ajax-load-more-filters') . '</p>';\n\n\t echo $html;\n\t}", "public function _render_give_currency_preview( $field, $value ) {\n\t\t\t$currency = give_get_currency();\n\t\t\t$currency_position = give_get_currency_position();\n\t\t\t$currency_symbol = give_currency_symbol( $currency, false );\n\t\t\t$formatted_currency = ( 'before' === $currency_position )\n\t\t\t\t? sprintf( '%1$s%2$s', esc_html( $currency_symbol ), esc_html( $field['default'] ) )\n\t\t\t\t: sprintf( '%1$s%2$s', esc_html( $field['default'] ), esc_html( $currency_symbol ) );\n\t\t\t?>\n\t\t\t<tr valign=\"top\" <?php echo ! empty( $field['wrapper_class'] ) ? 'class=\"' . $field['wrapper_class'] . '\"' : '' ?>>\n\t\t\t\t<th scope=\"row\" class=\"titledesc\">\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=\"<?php echo esc_attr( $field['id'] ); ?>\"><?php echo esc_html( $field['name'] ) ?></label>\n\t\t\t\t</th>\n\t\t\t\t<td class=\"give-forminp\">\n\t\t\t\t\t<input id=\"<?php echo esc_attr( $field['id'] ); ?>\" class=\"give-input-field\" type=\"text\" disabled value=\"<?php echo esc_attr( $formatted_currency ); ?>\">\n\t\t\t\t\t<?php echo Give_Admin_Settings::get_field_description( $field ); ?>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t}", "function wp_render_duotone_filter_preset($preset)\n {\n }", "function carton_format_total( $number ) {\n\treturn number_format( (float) $number, (int) get_option( 'carton_price_num_decimals' ), '.', '' );\n}", "function getIsoCurrCode($magento_currency_code) {\r\n\tswitch($magento_currency_code){\r\n\tcase 'HKD':\r\n\t\t$cur = '344';\r\n\t\tbreak;\r\n\tcase 'USD':\r\n\t\t$cur = '840';\r\n\t\tbreak;\r\n\tcase 'SGD':\r\n\t\t$cur = '702';\r\n\t\tbreak;\r\n\tcase 'CNY':\r\n\t\t$cur = '156';\r\n\t\tbreak;\r\n\tcase 'JPY':\r\n\t\t$cur = '392';\r\n\t\tbreak;\t\t\r\n\tcase 'TWD':\r\n\t\t$cur = '901';\r\n\t\tbreak;\r\n\tcase 'AUD':\r\n\t\t$cur = '036';\r\n\t\tbreak;\r\n\tcase 'EUR':\r\n\t\t$cur = '978';\r\n\t\tbreak;\r\n\tcase 'GBP':\r\n\t\t$cur = '826';\r\n\t\tbreak;\r\n\tcase 'CAD':\r\n\t\t$cur = '124';\r\n\t\tbreak;\r\n\tcase 'MOP':\r\n\t\t$cur = '446';\r\n\t\tbreak;\r\n\tcase 'PHP':\r\n\t\t$cur = '608';\r\n\t\tbreak;\r\n\tcase 'THB':\r\n\t\t$cur = '764';\r\n\t\tbreak;\r\n\tcase 'MYR':\r\n\t\t$cur = '458';\r\n\t\tbreak;\r\n\tcase 'IDR':\r\n\t\t$cur = '360';\r\n\t\tbreak;\r\n\tcase 'KRW':\r\n\t\t$cur = '410';\r\n\t\tbreak;\r\n\tcase 'SAR':\r\n\t\t$cur = '682';\r\n\t\tbreak;\r\n\tcase 'NZD':\r\n\t\t$cur = '554';\r\n\t\tbreak;\r\n\tcase 'AED':\r\n\t\t$cur = '784';\r\n\t\tbreak;\r\n\tcase 'BND':\r\n\t\t$cur = '096';\r\n\t\tbreak;\r\n\tcase 'VND':\r\n\t\t$cur = '704';\r\n\t\tbreak;\r\n\tcase 'INR':\r\n\t\t$cur = '356';\r\n\t\tbreak;\r\n\tdefault:\r\n\t\t$cur = '344';\r\n\t}\t\r\n\treturn $cur;\r\n}", "function paces_filter_price_text( $price ){\n $price = floatval( $price );\n $parts = explode( '.', (string)$price );\n\n if ( empty( $parts[1] ) ) {\n return $price;\n }\n if ( strlen( $parts[1] ) == 1 ) {\n $price = (string)$price . '0';\n }\n return $price;\n}" ]
[ "0.7087062", "0.707103", "0.7025064", "0.6552601", "0.64745337", "0.6437256", "0.6397361", "0.63158613", "0.6214393", "0.61571825", "0.61468023", "0.6135464", "0.6098713", "0.60848993", "0.60670805", "0.6065427", "0.6045571", "0.6043382", "0.5996679", "0.5970434", "0.59491545", "0.593274", "0.59085757", "0.58606243", "0.5857225", "0.58442354", "0.5820404", "0.5804137", "0.5787314", "0.5731559", "0.57304394", "0.5728539", "0.57267565", "0.5716311", "0.5712351", "0.56895256", "0.5649628", "0.5636553", "0.56330454", "0.5597321", "0.5582917", "0.55768555", "0.55766696", "0.5527808", "0.55210656", "0.551052", "0.5479519", "0.54774475", "0.54720384", "0.5467277", "0.5455226", "0.5452864", "0.54522854", "0.5450058", "0.5414223", "0.5414223", "0.5412513", "0.53916997", "0.5387526", "0.53834337", "0.5377142", "0.53512263", "0.53509104", "0.5350122", "0.53489214", "0.5347404", "0.53409374", "0.5336262", "0.5325949", "0.53245056", "0.5322195", "0.5318152", "0.53120995", "0.5308526", "0.5308526", "0.5304856", "0.5301045", "0.5299355", "0.5297631", "0.52912444", "0.52897966", "0.5280437", "0.5267786", "0.5254205", "0.5246745", "0.5243556", "0.5237637", "0.5225346", "0.52230906", "0.5218911", "0.52187026", "0.52142155", "0.52097", "0.52085537", "0.5192831", "0.51888424", "0.5186753", "0.5181498", "0.5179919", "0.5168531" ]
0.67093366
3
add_filter( 'wp_setup_nav_menu_item', 'getfair_currency_menu_item' ); //
function item_quantities_none() { //if( isset($edd_options['coopshares_fair_checkout_info']) ) { // return true; //} else { return false; //} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getfair_currency_menu_item( $item ) {\r\n if($item->title == 'Your Currency'){\r\n $item->title = 'from: '.edd_currency_get_stored_currency();\r\n }\r\n return $item;\r\n}", "function custom_nav_item( $menu, stdClass $args ){\n if ( 'primary' != $args->theme_location )\n\n return $menu; \n\t\t// $menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"dashicons dashicons-search\"></i>\n\t\t$menu .= '</ul><ul class=\"search-form-container\"><div class=\"search-toggle\"><i class=\"fa fa-search\"></i>\n\t\t\t\t<a href=\"#search-container\" class=\"screen-reader-text\"></a>\n\t\t\t\t</div>'; \n return $menu; \n}", "function wp_setup_nav_menu_item($menu_item)\n {\n }", "function erp_menu() {\n $menu = [];\n return apply_filters( 'erp_menu', $menu );\n}", "function wpmu_menu()\n {\n }", "function tarful_register_menus() {\n register_nav_menus(\n array(\n 'credits-1' => __( 'Footer IZQ' ),\n 'credits-2' => __( 'Footer CTR' ),\n 'credits-3' => __( 'Footer DER' )\n )\n );\n}", "function bethel_filter_menu_items() {\n\tadd_filter ('walker_nav_menu_start_el', 'bethel_add_menu_subtitles');\n}", "function wp_nav_menu_setup()\n {\n }", "function attach_items_to_menu( $args ) {\n\tif( 'secondary' == $args['theme_location'] ) {\n \t$args['walker'] = new add_cart_items_Walker;\n \t}\n \treturn $args;\n}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function my_custom_menu_item( $items, $args ) {\n\tif ( $args->theme_location == 'main-menu' ) {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$items .= '<li><a href=\"/cuenta\">Cuenta</li>'; // Iniciar Sesión - Cuenta\n\t\t\t$items .= '<li><a href=\"/vip\"><i class=\"fa fa-star\"></i></a></li>'; // Iniciar Sesión VIP - VIP\n\t\t\t$items .= '<li><a href=\"/dashboard\"><i class=\"fa fa-shopping-cart\"></i></a></li>'; // # - Dashboard\n\t\t\t$items .= '<li><a href=\"/cerrar-sesion\"><i class=\"fa fa-sign-out\"></i></li>'; // Administrador - Cerrar Sesión\n\t\t} else {\n\t\t\t$items .= '<li><a href=\"/iniciar-sesion\" class=\"fancybox-login\" data-fancybox-type=\"iframe\">Iniciar sesión</li>'; // Iniciar Sesión - Cuenta\n\t\t\t$items .= '<li><a href=\"/registrarse\" class=\"fancybox-login registrarse\" data-fancybox-type=\"iframe\">Registrarse <i class=\"fa fa-arrow-circle-right\"></i></a></li>'; // Registrarse\n\t\t\t$items .= '<li><a href=\"/iniciar-sesion-vip\" class=\"fancybox-login\" data-fancybox-type=\"iframe\"><i class=\"fa fa-star\"></i></a></li>'; // Iniciar Sesión VIP - VIP\n\t\t\t$items .= '<li><a href=\"#\"><i class=\"fa fa-shopping-cart\"></i></a></li>'; // # - Dashboard\n\t\t\t$items .= '<li><a href=\"/wp-admin\" target=\"_blank\"><i class=\"fa fa-user\"></i></a></li>'; // Administrador - Cerrar Sesión\n\t\t}\n\t\t$items .= '<li><a href=\"https://www.facebook.com/Comsubcol-SAS-1116634048391880\" target=\"_blank\"><i class=\"fa fa-facebook\"></i></a></li>'; // Facebook\n\t\t$items .= '<li><a href=\"https://www.twitter.com/ComsubcolSAS\" target=\"_blank\"><i class=\"fa fa-twitter\"></i></a></li>'; // Twitter\n\t\t$items .= '<li><a href=\"https://www.instagram.com/ComsubcolSAS\" target=\"_blank\"><i class=\"fa fa-instagram\"></i></a></li>'; // Instagram\n\t\tif ( isset( $_POST[ 'item_subasta' ] ) ) {\n\t\t\t$item_subasta = $_POST[ 'item_subasta' ];\n\t\t} else {\n\t\t\t$item_subasta = 'Buscar...';\n\t\t}\n\t\t$items .= '\n\t\t\t<li>\n\t\t\t\t<p><a href=\"#\" id=\"example-show\" class=\"showLink\"><i class=\"fa fa-search\"></i></a></p>\n\t\t\t\t<div id=\"example\" class=\"more\">\n\t\t\t\t\t<form action=\"' . esc_url( get_permalink( 2640 ) ) . '\" method=\"post\" id=\"blog-search\" class=\"blog-search\">\n\t\t\t\t\t\t<input type=\"text\" id=\"item_subasta\" name=\"item_subasta\" value=\"\" class=\"blog-search-field\" placeholder=\"' . $item_subasta . '\">\n\t\t\t\t\t</form>\n\t\t\t\t\t<p class=\"hidden-xs hidden-sm\"><a href=\"#\" id=\"example-hide\" class=\"hideLink\"><i class=\"fa fa-close\"></i></a></p>\n\t\t\t\t</div>\n\t\t\t</li>';\n\t}\n\treturn $items;\n}", "function _mai_add_widget_header_menu_args() {\n\tadd_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );\n\tadd_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );\n}", "function trimestral_module_init_menu_items()\n{\n $CI = &get_instance();\n\n $CI->app->add_quick_actions_link([\n 'name' => _l('trimestral_name'),\n 'url' => 'trimestral',\n ]);\n\n $CI->app_menu->add_sidebar_children_item('utilities', [\n 'slug' => 'trimestral',\n 'name' => _l('trimestral_name'),\n 'href' => admin_url('trimestral'),\n ]);\n}", "function ieatwp_default_menu(){ ?>\n\t\t<ul class=\"navbar navbar-right\">\n <li><a href=\"#section_intro\" class=\"easing\">Home</a></li>\n <li><a href=\"#section_about\" class=\"easing\">About</a></li>\n <li><a href=\"#section_work\" class=\"easing\">Strategy</a></li>\n <li><a href=\"#section_resume\" class=\"easing\">Resume</a></li>\n <li><a href=\"#section_portfolio\" class=\"easing\">Portfolio</a></li>\n <li><a href=\"#section_services\" class=\"easing\">Services</a></li>\n <li><a href=\"#section_contact\" class=\"easing\">Contact</a></li>\n </ul>\n<?php }", "function vsb_crypto_calculator_create_menu() {\n\tadd_menu_page(\n\t\t'Crypto Calculator Settings',\n\t\t'Crypto Calculator',\n\t\t'administrator', __FILE__,\n\t\t'vsb_crypto_calculator_settings_page' , WP_CRYPTO_CALCULATOR_URL.'/img/icon.png' );\n\n\t//call register settings function\n\tadd_action( 'admin_init', 'register_vsb_crypto_calculator_settings' );\n}", "function wpb_custom_new_menu() {\n register_nav_menus(\n array(\n 'my-custom-menu' => __( 'My Custom Menu' ),\n 'extra-menu' => __( 'Extra Menu' ),\n 'logo-menu' => __( 'Logo Menu' ),\n 'web-des' => __( 'Web Designing Services' ),\n 'sm-ser' => __( 'Social Meida Services' ),\n 'web-dev-ser' => __( 'Web Development Services' ),\n 'digital-ser' => __( 'Digital Marketing Services' ),\n )\n );\n}", "function woocommerce_custom_menu(){\n register_nav_menu('top-menu',__('WooCommerce Custom Menu', 'woocommercecustommenu'));\n}", "function wob_setup() {\n register_nav_menus( array(\n 'primary' => esc_html__( 'Primary', 'acstarter' ),\n 'sitemap' => esc_html__( 'Sitemap', 'acstarter' ),\n ) );\n\n}", "function px_add_search_menu_item($items, $args)\n{\n\treturn $items;\n\t\n if( 'primary-nav' != $args->theme_location )\n return $items;\n\n ob_start();\n ?>\n <li id=\"menu-item-search\" class=\"menu-item menu-item-search\">\n <a href=\"#\"><span class=\"icon-search\"></span></a>\n <div class=\"search-template\">\n <?php get_search_form(); ?>\n </div>\n </li>\n <?php\n $items .= ob_get_clean();\n return $items;\n}", "function greenfields_display_main_menu()\n{\n wp_nav_menu(\n array(\n 'theme_location' => 'main_nav', /* where in the theme it's assigned */\n 'menu' => 'main_nav', /* menu name */\n 'menu_class' => 'nav navbar-nav',\n 'container' => false, /* container class */\n 'depth' => 2,\n 'walker' => new greenfields_Bootstrap_walker(),\n )\n );\n}", "function filter_menu_items( $args ) {\r\n $args['show_home'] = false;\r\n return $args;\r\n}", "function sl_custom_menu() {\n register_nav_menus(\n array(\n 'main-menu' => __( 'Main Menu' ),\n 'footer-menu1' => __( 'Footer Menu 1' ),\n 'footer-menu2' => __( 'Footer Menu 2' )\n )\n );\n}", "function simpleton_navmenu() {\n\nif ( function_exists( 'wp_nav_menu' ) )\n\twp_nav_menu( 'menu_class=toppagenavi&fallback_cb=simpleton_navmenu_fallback&theme_location=mainmenu' );\nelse\n\tsimpleton_navmenu_fallback();\n}", "function koelsch_resources_footer_menu(){\n global $community_context;\n $lt = $community_context->getCurrentLivingTypes();\n $menuID = isset($lt['resources_menu_id']) ? $lt['resources_menu_id'] : false;\n if ($menuID){?>\n <div class=\"col col-12 col-nav\">\n <h4>Resources</h4>\n <?php\n wp_nav_menu(array(\n 'menu'=> $menuID,\n 'menu_id'=>'',\n 'menu_class'=>'second-menu main-item',\n 'container'=>false,\n 'depth'=>1,\n // 'walker'=> new Koelsch_Walker_Nav_Menu,\n 'fallback_cb'=>'__return_false'\n ));\n ?></div><?php\n }\n}", "function uds_pricing_admin_menu()\n{\t\n\tglobal $menu;\n\t$position = 105;\n\tif(!empty($menu[$position])) $position = null;\n\n\t$icon = UDS_PRICING_URL . 'images/menu-icon.png';\n\t$pricing_page = add_menu_page(\"Pricing Tables\", \"Pricing Tables\", 'manage_options', 'uds_pricing_admin', 'uds_pricing_admin', $icon, $position);\n\t$pricing_new = add_submenu_page('uds_pricing_admin', \"Add New\", 'Add New', 'manage_options', 'uds_pricing_new', 'uds_pricing_new');\n\t$pricing_structure_page = add_submenu_page('uds_pricing_admin', \"Structure\", 'Structure', 'manage_options', 'uds_pricing_structure', 'uds_pricing_structure');\n\t$pricing_products_page = add_submenu_page('uds_pricing_admin', \"Products\", 'Products', 'manage_options', 'uds_pricing_products', 'uds_pricing_products');\n\t\n\tadd_action(\"admin_print_styles-$pricing_page\", 'uds_pricing_admin_print_css');\n\tadd_action(\"admin_print_styles-$pricing_structure_page\", 'uds_pricing_admin_print_css');\n\tadd_action(\"admin_print_styles-$pricing_products_page\", 'uds_pricing_admin_print_css');\n\n\tadd_action(\"admin_print_scripts-$pricing_page\", 'uds_pricing_admin_print_scripts');\n\tadd_action(\"admin_print_scripts-$pricing_structure_page\", 'uds_pricing_admin_print_scripts');\n\tadd_action(\"admin_print_scripts-$pricing_products_page\", 'uds_pricing_admin_print_scripts');\n}", "function my_wp_nav_menu_items( $items, $args, $ajax = false ) {\n\tif ( ( isset( $ajax ) && $ajax ) || ( property_exists( $args, 'theme_location' ) && $args->theme_location === 'top_nav' ) ) {\n\t\t// WooCommerce\n\t\tif ( class_exists( 'woocommerce' ) ) {\n\t\t\t$css_class = 'menu-item menu-item-type-cart menu-item-type-woocommerce-cart';\n\t\t\t// Is this the cart page?\n\t\t\tif ( is_cart() )\n\t\t\t\t$css_class .= ' current-menu-item';\n\t\t\t$items .= '<li class=\"' . esc_attr( $css_class ) . '\">';\n\t\t\t\t$items .= '<a class=\"cart-contents\" href=\"' . esc_url( WC()->cart->get_cart_url() ) . '\">';\n\t\t\t\t\t$items .= wp_kses_data( WC()->cart->get_cart_total() ) . ' - <span class=\"count\">' . wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'simple-shop' ), WC()->cart->get_cart_contents_count() ) ) . '</span>';\n\t\t\t\t$items .= '</a>';\n\t\t\t$items .= '</li>';\n\t\t}\n\t\t// Easy Digital Downloads\n\t\telse if ( class_exists( 'Easy_Digital_Downloads' ) ) {\n\t\t\t$css_class = 'menu-item menu-item-type-cart menu-item-type-edd-cart';\n\t\t\t// Is this the cart page?\n\t\t\tif ( edd_is_checkout() )\n\t\t\t\t$css_class .= ' current-menu-item';\n\t\t\t$items .= '<li class=\"' . esc_attr( $css_class ) . '\">';\n\t\t\t\t$items .= '<a class=\"cart-contents\" href=\"' . esc_url( edd_get_checkout_uri() ) . '\">';\n\t\t\t\t\t$items .= wp_kses_data( edd_cart_subtotal() ) . ' - <span class=\"count\">' . wp_kses_data( sprintf( _n( '%d item', '%d items', edd_get_cart_quantity(), 'simple-shop' ), edd_get_cart_quantity() ) ) . '</span>';\n\t\t\t\t$items .= '</a>';\n\t\t\t$items .= '</li>';\n\t\t}\n\t}\n\treturn $items;\n}", "function shoppingcart_after_import_setup($selected_import) {\n $top_menu = get_term_by( 'name','Top Menu', 'nav_menu' );\n $main_menu = get_term_by( 'name','Main menu', 'nav_menu' );\n $catlog_nav_menu = get_term_by( 'name','All Products', 'nav_menu' );\n $social_icon = get_term_by( 'name','Social Links', 'nav_menu' );\n\n set_theme_mod( 'nav_menu_locations', array(\n 'top-menu' => $top_menu->term_id,\n 'primary' => $main_menu->term_id,\n 'catalog-menu' => $catlog_nav_menu->term_id,\n 'social-link' => $social_icon->term_id,\n )\n );\n\n // Assign front page and posts page (blog page).\n $front_page_id = get_page_by_title( 'Home' );\n $blog_page_id = get_page_by_title( 'Blog' );\n\n update_option( 'show_on_front', 'page' );\n update_option( 'page_on_front', $front_page_id->ID );\n update_option( 'page_for_posts', $blog_page_id->ID );\n\n}", "function new_spa_menu_items($items, $args) {\n\n if( get_option('is_single_page') && $args->theme_location == 'header-menu' ){\n\n $myItems = wp_get_nav_menu_items($args->menu);\n foreach ($myItems as $item) {\n if ($item->post_parent){\n $auxUrl = str_replace(get_site_url().'/','#post-', $item->url);\n $auxUrl = str_replace('#post-home/','#post-', $auxUrl);\n $auxUrl = str_replace('#post-inicio/','#post-', $auxUrl);\n $auxUrl = str_replace('/','', $auxUrl);\n $auxUrl = str_replace('#post-',get_site_url().'#post-', $auxUrl);\n\n $items = str_replace($item->url, $auxUrl, $items);\n }\n }\n\n return $items;\n }\n else{\n return $items;\n }\n}", "function urbanfitness_menus()\n{\n // Wordpress Function\n //registering menu we created\n //pass in a associative array\n register_nav_menus([\n 'main-menu' => 'Main Menu',\n ]);\n}", "function register_ac_menu() \n{\n register_nav_menu( 'primary', 'Primary Menu' );\n}", "function wp_widgets_add_menu()\n {\n }", "function templ_add_admin_menu_()\r\n{\r\n\tdo_action('templ_add_admin_menu_');\r\n}", "function default_menu(){\n\twp_nav_menu(array('menu' => 'Main Menu', 'fallback_cb' => 'default_page_menu', 'container' => 'nav', 'container_class' => 'mainmenu', 'menu_class' => 'menu clear'));\n}", "function rt_custom_menu() {\n register_nav_menus(\n array(\n 'top-nav' => __ ('Top menu'),\n 'bottom-nav' => __ ('Bottom menu'),\n )\n );\n}", "function ntp_use_nav_menu() {\n return 'wp_nav_menu';\n}", "function register_crackingthecode_menus() {\n register_nav_menus(\n array(\n 'main-menu' => __('Main Menu','crackingthecode')\n )\n );\n}", "function theme_nav_menus(){\n register_nav_menus( array(\n 'main'=>'Main Menu',\n 'footer'=>'Footer Menu'\n ) );\n}", "function wp_admin_bar_wp_menu($wp_admin_bar)\n {\n }", "function tierone_delta_menu(){\n\twp_nav_menu(\n\t\tarray(\n\t\t\t'theme_location' => 'primary-menu', /* where in the theme it's assigned */\n\t\t\t'menu'\t\t\t => 'main_nav', /* menu name */\n\t\t\t'menu_class'\t => 'nav navbar-nav',\n\t\t\t'container'\t\t => false, /* container class */\n\t\t\t'items_wrap'\t => '<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>',\n\t\t\t'depth' => 2,\n\t\t\t'walker' => new tierone_walker_menu() /* custom walker */\n\t\t)\n\t);\n}", "function agsg_shortcode_add_menu_items()\n{\n global $shortcode_page;\n $shortcode_page = add_menu_page('AGSG Shortcode List', 'AGSG Shortcode List', 'manage_options', 'shortcode_list', 'agsg_shortcode_render_list_page');\n add_action(\"load-$shortcode_page\", \"agsg_shortcode_page_screen_options\");\n add_action('admin_print_styles-' . $shortcode_page, 'agsg_shortcode_list_css_enqueue');\n add_action('admin_print_scripts-' . $shortcode_page, 'agsg_shortcode_list_js_enqueue');\n}", "function CrearMenu(){\n add_menu_page( \n __( 'Custom Menu Title', 'textdomain' ),\n 'Liukin Quotes',\n 'manage_options',\n plugin_dir_path(__FILE__).'admin/quotes_list.php',\n '',\n plugins_url ('/liukin-random-quotes/admin/img/icon.png' ),\n 6\n ); \n}", "public static function menu_item() {\r\n\t\t$app_settings = new Inf_Member_App_Settings();\r\n\r\n\t\t$hook_suffix = add_utility_page(\r\n\t\t\t__( 'Inf Member Plugin Settings', 'inf-member' ), // page <title>\r\n\t\t\t'Inf Member', // menu title\r\n\t\t\t'manage_options', // capability needed\r\n\t\t\tself::PAGE_SLUG, // what should I call you?\r\n\t\t\tarray( &$app_settings, 'settings_page' ), // pageload callback\r\n\t\t\t'' // to be replaced by dashicon\r\n\t\t);\r\n\r\n\t\t// conditional load CSS, scripts\r\n\t\tif ( $hook_suffix ) {\r\n\t\t\t$app_settings->hook_suffix = $hook_suffix;\r\n\t\t\tregister_setting( $hook_suffix, self::OPTION_NAME, array( 'Inf_Member_App_Settings', 'sanitize_options' ) );\r\n\t\t\tadd_action( 'load-' . $hook_suffix, array( &$app_settings, 'onload' ) );\r\n\t\t}\r\n\r\n\t\treturn $hook_suffix;\r\n\t}", "function wpbp_bookmark_add_menu($items, $args)\n{\n if (!is_user_logged_in()) return $items;\n\n if( $args->theme_location == 'primary' ) {\n return $items . '\n <li id=\"wpbp_bookmark_item\" class=\"menu-item menu-item-type-custom menu-item-object-custom wpbp_bookmark_menu\">\n <a href=\"/page-bookmarks/\"><i>★</i>Bookmarks</a>\n </li>\n ';\n }\n return $items;\n}", "function wpvideocoach_custom_menu_icon()\r\n{\r\n\tglobal $wpvideocoach_custom_menu_icon;\r\n\tif(empty($wpvideocoach_custom_menu_icon)){\r\n\t\t$wpvideocoach_custom_menu_icon = plugins_url('wp-video-coach/images/icon.png');\r\n\t}\r\n\treturn $wpvideocoach_custom_menu_icon;\r\n}", "function gymfitness_menus() {\n register_nav_menus( array(\n 'menu-principal' => __( 'Menu Principal', 'gymfitness' )\n ));\n}", "function sc_my_social_create_menu() {\n add_menu_page('SC MY SOCIAL', 'SC My Social', 'administrator', __FILE__, 'sc_my_social_settings_page', 'dashicons-share' );\n\n //call register settings function\n add_action( 'admin_init', 'register_sc_my_social_settings' );\n}", "function basetheme_nav_init()\n{\n\n\tregister_nav_menus( array(\n 'header' => 'Header',\n 'footer' => 'Footer'\n\t) );\n\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n $args['menu_class'] = 'nav-list';\n return $args;\n}", "function skcw_menu_items() {\n\tif (current_user_can('manage_options')) {\n\t\tadd_options_page(\n\t\t\t__('Code To Widget','skctw'),\n\t\t\t__('Code To Widget','skctw'),\n\t\t\t10,\n\t\t\t'code-to-widget',\n\t\t\t'skcw_options'\n\t\t);\n\t}\n}", "function elzero_add_menu() {\n // register_nav_menu('manin-menu', __('Main Navigation Menu'));\n register_nav_menus(array(\n 'main-menu' => 'Main Navigation Menu',\n 'footer-menu' => 'Footer Classic Menu'\n ));\n}", "function erp_add_menu( $component, $args ) {\n add_filter('erp_menu', function($menu) use( $component, $args ) {\n $menu[ $component ][$args['slug']] = $args;\n\n return $menu;\n });\n}", "function wp_get_nav_menu_items($items, $menu, $args)\n {\n }", "public function organique_layered_nav_init( ) {\n\n\t\t\t\tif ( is_active_widget( false, false, 'organique_price_filter', true ) && ! is_admin() ) {\n\n\t\t\t\t\tglobal $_chosen_attributes;\n\n\t\t\t\t\t$_chosen_attributes = array();\n\n\t\t\t\t\t$attribute_taxonomies = wc_get_attribute_taxonomies();\n\t\t\t\t\tif ( $attribute_taxonomies ) {\n\t\t\t\t\t\tforeach ( $attribute_taxonomies as $tax ) {\n\n\t\t\t\t\t\t\t$attribute = wc_sanitize_taxonomy_name( $tax->attribute_name );\n\t\t\t\t\t\t\t$taxonomy = wc_attribute_taxonomy_name( $attribute );\n\t\t\t\t\t\t\t$name = 'filter_' . $attribute;\n\t\t\t\t\t\t\t$query_type_name = 'query_type_' . $attribute;\n\n\t\t\t\t\t\t\tif ( ! empty( $_GET[ $name ] ) && taxonomy_exists( $taxonomy ) ) {\n\n\t\t\t\t\t\t\t\t$_chosen_attributes[ $taxonomy ]['terms'] = explode( ',', $_GET[ $name ] );\n\n\t\t\t\t\t\t\t\tif ( empty( $_GET[ $query_type_name ] ) || ! in_array( strtolower( $_GET[ $query_type_name ] ), array( 'and', 'or' ) ) )\n\t\t\t\t\t\t\t\t\t$_chosen_attributes[ $taxonomy ]['query_type'] = apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' );\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$_chosen_attributes[ $taxonomy ]['query_type'] = strtolower( $_GET[ $query_type_name ] );\n\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\tadd_filter('loop_shop_post_in', array( $this, 'layered_nav_query' ) );\n\t\t\t\t}\n\t\t\t}", "function register_my_menu() {\n register_nav_menu( 'primary', __( 'Primary Menu' ) );\n}", "function modify_nav_menu_args( $args )\n{\n$args['exclude'] = get_option('spreadshop_product_detail_page').','.get_option('spreadshop_article_detail_page');\nreturn $args;\n}", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function custom_theme_setup() {\n register_nav_menus( array( \n 'header' => 'Header menu', \n 'footer' => 'Footer menu' \n ) );\n}", "function register_my_menu() {\n register_nav_menu('footer-menu',__( 'Footer Menu' ));\n}", "function wptf_admin_menu() {\n add_menu_page('Blaketrix Woo Table', 'Diplay BX Table', 'edit_theme_options', 'wpt-shop', 'wptf_shortcode_generator_page', 'dashicons-list-view',40);\n add_submenu_page('wpt-shop', 'Configuration Blaketrix Table', 'MINI configs', 'edit_theme_options', 'wpt-shop-config', 'wptf_configuration_page');\n ;\n \n}", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "function wp_admin_bar_my_account_menu($wp_admin_bar)\n {\n }", "function social_media_menu() {\r\n // display the WordPress Custom Menu if available\r\n wp_nav_menu(array(\r\n 'menu' => 'social-media',\r\n 'theme_location' => 'social',\r\n 'depth' => 2,\r\n 'container' => 'div',\r\n 'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',\r\n 'menu_class' => 'nav navbar-nav soc-med',\r\n 'fallback_cb' => 'wp_bootstrap_navwalker::fallback',\r\n 'walker' => new wp_bootstrap_navwalker()\r\n ));\r\n}", "function register_main_menu() {\n // register_nav_menu( 'main-menu', __('Main Menu') );\n register_nav_menus( array(\n 'main-menu' => __('Main Menu'),\n 'need-help-menu' => __('Need Help Menu'),\n 'company-menu' => __('Company Menu')\n ) );\n}", "private function _add_filters() {\n\t\t\tadd_filter('wp_setup_nav_menu_item', array($this, 'add_custom_options'));\n\n\t\t\t# Update custom menu options\n\t\t\tadd_action('wp_update_nav_menu_item', array($this, 'update_custom_options'), 10, 3);\n\n\t\t\t# Set edit menu walker\n\t\t\tadd_filter('wp_edit_nav_menu_walker', array($this, 'apply_edit_walker_class'), 10, 2);\n\t\t\t\n\t\t\t# Addition style\n\t\t\tadd_action('admin_enqueue_scripts', array( $this, 'add_menu_css' ));\n\t\t\t\n\t\t\t# Addition js\n\t\t\tadd_action('admin_head-nav-menus.php', array( $this, 'add_icon_js' ));\n\n\t\t\t# Mega menu javascript\n\t\t\tadd_action('admin_enqueue_scripts', array( $this, 'wtbx_mega_menu_admin_scripts' ), 80);\n\t\t}", "function add_transfers_icon_backend(){\n ?>\n <style type=\"text/css\">\n #menu-posts-transfers .wp-menu-image{\n background:transparent url(\"<?php bloginfo('stylesheet_directory'); ?>/images/transfers_icon.png\") no-repeat 50% 50% !important;\n background-size: 85% 85%!important;\n }\n #menu-posts-transfers .dashicons-before:before {\n content: none!important;\n }\n </style>\n <?php \n}", "function wooadmin_rename_admin_menu_items( $menu ) {\n $menu = str_ireplace( 'Woocommerce', 'Eshopbox', $menu );\n // return $menu array\n return $menu;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function register_my_menu()\r\n{\r\n register_nav_menus(\r\n array(\r\n 'main' => 'Menu Principal',\r\n 'footer' => 'Menu Bas de Page',\r\n 'social' => 'Menu Réseaux Sociaux',\r\n 'side' => 'Menu bouton toggler'\r\n )\r\n );\r\n}", "function myAccountMenuOrder()\n{\n\n $menuOrder = array(\n SUBS_ENDPOINT => __(' Dostęp do radia', 'woocommerce'),\n 'orders' => __('Orders', 'woocommerce'),\n 'edit-address' => __('Addresses', 'woocommerce'),\n 'edit-account' => __('Szczegóły Konta', 'woocommerce'),\n 'customer-logout' => __('Logout', 'woocommerce'),\n // 'downloads' => __('Download', 'woocommerce'),\n // 'dashboard' => __('Dashboard', 'woocommerce'),\n );\n\n return $menuOrder;\n}", "function gymfitness_menus(){ \n register_nav_menus(array(\n 'menu-principal' =>__('Menu principal', 'gymfitness'),\n 'menu-principal2' =>__('Menu principal2', 'gymfitness')\n\n ));\n}", "public function filter_wp_nav_menu_args($args)\n {\n }", "function wp_admin_bar_customize_menu($wp_admin_bar)\n {\n }", "function wpvideocoach_custom_menu_title()\r\n{\r\n\tglobal $wpvideocoach_custom_menu_title;\r\n\tif(empty($wpvideocoach_custom_menu_title)){\r\n\t\t$wpvideocoach_custom_menu_title = __('Video Coach', 'wp-video-coach');\r\n\t}\r\n\treturn $wpvideocoach_custom_menu_title;\r\n}", "function band_theme_support() {\n add_theme_support('title-tag');\n add_theme_support('post-thumbnails');\n //navigacija\n register_nav_menus(array(\n 'primary' => __('Primary Menu')\n ));\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function threed_admin_plugin_menu_links($menu)\n{\n $menu[] = array(\n 'NAME' => 'ThreeD',\n 'URL' => THREED_ADMIN,\n );\n return $menu;\n}", "function wp_get_nav_menus($args = array())\n {\n }", "function sp_main_navigation() {\n\t\tif ( function_exists ( 'wp_nav_menu' ) )\n\t\t\twp_nav_menu( array(\n\t\t\t\t'container' => false,\n\t\t\t\t'menu_class'\t => 'main-menu',\n\t\t\t\t'theme_location' => 'primary_nav',\n\t\t\t\t'fallback_cb' => 'sp_main_nav_fallback'\n\t\t\t\t) );\n\t\telse\n\t\t\tsp_main_nav_fallback();\t\n\t}", "function register_menus()\n{\n register_nav_menus(array(\n 'primary' => __('Primary Navigation', 'pd'),\n 'footer' => __('Footer Navigation', 'pd'),\n ));\n}", "function ob_add_amazon_link_plugin_menu() {\n\tadd_menu_page( 'Amazon link', 'Amazon link', 'administrator', 'amazon-link', 'ob_amazon_link', 'dashicons-amazon' );\n}", "function at_try_menu()\n{\n add_menu_page('signup_list', //page title\n 'Sign Up List', //menu title\n 'manage_options', //capabilities\n 'Signup_List', //menu slug\n Signup_list //function\n );\n}", "function jpst_create_menu() {\nadd_menu_page('Twitter Widget with Cache', 'Twitter Widget','administrator', __FILE__, 'jpst_settings_page',plugins_url('/twitterbrd.png', __FILE__));\n\n//call register settings function \nadd_action( 'admin_init', 'jpst_register_settings' );\n\n}", "function atcf_theme_variable_pricing() {\n\tremove_action( 'edd_purchase_link_top', 'edd_purchase_variable_pricing' );\n\tadd_action( 'edd_purchase_link_top', 'atcf_purchase_variable_pricing' );\n}", "function test_theme_setup(){\n\n // Nav Menus\n register_nav_menus(array(\n 'primary' => __('Primary Menu')\n ));\n\n}", "function sp_main_navigation() {\n\t\tif ( function_exists ( 'wp_nav_menu' ) )\n\t\t\twp_nav_menu( array(\n\t\t\t\t'container' => false,\n\t\t\t\t'menu_class'\t => 'menu-nav',\n\t\t\t\t'theme_location' => 'primary_nav',\n\t\t\t\t'fallback_cb' => 'sp_main_nav_fallback'\n\t\t\t\t) );\n\t\telse\n\t\t\tsp_main_nav_fallback();\t\n\t}", "function primary_add_menu_atts( $atts, $item, $args ) {\r\n\tif( $args->theme_location == 'primary-menu' ) {\r\n\t$atts['class=\"nav-link js-scroll-trigger\"'] = 'return true';\r\n}\r\n return $atts;\r\n}", "function gera_item_no_menu()\n{\n //add_menu_page('Configurações do Plugin Menu', 'Config Plugin Menu', 'administrator', 'Config Plugin Menu', 'abre_config_plugin_menu', 'dashicons-airplane');\n\n //Para criar um sub-item em um menu existente da Sidebar padrão Wordpress\n add_submenu_page('options-general.php', 'Configurações do Plugin Menu', 'Config Plugin Menu', 'administrator', 'config-plugin-menu', 'abre_config_plugin_menu', 2);\n}", "function register_menus() { \n register_nav_menus(\n array(\n 'main-menu' => 'Main Menu', //primary menu\n )\n ); \n}", "function get_ffd_currency() {\r\n\treturn apply_filters( 'ffd_currency', get_option( 'ffd_currency' ) );\r\n}", "function register_my_menus() {\r\n register_nav_menus(\r\n array(\r\n 'primary-nav' => __( 'Primary Navigation' ),\r\n 'bottom-nav' => __( 'Bottom Navigation' )\r\n )\r\n );\r\n}", "function my_wp_nav_menu_args($args = '')\n{\n $args['container'] = false;\n return $args;\n}", "function register_menus() {\n\tregister_nav_menu( 'main', __( 'Main Menu', 'postlight-headless-wp' ) );\n}", "function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}", "function theme_setup() {\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', '%%%PACKAGE_NAME%%%' ),\n 'footer' => __('Footer Menu', '%%%PACKAGE_NAME%%%' )\n ) );\n }", "function register_my_menu() {\n register_nav_menu( 'main', __( 'Main' ) );\n register_nav_menu( 'footer', __( 'Footer' ) ); \n}", "function ltthe_setup()\r\n{\r\n\tadd_theme_support('post-thumbnails');\r\n\r\n\tremove_action('wp_head','wp_generator');\r\n\r\n\tremove_filter('the_content','wptexturize');\r\n\tremove_filter('the_excerpt','wptexturize');\r\n\r\n\tadd_theme_support('title-tag');\r\n\r\n\trequire_once('includes/wp-bootstrap-navwalker.php');\r\n\r\n\tregister_nav_menus( array('primary' =>__('principal')) );\r\n}" ]
[ "0.74404657", "0.68984455", "0.6791238", "0.66568035", "0.6655552", "0.66424197", "0.6597549", "0.65924525", "0.6578786", "0.64992946", "0.6378069", "0.63747925", "0.62441325", "0.6230045", "0.6218056", "0.6207642", "0.6202662", "0.6190292", "0.61674803", "0.61541367", "0.61372983", "0.61168104", "0.61128426", "0.60867864", "0.60862297", "0.6081865", "0.6063489", "0.6056448", "0.60486484", "0.60444826", "0.60391164", "0.6033255", "0.6023622", "0.60168153", "0.60152406", "0.6012101", "0.60100937", "0.6002871", "0.59882945", "0.5981119", "0.59808713", "0.5978858", "0.597454", "0.59743226", "0.59694284", "0.5968073", "0.59670323", "0.5965709", "0.5961101", "0.5958257", "0.5952105", "0.59493023", "0.5941943", "0.593157", "0.5926146", "0.5922762", "0.5922762", "0.5922762", "0.5916701", "0.59165233", "0.59104717", "0.5901717", "0.58935773", "0.5884867", "0.58731794", "0.5869907", "0.58629924", "0.5861265", "0.5855319", "0.5855319", "0.5855319", "0.5855319", "0.58529824", "0.58442557", "0.58411765", "0.58390284", "0.5826813", "0.58262783", "0.5825111", "0.58247304", "0.5821671", "0.58202684", "0.58185846", "0.5816633", "0.5814061", "0.58129174", "0.5812014", "0.58110154", "0.5810538", "0.5808119", "0.5804882", "0.58032244", "0.57965577", "0.57938546", "0.5792482", "0.579226", "0.5791381", "0.57899946", "0.5788246", "0.57818645", "0.57806987" ]
0.0
-1
// G E N E R A L S E T T I N G S F I E L D S //
function add_getfaircoin_settings($settings) { $getfaircoin_settings = array( 'faircoin_settings' => array( 'id' => 'faircoin_settings', 'name' => '<strong>' . __( 'FAIRCOIN Settings', 'edd-getfaircoin' ) . '</strong>', 'desc' => __( 'Set the actual Faircoin options', 'edd-getfaircoin' ), 'type' => 'header' ), 'faircoin_price' => array( 'id' => 'faircoin_price', 'name' => __( 'Faircoin-Euro Price', 'edd-getfaircoin' ), 'desc' => __( 'Put manually the actual Faircoin price related Euro: 1 ƒ = n €', 'edd-getfaircoin' ), 'type' => 'text', 'size' => 'medium', 'std' => '100.01' ), 'general_settings' => array( 'id' => 'general_settings', 'name' => '<strong>' . __( 'GENERAL Settings', 'edd-getfaircoin' ) . '</strong>', 'desc' => '', 'type' => 'header' ), ); return array_merge($getfaircoin_settings, $settings); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "public function helper()\n\t{\n\t\n\t}", "function handle() ;", "function process() ;", "public function native();", "public function testPingTreeGetItem()\n {\n }", "private function guest ()\n\t{\n\t\t;\n\t}", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "private function __() {\n }", "public function testPingTreeGet()\n {\n }", "private function j() {\n }", "function tp ()\n{\n return TPL;\n}", "public function testMessageThreadsV2Get()\n {\n }", "function _NDL()\r\n\t{\r\n\r\n\t}", "public function testMessageThreadsV2Get0()\n {\n }", "function getStatus() ;", "function getStatus() ;", "function getStatus() ;", "abstract protected function mini(): string;", "abstract protected function _run();", "abstract protected function _run();", "private function __construct () {}", "function generate() ;", "public function nadar()\n {\n }", "function GenerateUuid() \n{ \n $s = strtoupper(md5(uniqid(rand(),true))); \n $uuid = \n substr($s, 0, 8) . '-' . \n substr($s, 8, 4) . '-' . \n substr($s, 12, 4). '-' . \n substr($s, 16, 4). '-' . \n substr($s, 20);\n \n return $uuid;\n}", "protected function _exec()\n {\n }", "function generate_unique_id() {\n\t/*\n\tGenerates random binary ID. \n\tReturns the ID.\n\t*/\n\t$onetwo = [\"&zwj;\", \"&zwnj;\"];\n\t$uniqueid = '';\n\tfor ($i = 0; $i < 8; $i++) {\n\t\t$uniqueid .= $onetwo[rand(0, 1)];\n\t}\n\n\treturn $uniqueid;\n}", "public function testPingTreeCreatePingTree()\n {\n }", "public function tell() {}", "private function __construct()\t{}", "function t ()\n{\n echo TPL;\n}", "private function __construct() {}", "private final function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.5773305", "0.5284896", "0.5017293", "0.49124473", "0.49034098", "0.4883343", "0.48758993", "0.4830387", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47953275", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.47926715", "0.4773373", "0.4741313", "0.4735806", "0.47150016", "0.4695841", "0.46944326", "0.469433", "0.4671899", "0.46711826", "0.46711826", "0.4667689", "0.4648383", "0.4648383", "0.46390384", "0.463682", "0.46190593", "0.46044573", "0.45834073", "0.45825994", "0.45745492", "0.45739153", "0.4568652", "0.45672825", "0.45590037", "0.45577583", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828", "0.45571828" ]
0.0
-1
// P O S T G A T E W A Y S E T T I N G S //// Render Gateway Specific
function edd_render_gateway_choice( $post_id ) { $post_gate = get_post_meta( $post_id, '_edd_gateway', true ); $gateways = edd_get_payment_gateways(); $gateway_options = array(); foreach($gateways as $key => $arr){ $gateway_options[$key] = $arr['admin_label']; } $fiat_fee = get_post_meta( $post_id, '_edd_fiat_fee') ? get_post_meta( $post_id, '_edd_fiat_fee', true ) : '0'; $fair_fee = get_post_meta( $post_id, '_edd_faircoin_fee') ? get_post_meta( $post_id, '_edd_faircoin_fee', true ) : '1'; $gateway_order = get_post_meta( $post_id, '_edd_order') ? get_post_meta( $post_id, '_edd_order', true) : '0'; ?> <p><strong><?php _e( 'Gateway Options:', 'edd-getfaircoin' ); ?></strong></p> <p> <label for="_edd_gateway"> <?php echo EDD()->html->select( array( 'name' => '_edd_gateway', 'options' => $gateway_options, 'show_option_all' => null, 'show_option_none' => null, 'selected' => $post_gate ) ); ?> <?php _e( 'Specific gateway', 'edd-getfaircoin' ); ?> </label> </p> <p> <label for="_edd_order"> <?php echo EDD()->html->text( array( 'name' => '_edd_order', 'value' => $gateway_order, 'placeholder' => '0', 'class' => 'small-text' ) ); ?> <?php _e( 'Order', 'edd-getfaircoin' ); ?> </label> </p> <p> <label for="_edd_fiat_fee"> <?php echo EDD()->html->text( array( 'name' => '_edd_fiat_fee', 'value' => $fiat_fee, 'placeholder' => '0', 'class' => 'small-text' ) ); ?> <?php _e( '% Fiat Fee', 'edd' ); ?> </label> <label for="_edd_faircoin_fee"> <?php echo EDD()->html->text( array( 'name' => '_edd_faircoin_fee', 'value' => $fair_fee, 'placeholder' => '1', 'class' => 'small-text' ) ); ?> <?php _e( '% Fairc. Fee', 'edd-getfaircoin' ); ?> </label> </p> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render(){\n\t\t\n\t}", "abstract public function render() ;", "function render() ;", "protected function render() {}", "protected function render() {}", "protected function render() {}", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {\r\n\t\t\r\n\t}", "protected function _render()\n {\n }", "public function render_stub() {}", "function outputled_gateway() {\n\t\tglobal $g;\n\t\tglobal $config;\n\t\t$a_gateways = return_gateways_array();\n\t\t$gateways_status = array();\n\t\t$gateways_status = return_gateways_status(true);\n\t\tforeach ($a_gateways as $gname => $gateway)\n\t\t{\n\t\t\tif ($gateways_status[$gname]['status'] != \"none\")\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}", "function render_frontend(){\r\n if ($this -> type == 'textelement' || $this -> type == 'menu' || $this -> type == 'socialicons' || $this -> type == 'copyright' ) {\r\n if ($this -> text_align == 'left') {\r\n $text_align_class = 'align-left';\r\n }elseif ($this -> text_align == 'center'){\r\n $text_align_class = 'align-center';\r\n }elseif ($this -> text_align == 'right'){\r\n $text_align_class = 'align-right';\r\n }\r\n }else { $text_align_class = ''; } \r\n $type = $this -> type;\r\n echo '<div class=\"' . $this -> type . ' ' . $text_align_class . ' ' . LBRenderable::$words[ $this -> element_columns ] . ' columns\">';\r\n call_user_func( array ( $this, \"render_frontend_$type\" ) );\r\n echo '</div>';\r\n }", "function renderToClient();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "abstract public function render();", "public abstract function render();", "public abstract function render();", "public function renderNetwork()\n\t{\n // translate twig text\n $i18n = array(\n 'search' => __('Search', 'next-active-directory-integration'),\n 'title' => __('Profile assignment', 'next-active-directory-integration'),\n 'defaultProfile' => __('Default profile', 'next-active-directory-integration'),\n 'noneAssigned' => __('--- None assigned', 'next-active-directory-integration'),\n 'apply' => __('Apply', 'next-active-directory-integration'),\n 'changeBlogs' => __('Change selected blogs to profile', 'next-active-directory-integration'),\n 'useDefaultProfile' => __('--- Use default profile', 'next-active-directory-integration')\n );\n\t\t$i18n = NextADInt_Core_Util_EscapeUtil::escapeHarmfulHtml($i18n);\n\n\t\t$this->display(self::TEMPLATE, array(\n\t\t\t'nonce' => wp_create_nonce(self::NONCE), //create nonce for security\n\t\t\t'table' => $this->blogProfileRelationshipController->buildSiteTable(),\n 'i18n' => $i18n\n\t\t));\n\t}", "public function render()\n {\n \n }", "public function render()\n {\n }", "public function render()\n {\n }", "public function render()\n {\n }", "public function render()\n {\n }", "public function getGatewayTitle()\n {\n return GatewayInfo::niceTitle($this->Gateway);\n }", "function render(){\n\t\t\n\t}", "abstract function render();", "protected function render()\n {\n }", "protected function render()\n {\n }" ]
[ "0.6210329", "0.6175689", "0.61492145", "0.6125688", "0.6124968", "0.6124968", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.6117291", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60901916", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.60884684", "0.6021582", "0.60180265", "0.59972256", "0.59766084", "0.59732574", "0.5969649", "0.5920043", "0.5920043", "0.5920043", "0.5920043", "0.5920043", "0.5920043", "0.5908757", "0.5908757", "0.5890336", "0.5872307", "0.5826438", "0.5826438", "0.5826438", "0.5826438", "0.58243", "0.58238626", "0.5823223", "0.57973045", "0.5796402" ]
0.0
-1
// H O M E O R D E R ////
function getfaircoin_edd_downloads_query( $query, $atts ) { global $pagenow; if( 'index.php' != $pagenow ) return $query; $query[ 'meta_key' ] = '_edd_order'; $query[ 'orderby' ] = 'meta_value_num'; $query[ 'order' ] = 'ASC'; return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "public function helper()\n\t{\n\t\n\t}", "private function __() {\n }", "private function j() {\n }", "abstract protected function mini(): string;", "function specialop() {\n\n\n\t}", "public function ex4()\n {\n }", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function oops () {\n }", "public function main()\r\n {\r\n \r\n }", "public static function main(){\n\t\t\t\n\t\t}", "public function main()\n\t{\n\t}", "public function f02()\n {\n }", "private function aFunc()\n {\n }", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "function yy_r113()\n {\n return;\n }", "protected function test9() {\n\n }", "private function __construct( )\n {\n\t}", "private function __construct()\t{}", "public function f01()\n {\n }", "function __construct() ;", "public function aaa() {\n\t}", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "protected function _getNextCode() {}", "final private function __construct(){\r\r\n\t}", "function m() {\n }", "function m() {\n }", "final function __construct() { \n\t}", "function yy_r83(){return; }", "public function nadar()\n {\n }", "function handle() ;", "private function __construct () {}", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "private function __construct() {;}", "private function __construct() {}", "private function __construct() {}", "public function \tc_main(){ return \"\"; }", "private final function __construct() {}", "public static function dummy() {}", "function generate() ;", "function __toString() ;", "function __toString() ;", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "final private function __construct() {}", "final private function __construct() {}", "function stringMethod()\n {\n// return 1;\n }", "public function serch()\n {\n }" ]
[ "0.64852035", "0.6046081", "0.5719545", "0.55712384", "0.55657476", "0.5450696", "0.5449611", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.54173934", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.5415593", "0.54102445", "0.5396514", "0.53801787", "0.5365362", "0.5333973", "0.5333427", "0.52794975", "0.5268378", "0.52624667", "0.5260576", "0.52600217", "0.52423626", "0.52337974", "0.52295923", "0.52255535", "0.5221902", "0.52182907", "0.5211919", "0.5211919", "0.52110213", "0.5208601", "0.51973516", "0.5187702", "0.5170646", "0.5170263", "0.51678216", "0.5163418", "0.5163418", "0.51529366", "0.51423144", "0.5141769", "0.51356685", "0.51351255", "0.5133972", "0.5124704", "0.5124704", "0.5124704", "0.5124704", "0.51234365", "0.51234365", "0.5119929", "0.5113231" ]
0.0
-1
// P A Y M E N T H I S T O R Y /////
function payments_table_gateway_column( $columns ){ $columns['gateway'] = __('Gateway', 'edd-getfaircoin'); return $columns; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "public function helper()\n\t{\n\t\n\t}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "function handle() ;", "public function nadar()\n {\n }", "function tp ()\n{\n return TPL;\n}", "function twitter_tester(){\n\tget_twitter_message_info($nickname=\"paul\",$num_messages=10);\n}", "abstract protected function mini(): string;", "function t ()\n{\n echo TPL;\n}", "public function main()\n\t{\n\t}", "public function _strings_for_pot()\n {\n }", "public function main()\r\n {\r\n \r\n }", "function yy_r83(){return; }", "public function tell() {}", "function getStatus() ;", "function getStatus() ;", "function getStatus() ;", "public function truycapvao_private_cha(){\n }", "function get_to_ping($post)\n {\n }", "public function serch()\n {\n }", "public function testCreatePatrimonio()\n {\n }", "public function testDSTIdGet()\n {\n }", "function yy_r113()\n {\n return;\n }", "abstract public function generate() : string;", "function Post_Time($timestamp)\n{\n\t$hrformat = \"%A, %d.%m.%Y. u %H:%M\"; \n\t$res = strftime($hrformat,strtotime($timestamp)); \n\t$vrijeme = iconv('ISO-8859-2', 'UTF-8', $res);\n\t\n\techo($vrijeme);\t\n}", "public static function main(){\n\t\t\t\n\t\t}", "function present_token($tid) {\n global $tokens;\n die((__FUNCTION__).\" is legacy and shouldn't be used. Someone fix that.\");\n\n if($tokens[$tid][img]==\"\") return \"\";\n \n return \"<img src='\".$tokens[$tid][img].\"' title='\".htmlentities($tokens[$tid][name]).\"' style='vertical-align:text-bottom;padding-right:2px'>\";\n}", "abstract public function getPasiekimai();", "function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}", "function process() ;", "function pingback_ping_source_uri($source_uri)\n {\n }", "public function tell()\n {\n }", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }", "protected abstract function _message();", "function greeting(){\n\t\t\techo \"Idol ni Noli si Pong\";\n\t\t}", "function yy_r68(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "private function __construct () {}", "private function __() {\n }", "function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "public function testGetPatrimonio()\n {\n }", "function phpfmg_auto_response_message(){\r\n ob_start();\r\n?>\r\n\r\n<?php\r\n $msg = ob_get_contents() ;\r\n ob_end_clean();\r\n return trim($msg);\r\n}", "private function __construct( )\n {\n\t}", "private function __construct()\t{}", "private function j() {\n }", "public function main()\n {\n\n }", "function pied()\n\t{\n\t\techo \"\\t\".'</body>'.\"\\n\".'</html>';\n\t}", "function tweet_story($id,$title,$msg) {\n\t\n\t// build the URL for the story\n\t$url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . '?id=' . $id;\n\t\n\t// get length of string for message and URL (includes space in between)\n\t$cnt = strlen($url) + strlen($msg) + 1;\n\t\n\t// chars available for title\n\t$whats_left = 140-$cnt;\n\t\n\tif (strlen($title) < $whats_left) {\n\t\t// We have enough room for the full title, return the encoded part of the twitter\n\t\t// status message\n\t\treturn urlencode($msg . ' ' . $title . ' ') . $url . urlencode(' #5cardflickr');\n\t\t\n\t} else {\n\t\t// shorten the title\n\t\treturn urlencode($msg . ' ' . substr($title, 0 , $whats_left-3) . '... ') . $url . urlencode(' #5cardflickr');\n\t}\n\n}", "function getResponse();", "function getResponse();", "function parse():bool\n {\n // echo \"方法\".__CLASS__.__METHOD__.PHP_EOL;\n $this->info(\"msg\",$this->getData());\n //sleep(2);\n return true;\n }" ]
[ "0.54104805", "0.5167586", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5104864", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5103404", "0.5024572", "0.4900696", "0.48767248", "0.48399934", "0.48246205", "0.48224288", "0.4814726", "0.4791508", "0.47904778", "0.47890526", "0.47885132", "0.4786556", "0.47854966", "0.47854966", "0.47827184", "0.47734722", "0.4764979", "0.47544342", "0.47389787", "0.4737656", "0.47335416", "0.4729331", "0.47289345", "0.47033584", "0.4697494", "0.46749747", "0.4674806", "0.4664071", "0.4657163", "0.4655896", "0.46554682", "0.46518782", "0.4649352", "0.46450892", "0.4642604", "0.46416798", "0.46306226", "0.46298474", "0.46231875", "0.46227092", "0.46207806", "0.4616838", "0.46161348", "0.46116576", "0.46072316", "0.46072316", "0.46060264" ]
0.0
-1
$columns['gateway'] = array('gateway', false);
function payments_table_gateway_column_sortable( $columns ){ //$columns['status'] = array('status', false); return $columns; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function payments_table_gateway_column( $columns ){\r\n $columns['gateway'] = __('Gateway', 'edd-getfaircoin');\r\n return $columns;\r\n}", "function kt_invoices_columns_add($columns) {\n\tunset($columns['date']);\n\t// unset($columns['package']);\n\tunset($columns['price']);\n\tunset($columns['payment_option']);\n\tunset($columns['title']);\n\t$columns['user'] \t\t= pll__('User','docdirect_core');\n\t$columns['package'] \t\t\t= pll__('Package','docdirect_core');\n\t$columns['payment_option'] \t\t= pll__('Payment Method','docdirect_core');\n\t$columns['price'] \t\t= pll__('Price','docdirect_core');\n \n\t\treturn $columns;\n}", "function wpc_client_my_columns( $columns ) {\r\n $columns['clients'] = 'Clients';\r\n $columns['groups'] = 'Client Circles';\r\n\r\n unset($columns['date']);\r\n $columns['date'] = 'Date';\r\n\r\n return $columns;\r\n }", "public function table() {\n return 'gateway';\n }", "function get_columns()\n {\n $columns = array(\n\n 'cb' => '<input type=\"checkbox\" />', //Render a checkbox instead of text\n 'id' => __('# ID'),\n 'user' => __('Requested From'),\n //'requested_url' => __('Requested URI'),\n 'Ip' => __('From IP'),\n 'connected_at' => __('Requested At'),\n // 'msg' => __('Message'),\n 'on_status' => __('On'), \n 'action_trig' => __('Details')\n );\n\n return $columns;\n }", "protected function _getTableOptions(){ }", "function hub_columns( $columns ) {\r\n $columns['hub_title'] = 'HUB Title';\r\n $columns['client'] = 'Client';\r\n\r\n unset( $columns['title'] );\r\n unset( $columns['date'] );\r\n\r\n $columns['date'] = 'Date';\r\n\r\n return $columns;\r\n }", "protected function _prepareColumns()\n {\n if (Mage::helper('route')->canChangeOrderGrid()) {\n\n $this->addColumnAfter('route_is_insured', array(\n 'header'=> Mage::helper('sales')->__('Route Insurance'),\n 'width' => '80px',\n 'index' => 'route_is_insured',\n 'type' => 'options',\n 'renderer' => 'route/adminhtml_widget_grid_column_renderer_insured',\n 'options' => array(\n 1 => 'Yes',\n 0 => 'No',\n ),\n ),'status');\n\n $this->addColumnAfter('fee_amount', array(\n 'header'=> Mage::helper('sales')->__('Route Charge'),\n 'width' => '80px',\n 'filter' => false,\n 'sortable' => false,\n 'type' => 'currency',\n 'index' => 'fee_amount',\n 'currency' => 'order_currency_code',\n ),'route_is_insured');\n }\n parent::_prepareColumns();\n }", "public function getColumnConfig();", "function col_cost_country(){\n\t\t$column_array = array(\n\t\t\t\t0 => 'B.id_shipping_cost',//default order sort\n\t\t\t\t1 => 'B.id_shipping_cost',//default order sort\n\t\t\t\t2 => 'B.id_country_to',\n\t\t\t\t3 => 'A.country_name',\n\t\t\t\t4 => 'B.weight_first',\n\t\t\t\t5 => 'B.weight_last',\n\t\t\t\t6 => 'B.margin',\n\t\t\t\t7 => 'B.price'\n\t\n\t\t);\n\t\treturn $column_array;\n\t}", "function wc_veruspay_add_order_column_header( $columns ) {\n $wc_veruspay_new_columns = array();\n foreach ( $columns as $column_name => $column_info ) {\n\t\t$wc_veruspay_new_columns[ $column_name ] = $column_info;\n\t\tif ( 'order_status' == $column_name ) {\n\t\t\t$wc_veruspay_new_columns['verus_addr'] = __( 'Crypto Address', 'veruspay-verus-gateway' );\n\t\t}\n if ( 'order_total' == $column_name ) {\n $wc_veruspay_new_columns['verus_total'] = __( 'Crypto Total', 'veruspay-verus-gateway' );\n }\n }\n return $wc_veruspay_new_columns;\n}", "function get_columns()\n {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />', //Render a checkbox instead of text\n// 'type' => 'Type',\n// 'name' => 'Name',\n 'tag' => 'Shortcode Name',\n 'kind' => 'Kind',\n 'description' => 'Description',\n 'example' => 'Example',\n 'code' => 'Code',\n 'created_datetime' => 'Created Datetime'\n );\n return $columns;\n }", "protected function _getGateway() {\r\n return $this->_tableGateway;\r\n }", "function ysg_edit_columns( $columns ) {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'ysg_image' => __( 'Imagem do V&iacute;deo', 'youtube-simple-gallery' ),\n 'ysg_title' => __( 'T&iacute;tulo', 'youtube-simple-gallery' ),\n 'ysg_categories' => __(\"Categoria\", 'youtube-simple-gallery' ),\n 'ysg_url' => __( 'Link do V&iacute;deo', 'youtube-simple-gallery' )\n );\n\n return $columns;\n}", "function get_columns()\n { // global $hb_current_user_can_ap;\n $columns =\n ['cb' => '<input type=\"checkbox\" />'] + //Render a checkbox instead of text\n //($a ? ['wp_username' => 'User'] : [] )+\n ['date_added' => 'Form submitted on']+ \n //['car_holder_name' => 'Name']+\n ['venue_address' => 'Venue Address']+\n ['suburb' => 'Suburb']+\n ['post_code' => 'Post Code']+\n ['booking_date' => 'Booking Date']+\n ['view_details' => 'View Details']\n ;\n return $columns;\n }", "protected function _prepareColumns()\n {\n $this->addColumn('increment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'increment_id',\n 'filter_index' => 'main_table.increment_id',\n 'type' => 'text',\n ));\n $this->addColumn('shipment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'entity_id',\n 'filter_index' => 'main_table.entity_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('canpar_shipment_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Shipment #'),\n 'index' => 'canpar_shipment_id',\n 'filter_index' => 'ch_shipment.shipment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('manifest_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Manifest #'),\n 'index' => 'manifest_id',\n 'renderer' => 'canparmodule/adminhtml_canparshipment_renderer_manifestId',\n 'filter_index' => 'ch_shipment.manifest_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date Shipped'),\n 'index' => 'created_at',\n 'filter_index' =>'main_table.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('order_increment_id', array(\n 'header' => Mage::helper('sales')->__('Order #'),\n 'index' => 'order_increment_id',\n 'filter_index'=> 'o.increment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('order_created_date', array(\n 'header' => Mage::helper('sales')->__('Order Date'),\n 'index' => 'order_created_date',\n 'filter_index' =>'o.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('total_qty', array(\n 'header' => Mage::helper('sales')->__('Total Qty'),\n 'index' => 'total_qty',\n 'type' => 'number',\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('sales')->__('Action'),\n 'width' => '50px',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('sales')->__('View'),\n 'url' => array('base'=>'*/sales_shipment/view'),\n 'field' => 'shipment_id'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return parent::_prepareColumns();\n }", "function custom_columns( $columns ) {\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'title' => 'Title',\n\t\t'featured_image' => 'Photo',\n\t\t'date' => 'Date'\n\t);\n\treturn $columns;\n}", "function col_cost(){\n\t\t$column_array = array(\n\t\t\t\t0 => 'B.id_shipping_cost',//default order sort\n\t\t\t\t1 => 'B.id_shipping_cost',//default order sort\n\t\t\t\t2 => 'B.id_districts_to',\n\t\t\t\t3 => 'A.districts_name',\n\t\t\t\t4 => 'B.weight',\n\t\t\t\t5 => 'B.price'\n\t\n\t\t);\n\t\treturn $column_array;\n\t}", "function eddenvato_add_id($columns) {\n //$columns['user_id'] = 'User ID';\n $columns['purchase_codes'] = 'Purchase Codes';\n return $columns;\n}", "public function shop_order_columns( $columns ) {\n\t\t$columns['shipment_tracking'] = __( 'Shipment Tracking', 'woocommerce-shipment-tracking' );\n\t\treturn $columns;\n\t}", "protected function AdminRows_settings_columns() {\n\treturn array(\n\t 'ID' => 'ID',\n\t 'ID_Parent' \t=> 'Parent',\n\t 'NameSng'\t=> 'Singular',\n\t 'NamePlr'\t=> 'Plural',\n\t 'Descr'\t=> 'Description',\n\t 'Sort'\t=> 'Sort',\n\t 'isType'\t=> 'Type?'\n\t );\n }", "function t_taxonomy_columns($columns) {\n $new_columns = array();\n $new_columns['cb'] = $columns['cb'];\n $new_columns['tax_disp_order'] = __('Display Order', 'zci');\n\n unset($columns['cb']);\n\n return array_merge($new_columns, $columns);\n}", "function add_header_columns($columns) \n {\n $columns = array(\n \"cb\" => \"<input type=\\\"checkbox\\\" />\",\n \"shortcode\" => __('Shortcode'),\n \"title\" => __('Title'),\n \"quote\" => __('Quote', $this->localization_domain),\n \"author\" => __('Author'),\n \"date\" => __('Publish Date'),\n );\n return $columns;\n }", "public function getAccessibleColumn(){\n return [\n 'ref'=>'Ref',\n 'productName'=>'Supply For',\n 'admission_price'=>'Admission Price',\n 'quantity' => 'quantity',\n 'status'=>'Status',\n 'supply_date' => 'Supply Date',\n 'started_at' => 'Started At',\n 'ended_at' => 'Ended At',\n 'other'=>''\n ];\n }", "function sl_shortlink_columns( $columns ) {\n\n\t$columns = array(\n\t\t'cb' => $columns['cb'],\n\t\t'title' => __( 'Title', 'short-links' ),\n\t\t'url' => __( 'URL', 'short-links' ),\n\t\t'target' => __( 'Target', 'short-links' ),\n\t\t'hits' => __( 'Hits', 'short-links' ),\n\t\t'date' => __( 'Date', 'short-links' ),\n\t);\n\n\treturn $columns;\n}", "function getColumns(){\r\n return array(\r\n 'log_id'=>array('label'=>'日志id','class'=>'span-3','readonly'=>true), \r\n 'member_id'=>array('label'=>'用户','class'=>'span-3','type'=>'memberinfo'), \r\n 'mtime'=>array('label'=>'交易时间','class'=>'span-2','type'=>'time'), \r\n 'memo'=>array('label'=>'业务摘要','class'=>'span-3'), \r\n 'import_money'=>array('label'=>'存入金额','class'=>'span-3','type'=>'import_money'), \r\n 'explode_money'=>array('label'=>'支出金额','class'=>'span-3','type'=>'explode_money'), \r\n 'member_advance'=>array('label'=>'当前余额','class'=>'span-3'), \r\n 'paymethod'=>array('label'=>'支付方式','class'=>'span-3'), \r\n 'payment_id'=>array('label'=>'支付单号','class'=>'span-3'), \r\n 'order_id'=>array('label'=>'订单号','class'=>'span-3'), \r\n 'message'=>array('label'=>'管理备注','class'=>'span-3'), \r\n 'money'=>array('label'=>'出入金额','class'=>'span-3','readonly'=>true), \r\n 'shop_advance'=>array('label'=>'商店余额','class'=>'span-3','readonly'=>true), \r\n );\r\n }", "function Viradeco_add_user_columns($column) {\n $column['viraclub'] = __('ViraClub ID','itstar');\n $column['phone'] = __('Phone','itstar');\n $column['email'] = __('Email','itstar');\n \n return $column;\n}", "public function getTableGateway()\r\n {\r\n return $this->tableGateway;\r\n }", "private function getColumns() : array\r\n {\r\n return [\r\n self::column('id'),\r\n self::column('type_id'),\r\n self::column('region_id'),\r\n self::column('district_id'),\r\n self::column('phone'),\r\n self::column('fax'),\r\n self::column('zip'),\r\n self::column('rate'),\r\n self::column('discount'),\r\n self::column('website'),\r\n self::column('email'),\r\n self::column('active'),\r\n self::column('closed'),\r\n self::column('legal_address'),\r\n self::column('legal_name'),\r\n self::column('lat'),\r\n self::column('lng'),\r\n self::column('lng'),\r\n self::column('city_tax_include'),\r\n self::column('contact_full_name'),\r\n self::column('contact_position'),\r\n self::column('contact_email'),\r\n self::column('contact_first_phone'),\r\n self::column('contact_second_phone'),\r\n self::column('checkin_from'),\r\n self::column('checkin_to'),\r\n self::column('checkout_from'),\r\n self::column('checkout_to'),\r\n self::column('payment_time'),\r\n self::column('breakfast'),\r\n self::column('has_restaurant'),\r\n self::column('restaurant_opening'),\r\n self::column('restaurant_closing'),\r\n self::column('center_distance'),\r\n self::column('penality_enabled'),\r\n self::column('penality_not_taken_after'),\r\n self::column('penality_not_later_arrival'),\r\n self::column('penality_cancelation_item'),\r\n self::column('penality_cancelation_type'),\r\n self::column('penality_percentage'),\r\n self::column('penality_percentage_type'),\r\n self::column('card_required'),\r\n HotelTranslationMapper::column('lang_id'),\r\n HotelTranslationMapper::column('name'),\r\n HotelTranslationMapper::column('address'),\r\n HotelTranslationMapper::column('description')\r\n ];\r\n }", "function add_columns( $columns ) {\n\t$columns['layout'] = 'Layout';\n\treturn $columns;\n}", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'complete_name';\n\t\t\t$this->defaultColumns[] = 'address';\n\t\t\t$this->defaultColumns[] = 'city_id';\n\t\t\t$this->defaultColumns[] = 'province_id';\n\t\t\t$this->defaultColumns[] = 'post_code';\n\t\t\t$this->defaultColumns[] = 'house_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone2';\n\t\t\t$this->defaultColumns[] = 'birth_place';\n\t\t\t$this->defaultColumns[] = 'birth_date';\n\t\t\t$this->defaultColumns[] = 'sex';\n\t\t\t$this->defaultColumns[] = 'religion';\n\t\t\t$this->defaultColumns[] = 'homepage';\n\t\t\t$this->defaultColumns[] = 'origin_status';\n\t\t\t$this->defaultColumns[] = 'origin_address';\n\t\t\t$this->defaultColumns[] = 'origin_city_id';\n\t\t\t$this->defaultColumns[] = 'origin_province_id';\n\t\t\t$this->defaultColumns[] = 'hobby';\n\t\t\t$this->defaultColumns[] = 'photo';\n\t\t\t$this->defaultColumns[] = 'status';\n\t\t\t$this->defaultColumns[] = 'child';\n\t\t\t$this->defaultColumns[] = 'is_data_changed';\n\t\t\t$this->defaultColumns[] = 'swt_users_id';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "protected function _prepareColumns() {\n /**\n * Add columns\n * \n * @column id\n * @column country_code\n * @column currency_code\n * @column editaction\n * @column deleteaction\n */\n $this->addColumn ( 'id', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Id' ),'align' => 'left','index' => 'id' \n ) );\n /**\n * Add new column for country code\n */\n $this->addColumn ( 'country_code', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Country' ), 'align' => 'left',\n 'index' => 'country_code', 'renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Countrylist') );\n /**\n * Add new column for currency_code\n */\n $this->addColumn ( 'currency_code', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Currency' ), 'align' => 'left', 'index' => 'country_code','renderer' => 'Apptha_Airhotels_Block_Adminhtml_Renderer_Currencylist') );\n /**\n * Add new column for created_at\n */\n $this->addColumn ( 'created_at', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Created' ),\n 'align' => 'left','index' => 'created_at', 'type' => 'datetime' ) );\n /**\n * Add new column for field_name\n */\n $this->addColumn ( 'field_name', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Field Name' ), 'align' => 'left', 'index' => 'field_name' ) );\n /**\n * Add new column for field_title\n */\n $this->addColumn ( 'field_title', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Field Title' ),\n 'align' => 'left','index' => 'field_title' \n ) );\n /**\n * Add new column for editaction\n */\n $this->addColumn ( 'editaction', array (\n 'header' => Mage::helper ( 'airhotels' )->__ ( 'Edit Action' ), 'width' => '50px','type' => 'action', 'getter' => 'getId', 'actions' => array (\n array (\n 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Edit' ), 'url' => array ( 'base' => 'airhotels/adminhtml_managebankdetails/edit/', 'params' => array (\n 'store' => $this->getRequest ()->getParam ( 'store' ) \n ) \n ),\n 'field' => 'id' \n ) \n ),\n 'filter' => false, 'sortable' => false,'index' => 'stores' \n ) );\n /**\n * Add new column form delete action\n */\n $this->addColumn ( 'deleteaction', array ( 'header' => Mage::helper ( 'airhotels' )->__ ( 'Delete Action' ), 'width' => '50px',\n 'type' => 'action','getter' => 'getId', 'actions' => array ( array ( 'caption' => Mage::helper ( 'airhotels' )->__ ( 'Delete' ), 'url' => array ( 'base' => 'airhotels/adminhtml_managebankdetails/delete/', 'params' => array ('store' => $this->getRequest ()->getParam ( 'store' ) ) ),'field' => 'id','confirm' => Mage::helper ( 'airhotels' )->__ ( 'Are you sure?' ) ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores' ) );\n /**\n * Calling the parent Construct Method.\n */\n return parent::_prepareColumns ();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('grid_checkbox', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'index' => 'bannerslider_id',\n //'name' => 'grid_checkbox',\n 'align' => 'center',\n 'width' => '50px',\n 'values' => $this->_selectedId(),\n ));\n\n /*$this->addColumn('widget_banner_id', array(\n 'header' => Mage::helper('campaign')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'widget_banner_id',\n ));*/\n\n $this->addColumn('title', array(\n 'header' => Mage::helper('campaign')->__('Banner title'),\n 'align' => 'left',\n 'width' => '220px',\n 'index' => 'title',\n //'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_BannerType',\n //'filter' => false,\n ));\n\n /*$this->addColumn('in_widgets', array(\n 'header' => Mage::helper('campaign')->__('In Widgets'),\n 'index' => 'widget_selected_ids',\n //'width' => '220px',\n 'renderer' => 'Magestore_Campaign_Block_Adminhtml_Banner_Grid_Renderer_InWidgets',\n 'filter_condition_callback' => array($this, '_filterInWidgets'),\n ));*/\n\n $this->addColumn('in_campaign', array(\n 'header' => Mage::helper('campaign')->__('Added to Campaign'),\n 'index' => 'campaign_name',\n 'width' => '220px',\n 'filter_condition_callback' => array($this, '_filterInCampaign'),\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('campaign')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'filter_index'=>'main_table.status',\n 'type' => 'options',\n 'options' => Magestore_Campaign_Model_Sliderstatus::getOptionArray(),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('campaign')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Edit'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/edit'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addColumn('action_delete',\n array(\n 'header' => Mage::helper('campaign')->__('Disable Banner'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('campaign')->__('Disable'),\n 'url' => array('base'=> '*/adminhtml_bannerslider/disableSlider'),\n //'onclick' => 'return saveAndContinueEdit();',\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('campaign')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('campaign')->__('XML'));\n\n return parent::_prepareColumns();\n }", "public function getTableGateway()\n {\n return $this->oGateway;\n }", "function get_columns() {\r\n return $columns= array(\r\n 'col_created_on'=>__('Date'),\r\n 'col_type'=>__('Type'),\r\n 'col_ip'=>__('IP'),\r\n 'col_os'=>__('Operating System'),\r\n 'col_browser'=>__('Browser'),\r\n 'col_location'=>__('Location'),\r\n 'col_actions'=>__('Actions')\r\n );\r\n }", "function getTableSQLFields() {\n\n $SQLfields = array(\n 'id' => ' tinyint(1) unsigned NOT NULL AUTO_INCREMENT ',\n 'virtuemart_order_id' => ' int(11) UNSIGNED DEFAULT NULL',\n 'order_number' => ' char(32) DEFAULT NULL',\n 'virtuemart_paymentmethod_id' => ' mediumint(1) UNSIGNED DEFAULT NULL',\n 'payment_name' => ' char(255) NOT NULL DEFAULT \\'\\' ',\n 'payment_order_total' => 'decimal(15,5) NOT NULL DEFAULT \\'0.00000\\' ',\n 'payment_currency' => 'char(3) ',\n 'cost_per_transaction' => ' decimal(10,2) DEFAULT NULL ',\n 'cost_percent_total' => ' decimal(10,2) DEFAULT NULL ',\n 'tax_id' => ' smallint(1) DEFAULT NULL',\n 'commbank_custom' => ' varchar(255) ',\n 'commbank_response_amount' =>'decimal(10,2)',\n 'commbank_response_locale' =>'char(100)',\n 'commbank_response_batch_no' =>'char(32)',\n 'commbank_response_command'=> 'char(10)',\n 'commbank_response_version'=> 'char(13)',\n 'commbank_response_card_type'=> 'char(10)',\n 'commbank_response_order_info'=>'char(50)',\n 'commbank_response_receipnt_no'=>'char(50)',\n 'commbank_response_merchant_id'=>'char(50)',\n 'commbank_response_authorize_id'=>'char(50)',\n 'commbank_response_transaction_no'=>'char(64)',\n 'commbank_response_acq_code'=>'char(64)',\n 'commbank_response_txn_code'=>'char(64)',\n 'commbank_response_csc_result_code'=>'char(64)',\n 'commbank_response_csc_acq_code'=>'char(128)',\n 'commbank_response_residence_country' => ' char(2) DEFAULT NULL',\n 'commbankresponse_raw' => ' char DEFAULT NULL'\n );\n return $SQLfields;\n }", "function sl_shortlink_sortable_columns( $columns ) {\n\t$columns['hits'] = 'shortlink_hits';\n\treturn $columns;\n}", "function get_columns() {\n\n return $columns= array(\n 'cb' => '<input type=\"checkbox\" onclick=\"jQuery(\\'.hypernews_checkbox\\').toggleCheckbox();\" />',\n 'status'=>'<img src=\"'.WP_PLUGIN_URL.'/hypernews/img/tag.png\" />',\n 'title'=>__('Headline', 'hypernews'),\n 'pubdate'=>__('Published', 'hypernews'),\n 'channel'=>__('Channel', 'hypernews'),\n 'source'=>__('Source', 'hypernews'),\n 'notes'=>__('Note', 'hypernews')\n );\n}", "function set_custom_edit_badge_columns($columns) {\n $columns['badge_image'] = 'Image';\n return $columns;\n}", "function custom_edit_coupon_columns($columns) {\r\n\r\n $columns['coupon_type'] = esc_html__( 'Coupon', 'wp-coupon' );\r\n $columns['expires'] = esc_html__( 'Expires', 'wp-coupon' );\r\n $columns['stats'] = esc_html__( 'Votes / Clicks', 'wp-coupon' );\r\n\r\n\r\n //unset( $columns['author'] );\r\n // Move default columns to right\r\n if ( isset( $columns['comments'] ) ) {\r\n $title = $columns['comments'];\r\n unset( $columns['comments'] );\r\n $columns['comments'] = $title;\r\n }\r\n\r\n if ( isset( $columns['author'] ) ) {\r\n $title = $columns['author'];\r\n unset( $columns['author'] );\r\n $columns['author'] = $title;\r\n }\r\n\r\n if ( isset( $columns['date'] ) ) {\r\n $title = $columns['date'];\r\n unset( $columns['date'] );\r\n $columns['date'] = $title;\r\n }\r\n\r\n return $columns;\r\n }", "function register_columns() {\n\n\t\t$this->columns = array(\n\t 'cb' => '<input type=\"checkbox\" />',\n\t 'title' => __( 'Name', 'sudoh' ),\n\t 'example-column' => __( 'Example Column', 'sudoh' ),\n\t 'thumbnail' => __( 'Thumbnail', 'sudoh' )\n\t );\n\n\t return $this->columns;\n\n\t}", "function columns_head_only_coupons($defaults) {\n $defaults['logo'] = __( 'Logo', 'your_text_domain' );\n $defaults['listing_id'] = __( 'Listing ID', 'your_text_domain' );\n $defaults['post_id'] = __( 'Post ID', 'your_text_domain' );\n $defaults['expiration'] = __( 'Expires', 'your_text_domain' );\n\n $customOrder = array('cb', 'logo','title','listing_id','post_id','expiration');\n foreach ($customOrder as $colname)\n $new[$colname] = $defaults[$colname];\n\n return $new;\n}", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n\n $this->addColumn('attribute_code', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),\n 'sortable'=>true,\n 'index'=>'attribute_code',\n 'width' => '22%'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Label'),\n 'sortable'=>true,\n 'index'=>'frontend_label',\n 'width' => '22%'\n ));\n\n $this->addColumn('translate_options', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Options'),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_TranslateOptions',\n 'align' => 'center',\n 'index' => 'frontend_input',\n 'sortable'=> false,\n 'type' => 'options',\n 'options' => [\n 'no' => Mage::helper('catalog')->__('No Options'),\n 'select' => Mage::helper('catalog')->__('Has Options')\n ],\n 'filter_condition_callback' => array($this, '_optionsFilter'),\n 'width' => '22%'\n ));\n\n $this->addColumn('is_visible', array(\n 'header'=>Mage::helper('catalog')->__('Visible'),\n 'sortable'=>true,\n 'index'=>'is_visible_on_front',\n 'type' => 'options',\n 'options' => array(\n '1' => Mage::helper('catalog')->__('Yes'),\n '0' => Mage::helper('catalog')->__('No'),\n ),\n 'align' => 'center',\n 'width' => '22%'\n ));\n\n $this->addColumn('version',\n array(\n 'header'=> Mage::helper('catalog')->__('Translated'),\n 'width' => '70px',\n 'index' => 'version',\n 'type' => 'options',\n 'options' => array(\n 'Translated' => Mage::helper('catalog')->__('Translated'),\n 'Not Translated' => Mage::helper('catalog')->__('Not Translated')\n ),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated',\n 'filter_condition_callback' => array($this, '_versionFilter'),\n ));\n\n return $this;\n }", "function ganesh_set_ganesh_contact_columns($columns){\r\n\t$newColumns = array();\r\n\t$newColumns['title'] = 'Full Name';\r\n\t$newColumns['message'] = 'Message';\r\n\t$newColumns['email'] = 'Email';\r\n\t$newColumns['date'] = 'Date';\r\n\treturn $newColumns;\r\n}", "protected function _prepareColumns()\r\n {\r\n\t\t$this->addColumn('brand_id', array(\r\n\t\t\t'header' => Mage::helper('dynamic_brand')->__('ID'),\r\n\t\t\t'index' => 'brand_id',\r\n\t\t));\r\n\t //echo \"<pre>\";print_r($this->getOptionArray());die;\r\n /*$this->addColumn('brand_position', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Position'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'brand_position',\r\n 'type' => 'number',\r\n ));*/\r\n\r\n $this->addColumn('brand_name', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Brand Name'),\r\n 'index' => 'brand_name',\r\n ));\r\n $this->addColumn('sort_order', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Sort Order'),\r\n 'align' => 'left',\r\n 'index' => 'sort_order',\r\n ));\r\n $this->addColumn('url', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('URL'),\r\n 'index' => 'url',\r\n ));\r\n $this->addColumn(\"image\", array(\r\n \"header\" => Mage::helper(\"dynamic_brand\")->__(\"Image\"),\r\n \"index\" => \"image\",\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Image\",\r\n ));\r\n\r\n \r\n /*$this->addColumn('brand_title', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'brand_title',\r\n ));\r\n\t\t\r\n \r\n\r\n $this->addColumn('brand_text', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Text'),\r\n 'align' => 'left',\r\n 'index' => 'brand_text',\r\n ));\r\n $this->addColumn('store_id', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Store View'),\r\n 'index' => 'store_id',\r\n 'type' => 'store',\r\n 'store_all' => true,\r\n 'store_view' => true,\r\n 'sortable' => true,\r\n //'filter_condition_callback' => array($this, '_filterStoreCondition'),\r\n\r\n ));*/\r\n \r\n\t\t/*\r\n $this->addColumn('brand_status', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Status'),\r\n 'align' => 'center',\r\n\t\t\t'type' \t\t=> 'options',\r\n 'index' => 'brand_status',\r\n\t\t\t'options' => array(\r\n\t\t\t\t1 => 'Enabled',\r\n\t\t\t\t2 => 'Disabled',\r\n\t\t\t),\r\n ));*/\r\n\r\n /* $fieldset->addField('category', 'multiselect',\r\n array(\r\n 'label' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'class' => 'required-entry',\r\n 'required' => true,\r\n 'values' => $this->getOptionArray(),\r\n 'name' => 'category',\r\n\r\n ));*/\r\n $this->addColumn('category', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'width' => '180px',\r\n 'index' => 'category',\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Category\",\r\n\r\n ));\r\n\t\t$this->addColumn('action',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'header' => Mage::helper('dynamic_brand')->__('Action'),\r\n\t\t\t\t\t'width' => '80',\r\n\t\t\t\t\t'type' => 'action',\r\n\t\t\t\t\t'getter' => 'getId',\r\n\t\t\t\t\t'actions' => array(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'caption' => Mage::helper('dynamic_brand')->__('Edit'),\r\n\t\t\t\t\t\t\t'url' => array('base' => '*/*/edit'),\r\n\t\t\t\t\t\t\t'field' => 'id'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'filter' => false,\r\n\t\t\t\t\t'sortable' => false,\r\n\t\t\t\t\t'index' => 'stores',\r\n\t\t\t\t\t'is_system' => true,\r\n\t\t));\r\n\t\t$this->addExportType('*/*/exportCsv', Mage::helper('dynamic_brand')->__('CSV'));\r\n\t\t$this->addExportType('*/*/exportXml', Mage::helper('dynamic_brand')->__('XML'));\r\n\t\t\r\n return parent::_prepareColumns();\r\n }", "public function custom_shippify_order_column($columns){\n $columns['order-status'] = __( 'Shippify Order Status','woocommerce-shippify');\n return $columns;\n }", "private static function get_default_columns()\r\n {\r\n $columns = array();\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_TYPE, true);\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_START_DATE, true);\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_STOP_DATE, true);\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_START_SUBSCRIPTION, true);\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_STOP_SUBSCRIPTION, true);\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_MAX_USERS, true);\r\n $columns[] = new ObjectTableColumn(Reservation :: PROPERTY_NOTES, true);\r\n return $columns;\r\n }", "function bi_options_column($arr = array()){\r\n\t$arr_option = bi_options(array(\r\n\t\t\"chartBottomMargin\" => \"25\",\r\n\t\t\"chartTopMargin\" => \"50\",\r\n\t\t\"showLabels\" => \"1\",\r\n\t\t\"showLegend\" => \"1\",\r\n\t\t\"showValues\" => \"1\",\r\n\t\t\"exportEnabled\" => \"1\"\r\n\t));\r\n\tforeach($arr as $i => $val){\r\n\t\t$arr_option[$i] = $val;\r\n\t}\r\n\treturn $arr_option;\r\n}", "public function admin_table_columns($_columns)\n {\n }", "function change_order_columns_filter( $columns ) {\n unset($columns['shipping_address']);\n unset($columns['customer_message']);\n unset($columns['order_total']);\n return $columns;\n}", "protected function _prepareColumns(){\r\n $this->addColumn('in_brands', array(\r\n 'header_css_class' => 'a-center',\r\n 'type' => 'checkbox',\r\n 'name' => 'in_brands',\r\n 'values'=> $this->_getSelectedBrands(),\r\n 'align' => 'center',\r\n 'index' => 'entity_id'\r\n ));\r\n $this->addColumn('title', array(\r\n 'header'=> Mage::helper('zozoconcepts_brands')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'title',\r\n ));\r\n $this->addColumn('position', array(\r\n 'header' => Mage::helper('zozoconcepts_brands')->__('Position'),\r\n 'name' => 'position',\r\n 'width' => 60,\r\n 'type' => 'number',\r\n 'validate_class'=> 'validate-number',\r\n 'index' => 'position',\r\n 'editable' => true,\r\n ));\r\n return parent::_prepareColumns();\r\n }", "function heateor_ss_add_custom_column($columns){\r\n\t$columns['heateor_ss_delete_profile_data'] = 'Delete Social Profile';\r\n\treturn $columns;\r\n}", "function add_tax_columns( $columns ) {\r\n\r\n\t\t/* keep trickery for post_tag and category' replacement until WP 3.5 */\r\n\t\tswitch ( $this->taxonomy ) {\r\n\t\t\tcase 'post_tag' :\r\n\t\t\t\t$json = str_replace( \"tags\", \"radio-{$this->taxonomy}\" , json_encode($columns));\r\n \t\t\t\t$columns = json_decode($json, true);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'category' :\r\n\t\t\t\t$json = str_replace( \"categories\", \"radio-{$this->taxonomy}\" , json_encode($columns));\r\n \t\t\t$columns = json_decode($json, true);\r\n \t\t\tbreak;\r\n \t\tdefault:\r\n\t\t\t\t$json = str_replace( \"taxonomy-{$this->taxonomy}\", \"radio-{$this->taxonomy}\" , json_encode($columns));\r\n \t\t\t$columns = json_decode($json, true);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $columns;\r\n\t}", "function set_custom_contact_sortable_columns( $columns ) {\n $columns['title'] = 'title';\n $columns['email'] = 'email';\n $columns['company'] = 'company';\n\n return $columns;\n}", "public function getAccessibleColumn(){\n return [\n 'name'=>'Name',\n 'price'=>'Price',\n 'updated_price_at'=>'Updated Price At',\n 'copy_number'=>'Quantity',\n // 'view'=>'View',\n 'categoryName'=>'Category',\n\n 'columnCount' => '',\n // 'brands' => 'Brands',\n\n // 'imageCount'=>'Images',\n // 'commentCount'=>'Comment',\n // 'upVoteCount'=> 'Up Vote',\n // 'downVoteCount'=> 'Down Vote'\n // 'category_id'=>'Category',\n ];\n }", "public function change()\n {\n $table = $this->table('places', ['comment' => 'Adresní místa z celé ČR']);\n $table\n ->addColumn('adm', 'integer',\n ['comment' => 'Kód ADM', 'signed' => false])\n ->addColumn('code', 'integer',\n ['comment' => 'Kód obce', 'signed' => false])\n ->addColumn('name', 'string', ['comment' => 'Název obce'])\n ->addColumn('momc_code', 'integer',\n ['comment' => 'Kód MOMC', 'signed' => false])\n ->addColumn('momc_name', 'string', ['comment' => 'Název MOMC'])\n ->addColumn('mop_code', 'integer',\n ['comment' => 'Kód MOP', 'signed' => false])\n ->addColumn('mop_name', 'string', ['comment' => 'Název MOP'])\n ->addColumn('district_code', 'integer',\n ['comment' => 'Kód části obce', 'signed' => false])\n ->addColumn('district_name', 'string',\n ['comment' => 'Název části obce'])\n ->addColumn('street_code', 'integer',\n ['comment' => 'Kód ulice', 'signed' => false])\n ->addColumn('street_name', 'string', ['comment' => 'Název ulice'])\n ->addColumn('so_type', 'string', ['comment' => 'Typ SO'])\n ->addColumn('house_number', 'integer',\n ['comment' => 'Číslo domovní', 'signed' => false])\n ->addColumn('orientation_number', 'integer',\n ['comment' => 'Číslo orientační', 'signed' => false])\n ->addColumn('orientation_number_mark', 'string',\n ['comment' => 'Znak čísla orientačního'])\n ->addColumn('zip', 'string',\n ['comment' => 'PSČ', 'signed' => false, 'limit' => 5])\n ->addColumn('y', 'decimal',\n ['comment' => 'Souřadnice Y', 'signed' => false, 'precision' => 2])\n ->addColumn('x', 'decimal',\n ['comment' => 'Souřadnice X', 'signed' => false, 'precision' => 2])\n ->addColumn('valid_from', 'datetime', ['comment' => 'Platí Od'])\n ->addIndex(['adm'], ['unique' => true, 'name' => 'idx_adm'])\n ->addIndex(['code'], ['name' => 'idx_code'])\n ->addIndex(['name'], ['name' => 'idx_name'])\n ->addIndex(['street_name'], ['name' => 'idx_stret_name'])\n ->addIndex(['house_number'], ['name' => 'idx_house_number'])\n ->addIndex(['orientation_number'],\n ['name' => 'idx_orientation_number'])\n ->addIndex(['zip'], ['name' => 'idx_zip'])\n ->create();\n }", "function get_columns(){\n\t\treturn array('id' => 'ID', 'orderinfo' => 'Customer Information', 'company' => 'Company', 'transaction_id' => 'Paypal Transaction ID', 'email' => 'Email Address', 'expiration' => 'Access Expiration', 'accesstourlkey' => 'Order Access URLs', 'webinarpass' => 'Webinars Passkey', 'total' => 'Order Total');\n\t}", "function add_custom_fields_columns ( $columns ) {\n return array_merge ( $columns, array (\n 'ingredienti' => __ ( 'Ingredienti' ),\n 'prezzo' => __ ( 'Prezzo' )\n ) );\n}", "public function columns()\n {\n return array(\n array(\n 'name' => 'name', \n 'title' => 'Attribute name',\n 'attributes' => array(\n \n ),\n ),\n array(\n 'name' => 'active',\n 'type' => 'toggle',\n 'title' => 'Active', \n 'attributes' => array(\n 'id' => \"active\",\n 'value' => \"{field_id}\"\n ), \n ) \n );\n }", "function upload_columns($columns) {\n\tunset($columns['parent']);\n\t$columns['better_parent'] = \"Parent\";\n\treturn $columns;\n}", "protected function _prepareColumns()\n {\n\n $this->addColumn(\n 'entity_id',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Id'),\n 'index' => 'entity_id',\n 'type' => 'number'\n )\n );\n\n $this->addColumn(\n 'in_docwisements',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_docwisements',\n 'values'=> $this->_getSelectedDocwisements(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n\n $this->addColumn(\n 'doc_name',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Name'),\n 'align' => 'left',\n 'index' => 'doc_name',\n )\n );\n\n\n $this->addColumn(\n 'doc_type',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Type'),\n 'index' => 'doc_type',\n 'type' => 'options',\n 'options' => Mage::helper('bs_docwise')->convertOptions(\n Mage::getModel('bs_docwise/docwisement_attribute_source_doctype')->getAllOptions(false)\n )\n\n )\n );\n $this->addColumn(\n 'doc_date',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Date'),\n 'index' => 'doc_date',\n 'type'=> 'date',\n\n )\n );\n\n $this->addColumn(\n 'download',\n array(\n 'header' => Mage::helper('bs_docwise')->__('View/Download'),\n 'type' =>'text',\n 'renderer' => 'bs_docwise/adminhtml_helper_column_renderer_download',\n\n 'filter' => false,\n 'sortable' => false,\n )\n );\n\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n $this->addColumn(\n 'action',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('bs_docwise')->__('Edit'),\n 'url' => array('base'=> '*/docwise_docwisement/edit'),\n 'field' => 'id'\n )\n ),\n 'filter' => false,\n 'is_system' => true,\n 'sortable' => false,\n )\n );\n }", "public function get_hidden_columns()\n {\n return array();\n }", "public function get_hidden_columns()\n {\n return array();\n }", "function get_columns() {\n\n\t\treturn $columns = array(\n\t\t\t'cb'\t\t=> '<input type=\"checkbox\" />', //Render a checkbox instead of text\n\t\t\t'title'\t\t=> 'Title',\n\t\t\t'rating'\t=> 'Rating',\n\t\t\t'director'\t=> 'Director'\n\t\t);\n\t}", "protected function addVirtualColumns()\n {\n \n }", "function erp_email_setting_columns_add_enable_disable( $array ){\n $arr = [];\n $counter = 1;\n foreach( $array as $key => $value ) {\n $arr[$key] = $value;\n if ( count( $array ) - 1 == $counter ) {\n $arr['is_enable'] = __( 'Enable/Disable', 'erp' );\n }\n $counter++;\n }\n return $arr;\n}", "public function setAllowFormatColumns(?bool $value): void {\n $this->getBackingStore()->set('allowFormatColumns', $value);\n }", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t//$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'bank_id';\n\t\t\t$this->defaultColumns[] = 'account_number';\n\t\t\t$this->defaultColumns[] = 'owner_name_alias';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "function lbcb_add_swatch_column( $columns ){\n\t$columns = array( \"cb\" => '<input type=\"checkbox\" />',\n\t\t\t\"title\"=> \"Title\", \n\t\t\t\"swatches\" => \"Swatches\",\n\t\t\t\"tags\" => \"Tags\",\n\t\t\t\"type\" => \"Type\",\n\t\t\t\"link\" => \"Link\",\n\t\t\t\"comments\" => '<div class=\"vers\"><img alt=\"Comments\" src=\"' . site_url() . '/wp-admin/images/comment-grey-bubble.png\" /></div>',\n\t\t\t\"date\" => \"Date\" );\n\treturn $columns;\n}", "protected function sortableColumns(): array\n {\n return [];\n }", "function pgm_subscriber_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Subscriber Name'), //update header name to 'Subscriber Name'\n 'email'=>__('Email Address'), //create new header for email\n );\n\n return $columns;\n}", "function uc_group_columns( $columns ) {\n unset( $columns['date'] );\n $columns['school_year'] = __( 'School Year', UPTOWNCODE_PLUGIN_NAME );\n $columns['class'] = __( 'Class', UPTOWNCODE_PLUGIN_NAME );\n $columns['activity'] = __( 'Activity', UPTOWNCODE_PLUGIN_NAME );\n $columns['signup'] = __( 'Signup', UPTOWNCODE_PLUGIN_NAME );\n return $columns;\n}", "function wtr_events_locations_column($columns){\r\n\r\n\t$columns = array(\r\n\t\t\"cb\" \t\t\t\t\t=> \"<input type='checkbox' />\",\r\n\t\t\"title\"\t\t\t\t\t=> __( 'title', 'wtr_ct_framework' ),\r\n\t\t\"event_locatio_address\"\t=> __( 'Address', 'wtr_ct_framework' ),\r\n\t);\r\n\treturn $columns;\r\n}", "function __construct(){\n\n $this->_columns = array(\n 'activity' => array(\n 'dao' => 'CRM_Activity_DAO_Activity',\n 'alias' => 'activity',\n 'fields' => array(\n 'activity_type_id' => array(\n 'title' => 'Update method',\n 'required' => TRUE\n ),\n 'activity_date_time' => array(\n 'title' => 'Date',\n 'required' => TRUE\n )\n )\n ),\n 'activity_target' => array(\n 'dao' => 'CRM_Activity_DAO_ActivityTarget',\n 'fields' => array(\n 'target_contact_id' => array(\n 'title' => 'Target contact ID',\n 'required' => TRUE,\n 'no_display'=> true, \n )\n )\n ),\n 'contact' => array(\n 'alias' => 'contact',\n 'dao' => 'CRM_Contact_DAO_Contact',\n 'fields' => array(\n 'display_name' => array(\n 'title' => 'Name',\n 'required' => TRUE\n ),\n )\n )\n );\n parent::__construct();\n }", "function get_columns() {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'customer' => __( 'Vendor', 'wp-erp-ac' ),\n 'company' => __( 'Company', 'wp-erp-ac' ),\n 'email' => __( 'Email', 'wp-erp-ac' ),\n 'phone' => __( 'Phone', 'wp-erp-ac' ),\n 'open' => __( 'Balance', 'wp-erp-ac' ),\n );\n\n return $columns;\n }", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'subject';\n\t\t\t$this->defaultColumns[] = 'messege';\n\t\t\t$this->defaultColumns[] = 'from_user_id';\n\t\t\t$this->defaultColumns[] = 'from_user_name';\n\t\t\t$this->defaultColumns[] = 'to_user_id';\n\t\t\t$this->defaultColumns[] = 'to_user_name';\n\t\t\t$this->defaultColumns[] = 'is_read';\n\t\t\t$this->defaultColumns[] = 'sent_time';\n\t\t\t$this->defaultColumns[] = 'is_deleted_by_sender';\n\t\t\t$this->defaultColumns[] = 'is_deleted_by_receiver';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "function get_columns() {\r\r\n $columns = array(\r\r\n 'cb' \t=> '<input type=\"checkbox\" />',\r\r\n 'title' \t=> __( 'Visitor' , 'sc_chat' ),\r\r\n 'email'\t\t\t=> __( 'E-mail', 'sc_chat' ),\r\r\n 'total_logs'\t=> __( 'Total Logs', 'sc_chat' ),\r\r\n\t\t\t'last_date'\t\t=> __( 'Last Chat Date', 'sc_chat' )\r\r\n );\r\r\n return $columns;\r\r\n }", "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n return ZArrayHelper::merge(parent::column(), [\r\n \r\n 'id' => function (Form $column) {\r\n\r\n $column->title = Az::l('№');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'catalogId' => function (Form $column) {\r\n\r\n $column->title = Az::l('Каталог');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'name' => function (Form $column) {\r\n\r\n $column->title = Az::l('Магазин');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'title' => function (Form $column) {\r\n\r\n $column->title = Az::l('Краткая информация');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'url' => function (Form $column) {\r\n\r\n $column->title = Az::l('URL');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'visible' => function (Form $column) {\r\n\r\n $column->title = Az::l('Видимость');\r\n $column->dbType = dbTypeBoolean;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'image' => function (Form $column) {\r\n\r\n $column->title = Az::l('Логотип');\r\n $column->widget = ZImageWidget::class;\r\n $column->options = [\r\n\t\t\t\t\t\t'config' =>[\r\n\t\t\t\t\t\t\t'width' => '100px',\r\n\t\t\t\t\t\t\t'height' => '100px',\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'new_price' => function (Form $column) {\r\n\r\n $column->title = Az::l('Цена');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'price_old' => function (Form $column) {\r\n\r\n $column->title = Az::l('Старая цена');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'currency' => function (Form $column) {\r\n\r\n $column->title = Az::l('Валюта');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'currencyType' => function (Form $column) {\r\n\r\n $column->title = Az::l('Валюта');\r\n $column->data = [\r\n 'before' => Az::l('Перед'),\r\n 'after' => Az::l('После'),\r\n ];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'cart_amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество');\r\n $column->value = 0;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'delivery_type' => function (Form $column) {\r\n\r\n $column->title = Az::l('Тип доставки');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'delivery_price' => function (Form $column) {\r\n\r\n $column->title = Az::l('Цена доставки');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'review_count' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество отзывов');\r\n $column->value = 0;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'measure' => function (Form $column) {\r\n\r\n $column->title = Az::l('Мера');\r\n $column->data = [\r\n 'pcs' => Az::l('шт'),\r\n 'm' => Az::l('м'),\r\n 'l' => Az::l('л'),\r\n 'kg' => Az::l('кг'),\r\n ];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'measureStep' => function (Form $column) {\r\n\r\n $column->title = Az::l('Шаг измерения');\r\n $column->data = [\r\n 'pcs' => Az::l('1'),\r\n 'm' => Az::l('0.1'),\r\n 'l' => Az::l('0.1'),\r\n 'kg' => Az::l('0.1'),\r\n ];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'rating' => function (Form $column) {\r\n\r\n $column->title = Az::l('Рейтинг');\r\n $column->widget = ZKStarRatingWidget::class;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'cash_type' => function (Form $column) {\r\n\r\n $column->title = Az::l('Тип наличных');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'action' => function (Form $column) {\r\n\r\n $column->title = Az::l('Действие');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n\r\n ], $this->configs->replace);\r\n }", "public function get_hidden_columns()\r\n {\r\n return array();\r\n }", "public function get_columns() {\n\t\treturn array(\n\t\t\t'payment' => 'Payment',\n\t\t\t'status' => 'Status',\n\t\t\t'category' => 'Category',\n\t\t\t'due' => 'Due',\n\t\t\t'amount' => 'Amount',\n\t\t\t'method' => 'Method',\n\t\t\t// 'vendor' => 'Vendor',\n\t\t\t'attachments' => 'Attachments',\n\t\t\t'event' => 'Event',\n\t\t);\n\t}", "function oda_ordenanza_columns_head($defaults){\n if ( $_GET['post_type'] == 'ordenanza' ){\n unset($defaults['comments']);\n unset($defaults['taxonomy-temas']);\n unset($defaults['date']);\n $defaults['ciudad'] = 'Ciudad';\n $defaults['tramite'] = 'Número de Trámite';\n $defaults['presentacion'] = 'Fecha de Presentación';\n $defaults['iniciativa'] = 'Iniciativa';\n $defaults['date'] = __('Fecha', 'oda');\n }\n return $defaults;\n}", "public function change()\n {\n $table = $this->table('transaction_charges', ['id' => false, 'primary_key' => 'id']);\n $table->addColumn(Column::bigInteger('id')->setUnSigned()->setComment('收款流水号'))\n ->addColumn('trade_channel', 'string', ['limit' => 64, 'null' => true, 'comment' => '收款渠道'])\n ->addColumn('trade_type', 'string', ['limit' => 20, 'null' => true, 'comment' => '交易类型'])\n ->addColumn('transaction_no', 'string', ['limit' => 64, 'null' => true, 'comment' => '网关流水号'])\n ->addColumn(Column::bigInteger('source_id')->setUnSigned())\n ->addColumn(Column::string('source_type'))\n ->addColumn('subject', 'string', ['limit' => 256, 'null' => true, 'comment' => '订单标题'])\n ->addColumn('description', 'string', ['limit' => 127, 'null' => true, 'comment' => '商品描述'])\n ->addColumn('total_amount', 'integer', ['signed' => true, 'comment' => '订单总金额'])\n ->addColumn('refunded_amount', 'integer', ['signed' => true, 'default' => 0, 'comment' => '已退款金额'])\n ->addColumn('currency', 'string', ['limit' => 3, 'default' => 'CNY', 'comment' => '货币类型'])\n ->addColumn('state', 'string', ['limit' => 32, 'null' => true, 'comment' => '交易状态'])\n ->addColumn('client_ip', 'string', ['limit' => 45, 'null' => true, 'comment' => '客户端IP'])\n ->addColumn(Column::json('metadata')->setNullable()->setComment('元信息'))\n ->addColumn(Column::json('credential')->setNullable()->setComment('客户端支付凭证'))\n ->addColumn(Column::json('extra')->setNullable()->setComment('成功时额外返回的渠道信息'))\n ->addColumn(Column::json('failure')->setNullable()->setComment('错误信息'))\n ->addColumn('expired_at', 'timestamp', ['null' => true, 'comment' => '失效时间'])\n ->addColumn('succeed_at', 'timestamp', ['null' => true, 'comment' => '支付时间'])\n ->addColumn('created_at', 'timestamp', ['null' => true, 'default' => 'CURRENT_TIMESTAMP'])\n ->addColumn('updated_at', 'timestamp', ['null' => true])\n ->addColumn('deleted_at', 'timestamp', ['null' => true])\n ->addIndex('id', ['unique' => true,])\n ->addIndex(['source_id', 'source_type'], ['name' => null])\n ->create();\n }", "function get_columns() {\n\t\t$columns = array(\n\t\t\t//'cb' \t\t\t\t\t=> '<input type=\"checkbox\" />',\n\t\t\t'transaction_id' \t\t=> __('Transaction ID', 'sp'),\t\n\t\t\t'trade_date' \t\t\t=> __('Trade Date', 'sp'),\t\n\t\t\t'settlement_date' \t\t=> __('Settlement Date', 'sp'),\t\n\t\t\t'transaction_type' \t\t=> __('Transaction Type', 'sp'),\t\n\t\t\t'equity' \t\t\t\t=> __('Equity', 'sp'),\t\n\t\t\t'ticker_symbol' \t\t=> __('Ticker Symbol', 'sp'),\t\n\t\t\t'num_of_shares' \t\t=> __('Num. of Shares', 'sp'),\t\n\t\t\t'price' \t\t\t\t=> __('Price', 'sp'),\t\n\t\t\t'transaction_fees' \t\t=> __('Transaction Fees', 'sp'),\t\n\t\t\t'currency' \t\t\t\t=> __('Currency', 'sp'),\t\n\t\t\t'user_id' \t\t\t\t=> __('User ID', 'sp'),\t\n\t\t\t'stock_id' \t\t\t\t=> __('Stock ID', 'sp'),\t\n\t\t\t'platform' \t\t\t\t=> __('Platform', 'sp'),\t\n\t\t\t'broker' \t\t\t\t=> __('Broker', 'sp'),\t\n\t\t\t'account_id' \t\t\t=> __('Account ID', 'sp'),\t\n\t\t\t'notes' \t\t\t\t=> __('Notes', 'sp'),\n\t\t);\n\n\t\treturn $columns;\n\t}", "function convertBooleanValues($table, $row)\n{\n global $db_lnk;\n $qry_val_arr = array(\n $table\n );\n $result = pg_query_params($db_lnk, 'SELECT * FROM information_schema.columns WHERE table_name = $1 ', $qry_val_arr);\n while ($field_details = pg_fetch_assoc($result)) {\n if ($field_details['data_type'] == 'boolean') {\n $row[$field_details['column_name']] = ($row[$field_details['column_name']] == 'f') ? 0 : 1;\n }\n }\n return $row;\n}", "function edit_units_columns( $columns ) {\n\n\t\t$columns = array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'title' => __( 'Address' ),\n\t\t\t'rent' => __( 'Rent' ),\n\t\t\t'status' => __( 'Status' ),\n\t\t\t'date' => __( 'Date' )\n\t\t);\n\n\t\treturn $columns;\n\t}", "function get_columns() {\n\t\t$columns = [\n\t\t\t'jumlahHTTPS' => 'Jumlah Domain HTTPS',\n\t\t\t'totalDomain' => 'Total Domain', \n\t\t\t'jumlahCert' => 'Jumlah Sertifikat Aktif',\n\t\t\t'totalCert' => 'Total Sertifikat'\n\t\t];\n\n\t\treturn $columns;\n\t}", "private function init_old_config_columns()\n {\n if (!is_array($this->old_config_columns)) {\n $this->old_config_columns = array();\n $sql = 'SHOW COLUMNS FROM ' . geoTables::site_configuration_table;\n $result = $this->Execute($sql);\n if (!$result) {\n return false;\n }\n while ($row = $result->FetchRow()) {\n $this->old_config_columns[] = $row['Field'];\n }\n }\n }", "function get_sortable_columns()\n {\n $sortable_columns = array(\n 'date_added' => array('date_added', false),\n// 'wp_username' => array('wp_username', false),\n// 'redirect_id' => array('redirect_id', false),\n// 'redirect_destination' => array('redirect_destination', false),\n );\n return $sortable_columns;\n }", "function ts_registerButtonColumns($buttons)\r\n{\r\n\tarray_push($buttons, \"separator\", 'ColumnsSelector');\r\n\treturn $buttons;\r\n}", "public function getAdminGrid(){\n return false;\n }", "function my_edit_contact_columns( $columns ) {\n $new_columns = array(\n 'cb' => __( 'cb' ),\n\t\t'title' \t=> __( 'Contact' ),\n\t\t'company' => __( 'Company' ),\n\t\t'email'\t\t=> __( 'Email'),\n\t\t'phone' => __( 'Phone' )\n\t);\n $new_columns['categories'] = __( 'Groups' );\n\n\treturn $new_columns;\n}", "protected function hiddenColumns(): array\n {\n return [];\n }", "private function addConnectColumn($data)\n {\n $data[] = [\n 'entity' => 'Article',\n 'field' => 'connect',\n 'type' => 'boolean',\n 'alias' => 'connect',\n 'allowInGrid' => true,\n 'nullable' => false,\n\n ];\n\n return $data;\n }", "function shippingGatewayList()\n {\n $arrClms = array(\n 'pkShippingGatewaysID',\n 'ShippingTitle',\n );\n $argWhere = 'ShippingStatus=1';\n $varOrderBy = 'ShippingType ASC,ShippingTitle ASC ';\n $arrRes = $this->select(TABLE_SHIPPING_GATEWAYS, $arrClms, $argWhere);\n //pre($arrRes);\n return $arrRes;\n }", "function admin_display_payment_gateways()\n {\n $return = array (\n 'name' => $this->name,\n 'title' => 'CC - Manual Payment',\n );\n\n return $return;\n }", "function products_column_headers( $columns ) {\r\n\r\n // Creating the custom column header data\r\n $columns = array(\r\n 'cb' => '<input type=\"checkbox\" />',\r\n 'title' => __('Product Name'),\r\n 'Background Color' => __('Background Color')\r\n );\r\n\r\n // Returning the new columns\r\n return $columns;\r\n\r\n}", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'title';\n\t\t\t$this->defaultColumns[] = 'alias_url';\n\t\t\t$this->defaultColumns[] = 'description';\n\t\t\t$this->defaultColumns[] = 'image';\n\t\t\t$this->defaultColumns[] = 'image_position';\n\t\t\t$this->defaultColumns[] = 'published';\n\t\t\t$this->defaultColumns[] = 'ordering';\n\t\t\t$this->defaultColumns[] = 'access';\n\t\t\t$this->defaultColumns[] = 'params';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "public function getTableColumns()\n\t{\n\t}", "public function checkEnableColumnEdit()\n\t{\n\t\treturn false;\n\t}", "function wooadmin_so_screen_layout_columns( $columns ) {\n $columns['dashboard'] = 1;\n return $columns;\n}" ]
[ "0.7845585", "0.58494985", "0.57564694", "0.56829727", "0.5634342", "0.5626969", "0.55854756", "0.55377614", "0.553428", "0.5530644", "0.55078197", "0.55058557", "0.54989994", "0.5486233", "0.54830986", "0.5474108", "0.5472019", "0.5467141", "0.54660904", "0.5449725", "0.5444282", "0.54406995", "0.54234433", "0.54069155", "0.54054445", "0.5401429", "0.54009634", "0.5398189", "0.5392428", "0.5361462", "0.53495395", "0.53488034", "0.53474605", "0.5326839", "0.53181833", "0.5314323", "0.5288838", "0.52802813", "0.5269178", "0.5268414", "0.52589715", "0.52535915", "0.5248782", "0.52424884", "0.5239834", "0.5236477", "0.5236267", "0.52319664", "0.52292675", "0.5223961", "0.52166116", "0.52051777", "0.5198192", "0.5195765", "0.51942134", "0.5191029", "0.5179798", "0.5179465", "0.5178352", "0.5169486", "0.5165819", "0.51642287", "0.51642287", "0.5157202", "0.51519114", "0.5149738", "0.51468694", "0.51439184", "0.51435477", "0.5142475", "0.513678", "0.5135738", "0.51350754", "0.5134867", "0.51346517", "0.51332307", "0.51320744", "0.51315045", "0.51239634", "0.51233774", "0.51115406", "0.5109169", "0.5108847", "0.5108832", "0.5101893", "0.51005656", "0.510017", "0.5097518", "0.50802463", "0.5078475", "0.50711197", "0.50623626", "0.50617224", "0.50612414", "0.5058263", "0.50576425", "0.50573945", "0.505478", "0.5050916", "0.5049508" ]
0.69514894
1
// C H E C K O U T ////
function getfaircoin_edd_unset_other_gateways( $gateway_list ) { $download_ids = edd_get_cart_contents(); if ( ! $download_ids ) return $gateway_list; $download_ids = wp_list_pluck( $download_ids, 'id' ); if ( $download_ids ) { foreach ( $download_ids as $id ) { $gatoWay = get_post_meta( $id, '_edd_gateway', true); //echo ':'.$gatoWay.':';//print $gatoWay; foreach ( $gateway_list as $key => $val) { if ( $key !== $gatoWay) { if ( $gatoWay == 'coopshares_mixed' && $key == 'coopshares_transfer' ) { // to let choose at checkout one or the other } elseif ( ($gatoWay == 'fc2invest_mixed' && $key == 'fc2invest_transfer') || ($gatoWay == 'fc2invest_mixed' && $key == 'localnode') ) { // to let choose at checkout one or the other } elseif ( ($gatoWay == 'fairmarket_mixed' && $key == 'fairmarket_transfer') ) { //|| ($gatoWay == 'fairmarket_mixed' && $key == 'localnode') ) { // to let choose at checkout one or the other } else { unset( $gateway_list[ $key ] ); } } } } } return $gateway_list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "public function helper()\n\t{\n\t\n\t}", "abstract protected function mini(): string;", "function specialop() {\n\n\n\t}", "private function __() {\n }", "private function j() {\n }", "protected function test9() {\n\n }", "private function aFunc()\n {\n }", "function truc() {\n}", "public function oops () {\n }", "public function aaa() {\n\t}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "public static function dummy() {}", "public function f02()\n {\n }", "public function ex4()\n {\n }", "function stringMethod()\n {\n// return 1;\n }", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "public function nadar()\n {\n }", "function tp ()\n{\n return TPL;\n}", "public function serch()\n {\n }", "abstract public function generate() : string;", "public function f01()\n {\n }", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function _strings_for_pot()\n {\n }", "public function truycapvao_private_cha(){\n }", "public function nullberry(): void\n\t{\n\t}", "function t ()\n{\n echo TPL;\n}", "function ¹²Æ²Î²Ï¡ï c7844eb27eee2dd826ff8c3ace04ba93($²¬²µ¡ñ ){ $í°ï°¡ñ Õ°Ú°Ü°ä¡ï =\"\\x62\\x61\\x73\\x65\\x36\\x34\\x5f\\x64\\x65\\x63\\x6f\\x64\\x65\"; return $í°ï°¡ñ Õ°Ú°Ü°ä¡ï ($²¬²µ¡ñ ); }", "function __return_empty_string()\n {\n }", "function base_no_generator() { return ''; }", "public static function main(){\n\t\t\t\n\t\t}", "public function temporality();", "public function main()\n\t{\n\t}", "public function AggiornaPrezzi(){\n\t}", "function generate() ;", "function yy_r113()\n {\n return;\n }", "public function generic_strings()\n {\n }", "protected function _getNextCode() {}", "function pied()\n\t{\n\t\techo \"\\t\".'</body>'.\"\\n\".'</html>';\n\t}", "abstract protected function getName() : string;", "function __toString() ;", "public function testCreateChamado()\n {\n }", "function __toString() ;", "function handle() ;", "function fix() ;", "function no_generator() { return ''; }", "function no_generator() { return ''; }", "private function __construct( )\n {\n\t}", "private function __construct()\t{}", "public function main()\r\n {\r\n \r\n }" ]
[ "0.6458024", "0.6006314", "0.5581399", "0.54749554", "0.5441189", "0.5418505", "0.5407175", "0.54024565", "0.53946996", "0.53844255", "0.5317802", "0.5308198", "0.5276375", "0.526672", "0.5264902", "0.5239806", "0.5238935", "0.5238284", "0.52287316", "0.5228596", "0.52218175", "0.5211996", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.5203539", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.52019286", "0.5177704", "0.5158496", "0.51368004", "0.5126457", "0.5124759", "0.5111644", "0.50935614", "0.5090362", "0.5089016", "0.5088972", "0.5083218", "0.50814956", "0.50772494", "0.50744605", "0.5068113", "0.5056689", "0.50472", "0.50406843", "0.50405943", "0.5039372", "0.5038172", "0.5030315", "0.5028218", "0.5028218", "0.502481", "0.5013019", "0.5002202" ]
0.0
-1
add_action('init', 'getfaircoin_coopshares_posts'); // now fires from marketifychild/header.php
function getfaircoin_only_one_item_on_cart($download_id) { //echo 'CART CONTENTS: '; //print_r($cart_contents); //$cart_contents = edd_get_cart_contents(); //if($cart_contents) return false; //else return $download_id; edd_empty_cart(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}", "function udesign_single_portfolio_entry_top() {\r\n do_action('udesign_single_portfolio_entry_top');\r\n}", "function codex_portfolio_init() {\r\n\r\n $slug = get_theme_mod( 'sovenco_project_slug', 'portfolio' );\r\n if ( ! $slug ) {\r\n $slug = 'portfolio';\r\n }\r\n\r\n $labels = array(\r\n 'name' => _x( 'Portfolios', 'post type general name', 'sovenco-plus' ),\r\n 'singular_name' => _x( 'Portfolio', 'post type singular name', 'sovenco-plus' ),\r\n 'menu_name' => _x( 'Portfolios', 'admin menu', 'sovenco-plus' ),\r\n 'name_admin_bar' => _x( 'Portfolio', 'add new on admin bar', 'sovenco-plus' ),\r\n 'add_new' => _x( 'Add New', 'portfolio', 'sovenco-plus' ),\r\n 'add_new_item' => __( 'Add New Portfolio', 'sovenco-plus' ),\r\n 'new_item' => __( 'New Portfolio', 'sovenco-plus' ),\r\n 'edit_item' => __( 'Edit Portfolio', 'sovenco-plus' ),\r\n 'view_item' => __( 'View Portfolio', 'sovenco-plus' ),\r\n 'all_items' => __( 'All Portfolios', 'sovenco-plus' ),\r\n 'search_items' => __( 'Search Portfolios', 'sovenco-plus' ),\r\n 'parent_item_colon' => __( 'Parent Portfolios:', 'sovenco-plus' ),\r\n 'not_found' => __( 'No portfolios found.', 'sovenco-plus' ),\r\n 'not_found_in_trash' => __( 'No portfolios found in Trash.', 'sovenco-plus' )\r\n );\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => $slug ),\r\n 'capability_type' => 'post',\r\n 'has_archive' => false,\r\n 'hierarchical' => false,\r\n 'menu_position' => null,\r\n 'supports' => array( 'title', 'editor', 'thumbnail' )\r\n );\r\n\r\n register_post_type( 'portfolio', $args );\r\n\r\n // Portfolio category\r\n $labels = array(\r\n 'name' => _x( 'Categories', 'taxonomy general name', 'sovenco-plus' ),\r\n 'singular_name' => _x( 'Category', 'taxonomy singular name', 'sovenco-plus' ),\r\n 'search_items' => __( 'Search Categories', 'sovenco-plus' ),\r\n 'popular_items' => __( 'Popular Categories', 'sovenco-plus' ),\r\n 'all_items' => __( 'All Categories', 'sovenco-plus' ),\r\n 'parent_item' => null,\r\n 'parent_item_colon' => null,\r\n 'edit_item' => __( 'Edit Category', 'sovenco-plus' ),\r\n 'update_item' => __( 'Update Category', 'sovenco-plus' ),\r\n 'add_new_item' => __( 'Add New Category', 'sovenco-plus' ),\r\n 'new_item_name' => __( 'New Category Name', 'sovenco-plus' ),\r\n 'separate_items_with_commas' => __( 'Separate categories with commas', 'sovenco-plus' ),\r\n 'add_or_remove_items' => __( 'Add or remove categories', 'sovenco-plus' ),\r\n 'choose_from_most_used' => __( 'Choose from the most used categories', 'sovenco-plus' ),\r\n 'not_found' => __( 'No categories found.', 'sovenco-plus' ),\r\n 'menu_name' => __( 'Categories', 'sovenco-plus' ),\r\n );\r\n\r\n $args = array(\r\n 'hierarchical' => false,\r\n 'labels' => $labels,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'update_count_callback' => '_update_post_term_count',\r\n 'query_var' => false,\r\n 'rewrite' => array( 'slug' => 'portfolio_cat' ),\r\n );\r\n\r\n register_taxonomy( 'portfolio_cat', 'portfolio', $args );\r\n\r\n}", "public static function init() {\n // hook into linkback functions to add more semantics\n add_action('pingback_post', array( 'SemanticLinkbacksPlugin', 'linkback_fix' ));\n add_action('trackback_post', array( 'SemanticLinkbacksPlugin', 'linkback_fix' ));\n add_action('webmention_post', array( 'SemanticLinkbacksPlugin', 'linkback_fix' ));\n\n add_filter('get_avatar', array( 'SemanticLinkbacksPlugin', 'get_avatar'), 11, 5);\n add_filter('comment_text', array( 'SemanticLinkbacksPlugin', 'comment_text_add_cite'), 11, 3);\n add_filter('comment_text', array( 'SemanticLinkbacksPlugin', 'comment_text_excerpt'), 12, 3);\n add_filter('get_comment_link', array( 'SemanticLinkbacksPlugin', 'get_comment_link' ), 99, 3);\n add_filter('get_comment_author_url', array( 'SemanticLinkbacksPlugin', 'get_comment_author_url' ), 99, 3);\n add_filter('get_avatar_comment_types', array( 'SemanticLinkbacksPlugin', 'get_avatar_comment_types' ));\n }", "function udesign_blog_entry_top() {\r\n do_action('udesign_blog_entry_top');\r\n}", "function udesign_single_post_entry_top() {\r\n do_action('udesign_single_post_entry_top');\r\n}", "function udesign_blog_entry_before() {\r\n do_action('udesign_blog_entry_before');\r\n}", "function pd_startup()\n{\n add_action('init', 'pd_head_cleanup');\n add_action('after_setup_theme', 'pd_theme_support'); /* end pd theme support */\n}", "public static function init() {\n\t\tHeadway::load('admin/admin-meta-boxes');\n\t\t\t\t\n\t\tadd_action('delete_post', array(__CLASS__, 'delete_post'));\n\n\t\tadd_filter('get_sample_permalink_html', array(__CLASS__, 'open_in_visual_editor_button'), 10, 4);\n\t\t\n\t}", "function udesign_blog_post_content_before() {\r\n do_action('udesign_blog_post_content_before');\r\n}", "function x_remove_portfolio_cpt() { \n remove_action( 'init', 'x_portfolio_init'); \n}", "public function init() {\n \\add_action('acf/save_post', array($this, 'save_post'), 20);\n \\add_filter('acf/save_post' , array($this, 'pre_save_post'), 9, 1 );\n\n }", "function sec_conf() {\n\n // Head cleanup\n add_action( 'init', 'sec_head_cleanup' );\n\n // Menu\n add_action( 'init', 'sec_register_nav_menus' );\n add_filter( 'nav_menu_css_class', 'sec_toggle_nav_class', 10, 2 );\n\n // Remove wp version from rss\n add_filter( 'the_generator', 'sec_rss_version' );\n\n // Enqueue scripts & styles\n add_action( 'wp_enqueue_scripts', 'sec_scripts_and_styles', 999 );\n\n // theme support after theme setup\n sec_theme_support();\n\n // change post type query on home page\n add_filter( 'pre_get_posts', 'sec_get_posts' );\n\n // clean up random code around images\n add_filter( 'the_content', 'sec_filter_ptags_on_images' );\n\n add_action( 'admin_menu', 'remove_author_metabox' );\n add_action( 'post_submitbox_misc_actions', 'move_author_to_publish_metabox' );\n\n // ACF Options Page\n initThemeOptions();\n\n // Debugger\n add_filter( 'template_include', 'var_template_include', 1000 );\n}", "public static function init() {\r\n\t\tadd_action( 'init', array( __CLASS__, 'add_custom_post' ), 0 );\r\n\t}", "function udesign_home_page_content_top() {\r\n do_action('udesign_home_page_content_top');\r\n}", "function spreadshop_checkout()\n{\ninclude(plugin_dir_path(__FILE__).'/checkout.php');\nadd_filter('wp_head', 'sources');\n}", "static function on_td_wp_booster_after_header() {\r\n $page_id = get_queried_object_id();\r\n\r\n if (is_page()) {\r\n\r\n\t // previous meta\r\n\t //$td_unique_articles = get_post_meta($page_id, 'td_unique_articles', true);\r\n\r\n\t $meta_key = 'td_page';\r\n\t $td_page_template = get_post_meta($page_id, '_wp_page_template', true);\r\n\t if (!empty($td_page_template) && ($td_page_template == 'page-pagebuilder-latest.php')) {\r\n\t\t $meta_key = 'td_homepage_loop';\r\n\r\n\t }\r\n\r\n\t $td_unique_articles = get_post_meta($page_id, $meta_key, true);\r\n\t if (!empty($td_unique_articles['td_unique_articles'])) {\r\n\t\t self::$keep_rendered_posts_ids = true; //for new module hook\r\n\t\t self::$unique_articles_enabled = true; //for datasource\r\n\t }\r\n }\r\n if (td_util::get_option('tds_ajax_post_view_count') == 'enabled') {\r\n self::$keep_rendered_posts_ids = true;\r\n }\r\n }", "public static function init() {\n\t\tadd_action( 'admin_menu', __CLASS__ . '::simple_social_meta_create_menu' );\n\n\t\t/* Add the post meta box on the 'add_meta_boxes' hook. */\n\t\tadd_action( 'add_meta_boxes', __CLASS__ . '::add_simple_social_meta_meta_box' );\n\n\t\t/* Save the post meta box data on the 'save_post' hook. */\n\t\tadd_action( 'save_post', __CLASS__ . '::save_simple_social_meta_meta_box', 10, 2 );\n\n\t}", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "function udesign_home_page_content_before() {\r\n do_action('udesign_home_page_content_before');\r\n}", "function micos_hooks() {\n\tglobal $storefront_version;\n\n\t// Remove cart to add them with a different priority\n remove_action( 'storefront_header', 'storefront_product_search', 40 );\n remove_action( 'storefront_header', 'storefront_header_cart', 60 );\n\n\t// Add cart and search with different priority\n\tadd_action( 'storefront_header', 'storefront_icons_start', 36);\n\tadd_action( 'storefront_header', 'storefront_product_search', 37);\n\tadd_action( 'storefront_header', 'storefront_myaccount_link', 38);\n\tadd_action( 'storefront_header', 'storefront_header_cart', 39);\n\tadd_action( 'storefront_header', 'storefront_icons_end', 40);\n\n\t// Add footer socials widget\n\tadd_action( 'storefront_footer', 'storefront_footer_widgets', 10 );\n\tadd_action( 'storefront_footer', 'footer_social_icons', 11 );\n\n}", "static function init(){\n\t\tadd_action('widgets_init', array(get_class(), 'register_search_widget_area'));\n\t\tadd_action('wp_enqueue_scripts', array(get_class(), 'enqueue_scripts'));\n\t\t\n\t\t//register the custom taxonomies\n\t\tadd_action('init', array(get_class(), 'register_search_taxonomies'));\n\t\t\n\t\t//add custom templates\n\t\tadd_filter('template_include', array(get_class(), 'include_new_template'));\n\t\t\n\t\tadd_filter('wp_title', array(get_class(), 'filter_the_title'), 10, 3);\n\t}", "function spreadshop_imprint()\n{\ninclude(plugin_dir_path(__FILE__).'/imprint.php');\nadd_filter('wp_head', 'sources');\n}", "function vc_before_init_actions() {\n\t\tif ( function_exists( 'vc_set_shortcodes_templates_dir' ) ) {\n\n\t\t\tvc_set_shortcodes_templates_dir( get_template_directory() . '/vc-elements' );\n\t\t}\n\n\t\trequire_once( get_template_directory() . '/vc-elements/my_post_slider.php' );\n\t}", "function udesign_page_content_top() {\r\n do_action('udesign_page_content_top');\r\n}", "function udesign_single_post_entry_before() {\r\n do_action('udesign_single_post_entry_before');\r\n}", "public function set_hooks()\n\t{\n\t\tadd_action('init', 'register_shortcodes');\n\t}", "function udesign_front_page_slider_before() {\r\n do_action('udesign_front_page_slider_before');\r\n}", "function addWPActions ()\n\t{\n\t\t//Add Front End Jquery and CSS\n\t\t//add_action( 'wp_footer', array( $this, 'frontendEnqueues' ) );\n\t\t\n\t}", "public function init()\n\t{\n\t\tglobal $coauthors_plus;\n\t\tremove_filter( 'posts_where', array( $coauthors_plus, 'posts_where_filter' ), 10, 2 );\n\t\tremove_filter( 'posts_join', array( $coauthors_plus, 'posts_join_filter' ), 10, 2 );\n\t\tremove_filter( 'posts_groupby', array( $coauthors_plus, 'posts_groupby_filter' ), 10, 2 );\n\t}", "function udesign_single_portfolio_entry_after() {\r\n do_action('udesign_single_portfolio_entry_after');\r\n}", "public function init()\r\n {\r\n add_action('wp_footer', array($this, 'display'));\r\n }", "function udesign_main_content_top( $is_front_page ) {\r\n do_action('udesign_main_content_top', $is_front_page);\r\n}", "function scratch_home_page_setup() {\n if (!in_array(true, $home_sidebars)) {\n return;\n }\n\n if( $home_sidebars['home-welcome']) {\n add_action('genesis_after_header', 'scratch_add_home_welcome');\n }\n if( $home_sidebars['call-to-action']) {\n add_action('genesis_after_header', 'scratch_add_call_to_action');\n }\n\n}", "function udesign_page_content_before() {\r\n do_action('udesign_page_content_before');\r\n}", "private function init_hooks(){ \r\n add_filter('parse_query',array($this,'bamobile_mobiconnector_add_type_to_posts_rest_api'));\r\n add_action('init',array($this,'bamobile_mobiconnector_add_show_in_rest_to_post_type'), 25);\r\n add_filter('rest_request_after_callbacks',array($this,'bamobile_mobiconnector_change_response_post_details'), 10, 3 );\r\n add_filter('rest_request_after_callbacks',array($this, 'bamobile_change_error_max_page'), 10, 3 );\t\r\n }", "public static function init() {\n\t\tadd_action( 'add_meta_boxes', array( 'ReplyContextPlugin', 'add_meta_boxes' ) );\n\t\tadd_action( 'save_post', array( 'ReplyContextPlugin', 'save_postdata' ), 5, 1 );\n\n\t\tadd_filter( 'webmention_links', array( 'ReplyContextPlugin', 'webmention_links' ), 10, 2 );\n\t\tadd_action( 'loop_start', array( 'ReplyContextPlugin', 'loop_start' ) );\n\t}", "function spreadshop_assortment()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortment.php');\nadd_filter('wp_head', 'sources');\n}", "function udesign_head_top() {\r\n do_action('udesign_head_top');\r\n}", "public function action_init() {\n\t\t\t$portfolio_args = array(\n\t \t'label' => __('Portfolio'),\n\t \t'singular_label' => __('Portfolio'),\n\t \t'public' => true,\n\t \t'show_ui' => true,\n\t \t'capability_type' => 'post',\n\t \t'hierarchical' => false,\n\t \t'rewrite' => true,\n\t \t'supports' => array('title', 'editor', 'thumbnail')\n\t );\n\t \n\t \tregister_post_type('portfolio',$portfolio_args);\n\t\t}", "function spreadshop_assortment_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortmentdetail.php');\nadd_filter('wp_head', 'sources');\n}", "function udesign_entry_top() {\r\n do_action('udesign_entry_top');\r\n}", "public static function init () : void\n {\n add_action(\"init\", function () {\n self::register_post_type();\n });\n }", "private static function init_hooks() {\n\t\tself::$initiated = true;\n\t\tadd_action( 'wp_head', array( 'mptheme_functions', 'theme_styles' ) );\n\t\tadd_action( 'wp_enqueue_scripts', array('mptheme_functions', 'mptheme_enqueue') );\n\n\t\t// If a Google Analytics ID is defined, add the code to the head\n\t\tif ( get_option( 'mptheme_google_analytics_id' ) ){\n\t\t\tadd_action( 'wp_head', array( 'mptheme_functions', 'mptheme_google_analytics_code' ) );\n\t\t}\n\n\t\t// If a Facebook Pixel ID is defined, add the code to the head\n\t\tif ( get_option( 'mptheme_facebook_pixel_id' ) ){\n\t\t\tadd_action( 'wp_head', array( 'mptheme_functions', 'mptheme_facebook_pixel_code' ) );\n\t\t}\n\n\t}", "function udesign_footer_before() {\r\n do_action('udesign_footer_before');\r\n}", "public static function init()\n {\n // add_action('wp_head', array(__CLASS__, 'html5shiv'), 1);\n\n // add_action('wp_head', array(__CLASS__, 'favicon'));\n //add_action('wp_head', array(__CLASS__, 'fontloader'));\n\n // Use only if supporting IE8\n // add_action('wp_head', array(__CLASS__, 'ieResponsive'));\n\n add_action('wp_enqueue_scripts', array(__CLASS__, 'stylesheet'));\n add_action('wp_enqueue_scripts', array(__CLASS__, 'javascript'));\n //add_action('wp_footer', array(__CLASS__, 'googleAnalytics'));\n\n }", "function init(){\n //if(!$this->is_ticket_type())\n // return false;\n //add\n $pages=array('post.php','post-new.php');\n foreach($pages as $page){\n add_action(\"load-{$page}\" , array($this,'add_remove_metaboxes' ));\n add_action(\"admin_head-{$page}\", array($this,'generate_css'));\n }\n\n }", "function learndash_coupons_init() {\n\t\tadd_action( 'wp_ajax_learndash_apply_coupon', 'learndash_apply_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_remove_coupon', 'learndash_remove_coupon' );\n\t\tadd_action( 'wp_ajax_learndash_enroll_with_zero_price', 'learndash_enroll_with_zero_price' );\n\t\tadd_action( 'learndash_transaction_created', 'learndash_process_coupon_after_transaction' );\n\t\tadd_filter( 'learndash_get_price_by_coupon', 'learndash_get_price_by_coupon', 10, 3 );\n\t}", "function vc_before_init_actions() {\n \t require_once( get_template_directory().'/vc-elements/my-first-custom-element.php' );\n require_once( get_template_directory().'/vc-elements/progressbar0.php' );\n\t require_once( get_template_directory().'/vc-elements/card-counter-card.php' );\t \n\t require_once( get_template_directory().'/vc-elements/Services.php' );\t\n require_once( get_template_directory().'/vc-elements/Carousel-Side-Caption.php' );\n\t require_once( get_template_directory().'/vc-elements/InteractiveSVG.php' );\n\t require_once( get_template_directory().'/vc-elements/piechart.php' );\n\t require_once( get_template_directory().'/vc-elements/OurServices.php' );\n\t require_once( get_template_directory().'/vc-elements/Timeline66.php' );\n\t require_once( get_template_directory().'/vc-elements/ServiceBox76.php' );\n\t require_once( get_template_directory().'/vc-elements/project.php' );\n\t require_once( get_template_directory().'/vc-elements/project1.php' );\n\t }", "function udesign_top_wrapper_before() {\r\n do_action('udesign_top_wrapper_before');\r\n}", "static function init(){\n\t\tadd_action('wp_ajax_athlates_contribution', array(get_class(), 'show_athlates_contribution'));\n\t\tadd_action('wp_ajax_nopriv_athlates_contribution', array(get_class(), 'show_athlates_contribution'));\n\t\t\n\t\t\n\t\t//ajax actions to email verification\n\t\tadd_action('wp_ajax_athlates_email_verify', array(get_class(), 'athlates_email_verify'));\n\t\tadd_action('wp_ajax_nopriv_athlates_email_verify', array(get_class(), 'athlates_email_verify'));\n\t\t\n\t\t\n\t\t//visitors profiles are updated\n\t\tadd_action('wp_ajax_athlates_records_updated', array(get_class(), 'athlates_records_updated'));\n\t\tadd_action('wp_ajax_nopriv_athlates_records_updated', array(get_class(), 'athlates_records_updated'));\n\t\t\n\t\t\n\t\t//athlete's directory\n\t\tadd_shortcode('athletes_directory', array(get_class(), 'athletes_directory'));\n\t\t\n\t\t\n\t\t\n\t\t//ajax actions to add a record\n\t\tadd_action('wp_ajax_athlates_records_submitted', array(get_class(), 'ajax_reuqest_parsing'));\n\t\tadd_action('wp_ajax_nopriv_athlates_records_submitted', array(get_class(), 'ajax_reuqest_parsing'));\n\t\t\n\t}", "public function init() {\n\t\tadd_action( 'init', array( $this, 'new_page' ) );\n\t}", "function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}", "function cbp_display_front_page() {\n\t?>\n\t\t<h2>Chibipaint Integration</h2>\n\t\t<h3>Introduction</h3>\n\t\t<p>This plugin's purpose is to integrate the Chibipaint applet with Wordpress. The code was largely rewritten from the previous version back in 2010. Some of the notable differences are:</p>\n\t\t<ul class=\"ul-disc\">\n\t\t<li>Visibility &amp; Accessibility: Where you had to access the applet via the upload media section, it is now placed in a &quot;metabox&quot; above the WYSIWYG editor of any post type of your choosing</li>\n\t\t<li>Choice of location: You can choose where to place the files you save, but you are restricted to within the upload folder.</li>\n\t\t</ul>\n\t\t<p>If you feel I've missed any, feel free to let me know. The applet itself can be found at http://www.chibipaint.com/.</p>\n\t\t<h3>Known Limitations</h3>\n\t\t<ul class=\"ul-disc\">\n\t\t<li>Currently, you can only change the default dimensions. There are plans to allow users to add dimensions they commonly use and to pick them from a drop down list at the editor.</li>\n\t\t<li>There is currently no implementation of templates. The closest thing to it now is to upload an image to the post, select it in the list of images and click on Edit. There are also plans to implement a template feature for the plugin.</li>\n\t\t<li>The plugin cannot do a recursive search for wp-config.php.</li>\n\t\t<li>This plugin has not been tested with a multiuser wordpress install. It's certain it will not work since there are no filtering based on author, nor is the author of the image saved with the attachment.</li>\n\t\t<li>If the user saves the source file, all edits will be based on the source file. This is particularly troublesome for those who decide to save image only later on.</li>\n\t\t</ul>\n\t<?php\n}", "function add_init_hook(){\n\n\t\t// Hooks need to be always added so that the plugins in the content\n\t\t// can be rendered\n\t\tadd_action( 'init', array( &$this, 'add_wp_hooks' ) );\n\n\t\t$this->add_admin_panel();\n\t\t$this->add_custom_fields();\n\t\t\t\t\t\n\t\t$this->register_shortcodes();\n\n\t\tadd_action( 'wp_head', array( &$this, 'add_og_meta' ) );\n\t\tadd_action( 'wp_footer', array( &$this, 'add_fb_js' ) );\n\n\t\tadd_action( 'switch_theme', array( &$this, 'switch_theme_handler' ) );\n\n\t\tadd_action( 'widgets_init', array( &$this, 'load_widget' ) );\n\t}", "public static function init() {\n\t\t\n \t\tadd_action( 'init', array(get_class(), 'init_tax'), 0 );\n\t\t// Template\n\t\tadd_filter('template_include', array( get_class(), 'override_template' ) );\n\t\t// Meta Boxes\n\t\tadd_action( 'add_meta_boxes', array(get_class(), 'add_meta_boxes'));\n\t\tadd_action( 'save_post', array( get_class(), 'save_meta_boxes' ), 10, 2 );\n\t\t\n\t}", "static function init(){\n\t\t\t\tadd_action('wp_ajax_gdlr_core_get_pb_template', 'gdlr_core_page_builder_template::get_template');\n\t\t\t}", "function wc_show_author() {\n global $post;\n echo \"This plugin was made by William Cayetano\";\n\n}", "function udesign_entry_before() {\r\n do_action('udesign_entry_before');\r\n}", "public function __construct()\n {\n # set variables\n $this->cpt_prefix = 'ash_coupons'; \n $this->menu_parent = 'ad_skip_hire'; \n\n # hook into wordpress using actions\n add_action('init', [$this, 'coupon_post_type']);\n add_filter( 'cmb2_meta_boxes', [$this, 'register_meta_fields'] );\n add_filter( 'manage_' . $this->cpt_prefix . '_posts_columns', [$this, 'modify_post_columns'] );\n add_action( 'manage_' . $this->cpt_prefix . '_posts_custom_column', [$this, 'modify_table_content'], 10, 2 );\n }", "function initialize() {\t\t\t\t\t\n\t\t\t\n\t\t\t// Include templates\n\t\t\t//require_once( FU_PLUGIN_DIR . 'assets/inc/add-page-templates.php' );\t\n\n\t\t\t// Enqueue scripts\n\t\t\tadd_action('wp_enqueue_scripts', 'register_fluxiusers_scripts',100);\n\n\t\t\t// actions\n\t\t\tadd_action('init',\tarray($this, 'init'), 5);\t\t\t\t\n\t\t\t\n\t\t\t// filters\n\t\t\t//add_filter('posts_where',\t\tarray($this, 'posts_where'), 10, 2 );\n\t\t\t//add_filter('posts_request',\tarray($this, 'posts_request'), 10, 1 );\n\t\t\t\n\t\t}", "function portfolio_hl_setup() {\n add_theme_support('title-tag');\n\n\n\n\n /*\n * menu par default wordpress\n */\n register_nav_menus( array(\n 'primary' => esc_html__('Primary','portfolio_hl'),\n ));\n\n\n /*\n * Switch default core markup for search form, comment form, and comments\n * to output valid HTML5.\n */\n add_theme_support( 'html5', array(\n 'search-form',\n 'comment-form',\n 'comment-list',\n 'gallery',\n 'caption',\n ) );\n\n /*\n * Enable support for Post Thumbnails on posts and pages.\n *\n * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n */\n add_theme_support( 'post-thumbnails' );\n add_image_size( 'portfolio_hl-home-small', 200);\n add_image_size( 'portfolio_hl-home-large', 280, 280, true );\n add_image_size( 'portfolio_hl-blog-image', 690 );\n add_image_size( 'portfolio_hl-blog-thumb', 470);\n add_image_size( 'portfolio_hl-blog-header', 1920);\n\n /*\n * custum background wordpress function\n */\n add_theme_support('custum-background', apply_filters('portfolio_hl_custum_bakground_arg', array(\n 'default-color' =>'ffffff',\n 'default-image' => '',\n )));\n\n\n\n\n\n /**\n * Register widget area.\n *\n * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar\n */\nfunction portfolio_hl_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => esc_html__( 'Sidebar', 'portfolio_hl' ),\n\t\t'id' => 'sidebar-1',\n\t\t'description' => esc_html__( 'Add widgets here.', 'portfolio_hl' ),\n\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</section>',\n\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t'after_title' => '</span></h3>',\n\t) );\n\n\n\n}\nadd_action( 'widgets_init', 'portfolio_hl_widgets_init' );\n /*\n * logo custum\n */\n add_theme_support('custom-logo',array(\n 'height' => 55,\n 'width' => 200,\n 'flex-height' => true,\n ));\n\n }", "function add_wp_hooks(){\n\n\t\t$comments = new WordpressConnectComments();\n\t\t$like = new WordpressConnectLikeButton();\n\n\t}", "function TS_VCSC_Extensions_Front_Main() {\r\n\t\t\tglobal $post;\r\n\t\t\tglobal $wp_query;\r\n\t\t\t$url \t\t\t\t\t\t\t\t\t= plugin_dir_url( __FILE__ );\r\n\t\t\t$this->TS_VCSC_FilesRegistrations();\r\n\t\t\t// Check For Standard Frontend Page\r\n\t\t\tif (!is_404() && !is_search() && !is_archive()) {\r\n\t\t\t\t$TS_VCSC_StandardFrontendPage\t\t= \"true\";\r\n\t\t\t} else {\r\n\t\t\t\t$TS_VCSC_StandardFrontendPage\t\t= \"false\";\r\n\t\t\t}\r\n\t\t\t// Load Scripts As Needed\r\n\t\t\tif (!empty($post)){\r\n\t\t\t\t// Check for Standard Shortcodes\r\n\t\t\t\tif ((stripos($post->post_content, '[TS-VCSC-') !== FALSE) || (stripos($post->post_content, '[TS_VCSC_') !== FALSE)) {\r\n\t\t\t\t\t$TS_VCSC_StandardShorcodes\t\t= \"true\";\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$TS_VCSC_StandardShorcodes\t\t= \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t// Check for EnlighterJS Shortcodes\r\n\t\t\t\tif (stripos($post->post_content, '[TS_EnlighterJS_') !== FALSE) {\r\n\t\t\t\t\t$TS_VCSC_EnlighterShorcodes\t\t= \"true\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$TS_VCSC_EnlighterShorcodes\t\t= \"false\";\r\n\t\t\t\t}\r\n\t\t\t\t// Define Ajax Path Variable\r\n\t\t\t\t/*if (stripos($post->post_content, '[TS_VCSC_Timeline_CSS_Container') !== FALSE) {\r\n\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-ajax', \t\t$url . '/css/ts-visual-composer-extend-ajax.css', null, false, 'all');\r\n\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-ajax', \t$url . '/js/ts-visual-composer-extend-ajax.js', array('jquery'), false, true);\r\n\t\t\t\t\twp_localize_script('ts-visual-composer-extend-ajax', \t'$TS_VCSC_AjaxData', array(\r\n\t\t\t\t\t\t'ajaxurl' \t\t=> admin_url('admin-ajax.php'),\r\n\t\t\t\t\t\t'queryvars' \t=> json_encode($wp_query->query)\r\n\t\t\t\t\t));\r\n\t\t\t\t}*/\r\n\t\t\t\tif ((($this->TS_VCSC_LoadFrontEndLightbox == \"true\") || ($this->TS_VCSC_UseLightboxPrettyPhoto == \"true\") || ($this->TS_VCSC_UseLightboxAutoMedia == \"true\")) && ($TS_VCSC_StandardFrontendPage == \"true\") && ($this->TS_VCSC_UseInternalLightbox == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\")) {\r\n\t\t\t\t\tif ((((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? 'true' : 'false') == \"true\") {\r\n wp_enqueue_script('ts-extend-perfectscrollbar');\r\n wp_enqueue_style('ts-extend-perfectscrollbar');\r\n }\r\n wp_enqueue_script('ts-extend-krautlightbox');\r\n\t\t\t\t\twp_enqueue_style('ts-extend-krautlightbox');\r\n\t\t\t\t}\r\n\t\t\t\tif (($this->TS_VCSC_LoadFrontEndTooltips == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\")) {\r\n\t\t\t\t\twp_enqueue_style('ts-extend-tooltipster');\r\n\t\t\t\t\twp_enqueue_script('ts-extend-tooltipster');\t\r\n\t\t\t\t}\r\n\t\t\t\tif (get_option('ts_vcsc_extend_settings_loadFonts', 0) == 1) {\r\n\t\t\t\t\t// Add CSS for each enabled Font to WordPress Frontend\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(true);\r\n\t\t\t\t}\r\n\t\t\t\t/* Force Load of Core Files */\t\t\t\t\r\n\t\t\t\tif (($this->TS_VCSC_LoadFrontEndForcable == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\")) {\t\t\t\t\t\r\n\t\t\t\t\t// Load jQuery (if not already loaded)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndJQuery == \"true\") && (!wp_script_is('jquery'))) {\r\n\t\t\t\t\t\twp_enqueue_script('jquery');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t\t// Load Waypoints\r\n\t\t\t\t\t\tif ($this->TS_VCSC_LoadFrontEndWaypoints == \"true\") {\r\n\t\t\t\t\t\t\tif (wp_script_is('waypoints', $list = 'registered')) {\r\n\t\t\t\t\t\t\t\twp_enqueue_script('waypoints');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\twp_enqueue_script('ts-extend-waypoints');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add CSS for each enabled Icon Font to Page\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t\t// Load Other Required Files\r\n\t\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t\twp_enqueue_style('ts-extend-animations');\r\n\t\t\t\t\t\twp_enqueue_style('ts-extend-tooltipster');\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-tooltipster');\t\r\n\t\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-front');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-forms');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-galleries');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-backgrounds');\r\n\t\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-front');\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/* Files if Shortcode Detected or Widgets Activated */\r\n\t\t\t\tif ((($TS_VCSC_StandardShorcodes == \"true\" || $TS_VCSC_EnlighterShorcodes == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\")) || (($this->TS_VCSC_CustomPostTypesWidgets == \"true\") && ($TS_VCSC_StandardFrontendPage == \"true\"))) { \r\n\t\t\t\t\t// Load jQuery (if not already loaded)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndJQuery == \"true\") && (!wp_script_is('jquery'))) {\r\n\t\t\t\t\t\twp_enqueue_script('jquery');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load MooTools (for EnlighterJS)\r\n\t\t\t\t\tif (($this->TS_VCSC_LoadFrontEndMooTools == \"true\") && ($TS_VCSC_EnlighterShorcodes == \"true\")) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-library-mootools');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load Google Charts API\r\n\t\t\t\t\tif ((TS_VCSC_CheckShortcode('TS-VCSC-Google-Charts') == \"true\") || (TS_VCSC_CheckShortcode('TS-VCSC-Google-Tables') == \"true\")) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-google-charts');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Add CSS for each enabled Icon Font to Page\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Add CSS for Each Enabled Font (Force Load)\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function __construct(){\n\t\tadd_action('init', array($this, 'stockIntegrateWithVC'));\n\t}", "function wp_christiancrew_setup() {\r\n\r\n\tadd_action( 'init', array( 'phpBB', 'init' ) );\r\n\r\n\tif ( is_admin() ) {\r\n\t\tadd_action( 'init', array( 'phpBBAdmin', 'init' ) );\r\n\t}\r\n\r\n\t// Instantiate custom post types\r\n\t$CC_Divisions = new CC_Divisions();\r\n\r\n\t// Instantiate widgets\r\n\tadd_action( 'widgets_init', function(){ register_widget( 'TS_BTN' ); });\r\n\tadd_action( 'widgets_init', function(){ register_widget( 'Forums_BTN' ); });\r\n\tadd_action( 'widgets_init', function(){ register_widget( 'CC_Announcements' ); });\r\n\r\n\t// Add feed links to <head>\r\n\tadd_theme_support('automatic-feed-links');\r\n\r\n\t// Let WordPress handle document titles\r\n\tadd_theme_support('title-tag');\r\n\r\n\t// Add support for featured images to the cc_divisions post type\r\n\tadd_theme_support( 'post-thumbnails', array( 'divisions' ) );\r\n\tadd_image_size( 'division-thumb', 246, 138, true );\r\n\r\n\t// Register nav menu\r\n\tregister_nav_menus(array(\r\n\t\t'site_nav' => 'Site Nav',\r\n\t));\r\n\r\n\t// Remove unnecessary bits from WordPress\r\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\r\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\r\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\r\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\r\n\r\n}", "function me_theme_jetpack_portfolio_cpt() {\n\tadd_theme_support( 'jetpack-portfolio' );\n}", "function tcf_init() {\n require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'tcf_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'tcf_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'tcf_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'tcf_scripts_and_styles', 800 );\n add_action( 'wp_enqueue_scripts', 'template_scripts_and_styles', 999 );\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n tcf_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'tcf_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'tcf_excerpt_more' );\n\n}", "function ahs_callposts_activate(){\n add_option('ahscp_css', \".callposts_2col .post { float: left; margin-right: 20px; border-bottom: 1px solid #999; overflow: hidden; clear: none; }\\n.callposts_2col .post h3 { margin-bottom: 0; }\\n.callposts_2col .clr { height: 20px; }\\n.callposts.whitespace { background: #fff; width: 225px; float: right; margin-right: -10px; padding: 0 0 10px 10px; }\\n.callposts .floatbox { background-color: #eee; padding: 15px; float: right; margin: 10px -10px 10px 10px;}\\n.clr { clear: both; }\");\n\n add_option('ahscp_tmplnum', '3');\n add_option('ahscp_tmpl_1_title', 'Simple linked titles list');\n add_option('ahscp_tmpl_1_group', '1');\n add_option('ahscp_tmpl_1_text', '<li><a href=\"%%URL%%\">%%TITLE%%</a> %%EDITLINK%%</li>');\n add_option('ahscp_tmpl_2_title', 'Just title and full content');\n add_option('ahscp_tmpl_2_text', \"<div class=\\\"post\\\">\n<h3>%%TITLE%% %%EDITLINK%%</h3>\n<p>%%CONTENT%%</p>\n</div>\");\n add_option('ahscp_tmpl_3_title', 'Linked title, image, excerpt and continue link');\n add_option('ahscp_tmpl_3_text', \"<div class=\\\"post %%CATEGORY%%\\\">\n<h3><a href=\\\"%%URL%%\\\">%%TITLE%%</a> %%EDITLINK%%</h3>\n%%IMAGE%%<p>%%EXCERPT%%...<a href=\\\"%%URL%%\\\">More...</a></p>\n</div>\");\n}", "function omfg_mobile_pro_header() {\n\tdo_action('omfg_mobile_pro_header');\n}", "function udesign_page_title_before() {\r\n do_action('udesign_page_title_before');\r\n}", "function posts_on_front() {\n\n\t// Add setting section\n\tadd_settings_section(\n\t\t'custom_setting_section', // $id\n\t\t'Custome Setting Section', // $title\n\t\t'custom_setting_section_callback', // $callback\n\t\t'reading' // $page\n\t);\n\n\t// Add setting field\n\tadd_settings_field(\n\t\t'posts_on_front', // $id\n\t\t'Number of Posts to show on Front Page', // $title\n\t\t'posts_on_front_callback', // $callback\n\t\t'reading', // $page\n\t\t'custom_setting_section', // $section, or use 'default'\n\t\t[] //$args\n\t);\n\n\t// Register fields\n\tregister_setting('reading', 'posts_on_front');\n}", "function au_load_frontpage() {\n\n}", "function the_author_posts()\n {\n }", "function acf_get_posts($args = array())\n{\n}", "function the_post()\n {\n }", "public function __construct(){\n add_action( 'init', array( &$this, 'init' ) );\n\t\tadd_action( 'add_meta_boxes', array( &$this, 'pvplugin_add_meta_box' ) );\n\t\tadd_action( 'save_post', array( &$this, 'pvplugin_save_meta_box_data' ) );\n\t\tadd_action( 'restrict_manage_posts', array( &$this, 'wpse45436_admin_posts_filter_restrict_manage_posts' ) );\n\t\tadd_filter( 'parse_query', array( &$this, 'wpse45436_posts_filter' ) );\n\t\t\n\t\t\n }", "function fetch_portfolio_script() {\t\nwp_enqueue_style( 'portfolio-style', get_template_directory_uri() . '/inc/portfolio/css/portfolio.css' );\n}", "function publisher_cpHeader()\r\n{\r\n xoops_cp_header();\r\n\r\n //cannot use xoTheme, some conflit with admin gui\r\n echo '<link type=\"text/css\" href=\"' . PUBLISHER_URL . '/css/jquery-ui-1.7.1.custom.css\" rel=\"stylesheet\" />\r\n <link type=\"text/css\" href=\"' . PUBLISHER_URL . '/css/publisher.css\" rel=\"stylesheet\" />\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/funcs.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/cookies.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ui.core.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ui.tabs.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ajaxupload.3.9.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/publisher.js\"></script>\r\n ';\r\n}", "public function init()\n {\n add_action('admin_init', array($this, 'init_plugin'), 20);\n add_action( 'admin_enqueue_scripts', array( $this, 'admin_setup' ) );\n add_shortcode('webicon', array($this, 'dtbaker_shortcode_webicon'));\n add_action('widgets_init', create_function('', 'return register_widget(\"dtbaker_Social_Icons\");'));\n }", "function customPageHeader() {\n echo osc_apply_filter('custom_plugin_title', __('Plugins'));\n }", "public function action_init( )\n\t{\n\t\t$this->load_text_domain( 'flickrfeed' );\n\t\t$this->add_template( 'block.flickrfeed', dirname( __FILE__ ) . '/block.flickrfeed.php' );\n\t}", "function portfolio_setup() {\r\n\r\n /* ----- Register nav menu's ----- */\r\n register_nav_menus( array(\r\n 'head-menu' => __( 'Hoofd menu', 'portfolio' ),\r\n ) );\r\n\r\n /* ----- Making strings available for translation ----- */\r\n load_theme_textdomain( 'portfolio', get_template_directory() . '/languages' );\r\n\r\n /* ----- Add post thumbnails and featured images ----- */\r\n add_theme_support( 'post-thumbnails' );\r\n\r\n /* ----- Enable support for the following post formats:\r\n * aside, gallery, quote, image, and video ----- */\r\n add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\r\n\r\n // Add theme support for Custom Logo\r\n add_theme_support( 'custom-logo', array(\r\n 'flex-width' => false,\r\n ));\r\n\r\n }", "function wp_hooks() \n {\n // Wordpress actions & filters \n add_action( 'admin_menu', array(&$this,'admin_menu_link') );\n add_action( 'admin_head', array(&$this, 'remove_mediabuttons') );\n add_action( 'init', array(&$this, 'add_custom_post_type') );\n add_action( 'admin_init', array(&$this, 'add_metaboxes') );\n add_action( 'save_post', array(&$this, 'save_source_metabox'), 10, 2 );\n add_action( 'manage_posts_custom_column', array(&$this, 'add_custom_columns') ); // sets the row value\n \n $filter = 'manage_edit-' . $this->custom_post_type_name . '_columns';\n add_filter( $filter, array(&$this, 'add_header_columns') );\n add_filter( 'body_class', array(&$this, 'body_classes') );\n add_action('wp_print_styles', array(&$this, 'add_css') );\n\n add_filter( 'enter_title_here', array(&$this, 'change_title_text'), 10, 1 );\n add_filter( 'post_row_actions', array(&$this, 'remove_row_actions'), 10, 1 );\n add_filter( 'post_updated_messages', array(&$this, 'bbquotations_updated_messages') );\n\n add_action( 'admin_print_footer_scripts', array(&$this, 'remove_preview_button') );\n\n // add shortcode\n add_shortcode( 'bbquote', array(&$this, 'shortcode') );\n }", "protected static function _init()\n {\n /**\n * This functions a lot like a __construct in a instantiated class.\n */\n\n // Add the getFooter method to get_footer action.\n add_action('get_footer', [static::$_class, 'getFooter']);\n }", "public function main_load() {\n\t\tadd_action( 'admin_init', array( $this, 'custom_admin_init_action' ) );\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_meta_boxes_action' ) );\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'custom_admin_enqueue_scripts' ) );\n\t\tadd_action( 'pre_get_posts', array( $this, 'custom_pre_get_posts_action' ) );\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'custom_restrict_manage_posts_action' ) );\n\t\tadd_filter( 'posts_where', array( $this, 'custom_posts_where_filter' ), 10, 2 );\n\t}", "private function __construct(){\n\t// Add back in the registration of pochomaps post-type\n\tadd_action( 'init', array(&$this, 'register_pochomaps') );\n\t// Register the top level admin menu and page\n\n\tadd_action('admin_init', array(&$this, 'pochomaps_admin_init') );\n\tadd_action('admin_menu', array(&$this, 'pochomaps_admin_page') );\n\n\t// This is do add image upload functionality\n\tadd_action('admin_print_scripts', array(&$this, 'pocho_manager_admin_scripts') );\n\tadd_action('admin_print_styles', array(&$this, 'pocho_manager_admin_styles') );\n\n\t// Call Function to store value into database.\n\tadd_action('init', array(&$this, 'store_in_database'));\n\n\t// Call Function to delete image.\n\tadd_action('init', array(&$this, 'delete_image'));\n\n\t// Call function to add map point\n\tadd_action('init', array(&$this, 'add_mappoint'));\n\n\t// ----------------------------------\n\t//\n\t// Now register scripts for front end\n\t//\n\t// ----------------------------------\n\n\t// add_action('init', array(&$this, 'pochomaps_frontend_init'));\n\t// add_action( 'wp_enqueue_scripts', array(&$this,'pm_frontend_scripts') );\n\t// add_action( 'wp_enqueue_style', array(&$this,'pm_frontend_sty') );\n\n\n}", "public function subscribe()\r\n {\r\n /* Fire our meta box setup function on the post editor screen. */\r\n add_action('load-post.php', array(\r\n $this,\r\n 'setup'\r\n ));\r\n add_action('load-post-new.php', array(\r\n $this,\r\n 'setup'\r\n ));\r\n }", "function portfolio_web_pingback_header() {\r\n\tif ( is_singular() && pings_open() ) {\r\n\t\techo '<link rel=\"pingback\" href=\"', esc_url( get_bloginfo( 'pingback_url' ) ), '\">';\r\n\t}\r\n}", "function checkout_page_load() {\r\n\t if ( !is_main_site() )\r\n\t return;\r\n\t\t\r\n\t\t//prevent weird redo when theme has multiple query loops\r\n\t\tif ($this->checkout_processed)\r\n\t\t\treturn;\r\n\t\t\r\n //check if on checkout page\r\n\t if (!$this->get_setting('checkout_page') || get_queried_object_id() != $this->get_setting('checkout_page'))\r\n\t return;\r\n\r\n\t //force ssl on the checkout page if required by gateway\r\n\t if ( apply_filters('psts_force_ssl', false) && !is_ssl() ) {\r\n\t\t\twp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\r\n\t\t\texit();\r\n\t }\r\n\r\n\t //make sure session is started\r\n\t if (session_id() == \"\")\r\n\t \tsession_start();\r\n\t\t\r\n\t\t//passed all checks, flip one time flag\r\n\t\t$this->checkout_processed = true;\r\n\t\t\r\n\t\t//remove all filters except shortcodes and checkout form\r\n\t\tremove_all_filters('the_content');\r\n\t\tadd_filter('the_content', 'do_shortcode');\r\n add_filter('the_content', array(&$this, 'checkout_output'), 15);\r\n\r\n wp_enqueue_script('psts-checkout', $this->plugin_url . 'js/checkout.js', array('jquery'), $this->version );\r\n if ( !current_theme_supports( 'psts_style' ) )\r\n\t\t\twp_enqueue_style('psts-checkout', $this->plugin_url . 'css/checkout.css', false, $this->version );\r\n\r\n\t\t//setup error var\r\n\t\t$this->errors = new WP_Error();\r\n\r\n\t\t//set blog_id\r\n\t\tif (isset($_POST['bid']))\r\n\t\t $blog_id = intval($_POST['bid']);\r\n\t\telse if (isset($_GET['bid']))\r\n\t\t $blog_id = intval($_GET['bid']);\r\n else\r\n\t\t $blog_id = false;\r\n\r\n\t\tif ($blog_id) {\r\n\r\n add_filter( 'the_title', array(&$this, 'page_title_output'), 99, 2 );\r\n\t\t\tadd_filter( 'bp_page_title', array(&$this, 'page_title_output'), 99, 2 );\r\n\r\n\t\t //clear coupon if link clicked\r\n\t\t if (isset($_GET['remove_coupon']))\r\n\t\t unset($_SESSION['COUPON_CODE']);\r\n\r\n\t\t //check for coupon session variable\r\n\t\t if (isset($_SESSION['COUPON_CODE'])) {\r\n\t\t\t if ( $this->check_coupon($_SESSION['COUPON_CODE'], $blog_id, intval(@$_POST['level'])) ) {\r\n\t\t\t $coupon = true;\r\n\t\t\t } else {\r\n\t\t\t if (isset($_POST['level']) && is_numeric($_POST['level'])) {\r\n\t\t\t \t$this->errors->add('coupon', __('Sorry, the coupon code you entered is not valid for your chosen level.', 'psts'));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t $this->errors->add('coupon', __('Whoops! The coupon code you entered is not valid.', 'psts'));\r\n\t\t\t unset($_SESSION['COUPON_CODE']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t if (isset($_POST['coupon-submit'])) {\r\n\t\t $code = preg_replace('/[^A-Z0-9_-]/', '', strtoupper($_POST['coupon_code']));\r\n\t\t $coupon = $this->check_coupon($code, $blog_id);\r\n\t\t if ($coupon) {\r\n\t\t $_SESSION['COUPON_CODE'] = $code;\r\n\t\t $this->log_action( $blog_id, __(\"User added a valid coupon to their order on the checkout page:\", 'psts') . ' ' . $code );\r\n\t\t } else {\r\n\t\t $this->errors->add('coupon', __('Whoops! The coupon code you entered is not valid.', 'psts'));\r\n\t\t $this->log_action( $blog_id, __(\"User attempted to add an invalid coupon to their order on the checkout page:\", 'psts') . ' ' . $code );\r\n\t\t }\r\n\t\t }\r\n\t\t\t\t\t\r\n\t\t\tdo_action('psts_checkout_page_load', $blog_id); //for gateway plugins to hook into\r\n\t\t} else {\r\n\t\t\t//code for unique coupon links\r\n\t\t\tif (isset($_GET['coupon'])) {\r\n\t\t $code = preg_replace('/[^A-Z0-9_-]/', '', strtoupper($_GET['coupon']));\r\n\t\t if ($this->check_coupon($code))\r\n\t\t $_SESSION['COUPON_CODE'] = $code;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static function init() {\n // For more info see: https://codex.wordpress.org/Roles_and_Capabilities#unfiltered_html\n add_filter('wp_kses_allowed_html', array('CubxRuntime', 'returnAllowedCustomTags'), 10, 2);\n add_filter('tiny_mce_before_init', array('CubxRuntime', 'filterTinyMceBeforeInit'));\n // use this filter to replace all custom tags with dashes before kses filter is applied\n add_filter('content_save_pre', array('CubxRuntime', 'transformCustomTags'), 9);\n // use this to retransform filtered html before saving\n add_filter('content_save_pre', array('CubxRuntime', 'retransformCustomTags'), 11);\n\n // adding the needed cubbles platform scripts\n add_action('wp_enqueue_scripts', array('CubxRuntime', 'addRuntime'));\n // add cif init attribute to crc loader script tag\n add_filter('clean_url', array('CubxRuntime', 'addCifScriptAttr'), 10, 1);\n // make the content get wrapped by a client runtime container (<div cubx-core-crc>[the content]</div>)\n add_filter('the_content', array('CubxRuntime', 'wrapContent'));\n\n // add admin menu\n add_action('admin_menu', array('CubxRuntime', 'addAdminMenu'));\n }", "function wpcom_vip_enable_sharing() {\n\tadd_filter( 'post_flair', 'sharing_display', 20 );\n}", "function genesis_simple_share_init() {\n\n\t/** Load textdomain for translation */\n load_plugin_textdomain( 'genesis-simple-share', false, basename( dirname( __FILE__ ) ) . '/languages/' );\n\t\t\n\tif( is_admin() && class_exists( 'Genesis_Admin_Boxes' ) ) {\n\t\trequire_once( GENESIS_SIMPLE_SHARE_LIB . 'admin.php' );\n\t\trequire_once( GENESIS_SIMPLE_SHARE_LIB . 'post-meta.php' );\n\t}\n\telse\n\t\trequire_once( GENESIS_SIMPLE_SHARE_LIB . 'front-end.php' );\n\t\t\n\t//require_once( GENESIS_SIMPLE_SHArE_LIB . 'functions.php' );\n\n}", "function rest_output_link_wp_head()\n {\n }", "function csco_activated_theme() {\n\tcsco_plugin_set_options( 'post-views-counter' );\n\tcsco_plugin_set_options( 'wp-seo' );\n}", "function p2_setup() {\n\trequire_once( get_template_directory() . '/inc/custom-header.php' );\n\tp2_setup_custom_header();\n\n\tadd_theme_support( 'automatic-feed-links' );\n\tadd_theme_support( 'post-formats', p2_get_supported_post_formats( 'post-format' ) );\n\n\tadd_theme_support( 'custom-background', apply_filters( 'p2_custom_background_args', array( 'default-color' => 'f1f1f1' ) ) );\n\n\tadd_filter( 'the_content', 'make_clickable', 12 ); // Run later to avoid shortcode conflicts\n\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Menu', 'p2' ),\n\t) );\n\n\tif ( is_admin() && false === get_option( 'prologue_show_titles' ) )\n\t\tadd_option( 'prologue_show_titles', 1 );\n}", "function colloquium_theme_setup() {\n add_action('wp_head', 'colloquium_bbpress_custom_color');\n}", "static function td_init() {\r\n /**\r\n * we need to hook after header because in mega menu we can have all kinds of modules and we don't want the unique\r\n * articles class to interfere with them.\r\n */\r\n add_filter('td_wp_booster_after_header', array(__CLASS__, 'on_td_wp_booster_after_header'), 10);\r\n\r\n /**\r\n * this hook is called each time a module is instantiated\r\n */\r\n add_filter('td_wp_booster_module_constructor', array(__CLASS__, 'on_td_wp_booster_module_constructor'), 5, 3);\r\n }", "function ll_team_landing_setup() {\n\tremove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );\n\tremove_action( 'genesis_entry_header', 'genesis_do_post_title' );\n\tremove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );\n\tadd_action( 'genesis_loop', 'll_team_news_section' );\n\tremove_action( 'genesis_after_content', 'genesis_get_sidebar' );\n\tadd_action( 'genesis_before_content', 'genesis_get_sidebar' );\n}", "public function action_wp_head() {\n\t\t?>\n\t\t<style>\n\t\t\t.wpcom-related-posts ul li {\n\t\t\t\tlist-style-type: none;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "function theme_enqueue_scripts() {\n wp_enqueue_script( 'pavi_load_post' );\n\n}" ]
[ "0.7020533", "0.7000086", "0.65423626", "0.6474568", "0.64283824", "0.6369209", "0.6292077", "0.6196701", "0.61896455", "0.6181895", "0.61761653", "0.6152226", "0.6149891", "0.61490303", "0.6144369", "0.6136952", "0.61333424", "0.61252075", "0.6111077", "0.60991764", "0.609106", "0.60747004", "0.6071315", "0.6055251", "0.60518175", "0.6051419", "0.60433733", "0.60428166", "0.6036102", "0.6021778", "0.6014556", "0.60109603", "0.6006964", "0.59969646", "0.59911287", "0.597522", "0.5969076", "0.59625304", "0.59618235", "0.5956398", "0.5944114", "0.5942246", "0.5940646", "0.5909418", "0.5908311", "0.59082794", "0.5906307", "0.58790165", "0.5870742", "0.5869043", "0.5863316", "0.58630306", "0.5857845", "0.5849263", "0.58430237", "0.58307356", "0.58307064", "0.5830024", "0.58270663", "0.5812976", "0.58059806", "0.5805093", "0.57976973", "0.57867515", "0.57776284", "0.57499194", "0.57444125", "0.57432735", "0.57382375", "0.5738099", "0.57371277", "0.57349384", "0.5734676", "0.57304627", "0.5729678", "0.5720226", "0.5719612", "0.5716004", "0.57128847", "0.5712728", "0.5709242", "0.5708812", "0.5698993", "0.5692134", "0.5684294", "0.568371", "0.5683211", "0.56793123", "0.56793", "0.5672881", "0.5669643", "0.5664537", "0.5663302", "0.56628305", "0.56574225", "0.5656199", "0.5655562", "0.56491053", "0.56476265", "0.56471294", "0.56468654" ]
0.0
-1
// N E W U S E R F I E L D S //// Display fairaddress number field at checkout Add more here if you need to
function getfaircoin_edd_display_checkout_fields() { // get user's fairaddress number if they already have one stored if ( is_user_logged_in() ) { $user_id = get_current_user_id(); $fairaddress = get_the_author_meta( '_edd_user_fairaddress', $user_id ); $fairsaving = get_the_author_meta( '_edd_user_fairsaving', $user_id ); } $fairaddress = isset( $fairaddress ) ? esc_attr( $fairaddress ) : ''; $fairsaving = isset( $fairsaving ) ? esc_attr( $fairsaving ) : '0'; ?> <p id="edd-fairsaving-wrap"> <label class="edd-label" for="edd_fairsaving"> <?php echo _e('FairSaving Service', 'edd-getfaircoin'); ?> </label> <span class="edd-description"> <?php echo _e('Check this if you\'re not managing your own wallet yet, and want the FairSaving service team to take care of it.', 'edd-getfaircoin'); ?> </span> <input class="edd-checkbox" type="checkbox" name="edd_fairsaving" id="edd-fairsaving" value="<?php echo $fairsaving; ?>" onclick="fairsaving_hide_fairaddress(this)" /> <br /> </p> <p id="edd-fairaddress-wrap"> <label class="edd-label" for="edd_fairaddress"> <?php echo _e('Faircoin Address', 'edd-getfaircoin'); ?> </label> <span class="edd-description"> <?php echo _e('Enter your FAIR Address so we can send your Faircoins to your wallet.', 'edd-getfaircoin'); ?> </span> <input class="edd-input" type="text" name="edd_fairaddress" id="edd-fairaddress" placeholder="<?php echo _e('Faircoin Address', 'edd-getfaircoin'); ?>" value="<?php echo $fairaddress; ?>" /> </p> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drum_smart_address($address_array) {\n\t// Set up variables\n\t$street1 = $address_array['street1'];\n\t$street2 = $address_array['street2'];\n\t$city = $address_array['city'];\n\t$state = $address_array['state'];\n\t$zip = $address_array['zip'];\n\t// Format address for links to map\n\tif ($street2 == null) {\n\t\t$address = $street1 . ', ' . $street2 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t} else {\n\t\t$address = $street1 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t}\n\t// Create address output\n\t$output = $street1 . '<br />';\n\tif ($street2 != null) {\n\t\t$output .= $street2 . '<br />';\n\t}\n\t$output .= $city . ', ' . $state . ' ' . $zip;\n return $output;\n}", "public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }", "function retrieveAddress()\n{\n $usertoken = $_SESSION['usertoken'];\n\n //here is where you can override what the default values were set for your site. If you have a piece of content that\n //should be priced differently, you can set that value here\n $payload = array(\n// 'required_confirmations_override' => 3, //optional, default 0\n// 'amount_override' => 1, //optional\n// 'denomination_override' => 'usd' //optional\n );\n\n //this will return a jsonencoded array with an address, auto created if not found, and payment info if found\n $endpoint = 'https://api.coinbee.io/retrieve/' . $usertoken;\n\n return json_encode(doCurl($endpoint, $payload));\n}", "function getfaircoin_edd_view_order_details( $payment_meta, $user_info ) {\r\n $fairaddress = isset( $payment_meta['fairaddress'] ) ? $payment_meta['fairaddress'] : 'none';\r\n $fairsaving = isset( $payment_meta['fairsaving'] ) ? $payment_meta['fairsaving'] : '0';\r\n ?>\r\n <div class=\"column-container\">\r\n <div class=\"column\">\r\n <strong><?php echo _e('FairSaving: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairsaving\" value=\"<?php esc_attr_e( $fairsaving ); ?>\" class=\"small-text\" />\r\n <p class=\"description\"><?php _e( 'Customer FairSaving choice', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n <div class=\"column\">\r\n <strong><?php echo _e('FaircoinAddress: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairaddress\" value=\"<?php esc_attr_e( $fairaddress ); ?>\" class=\"medium-text\" />\r\n <p class=\"description\"><?php _e( 'Customer Faircoin address', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n}", "function viewAddress(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n return $payment->viewAddress();\r\n }", "function give_default_cc_address_fields( $form_id ) {\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give_cc_address\" class=\"cc-address\">\n\t\t<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, before address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_top' );\n\n\t\t// For Country.\n\t\t$selected_country = give_get_country();\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\t\t$countries = give_get_country_list();\n\n\t\t// For state.\n\t\t$selected_state = '';\n\t\tif ( $selected_country === give_get_country() ) {\n\t\t\t// Get default selected state by admin.\n\t\t\t$selected_state = give_get_state();\n\t\t}\n\t\t// Get the last payment made by user states.\n\t\tif ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {\n\t\t\t$selected_state = $give_user_info['card_state'];\n\t\t}\n\t\t// Get the country code.\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\n\n\t\t// Get the country list that does not require city.\n\t\t$city_required = ! array_key_exists( $selected_country, give_city_not_required_country_list() );\n\n\t\t?>\n\t\t<p id=\"give-card-country-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"billing_country\" class=\"give-label\">\n\t\t\t\t<?php esc_html_e( 'Country', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\n\t\t\t<select\n\t\t\t\tname=\"billing_country\"\n\t\t\t\tautocomplete=\"country\"\n\t\t\t\tid=\"billing_country\"\n\t\t\t\tclass=\"billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $countries as $country_code => $country ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 1', 'give' ); ?>\n\t\t\t\t<?php\n\t\t\t\tif ( give_field_is_required( 'card_address', $form_id ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The primary billing address for your credit card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address\"\n\t\t\t\tname=\"card_address\"\n\t\t\t\tautocomplete=\"address-line1\"\n\t\t\t\tclass=\"card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 1', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-2-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address_2\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 2', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( '(optional) The suite, apartment number, post office box (etc) associated with your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address_2\"\n\t\t\t\tname=\"card_address_2\"\n\t\t\t\tautocomplete=\"address-line2\"\n\t\t\t\tclass=\"card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 2', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-city-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_city\" class=\"give-label\">\n\t\t\t\t<?php _e( 'City', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator <?php echo( $city_required ? '' : 'give-hidden' ); ?>\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The city for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_city\"\n\t\t\t\tname=\"card_city\"\n\t\t\t\tautocomplete=\"address-level2\"\n\t\t\t\tclass=\"card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'City', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo( isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_city', $form_id ) && $city_required ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php\n\t\t/**\n\t\t * State field logic.\n\t\t */\n\t\t$state_label = __( 'State', 'give' );\n\t\t$states_label = give_get_states_label();\n\t\t// Check if $country code exists in the array key for states label.\n\t\tif ( array_key_exists( $selected_country, $states_label ) ) {\n\t\t\t$state_label = $states_label[ $selected_country ];\n\t\t}\n\t\t$states = give_get_states( $selected_country );\n\t\t// Get the country list that do not have any states.\n\t\t$no_states_country = give_no_states_country_list();\n\t\t// Get the country list that does not require states.\n\t\t$states_not_required_country_list = give_states_not_required_country_list();\n\t\t// Used to determine if state is required.\n\t\t$require_state = ! array_key_exists( $selected_country, $no_states_country ) && give_field_is_required( 'card_state', $form_id );\n\t\t// Used to determine is state input should be marked as required.\n\t\t$validate_state = ! array_key_exists( $selected_country, $states_not_required_country_list ) && give_field_is_required( 'card_state', $form_id );\n\n\t\t?>\n\t\t<p id=\"give-card-state-wrap\"\n\t\t class=\"form-row form-row-first form-row-responsive <?php echo ( ! empty( $selected_country ) && ! $require_state ) ? 'give-hidden' : ''; ?> \">\n\t\t\t<label for=\"card_state\" class=\"give-label\">\n\t\t\t\t<span class=\"state-label-text\"><?php echo $state_label; ?></span>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"give-required-indicator <?php echo $validate_state ? '' : 'give-hidden'; ?> \">*</span>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\t\t\t<?php\n\n\t\t\tif ( ! empty( $states ) ) :\n\t\t\t\t?>\n\t\t\t\t<select\n\t\t\t\t\tname=\"card_state\"\n\t\t\t\t\tautocomplete=\"address-level1\"\n\t\t\t\t\tid=\"card_state\"\n\t\t\t\t\tclass=\"card_state give-select<?php echo $validate_state ? ' required' : ''; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $states as $state_code => $state ) {\n\t\t\t\t\t\techo '<option value=\"' . $state_code . '\"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t<?php else : ?>\n\t\t\t\t<input type=\"text\" size=\"6\" name=\"card_state\" id=\"card_state\" class=\"card_state give-input\"\n\t\t\t\t placeholder=\"<?php echo $state_label; ?>\" value=\"<?php echo $selected_state; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>\n\t\t\t\t/>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\n\t\t<p id=\"give-card-zip-wrap\" class=\"form-row <?php echo $require_state ? 'form-row-last' : ''; ?> form-row-responsive\">\n\t\t\t<label for=\"card_zip\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Zip / Postal Code', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The zip or postal code for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tsize=\"4\"\n\t\t\t\tid=\"card_zip\"\n\t\t\t\tname=\"card_zip\"\n\t\t\t\tautocomplete=\"postal-code\"\n\t\t\t\tclass=\"card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Zip / Postal Code', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, after address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_bottom' );\n\t\t?>\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}", "private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}", "function eralha_crowdfunding_account(){\n\t\t\t\n\t\t}", "function getfaircoin_edd_required_checkout_fields( $required_fields ) {\r\n $required_fields['edd_fairaddress'] = array(\r\n 'error_id' => 'invalid_fairaddress',\r\n 'error_message' => __('Please enter a valid Faircoin Address', 'edd-getfaircoin')\r\n );\r\n return $required_fields;\r\n}", "function spectra_address_balance ($address)\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT `balance` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"` WHERE `address` = '\".$address.\"'\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"balance\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"balance\"];\n\t\t}\n\t}", "function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = \"\\n\") {\n\t$address_query = tep_db_query(\"select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id = '\" . (int)$customers_id . \"' and address_book_id = '\" . (int)$address_id . \"'\");\n\t$address = tep_db_fetch_array($address_query);\n\t\n\t$format_id = tep_get_address_format_id($address['country_id']);\n\t\n\treturn tep_address_format($format_id, $address, $html, $boln, $eoln);\n}", "function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }", "public function invoiceAddress() {\r\n $result = $this->clients->flatInvoice();\r\n foreach ($result as $key => $value) {\r\n $getAdress = $this->clients->companyAddress($value->CustomerCompanyID);\r\n $data = array('Params' => $getAdress[0]->Params);\r\n $response = $this->clients->invoiceAdressupdate($value->InvoiceID, $data);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "function cardNumber()\n\t\t{\n\t\t\techo $this->card_number;\n\t\t}", "function print_account_info()\r\n{\r\n}", "public function show(Address $address)\n\t{\n\t\t//\n\t}", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "public function renderAddress()\n {\n echo $this->getAddressStringSingleLine();\n }", "public function fetch(Mage_Sales_Model_Quote_Address $address)\n {\n if ($address->getInterest() != 0)\n {\n $address->addTotal(array\n (\n 'code' => $this->getCode(),\n 'title' => Mage::helper('azpay')->__('Interest'),\n 'value' => $address->getInterest()\n ));\n }\n }", "public function getAccount($bitcoinaddress);", "public function printDistributorAddress()\n {\n $str = '<address class=\"vcard\">';\n $str .= '<p>';\n $str .= '<strong class=\"org\">' . $this->name . '</strong>';\n if ( ! empty($this->address)) {\n $str .= '<br><span class=\"adr\">';\n $str .= '<span class=\"street-address\">' . $this->address . '</span>';\n if ( ! empty($this->city)) {\n $str .= '<br><span class=\"locality\">' . $this->city . '</span>';\n }\n if ( ! empty($this->region)) {\n $str .= ', <span class=\"region\">' . $this->region . '</span>';\n }\n if ( ! empty($this->postCode)) {\n $str .= ' <span class=\"postal-code\">' . $this->postCode . '</span>';\n }\n if ( ! empty($this->country)) {\n $str .= ', <span class=\"country-name\">' . $this->country . '</span>';\n }\n $str .= '</span>';\n }\n if ( ! empty($this->website)) {\n $str .= '<br><a href=\"' . $this->website . '\" class=\"url\">' . $this->website . '</a>';\n }\n if ( ! empty($this->contact)) {\n $str .= '<br>Contact: <span class=\"fn\">' . $this->contact . '</span>';\n }\n if ( ! empty($this->email)) {\n $str .= '<br>Email: <a href=\"mailto:' . $this->email . '\" class=\"email\">' . $this->email . '</a>';\n }\n if ( ! empty($this->phone)) {\n $str .= '<br>Phone: <span class=\"tel\">' . $this->phone . '</span>';\n }\n $str .= '</p>';\n $str .= '</address>';\n\n return $str;\n }", "public function fetch(Mage_Sales_Model_Quote_Address $address)\n {\n if ($address->getDesconto()!=0)\n {\n $address->addTotal(array( 'code' => $this->getCode(),\n 'title' => Mage::getStoreConfig('payment/nitrocielo/texto_desconto_a_vista'),\n 'value' => $address->getDesconto() ));\n }\n }", "public function show(Address $address)\n {\n //\n }", "public function show(Address $address)\n {\n //\n }", "public function show(Address $address)\n {\n //\n }", "public function getBillingAddress($includeOrdererDetails = false)\n {\n $address = \"\";\n\n if ($includeOrdererDetails) {\n $address .= $this->name . \"<br>\";\n $address .= ($this->program_name ? $this->program_name : $this->program->name) . \"<br>\";\n }\n\n $address .= $this->address1 . \"<br>\";\n $address .= $this->address2 ? $this->address2 . \"<br>\" : \"\";\n $address .= $this->address3 ? $this->address3 . \"<br>\" : \"\";\n $address .= $this->city . \", \" . $this->state . \" \" . $this->zip;\n\n return $address;\n }", "function edd_stripe_update_billing_address_field() {\n\t$payment_mode = strtolower( edd_get_chosen_gateway() );\n\tif ( edd_is_checkout() && 'stripe' !== $payment_mode ) {\n\t\treturn;\n\t}\n\n\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\tif ( empty( $existing_cards ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! did_action( 'edd_stripe_cc_form' ) ) {\n\t\treturn;\n\t}\n\n\t$default_card = false;\n\n\tforeach ( $existing_cards as $existing_card ) {\n\t\tif ( $existing_card['default'] ) {\n\t\t\t$default_card = $existing_card['source'];\n\t\t\tbreak;\n\t\t}\n\t}\n\t?>\n\t<p class=\"edd-stripe-update-billing-address-current\">\n\t\t<?php\n\t\tif ( $default_card ) :\n\t\t\t$address_fields = array( \n\t\t\t\t'line1' => isset( $default_card->address_line1 ) ? $default_card->address_line1 : null,\n\t\t\t\t'line2' => isset( $default_card->address_line2 ) ? $default_card->address_line2 : null,\n\t\t\t\t'city' => isset( $default_card->address_city ) ? $default_card->address_city : null,\n\t\t\t\t'state' => isset( $default_card->address_state ) ? $default_card->address_state : null,\n\t\t\t\t'zip' => isset( $default_card->address_zip ) ? $default_card->address_zip : null,\n\t\t\t\t'country' => isset( $default_card->address_country ) ? $default_card->address_country : null,\n\t\t\t);\n\n\t\t\t$address_fields = array_filter( $address_fields );\n\n\t\t\techo esc_html( implode( ', ', $address_fields ) );\n\t\tendif;\n\t\t?>\n\t</p>\n\n\t<p class=\"edd-stripe-update-billing-address-wrapper\">\n\t\t<input type=\"checkbox\" name=\"edd_stripe_update_billing_address\" id=\"edd-stripe-update-billing-address\" value=\"1\" />\n\t\t<label for=\"edd-stripe-update-billing-address\"><?php _e( 'Enter new billing address', 'edds' ); ?></label>\n\t</p>\n\t<?php\n}", "public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}", "public function show_refund_address() {\n\t\treturn $this->get_option( 'show_refund_address', 'no' ) == 'yes';\n\t}", "public function getStreetNumber();", "function get_footer_address() {\n\t$street_address = '';\n\t$city = '';\n\t$postal_code = '';\n\t$country = '';\n\t/**\n\t * Check if we are in front-page:\n\t */\n\tif (is_page_template('page-templates/front-page.php')){\n\t\tif ( get_field('front_page_contact_street_address') )\n\t\t\t$street_address = get_field('front_page_contact_street_address');\n\t\tif ( get_field('front_page_contact_city') )\n\t\t\t$city = get_field('front_page_contact_city');\n\t\tif ( get_field('front_page_contact_postal_code') )\n\t\t\t$postal_code = get_field('front_page_contact_postal_code');\n\t\tif ( get_field('front_page_contact_country') )\n\t\t\t$country = get_field('front_page_contact_country');\n\t}\n\t/**\n\t * If NOT in front-page:\n\t */\n\telse {\n\t\t/**\n\t\t * Check if we are in companies page:\n\t\t */\n\t\tif (is_singular('companies')) {\n\t\t\tif ( get_field('company_contact_street_address') )\n\t\t\t\t$street_address = get_field('company_contact_street_address');\n\t\t\tif ( get_field('company_contact_city') )\n\t\t\t\t$city = get_field('company_contact_city');\n\t\t\tif ( get_field('company_contact_postal_code') )\n\t\t\t\t$postal_code = get_field('company_contact_postal_code');\n\t\t\tif ( get_field('company_contact_country') )\n\t\t\t\t$country = get_field('company_contact_country');\n\t\t}\n\t\t/**\n\t\t * Check if we are in group of companies page:\n\t\t */\n\t\tif (is_singular('group_of_companies')) {\n\t\t\tif ( get_field('group_of_companies_contact_street_address') )\n\t\t\t\t$street_address = get_field('group_of_companies_contact_street_address');\n\t\t\tif ( get_field('group_of_companies_contact_city') )\n\t\t\t\t$city = get_field('group_of_companies_contact_city');\n\t\t\tif ( get_field('group_of_companies_contact_postal_code') )\n\t\t\t\t$postal_code = get_field('group_of_companies_contact_postal_code');\n\t\t\tif ( get_field('group_of_companies_contact_country') )\n\t\t\t\t$country = get_field('group_of_companies_contact_country');\n\t\t}\n\t}\n\tif ($street_address == '' && $city == '' && $postal_code == '' && $country == '') {\n\t\t/**\n\t\t * Don't show the red marker for address.\n\t\t */\n\t}\n\telse {\n\t\t/**\n\t\t * Generate google_maps_url:\n\t\t */\n\t\t$google_maps_url = 'http://maps.google.com/?q='.$street_address.','.$city.','.$postal_code;\n\t\t?>\n\t\t<a href=\"<?php echo $google_maps_url; ?>\" class=\"contact-link\" target=\"_blank\">\n\t\t\t<img src=\"<?php echo get_template_directory_uri().'/images/icon_address.png'; ?>\" class=\"footer-icon\">\n\t\t\t<br>\n\t\t\t<span class=\"contact-street-address\"><?php echo $street_address; ?></span>\n\t\t\t<span class=\"contact-postal-code-and-city\"><?php echo $postal_code; ?> <?php echo $city; ?></span>\n\t\t\t<span class=\"contact-country\"><?php echo $country; ?></span>\n\t\t</a>\n\t\t<?php\n\t}\n}", "public function indexAction()\n {\n $ssn = $this->getRequest()->getParam('ssn');\n\n // Init PayEx\n $px = new Px();\n $px->setEnvironment(Mage::getStoreConfig(self::XML_PATH_MODULE_ACCOUNTNUMBER), Mage::getStoreConfig(self::XML_PATH_MODULE_ENCRYPTIONKEY), (bool)Mage::getStoreConfig(self::XML_PATH_MODULE_DEBUG));\n\n $params = array(\n 'accountNumber' => '',\n 'countryCode' => 'SE', // Supported only \"SE\"\n 'socialSecurityNumber' => $ssn\n );\n $result = $px->GetConsumerLegalAddress($params);\n if ($result['code'] !== 'OK' || $result['description'] !== 'OK' || $result['errorCode'] !== 'OK') {\n if (preg_match('/\\bInvalid parameter:SocialSecurityNumber\\b/i', $result['description'])) {\n $data = array(\n 'success' => false,\n 'message' => Mage::helper('aait_ssn')->__('Invalid Social Security Number')\n );\n $this->getResponse()->setHeader('Content-type', 'application/json');\n $this->getResponse()->setBody(Zend_Json::encode($data));\n return;\n }\n\n $data = array(\n 'success' => false,\n 'message' => $result['errorCode'] . '(' . $result['description'] . ')'\n );\n $this->getResponse()->setHeader('Content-type', 'application/json');\n $this->getResponse()->setBody(Zend_Json::encode($data));\n return;\n }\n\n $data = array(\n 'success' => true,\n 'first_name' => $result['firstName'],\n 'last_name' => $result['lastName'],\n 'address_1' => $result['address1'],\n 'address_2' => $result['address2'],\n 'postcode' => $result['postNumber'],\n 'city' => $result['city'],\n 'country' => $result['country']\n );\n\n $this->getResponse()->setHeader('Content-type', 'application/json');\n $this->getResponse()->setBody(Zend_Json::encode($data));\n }", "public function getAddress() {\n if($this->isCash) {\n return $this->getPdfUrl(Dotpay::getInstance()->getSettings()->getPaymentUrl());\n } else {\n return $this->getBankPage(Dotpay::getInstance()->getSettings()->getPaymentUrl());\n }\n }", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {\n $address_format_query = tep_db_query(\"select address_format as format from \" . TABLE_ADDRESS_FORMAT . \" where address_format_id = '\" . (int)$address_format_id . \"'\");\n $address_format = tep_db_fetch_array($address_format_query);\n\n $company = tep_output_string_protected($address['company']);\n if (isset($address['firstname']) && tep_not_null($address['firstname'])) {\n $firstname = tep_output_string_protected($address['firstname']);\n $lastname = tep_output_string_protected($address['lastname']);\n } elseif (isset($address['name']) && tep_not_null($address['name'])) {\n $firstname = tep_output_string_protected($address['name']);\n $lastname = '';\n } else {\n $firstname = '';\n $lastname = '';\n }\n $street = tep_output_string_protected($address['street_address']);\n $suburb = tep_output_string_protected($address['suburb']);\n $city = tep_output_string_protected($address['city']);\n $state = tep_output_string_protected($address['state']);\n if (isset($address['country_id']) && tep_not_null($address['country_id'])) {\n $country = tep_get_country_name($address['country_id']);\n\n if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) {\n $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state);\n }\n } elseif (isset($address['country']) && tep_not_null($address['country'])) {\n $country = tep_output_string_protected($address['country']);\n } else {\n $country = '';\n }\n $postcode = tep_output_string_protected($address['postcode']);\n $zip = $postcode;\n\n if ($html) {\n// HTML Mode\n $HR = '<hr>';\n $hr = '<hr>';\n if ( ($boln == '') && ($eoln == \"\\n\") ) { // Values not specified, use rational defaults\n $CR = '<br>';\n $cr = '<br>';\n $eoln = $cr;\n } else { // Use values supplied\n $CR = $eoln . $boln;\n $cr = $CR;\n }\n } else {\n// Text Mode\n $CR = $eoln;\n $cr = $CR;\n $HR = '----------------------------------------';\n $hr = '----------------------------------------';\n }\n\n $statecomma = '';\n $streets = $street;\n if ($suburb != '') $streets = $street . $cr . $suburb;\n if ($country == '') $country = tep_output_string_protected($address['country']);\n if ($state != '') $statecomma = $state . ', ';\n\n $fmt = $address_format['format'];\n eval(\"\\$address = \\\"$fmt\\\";\");\n\n if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) {\n $address = $company . $cr . $address;\n }\n\n return $address;\n }", "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}", "function storefront_footer_site_info()\n {\n ?>\n <div class=\"content-copyright text-center\" itemprop=\"streetAddress\">Central Jakarta, Indonesia</div>\n <div class=\"content-copyright text-center\">Developed by <a target=\"_blank\" href=\"https://taufiqelrahman.com\">taufiqelrahman.com</a>.</div>\n <?php\n }", "function honeycomb_credit() {\n\t\t?>\n\t\t<div class=\"site-info\">\n\t\t\t<?php echo esc_html( apply_filters( 'honeycomb_copyright_text', $content = '&copy; ' . get_bloginfo( 'name' ) . ' ' . date( 'Y' ) ) ); ?>\n\t\t\t<?php if ( apply_filters( 'honeycomb_credit_link', true ) ) { ?>\n\t\t\t<br /> <?php echo __(sprintf( esc_attr__( '%1$s powered by %2$s.', 'honeycomb' ), 'Honeycomb', '<a href=\"https://wp-property-hive.com\" title=\"Property Hive - The Leading WordPress Platform For Estate Agency Websites\" rel=\"author\">Property Hive</a>' ), 'propertyhive'); ?>\n\t\t\t<?php } ?>\n\t\t</div><!-- .site-info -->\n\t\t<?php\n\t}", "function wc_veruspay_display_crypto_address_in_admin( $order ) {\n\tglobal $wc_veruspay_global;\n\t$order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;\n\t$wc_veruspay_payment_method = $order->get_payment_method();\n\tif ( $wc_veruspay_payment_method == $wc_veruspay_global['id'] ){\n\t\t$wc_veruspay_order_status = get_post_meta( $order_id, '_wc_veruspay_status', TRUE );\n\t\tif ( $wc_veruspay_order_status == 'noaddress' ) {\n\t\t\tforeach ( $order->get_items() as $item_key => $item_values) { \n\t\t\t\t$wc_veruspay_stock = get_post_meta( $item_values['variation_id'], '_manage_stock', TRUE ); \n\t\t\t}\n\t\t\tupdate_post_meta( $order_id, '_wc_veruspay_status', sanitize_text_field( 'cancelled' ) );\n\t\t\t$order->update_status( 'cancelled', __( 'Missing Payment Address', 'woocommerce') );\n\t\t\theader(\"Refresh:0\");\n\t\t}\n\t\telse {\n\t\t\tif ( $order->has_status( 'processing' ) ) {\n\t\t\t\t$wc_veruspay_payment_status = 'Received';\n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_paid', TRUE );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$wc_veruspay_payment_status = 'Pending'; \n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_price', TRUE ); \n\t\t\t}\n\t\t\t$wc_veruspay_address = get_post_meta( $order_id, '_wc_veruspay_address', TRUE );\n\t\t\t$_chain_up = strtoupper( get_post_meta( $order_id, '_wc_veruspay_coin', TRUE ) );\n\t\t\t$_chain_lo = strtolower( $_chain_up );\n\t\t\techo '<style>.wc-order-totals-items{height:3rem!important}.wc-order-totals-items:after{content: \"' . $_chain_up . ' ' . $wc_veruspay_payment_status . ': ' . $wc_veruspay_price . '\"!important;position:relative;font-size:1rem;font-weight:bold;color:#007bff!important;top:0;float:right;width:200px;height:30px;}</style>';\n\t\t\techo '<p><strong>'.__( $_chain_up . ' Price', 'woocommerce' ).':</strong>' . $wc_veruspay_price . ' with exchange rate of ' . get_post_meta( $order_id, '_wc_veruspay_rate', TRUE ) . '</p>';\n\t\t\tif ( substr($wc_veruspay_address, 0, 2) !== 'zs' ) {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> <a target=\"_BLANK\" href=\"' . $wc_veruspay_global['chain_dtls'][$_chain_lo]['address'] . $wc_veruspay_address . '\">' . $wc_veruspay_address . '</a></p>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> '.$wc_veruspay_address.'</p';\n\t\t\t}\n\t\t}\n\t}\n}", "function get_contact_address_markup() {\n\t$address = get_theme_mod( 'organization_address' );\n\tif ( !empty( $address ) ) {\n\t\tob_start();\n\t?>\n\t<address class=\"address\">\n\t\t<?php echo wptexturize( nl2br( $address ) ); ?>\n\t</address>\n\t<?php\n\t\treturn ob_get_clean();\n\t}\n\treturn;\n}", "public function toString()\n\t{\n\t\treturn \"Customer on checkout page - Shipping address popup - created address is shown on [Shipping address] and [Billing address] section\";\n\t}", "function oos_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = \"\\n\") {\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $address_booktable = $oostable['address_book'];\n $query = \"SELECT entry_firstname AS firstname, entry_lastname AS lastname, entry_company AS company,\n entry_street_address AS street_address, entry_suburb AS suburb, entry_city AS city,\n entry_postcode AS postcode, entry_state AS state, entry_zone_id AS zone_id,\n entry_country_id AS country_id\n FROM $address_booktable\n WHERE customers_id = '\" . intval($customers_id) . \"' AND\n address_book_id = '\" . intval($address_id) . \"'\";\n $address = $dbconn->GetRow($query);\n\n $format_id = oos_get_address_format_id($address['country_id']);\n\n return oos_address_format($format_id, $address, $html, $boln, $eoln);\n }", "function commerce_braintree_creditcard_edit_form_submit($form, &$form_state) {\n $sub = commerce_braintree_subscription_local_get(array('sid' => $form_state['values']['sid']), FALSE);\n $token = $sub['token'];\n $commerce_customer_address = $form_state['values']['commerce_customer_address']['und'][0];\n //billing address\n $billing_address['firstName'] = isset($commerce_customer_address['first_name']) ? $commerce_customer_address['first_name'] : '';\n $billing_address['lastName'] = isset($commerce_customer_address['last_name']) ? $commerce_customer_address['last_name'] : '';\n $billing_address['company'] = isset($commerce_customer_address['organisation_name']) ? $commerce_customer_address['organisation_name'] : '';\n $billing_address['streetAddress'] = isset($commerce_customer_address['thoroughfare']) ? $commerce_customer_address['thoroughfare'] : '';\n $billing_address['extendedAddress'] = isset($commerce_customer_address['premise']) ? $commerce_customer_address['premise'] : '';\n $billing_address['locality'] = isset($commerce_customer_address['locality']) ? $commerce_customer_address['locality'] : '';\n $billing_address['region'] = isset($commerce_customer_address['administrative_area']) ? $commerce_customer_address['administrative_area'] : '';\n $billing_address['postalCode'] = isset($commerce_customer_address['postal_code']) ? $commerce_customer_address['postal_code'] : '';\n $billing_address['countryCodeAlpha2'] = isset($commerce_customer_address['country']) ? $commerce_customer_address['country'] : '';\n \n //creditcard\n $creditcard['cardholderName'] = $form_state['values']['ca_cardholder_name'];\n $creditcard['number'] = $form_state['values']['credit_card']['number'];\n $creditcard['cvv'] = $form_state['values']['credit_card']['code'];\n $creditcard['expirationDate'] = $form_state['values']['credit_card']['exp_month'];\n $creditcard['expirationDate'] .= '/' . $form_state['values']['credit_card']['exp_year'];\n $creditcard['billingAddress'] = $billing_address;\n $creditcard['options'] = array('verifyCard' => TRUE);\n $creditcard['billingAddress']['options'] = array('updateExisting' => TRUE);\n \n $card = commerce_braintree_credit_card_update($creditcard, $token);\n if ($card->success) {\n drupal_set_message(t('Updated Successfull.'));\n return;\n }\n drupal_set_message(t('There are error. @errors', array('@errors' => commerce_braintree_get_errors($card))), 'error');\n}", "function balance($details,$phone){\n\tif(count($details)==1){\n $ussd_text=\"CON <br/> Enter your ID statement\"; \n ussd_proceed($ussd_text); \n\n\t}elseif (count($details)==2) {\n\t\t# code...\n\t\t$ussd_text=\"CON <br/> Enter your NAME\"; \n ussd_proceed($ussd_text); \n}elseif (count($details)==3) {\n\t\t# code...\n\t\t$ussd_text=\"CON <br/> Enter your second NAME\"; \n ussd_proceed($ussd_text); \n}\n\t}", "function show_my_text_on_checkout() {\n echo '<p>All credit card details are processed and stored securely via Stripe.</p>'; \n}", "function setBankReceiptNumber($num)\n {\n $this->bank_receipt = $num;\n }", "function address() { return ($this->address); }", "function getFieldStreetAddressPostCode($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_spostcode');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_spostcode');\n\t\t$tooltip = setToolTipNotification(\"spostcode\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('spostcode') === 'spostcode' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='spostcode' id='spostcode' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('spostcode') === 'spostcode' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function display_address( $post ) {\n\t\t\t// output buffer start\n\t\t\tob_start();\n\n\t\t\t//nonce field for address meta box\n\t\t\twp_nonce_field( 'rt_restaurant_address_nonce', 'restaurant_address_nonce', false );\n\n\t\t\t// Array for address fields\n\t\t\t$addr = array( \"streetAddress\" => \"Street Address\", \"addressLocality\" => \"Locality\", \"addressRegion\" => \"Region\", \"postalCode\" => \"Postal Code\", \"addressCountry\" => \"Country\" );\n\n\t\t\t// Retriving address post meta for particular post.\n\t\t\t$add = get_post_meta( $post->ID, '_restaurant_address', true );\n\n\t\t\t//includes address html\n\t\t\trequire \\rtCamp\\WP\\rtRestaurants\\PATH . 'includes/views/address.php';\n\n\t\t\t// Get output buffer value into variable and clear output buffer\n\t\t\t$ob_address = ob_get_clean();\n\n\t\t\t/**\n\t\t\t * Filter for change post meta box display of address post meta.\n\t\t\t *\n\t\t\t * This filter allow user to change meta box of address post meta by passing output string.\n\t\t\t *\n\t\t\t * @since 0.1\n\t\t\t *\n\t\t\t * @param string $var Filter name\n\t\t\t * @param string $ob_address\n\t\t\t */\n\t\t\t$ob_address = apply_filters( 'rt_restaurant_address_html', $ob_address );\n\n\n\t\t\t/**\n\t\t\t * Action to add extra fields in address display\n\t\t\t * \n\t\t\t * @param string $ob_address\n\t\t\t */\n\t\t\tdo_action( 'rt_restaurants_address_display', $ob_address );\n\n\t\t\treturn $ob_address;\n\t\t}", "protected function _doAddressbooks()\n {\n global $prefs;\n\n $abooks = $prefs->getValue('addressbooks');\n if (is_array(json_decode($abooks))) {\n return;\n }\n\n $abooks = explode(\"\\n\", $abooks);\n if (is_array($abooks) && !empty($abooks[0])) {\n $new_prefs = array();\n foreach ($abooks as $abook) {\n $new_prefs[] = $this->_updateShareName($abook);\n }\n\n $prefs->setValue('addressbooks', json_encode($new_prefs));\n }\n }", "function jt_cmb2_address_field( $metakey, $post_id = 0 ) {\n\techo jt_cmb2_get_address_field( $metakey, $post_id );\n}", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "public function display_account_billing_information( ){\n\t\tif( $this->is_page_visible( \"billing_information\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_billing_information.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_billing_information.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_billing_information.php' );\n\t\t}\n\t}", "public function toString()\n\t{\n\t\t$checksum = Hash::ripemd160($this->addy);\n\t\t$this->addy = Buffertools::concat($this->addy, $checksum->slice(0, 4));\n\t\treturn $this->address_prefix . Base58::encode($this->addy);\n\t}", "public function show(CustomerAddress $add)\n\t{\n\t\t//\n\t}", "public function updateAction()\n {\n /**\n * Fetch given address hash\n */\n $addressHash = $this->getRequest()->getParam('address_key');\n\n /**\n * Only if hash were given\n */\n if ( $addressHash ) {\n\n /**\n * Fetch all addresses in session\n */\n $allAddresses = Mage::getSingleton('core/session')->getKlarnaAddresses();\n\n /**\n * Look for a matching hash\n */\n foreach ($allAddresses as $address) {\n if ( $address['hash'] == $addressHash ) {\n\n /**\n * Fetch quote\n */\n $quote = Mage::getModel('checkout/cart')->getQuote();\n\n /**\n * Update billing address\n */\n if ( $quote && $quote->getBillingAddress() ) {\n\n $quote->getBillingAddress()\n ->setFirstname($address['fname'])\n ->setLastname($address['lname'])\n ->setCompany($address['company'])\n ->setStreet($address['street'])\n ->setPostcode($address['zip'])\n ->setCity($address['city'])\n ->setCountry(Mage::helper('klarna')->klarnaCountryToMagento($address['country']))\n ->save();\n }\n\n /**\n * Update shipping address\n */\n if ( $quote && $quote->getShippingAddress() ) {\n\n $quote->getShippingAddress()\n ->setFirstname($address['fname'])\n ->setLastname($address['lname'])\n ->setCompany($address['company'])\n ->setStreet($address['street'])\n ->setPostcode($address['zip'])\n ->setCity($address['city'])\n ->setCountry(Mage::helper('klarna')->klarnaCountryToMagento($address['country']))\n ->save();\n }\n\n /**\n * Return successful response\n */\n return $this->jsonReponse(Mage::helper('klarna/json')->success(array('success' => true)));\n }\n }\n }\n\n /**\n * Return the json error\n */\n return $this->jsonReponse(Mage::helper('klarna/json')->error($this->__('Unable to set address')));\n }", "public function getBillingAddress();", "public function getBillingAddress();", "function set_street_address($name='*', $suffix='*', $street_num='*', $apt_num='*')\r\n{\r\n\tif ( $this->debug ) $this->print_d(__FUNCTION__ . ' : set street address');\r\n\t\r\n\t// random apartment num\r\n\tif ( $apt_num == '*' ) $apt_num = $this->_get_random_apt_num();\r\n\t\r\n\t// random suffix (St, Ave, Blvd, etc.)\r\n\tif ( $suffix == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_SUFFIX = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$suffix = $_SUFFIX[1];\r\n\t\tif ( $this->debug ) $this->print_d(\"random suffix: $suffix\");\r\n\t}\r\n\t\r\n\t// random street name\r\n\tif ( $name == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_NAME = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$name = $_NAME[0];\r\n\t\tif ( $this->debug ) $this->print_d(\"random name: $name\");\r\n\t}\r\n\t\r\n\t// street number (quick and dirty)\r\n\tif ( $street_num == '*' )\r\n\t{\r\n\t\t$street_num = mt_rand(1,12500);\r\n\t\tif ( $this->debug ) $this->print_d(\"random street number: $street_num\");\r\n\t}\r\n\t\r\n\t// set street prop\r\n\t$this->street_address = trim(ucwords(strtolower(\"$street_num $name $suffix $apt_num\")));\r\n\tif ( $this->debug ) $this->print_d(\"random street_address : {$this->street_address}\");\r\n\treturn;\r\n}", "public function getStreetNumber() {\n\t\treturn $this->streetNumber;\n\t}", "public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}", "function viewStudentAddress( $sessionID, $addressID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT * FROM X_PNSY_ADDRESS WHERE ADDRESS_ID='$addressID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t\r\n\t\t\treturn mysql_fetch_assoc($result);\r\n\t\t}\r\n\t}", "function display_bank_header(&$order)\n{\n\tglobal $Ajax, $Refs;\n\t$payment = $order->trans_type == ST_BANKPAYMENT;\n\n\t$customer_error = false;\n\tdiv_start('pmt_header');\n\n\tstart_outer_table(TABLESTYLE2, \"width=90%\"); // outer table\n\n\ttable_section(1);\n\t\n date_row(_(\"Date:\"), 'date_', '', true, 0, 0, 0, null, true);\n\n\tref_row(_(\"Reference:\"), 'ref', '');\n\n\ttable_section(2, \"33%\");\n\n\tif (!isset($_POST['PayType']))\n\t{\n\t\tif (isset($_GET['PayType']))\n\t\t\t$_POST['PayType'] = $_GET['PayType'];\n\t\telse\n\t\t\t$_POST['PayType'] = \"\";\n\t}\n\tif (!isset($_POST['person_id']))\n\t{\n\t\tif (isset($_GET['PayPerson']))\n\t\t\t$_POST['person_id'] = $_GET['PayPerson'];\n\t\telse\n\t\t\t$_POST['person_id'] = \"\";\n\t}\n\tif (isset($_POST['_PayType_update'])) {\n\t\t$_POST['person_id'] = '';\n\t\t$Ajax->activate('pmt_header');\n\t\t$Ajax->activate('code_id');\n\t\t$Ajax->activate('pagehelp');\n\t\t$Ajax->activate('editors');\n\t\t$Ajax->activate('footer');\n\t}\n payment_person_types_list_row( $payment ? _(\"Pay To:\"):_(\"From:\"),\n\t\t 'PayType', $_POST['PayType'], true);\n switch ($_POST['PayType'])\n {\n\t\tcase PT_MISC :\n \t\ttext_row_ex($payment ?_(\"To the Order of:\"):_(\"Name:\"),\n\t\t\t\t 'person_id', 40, 50);\n \t\tbreak;\n\t\t//case PT_WORKORDER :\n \t//\tworkorders_list_row(_(\"Work Order:\"), 'person_id', null);\n \t//\tbreak;\n\t\tcase PT_SUPPLIER :\n \t\tsupplier_list_row(_(\"Supplier:\"), 'person_id', null, false, true, false, true);\n \t\tbreak;\n\t\tcase PT_CUSTOMER :\n \t\tcustomer_list_row(_(\"Customer:\"), 'person_id', null, false, true, false, true);\n\n \tif (db_customer_has_branches($_POST['person_id']))\n \t{\n \t\tcustomer_branches_list_row(_(\"Branch:\"), $_POST['person_id'], \n\t\t\t\t\t'PersonDetailID', null, false, true, true, true);\n \t}\n \telse\n \t{\n\t\t\t\t$_POST['PersonDetailID'] = ANY_NUMERIC;\n \t\thidden('PersonDetailID');\n \t}\n \t$trans = get_customer_habit($_POST['person_id']); // take care of customers on hold\n \tif ($trans['dissallow_invoices'] != 0)\n \t{\n \t\tif ($payment)\n \t\t{\n \t\t\t$customer_error = true;\n\t\t\t\t\tdisplay_error(_(\"This customer account is on hold.\"));\n \t\t}\n \t\telse\t\t\t\n\t\t\t\t\tdisplay_warning(_(\"This customer account is on hold.\"));\n \t}\t\t\n \t\tbreak;\n\n\t\tcase PT_QUICKENTRY :\n\t\t\tquick_entries_list_row(_(\"Type\").\":\", 'person_id', null, ($payment ? QE_PAYMENT : QE_DEPOSIT), true);\n\t\t\t$qid = get_quick_entry(get_post('person_id'));\n\t\t\tif (list_updated('person_id')) {\n\t\t\t\tunset($_POST['totamount']); // enable default\n\t\t\t\t$Ajax->activate('footer');\n\t\t\t\t$Ajax->activate('totamount');\n\t\t\t}\n\t\t\tamount_row($qid['base_desc'].\":\", 'totamount', price_format($qid['base_amount']),\n\t\t\t\t null, \"&nbsp;&nbsp;\".submit('go', _(\"Go\"), false, false, true));\n\t\t\tbreak;\t\n\t\t//case payment_person_types::Project() :\n \t//\tdimensions_list_row(_(\"Dimension:\"), 'person_id', $_POST['person_id'], false, null, true);\n \t//\tbreak;\n }\n\n\ttable_section(3, \"33%\");\n\n\tif (!$order->order_id && !get_post('bank_account'))\n\t{\n\t\tif ($_POST['PayType'] == PT_CUSTOMER)\n\t\t\t$_POST['bank_account'] = get_default_customer_bank_account($_POST['person_id']);\n\t\telseif ($_POST['PayType'] == PT_SUPPLIER)\t\n\t\t\t$_POST['bank_account'] = get_default_supplier_bank_account($_POST['person_id']);\n\t\telse\n\t\t\tunset($_POST['bank_account']);\n\t}\t\t\n \n bank_accounts_list_row( $payment ? _(\"From:\") : _(\"Into:\"), 'bank_account', null, true);\n if ($payment)\n\t\tbank_balance_row($_POST['bank_account']);\n\n\t$bank_currency = get_bank_account_currency($_POST['bank_account']);\n\n\texchange_rate_display(get_company_currency(), $bank_currency, $_POST['date_']);\n\n\tend_outer_table(1); // outer table\n\n\tdiv_end();\n\tif ($customer_error)\n\t{\n\t\tend_form();\n\t\tend_page();\n\t\texit;\n\t}\n}", "function edd_stripe_setup_billing_address_fields() {\n\n\tif( ! function_exists( 'edd_use_taxes' ) ) {\n\t\treturn;\n\t}\n\n\tif( edd_use_taxes() || 'stripe' !== edd_get_chosen_gateway() || ! edd_get_cart_total() > 0 ) {\n\t\treturn;\n\t}\n\n\t$display = edd_get_option( 'stripe_billing_fields', 'full' );\n\n\tswitch( $display ) {\n\n\t\tcase 'full' :\n\n\t\t\t// Make address fields required\n\t\t\tadd_filter( 'edd_require_billing_address', '__return_true' );\n\n\t\t\tbreak;\n\n\t\tcase 'zip_country' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\t\t\tadd_action( 'edd_after_cc_fields', 'edd_stripe_zip_and_country', 9 );\n\n\t\t\t// Make Zip required\n\t\t\tadd_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' );\n\n\t\t\tbreak;\n\n\t\tcase 'none' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\n\t\t\tbreak;\n\n\t}\n\n}", "public function actionAjaxAddress()\n { \n $detail = new QuotationDetail();\n $this->layout = false;\n if ( Yii::$app->request->post() ) {\n $customerId = Yii::$app->request->post()['customerId'];\n $address = Address::find()->where(['customer_id' => $customerId,'address_type'=>'billing'])->all();\n return $this->render('ajax-address', [\n 'address' => $address,\n ]);\n }\n }", "public function actionAddressView($address_id)\r\n {\r\n $customer_id = Yii::$app->user->getId();\r\n $combinedAddress = [];\r\n $combinedAddress['address'] = CustomerAddress::findone([\r\n 'address_id' => $address_id,\r\n 'customer_id' => $customer_id\r\n ]);\r\n\r\n $address = CustomerAddressResponse::find()\r\n ->select('aq.question_ar, aq.question,aq.required, whitebook_customer_address_response.*')\r\n ->innerJoin('whitebook_address_question aq', 'aq.ques_id = address_type_question_id')\r\n ->where('address_id = :address_id', [':address_id' => $address_id])\r\n ->asArray()\r\n ->all();\r\n if ($address) {\r\n $combinedAddress['question'] = $address;\r\n }\r\n return $combinedAddress;\r\n }", "function link_card()\n\t{\n\t\tlog_message('debug', 'Account/link_card');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['featuredBanks'] = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'10', 'isFeatured'=>'Y'));\n\n\t\t$data = load_page_labels('link_card', $data);\n\t\t$this->load->view('account/link_card', $data);\n\t}", "public function bookCreditBalance($relatedDocNo) {\n trace('[METHOD] '.__METHOD__);\n $this->set_booked(true);\n $this->set_reserved(false);\n $this->set_relatedDocNo($relatedDocNo);\n $this->set_bookDate(date('Y-m-d'));\n $this->storeSelf();\n }", "function getfaircoin_edd_updated_edited_purchase( $payment_id ) {\r\n // get the payment meta\r\n $payment_meta = edd_get_payment_meta( $payment_id );\r\n // update our fairaddress number\r\n $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : false;\r\n $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : false;\r\n // update the payment meta with the new array\r\n update_post_meta( $payment_id, '_edd_payment_meta', $payment_meta );\r\n}", "public function getFullAddressAttribute(): string\n {\n return \"$this->address\" . ($this->address2 ? ' #' . $this->address2 : '') . \", $this->city $this->state, $this->zip\";\n }", "function address_shortcode() {\n ob_start();\n get_template_part('address');\n return ob_get_clean();\n}", "function getAddress($single){\n\t\t\t$list = $this -> makeRequest('GET', '/list', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'confirmations'=>4\n\t\t\t\t));\n\n\t\t\tif($single){\n\t\t\t\treturn $list['addresses'][0]['address'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $list['addresses'];\n\t\t\t}\n\t\t}", "function update_cart_address($address_field,$address_id){\n\n $this->update([$address_field => $address_id]);\n }", "function getFieldStreetAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_sstreet');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_sstreet');\n\t\t$tooltip = setToolTipNotification(\"sstreet\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('sstreet') === 'sstreet' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='sstreetNo' id='sstreetNo' value='\".$value1.\"' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='sstreetName' id='sstreetName' value='\".$value2.\"' size='12' class='srms-field \".(get_axl_req_fields('sstreet') === 'sstreet' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "private function SaveBillingAddress()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// If the customer isn't signed in then they've just entered an address that we need to validate\n\t\tif(!CustomerIsSignedIn()) {\n\t\t\t$errors = array();\n\t\t\t// An invalid address was entered, show the form again\n\t\t\t$addressDetails = $this->ValidateGuestCheckoutAddress('billing', $errors);\n\t\t\tif(!$addressDetails) {\n\t\t\t\t$this->ChooseBillingAddress($errors);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// We've just selected an address\n\t\t\tif(isset($_GET['address_id'])) {\n\t\t\t\t$addressDetails = (int)$_GET['address_id'];\n\t\t\t}\n\t\t}\n\n\t\t// There was a problem saving the selected billing address\n\t\tif(!$this->SetOrderBillingAddress($addressDetails)) {\n\t\t\t$this->ChooseBillingAddress();\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're automatically creating accounts for customers then we need to save those details too\n\t\tif(!CustomerIsSignedIn() && GetConfig('GuestCheckoutCreateAccounts')) {\n\t\t\t$password = substr(md5(uniqid(true)), 0, 8);\n\t\t\t$autoAccount = 1;\n\t\t\t$_SESSION['CHECKOUT']['CREATE_ACCOUNT'] = 1;\n\t\t\t$_SESSION['CHECKOUT']['ACCOUNT_DETAILS'] = array(\n\t\t\t\t'email' => $addressDetails['shipemail'],\n\t\t\t\t'password' => $password,\n\t\t\t\t'firstname' => $addressDetails['shipfirstname'],\n\t\t\t\t'lastname' => $addressDetails['shiplastname'],\n\t\t\t\t'company' => '',\n\t\t\t\t'phone' => $addressDetails['shipphone'],\n\t\t\t\t'autoAccount' => $autoAccount\n\t\t\t);\n\t\t}\n\n\t\tif($this->getQuote()->isDigital()) {\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"location:%s/checkout.php?action=confirm_order\", $GLOBALS['ShopPath']));\n\t\t}\n\t\telse {\n\t\t\t// Are we shipping to the same address?\n\t\t\tif(isset($_POST['ship_to_billing'])) {\n\t\t\t\tif(!$this->SetOrderShippingAddress($addressDetails, true)) {\n\t\t\t\t\t$this->ChooseShippingAddress();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now they need to choose the shipping provider for their order\n\t\t\t\t@ob_end_clean();\n\t\t\t\theader(\"Location: \".GetConfig('ShopPath').\"/checkout.php?action=choose_shipper\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Otherwise, we just move to the next step\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"location:%s/checkout.php?action=choose_shipping_address\", $GLOBALS['ShopPath']));\n\t\t}\n\t\texit;\n\t}", "public function wc_address_book_make_primary() {\n\n\t\t$customer_id = get_current_user_id();\n\t\t$address_book = $this->get_address_book( $customer_id );\n\n\t\t$primary_address_name = 'shipping';\n\t\t$alt_address_name = $_POST['name'];\n\n\t\t// Loop through and swap values between shipping names.\n\t\tforeach ( $address_book[ $primary_address_name ] as $field => $value ) {\n\n\t\t\t$alt_field = preg_replace( '/^[^_]*_\\s*/', $alt_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $alt_address_name ][ $alt_field ] );\n\t\t}\n\n\t\tforeach ( $address_book[ $alt_address_name ] as $field => $value ) {\n\n\t\t\t$primary_field = preg_replace( '/^[^_]*_\\s*/', $primary_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $primary_address_name ][ $primary_field ] );\n\t\t}\n\n\t\tdie();\n\t}", "function show_symbol()\n {\n echo \"Symbols purchased in Stack are:\\n\";\n $this->object_linkedlist->display();\n }", "public function bsuccessAction() {\n\t\t\n\t\t$session = Mage::getSingleton('checkout/session');\n\t\t\n\t\t$logFileName = 'magentoorder.log';\n\t\t\n\t\tMage::log('----------------- START ------------------------------- ', null, $logFileName);\t\n\t\t\n\t\t$quote = $session->getQuote();\n\t\t$quoteId = $quote->getEntityId();\n\t\t\n\t\t\n\t\t$typeData = $session->getTypeData();\n\t\t\n\t\t$privateId = $session->getBusinessPrivateId();\n\t\tif($privateId){\n\t\t\t$orderData = Mage::getModel('collectorbank/api')->getOrderResponse();\t\n\t\t\t//echo \"<pre>business \";print_r($orderData);die;\n\t\t\tif(isset($orderData['error'])){\n\t\t\t\t$session->addError($orderData['error']['message']);\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$orderDetails = $orderData['data'];\t\t\n\t\t\n\t\t\n\t\tif($orderDetails){\t\t\n\t\t\t$email = $orderDetails['businessCustomer']['email'];\n\t\t\t$mobile = $orderDetails['businessCustomer']['mobilePhoneNumber'];\n\t\t\t$firstName = $orderDetails['businessCustomer']['deliveryAddress']['companyName'];\n\t\t\t$lastName = $orderDetails['businessCustomer']['referencePerson'];\n\t\t\t\n\t\t\t\n\t\t\t$store = Mage::app()->getStore();\n\t\t\t$website = Mage::app()->getWebsite();\n\t\t\t$customer = Mage::getModel('customer/customer')->setWebsiteId($website->getId())->loadByEmail($email);\n\t\t\t\t// if the customer is not already registered\n\t\t\t\tif (!$customer->getId()) {\n\t\t\t\t\t$customer = Mage::getModel('customer/customer');\t\t\t\n\t\t\t\t\t$customer->setWebsiteId($website->getId())\n\t\t\t\t\t\t\t ->setStore($store)\n\t\t\t\t\t\t\t ->setFirstname($firstName)\n\t\t\t\t\t\t\t ->setLastname($lastName)\n\t\t\t\t\t\t\t ->setEmail($email); \n\t\t\t\t\ttry {\n\t\t\t\t\t \n\t\t\t\t\t\t$password = $customer->generatePassword(); \n\t\t\t\t\t\t$customer->setPassword($password); \n\t\t\t\t\t\t// set the customer as confirmed\n\t\t\t\t\t\t$customer->setForceConfirmed(true); \n\t\t\t\t\t\t// save customer\n\t\t\t\t\t\t$customer->save(); \n\t\t\t\t\t\t$customer->setConfirmation(null);\n\t\t\t\t\t\t$customer->save();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set customer address\n\t\t\t\t\t\t$customerId = $customer->getId(); \n\t\t\t\t\t\t$customAddress = Mage::getModel('customer/address'); \n\t\t\t\t\t\t$customAddress->setData($billingAddress)\n\t\t\t\t\t\t\t\t\t ->setCustomerId($customerId)\n\t\t\t\t\t\t\t\t\t ->setIsDefaultBilling('1')\n\t\t\t\t\t\t\t\t\t ->setIsDefaultShipping('1')\n\t\t\t\t\t\t\t\t\t ->setSaveInAddressBook('1');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// save customer address\n\t\t\t\t\t\t$customAddress->save();\n\t\t\t\t\t\t// send new account email to customer \n\t\t\t\t\t\t\n\t\t\t\t\t\t$storeId = $customer->getSendemailStoreId();\n\t\t\t\t\t\t$customer->sendNewAccountEmail('registered', '', $storeId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Customer with email '.$email.' is successfully created.', null, $logFileName);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Mage_Core_Exception $e) {\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$e->getMessage(), null, $logFileName);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$email, null, $logFileName);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t// Assign Customer To Sales Order Quote\n\t\t\t$quote->assignCustomer($customer);\n\t\t\t\n\t\t\tif($orderDetails['businessCustomer']['deliveryAddress']['country'] == 'Sverige'){\t$scountry_id = \"SE\";\t}\n\t\t\tif($orderDetails['businessCustomer']['invoiceAddress']['country'] == 'Sverige'){ $bcountry_id = \"SE\";\t}\n\t\t\t\n\t\t\t$billingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['businessCustomer']['invoiceAddress']['companyName'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['businessCustomer']['invoiceAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['businessCustomer']['invoiceAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['businessCustomer']['invoiceAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['businessCustomer']['invoiceAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\t$shippingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['businessCustomer']['deliveryAddress']['companyName'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['businessCustomer']['deliveryAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['businessCustomer']['deliveryAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['businessCustomer']['deliveryAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['businessCustomer']['deliveryAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\n\t\t\t// Add billing address to quote\n\t\t\t$billingAddressData = $quote->getBillingAddress()->addData($billingAddress);\n\t\t \n\t\t\t// Add shipping address to quote\n\t\t\t$shippingAddressData = $quote->getShippingAddress()->addData($shippingAddress);\n\t\t\t\n\t\t\t//check for selected shipping method\n\t\t\t$shippingMethod = $session->getSelectedShippingmethod();\n\t\t\tif(empty($shippingMethod)){\n\t\t\t\t$allShippingData = Mage::getModel('collectorbank/config')->getActiveShppingMethods();\n\t\t\t\t$orderItems = $orderDetails['order']['items'];\n\t\t\t\tforeach($orderItems as $oitem){\n\t\t\t\t\t//echo \"<pre>\";print_r($oitem);\n\t\t\t\t\tif(in_array($oitem['id'], $allShippingData)) {\n\t\t\t\t\t\t$shippingMethod = $oitem['id'];\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collect shipping rates on quote shipping address data\n\t\t\t$shippingAddressData->setCollectShippingRates(true)->collectShippingRates();\n\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setShippingMethod($shippingMethod);\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$paymentMethod = 'collectorbank_invoice';\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setPaymentMethod($paymentMethod);\t\t\t\n\t\t\t\n\t\t\t$colpayment_method = $orderDetails['purchase']['paymentMethod'];\n\t\t\t$colpayment_details = json_encode($orderDetails['purchase']);\n\t\t\t\n\t\t\t\n\t\t\t// Set payment method for the quote\n\t\t\t$quote->getPayment()->importData(array('method' => $paymentMethod,'coll_payment_method' => $colpayment_method,'coll_payment_details' => $colpayment_details));\n\t\t\t\n\t\t\t//die;\n\t\t\ttry{\n\t\t\t\t$orderReservedId = $session->getReference();\n\t\t\t\t$quote->setResponse($orderDetails);\n\t\t\t\t$quote->setCollCustomerType($orderDetails['customerType']);\n\t\t\t\t$quote->setCollBusinessCustomer($orderDetails['businessCustomer']);\n\t\t\t\t$quote->setCollStatus($orderDetails['status']);\n\t\t\t\t$quote->setCollPurchaseIdentifier($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t$quote->setCollTotalAmount($orderDetails['order']['totalAmount']);\n\t\t\t\tif($orderDetails['reference'] == $orderReservedId){\n\t\t\t\t\t$quote->setReservedOrderId($orderReservedId);\n\t\t\t\t} else {\n\t\t\t\t\t$quote->setReservedOrderId($orderDetails['reference']);\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t \t// Collect totals of the quote\n\t\t\t\t$quote->collectTotals();\n\t\t\t\t$quote->save();\n\t\t\t\t\n\t\t\t\t$service = Mage::getModel('sales/service_quote', $quote);\n\t\t\t\t$service->submitAll();\n\t\t\t\t$incrementId = $service->getOrder()->getRealOrderId();\n\t\t\t\t\n\t\t\t\tif($session->getIsSubscribed() == 1){\n\t\t\t\t\tMage::getModel('newsletter/subscriber')->subscribe($email);\n\t\t\t\t} \t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->setLastQuoteId($quote->getId())\n\t\t\t\t\t->setLastSuccessQuoteId($quote->getId())\n\t\t\t\t\t->clearHelperData();\n\t\t\t\t\t\n\t\t\t\tMage::getSingleton('checkout/session')->clear();\n\t\t\t\tMage::getSingleton('checkout/cart')->truncate()->save();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->unsBusinessPrivateId();\n\t\t\t\t$session->unsReference();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t // Log order created message\n\t\t\t\tMage::log('Order created with increment id: '.$incrementId, null, $logFileName);\t\t\t\t\t\t\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$result['error'] = false;\n\t\t\t\t\n\t\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);\n\t\t\t\t\n\t\t\t\t$this->loadLayout();\n\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\tif ($block){//check if block actually exists\t\t\t\t\t\n\t\t\t\t\t\tif ($order->getId()) {\n\t\t\t\t\t\t\t$orderId = $order->getId();\n\t\t\t\t\t\t\t$isVisible = !in_array($order->getState(),Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());\n\t\t\t\t\t\t\t$block->setOrderId($incrementId);\n\t\t\t\t\t\t\t$block->setIsOrderVisible($isVisible);\n\t\t\t\t\t\t\t$block->setViewOrderId($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setViewOrderUrl($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setPrintUrl($block->getUrl('sales/order/print', array('order_id'=> $orderId)));\n\t\t\t\t\t\t\t$block->setCanPrintOrder($isVisible);\n\t\t\t\t\t\t\t$block->setCanViewOrder(Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->renderLayout();\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (Mage_Core_Exception $e) {\n\t\t\t\t\t$result['success'] = false;\n\t\t\t\t\t$result['error'] = true;\n\t\t\t\t\t$result['error_messages'] = $e->getMessage(); \n\t\t\t\t\tMage::log('Order creation is failed for invoice no '.$orderDetails['purchase']['purchaseIdentifier'] .\"Error is --> \".Mage::helper('core')->jsonEncode($result), null, $logFileName);\t\t\n\t\t\t\t\t$this->loadLayout();\n\t\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\t\tif ($block){\n\t\t\t\t\t\tif($orderDetails['purchase']['purchaseIdentifier']){\n\t\t\t\t\t\t\t$block->setInvoiceNo($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$block->setCode(222);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->renderLayout();\t\t\t\t\t\n\t\t\t} \t\t\t\n\t\t} \n\t\t\n\t\t} else {\n\t\t\tMage::log('Order is already generated.', null, $logFileName);\t\t\n\t\t\t$this->loadLayout(); \n\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\tif ($block){\n\t\t\t\t$block->setCode(111);\n\t\t\t}\n\t\t\t$this->renderLayout();\n\t\t}\n\n\t\tMage::log('----------------- END ------------------------------- ', null, $logFileName);\t\t\n\t}", "function sopac_bib_record() {\n global $user;\n\n $locum = sopac_get_locum();\n $insurge = sopac_get_insurge();\n $actions = sopac_parse_uri();\n $bnum = $actions[1];\n $getvars = sopac_parse_get_vars();\n $output = $getvars['output'];\n\n // Load social function\n require_once('sopac_social.php');\n drupal_add_js('misc/collapse.js');\n drupal_add_js(drupal_get_path('theme', 'aadl').'/soundmanager2-nodebug-jsmin.js');\n drupal_add_js(drupal_get_path('theme', 'aadl').'/inlineplayer.js');\n $no_circ = $locum->csv_parser($locum->locum_config['location_limits']['no_request']);\n $show_inactive = user_access('show suppressed records');\n $item = $locum->get_bib_item($bnum, $show_inactive);\n $bnum_arr[] = $bnum;\n $reviews = $insurge->get_reviews(NULL, $bnum_arr, NULL);\n $i = 0;\n foreach ($reviews['reviews'] as $insurge_review) {\n $rev_arr[$i]['rev_id'] = $insurge_review['rev_id'];\n $rev_arr[$i]['bnum'] = $insurge_review['bnum'];\n if ($insurge_review['uid']) {\n $rev_arr[$i]['uid'] = $insurge_review['uid'];\n }\n $rev_arr[$i]['timestamp'] = $insurge_review['rev_create_date'];\n $rev_arr[$i]['rev_title'] = $insurge_review['rev_title'];\n $rev_arr[$i]['rev_body'] = $insurge_review['rev_body'];\n $i++;\n }\n if (!$insurge->check_reviewed($user->uid, $bnum_arr[0]) && $user->uid) {\n $rev_form = drupal_get_form('sopac_review_form', $bnum_arr[0]);\n }\n else {\n $rev_form = NULL;\n }\n if($machinetags = $insurge->get_machine_tags($bnum)){\n foreach($machinetags as $machinetag){\n $item['machinetags'][$machinetag['namespace']][] = $machinetag;\n }\n }\n if(($item['magnatune_url'] || $item['mat_code'] == 'z') && !$item['stream_filetype']){\n $result_page = theme('sopac_record_musicdownload', $item, $locum->locum_config, $rev_arr, $rev_form);\n }\n else if ($item['mat_code']) {\n $item['tracks'] = $locum->get_cd_tracks($bnum);\n $item['trackupc'] = $locum->get_upc($bnum);\n if($item['bnum']) {\n $item_status = $locum->get_item_status($bnum, TRUE);\n }\n // Grab Syndetics reviews, etc..\n $review_links = $locum->get_syndetics($item['stdnum'][0]);\n if (count($review_links)) {\n $item['review_links'] = $review_links;\n }\n $lists = $insurge->get_item_list_ids($item['bnum']);\n if(count($lists)){\n $sql = \"SELECT * FROM {sopac_lists} WHERE public = 1 and list_id IN (\".implode($lists,',').\") ORDER BY list_id DESC\";\n $res = db_query($sql);\n for ($i = 1; $i <= 10; $i++) {\n $record = db_fetch_array($res);\n $item['lists'][] = $record;\n }\n }\n // Build the page\n $result_page = theme('sopac_record', $item, $item_status, $locum->locum_config, $no_circ, &$locum, $rev_arr, $rev_form);\n }\n else {\n $result_page = t('This record does not exist.');\n }\n\n if ($output == \"rss\") {\n $item['status'] = $item_status;\n $item['type'] = 'bib';\n $cover_img_url = $item['cover_img'];\n return theme('sopac_results_hitlist_rss', 1, $cover_img_url, $item, $locum->locum_config, $no_circ);\n } else {\n return '<p>'. t($result_page) .'</p>';\n }\n}", "public function getQuoteAddressId();", "public function collect(Mage_Sales_Model_Quote_Address $address) {\r\n parent::collect($address);\r\n $this->_setAmount(0);\r\n $this->_setBaseAmount(0);\r\n \r\n $items = $this->_getAddressItems($address);\r\n if (!count($items)) { \r\n /**\r\n * this makes only address type shipping to come through\r\n */\r\n return $this; \r\n }\r\n $quote = $address->getQuote();\r\n if(Mage::app()->getRequest()->getControllerName() == \"checkout_cart\"){\r\n $address->setDeliveryCost('');\r\n $address->setBaseDeliveryCost('');\r\n $quote->setShippingDeliveryCost('');\r\n $quote->setDeliveryCost('');\r\n $address->setGrandTotal($address->getGrandTotal() + 0);\r\n $address->setBaseGrandTotal($address->getBaseGrandTotal() + 0);\r\n Mage::getSingleton ( 'core/session' )->setShippingDeliveryCost('');\r\n }\r\n else {\r\n $deliveryCost=$quote->getShippingDeliveryCost();\r\n $address->setDeliveryCost($deliveryCost);\r\n $address->setBaseDeliveryCost($deliveryCost);\r\n $quote->setDeliveryCost($deliveryCost);\r\n $address->setGrandTotal($address->getGrandTotal() + $address->getDeliveryCost());\r\n $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseDeliveryCost());\r\n Mage::getSingleton ( 'core/session' )->setShippingDeliveryCost($deliveryCost);\r\n }\r\n }", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "function ywig_company_address_3_callback() {\n\techo '<p class=\"description\">Company Address Line 3</p><input type=\"text\" name=\"company_address_3\" value=\"' . esc_html( get_option( 'company_address_3' ) ) . '\" placeholder=\"Company Address 3\" />';\n}", "function addAddressBookEntry($customer_id, $address_question_arr, $make_default = false) {\n // first get the zone id's from the 2 digit iso codes\n // country first\n $country_query = tep_db_query('SELECT countries_id, address_format_id\n FROM ' . TABLE_COUNTRIES . '\n WHERE countries_name = \\'' . $address_question_arr['country'] . '\\'\n LIMIT 1');\n\n // see if we found a record, if not default to American format\n if (tep_db_num_rows($country_query) > 0) {\n $country = tep_db_fetch_array($country_query);\n // grab the country id and address format\n $country_id = $country['countries_id'];\n $address_format_id = $country['address_format_id'];\n } else {\n // default\n $country_id = '223';\n $address_format_id = '2'; //2 is the American format\n }\n\n // see if the country code has a state\n $country_zone_check_query = tep_db_query('SELECT zone_country_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\'\n LIMIT 1');\n if (tep_db_num_rows($country_zone_check_query) > 0) {\n $check_zone = true;\n } else {\n $check_zone = false;\n }\n\n // now try and find the zone_id (state/province code)\n // use the country id above\n if ($check_zone) {\n $zone_query = tep_db_query('SELECT zone_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\' AND\n zone_code = \\'' . $address_question_arr['state'] . '\\'\n LIMIT 1');\n if (tep_db_num_rows($zone_query) > 0) {\n // grab the id\n $zone = tep_db_fetch_array($zone_query);\n $zone_id = $zone['zone_id'];\n } else {\n $check_zone = false;\n }\n }\n\n // now run the insert\n // this isnt the best way but it will get the majority of cases\n list($fname, $lname) = explode(' ', $address_question_arr['name']);\n if ($check_zone) {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id,\n entry_zone_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\', \\'' . $zone_id . '\\')');\n } else {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\')');\n }\n $address_book_id = tep_db_insert_id();\n\n // make default if set, update\n if ($make_default) {\n tep_db_query('UPDATE '. TABLE_CUSTOMERS . '\n SET customers_default_address_id = \\'' . $address_book_id . '\\'\n WHERE customers_id = \\'' . $customer_id . '\\'');\n $_SESSION['customer_default_address_id'] = $address_book_id;\n }\n\n // set the sendto\n $_SESSION['sendto'] = $address_book_id;\n\n // return the address_id\n return $address_book_id;\n }", "function ywig_company_address_1_callback() {\n\techo '<p class=\"description\">Company Address Line 1</p><input type=\"text\" name=\"company_address_1\" value=\"' . esc_html( get_option( 'company_address_1' ) ) . '\" placeholder=\"Company Address 1\" />';\n}", "public function show_my_account() {\n\t\tif ( version_compare( WC()->version, '2.6', '<' ) ) {\n\t\t\t$this->render_my_vat_number_content();\n\t\t}\n\t}", "function oos_address_format($address_format_id, $address, $html, $boln, $eoln) {\n\n // Get database information\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $address_formattable = $oostable['address_format'];\n $address_format_result = $dbconn->Execute(\"SELECT address_format AS format FROM $address_formattable WHERE address_format_id = '\" . intval($address_format_id) . \"'\");\n $address_format = $address_format_result->fields;\n\n $company = addslashes($address['company']);\n $firstname = addslashes($address['firstname']);\n $lastname = addslashes($address['lastname']);\n $street = addslashes($address['street_address']);\n $suburb = addslashes($address['suburb']);\n $city = addslashes($address['city']);\n $state = addslashes($address['state']);\n $country_id = $address['country_id'];\n $zone_id = $address['zone_id'];\n $postcode = addslashes($address['postcode']);\n $zip = $postcode;\n $country = oos_get_country_name($country_id);\n $state = oos_get_zone_code($country_id, $zone_id, $state);\n\n if ($html) {\n// HTML Mode\n $HR = '<hr>';\n $hr = '<hr>';\n if ( ($boln == '') && ($eoln == \"\\n\") ) { // Values not specified, use rational defaults\n $CR = '<br />';\n $cr = '<br />';\n $eoln = $cr;\n } else { // Use values supplied\n $CR = $eoln . $boln;\n $cr = $CR;\n }\n } else {\n// Text Mode\n $CR = $eoln;\n $cr = $CR;\n $HR = '----------------------------------------';\n $hr = '----------------------------------------';\n }\n\n $statecomma = '';\n $streets = $street;\n if ($suburb != '') $streets = $street . $cr . $suburb;\n if ($firstname == '') $firstname = addslashes($address['name']);\n if ($country == '') $country = addslashes($address['country']);\n if ($state != '') $statecomma = $state . ', ';\n\n $fmt = $address_format['format'];\n eval(\"\\$address = \\\"$fmt\\\";\");\n $address = stripslashes($address);\n\n if ( (ACCOUNT_COMPANY == '1') && (!empty($company)) ) {\n $address = $company . $cr . $address;\n }\n\n return $boln . $address . $eoln;\n }", "function getFieldStreetAddressUnitNumber($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_sunitNo');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_sunitNo');\n\t\t$tooltip = setToolTipNotification(\"sunitNo\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('sunitno') === 'sunitno' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='sunitNo' id='sunitNo' value='\".$value.\"' class='srms-field \".(get_axl_req_fields('sunitno') === 'sunitno' ? 'input-text-required' : '').\"'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "protected function insertAddress(&$page, $store = null)\r\n {\r\n $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));\r\n $font = $this->_setFontRegular($page, 10);\r\n $page->setLineWidth(0);\r\n $this->y = $this->y ? $this->y : 815;\r\n $top = 815;\r\n\r\n $collection = Mage::getModel('marketplace/userprofile')->getCollection()\r\n ->addFieldToFilter('mageuserid',array('eq'=>Mage::getSingleton('customer/session')->getCustomerId()));\r\n foreach ($collection as $row) {\r\n $address=$row->getOthersInfo();\r\n }\r\n\r\n foreach (explode(\"\\n\", $address) as $value){\r\n if ($value !== '') {\r\n $value = preg_replace('/<br[^>]*>/i', \"\\n\", $value);\r\n foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {\r\n $page->drawText(trim(strip_tags($_value)),\r\n $this->getAlignRight($_value, 130, 440, $font, 10),\r\n $top,\r\n 'UTF-8');\r\n $top -= 10;\r\n }\r\n }\r\n }\r\n $this->y = ($this->y > $top) ? $top : $this->y;\r\n }", "public function display_billing()\n\t{\n\t\t$this->call_member('display_billing_'.g::$pages[$this->page_index + 2], 'display_billing_hist');\n\t}", "public function getCardsn()\n {\n return $this->cardsn;\n }", "function address($wallet_id = null) {\n\t\tif(empty($wallet_id)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/address';\n\t\t\t$json = file_get_contents($url);\n\t\t\t$data = json_decode($json);\n\t\t\tif(!$data->successful) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $data->address;\n\t\t\t}\n\t\t}\n\t}", "function spectra_search_address ($search_text)\n\t{\n\t\techo \"\t\t<h2> Address Search Results: </h2> \\n\\n\";\n\n\t\t$address = mysqli_getset ($GLOBALS[\"tables\"][\"ledger\"], \"`address` LIKE '%\".$search_text.\"%'\");\n\n\t\tif (!isset ($address[\"data\"]) || $address[\"data\"] == \"\")\n\t\t{\n\t\t\techo \"\t\t<p class=\\\"search_dark\\\"> No Matching Address Records </p> \\n\\n\";\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\techo \"\t\t<p class=\\\"search_dark\\\"> Addresses Containing \\\"\".substr ($search_text, 0, 32).\"\\\": </p> \\n\\n\";\n\n\t\t\tforeach ($address[\"data\"] as $address)\n\t\t\t{\n\t\t\t\techo \"\t\t<p> \\n\";\n\t\t\t\techo \"\t\t<a href=\\\"address.php?address=\".$address[\"address\"].\"\\\" title=\\\"Address Detaiil Page\\\"> \\n\";\n\t\t\t\techo \"\t\t\t\".$address[\"address\"].\"\\n\";\n\t\t\t\techo \"\t\t</a> \\n\";\n\t\t\t\techo \"\t\t</p> \\n\\n\";\n\t\t\t}\n\t\t}\n\t}", "public function require_refund_address() {\n\t\treturn $this->show_refund_address() && $this->get_option( 'refund_address_optional', 'yes' ) == 'no';\n\t}", "public function address(): string\n {\n return $this->address;\n }", "public function fullAddress() :string\n {\n $parts = [\n $this->address1,\n $this->address2,\n $this->city,\n $this->county,\n $this->postcode\n ];\n $address = array_filter($parts, [$this,'not_blank']);\n return implode(', ',$address);\n }", "private function BeginMultipleAddressCheckout()\n\t{\n\t\t$this->getQuote()->setIsSplitShipping(true);\n\t\t$this->Checkout();\n\t}", "function read_address_book()\n {\n return $this->read();\n }", "function formatAddressNoBr($street, $city, $state, $zip, $country)\n{\n\t$fullAddress;\n\n\tif($street != NULL) \t{ $fullAddress .= $street; }\n\tif($street != NULL and ($city != NULL or $state != NULL or $zip != NULL or $country != NULL) ) \n\t\t\t\t\t\t\t{ $fullAddress .= \"\\n\"; }\n\tif($city != NULL)\t\t{ $fullAddress .= $city; }\n\tif($city != NULL and $state != NULL) \n\t\t\t\t\t\t\t{ $fullAddress .= ', '; }\n\tif($state != NULL)\t\t{ $fullAddress .= $state; }\n\tif($state != NULL and $zip != NULL) \n\t\t\t\t\t\t\t{ $fullAddress .= ' '; }\n\tif($zip != NULL)\t\t{ $fullAddress .= $zip; }\n\tif($zip != NULL and $country != NULL)\n\t\t\t\t\t\t\t{ $fullAddress .= ' '; }\n\tif($country != NULL)\t{ $fullAddress .= $country; }\n\n\treturn($fullAddress);\n}", "public function setCustomerAddress($customerAddress = '') {\n $address = array(\n 'x_address'=>$this->truncateChars($customerAddress, 60),\n );\n $this->NVP = array_merge($this->NVP, $address); \n }" ]
[ "0.58334327", "0.5507453", "0.54782784", "0.546587", "0.5437603", "0.54345214", "0.5415296", "0.5410433", "0.5396631", "0.538454", "0.5376773", "0.53322387", "0.5311239", "0.5308325", "0.53004664", "0.5298783", "0.5292027", "0.52858293", "0.5263722", "0.5256892", "0.52295154", "0.5211356", "0.5200383", "0.5200383", "0.5200383", "0.51966953", "0.5178407", "0.5160598", "0.514822", "0.5145691", "0.5142647", "0.51284736", "0.5113298", "0.5111245", "0.51086", "0.51006186", "0.5091851", "0.50807637", "0.5071984", "0.5071936", "0.506413", "0.5054684", "0.50440794", "0.5043327", "0.5042536", "0.5039602", "0.5025162", "0.50199014", "0.50173134", "0.50058275", "0.49995053", "0.49959654", "0.49908903", "0.49639773", "0.49623072", "0.4951962", "0.49507555", "0.49507555", "0.49501857", "0.4948875", "0.4943134", "0.4940402", "0.49350643", "0.49243924", "0.49197114", "0.49034655", "0.4897219", "0.48778605", "0.48675802", "0.4867101", "0.48646763", "0.48635244", "0.48609665", "0.48550802", "0.48515344", "0.48461148", "0.4841519", "0.48292378", "0.48279637", "0.48212034", "0.48123196", "0.4809264", "0.48084053", "0.48076212", "0.4806751", "0.4804659", "0.48036286", "0.48031673", "0.48019895", "0.47974926", "0.47931972", "0.47930884", "0.4781619", "0.47784254", "0.47762564", "0.47735062", "0.47733808", "0.47689825", "0.47652495", "0.4760358" ]
0.6168468
0
Make fairaddress number required Add more required fields here if you need to
function getfaircoin_edd_required_checkout_fields( $required_fields ) { $required_fields['edd_fairaddress'] = array( 'error_id' => 'invalid_fairaddress', 'error_message' => __('Please enter a valid Faircoin Address', 'edd-getfaircoin') ); return $required_fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n return [\n 'address_id' => \"required|numeric\",\n ];\n }", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "public function rules()\n {\n return [\n 'billing_address' => ['required']\n ];\n }", "function wc_elshaddai_bfield( $fields ) {\n $fields['billing_number']['maxlength'] = 5;\n $fields['billing_address_2']['maxlength'] = 30;\n $fields['billing_address_2']['label_class'] = array('');\n $fields['billing_neighborhood']['required'] = true;\n return $fields;}", "public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }", "public function rules()\n {\n return [\n 'address' => 'required',\n ];\n }", "public static function getMandatoryField() {\n\t\t$mandatory['AU'] = array('bsb' => 'required','account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'routing_number' => 'required');\n\t\t$mandatory['CA'] = array('transit_number' => 'required','account_number' => 'required','institution_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'routing_number' => 'required');\n\t\t$mandatory['GB'] = array('sort_code' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['HK'] = array('clearing_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['JP'] = array('bank_code' => 'required','bank_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'bank_name' => 'required', 'branch_name' => 'required', 'account_owner_name' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['NZ'] = array('routing_number' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['SG'] = array('bank_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['US'] = array('routing_number' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'ssn_last_4' => 'required');\n\t\t$mandatory['AT'] = array('iban' => 'required','account_number'=>'required','account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['BE'] = array('iban' => 'required','account_holder_name' => 'required','currency' => 'required','account_number'=>'required');\n\t\t$mandatory['CH'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['DE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['DK'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['ES'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['FI'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['FR'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['IE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['IT'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['LU'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['NL'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['NO'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['PT'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['SE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['OT'] = array('account_number' => 'required', 'bank_name' => 'required', 'account_holder_name' => 'required','branch_name' => 'required');\n\n\t\treturn $mandatory;\n\t}", "function validateAddress($field)\n\t{\n //Make sure field is not blank; unable to validate anything beyond that.\n if ($field == \"\") return \"Please specify your address.\\\\n\";\n\t\treturn \"\";\n\t}", "public function __construct($address = null, $address2 = null, $birthDate = null, $city = null, $comments = null, $company = null, $completeName = null, $contactType = null, $country = null, array $customFields = array(), $dirty = null, $driversLicenseNumber = null, $email = null, $fax = null, $firstName = null, $gender = null, $homePhone = null, $jobTitle = null, $lastName = null, $middleName = null, $mobilePhone = null, $nameOnCheck = null, $namedOnLease = null, $pager = null, $salutation = null, $searchTag = null, $ssn = null, $state = null, $suffix = null, $webAddress = null, $workPhone = null, $zip = null)\n {\n $this\n ->setAddress($address)\n ->setAddress2($address2)\n ->setBirthDate($birthDate)\n ->setCity($city)\n ->setComments($comments)\n ->setCompany($company)\n ->setCompleteName($completeName)\n ->setContactType($contactType)\n ->setCountry($country)\n ->setCustomFields($customFields)\n ->setDirty($dirty)\n ->setDriversLicenseNumber($driversLicenseNumber)\n ->setEmail($email)\n ->setFax($fax)\n ->setFirstName($firstName)\n ->setGender($gender)\n ->setHomePhone($homePhone)\n ->setJobTitle($jobTitle)\n ->setLastName($lastName)\n ->setMiddleName($middleName)\n ->setMobilePhone($mobilePhone)\n ->setNameOnCheck($nameOnCheck)\n ->setNamedOnLease($namedOnLease)\n ->setPager($pager)\n ->setSalutation($salutation)\n ->setSearchTag($searchTag)\n ->setSsn($ssn)\n ->setState($state)\n ->setSuffix($suffix)\n ->setWebAddress($webAddress)\n ->setWorkPhone($workPhone)\n ->setZip($zip);\n }", "public function rules()\n {\n return [\n 'addresseeId' => 'required'\n ];\n }", "function storms_wcbcf_billing_fields( $fields ) {\n\n\t\t$fields['billing_neighborhood']['required'] = true;\n\n\t\treturn $fields;\n\t}", "function sv_unrequire_wc_phone_field( $fields ) {\n $fields['billing_email']['required'] = false;\n return $fields;\n}", "function edd_stripe_setup_billing_address_fields() {\n\n\tif( ! function_exists( 'edd_use_taxes' ) ) {\n\t\treturn;\n\t}\n\n\tif( edd_use_taxes() || 'stripe' !== edd_get_chosen_gateway() || ! edd_get_cart_total() > 0 ) {\n\t\treturn;\n\t}\n\n\t$display = edd_get_option( 'stripe_billing_fields', 'full' );\n\n\tswitch( $display ) {\n\n\t\tcase 'full' :\n\n\t\t\t// Make address fields required\n\t\t\tadd_filter( 'edd_require_billing_address', '__return_true' );\n\n\t\t\tbreak;\n\n\t\tcase 'zip_country' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\t\t\tadd_action( 'edd_after_cc_fields', 'edd_stripe_zip_and_country', 9 );\n\n\t\t\t// Make Zip required\n\t\t\tadd_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' );\n\n\t\t\tbreak;\n\n\t\tcase 'none' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\n\t\t\tbreak;\n\n\t}\n\n}", "function give_require_billing_address( $payment_mode ) {\n\n\t$return = false;\n\t$billing_country = ! empty( $_POST['billing_country'] ) ? give_clean( $_POST['billing_country'] ) : 0; // WPCS: input var ok, sanitization ok, CSRF ok.\n\n\tif ( $billing_country || did_action( \"give_{$payment_mode}_cc_form\" ) || did_action( 'give_cc_form' ) ) {\n\t\t$return = true;\n\t}\n\n\t// Let payment gateways and other extensions determine if address fields should be required.\n\treturn apply_filters( 'give_require_billing_address', $return );\n\n}", "private function validatePaymentFields(){\n }", "public function rules()\n {\n return [\n 'bank_name' => 'required',\n 'account_number' => 'required|integer|min:0|'\n ];\n }", "private function isTelephoneRequired()\n {\n return $this->eavConfig->getAttribute('customer_address', 'telephone')->getIsRequired();\n }", "public function store(Request $request)\n {\n if($request->input('differentAddress')=='yes'){\n\n $this->validate($request, [\n 'billingFirstName' => 'required',\n 'billingLastName' => 'required',\n 'billingTel' => 'required|numeric',\n 'billingLine1' => 'required',\n 'billingTown' => 'required',\n 'billingCounty' => 'required',\n 'billingPostcode' => 'required',\n 'billingCountry' => 'required',\n 'paymentMethod' => 'required',\n 'termsCondition' => 'required',\n 'poNumber' => 'required_if:paymentMethod,invoiceRequest',\n ]);\n }else {\n $this->validate($request, [\n\n 'paymentMethod' => 'required',\n 'termsCondition' => 'required',\n 'poNumber' => 'required_if:paymentMethod,invoiceRequest',\n ]);\n }\n\n // 'signUpForNews' => 'required',\n // 'contacts' => 'required_if:signUpForNews,Yes',\n\n\n $userData=$request->session()->get('userData');\n $newUser=$userData['userInfo'];\n $newUserDetails=$userData['userAdditionalDetail'];\n $userAddress=$userData['address'];\n $whoIsItFor=$userData['whoIsItFor'];\n // dd($newUserDetails);\n $role = Role::where('name', 'Learner')->first();\n $newUser->save();\n if(!$newUser->roles->contains('role_id',$role->id)){\n $newUser->roles()->attach($role);\n }\n\n if(!$newUser->addresses->contains('type','home')){\n $newUser->addresses()->save($userAddress);\n }\n\n if ($whoIsItFor=='self') {\n if ($newUser->detail === null)\n {\n $newUser->detail()->save($newUserDetails);\n // $newUserDetails->user_id=$newUser->id;\n // $newUserDetails->save();\n }\n }\n\n $order= new Order();\n $order->billingFirstName=$request->input('billingFirstName');\n $order->billingLastName=$request->input('billingLastName');\n $order->billingTel=$request->input('billingTel');\n $order->billingLine1=$request->input('billingLine1');\n $order->billingLine2=$request->input('billingLine2');\n $order->billingTown=$request->input('billingTown');\n $order->billingCounty=$request->input('billingCounty');\n $order->billingPostcode=$request->input('billingPostcode');\n $order->billingCountry=$request->input('billingCountry');\n // $order->signUpForNews=$request->input('signUpForNews');\n // $order->contacts=$request->input('contacts');\n\n\n $order->paymentMethod=$request->input('paymentMethod');\n $order->termsCondition=$request->input('termsCondition');\n $order->poNumber=$request->input('poNumber');\n $cart=Cart::getCartIntance();\n $order->total=$cart->total();\n $order->subTotal=$cart->subtotal();\n $order->totalVat=$cart->getVAT();\n $order->vat=$cart->tax();\n\n\n $savedOrder=$newUser->orders()->save($order);\n\n foreach ($cart->getCart() as $cartItem) {\n # code...\n $orderDetails= new OrderDetail();\n $orderDetails->order_id=$savedOrder->id;\n $orderDetails->class_id=$cartItem->class_id;\n $orderDetails->quantity=$cartItem->quantity;\n }\n\n $userGDPR= new UserGdpr();\n $userGDPR->agreed=$request->input('signUpForNews');\n if($request->input('signUpForNews')=='Yes'){\n $userGDPR->byEmail='yes';\n $userGDPR->byPhone='yes';\n }else {\n $userGDPR->byEmail='no';\n $userGDPR->byPhone='no';\n }\n\n $newUser->gdpr()->save($userGDPR);\n\n if (Auth::loginUsingId($newUser->id)) {\n\n // dd($newUser);\n return redirect()->route('thankYou');\n }\n\n }", "private function ignoreAddressValidation()\n {\n $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_quote->getIsVirtual()) {\n $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_config->getValue('requireBillingAddress')\n && !$this->_quote->getBillingAddress()->getEmail()\n ) {\n $this->_quote->getBillingAddress()->setSameAsBilling(1);\n }\n }\n }", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "public function validate_refund_address_field() {\n\n\t\tWC()->session->set( 'decred_refund_address', null );\n\n\t\t$address = $this->get_post( 'decred-refund-address' );\n\n\t\t// this should never happen as the refund address field should be missing.\n\t\tif ( ! empty( $address ) && ! $this->show_refund_address() ) {\n\t\t\twc_add_notice( __( 'Decred plugin error: unexpected refund address.', 'decred' ), 'error' );\n\t\t\treturn false;\n\t\t}\n\n\t\t// empty address OK if optional, otherwise validate it.\n\t\tif ( empty( $address ) && ! $this->require_refund_address() ) {\n\t\t\t$address_is_valid = true;\n\t\t} else {\n\t\t\t$address_is_valid = $this->validate_address( $address );\n\t\t}\n\n\t\tif ( $address_is_valid ) {\n\t\t\tif ( ! empty( $address ) ) {\n\t\t\t\t// save address now to retrieve it later when order created.\n\t\t\t\tWC()->session->set( 'decred_refund_address', $address );\n\t\t\t}\n\t\t} else {\n\t\t\t// translators: parameter is address entered by user, not to be translated.\n\t\t\t$message = __( 'Please enter a valid Decred address for refunds. Wrong address \"%s\"', 'decred' );\n\t\t\twc_add_notice( sprintf( $message, $address ), 'error' );\n\t\t}\n\t}", "public function require_refund_address() {\n\t\treturn $this->show_refund_address() && $this->get_option( 'refund_address_optional', 'yes' ) == 'no';\n\t}", "public function verifyAndSetAddress($a,$bRequired) {\n\t\tif ($a['country'] != 'USA')\n\t\t\tthrow new exception(\"internation addresses not supported yet\");\n\t\t$this->country='USA';\t\t\n\t\t$this->line1 = isset($a['line1']) ? $a['line1'] : ''; \t\n\t\t$this->line2 = isset($a['line2']) ? $a['line2'] : ''; \t\n\t\t$this->city = isset($a['city']) ? $a['city'] : ''; \t\n\t\t$this->state = isset($a['state2']) ? $a['state2'] : ''; \t\n\t\t$this->zip = isset($a['zip']) ? $a['zip'] : ''; \t\n\t\t\t\n\t\tif ($this->line1 == '' && $this->line2 == '') {\n\t\t\tif ($bRequired || $this->city != '' || $this->zip != '')\n\t\t\t\treturn (array('*line1'=>'You must provide an address'));\n\t\t\telse {\n\t\t\t\t$this->city=$this->state=$this->zip='';\n\t\t\t\treturn True;\t\t// OK -- just no address\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$retval=array();\n\t\tif ($this->city == '')\n\t\t\t$retval['*city']='You must provide a city';\n\t\tif ($this->zip == '')\n\t\t\t$retval['*zip']='You must provide a ZIP code';\n\t\telse {\n\t\t\t$nmatches=preg_match('/^[\\\\d]{5}(-[\\\\d]{4})??$/',$this->zip);\n\t\t\tif (0 == $nmatches)\n\t\t\t\t$retval['*zip']=\"Invalid ZIP code\";\n\t\t}\t\n\t\treturn (sizeof($retval) != 0) ? $retval : True;\n\t}", "public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}", "function checkAddress(){\n $country = $_POST[\"country\"];\n $city = $_POST[\"city\"];\n $street = $_POST[\"street\"];\n $number = $_POST[\"number\"];\n if(empty($country) || empty($city) || empty($street) || empty($number)){\n return false; \n }\n return true; \n }", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "protected function setRequiredFields()\n {\n $requiredFields = [\n 'transaction_id',\n 'remote_ip',\n 'return_success_url',\n 'return_failure_url',\n 'amount',\n 'currency',\n 'bank_code'\n ];\n\n $this->requiredFields = \\Genesis\\Utils\\Common::createArrayObject($requiredFields);\n\n $requiredFieldValues = [\n 'currency' => [\n 'CNY', 'THB', 'IDR', 'MYR', 'INR'\n ]\n ];\n\n $this->requiredFieldValues = \\Genesis\\Utils\\Common::createArrayObject($requiredFieldValues);\n\n $this->setRequiredFieldsConditional();\n }", "function free_address_fields( $address_fields ) {\n // Only on checkout page\n if( ! is_checkout() ) return $address_fields;\n $cart = WC()->cart->get_cart();\n\n // iterate through each item of the cart \n foreach ( $cart as $item_key => $values ) {\n $product = $values['data'];\n $price = $product->get_price();\n\n // if any cart items are greater than 0 end loop the rest of the function is dunzo\n if ($price > 0){\n $see_ya = 1;\n break;\n } \n }\n\n if($see_ya) return $address_fields;\n \n // All field keys in this array\n $key_fields = array('country','company','address_1','address_2','city','state','postcode');\n\n // Loop through each address fields (billing and shipping)\n foreach( $key_fields as $key_field )\n $address_fields[$key_field]['required'] = false;\n\n return $address_fields;\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('amount, subSipOwner', 'required'),\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'name' => 'required|max:150|string',\n 'phone' => 'required|min:10|string|unique:customers',\n 'tc_no' => 'required|min:11|string|unique:customers', \n 'address' => 'required|string|max:150',\n 'billing' => 'required|string|max:150',\n 'customer_level' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'nom' => 'required|string|min:2|unique:streets',\n 'lat' => 'required|numeric',\n 'long' => 'required|numeric',\n 'country_id' => 'required|int',\n 'region_id' => 'required|int',\n 'prefecture_id' => 'required|int',\n 'town_id' => 'required|int',\n 'district_id' => 'required|int',\n 'quartier_id' => 'required|int',\n ];\n }", "public function rules()\n {\n return [\n 'number' => 'required|max:10|min:4',\n 'name' => 'required|max:20|min:2',\n 'type' => 'required',\n 'balance_date' => 'required',\n 'initial_payable' => 'required',\n 'initial_advance_payment' => 'required',\n 'rate' => 'required',\n 'contacts' => 'required',\n 'phone' => 'required|max:11|min:11',\n 'landline' => 'required|max:11|min:11',\n 'qq' => 'required|max:10|min:10',\n 'address' => 'required|max:225'\n ];\n }", "function set_required() \n {\n $this->error_state = FORMEX_FIELD_REQUIRED;\n }", "public function setIgnoreValidation() {\r\n\t\t$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\r\n\t\t$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\r\n\t}", "public function rules()\n {\n return [\n 'delivery_area' => 'required|string',\n 'complete_address' => 'required|string',\n 'contact_no' => 'required|numeric|digits:10',\n 'delivery_instructions' => 'string',\n 'latitude' => 'required|numeric',\n 'longitude' => 'required|numeric',\n 'nickname' => 'required|string'\n ];\n }", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "function checkClientMandatoryDetailsAction()\n\t{\n\t\t$parameters=$this->_request->getParams();\n\t\t$client_id=$parameters['client_id'];\n\t\tif($client_id)\n\t\t{\n\t\t\t$contact_obj=new Ep_Quote_ClientContacts();\n\t\t\t$contactDetails=$contact_obj->getClientMainContacts($client_id);\n\t\t\tif($contactDetails=='NO')\n\t\t\t{\n\t\t\t\t$exists='NotExists';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t$clientDetails=$client_obj->getClientDetails($client_id);\n\t\t\t\tif($clientDetails!='NO')\n\t\t\t\t{\n\t\t\t\t\t$client_info=$clientDetails[0];\t\n\t\t\t\t\t\n\t\t\t\t\t$company_name=$client_info['company_name'];\n\t\t\t\t\t$address=$client_info['address'];\n\t\t\t\t\t$zipcode=$client_info['zipcode'];\n\t\t\t\t\t$city=$client_info['city'];\n\t\t\t\t\t$country=$client_info['country'];\t\t\t\t\t\n\t\t\t\t\t$siret_applicable=$client_info['siret_applicable'];\n\t\t\t\t\t$siret=($siret_applicable=='yes'?$client_info['siret'] : 'no');\n\t\t\t\t\t\n\t\t\t\t\t//echo \"$company_name -- $address -- $zipcode -- $city -- $country -- $siret \";\n\t\t\t\t\tif($company_name && $address && $zipcode && $city && $country!='' && $siret)\n\t\t\t\t\t{\n\t\t\t\t\t\t$exists='Exists';\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$exists='NotExists';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$exists='NotExists';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\techo json_encode(array('status'=>$exists));\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// skuid and idclient are required\n\t\t\tarray('skucode', 'required'),\n\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'address' => 'required|string',\n 'country_id' => 'required',\n 'city_id' => 'required',\n 'post_code' => 'required',\n 'floor' => 'required',\n 'phone' => 'required'\n ];\n }", "public function rules()\n {\n return [\n \n 'name' => 'required|unique:headquarter',\n 'id_city_address' => 'required',\n 'zone_id' => 'required'\n ];\n }", "function edd_stripe_require_zip_and_country( $fields ) {\n\n\t$fields['card_zip'] = array(\n\t\t'error_id' => 'invalid_zip_code',\n\t\t'error_message' => __( 'Please enter your zip / postal code', 'edds' )\n\t);\n\n\t$fields['billing_country'] = array(\n\t\t'error_id' => 'invalid_country',\n\t\t'error_message' => __( 'Please select your billing country', 'edds' )\n\t);\n\n\treturn $fields;\n}", "public function validAddresses() {}", "public function rules()\n {\n return [\n 'park_name' => 'required|string',\n 'account_type'=>'required|numeric',\n 'bank_name' => 'required|string',\n 'bank_code' => 'required|string',\n 'province_id' => 'required|numeric',\n 'city_id' => 'required|numeric',\n 'sub_branch' => 'required|string',\n 'account' => 'required',\n 'account_name' => 'required|string',\n 'contract_num'=>'required|string'\n ];\n }", "public function rules()\n {\n return [\n 'provinsi' => 'required',\n 'kab-kota' => 'required',\n 'address' => 'required',\n 'phone_number' => 'required|numeric',\n 'wa_number' => 'nullable|numeric',\n 'pin_bbm' => 'nullable',\n ];\n }", "private function buildAddressFields()\n {\n /**\n * Check if WooCommerce is active\n */\n if (!Local::hasWooCommerce()) {\n return;\n }\n //====================================================================//\n // Customer Full Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company_safe\")\n ->name(\"Customer Fullname\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Company\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company\")\n ->name(__(\"Company\"))\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 1\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_1\")\n ->name(__(\"Address line 1\"))\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 2\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_2\")\n ->name(__(\"Address line 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postOfficeBoxNumber\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address Full\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_full\")\n ->name(__(\"Address line 1 & 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"alternateName\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Zip Code\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"postcode\")\n ->name(__(\"Postcode / ZIP\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postalCode\")\n ->isReadOnly()\n ;\n //====================================================================//\n // City Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"city\")\n ->name(__(\"City\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressLocality\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country\")\n ->name(__(\"Country\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isReadOnly()\n ;\n //====================================================================//\n // State code\n $this->fieldsFactory()->create(SPL_T_STATE)\n ->identifier(\"state\")\n ->name(__(\"State / County\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressRegion\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Phone Pro\n $this->fieldsFactory()->create(SPL_T_PHONE)\n ->identifier(\"phone\")\n ->name(__(\"Phone\"))\n ->microData(\"http://schema.org/Person\", \"telephone\")\n ->isIndexed()\n ->isReadOnly()\n ;\n }", "function validateBizAddFields($fields)\r\r\n\t\t\t{\r\r\n\t\t\t\t$f1 = $fields['businessName'];\r\r\n\t\t\t\t$f2 = $fields['businessCategory'];\r\r\n\t\t\t\t$f3 = $fields['address1'];\r\r\n\t\t\t\t$f4 = $fields['city'];\r\r\n\t\t\t\tif (($f1 == '') && ($f2 == '') && ($f3 == '') && ($f4 == '')) {\r\r\n\t\t\t\t\treturn array('businessName' => 'Business name, category, address and city are required fields');\r\r\n\t\t\t\t}\r\r\n\t\t\t\treturn true;\r\r\n\t\t\t}", "public function rules()\n {\n return [\n 'address_1' => 'required|max:155',\n 'address_2' => 'max:155',\n 'city_town' => 'required|max:55',\n 'state' => 'required|max:5',\n 'zip_code' => 'required|numeric|max:9999999999',\n ];\n }", "function getfaircoin_edd_validate_checkout_fields( $valid_data, $data ) {\r\n if( !isset($data['edd_fairsaving']) ) $data['edd_fairsaving'] = '0';\r\n if ( is_user_logged_in() ) {\r\n $user_id = get_current_user_id();\r\n update_user_meta( $user_id, '_edd_user_fairsaving', sanitize_text_field($data['edd_fairsaving']) );\r\n } else {\r\n\r\n }\r\n $fairsaving = sanitize_text_field($data['edd_fairsaving']);\r\n if( $fairsaving === '0') {\r\n if ( empty( $data['edd_fairaddress'] ) ) {\r\n edd_set_error( 'invalid_fairaddress', __('Please enter your Faircoin Address.', 'edd-getfaircoin') );\r\n } else if ( strlen( $data['edd_fairaddress'] ) != 34 ) {\r\n edd_set_error( 'invalid_fairaddress', __('Your Faircoin Address must have 34 digits', 'edd-getfaircoin') );\r\n } else {\r\n\r\n }\r\n } else if( $fairsaving == '1'){\r\n //\r\n } else {\r\n edd_set_error( 'invalid_fairaddress', 'FAIRSAVING = '+$fairsaving+' ?' );\r\n }\r\n}", "function getFieldStreetAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_sstreet');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_sstreet');\n\t\t$tooltip = setToolTipNotification(\"sstreet\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('sstreet') === 'sstreet' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='sstreetNo' id='sstreetNo' value='\".$value1.\"' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='sstreetName' id='sstreetName' value='\".$value2.\"' size='12' class='srms-field \".(get_axl_req_fields('sstreet') === 'sstreet' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function modifyAddress($formdata) {\r\n\r\n\t\t\t//Make sure this is a user before continuing\r\n\t\t\tif ($_SESSION['CID'] > 0) {\r\n\r\n\t\t\t\t//Instantiate our form validator, and validate the user input\r\n\t\t\t\t$valid = new Validate($formdata);\r\n\t\t\t\t$valid->name('first')->required(\"You must provide your first name.\");\r\n\t\t\t\t$valid->name('last')->required(\"You must provide your last name.\");\r\n\t\t\t\t$valid->name('phone')->required(\"You must provide your phone number.\")->phone(\"The number you have provided does not match a valid phone number format.\");\r\n\t\t\t\t$formdata['phone'] = $valid->getParsed(); //Get the phone number parsed in our format\r\n\t\t\t\t$valid->name('address1')->required(\"You must provide a street address.\");\r\n\t\t\t\t$valid->name('city')->required(\"You must provide a city.\")->minLength(2, \"The city you have provided is not valid.\");\r\n\t\t\t\t$valid->name('state')->requiredWhenCountryHasZones(\"You must provide a state.\");\r\n\t\t\t\t$valid->name('zip')->required(\"You must provide a zip code.\")->minLength(5, \"Valid zip codes contain 5 or more digits.\")->maxLength(10, \"The zip code you entered is invalid.\");\r\n\t\t\t\t$valid->name('country')->required(\"You must provide a country.\");\r\n\t\t\t\t$validate = $valid->validate();\r\n\r\n\t\t\t\t$formdata['default_shipping'] = ($formdata['default_shipping'] == 1 ? 1 : 0);\r\n\t\t\t\t$formdata['default_billing'] = ($formdata['default_billing'] == 1 ? 1 : 0);\r\n\r\n\t\t\t\t//If our form validates correctly so far\r\n\t\t\t\tif (empty($validate)) {\r\n\r\n\r\n\t\t\t\t\t//We need to check if the state is required, or if they are in a country where we should omit the state\r\n\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT COUNT(*) AS total FROM bs_zones WHERE countries_id = ?\");\r\n\t\t\t\t\t$sql->execute(array($formdata['country']));\r\n\t\t\t\t\t$result = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t\t\t\tif ($result['total'] <= 0) {\r\n\t\t\t\t\t\t$formdata['state'] = NULL;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//We need to see if a specific address edit id was given to us from the form. If an edit id is present,\r\n\t\t\t\t\t//we are updating that address. If the edit id is 0, we are inserting a new address\r\n\t\t\t\t\tif (!empty($formdata['address_id'])) {\r\n\r\n\t\t\t\t\t\t//Check to make sure the address exists\r\n\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT COUNT(id) AS total FROM bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE public_id = ? AND cid = ?\");\r\n\t\t\t\t\t\t$sql->execute(array($formdata['address_id'], $_SESSION['CID']));\r\n\t\t\t\t\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\r\n\t\t\t\t\t\t//If the address does exist, and it belongs to this customer, let them update it\r\n\t\t\t\t\t\tif ($row['total'] > 0) {\r\n\r\n\t\t\t\t\t\t\t//If the customer is setting this as a default address, we first have to disable any other\r\n\t\t\t\t\t\t\t//defaults on their account of the same type\r\n\t\t\t\t\t\t\tif ($formdata['default_shipping'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_shipping = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ($formdata['default_billing'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_billing = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t//Update the address\r\n\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompany = :company,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfirst_name = :first,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlast_name = :last,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstreet_address = :address1,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuburb = :address2,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostcode = :zip,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcity = :city,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstate = :state,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcountry = :country,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone = :phone,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfax = :fax,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault_shipping = :default_shipping,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault_billing = :default_billing\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE cid = :cid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND public_id = :id\");\r\n\r\n\t\t\t\t\t\t\t$sql->execute(array(\":cid\" => $_SESSION['CID'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":id\" => $formdata['address_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":company\" => $formdata['company'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":first\" => $formdata['first'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":last\" => $formdata['last'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address1\" => $formdata['address1'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address2\" => $formdata['address2'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":zip\" => $formdata['zip'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":city\" => $formdata['city'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":state\" => $formdata['state'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":country\" => $formdata['country'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":phone\" => $formdata['phone'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":fax\" => $formdata['fax'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_shipping\" => $formdata['default_shipping'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_billing\" => $formdata['default_billing']));\r\n\r\n\t\t\t\t\t\t\t$_SESSION['successes'][] = \"Your address has successfully been updated.\";\r\n\r\n\t\t\t\t\t\t\t//Redirect them\r\n\t\t\t\t\t\t\t$link = new Page('my-account');\r\n\t\t\t\t\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 302 Found', true, 302);\r\n\t\t\t\t\t\t\theader(\"Location: \".$link->getUrl());\r\n\t\t\t\t\t\t\texit;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//The address doesn't exist, or doesn't belong to this customer. Give them an unknown error\r\n\t\t\t\t\t\t\t$_SESSION['errors'][] = \"Your address could not be updated; An unknown error was encountered.\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//Inserting a new address\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t//First we'll check to make sure this address isn't already on the customer's account\r\n\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT COUNT(id) AS total FROM bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE cid = :cid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND company = :company\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND first_name = :first\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND last_name = :last\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND street_address = :address1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND suburb = :address2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND postcode = :zip\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND city = :city\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND state = :state\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND country = :country\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND phone = :phone\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND fax = :fax\");\r\n\t\t\t\t\t\t$sql->execute(array(\":cid\" => $_SESSION['CID'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":company\" => $formdata['company'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":first\" => $formdata['first'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":last\" => $formdata['last'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":address1\" => $formdata['address1'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":address2\" => $formdata['address2'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":zip\" => $formdata['zip'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":city\" => $formdata['city'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":state\" => $formdata['state'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":country\" => $formdata['country'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":phone\" => $formdata['phone'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":fax\" => $formdata['fax']));\r\n\t\t\t\t\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t\t\t\t\t//Make sure this address is not already on the account\r\n\t\t\t\t\t\tif ($row['total'] <= 0 OR $row['total'] == NULL) {\r\n\t\t\t\t\t\t\t//If the customer is setting this as a default address, we first have to disable any other\r\n\t\t\t\t\t\t\t//defaults on their account of the same type\r\n\t\t\t\t\t\t\tif ($formdata['default_shipping'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_shipping = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ($formdata['default_billing'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_billing = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"INSERT INTO bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(public_id, cid, company, first_name, last_name,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstreet_address, suburb, postcode,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcity, state, country, phone, fax,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault_shipping, default_billing)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(:public_id, :cid, :company, :first, :last,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:address1, :address2, :zip,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:city, :state, :country, :phone, :fax,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:default_shipping, :default_billing)\");\r\n\t\t\t\t\t\t\t$sql->execute(array(\":public_id\" => $this->getUniquePublicId(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":cid\" => $_SESSION['CID'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":company\" => $formdata['company'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":first\" => $formdata['first'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":last\" => $formdata['last'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address1\" => $formdata['address1'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address2\" => $formdata['address2'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":zip\" => $formdata['zip'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":city\" => $formdata['city'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":state\" => $formdata['state'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":country\" => $formdata['country'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":phone\" => $formdata['phone'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":fax\" => $formdata['fax'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_shipping\" => $formdata['default_shipping'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_billing\" => $formdata['default_billing']));\r\n\r\n\t\t\t\t\t\t\t$_SESSION['successes'][] = \"Your address has successfully been added.\";\r\n\r\n\t\t\t\t\t\t\t//Redirect them\r\n\t\t\t\t\t\t\t$link = new Page('my-account');\r\n\t\t\t\t\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 302 Found', true, 302);\r\n\t\t\t\t\t\t\theader(\"Location: \".$link->getUrl());\r\n\t\t\t\t\t\t\texit;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//This address already exists for this customer\r\n\t\t\t\t\t\t\t$_SESSION['errors'][] = \"This address already exists for your account.\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t//If there were validation errors\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tforeach($validate as $key => $error) {\r\n\t\t\t\t\t\t$_SESSION['errors'][] = $error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t//Otherwise, they are not a user and we have an unknown error\r\n\t\t\t} else {\r\n\r\n\t\t\t\t//Check if they were updating or adding, and throw an error depending\r\n\t\t\t\tif (!empty($formdata['address_id'])) {\r\n\t\t\t\t\t$_SESSION['errors'][] = \"Your address could not be updated; An unknown error was encountered.\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$_SESSION['errors'][] = \"Your address could not be added; An unknown error was encountered.\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$_SESSION['validate'] = $formdata;\r\n\r\n\t\t\tif (!empty($formdata['address_id'])) {\r\n\t\t\t\t$_SESSION['instructions'] = \"Please click \\\"Update Address\\\" again to fix the following errors. \";\r\n\t\t\t} else {\r\n\t\t\t\t$_SESSION['instructions'] = \"Please click \\\"Add An Address\\\" again to fix the following errors. \";\r\n\t\t\t}\r\n\r\n\t\t\t//Redirect them\r\n\t\t\t$link = new Page('my-account');\r\n\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 302 Found', true, 302);\r\n\t\t\theader(\"Location: \".$link->getUrl());\r\n\t\t\texit;\r\n\t\t}", "public function rules()\n {\n return [\n 'company_identification_number' => 'alpha_num|min:5|max:50',\n 'company' => 'required|alpha_spaces',\n 'gstin' => 'required|alpha_num|min:15|max:15'\n ];\n }", "public function validateWithCardNumber($data)\n {\n $validator = Validator::make($data, [\n 'datetime' => 'required|numeric',\n 'referenceId' => 'required|string',\n 'installments' => 'required|integer',\n 'amountE2' => 'required|integer',\n 'cardNumber' => 'required|numeric',\n 'cardholderName' => 'required|string',\n 'cardExpirationDateYymm' => 'required|string|max:4',\n 'cvv' => 'required|numeric',\n 'autoCapture' => 'required|bool',\n\n 'purchaseInfo' => 'required|array',\n 'purchaseInfo.billTo' => 'required|array',\n 'purchaseInfo.billTo.address1' => 'required|string',\n 'purchaseInfo.billTo.address2' => 'nullable|string',\n 'purchaseInfo.billTo.administrativeArea' => 'required|string|max:2',\n 'purchaseInfo.billTo.countryCode' => 'required|string|max:2',\n 'purchaseInfo.billTo.city' => 'required|string',\n 'purchaseInfo.billTo.firstName' => 'required|string',\n 'purchaseInfo.billTo.lastName' => 'required|string',\n 'purchaseInfo.billTo.phoneNumber' => 'required|numeric',\n 'purchaseInfo.billTo.postalCode' => 'required|numeric',\n\n 'purchaseInfo.shippingTo' => 'required|array',\n 'purchaseInfo.shippingTo.address1' => 'required|string',\n 'purchaseInfo.shippingTo.address2' => 'nullable|string',\n 'purchaseInfo.shippingTo.administrativeArea' => 'required|string|max:2',\n 'purchaseInfo.shippingTo.countryCode' => 'required|string|max:2',\n 'purchaseInfo.shippingTo.city' => 'required|string',\n 'purchaseInfo.shippingTo.firstName' => 'required|string',\n 'purchaseInfo.shippingTo.lastName' => 'required|string',\n 'purchaseInfo.shippingTo.phoneNumber' => 'required|numeric',\n 'purchaseInfo.shippingTo.postalCode' => 'required|numeric',\n\n 'purchaseInfo.email' => 'nullable|email',\n 'purchaseInfo.ipAddress' => 'nullable|string',\n 'purchaseInfo.fingerprintSessionId' => 'nullable|string',\n 'purchaseInfo.personalIdentification' => 'nullable|numeric',\n\n ]);\n\n if ($validator->fails()) {\n throw new \\Exception($validator->errors()->first());\n }\n }", "public function validateAddress($attribute)\n {\n $web3BlockChainAdapter = new Web3BlockChainAdapter(Yii::$app->ethereumAPI);\n if ($this->network === CryptoCurrencyTypes::NETWORK_TYPE_ETHEREUM && !$web3BlockChainAdapter->isAccount($this->$attribute)) {\n $this->addError($attribute, 'The address does not exist in the blockchain.');\n }\n }", "function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$location, &$occupation, &$interests, &$sig)\n{\n\t$check_var_length = array('aim', 'msnm', 'yim', 'location', 'occupation', 'interests', 'sig');\n\n\tfor($i = 0; $i < count($check_var_length); $i++)\n\t{\n\t\tif (strlen($$check_var_length[$i]) < 2)\n\t\t{\n\t\t\t$$check_var_length[$i] = '';\n\t\t}\n\t}\n\n\t// ICQ number has to be only numbers.\n\tif (!preg_match('/^[0-9]+$/', $icq))\n\t{\n\t\t$icq = '';\n\t}\n\n\t// website has to start with http://, followed by something with length at least 3 that\n\t// contains at least one dot.\n\tif ($website != \"\")\n\t{\n\t\tif (!preg_match('#^http[s]?:\\/\\/#i', $website))\n\t\t{\n\t\t\t$website = 'http://' . $website;\n\t\t}\n\n\t\tif (!preg_match('#^http[s]?\\\\:\\\\/\\\\/[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)?[a-z]+#i', $website))\n\t\t{\n\t\t\t$website = '';\n\t\t}\n\t}\n\n\treturn;\n}", "public function rules()\n {\n return [\n 'bank_code'=>'required|between:16,23',\n 'account_name'=>'required|max:20',\n 'bank_name'=>'required|max:20',\n 'bank_addr'=>'required|max:30',\n 'start_use_status'=>'required|numeric',\n ];\n }", "function give_donation_form_validate_cc() {\n\n\t$card_data = give_get_donation_cc_info();\n\n\t// Validate the card zip.\n\tif ( ! empty( $card_data['card_zip'] ) ) {\n\t\tif ( ! give_donation_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) {\n\t\t\tgive_set_error( 'invalid_cc_zip', __( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) );\n\t\t}\n\t}\n\n\t// Ensure no spaces.\n\tif ( ! empty( $card_data['card_number'] ) ) {\n\t\t$card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); // no \"+\" signs.\n\t\t$card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces.\n\t}\n\n\t// This should validate card numbers at some point too.\n\treturn $card_data;\n}", "public function beforeValidate() {\n $requiredValidator = new CRequiredValidator();\n $emailValidator = new CEmailValidator();\n\n //SFERA-2781\n if(ClientDetectorComponent::getInstance()->isTechnicolor() || ClientDetectorComponent::getInstance()->isUmg()){\n\n //if not empty => should be validate\n if($this->email){\n $emailValidator->attributes[] = 'email';\n }\n\n if ($this->isMoneyBookers()) {\n // Set email variable\n $this->email = $this->mbEmail;\n if($this->email){\n $emailValidator->attributes[] = 'mbEmail';\n }\n } elseif($this->isPayPal()) {\n // Set email variable\n $this->email = $this->ppEmail;\n if($this->email){\n $emailValidator->attributes[] = 'ppEmail';\n }\n } elseif($this->isWiretransfer()) {\n // Set required attributes\n // $requiredValidator->attributes[] = 'bank_name';\n // $requiredValidator->attributes[] = 'bank_address';\n // $requiredValidator->attributes[] = 'bank_swift_code';\n // $requiredValidator->attributes[] = 'bank_account_number'; \n }\n\n } else {\n\n //not Technicolor => require and validate email\n if ($this->isMoneyBookers()) {\n $requiredValidator->attributes[] = 'email';\n $emailValidator->attributes[] = 'email';\n\n // Set email variable\n $this->email = $this->mbEmail;\n // Set required attributes\n $requiredValidator->attributes[] = 'mbEmail';\n $requiredValidator->attributes[] = 'money_bookers_id';\n // Set email required attributes\n $emailValidator->attributes[] = 'mbEmail';\n } elseif($this->isPayPal()) {\n $requiredValidator->attributes[] = 'email';\n $emailValidator->attributes[] = 'email';\n\n // Set email variable\n $this->email = $this->ppEmail;\n // Set required attributes\n $requiredValidator->attributes[] = 'ppEmail';\n // Set email required attributes\n $emailValidator->attributes[] = 'ppEmail';\n } elseif($this->isWiretransfer()) {\n // Set required attributes\n // $requiredValidator->attributes[] = 'bank_name';\n // $requiredValidator->attributes[] = 'bank_address';\n // $requiredValidator->attributes[] = 'bank_swift_code';\n // $requiredValidator->attributes[] = 'bank_account_number';\n } elseif($this->isNoPayment()) {\n \n }\n }\n\n // Add validators to existing list\n if(!empty($requiredValidator->attributes)){\n $this->validatorList->add($requiredValidator);\n }\n\n if(!empty($emailValidator->attributes)){\n $this->validatorList->add($emailValidator);\n }\n\n return parent::beforeValidate();\n }", "public function addAddress(){\n\t\t$name = $_REQUEST['name'];\n\t\t$address = $_REQUEST['address'];\n $stuid = $_REQUEST['stuid'];\n\t\t$phone = $_REQUEST['phone'];\n\t\t$form = M(\"addressinfo\");\n\t\t$data['name'] = $name;\n \t$data['address'] = $address;\n \t$data['phone'] = $phone;\n $data['stuid'] = $stuid;\n \t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "function pw_edd_purchase_form_required_fields( $required_fields ) {\n \n \t// Set a field as required\n $required_fields['edd_last'] = array( \n 'error_id' => 'invalid_last_name',\n 'error_message' => __( 'Please enter your last name.', 'edd' )\n );\n\n /*\n * If you wanted to remove a field from required list\n\t * you would simply unset the array key\n\t */\n // unset( $required_fields['edd_first'] );\n \n return $required_fields;\n}", "public function test_street_address_validation()\n {\n /*\n * Valid\n */\n $validStreetLocation = Location::factory()->make([\n 'streetAddress' => '123 Valid Address',\n ]);\n $validStreetData = $validStreetLocation->toArray();\n $response = $this->post($this->route(), $validStreetData);\n $response->assertStatus(201);\n\n /*\n * Invalid: missing\n */\n $missingStreetLocation = Location::factory()->make();\n $missingStreetData = $missingStreetLocation->toArray();\n unset($missingStreetData['streetAddress']);\n\n $response = $this->post($this->route(), $missingStreetData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.streetAddress', 'The street address field is required.');\n\n /**\n * Invalid: not a string\n */\n $nonStringLocation = Location::factory()->make([\n 'streetAddress' => ['invalid'],\n ]);\n $nonStringData = $nonStringLocation->toArray();\n\n $response = $this->post($this->route(), $nonStringData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.streetAddress', 'The street address must be a string.');\n }", "private function isCompanyRequired()\n {\n return $this->eavConfig->getAttribute('customer_address', 'company')->getIsRequired();\n }", "public function rules()\n {\n return [\n\n 'name' =>'required',\n 'phone'=>'required|numeric|min:6',\n 'address'=>'required'\n //\n ];\n }", "public function rules()\n\t{\n\t\treturn [\t\t\t\n\t\t\t'address' => 'required',\n\t\t\t'dateofbirth' => 'required|date_format:\"Y/m/d\"',\n\t\t\t'placeofbirth' => 'required',\t\t\t\n\t\t\t'phoneNumber' => 'required|min:11',\n\t\t\t'school_before' => 'required',\t\t\t\n\t\t];\n\t}", "function validate_ref_no($formdata,$required_fields = array(),$correctformat=array())\n{\n\tprint_r($correctformat); exit();\n \t\n\t/*$empty_fields = array();\n\t$bool_result = TRUE;\n\tforeach($required_fields AS $required)\n\t{\n\t\t//compare fordata;\n\t\t//if($formdata)\n\n\t\t#array_push($empty_fields, $field_str[0]);\n\t} */\n}", "protected function buildMainFields(): void\n {\n $groupName = \"Address\";\n\n //====================================================================//\n // Addess\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address1\")\n ->name(\"Street 1\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress\")\n ->isIndexed()\n ;\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address2\")\n ->name(\"Street 2\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress2\")\n ;\n //====================================================================//\n // Zip Code\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"zip\")\n ->name(\"Zip\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"postalCode\")\n ->isIndexed()\n ->addOption('maxLength', (string) 18)\n ;\n //====================================================================//\n // City Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"city\")\n ->name(\"Town\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"addressLocality\")\n ;\n //====================================================================//\n // Country Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"country_name\")\n ->name(\"Country\")\n ->group($groupName)\n ->isReadOnly()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country_code\")\n ->name(\"Country Code\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ;\n //====================================================================//\n // State Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"province\")\n ->group($groupName)\n ->name(\"State\")\n ->isReadOnly()\n ;\n //====================================================================//\n // State code\n $this->fieldsFactory()->create(SPL_T_STATE)\n ->identifier(\"province_code\")\n ->name(\"State Code\")\n ->group($groupName)\n ->microData(\"http://schema.org/PostalAddress\", \"addressRegion\")\n ->isReadOnly()\n ->isNotTested()\n ;\n }", "public function validateDetails($attribute,$params)\n {\n if (count($this->orderDetails) == 0) {\n $this->addError('orderDetails', 'Order Details need to be entered');\n }\n }", "function give_default_cc_address_fields( $form_id ) {\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give_cc_address\" class=\"cc-address\">\n\t\t<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, before address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_top' );\n\n\t\t// For Country.\n\t\t$selected_country = give_get_country();\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\t\t$countries = give_get_country_list();\n\n\t\t// For state.\n\t\t$selected_state = '';\n\t\tif ( $selected_country === give_get_country() ) {\n\t\t\t// Get default selected state by admin.\n\t\t\t$selected_state = give_get_state();\n\t\t}\n\t\t// Get the last payment made by user states.\n\t\tif ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {\n\t\t\t$selected_state = $give_user_info['card_state'];\n\t\t}\n\t\t// Get the country code.\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\n\n\t\t// Get the country list that does not require city.\n\t\t$city_required = ! array_key_exists( $selected_country, give_city_not_required_country_list() );\n\n\t\t?>\n\t\t<p id=\"give-card-country-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"billing_country\" class=\"give-label\">\n\t\t\t\t<?php esc_html_e( 'Country', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\n\t\t\t<select\n\t\t\t\tname=\"billing_country\"\n\t\t\t\tautocomplete=\"country\"\n\t\t\t\tid=\"billing_country\"\n\t\t\t\tclass=\"billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $countries as $country_code => $country ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 1', 'give' ); ?>\n\t\t\t\t<?php\n\t\t\t\tif ( give_field_is_required( 'card_address', $form_id ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The primary billing address for your credit card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address\"\n\t\t\t\tname=\"card_address\"\n\t\t\t\tautocomplete=\"address-line1\"\n\t\t\t\tclass=\"card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 1', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-2-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address_2\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 2', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( '(optional) The suite, apartment number, post office box (etc) associated with your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address_2\"\n\t\t\t\tname=\"card_address_2\"\n\t\t\t\tautocomplete=\"address-line2\"\n\t\t\t\tclass=\"card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 2', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-city-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_city\" class=\"give-label\">\n\t\t\t\t<?php _e( 'City', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator <?php echo( $city_required ? '' : 'give-hidden' ); ?>\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The city for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_city\"\n\t\t\t\tname=\"card_city\"\n\t\t\t\tautocomplete=\"address-level2\"\n\t\t\t\tclass=\"card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'City', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo( isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_city', $form_id ) && $city_required ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php\n\t\t/**\n\t\t * State field logic.\n\t\t */\n\t\t$state_label = __( 'State', 'give' );\n\t\t$states_label = give_get_states_label();\n\t\t// Check if $country code exists in the array key for states label.\n\t\tif ( array_key_exists( $selected_country, $states_label ) ) {\n\t\t\t$state_label = $states_label[ $selected_country ];\n\t\t}\n\t\t$states = give_get_states( $selected_country );\n\t\t// Get the country list that do not have any states.\n\t\t$no_states_country = give_no_states_country_list();\n\t\t// Get the country list that does not require states.\n\t\t$states_not_required_country_list = give_states_not_required_country_list();\n\t\t// Used to determine if state is required.\n\t\t$require_state = ! array_key_exists( $selected_country, $no_states_country ) && give_field_is_required( 'card_state', $form_id );\n\t\t// Used to determine is state input should be marked as required.\n\t\t$validate_state = ! array_key_exists( $selected_country, $states_not_required_country_list ) && give_field_is_required( 'card_state', $form_id );\n\n\t\t?>\n\t\t<p id=\"give-card-state-wrap\"\n\t\t class=\"form-row form-row-first form-row-responsive <?php echo ( ! empty( $selected_country ) && ! $require_state ) ? 'give-hidden' : ''; ?> \">\n\t\t\t<label for=\"card_state\" class=\"give-label\">\n\t\t\t\t<span class=\"state-label-text\"><?php echo $state_label; ?></span>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"give-required-indicator <?php echo $validate_state ? '' : 'give-hidden'; ?> \">*</span>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\t\t\t<?php\n\n\t\t\tif ( ! empty( $states ) ) :\n\t\t\t\t?>\n\t\t\t\t<select\n\t\t\t\t\tname=\"card_state\"\n\t\t\t\t\tautocomplete=\"address-level1\"\n\t\t\t\t\tid=\"card_state\"\n\t\t\t\t\tclass=\"card_state give-select<?php echo $validate_state ? ' required' : ''; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $states as $state_code => $state ) {\n\t\t\t\t\t\techo '<option value=\"' . $state_code . '\"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t<?php else : ?>\n\t\t\t\t<input type=\"text\" size=\"6\" name=\"card_state\" id=\"card_state\" class=\"card_state give-input\"\n\t\t\t\t placeholder=\"<?php echo $state_label; ?>\" value=\"<?php echo $selected_state; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>\n\t\t\t\t/>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\n\t\t<p id=\"give-card-zip-wrap\" class=\"form-row <?php echo $require_state ? 'form-row-last' : ''; ?> form-row-responsive\">\n\t\t\t<label for=\"card_zip\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Zip / Postal Code', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The zip or postal code for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tsize=\"4\"\n\t\t\t\tid=\"card_zip\"\n\t\t\t\tname=\"card_zip\"\n\t\t\t\tautocomplete=\"postal-code\"\n\t\t\t\tclass=\"card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Zip / Postal Code', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, after address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_bottom' );\n\t\t?>\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}", "public function rules() \n \t{\n \t\treturn [\n \t\t\t[['address'], 'required'],\n \t\t\t['address', 'ip']\n \t\t];\n \t}", "function validatePostcode(&$errors, $field_list, $field_name)\n{\n\t$PostcodePat = '/^[0-9]{4}$/'; //postcode regex\n\tif (!isset($field_list[$field_name])|| empty($field_list[$field_name])) //checks if empty\n\t\t$errors[$field_name] = ' Required';\n\telse if (!preg_match($PostcodePat, $field_list[$field_name])) //checks if matches the given regex\n\t\t$errors[$field_name] = ' Invalid';\n}", "public function rules() {\n return [\n [['location_id', 'customer_id'], 'required'],\n [['location_id', 'customer_id','type'], 'safe'],\n ];\n }", "function wp_required_field_indicator()\n {\n }", "public function testDebtorSaveAddressEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => 'cvmm121@gmail.com',\n 'cpf_cnpj' => '1234567890',\n 'birthdate' => '12/01/1994',\n 'phone_number' => '(79) 9 9999-9999',\n 'zipcode' => '99999-999',\n 'address' => '',\n 'number' => '25',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }", "public function rules()\n {\n return [\n 'name' => 'required|min:3|max:190',\n 'support_pin' => 'required|numeric|digits:4',\n 'rng_level' => 'required|numeric|digits:1',\n 'dob' => 'required',\n 'mobile' => 'required|numeric',\n 'country' => 'required',\n ];\n }", "public function rules()\n {\n return [\n //\n 'fullname'=>'required|min:3',\n 'phone'=>'required|numeric',\n 'gender'=>'required',\n 'state'=>'required',\n 'lga'=>'required',\n 'village'=>'required',\n 'farm_size'=>'required|numeric',\n 'bank'=>'required',\n 'account_no'=>'required|numeric'\n ];\n }", "public function testFormCityMissingAddressVisible() {\n $form = new RedirectForm();\n $form_state = [];\n $payment = $this->mockPayment([\n 'firstname' => 'First',\n 'lastname' => 'Last',\n 'address1' => 'Address1',\n 'postcode' => 'TEST',\n 'country' => 'GB',\n ]);\n $element = $form->form([], $form_state, $payment);\n $pd = $element['personal_data'];\n $pd['address'] += ['#access' => TRUE];\n $this->assertTrue($pd['address']['#access']);\n }", "public function dp_saveaddress($data)\n {\n return $this->call('dp_saveaddress', static::prepareParams($data, [\n 'address_id' => ['numeric'], // Enter 0 in this field to create a new address value or the address_id number of an existing address_id to update the existing value\n 'donor_id' => ['numeric'], // Specify the donor_id of the donor associated with this\n 'opt_line' => ['string', 100], // Enter a secondary name or company name if appropriate\n 'address' => ['string', 100], //\n 'address2' => ['string', 100], //\n 'city' => ['string', 50], //\n 'state' => ['string', 30], //\n 'zip' => ['string', 20], //\n 'country' => ['string', 30], //\n 'address_type' => ['string', 30], // Enter the CODE value associated with the address type\n 'getmail' => ['string', 1], // Enter 'Y' or 'N' to indicate whether the Receive Mail box will be checked and to indicate whether mail can be sent to this address.\n 'user_id' => $this->appName,\n 'title' => ['string', 50], // Enter a value to be stored in the Professional Title field.\n 'first_name' => ['string', 50], //\n 'middle_name' => ['string', 50], //\n 'last_name' => ['string', 75], //\n 'suffix' => ['string', 50], //\n 'prof_title' => ['string', 100], //\n 'salutation' => ['string', 130], // Enter desired salutation value (e.g.; 'Dear Bob')\n 'seasonal_from_date' => ['string', 4], // Enter the 'from' date as MMYY – e.g; November 2017 would be represented as 1117\n 'seasonal_to_date' => ['string', 4], // Enter the 'to' date as MMYY\n 'email' => ['string', 75], //\n 'home_phone' => ['string', 40], //\n 'business_phone' => ['string', 40], //\n 'fax_phone' => ['string', 40], //\n 'mobile_phone' => ['string', 40], //\n 'address3' => ['string', 100], //\n 'address4' => ['string', 100], //\n 'ukcountry' => ['string', 100], //\n 'org_rec' => ['string', 1], // Enter 'Y' to check the Org Rec field (indicating an organizational record) or 'N' to leave it unchecked to indicate an individual record.\n ]));\n }", "public function rules()\n {\n return [\n 'brand_name' => 'required|min:3|max:30',\n 'contact_person' => 'required|min:3|max:30',\n 'contact_no' => 'required|max:13',\n 'address' => 'required',\n 'status' => 'required',\n ];\n }", "public function rules()\n {\n return [\n 'assigned_to' => 'required',\n 'bank_name' => 'required',\n 'bank_address' => 'required',\n 'bank_branch' => 'required',\n 'bank_code' => 'required',\n 'swiftcode' => 'required',\n 'bank_account_no' => 'required',\n 'payment_date' => 'required',\n 'payment_mode' => 'required',\n 'currency' => 'required',\n 'co_name_1' => 'required',\n 'co_contact_name_1' => 'required',\n 'co_address_1' => 'required',\n 'co_city_1' => 'required',\n 'co_postcode_1' => 'required',\n 'co_phone_1' => 'required',\n 'co_email_1' => 'required',\n 'co_comment_1' => 'required',\n 'co_name_2' => 'sometimes',\n 'co_contact_name_2' => 'sometimes',\n 'co_address_2' => 'sometimes',\n 'co_city_2' => 'sometimes',\n 'co_postcode_2' => 'sometimes',\n 'co_phone_2' => 'sometimes',\n 'co_email_2' => 'sometimes',\n 'co_comment_2' => 'sometimes',\n// 'terms' => 'required',\n 'pin_cert' => 'nullable|mimes:pdf,doc,docx,zip,docm,xls,xlsx,xlsm',\n 'vat_cert' => 'nullable|mimes:pdf,doc,docx,zip,docm,xls,xlsx,xlsm',\n 'co_reg_cert' => 'nullable|mimes:pdf,doc,docx,zip,docm,xls,xlsx,xlsm',\n 'rep_id_file' => 'nullable|mimes:pdf,doc,docx,zip,docm,xls,xlsx,xlsm',\n 'directors_list' => 'nullable|mimes:pdf,doc,docx,zip,docm,xls,xlsx,xlsm',\n 'utility_bill' => 'nullable|mimes:pdf,doc,docx,zip,docm,xls,xlsx,xlsm',\n 'total_turnover_1' => 'required',\n 'total_assets_1' => 'required',\n 'current_assets_1' => 'required',\n 'total_liabilities_1' => 'required',\n 'current_liabilities_1' => 'required',\n 'profit_before_taxes_1' => 'required',\n 'profit_after_taxes_1' => 'required',\n 'total_turnover_2' => 'sometimes',\n 'total_assets_2' => 'sometimes',\n 'current_assets_2' => 'sometimes',\n 'total_liabilities_2' => 'sometimes',\n 'current_liabilities_2' => 'sometimes',\n 'profit_before_taxes_2' => 'sometimes',\n 'profit_after_taxes_2' => 'sometimes',\n ];\n }", "function set_street_address($name='*', $suffix='*', $street_num='*', $apt_num='*')\r\n{\r\n\tif ( $this->debug ) $this->print_d(__FUNCTION__ . ' : set street address');\r\n\t\r\n\t// random apartment num\r\n\tif ( $apt_num == '*' ) $apt_num = $this->_get_random_apt_num();\r\n\t\r\n\t// random suffix (St, Ave, Blvd, etc.)\r\n\tif ( $suffix == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_SUFFIX = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$suffix = $_SUFFIX[1];\r\n\t\tif ( $this->debug ) $this->print_d(\"random suffix: $suffix\");\r\n\t}\r\n\t\r\n\t// random street name\r\n\tif ( $name == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_NAME = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$name = $_NAME[0];\r\n\t\tif ( $this->debug ) $this->print_d(\"random name: $name\");\r\n\t}\r\n\t\r\n\t// street number (quick and dirty)\r\n\tif ( $street_num == '*' )\r\n\t{\r\n\t\t$street_num = mt_rand(1,12500);\r\n\t\tif ( $this->debug ) $this->print_d(\"random street number: $street_num\");\r\n\t}\r\n\t\r\n\t// set street prop\r\n\t$this->street_address = trim(ucwords(strtolower(\"$street_num $name $suffix $apt_num\")));\r\n\tif ( $this->debug ) $this->print_d(\"random street_address : {$this->street_address}\");\r\n\treturn;\r\n}", "public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }", "public function rules()\n {\n $id = $this->segment(3);\n return [\n 'street' => \"required|min:3|max:60|unique:addresses,street,{$id},id\",\n 'url' => \"required|min:3|max:60|unique:addresses,url,{$id},id\",\n 'number' => \"required|min:1|max:6,{$id},id\",\n 'neighborhood' => \"required|min:3|max:60|\",\n 'complement' => \"max:9000\",\n 'city_id' => 'required|exists:cities,id',\n 'state_id' => 'required|exists:states,id',\n 'zipeCode' => 'required|min:8|max:8',\n ];\n }", "public function rules()\n {\n return [\n\n 'name' => 'required|max:255',\n 'address' => 'required',\n 'postcode' => 'required|max:15',\n 'cardnumber' => 'required|digits_between:16,20',\n 'cvv' => 'required|digits_between:3,4'\n ];\n }", "public function asMandatory()\n {\n $this->mandatory = true;\n\n // update the cache that Datastore_MetaRecord holds\n $oDef = DataModel_Definitions::getIfExists($this->modelName);\n $oDef->setMandatoryField($this);\n }", "public function rules()\n {\n return [\n 'name'=>'required',\n 'postalCode'=>'required|regex:/^[0-9]{3}-[0-9]{4}$/',//'bail|required|numeric|between:7,7',\n 'address'=>'required',\n 'phoneNum'=>'required|regex:/^[0-9]{3}-[0-9]{4}-[0-9]{4}$/',\n 'email'=>'bail|required|confirmed',\n 'password'=>'bail|required|min:4|max:15|alpha_num|confirmed',\n ];\n }", "public function rules()\n\t{\n\t\treturn [\n\t\t\t'name' => 'required|unique:almacens',\n\t\t\t'adress'=>'required'\n\t\t];\n\t}", "public function rules()\n {\n return [\n \"client\" => \"required\",\n \"client.id\" => \"required|numeric|exists:clients,id\",\n \"client.name\" => \"string|min:7\",\n \"client.email\" => \"email\",\n \"client.password\" => \"required|string|min:8\",\n \"client.cpf_cnpj\" => \"required|string|min:11|unique:clients,cpf_cnpj\",\n \"client.phone\" => \"string|min:10|max:15\",\n \"client.cellphone\" => \"string|min:12|max:15\",\n \"client.user_id\" => \"nullable|numeric\",\n \"client.address\" => \"required\",\n \"client.address.id\" => \"required|numeric|exists:addresses,id\",\n \"client.address.state\" => \"required|string|min:2|max:2\",\n \"client.address.zip_code\" => \"required|string|min:8\",\n \"client.address.city\" => \"required|string|max:50\",\n \"client.address.street\" => \"required|string|max:100\",\n \"client.address.number\" => \"numeric\",\n \"client.address.addressable_id\" => \"required_without:client.id|numeric\",\n \"client.address.addressable_type\" => \"nullable|string\",\n \"client.electric_account\" => \"required\",\n \"client.electric_account.number\" => \"required|string\",\n \"client.electric_account.consumption_type_id\" => \"required|numeric|exists:production_types,id\",\n \"client.electric_account.distributor_initials\" => \"required|string\",\n \"client.electric_account.phase\" => \"required|string|min:2|max:4\",\n \"client.electric_account.address\" => \"required\",\n \"client.electric_account.address.state\" => \"required|string|min:2|max:2\",\n \"client.electric_account.address.zip_code\" => \"required|string|min:8\",\n \"client.electric_account.address.city\" => \"required|string|max:50\",\n \"client.electric_account.address.street\" => \"required|string|max:100\",\n \"client.electric_account.address.number\" => \"numeric\",\n \"client.bank\" => \"nullable\",\n \"client.bank.agency\" => \"required_with:client.bank|string|min:4\",\n \"client.bank.account\" => \"required_with:client.bank|string|min:4\",\n \"client.bank.account_dv\" => \"nullable|string|max:2\",\n \"client.bank.agency_dv\" => \"nullable|string|max:2\",\n \"client.bank.type\" => \"string|min:2\",\n \"client.bank.bank_id\" => \"required_with:client.bank|numeric|exists:banks,id\",\n \"client.bank.segment_id\" => \"numeric|exists:segments,id\",\n ];\n }", "public function rules()\n {\n return [\n 'credit_type_name' => 'required|max:20|min:3|unique:credit_types',\n ];\n }", "public function setStreet($street = \"\");", "function adstrue_vendor_provice_validate($form, &$form_state) {\n drupal_add_css(drupal_get_path('module','adstrue_vendor').'/assets/css/custom_form.css');\n \n $name_province = $form_state['values']['name_province'];\n $company_id = $form_state['values']['company_id'];\n if($company_id == 0) {\n form_set_error('company_id',t('Vui lòng chọn công ty'));\n }\n\n $province_description = $form_state['values']['province_description'];\n $region_id = $form_state['values']['region_id'];\n $company_id = $form_state['values']['company_id'];\n if($name_province == '') {\n form_set_error('Vui lòng nhập tên tỉnh thành');\n }\n}", "public function rules()\n {\n return [\n 'code'=>'required|numeric|unique:agencies',\n 'name'=>'required|string',\n 'phone'=>'required|regex:/(0)[0-9]/|not_regex:/[a-z]/|min:9',\n 'email'=>'required|email',\n 'address'=>'required|string',\n 'manager'=>'required|string',\n ];\n }", "public function isAddressSpecified(): bool\n {\n return ($this->getAddressZip() && $this->getAddressCity() && $this->getAddressCountry());\n }", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "public function rules()\n {\n return [\n 'storeId' => 'required|exists:stores,id',\n 'phone' => 'nullable|min:8|max:15',\n 'address' => 'nullable',\n 'address_id' => 'nullable',\n 'latitude' => 'nullable',\n 'longitude' => 'nullable',\n 'place_id' => 'nullable',\n ];\n }", "function my_custom_checkout_field_process() {\n // Check if set, if its not set add an error.\n if ( ! $_POST['billing_phone_new'] )\n wc_add_notice( __( 'Phone 2 is compulsory. Please enter a value' ), 'error' );\n}", "public function rules()\n {\n return [\n 'or_number' => 'required|min:1'\n ];\n }", "public function validate()\n {\n if (empty($this->schemeID)) {\n ISO6523ICD::verify($this->schemeID);\n }\n\n if ($this->address === null) {\n throw new \\InvalidArgumentException(\"Element 'cac:Address' MUST be provided\");\n }\n }", "public function rules()\n {\n return [\n\n 'case_type' =>'required|not_in:0',\n// 'case_sub_type' =>'required|not_in:0',\n'saps_station'=>'required',\n 'cellphone' =>'required',\n 'name' =>'required|alpha',\n 'surname' =>'required|alpha',\n 'company' =>'required',\n 'description' =>'required',\n 'client_reference_number' =>'required',\n 'saps_case_number' =>'required',\n 'saps_case_number' =>'required',\n // 'rate_value' =>'required',\n 'investigation_cell' =>'required',\n 'investigation_email' =>'email',\n 'investigation_note' =>'required',\n\n\n\n\n\n\n \n ];\n }", "public function validate_address( $address ) {\n\t\t// @codingStandardsIgnoreStart\n\t\treturn strlen( $address ) == 35\n\t\t\t&& ( $address[0] == 'D' || $address[0] == 'T' )\n\t\t\t&& $address[1] == 's';\n\t\t// @codingStandardsIgnoreEnd\n\t}", "public function required();", "public function required();" ]
[ "0.63563126", "0.6261012", "0.6244177", "0.62391853", "0.62220436", "0.60639143", "0.6034561", "0.5905881", "0.5889249", "0.58749336", "0.5860568", "0.5850722", "0.57566303", "0.5748364", "0.5661461", "0.5633679", "0.5586975", "0.5554097", "0.55473125", "0.5525727", "0.5502592", "0.54973435", "0.5469504", "0.5461216", "0.54609346", "0.5456538", "0.5455401", "0.5439315", "0.5419155", "0.54136956", "0.53917325", "0.53712773", "0.53693604", "0.53654885", "0.5345589", "0.5337632", "0.5337472", "0.5333646", "0.53248155", "0.5318005", "0.53132224", "0.5300462", "0.52975833", "0.5295391", "0.5295087", "0.52843904", "0.5278795", "0.5273755", "0.5270808", "0.5265592", "0.5264409", "0.52613515", "0.5247959", "0.5245677", "0.52413595", "0.5240389", "0.52297604", "0.5229114", "0.52287346", "0.52214015", "0.5216901", "0.5210447", "0.5206609", "0.52022964", "0.5199581", "0.51957107", "0.5192436", "0.51841235", "0.51729536", "0.51699", "0.5162762", "0.51616925", "0.5156667", "0.5154607", "0.51485157", "0.5146254", "0.51441944", "0.5141032", "0.51374716", "0.5134667", "0.5131583", "0.5130552", "0.5127157", "0.51233304", "0.51177037", "0.5109192", "0.5104506", "0.5103943", "0.5100828", "0.5100682", "0.5100496", "0.5098864", "0.5095315", "0.509529", "0.5082033", "0.5080457", "0.5079609", "0.5078181", "0.5075606", "0.5075606" ]
0.6876823
0
Set error if fairaddress number field is empty You can do additional error checking here if required
function getfaircoin_edd_validate_checkout_fields( $valid_data, $data ) { if( !isset($data['edd_fairsaving']) ) $data['edd_fairsaving'] = '0'; if ( is_user_logged_in() ) { $user_id = get_current_user_id(); update_user_meta( $user_id, '_edd_user_fairsaving', sanitize_text_field($data['edd_fairsaving']) ); } else { } $fairsaving = sanitize_text_field($data['edd_fairsaving']); if( $fairsaving === '0') { if ( empty( $data['edd_fairaddress'] ) ) { edd_set_error( 'invalid_fairaddress', __('Please enter your Faircoin Address.', 'edd-getfaircoin') ); } else if ( strlen( $data['edd_fairaddress'] ) != 34 ) { edd_set_error( 'invalid_fairaddress', __('Your Faircoin Address must have 34 digits', 'edd-getfaircoin') ); } else { } } else if( $fairsaving == '1'){ // } else { edd_set_error( 'invalid_fairaddress', 'FAIRSAVING = '+$fairsaving+' ?' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateContactNumber()\n {\n if(! ctype_digit($this->Landline))\n $this->addError('Landline', 'Invalid landline.');\n }", "function validateAddress($field)\n\t{\n //Make sure field is not blank; unable to validate anything beyond that.\n if ($field == \"\") return \"Please specify your address.\\\\n\";\n\t\treturn \"\";\n\t}", "public function validate_refund_address_field() {\n\n\t\tWC()->session->set( 'decred_refund_address', null );\n\n\t\t$address = $this->get_post( 'decred-refund-address' );\n\n\t\t// this should never happen as the refund address field should be missing.\n\t\tif ( ! empty( $address ) && ! $this->show_refund_address() ) {\n\t\t\twc_add_notice( __( 'Decred plugin error: unexpected refund address.', 'decred' ), 'error' );\n\t\t\treturn false;\n\t\t}\n\n\t\t// empty address OK if optional, otherwise validate it.\n\t\tif ( empty( $address ) && ! $this->require_refund_address() ) {\n\t\t\t$address_is_valid = true;\n\t\t} else {\n\t\t\t$address_is_valid = $this->validate_address( $address );\n\t\t}\n\n\t\tif ( $address_is_valid ) {\n\t\t\tif ( ! empty( $address ) ) {\n\t\t\t\t// save address now to retrieve it later when order created.\n\t\t\t\tWC()->session->set( 'decred_refund_address', $address );\n\t\t\t}\n\t\t} else {\n\t\t\t// translators: parameter is address entered by user, not to be translated.\n\t\t\t$message = __( 'Please enter a valid Decred address for refunds. Wrong address \"%s\"', 'decred' );\n\t\t\twc_add_notice( sprintf( $message, $address ), 'error' );\n\t\t}\n\t}", "function checkAddress(){\n $country = $_POST[\"country\"];\n $city = $_POST[\"city\"];\n $street = $_POST[\"street\"];\n $number = $_POST[\"number\"];\n if(empty($country) || empty($city) || empty($street) || empty($number)){\n return false; \n }\n return true; \n }", "public function validate_fields() {\n\n\t\t$this->validate_refund_address_field();\n\t}", "public function invalidAddresses() {}", "public function validateAddress($attribute)\n {\n $web3BlockChainAdapter = new Web3BlockChainAdapter(Yii::$app->ethereumAPI);\n if ($this->network === CryptoCurrencyTypes::NETWORK_TYPE_ETHEREUM && !$web3BlockChainAdapter->isAccount($this->$attribute)) {\n $this->addError($attribute, 'The address does not exist in the blockchain.');\n }\n }", "public function validateAddress() {\r\n $leng = mb_strlen($this->data[$this->name]['Address']);\r\n if ($leng > 256) {\r\n return FALSE;\r\n } else if ($leng > 128) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['Address']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }", "private function _setAddressAttributeCode()\n {\n $assignAddress = new Address();\n return $assignAddress->addressErrorCodes;\n }", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "function validatePostcode(&$errors, $field_list, $field_name)\n{\n\t$PostcodePat = '/^[0-9]{4}$/'; //postcode regex\n\tif (!isset($field_list[$field_name])|| empty($field_list[$field_name])) //checks if empty\n\t\t$errors[$field_name] = ' Required';\n\telse if (!preg_match($PostcodePat, $field_list[$field_name])) //checks if matches the given regex\n\t\t$errors[$field_name] = ' Invalid';\n}", "public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }", "private function validate_address_2($value)\n\t{\n\t\t$value = trim($value);\n\t\t// empty user name is not valid\n\t\tif ($value) {\n\t\t\t$p_field_valid = validator_helper::validate_alphanum($value);\n\t\t\t//since the validator function returns FALSE if invalid or the value if valid,\n\t\t\t//it's safer to check explicitly for not FALSE)\n\t\t\tif (!$p_field_valid === FALSE) {\n\t\t\t\t//echo \"p_field_valid: \" . $p_field_valid . \"<br>\";\n\t\t\t\treturn 1; // valid\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 0; /* invalid characters */\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t return 1; /* field empty */\n\t\t}\n\t}", "public function validAddresses() {}", "public function setAddress($address) {\n\n $this->address = htmlspecialchars(strip_tags($address), ENT_QUOTES, 'utf-8');\n \n if (empty(trim($this->address))) {\n $this->valid = false;\n }\n\n }", "function checkAddress($address = null, $state = null, $city = null, $zip = null) {\n $this->autoRender = false;\n if (isset($_POST)) {\n $zipCode = ltrim($zip, \" \");\n $stateName = $state;\n $cityName = strtolower($city);\n $cityName = ucwords($cityName);\n $dlocation = $address . \" \" . $cityName . \" \" . $stateName . \" \" . $zipCode;\n $adjuster_address2 = str_replace(' ', '+', $dlocation);\n $geocode = file_get_contents('https://maps.google.com/maps/api/geocode/json?key='.GOOGLE_GEOMAP_API_KEY.'&address=' . $adjuster_address2 . '&sensor=false');\n $output = json_decode($geocode);\n if ($output->status == \"ZERO_RESULTS\" || $output->status != \"OK\") {\n echo 2;\n die; // Bad Address\n } else {\n $latitude = @$output->results[0]->geometry->location->lat;\n $longitude = @$output->results[0]->geometry->location->lng;\n $formated_address = @$output->results[0]->formatted_address;\n if ($latitude) {\n echo 1;\n die; // Good Address\n }\n }\n }\n }", "function getfaircoin_edd_required_checkout_fields( $required_fields ) {\r\n $required_fields['edd_fairaddress'] = array(\r\n 'error_id' => 'invalid_fairaddress',\r\n 'error_message' => __('Please enter a valid Faircoin Address', 'edd-getfaircoin')\r\n );\r\n return $required_fields;\r\n}", "private function ignoreAddressValidation()\n {\n $this->_quote->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_quote->getIsVirtual()) {\n $this->_quote->getShippingAddress()->setShouldIgnoreValidation(true);\n if (!$this->_config->getValue('requireBillingAddress')\n && !$this->_quote->getBillingAddress()->getEmail()\n ) {\n $this->_quote->getBillingAddress()->setSameAsBilling(1);\n }\n }\n }", "public function testDebtorSaveAddressEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => 'cvmm121@gmail.com',\n 'cpf_cnpj' => '1234567890',\n 'birthdate' => '12/01/1994',\n 'phone_number' => '(79) 9 9999-9999',\n 'zipcode' => '99999-999',\n 'address' => '',\n 'number' => '25',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }", "public function validate_customer_input_fields()\n {\n $passed_validation_tests = true;\n $check_name = has_presence($this->name);\n $msg = \"Fix the following error(s): \";\n $msg .=\"<ul style='text-align:left;margin-left:33%'>\";\n \n if (!$check_name) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Customer name cannot be blank.\";\n $msg .= \"</li>\";\n }\n // $check_apy_regex = Form::has_format_matching($apy, '/\\A\\d\\Z/');\n $check_telephone = has_presence($this->telephone);\n $check_telephone_numeric = has_number($this->telephone);\n $check_telephone_length = has_length($this->telephone, ['exact' => 10]);\n if (!$check_telephone or !$check_telephone_numeric or !$check_telephone_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Telephone: \";\n $msg .= h($this->telephone);\n $msg .= \" cannot be blank and must consists of 10 digits.\";\n $msg .= \"</li>\";\n }\n\n $check_barcode = has_presence($this->barcode);\n $check_barcode_numeric = has_number($this->barcode);\n $check_barcode_length = has_length($this->barcode, ['exact' => 6]);\n if (!$check_barcode or !$check_barcode_numeric or !$check_barcode_length) {\n $passed_validation_tests = false;\n $msg .= \"<li>\";\n $msg .= \"Barcode: \";\n $msg .= h($this->barcode);\n $msg .= \" cannot be blank and must consists of 6 digits.\";\n $msg .= \"</li>\";\n }\n\n $msg .= \"</ul>\";\n\n if ($passed_validation_tests) {\n return \"\";\n } else {\n return $msg;\n }\n }", "public function modifyAddress($formdata) {\r\n\r\n\t\t\t//Make sure this is a user before continuing\r\n\t\t\tif ($_SESSION['CID'] > 0) {\r\n\r\n\t\t\t\t//Instantiate our form validator, and validate the user input\r\n\t\t\t\t$valid = new Validate($formdata);\r\n\t\t\t\t$valid->name('first')->required(\"You must provide your first name.\");\r\n\t\t\t\t$valid->name('last')->required(\"You must provide your last name.\");\r\n\t\t\t\t$valid->name('phone')->required(\"You must provide your phone number.\")->phone(\"The number you have provided does not match a valid phone number format.\");\r\n\t\t\t\t$formdata['phone'] = $valid->getParsed(); //Get the phone number parsed in our format\r\n\t\t\t\t$valid->name('address1')->required(\"You must provide a street address.\");\r\n\t\t\t\t$valid->name('city')->required(\"You must provide a city.\")->minLength(2, \"The city you have provided is not valid.\");\r\n\t\t\t\t$valid->name('state')->requiredWhenCountryHasZones(\"You must provide a state.\");\r\n\t\t\t\t$valid->name('zip')->required(\"You must provide a zip code.\")->minLength(5, \"Valid zip codes contain 5 or more digits.\")->maxLength(10, \"The zip code you entered is invalid.\");\r\n\t\t\t\t$valid->name('country')->required(\"You must provide a country.\");\r\n\t\t\t\t$validate = $valid->validate();\r\n\r\n\t\t\t\t$formdata['default_shipping'] = ($formdata['default_shipping'] == 1 ? 1 : 0);\r\n\t\t\t\t$formdata['default_billing'] = ($formdata['default_billing'] == 1 ? 1 : 0);\r\n\r\n\t\t\t\t//If our form validates correctly so far\r\n\t\t\t\tif (empty($validate)) {\r\n\r\n\r\n\t\t\t\t\t//We need to check if the state is required, or if they are in a country where we should omit the state\r\n\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT COUNT(*) AS total FROM bs_zones WHERE countries_id = ?\");\r\n\t\t\t\t\t$sql->execute(array($formdata['country']));\r\n\t\t\t\t\t$result = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t\t\t\tif ($result['total'] <= 0) {\r\n\t\t\t\t\t\t$formdata['state'] = NULL;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//We need to see if a specific address edit id was given to us from the form. If an edit id is present,\r\n\t\t\t\t\t//we are updating that address. If the edit id is 0, we are inserting a new address\r\n\t\t\t\t\tif (!empty($formdata['address_id'])) {\r\n\r\n\t\t\t\t\t\t//Check to make sure the address exists\r\n\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT COUNT(id) AS total FROM bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE public_id = ? AND cid = ?\");\r\n\t\t\t\t\t\t$sql->execute(array($formdata['address_id'], $_SESSION['CID']));\r\n\t\t\t\t\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\r\n\t\t\t\t\t\t//If the address does exist, and it belongs to this customer, let them update it\r\n\t\t\t\t\t\tif ($row['total'] > 0) {\r\n\r\n\t\t\t\t\t\t\t//If the customer is setting this as a default address, we first have to disable any other\r\n\t\t\t\t\t\t\t//defaults on their account of the same type\r\n\t\t\t\t\t\t\tif ($formdata['default_shipping'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_shipping = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ($formdata['default_billing'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_billing = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t//Update the address\r\n\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompany = :company,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfirst_name = :first,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlast_name = :last,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstreet_address = :address1,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuburb = :address2,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostcode = :zip,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcity = :city,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstate = :state,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcountry = :country,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone = :phone,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfax = :fax,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault_shipping = :default_shipping,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault_billing = :default_billing\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE cid = :cid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND public_id = :id\");\r\n\r\n\t\t\t\t\t\t\t$sql->execute(array(\":cid\" => $_SESSION['CID'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":id\" => $formdata['address_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":company\" => $formdata['company'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":first\" => $formdata['first'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":last\" => $formdata['last'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address1\" => $formdata['address1'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address2\" => $formdata['address2'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":zip\" => $formdata['zip'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":city\" => $formdata['city'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":state\" => $formdata['state'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":country\" => $formdata['country'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":phone\" => $formdata['phone'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":fax\" => $formdata['fax'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_shipping\" => $formdata['default_shipping'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_billing\" => $formdata['default_billing']));\r\n\r\n\t\t\t\t\t\t\t$_SESSION['successes'][] = \"Your address has successfully been updated.\";\r\n\r\n\t\t\t\t\t\t\t//Redirect them\r\n\t\t\t\t\t\t\t$link = new Page('my-account');\r\n\t\t\t\t\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 302 Found', true, 302);\r\n\t\t\t\t\t\t\theader(\"Location: \".$link->getUrl());\r\n\t\t\t\t\t\t\texit;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//The address doesn't exist, or doesn't belong to this customer. Give them an unknown error\r\n\t\t\t\t\t\t\t$_SESSION['errors'][] = \"Your address could not be updated; An unknown error was encountered.\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//Inserting a new address\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t//First we'll check to make sure this address isn't already on the customer's account\r\n\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"SELECT COUNT(id) AS total FROM bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE cid = :cid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND company = :company\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND first_name = :first\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND last_name = :last\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND street_address = :address1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND suburb = :address2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND postcode = :zip\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND city = :city\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND state = :state\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND country = :country\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND phone = :phone\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND fax = :fax\");\r\n\t\t\t\t\t\t$sql->execute(array(\":cid\" => $_SESSION['CID'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":company\" => $formdata['company'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":first\" => $formdata['first'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":last\" => $formdata['last'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":address1\" => $formdata['address1'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":address2\" => $formdata['address2'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":zip\" => $formdata['zip'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":city\" => $formdata['city'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":state\" => $formdata['state'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":country\" => $formdata['country'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":phone\" => $formdata['phone'],\r\n\t\t\t\t\t\t\t\t\t\t\t\":fax\" => $formdata['fax']));\r\n\t\t\t\t\t\t$row = $sql->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t\t\t\t\t//Make sure this address is not already on the account\r\n\t\t\t\t\t\tif ($row['total'] <= 0 OR $row['total'] == NULL) {\r\n\t\t\t\t\t\t\t//If the customer is setting this as a default address, we first have to disable any other\r\n\t\t\t\t\t\t\t//defaults on their account of the same type\r\n\t\t\t\t\t\t\tif ($formdata['default_shipping'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_shipping = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif ($formdata['default_billing'] == 1) {\r\n\t\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"UPDATE bs_customer_addresses SET default_billing = 0 WHERE cid = ?\");\r\n\t\t\t\t\t\t\t\t$sql->execute(array($_SESSION['CID']));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t$sql = Connection::getHandle()->prepare(\"INSERT INTO bs_customer_addresses\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(public_id, cid, company, first_name, last_name,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstreet_address, suburb, postcode,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcity, state, country, phone, fax,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefault_shipping, default_billing)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(:public_id, :cid, :company, :first, :last,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:address1, :address2, :zip,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:city, :state, :country, :phone, :fax,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:default_shipping, :default_billing)\");\r\n\t\t\t\t\t\t\t$sql->execute(array(\":public_id\" => $this->getUniquePublicId(),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":cid\" => $_SESSION['CID'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":company\" => $formdata['company'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":first\" => $formdata['first'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":last\" => $formdata['last'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address1\" => $formdata['address1'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":address2\" => $formdata['address2'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":zip\" => $formdata['zip'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":city\" => $formdata['city'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":state\" => $formdata['state'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":country\" => $formdata['country'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":phone\" => $formdata['phone'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":fax\" => $formdata['fax'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_shipping\" => $formdata['default_shipping'],\r\n\t\t\t\t\t\t\t\t\t\t\t\t\":default_billing\" => $formdata['default_billing']));\r\n\r\n\t\t\t\t\t\t\t$_SESSION['successes'][] = \"Your address has successfully been added.\";\r\n\r\n\t\t\t\t\t\t\t//Redirect them\r\n\t\t\t\t\t\t\t$link = new Page('my-account');\r\n\t\t\t\t\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 302 Found', true, 302);\r\n\t\t\t\t\t\t\theader(\"Location: \".$link->getUrl());\r\n\t\t\t\t\t\t\texit;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t//This address already exists for this customer\r\n\t\t\t\t\t\t\t$_SESSION['errors'][] = \"This address already exists for your account.\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t//If there were validation errors\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tforeach($validate as $key => $error) {\r\n\t\t\t\t\t\t$_SESSION['errors'][] = $error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t//Otherwise, they are not a user and we have an unknown error\r\n\t\t\t} else {\r\n\r\n\t\t\t\t//Check if they were updating or adding, and throw an error depending\r\n\t\t\t\tif (!empty($formdata['address_id'])) {\r\n\t\t\t\t\t$_SESSION['errors'][] = \"Your address could not be updated; An unknown error was encountered.\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$_SESSION['errors'][] = \"Your address could not be added; An unknown error was encountered.\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$_SESSION['validate'] = $formdata;\r\n\r\n\t\t\tif (!empty($formdata['address_id'])) {\r\n\t\t\t\t$_SESSION['instructions'] = \"Please click \\\"Update Address\\\" again to fix the following errors. \";\r\n\t\t\t} else {\r\n\t\t\t\t$_SESSION['instructions'] = \"Please click \\\"Add An Address\\\" again to fix the following errors. \";\r\n\t\t\t}\r\n\r\n\t\t\t//Redirect them\r\n\t\t\t$link = new Page('my-account');\r\n\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 302 Found', true, 302);\r\n\t\t\theader(\"Location: \".$link->getUrl());\r\n\t\t\texit;\r\n\t\t}", "public function test_street_address_validation()\n {\n /*\n * Valid\n */\n $validStreetLocation = Location::factory()->make([\n 'streetAddress' => '123 Valid Address',\n ]);\n $validStreetData = $validStreetLocation->toArray();\n $response = $this->post($this->route(), $validStreetData);\n $response->assertStatus(201);\n\n /*\n * Invalid: missing\n */\n $missingStreetLocation = Location::factory()->make();\n $missingStreetData = $missingStreetLocation->toArray();\n unset($missingStreetData['streetAddress']);\n\n $response = $this->post($this->route(), $missingStreetData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.streetAddress', 'The street address field is required.');\n\n /**\n * Invalid: not a string\n */\n $nonStringLocation = Location::factory()->make([\n 'streetAddress' => ['invalid'],\n ]);\n $nonStringData = $nonStringLocation->toArray();\n\n $response = $this->post($this->route(), $nonStringData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.streetAddress', 'The street address must be a string.');\n }", "private function setPostalCode()\n {\n \tif ( ! isset( $_POST['postal_code'] ) ) {\n \t\t$this->data['error']['postal_code'] = 'Please provide your postal or zip code.';\n $this->error = true;\n return;\n }\n \n $pc = trim( $_POST['postal_code'] );\n\t\n \n // Make sure the country is set\n if ( ! isset( $this->data['country'] ) ) {\n $pc_obj = new PostalCode( $pc );\n if ( $pc_obj->isValid() ) {\n $this->data['postal_code'] = $pc_obj->get();\n return;\n }\n \n $zip_obj = new ZipCode( $pc );\n if ( $zip_obj->isValid() ) {\n $this->data['postal_code'] = $zip_obj->get();\n return;\n }\n }\n \n if ( $this->data['country'] == 'CA' ) {\n $pc_obj = new PostalCode( $pc );\n if ( ! $pc_obj->isValid() ) {\n\t\t\t\t$this->data['error']['postal_code'] = 'Please provide a valid postal code.';\n $this->error = true;\n return;\n }\n $this->data['postal_code'] = $pc_obj->get();\n }\n elseif ( $this->data['country'] == 'US' ) {\n $zip_obj = new ZipCode( $pc );\n if ( ! $zip_obj->isValid() ) {\n\t\t\t\t$this->data['error']['postal_code'] = 'Please provide a valid zip code.';\n $this->error = true;\n return;\n }\n $this->data['postal_code'] = $zip_obj->get();\n }\n }", "public function test_create_new_rural_address_with_no_station()\n {\n new Helpers\\EloquentHelper();\n\n $address = Models\\Address::create([\n 'type' => 'rural',\n 'name' => 'My Address',\n 'city' => 'Toronto',\n 'postal_code' => 'A1A1A1',\n 'province' => 'ON',\n 'country' => 'CA',\n 'rural_route' => 'RR 123',\n 'station' => ''\n ]);\n\n $error = $this->getValidationMessage('validation.required', [':attribute'=>'station'], 'en');\n\n $errors = new MessageBag;\n $errors->add('station', $error);\n\n $this->assertEquals($errors, $address->errors);\n }", "protected function validateRecipients(): void\n {\n if (count($this->recipients) == 0) {\n throw new IncorrectPhoneNumberFormatException();\n }\n foreach ($this->recipients as $recipient) {\n if (strstr($recipient, ' ') || strlen($recipient) < 10) {\n throw new IncorrectPhoneNumberFormatException();\n }\n }\n }", "function hasValidAddress()\n{\n return isset($_POST[\"address\"]) && isAddress($_POST[\"address\"]);\n}", "public function validate_account(){ \n\t\tif($this->data['Client']['account_holder'][0] != ''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validate_address( $address ) {\n\t\t// @codingStandardsIgnoreStart\n\t\treturn strlen( $address ) == 35\n\t\t\t&& ( $address[0] == 'D' || $address[0] == 'T' )\n\t\t\t&& $address[1] == 's';\n\t\t// @codingStandardsIgnoreEnd\n\t}", "public function setIgnoreValidation() {\r\n\t\t$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\r\n\t\t$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\r\n\t}", "private function setTelephone()\n {\n \tif ( empty($_POST['telephone'] ) ) {\n $this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n }\n\t\n $t = trim( $_POST['telephone'] );\n \n\t\t// Remove non-digits.\n\t\t$t = preg_replace('/[^0-9]/', '', $t);\n\t\n\t\t// Make sure it's 10 digits.\n\t\tif ( strlen($t) != 10 ) {\n\t\t\t$this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n\t\t}\n\t\n $this->data['telephone'] = $t;\n }", "public function verifyAndSetAddress($a,$bRequired) {\n\t\tif ($a['country'] != 'USA')\n\t\t\tthrow new exception(\"internation addresses not supported yet\");\n\t\t$this->country='USA';\t\t\n\t\t$this->line1 = isset($a['line1']) ? $a['line1'] : ''; \t\n\t\t$this->line2 = isset($a['line2']) ? $a['line2'] : ''; \t\n\t\t$this->city = isset($a['city']) ? $a['city'] : ''; \t\n\t\t$this->state = isset($a['state2']) ? $a['state2'] : ''; \t\n\t\t$this->zip = isset($a['zip']) ? $a['zip'] : ''; \t\n\t\t\t\n\t\tif ($this->line1 == '' && $this->line2 == '') {\n\t\t\tif ($bRequired || $this->city != '' || $this->zip != '')\n\t\t\t\treturn (array('*line1'=>'You must provide an address'));\n\t\t\telse {\n\t\t\t\t$this->city=$this->state=$this->zip='';\n\t\t\t\treturn True;\t\t// OK -- just no address\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$retval=array();\n\t\tif ($this->city == '')\n\t\t\t$retval['*city']='You must provide a city';\n\t\tif ($this->zip == '')\n\t\t\t$retval['*zip']='You must provide a ZIP code';\n\t\telse {\n\t\t\t$nmatches=preg_match('/^[\\\\d]{5}(-[\\\\d]{4})??$/',$this->zip);\n\t\t\tif (0 == $nmatches)\n\t\t\t\t$retval['*zip']=\"Invalid ZIP code\";\n\t\t}\t\n\t\treturn (sizeof($retval) != 0) ? $retval : True;\n\t}", "public function isAddressValid()\n {\n //TODO: consider does it make sense to have a special validation by country? how does the app handle different country addresses ?\n $addressValid = trim($this->Streetname1) != '' && trim($this->PostalCode) != '' && trim($this->City) != '' && trim($this->Country) != '' ;\n\n if (!$addressValid) {\n $this->errors[] = 'Invalid Shipping Address';\n }\n\n return $addressValid;\n }", "static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter valid data in all the fields, nothing can not be empty.\");\r\n }", "public function rules()\n {\n return [\n 'address_id' => \"required|numeric\",\n ];\n }", "function set_error() \n {\n $this->error_state = FORMEX_FIELD_ERROR;\n }", "public function validate_fields() {\n\n\t\t\t\t$phone = $this->sanatizePhone( $_POST['havanao_phone_number'] );\n\n\t\t\t\tif ( strlen( trim( preg_replace( '/^(\\+?250)\\d{9}/', '', $phone ) ) ) ) {\n\t\t\t\t\twc_add_notice( __( 'Invalid phone number provided. Please provide a valid Rwanda mobile phone number', 'havanao' ), 'error' );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function setAddress($data=null) {\n if(!is_array($data)) {\n $b = $this->getBilling();\n $p = $this->getPayment();\n $data = array(\n 'STREET' => $b['address'],\n 'STREET2' => $b['address2'],\n 'CITY' => $b['city'],\n 'STATE' => $b['state'],\n 'COUNTRYCODE' => $b['country'],\n 'ZIP' => $b['zip'],\n 'SHIPTOPHONENUM' => $p['phone']\n );\n }\n $this->_payerAddress = $data;\n }", "function my_custom_checkout_field_process() {\n // Check if set, if its not set add an error.\n if ( ! $_POST['billing_phone_new'] )\n wc_add_notice( __( 'Phone 2 is compulsory. Please enter a value' ), 'error' );\n}", "function validation($data){\n\tif (empty($data['name']))\n\t\treturn \"Please enter your name\";\n\tif (empty($data['tel']))\n\t\treturn \"Please enter valid contact number\";\n\treturn 0;\n}", "public function validateEmptyLengow($fieldName)\n {\n switch ($fieldName) {\n case 'lastname':\n case 'firstname':\n if ($fieldName === 'lastname') {\n $fieldName = 'firstname';\n } else {\n $fieldName = 'lastname';\n }\n $names = LengowAddress::extractNames($this->{$fieldName});\n $this->firstname = $names['firstname'];\n $this->lastname = $names['lastname'];\n // check full name if last_name and first_name are empty\n if (empty($this->firstname) && empty($this->lastname)) {\n $names = LengowAddress::extractNames($this->fullName);\n }\n $this->firstname = $names['firstname'];\n $this->lastname = $names['lastname'];\n if (empty($this->firstname)) {\n $this->firstname = '--';\n }\n if (empty($this->lastname)) {\n $this->lastname = '--';\n }\n break;\n case '':\n break;\n default:\n return;\n }\n }", "public function testSetWithBankingCustomerIdInvalidParameter()\n {\n $this->slipData->setWithBankingCustomerId(1);\n }", "public function validate()\n {\n $errors = parent::validate();\n\n $transport = new Varien_Object();\n $transport->setErrors( $errors );\n $transport->setAddress( $this );\n\n Mage::dispatchEvent('customer_address_validation_errors', array('transport' => $transport ));\n\n $errors = $transport->getErrors();\n\n if ($errors === true || empty($errors))\n { // no errors: be true\n return true;\n }\n\n return $errors;\n }", "function addUserAddress() {\n $this->load->model('Usermodel');\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->load->helper('string');\n $this->load->library('encrypt');\n $this->load->library('parser');\n $this->load->library('email');\n\n $this->form_validation->set_rules('address', 'Address', 'trim|required');\n $this->form_validation->set_rules('city', 'City', 'trim|required');\n $this->form_validation->set_rules('county', 'County', 'trim|required');\n $this->form_validation->set_rules('postcode', 'Postcode', 'trim|required');\n $this->form_validation->set_rules('phone', 'Phone', 'trim|required');\n\n if ($this->form_validation->run($this) == FALSE) {\n\n $errors = array();\n // Loop through $_POST and get the keys\n foreach ($this->input->post() as $key => $value) {\n // Add the error message for this field\n $errors[$key] = form_error($key);\n }\n\n //$response = array_filter($errors); // Some might be empty\n $response = $errors;\n $json_arr = array('response' => 'false', 'customerror' => $response, 'msg' => validation_errors());\n echo json_encode($json_arr);\n exit;\n } else {\n $insertId = $this->Usermodel->insertAddressRecord();\n $html = \"\";\n echo json_encode(array('response' => 'true', 'msg' => 'Done', 'html' => $html));\n }\n }", "public function validate() {\n\n\t\tif ($this->getPrimaryAccountNumber() === null) {\n\t\t\tthrow new ValidationException(\"'primaryAccountNumber' can't be null\", 'primaryAccountNumber', $this);\n\t\t}\n\t}", "function give_donation_form_validate_cc() {\n\n\t$card_data = give_get_donation_cc_info();\n\n\t// Validate the card zip.\n\tif ( ! empty( $card_data['card_zip'] ) ) {\n\t\tif ( ! give_donation_form_validate_cc_zip( $card_data['card_zip'], $card_data['card_country'] ) ) {\n\t\t\tgive_set_error( 'invalid_cc_zip', __( 'The zip / postal code you entered for your billing address is invalid.', 'give' ) );\n\t\t}\n\t}\n\n\t// Ensure no spaces.\n\tif ( ! empty( $card_data['card_number'] ) ) {\n\t\t$card_data['card_number'] = str_replace( '+', '', $card_data['card_number'] ); // no \"+\" signs.\n\t\t$card_data['card_number'] = str_replace( ' ', '', $card_data['card_number'] ); // No spaces.\n\t}\n\n\t// This should validate card numbers at some point too.\n\treturn $card_data;\n}", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "function buzzer_sms_number_validate($element, &$form_state, $form) {\n if ($number = twilio_validate_number($element['#value'], TRUE)) {\n $form_state['values']['buzzer_sms_number'] = $number;\n }\n else {\n form_error($element, t('You must enter a valid 10 digit phone number'));\n }\n}", "function checkEmptyFields($custInfo) { \n $errorMessageIfEmpty = array(\n \"CustFirstName\" => \"First name is empty\",\n \"CustLastName\" => \"Last name is empty\",\n \"CustAddress\" => \"Address is required\",\n \"CustCity\" => \"City field is empty\",\n \"CustProv\" => \"Province field is empty\",\n \"CustPostal\" => \"Postal Code is empty\",\n \"CustCountry\" => \"Country field is empty\",\n \"CustHomePhone\" => \"Home phone number is required\",\n \"CustBusPhone\" => \"Bus/Cell phone number is required\",\n \"CustEmail\" => \"Please enter your email\",\n \"username\" => \"Username field is empty\",\n \"password\" => \"Password field is empty\"\n );\n \n $actualErrors = array();\n \n foreach($custInfo as $key => $value) {\n if(array_key_exists($key, $errorMessageIfEmpty)) {\n if(trim($value) == \"\") {\n $actualErrors[$key] = $errorMessageIfEmpty[$key];\n } \n }\n } \n return $actualErrors;\n }", "function bbloomer_validate_name_fields( $errors, $username, $email ) {\r\n if ( isset( $_POST['billing_first_name'] ) && empty( $_POST['billing_first_name'] ) ) {\r\n $errors->add( 'billing_first_name_error', __( '<strong>Error</strong>: First name is required!', 'woocommerce' ) );\r\n }\r\n if ( isset( $_POST['billing_last_name'] ) && empty( $_POST['billing_last_name'] ) ) {\r\n $errors->add( 'billing_last_name_error', __( '<strong>Error</strong>: Last name is required!.', 'woocommerce' ) );\r\n }\r\n return $errors;\r\n}", "public function validate_contact(){\n\t\t$er_flag = true;\t\t\n\t\tfor($i = 0; $i < $this->request->data['Client']['contact_count']; $i++){\n\t\t\tif($this->request->data['Client']['first_name_'.$i] == ''){\n\t\t\t\t$error[$i]['fname'] = 'Please enter the first name';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['mobile_'.$i] == ''){\n\t\t\t\t$error[$i]['mobile'] = 'Please enter the mobile';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\t$mobile = $this->request->data['Client']['mobile_'.$i];\n\t\t\tif(!is_numeric($mobile)){\n\t\t\t\t$error[$i]['mobile'] = 'Please enter the numeric only';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif(strlen($mobile) < 10){\n\t\t\t\t$error[$i]['mobile'] = 'Mobile no. must be min. 10 digits';\n\t\t\t\t$er_flag = false;\n\t\t\t}\t\t\t\t\t\t\n\t\t\tif($this->request->data['Client']['email_'.$i] == ''){\n\t\t\t\t$error[$i]['email'] = 'Please enter the email address';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\t// validate email\n\t\t\tif($this->Functions->email_validation($this->request->data['Client']['email_'.$i])){\n\t\t\t\t$error[$i]['email'] = 'Please enter valid email address';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['title_'.$i] == ''){\n\t\t\t\t$error[$i]['title'] = 'Please select the title';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['designation_'.$i] == ''){\n\t\t\t\t$error[$i]['designation'] = 'Please select the designation';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t\tif($this->request->data['Client']['branch_'.$i] == ''){\n\t\t\t\t$error[$i]['branch'] = 'Please select the branch';\n\t\t\t\t$er_flag = false;\n\t\t\t}\n\t\t}\n\t\t$this->set('errorData', $error);\n\t\treturn $er_flag;\n\t}", "public function testDebtorSavePhoneNumberEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => 'cvmm121@gmail.com',\n 'cpf_cnpj' => '1234567890',\n 'birthdate' => '12/01/1994',\n 'phone_number' => '',\n 'zipcode' => '99999-999',\n 'address' => 'Rua Teste',\n 'number' => '25',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }", "public function validate()\n {\n if (empty($this->schemeID)) {\n ISO6523ICD::verify($this->schemeID);\n }\n\n if ($this->address === null) {\n throw new \\InvalidArgumentException(\"Element 'cac:Address' MUST be provided\");\n }\n }", "protected function validate()\n {\n if ($this->primary_first_name == '') {\n $this->errors[] = 'First name is required';\n }\n if ($this->primary_last_name == '') {\n $this->errors[] = 'Last Name is required';\n }\n\n if ($this->email == '') {\n $this->errors[] = 'Email is required';\n }\n\n if ($this->phone_number == '') {\n $this->errors[] = 'Phone Number is required';\n }\n\n if ($this->city == '') {\n $this->errors[] = 'City is required';\n }\n\n if ($this->state == '') {\n $this->errors[] = 'State is required';\n }\n\n if ($this->zip_code == '') {\n $this->errors[] = 'Zip Code is required';\n }\n\n if ($this->application_date == '') {\n $this->errors[] = 'Application Date is required';\n }\n\n return empty($this->errors);\n}", "public static function saveAddress($data)\n {\n $msgValidate = [];\n $rule = [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email',\n 'phone' => 'required|numeric',\n 'address' => 'required'\n ];\n $validateRs = Frontend::validateForm($data, $rule, $msgValidate);\n if ($validateRs['rs'] == System::FAIL) {\n return $validateRs;\n } else {\n return self::doSaveAddress($data);\n }\n }", "function check()\n {\n if (trim($this->monto) == '') {\n $this->setError(JText::_('Debe Ingresar Un Monto a Pagar'));\n return false;\n }\n\n return true;\n }", "function wc_elshaddai_bfield( $fields ) {\n $fields['billing_number']['maxlength'] = 5;\n $fields['billing_address_2']['maxlength'] = 30;\n $fields['billing_address_2']['label_class'] = array('');\n $fields['billing_neighborhood']['required'] = true;\n return $fields;}", "private function check_is_empty($excel) {\n $error_msg = '';\n if (empty($excel['taxcode']))\n $error_msg .= 'Employee Taxcode Required.';\n if (empty($excel['enrollment_type'])) {\n $error_msg .= 'Enrollment Type Required.';\n } else {\n if (($excel['enrollment_type'] != 'FIRST')) {\n if ($excel['enrollment_type'] != 'RETAKE') {\n $error_msg .='Invalid Enrollment Type';\n }\n }\n }\n if ($excel['enrollment_type'] == 'RETAKE') {\n if (empty($excel['enrol_retake_pay_mode'])) {\n $error_msg .= 'Enrollment Type being RE-TAKE, Mode of Payment is required.';\n } else {\n if ($excel['enrol_retake_pay_mode'] != 'REQUIRED') {\n if ($excel['enrol_retake_pay_mode'] != 'BYPASS') {\n $error_msg .='Invalid Re-take Payment Mode.';\n }\n }\n }\n }\n if (!empty($excel['subsidy_amount'])) {\n if (!is_numeric($excel['subsidy_amount'])) {\n $error_msg .= 'Invalid Subsidy Amount.';\n } else {\n if (empty($excel['subsidy_recd_on'])) {\n $error_msg .= 'Subsidy recd. on date required, as subsidy amount is present.';\n } else {\n if (strtotime($excel['subsidy_recd_on']) === FALSE) {\n $error_msg .= 'Invalid Subsidy Received on Date Format.';\n }\n }\n }\n }\n return $error_msg;\n }", "public function isAddressSpecified(): bool\n {\n return ($this->getAddressZip() && $this->getAddressCity() && $this->getAddressCountry());\n }", "public function normalizeData()\n {\n if (is_numeric($this->Streetname2)) {\n $this->HouseNumber = $this->Streetname2;\n $this->Streetname2 = \"\";\n }\n\n// Sometimes people will input - To mean Idfk why are you asking me to input this?\n if ($this->Phone && strlen($this->Phone) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid Phone [$this->Phone] ignoring\"));\n $this->Phone = '';\n }\n\n if ($this->State && strlen($this->State) < 2) {\n $this->addMessage($this->getFormatedMessage(\"Invalid State [$this->State] ignoring\"));\n $this->State = '';\n }\n\n if ($this->CompanyName && strlen($this->CompanyName) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid CompanyName[$this->CompanyName] ignoring \"));\n $this->CompanyName = '';\n }\n\n $this->Description = $this->escapeTextData($this->Description);\n if ($this->Description && strlen($this->Description) > 255) {\n $this->Description = substr($this->Description, 0, 255);\n\n //Make sure we are not sending a broken special char\n $descChars = str_split($this->Description); \n for ($i = 254; $i > 251; --$i) {\n if ($descChars[$i] == '&') {\n $this->Description = substr($this->Description, 0, $i);\n }\n }\n }\n\n if($this->Description && strlen($this->Description) < 3) {\n $this->addMessage($this->getFormatedMessage(\"Invalid description $this->Description ignoring \"));\n $this->Description = ''; \n }\n }", "function setAddressValidation() {\n $ci = &get_instance();\n $ci->load->library('form_validation');\n //$ci->form_validation->set_error_delimiters('<p>', '</p>');\n $ci->form_validation->set_rules(\"firstName\", \"First Name\", \"required\");\n $ci->form_validation->set_rules(\"lastName\", \"Last Name\", \"required\");\n $ci->form_validation->set_rules(\"addressLine1\", \"Address Line 1\", \"required\");\n $ci->form_validation->set_rules(\"addressLine2\", \"Address Line 2\", \"\");\n $ci->form_validation->set_rules(\"country\", \"Country\", \"required\");\n $ci->form_validation->set_rules(\"city\", \"City\", \"required\");\n $ci->form_validation->set_rules(\"postcode\", \"Postcode\", \"required\");\n $ci->form_validation->set_rules(\"phone\", \"Phone\", \"required\");\n}", "function fn_validate_cc_number($number, $show_error = false)\n{\n if (empty($number)) {\n return false;\n }\n\n $number = str_replace(array('-',' '), '', $number);\n\n if (preg_match('/^([?0-9]{13,19}|[?*\\d]+)$/', $number)) {\n return true;\n } elseif ($show_error) {\n fn_set_notification('E', __('error'), __('text_not_valid_cc_number', array(\n '[cc_number]' => $number\n )));\n }\n\n return false;\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 }", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "public function checkAddress($address)\n\t\t{\n\t\t\t$address = strip_tags($address);\n\t\t\t\n\t\t\t$this->groestlcoin->validateaddress($address);\n\t\t\t\n\t\t\tif ($this->groestlcoin->response['result']['isvalid'] == 1){\n\t\t\t\treturn 1;}\n\t\t\telse{\n\t\t\t\treturn 0;}\t\t\t\n\t\t}", "private function isTelephoneRequired()\n {\n return $this->eavConfig->getAttribute('customer_address', 'telephone')->getIsRequired();\n }", "function formErrorCheck( $fields ) {\n\t\n\t$array = get_option( 'resume_input_fields' );\n\n\tforeach ( $array as $item => $key) {\n\t\t\n\t\tswitch($item){\n\t\t\tcase 'fname':\n\t\t\t\t\t\tif ( !$fields['fname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'lname':\n\t\t\t\t\t\tif ( !$fields['lname'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address':\n\t\t\t\t\t\tif ( !$fields['address'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'address2':\n\t\t\t\t\t\tif ( !$fields['address2'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'city':\n\t\t\t\t\t\tif ( !$fields['city'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'state':\n\t\t\t\t\t\tif ( !$fields['state'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'zip':\n\t\t\t\t\t\tif ( !$fields['zip'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'pnumber':\n\t\t\t\t\t\tif ( ( !$fields['pnumber'] || !$fields['pnumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'snumber':\n\t\t\t\t\t\tif ( ( !$fields['snumber'] || !$fields['snumbertype'] ) && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\t\t\tif ( !$fields['email'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'attachment':\n\t\t\t\t\t\tif ( !$fields['attachment'][0]['name'][0] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'cover':\n\t\t\t\t\t\tif ( !$fields['cover'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t\tcase 'resume':\n\t\t\t\t\t\tif ( !$fields['resume'] && $key[1] == 1 )\n\t\t\t\t\t\t\t$error = true;\n\t\t\t\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\t\n\treturn $error;\t\n}", "public function addAddress() {\n $request=new request();\n $email_id=request::input('email_id');\n $address_name=request::input('address_name');\n $address=request::input('address');\n $is_default = request::input('is_default') ? request::input('is_default') : 0;\n \n $validation_rules = array();\n $validation_rules['email_id'] = 'required';\n $validation_rules['address_name'] = 'required';\n $validation_rules['address'] = 'required';\n //$validation_rules['is_default'] = 'required';\n\n $validator = Validator::make($request::all(), $validation_rules);\n if ($validator->fails()) {\n $response['status'] = 406 ;\n $response['message'] = $validator->messages()->first();\n return json_encode($response) ;\n } else {\n $user_info = DB::table('users')->where('email' , $email_id)->first();\n //dd($user_id);\n if(!empty($user_info)) {\n $last_address_id = DB::table('address')->insertGetId(['customer_id'=>$user_info->id,'address_name' => $address_name, 'address' => $address, 'is_default' => $is_default]);\n if($last_address_id) {\n $response['status'] = 200;\n $response['message'] = \"Your address save successfully.\";\n $response['address'] = DB::table('address')->where(['customer_id' => $user_info->id, 'id' => $last_address_id])->first();\n } else {\n $response['status'] = 406 ;\n $response['message'] = 'Unable to save address, Please try again.';\n }\n return json_encode($response);\n } else {\n $response['status'] = 406 ;\n $response['message'] = 'Please enter valid email.';\n return json_encode($response) ;\n\n }\n \n }\n \n }", "public function require_refund_address() {\n\t\treturn $this->show_refund_address() && $this->get_option( 'refund_address_optional', 'yes' ) == 'no';\n\t}", "public function setStreet($street = \"\");", "function validateHomePhoneNumber($string){\n\tif($string == '') {return '';}\n\tif(!preg_match(\"/^\\d{10}$/\", $string)){\n\t\treturn 'Home phone number is invalid </br>';\n\t}\n\treturn '';\n}", "public function set_address_1( $address ) {\n\t\t$this->set_prop( 'address_1', $address );\n\t}", "function vcn_findwork_common_validation($form, &$form_state) {\r\n\t$search_text_val = trim($form_state['input']['search_by_job_title']);\r\n\t$zipcode_val = trim($form_state['input']['zipcode']);\r\n\r\n\tif (!empty($zipcode_val)) {\r\n\t\t$zipcode_data = vcn_rest_wrapper('vcnlocationsvc', 'vcnlocation', 'get-location', array('zipcode' => $zipcode_val), 'json', 'post', false);\r\n\t\tif (empty($zipcode_data->location)) {\r\n\t\t\tform_set_error('zipcode', t('Please enter a valid US ZIP Code.'));\r\n\t\t}\r\n\t}\r\n\r\n\tif (empty($form['careers']['#value']) && empty($search_text_val)) {\r\n\t\tform_set_error('', t('Please enter a search term OR select a career from the list.'));\r\n\t\tform_set_error('careers');\r\n\t\tform_set_error('search_by_job_title');\r\n\t}\r\n}", "public function validate(){\n\t\tif($this->address instanceof AddressObject){\n\t\t\t$this->validate1();\n\t\t}else{\n\t\t\t$this->exception = new InvalidParameterException('Address',\"Address Object\");\n\t\t}\n\t\treturn $this->exception;\n\t}", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "public function testThrowExceptionOnInvalidLitecoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::LITECOIN);\n }", "function _validateAddress($address)\n {\n $is_group = false;\n $addresses = array();\n\n if ($address['group']) {\n $is_group = true;\n\n // Get the group part of the name\n $parts = explode(':', $address['address']);\n $groupname = $this->_splitCheck($parts, ':');\n $structure = array();\n\n // And validate the group part of the name.\n if (!$this->_validatePhrase($groupname)){\n $this->error = 'Group name did not validate.';\n return false;\n } else {\n // Don't include groups if we are not nesting\n // them. This avoids returning invalid addresses.\n if ($this->nestGroups) {\n $structure = new stdClass;\n $structure->groupname = $groupname;\n }\n }\n\n $address['address'] = ltrim(substr($address['address'], strlen($groupname . ':')));\n }\n\n // If a group then split on comma and put into an array.\n // Otherwise, Just put the whole address in an array.\n if ($is_group) {\n while (strlen($address['address']) > 0) {\n $parts = explode(',', $address['address']);\n $addresses[] = $this->_splitCheck($parts, ',');\n $address['address'] = trim(substr($address['address'], strlen(end($addresses) . ',')));\n }\n } else {\n $addresses[] = $address['address'];\n }\n\n // Check that $addresses is set, if address like this:\n // Groupname:;\n // Then errors were appearing.\n if (!count($addresses)){\n $this->error = 'Empty group.';\n return false;\n }\n\n // Trim the whitespace from all of the address strings.\n array_map('trim', $addresses);\n\n // Validate each mailbox.\n // Format could be one of: name <geezer@domain.com>\n // geezer@domain.com\n // geezer\n // ... or any other format valid by RFC 822.\n for ($i = 0; $i < count($addresses); $i++) {\n if (!$this->validateMailbox($addresses[$i])) {\n if (empty($this->error)) {\n $this->error = 'Validation failed for: ' . $addresses[$i];\n }\n return false;\n }\n }\n\n // Nested format\n if ($this->nestGroups) {\n if ($is_group) {\n $structure->addresses = $addresses;\n } else {\n $structure = $addresses[0];\n }\n\n // Flat format\n } else {\n if ($is_group) {\n $structure = array_merge($structure, $addresses);\n } else {\n $structure = $addresses;\n }\n }\n\n return $structure;\n }", "function form_check() {\n\tglobal $dbh, $cust_cpns_tbl;\n\t\n\t// required fields array\n\t$required_fields = array(\n\t\t\t\t\t\t\t'Code'=> $cust_cpns_tbl->code,\n\t\t\t\t\t\t\t'Value'=> $cust_cpns_tbl->value,\n\t\t\t\t\t\t\t'Expires'=> $cust_cpns_tbl->expires\n\t\t\t\t\t\t\t);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n\tif ($cust_cpns_tbl->existing_code_check() > 0) {\n\t $error_message .= '<center>Coupon code already assigned. Please enter another.</center>'.LB;\n\t}\n\t\n return $error_message;\n }", "static function checkAddress($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d,][\\W\\w\\d\\s,]{1,40}$/', $input)) {\r\n return true; //Illegal Character found!\r\n }\r\n else{\r\n echo PageBuilder::printError(\"Please enter alphabets and numbers with comma seperation, maximum of 40 characters.\");\r\n return false;\r\n }\r\n }", "public function test_create_new_rural_address_with_no_rural_route()\n {\n new Helpers\\EloquentHelper();\n\n $address = Models\\Address::create([\n 'type' => 'rural',\n 'name' => 'My Address',\n 'city' => 'Toronto',\n 'postal_code' => 'A1A1A1',\n 'province' => 'ON',\n 'country' => 'CA',\n 'rural_route' => '',\n 'station' => 'STN A'\n ]);\n\n $error = $this->getValidationMessage('validation.required', [':attribute'=>'rural route'], 'en');\n\n $errors = new MessageBag;\n $errors->add('rural_route', $error);\n\n $this->assertEquals($errors, $address->errors);\n }", "public function testFormCityMissingAddressVisible() {\n $form = new RedirectForm();\n $form_state = [];\n $payment = $this->mockPayment([\n 'firstname' => 'First',\n 'lastname' => 'Last',\n 'address1' => 'Address1',\n 'postcode' => 'TEST',\n 'country' => 'GB',\n ]);\n $element = $form->form([], $form_state, $payment);\n $pd = $element['personal_data'];\n $pd['address'] += ['#access' => TRUE];\n $this->assertTrue($pd['address']['#access']);\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "function insert_address($street_no, $street_name, $street_direct_code, $city, $postal_code, $country_code,\n $province_code, $misc_addr_line, $addr_tel_no, $addr_email, \n $latitude=NULL, $longitude=NULL) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"INSERT INTO address\n\t\t\t\t (street_no, street_name, street_direct_code, city, postal_code, country_code,\n province_code, misc_addr_line, addr_tel_no, addr_email, \n latitude, longitude) \n\t\t\t\tVALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\n\t\t$stmt->bind_param(\"isssssssssdd\", $street_no, $street_name, $street_direct_code, $city, $postal_code, $country_code,\n $province_code, $misc_addr_line, $addr_tel_no, $addr_email, \n $latitude, $longitude);\n\t\t$stmt->execute();\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error inserting address: \" . $street_no . \" \" . $street_name . \" \" . $street_direct_code\n\t\t . \" \" . $city . \" \" . $postal_code . \" \" . $country_code . \" \" \n . $province_code . \" \" . $misc_addr_line . \"tel: \" . $addr_tel_no . \" \" . $addr_email \n . \" position: \" . $latitude . \" \" . $longitude;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\t$errArr[ERR_INSERT_ID] = $cxn->insert_id;\n\treturn $errArr;\n}", "protected function validateAttribute($object,$attribute) {\n\t\tparent::validateAttribute($object, $attribute);\n\n\t\t$value = $object->$attribute;\n\t\tif(!preg_match($this->ausTelPattern, $value)) {\n\t\t\t// Not a valid Australian Telephone Number\n\t\t\t$message=$this->message!==null?$this->message:\\Yii::t('yii','{attribute} is not a valid Australian telephone number.');\n\t\t\t$this->addError($object,$attribute,$message);\n\t\t} else {\n\t\t\t// Passed valid number test, now make it look right\n\t\t\t// If it has 61 - replace with 0\n\t\t\t$value = preg_replace('/61/', '0', $value);\n\t\t\t// If there are not space add spaces as follows:\n\t\t\t// 04xx xxx xxx\n\t\t\t// 08 xxxx xxxx\n\t\t\tif(preg_match('/^04/', $value)) {\n\t\t\t\t$value = substr($value, 0, 4).' '.substr($value, 4, 3).' '.substr($value, 7);\n\t\t\t}\n\t\t\tif(preg_match('/^0[^4]/', $value)) {\n\t\t\t\t$value = substr($value, 0, 2).' '.substr($value, 2, 4).' '.substr($value, 6);\n\t\t\t}\n\t\t\t$object->value = $value;\n\t\t}\n\t}", "public function testDebtorSaveNumberEmpty()\n {\n $aDados = [\n 'name' => 'Carlos Vinicius',\n 'email' => 'cvmm121@gmail.com',\n 'cpf_cnpj' => '1234567890',\n 'birthdate' => '12/01/1994',\n 'phone_number' => '(79) 9 9999-9999',\n 'zipcode' => '99999-999',\n 'address' => 'Rua Teste',\n 'number' => '',\n 'complement' => 'Conjunto Teste 2',\n 'neighborhood' => 'Bairro Teste 2',\n 'city' => 'Aracaju',\n 'state' => 'SE'\n ];\n\n $this->expectException(InvalidAttributeException::class);\n $oDebtor = Debtor::createFromRequest($aDados);\n }", "function validate_not_empty($field_input, &$field) {\r\n if ($field_input === '') {\r\n $field['error'] = 'Laukas negali b?ti tuš?ias!';\r\n } else {\r\n return true;\r\n }\r\n}", "protected function setErrorsExist() {}", "public function checkForErrors()\n {\n if ($this->getDebtor() == '' && $this->getDebtorCode() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Debtor or DebtorCode must be defined')\n );\n }\n\n if ($this->getDomain() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Domain must be defined')\n );\n }\n\n if ($this->getTld() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Tld must be defined')\n );\n }\n }", "public function dp_saveaddress($data)\n {\n return $this->call('dp_saveaddress', static::prepareParams($data, [\n 'address_id' => ['numeric'], // Enter 0 in this field to create a new address value or the address_id number of an existing address_id to update the existing value\n 'donor_id' => ['numeric'], // Specify the donor_id of the donor associated with this\n 'opt_line' => ['string', 100], // Enter a secondary name or company name if appropriate\n 'address' => ['string', 100], //\n 'address2' => ['string', 100], //\n 'city' => ['string', 50], //\n 'state' => ['string', 30], //\n 'zip' => ['string', 20], //\n 'country' => ['string', 30], //\n 'address_type' => ['string', 30], // Enter the CODE value associated with the address type\n 'getmail' => ['string', 1], // Enter 'Y' or 'N' to indicate whether the Receive Mail box will be checked and to indicate whether mail can be sent to this address.\n 'user_id' => $this->appName,\n 'title' => ['string', 50], // Enter a value to be stored in the Professional Title field.\n 'first_name' => ['string', 50], //\n 'middle_name' => ['string', 50], //\n 'last_name' => ['string', 75], //\n 'suffix' => ['string', 50], //\n 'prof_title' => ['string', 100], //\n 'salutation' => ['string', 130], // Enter desired salutation value (e.g.; 'Dear Bob')\n 'seasonal_from_date' => ['string', 4], // Enter the 'from' date as MMYY – e.g; November 2017 would be represented as 1117\n 'seasonal_to_date' => ['string', 4], // Enter the 'to' date as MMYY\n 'email' => ['string', 75], //\n 'home_phone' => ['string', 40], //\n 'business_phone' => ['string', 40], //\n 'fax_phone' => ['string', 40], //\n 'mobile_phone' => ['string', 40], //\n 'address3' => ['string', 100], //\n 'address4' => ['string', 100], //\n 'ukcountry' => ['string', 100], //\n 'org_rec' => ['string', 1], // Enter 'Y' to check the Org Rec field (indicating an organizational record) or 'N' to leave it unchecked to indicate an individual record.\n ]));\n }", "public function setAddress1($fv_address1)\n {\n \tif(!empty($fv_address1))\n \t{\n \t\treturn $this->fv_address1 = $fv_address1;\n \t}\n $this->fv_error_message = $this->fv_error_message .'<br> - Direccion 1 '.ERROR_NULL;\n\n return $this->fv_address1 = null;\n }", "public function test_phone_returns_true_when_not_optional_input_phone_10_area_bracket() {\n\t\t$optional = false;\n\t\t$result = self::$validator->validate('(555)555-5555', $optional);\n\t\t$this->assertTrue( $result );\n\t}", "public function validateaddress($address){\n return $this->bitcoin->validateaddress($address);\n }", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function testGetInvalidLocationByLocationStreetOne() {\n\t\t// grab a location by searching for street one that does not exist\n\t\t$location = Location::getLocationByLocationStreetOne($this->getPDO(), \"That's a ghost street\");\n\t\t$this->assertCount(0, $location);\n\t}", "public function testExceptionEmptyPhoneme(){\n\t\t\t$app = new App();\n\t\t\t$phoneme = $app->getIPA('');\n\t\t}", "public function accountDetailsNotFilledIn()\n {\n return (empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_host'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_user'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_pass'))\n || empty(Mage::getStoreConfig('easywebshopsms/api_connection/api_port'))\n );\n }", "public function testThrowExceptionOnInvalidDashAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::DASH);\n }", "function form_check() {\n\tglobal $cert_amt_tbl;\n\t\n\t// required fields array\n\t$required_fields = array('Discount Amount'=> $cert_amt_tbl->discount_amount);\n\t\t\n\t// check error values and write error array\t\t\t\t\t\n\tforeach($required_fields as $field_name => $output) {\n\t if (empty($output)) {\n\t\t$errors_array[] = $field_name;\n\t }\n\t}\n\t\n\tif (!empty($errors_array)) {\n\t $error_message = 'You did not supply a value for these fields: ' . implode(', ',$errors_array);\n\t}\n\t\n return $error_message;\n }", "protected function _getErrorNumber()\n {\n return '';\n }" ]
[ "0.65552855", "0.63820225", "0.6099923", "0.60623604", "0.5941438", "0.5800598", "0.5670589", "0.5668923", "0.5650228", "0.55958664", "0.55885977", "0.5572066", "0.5565277", "0.55591214", "0.55105764", "0.55084443", "0.549751", "0.54549813", "0.54325384", "0.53975725", "0.5396121", "0.5395223", "0.5389485", "0.537877", "0.53738385", "0.53527194", "0.53396904", "0.5338271", "0.5302082", "0.5282523", "0.52790827", "0.5269873", "0.5266397", "0.5258571", "0.5257943", "0.52563894", "0.5246443", "0.5227114", "0.51829296", "0.5179614", "0.5175907", "0.5170337", "0.5163776", "0.5141324", "0.5126724", "0.5125507", "0.5123495", "0.51059395", "0.51022094", "0.5098502", "0.507393", "0.5071733", "0.5065305", "0.50641465", "0.50588006", "0.5058172", "0.5049769", "0.50465024", "0.50457376", "0.5042937", "0.5037721", "0.5034456", "0.5027528", "0.5025815", "0.50191706", "0.5016969", "0.50150114", "0.50145096", "0.5012496", "0.50120085", "0.5005033", "0.50029564", "0.49973089", "0.49969745", "0.49965972", "0.4990209", "0.4989511", "0.4988251", "0.49843234", "0.4973619", "0.4970671", "0.4967532", "0.4967532", "0.49673346", "0.4966509", "0.4964221", "0.4960738", "0.4959881", "0.49598482", "0.49578488", "0.4954774", "0.49540207", "0.4950197", "0.49496645", "0.49477455", "0.49473384", "0.49470463", "0.49467885", "0.49439046", "0.49420252" ]
0.5433538
18
Store the custom field data into EDD's payment meta
function getfaircoin_edd_store_custom_fields( $payment_meta ) { $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? sanitize_text_field( $_POST['edd_fairsaving'] ) : '0'; $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? sanitize_text_field( $_POST['edd_fairaddress'] ) : ''; return $payment_meta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function save_paypal_meta_data()\n {\n $postMeta = [\n 'payer_email' => 'Payer PayPal address',\n 'first_name' => 'Payer first name',\n 'last_name' => 'Payer last name',\n 'payment_type' => 'Payment type',\n ];\n\n foreach ($postMeta as $key => $name) {\n $value = wc_clean($this->request->get($key, FILTER_DEFAULT));\n $value and update_post_meta($this->order->get_id(), $name, $value);\n }\n }", "function pp_rcp_store_payment_meta( $payment, $payment_data ) {\n\n\t// store meta\n\tif ( EDD()->session->get( 'came_from_rcp' ) ) {\n\t\tupdate_post_meta( $payment, '_edd_payment_from_rcp', true );\n\t}\n\n}", "protected function save_meta() {}", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }", "protected function save_paypal_meta_data( $order, $posted ) {\n }", "private function set_metafile_fields(){\n\n\t\t\t// add more fields for your requierements\n $custom_fields = array( \n\t\t\t\t'field_name1'\t=> __( 'field name 1', self::$plugin_obj->class_name ),\n\t\t\t\t'field_name2'\t=> __( 'field name 2', self::$plugin_obj->class_name ),\n\t\t\t\t'field_name3'\t=> __( 'field name 3', self::$plugin_obj->class_name ),\n\t\t\t );\n\n\n foreach( $custom_fields as $custom_attrname => $custom_value){\n self::$metafile_fields->$custom_attrname = $custom_value;\n } \n\n }", "function give_stripe_custom_payment_meta( $charge_args ) {\n\n\t// Sanitize the input posted data to the form.\n\t$posted_data = give_clean( filter_input_array( INPUT_POST ) );\n\n\t// Prepare metadata fields list.\n\t$custom_meta_fields = array(\n\t\t'Text Field' => ! empty( $posted_data['text_field'] ) ? $posted_data['text_field'] : 'undefined',\n\t\t'Dropdown Field' => ! empty( $posted_data['dropdown_field'] ) ? $posted_data['dropdown_field'][0] : 'undefined',\n\t\t'Donor Comment' => ! empty( $posted_data['give_comment'] ) ? $posted_data['give_comment'] : '',\n\t);\n\t$charge_args['metadata'] = array_merge( $charge_args['metadata'], $custom_meta_fields );\n\n\treturn $charge_args;\n}", "protected function addOrderCustomFields(): void\n {\n $custom_field_set_id = md5('Viacash custom_field_set');\n\n $this->container->get('custom_field_set.repository')->upsert(\n [\n [\n 'id' => $custom_field_set_id,\n 'name' => 'custom_viacash',\n 'config' => [\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Viacash\", \"en-GB\" => \"Viacash\"]),\n \"translated\" => true\n ],\n 'active' => true,\n 'global' => false,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field_set_relation.repository')->upsert(\n [\n [\n 'id' => md5('Viacash custom_field_set_relation'),\n 'customFieldSetId' => $custom_field_set_id,\n 'entityName' => 'order',\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_checkout_token'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_checkout_token',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Checkout-Token\", \"en-GB\" => \"Viacash Checkout-Token\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 1\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_slip_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_slip_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Slip-ID\", \"en-GB\" => \"Viacash Slip-ID\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 2\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_division_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_division_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Interne Barzahlen Divisions-Nummer\", \"en-GB\" => \"Internal Viacash division number\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 3\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_is_sandboxed'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_is_sandboxed',\n 'type' => 'switch',\n 'config' => [\n 'type' => 'switch',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Sandbox-Transaktion\", \"en-GB\" => \"Viacash sandboxed transaction\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"switch\",\n \"customFieldPosition\" => 4\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_refundable_amount'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_refundable_amount',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\n \"de-DE\" => \"Verbleibender per Barzahlen erstattbarer Betrag\",\n \"en-GB\" => \"Remaining amount that can be refunded with Viacash\",\n ]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_validity_days'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_validity_days',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Gültigkeitsdauer des Zahlscheins in Tagen\", \"en-GB\" => \"Days of payslip validity.\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n }", "public static function store_eu_data( $payment_meta ) {\n global $edd_options;\n\n $payment_meta['country'] = isset( $_POST['edd_country'] ) ? sanitize_text_field( $_POST['edd_country'] ) : $payment_meta['user_info']['address']['country'];\n \n $payment_meta['edd_vatreg'] = isset( $_POST['edd_vatreg'] ) ? true : false;\n\n // Check if user is VAT Registered with a Valid number. If so, set the Tax to 0.\n if ( isset( $_POST['vat_number'] ) && !empty($_POST['vat_number']) && \"\" !== $_POST['vat_number'] ) {\n\n $payment_meta['vat_number'] = preg_replace( '/\\s+/', '', $_POST['vat_number']);\n\n $vatarray = taxedd_get_vat_details($payment_meta['vat_number']);\n\n if ( isset( $vatarray['billing_country_code'] ) ) {\n $payment_meta['vat_billing_country_code'] = $vatarray['billing_country_code'];\n } else {\n $payment_meta['vat_billing_country_code'] = $payment_meta['user_info']['address']['country'];\n }\n // But if the base country is equal to the VAT Country code, add the tax on.\n if ($edd_options['base_country'] == $payment_meta['vat_billing_country_code']) {\n $payment_meta['tax'] = self::calculate_tax( $payment_meta['vat_billing_country_code'] );\n }\n\n } else {\n $payment_meta['vat_number'] = \"\";\n $payment_meta['tax'] = self::calculate_tax( $payment_meta['user_info']['address']['country'] );\n }\n\n // Set self declaration flag if needed.\n if ( isset( $_POST['edd_self_declaration'] ) ) {\n\n $payment_meta['self_declaration'] = $_POST['edd_self_declaration'];\n\n }\n\n return $payment_meta;\n }", "function brag_add_meta_field($args) {\n \n $args['fields']['referral'] = '';\n $args['fields']['notes'] = '';\n $args['fields']['type'] = '';\n $args['fields']['lead_status'] = '';\n\n return $args;\n}", "function getfaircoin_edd_store_usermeta( $payment_id ) {\r\n // return if user is not logged in\r\n if ( ! is_user_logged_in() )\r\n return;\r\n // get the user's ID\r\n $user_id = get_current_user_id();\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['edd_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['edd_fairsaving'] );\r\n}", "public function payment_fields() {\n \n\t\t\n \n\t\t}", "public function payment_fields() {\n\t\t$user = wp_get_current_user();\n\t\t$display_tokenization = $this->supports( 'tokenization' ) && is_checkout();\n\t\t$total = WC()->cart->total;\n\n\t\tif ( $user->ID ) {\n\t\t\t$user_email = get_user_meta( $user->ID, 'billing_email', true );\n\t\t\t$user_email = $user_email ? $user_email : $user->user_email;\n\t\t} else {\n\t\t\t$user_email = '';\n\t\t}\n\n\t\techo '<div\n\t\t\tid=\"xendit-payment-data\"\n\t\t\tdata-description=\"\"\n\t\t\tdata-email=\"' . esc_attr( $user_email ) . '\"\n\t\t\tdata-amount=\"' . esc_attr( $this->get_xendit_amount( $total ) ) . '\"\n\t\t\tdata-name=\"' . esc_attr( $this->statement_descriptor ) . '\"\n\t\t\tdata-currency=\"' . esc_attr( strtolower( get_woocommerce_currency() ) ) . '\"\n\t\t\tdata-locale=\"' . esc_attr( 'en' ) . '\"\n\t\t\tdata-image=\"' . esc_attr( $this->xendit_checkout_image ) . '\"\n\t\t\tdata-allow-remember-me=\"' . esc_attr( $this->saved_cards ? 'true' : 'false' ) . '\">';\n\n\t\tif ( $this->description ) {\n\t\t\techo apply_filters( 'wc_xendit_description', wpautop( wp_kses_post( $this->description ) ) );\n\t\t}\n\n\t\tif ( $display_tokenization ) {\n\t\t\t$this->tokenization_script();\n\t\t}\n\n\t\t$this->form();\n\t\techo '</div>';\n\t}", "public static function admin_order_add_custom_meta_data( $data, $wc_order )\n {\n $configs = OmnivaLt_Core::get_configs();\n $order = OmnivaLt_Wc_Order::get_data($wc_order->get_id(), array('omniva'));\n\n foreach ( $configs['method_params'] as $method_key => $method_values ) {\n if ( ! $method_values['is_shipping_method'] ) continue;\n if ( $order->omniva->method != $method_values['key'] ) continue;\n\n if ( $method_values['key'] == 'pt' || $method_values['key'] == 'ps' ) {\n $data['shipping_via'] = 'Omniva ' . strtolower($method_values['title']) . \": \" . OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id);\n }\n }\n\n if ($order->omniva->method) {\n $shipping_settings = OmnivaLt_Core::get_settings();\n $omnivalt_labels = new OmnivaLt_Labels();\n\n $barcode = $order->omniva->barcodes[0];\n $country_code = $shipping_settings['shop_countrycode'];\n $data['omnivalt_tracking_link'] = $omnivalt_labels->get_tracking_link($country_code, $barcode, true);\n $data['omnivalt_barcode'] = $barcode;\n }\n\n return $data;\n }", "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "function hometown_woocommerce_product_custom_fields_save($post_id)\n{\n $woocommerce_custom_product_text_field = $_POST['_custom_product'];\n update_post_meta($post_id, '_custom_product', esc_attr($woocommerce_custom_product_text_field));\n}", "function payment_fields() {\n\t\t\tif ( $this->description ) echo wpautop( wptexturize( $this->description ) );\n\t\t\tdo_action( 'tgm_jigoshop_payment_fields' ); // allow for insertion of custom code if needed\n\t\t}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tparent::save_order_meta_fields( $order, $request );\n\n\t\tupdate_post_meta( $order->get_id(), '_cards_brand_name', $request->payment->payment_type_code );\n\t\tupdate_post_meta( $order->get_id(), '_masked_card_number', WC_EBANX_Request::read( 'ebanx_masked_card_number' ) );\n\t}", "protected function save_order_meta_fields( $order, $request ) {\n\t\tupdate_post_meta( $order->get_id(), '_ebanx_tef_bank', sanitize_text_field( WC_EBANX_Request::read( 'tef' ) ) );\n\n\t\tparent::save_order_meta_fields( $order, $request );\n\t}", "public function add_meta() {\n\n\t\tglobal $woocommerce, $post;\n\t\t// Text Field\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'author',\n\t\t\t\t'label' => __( 'Author(s)', 'woocommerce' ),\n\t\t\t\t'placeholder' => 'author(s)',\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Author Name(s)', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'release_date',\n\t\t\t\t'label' => __( 'Release Date', 'woocommerce' ),\n\t\t\t\t'placeholder' => date( \"n/j/Y\" ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Release Date', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\twoocommerce_wp_text_input(\n\t\t\tarray(\n\t\t\t\t'id' => 'preview_file',\n\t\t\t\t'label' => __( 'Preview File (look inside)', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( 'Upload a PDF file sample', 'woocommerce' )\n\t\t\t)\n\t\t);\n\t\techo( '<input type=\"button\" class=\"button custom_media\" name=\"preview_file_button\" id=\"preview_file_button\" value=\"Upload/Browse\"/>' );\n\t\twoocommerce_wp_checkbox(\n\t\t\tarray(\n\t\t\t\t'id' => 'local_product',\n\t\t\t\t'label' => __( 'Local Product', 'woocommerce' ),\n\t\t\t\t'desc_tip' => 'true',\n\t\t\t\t'description' => __( '(not Longleaf)', 'woocommerce' ),\n\t\t\t\t'cbvalue' => '1'\n\t\t\t)\n\t\t);\n\t}", "function save_custom_fields( $post_id, $post ) {\n if ( !isset($_POST['wpnext_wpnonce']) || !wp_verify_nonce($_POST['wpnext_wpnonce'], 'wpnext') )\n return;\n if ( !current_user_can( 'edit_post', $post_id ) )\n return;\n\n if ( isset($_POST['wpn_post_data']) ) {\n update_post_meta( $post_id, 'wpnext', $_POST['wpn_post_data']);\n } else {\n delete_post_meta( $post_id, 'wpnext');\n }\n }", "public function setCustomFields ($order) {\n \n }", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_TOTAL_KEY, $this->total_reports );\n\t}", "public function saveCustomFields()\n\t{\n\t\t$state = $this->getStateVariables();\n\t\t$validation = $this->getValidation();\n\n\t\t$user = JFactory::getUser();\n\t\t$user = $this->getState('user', $user);\n\n\t\t// Find an existing record\n\t\t$list = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->user_id($user->id)\n\t\t\t->getItemList();\n\n\t\tif(!count($list)) {\n\t\t\t$id = 0;\n\t\t} else {\n\t\t\t$thisUser = array_pop($list);\n\t\t\t$id = $thisUser->akeebasubs_user_id;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'akeebasubs_user_id' => $id,\n\t\t\t'user_id'\t\t=> $user->id,\n\t\t\t'isbusiness'\t=> $state->isbusiness ? 1 : 0,\n\t\t\t'businessname'\t=> $state->businessname,\n\t\t\t'occupation'\t=> $state->occupation,\n\t\t\t'vatnumber'\t\t=> $state->vatnumber,\n\t\t\t'viesregistered' => $validation->validation->vatnumber,\n\t\t\t// @todo Ask for tax authority\n\t\t\t'taxauthority'\t=> '',\n\t\t\t'address1'\t\t=> $state->address1,\n\t\t\t'address2'\t\t=> $state->address2,\n\t\t\t'city'\t\t\t=> $state->city,\n\t\t\t'state'\t\t\t=> $state->state,\n\t\t\t'zip'\t\t\t=> $state->zip,\n\t\t\t'country'\t\t=> $state->country,\n\t\t\t'params'\t\t=> $state->custom\n\t\t);\n\n\t\t// Allow plugins to post-process the fields\n\t\tJLoader::import('joomla.plugin.helper');\n\t\tJPluginHelper::importPlugin('akeebasubs');\n\t\t$app = JFactory::getApplication();\n\t\t$jResponse = $app->triggerEvent('onAKSignupUserSave', array((object)$data));\n\t\tif(is_array($jResponse) && !empty($jResponse)) foreach($jResponse as $pResponse) {\n\t\t\tif(!is_array($pResponse)) continue;\n\t\t\tif(empty($pResponse)) continue;\n\t\t\tif(array_key_exists('params', $pResponse)) {\n\t\t\t\tif(!empty($pResponse['params'])) foreach($pResponse['params'] as $k => $v) {\n\t\t\t\t\t$data['params'][$k] = $v;\n\t\t\t\t}\n\t\t\t\tunset($pResponse['params']);\n\t\t\t}\n\t\t\t$data = array_merge($data, $pResponse);\n\t\t}\n\n\t\t// Serialize custom fields\n\t\t$data['params'] = json_encode($data['params']);\n\n\t\t$status = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->setId($id)\n\t\t\t->getItem()\n\t\t\t->save($data);\n\n\t\treturn $status;\n\t}", "protected function update_post_meta( &$order ) {\n\t\tglobal $wpdb;\n\n\t\t$edit_data = array(\n\t\t\t'order_key' => $order->get_order_key( 'edit' ),\n\t\t\t'customer_id' => $order->get_customer_id( 'edit' ),\n\t\t\t'payment_method' => $order->get_payment_method( 'edit' ),\n\t\t\t'payment_method_title' => $order->get_payment_method_title( 'edit' ),\n\t\t\t'transaction_id' => $order->get_transaction_id( 'edit' ),\n\t\t\t'customer_ip_address' => $order->get_customer_ip_address( 'edit' ),\n\t\t\t'customer_user_agent' => $order->get_customer_user_agent( 'edit' ),\n\t\t\t'created_via' => $order->get_created_via( 'edit' ),\n\t\t\t'date_completed' => $order->get_date_completed( 'edit' ),\n\t\t\t'date_paid' => $order->get_date_paid( 'edit' ),\n\t\t\t'cart_hash' => $order->get_cart_hash( 'edit' ),\n\n\t\t\t'billing_first_name' => $order->get_billing_first_name( 'edit' ),\n\t\t\t'billing_last_name' => $order->get_billing_last_name( 'edit' ),\n\t\t\t'billing_company' => $order->get_billing_company( 'edit' ),\n\t\t\t'billing_address_1' => $order->get_billing_address_1( 'edit' ),\n\t\t\t'billing_address_2' => $order->get_billing_address_2( 'edit' ),\n\t\t\t'billing_city' => $order->get_billing_city( 'edit' ),\n\t\t\t'billing_state' => $order->get_billing_state( 'edit' ),\n\t\t\t'billing_postcode' => $order->get_billing_postcode( 'edit' ),\n\t\t\t'billing_country' => $order->get_billing_country( 'edit' ),\n\n\t\t\t'billing_email' => $order->get_billing_email( 'edit' ),\n\t\t\t'billing_phone' => $order->get_billing_phone( 'edit' ),\n\n\t\t\t'shipping_first_name' => $order->get_shipping_first_name( 'edit' ),\n\t\t\t'shipping_last_name' => $order->get_shipping_last_name( 'edit' ),\n\t\t\t'shipping_company' => $order->get_shipping_company( 'edit' ),\n\t\t\t'shipping_address_1' => $order->get_shipping_address_1( 'edit' ),\n\t\t\t'shipping_address_2' => $order->get_shipping_address_2( 'edit' ),\n\t\t\t'shipping_city' => $order->get_shipping_city( 'edit' ),\n\t\t\t'shipping_state' => $order->get_shipping_state( 'edit' ),\n\t\t\t'shipping_postcode' => $order->get_shipping_postcode( 'edit' ),\n\t\t\t'shipping_country' => $order->get_shipping_country( 'edit' ),\n\n\t\t\t'discount_total' => $order->get_discount_total( 'edit' ),\n\t\t\t'discount_tax' => $order->get_discount_tax( 'edit' ),\n\t\t\t'shipping_total' => $order->get_shipping_total( 'edit' ),\n\t\t\t'shipping_tax' => $order->get_shipping_tax( 'edit' ),\n\t\t\t'cart_tax' => $order->get_total_tax( 'edit' ),\n\t\t\t'total' => $order->get_total( 'edit' ),\n\n\t\t\t'version' => $order->get_version( 'edit' ),\n\t\t\t'currency' => $order->get_currency( 'edit' ),\n\t\t\t'prices_include_tax' => $order->get_prices_include_tax( 'edit' ),\n\t\t);\n\n\t\t$changes = array();\n\n\t\tif ( $this->creating ) {\n\t\t\t$wpdb->insert(\n\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\tarray_merge( array(\n\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t), $edit_data )\n\t\t\t);\n\n\t\t\t// We are no longer creating the order, it is created.\n\t\t\t$this->creating = false;\n\t\t} else {\n\t\t\t$changes = array_intersect_key( $edit_data, $order->get_changes() );\n\n\t\t\tif ( ! empty( $changes ) ) {\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t\"{$wpdb->prefix}woocommerce_orders\",\n\t\t\t\t\t$changes,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$updated_props = array_keys( (array) $changes );\n\n\t\t// If customer changed, update any downloadable permissions.\n\t\tif ( in_array( 'customer_user', $updated_props ) || in_array( 'billing_email', $updated_props ) ) {\n\t\t\t$data_store = WC_Data_Store::load( 'customer-download' );\n\t\t\t$data_store->update_user_by_order_id( $order->get_id(), $order->get_customer_id(), $order->get_billing_email() );\n\t\t}\n\n\t\tdo_action( 'woocommerce_order_object_updated_props', $order, $updated_props );\n\t}", "function woocommerce_product_custom_fields_save($post_id)\n{\n $woocommerce_custom_product_text_field = $_POST['_custom_product_upc'];\n if (!empty($woocommerce_custom_product_text_field))\n update_post_meta($post_id, '_custom_product_upc', esc_attr($woocommerce_custom_product_text_field));\n\n}", "function client_meta_init()\n{\n add_meta_box('client_meta', 'Ссылка', 'client_meta_setup', 'client', 'side', 'low');\n // add a callback function to save any data a user enters in\n add_action('save_post','client_meta_save');\n}", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "protected function save_meta() {\n\t\t// save report meta details\n\t\tupdate_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, $this->get_meta() );\n\t}", "protected function addCustomFieldset()\n {\n $this->meta = array_merge_recursive(\n $this->meta,\n [\n static::NOTE_FIELD_INDEX => $this->getFieldsetConfig(),\n ]\n );\n }", "function add_field($field, $value) \n {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "public function register_meta() {\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tadd_meta_box( 'ecf-'.$customField['name'], __( $customField['title'], 'exlist' ), $customField['callback'], $postTypes , 'advanced', 'high', $type = array($customField['name'], $customField['title'], $customField['type']) );\r\n\t\t\t}\r\n }", "function getfaircoin_edd_updated_edited_purchase( $payment_id ) {\r\n // get the payment meta\r\n $payment_meta = edd_get_payment_meta( $payment_id );\r\n // update our fairaddress number\r\n $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : false;\r\n $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : false;\r\n // update the payment meta with the new array\r\n update_post_meta( $payment_id, '_edd_payment_meta', $payment_meta );\r\n}", "function rps_save_custom_meta() {\n\tglobal $post;\n\n\t// Stops WP from clearing post meta when autosaving\n\tif( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {\n\t return $post->ID;\n\t}\n\tif (isset($_POST['rps-url'])) {\n\t\t$clean = esc_url_raw($_POST['rps-url']);\n\t\tupdate_post_meta($post->ID, '_url' , $clean);\n\t}\n\tif (isset($_POST['rps-tagline'])) {\n\t\t$realclean = sanitize_text_field($_POST['rps-tagline']);\n\t\tupdate_post_meta($post->ID, '_tagline' , $realclean);\n\t}\n\n}", "function classiera_save_post_meta($post_id, $post) {\r\n\t\r\n\t// verify this came from the our screen and with proper authorization,\r\n\t// because save_post can be triggered at other times\r\n\tif ( !wp_verify_nonce( isset( $_POST['eventmeta_noncename'] ) ? $_POST['eventmeta_noncename'] : '', plugin_basename(__FILE__) )) {\r\n\treturn $post->ID;\r\n\t}\r\n\r\n\t// Is the user allowed to edit the post or page?\r\n\tif ( !current_user_can( 'edit_post', $post->ID ))\r\n\t\treturn $post->ID;\r\n\r\n\t// OK, we're authenticated: we need to find and save the data\r\n\t// We'll put it into an array to make it easier to loop though.\r\n\t\r\n\t$events_meta['featured_post'] = $_POST['featured_post'];\r\n\t\r\n\t$chk = ( isset( $_POST['featured_post'] ) && $_POST['featured_post'] ) ? '1' : '2';\r\n\tupdate_post_meta( $post_id, 'featured_post', $chk );\r\n\t\r\n\t// Add values of $events_meta as custom fields\r\n\tforeach ($events_meta as $key => $value) { // Cycle through the $events_meta array!\r\n\t\tif( $post->post_type == 'post' ) return; // Don't store custom data twice\r\n\t\t$value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)\r\n\t\tif(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value\r\n\t\t\tupdate_post_meta($post->ID, $key, $value);\r\n\t\t} else { // If the custom field doesn't have a value\r\n\t\t\tadd_post_meta($post->ID, $key, $value);\r\n\t\t}\r\n\t\tif(!$value) delete_post_meta($post->ID, $key); // Delete if blank\r\n\t}\r\n\r\n}", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_TOTAL_KEY, $this->total_reports );\n\t}", "public function afterCreate()\n {\n $this->saveCustomFields();\n }", "public function saveExtraRegistrationData($customerId)\n {\n if (isset($_POST['billing_first_name'])) {\n update_user_meta($customerId, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n if (isset($_POST['billing_last_name'])) {\n update_user_meta($customerId, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n if (isset($_POST['billing_address_1'])) {\n update_user_meta($customerId, 'billing_address_1', sanitize_text_field($_POST['billing_address_1']));\n }\n if (isset($_POST['billing_city'])) {\n update_user_meta($customerId, 'billing_city', sanitize_text_field($_POST['billing_city']));\n }\n if (isset($_POST['billing_postcode'])) {\n update_user_meta($customerId, 'billing_postcode', sanitize_text_field($_POST['billing_postcode']));\n }\n if (isset($_POST['billing_phone'])) {\n update_user_meta($customerId, 'billing_phone', sanitize_text_field($_POST['billing_phone']));\n }\n if (isset($_POST['billing_country'])) {\n update_user_meta($customerId, 'billing_country', sanitize_text_field($_POST['billing_country']));\n }\n }", "function apprenants_save_meta_box_data($post_id)\r\n {\r\n // verify taxonomies meta box nonce\r\n if (!isset($_POST['apprenants_meta_box_nonce']) || !wp_verify_nonce($_POST['apprenants_meta_box_nonce'], basename(__FILE__))) {\r\n return;\r\n }\r\n\r\n // return if autosave\r\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\r\n return;\r\n }\r\n\r\n // Check the user's permissions.\r\n if (!current_user_can('edit_post', $post_id)) {\r\n return;\r\n }\r\n\r\n // store custom fields values\r\n // nom string\r\n if (isset($_REQUEST['nom'])) {\r\n update_post_meta($post_id, '_apprenants_nom', sanitize_text_field($_POST['nom']));\r\n }\r\n\r\n // store custom fields values\r\n // prénom string\r\n if (isset($_REQUEST['prenom'])) {\r\n update_post_meta($post_id, '_apprenants_prenom', sanitize_text_field($_POST['prenom']));\r\n }\r\n\r\n // store custom fields values\r\n // github string\r\n if (isset($_REQUEST['github'])) {\r\n update_post_meta($post_id, '_apprenants_github', sanitize_text_field($_POST['github']));\r\n }\r\n\r\n // store custom fields values\r\n //linkedIn string\r\n if (isset($_REQUEST['linkedIn'])) {\r\n update_post_meta($post_id, '_apprenants_linkedIn', sanitize_text_field($_POST['linkedIn']));\r\n }\r\n\r\n // store custom fields values\r\n //portfolio string\r\n if (isset($_REQUEST['portfolio'])) {\r\n update_post_meta($post_id, '_apprenants_portfolio', sanitize_text_field($_POST['portfolio']));\r\n }\r\n }", "function vw_mobile_app_pro_posttype_ex_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n // Save designation\n if( isset( $_POST[ 'meta-designation' ] ) ) {\n update_post_meta( $post_id, 'meta-designation', esc_html($_POST[ 'meta-designation' ]) );\n }\n}", "function cd_meta_box_garoe_banner_prom_product_save( $post_id )\n{\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n \n // if our nonce isn't there, or we can't verify it, bail\n if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;\n \n // if our current user can't edit this post, bail\n if( !current_user_can( 'edit_post' ) ) return;\n \n // Make sure your data is set before trying to save it\n if( isset( $_POST['mb_garoe_banner_prom_product'] ) )\n update_post_meta( $post_id, 'mb_garoe_banner_prom_product', esc_attr( $_POST['mb_garoe_banner_prom_product'] ) );\n}", "function gutenberg_test_register_meta() {\n\n\tregister_meta( 'post', 'my_block_meta', array(\n\t\t'type' => 'number',\n\t\t'single' => true,\n\t\t'show_in_rest' => true,\n\t) );\n\n}", "function caviar_meta_box_callback( $post ) {\n\n\t// Add a nonce field so we can check for it later.\n\twp_nonce_field( 'caviar_save_meta_box_data', 'caviar_meta_box_nonce' );\n\n\t/*\n\t * Use get_post_meta() to retrieve an existing value\n\t * from the database and use the value for the form.\n\t */\n\t$txtName = get_post_meta( $post->ID, '_txtName', true );\n\t$txtAddress = get_post_meta( $post->ID, '_txtAddress', true );\n\t$txtWebsite = get_post_meta( $post->ID, '_txtWebsite', true );\n\t$chkFood = get_post_meta( $post->ID, '_chkFood', true );\n\t$selHobby\t = get_post_meta( $post->ID, '_selHobby', true );\n\t$selTrans\t = get_post_meta( $post->ID, '_selTrans', true );\n\t$itemFeatures = get_post_meta( $post->ID, '_itemFeatures', true );\n\t$gender = get_post_meta( $post->ID, '_gender', true );\n\t$colorMeta = get_post_meta( $post->ID, '_colorMeta', true );\n\t$edAboutMe = get_post_meta( $post->ID, '_edAboutMe', true );\n\t$selCats = get_post_meta( $post->ID, '_selCats', true );\n\t$upPhoto = get_post_meta( $post->ID, '_upPhoto', true );\n\t$upLicense = get_post_meta( $post->ID, '_upLicense', true );\n\t$rePersonalData = get_post_meta( $post->ID, '_rePersonalData', true );\n\n\t// var_dump($rePersonalData);\n\n\t$fields = array(\n\t\t'title' => array(\n\t\t\t'title' => 'Feature',\n\t\t\t'type' => 'text',\n\t\t),\n\t\t'desc' => array(\n\t\t\t'title' => 'Price',\n\t\t\t'type' => 'textarea',\n\t\t),\n\t\t'pic' => array(\n\t\t\t'id' => 'repeaterPic',\n\t\t\t'title' => 'Picture',\n\t\t\t'type' => 'upload',\n\t\t),\n\t\t'featured' => array(\n\t\t\t'title' => 'Featured',\n\t\t\t'type' => 'checkbox',\n\t\t\t'options' => array(\n\t\t\t\t'1' => 'Yes',\n\t\t\t\t'2' => 'No',\n\t\t\t\t'3' => 'Undecided',\n\t\t\t)\n\t\t) \n\t);\n\n\t$fieldx = array(\n\t\t'name' => array(\n\t\t\t'title' => 'Name',\n\t\t\t'type' => 'text',\n\t\t),\n\t\t'gender' => array(\n\t\t\t'title' => 'Feature',\n\t\t\t'type' => 'radioimage',\n\t\t\t'options' => array(\n\t\t\t\t'1' => 'http://placeimg.com/100/100/arch',\n\t\t\t\t'2' => 'http://placeimg.com/100/100/tech',\n\t\t\t),\n\t\t),\n\t\t'pic' => array(\n\t\t\t'id' => 'profilePic',\n\t\t\t'title' => 'Picture',\n\t\t\t'type' => 'upload',\n\t\t),\n\t);\n\n\t$fieldControl = new Field_Controls();\n\t$fieldControl->upload('Photo', 'upPhoto', array('name' => 'upPhoto', 'value' => $upPhoto, 'class' => 'single previewImage', 'placeholder' => esc_html__('Image URL' , 'claypress')));\n\t$fieldControl->upload('License Url', 'upLicense', array('name' => 'upLicense', 'value' => $upLicense, 'class' => 'single previewImage', 'placeholder' => esc_html__('Driving License url' , 'claypress')));\n\n\t$fieldControl->text('Name', 'txtName', array('value' => esc_attr( $txtName ), 'attr' => array('data-test1' => 'test1', 'data-validate' => 'true')));\n\t$fieldControl->text('Website', 'txtWebsite', array('type' => 'url','value' => esc_attr( $txtWebsite )));\n\t$fieldControl->textarea('Address', 'txtAddress', array('value' => $txtAddress) );\n\t$fieldControl->select('Transportation?', 'selTrans', array('name' => 'selTrans', 'value' => $selTrans, 'class' => 'widefat chosen-select'), array('car' => 'Car', 'bike' => 'Bike', 'train' => 'Train') );\n\t$fieldControl->select('Hobby?', 'selHobby', array('name' => 'selHobby', 'multiple' => 'multiple', 'value' => $selHobby, 'class' => 'widefat chosen-select'), array('Out Door' => array('football' => 'Football', 'basketball' => 'Basketball', 'tennis' => 'Tennis', 'swimming' => 'Swimming'), 'Indoor' => array('reading' => 'Reading', 'writing' => 'Writing'), 'Extreme' => array('basejump' => 'Base Jumping', 'surving' => 'Surving', 'diving' => 'Diving')) );\n \t$fieldControl->checkbox('Food?', 'chkFood', array('name' => 'chkFood', 'value' => $chkFood, 'class' => 'widefat'), array('fruit' => 'Fruit', 'vegetable' => 'Vegetable', 'bread' => 'Bread') );\n \t// $fieldControl->radio('Gender', 'gender', array('name' => 'gender', 'value' => $gender, 'attr' => array('data-test1' => 'test1')), array('male' => 'Male', 'female' => 'Female', 'other' => 'Other'));\n \t// $fieldControl->radiopill('Gender', 'gender', array('name' => 'gender', 'value' => $gender, 'attr' => array('data-test1' => 'test1')), array('male' => 'Male', 'female' => 'Female', 'other' => 'Other'));\n \t$fieldControl->radioimage('Gender', 'gender', array('name' => 'gender', 'value' => $gender, 'attr' => array('data-test1' => 'test1')), array('male' => 'http://placeimg.com/100/100/nature', 'female' => 'http://placeimg.com/100/100/tech', 'other' => 'http://placeimg.com/100/100/arch'));\n \t$fieldControl->colorpicker('Fav Color', 'colorMeta', array('class' => 'widefat', 'value' => $colorMeta, 'attr' => array('data-color' => 'test1')));\n \t$fieldControl->editor('About me', 'edAboutMe', array('value' => $edAboutMe), array('textarea_rows' => '5'));\n \t\n \t// $fieldControl->taxonomy('Category', 'selCats', array('name' => 'selCats', 'type' => 'select', 'value' => $selCats), 'post_tag', '');\n \t$fieldControl->repeaterField('Repeated Feature', 'itemFeatures', array('name' => 'itemFeatures', 'value' => $itemFeatures), $fields);\n\n \t$fieldControl->repeaterField('Personal data', 'rePersonalData', array('name' => 'rePersonalData', 'value' => $rePersonalData), $fieldx);\n \t?>\n<?php\n}", "public function vendors_save_metabox_data($post_id)\n {\n // die(print_r(basename(__FILE__)));\n\n // Contact Person field nonce\n if (!isset($_POST['vendor_contact_person_metabox_nonce']) || !wp_verify_nonce($_POST['vendor_contact_person_metabox_nonce'], 'vendor_contact_person_metabox')) {\n return $post_id;\n }\n // Email field nonce\n if (!isset($_POST['vendor_email_metabox_nonce']) || !wp_verify_nonce($_POST['vendor_email_metabox_nonce'], 'vendor_email_metabox')) {\n return $post_id;\n }\n // Phone field nonce\n if (!isset($_POST['vendor_phone_metabox_nonce']) || !wp_verify_nonce($_POST['vendor_phone_metabox_nonce'], 'vendor_phone_metabox')) {\n return $post_id;\n }\n\n // URL field nonce\n if (!isset($_POST['vendor_url_metabox_nonce']) || !wp_verify_nonce($_POST['vendor_url_metabox_nonce'], 'vendor_url_metabox')) {\n return $post_id;\n }\n\n // return if autosave\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return;\n }\n // Check the user's permissions.\n if (! current_user_can('edit_post', $post_id)) {\n return;\n }\n\n // store custom fields values\n // Save contact person\n if (isset($_POST['vendor_contact_person'])) {\n update_post_meta($post_id, '_vendor_contact_person', sanitize_text_field($_POST['vendor_contact_person']));\n }\n\n // Save email\n if (isset($_POST['vendor_email'])) {\n update_post_meta($post_id, '_vendor_email', sanitize_text_field($_POST['vendor_email']));\n }\n\n // Save phone\n if (isset($_POST['vendor_phone'])) {\n update_post_meta($post_id, '_vendor_phone', sanitize_text_field($_POST['vendor_phone']));\n }\n\n // Save URL\n if (isset($_POST['vendor_url'])) {\n update_post_meta($post_id, '_vendor_url', sanitize_text_field($_POST['vendor_url']));\n }\n }", "public function save_order_payment_type_meta_data( $order, $data ) {\n if ( $data['payment_method'] === $this->id && isset($_POST['payment_duration']) )\n $order->update_meta_data('_payment_duration', esc_attr($_POST['payment_duration']) );\n }", "function prfx_meta_callback( $post ) {\r\n wp_nonce_field( basename( __FILE__ ), 'prfx_nonce' );\r\n $prfx_stored_meta = get_post_meta( $post->ID );\r\n ?>\r\n \r\n <p>\r\n <label for=\"meta-text\" class=\"prfx-row-title\"><?php _e( 'Enter H1 Title Tag Here', 'prfx-textdomain' )?></label>\r\n <input type=\"text\" name=\"meta-text\" id=\"meta-text\" value=\"<?php if ( isset ( $prfx_stored_meta['meta-text'] ) ) echo $prfx_stored_meta['meta-text'][0]; ?>\" />\r\n </p>\r\n \r\n <?php\r\n}", "function simply_add_custom_general_fields()\n{\n // You can create text, textarea, select, checkbox and custom fields\n global $woocommerce, $post;\n // Custom fields will be created here...\n ?>\n <div class=\"options_group\">\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_family_code\"><?php echo __('Family Code', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n $family_code = get_post_meta($post->ID, 'family_code', true);\n\n echo $family_code;\n\n ?>\n\n </p>\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_mpartname\"><?php echo __('Mpartname', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n\t\t$mpartname = get_post_meta($post->ID, 'mpartname', true);\n\n\t\techo $mpartname;\n\n\t\t?>\n\n </p>\n </div>\n <?php\n}", "public function get_customer_meta_fields()\n {\n\n $show_fields = apply_filters('wc_pos_customer_meta_fields', array(\n 'outlet_filds' => array(\n 'title' => __('Point of Sale', 'wc_point_of_sale'),\n 'fields' => array(\n 'outlet' => array(\n 'label' => __('Outlet', 'wc_point_of_sale'),\n 'type' => 'select',\n 'name' => 'outlet[]',\n 'multiple' => true,\n 'options' => WC_POS()->outlet()->get_data_names(),\n 'description' => __('Ensure the user is logged out before changing the outlet.', 'wc_point_of_sale')\n ),\n 'discount' => array(\n 'label' => __('Discount', 'wc_point_of_sale'),\n 'type' => 'select',\n 'options' => array(\n 'enable' => 'Enable',\n 'disable' => 'Disable'\n ),\n 'description' => ''\n ),\n )\n ),\n ));\n\n if ( get_option( 'wc_pos_enable_user_card', 'no' ) == 'yes' ) {\n $show_fields['outlet_filds']['fields']['user_card_number'] = array(\n 'label' => __( 'Card Number', 'wc_point_of_sale' ),\n 'type' => 'input',\n 'description' => 'Enter the number of the card to associate this customer with.'\n );\n $show_fields['outlet_filds']['fields']['user_card_number_print'] = array(\n 'label' => __( 'Print Customer Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['user_card_number_scan'] = array(\n 'label' => __( 'Load Card', 'wc_point_of_sale' ),\n 'type' => 'button',\n 'description' => ''\n );\n }\n $show_fields['outlet_filds']['fields']['disable_pos_payment'] = array(\n 'label' => __( 'Tendering', 'wc_point_of_sale' ),\n 'desc' => 'Disable tendering ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n $show_fields['outlet_filds']['fields']['approve_refunds'] = array(\n 'label' => __( 'Refunds', 'wc_point_of_sale' ),\n 'desc' => 'Enable refund ability when using the register in assigned outlets.',\n 'type' => 'checkbox',\n 'description' => ''\n );\n return $show_fields;\n }", "function my_custom_checkout_field_display_admin_order_meta($order){\n echo '<p><strong>'.__('Phone 2').':</strong> <br/>' . get_post_meta( $order->get_id(), 'billing_phone_new', true ) . '</p>';\n}", "public function add_customer_meta_fields($user)\n {\n\n if (!current_user_can('manage_wc_point_of_sale'))\n return;\n\n $show_fields = $this->get_customer_meta_fields();\n\n foreach ($show_fields as $fieldset) :\n ?>\n <h3><?php echo $fieldset['title']; ?></h3>\n <table class=\"form-table\" id=\"pos_custom_user_fields\">\n <?php\n foreach ($fieldset['fields'] as $key => $field) :\n ?>\n <tr>\n <th><label for=\"<?php echo esc_attr($key); ?> \"><?php echo esc_html($field['label']); ?></label>\n </th>\n <td>\n <?php if (isset($field['type']) && $field['type'] == 'select') {\n $value_user_meta = (array)get_user_meta($user->ID, $key, true);\n $multiple = isset($field['multiple']) && $field['multiple'] ? 'multiple' : '';\n ?>\n <select name=\"<?php echo isset($field['name']) ? esc_attr($field['name']) : esc_attr($key); ?>\" id=\"<?php echo esc_attr($key); ?>\"\n <?php echo $multiple ?> style=\"width: 100%; max-width: 15em;\">\n <?php if ($key == 'outlet') { ?>\n <option></option>\n <?php } ?>\n <?php foreach ($field['options'] as $label_value => $label) {\n echo '<option value=\"' . $label_value . '\" ' . ((in_array($label_value, $value_user_meta)) ? 'selected' : '') . ' >' . $label . '</option>';\n } ?>\n </select>\n\n <?php } elseif($field['type'] == 'button' && $key == 'user_card_number_print') { ?>\n <a class=\"button order-preview\" name=\"<?php echo $key ?>\" id=\"print_customer_card_qr\"><?php _e('Print QR Code', 'wc_point_of_sale') ?></a>\n <a class=\"button order-preview\" name=\"<?php echo $key ?>\" id=\"print_customer_card_bc\"><?php _e('Print Barcode', 'wc_point_of_sale') ?></a>\n\n <div style=\"display: none\" id=\"wc-backbone-modal-dialog\">\n <div class=\"wc-backbone-modal wc-order-preview\">\n <div class=\"wc-backbone-modal-content\" tabindex=\"0\">\n <section class=\"wc-backbone-modal-main\" role=\"main\">\n <header class=\"wc-backbone-modal-header\">\n <h1><?php _e('Print card', 'wc_point_of_sale'); ?></h1>\n <button class=\"modal-close modal-close-link dashicons dashicons-no-alt close\">\n <span class=\"screen-reader-text\"><?php _e('Close modal panel', 'wc_point_of_sale'); ?></span>\n </button>\n </header>\n <article id=\"print_area\" style=\"max-height: 441px;\">\n <svg style=\"display: none\" id=\"barcode\"></svg>\n <div style=\"display: none\" id=\"qrcode\"></div>\n </article>\n </section>\n </div>\n </div>\n <div class=\"wc-backbone-modal-backdrop modal-close\"></div>\n </div>\n <?php } elseif($field['type'] == 'button' && $key == 'user_card_number_scan') { ?>\n <button class=\"button\" name=\"<?php echo $key ?>\" id=\"<?php echo $key ?>\"><?php echo $field['label'] ?></button>\n <div style=\"display: none\" id=\"wc-backbone-modal-dialog-scan\">\n <div class=\"wc-backbone-modal wc-order-preview\">\n <div class=\"wc-backbone-modal-content\" tabindex=\"0\">\n <section class=\"wc-backbone-modal-main\" role=\"main\">\n <header class=\"wc-backbone-modal-header\">\n <h1 style=\"padding: 0;\"><?php _e('Swipe Card', 'wc_point_of_sale'); ?></h1>\n <button class=\"modal-close modal-close-link dashicons dashicons-no-alt close-scan\">\n <span class=\"screen-reader-text\"><?php _e('Close modal panel', 'wc_point_of_sale'); ?></span>\n </button>\n </header>\n <article>\n <div id=\"pos_card_fields\" class=\"pos-customer-details-tab\" style=\"padding: 0 2em;\">\n <div class=\"woocommerce-additional-fields\">\n <form class=\"card-form\">\n <input type=\"hidden\" id=\"swiped\">\n </form>\n <p><?php _e('Please swipe the card which you want to assign to this user.', 'wc_point_of_sale'); ?></p>\n <div class=\"result\">\n <ul id=\"properties\">\n </ul>\n <p><?php _e('Status: ', 'wc_point_of_sale'); ?><span id=\"status\"></span></p>\n </div>\n </div>\n <button style=\"margin-top: 20px\" class=\"button\" id=\"assign-card\" disabled><?php _e('Assign Card To User', 'wc_point_of_sale'); ?></button>\n </div>\n </article>\n </section>\n </div>\n </div>\n <div class=\"wc-backbone-modal-backdrop modal-close\"></div>\n </div>\n <?php }elseif ($field['type'] == 'input' && $key == 'user_card_number'){ ?>\n <?php $card = esc_attr(get_user_meta($user->ID, $key, true)); ?>\n <input type=\"text\" name=\"<?php echo esc_attr($key); ?>\"\n id=\"<?php echo esc_attr($key); ?>\"\n value=\"<?php echo $card; ?>\"\n <?php echo !empty($card) ? \"disabled\" : \"\"; ?>\n class=\"regular-text\"/>\n <a id=\"enable_card\" class=\"button\"><?php _e('Change Card Number', 'wc_point_of_sale'); ?></a>\n <?php }elseif(true){\n $val = get_user_meta($user->ID, $key, true); ?>\n <label for=\"<?php echo esc_attr($key); ?>\">\n <input type=\"checkbox\"\n name=\"<?php echo esc_attr($key); ?>\"\n id=\"<?php echo esc_attr($key); ?>\"\n value=\"1\"\n <?php checked(isset($val) && $val == \"yes\") ?>>\n <?php echo isset($field['desc']) ? $field['desc'] : \"\"; ?>\n </label>\n <?php } else { ?>\n <input type=\"text\" name=\"<?php echo esc_attr($key); ?>\"\n id=\"<?php echo esc_attr($key); ?>\"\n value=\"<?php echo esc_attr(get_user_meta($user->ID, $key, true)); ?>\"\n class=\"regular-text\"/><br/>\n <?php } ?>\n <br>\n <span class=\"description\"><?php echo isset($field['description']) ? wp_kses_post($field['description']) : \"\"; ?></span>\n </td>\n </tr>\n <?php\n endforeach;\n ?>\n </table>\n <style rel=\"stylesheet\">\n #pos_custom_user_fields .select2-container .select2-search--inline .select2-search__field {\n max-width: 100% !important;\n width: auto !important;\n }\n .select2-selection__choice[title=\"\"] {\n display: none;\n }\n </style>\n <?php\n endforeach;\n }", "function wooc_save_extra_register_fields( $customer_id ) {\n if ( isset( $_POST['billing_first_name'] ) ) {\n // WordPress default first name field.\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n // WooCommerce billing first name.\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n }\n if ( isset( $_POST['billing_last_name'] ) ) {\n // WordPress default last name field.\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n // WooCommerce billing last name.\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n }\n}", "function save_meta_info( $post_id, $post ) {\n if($post->post_type != 'events')\n return $post_id;\n\n /* Verify the nonce before proceeding. */\n if ( !isset( $_POST['mindevents_event_meta_nonce'] ) || !wp_verify_nonce( $_POST['mindevents_event_meta_nonce'], basename( __FILE__ ) ) )\n return $post_id;\n\n\n\n $field_key = 'event_meta';\n /* Get the posted data and sanitize it for use as an HTML class. */\n $new_meta_values = (isset( $_POST[$field_key]) ? $_POST[$field_key] : '' );\n if($new_meta_values) :\n foreach ($new_meta_values as $key => $value) :\n update_post_meta( $post_id, $key, $value);\n endforeach;\n endif;\n\n return $post_id;\n }", "function woocommerce_product_custom_fields_save($post_id) {\n $woocommerce_custom_product_number_field = $_POST['sharethewarmth_selling_goal'];\n if (!empty($woocommerce_custom_product_number_field)) {\n update_post_meta($post_id, 'sharethewarmth_selling_goal', esc_attr($woocommerce_custom_product_number_field));\n }\n}", "public function fields() {\n $ID = $this->order['id'];\n $BUYCODE = $this->order['code'];\n $url = (mswSSL() == 'yes' ? str_replace('http://', 'https://', BASE_HREF) : BASE_HREF);\n $order = $this->getsale($ID, $BUYCODE);\n $params = $this->params();\n $timestamp = time();\n $name = $this->firstLastName($order->name);\n $country = $this->country($_POST['country']);\n $amount = $this->saletotal($order);\n $arr = array(\n 'x_login' => $params['login-id'],\n 'x_amount' => $amount,\n 'x_description' => $this->stripchars($this->lang[2]),\n 'x_invoice_num' => $ID,\n 'x_fp_sequence' => $ID,\n 'x_fp_timestamp' => $timestamp,\n 'x_fp_hash' => mmGateway::submissionhash($timestamp, $params, $ID, $amount),\n 'x_test_request' => ($this->settings->paymode == 'live' ? 'false' : 'true'),\n 'x_show_form' => 'PAYMENT_FORM',\n 'x_type' => 'AUTH_CAPTURE',\n 'x_first_name' => $this->stripchars($name['first-name']),\n 'x_last_name' => $this->stripchars($name['last-name']),\n 'x_address' => $this->stripchars($_POST['address1'] . ($_POST['address2'] ? ', ' . $_POST['address2'] : '')),\n 'x_email' => $this->stripchars($order->email),\n 'x_city' => $this->stripchars($_POST['city']),\n 'x_state' => $this->stripchars($_POST['county']),\n 'x_zip' => $this->stripchars($_POST['postcode']),\n 'x_country' => $this->stripchars($country->name),\n 'x_ship_to_first_name' => $this->stripchars($name['first-name']),\n 'x_ship_to_last_name' => $this->stripchars($name['last-name']),\n 'x_ship_to_address' => $this->stripchars($_POST['address1'] . ($_POST['address2'] ? ', ' . $_POST['address2'] : '')),\n 'x_ship_to_city' => $this->stripchars($_POST['city']),\n 'x_ship_to_state' => $this->stripchars($_POST['county']),\n 'x_ship_to_zip' => $this->stripchars($_POST['postcode']),\n 'x_ship_to_country' => $this->stripchars($country->name),\n 'x_relay_response' => 'false',\n 'x_cancel_url' => $url . $this->seo->url('cancel', array(), 'yes'),\n 'x_receipt_method' => 'POST',\n 'x_receipt_link_text' => $this->stripchars(str_replace('{store}', $this->settings->website, $this->lang[5])),\n 'x_receipt_link_url' => $url . 'index.php?gw=' . $ID . '-' . $BUYCODE\n );\n // Only include currency code for live server..\n // Seems to throw errors for test server..\n // If this throws (99) errors on live, uncomment..\n if ($this->settings->paymode == 'live') {\n $arr['x_currency_code'] = (in_array($this->settings->currency, array(\n 'USD',\n 'GBP',\n 'CAD',\n 'EUR'\n )) ? $this->settings->currency : 'USD');\n }\n return $arr;\n }", "function save_user_fields ($user_id) {\n if ( isset($_POST['billing_first_name']) ){\n update_user_meta($user_id, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n \n if ( isset($_POST['billing_last_name']) ){\n update_user_meta($user_id, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n\n if ( isset($_POST['billing_tipo_documento']) ){\n update_user_meta($user_id, 'billing_tipo_documento', sanitize_text_field($_POST['billing_tipo_documento']));\n }\n\n if ( isset($_POST['billing_numero_documento']) ){\n update_user_meta($user_id, 'billing_numero_documento', sanitize_text_field($_POST['billing_numero_documento']));\n }\n \n}", "function save_custom_field_brand( $post_id ) {\n $product = wc_get_product( $post_id );\n $details_brand = isset( $_POST['custom_field_brand'] ) ? $_POST['custom_field_brand'] : '';\n $product->update_meta_data( 'custom_field_brand', sanitize_textarea_field( $details_brand ) );\n $product->save();\n}", "function action_save_postdata( $post_id ) {\n $inputValues = [\n 'cost_recommandation',\n 'link_recommandation'\n ];\n foreach ($inputValues as $inputValue) {\n $value = Services::getValue( $inputValue );\n if (false != $value)\n update_post_meta( $post_id, $inputValue, $value );\n }\n\n}", "function payment_fields() {\n if ($this->description) echo wpautop(wptexturize($this->description));\n ?>\n <ol class=\"my-list\">\n <li>Entrez votre numéro MTN Mobile Money dans le champ de formulaire ci-dessous</li>\n <li>Vous recevrez un message vous demandant de composer *126# et d'entrer votre code PIN</li>\n <li>Composez *126# et entrez votre code PIN pour confirmer votre paiement</li>\n <li>Si le paiement est effectué, votre commande sera automatiquement validé</li>\n </ol>\n\n <label for=\"\">Entrez votre numéro MTN Mobile Money</label>\n\n <input type=\"text\" name=\"gt_user_momo_number\" value=\"\"\n style=\"background-color: #fff; border-radius: 0px; color: #222;\"required class=\"form-controll\"\n placeholder=\"Enter your phone number\">\n <?php\n }", "function cs_wc_save_extra_register_fields( $customer_id ) {\r\n if ( isset( $_POST['billing_first_name'] ) ) {\r\n // WordPress default first name field.\r\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n // WooCommerce billing first name.\r\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n }\r\n if ( isset( $_POST['billing_last_name'] ) ) {\r\n // WordPress default last name field.\r\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n // WooCommerce billing last name.\r\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n }\r\n}", "function wordimpress_custom_checkout_field_update_order_meta( $order_id ) {\n if ( $_POST['inscription_checkbox'] ) {\n //It does: update post meta for this order\n update_post_meta( $order_id, 'NOLA Terms', esc_attr( $_POST['inscription_checkbox'] ) );\n }\n if ( $_POST['inscription_textbox'] ) {\n update_post_meta( $order_id, 'Allergy Information', esc_attr( $_POST['inscription_textbox'] ) );\n }\n}", "public function save_custom_meta_data( $post_id ) {\n\n\t\t$is_valid_nonce = ( isset( $_POST[ $this->nonce ] ) && wp_verify_nonce( sanitize_text_field( $_POST[ $this->nonce ] ), plugin_basename( __FILE__ ) ) );\n\t\t// First, make sure the user can save the post\n\t\tif ( $is_valid_nonce && $this->user_can_save( $post_id ) ) {\n\n\t\t\t// Did the user set an expiry date, or are they clearing an old one?\n\t\t\tif ( ! empty( $_POST['sailthru_post_expiration'] ) && isset( $_POST['sailthru_post_expiration'] ) \n\t\t\t\t|| get_post_meta( $post_id, 'sailthru_post_expiration', true ) ) {\n\n\t\t\t\t$expiry_time = strtotime( sanitize_text_field( $_POST['sailthru_post_expiration'] ) );\n\t\t\t\tif ( $expiry_time ) {\n\t\t\t\t\t$expiry_date = date( 'Y-m-d', $expiry_time );\n\n\t\t\t\t\t// Save the date. hehe.\n\t\t\t\t\tupdate_post_meta( $post_id, 'sailthru_post_expiration', $expiry_date );\n\t\t\t\t}\n\t\t\t} // end if\n\n\t\t\t// Did the user set some meta tags, or are they clearing out old tags?\n\t\t\tif ( ! empty( $_POST['sailthru_meta_tags'] ) && isset( $_POST['sailthru_meta_tags'] )\n\t\t\t\t|| get_post_meta( $post_id, 'sailthru_meta_tags', true ) ) {\n\n\t\t\t\t//remove trailing comma\n\t\t\t\t$meta_tags = rtrim( sanitize_text_field( $_POST['sailthru_meta_tags'] ), ',' );\n\t\t\t\tupdate_post_meta( $post_id, 'sailthru_meta_tags', $meta_tags );\n\n\t\t\t}\n\t\t} // end if\n\n\t}", "function construction_realestate_posttype_bn_metadesig_save( $post_id ) {\n if( isset( $_POST[ 'meta-desig' ] ) ) {\n update_post_meta( $post_id, 'meta-desig', esc_html($_POST[ 'meta-desig' ]) );\n }\n if( isset( $_POST[ 'meta-call' ] ) ) {\n update_post_meta( $post_id, 'meta-call', esc_html($_POST[ 'meta-call' ]) );\n }\n // Save facebookurl\n if( isset( $_POST[ 'meta-facebookurl' ] ) ) {\n update_post_meta( $post_id, 'meta-facebookurl', esc_url($_POST[ 'meta-facebookurl' ]) );\n }\n // Save linkdenurl\n if( isset( $_POST[ 'meta-linkdenurl' ] ) ) {\n update_post_meta( $post_id, 'meta-linkdenurl', esc_url($_POST[ 'meta-linkdenurl' ]) );\n }\n if( isset( $_POST[ 'meta-twitterurl' ] ) ) {\n update_post_meta( $post_id, 'meta-twitterurl', esc_url($_POST[ 'meta-twitterurl' ]) );\n }\n // Save googleplusurl\n if( isset( $_POST[ 'meta-googleplusurl' ] ) ) {\n update_post_meta( $post_id, 'meta-googleplusurl', esc_url($_POST[ 'meta-googleplusurl' ]) );\n }\n}", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the\n // array, it will be overwritten.\n\n $this->fields[\"$field\"] = $value;\n }", "function wp_api_encode_acf($data,$post,$context){\n $customMeta = (array) get_fields($post['ID']);\n\n $data['meta'] = array_merge($data['meta'], $customMeta );\n return $data;\n}", "function wck_add_meta(){\r\n\t\tcheck_ajax_referer( \"wck-add-meta\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse\r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint($_POST['id']);\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( !empty( $_POST['values'] ) && is_array( $_POST['values'] ) )\r\n\t\t\t$values = array_map( 'wppb_sanitize_value', $_POST['values'] );\r\n\t\telse\r\n\t\t\t$values = array();\r\n\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\r\n\t\t$values = apply_filters( \"wck_add_meta_filter_values_{$meta}\", $values );\r\n\r\n\t\t/* check required fields */\r\n\t\t$errors = self::wck_test_required( $this->args['meta_array'], $meta, $values, $id );\t\t\r\n\t\tif( $errors != '' ){\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $errors ) );\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $values ) );\r\n\r\n\t\t/* we need an array here */\r\n\t\tif( empty( $results ) && !is_array( $results ) )\r\n\t\t\t$results = array();\r\n\r\n /* for single metaboxes owerwrite entries each time so we have a maximum of one */\r\n if( $this->args['single'] )\r\n $results = array( $values );\r\n else\r\n $results[] = $values;\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_add_meta', $meta, $id, $values );\r\n\t\t$wck_before_add_meta = ob_get_clean(); //don't output it\r\n\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t/* if unserialize_fields is true add for each entry separate post meta for every element of the form */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\r\n\t\t\t\r\n\t\t\t$meta_suffix = count( $results );\r\n\t\t\tif( !empty( $values ) ){ \r\n\t\t\t\tforeach( $values as $name => $value ){\r\n\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_list = $this->wck_refresh_list( $meta, $id );\r\n\t\t$add_form = $this->wck_add_form( $meta, $id );\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_list' => $entry_list, 'add_form' => $add_form ) ) );\t\r\n\t\t\r\n\t}", "public function saveData($data)\n\t {\n\t \t$name = self::getNameMetaBox($data['_title_meta_box']);\n\n\t \t$content = self::getDataMetas();\n\t \t$data['_name_meta_box'] = $name;\n\t \t$content[$name] = $data;\n\t \tupdate_option('metas-custom', $content);\n\t }", "function vw_hospital_cs_savecustom_meta() {\n add_meta_box( 'cs_meta', __( 'Settings', 'vw-hospital' ), 'w_hospital_cs_appoint_callback' , 'Appointment','normal', 'high' ); \n}", "public function payment_fields() {\n\n\t\tWC()->session->set( 'decred_amount', null );\n\n\t\ttry {\n\n\t\t\t$dcr_amount = $this->get_dcr_amount();\n\n\t\t\t// save amount now to retrieve it later when order created.\n\t\t\tWC()->session->set( 'decred_amount', $dcr_amount );\n\n\t\t\trequire __DIR__ . '/html-checkout.php';\n\n\t\t} catch ( \\Exception $e ) {\n\t\t\t// TODO log $e.\n\t\t\tprintf(\n\t\t\t\t// translators: don't translate error message.\n\t\t\t\tesc_html__( 'There was an error while trying to get the DCR amount: \"%s\".', 'decred' ),\n\t\t\t\t$e->getMessage()\n\t\t\t);\n\t\t}\n\t}", "function ppom_make_meta_data( $cart_item, $context=\"cart\" ){\n\t\n\tif( ! isset($cart_item['ppom']['fields']) ) return $cart_item;\n\t\n\t$ppom_meta_ids = '';\t\n\t// removing id field\n\tif ( !empty( $cart_item ['ppom'] ['fields']['id'] )) {\n\t\t$ppom_meta_ids = $cart_item ['ppom'] ['fields']['id'];\n\t\tunset( $cart_item ['ppom'] ['fields']['id']);\n\t}\n\t\n\t$ppom_meta = array(); \n\t\n\tforeach($cart_item['ppom']['fields'] as $key => $value) {\n\t\t\n\t\t// if no value\n\t\tif( $value == '' ) continue;\n\t\t$product_id = ppom_get_product_id($cart_item['data']);\n\t\t// $cart_item['data'] ->post_type == 'product' ? $cart_item['data']->get_id() : $cart_item['data']->get_parent_id();\n\t\t$field_meta = ppom_get_field_meta_by_dataname( $product_id, $key, $ppom_meta_ids);\n\t\t\n\t\t// If field deleted while it's in cart\n\t\tif( empty($field_meta) ) continue;\n\t\t\n\t\t$field_type = isset($field_meta['type']) ? $field_meta['type'] : '';\n\t\t$field_title= isset($field_meta['title']) ? $field_meta['title'] : '';\n\t\t\n\t\t// third party plugin for different fields types\n\t\t$field_type = apply_filters('ppom_make_meta_data_field_type', $field_type, $field_meta);\n\t\t\n\t\t$meta_data = array();\n\t\t\n\t\tswitch( $field_type ) {\n\t\t\t\n\t\t\tcase 'quantities':\n\t\t\t\t$total_qty = 0;\n\t\t\t\t$qty_values = array();\n\t\t\t\tforeach($value as $label => $qty) {\n\t\t\t\t\tif( !empty($qty) ) {\n\t\t\t\t\t\t$qty_values[] = \"{$label} = {$qty}\";\n\t\t\t\t\t\t// $ppom_meta[$label] = $qty;\n\t\t\t\t\t\t$total_qty += $qty;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$qty_values[] = __('Total','ppom').' = '.$total_qty;\n\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>implode(\",\",$qty_values));\n\t\t\t\t// A placeholder key to handle qunantity display in item meta data under myaccount\n\t\t\t\t$ppom_meta['ppom_has_quantities'] = $total_qty;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'file':\n\t\t\t\tif( $context == 'order') {\n\t\t\t\t\t$uploaded_filenames = array();\n\t\t\t\t\tforeach($value as $file_id => $file_uploaded) {\n\t\t\t\t\t\t$uploaded_filenames[] = $file_uploaded['org'];\n\t\t\t\t\t}\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>implode(',',$uploaded_filenames));\n\t\t\t\t} else {\n\t\t\t\t\t$file_thumbs_html = '';\n\t\t\t\t\tforeach($value as $file_id => $file_uploaded) {\n\t\t\t\t\t\t$file_name = $file_uploaded['org'];\n\t\t\t\t\t\t$file_thumbs_html .= ppom_create_thumb_for_meta($file_name, $product_id);\n\t\t\t\t\t}\n\t\t\t\t\t// $ppom_meta['ppom_has_files'][$key] = $value;\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>$file_thumbs_html);\n\t\t\t\t\t// $ppom_meta[$field_title] = $file_thumbs_html;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'cropper':\n\t\t\t\tif( $context == 'order') {\n\t\t\t\t\t$uploaded_filenames = array();\n\t\t\t\t\tforeach($value as $file_id => $file_cropped) {\n\t\t\t\t\t\t$uploaded_filenames[] = $file_cropped['org'];\n\t\t\t\t\t}\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>implode(',',$uploaded_filenames));\n\t\t\t\t} else {\n\t\t\t\t\t$file_thumbs_html = '';\n\t\t\t\t\t// ppom_pa($value);\n\t\t\t\t\tforeach($value as $file_id => $file_cropped) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$file_name = $file_cropped['org'];\n\t\t\t\t\t\t$file_thumbs_html .= ppom_create_thumb_for_meta($file_name, $product_id, true);\n\t\t\t\t\t}\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>$file_thumbs_html);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'image':\n\t\t\t\tif($value) {\n\t\t\t\t\t\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>ppom_generate_html_for_images($value));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'audio':\n\t\t\t\tif($value) {\n\t\t\t\t\t$ppom_file_count = 1;\n\t\t\t\t\tforeach($value as $id => $audio_meta) {\n\t\t\t\t\t\t$audio_meta = json_decode(stripslashes($audio_meta), true);\n\t\t\t\t\t\t$audio_url\t= stripslashes($audio_meta['link']);\n\t\t\t\t\t\t$audio_html = '<a href=\"'.esc_url($audio_url).'\" title=\"'.esc_attr($audio_meta['title']).'\">'.$audio_meta['title'].'</a>';\n\t\t\t\t\t\t$meta_lable\t= $field_title.': '.$ppom_file_count++;\n\t\t\t\t\t\t// $ppom_meta[$meta_lable] = $audio_html;\n\t\t\t\t\t\t$meta_data = array('name'=>$meta_lable, 'value'=>$audio_html);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'bulkquantity':\n\t\t\t\t\n\t\t\t\t$bq_value = $value['option'].' ('.$value['qty'].')';\n\t\t\t\t// $ppom_meta[$key] = $value['option'].' ('.$value['qty'].')';\n\t\t\t\t$meta_data = array('name'=>$key, 'value'=>$bq_value);\n\t\t\t\t// A placeholder key to handle qunantity display in item meta data under myaccount\n\t\t\t\t$ppom_meta['ppom_has_quantities'] = array('name'=>$key, 'value'=>$value['qty'],'hidden'=>true);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t// NOTE: We have DISABLE this due to REST API values\n\t\t\tcase 'checkbox':\n\t\t\t\t\n\t\t\t\t$option_posted = $value;\n\t\t\t\t\n\t\t\t\tif( is_array($option_posted) ) {\n\t\t\t\t\t\n\t\t\t\t\t$option_posted = array_map('stripslashes', $option_posted);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$option_label_array = array();\n\t\t\t\t$options_data_array = array();\n\t\t\t\t\n\t\t\t\t$product = new WC_Product($product_id);\n\t\t\t\t$options_filter\t = ppom_convert_options_to_key_val($field_meta['options'], $field_meta, $product);\n\t\t\t\t\n\t\t\t\tforeach($option_posted as $posted_value) {\n\t\t\t\t\tforeach($options_filter as $option_key => $option) {\n\t \n\t $option_value = stripslashes($option['raw']);\n\t \n\t if( $posted_value == $option_value ) {\n\t $option_label_array[] = $option['label'];\n\t $options_data_array[] = array('option'=>$option['raw'],'price'=>$option['price'],'id'=>$option['option_id']);\n\t }\n\t }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( ppom_is_api_enable() ) {\n\t\t\t\t\t$meta_data = array('name'\t\t=>$field_title, \n\t\t\t\t\t\t\t\t\t\t'value'\t\t=> json_encode($options_data_array),\n\t\t\t\t\t\t\t\t\t\t'display'\t=> implode(',',$option_label_array), \n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=> implode(',',$option_label_array));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'select':\n\t\t\tcase 'radio':\n\t\t\t\t\n\t\t\t\t$posted_value = stripslashes($value);\n\t\t\t\t\n\t\t\t\t$option_price\t= '';\n\t\t\t\t$option_data\t= array();\n\t\t\t\t\n\t\t\t\t$product = new WC_Product($product_id);\n\t\t\t\t$options_filter\t = ppom_convert_options_to_key_val($field_meta['options'], $field_meta, $product);\n\t\t\t\t\n\t\t\t\tforeach($options_filter as $option_key => $option) {\n\t \n $option_value = stripslashes($option['raw']);\n \n if( $posted_value == $option_value ) {\n $option_price = $option['label'];\n $option_data[] = array('option'=>$option['raw'],'price'=>$option['price'],'id'=>$option['option_id']);\n break;\n }\n }\n\t\t\t\t\n\t\t\t\tif( ppom_is_api_enable() ) {\n\t\t\t\t\t$meta_data = array('name'\t\t=> $field_title, \n\t\t\t\t\t\t\t\t\t\t'value'\t\t=> json_encode($option_data),\n\t\t\t\t\t\t\t\t\t\t'display'\t=> $option_price, \n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$meta_data = array('name'\t\t=> $field_title, \n\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $option_price,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'measure':\n\t\t\t\t\n\t\t\t\t// if units are set for this\n\t\t\t\tif( !empty ($cart_item['ppom']['unit'][$key]) ) {\n\t\t\t\t\t$field_title .= ' ('.$cart_item['ppom']['unit'][$key].')';\n\t\t\t\t}\n\t\t\t\t$meta_data = array('name' => $field_title, 'value' => $value);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t$value = is_array($value) ? implode(\",\", $value) : $value;\n\t\t\t\t// $ppom_meta[$field_title] = stripcslashes($value);\n\t\t\t\t$meta_data = array('name'=>$field_title, 'value'=>stripcslashes($value));\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// Getting option price if field have\n\t\t$option_price = ppom_get_field_option_price( $field_meta, $value );\n\t\tif( $option_price != 0 ) {\n\t\t\t$meta_data['price'] = $option_price;\n\t\t}\n\t\t\n\t\t$meta_data_field = apply_filters('ppom_meta_data_field', $meta_data, $key, $field_meta, $product_id);\n\t\t$ppom_meta[$key] = $meta_data_field;\n\t}\n\t\n\t\n\t// ppom_pa($ppom_meta);\n\treturn apply_filters('ppom_meta_data', $ppom_meta, $cart_item, $context);\n}", "function qw_field_meta_value( $fields ) {\n\t$show_silent_meta = QW_Settings::get_instance()->get( 'show_silent_meta', FALSE );\n\t// Create a unique cache name\n\t$_cache_name = md5(json_encode($fields));\n\t// Check if we have any cache for this\n\t$meta_fields = get_transient( $_cache_name );\n\tif ( !$meta_fields ) {\n\t\t$meta_fields = [];\n\t\t// add meta keys to field list\n\t\t$meta = qw_get_meta_keys();\n\t\tforeach ( $meta as $key ) {\n\t\t\t$field_key = 'meta_' . str_replace( \" \", \"_\", $key );\n\n\t\t\t$key_is_not_silent = ( substr( $key, 0, 1 ) != '_' && substr( $key,\n\t\t\t\t\t0,\n\t\t\t\t\t3 ) != 'ww-' && substr( $key, 0, 3 ) != 'ww_' );\n\n\t\t\t// show all keys if show_silent_meta is true\n\t\t\t// otherwise, show any key that is not silent\n\t\t\tif ( $show_silent_meta || $key_is_not_silent ) {\n\t\t\t\t$meta_fields[ $field_key ] = array(\n\t\t\t\t\t'title' => 'Custom Field: ' . $key,\n\t\t\t\t\t'description' => 'Custom Field data with key: ' . $key,\n\t\t\t\t\t'output_callback' => 'qw_display_post_meta_value',\n\t\t\t\t\t'output_arguments' => TRUE,\n\t\t\t\t\t'meta_key' => $key,\n\t\t\t\t\t'form_callback' => 'qw_meta_value_form_callback',\n\t\t\t\t\t'content_options' => TRUE,\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\t\tset_transient( $_cache_name, $meta_fields, 900 );\n\t}\n\t$fields = array_merge($fields, $meta_fields);\n\treturn $fields;\n}", "function add_custom_field($args) {\n register_rest_field( array(\"post\", \"page\"), 'wpnext', \n array(\n 'get_callback' => array( &$this, 'custom_field_get' ),\n 'update_callback' => array( &$this, 'custom_field_update' ),\n 'schema' => array(\n 'description' => \"Components and listed values.\",\n 'type' => 'object',\n 'context' => array('view', 'edit')\n )\n )\n );\n }", "public function payment_fields() {\n\n $cc_form = new WC_Payment_Gateway_CC;\n $cc_form->id = $this->id;\n $cc_form->supports = $this->supports;\n $this->cc_form = $cc_form;\n $this->images_dir = plugin_dir_url(__FILE__).'../assets/images/';\n \n $form_template = realpath(dirname(__FILE__)).'/../templates/payment_form.php'; \n include_once($form_template); \n }", "function wpcp_save_postdata($post_id)\n{\n if (array_key_exists('wpcp_providerplans', $_POST)) {\n\n $wpcp_provider = sanitize_text_field($_POST['wpcp_provider']);\n $wpcp_providerplans = sanitize_text_field($_POST['wpcp_providerplans']);\n\n update_post_meta(\n $post_id,\n WPCP_PROVIDER,\n $wpcp_provider\n );\n update_post_meta(\n $post_id,\n WPCP_PROVIDERPLANS,\n $wpcp_providerplans\n );\n }\n\n if (array_key_exists('wpcp_server_state', $_POST)) {\n\n $state = sanitize_text_field($_POST['wpcp_server_state']);\n\n if ($state == 'Active')\n $state = WPCP_ACTIVE;\n elseif ($state == 'Suspended')\n $state = WPCP_SUSPENDED;\n elseif ($state == 'Cancelled')\n $state = WPCP_CANCELLED;\n elseif ($state == 'Terminated')\n $state = WPCP_TERMINATED;\n\n update_post_meta(\n $post_id,\n WPCP_STATE,\n $state\n );\n }\n\n if (array_key_exists(WPCP_ORDER_PRICE, $_POST)) {\n\n $price = sanitize_text_field($_POST[WPCP_ORDER_PRICE]);\n\n update_post_meta(\n $post_id,\n WPCP_ORDER_PRICE,\n $price\n );\n }\n}", "public function payment_fields() {\n\t\t\t\t?>\n\t\t\t\t<div class=\"wc-gateway-havanao\">\n\t\t\t\t\t<p><?php _e( 'Please enter the mobile number you want to charge:' ); ?></p>\n\t\t\t\t\t<input type=\"text\" name=\"havanao_phone_number\" class=\"wc-gateway-havanao__phone-number\" />\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}", "function wck_add_meta(){\n\t\tparent::wck_add_meta();\n\t}", "public static function save_meta( $post_id ) {\n\n\t\t/* Verify the nonce before proceeding. */\n\t\tif ( !isset( $_POST['sponsor-meta'] ) || !wp_verify_nonce( $_POST['sponsor-meta'], basename( __FILE__ ) ) )\n\t\t\treturn $post_id;\n\n\t\t$meta = array(\n\t\t\t'sponsor-url'\n\t\t);\n\n\t\tforeach ( $meta as $meta_key ) {\n\t\t\t$new_meta_value = $_POST[$meta_key];\n\n\t\t\t/* Get the meta value of the custom field key. */\n\t\t\t$meta_value = get_post_meta( $post_id, '_' . $meta_key , true );\n\n\t\t\t/* If there is no new meta value but an old value exists, delete it. */\n\t\t\tif ( '' == $new_meta_value && $meta_value )\n\t\t\t\tdelete_post_meta( $post_id, '_' . $meta_key , $meta_value );\n\n\t\t\t/* If a new meta value was added and there was no previous value, add it. */\n\t\t\telseif ( $new_meta_value && '' == $meta_value )\n\t\t\t\tadd_post_meta( $post_id, '_' . $meta_key , $new_meta_value, true );\n\n\t\t\t/* If the new meta value does not match the old value, update it. */\n\t\t\telseif ( $new_meta_value && $new_meta_value != $meta_value )\n\t\t\t\tupdate_post_meta( $post_id, '_' . $meta_key , $new_meta_value );\n\t\t}\n\t}", "public function register_meta_fields() {\n\n\t\t$args = array(\n\t\t\t'type' => 'boolean',\n\t\t\t'description' => 'Has this post been published to stage',\n\t\t\t'single' => true,\n\t\t\t'show_in_rest' => true,\n\t\t);\n\n\t\tregister_meta( 'post', 'lbn_published_stage', $args );\n\n\t\t$args['description'] = 'Has this post been published to production';\n\t\tregister_meta( 'post', 'lbn_published_production', $args );\n\t}", "function fmp_attachment_field_credit( $form_fields, $post ) {\n\t$form_fields['fmp-artist-first-name'] = array(\n\t\t'label' => 'Artist First Name',\n\t\t'input' => 'text',\n\t\t'value' => get_post_meta( $post->ID, 'fmp_artist_first_name', true )\n\t);\n\n\t$form_fields['fmp-artist-last-name'] = array(\n\t\t'label' => 'Artist Last Name',\n\t\t'input' => 'text',\n\t\t'value' => get_post_meta( $post->ID, 'fmp_artist_last_name', true )\n\t);\n\n\treturn $form_fields;\n}", "function add_custom_meta() {\n global $post;\n }", "function adleex_resource_post_insert($data,$postarr) {\nglobal $adleex_fields_value;\nglobal $adleex_fields;\n $type = $data['post_type'];\n if ($type!='resource') return $data;\n \n if (key_exists($type,$adleex_fields)) {\n\t\tforeach($adleex_fields[$type] as $boxname => $fields) {\n\t\t\tforeach($fields as $name => $field) {\n\t\t\t\tif (isset($postarr[$name])) $adleex_fields_value[$postarr['ID']][$name] = $postarr[$name];\n\t\t\t\telse $adleex_fields_value[$postarr['ID']][$name] = get_post_meta($postarr['ID'],$name,true);\n\t\t\t}\n\t\t}\n }\n $adleex_fields_value[$postarr['ID']]['post_type'] = $type;\n return $data;\n}", "function xpost_to_friendika_post_field_data($post_id) {\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)\n return;\n\n // security check\n if (!wp_verify_nonce( $_POST['xpost_to_friendika_nonce'], plugin_basename( __FILE__ )))\n return;\n\n // now store data in custom fields based on checkboxes selected\n if (isset($_POST['xpost_to_friendika'])) {\n\t\tupdate_post_meta($post_id, 'xpost_to_friendika', 1);\n\t} else {\n\t\tupdate_post_meta($post_id, 'xpost_to_friendika', 0);\n\t}\n}", "function edd_incentives_save_meta( $post_id ) {\n global $post;\n \n // Don't process if nonce can't be validated\n if( ! isset( $_POST['edd_incentives_nonce'] ) || ! wp_verify_nonce( $_POST['edd_incentives_nonce'], basename( __FILE__ ) ) ) return $post_id;\n\n // Don't process if this is an autosave\n if( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || isset( $_REQUEST['bulk_edit'] ) ) return $post_id;\n\n // Don't process if this is a revision\n if( $post->post_type == 'revision' ) return $post_id;\n\n // Don't process if the current user shouldn't be editing this\n if( ! current_user_can( 'edit_post', $post_id ) ) return $post_id;\n\n // Whitelisted fields\n $fields = apply_filters( 'edd_incentives_fields_save', array(\n '_edd_incentive_meta'\n ) );\n\n if( ! empty( $_FILES ) && isset( $_FILES['_edd_incentive_button_image'] ) ) {\n $image = wp_upload_bits( $_FILES['_edd_incentive_button_image']['name'], null, file_get_contents( $_FILES['_edd_incentive_button_image']['tmp_name'] ) );\n\n if( $image['error'] == false ) {\n $_POST['_edd_incentive_meta']['button_image'] = $image['url'];\n }\n }\n\n foreach( $fields as $field ) {\n if( isset( $_POST[$field] ) ) {\n if( is_array( $_POST[$field] ) ) {\n foreach( $_POST[$field] as $field_key => $field_value ) {\n if( is_string( $field_value ) ) {\n $_POST[$field][$field_key] = esc_attr( $field_value );\n }\n }\n\n $new = $_POST[$field];\n } else {\n if( is_string( $_POST[$field] ) ) {\n $new = esc_attr( $_POST[$field] );\n } elseif( is_int( $_POST[$field] ) ) {\n $new = absint( $_POST[$field] );\n } else {\n $new = $_POST[$field];\n }\n }\n \n $new = apply_filters( 'edd_incentives_save_' . $field, $new );\n update_post_meta( $post_id, $field, $new );\n } else {\n delete_post_meta( $post_id, $field );\n }\n }\n}", "function save_qr_meta( $post_data, $post_id, $meta_key, $form_settings ) {\n $type = $post_data['qr_code_type'];\n\n if( $type == '' && empty( $type ) ) {\n return;\n }\n\n $metadata = array(\n 'type' => $post_data['qr_code_type'],\n 'type_param' => $post_data['type_param']\n );\n\n update_post_meta( $post_id, $meta_key, $metadata );\n }", "function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}", "function meta_box_save( $post_id )\n{\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n \n // if our nonce isn't there, or we can't verify it, bail\n if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'meta_box_nonce' ) ) return;\n \n // if our current user can't edit this post, bail\n //if( !current_user_can( 'edit_post' ) ) return;\n\t\n\t// now we can actually save the data\n $allowed = array(\n 'a' => array( // on allow a tags\n 'href' => array() // and those anchors can only have href attribute\n )\n );\n // Make sure your data is set before trying to save it\n if( isset( $_POST['meta_box_manufacturer'] ) )\n update_post_meta( $post_id, 'meta_box_manufacturer', $_POST['meta_box_manufacturer'] );\n}", "public function register_meta_fields() \n {\n $coupon_fields = new_cmb2_box([\n 'id' => $this->cpt_prefix . '_metabox',\n 'title' => __( 'Coupon Details', 'ash' ),\n 'object_types' => [$this->cpt_prefix],\n 'context' => 'normal',\n 'priority' => 'high',\n 'show_names' => true, // Show field names on the left\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_type',\n 'name' => __( 'Type', 'ash' ),\n 'type' => 'select',\n 'options' => [\n 'flat' => __('Flat Discount', 'ash'),\n 'percent' => __('Percentage Discount', 'ash'),\n ],\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_amount',\n 'name' => __( 'Amount', 'ash' ),\n 'type' => 'text_small',\n 'attributes' => [\n 'type' => 'number',\n 'pattern' => '\\d*',\n ],\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_start_date',\n 'name' => __( 'Start Date', 'ash' ),\n 'type' => 'text_date',\n 'date_format' => __( 'd/m/Y', 'ash' ),\n ]);\n\n $coupon_fields->add_field([\n 'id' => $this->cpt_prefix . '_end_date',\n 'name' => __( 'End Date', 'ash' ),\n 'type' => 'text_date',\n 'date_format' => __( 'd/m/Y', 'ash' ),\n ]);\n }", "function _arc_meta_article_meta($event, $step, $data, $rs)\n{\n $articleId = !empty($rs['ID']) ? $rs['ID'] : null;\n $meta = _arc_meta('article', $articleId, true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= \"<p class='arc_meta_title'>\";\n $form .= tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '<br />';\n $form .= fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title');\n $form .= \"</p>\";\n $form .= \"<p class='edit-category-arc_meta_robots'>\";\n $form .= tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '<br />';\n $form .= selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots');\n $form .= '</p>';\n\n return $form . $data;\n}", "function ccwts_metabox_ticketsale_save( $post_id )\n{\n //if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n \n // if our nonce isn't there, or we can't verify it, bail\n //if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;\n \n // if our current user can't edit this post, bail\n //if( !current_user_can( 'edit_post' ) ) return;\n \n // now we can actually save the data\n /*$allowed = array( \n 'a' => array( // on allow a tags\n 'href' => array() // and those anchors can only have href attribute\n )\n );*/\n \n // Make sure your data is set before trying to save it\n if(basename( get_page_template() ) == 'page-biglietteria-2017.php' || basename( get_page_template() ) == 'page-biglietteria-2017-hotel.php' )\n {\n \n if( isset( $_POST['ccwts_ticketsale_id'] ) && intval($_POST['ccwts_ticketsale_id']) > 0)\n ccwts_field('ticketsale_id', $_POST['ccwts_ticketsale_id']);\n\n if(basename( get_page_template() ) == 'page-biglietteria-2017-hotel.php' ){\n if( isset( $_POST['ccwts_parkhotel_ticket_id'] ) && intval($_POST['ccwts_parkhotel_ticket_id']) > 0)\n ccwts_field('parkhotel_ticket_id', $_POST['ccwts_parkhotel_ticket_id']);\n }\n\n }\n //update_post_meta( $post_id, 'my_meta_box_text', wp_kses( $_POST['my_meta_box_text'], $allowed ) );\n \n //if( isset( $_POST['my_meta_box_select'] ) )\n //update_post_meta( $post_id, 'my_meta_box_select', esc_attr( $_POST['my_meta_box_select'] ) );\n \n // This is purely my personal preference for saving check-boxes\n //$chk = isset( $_POST['my_meta_box_check'] ) && $_POST['my_meta_box_select'] ? 'on' : 'off';\n //update_post_meta( $post_id, 'my_meta_box_check', $chk );\n}", "function wpbs_add_booking_meta($booking_id, $meta_key, $meta_value, $unique = false)\n{\n\n return wp_booking_system()->db['bookingmeta']->add($booking_id, $meta_key, $meta_value, $unique);\n\n}", "function pt_payment_meta(){\r\n global $post;\r\n\r\n $data = get_post_meta($post->ID,\"payment_data\",true);\r\n echo '<div>';\r\n echo '<ul id=\"payment_items\">';\r\n $c = 0;\r\n if (count($data) > 0){\r\n foreach((array)$data as $p ){\r\n if (isset($p['amount']) || isset($p['date'])){\r\n echo pt_print_payment_fields($c,$p);\r\n $c = $c +1;\r\n }\r\n }\r\n\r\n}\r\necho '</ul>';\r\n\r\n?>\r\n<span id=\"here\"></span>\r\n<span class=\"add\"><?php echo __('Add Payment'); ?></span>\r\n<script>\r\nvar $ =jQuery.noConflict();\r\n$(document).ready(function() {\r\n var count = <?php echo $c; ?>;\r\n $(\".add\").click(function() {\r\n count = count + 1;\r\n $('#payment_items').append('<? echo implode('',explode(\"\\n\",pt_print_payment_fields('count'))); ?>'.replace(/count/g, count));\r\n $('.pt-datepicker').datepicker();\r\n return false;\r\n });\r\n $(\".remove\").live('click', function() {\r\n $(this).parent().remove();\r\n });\r\n});\r\n</script>\r\n<style>#payment_items {list-style: none;}</style>\r\n<?php\r\necho '</div>';\r\n}", "function add_vendor_custom_fields() {\n\n\twp_nonce_field( basename( __FILE__ ), 'vendor_custom_fields_nonce' );\n\t?>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-firstname\"><?php esc_html_e( 'First Name', 'woocommerce-product-vendors' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" class=\"input-text\" name=\"firstname\" id=\"wcpv-firstname\" value=\"<?php if ( ! empty( $_POST['firstname'] ) ) echo esc_attr( trim( $_POST['firstname'] ) ); ?>\" tabindex=\"1\" />\n\t</div>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-lastname\"><?php esc_html_e( 'Last Name', 'woocommerce-product-vendors' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" class=\"input-text\" name=\"lastname\" id=\"wcpv-lastname\" value=\"<?php if ( ! empty( $_POST['lastname'] ) ) echo esc_attr( trim( $_POST['lastname'] ) ); ?>\" tabindex=\"2\" />\n\t</div>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-date_of_birth\"><?php esc_html_e( 'Date of birth', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"date\" name=\"date_of_birth\" id=\"wcpv-date_of_birth\" value=\"<?php if ( ! empty( $_POST['date_of_birth'] ) ) echo esc_attr( trim( $_POST['date_of_birth'] ) ); ?>\" placeholder=\"DD / MM / YY\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-address\"><?php esc_html_e( 'Personal Address', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"address\" id=\"wcpv-address\" value=\"<?php if ( ! empty( $_POST['address'] ) ) echo esc_attr( trim( $_POST['address'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-city\"><?php esc_html_e( 'City', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"city\" id=\"wcpv-city\" value=\"<?php if ( ! empty( $_POST['city'] ) ) echo esc_attr( trim( $_POST['city'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-zipcode\"><?php esc_html_e( 'Zip', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"zipcode\" id=\"wcpv-zipcode\" value=\"<?php if ( ! empty( $_POST['zipcode'] ) ) echo esc_attr( trim( $_POST['zipcode'] ) ); ?>\" />\n\t</div>\n\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-taxid\"><?php esc_html_e( 'Tax ID', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"taxid\" id=\"wcpv-taxid\" value=\"<?php if ( ! empty( $_POST['taxid'] ) ) echo esc_attr( trim( $_POST['taxid'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-business_address\"><?php esc_html_e( 'Business Address', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"business_address\" id=\"wcpv-business_address\" value=\"<?php if ( ! empty( $_POST['business_address'] ) ) echo esc_attr( trim( $_POST['business_address'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-bcity\"><?php esc_html_e( 'Business City', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"bcity\" id=\"wcpv-bcity\" value=\"<?php if ( ! empty( $_POST['bcity'] ) ) echo esc_attr( trim( $_POST['bcity'] ) ); ?>\" />\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"wcpv-bzipcode\"><?php esc_html_e( 'Business Zip', 'stillactive' ); ?> <span class=\"required\">*</span></label>\n\t\t<input type=\"text\" name=\"bzipcode\" id=\"wcpv-bzipcode\" value=\"<?php if ( ! empty( $_POST['bzipcode'] ) ) echo esc_attr( trim( $_POST['bzipcode'] ) ); ?>\" />\n\t</div>\n\n\t<?php\n}", "function jtl_save_testimonial_order_meta($post_id, $post) {\n\tif ($post->post_type == 'testimonial') {\n\t\t// Check to see if order value exists\n\t\t$meta_value = get_post_meta($post_id, 'jlt_testimonial_order', true);\n\t\tif (!$meta_value || empty($meta_value)) {\n\t\t\tadd_post_meta($post_id, 'jlt_testimonial_order', 0, true);\n\t\t}\n\t}\n\t\n}", "public function setCustomFields($value)\n {\n $this->setItemValue('custom_fields', (array)$value);\n }", "function foodpress_save_meta_data($post_id, $post){\n\t\t\tglobal $pagenow;\n\n\t\t\tif ( empty( $post_id ) || empty( $post ) ) return;\n\t\t\tif($post->post_type!='menu') return;\n\t\t\tif (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;\n\n\t\t\t// Prevent quick edit from clearing custom fields\n\t\t\tif (defined('DOING_AJAX') && DOING_AJAX) return;\n\t\t\tif ( is_int( wp_is_post_revision( $post ) ) ) return;\n\t\t\tif ( is_int( wp_is_post_autosave( $post ) ) ) return;\n\t\t\t\n\t\t\t// verify this came from the our screen and with proper authorization,\n\t\t\t// because save_post can be triggered at other times\n\t\t\tif( isset($_POST['fp_noncename']) ){\n\t\t\t\tif ( !wp_verify_nonce( $_POST['fp_noncename'], plugin_basename( __FILE__ ) ) ){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t$_allowed = array( 'post-new.php', 'post.php' );\n\t\t\tif(!in_array($pagenow, $_allowed)) return;\n\n\t\t\t/* Get the post type object. */\n\t\t\t$post_type = get_post_type_object( $post->post_type );\n\t\t\t\n\t\t\t\n\t\t\t// Check permissions\n\t\t\tif ( !current_user_can( $post_type->cap->edit_post, $post_id ) )\n\t\t\t\treturn;\t\n\n\t\t\t\n\t\t\t//save the post meta values\n\t\t\t//$fields_ar =apply_filters();\n\t\t\t\n\t\t\t$meta_fields = $this->foodpress_menu_metabox_array();\t\t\t\n\t\t\t\n\t\t\t// run through all the custom meta fields\n\t\t\tforeach($meta_fields as $mb=>$f_val){\n\t\t\t\t\n\t\t\t\tif(!empty($f_val)){\n\t\t\t\t\tif( $f_val['type']=='multiinput'){\n\t\t\t\t\t\tforeach($f_val['ids'] as $fvals){\n\t\t\t\t\t\t\t$this->fp_individual_post_values($fvals, $post_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->fp_individual_post_values($f_val['id'], $post_id);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//update_post_meta($post_id, 'test', $_POST['fp_menuicons']);\n\t\t\t\n\t\t\t// save user closed meta field boxes\n\t\t\t$fp_closemeta_value = (isset($_POST['fp_collapse_meta_boxes']))? $_POST['fp_collapse_meta_boxes']: '';\n\t\t\t\n\t\t\tfoodpress_save_collapse_metaboxes($post_id, $fp_closemeta_value );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// (---) hook for addons\n\t\t\tdo_action('foodpress_save_meta', $post_id);\t\n\t\t\t\t\n\t\t}", "public function payment_fields()\r\n {\r\n \r\n // ok, let's display some description before the payment form\r\n if ($this->description) {\r\n // display the description with <p> tags etc.\r\n echo wpautop(wp_kses_post($this->description));\r\n }\r\n \r\n // I will echo() the form, but you can close PHP tags and print it directly in HTML\r\n echo '<fieldset id=\"wc-' . esc_attr($this->id) . '-cc-form\" class=\"wc-credit-card-form wc-payment-form\" style=\"background:transparent;\">';\r\n \r\n // Add this action hook if you want your custom gateway to support it\r\n do_action('woocommerce_momo_form_start', $this->id);\r\n \r\n // I recommend to use inique IDs, because other gateways could already use #ccNo, #expdate, #cvc\r\n echo '<div class=\"form-row form-row-wide\"><label>Mobile Wallet Provider <span class=\"required\">*</span></label>\r\n\t\t\t\t<select id=\"epaygh_mobile_wallet_network\" name=\"epaygh_mobile_wallet_network\">\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"mtn\" selected>MTN</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"airtel\">Airtel</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"tigo\">Tigo</option>\r\n\t\t\t\t\t<option name=\"epaygh_mobile_wallet_network\" value=\"vodafone\">Vodafone</option>\r\n\t\t\t\t</select>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"form-row form-row-wide\"><label>Mobile Wallet Number <span class=\"required\">*</span></label>\r\n\t\t\t\t<input id=\"epaygh_mobile_wallet_number\" name=\"epaygh_mobile_wallet_number\" type=\"tel\">\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"form-row form-row-wide\"><label>Voucher </label>\r\n\t\t\t\t\t<input id=\"epaygh_payment_voucher\" name=\"epaygh_payment_voucher\" type=\"text\" autocomplete=\"off\"><br>\r\n\t\t\t\t\t<span class=\"required\">Leave empty if mobile network is not Vodafone</span>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div class=\"clear\"></div>';\r\n \r\n do_action('woocommerce_momo_form_end', $this->id);\r\n \r\n echo '<div class=\"clear\"></div></fieldset>';\r\n }", "function save_customfields($data, array $extra_cols=array())\n\t{\n\t\tforeach (array_keys((array)$this->customfields) as $name)\n\t\t{\n\t\t\tif (!isset($data[$field = $this->get_cf_field($name)])) continue;\n\n\t\t\t$where = array(\n\t\t\t\t$this->extra_id => isset($data[$this->autoinc_id]) ? $data[$this->autoinc_id] : $data[$this->db_key_cols[$this->autoinc_id]],\n\t\t\t\t$this->extra_key => $name,\n\t\t\t);\n\t\t\t$is_multiple = $this->is_multiple($name);\n\n\t\t\t// we explicitly need to delete fields, if value is empty or field allows multiple values or we have no unique index\n\t\t\tif(empty($data[$field]) || $is_multiple || !$this->extra_has_unique_index)\n\t\t\t{\n\t\t\t\t$this->db->delete($this->extra_table,$where,__LINE__,__FILE__,$this->app);\n\t\t\t\tif (empty($data[$field])) continue;\t// nothing else to do for empty values\n\t\t\t}\n\t\t\tforeach($is_multiple && !is_array($data[$field]) ? explode(',',$data[$field]) :\n\t\t\t\t// regular custom fields (!$is_multiple) eg. addressbook store multiple values comma-separated\n\t\t\t\t(array)(!$is_multiple && is_array($data[$field]) ? implode(',', $data[$field]) : $data[$field]) as $value)\n\t\t\t{\n\t\t\t\tif (!$this->db->insert($this->extra_table,array($this->extra_value => $value)+$extra_cols,$where,__LINE__,__FILE__,$this->app))\n\t\t\t\t{\n\t\t\t\t\treturn $this->db->Errno;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\t// no error\n\t}", "function payment_fields() {\n?>\n\t\t<?php if ($this->tran_mode=='sandbox') : ?><p><?php _e('TEST MODE/SANDBOX ENABLED', WC_Authorize_SIM::TEXT_DOMAIN); ?></p><?php endif; ?>\n\t\t<?php if ($this->description) : ?><p><?php echo wpautop(wptexturize($this->description)); ?></p><?php endif; ?>\n<?php\n\n\t}", "function meta_boxes_save() {\r\n\t\t\r\n\t\t// Only process if the form has actually been submitted\r\n\t\tif (\r\n\t\t\tisset( $_POST['_wpnonce'] ) &&\r\n\t\t\tisset( $_POST['post_ID'] )\r\n\t\t) {\r\n\t\t\t\r\n\t\t\t// Do nonce security check\r\n\t\t\twp_verify_nonce( '_wpnonce', $_POST['_wpnonce'] );\r\n\t\t\t\r\n\t\t\t// Grab post ID\r\n\t\t\t$post_ID = (int) $_POST['post_ID'];\r\n\t\t\t\r\n\t\t\t// Iterate through each possible piece of meta data\r\n\t\t\tforeach( $this->post_meta as $key => $value ) {\r\n\t\t\t\tif ( isset( $_POST['_' . $key] ) ) {\r\n\t\t\t\t\t$data = esc_html( $_POST['_' . $key] ); // Sanitise data input\r\n\t\t\t\t\tupdate_post_meta( $post_ID, '_' . $key, $data ); // Store the data\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function base_price_box_save( $post_id, $post ) {\n \tif ( ! current_user_can( 'edit_post', $post_id ) ) {\n \t\treturn $post_id;\n \t}\n \t// Verify this came from the our screen and with proper authorization,\n \t// because save_post can be triggered at other times.\n \tif ( ! isset( $_POST['base_price'] ) || ! wp_verify_nonce( $_POST['base_price_box_content_nonce'], basename(__FILE__) ) ) {\n \t\treturn $post_id;\n \t}\n \t// Now that we're authenticated, time to save the data.\n \t// This sanitizes the data from the field and saves it into an array $events_meta.\n \t$events_meta['base_price'] = esc_textarea( $_POST['base_price'] );\n \t// Cycle through the $events_meta array.\n \t// Note, in this example we just have one item, but this is helpful if you have multiple.\n \tforeach ( $events_meta as $key => $value ) :\n \t\t// Don't store custom data twice\n \t\tif ( 'revision' === $post->post_type ) {\n \t\t\treturn;\n \t\t}\n \t\tif ( get_post_meta( $post_id, $key, false ) ) {\n \t\t\t// If the custom field already has a value, update it.\n \t\t\tupdate_post_meta( $post_id, $key, $value );\n \t\t} else {\n \t\t\t// If the custom field doesn't have a value, add it.\n \t\t\tadd_post_meta( $post_id, $key, $value);\n \t\t}\n \t\tif ( ! $value ) {\n \t\t\t// Delete the meta key if there's no value\n \t\t\tdelete_post_meta( $post_id, $key );\n \t\t}\n \tendforeach;\n }", "function metabox_save_portfolio_meta($post_id, $post)\n\n {\n\n if (!wp_verify_nonce($_POST['eventmeta_noncename'], plugin_basename(__FILE__))) {\n\n\n\n return $post->ID;\n\n }\n\n\n\n // Is the user allowed to edit the post or page?\n\n if (!current_user_can('edit_post', $post->ID))\n\n\n\n return $post->ID;\n\n\n\n $headquarters = sanitize_text_field($_POST['_headquarters']);\n\n update_post_meta($post->ID, '_headquarters', $headquarters);\n\n\n\n $website_url = sanitize_text_field($_POST['_website_url']);\n\n update_post_meta($post->ID, '_website_url', $website_url);\n\n\n\n $regions = $_POST['_regions'];\n\n update_post_meta($post->ID, '_regions', $regions);\n\n\n\n $sector = $_POST['_sector'];\n\n update_post_meta($post->ID, '_sector', $sector);\n\n\n\n }" ]
[ "0.7428768", "0.6750175", "0.6736063", "0.66967684", "0.6656898", "0.66052705", "0.6504903", "0.6439696", "0.6401099", "0.6324445", "0.6324173", "0.6279511", "0.6201601", "0.6120508", "0.6110767", "0.6100246", "0.60905814", "0.60845697", "0.6062596", "0.6049495", "0.6016421", "0.6006842", "0.60010576", "0.5992214", "0.5986615", "0.59503245", "0.59061426", "0.5897777", "0.5882305", "0.58691394", "0.586749", "0.5861592", "0.5859637", "0.5855994", "0.5850695", "0.5847497", "0.5844588", "0.58425844", "0.5841806", "0.5841322", "0.5834891", "0.5818855", "0.5818669", "0.5818628", "0.58158326", "0.58142287", "0.58083117", "0.58082265", "0.57980746", "0.5796774", "0.5795048", "0.5793392", "0.5788858", "0.5787731", "0.5778591", "0.5774648", "0.5765766", "0.57619303", "0.57572365", "0.5745945", "0.57433176", "0.57336754", "0.57295406", "0.5726856", "0.5724343", "0.5722858", "0.5720891", "0.57169074", "0.5714146", "0.570966", "0.57082105", "0.57072175", "0.5693995", "0.5693375", "0.56867576", "0.56840026", "0.5682968", "0.5681463", "0.56653464", "0.56631124", "0.5658406", "0.5645795", "0.5642844", "0.5638855", "0.56342703", "0.5633392", "0.5631074", "0.5630107", "0.5626632", "0.5622676", "0.561845", "0.5608225", "0.56023735", "0.56003654", "0.55955535", "0.5593276", "0.55898196", "0.55894905", "0.5589034", "0.5585611" ]
0.7357231
1
Add the fairaddress number to the "View Order Details" page
function getfaircoin_edd_view_order_details( $payment_meta, $user_info ) { $fairaddress = isset( $payment_meta['fairaddress'] ) ? $payment_meta['fairaddress'] : 'none'; $fairsaving = isset( $payment_meta['fairsaving'] ) ? $payment_meta['fairsaving'] : '0'; ?> <div class="column-container"> <div class="column"> <strong><?php echo _e('FairSaving: ', 'edd-getfaircoin'); ?></strong> <input type="text" name="edd_fairsaving" value="<?php esc_attr_e( $fairsaving ); ?>" class="small-text" /> <p class="description"><?php _e( 'Customer FairSaving choice', 'edd-getfaircoin' ); ?></p> </div> <div class="column"> <strong><?php echo _e('FaircoinAddress: ', 'edd-getfaircoin'); ?></strong> <input type="text" name="edd_fairaddress" value="<?php esc_attr_e( $fairaddress ); ?>" class="medium-text" /> <p class="description"><?php _e( 'Customer Faircoin address', 'edd-getfaircoin' ); ?></p> </div> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewAddress(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n return $payment->viewAddress();\r\n }", "public function show(CustomerAddress $add)\n\t{\n\t\t//\n\t}", "public function display_account_order_details( ){\n\t\tif( $this->is_page_visible( \"order_details\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_order_details.php' );\n\t\t}\n\t}", "public function show(Address $address)\n {\n //\n }", "public function show(Address $address)\n {\n //\n }", "public function show(Address $address)\n {\n //\n }", "public function show(Address $address)\n\t{\n\t\t//\n\t}", "public function fetch(Mage_Sales_Model_Quote_Address $address)\n {\n if ($address->getDesconto()!=0)\n {\n $address->addTotal(array( 'code' => $this->getCode(),\n 'title' => Mage::getStoreConfig('payment/nitrocielo/texto_desconto_a_vista'),\n 'value' => $address->getDesconto() ));\n }\n }", "public function invoiceAddress() {\r\n $result = $this->clients->flatInvoice();\r\n foreach ($result as $key => $value) {\r\n $getAdress = $this->clients->companyAddress($value->CustomerCompanyID);\r\n $data = array('Params' => $getAdress[0]->Params);\r\n $response = $this->clients->invoiceAdressupdate($value->InvoiceID, $data);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "public function toString()\n\t{\n\t\treturn \"Customer on checkout page - Shipping address popup - created address is shown on [Shipping address] and [Billing address] section\";\n\t}", "public function getBillingAddress($includeOrdererDetails = false)\n {\n $address = \"\";\n\n if ($includeOrdererDetails) {\n $address .= $this->name . \"<br>\";\n $address .= ($this->program_name ? $this->program_name : $this->program->name) . \"<br>\";\n }\n\n $address .= $this->address1 . \"<br>\";\n $address .= $this->address2 ? $this->address2 . \"<br>\" : \"\";\n $address .= $this->address3 ? $this->address3 . \"<br>\" : \"\";\n $address .= $this->city . \", \" . $this->state . \" \" . $this->zip;\n\n return $address;\n }", "public function printDistributorAddress()\n {\n $str = '<address class=\"vcard\">';\n $str .= '<p>';\n $str .= '<strong class=\"org\">' . $this->name . '</strong>';\n if ( ! empty($this->address)) {\n $str .= '<br><span class=\"adr\">';\n $str .= '<span class=\"street-address\">' . $this->address . '</span>';\n if ( ! empty($this->city)) {\n $str .= '<br><span class=\"locality\">' . $this->city . '</span>';\n }\n if ( ! empty($this->region)) {\n $str .= ', <span class=\"region\">' . $this->region . '</span>';\n }\n if ( ! empty($this->postCode)) {\n $str .= ' <span class=\"postal-code\">' . $this->postCode . '</span>';\n }\n if ( ! empty($this->country)) {\n $str .= ', <span class=\"country-name\">' . $this->country . '</span>';\n }\n $str .= '</span>';\n }\n if ( ! empty($this->website)) {\n $str .= '<br><a href=\"' . $this->website . '\" class=\"url\">' . $this->website . '</a>';\n }\n if ( ! empty($this->contact)) {\n $str .= '<br>Contact: <span class=\"fn\">' . $this->contact . '</span>';\n }\n if ( ! empty($this->email)) {\n $str .= '<br>Email: <a href=\"mailto:' . $this->email . '\" class=\"email\">' . $this->email . '</a>';\n }\n if ( ! empty($this->phone)) {\n $str .= '<br>Phone: <span class=\"tel\">' . $this->phone . '</span>';\n }\n $str .= '</p>';\n $str .= '</address>';\n\n return $str;\n }", "public function actionAddressView($address_id)\r\n {\r\n $customer_id = Yii::$app->user->getId();\r\n $combinedAddress = [];\r\n $combinedAddress['address'] = CustomerAddress::findone([\r\n 'address_id' => $address_id,\r\n 'customer_id' => $customer_id\r\n ]);\r\n\r\n $address = CustomerAddressResponse::find()\r\n ->select('aq.question_ar, aq.question,aq.required, whitebook_customer_address_response.*')\r\n ->innerJoin('whitebook_address_question aq', 'aq.ques_id = address_type_question_id')\r\n ->where('address_id = :address_id', [':address_id' => $address_id])\r\n ->asArray()\r\n ->all();\r\n if ($address) {\r\n $combinedAddress['question'] = $address;\r\n }\r\n return $combinedAddress;\r\n }", "public function renderAddress()\n {\n echo $this->getAddressStringSingleLine();\n }", "public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }", "public function setBillingAddressAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n $billingAddressModel = $customerModel->getBilling();\n\n $billingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($billingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['billingAddressId' => $billingAddressModel->getId()]);\n }", "function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }", "public function display_address( $post ) {\n\t\t\t// output buffer start\n\t\t\tob_start();\n\n\t\t\t//nonce field for address meta box\n\t\t\twp_nonce_field( 'rt_restaurant_address_nonce', 'restaurant_address_nonce', false );\n\n\t\t\t// Array for address fields\n\t\t\t$addr = array( \"streetAddress\" => \"Street Address\", \"addressLocality\" => \"Locality\", \"addressRegion\" => \"Region\", \"postalCode\" => \"Postal Code\", \"addressCountry\" => \"Country\" );\n\n\t\t\t// Retriving address post meta for particular post.\n\t\t\t$add = get_post_meta( $post->ID, '_restaurant_address', true );\n\n\t\t\t//includes address html\n\t\t\trequire \\rtCamp\\WP\\rtRestaurants\\PATH . 'includes/views/address.php';\n\n\t\t\t// Get output buffer value into variable and clear output buffer\n\t\t\t$ob_address = ob_get_clean();\n\n\t\t\t/**\n\t\t\t * Filter for change post meta box display of address post meta.\n\t\t\t *\n\t\t\t * This filter allow user to change meta box of address post meta by passing output string.\n\t\t\t *\n\t\t\t * @since 0.1\n\t\t\t *\n\t\t\t * @param string $var Filter name\n\t\t\t * @param string $ob_address\n\t\t\t */\n\t\t\t$ob_address = apply_filters( 'rt_restaurant_address_html', $ob_address );\n\n\n\t\t\t/**\n\t\t\t * Action to add extra fields in address display\n\t\t\t * \n\t\t\t * @param string $ob_address\n\t\t\t */\n\t\t\tdo_action( 'rt_restaurants_address_display', $ob_address );\n\n\t\t\treturn $ob_address;\n\t\t}", "function viewStudentAddress( $sessionID, $addressID ) {\r\n\t\tif( $this->userCanViewStudent( $sessionID )) {\r\n\t\t\t$query = \"SELECT * FROM X_PNSY_ADDRESS WHERE ADDRESS_ID='$addressID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t\r\n\t\t\treturn mysql_fetch_assoc($result);\r\n\t\t}\r\n\t}", "public function getQuoteAddressId();", "public function actionAjaxAddress()\n { \n $detail = new QuotationDetail();\n $this->layout = false;\n if ( Yii::$app->request->post() ) {\n $customerId = Yii::$app->request->post()['customerId'];\n $address = Address::find()->where(['customer_id' => $customerId,'address_type'=>'billing'])->all();\n return $this->render('ajax-address', [\n 'address' => $address,\n ]);\n }\n }", "function getfaircoin_edd_display_checkout_fields() { // get user's fairaddress number if they already have one stored\r\n if ( is_user_logged_in() ) {\r\n $user_id = get_current_user_id();\r\n $fairaddress = get_the_author_meta( '_edd_user_fairaddress', $user_id );\r\n $fairsaving = get_the_author_meta( '_edd_user_fairsaving', $user_id );\r\n }\r\n $fairaddress = isset( $fairaddress ) ? esc_attr( $fairaddress ) : '';\r\n $fairsaving = isset( $fairsaving ) ? esc_attr( $fairsaving ) : '0';\r\n ?>\r\n <p id=\"edd-fairsaving-wrap\">\r\n <label class=\"edd-label\" for=\"edd_fairsaving\">\r\n <?php echo _e('FairSaving Service', 'edd-getfaircoin'); ?>\r\n </label>\r\n <span class=\"edd-description\">\r\n <?php echo _e('Check this if you\\'re not managing your own wallet yet, and want the FairSaving service team to take care of it.', 'edd-getfaircoin'); ?>\r\n </span>\r\n <input class=\"edd-checkbox\" type=\"checkbox\" name=\"edd_fairsaving\" id=\"edd-fairsaving\" value=\"<?php echo $fairsaving; ?>\" onclick=\"fairsaving_hide_fairaddress(this)\" />\r\n <br />\r\n </p>\r\n <p id=\"edd-fairaddress-wrap\">\r\n <label class=\"edd-label\" for=\"edd_fairaddress\">\r\n <?php echo _e('Faircoin Address', 'edd-getfaircoin'); ?>\r\n </label>\r\n <span class=\"edd-description\">\r\n <?php echo _e('Enter your FAIR Address so we can send your Faircoins to your wallet.', 'edd-getfaircoin'); ?>\r\n </span>\r\n <input class=\"edd-input\" type=\"text\" name=\"edd_fairaddress\" id=\"edd-fairaddress\" placeholder=\"<?php echo _e('Faircoin Address', 'edd-getfaircoin'); ?>\" value=\"<?php echo $fairaddress; ?>\" />\r\n </p>\r\n <?php\r\n}", "function drum_smart_address($address_array) {\n\t// Set up variables\n\t$street1 = $address_array['street1'];\n\t$street2 = $address_array['street2'];\n\t$city = $address_array['city'];\n\t$state = $address_array['state'];\n\t$zip = $address_array['zip'];\n\t// Format address for links to map\n\tif ($street2 == null) {\n\t\t$address = $street1 . ', ' . $street2 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t} else {\n\t\t$address = $street1 . ', ' . $city . ', ' . $state . ' ' . $zip;\n\t}\n\t// Create address output\n\t$output = $street1 . '<br />';\n\tif ($street2 != null) {\n\t\t$output .= $street2 . '<br />';\n\t}\n\t$output .= $city . ', ' . $state . ' ' . $zip;\n return $output;\n}", "public function getAddressId() \n {\n return $this->address_id;\n }", "public function viewAddresses($accountID)\n\t{\n\t\thome::displayHeader();\n\t\taccountController::displayHeader($accountID);\n\n\t\t$addresses = Address::where('Account_Id', $accountID)\n\t\t\t\t\t\t\t->orderby('Address_Id', 'ASC');;\n\n\t\tself::view('address/addresses', ['addresses' => $addresses->get()]);\n\t}", "public function showAction(Address $address)\n {\n $apiKeyGOGR = \"AIzaSyDWi3w0hvwNzy1OYnVcRImnDH2bhBFNV8M\";\n $apiKeyJDD = \"AIzaSyAa232Ch8q6OuI0qAkNV4s36dSJKSCaswc\";\n $deleteForm = $this->createDeleteForm($address);\n\n return $this->render('address/show.html.twig', array(\n 'address' => $address,\n 'delete_form' => $deleteForm->createView(),\n 'apikey' => $apiKeyJDD,\n ));\n }", "public function getAddress() {\n if($this->isCash) {\n return $this->getPdfUrl(Dotpay::getInstance()->getSettings()->getPaymentUrl());\n } else {\n return $this->getBankPage(Dotpay::getInstance()->getSettings()->getPaymentUrl());\n }\n }", "public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }", "public function fetch(Mage_Sales_Model_Quote_Address $address)\n {\n if ($address->getInterest() != 0)\n {\n $address->addTotal(array\n (\n 'code' => $this->getCode(),\n 'title' => Mage::helper('azpay')->__('Interest'),\n 'value' => $address->getInterest()\n ));\n }\n }", "protected function drawAddresses($page, $order)\n {\n /* Add table head */\n $this->_setFontBold($page, 14);\n $page->setFillColor(new \\Zend_Pdf_Color_GrayScale(0));\n\n $this->y -= 15;\n $page->drawText(__('Bill to :'), 30, $this->y, 'UTF-8');\n $page->drawText(__('Ship to :'), 300, $this->y, 'UTF-8');\n\n $billingAddress = explode(\"\\n\", $order->getBillingAddress());\n $shippingAddress = explode(\"\\n\", $order->getShippingAddress());\n\n $this->_setFontRegular($page, 12);\n $i = 0;\n foreach($billingAddress as $line) {\n $line = str_replace(\"\\r\", \"\", $line);\n if ($line) {\n $page->drawText($line, 60, $this->y - 20 - ($i * 13), 'UTF-8');\n $i++;\n }\n }\n\n $j = 0;\n foreach($shippingAddress as $line) {\n $line = str_replace(\"\\r\", \"\", $line);\n if ($line) {\n $page->drawText($line, 330, $this->y - 20 - ($j * 13), 'UTF-8');\n $j++;\n }\n }\n\n $maxLines = max(($i), ($j));\n\n $this->y -= $maxLines * 20 + 20;\n }", "public function Edit_details_form() {\n\t\t$this->load->model('mlist');\n\t\t$dealerships = $this->mlist->getClients();\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t$user->Address = mod_parser($user->Address);\n\t\t$user->CompanyAddress = mod_parser($user->CompanyAddress);\n\t\t$user->Email = mod_parser($user->Emails,false,true);\n\t\t$user->Phone = mod_parser($user->Phones,false,true);\n\t\t\n\t\t$page = $_GET['page'];\n\t\t\n\t\t$data = array(\n\t\t\t'user'=>$user,\n\t\t\t'dealerships'=>$dealerships,\n\t\t\t'page'=>$page\n\t\t);\t\n\t\t$this->load->dom_view('forms/users/edit_details', $this->theme_settings['ThemeViews'], $data);\n\t}", "function wc_veruspay_display_crypto_address_in_admin( $order ) {\n\tglobal $wc_veruspay_global;\n\t$order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;\n\t$wc_veruspay_payment_method = $order->get_payment_method();\n\tif ( $wc_veruspay_payment_method == $wc_veruspay_global['id'] ){\n\t\t$wc_veruspay_order_status = get_post_meta( $order_id, '_wc_veruspay_status', TRUE );\n\t\tif ( $wc_veruspay_order_status == 'noaddress' ) {\n\t\t\tforeach ( $order->get_items() as $item_key => $item_values) { \n\t\t\t\t$wc_veruspay_stock = get_post_meta( $item_values['variation_id'], '_manage_stock', TRUE ); \n\t\t\t}\n\t\t\tupdate_post_meta( $order_id, '_wc_veruspay_status', sanitize_text_field( 'cancelled' ) );\n\t\t\t$order->update_status( 'cancelled', __( 'Missing Payment Address', 'woocommerce') );\n\t\t\theader(\"Refresh:0\");\n\t\t}\n\t\telse {\n\t\t\tif ( $order->has_status( 'processing' ) ) {\n\t\t\t\t$wc_veruspay_payment_status = 'Received';\n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_paid', TRUE );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$wc_veruspay_payment_status = 'Pending'; \n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_price', TRUE ); \n\t\t\t}\n\t\t\t$wc_veruspay_address = get_post_meta( $order_id, '_wc_veruspay_address', TRUE );\n\t\t\t$_chain_up = strtoupper( get_post_meta( $order_id, '_wc_veruspay_coin', TRUE ) );\n\t\t\t$_chain_lo = strtolower( $_chain_up );\n\t\t\techo '<style>.wc-order-totals-items{height:3rem!important}.wc-order-totals-items:after{content: \"' . $_chain_up . ' ' . $wc_veruspay_payment_status . ': ' . $wc_veruspay_price . '\"!important;position:relative;font-size:1rem;font-weight:bold;color:#007bff!important;top:0;float:right;width:200px;height:30px;}</style>';\n\t\t\techo '<p><strong>'.__( $_chain_up . ' Price', 'woocommerce' ).':</strong>' . $wc_veruspay_price . ' with exchange rate of ' . get_post_meta( $order_id, '_wc_veruspay_rate', TRUE ) . '</p>';\n\t\t\tif ( substr($wc_veruspay_address, 0, 2) !== 'zs' ) {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> <a target=\"_BLANK\" href=\"' . $wc_veruspay_global['chain_dtls'][$_chain_lo]['address'] . $wc_veruspay_address . '\">' . $wc_veruspay_address . '</a></p>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> '.$wc_veruspay_address.'</p';\n\t\t\t}\n\t\t}\n\t}\n}", "public function vieworderdetails($orderno, $bid_type)\r\n {\r\n $orderbookdetails = DB::table('place_bid')\r\n ->select('*')\r\n ->where('order_no', $orderno)\r\n ->where('bid_type', $bid_type)\r\n ->get();\r\n return view('dam.iex.orderbook.vieworderdetails',compact('orderbookdetails'));\r\n }", "function receipt_page($order) {\n echo '<p>' . __('Gracias! - Tu orden ahora está pendiente de pago. Deberías ser redirigido automáticamente a la página de transbank.') . '</p>';\n\n echo $this->generate_webpayplus_form($order);\n }", "public function setEntryDetailSequenceNumber( $number ) {\n\t\t$this->entryDetailSequence = $number;\n\t\t$this->addField( new ACHRecordField([88,94], $this->entryDetailSequence));\n\t}", "function viewCustomerFullAddress(){\n $customer = new customerModel();\n $customer->cust_id = $_SESSION['userid'];\n return $customer->viewCustomerFullAddress();\n //retrieve data from customerModel\n }", "public function show(Customer $customer, Address $address)\n\t{\n //echo $id;\n //$customer = Customer::findOrFail($id);\n //echo $customer;\n $this->layout->content = View::make('addresses.show', compact('customer', 'address'))->with('heading', 'Show Address');\n\t}", "protected function insertAddress(&$page, $store = null)\r\n {\r\n $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));\r\n $font = $this->_setFontRegular($page, 10);\r\n $page->setLineWidth(0);\r\n $this->y = $this->y ? $this->y : 815;\r\n $top = 815;\r\n\r\n $collection = Mage::getModel('marketplace/userprofile')->getCollection()\r\n ->addFieldToFilter('mageuserid',array('eq'=>Mage::getSingleton('customer/session')->getCustomerId()));\r\n foreach ($collection as $row) {\r\n $address=$row->getOthersInfo();\r\n }\r\n\r\n foreach (explode(\"\\n\", $address) as $value){\r\n if ($value !== '') {\r\n $value = preg_replace('/<br[^>]*>/i', \"\\n\", $value);\r\n foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {\r\n $page->drawText(trim(strip_tags($_value)),\r\n $this->getAlignRight($_value, 130, 440, $font, 10),\r\n $top,\r\n 'UTF-8');\r\n $top -= 10;\r\n }\r\n }\r\n }\r\n $this->y = ($this->y > $top) ? $top : $this->y;\r\n }", "public function addAddress()\n\t{\n\t\treturn $this->editAddress();\n\t}", "public function order_details_data($order_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('Lorder');\n\t\t$content = $CI->lorder->order_details_data($order_id);\t\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function orderLink($in){\n\treturn( '<a href=\"https://www.google.com/dfp/'.DFP_NETWORK_ID.'?#delivery/OrderDetail/orderId='.$in.'\" target=\"_new\">'.$in.'</a>' );\n }", "function receipt_page( $order ) {\n\t\terror_reporting(E_ERROR);\n\t\tini_set('display_errors', 1);\n\n\t\techo '<p>'.__( 'Спасибо за ваш заказ. Нажмите кнопку, для перехода к оплате через Твои Платежи.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_payu_form( $order );\n\n\t}", "public function addresscardpdfAction() {\n Mage::log(\"addresscardpdfAction PostofficeController\", null, 'dpdlog.log');\n $orderId = (int)$this->getRequest()->getParam('order_id', 0);\n if ($orderId <= 0) {\n return;\n }\n $order = Mage::getModel('sales/order')->load($orderId);\n if (!$order || $order->getId() <= 0) {\n return;\n }\n $incrementId[] = $order->getIncrementId();\n Mage::log(\"addresscardpdfAction incrementId:\".print_r($incrementId, true), null, 'dpdlog.log');\n $res = Mage::helper('balticode_dpdlt')->getBarcodePdf2($incrementId);\n if ($res !== false) {\n header('Content-Type: application/pdf');\n header('Content-Disposition: attachment; filename=\"addresscard-' . $incrementId . '.pdf\"');\n\n echo $res->getBody();\n } else {\n echo 'No barcode available';\n }\n }", "public function chooseAddress() {\n\t\t$disposition = $this->DispositionManager->get();\n\t\t$collection = new Collection($disposition->addresses);\n\t\t$address_id = Hash::get($this->request->getQueryParams(), 'address');\n\t\t$choice = $collection->filter(function($address) use($address_id){\n\t\t\treturn $address->id == $address_id;\n\t\t});\n\t\t$this->DispositionManager->disposition->addresses = $choice->toArray();\n\t\t$this->DispositionManager->write();\n\t\t$this->autoRender = false;\n\t\t$this->redirect($this->refererStack(SYSTEM_CONSUME_REFERER));\n\t}", "public function addAddress(){\n\t\t$name = $_REQUEST['name'];\n\t\t$address = $_REQUEST['address'];\n $stuid = $_REQUEST['stuid'];\n\t\t$phone = $_REQUEST['phone'];\n\t\t$form = M(\"addressinfo\");\n\t\t$data['name'] = $name;\n \t$data['address'] = $address;\n \t$data['phone'] = $phone;\n $data['stuid'] = $stuid;\n \t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "function address() { return ($this->address); }", "function receipt_page( $order ) {\n\n\t\t\techo '<p>'. __( 'Thank you for your order, please click the button below to pay with eSewa.', 'esewa-payment-gateway-for-woocommerce' ) . '</p>';\n\t\t\techo $this->generate_esewa_form( $order );\n\n\t\t}", "function add_bankdetails()\r\n\t\t{\r\n\t\t\t$data['page']='add_bankdetails';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t}", "public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }", "function invoice_details_view($param1 = '')\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['code'] = $param1;\n $page_data['page_name'] = 'invoice_details';\n $page_data['page_title'] = get_phrase('invoice_details');\n $this->load->view('backend/index', $page_data);\n }", "function details() {\r\n\t\r\n\t\t// Id of the annonce\r\n\t\t$id = $_REQUEST['id'];\n\t\t\r\n\t\t// Find it\r\n\t\t$request = new Annonce();\r\n\t\t$request->id = $id;\r\n\t\t$res = $request->find();\r\n\t\r\n\t\t// Should have only one result\r\n\t\tif (sizeof($res) != 1) {\r\n\t\t\tthrow new InternalError(\"Expected one result for Annonce (id=$id). Got \" . sizeof($res));\r\n\t\t}\r\n\t\n\t\t$this->annonce = $res[0];\r\n\t\r\n\t\t// Redirect to list\r\n\t\t$this->renderView(\"detailsAnnonce\");\r\n\t}", "public function addAction() {\r\n \t$this->checkRight();\r\n \t$gid = $this->getInput('gid');\r\n \t$title = \"添加收货人地址\";\r\n \t$this->assign('title', $title);\r\n \t$this->assign('gid', $gid);\r\n }", "public function getUserAddressId()\n {\n return parent::getValue('user_address_id');\n }", "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "public function editAction() {\r\n \t$gid = $this->getInput('gid');\r\n \t$this->checkRight();\r\n \t$title = \"收货人地址修改\";\r\n \t$id = $this->getInput('id');\r\n \t$addressInfo = Gc_Service_UserAddress::getUserAddress($id);\r\n \t$this->assign('info', $addressInfo);\r\n \t$this->assign('title', $title);\r\n \t$this->assign('gid', $gid);\r\n }", "public function getStreetNumber();", "public function getOrderDetailId()\n {\n return $this->order_detail_id;\n }", "public function edit(Address $address)\n {\n //\n }", "function view(){\n\t\t$sale_number = $this->uri->segment(3);\n\n\t\t$data['purchase'] = $this->m_sale->get_one($sale_number)->row_array();\n\t\t$data['purchdetail'] = $this->m_sale->get_detail($sale_number);\n\n\t\t$this->template->load('inv_template', 'orders/v_view_sale', $data);\n\t}", "public function onBeforeUseMemberAddress() {\n if($this->owner->onlyDownloadable()) {\n $id = $this->owner->request->param(\"ID\");\n $otherid = $this->owner->request->param(\"OtherID\");\n $data = array();\n $address = MemberAddress::get()->byID($id);\n\n if($address) {\n $data = array();\n\n $data['DeliveryFirstnames'] = $address->FirstName;\n $data['DeliverySurname'] = $address->Surname;\n $data['DeliveryAddress1'] = $address->Address1;\n $data['DeliveryAddress2'] = $address->Address2;\n $data['DeliveryCity'] = $address->City;\n $data['DeliveryPostCode'] = $address->PostCode;\n $data['DeliveryCountry'] = $address->Country;\n\n Session::set(\"Checkout.DeliveryDetailsForm.data\", $data);\n }\n }\n }", "function retrieveAddress()\n{\n $usertoken = $_SESSION['usertoken'];\n\n //here is where you can override what the default values were set for your site. If you have a piece of content that\n //should be priced differently, you can set that value here\n $payload = array(\n// 'required_confirmations_override' => 3, //optional, default 0\n// 'amount_override' => 1, //optional\n// 'denomination_override' => 'usd' //optional\n );\n\n //this will return a jsonencoded array with an address, auto created if not found, and payment info if found\n $endpoint = 'https://api.coinbee.io/retrieve/' . $usertoken;\n\n return json_encode(doCurl($endpoint, $payload));\n}", "function ship_detail()\n\t\t{\n\t\t\t$id_kapal = $this->uri->segment(5);\n\t\t\t// echo $id_kapal;\n\t\t\t$data['ship'] = $this->ship_model->get_detail_ship($id_kapal);\n\t\t\t$data['detail_ship'] = $this->ship_model->get_ships_type($data['ship']['id_ship_type']);\n\t\t\t$template = \"vacantsea/template_detail\"; //memanggil template selain di dalam company\n\t\t\t$new_page = \"company/detail_company/ships/ships_detail\"; //halaman detail yang baru jika tidak menggunakan template detail company\n\t\t\t$this->directPageDetails(\"ships/ships_detail\",\"\",$data, $template, $new_page);\n\t\t}", "function view_one()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['bid'] = $this->_bid->details(array('bid_id'=>$data['d']));\n\t\tif(empty($data['bid'])) $data['msg'] = \"ERROR: No bid information could be resolved.\";\n\t\t\n\t\t$this->load->view('bids/bid_details', $data);\n\t}", "public function show_refund_address() {\n\t\treturn $this->get_option( 'show_refund_address', 'no' ) == 'yes';\n\t}", "function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = \"\\n\") {\n\t$address_query = tep_db_query(\"select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id = '\" . (int)$customers_id . \"' and address_book_id = '\" . (int)$address_id . \"'\");\n\t$address = tep_db_fetch_array($address_query);\n\t\n\t$format_id = tep_get_address_format_id($address['country_id']);\n\t\n\treturn tep_address_format($format_id, $address, $html, $boln, $eoln);\n}", "public static function geoCart_initSteps_addOtherDetails()\n {\n //Possible enhancement: perhaps show final fee table on other detail page?\n return false;\n }", "public function address(): string\n {\n return $this->address;\n }", "function eZAddress( $id = \"\" )\n {\n if ( $id != \"\" )\n {\n $this->ID = $id;\n $this->get( $this->ID );\n }\n }", "public function display_listing_order()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$this->data['heading'] = 'Rental Listing Payment';\n\t\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\t\tif ($rep_code != '') {\n\t\t\t\t$condition = ' and u.rep_code=\"' . $rep_code . '\"';\n\t\t\t} else {\n\t\t\t\t$condition = '';\n\t\t\t}\n\t\t\t$this->data['listingorderList'] = $this->order_model->view_listingorder_details('Paid', $condition);\n\t\t\t$this->load->view('admin/order/display_listing_orders', $this->data);\n\t\t}\n\t}", "private function get_address()\n\t{\n\t\treturn $this->m_address;\n\t}", "public function fetch(Mage_Sales_Model_Quote_Address $address) {\r\n $amt = $address->getDeliveryCost();\r\n /**\r\n * check if $amt is not zero \r\n */\r\n if($amt !=0){\r\n $address->addTotal(array(\r\n 'code'=>$this->getCode(),\r\n 'title'=>Mage::helper('deliveryschedule')->__('Delivery Cost'),\r\n 'value'=> $amt\r\n ));\r\n }\r\n /**\r\n * return array\r\n */\r\n return $this;\r\n }", "public function handleAddress ()\n {\n /**\n * Wir verzichten der Übersichtlichkeit halber auf eine Validierung. Eigentlich müsste hier eine Daten-\n * validierung durchgeführt werden und etwaige Fehler an den User zurückgespielt werden. Im Login machen wir das\n * beispielsweise und auch bei der Bearbeitung eines Produkts. Der nachfolgende Code dürfte gar nicht mehr\n * ausgeführt werden, wenn Validierungsfehler aufgetreten sind.\n */\n\n /**\n * Eingeloggten User abfragen\n */\n $user = User::getLoggedInUser();\n\n /**\n * Wurde das linke Formular abgeschickt?\n */\n if (isset($_POST['address_id'])) {\n /**\n * Ausgefühlte AddressId in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt wieder\n * verwenden können.\n */\n Session::set(self::ADDRESS_KEY, (int)$_POST['address_id']);\n }\n\n /**\n * Wurde das rechte Formular abgeschickt?\n */\n if (isset($_POST['address'])) {\n /**\n * Neue Addresse erstellen und in die Datenbank speichern.\n */\n $address = new Address();\n $address->address = $_POST['address'];\n $address->user_id = $user->id;\n $address->save();\n\n /**\n * ID der neu erstellten Adresse in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt\n * wieder verwenden können.\n */\n Session::set(self::ADDRESS_KEY, (int)$address->id);\n }\n\n /**\n * Weiterleiten auf den nächsten Schritt im Checkout Prozess.\n */\n $baseUrl = Config::get('app.baseUrl');\n header(\"Location: {$baseUrl}checkout/final\");\n }", "public function getOrderDetailLink($orderId) {\n \n }", "public function viewAction()\n {\n $this->loadLayout();\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('oggetto_oneclick/order')->load($id);\n Mage::register('order', $model);\n $this->renderLayout();\n }", "public function listOrderCWithAddress(Request $request)\n {\n $this->setPageHeader('List Order Pin Plan-C (With Address)');\n if (!$this->user->hasAccessRoute('admin.pinc.order.address')) return view('404');\n $orders = $this->PinC->getAllOrdersWithAddress();\n return view('admin.planc.list_order_address')->with('orders', $orders);\n }", "public function viewAction()\n {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n if (!$orderId) {\n $this->_redirect('sales/order/history');\n return;\n }\n\n $order = Mage::getModel('oscommerce/oscommerce')->loadOrderById($orderId);\n if ($order && $this->_canViewOrder($order['order'])) {\n Mage::register('current_oscommerce_order', $order);\n $this->loadLayout();\n if ($navigationBlock = $this->getLayout()->getBlock('customer_account_navigation')) {\n $navigationBlock->setActive('oscommerce/order/view');\n }\n \n $this->renderLayout();\n }\n else {\n $this->_redirect('sales/order/history');\n }\n }", "public function viewAddressHelper($addresses)\n\t{\t\n\t\tfor($count = 0; $count < $addresses->count(); $count++)\n\t\t{\n\t\t\t$address = $addresses->get($count);\n\n\t\t\tself::view('address/address', [\n\t\t\t\t'accountID' => $_SESSION['accountID'],\n\t\t\t\t'addressID' => $address->Address_Id,\n\t\t\t\t'addressLine1' => $address->Address_Line_1,\n\t\t\t\t'addressLine2' => $address->Address_Line_2,\n\t\t\t\t'city' => $address->City,\n\t\t\t\t'stateProvince' => $address->State_Province,\n\t\t\t\t'zipPostalCode' => $address->Zip_Postal_Code,\n\t\t\t\t'country' => $address->Country,\n\t\t\t\t'addressIndex' => $count]);\n\t\t}\n\t}", "public function edit(Address $address)\n\t{\n\t\t//\n\t}", "public function addressDetail(){\n $province = array('0'=>'กรุงเทพมหานคร','1'=>'กระบี่','2'=>'กาญจนบุรี','3'=>'กาฬสินธุ์','4'=>'กำแพงเพชร','5'=>'ขอนแก่น','6'=>'จันทบุรี','7'=>'ฉะเชิงเทรา','8'=>'ชลบุรี','9'=>'ชัยนาท','10'=>'ชัยภูมิ','11'=>'ชุมพร','12'=>'เชียงราย','13'=>'เชียงใหม่','14'=>'ตรัง','15'=>'ตราด','16'=>'ตาก','17'=>'นครนายก','18'=>'นครปฐม','19'=>'นครพนม','20'=>'นครราชสีมา','21'=>'นครศรีธรรมราช','22'=>'นครสวรรค์','23'=>'นนทบุรี','24'=>'นราธิวาส','25'=>'น่าน','26'=>'บึงกาฬ','27'=>'บุรีรัมย์','28'=>'ปทุมธานี','29'=>'ประจวบคีรีขันธ์','30'=>'ปราจีนบุรี','31'=>'ปัตตานี','32'=>'พระนครศรีอยุธยา','33'=>'พังงา','34'=>'พัทลุง','35'=>'พิจิตร','36'=>'พิษณุโลก','37'=>'เพชรบุรี','38'=>'เพชรบูรณ์','39'=>'แพร่','40'=>'พะเยา','41'=>'ภูเก็ต','42'=>'มหาสารคาม','43'=>'มุกดาหาร','44'=>'แม่ฮ่องสอน','45'=>'ยะลา','46'=>'ยโสธร','47'=>'ร้อยเอ็ด','48'=>'ระนอง','49'=>'ระยอง','50'=>'ราชบุรี','51'=>'ลพบุรี','52'=>'ลำปาง','53'=>'ลำพูน','54'=>'เลย','55'=>'ศรีสะเกษ','56'=>'สกลนคร','57'=>'สงขลา','58'=>'สตูล','59'=>'สมุทรปราการ','60'=>'สมุทรสงคราม','61'=>'สมุทรสาคร','62'=>'สระแก้ว','63'=>'สระบุรี','64'=>'สิงห์บุรี','65'=>'สุโขทัย','66'=>'สุพรรณบุรี','67'=>'สุราษฎร์ธานี','68'=>'สุรินทร์','69'=>'หนองคาย','70'=>'หนองบัวลำภู','71'=>'อ่างทอง','72'=>'อุดรธานี','73'=>'อุทัยธานี','74'=>'อุตรดิตถ์','75'=>'อุบลราชธานี','76'=>'อำนาจเจริญ');\n\n $tmp = explode(\",,\", $this->address);\n $arr['addressNo'] = $tmp[0];\n $arr['moo'] = $tmp[1];\n $arr['street'] = $tmp[2];\n $arr['subdistrict'] = $tmp[3];\n $arr['district'] = $tmp[4];\n $arr['province'] = $province[$tmp[5]];\n $arr['zipcode'] = $tmp[6];\n $arr['provinceNo'] = $tmp[5];\n return $arr;\n }", "public function editAddressAction() {\n\n //USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET PAGE ID, PAGE OBJECT AND THEN CHECK PAGE VALIDATION\n $resource_type = $this->_getParam('resource_type');\n switch ($resource_type) {\n case 'group':\n $id = 'group_id';\n $itemTable = Engine_Api::_()->getItemTable('group');\n $route = 'sitetagcheckin_groupspecific';\n break;\n\n case 'user':\n $id = 'user_id';\n $itemTable = Engine_Api::_()->getDbtable('users', 'user');\n $route = 'sitetagcheckin_userspecific';\n break;\n\n case 'event':\n $id = 'event_id';\n $itemTable = Engine_Api::_()->getItemTable('event');\n $route = 'sitetagcheckin_specific';\n break;\n }\n\n $seao_locationid = $this->_getParam('seao_locationid');\n $resource_id = $this->_getParam($id);\n $resource = Engine_Api::_()->getItem($resource_type, $resource_id);\n\n $this->view->form = $form = new Sitetagcheckin_Form_Address(array('item' => $resource));\n\n //POPULATE FORM\n if (!$this->getRequest()->isPost()) {\n $form->populate($resource->toArray());\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n\n $values = $form->getValues();\n\n //Update field value\n if ($resource_type == 'user') {\n\n $aliasValues = Engine_Api::_()->fields()->getFieldsValuesByAlias($resource);\n\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $table_exist = $db->query('SHOW TABLES LIKE \\'engine4_user_fields_search\\'')->fetch();\n if (!empty($table_exist)) {\n $column_exist = $db->query('SHOW COLUMNS FROM engine4_user_fields_search LIKE \\'location\\'')->fetch();\n }\n\n $profilemapsTable = Engine_Api::_()->getDbtable('profilemaps', 'sitetagcheckin');\n $profilemapsTablename = $profilemapsTable->info('name');\n\n $select = $profilemapsTable->select()->from($profilemapsTablename, array('profile_type'));\n if (empty($aliasValues['profile_type'])) {\n $select->where($profilemapsTablename . '.option_id = ?', 1);\n } else {\n $select->where($profilemapsTablename . '.option_id = ?', $aliasValues['profile_type']);\n }\n $option_id = $select->query()->fetchColumn();\n\n if (!empty($option_id)) {\n $valuesTable = Engine_Api::_()->fields()->getTable('user', 'values');\n $valuesTableName = $valuesTable->info('name');\n\n $select = $valuesTable->select()\n ->from($valuesTableName, array('item_id'))\n ->where($valuesTableName . '.item_id = ?', $resource_id)\n ->where($valuesTableName . '.field_id = ?', $option_id);\n $valuesResultsLocation = $select->query()->fetchColumn();\n if (!empty($valuesResultsLocation)) {\n Engine_Api::_()->fields()->getTable('user', 'values')->update(array('value' => $values['location']), array('item_id =?' => $resource_id, 'field_id =?' => $option_id));\n\n if (!empty($column_exist)) {\n Engine_Api::_()->fields()->getTable('user', 'search')->update(array('location' => $values['location']), array('item_id =?' => $resource_id));\n }\n } else {\n $valuesTable = Engine_Api::_()->fields()->getTable('user', 'values');\n $row = $valuesTable->createRow();\n $row->item_id = $resource_id;\n $row->field_id = $option_id;\n $row->index = 0;\n $row->value = $values['location'];\n $row->save();\n if (!empty($column_exist)) {\n Engine_Api::_()->fields()->getTable('user', 'search')->update(array('location' => $values['location']), array('item_id =?' => $resource_id));\n }\n }\n }\n }\n\n $resource->location = $values['location'];\n if (empty($values['location'])) {\n //DELETE THE RESULT FORM THE TABLE.\n Engine_Api::_()->getDbtable('locationitems', 'seaocore')->delete(array('resource_id =?' => $resource_id, 'resource_type = ?' => $resource_type));\n $resource->seao_locationid = '0';\n }\n $resource->save();\n unset($values['submit']);\n\n if (!empty($values['location'])) {\n\n //DELETE THE RESULT FORM THE TABLE.\n Engine_Api::_()->getDbtable('locationitems', 'seaocore')->delete(array('resource_id =?' => $resource_id, 'resource_type = ?' => $resource_type));\n\n $seaoLocation = Engine_Api::_()->getDbtable('locationitems', 'seaocore')->getLocationItemId($values['location'], '', $resource_type, $resource_id);\n\n //group table entry of location id.\n $itemTable->update(array('seao_locationid' => $seaoLocation), array(\"$id =?\" => $resource_id));\n }\n\n $db->commit();\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 500,\n 'parentRedirect' => $this->_helper->url->url(array('action' => 'edit-location', 'seao_locationid' => $seaoLocation, \"$id\" => $resource_id, \"resource_type\" => $resource_type), \"$route\", true),\n 'parentRedirectTime' => '2',\n 'format' => 'smoothbox',\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your location has been modified successfully.'))\n ));\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }", "public function detail() {\n $url = explode('/', $_GET['url']);\n $id = $url[2];\n $this->loadView('detail', 'content');\n $client = $this->em->selectById('client', $id);\n $village = $this->em->selectById('village', $client->getIdVillage());\n $this->loadHtml($client->getId(), 'id');\n $this->loadHtml($client->getNomFamille(), 'nomFamille');\n $this->loadHtml($village->getNom(), 'village');\n $this->loadHtml($client->getTelephone(), 'telephone');\n $this->dom->getElementById('lien_client')->href .= $id;\n }", "public function updateCustomerAddressAction() {\n if(!Mage::app()->getRequest()->isAjax()){\n $this->norouteAction();\n exit;\n }\n\n $postData = $this->getRequest()->getPost();\n parse_str($postData['form'], $billing);\n\n $customer = $this->_getCustomer();\n\n $address = new Varien_Object();\n $address->addData(\n array(\n 'state' => $billing['state'],\n 'city' => $billing['city'],\n 'street' => $billing['street'],\n 'zip_code' => $billing['zipcode'],\n 'firstname' => $billing['firstname'],\n 'lastname' => $billing['lastname'],\n 'telephone' => $billing['telephone'],\n 'phone_number' => $billing['telephone'],\n 'country_code' => $billing['country_id'],\n )\n );\n\n $response = Mage::getModel(\"payments/api\")->updateBilling($customer->getId(), $address);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('token' => $response)));\n }", "public function addAddress($address, $name = ''){ \n $this->adresses[$address]= $name;\n }", "public function key() {\n\t\treturn \"Address\";\n\t}", "public function getStreetNumber() {\n\t\treturn $this->streetNumber;\n\t}", "public function appendAddressDataToBillingStep($observer)\n {\n if( false === Mage::getModel('postident/config')->isEnabled()\n || false === Mage::getModel('postident/config')->getAddressDataUsage()) {\n return;\n }\n \n if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Billing \n && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Billing\n ) {\n $transport = $observer->getTransport();\n $block = $observer->getBlock();\n $layout = $block->getLayout();\n $html = $transport->getHtml();\n $addAddressTemplateHtml = $layout->createBlock(\n 'postident/checkout_onepage_billing', 'postident_onepage_billing')\n ->renderView();\n $html = $html . $addAddressTemplateHtml;\n $transport->setHtml($html);\n }\n }", "public function fetch(Mage_Sales_Model_Quote_Address $address)\n {\n $amount = $address->getFeeAmount();\n if ($amount != 0) {\n $address->addTotal(\n array(\n 'code' => $this->getCode(),\n 'title' => Mage::helper('route')->getRouteLabel(),\n 'value' => $amount,\n )\n );\n }\n return $this;\n }", "function update_cart_address($address_field,$address_id){\n\n $this->update([$address_field => $address_id]);\n }", "public function getBillingAddressId();", "public function getItemAddress()\n {\n return $this->item_address;\n }", "function getAddress($single){\n\t\t\t$list = $this -> makeRequest('GET', '/list', array(\n\t\t\t\t'password'=>$_SESSION['walletpass'],\n\t\t\t\t'confirmations'=>4\n\t\t\t\t));\n\n\t\t\tif($single){\n\t\t\t\treturn $list['addresses'][0]['address'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $list['addresses'];\n\t\t\t}\n\t\t}", "public function editAddress($addressID = null)\n\t{\n\t\t$address = Address::find($addressID); // Get the addresses associated with the account for an edit\n\n\t\tif(is_null($address))\n\t\t{\n\t\t\t$address = new Address(); // Create a new address instance for adding\n\t\t}\n\n\t\tif(isset($_POST['add']) || isset($_POST['edit'])) // Add or edit an address\n\t\t{\n\t\t\t# ****************************************************************************\n\t\t\t# **********EDIT SHIPPING ADDRESS + ADD ALTERNATIVE SHIPPING ADDRESS**********\n\t\t\t# ****************************************************************************\n\t\t\t$address->Account_Id = $_SESSION['accountID'];\n\t\t\t$address->Address_Line_1 = trim($_POST['addressLine1']);\n\t\t\t$address->Address_Line_2 = trim($_POST['addressLine2']);\n\t\t\t$address->City = trim($_POST['city']);\n\t\t\t$address->State_Province = trim($_POST['stateProvince']);\n\t\t\t$address->Zip_Postal_Code = trim($_POST['zipPostalCode']);\n\t\t\t$address->Country = trim($_POST['country']);\n\t\t\t$address->save();\n\n\t\t\t// Generate add address notification\n\t\t\tif(isset($_POST['add']))\n\t\t\t{\n\t\t\t\tnotificationController::addAddressNotif($address->Account_Id);\n\t\t\t}\n\t\t\telse // Generate edit address notification\n\t\t\t{\n\t\t\t\tnotificationController::editAddressNotif($address->Account_Id);\n\t\t\t}\t\n\t\t\t\n\t\t\t// Redirect to the list of addresses\n\t\t\theader('Location: '. '/public/addressController/viewAddresses/' . $_SESSION['accountID']);\n\t\t}\n\t\telse if(isset($_POST['delete'])) // Delete an address\n\t\t{\n\t\t\t$address->delete();\n\t\t\t\n\t\t\t// Redirect to the list of addresses\n\t\t\theader('Location: '. '/public/addressController/viewAddresses/' . $_SESSION['accountID']);\n\t\t}\n\t\telse // Display the address form\n\t\t{\t\n\t\t\thome::displayHeader();\n\t\t\taccountController::displayHeader($_SESSION['accountID']);\n\n\t\t\tself::view('address/addAddress', [\n\t\t\t\t\t'addressID' => $addressID,\n\t\t\t\t\t'addressLine1' => $address->Address_Line_1,\n\t\t\t\t\t'addressLine2' => $address->Address_Line_2,\n\t\t\t\t\t'city' => $address->City,\n\t\t\t\t\t'stateProvince' => $address->State_Province,\n\t\t\t\t\t'zipPostalCode' => $address->Zip_Postal_Code,\n\t\t\t\t\t'country' => $address->Country]);\n\t\t}\n\t}", "function actionIndex(){\n $this ->render(\"address\");\n }", "public static function getAdditionalAddressLine(Address $address)\n {\n $fields = static::getAddressLineFields($address->id_country);\n if (!in_array('address2', $fields)) {\n return $address->address2;\n }\n\n return '';\n }", "public function display_account_billing_information( ){\n\t\tif( $this->is_page_visible( \"billing_information\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_billing_information.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_billing_information.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_billing_information.php' );\n\t\t}\n\t}", "public function edit()\n\t{\n\t\tif (!$this->user->isLogged() || !$this->auth->validateUserToken($this->uri->getSegment($this->uri->getTotalSegments()))) {\n\n\t\t\t$this->session->set('user_redirect' . $this->session->user_session_id, '/account/address/edit/' . $this->request->uri->getSegment(4));\n\n\t\t\treturn redirect()->to(base_url('/login'));\n\t\t}\n\n\t\t$data = array();\n\n\t\t// Data Libraries\n\t\t$data['lang'] = $this->language;\n\t\t$data['validation'] = $this->validation;\n\n\t\t// Breadcrumbs\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_home', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url(),\n\t\t\t'active' => false,\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_account', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url('/account/' . $this->user->getToken()),\n\t\t\t'active' => false,\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_address_book', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url('/account/address/' . $this->user->getToken()),\n\t\t\t'active' => false,\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_address_edit', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url('/account/address/edit/' . $this->request->uri->getSegment(4) . '/' . $this->user->getToken()),\n\t\t\t'active' => true,\n\t\t);\n\n\t\t// Data Text\n\t\t$data['heading_title'] = lang('Heading.heading_address_edit', array(), $this->language->getFrontEndLocale());\n\n\t\t// Data Link\n\t\t$data['action'] = base_url('/account/address/edit/' . $this->request->uri->getSegment(4) . '/' . $this->user->getToken());\n\n\t\t// Form Validation\n\t\tif ($this->request->getPost()) {\n\t\t\t$this->validate([\n\t\t\t\t'firstname' => ['label' => lang('Entry.entry_firstname', array(), $this->language->getFrontEndLocale()), 'rules' => 'required', 'errors' => ['required' => lang('Error.error_required', array(), $this->language->getFrontEndLocale())]],\n\t\t\t\t'lastname' => ['label' => lang('Entry.entry_lastname', array(), $this->language->getFrontEndLocale()), 'rules' => 'required', 'errors' => ['required' => lang('Error.error_required', array(), $this->language->getFrontEndLocale())]],\n\t\t\t]);\n\n\t\t\t// Check if errors exist\n\t\t\tif (!empty($this->validation->getErrors())) {\n\t\t\t\t$data['error'] = lang('Error.error_form', array(), $this->language->getFrontEndLocale());\n\n\t\t\t\t$this->session->remove('error');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->validation->withRequest($this->request)->run() == TRUE) {\n \tif ($this->user->hasPermission()) {\n\t // Query\n\t \t$query = $this->userAddressModel->editUserAddress($this->request->getPost(), $this->user->getId());\n\t \n\t if ($query) {\n\t \t$this->session->set('success', lang('Success.success_user_address_edit', array(), $this->language->getFrontEndLocale()));\n\t } else {\n\t \t$this->session->set('error', lang('Error.error_user_address_edit', array(), $this->language->getFrontEndLocale()));\n\t }\n } else {\n\t $this->session->set('error', lang('Error.error_permission_modify', array(), $this->language->getFrontEndLocale()));\n }\n\n\t\t\treturn redirect()->to(base_url('/account/address/' . $this->user->getToken()));\n\t\t}\n\n\t\t// Return\n\t\treturn $this->getForm($data);\n\t}", "public function getAddress(){\r\n\t\treturn $this->address;\r\n\t}", "public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}", "public function show(string $postcode, string $houseNumber, string $houseNumberAddition = null): JsonResponse\n {\n try {\n $address = $this->addressService->search(str_replace(' ', '', $postcode), (int)$houseNumber, $houseNumberAddition);\n return response()->json($address);\n } catch (\\Exception $e) {\n abort($e->getCode(), $e->getMessage());\n }\n }" ]
[ "0.6339768", "0.6233099", "0.6017659", "0.5957247", "0.5957247", "0.5957247", "0.5930352", "0.5783741", "0.5777399", "0.5701607", "0.5625908", "0.5517851", "0.55108964", "0.5493997", "0.5456461", "0.54216266", "0.53936386", "0.5378968", "0.53730774", "0.53711283", "0.53421175", "0.533785", "0.5326002", "0.53216165", "0.5314429", "0.5309673", "0.53070855", "0.5280204", "0.5250676", "0.52503717", "0.52422875", "0.5241892", "0.5240742", "0.52285856", "0.5211098", "0.5195039", "0.5192355", "0.51874477", "0.51699895", "0.51699615", "0.5154714", "0.5141431", "0.5139847", "0.513678", "0.51341724", "0.51170063", "0.5115453", "0.51090837", "0.5095829", "0.5093507", "0.50882804", "0.50706863", "0.5066556", "0.506585", "0.50514364", "0.5047248", "0.5035931", "0.50298136", "0.5024377", "0.50208604", "0.50128484", "0.50089675", "0.5006922", "0.5003849", "0.4989787", "0.49891815", "0.498835", "0.4986787", "0.4974978", "0.4972149", "0.49611866", "0.4960466", "0.4955384", "0.49526107", "0.4946511", "0.4946069", "0.49389496", "0.49308422", "0.49276415", "0.4916225", "0.49160817", "0.49139556", "0.49131858", "0.49129033", "0.49111745", "0.49110115", "0.49080107", "0.49066222", "0.49058396", "0.49056423", "0.4903441", "0.4899016", "0.48989686", "0.48897356", "0.4880516", "0.48787096", "0.48784927", "0.48745358", "0.4873742", "0.48733166" ]
0.6015767
3
Save the fairaddress field when it's modified via view order details
function getfaircoin_edd_updated_edited_purchase( $payment_id ) { // get the payment meta $payment_meta = edd_get_payment_meta( $payment_id ); // update our fairaddress number $payment_meta['fairaddress'] = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : false; $payment_meta['fairsaving'] = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : false; // update the payment meta with the new array update_post_meta( $payment_id, '_edd_payment_meta', $payment_meta ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}", "public function updateAction()\n {\n /**\n * Fetch given address hash\n */\n $addressHash = $this->getRequest()->getParam('address_key');\n\n /**\n * Only if hash were given\n */\n if ( $addressHash ) {\n\n /**\n * Fetch all addresses in session\n */\n $allAddresses = Mage::getSingleton('core/session')->getKlarnaAddresses();\n\n /**\n * Look for a matching hash\n */\n foreach ($allAddresses as $address) {\n if ( $address['hash'] == $addressHash ) {\n\n /**\n * Fetch quote\n */\n $quote = Mage::getModel('checkout/cart')->getQuote();\n\n /**\n * Update billing address\n */\n if ( $quote && $quote->getBillingAddress() ) {\n\n $quote->getBillingAddress()\n ->setFirstname($address['fname'])\n ->setLastname($address['lname'])\n ->setCompany($address['company'])\n ->setStreet($address['street'])\n ->setPostcode($address['zip'])\n ->setCity($address['city'])\n ->setCountry(Mage::helper('klarna')->klarnaCountryToMagento($address['country']))\n ->save();\n }\n\n /**\n * Update shipping address\n */\n if ( $quote && $quote->getShippingAddress() ) {\n\n $quote->getShippingAddress()\n ->setFirstname($address['fname'])\n ->setLastname($address['lname'])\n ->setCompany($address['company'])\n ->setStreet($address['street'])\n ->setPostcode($address['zip'])\n ->setCity($address['city'])\n ->setCountry(Mage::helper('klarna')->klarnaCountryToMagento($address['country']))\n ->save();\n }\n\n /**\n * Return successful response\n */\n return $this->jsonReponse(Mage::helper('klarna/json')->success(array('success' => true)));\n }\n }\n }\n\n /**\n * Return the json error\n */\n return $this->jsonReponse(Mage::helper('klarna/json')->error($this->__('Unable to set address')));\n }", "function update_cart_address($address_field,$address_id){\n\n $this->update([$address_field => $address_id]);\n }", "public function saveAddress()\n\t{\n\t\trequire_once Component::path('com_members') . DS . 'models' . DS . 'address.php';\n\n\t\t// get request vars\n\t\t$data = Request::getArray('address', array());\n\t\t$data['uidNumber'] = User::get('id');\n\n\t\t// set up objects\n\t\t$address = Components\\Members\\Models\\Address::blank()->set($data);\n\n\t\t// attempt to save\n\t\tif (!$address->save())\n\t\t{\n\t\t\t$this->setError($address->getError());\n\t\t\treturn $this->editAddress($address);\n\t\t}\n\n\t\t//inform and redirect\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=com_members&id=' . User::get('id') . '&active=profile'),\n\t\t\tLang::txt('PLG_MEMBERS_PROFILE_ADDRESS_SAVED'),\n\t\t\t'passed'\n\t\t);\n\t}", "public function updateBillingAddress() {\n Log::debug(\"Entering updateBillingAddress\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // update the existing billing adress or create a new one\n $address = $order->billingAddress;\n if (!isset($address))\n $address = new Address();\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->billing_address = $address->id;\n $order->save();\n }\n });\n }", "public function modifyAddress(){\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n $stuid = $_REQUEST['stuid'];\n\t\t$address = $_REQUEST['address'];\n\t\t$phone = $_REQUEST['phone'];\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$form = M(\"addressinfo\");\n \t$data = $form->where($condition)->find();\n \t$data['name'] = $name;\n \t$data['address'] = $address;\n $data['stuid'] = $stuid;\n \t$data['phone'] = $phone;\n \t//echo $data;\n\t\t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "public function saving( Client $client)\n\t{\n\t\tif($client->address != NULL){\n\t\t\t$client->address->update($this->request->all());\n\t\t\t$client->contact->update($this->request->all());\n\t\t}\n\t}", "public function saveAddress()\r\n\t{\t\t\t\r\n\t\t$data = array('address' => $this->input->post('address'));\t\r\n\t\t$where = array('id' => $this->session->userdata('emp_id'));\t\t\t\t\r\n\t\t$iStatus = $this->My_model->updateRecord('lang_company',$data,$where);\r\n\t\techo $iStatus;\t\t\r\n\t}", "public function save() {\n\t\tif(!$this->hasPermission(\\OCP\\PERMISSION_UPDATE)) {\n\t\t\tthrow new Exception(self::$l10n->t('You don\\'t have permissions to update the address book.'), 403);\n\t\t}\n\t}", "public function updateCustomerAddressAction() {\n if(!Mage::app()->getRequest()->isAjax()){\n $this->norouteAction();\n exit;\n }\n\n $postData = $this->getRequest()->getPost();\n parse_str($postData['form'], $billing);\n\n $customer = $this->_getCustomer();\n\n $address = new Varien_Object();\n $address->addData(\n array(\n 'state' => $billing['state'],\n 'city' => $billing['city'],\n 'street' => $billing['street'],\n 'zip_code' => $billing['zipcode'],\n 'firstname' => $billing['firstname'],\n 'lastname' => $billing['lastname'],\n 'telephone' => $billing['telephone'],\n 'phone_number' => $billing['telephone'],\n 'country_code' => $billing['country_id'],\n )\n );\n\n $response = Mage::getModel(\"payments/api\")->updateBilling($customer->getId(), $address);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('token' => $response)));\n }", "function hook_commerce_adyen_shopper_address_alter(\\Commerce\\Adyen\\Payment\\Composition\\Address $address, \\EntityDrupalWrapper $profile, array $checkout_values, \\EntityDrupalWrapper $order) {\n if ('Dnipropetrovsk' === $address->getCity()) {\n $address->setCity('Dnipro');\n }\n}", "function do_save($params)\n {\n \t$this->load->model('order_address');\n \t\n \t$params['order_address_id'] = $this->order_address->do_save($params);\n\n \t$params['delivery_datetime'] = date('Y-m-d H:i:s', strtotime($params['delivery_datetime']));\n\n if (isset($params['order_id'])) { \n if ($delivery = $this->get($params['order_id'], 'order_id')) {\n $params[$this->get_primary_key()] = $delivery->{$this->get_primary_key()};\n }\n }\n\n \treturn parent::do_save($params);\n }", "public function setBillingAddressAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n $billingAddressModel = $customerModel->getBilling();\n\n $billingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($billingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['billingAddressId' => $billingAddressModel->getId()]);\n }", "public function saveAddress(Commerce_AddressModel $address)\n {\n $customer = $this->getSavedCustomer();\n if(craft()->commerce_addresses->saveAddress($address)){\n\n $customerAddress = Commerce_CustomerAddressRecord::model()->findByAttributes([\n 'customerId' => $customer->id,\n 'addressId' => $address->id\n ]);\n\n if(!$customerAddress){\n $customerAddress = new Commerce_CustomerAddressRecord;\n }\n\n $customerAddress->customerId = $customer->id;\n $customerAddress->addressId = $address->id;\n if($customerAddress->save()){\n return true;\n }\n }\n\n return false;\n }", "function save_address($data)\n\t{\n\t\t$data['field_data'] = serialize($data['field_data']);\n\t\t// update or insert\n\t\tif(!empty($data['id']))\n\t\t{\n\t\t\t$this->db->where('id', $data['id']);\n\t\t\t$this->db->update('merchants_address_bank', $data);\n\t\t\t//echo $this->db->last_query(); die; \n\t\t\treturn $data['id'];\n\t\t} else {\n\t\t\t$this->db->insert('merchants_address_bank', $data);\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t}", "public function saveOfferBillingAddress($address, $tax_rate, $id)\r\n {\r\n if($address['stateID'] == null)\r\n {\r\n $address['stateID']='0';\r\n }\r\n $checkForExistingDocument = Shopware()->Db()->fetchRow(\"SELECT id FROM s_offer_billingaddress WHERE offerID = ?\",array($id));\r\n\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $customer = Shopware()->Models()->getRepository('Shopware\\Models\\Customer\\Customer')->find($address[\"userID\"]);\r\n if($customer instanceof \\Shopware\\Models\\Customer\\Customer) {\r\n $address['customernumber'] = $customer->getNumber();\r\n }\r\n }\r\n\r\n if (!empty($checkForExistingDocument[\"id\"])) {\r\n\r\n $sql = \"\r\n UPDATE s_offer_billingaddress SET\r\n userID = ?,\r\n customernumber = ?,\r\n company = ?,\r\n department = ?,\r\n salutation = ?,\r\n firstname = ?,\r\n lastname = ?,\r\n street = ?,\r\n zipcode = ?,\r\n city = ?,\r\n phone = ?,\r\n fax = ?,\r\n countryID = ?,\r\n stateID = ?,\r\n ustid = ?,\r\n shipping_tax = ?\r\n WHERE offerID = ?\r\n \";\r\n\r\n\t\t\t$street = $address[\"street\"];\r\n $fax = $address[\"fax\"];\r\n $phone = $address[\"phone\"];\r\n $ustid = $address[\"ustid\"];\r\n $department = $address[\"department\"];\r\n $company = $address[\"company\"];\r\n\t\t\tif(!Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5\")){\r\n\t\t\t\t$street = $address[\"street\"].\" \".$address[\"streetnumber\"];\r\n\t\t\t}\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $fax = \"\";\r\n if(!isset($phone) || empty($phone)) {\r\n $phone = \"\";\r\n }\r\n if(!isset($ustid) || empty($ustid)) {\r\n $ustid = \"\";\r\n }\r\n if(!isset($department) || empty($department)) {\r\n $department = \"\";\r\n }\r\n if(!isset($company) || empty($company)) {\r\n $company = \"\";\r\n }\r\n }\r\n $array = array(\r\n $address[\"userID\"],\r\n $address[\"customernumber\"],\r\n $company,\r\n $department,\r\n $address[\"salutation\"],\r\n $address[\"firstname\"],\r\n $address[\"lastname\"],\r\n $street,\r\n $address[\"zipcode\"],\r\n $address[\"city\"],\r\n $phone,\r\n $fax,\r\n $address[\"countryID\"],\r\n $address[\"stateID\"],\r\n $ustid,\r\n $tax_rate,\r\n $id\r\n );\r\n }\r\n else{\r\n $sql = \"\r\n INSERT INTO s_offer_billingaddress\r\n (\r\n userID,\r\n offerID,\r\n customernumber,\r\n company,\r\n department,\r\n salutation,\r\n firstname,\r\n lastname,\r\n street,\r\n zipcode,\r\n city,\r\n phone,\r\n fax,\r\n countryID,\r\n stateID,\r\n ustid,\r\n shipping_tax\r\n )\r\n VALUES (\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?\r\n )\r\n \";\r\n\t\t\t$street = $address[\"street\"];\r\n $fax = $address[\"fax\"];\r\n $phone = $address[\"phone\"];\r\n $ustid = $address[\"ustid\"];\r\n $department = $address[\"department\"];\r\n $company = $address[\"company\"];\r\n\t\t\tif(!Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5\")){\r\n\t\t\t\t$street = $address[\"street\"].\" \".$address[\"streetnumber\"];\r\n\t\t\t}\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $fax = \"\";\r\n if(!isset($phone) || empty($phone)) {\r\n $phone = \"\";\r\n }\r\n if(!isset($ustid) || empty($ustid)) {\r\n $ustid = \"\";\r\n }\r\n if(!isset($department) || empty($department)) {\r\n $department = \"\";\r\n }\r\n if(!isset($company) || empty($company)) {\r\n $company = \"\";\r\n }\r\n }\r\n\r\n $array = array(\r\n $address[\"userID\"],\r\n $id,\r\n $address[\"customernumber\"],\r\n $company,\r\n $department,\r\n $address[\"salutation\"],\r\n $address[\"firstname\"],\r\n $address[\"lastname\"],\r\n $street,\r\n $address[\"zipcode\"],\r\n $address[\"city\"],\r\n $phone,\r\n $fax,\r\n $address[\"countryID\"],\r\n $address[\"stateID\"],\r\n $ustid,\r\n $tax_rate\r\n );\r\n\r\n }\r\n $result = Shopware()->Db()->executeUpdate($sql,$array);\r\n if (!$result) {\r\n throw new Enlight_Exception(\"Shopware Offer Fatal-Error {$_SERVER[\"HTTP_HOST\"]} : No row affected in s_offer_billingaddress.\", 0);\r\n }\r\n return $result;\r\n }", "public function beforeSave($options = array()) {\r\n\t\t$now = date(\"Y-m-d H:i:s\", time());\r\n\t\t$this->data['DeliveryAddress']['last_update'] = $now;\r\n\t\t\t\t\r\n\t\t// format postal code\r\n\t\t$this->data['DeliveryAddress']['postal_code'] = strtoupper($this->data['DeliveryAddress']['postal_code']);\r\n\t\t\r\n\t}", "public static function address($address){\n $addre = Address::where('user_id',Auth::id())->where('address_type',$address['address_type'])->first();\n if ($addre){\n $addre->update($address);\n }else{\n Address::create($address);\n }\n }", "public function actionAddressUpdate()\r\n {\r\n $customer_id = Yii::$app->user->getId();\r\n $address_id = Yii::$app->request->getBodyParam('address_id');\r\n $address_name = Yii::$app->request->getBodyParam(\"address_name\");\r\n $address_data = Yii::$app->request->getBodyParam(\"address_data\");\r\n $address_type_id = Yii::$app->request->getBodyParam(\"address_type_id\");\r\n $questions_answers = Yii::$app->request->getBodyParam(\"questions_answers\");\r\n\r\n $area_id = Yii::$app->request->getBodyParam(\"area_id\");\r\n\r\n $QuestionsList = AddressQuestion::find()\r\n ->select(['ques_id','question','required'])\r\n ->where([\r\n 'address_type_id'=>$address_type_id,\r\n 'trash' => 'Default',\r\n 'status' => 'Active'\r\n ])\r\n ->asArray()\r\n ->all();\r\n\r\n\r\n foreach ($QuestionsList as $question) {\r\n if ($question['required']) {\r\n if(!isset($questions_answers[$question['ques_id']]) || $questions_answers[$question['ques_id']] == '') {\r\n return [\r\n \"operation\" => \"error\",\r\n \"code\" => \"0\",\r\n \"message\" => Yii::t(\"api\", \"Please provide answer of question {question}\", [\r\n 'question' => $question['question']\r\n ]),\r\n 'detail' => $question['question']\r\n ];\r\n exit;\r\n }\r\n }\r\n }\r\n $customer_address = CustomerAddress::findone([\r\n 'address_id' => $address_id,\r\n 'customer_id' => $customer_id\r\n ]);\r\n\r\n //save address\r\n if ($customer_address) {\r\n $customer_address->address_name = $address_name;\r\n $customer_address->address_data = $address_data;\r\n $customer_address->address_type_id = $address_type_id;\r\n $customer_address->area_id = $area_id;\r\n $customer_address->modified_by = $customer_id;\r\n\r\n $location = Location::findOne($customer_address->area_id);\r\n\r\n $customer_address->city_id = $location->city_id;\r\n $customer_address->country_id = $location->country_id;\r\n if ($customer_address->save(false)) {\r\n\r\n //remove old questions\r\n CustomerAddressResponse::deleteAll(['address_id' => $address_id]);\r\n\r\n //save address questions\r\n foreach ($QuestionsList as $question) {\r\n $customer_address_response = new CustomerAddressResponse();\r\n $customer_address_response->address_id = $address_id;\r\n $customer_address_response->address_type_question_id = $question['ques_id'];\r\n $customer_address_response->response_text = $questions_answers[$question['ques_id']];\r\n $customer_address_response->save(false);\r\n }\r\n\r\n return [\r\n \"operation\" => \"success\",\r\n \"message\" => Yii::t('api', \"Address Updated Successfully\"),\r\n ];\r\n\r\n } else {\r\n return [\r\n \"operation\" => \"error\",\r\n \"message\" => Yii::t('api', \"Error While Updating Address\"),\r\n 'detail' => $customer_address->errors\r\n ];\r\n }\r\n } else {\r\n return [\r\n \"operation\" => \"error\",\r\n \"message\" => Yii::t('api', \"Unable To Find Address With Address ID\"),\r\n ];\r\n }\r\n }", "public function editAddressAction() {\n\n //USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET PAGE ID, PAGE OBJECT AND THEN CHECK PAGE VALIDATION\n $resource_type = $this->_getParam('resource_type');\n switch ($resource_type) {\n case 'group':\n $id = 'group_id';\n $itemTable = Engine_Api::_()->getItemTable('group');\n $route = 'sitetagcheckin_groupspecific';\n break;\n\n case 'user':\n $id = 'user_id';\n $itemTable = Engine_Api::_()->getDbtable('users', 'user');\n $route = 'sitetagcheckin_userspecific';\n break;\n\n case 'event':\n $id = 'event_id';\n $itemTable = Engine_Api::_()->getItemTable('event');\n $route = 'sitetagcheckin_specific';\n break;\n }\n\n $seao_locationid = $this->_getParam('seao_locationid');\n $resource_id = $this->_getParam($id);\n $resource = Engine_Api::_()->getItem($resource_type, $resource_id);\n\n $this->view->form = $form = new Sitetagcheckin_Form_Address(array('item' => $resource));\n\n //POPULATE FORM\n if (!$this->getRequest()->isPost()) {\n $form->populate($resource->toArray());\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n\n $values = $form->getValues();\n\n //Update field value\n if ($resource_type == 'user') {\n\n $aliasValues = Engine_Api::_()->fields()->getFieldsValuesByAlias($resource);\n\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $table_exist = $db->query('SHOW TABLES LIKE \\'engine4_user_fields_search\\'')->fetch();\n if (!empty($table_exist)) {\n $column_exist = $db->query('SHOW COLUMNS FROM engine4_user_fields_search LIKE \\'location\\'')->fetch();\n }\n\n $profilemapsTable = Engine_Api::_()->getDbtable('profilemaps', 'sitetagcheckin');\n $profilemapsTablename = $profilemapsTable->info('name');\n\n $select = $profilemapsTable->select()->from($profilemapsTablename, array('profile_type'));\n if (empty($aliasValues['profile_type'])) {\n $select->where($profilemapsTablename . '.option_id = ?', 1);\n } else {\n $select->where($profilemapsTablename . '.option_id = ?', $aliasValues['profile_type']);\n }\n $option_id = $select->query()->fetchColumn();\n\n if (!empty($option_id)) {\n $valuesTable = Engine_Api::_()->fields()->getTable('user', 'values');\n $valuesTableName = $valuesTable->info('name');\n\n $select = $valuesTable->select()\n ->from($valuesTableName, array('item_id'))\n ->where($valuesTableName . '.item_id = ?', $resource_id)\n ->where($valuesTableName . '.field_id = ?', $option_id);\n $valuesResultsLocation = $select->query()->fetchColumn();\n if (!empty($valuesResultsLocation)) {\n Engine_Api::_()->fields()->getTable('user', 'values')->update(array('value' => $values['location']), array('item_id =?' => $resource_id, 'field_id =?' => $option_id));\n\n if (!empty($column_exist)) {\n Engine_Api::_()->fields()->getTable('user', 'search')->update(array('location' => $values['location']), array('item_id =?' => $resource_id));\n }\n } else {\n $valuesTable = Engine_Api::_()->fields()->getTable('user', 'values');\n $row = $valuesTable->createRow();\n $row->item_id = $resource_id;\n $row->field_id = $option_id;\n $row->index = 0;\n $row->value = $values['location'];\n $row->save();\n if (!empty($column_exist)) {\n Engine_Api::_()->fields()->getTable('user', 'search')->update(array('location' => $values['location']), array('item_id =?' => $resource_id));\n }\n }\n }\n }\n\n $resource->location = $values['location'];\n if (empty($values['location'])) {\n //DELETE THE RESULT FORM THE TABLE.\n Engine_Api::_()->getDbtable('locationitems', 'seaocore')->delete(array('resource_id =?' => $resource_id, 'resource_type = ?' => $resource_type));\n $resource->seao_locationid = '0';\n }\n $resource->save();\n unset($values['submit']);\n\n if (!empty($values['location'])) {\n\n //DELETE THE RESULT FORM THE TABLE.\n Engine_Api::_()->getDbtable('locationitems', 'seaocore')->delete(array('resource_id =?' => $resource_id, 'resource_type = ?' => $resource_type));\n\n $seaoLocation = Engine_Api::_()->getDbtable('locationitems', 'seaocore')->getLocationItemId($values['location'], '', $resource_type, $resource_id);\n\n //group table entry of location id.\n $itemTable->update(array('seao_locationid' => $seaoLocation), array(\"$id =?\" => $resource_id));\n }\n\n $db->commit();\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 500,\n 'parentRedirect' => $this->_helper->url->url(array('action' => 'edit-location', 'seao_locationid' => $seaoLocation, \"$id\" => $resource_id, \"resource_type\" => $resource_type), \"$route\", true),\n 'parentRedirectTime' => '2',\n 'format' => 'smoothbox',\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your location has been modified successfully.'))\n ));\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }", "public function update($adress)\n {\n $this->store($adress);\n\n }", "private function SaveBillingAddress()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// If the customer isn't signed in then they've just entered an address that we need to validate\n\t\tif(!CustomerIsSignedIn()) {\n\t\t\t$errors = array();\n\t\t\t// An invalid address was entered, show the form again\n\t\t\t$addressDetails = $this->ValidateGuestCheckoutAddress('billing', $errors);\n\t\t\tif(!$addressDetails) {\n\t\t\t\t$this->ChooseBillingAddress($errors);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// We've just selected an address\n\t\t\tif(isset($_GET['address_id'])) {\n\t\t\t\t$addressDetails = (int)$_GET['address_id'];\n\t\t\t}\n\t\t}\n\n\t\t// There was a problem saving the selected billing address\n\t\tif(!$this->SetOrderBillingAddress($addressDetails)) {\n\t\t\t$this->ChooseBillingAddress();\n\t\t\treturn;\n\t\t}\n\n\t\t// If we're automatically creating accounts for customers then we need to save those details too\n\t\tif(!CustomerIsSignedIn() && GetConfig('GuestCheckoutCreateAccounts')) {\n\t\t\t$password = substr(md5(uniqid(true)), 0, 8);\n\t\t\t$autoAccount = 1;\n\t\t\t$_SESSION['CHECKOUT']['CREATE_ACCOUNT'] = 1;\n\t\t\t$_SESSION['CHECKOUT']['ACCOUNT_DETAILS'] = array(\n\t\t\t\t'email' => $addressDetails['shipemail'],\n\t\t\t\t'password' => $password,\n\t\t\t\t'firstname' => $addressDetails['shipfirstname'],\n\t\t\t\t'lastname' => $addressDetails['shiplastname'],\n\t\t\t\t'company' => '',\n\t\t\t\t'phone' => $addressDetails['shipphone'],\n\t\t\t\t'autoAccount' => $autoAccount\n\t\t\t);\n\t\t}\n\n\t\tif($this->getQuote()->isDigital()) {\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"location:%s/checkout.php?action=confirm_order\", $GLOBALS['ShopPath']));\n\t\t}\n\t\telse {\n\t\t\t// Are we shipping to the same address?\n\t\t\tif(isset($_POST['ship_to_billing'])) {\n\t\t\t\tif(!$this->SetOrderShippingAddress($addressDetails, true)) {\n\t\t\t\t\t$this->ChooseShippingAddress();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now they need to choose the shipping provider for their order\n\t\t\t\t@ob_end_clean();\n\t\t\t\theader(\"Location: \".GetConfig('ShopPath').\"/checkout.php?action=choose_shipper\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t// Otherwise, we just move to the next step\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"location:%s/checkout.php?action=choose_shipping_address\", $GLOBALS['ShopPath']));\n\t\t}\n\t\texit;\n\t}", "public function edit(Address $address)\n {\n //\n }", "public function invoiceAddress() {\r\n $result = $this->clients->flatInvoice();\r\n foreach ($result as $key => $value) {\r\n $getAdress = $this->clients->companyAddress($value->CustomerCompanyID);\r\n $data = array('Params' => $getAdress[0]->Params);\r\n $response = $this->clients->invoiceAdressupdate($value->InvoiceID, $data);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "public function editAction() {\r\n \t$gid = $this->getInput('gid');\r\n \t$this->checkRight();\r\n \t$title = \"收货人地址修改\";\r\n \t$id = $this->getInput('id');\r\n \t$addressInfo = Gc_Service_UserAddress::getUserAddress($id);\r\n \t$this->assign('info', $addressInfo);\r\n \t$this->assign('title', $title);\r\n \t$this->assign('gid', $gid);\r\n }", "public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }", "public function edit(Address $address)\n\t{\n\t\t//\n\t}", "private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}", "public function saveAddress($objid, $name, $link, $type, $confidentiality, $description)\n {\n\n $orm = $this->getOrm();\n\n $storageNode = $orm->get(\"WbfsysFileAddress\", $objid);\n $storageNode->name = $name;\n $storageNode->link = $link;\n $storageNode->id_type = $type;\n $storageNode->description = $description;\n $storageNode->id_confidentiality = $confidentiality;\n\n $orm->update($storageNode);\n\n }", "function setAddress($add) {\n if ( strpos($add->value, \"BEGIN:VCARD\") || strpos($add->value, \"begin:vcard\") )\n $add->type = 'text/directory';\n else\n $add->type = 'text/plain';\n $this->address = $add;\n $changed = true;\n }", "abstract protected function doSaveAddress(AddressInterface $address);", "public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }", "public function saveaddress() {\n if (isset($_POST['address'])) {\n $userId = $this->session->userdata('user_id');\n $address = $this->input->post('address');\n $result = $this->Users->saveaddress($address, $userId);\n if ($result) {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 1)));\n } else {\n $this->output\n ->set_content_type('application/json')\n ->set_output(json_encode(array('result' => 0)));\n }\n }\n }", "public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }", "public function add_delivery_address(){\n $save_data['customer_id'] = $_REQUEST['customer_id'];\n $save_data['address_title'] = $_REQUEST['address_title'];\n $save_data['address'] = $_REQUEST['address'];\n $save_data['country_id'] = $_REQUEST['country_id'];\n $save_data['state_id'] = $_REQUEST['state_id'];\n $save_data['city_id'] = $_REQUEST['city_id'];\n $save_data['pincode'] = $_REQUEST['pincode'];\n\n $is_default = $_REQUEST['is_default'];\n $customer_id = $_REQUEST['customer_id'];\n\n $address_id = $this->User_Model->save_data('delivery_address', $save_data);\n if ($address_id) {\n if($is_default == 1){\n $up_data1['is_default'] = 0;\n $this->User_Model->update_info('customer_id', $customer_id, 'delivery_address', $up_data1);\n $up_data2['is_default'] = 1;\n $this->User_Model->update_info('address_id', $address_id, 'delivery_address', $up_data2);\n }\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = \"Address Saved Successfuly\";\n } else {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = \"Address Not Saved\";\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function save_address( $post_id ) {\n\t\t\t//check for empty post id\n\t\t\tif ( empty( $post_id ) ) {\n\t\t\t\t$post_id = $_POST[ 'post_ID' ];\n\t\t\t}\n\t\t\tif ( empty( $post_id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//verify nonce for address\n\t\t\t$address_nonce = !empty( $_POST[ 'restaurant_address_nonce' ] ) ? $_POST[ 'restaurant_address_nonce' ] : '';\n\t\t\tif ( empty( $address_nonce ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( !wp_verify_nonce( $_POST[ 'restaurant_address_nonce' ], 'rt_restaurant_address_nonce' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//fetch value of address\n\t\t\t$address = isset( $_POST[ 'restaurant_add' ] ) ? $_POST[ 'restaurant_add' ] : '';\n\t\t\tif ( empty( $address ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//sanitize address values\n\t\t\tforeach ( $address as $key => $value ) {\n\t\t\t\t$address[ $key ] = sanitize_text_field( $value );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter to change address value\n\t\t\t *\n\t\t\t * @since 0.1\n\t\t\t *\n\t\t\t * @param string $var Name of filter\n\t\t\t * @param array $address\n\t\t\t */\n\t\t\t$address = apply_filters( 'rt_restaurant_save_address', $address );\n\n\t\t\t/**\n\t\t\t * Action to run code before saving address\n\t\t\t * \n\t\t\t * @param array $address\n\t\t\t */\n\t\t\tdo_action( 'rt_restaurants_before_save_address', $address );\n\n\t\t\t//add or update address post meta\n\t\t\tupdate_post_meta( $post_id, '_restaurant_address', $address );\n\t\t}", "public function save()\n {\n return $this->address_srl ? $this->repo->update($this) : $this->repo->insert($this);\n }", "public function saveDhlAccount($observer)\n {\n $data = Mage::app()->getRequest()->getPost();\n if (array_key_exists('billing', $data) &&\n array_key_exists('preferred_date', $data['billing']) &&\n array_key_exists('dhlaccount', $data['billing']) &&\n 0 < strlen(trim($data['billing']['dhlaccount']))\n ) {\n Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()\n ->setData('dhlaccount', $data['billing']['dhlaccount'])\n ->save();\n\n Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()\n ->setData('dhlaccount', Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getDhlaccount())\n ->save();\n }\n }", "public function setAddress($address);", "public function setAddress($address);", "public function update(Address $address)\n\t{\n\t\t//\n\t}", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$date=$values['bill_date'];\n$amount=$values['amount'];\n$item=$values['item'];\n$bill_no=$values['bill_no'];\n\n\n$sql_update=\"UPDATE student_billing SET \nitem='$item',amount='$amount',amount_balance='$amount',\ndate='$date',\nbill_no='$bill_no'\nWHERE proid='$proid'\";\ndb_exec($sql_update,$conn);\n\n;\t\t\n}", "public function updateShippingAddress(ResourceControllerEvent $event): void\n {\n /** @var Order $order */\n $order = $event->getSubject();\n\n $pickup = $this->getPickupAddress($order);\n\n if (!empty($pickup)) {\n $shipping = $order->getShippingAddress();\n $shipping->setCompany($pickup['company']);\n $shipping->setStreet($pickup['street_1']);\n $shipping->setCity($pickup['city']);\n $shipping->setPostcode($pickup['postcode']);\n $shipping->setCountryCode($pickup['country']);\n }\n }", "public function append_to_approved($address)\n\t{\n\t\t$this->approved_array[] = $address;\n\t}", "public function update(Request $request,Address $address)\n {$address->street = $request->street;\n $address->number = $request->number;\n $address->neighborhood = $request->neighborhood;\n $address->local_id = $request->local_id;\n\n $address->save();\n $request->session()->flash('alert-success', 'Endereco alterado com sucesso!');\n return redirect(\"admin.address\");\n }", "public function saveShippingAction() {\n\t\tif ($this->getRequest ()->isPost ()) {\n\t\t\t$preAddr = Mage::getSingleton ( 'customer/session' )->getPreaddress ();\n\t\t\t\n\t\t\tif ($preAddr) {\n\t\t\t\t$data = array ();\n\t\t\t\tif (! empty ( $preAddr ['ShippingAddress'] [0] )) {\n\t\t\t\t\t$preData = $preAddr ['ShippingAddress'];\n\t\t\t\t} else {\n\t\t\t\t\t$preData = $preAddr;\n\t\t\t\t}\n\t\t\t\t$dataId = $this->getRequest ()->getPost ( 'addressid' );\n\t\t\t\t\n\t\t\t\t$mpData = Mage::getModel ( 'masterpass/masterpass' );\n\t\t\t\tforeach ( $preData as $value ) {\n\t\t\t\t\tif ($dataId == $value ['AddressId']) {\n\t\t\t\t\t\t$reecipientName = $value ['RecipientName'];\n\t\t\t\t\t\t$name = Mage::helper ( 'masterpass' )->getRecipienName ( $reecipientName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! is_array ( $value ['Line2'] )) {\n\t\t\t\t\t\t\t$lin2 = $value ['Line2'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$lin2 = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! is_array ( $value ['Line3'] )) {\n\t\t\t\t\t\t\t$lin3 = $value ['Line3'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$lin3 = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$regionIdS = Mage::helper ( 'masterpass' )->checkMasterpassData ( $mpData->statesMapping ( $value ['CountrySubdivision'] ) );\n\t\t\t\t\t\t$regionS = Mage::helper ( 'masterpass' )->checkMasterpassData ( $mpData->getMasterpassRegion ( $value ['CountrySubdivision'] ) );\n\t\t\t\t\t\t$shippingPhone = $mpData->getRemoveDash ( Mage::helper ( 'masterpass' )->checkMasterpassData ( $value ['RecipientPhoneNumber'] ) );\n\t\t\t\t\t\t$data = array (\n\t\t\t\t\t\t\t\t'firstname' => $name [0],\n\t\t\t\t\t\t\t\t'lastname' => $name [1],\n\t\t\t\t\t\t\t\t'street' => array (\n\t\t\t\t\t\t\t\t\t\t0 => $value ['Line1'],\n\t\t\t\t\t\t\t\t\t\t1 => $lin2,\n\t\t\t\t\t\t\t\t\t\t2 => $lin3 \n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'city' => $value ['City'],\n\t\t\t\t\t\t\t\t'region_id' => $regionIdS,\n\t\t\t\t\t\t\t\t'region' => $regionS,\n\t\t\t\t\t\t\t\t'postcode' => $value ['PostalCode'],\n\t\t\t\t\t\t\t\t'country_id' => $value ['Country'],\n\t\t\t\t\t\t\t\t'telephone' => $shippingPhone \n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$customerAddressId = $this->getRequest ()->getPost ( 'shipping_address_id', false );\n\t\t\t\t$this->getOnepage ()->saveShipping ( $data, $customerAddressId );\n\t\t\t}\n\t\t}\n\t\t$this->loadLayout ( false );\n\t\t$this->renderLayout ();\n\t}", "public function setAddress(Address $address);", "public function dp_saveaddress($data)\n {\n return $this->call('dp_saveaddress', static::prepareParams($data, [\n 'address_id' => ['numeric'], // Enter 0 in this field to create a new address value or the address_id number of an existing address_id to update the existing value\n 'donor_id' => ['numeric'], // Specify the donor_id of the donor associated with this\n 'opt_line' => ['string', 100], // Enter a secondary name or company name if appropriate\n 'address' => ['string', 100], //\n 'address2' => ['string', 100], //\n 'city' => ['string', 50], //\n 'state' => ['string', 30], //\n 'zip' => ['string', 20], //\n 'country' => ['string', 30], //\n 'address_type' => ['string', 30], // Enter the CODE value associated with the address type\n 'getmail' => ['string', 1], // Enter 'Y' or 'N' to indicate whether the Receive Mail box will be checked and to indicate whether mail can be sent to this address.\n 'user_id' => $this->appName,\n 'title' => ['string', 50], // Enter a value to be stored in the Professional Title field.\n 'first_name' => ['string', 50], //\n 'middle_name' => ['string', 50], //\n 'last_name' => ['string', 75], //\n 'suffix' => ['string', 50], //\n 'prof_title' => ['string', 100], //\n 'salutation' => ['string', 130], // Enter desired salutation value (e.g.; 'Dear Bob')\n 'seasonal_from_date' => ['string', 4], // Enter the 'from' date as MMYY – e.g; November 2017 would be represented as 1117\n 'seasonal_to_date' => ['string', 4], // Enter the 'to' date as MMYY\n 'email' => ['string', 75], //\n 'home_phone' => ['string', 40], //\n 'business_phone' => ['string', 40], //\n 'fax_phone' => ['string', 40], //\n 'mobile_phone' => ['string', 40], //\n 'address3' => ['string', 100], //\n 'address4' => ['string', 100], //\n 'ukcountry' => ['string', 100], //\n 'org_rec' => ['string', 1], // Enter 'Y' to check the Org Rec field (indicating an organizational record) or 'N' to leave it unchecked to indicate an individual record.\n ]));\n }", "function wyz_bus_save_draft() {\n\n}", "public function saveAddress(Address $address)\n {\n return $this->address()->save($address);\n }", "public function beforeSave() {\n $userId = isset(Yii::app()->user) ? Yii::app()->user->id : '';\n $this->address = CommonProcess::createAddressString(\n $this->province_id, $this->district_id, $this->ward_id, $this->street_id, $this->house_numbers);\n $this->address_vi = CommonProcess::removeSign(\n $this->first_name . ' ' .\n $this->username . ' ' .\n $this->phone . ' ' .\n $this->email . ' ' .\n $this->address);\n $this->formatDate('birthday');\n $this->formatDate('date_of_issue');\n $this->formatDate('date_in');\n// // Format birthday value\n// $date = $this->birthday;\n// $this->birthday = CommonProcess::convertDateTimeToMySqlFormat(\n// $date, DomainConst::DATE_FORMAT_3);\n// if (empty($this->birthday)) {\n// $this->birthday = CommonProcess::convertDateTimeToMySqlFormat(\n// $date, DomainConst::DATE_FORMAT_4);\n// }\n// if (empty($this->birthday)) {\n// $this->birthday = $date;\n// }\n if ($this->isNewRecord) { // Add\n // Handle password\n $this->temp_password = CommonProcess::generateTempPassword();\n $this->password_hash = CommonProcess::hashPassword(\n $this->password_hash, $this->temp_password);\n\n // Handle username\n if ($this->role_id == Roles::getRoleByName(Roles::ROLE_CUSTOMER)->id) {\n // Do nothing\n } else {\n $this->username = self::generateUsername($this->first_name);\n }\n \n // Handle created by\n if (empty($this->created_by)) {\n $this->created_by = $userId;\n }\n // Handle created date\n $this->created_date = CommonProcess::getCurrentDateTimeWithMySqlFormat();\n } else { // Update\n }\n return parent::beforeSave();\n }", "public function sSaveBillingAddress($address, $id)\n {\n /** @var Customer $customer */\n $customer = $this->modelManager->find(Customer::class, $address['userID']);\n\n $sql = '\n INSERT INTO s_order_billingaddress\n (\n userID,\n orderID,\n customernumber,\n company,\n department,\n salutation,\n firstname,\n lastname,\n street,\n zipcode,\n city,\n phone,\n countryID,\n stateID,\n ustid,\n additional_address_line1,\n additional_address_line2,\n title\n )\n VALUES (\n :userID,\n :orderID,\n :customernumber,\n :company,\n :department,\n :salutation,\n :firstname,\n :lastname,\n :street,\n :zipcode,\n :city,\n :phone,\n :countryID,\n :stateID,\n :ustid,\n :additional_address_line1,\n :additional_address_line2,\n :title\n )\n ';\n $sql = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveBilling_FilterSQL',\n $sql,\n ['subject' => $this, 'address' => $address, 'id' => $id]\n );\n $array = [\n ':userID' => $address['userID'],\n ':orderID' => $id,\n ':customernumber' => $customer->getNumber(),\n ':company' => (string) $address['company'],\n ':department' => (string) $address['department'],\n ':salutation' => (string) $address['salutation'],\n ':firstname' => (string) $address['firstname'],\n ':lastname' => (string) $address['lastname'],\n ':street' => (string) $address['street'],\n ':zipcode' => (string) $address['zipcode'],\n ':city' => (string) $address['city'],\n ':phone' => (string) $address['phone'],\n ':countryID' => $address['countryID'],\n ':stateID' => $address['stateID'],\n ':ustid' => $address['ustid'],\n ':additional_address_line1' => $address['additional_address_line1'],\n ':additional_address_line2' => $address['additional_address_line2'],\n ':title' => $address['title'],\n ];\n $array = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveBilling_FilterArray',\n $array,\n ['subject' => $this, 'address' => $address, 'id' => $id]\n );\n $result = $this->db->executeUpdate($sql, $array);\n\n $billingID = $this->db->lastInsertId();\n\n $billingAddressId = null;\n\n if ($this->session !== null) {\n $billingAddressId = $this->session->get('checkoutBillingAddressId');\n }\n\n if ($billingAddressId === null) {\n $billingAddressId = $customer->getDefaultBillingAddress()->getId();\n }\n\n $attributes = $this->attributeLoader->load('s_user_addresses_attributes', $billingAddressId);\n\n if (!is_array($attributes)) {\n $attributes = [];\n }\n\n $this->attributePersister->persist($attributes, 's_order_billingaddress_attributes', $billingID);\n\n return $result;\n }", "function getfaircoin_edd_save_extra_profile_fields( $user_id ) {\r\n if ( ! current_user_can( 'edit_user', $user_id ) )\r\n return false;\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['_edd_user_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['_edd_user_fairsaving'] );\r\n}", "function saveAddress($formvalues, $prefix){\n\t\n\t\tif(isset($formvalues[$prefix.'addressupdateid'])){\n\t\t\t$query = \"UPDATE places SET name = '\".$formvalues[$prefix.'name'].\"', telephone = '\".$formvalues[$prefix.'tel'].\"', village = '\".$formvalues[$prefix.'village'].\"', subcounty = '\".$formvalues[$prefix.'subcounty'].\"', county = '\".$formvalues[$prefix.'county'].\"', parish = '\".$formvalues[$prefix.'parish'].\"', town = '\".$formvalues[$prefix.'town'].\"', district = '\".$formvalues[$prefix.'district'].\"', plotnumber = '\".$formvalues[$prefix.'plotno'].\"', lc1chairman = '\".$formvalues[$prefix.'lc1cm'].\"', lc1telephone = '\".$formvalues[$prefix.'lc1tel'].\"', lc2chairman = '\".$formvalues[$prefix.'lc2cm'].\"', lc2telephone = '\".$formvalues[$prefix.'lc2tel'].\"', lastupdatedby = \".$_SESSION['userid'].\", lastupdatedate = now() WHERE id = '\".$formvalues[$prefix.'addressupdateid'].\"'\";\n\t\t\t\n\t\t} else {\n\t\t\t$query = \"INSERT INTO places (name, telephone, village, subcounty, county, parish, town, district, plotnumber, lc1chairman, lc1telephone, lc2chairman, lc2telephone, createdby, datecreated) VALUES ('\".$formvalues[$prefix.'name'].\"', '\".$formvalues[$prefix.'tel'].\"', '\".$formvalues[$prefix.'village'].\"', '\".$formvalues[$prefix.'subcounty'].\"', '\".$formvalues[$prefix.'county'].\"', '\".$formvalues[$prefix.'parish'].\"', '\".$formvalues[$prefix.'town'].\"', '\".$formvalues[$prefix.'district'].\"', '\".$formvalues[$prefix.'plotno'].\"', '\".$formvalues[$prefix.'lc1cm'].\"', '\".$formvalues[$prefix.'lc1tel'].\"', '\".$formvalues[$prefix.'lc2cm'].\"', '\".$formvalues[$prefix.'lc2tel'].\"', \".$_SESSION['userid'].\", NOW())\";\n\t\t\n\t\t}\n\t\t\n\t\t$result = mysql_query($query);\n\t\t$addressid = \"\";\n\t\t# check if any errors have occured during the saving the activities to the database\n\t\tif (mysql_error() == \"\") {\n\t\t\t# no errors occured, so return the last inserted id\n\t\t\t$addressid = mysql_insert_id();\n\t\t\t\n\t\t\tif(isset($formvalues[$prefix.'addressupdateid'])){\n\t\t\t\t$addressid = $formvalues[$prefix.'addressupdateid'];\n\t\t\t}\n\t\t} else {\n\t\t\t# add the error message to the string\n\t\t\t$_SESSION['error'] = \"ERROR: Couldnot insert address for \".$formvalues[$prefix.'village'].\". Please try again. DETAILS: \".mysql_error();\n\t\t}\n\t\treturn $addressid;\n\t\n}", "public function save() {\n $postcode = $this->getQuote()->getShippingAddress()->getPostcode();\n $this->getQuote()->collectTotals();\n $this->getQuote()->getShippingAddress()->setPostcode($postcode);\n $this->getQuote()->save();\n\n return $this;\n }", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "public function setAddress($address)\n {\n $this->set('address', $address);\n }", "function viewAddress(){\r\n $payment = new managePaymentModel();\r\n $payment->cust_ID = $_SESSION['cust_ID'];\r\n return $payment->viewAddress();\r\n }", "public function setAutoResponderToAddressField($value) { $this->_autoResponderToAddressField = $value; }", "function save()\n {\n $baseobject = $this->getBaseObject();\n $this->dn = \"cn=$baseobject->cn,\".get_ou('phoneRDN').$baseobject->base;\n $baseobject->dn = $this->dn;\n\n foreach ($this->by_object as $key => $obj) {\n $this->by_object[$key]->dn = $this->dn;\n }\n\n parent::save();\n }", "public function update(CustomerAddress $add)\n\t{\n\t\t//\n\t}", "public function setShippingAddressAction()\n {\n $data = $this->Request()->getParams();\n //we need to set this because of a bug in the shopware models\n if (!isset($data['stateId'])) {\n $data['stateId'] = 0;\n }\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n if ($shippingAddressModel = $customerModel->getShipping()) {\n $shippingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($shippingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['shippingAddressId' => $shippingAddressModel->getId()]);\n }\n }", "public function chooseAddress() {\n\t\t$disposition = $this->DispositionManager->get();\n\t\t$collection = new Collection($disposition->addresses);\n\t\t$address_id = Hash::get($this->request->getQueryParams(), 'address');\n\t\t$choice = $collection->filter(function($address) use($address_id){\n\t\t\treturn $address->id == $address_id;\n\t\t});\n\t\t$this->DispositionManager->disposition->addresses = $choice->toArray();\n\t\t$this->DispositionManager->write();\n\t\t$this->autoRender = false;\n\t\t$this->redirect($this->refererStack(SYSTEM_CONSUME_REFERER));\n\t}", "public function saveOfferShippingAddress($address, $id)\r\n {\r\n if($address['stateID'] == null)\r\n {\r\n $address['stateID']='0';\r\n }\r\n $checkForExistingDocument = Shopware()->Db()->fetchRow(\"SELECT id FROM s_offer_shippingaddress WHERE offerID = ?\",array($id));\r\n\r\n if (!empty($checkForExistingDocument[\"id\"])) {\r\n\r\n $sql = \"\r\n UPDATE s_offer_shippingaddress SET\r\n userID = ?,\r\n company = ?,\r\n department = ?,\r\n salutation = ?,\r\n firstname = ?,\r\n lastname = ?,\r\n street = ?,\r\n zipcode = ?,\r\n city = ?,\r\n countryID = ?,\r\n stateID = ?\r\n WHERE offerID = ?\r\n \";\r\n\t\t\t$street = $address[\"street\"];\r\n\t\t\tif(!Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5\")){\r\n\t\t\t\t$street = $address[\"street\"].\" \".$address[\"streetnumber\"];\r\n\t\t\t}\r\n $department = $address[\"department\"];\r\n $company = $address[\"company\"];\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n if(!isset($department) || empty($department)) {\r\n $department = \"\";\r\n }\r\n if(!isset($company) || empty($company)) {\r\n $company = \"\";\r\n }\r\n }\r\n\r\n $array = array(\r\n $address[\"userID\"],\r\n $company,\r\n $department,\r\n $address[\"salutation\"],\r\n $address[\"firstname\"],\r\n $address[\"lastname\"],\r\n $street,\r\n $address[\"zipcode\"],\r\n $address[\"city\"],\r\n $address[\"countryID\"],\r\n $address[\"stateID\"],\r\n $id\r\n );\r\n }\r\n else{\r\n $sql = \"\r\n INSERT INTO s_offer_shippingaddress\r\n (\r\n userID,\r\n offerID,\r\n company,\r\n department,\r\n salutation,\r\n firstname,\r\n lastname,\r\n street,\r\n zipcode,\r\n city,\r\n countryID,\r\n stateID\r\n )\r\n VALUES (\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?,\r\n ?\r\n )\r\n \";\r\n\t\t\t\r\n\t\t\t$street = $address[\"street\"];\r\n\t\t\tif(!Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5\")){\r\n\t\t\t\t$street = $address[\"street\"].\" \".$address[\"streetnumber\"];\r\n\t\t\t}\r\n $department = $address[\"department\"];\r\n $company = $address[\"company\"];\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n if(!isset($department) || empty($department)) {\r\n $department = \"\";\r\n }\r\n if(!isset($company) || empty($company)) {\r\n $company = \"\";\r\n }\r\n }\r\n $array = array(\r\n $address[\"userID\"],\r\n $id,\r\n $company,\r\n $department,\r\n $address[\"salutation\"],\r\n $address[\"firstname\"],\r\n $address[\"lastname\"],\r\n $street,\r\n $address[\"zipcode\"],\r\n $address[\"city\"],\r\n $address[\"countryID\"],\r\n $address[\"stateID\"]\r\n );\r\n\r\n }\r\n $result = Shopware()->Db()->executeUpdate($sql,$array);\r\n if (!$result) {\r\n throw new Enlight_Exception(\"Shopware Offer Fatal-Error {$_SERVER[\"HTTP_HOST\"]} : No row affected in s_offer_shippingaddress.\", 0);\r\n }\r\n return $result;\r\n }", "public function setAddress(?string $value): void {\n $this->getBackingStore()->set('address', $value);\n }", "protected function preSave($detail, $extra) {\n $address = $this->address_library->checkDuplicate($extra);\n \n // Save the address first, set new ID in $detail.\n if( ! isset($address->id) )\n $addr = $this->address_model->insert($address);\n else\n $addr = $this->address_model->update($address);\n if ( $addr === FALSE ) {\n UIMessage::addError('Failed to save address');\n return FALSE;\n }\n \n // Save address in session\n $_SESSION[$this->sessionKey('address')] = $addr;\n \n // Store address ID in recruiter entity\n $detail->address_id = $addr->id;\n \n return $detail;\n }", "public function processEdit( Mage_Payment_Model_Recurring_Profile $profile, Varien_Object $input )\n\t{\n\t\t$customer = Mage::helper('tokenbase')->getCurrentCustomer();\n\t\t\n\t\tif( $profile->getShippingAddressInfo() != array() ) {\n\t\t\t$origAddr\t= Mage::getModel('sales/quote_address')->load( $profile->getInfoValue('shipping_address_info', 'address_id') );\n\t\t\t$newAddrId\t= intval( $input->getData('shipping_address_id') );\n\t\t\t\n\t\t\t/**\n\t\t\t * Has the address changed?\n\t\t\t */\n\t\t\tif( $origAddr && $newAddrId != $origAddr->getCustomerAddressId() ) {\n\t\t\t\t/**\n\t\t\t\t * New address or existing?\n\t\t\t\t * \n\t\t\t\t * If new:\n\t\t\t\t * - store as customer address\n\t\t\t\t * - convert to quote address\n\t\t\t\t * - add to profile\n\t\t\t\t * \n\t\t\t\t * If existing:\n\t\t\t\t * - convert to quote address\n\t\t\t\t * - add to profile\n\t\t\t\t */\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Existing address\n\t\t\t\t */\n\t\t\t\tif( $newAddrId > 0 ) {\n\t\t\t\t\t$newAddr = Mage::getModel('customer/address')->load( $newAddrId );\n\t\t\t\t\t\n\t\t\t\t\tif( !$customer || $newAddr->getCustomerId() != $customer->getId() ) {\n\t\t\t\t\t\tMage::throwException( $this->__('An error occurred. Please try again.') );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * New address\n\t\t\t\t */\n\t\t\t\telse {\n\t\t\t\t\t$newAddr = Mage::getModel('customer/address');\n\t\t\t\t\t$newAddr->setCustomerId( $customer->getId() );\n\t\t\t\t\t\n\t\t\t\t\t$data = $input->getData('shipping');\n\t\t\t\t\t\n\t\t\t\t\t$addressForm = Mage::getModel('customer/form');\n\t\t\t\t\t$addressForm->setFormCode('customer_address_edit');\n\t\t\t\t\t$addressForm->setEntity( $newAddr );\n\t\t\t\t\t\n\t\t\t\t\t$addressData = $addressForm->extractData( $addressForm->prepareRequest( $data ) );\n\t\t\t\t\t$addressErrors = $addressForm->validateData( $addressData );\n\t\t\t\t\t\n\t\t\t\t\tif( $addressErrors !== true ) {\n\t\t\t\t\t\tMage::throwException( implode( ' ', $addressErrors ) );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$addressForm->compactData( $addressData );\n\t\t\t\t\t$addressErrors = $newAddr->validate();\n\t\t\t\t\t\n\t\t\t\t\t$newAddr->setSaveInAddressBook( true );\n\t\t\t\t\t$newAddr->implodeStreetAddress();\n\t\t\t\t\t$newAddr->save();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Update the shipping address on our record\n\t\t\t\t */\n\t\t\t\t$origAddr->importCustomerAddress( $newAddr );\n\t\t\t\t\n\t\t\t\t$shippingAddr = $origAddr->getData();\n\t\t\t\t$this->_cleanupArray( $shippingAddr );\n\t\t\t\t$profile->setShippingAddressInfo( $shippingAddr );\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Has the payment card changed?\n\t\t */\n\t\t$tokenbaseId = intval( $input->getData('tokenbase_id') );\n\t\tif( $tokenbaseId > 0 && $tokenbaseId != $profile->getInfoValue('additional_info', 'tokenbase_id') ) {\n\t\t\t$card = Mage::getModel('tokenbase/card')->load( $tokenbaseId );\n\t\t\t\n\t\t\tif( $card && $card->getId() == $tokenbaseId && ( $customer->getId() == 0 || $card->hasOwner( $customer->getId() ) ) ) {\n\t\t\t\t$adtl = $profile->getAdditionalInfo();\n\t\t\t\t$adtl['tokenbase_id'] = $tokenbaseId;\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Update billing address to match the card\n\t\t\t\t */\n\t\t\t\t$billingAddr\t= $profile->getBillingAddressInfo();\n\t\t\t\t\n\t\t\t\t$copyKeys\t\t= array( 'street', 'firstname', 'lastname', 'city', 'region', 'region_id', 'postcode', 'country_id', 'telephone', 'fax' );\n\t\t\t\tforeach( $copyKeys as $key ) {\n\t\t\t\t\t$billingAddr[ $key ] = $card->getAddress( $key );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$profile->setBillingAddressInfo( $billingAddr );\n\t\t\t\t$profile->setAdditionalInfo( $adtl );\n\t\t\t\t\n\t\t\t\tMage::helper('tokenbase')->log( $profile->getMethodCode(), sprintf( 'Changed tokenbase ID for RP #%s to %s', $profile->getReferenceId(), $adtl['tokenbase_id'] ) );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMage::throwException( $this->__('Payment record not found. Please try again.') );\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Has the next billing date changed?\n\t\t */\n\t\t$nextBilled = Mage::getModel('core/date')->gmtTimestamp( $input->getData('next_billed') );\n\t\tif( $input->getData('next_billed') != '' && $nextBilled > 0 && $nextBilled != $profile->getInfoValue('additional_info', 'next_cycle') ) {\n\t\t\t$adtl = $profile->getAdditionalInfo();\n\t\t\t$adtl['next_cycle'] = $nextBilled;\n\t\t\t\n\t\t\t$profile->setAdditionalInfo( $adtl );\n\t\t\t\n\t\t\tMage::helper('tokenbase')->log( $profile->getMethodCode(), sprintf( 'Changed next billing cycle for RP #%s to %s', $profile->getReferenceId(), date( 'j-F Y h:i', Mage::getModel('core/date')->timestamp( $adtl['next_cycle'] ) ) ) );\n\t\t}\n\t\t\n\t\tMage::dispatchEvent( 'tokenbase_recurringprofile_edit_before_save', array( 'profile' => $profile, 'input' => $input ) );\n\t\t\n\t\t$profile->save();\n\t\t\n\t\treturn $profile;\n\t}", "public function addAdditionalDataToAddress(Varien_Event_Observer $observer)\n {\n $event = $observer->getEvent();\n $address = $event['address'];\n $orderData = $address->getOrder()->getData();\n $address->setData(\n array_merge(\n $address->getData(),\n array(\n 'vat_id' => $orderData['customer_taxvat'],\n )\n ));\n }", "public function handleAddress ()\n {\n /**\n * Wir verzichten der Übersichtlichkeit halber auf eine Validierung. Eigentlich müsste hier eine Daten-\n * validierung durchgeführt werden und etwaige Fehler an den User zurückgespielt werden. Im Login machen wir das\n * beispielsweise und auch bei der Bearbeitung eines Produkts. Der nachfolgende Code dürfte gar nicht mehr\n * ausgeführt werden, wenn Validierungsfehler aufgetreten sind.\n */\n\n /**\n * Eingeloggten User abfragen\n */\n $user = User::getLoggedInUser();\n\n /**\n * Wurde das linke Formular abgeschickt?\n */\n if (isset($_POST['address_id'])) {\n /**\n * Ausgefühlte AddressId in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt wieder\n * verwenden können.\n */\n Session::set(self::ADDRESS_KEY, (int)$_POST['address_id']);\n }\n\n /**\n * Wurde das rechte Formular abgeschickt?\n */\n if (isset($_POST['address'])) {\n /**\n * Neue Addresse erstellen und in die Datenbank speichern.\n */\n $address = new Address();\n $address->address = $_POST['address'];\n $address->user_id = $user->id;\n $address->save();\n\n /**\n * ID der neu erstellten Adresse in die Session speichern, damit wir sie in einem weiteren Checkout-Schritt\n * wieder verwenden können.\n */\n Session::set(self::ADDRESS_KEY, (int)$address->id);\n }\n\n /**\n * Weiterleiten auf den nächsten Schritt im Checkout Prozess.\n */\n $baseUrl = Config::get('app.baseUrl');\n header(\"Location: {$baseUrl}checkout/final\");\n }", "public function save(Address $address)\n { \n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if ($address->getId() === null) {\n $address->setCreated($now);\n }\n\n $this->em->persist($address);\n $this->em->flush();\n }", "protected function _doAddressbooks()\n {\n global $prefs;\n\n $abooks = $prefs->getValue('addressbooks');\n if (is_array(json_decode($abooks))) {\n return;\n }\n\n $abooks = explode(\"\\n\", $abooks);\n if (is_array($abooks) && !empty($abooks[0])) {\n $new_prefs = array();\n foreach ($abooks as $abook) {\n $new_prefs[] = $this->_updateShareName($abook);\n }\n\n $prefs->setValue('addressbooks', json_encode($new_prefs));\n }\n }", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "public function setAddress($value)\n {\n $this->_address = $value;\n }", "public function saveShipping($data, $customerAddressId, $saveQuote = true)\n {\n if (empty($data)) {\n throw new Klarna_Kco_Exception($this->_helper->__('Invalid billing details'));\n }\n\n $address = $this->getQuote()->getShippingAddress();\n\n /* @var $addressForm Mage_Customer_Model_Form */\n $addressForm = Mage::getModel('customer/form');\n $addressForm->setFormCode('customer_address_edit')\n ->setEntityType('customer_address')\n ->setIsAjaxRequest(Mage::app()->getRequest()->isAjax());\n\n if (!empty($customerAddressId)) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n if ($customerAddress->getId()) {\n if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) {\n throw new Klarna_Kco_Exception($this->_helper->__('Customer Address is not valid.'));\n }\n\n $address->importCustomerAddress($customerAddress)->setSaveInAddressBook(0);\n $addressForm->setEntity($address);\n $addressErrors = $addressForm->validateData($address->getData());\n if ($addressErrors !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $addressErrors)));\n }\n }\n } else {\n $addressForm->setEntity($address);\n // emulate request object\n $addressData = $addressForm->extractData($addressForm->prepareRequest($data));\n $addressErrors = $addressForm->validateData($addressData);\n if ($addressErrors !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $addressErrors)));\n }\n\n $addressForm->compactData($addressData);\n // unset shipping address attributes which were not shown in form\n foreach ($addressForm->getAttributes() as $attribute) {\n if (!isset($data[$attribute->getAttributeCode()])) {\n $address->setData($attribute->getAttributeCode(), null);\n }\n }\n\n $address->setCustomerAddressId(null);\n $address->setSaveInAddressBook(empty($data['save_in_address_book']) ? 0 : 1);\n $address->setSameAsBilling(empty($data['same_as_other']) ? 0 : 1);\n }\n\n $address->implodeStreetAddress();\n $address->setCollectShippingRates(true);\n\n if (($validateRes = $address->validate()) !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $validateRes)));\n }\n\n if ($saveQuote) {\n $this->getQuote()->collectTotals()->save();\n }\n\n return $this;\n }", "public function edit()\n\t{\n\t\tif (!$this->user->isLogged() || !$this->auth->validateUserToken($this->uri->getSegment($this->uri->getTotalSegments()))) {\n\n\t\t\t$this->session->set('user_redirect' . $this->session->user_session_id, '/account/address/edit/' . $this->request->uri->getSegment(4));\n\n\t\t\treturn redirect()->to(base_url('/login'));\n\t\t}\n\n\t\t$data = array();\n\n\t\t// Data Libraries\n\t\t$data['lang'] = $this->language;\n\t\t$data['validation'] = $this->validation;\n\n\t\t// Breadcrumbs\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_home', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url(),\n\t\t\t'active' => false,\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_account', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url('/account/' . $this->user->getToken()),\n\t\t\t'active' => false,\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_address_book', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url('/account/address/' . $this->user->getToken()),\n\t\t\t'active' => false,\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' => lang('Heading.heading_address_edit', array(), $this->language->getFrontEndLocale()),\n\t\t\t'href' => base_url('/account/address/edit/' . $this->request->uri->getSegment(4) . '/' . $this->user->getToken()),\n\t\t\t'active' => true,\n\t\t);\n\n\t\t// Data Text\n\t\t$data['heading_title'] = lang('Heading.heading_address_edit', array(), $this->language->getFrontEndLocale());\n\n\t\t// Data Link\n\t\t$data['action'] = base_url('/account/address/edit/' . $this->request->uri->getSegment(4) . '/' . $this->user->getToken());\n\n\t\t// Form Validation\n\t\tif ($this->request->getPost()) {\n\t\t\t$this->validate([\n\t\t\t\t'firstname' => ['label' => lang('Entry.entry_firstname', array(), $this->language->getFrontEndLocale()), 'rules' => 'required', 'errors' => ['required' => lang('Error.error_required', array(), $this->language->getFrontEndLocale())]],\n\t\t\t\t'lastname' => ['label' => lang('Entry.entry_lastname', array(), $this->language->getFrontEndLocale()), 'rules' => 'required', 'errors' => ['required' => lang('Error.error_required', array(), $this->language->getFrontEndLocale())]],\n\t\t\t]);\n\n\t\t\t// Check if errors exist\n\t\t\tif (!empty($this->validation->getErrors())) {\n\t\t\t\t$data['error'] = lang('Error.error_form', array(), $this->language->getFrontEndLocale());\n\n\t\t\t\t$this->session->remove('error');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->validation->withRequest($this->request)->run() == TRUE) {\n \tif ($this->user->hasPermission()) {\n\t // Query\n\t \t$query = $this->userAddressModel->editUserAddress($this->request->getPost(), $this->user->getId());\n\t \n\t if ($query) {\n\t \t$this->session->set('success', lang('Success.success_user_address_edit', array(), $this->language->getFrontEndLocale()));\n\t } else {\n\t \t$this->session->set('error', lang('Error.error_user_address_edit', array(), $this->language->getFrontEndLocale()));\n\t }\n } else {\n\t $this->session->set('error', lang('Error.error_permission_modify', array(), $this->language->getFrontEndLocale()));\n }\n\n\t\t\treturn redirect()->to(base_url('/account/address/' . $this->user->getToken()));\n\t\t}\n\n\t\t// Return\n\t\treturn $this->getForm($data);\n\t}", "public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }", "function setMainAddress( &$mainAddress, &$user )\n {\n if ( get_class( $mainAddress ) == \"ezaddress\" )\n $addressID = $mainAddress->id();\n else\n $addressID = $mainAddress;\n if ( get_class ( $user ) == \"ezuser\" )\n $userID = $user->id();\n else\n $userID = $user;\n\n $db =& eZDB::globalDatabase();\n\n $db->array_query( $checkForAddress, \"SELECT UserID FROM eZAddress_AddressDefinition\n WHERE UserID='$userID'\" );\n\n if ( count ( $checkForAddress ) != 0 )\n {\n $res[] = $db->query( \"UPDATE eZAddress_AddressDefinition SET\n AddressID='$addressID',\n UserID='$userID'\n WHERE UserID='$userID'\" );\n }\n else\n {\n $db->begin();\n $res[] = $db->query( \"INSERT INTO eZAddress_AddressDefinition\n (AddressID, UserID)\n VALUES\n ('$addressID', '$userID')\" );\n $db->unlock();\n }\n \n eZDB::finish( $res, $db );\n }", "public function setAddress($address) {\n\t\t$this->address = $address;\n\t}", "public function wc_address_book_make_primary() {\n\n\t\t$customer_id = get_current_user_id();\n\t\t$address_book = $this->get_address_book( $customer_id );\n\n\t\t$primary_address_name = 'shipping';\n\t\t$alt_address_name = $_POST['name'];\n\n\t\t// Loop through and swap values between shipping names.\n\t\tforeach ( $address_book[ $primary_address_name ] as $field => $value ) {\n\n\t\t\t$alt_field = preg_replace( '/^[^_]*_\\s*/', $alt_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $alt_address_name ][ $alt_field ] );\n\t\t}\n\n\t\tforeach ( $address_book[ $alt_address_name ] as $field => $value ) {\n\n\t\t\t$primary_field = preg_replace( '/^[^_]*_\\s*/', $primary_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $primary_address_name ][ $primary_field ] );\n\t\t}\n\n\t\tdie();\n\t}", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "public function save() \n {\n $oForwarding = oxNew('fcpoforwarding');\n $aForwardings = $this->_oFcpoHelper->fcpoGetRequestParameter(\"editval\");\n if(is_array($aForwardings) && count($aForwardings) > 0) {\n $oForwarding->fcpoUpdateForwardings($aForwardings);\n }\n }", "function saveAddressData($new = FALSE, $addressType = 0) {\n\t\t$newData = array();\n\n\t\t// Set basic data\n\t\tif (empty($addressType)) $addressType = 0;\n\t\tif ($this->piVars['ismainaddress'] == 'on') {\n\t\t\t$newData['tx_commerce_is_main_address'] = 1;\n\t\t\t// Remove all \"is main address\" flags from addresses that are assigned to this user\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t\t'tt_address',\n\t\t\t\t'pid=' . $this->conf['addressPid'] . ' AND tx_commerce_fe_user_id=' . $this->user['uid'] . ' AND tx_commerce_address_type_id=' . $addressType,\n\t\t\t\tarray('tx_commerce_is_main_address' => 0)\n\t\t\t);\n\t\t} else {\n\t\t\t$newData['tx_commerce_is_main_address'] = 0;\n\t\t}\n\n\t\t$newData['tstamp'] = time();\n\n\t\tif ($this->debug) {\n\t\t\tdebug($newData,'newdata');\n\t\t}\n\n\t\tforeach($this->fieldList as $name) {\n\t\t\t$newData[$name] = t3lib_div::removeXSS(strip_tags($this->piVars[$name]));\n\t\t\tif (!$new) {\n\t\t\t\t$this->addresses[intval($this->piVars['addressid']) ][$name] = t3lib_div::removeXSS(strip_tags($this->piVars[$name]));\n\t\t\t}\n\t\t}\n\n\n\t\t// Hook to process new/changed address\n\t\t$hookObjectsArr = array();\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi4/class.tx_commerce_pi4.php']['saveAddress'])) {\n\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi4/class.tx_commerce_pi4.php']['saveAddress'] as $classRef) {\n\t\t\t\t$hookObjectsArr[] = &t3lib_div::getUserObj($classRef);\n\t\t\t}\n\t\t}\n\n\t\tif ($new) {\n\t\t\t$newData['tx_commerce_fe_user_id'] = $this->user['uid'];\n\t\t\t$newData['tx_commerce_address_type_id'] = $addressType;\n\t\t\t$newData['pid'] = $this->conf['addressPid'];\n\n\t\t\tforeach($hookObjectsArr as $hookObj) {\n\t\t\t\tif (method_exists($hookObj, 'beforeAddressSave')) {\n\t\t\t\t\t$hookObj->beforeAddressSave($newData, $this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t\t'tt_address',\n\t\t\t\t$newData\n\t\t\t);\n\t\t\t$newUid = $GLOBALS['TYPO3_DB']->sql_insert_id();\n\n\t\t\tforeach($hookObjectsArr as $hookObj) {\n\t\t\t\tif (method_exists($hookObj, 'afterAddressSave')) {\n\t\t\t\t\t$hookObj->afterAddressSave($newUid, $newData, $this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->addresses = $this->getAddresses($this->user['uid']);\n\t\t} else {\n\t\t\tforeach($hookObjectsArr as $hookObj) {\n\t\t\t\tif (method_exists($hookObj, 'beforeAddressEdit')) {\n\t\t\t\t\t$hookObj->beforeAddressEdit((int)$this->piVars['addressid'], $newData, $this);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sWhere = 'uid=' . intval($this->piVars['addressid']) . \" AND tx_commerce_fe_user_id = \" . $GLOBALS[\"TSFE\"]->fe_user->user[\"uid\"] . ' ';\n\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t\t'tt_address',\n\t\t\t\t$sWhere,\n\t\t\t\t$newData\n\t\t\t);\n\n\t\t\tforeach($hookObjectsArr as $hookObj) {\n\t\t\t\tif (method_exists($hookObj, 'afterAddressEdit')) {\n\t\t\t\t\t$hookObj->afterAddressEdit((int)$this->piVars['addressid'], $newData, $this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function saveAction()\n {\n $tab = '';\n \n \n $pPoOrderId = $this->getRequest()->getPost('po_order_id');\n \n //get input parametre from the webpage.\n $order = Mage::getModel('purchase/order')->load($pPoOrderId);\n\n $order->setPurchaseRep(Mage::getSingleton('admin/session')->getUser()->getUsername());\n \n if ($this->getRequest()->getPost('order_eta')){\n $order->setOrderEta($this->getRequest()->getPost('order_eta'));\n }else{\n $order->setOrderEta(null);\n }\n $order->setPaymentTerms($this->getRequest()->getPost('payment_term_id'));\n $order->setShippingMethod($this->getRequest()->getPost('shipping_method_id'));\n \n $order->setComments($this->getRequest()->getPost('comments'));\n $order->setStoreId($this->getRequest()->getPost('store_id'));\n \n $order->setShippingName($this->getRequest()->getPost('shipping_name'));\n $order->setShippingCompany($this->getRequest()->getPost('shipping_company'));\n $order->setShippingStreet1($this->getRequest()->getPost('shipping_street1'));\n $order->setShippingStreet2($this->getRequest()->getPost('shipping_street2'));\n $order->setShippingCity($this->getRequest()->getPost('shipping_city'));\n $order->setShippingState($this->getRequest()->getPost('shipping_state'));\n $order->setShippingZipcode($this->getRequest()->getPost('shipping_zipcode'));\n $order->setShippingCountry($this->getRequest()->getPost('shipping_country'));\n $order->setShippingTelephone1($this->getRequest()->getPost('shipping_telephone1'));\n $order->setShippingTelephone2($this->getRequest()->getPost('shipping_telephone2'));\n $order->setShippingFax($this->getRequest()->getPost('shipping_fax'));\n $order->setShippingEmail($this->getRequest()->getPost('shipping_email'));\n $order->setShippingType($this->getRequest()->getPost('shipping_type')); \n// $order->setShippingSalesOrderId(\"\"); \n if($this->getRequest()->getPost('po_shipping_type')==\"so\")\n $order->setShippingSalesOrderId($this->getRequest()->getPost('po_shipping_so_num')); \n else\n $order->setShippingSalesOrderId(\"\"); \n \n $order->save(); \n \n $purchaseOrderId = $order->getId();\n \n \n //Process information from \"review product\" tab page\n foreach ($order->getOrderItems() as $item)\n {\n\n $itemId = $item->getId();\n \n if ($this->getRequest()->getPost('delete_'.$itemId) == 1)\n {\n $vOldQty = $item->getProductQty();\n $vProductQty = 0;\n $item->delete();\n }\n else \n {\n $receivedQty =$item->getQtyReceipted(); \n $vOldQty = $item->getProductQty();\n $vProductQty = $this->getRequest()->getPost('product_qty_'.$itemId);\n\n if (!(($vProductQty < $receivedQty) || ($vOldQty < $receivedQty))){ \n $item->setPurchaseOrderId($purchaseOrderId);\n $item->setProductId($this->getRequest()->getPost('product_id_'.$itemId));\n $item->setProductName($this->getRequest()->getPost('product_name_'.$itemId));\n \n //$item->setpop_supplier_ref($this->getRequest()->getPost('pop_supplier_ref_'.$item->getId()));\n \n $item->setProductQty($vProductQty);\n $item->setProductPrice($this->getRequest()->getPost('product_price_'.$itemId));\n $item->setSubtotal($item->getProductQty() * $item->getProductPrice());\n $item->setTotal($item->getSubtotal() + $item->getTax() + $item->getAdjustFee());\n $item->save();\n\n $vendorProduct = Mage::getModel(\"purchase/vendorproduct\")\n ->loadByProductId($order->getVendorId() , $item->getProductId());\n $vendorProduct->setVendorSku($this->getRequest()->getPost('vendor_sku_'.$itemId))\n ->setUnitCost($item->getProductPrice())\n ->save();\n }else {\n Mage::getSingleton('adminhtml/session')->addWarning($this->__('not updated for %s: new qty[%s] less than received qty [%s]', $item->getProductName(), $vProductQty, $receivedQty)); \n $vProductQty = $vOldQty;\n } \n\n } \n //process update qty when order had been send to vendor\n if ((($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY) \n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED))\n && ($vOldQty != $vProductQty)){\n \n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $purchaseOrderId,\n 'po_product_id' => $item->getProductId(), \n 'po_product_qty_old' => $vOldQty,\n 'po_product_qty_new' => $vProductQty));\n\n } \n\n }\n\n\n \n //process information from \"Add product\" tab page, check if we have to add products\n if ($this->getRequest()->getPost('add_product') != '')\n {\n $productsToAdd = Mage::helper('purchase')->decodeInput($this->getRequest()->getPost('add_product'));\n foreach($productsToAdd as $key => $value)\n {\n //retrieves values\n $productId = $key;\n $qty = $value['qty'];\n if ($qty == '')\n $qty = 1;\n \n //add product\n $order->addItems($productId, $qty);\n \n //process update qty when order had been send to vendor\n if (($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY)\n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED)){\n \n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $purchaseOrderId,\n 'po_product_id' => $productId, \n 'po_product_qty_old' => 0,\n 'po_product_qty_new' => $qty));\n\n }\n \n }\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Products added'));\n $tab = 'tab_products';\n $order->resetOrderItems();\n \n }\n \n $orderSubtotal = 0.0000;\n //$orderTotal = 0.0000;\n foreach ($order->getOrderItems() as $item)\n {\n $orderSubtotal += $item->getSubtotal();\n //$orderTotal += $item->getTotal();;\n //Update vendor_product's vendor sku, cost...etc,.\n Mage::dispatchEvent('purchase_order_update_vendor_product', array('po_order_item'=>$item));\n }\n $order->setSubtotal($orderSubtotal)\n ->setTotal($orderSubtotal + $order->getTax() + $order->getAdjustFee() + $order->getShippingPrice())\n ->save();\n \n //Process information from \"send to vendor\" tab page.\n $notifyFlag = $this->getRequest()->getPost('send_to_customer');\n if ($notifyFlag == 1)\n {\n $order->notifyVendor($this->getRequest()->getPost('email_comment'));\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Vendor notified'));\n\n //update Po_qty in stockitem.\n foreach ($order->getOrderItems() as $item)\n {\n Mage::dispatchEvent('purchase_order_refresh_poqty', \n array('po_order_id' => $order->getId(),\n 'po_product_id' => $item->getProductId(), \n 'po_product_qty_old' => 0,\n 'po_product_qty_new' => $item->getProductQty()));\n }\n\n }\n \n if (($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_WAITING_FOR_DELIVERY)\n ||($order->getStatus() == Ebulb_Purchase_Model_Order::STATUS_PARTIALLY_RECEIVED) ){\n Mage::dispatchEvent('purchase_order_refresh_status', \n array('po_order' => $order)); \n }\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Saved'));\n \n $this->_redirect('purchase/orders/edit/po_order_id/'.$order->getOrderId().'/tab/'.$tab);\n \n }", "public function update(Request $request)\n {\n // Get logged in user\n $customer_user = Auth::user();\n $customer = Auth::user()->customer;\n $address = $customer->address;\n\n// $rules = \\Arr::except( Customer::$rules, array('password') );\n $rules = [];\n $this->validate($request, $rules);\n\n $request->merge( ['name_commercial' => $request->input('address.name_commercial')] );\n\n // $customer->update( array_merge($request->all(), ['name_commercial' => $request->input('address.name_commercial')] ) );\n $customer->update( $request->all() );\n if ( !$request->input('address.name_commercial') ) $request->merge( ['address.name_commercial' => $request->input('name_fiscal')] );\n $data = $request->input('address');\n $address->update($data);\n\n\n return redirect()->route('abcc.customer.edit')\n ->with('info', l('This record has been successfully updated &#58&#58 (:id) ', ['id' => ''], 'layouts') . $request->input('name_commercial'));\n }", "function saveEstimateSignDetailsAction()\n\t{\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$signParams = $this->_request->getParams();\n\n\t\t\t$quote_id=$signParams['quote_id'];\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quoteObj->getQuoteDetails($quote_id);\n\n\t\t\t\t$status=$quoteDetails[0]['sales_review'];\n\t\t\t\tif($status=='not_done')\n\t\t\t\t\t$status='';\n\n\t\t\t\t\n\t\t\t\t$quote_update['estimate_sign_percentage']=$signParams['estimate_sign_percentage'];\n\t\t\t\t$quote_update['estimate_sign_date']=$signParams['estimate_sign_date'];\n\t\t\t\t$quote_update['estimate_sign_comments']=$signParams['estimate_sign_comments'];\n\n\n\t\t\t\t//echo \"<pre>\";print_r($_SERVER);exit;\t\t\t\t\n\t\t\t\t$quoteObj->updateQuote($quote_update,$quote_id);\n\n\t\t\t\t$this->_helper->FlashMessenger('Details updated successfully');\n\t\t\t}\t\n\n\n\t\t\t$this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2&active=\".$status);\n\t\t}\n\t\t\n\t}", "function saveInfo(){\n mysql_query(\"UPDATE school_payments SET schoolId='$this->schoolId' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET amount='$this->amount' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET started='$this->started' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET completed='$this->completed' WHERE id='$this->paymentId'\") or die(mysql_error());\n mysql_query(\"UPDATE school_payments SET finaid='$this->finaid' WHERE id='$this->paymentId'\") or die(mysql_error());\n }", "public function setAddress($data=null) {\n if(!is_array($data)) {\n $b = $this->getBilling();\n $p = $this->getPayment();\n $data = array(\n 'STREET' => $b['address'],\n 'STREET2' => $b['address2'],\n 'CITY' => $b['city'],\n 'STATE' => $b['state'],\n 'COUNTRYCODE' => $b['country'],\n 'ZIP' => $b['zip'],\n 'SHIPTOPHONENUM' => $p['phone']\n );\n }\n $this->_payerAddress = $data;\n }", "public function addresssavevenue(Request $request)\n {\n $respAr = array();\n $errorflagmsg = 0;\n $error_message='';\n $venuecretaeOredit=0;\n $nicknmres = 0;\n $user_id = 1;\n if ($request->session()->has('front_id_sess'))\n {\n $user_id=$request->session()->get('front_id_sess'); // get session \n $venueID = $this->getseo_name($user_id);\n }\n //**********check modifying date starts here\n $r = $this->check_modifying_date($venueID,$user_id);\n //IF MODIFYING DATE IS 1 THEN THIS IS FIRST TIME EDIT //*** update user_master table ends\n \n $addressvenue1 = $request->input('address1val');\n $addressvenue2 = $request->input('address2val');\n \n $countryId = $request->input('countrydata');\n $statelistdata = $request->input('statelistdata');\n $tablenamecountry ='location_country';\n $tablenamestate ='location_state';\n $countryfield = 'country_name';\n $statefield = 'state_name';\n\n\n\n$chkvalid=$this->checksavevenueaddressamenities($request);\n\nif($chkvalid===true)\n{\n //$countrycmpfield = 'id';\n //$statecmpfield = '';\n \n $countryname = $this->getcountrystatevenueedit($countryId,$tablenamecountry,$countryfield);\n $statename = $this->getcountrystatevenueedit($statelistdata,$tablenamestate,$statefield);\n \n $towndata = $request->input('towndata');\n $zipdata = $request->input('zipdata');\n //$addressvenue1 = $request->input('valchk');\n $valchk = $request->input('valchk');\n \n //*************getltlong from address starts here\n $hlprdta = urlencode($addressvenue1.' '.$addressvenue2.' '.$towndata.' '.$zipdata.' '.$statename.' '.$countryname);\n $LatLongchk = getLatLong($hlprdta);\n $latitude = $LatLongchk['latlong'][0]['latitude'];\n // echo \"<br>\";\n $longitude = $LatLongchk['latlong'][0]['longitude'];\n $TimeZoneCheck = getTimezone($latitude,$longitude);\n $timezoneId = $TimeZoneCheck['timeZoneId'];\n $timezoneName = $TimeZoneCheck['timeZoneName'];\n //*************get latlong from address ends here\n \n $updatedatavenue = array(\n 'address_1' =>$addressvenue1,\n 'address_2' =>$addressvenue2,\n 'country' =>$countryId,\n 'state'=>$statelistdata,\n 'city'=>$towndata,\n 'zip'=>$zipdata,\n 'venue_lat'=>$latitude,\n 'venue_long'=>$longitude,\n 'venue_timezone'=>$timezoneId,\n 'modified_date'=>date('Y-m-d H:i:s')\n );\n //echo \"<pre>\";\n //print_r($updatedatavenue);\n \n //$insertvaenueaminity = \n $amnty = count($valchk);\n if($amnty>0)\n {\n DB::table('venue_amenity_rel')\n ->where('venue_id', $venueID)\n ->where('v_creator_id', $user_id)\n ->delete();\n for($i=0;$i<$amnty;$i++)\n {\n DB::table('venue_amenity_rel')->insert([\n \n ['venue_id' => $venueID,'v_creator_id' => $user_id, 'amenity_id' => $valchk[$i],'create_date' =>date('Y-m-d H:i:s')]\n ]);\n }\n }\n \n $updatevenueqry = DB::table('venue_master')\n ->where('id', $venueID)\n ->where('creater_id', $user_id)\n ->update($updatedatavenue);\n if($updatevenueqry)\n {\n // echo \"Data updated successfully\";\n $respAr['flag']=1;\n \n }else\n {\n //echo \"Data not updated succesfully\";\n $respAr['flag']=0;\n }\n if($r == 1)\n {\n $request->session()->flash('front_successmsgdata_sess', 'Your venue has been created successfully .');\n //return redirect('/');\n $venuecretaeOredit=1;\n //**get nickname starts here\n $nicknmres = $this->getnicknm($venueID,$user_id);\n //**get nickname ends here\n \n }\n $errorflagmsg = 1;\n \n\n }\n \n else\n { \n\n $error_message = $chkvalid->messages();\n }\n $error_msgAr=array(); // echo $amnty;\n // die;\n $respAr['venuecretaeedit']=$venuecretaeOredit;\n $respAr['nicknmdata']= $nicknmres;\n $respAr['errormsgdata']= $error_message;\n $respAr['errorflagmsghck']= $errorflagmsg;\n\n echo json_encode($respAr); \n \n // print_r($addressvenue1);die;\n //$j = count($addressvenue1);\n \n }", "public function redirect_on_save( $user_id, $name ) {\n\n\t\tif ( ! is_admin() && ! defined( 'DOING_AJAX' ) ) {\n\n\t\t\twp_safe_redirect( wc_get_account_endpoint_url( 'edit-address' ) );\n\t\t\texit;\n\t\t}\n\t}", "public function saveBilling($data, $customerAddressId, $saveQuote = true)\n {\n if (empty($data)) {\n throw new Klarna_Kco_Exception($this->_helper->__('Invalid billing details'));\n }\n\n $address = $this->getQuote()->getBillingAddress();\n /* @var $addressForm Mage_Customer_Model_Form */\n $addressForm = Mage::getModel('customer/form');\n $addressForm->setFormCode('customer_address_edit')\n ->setEntityType('customer_address')\n ->setIsAjaxRequest(Mage::app()->getRequest()->isAjax());\n\n if (!empty($customerAddressId)) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n if ($customerAddress->getId()) {\n if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) {\n throw new Klarna_Kco_Exception($this->_helper->__('Customer Address is not valid.'));\n }\n\n $address->importCustomerAddress($customerAddress)->setSaveInAddressBook(0);\n $addressForm->setEntity($address);\n $addressErrors = $addressForm->validateData($address->getData());\n if ($addressErrors !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $addressErrors)));\n }\n }\n } else {\n $addressForm->setEntity($address);\n $addressData = $addressForm->extractData($addressForm->prepareRequest($data));\n $addressErrors = $addressForm->validateData($addressData);\n if ($addressErrors !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", array_values($addressErrors))));\n }\n\n $addressForm->compactData($addressData);\n //unset billing address attributes which were not shown in form\n foreach ($addressForm->getAttributes() as $attribute) {\n if (!isset($data[$attribute->getAttributeCode()])) {\n $address->setData($attribute->getAttributeCode(), null);\n }\n }\n\n $address->setCustomerAddressId(null);\n $address->setSaveInAddressBook(0);\n }\n\n // set email for newly created user\n if (!$address->getEmail() && $this->getQuote()->getCustomerEmail()) {\n $address->setEmail($this->getQuote()->getCustomerEmail());\n }\n\n // validate billing address\n if (version_compare(Mage::getVersion(), '1.7', '>=') && ($validateRes = $address->validate()) !== true) {\n throw new Klarna_Kco_Exception(sprintf('%s', implode(\"\\n\", $validateRes)));\n }\n\n $address->implodeStreetAddress();\n\n $this->_validateCustomerData($data);\n\n if (!$this->getQuote()->getCustomerId() && self::METHOD_REGISTER == $this->getQuote()->getCheckoutMethod()) {\n if ($this->_customerEmailExists($address->getEmail(), Mage::app()->getWebsite()->getId())) {\n throw new Klarna_Kco_Exception($this->_helper->__($this->_customerEmailExistsMessage));\n }\n }\n\n if (!$this->getQuote()->isVirtual()) {\n /**\n * Billing address using otions\n */\n $usingCase = isset($data['same_as_other']) ? (int)$data['same_as_other'] : 0;\n\n switch ($usingCase) {\n case 0:\n $shipping = $this->getQuote()->getShippingAddress();\n $shipping->setSameAsBilling(0);\n break;\n case 1:\n $billing = clone $address;\n $billing->unsAddressId()->unsAddressType();\n $shipping = $this->getQuote()->getShippingAddress();\n $shippingMethod = $shipping->getShippingMethod();\n\n // Billing address properties that must be always copied to shipping address\n $requiredBillingAttributes = array('customer_address_id');\n\n // don't reset original shipping data, if it was not changed by customer\n foreach ($shipping->getData() as $shippingKey => $shippingValue) {\n if (null !== $shippingValue && null !== $billing->getData($shippingKey)\n && !isset($data[$shippingKey])\n && !in_array($shippingKey, $requiredBillingAttributes)\n ) {\n $billing->unsetData($shippingKey);\n }\n }\n\n $shipping->unsetData('region_id');\n $shipping->addData($billing->getData())\n ->setSameAsBilling(1)\n ->setSaveInAddressBook(0)\n ->setShippingMethod($shippingMethod)\n ->setCollectShippingRates(true);\n break;\n }\n }\n\n if ($saveQuote) {\n $this->getQuote()->collectTotals()->save();\n }\n\n return $this;\n }", "function useDifferentShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = true;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}", "public function setStreetAddress($value) {\n\t\tself::$_streetAddress = $value;\n\t}", "public function setAddress($address)\n {\n $this->address = $address;\n }", "function wc_veruspay_display_crypto_address_in_admin( $order ) {\n\tglobal $wc_veruspay_global;\n\t$order_id = method_exists( $order, 'get_id' ) ? $order->get_id() : $order->id;\n\t$wc_veruspay_payment_method = $order->get_payment_method();\n\tif ( $wc_veruspay_payment_method == $wc_veruspay_global['id'] ){\n\t\t$wc_veruspay_order_status = get_post_meta( $order_id, '_wc_veruspay_status', TRUE );\n\t\tif ( $wc_veruspay_order_status == 'noaddress' ) {\n\t\t\tforeach ( $order->get_items() as $item_key => $item_values) { \n\t\t\t\t$wc_veruspay_stock = get_post_meta( $item_values['variation_id'], '_manage_stock', TRUE ); \n\t\t\t}\n\t\t\tupdate_post_meta( $order_id, '_wc_veruspay_status', sanitize_text_field( 'cancelled' ) );\n\t\t\t$order->update_status( 'cancelled', __( 'Missing Payment Address', 'woocommerce') );\n\t\t\theader(\"Refresh:0\");\n\t\t}\n\t\telse {\n\t\t\tif ( $order->has_status( 'processing' ) ) {\n\t\t\t\t$wc_veruspay_payment_status = 'Received';\n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_paid', TRUE );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$wc_veruspay_payment_status = 'Pending'; \n\t\t\t\t$wc_veruspay_price = get_post_meta( $order_id, '_wc_veruspay_price', TRUE ); \n\t\t\t}\n\t\t\t$wc_veruspay_address = get_post_meta( $order_id, '_wc_veruspay_address', TRUE );\n\t\t\t$_chain_up = strtoupper( get_post_meta( $order_id, '_wc_veruspay_coin', TRUE ) );\n\t\t\t$_chain_lo = strtolower( $_chain_up );\n\t\t\techo '<style>.wc-order-totals-items{height:3rem!important}.wc-order-totals-items:after{content: \"' . $_chain_up . ' ' . $wc_veruspay_payment_status . ': ' . $wc_veruspay_price . '\"!important;position:relative;font-size:1rem;font-weight:bold;color:#007bff!important;top:0;float:right;width:200px;height:30px;}</style>';\n\t\t\techo '<p><strong>'.__( $_chain_up . ' Price', 'woocommerce' ).':</strong>' . $wc_veruspay_price . ' with exchange rate of ' . get_post_meta( $order_id, '_wc_veruspay_rate', TRUE ) . '</p>';\n\t\t\tif ( substr($wc_veruspay_address, 0, 2) !== 'zs' ) {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> <a target=\"_BLANK\" href=\"' . $wc_veruspay_global['chain_dtls'][$_chain_lo]['address'] . $wc_veruspay_address . '\">' . $wc_veruspay_address . '</a></p>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo '<p><strong>'.__( $_chain_up . ' Address', 'woocommerce' ).':</strong> '.$wc_veruspay_address.'</p';\n\t\t\t}\n\t\t}\n\t}\n}", "public function save()\n\t{\n\t\tparent::save();\n\t\t\\IPS\\Widget::deleteCaches( 'donations', 'nexus' );\n\t\tstatic::recountCustomerFields();\n\t}", "public function updateCustomer($accessCode)\n {\n $response = $this->_doRapidAPI('Transaction/' . $accessCode, 'GET');\n if ($response->isSuccess()) {\n $customer = $this->_quote->getCustomer();\n $billingAddress = $this->_quote->getBillingAddress();\n $shippingAddress = $this->_quote->getShippingAddress();\n $trans = $response->getTransactions();\n\n if (isset($trans[0]['Customer'])) {\n $billing = $trans[0]['Customer'];\n $billingAddress->setFirstname($billing['FirstName'])\n ->setLastName($billing['LastName'])\n ->setCompany($billing['CompanyName'])\n ->setJobDescription($billing['JobDescription'])\n ->setStreet($billing['Street1'])\n ->setStreet2($billing['Street2'])\n ->setCity($billing['City'])\n ->setState($billing['State'])\n ->setPostcode($billing['PostalCode'])\n ->setCountryId(strtoupper($billing['Country']))\n ->setEmail($billing['Email'])\n ->setTelephone($billing['Phone'])\n ->setMobile($billing['Mobile'])\n ->setComments($billing['Comments'])\n ->setFax($billing['Fax'])\n ->setUrl($billing['Url']);\n }\n if (isset($trans[0]['ShippingAddress'])) {\n $shipping = $trans[0]['ShippingAddress'];\n $shippingAddress->setFirstname($shipping['FirstName'])\n ->setLastname($shipping['LastName'])\n ->setStreet($shipping['Street1'])\n ->setStreet2($shipping['Street2'])\n ->setCity($shipping['City'])\n ->setPostcode($shipping['PostalCode'])\n ->setCountryId(strtoupper($shipping['Country']))\n ->setEmail($shipping['Email'])\n ->setFax($shipping['Fax']);\n\n if ($shipping['State']\n && $shipping['Country']\n && $region = Mage::getModel('directory/region')->loadByCode($shipping['State'], $shipping['Country'])\n ) {\n $shippingAddress->setRegion($region->getName())\n ->setRegionId($region->getId());\n }\n if ($shipping['Phone']) {\n $shippingAddress->setTelephone($shipping['Phone']);\n }\n }\n $this->_quote->assignCustomerWithAddressChange($customer, $billingAddress, $shippingAddress)->save();\n }\n }", "public function update(StoreAddress $storeAddress, Address $address) {\n $this->authorize('manage', $address);\n $storeAddress->merge(['professionnal' => $storeAddress->has('professionnal')]);\n $address->update($storeAddress->all());\n return redirect(route('addresses.index'))->with('alert', config('messages.addressupdated'));\n }", "function getOverrideAddress()\n {\n global $customer_id, $sendto;\n\n if (!empty($_GET['markflow']) && tep_session_is_registered('customer_id')) {\n // From now on for this user we will edit addresses on the\n // osc install, not by going to PayPal.\n tep_session_register('paypal_ec_markflow');\n $_SESSION['paypal_ec_markflow'] = 1;\n\n // find the users default address id\n if (!empty($sendto)) {\n $address_id = $sendto;\n } else {\n $default_address_id_query = tep_db_query('SELECT customers_default_address_id\n FROM ' . TABLE_CUSTOMERS . '\n WHERE customers_id = \\'' . $customer_id . '\\'');\n if (tep_db_num_rows($default_address_id_query) > 0) {\n // grab the data\n $default_address_id_arr = tep_db_fetch_array($default_address_id_query);\n $address_id = $default_address_id_arr['customers_default_address_id'];\n } else {\n // couldn't find an address.\n return false;\n }\n }\n\n // now grab the address from the database and set it\n $address_query = tep_db_query('SELECT entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_city, entry_postcode,\n entry_country_id, entry_zone_id\n FROM ' . TABLE_ADDRESS_BOOK . '\n WHERE address_book_id = \\'' . $address_id . '\\' AND\n customers_id = \\'' . $customer_id . '\\'\n LIMIT 1');\n\n // see if we found a record, if not well we have nothing to override with\n if (tep_db_num_rows($address_query) > 0) {\n // grab the data\n $address_arr = tep_db_fetch_array($address_query);\n\n // get the state/prov code\n $state_query = tep_db_query('SELECT zone_code\n FROM ' . TABLE_ZONES . '\n WHERE zone_id = \\'' . $address_arr['entry_zone_id'] . '\\'');\n if (tep_db_num_rows($state_query) > 0) {\n $state_code_arr = tep_db_fetch_array($state_query);\n } else {\n $state_code_arr['zone_code'] = '';\n }\n $address_arr['zone_code'] = $state_code_arr['zone_code'];\n\n // get the country code\n // ISO 3166 standard country code\n $country_query = tep_db_query('SELECT countries_iso_code_2\n FROM ' . TABLE_COUNTRIES . '\n WHERE countries_id = \\'' . $address_arr['entry_country_id'] . '\\'');\n if (tep_db_num_rows($country_query) > 0) {\n $country_code_arr = tep_db_fetch_array($country_query);\n } else {\n // default to go old US\n $country_code_arr['countries_iso_code_2'] = 'US';\n }\n $address_arr['countries_iso_code_2'] = $country_code_arr['countries_iso_code_2'];\n\n // return address data.\n return $address_arr;\n }\n }\n\n return false;\n }", "public function addDataToAddress(Mage_Sales_Model_Quote_Address $address, array $details)\n {\n Mage::dispatchEvent(\"fontis_masterpass_add_address_data_before\", array(\"address\" => $address));\n\n foreach ($details as $key => $detail) {\n $address->setDataUsingMethod($key, $detail);\n }\n $address->implodeStreetAddress()->setCollectShippingRates(true);\n $validate = $address->validate();\n if ($validate !== true) {\n $message = \"Failed to validate address after inserting address data.\\n\";\n $message .= \"Validation errors:\\n\" . print_r($validate, true);\n $message .= \"\\nAddress details processed from XML retrieved from MasterPass:\\n\" . print_r($details, true);\n throw new Exception($message);\n }\n $address->save();\n\n Mage::dispatchEvent(\"fontis_masterpass_add_address_data_after\", array(\"address\" => $address));\n }", "function spectra_address_addowner ($owner, $address)\n\t{\n\t\t$prep = $GLOBALS[\"db\"][\"obj\"]->prepare (\"UPDATE `\".$GLOBALS[\"tables\"][\"ledger\"].\"` SET `owner` = ? where `address` = ?\");\n\t\t\n\t\tif (!$prep)\n\t\t{\n\t\t\techo \"Unable To Prepare Statement (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$bound = $prep->bind_param (\"ss\", $owner, $address);\n\t\t\n\t\tif (!$bound)\n\t\t{\n\t\t\techo \"Unable To Bind Parameters (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$response = $prep->execute ();\n\t\t\n\t\tif ($GLOBALS[\"db\"][\"obj\"]->errno > 0)\n\t\t{\n\t\t\techo \"Unable To Execute Statement (\".__FUNCTION__.\": \".__LINE__.\") \".$GLOBALS[\"db\"][\"obj\"]->error;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}" ]
[ "0.65889126", "0.62865514", "0.6219203", "0.60845745", "0.6084406", "0.59402853", "0.5865731", "0.5852968", "0.5848235", "0.58456117", "0.58237624", "0.5820792", "0.5808011", "0.578708", "0.57807374", "0.57623297", "0.5740811", "0.5733312", "0.5725727", "0.5694766", "0.5653044", "0.56476307", "0.56256616", "0.56201243", "0.5605342", "0.5605189", "0.55910623", "0.55642986", "0.55599916", "0.55595714", "0.5546615", "0.5541938", "0.553613", "0.553016", "0.55256885", "0.55205256", "0.55200976", "0.5496079", "0.5481953", "0.5481953", "0.54804796", "0.5451512", "0.54505175", "0.5449871", "0.54485655", "0.544228", "0.54326886", "0.5427166", "0.53994477", "0.53893125", "0.5372503", "0.5371482", "0.53676194", "0.53647786", "0.5348252", "0.53433824", "0.5339944", "0.53369373", "0.5332179", "0.53311926", "0.5325941", "0.5325121", "0.5307859", "0.5304039", "0.53025806", "0.5283752", "0.5275783", "0.52729857", "0.5270819", "0.52585113", "0.5257206", "0.52466434", "0.5245105", "0.52385914", "0.5236455", "0.5235111", "0.5231347", "0.52210546", "0.5216994", "0.521653", "0.521119", "0.5206346", "0.52059186", "0.52040714", "0.51959926", "0.51950544", "0.51912904", "0.51839346", "0.517369", "0.51718956", "0.5162372", "0.5148978", "0.51428413", "0.5142076", "0.51404214", "0.5135854", "0.51357824", "0.5134032", "0.51282483", "0.5123437" ]
0.6012756
5
Update user's fairaddress number in the wp_usermeta table This fairaddress number will be shown on the user's edit profile screen in the admin
function getfaircoin_edd_store_usermeta( $payment_id ) { // return if user is not logged in if ( ! is_user_logged_in() ) return; // get the user's ID $user_id = get_current_user_id(); // update fairaddress number update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['edd_fairaddress'] ); update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['edd_fairsaving'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "function getfaircoin_edd_save_extra_profile_fields( $user_id ) {\r\n if ( ! current_user_can( 'edit_user', $user_id ) )\r\n return false;\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['_edd_user_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['_edd_user_fairsaving'] );\r\n}", "public static function update_user_meta( $user_id ) {\n\t\tif ( $user_id && self::$data['vat_number'] ) {\n\t\t\tupdate_user_meta( $user_id, 'vat_number', self::$data['vat_number'] );\n\t\t}\n\t}", "function update_usermeta($user_id, $meta_key, $meta_value)\n {\n }", "function itstar_viraclub_id($user_id){\n global $wpdb;\n\n $user = new WP_User( $user_id );\n\n // Set your role\n \n $firstid = 2999;\n \n \n $latestid=$wpdb->get_var(\"SELECT meta_value from $wpdb->usermeta where meta_key='viraclub' order by meta_value DESC limit 1;\");\n $latestid = ($latestid)?($latestid):($firstid);\n update_user_meta( $user_id, 'first_name', $latestid+1 );\n\n // Destroy user object\n unset( $user );\n}", "public function updateUserAddress($data,$id)\n\t{\n\t\t$this->db->where($this->pro->useraddress.\"_user_id\",$id);\n\t\treturn $this->db->update($this->pro->prifix.$this->pro->useraddress,$data);\n\t}", "public function edit($user_id)\n\t{\n\t\t$stmt = self::$_connection->prepare(\"UPDATE user_profile SET first_name = :first_name, last_name = :last_name, email=:email, country = :country, city = :city, street_address = :street_address, postal_code = :postal_code WHERE user_id = :user_id\");\n\t\t$stmt->execute(['first_name'=>$this->first_name, 'last_name'=>$this->last_name, 'email'=>$this->email, 'country'=>$this->country, 'city'=>$this->city, 'street_address'=>$this->street_address, 'postal_code'=>$this->postal_code, 'user_id'=>$user_id]);\n\t}", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function update_user_profile( $user_id ) {\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! empty( $_POST['phone'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing\n\t\t\tupdate_user_meta( $user_id, 'phone', intval( $_POST['phone'] ) ); //phpcs:ignore WordPress.Security.NonceVerification.Missing\n\t\t}\n\t}", "public function updateUserLinked\t(){\n\t\t\n\t\t}", "function updateProfile($name, $phone, $email, $username, $userid) {\n $query = \"UPDATE users_account SET fullname = ?,mobileno = ?,email = ?,username WHERE userid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n $name,\n $phone,\n $email,\n $username,\n $userid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "function save_extra_user_profile_fields( $user_id ) {\n if ( !current_user_can( 'edit_user', $user_id ) ) { \n return false; \n }\n\n\n $socialLinks=array(\"twitter\" => $_POST['twitter'] , \"facebook\" => $_POST['facebook'],\"instagram\" => $_POST['instagram']);\n\n \n update_user_meta(\n $user_id,\n 'social_links',\n $socialLinks\n );\n}", "function update_user($user_id, $old_userdata){\r\n $old_userdata = (array)$old_userdata;\r\n if($old_userdata['user_nicename']) $user_nicename = $old_userdata['user_nicename'];\r\n if($old_userdata['user_pass']) $user_pass = $old_userdata['user_pass'];\r\n if($old_userdata['user_email']) $user_email = $old_userdata['user_email'];\r\n if($old_userdata['nickname'] AND server(get_option('sso_user_nickname')) !== FALSE)\r\n update_usermeta($user_id, 'nickname', $old_userdata['nickname']);\r\n if($old_userdata['first_name'] AND server(get_option('sso_user_firstname')) !== FALSE)\r\n update_usermeta($user_id, 'first_name', $old_userdata['first_name']);\r\n if($old_userdata['last_name'] AND server(get_option('sso_user_lastname')) !== FALSE)\r\n update_usermeta($user_id, 'last_name', $old_userdata['last_name']);\r\n\r\n global $wpdb;\r\n $data = compact('user_pass', 'user_email', 'user_nicename');\r\n $data = stripslashes_deep($data);\r\n $e = $wpdb->update($wpdb->users, $data, array('ID' => $user_id));\r\n}", "function changeUserDetail($userEmail, $firstname, $lastname, $phone){\n\n\t\tglobal $conn;\n\n\t\t$query = \"UPDATE User \n\t\tSET firstname='$firstname', lastname='$lastname', phone='$phone' \n\t\tWHERE email='\" . $userEmail . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result != TRUE){\n\t\t\techo \"Error updating \" . $userEmail . \" details\";\n\t\t}\n\n\t}", "public function updateProfile($data) {\n $this->db->query(\"UPDATE \" . DB_PREFIX . \"wkpos_user SET firstname = '\" . $data['firstname'] . \"', lastname = '\" . $data['lastname'] . \"', email = '\" . $data['account_email'] . \"', username = '\" . $data['username'] . \"', salt = '\" . $this->db->escape($salt = token(9)) . \"', password = '\" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['account_npwd'])))) . \"' WHERE user_id = '\" . $this->session->data['user_login_id'] . \"'\");\n }", "function classiera_save_extra_profile_fields( $user_id ) {\r\n\tupdate_user_meta( $user_id, 'price_plan' );\r\n\tadd_user_meta( $user_id, 'price_plan_id' );\r\n}", "public function adminEditUserProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n {\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"', level_access = '\" . $level_access . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n $res = $this->processSql($sql);\n if(!$res) return 4;\n return 99;\n }", "function updateManagedAuthorMetaData( $user_id, $fistLastName ) {\n\t$update_data = [];\n\t$update_data['user_url'] = \"https://wordpress.org/ionurboz\";\n\t$update_data['first_name'] = isset( $fistLastName[0] ) ? $fistLastName[0] : \"\";\n\t$update_data['last_name'] = isset( $fistLastName[1] ) ? $fistLastName[1] : \"\";\n\t$update_data['wp_capabilities'] = [ 'author' => true ];\n\t$update_data['wp_user_level'] = 8;\n\n\tforeach ( $update_data as $key => $value ) {\n\t\tupdate_user_meta( $user_id, $key, $value );\n\t}\n}", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "protected function _set_pin($user_id, $pin)\n\t{\n\t\t$pin = security_encode($pin);\n\n\t\tmodel('user')->update($user_id, compact('pin'));\n\t}", "public function updateBankerCredit()\n {\n $user = User::whereHas(\"roles\", function($q){$q->where(\"name\", \"Banker\");})->first();\n\n $total = Credit::where('credit_type', 0)->sum('value');\n $user->free_credits = $total;\n $total = Credit::where('credit_type', 1)->sum('value');\n $user->paid_credits = $total;\n $user->save();\n }", "public static function editProfile( $address, $phone, $mail){\n\t}", "public function edit_self(ProfileUser $editted_profile) {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"UPDATE `users` SET program = '$editted_profile->program' AND level = '$editted_profile->level' AND commuter = '$editted_profile->commuter' AND bio = '$editted_profile->bio' WHERE user_id = '$this->user_id' LIMIT 1\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t}\r\n\t}", "function save_custom_user_profile_fields($user_id){\n if(!current_user_can('edit_posts'))\n return false;\n\n // save my custom field\n update_user_meta($user_id, 'learner', esc_html($_POST['learner']));\n}", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "function updateProfile($mysqli,$profile){\r\n $query = \"UPDATE `profiles` SET FirstName = '\".$profile->firstName.\"', LastName = '\".$profile->lastName.\"', Gender = '\".$profile->gender.\"', Birthday = '\".$profile->birthday.\"', Weight = '\".$profile->weight.\"', \r\n Height = '\".$profile->height.\"', Bio = '\".$profile->bio.\"', Prof_Pic_URL = '\".$profile->profPicURL.\"' WHERE UserID = \".$profile->userID;\r\n $mysqli->query($query);\r\n }", "function edituserPaddress($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$paddress = mysqli_real_escape_string($conn, $data['paddress']);\n\t\t\t$parea = mysqli_real_escape_string($conn, $data['parea']);\n\t\t\t$pthana = mysqli_real_escape_string($conn, $data['pthana']);\n\t\t\t$pdistrict = mysqli_real_escape_string($conn, $data['pdistrict']);\n\t\t\t$pzip = mysqli_real_escape_string($conn, $data['pzip']);\n\t\t\tif(empty($paddress) || empty($parea) || empty($pthana) || empty($pdistrict) || empty($pzip)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $pdistrict)) {\n\t\t\t\t\tif($this->length($pdistrict,25,3)){\n\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $pthana)) {\n\t\t\t\t\t\t\tif($this->length($pthana,25,3)) {\n\t\t\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $parea)) {\n\t\t\t\t\t\t\t\t\tif($this->length($parea,25,3)) {\n\t\t\t\t\t\t\t\t\t\tif($this->length($paddress,50,3)) {\n\t\t\t\t\t\t\t\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $pzip)) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($this->length($pzip,4,4)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_paddress\", $paddress , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_parea\", $parea , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result2 = $this->change(\"user_login\", \"user_pthana\", $pthana , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result3 = $this->change(\"user_login\", \"user_pdistrict\", $pdistrict , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result4 = $this->change(\"user_login\", \"user_pzip\", $pzip , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $result == false || $result1 == false || $result2 == false || $result3 == false || $result4 == false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=ZipCode\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=addretooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=areatooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=area\");\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$this->re_direct(\"profile\", \"length=thanatooBigORtooSmall\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=thana\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=DistricttooBigORtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=District\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function update_user_balance($user_id)\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$form_field = 'user_balance_'.$user_id;\n\t\t\tif($this->input->post($form_field))\n\t\t\t{\n\t\t\t\t$user_data['credit'] = $this->input->post($form_field);\n\t\t\t\t$this->load->model('user_profiles', 'up');\n\t\t\t\t$this->up->update($user_id, $user_data);\n\t\t\t}\n\t\t\tredirect('/admin/user_list','refresh');\n\t\t}", "function update()\n {\n global $db, $fullname, $email, $Dateofbirth, $Phonenumber, $Occupation, $Address, $gender, $path, $nationality, $user_type;\n\n $id = $_POST['id'];\n $fullname = $_POST['fullname'];\n $Dateofbirth = $_POST['dbirth'];\n $Phonenumber = $_POST['phonenumber'];\n $Occupation = $_POST['occupation'];\n $Address = $_POST['address'];\n $gender = $_POST['mradio'];\n $email = $_POST['email'];\n $$user_type = $_POST['user_type'];\n $path = $_FILES['image'];\n $nationality =$_POST['nationality'];\n $path = mysqli_real_escape_string($db, '../images/uploads/' . $_FILES['image']['name']);\n copy($_FILES['image']['tmp_name'], $path);\n\n mysqli_query($db, \"UPDATE users SET name='$fullname', 'admin','$Occupation','$Address','$Phonenumber', '$Dateofbirth','$gender','$email','$nationality','$path' WHERE id=$id\");\n $_SESSION['message'] = \"Address updated!\";\n header('location: ../members.php');\n \n }", "function setMainAddress( &$mainAddress, &$user )\n {\n if ( get_class( $mainAddress ) == \"ezaddress\" )\n $addressID = $mainAddress->id();\n else\n $addressID = $mainAddress;\n if ( get_class ( $user ) == \"ezuser\" )\n $userID = $user->id();\n else\n $userID = $user;\n\n $db =& eZDB::globalDatabase();\n\n $db->array_query( $checkForAddress, \"SELECT UserID FROM eZAddress_AddressDefinition\n WHERE UserID='$userID'\" );\n\n if ( count ( $checkForAddress ) != 0 )\n {\n $res[] = $db->query( \"UPDATE eZAddress_AddressDefinition SET\n AddressID='$addressID',\n UserID='$userID'\n WHERE UserID='$userID'\" );\n }\n else\n {\n $db->begin();\n $res[] = $db->query( \"INSERT INTO eZAddress_AddressDefinition\n (AddressID, UserID)\n VALUES\n ('$addressID', '$userID')\" );\n $db->unlock();\n }\n \n eZDB::finish( $res, $db );\n }", "public function modify_user($user) {\r\n $this->conn->connect();\r\n $this->conn->execute_query(\r\n \"UPDATE Users \r\n SET\r\n UserType=?,\r\n FirstName=?,\r\n LastName=?,\r\n HomePhone=?,\r\n MobilePhone=?,\r\n Address1=?, \r\n Address2=?,\r\n City=?,\r\n State=?,\r\n ZipCode=?\r\n WHERE UserId=?\",\"dsssssssssd\",\r\n $user->get_user_type(),\r\n $user->get_first_name(),\r\n $user->get_last_name(),\r\n $user->get_home_phone(),\r\n $user->get_mobile_phone(),\r\n $user->get_address_1(),\r\n $user->get_address_2(),\r\n $user->get_city(),\r\n $user->get_state(),\r\n $user->get_zip(),\r\n $user->get_user_id()\r\n );\r\n }", "function ajan_update_user_meta( $user_id, $key, $value, $prev_value = '' ) {\n\treturn update_user_meta( $user_id, ajan_get_user_meta_key( $key ), $value, $prev_value );\n}", "function profile_update($user_id = null) {\n\t\t\tglobal $wpdb, $Db, $Subscriber;\n\t\t\t\n\t\t\tif (!empty($user_id)) {\t\t\t\n\t\t\t\tif ($newuserdata = $this -> userdata($user_id)) {\n\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\n\t\t\t\t\tif ($subscriber = $Db -> find(array('user_id' => $user_id))) {\n\t\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\t$Db -> save_field('email', $newuserdata -> user_email, array('id' => $subscriber -> id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "function modifyUserDetail($userId,$uname,$sex,$age,$loc,$hobby,$signature){\n DBUtils::execute('UPDATE user SET name = '.'\"'.$uname.'\",'.'sex='.'\"'.$sex.'\",'.'age='.$age.',location='.'\"'.$loc.'\",'.'hobby='.'\"'.$hobby.'\",'.'signature='.'\"'.$signature.'\" WHERE id='.$userId);\n }", "public function update_user_info($user_id, $phone, $receiver, $address)\n {\n $this->db\n ->set(array(\n 'phone' => $phone,\n 'rcv_name' => $receiver,\n 'rcv_address' => $address\n ))\n ->where('user_id', $user_id)\n ->update('users');\n }", "public function update_profile(){\n\t\t\t$data = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'zipcode' => $this->input->post('zipcode'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'username' => $this->input->post('username')\n\t\t\t);\n\n\t\t\t$this->db->where('id', $this->input->post('id'));\n \n return $this->db->update('users', $data);\n\t\t}", "function _update_userdata($userdata){\r\n $userdata = (array)$userdata;\r\n $userdata2['user_email'] = server(get_sso_option('user_email'));\r\n $nickname = server(get_option('sso_user_nickname'));\r\n if($nickname !== FALSE AND $nickname !== $userdata['nickname']) $userdata2['nickname'] = $nickname;\r\n $firstname = server(get_option('sso_user_firstname'));\r\n if($firstname !== FALSE AND $firstname !== $userdata['firstname']) $userdata2['first_name'] = $firstname;\r\n $lastname = server(get_option('sso_user_lastname'));\r\n if($lastname !== FALSE AND $lastname !== $userdata['lastname']) $userdata2['last_name'] = $lastname;\r\n\r\n update_user($userdata['ID'], (array)$userdata2);\r\n //require_once(WPINC . DIRECTORY_SEPARATOR . 'registration.php');\r\n //wp_update_user((array)$userdata);\r\n \r\n set_user_groups();\r\n}", "public function save_address_names( $user_id, $new_value ) {\n\n\t\t// Make sure that is a new_value to save.\n\t\tif ( ! isset( $new_value ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update the value.\n\t\t$error_test = update_user_meta( $user_id, 'wc_address_book', $new_value );\n\n\t\t// If update_user_meta returns false, throw an error.\n\t\tif ( ! $error_test ) {\n\t\t\t// TODO: Add error notice.\n\t\t}\n\t}", "function oid_update_user($user, $sreg)\n{\n $profile = $user->getProfile();\n\n $orig_profile = clone($profile);\n\n if (!empty($sreg['fullname']) && strlen($sreg['fullname']) <= 255) {\n $profile->fullname = $sreg['fullname'];\n }\n\n if (!empty($sreg['country'])) {\n if ($sreg['postcode']) {\n // XXX: use postcode to get city and region\n // XXX: also, store postcode somewhere -- it's valuable!\n $profile->location = $sreg['postcode'] . ', ' . $sreg['country'];\n } else {\n $profile->location = $sreg['country'];\n }\n }\n\n // XXX save language if it's passed\n // XXX save timezone if it's passed\n\n if (!$profile->update($orig_profile)) {\n // TRANS: OpenID plugin server error.\n common_server_error(_m('Error saving the profile.'));\n return false;\n }\n\n $orig_user = clone($user);\n\n if (!empty($sreg['email']) && Validate::email($sreg['email'], common_config('email', 'check_domain'))) {\n $user->email = $sreg['email'];\n }\n\n if (!$user->update($orig_user)) {\n // TRANS: OpenID plugin server error.\n common_server_error(_m('Error saving the user.'));\n return false;\n }\n\n return true;\n}", "function interestedIn_update() {\n global $user_id;\n if (isset($_POST['intereses'])) {\n update_user_meta( $user_id, 'interesado_actividades', $_POST['intereses'] );\n }\n}", "public static function edit_account() {\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\t\t$enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );\n\t\t$minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );\n\n\t\tif ( 'yes' === $enable_strong_password || '1' === $enable_strong_password ) {\n\t\t\twp_enqueue_script( 'ur-password-strength-meter' );\n\t\t}\n\n\t\tur_get_template(\n\t\t\t'myaccount/form-edit-password.php',\n\t\t\tarray(\n\t\t\t\t'user' => get_user_by( 'id', get_current_user_id() ),\n\t\t\t\t'enable_strong_password' => $enable_strong_password,\n\t\t\t\t'minimum_password_strength' => $minimum_password_strength,\n\t\t\t)\n\t\t);\n\t}", "function updateUserProfileData($user_id, $lrdata)\n{\n\t$date_upd = date('Y-m-d H:i:s', time());\n\t$str = '';\n\tif (!empty($lrdata['fname']))\n\t\t$str .= \"firstname='\".pSQL($lrdata['fname']).\"',\";\n\tif (!empty($lrdata['lname']))\n\t\t$str .= \"lastname='\".pSQL($lrdata['lname']).\"',\";\n\tif (!empty($lrdata['gender']))\n\t{\n\t\t$gender = ((!empty($lrdata['gender'])\n\t\t\t&& (strpos($lrdata['gender'], 'f') !== false\n\t\t\t\t|| (trim($lrdata['gender']) == 'F'))) ? 2 : 1);\n\t\t$str .= \"id_gender='\".$gender.\"',\";\n\t}\n\tif (!empty($lrdata['dob']))\n\t{\n\t\t$dob_arr = explode('/', $lrdata['dob']);\n\t\t$dob = $dob_arr[2].'-'.$dob_arr[0].'-'.$dob_arr[1];\n\t\t$date_of_birth = (!empty($dob) && Validate::isBirthDate($dob) ? $dob : '');\n\t\t$str .= \"birthday='\".$date_of_birth.\"',\";\n\t}\n\tDb::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET '.$str.\" date_upd='$date_upd' WHERE \tid_customer\t= $user_id\");\n}", "function save_user_fields ($user_id) {\n if ( isset($_POST['billing_first_name']) ){\n update_user_meta($user_id, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n \n if ( isset($_POST['billing_last_name']) ){\n update_user_meta($user_id, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n\n if ( isset($_POST['billing_tipo_documento']) ){\n update_user_meta($user_id, 'billing_tipo_documento', sanitize_text_field($_POST['billing_tipo_documento']));\n }\n\n if ( isset($_POST['billing_numero_documento']) ){\n update_user_meta($user_id, 'billing_numero_documento', sanitize_text_field($_POST['billing_numero_documento']));\n }\n \n}", "public function my_profile_update( $user_id ) {\n\n\t\t\tglobal $wpdb;\n\n\t\t\tif ( current_user_can( 'edit_user', $user_id ) ) {\n\n\t\t\t\t$current_user = get_userdata( $user_id );\n\n\t\t\t\t$old_customers_email_id = $current_user->data->user_email;\n\n\t\t\t\t$post_email = ( isset( $_POST['email'] ) ) ? wc_clean( wp_unslash( $_POST['email'] ) ) : ''; // phpcs:ignore\n\n\t\t\t\tif ( ! empty( $post_email ) && $post_email !== $old_customers_email_id ) {\n\n\t\t\t\t\t$result = wp_cache_get( 'wc_sc_customers_coupon_ids_' . sanitize_key( $old_customers_email_id ), 'woocommerce_smart_coupons' );\n\n\t\t\t\t\tif ( false === $result ) {\n\t\t\t\t\t\t$result = $wpdb->get_col( // phpcs:ignore\n\t\t\t\t\t\t\t$wpdb->prepare(\n\t\t\t\t\t\t\t\t\"SELECT post_id\n\t\t\t\t\t\t\t\t\tFROM $wpdb->postmeta\n\t\t\t\t\t\t\t\t\tWHERE meta_key = %s\n\t\t\t\t\t\t\t\t\tAND meta_value LIKE %s\n\t\t\t\t\t\t\t\t\tAND post_id IN ( SELECT ID\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM $wpdb->posts\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE post_type = %s)\",\n\t\t\t\t\t\t\t\t'customer_email',\n\t\t\t\t\t\t\t\t'%' . $wpdb->esc_like( $old_customers_email_id ) . '%',\n\t\t\t\t\t\t\t\t'shop_coupon'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\twp_cache_set( 'wc_sc_customers_coupon_ids_' . sanitize_key( $old_customers_email_id ), $result, 'woocommerce_smart_coupons' );\n\t\t\t\t\t\t$this->maybe_add_cache_key( 'wc_sc_customers_coupon_ids_' . sanitize_key( $old_customers_email_id ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! empty( $result ) ) {\n\n\t\t\t\t\t\tforeach ( $result as $post_id ) {\n\n\t\t\t\t\t\t\t$coupon_meta = get_post_meta( $post_id, 'customer_email', true );\n\n\t\t\t\t\t\t\tforeach ( $coupon_meta as $key => $email_id ) {\n\n\t\t\t\t\t\t\t\tif ( $email_id === $old_customers_email_id ) {\n\n\t\t\t\t\t\t\t\t\t$coupon_meta[ $key ] = $post_email;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tupdate_post_meta( $post_id, 'customer_email', $coupon_meta );\n\n\t\t\t\t\t\t} //end foreach\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function update(Address $address)\n\t{\n\t\t//\n\t}", "function update_cart_address($address_field,$address_id){\n\n $this->update([$address_field => $address_id]);\n }", "function edituserCaddress($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$caddress = mysqli_real_escape_string($conn, $data['caddress']);\n\t\t\t$carea = mysqli_real_escape_string($conn, $data['carea']);\n\t\t\t$cthana = mysqli_real_escape_string($conn, $data['cthana']);\n\t\t\t$cdistrict = mysqli_real_escape_string($conn, $data['cdistrict']);\n\t\t\t$czip = mysqli_real_escape_string($conn, $data['czip']);\n\t\t\tif(empty($caddress) || empty($carea) || empty($cthana) || empty($cdistrict) || empty($czip)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $cdistrict)) {\n\t\t\t\t\tif($this->length($cdistrict,25,3)){\n\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $cthana)) {\n\t\t\t\t\t\t\tif($this->length($cthana,25,3)) {\n\t\t\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $carea)) {\n\t\t\t\t\t\t\t\t\tif($this->length($carea,25,3)) {\n\t\t\t\t\t\t\t\t\t\tif($this->length($caddress,50,3)) {\n\t\t\t\t\t\t\t\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $czip)) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($this->length($czip,4,4)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_caddress\", $caddress , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_carea\", $carea , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result2 = $this->change(\"user_login\", \"user_cthana\", $cthana , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result3 = $this->change(\"user_login\", \"user_cdistrict\", $cdistrict , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result4 = $this->change(\"user_login\", \"user_czip\", $czip , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $result == false || $result1 == false || $result2 == false || $result3 == false || $result4 == false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=ZipCode\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=areatooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=area\");\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$this->re_direct(\"profile\", \"length=thanatooBigORtooSmall\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=thana\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=DistricttooBigORtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=District\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function docdirect_save_custom_user_profile_fields($user_id){\n\t\tif(!current_user_can('manage_options'))\n\t\t\treturn false;\n\t\n\t\t# save my custom field\n\t\tupdate_user_meta($user_id, 'verify_user', 'off');\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', false );\n\t}", "function ffl_save_extra_profile_fields( $user_id ) \n{\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\treturn false;\n\n\t//set the display name\n\t$display_name = trim($_POST['first_name'] . \" \" . $_POST['last_name']);\n\tif(!$display_name)\n\t\t$display_name = $_POST['user_login'];\n\t\t\n\t$_POST['display_name'] = $display_name;\n\t\n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t); \n\twp_update_user( $args ) ;\n}", "function UpdateProfileFrontEnd($oAffiliate)\n\t\t{\t\t\n\t\t\t$pass = \"\";\n\t\t \tif(strlen($this->uProfile['password'])){\n\t\t\t\t$pass=\", password ='\".md5($oAffiliate->password).\"'\";\t\t\t\n\t\t \t} \n\t\t \n\t\t\t$query =\"UPDATE tbl_member SET first_name='\".$oAffiliate->first_name.\"',\n\t\t\t\t\tlast_name = '\".$oAffiliate->last_name.\"',\n\t\t\t\t\temail = '\".$oAffiliate->email.\"'{$pass}\n\t\t\t\t\twhere member_id = '\".$oAffiliate->member_id.\"' and member_type='affiliate'\";\n\t\t \t\t\t\n\t\t\t$this->Execute($query);\n\t\t\t\n\t\t\t$query =\"UPDATE tbl_affiliate SET organisation_name = '\".$oAffiliate->organisation_name.\"',\n\t\t\t\t\torganisation_website = '\".$oAffiliate->organisation_website.\"',\n\t\t\t\t\tstate = '\".$oAffiliate->state.\"',\n\t\t\t\t\tzip_code = '\".$oAffiliate->zip_code.\"',\n\t\t\t\t\tcountry = '\".$oAffiliate->country.\"',\n\t\t\t\t\tdonation_url = '\".$oAffiliate->donation_url.\"',\n\t\t\t\t\tdescription = '\".$oAffiliate->description.\"',\n\t\t\t\t\tstreet_address = '\".$oAffiliate->street_address.\"',\n\t\t\t\t\tcity = '\".$oAffiliate->city.\"'\n\t\t\t\t\twhere affiliate_id = '\".$oAffiliate->member_id.\"'\";\n\t\t\t//die();\n\t\t\t$rs = $this->Execute($query);\n\t\t\treturn $rs;\n\t\t}", "public function adminEditProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n\t{\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n \t$res = $this->processSql($sql);\n\t\t\tif(!$res) return 4;\n\t\t\treturn 99;\n\t}", "private function fillPincode(User $user, Request $request) {\n $user->Pincode = $request->pincode;\n }", "public function updateReward($UserID) { $Rank = $this->rank($UserID);\n $SpecialRank = $this->specialRank($UserID);\n $HasAll = $SpecialRank == MAX_SPECIAL_RANK;\n $Counter = 0;\n $Insert = array();\n $Values = array();\n $Update = array();\n\n $Insert[] = \"UserID\";\n $Values[] = \"'$UserID'\";\n if ($Rank >= 1 || $HasAll) {\n }\n if ($Rank >= 2 || $HasAll) {\n if (isset($_POST['donor_icon_mouse_over_text'])) {\n $IconMouseOverText = db_string($_POST['donor_icon_mouse_over_text']);\n $Insert[] = \"IconMouseOverText\";\n $Values[] = \"'$IconMouseOverText'\";\n $Update[] = \"IconMouseOverText = '$IconMouseOverText'\";\n }\n $Counter++;\n }\n if ($Rank >= 3 || $HasAll) {\n if (isset($_POST['avatar_mouse_over_text'])) {\n $AvatarMouseOverText = db_string($_POST['avatar_mouse_over_text']);\n $Insert[] = \"AvatarMouseOverText\";\n $Values[] = \"'$AvatarMouseOverText'\";\n $Update[] = \"AvatarMouseOverText = '$AvatarMouseOverText'\";\n }\n $Counter++;\n }\n if ($Rank >= 4 || $HasAll) {\n if (isset($_POST['donor_icon_link'])) {\n $CustomIconLink = db_string($_POST['donor_icon_link']);\n if (!Misc::is_valid_url($CustomIconLink)) {\n $CustomIconLink = '';\n }\n $Insert[] = \"CustomIconLink\";\n $Values[] = \"'$CustomIconLink'\";\n $Update[] = \"CustomIconLink = '$CustomIconLink'\";\n }\n $Counter++;\n }\n\n for ($i = 1; $i <= $Counter; $i++) {\n $this->addProfileInfoReward($i, $Insert, $Values, $Update);\n }\n if ($Rank >= MAX_RANK || $HasAll) {\n if (isset($_POST['donor_icon_custom_url'])) {\n $CustomIcon = db_string($_POST['donor_icon_custom_url']);\n if (!Misc::is_valid_url($CustomIcon)) {\n $CustomIcon = '';\n }\n $Insert[] = \"CustomIcon\";\n $Values[] = \"'$CustomIcon'\";\n $Update[] = \"CustomIcon = '$CustomIcon'\";\n }\n $this->updateTitle($UserID, $_POST['donor_title_prefix'], $_POST['donor_title_suffix'], $_POST['donor_title_comma']);\n $Counter++;\n }\n if ($SpecialRank >= 4) {\n if (isset($_POST['second_avatar'])) {\n $SecondAvatar = db_string($_POST['second_avatar']);\n if (!Misc::is_valid_url($SecondAvatar)) {\n $SecondAvatar = '';\n }\n $Insert[] = \"SecondAvatar\";\n $Values[] = \"'$SecondAvatar'\";\n $Update[] = \"SecondAvatar = '$SecondAvatar'\";\n }\n if (isset($_POST['limitedcolor']) && (preg_match('/^#[a-fA-F0-9]{6}$/', $_POST['limitedcolor']) || $_POST['limitedcolor'] == '')) {\n $ColorUsername = db_string($_POST['limitedcolor']);\n $Insert[] = \"ColorUsername\";\n $Values[] = \"'$ColorUsername'\";\n $Update[] = \"ColorUsername = '$ColorUsername'\";\n }\n }\n if ($SpecialRank >= 5) {\n if (isset($_POST['unlimitedcolor']) && (preg_match('/^#[a-fA-F0-9]{6}$/', $_POST['unlimitedcolor']) || $_POST['unlimitedcolor'] == '')) {\n $ColorUsername = db_string($_POST['unlimitedcolor']);\n $Insert[] = \"ColorUsername\";\n $Values[] = \"'$ColorUsername'\";\n $Update[] = \"ColorUsername = '$ColorUsername'\";\n }\n if (isset($_POST['gradientscolor']) && (preg_match('/^#[a-fA-F0-9]{6}(,#[a-fA-F0-9]{6}){1,2}$/', $_POST['gradientscolor']) || $_POST['gradientscolor'] == '')) {\n $GradientsColor = db_string($_POST['gradientscolor']);\n $Insert[] = \"GradientsColor\";\n $Values[] = \"'$GradientsColor'\";\n $Update[] = \"GradientsColor = '$GradientsColor'\";\n }\n }\n $Insert = implode(', ', $Insert);\n $Values = implode(', ', $Values);\n $Update = implode(', ', $Update);\n if ($Counter > 0) {\n $QueryID = $this->db->get_query_id();\n $this->db->query(\"\n\t\t\t\tINSERT INTO donor_rewards\n\t\t\t\t\t($Insert)\n\t\t\t\tVALUES\n\t\t\t\t\t($Values)\n\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\t$Update\");\n $this->db->set_query_id($QueryID);\n }\n $this->cache->delete_value(\"donor_profile_rewards_$UserID\");\n $this->cache->delete_value(\"donor_info_$UserID\");\n }", "function updateProfile()\n\t\t{\n\t \t$pass = \"\";\n\t\t \tif(strlen($this->updProfile['password'])){\n\t\t\t\t$pass=\", password ='\".$this->updProfile['password'].\"'\";\n\t\t \t} \n\t\t \n\t\t\t$query = \"UPDATE tbl_member SET first_name='\".$this->updProfile['firstName'].\"',\n\t\t last_name = '\".$this->updProfile['lastName'].\"',\n\t\t email = '\".$this->updProfile['email'].\"',\n\t\t user_name = '\".$this->updProfile['UserName'].\"'{$pass}\n\t\t WHERE member_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t\t$this->Execute($query);\n\t\t \n\t\t\t$query = \"UPDATE tbl_subscriber \n\t\t\tSET mail_street_address ='\".$this->updProfile['streetAddress'].\"',\n\t\t mail_city='\".$this->updProfile['City'].\"',\n\t\t bill_street_address ='\".$this->updProfile['billingAddress'].\"' ,\n\t\t bill_city ='\".$this->updProfile['billCity'].\"',\n\t\t mail_state ='\".$this->updProfile['state'].\"',\n\t\t mail_zip_code ='\".$this->updProfile['zipCode'].\"',\n\t\t bill_state ='\".$this->updProfile['billState'].\"',\n\t\t bill_zip_code ='\".$this->updProfile['billZipCode'].\"',\n\t\t is_address_changed ='\".$this->updProfile['is_address_changed'].\"',\n\t\t secondary_affiliates ='\".$this->updProfile['secondary_afflliates'].\"'\n\t\t \n\t\t WHERE subscriber_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t return $this->Execute($query);\n\t\t //return $this->_getPageArray($rs, 'Subscriber');*/\n\t\t}", "public function update(){\n\t\t\t$record = $this->modelGetrenter_user();\n\t\t\tinclude \"Views/AccountUpdateView.php\";\n\t\t}", "public function update_profile($username,$email,$surname,$finame,$status,$address,$state,$dob){\r\n $update_profile = \"UPDATE student_registration SET username='$username', email='$email', surname='$surname', firstname='$finame', status='$status', address='$address', state='$state', dob='$dob' WHERE email='$email'\";\r\n $update_query = $this->conn->query($update_profile);\r\n if($update_query){\r\n echo \"<script>\r\n alert('Your profile has been updated successfully');\r\n window.location = 'my_profile.php';\r\n </script>\";\r\n }\r\n \r\n }", "public function update($nonce, $address) {\n return $this->_mysqli->query(sprintf(\"UPDATE tbl_nonces SET s_address = '%s' WHERE s_nonce = '%s' \", $this->_mysqli->real_escape_string($address), $this->_mysqli->real_escape_string($nonce)));\n }", "public static function address($address){\n $addre = Address::where('user_id',Auth::id())->where('address_type',$address['address_type'])->first();\n if ($addre){\n $addre->update($address);\n }else{\n Address::create($address);\n }\n }", "public function UpdateBillingAddress($data)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('MyAddress');\n\t\t\t$this->db->where('addr_uid',$GLOBALS['currentUserId']);\n\t\t\t$query = $this->db->get();\n\t\t\t$result = $query->result_array();\n\t\t\tif(!empty($result))\n\t\t\t{\n\t\t\t\t$this->db->where('addr_uid',$GLOBALS['currentUserId']);\n\t\t\t\treturn $this->db->update('MyAddress',$data);\n\t\t\t}\n\t\t\telse{\n\t\t\t$this->db->insert('MyAddress', $data);\n\t\t\t\n\t\t\t}\n\t\t\n\t\t\t\n\t\t}", "function updatePersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//getting id of given user id\n\t\t\t$idRow = $this->manageContent->getValue_where(\"user_info\",\"*\",\"user_id\",$user_id);\n\t\t\t$id = $idRow[0]['id'];\n\t\t\t//updating the values\n\t\t\tif(isset($userData['name']) && !empty($userData['name']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"name\",$userData['name'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['gender']) && !empty($userData['gender']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"gender\",$userData['gender'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['dob']) && !empty($userData['dob']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"dob\",$userData['dob'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['contact']) && !empty($userData['contact']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"contact_no\",$userData['contact'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add1']) && !empty($userData['add1']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line1\",$userData['add1'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add2']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line2\",$userData['add2'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['pin']) && !empty($userData['pin']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"pincode\",$userData['pin'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['city']) && !empty($userData['city']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"city\",$userData['city'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['state']) && !empty($userData['state']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"state\",$userData['state'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['country']) && !empty($userData['country']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"country\",$userData['country'],\"id\",$id);\n\t\t\t}\n\t\t}", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function update_user_profile_info($user_id,$data)\n\t{\n\t\treturn $this->ci->profile_model->update_user_profile_info($user_id,$data);\n\t}", "public function updateProfile($user, array $profile);", "protected function handlePin() : void // (un)favorite\n {\n if (!User::$id || empty($this->_get['id'][0]))\n {\n trigger_error('AjaxProfile::handlePin - profileId empty or user not logged in', E_USER_ERROR);\n return;\n }\n\n $uid = User::$id;\n if ($this->_get['user'] && User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU))\n {\n if (!($uid = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE user = ?', $this->_get['user'])))\n {\n trigger_error('AjaxProfile::handlePin - user \"'.$this->_get['user'].'\" does not exist', E_USER_ERROR);\n return;\n }\n }\n\n // since only one character can be pinned at a time we can reset everything\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags & ?d WHERE accountId = ?d', ~PROFILER_CU_PINNED, $uid);\n // and set a single char if necessary\n if (!$this->undo)\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags | ?d WHERE profileId = ?d AND accountId = ?d', PROFILER_CU_PINNED, $this->_get['id'][0], $uid);\n }", "function custom_user_profile_fields($user){\n if ( current_user_can('edit_posts') ) { // if current user can activate plugins they are admin\n ?>\n <h3>Learner Number</h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"learner\">Learner Number</label></th>\n <td><input type=\"text\" name=\"learner\" value=\"<?php echo esc_attr(get_the_author_meta( 'learner', $user->ID )); ?>\"></td>\n </tr>\n </table>\n <?php\n }\n}", "function update_bio($user_id,$bio,$connection)\n {\n if(!empty($bio))\n { \n $salt_string=\"@!\";\n $current_username.=$salt_string;\n $query = \"UPDATE user_details SET bio = '$bio' WHERE user_id = '$user_id' LIMIT 1\";\n $result = mysqli_query($connection, $query);\n\n if($result)\n return true;\n else\n return false;\n }\n else\n return true;\n }", "function user_edit($user_info)\n {\n }", "public function webeditprofile($user_id,$data)\n {\n \n $editprofile = DB::table('users')->where('id',$user_id)->update($data);\n return redirect('myprofile');\n\n }", "function itstar_save_extra_user_profile_fields( $user_id ) {\n $saved = false;\n if ( current_user_can( 'edit_user', $user_id ) ) {\n update_user_meta( $user_id, 'birthday', $_POST['birthday'] );\n update_user_meta( $user_id, 'birthmonth', $_POST['birthmonth'] );\n update_user_meta( $user_id, 'birthyear', $_POST['birthyear'] );\n update_user_meta( $user_id, 'phone', $_POST['phone'] );\n update_user_meta( $user_id, 'job', $_POST['job'] );\n $saved = true;\n }\n return true;\n}", "function my_update_first_and_last_name_after_checkout($user_id)\n{\n\tif(isset($_REQUEST['ep_special']))\n\t{\n\t\t$ep_special = $_REQUEST['ep_special'];\n\t}\n\telseif(isset($_SESSION['ep_special']))\n\t{\n\t\t//maybe in sessions?\n\t\t$ep_special = $_SESSION['ep_special'];\n\t\t\n\t\t//unset\n\t\tunset($_SESSION['ep_special']);\n\t}\n\t\n\tif(isset($ep_special))\t\n\t\tupdate_user_meta($user_id, \"ep_special\", $ep_special);\n}", "public function updateAction()\n {\n /**\n * Fetch given address hash\n */\n $addressHash = $this->getRequest()->getParam('address_key');\n\n /**\n * Only if hash were given\n */\n if ( $addressHash ) {\n\n /**\n * Fetch all addresses in session\n */\n $allAddresses = Mage::getSingleton('core/session')->getKlarnaAddresses();\n\n /**\n * Look for a matching hash\n */\n foreach ($allAddresses as $address) {\n if ( $address['hash'] == $addressHash ) {\n\n /**\n * Fetch quote\n */\n $quote = Mage::getModel('checkout/cart')->getQuote();\n\n /**\n * Update billing address\n */\n if ( $quote && $quote->getBillingAddress() ) {\n\n $quote->getBillingAddress()\n ->setFirstname($address['fname'])\n ->setLastname($address['lname'])\n ->setCompany($address['company'])\n ->setStreet($address['street'])\n ->setPostcode($address['zip'])\n ->setCity($address['city'])\n ->setCountry(Mage::helper('klarna')->klarnaCountryToMagento($address['country']))\n ->save();\n }\n\n /**\n * Update shipping address\n */\n if ( $quote && $quote->getShippingAddress() ) {\n\n $quote->getShippingAddress()\n ->setFirstname($address['fname'])\n ->setLastname($address['lname'])\n ->setCompany($address['company'])\n ->setStreet($address['street'])\n ->setPostcode($address['zip'])\n ->setCity($address['city'])\n ->setCountry(Mage::helper('klarna')->klarnaCountryToMagento($address['country']))\n ->save();\n }\n\n /**\n * Return successful response\n */\n return $this->jsonReponse(Mage::helper('klarna/json')->success(array('success' => true)));\n }\n }\n }\n\n /**\n * Return the json error\n */\n return $this->jsonReponse(Mage::helper('klarna/json')->error($this->__('Unable to set address')));\n }", "public function update_userdetails($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $userId = Yii::$app->user->id;\n\n $query = new Query;\n\n $result = $query->createCommand()->update('core_users', ['user_name' => $name,'company_name' => $company_name,'company_address' => $address,'designation' => $designation,'company_email' => $company_email], 'user_id = \"'.$userId.'\"')->execute();\n\n if ($result == 1){\n return \"SUCCESS\";\n }else{\n return \"FAILED\";\n }\n }", "public function testUpdateUser()\n {\n }", "public function update($user_id)\n\t{\n\t\t//\n\t}", "function set_seller_meta($user_id) {\n update_user_meta( $user_id, 'dokan_publishing', 'yes' );\n}", "function userverifydetails($firstname, $lastname, $address1, $address2, $city, $zip, $state, $country, $dob, $username) \n\t{\n $user = UserModel::user();\n\t\t\n if ($user>user_detailssubmitted == 'submitted') \n\t\t{ \n\t\n\t\t\t//sql to run\n\t\t\t$sql = \"UPDATE user \n\t\t\t\t\tSET\tuser_firstname = ?,\n\t\t\t\t\t\tuser_lastname = ?,\n\t\t\t\t\t\tuser_address1 = ?, \n\t\t\t\t\t\tuser_address2 = ?,\n\t\t\t\t\t\tuser_city = ?,\n\t\t\t\t\t\tuser_zip = ?,\n\t\t\t\t\t\tuser_state = ?,\n\t\t\t\t\t\tuser_country = ?,\n\t\t\t\t\t\tuser_dob = ?, \n\t\t\t\t\t\tuser_detailssubmitted = 'submitted' \n\t\t\t\t\t\tWHERE user_id = ?\";\n\t\t\t\t\t\t\n\t\t\t//run the sql\n\t\t\t$updateuser = $this->db->prepare($sql);\n $updateuser->execute(array($firstname, $lastname, $address1, $address2, $city, \n\t\t\t\t\t\t\t\t\t $zip, $state, $country, $dob, $username->username));\n }\n }", "protected function auth0_update_fields($user_info, $user, &$edit)\n {\n $config = \\Drupal::service('config.factory')->get('auth0.settings');\n $auth0_claim_mapping = $config->get('auth0_claim_mapping');\n\n if (isset($auth0_claim_mapping) && !empty($auth0_claim_mapping)) {\n // For each claim mapping, lookup the value, otherwise set to blank\n $mappings = $this->auth0_pipeListToArray($auth0_claim_mapping);\n\n // Remove mappings handled automatically by the module\n $skip_mappings = array('uid', 'name', 'mail', 'init', 'is_new', 'status', 'pass');\n foreach ($mappings as $mapping) {\n \\Drupal::logger('auth0')->notice('mapping '.$mapping);\n\n $key = $mapping[1];\n if (in_array($key, $skip_mappings)) {\n \\Drupal::logger('auth0')->notice('skipping mapping handled already by auth0 module '.$mapping);\n } else {\n $value = isset($user_info[$mapping[0]]) ? $user_info[$mapping[0]] : '';\n $current_value = $user->get($key)->value;\n if ($current_value === $value) {\n \\Drupal::logger('auth0')->notice('value is unchanged '.$key);\n } else {\n \\Drupal::logger('auth0')->notice('value changed '.$key . ' from [' . $current_value . '] to [' . $value . ']');\n $edit[$key] = $value;\n $user->set($key, $value);\n }\n }\n }\n }\n }", "private static function updateUserAuthy( $ui, $email_addr, $dirty_phone_number, $full_country_code ) {\n\n \tif( Config::get('TWO_FACTOR_METHOD') != 'authy' ) {\n\t\t\treturn;\n\t\t}\n\n //Allow only digits in the phone number\n $clean_phone_number = preg_replace(\"/[^0-9]/\", \"\", $dirty_phone_number);\n if( $dirty_phone_number != $clean_phone_number ) {\n $ui->setAttribute('phone_number',$clean_phone_number);\n }\n\n //transform the country code in a format Authy likes\n $country_code = trim( $full_country_code, '+' );\n\n //init\n $authy = Loader::helper(\"authy\");\n\n //get the id\n $authy_id = $authy->getAuthyUserId(\n $email_addr,\n $clean_phone_number,\n $country_code\n );\n\n //and store it for rainny days\n $ui->setAttribute( 'authy_user_id', $authy_id );\n }", "function updateUser(){\n\t$conn = db_connect();\n\n\tif(isset($_GET['id']) && (int)$_GET['id'] > 0){#proper data must be on querystring\n\t\t$myID = (int)$_GET['id']; #Convert to integer, will equate to zero if fails\n\t}\n\n\tif(isset($_POST['firstname'])){$firstName=$_POST['firstname'];}else{$firstName = '';}\n if(isset($_POST['lastname'])){$lastName=$_POST['lastname'];}else{$lastName = '';}\n if(isset($_POST['userPhone'])){$userPhone=$_POST['userPhone'];}else{$firstName = '';}\n if(isset($_POST['userEmail'])){$userEmail=$_POST['userEmail'];}else{$lastName = '';}\n if(isset($_POST['type'])){$type=$_POST['type'];}else{$type = '';}\n\n\t$sql = \"UPDATE users set firstName='%s',lastName='%s',PhoneNumber='%s',EmailAddress='%s',TypeId=%d WHERE UserId = \" . $myID;\n\n\t$sql = sprintf($sql,$firstName,$lastName, $userPhone,$userEmail, $type);\n\t$result = mysqli_query($conn,$sql); \n \n\tif ($result)\n\t{#successful update!\n\t\t$newURL = 'detail.php?id=' . $myID;\n\t}else{\n\t\t$newURL = 'edit.php?id=' . $myID;\n\t}\n\theader('Location: '.$newURL);\n die();\n}", "public function update($userid)\n {\n $user = \\App\\User::with('profile')->whereId($userid)->firstOrFail();\n $input = Input::only('location', 'bio', 'twitter_username', 'github_username');\n\n $this->validator($input);\n\n //dd($user);\n $user->profile->fill($input)->save();\n \\Session::flash('flash_message','Profile successfully updated!');\n return redirect()->route('profile.edit', $user->id);\n }", "function updateprofile($pdo,$profile_id) {\n $sql = \"UPDATE profile SET first_name = :first_name, summary = :summary,\n last_name = :last_name, email = :email, headline = :headline\n WHERE profile_id = :profile_id\";\n $stmt = $pdo->prepare($sql);\n $stmt->execute(array(\n ':first_name' => $_POST['first_name'],\n ':last_name' => $_POST['last_name'],\n ':email' => $_POST['email'],\n ':headline' => $_POST['headline'],\n ':summary' => $_POST['summary'],\n ':profile_id' => $profile_id));\n}", "function update_user_phone($phone, $user) {\n\n global $DB, $CFG;\n\n if (isset($SESSION->mustattempt)) {\n unset($SESSION->mustattempt);\n }\n\n $user = json_decode(base64_decode($user));\n $user->phone2 = $phone;\n\n $DB->update_record('user', $user);\n\n redirect('/login/index.php', get_string('phoneupdatesuccess', 'auth_twofactor'), 5, \\core\\output\\notification::NOTIFY_SUCCESS);\n\n}", "public function updateUser($userId=-1,$firstName=null, $lastName=null, $userName=null, $password=null, $emailAddress=null,$studentId=null, $major=null, $address=null);", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "public function update_userdetails_by_admin($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n \n $query = new Query;\n\n $result = $query->createCommand()->update('core_users', ['user_name' => $name,'company_name' => $company_name,'company_address' => $address,'designation' => $designation,'company_email' => $company_email], 'user_id = \"'.$userid.'\"')->execute();\n\n if ($result == 1){\n return \"SUCCESS\";\n }else{\n return \"FAILED\";\n }\n }", "function change_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\tloadTemplate('user/add_mobile_number');\n\t}", "function updates_meta( $user_id, $old_user_data ) {\n \t $field_name = $_POST['field_name'];\n\t\t$field_key = $_POST['field_key'];\n\t\t$company_names = $_POST['company_names'];\n\t \t$job_role = $_POST['job_role'];\n \t\tif( !empty( $field_name ) && !empty( $field_key ) ) {\n\t\t\tupdate_user_meta( $user_id, $field_name, $company_names );\n\t\t\tupdate_user_meta( $user_id, '_' . $field_name, $company_names );\n\t\t\tupdate_user_meta( $user_id, 'job_role' , $job_role );\n\t\t\tupdate_user_meta( $user_id, '_job_role', $job_role );\n\t\t}\n}", "public function update_sso_user($sso_id, $email, $screen_name)\n\t{\n\t\t$this->db->set('email', $email);\n\t\t$this->db->set('screen_name', $screen_name);\n\t\t$this->db->set('is_active', 'yes');\n\n\t\t$this->db->where('sso_id', $sso_id);\n\t\t$this->db->update('user');\n\t}", "function func_bp_core_activated_user($user_id, $key, $user){\n $args = array( 'field' => 'Are You A Coach', 'user_id' => $user_id); \n $_xprofile_coach_yes_no = bp_get_profile_field_data($args); \n if( $_xprofile_coach_yes_no == 'Yes'){ \n\t//change user role to coach \n\t$wp_user = get_user_by('ID', $user_id); \n\t$wp_user->remove_role('subscriber'); \n\t$wp_user->add_role('coach');\n }\n}", "public function edit_profile($username, $data) {\n\t\t$this->db->where('username', $username)\n\t\t\t\t ->update('user', $data);\n\t}", "public function update() {\n if($this->profile_id == 0)\n return null; // can't update something without an ID\n\n $db = Db::instance(); // connect to db\n $q = sprintf(\"UPDATE `profiles` SET\n `firstname` = $db->escape($this->firstname),\n `lastname` = $db->escape($this->lastname),\n `username` = $db->escape($this->username),\n `password` = $db->escape($this->password),\n `photo` = $db->escape($this->photo),\n `number_posts` = $db->escape($this->number_posts)\n WHERE `profile_id` = $db->escape($this->profile_id);\");\n\n $db->query($q); // execute query\n return $db->profile_id; // return this object's ID\n }", "function updateProfile($data) {\ntry {\n\n if (!$conn = connectDB()) {\n return false;\n }\n\n $userId = $_SESSION[\"userId\"];\n $args = array(\n $data[\"firstName\"], $data[\"lastName\"],\n $data[\"phone\"], $data[\"email\"], $data[\"location\"],\n $userId\n );\n\n $sql = <<<SQL\nUPDATE WebUser\nSET firstName=$1, lastName=$2,\n phonenumber=$3, emailaddress=$4, location=$5\nWHERE userId=$6\nSQL;\n\n $result = executeSQL($conn, $sql, $args);\n\n if (getUpdateCount($result) != 1) {\n /* Update was unsuccessful */\n closeDB($conn);\n return false;\n }\n\n /* Update succeeded */\n closeDB($conn);\n return true;\n\n} catch (Exception $e) {\n error(\"updateProfile\");\n closeDB($conn);\n return false;\n}\n}", "function pmprorss_memberkeys_profile( $user ) { \r\n\r\n\tglobal $pmpro_levels;\r\n\r\n\t$args = array(\r\n\t\t'pmpromrss_regenerate_key' => 1,\r\n\t\t'user_id' => $user->ID,\r\n\t\t'_wpnonce' => wp_create_nonce( 'pmpromrss_regenerate' )\r\n\t);\r\n\t?>\r\n\r\n <h3><?php esc_html_e( 'Member RSS', 'pmpro-member-rss' ); ?></h3>\r\n\r\n <table class=\"form-table\">\r\n\r\n\t <tr id='pmpromrss_key'>\r\n\t <th><label for=\"address\"><?php esc_html_e( 'Key', 'pmpro-member-rss' ); ?></label></th>\r\n\t <td>\r\n\t <input type=\"text\" name=\"pmpromrss_profile_key\" id=\"pmpromrss_profile_key\" readonly=\"readonly\" value=\"<?php echo pmpromrss_getMemberKey( $user->ID ); ?>\" class=\"regular-text\" />&nbsp;<a href='javascript:pmpro_askfirst(\"<?php esc_attr_e( \"Are you sure you want to regenerate this user's key?\", 'pmpro-member-rss' ); ?>\", \"<?php echo esc_url( add_query_arg( $args, get_edit_profile_url() ) ); ?>\");' class=\"button button-primary\"><?php esc_html_e( 'Regenerate Key', 'pmpro-member-rss' ); ?></a>\r\n\t </td>\r\n\t </tr>\r\n \t\r\n </table>\r\n<?php }", "static function updateProfile($userid, $save)\r\n\t{\r\n\t\t$userid = funcs::check_input($userid);\r\n\r\n\t\t$col_member = array_flip(DBconnect::get_col_names(TABLE_MEMBER));\r\n\t\tforeach($col_member as $key => $value) {\r\n\t\t\techo $value[$key];\r\n\t\t}\r\n\t\t$save_post = array_intersect_key($save, $col_member);\r\n\t\tforeach($save_post as $key => $val)\r\n\t\t{\r\n\t\t\t$validate_save[$key] = funcs::check_input($val);\r\n\t\t}\r\n\t\t#Pakin Change this static function\r\n\t\t$username = self::findUserName($userid);\r\n\t\tself::NewSorting($username);\r\n\t\tfuncs::logProfileAction($userid,2);\r\n\r\n\t\t/*/////\r\n\t\t$save['username'] = $username;\r\n\t\t$save['secret'] = 'kontaktmarkt';\r\n\t\t$client = new SoapClient(null, array('location' => \"http://emailchat.napil.de/services/soapserver.php\", 'uri' => \"urn://kontaktmarkt\"));\r\n\t\t$result = $client->updateProfile($save);\r\n\t\t*/\r\n\t\treturn DBconnect::update_1D_row_with_1D_array(TABLE_MEMBER, $validate_save, TABLE_MEMBER_ID, $userid);\r\n\t}", "public function update_partner_profile($user_data) {\n\n $partner_id = $user_data['vendor_id'];\n if (isset($user_data['name']) && $user_data['name'] != '') {\n $updated_user_data = array(\n 'first_name' => $user_data['name'],\n );\n $this->db->where('id', $partner_id);\n $this->db->update('vendors', $updated_user_data);\n return $updated_user_data;\n }\n\n\n if (isset($user_data['lastname']) && $user_data['lastname'] != '') {\n\n $updated_user_data = array(\n 'last_name' => $user_data['lastname'],\n );\n $this->db->where('id', $partner_id);\n $this->db->update('vendors', $updated_user_data);\n return $updated_user_data;\n }\n }", "public function testUpdateNetworkMerakiAuthUser()\n {\n }", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "public function wc_address_book_make_primary() {\n\n\t\t$customer_id = get_current_user_id();\n\t\t$address_book = $this->get_address_book( $customer_id );\n\n\t\t$primary_address_name = 'shipping';\n\t\t$alt_address_name = $_POST['name'];\n\n\t\t// Loop through and swap values between shipping names.\n\t\tforeach ( $address_book[ $primary_address_name ] as $field => $value ) {\n\n\t\t\t$alt_field = preg_replace( '/^[^_]*_\\s*/', $alt_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $alt_address_name ][ $alt_field ] );\n\t\t}\n\n\t\tforeach ( $address_book[ $alt_address_name ] as $field => $value ) {\n\n\t\t\t$primary_field = preg_replace( '/^[^_]*_\\s*/', $primary_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $primary_address_name ][ $primary_field ] );\n\t\t}\n\n\t\tdie();\n\t}" ]
[ "0.7514233", "0.683388", "0.6059354", "0.5975911", "0.5946821", "0.59335494", "0.5908196", "0.59075725", "0.5900647", "0.58909017", "0.58900136", "0.58877856", "0.58725476", "0.5860378", "0.5859505", "0.58435875", "0.58138007", "0.5812223", "0.5801307", "0.5773004", "0.5768474", "0.5733635", "0.5728056", "0.5727712", "0.57200074", "0.5714747", "0.5700816", "0.5700613", "0.56963056", "0.56717193", "0.56654716", "0.5652136", "0.5643073", "0.56380445", "0.56309634", "0.5630463", "0.5628952", "0.56098497", "0.56063634", "0.56050307", "0.5596205", "0.5591873", "0.5590487", "0.55865586", "0.5584663", "0.5579442", "0.5578464", "0.55748636", "0.5566337", "0.5564128", "0.5561455", "0.55576116", "0.55467784", "0.5536122", "0.552888", "0.5502072", "0.55009544", "0.549782", "0.5495105", "0.54934394", "0.54836965", "0.547591", "0.54686636", "0.54674584", "0.54650134", "0.545243", "0.5446525", "0.5446477", "0.54432434", "0.54374504", "0.54350245", "0.5429684", "0.5429673", "0.5414462", "0.5407805", "0.5399466", "0.53932935", "0.538739", "0.53865415", "0.5382644", "0.5376304", "0.53635925", "0.5353966", "0.5344629", "0.53437555", "0.5329469", "0.53287345", "0.5324048", "0.53168976", "0.5316228", "0.53149307", "0.5314397", "0.5311547", "0.5308266", "0.53082144", "0.5300467", "0.5293822", "0.5292445", "0.5291528", "0.5290516" ]
0.682074
2
Save the field when the values are changed on the user's WP profile page
function getfaircoin_edd_save_extra_profile_fields( $user_id ) { if ( ! current_user_can( 'edit_user', $user_id ) ) return false; update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['_edd_user_fairaddress'] ); update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['_edd_user_fairsaving'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save_custom_user_profile_fields($user_id){\n if(!current_user_can('edit_posts'))\n return false;\n\n // save my custom field\n update_user_meta($user_id, 'learner', esc_html($_POST['learner']));\n}", "function docdirect_save_custom_user_profile_fields($user_id){\n\t\tif(!current_user_can('manage_options'))\n\t\t\treturn false;\n\t\n\t\t# save my custom field\n\t\tupdate_user_meta($user_id, 'verify_user', 'off');\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', false );\n\t}", "public function save()\n\t{\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile->{Yii::$app->request->post()['flag']} = Yii::$app->request->post()['val'];\n\n\t\t$updatedProfile->save();\n\t}", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "function itstar_save_extra_user_profile_fields( $user_id ) {\n $saved = false;\n if ( current_user_can( 'edit_user', $user_id ) ) {\n update_user_meta( $user_id, 'birthday', $_POST['birthday'] );\n update_user_meta( $user_id, 'birthmonth', $_POST['birthmonth'] );\n update_user_meta( $user_id, 'birthyear', $_POST['birthyear'] );\n update_user_meta( $user_id, 'phone', $_POST['phone'] );\n update_user_meta( $user_id, 'job', $_POST['job'] );\n $saved = true;\n }\n return true;\n}", "function save_extra_user_profile_fields( $user_id ) {\n if ( !current_user_can( 'edit_user', $user_id ) ) { \n return false; \n }\n\n\n $socialLinks=array(\"twitter\" => $_POST['twitter'] , \"facebook\" => $_POST['facebook'],\"instagram\" => $_POST['instagram']);\n\n \n update_user_meta(\n $user_id,\n 'social_links',\n $socialLinks\n );\n}", "function save_user_fields ($user_id) {\n if ( isset($_POST['billing_first_name']) ){\n update_user_meta($user_id, 'billing_first_name', sanitize_text_field($_POST['billing_first_name']));\n }\n \n if ( isset($_POST['billing_last_name']) ){\n update_user_meta($user_id, 'billing_last_name', sanitize_text_field($_POST['billing_last_name']));\n }\n\n if ( isset($_POST['billing_tipo_documento']) ){\n update_user_meta($user_id, 'billing_tipo_documento', sanitize_text_field($_POST['billing_tipo_documento']));\n }\n\n if ( isset($_POST['billing_numero_documento']) ){\n update_user_meta($user_id, 'billing_numero_documento', sanitize_text_field($_POST['billing_numero_documento']));\n }\n \n}", "function ffl_save_extra_profile_fields( $user_id ) \n{\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\treturn false;\n\n\t//set the display name\n\t$display_name = trim($_POST['first_name'] . \" \" . $_POST['last_name']);\n\tif(!$display_name)\n\t\t$display_name = $_POST['user_login'];\n\t\t\n\t$_POST['display_name'] = $display_name;\n\t\n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t); \n\twp_update_user( $args ) ;\n}", "public function save( $user_id ) {\r\n\t\t// Unhook action to garantee single save\r\n\t\tremove_action( 'profile_update', array( $this, '_save' ) );\r\n\r\n\t\t$this->set_user_id( $user_id );\r\n\r\n\t\tforeach ( $this->fields as $field ) {\r\n\t\t\t$field->set_value_from_input();\r\n\t\t\t$field->save();\r\n\t\t}\r\n\r\n\t\tdo_action( 'carbon_after_save_user_meta', $user_id );\r\n\t}", "function saveExtraProfileFields($user_id) {\n\t\tif($this->checkPermissions()) {\n\t\t\tif ( !current_user_can( 'edit_user', $user_id ) ) { return false; }\n\t\t\tupdate_usermeta( $user_id, 'lepress-organization', $_POST['lepress-organization'] );\n\t\t}\n\t}", "function save_profile() {\n global $wpdb;\n\n // Get the current subscriber, fail if not found\n $user = $this->get_user_from_request(true);\n\n // Conatains the cleaned up user data to be saved\n $data = array();\n $data['id'] = $user->id;\n\n $options_profile = get_option('newsletter_profile', array());\n $options_main = get_option('newsletter_main', array());\n\n // Not an elegant interaction between modules but...\n $subscription_module = NewsletterSubscription::instance();\n\n if (!$this->is_email($_REQUEST['ne'])) {\n $user->alert = $this->options['profile_error'];\n return $user;\n }\n\n $email = $this->normalize_email(stripslashes($_REQUEST['ne']));\n $email_changed = ($email != $user->email);\n\n // If the email has been changed, check if it is available\n if ($email_changed) {\n $tmp = $this->get_user($email);\n if ($tmp != null && $tmp->id != $user->id) {\n // TODO: Move the label on profile setting panel\n $user->alert = $this->options['error'];\n return $user;\n }\n $data['status'] = Newsletter::STATUS_NOT_CONFIRMED;\n }\n\n // General data\n $data['email'] = $email;\n if (isset($_REQUEST['nn'])) {\n $data['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));\n if ($subscription_module->is_spam_text($data['name'])) {\n die();\n }\n }\n if (isset($_REQUEST['ns'])) {\n $data['surname'] = $this->normalize_name(stripslashes($_REQUEST['ns']));\n if ($subscription_module->is_spam_text($data['surname'])) {\n die();\n }\n }\n if ($options_profile['sex_status'] >= 1) {\n $data['sex'] = $_REQUEST['nx'][0];\n // Wrong data injection check\n if ($data['sex'] != 'm' && $data['sex'] != 'f' && $data['sex'] != 'n') {\n die('Wrong sex field');\n }\n }\n\n // Lists. If not list is present or there is no list to choose or all are unchecked.\n $nl = array();\n if (isset($_REQUEST['nl']) && is_array($_REQUEST['nl'])) {\n $nl = $_REQUEST['nl'];\n }\n\n // Every possible list shown in the profile must be processed\n $lists = $this->get_lists_for_profile();\n foreach ($lists as $list) {\n $field_name = 'list_' . $list->id;\n $data[$field_name] = in_array($list->id, $nl) ? 1 : 0;\n }\n\n // Profile\n for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {\n // Private fields cannot be changed by the subscriber\n if ($options_profile['profile_' . $i . '_status'] == 0) {\n continue;\n }\n $data['profile_' . $i] = stripslashes($_REQUEST['np' . $i]);\n }\n\n\n // Feed by Mail service is saved here\n $data = apply_filters('newsletter_profile_save', $data);\n\n if ($user->status == TNP_User::STATUS_NOT_CONFIRMED) {\n $data['status'] = TNP_User::STATUS_CONFIRMED;\n }\n\n $user = $this->save_user($data);\n $this->add_user_log($user, 'profile');\n\n // Send the activation again only if we use double opt-in, otherwise it has no meaning\n // TODO: Maybe define a specific email for that and not the activation email\n if ($email_changed && $subscription_module->is_double_optin()) {\n $subscription_module->send_activation_email($user);\n // TODO: Move this option on new profile configuration panel\n $alert = $this->options['profile_email_changed'];\n }\n\n if (isset($alert)) {\n $user->alert = $alert;\n } else {\n // TODO: Move this label on profile settings panel\n $user->alert = $this->options['saved'];\n }\n return $user;\n }", "function interestedIn_update() {\n global $user_id;\n if (isset($_POST['intereses'])) {\n update_user_meta( $user_id, 'interesado_actividades', $_POST['intereses'] );\n }\n}", "function classiera_save_extra_profile_fields( $user_id ) {\r\n\tupdate_user_meta( $user_id, 'price_plan' );\r\n\tadd_user_meta( $user_id, 'price_plan_id' );\r\n}", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "function hook_openid_connect_userinfo_save(UserInterface $account, array $context) {\n // Update only when the required information is available.\n if (\n $context['plugin_id'] != 'generic'\n || empty($context['userinfo']['my_info'])\n ) {\n return;\n }\n\n // Note: For brevity, this example does not validate field\n // types, nor does it implement error handling.\n $my_info = $context['userinfo']['my_info'];\n foreach ($my_info as $key => $value) {\n $account->set('field_' . $key, $value);\n }\n}", "function profile_update($user_id = null) {\n\t\t\tglobal $wpdb, $Db, $Subscriber;\n\t\t\t\n\t\t\tif (!empty($user_id)) {\t\t\t\n\t\t\t\tif ($newuserdata = $this -> userdata($user_id)) {\n\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\n\t\t\t\t\tif ($subscriber = $Db -> find(array('user_id' => $user_id))) {\n\t\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\t$Db -> save_field('email', $newuserdata -> user_email, array('id' => $subscriber -> id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "function power_user_meta_save( $user_id ) {\n\n\tif ( ! current_user_can( 'edit_users', $user_id ) ) {\n\t\treturn;\n\t}\n\t// phpcs:ignore WordPress.Security.NonceVerification.Missing -- $_POST['power-meta'] is not a nonce field.\n\tif ( ! isset( $_POST['power-meta'] ) || ! is_array( $_POST['power-meta'] ) ) {\n\t\treturn;\n\t}\n\n\t$defaults = [\n\t\t'power_admin_menu' => '',\n\t\t'power_seo_settings_menu' => '',\n\t\t'power_import_export_menu' => '',\n\t\t'power_author_box_single' => '',\n\t\t'power_author_box_archive' => '',\n\t\t'headline' => '',\n\t\t'intro_text' => '',\n\t\t'doctitle' => '',\n\t\t'meta_description' => '',\n\t\t'meta_keywords' => '',\n\t\t'noindex' => '',\n\t\t'nofollow' => '',\n\t\t'noarchive' => '',\n\t\t'layout' => '',\n\t];\n\n\t/**\n\t * Filter the user meta defaults array.\n\t *\n\t * Allows developer to filter the default array of user meta key => value pairs.\n\t *\n\t * @since 2.1.0\n\t *\n\t * @param array $defaults Default user meta array.\n\t */\n\t$defaults = apply_filters( 'power_user_meta_defaults', $defaults );\n\n\t// phpcs:ignore WordPress.Security.NonceVerification.Missing -- $_POST['power-meta'] is not a nonce field.\n\t$meta = wp_parse_args( $_POST['power-meta'], $defaults );\n\n\t$meta['headline'] = wp_strip_all_tags( $meta['headline'] );\n\t$meta['intro_text'] = current_user_can( 'unfiltered_html' ) ? $meta['intro_text'] : power_formatting_kses( $meta['intro_text'] );\n\n\tforeach ( $meta as $key => $value ) {\n\t\tupdate_user_meta( $user_id, $key, $value );\n\t}\n\n}", "public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "private function p_save($data)\n\t{\n\t\t// data must be already sanitized through the form array\n\t\t$this->db->where('user_id', $data['user_id'])->update('profiles', $data);\n\t}", "public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "public function save()\n {\n $this->user->setCulture($this->getValue('language'));\n }", "function volpress_save_postdata( $post_id ) {\n\n\t// First we need to check if the current user is authorised to do this action. \n\tif ( 'page' == $_POST['post_type'] ) {\n\t\tif ( ! current_user_can( 'edit_page', $post_id ) )\n\t\t\t\treturn;\n\t} else {\n\t\tif ( ! current_user_can( 'edit_post', $post_id ) )\n\t\t\t\treturn;\n\t}\n\n\t// Secondly we need to check if the user intended to change this value.\n\tif ( ! isset( $_POST['volpress_noncename'] ) || ! wp_verify_nonce( $_POST['volpress_noncename'], plugin_basename( __FILE__ ) ) )\n\t\t\treturn;\n\n\t// Thirdly we can save the value to the database\n\n\t//if saving in a custom table, get post_ID\n\t$post_ID = $_POST['post_ID'];\n\t//sanitize user input\n\t$mydata = sanitize_text_field( $_POST['volpress_new_field'] );\n\n\t// Do something with $mydata \n\t// either using \n\tadd_post_meta($post_ID, '_my_meta_value_key', $mydata, true) or\n\t\tupdate_post_meta($post_ID, '_my_meta_value_key', $mydata);\n\t// or a custom table (see Further Reading section below)\n}", "public function save() {\n\n $columnName = $this->profileField->internal_name;\n\n // Try create column name\n if (!Profile::model()->columnExists($columnName)) {\n $sql = \"ALTER TABLE profile ADD `\" . $columnName . \"` INT;\";\n $this->profileField->dbConnection->createCommand($sql)->execute();\n }\n\n parent::save();\n }", "public function saveCustomFields()\n\t{\n\t\t$state = $this->getStateVariables();\n\t\t$validation = $this->getValidation();\n\n\t\t$user = JFactory::getUser();\n\t\t$user = $this->getState('user', $user);\n\n\t\t// Find an existing record\n\t\t$list = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->user_id($user->id)\n\t\t\t->getItemList();\n\n\t\tif(!count($list)) {\n\t\t\t$id = 0;\n\t\t} else {\n\t\t\t$thisUser = array_pop($list);\n\t\t\t$id = $thisUser->akeebasubs_user_id;\n\t\t}\n\n\t\t$data = array(\n\t\t\t'akeebasubs_user_id' => $id,\n\t\t\t'user_id'\t\t=> $user->id,\n\t\t\t'isbusiness'\t=> $state->isbusiness ? 1 : 0,\n\t\t\t'businessname'\t=> $state->businessname,\n\t\t\t'occupation'\t=> $state->occupation,\n\t\t\t'vatnumber'\t\t=> $state->vatnumber,\n\t\t\t'viesregistered' => $validation->validation->vatnumber,\n\t\t\t// @todo Ask for tax authority\n\t\t\t'taxauthority'\t=> '',\n\t\t\t'address1'\t\t=> $state->address1,\n\t\t\t'address2'\t\t=> $state->address2,\n\t\t\t'city'\t\t\t=> $state->city,\n\t\t\t'state'\t\t\t=> $state->state,\n\t\t\t'zip'\t\t\t=> $state->zip,\n\t\t\t'country'\t\t=> $state->country,\n\t\t\t'params'\t\t=> $state->custom\n\t\t);\n\n\t\t// Allow plugins to post-process the fields\n\t\tJLoader::import('joomla.plugin.helper');\n\t\tJPluginHelper::importPlugin('akeebasubs');\n\t\t$app = JFactory::getApplication();\n\t\t$jResponse = $app->triggerEvent('onAKSignupUserSave', array((object)$data));\n\t\tif(is_array($jResponse) && !empty($jResponse)) foreach($jResponse as $pResponse) {\n\t\t\tif(!is_array($pResponse)) continue;\n\t\t\tif(empty($pResponse)) continue;\n\t\t\tif(array_key_exists('params', $pResponse)) {\n\t\t\t\tif(!empty($pResponse['params'])) foreach($pResponse['params'] as $k => $v) {\n\t\t\t\t\t$data['params'][$k] = $v;\n\t\t\t\t}\n\t\t\t\tunset($pResponse['params']);\n\t\t\t}\n\t\t\t$data = array_merge($data, $pResponse);\n\t\t}\n\n\t\t// Serialize custom fields\n\t\t$data['params'] = json_encode($data['params']);\n\n\t\t$status = FOFModel::getTmpInstance('Users','AkeebasubsModel')\n\t\t\t->setId($id)\n\t\t\t->getItem()\n\t\t\t->save($data);\n\n\t\treturn $status;\n\t}", "function custom_user_profile_fields($user){\n if ( current_user_can('edit_posts') ) { // if current user can activate plugins they are admin\n ?>\n <h3>Learner Number</h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"learner\">Learner Number</label></th>\n <td><input type=\"text\" name=\"learner\" value=\"<?php echo esc_attr(get_the_author_meta( 'learner', $user->ID )); ?>\"></td>\n </tr>\n </table>\n <?php\n }\n}", "function getfaircoin_edd_store_usermeta( $payment_id ) {\r\n // return if user is not logged in\r\n if ( ! is_user_logged_in() )\r\n return;\r\n // get the user's ID\r\n $user_id = get_current_user_id();\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['edd_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['edd_fairsaving'] );\r\n}", "function my_update_first_and_last_name_after_checkout($user_id)\n{\n\tif(isset($_REQUEST['ep_special']))\n\t{\n\t\t$ep_special = $_REQUEST['ep_special'];\n\t}\n\telseif(isset($_SESSION['ep_special']))\n\t{\n\t\t//maybe in sessions?\n\t\t$ep_special = $_SESSION['ep_special'];\n\t\t\n\t\t//unset\n\t\tunset($_SESSION['ep_special']);\n\t}\n\t\n\tif(isset($ep_special))\t\n\t\tupdate_user_meta($user_id, \"ep_special\", $ep_special);\n}", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function update_profile(Request $request) {\n //type can be: mobile/phone/email\n $type = $request->type;\n //this new value is already validated in javascript\n $new_value = $request->new_value;\n $user = User::find($request->user_id);\n //dd($user);\n switch ($type) {\n case 'mobile':\n $user->gsm = $new_value;\n break;\n case 'phone':\n $user->tel = $new_value;\n break;\n case 'email':\n $user->email = $new_value;\n break;\n }\n\n $user->save();\n return 'success';\n }", "public function afterSave() {\n\t\t$setting = GPrivacySetting::model ()->cache ( 500 )->findByPk ( $this->id );\n\t\tif (! $setting) {\n\t\t\t$setting = new GPrivacySetting ();\n\t\t\t$setting->userId = $this->id;\n\t\t\t$setting->save ();\n\t\t}\n\t\t\n\t\tif ($this->isNewRecord) {\n\t\t\tG::log ( G::t ( 'A user has been created: user: {user}', array (\n\t\t\t\t\t'{user}' => CJavaScript::jsonEncode ( $this->attributes ) \n\t\t\t) ) );\n\t\t}\n\t\treturn parent::afterSave ();\n\t}", "public function onUpdateField()\n {\n //TODO Validate input\n\n $post = post();\n\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::updateField(\n $post['name'],\n $post['code'],\n $post['description'],\n $post['type'],\n $validation,\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }", "public function setUserfield($value);", "public function save( $user_id ) {\n\t\tforeach ( self::get_fields() as $id => $field ) {\n\t\t\tif ( ! empty( $_POST[ $id ] ) ) {\n\t\t\t\tupdate_user_meta( $user_id, $id, sanitize_text_field( $_POST[ $id ] ) );\n\t\t\t}\n\t\t}\n\t}", "public function saveProfile()\n\t{\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = trim($_REQUEST['username']);\n\t\t\t$fbuid = $this->getFBUID();\n\t\t\tif (isset($_POST['sub_clear'])) { $username = ''; }\n\t\t\tif ($username) {\n\t\t\t\t$result = $this->db->exec(\"INSERT IGNORE INTO selective_status_users (fbuid, twitterid) VALUES (\" . $this->db->quote($fbuid) . \", \" . $this->db->quote($username) . \");\");\n\t\t\t}\n\t\t\t$result = $this->db->exec(\"UPDATE selective_status_users SET twitterid = \" . $this->db->quote($username) . \", is_page = 0 WHERE fbuid = \" . $this->db->quote($fbuid) . \" LIMIT 1\");\n\t\t\treturn true;\n\t\t}\n\t}", "public function save_settings()\n\t{\n\t\tif ( $_POST && wp_verify_nonce( $_POST['save-confirm-user-registration-settings-nonce'], 'save-confirm-user-registration-settings' ) ) :\n\t\t\t$options = array(\n\t\t\t\t'error' => $_POST['error'],\n\t\t\t\t'from' => $_POST['from'],\n\t\t\t\t'subject' => $_POST['subject'],\n\t\t\t\t'message' => $_POST['message']\n\t\t\t);\n\n\t\t\t$options = apply_filters( 'confirm-user-registration-save-options', $options );\n\t\t\tupdate_site_option( 'confirm-user-registration', $options);\n\n\t\t\t?>\n\t\t\t<div class=\"updated message\">\n\t\t\t\t<p><?php _e( 'Saved' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t}", "function after_validation_on_update() {}", "function itstar_extra_user_profile_fields( $user ) {\n?>\n <h3><?php _e(\"Extra profile information\", \"itstar\"); ?></h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"birthday\"><?php echo __(\"birthday\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthday\" id=\"Birth Day\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthday' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birthday.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthmonth\"><?php echo __(\"Birth Month\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthmonth\" id=\"birthmonth\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthmonth' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Month.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthyear\"><?php echo __(\"Birth Year\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthyear\" id=\"birthyear\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthyear' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Year.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"phone\"><?php echo __(\"Phone\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"phone\" id=\"phone\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'phone',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your phone.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"job\"><?php echo __(\"Job\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"job\" id=\"job\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'job',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Job.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"viraclub\"><?php __(\"Vira club ID\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" disabled name=\"viraclub\" id=\"viraclub\" class=\"regular-text\" \n value=\"<?php echo 'V'.esc_attr( get_user_meta( $user->ID,'viraclub' ,true) ); ?>\" /><br />\n \n </td>\n </tr>\n </table>\n<?php\n}", "function registrationProcess_afterSaveEdit($currentArr, &$pObj) {\n//\t\tdebug($currentArr,'$currentArr');\n//\t\tdebug($pObj,'$pObj');\n\n\t\t//notify observer\n\t\tfeusers_observer::update('update', $currentArr['uid'], $currentArr);\n\t}", "function email_revalidate_user_settings_save() {\n\t$email = get_input('email');\n\t$user_id = get_input('guid');\n\n\tif (!$user_id) {\n\t\t$user = elgg_get_logged_in_user_entity();\n\t} else {\n\t\t$user = get_entity($user_id);\n\t}\n\n\tif (!is_email_address($email)) {\n\t\tregister_error(elgg_echo('email:save:fail'));\n\t\treturn false;\n\t}\n\n\tif ($user) {\n\t\tif (strcmp($email, $user->email) != 0) {\n\t\t\tif (!get_user_by_email($email)) {\n\t\t\t\t$user->new_email = $email;\n\t\t\t\tset_input('email', $user->email);\n\t\t\t\temail_revalidate_request_validation($user->guid);\n\t\t\t} else {\n\t\t\t\tregister_error(elgg_echo('registration:dupeemail'));\n\t\t\t}\n\t\t} else {\n\t\t\tunset($user->new_email);\n\t\t\treturn null;\n\t\t}\n\t} else {\n\t\tregister_error(elgg_echo('email:save:fail'));\n\t}\n\treturn false;\n}", "function cs_wc_save_extra_register_fields( $customer_id ) {\r\n if ( isset( $_POST['billing_first_name'] ) ) {\r\n // WordPress default first name field.\r\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n // WooCommerce billing first name.\r\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n }\r\n if ( isset( $_POST['billing_last_name'] ) ) {\r\n // WordPress default last name field.\r\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n // WooCommerce billing last name.\r\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n }\r\n}", "function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function updateFieldsPersonalization()\n\t{\n\t\tConfiguration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1'));\n\t\t$this->_html .= '<div class=\"conf confirm\"><img src=\"'._PS_ADMIN_IMG_.'/ok.gif\" alt=\"\" /> '.$this->l('Settings updated').'</div>';\t\t\n\t}", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "function stm_user_registration_save( $user_id ) {\r\n\t$post_title = '';\r\n if ( isset( $_POST['first_name'] ) )\r\n\t\t$post_title = $_POST['first_name'];\r\n\telse{\r\n\t\t$user_info = get_userdata($user_id);\r\n\t\t//$username = $user_info->user_login;\r\n\t\t$first_name = $user_info->first_name;\r\n\t\t$last_name = $user_info->last_name;\r\n\t\t$post_title = $first_name . ' ' . $last_name;\r\n\t}\r\n\r\n\r\n\t$defaults = array(\r\n\t\t\t\t 'post_type' => 'ocbmembers',\r\n\t\t\t\t 'post_title' => $post_title,\r\n\t\t\t\t 'post_content' => 'Replace with your content.',\r\n\t\t\t\t 'post_status' => 'publish'\r\n\t\t\t\t);\r\n\tif($post_id = wp_insert_post( $defaults )) {\r\n\t\t// add to user profile\r\n\t\tadd_post_meta($post_id, '_stm_user_id', $user_id);\r\n\r\n\t\t//add user profile to post\r\n\t\tupdate_user_meta( $user_id, '_stm_profile_post_id', $post_id );\r\n\r\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', 'false' );\r\n\r\n\t}\r\n\r\n}", "function save_user_story_backend($post_id) {\n $post = get_post($post_id);\n \n if ('user_story' == $_POST['post_type']) {\n if (!current_user_can('edit_page', $post_id)) return;\n\t$user_assigned = get_field('assigned_to');\n\tif(get_post_meta($post_id,'assigned_email', true)!=$user_assigned['user_email']){//different value then send email \n\t\tupdate_post_meta($post_id,'assigned_email',$user_assigned['user_email']);\n\t\tsend_email_assigned($user_assigned['user_email'],$post->post_title,get_permalink($post_id)); //send email\n\t}\n\t\n }\t\n}", "function wp_ajax_save_wporg_username()\n {\n }", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "function save() {\n //save the added fields\n }", "function owa_userProfileUpdateActionTracker($user_id, $old_user_data = '') {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$user = get_userdata($user_id);\r\n\tif (!empty($user->first_name) && !empty($user->last_name)) {\r\n\t\t$label = $user->first_name.' '.$user->last_name;\t\r\n\t} else {\r\n\t\t$label = $user->display_name;\r\n\t}\r\n\t\r\n\t$owa->trackAction('wordpress', 'User Profile Update', $label);\r\n}", "function wooc_save_extra_register_fields( $customer_id ) {\n if ( isset( $_POST['billing_first_name'] ) ) {\n // WordPress default first name field.\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n // WooCommerce billing first name.\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n }\n if ( isset( $_POST['billing_last_name'] ) ) {\n // WordPress default last name field.\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n // WooCommerce billing last name.\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n }\n}", "public static function profile_model_saved($model) {\n\t\t$model->preference('timezone', Arr::get($_POST, 'timezone'));\n\t}", "protected function hook_afterSave(){}", "function update_user($user_id, $old_userdata){\r\n $old_userdata = (array)$old_userdata;\r\n if($old_userdata['user_nicename']) $user_nicename = $old_userdata['user_nicename'];\r\n if($old_userdata['user_pass']) $user_pass = $old_userdata['user_pass'];\r\n if($old_userdata['user_email']) $user_email = $old_userdata['user_email'];\r\n if($old_userdata['nickname'] AND server(get_option('sso_user_nickname')) !== FALSE)\r\n update_usermeta($user_id, 'nickname', $old_userdata['nickname']);\r\n if($old_userdata['first_name'] AND server(get_option('sso_user_firstname')) !== FALSE)\r\n update_usermeta($user_id, 'first_name', $old_userdata['first_name']);\r\n if($old_userdata['last_name'] AND server(get_option('sso_user_lastname')) !== FALSE)\r\n update_usermeta($user_id, 'last_name', $old_userdata['last_name']);\r\n\r\n global $wpdb;\r\n $data = compact('user_pass', 'user_email', 'user_nicename');\r\n $data = stripslashes_deep($data);\r\n $e = $wpdb->update($wpdb->users, $data, array('ID' => $user_id));\r\n}", "function seun_edit_user_options() {\n\n\t\t\tglobal $user_id;\n\n\t\t\t$user_id = isset($user_id) ? (int) $user_id : 0;\n\n\t\t\tif ( ! current_user_can('edit_users') )\n\t\t\t\treturn;\n\n\t\t\tif ( ! ($userdata = get_userdata( $user_id ) ) )\n\t\t\t\treturn;\n\n\t\t\t$default_user_nicename = sanitize_title( $userdata->user_login );\n\n\t\t\techo '<h3>'.__('User Nicename', 'seun').'</h3>'\n\t\t\t\t.'<table class=\"form-table\">'.\"\\n\"\n\t\t\t\t\t.'<tr>'.\"\\n\"\n\t\t\t\t\t\t.'<th><label for=\"user_nicename\">'.__('User nicename/slug', 'seun').'</label></th>'.\"\\n\"\n\t\t\t\t\t\t.'<td>'\n\t\t\t\t\t\t\t.'<input id=\"user_nicename\" name=\"user_nicename\" class=\"regular-text code\" type=\"text\" value=\"'.sanitize_title($userdata->user_nicename, $default_user_nicename).'\"/> '\n\t\t\t\t\t\t\t.'<span class=\"description\">('.sprintf(__('Leave empty for default value: %s', 'seun'), $default_user_nicename).')</span> '\n\t\t\t\t\t\t\t.'<a href=\"'.get_author_posts_url($user_id).'\">'.__('Your Profile').'</a> '\n\t\t\t\t\t\t.\"</td>\\n\"\n\t\t\t\t\t.'</tr>'.\"\\n\"\n\t\t\t\t.'</table>'.\"\\n\";\n\n\t\t}", "function save_user_anaytics_info( $post_id, $form_id, $form_settings, $form_vars ) {\n $user_analytics = $this->get_user_analytics_info();\n update_post_meta( $post_id, 'user_analytics_info', $user_analytics );\n }", "function ajan_update_user_meta( $user_id, $key, $value, $prev_value = '' ) {\n\treturn update_user_meta( $user_id, ajan_get_user_meta_key( $key ), $value, $prev_value );\n}", "function save_custom_fields( $post_id, $post ) {\n if ( !isset($_POST['wpnext_wpnonce']) || !wp_verify_nonce($_POST['wpnext_wpnonce'], 'wpnext') )\n return;\n if ( !current_user_can( 'edit_post', $post_id ) )\n return;\n\n if ( isset($_POST['wpn_post_data']) ) {\n update_post_meta( $post_id, 'wpnext', $_POST['wpn_post_data']);\n } else {\n delete_post_meta( $post_id, 'wpnext');\n }\n }", "public function save()\n {\n update_option($this->optionKey, $this->fields);\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "function update_profile_fields()\n {\n if ( ! Session::access('can_admin_members')) {\n return Cp::unauthorizedAccess();\n }\n\n $fields = [\n \"m_field_id\",\n \"cur_field_name\",\n \"m_field_name\",\n \"m_field_label\",\n \"m_field_description\",\n \"m_field_order\",\n \"m_field_width\",\n \"m_field_type\",\n \"m_field_maxl\",\n \"m_field_ta_rows\",\n \"m_field_list_items\",\n \"m_field_required\",\n \"m_field_public\",\n \"m_field_reg\"\n ];\n\n\n $input = request()->only($fields);\n\n // If the $m_field_id variable is present we are editing existing\n $edit = (bool) request()->has('m_field_id');\n\n // Check for required fields\n if (empty($input['m_field_name'])) {\n $errors[] = __('members.no_field_name');\n }\n\n if (empty($input['m_field_label'])) {\n $errors[] = __('members.no_field_label');\n }\n\n // Is the field one of the reserved words?\n if (in_array($input['m_field_name'], Cp::unavailableFieldNames())) {\n $errors[] = __('members.reserved_word');\n }\n\n // Does field name have invalid characters?\n if ( ! preg_match(\"#^[a-z0-9\\_]+$#i\", $input['m_field_name'])) {\n $errors[] = __('members.invalid_characters');\n }\n\n // Is the field name taken?\n $field_count = DB::table('member_fields')\n ->where('m_field_name', $input['m_field_name'])\n ->count();\n\n if ($field_count > 0) {\n if ($edit === false) {\n $errors[] = __('members.duplicate_field_name');\n }\n\n if ($edit === true && $input['m_field_name'] != $input['cur_field_name']) {\n $errors[] = __('members.duplicate_field_name');\n }\n }\n\n // Are there errors to display?\n if (!empty($errors)) {\n return Cp::errorMessage(implode(\"\\n\", $errors));\n }\n\n if (!empty($input['m_field_list_items'])) {\n $input['m_field_list_items'] = Regex::convert_quotes($input['m_field_list_items']);\n }\n\n $n = 100;\n\n $f_type = 'text';\n\n if ($input['m_field_type'] == 'text') {\n if ( !empty($input['m_field_maxl']) && is_numeric($input['m_field_maxl'])) {\n $n = '100';\n }\n\n $f_type = 'string';\n }\n\n if ($edit === true) {\n\n if ($input['cur_field_name'] !== $input['m_field_name']) {\n\n Schema::table('member_data', function ($table) use ($input) {\n $table->renameColumn('m_field_'.$input['cur_field_name'], 'm_field_'.$input['m_field_name']);\n });\n }\n\n // ALTER\n Schema::table('member_data', function($table) use ($input, $f_type, $n)\n {\n if ($f_type == 'string') {\n $table->string('m_field_'.$input['m_field_name'], $n)->change();\n } else {\n $table->text('m_field_'.$input['m_field_name'])->change();\n }\n });\n\n unset($input['cur_field_name']);\n\n DB::table('member_fields')\n ->where('m_field_id', $input['m_field_id'])\n ->update($input);\n }\n\n if ($edit === false) {\n if (empty($input['m_field_order'])) {\n $total = DB::table('member_fields')->count() + 1;\n\n $input['m_field_order'] = $total;\n }\n\n unset($input['m_field_id']); // insure empty\n unset($input['cur_field_name']);\n\n $field_id = DB::table('member_fields')->insertGetId($input);\n\n // Add Field\n Schema::table('member_data', function($table) use ($input, $f_type, $n)\n {\n if ($f_type == 'string') {\n $table->string('m_field_'.$input['m_field_name'], $n);\n } else {\n $table->text('m_field_'.$input['m_field_name']);\n }\n });\n }\n\n // Insure every member has member data row?\n $query = DB::table('members')\n ->leftJoin('member_data', 'members.member_id', '=', 'member_data.member_id')\n ->whereNull('member_data.member_id')\n ->select('members.member_id')\n ->get();\n\n foreach ($query as $row)\n {\n DB::table('member_data')->insert(['member_id' => $row->member_id]);\n }\n\n return $this->custom_profile_fields();\n }", "public function afterUpdate()\n {\n //only clean and change custom fields if they have been set\n if (!empty($this->customFields)) {\n $this->deleteAllCustomFields();\n $this->saveCustomFields();\n }\n }", "function save() {\n $modified_fields = $this->modified_fields;\n $is_new = $this->isNew();\n\n if($is_new && ($this->getToken() == '')) {\n $this->resetToken();\n } // if\n\n $save = parent::save();\n if($save && !is_error($save)) {\n if($is_new || in_array('email', $modified_fields) || in_array('first_name', $modified_fields) || in_array('last_name', $modified_fields)) {\n $content = $this->getEmail();\n if($this->getFirstName() || $this->getLastName()) {\n $content .= \"\\n\\n\" . trim($this->getFirstName() . ' ' . $this->getLastName());\n } // if\n\n search_index_set($this->getId(), 'User', $content);\n cache_remove_by_pattern('object_assignments_*_rendered');\n } // if\n\n // Role changed?\n if(in_array('role_id', $modified_fields)) {\n clean_user_permissions_cache($this);\n } // if\n } // if\n\n return $save;\n }", "function display_user_profile_fields() {\r\n global $wpdb, $user_id, $wpi_settings;\r\n $profileuser = get_user_to_edit($user_id);\r\n\r\n include($wpi_settings['admin']['ui_path'] . '/profile_page_content.php');\r\n }", "public function saveFirstName()\n {\n $this->validate(['firstName' => 'sometimes|required']);\n\n $this->updateValue(\n 'first_name',\n $this->firstName,\n 'Customer First name updated successfully.'\n );\n\n $this->firstNameUpdate = false;\n $this->emit('profileUpdate');\n }", "function wppb_save_timezone_select_value( $field, $user_id, $request_data, $form_location ){\r\n if( $field['field'] == 'Select (Timezone)' ){\r\n if ( isset( $request_data[wppb_handle_meta_name( $field['meta-name'] )] ) )\r\n update_user_meta( $user_id, $field['meta-name'], $request_data[wppb_handle_meta_name( $field['meta-name'] )] );\r\n }\r\n}", "public function handleBeforeSave() {\n // Convert value of salary from formated value to save value\n $this->base_salary = str_replace(DomainConst::SPLITTER_TYPE_MONEY, '', $_POST['Users']['base_salary']);\n $this->social_insurance_salary = str_replace(DomainConst::SPLITTER_TYPE_MONEY, '', $_POST['Users']['social_insurance_salary']);\n $this->responsible_salary = str_replace(DomainConst::SPLITTER_TYPE_MONEY, '', $_POST['Users']['responsible_salary']);\n $this->subvention = str_replace(DomainConst::SPLITTER_TYPE_MONEY, '', $_POST['Users']['subvention']);\n }", "function _update_userdata($userdata){\r\n $userdata = (array)$userdata;\r\n $userdata2['user_email'] = server(get_sso_option('user_email'));\r\n $nickname = server(get_option('sso_user_nickname'));\r\n if($nickname !== FALSE AND $nickname !== $userdata['nickname']) $userdata2['nickname'] = $nickname;\r\n $firstname = server(get_option('sso_user_firstname'));\r\n if($firstname !== FALSE AND $firstname !== $userdata['firstname']) $userdata2['first_name'] = $firstname;\r\n $lastname = server(get_option('sso_user_lastname'));\r\n if($lastname !== FALSE AND $lastname !== $userdata['lastname']) $userdata2['last_name'] = $lastname;\r\n\r\n update_user($userdata['ID'], (array)$userdata2);\r\n //require_once(WPINC . DIRECTORY_SEPARATOR . 'registration.php');\r\n //wp_update_user((array)$userdata);\r\n \r\n set_user_groups();\r\n}", "function before_validation_on_update() {}", "function wck_fep_output_user_profile(){\n\n\t$nonce = wp_create_nonce( 'wck-fep-user-action' );\n\n\t$current_user = wp_get_current_user();\n\t$user_data = get_userdata( $current_user->ID );\n\n\t$user_profile = '<div id=\"wck-fep-update-form\">';\n\t$user_profile .= '<p><span class=\"wck-welcome\">'. sprintf( __( 'Welcome %1$s! ', 'wck' ), $current_user->display_name ) .'</span><a href=\"'. wp_logout_url( wck_fep_cur_page_url() ).'\" class=\"wck-logout\">'. __( 'Logout', 'wck' ) .'</a></p>';\n\n\t$user_profile .= '<p id=\"wck-fep-update-messages\"></p>';\n\t$user_profile .= '<p id=\"wck-fep-update-errors\"></p>';\n\n\t$user_profile .= '<ul>';\n\t$user_profile .= '<li><label for=\"email\">'. __( 'Email:', 'wck' ) .'</label>';\n\t$user_profile .= '<input type=\"text\" id=\"email\" name=\"email\" value=\"'. esc_attr( $current_user->user_email ) .'\" /></li>';\n\n\t$user_profile .= '<li><label for=\"password\">'. __( 'Password:', 'wck' ) .'</label>';\n\t$user_profile .= '<input type=\"password\" id=\"password\" name=\"password\"/></li>';\n\n\t$user_profile .= '<li><label for=\"confirm-password\">'. __( 'Password Confirm:', 'wck' ) .'</label>';\n\t$user_profile .= '<input type=\"password\" id=\"confirm-password\" name=\"confirm-password\"/></li>';\n\n\t$user_profile .= '<li><label for=\"description\">'. __( 'Description', 'wck' ) .'</label>';\n\t$user_profile .= '<textarea id=\"description\" name=\"description\">'. esc_textarea( $user_data->user_description ) .'</textarea></li>';\n\n\t$user_profile .= '<li><input type=\"submit\" value=\"'. __( 'Update', 'wck' ) .'\" onclick=\"wckFepUpdateUser(\\''. $nonce .'\\')\" /></li>';\n\t$user_profile .= '</ul></div>';\n\n\treturn apply_filters( 'wck_fep_user_profile', $user_profile );\n}", "function save() {\n\n $record = new stdClass;\n $record->username = $this->username;\n $record->firstname = addslashes($this->firstname);\n $record->lastname = addslashes($this->lastname);\n $record->idnumber = $this->idnumber;\n $record->update_flag = $this->update_flag;\n $record->reg_status = $this->reg_status;\n $record->college = $this->college;\n $record->year = $this->year;\n $record->classification = $this->classification;\n $record->keypadid = $this->keypadid;\n $record->ferpa= $this->ferpa;\n $record->anonymous = $this->anonymous;\n $record->degree_candidacy = $this->degree_candidacy;\n\n if ($this->hidden != null) {\n $record->hidden = $this->hidden;\n }\n if ($this->numsections != null) {\n $record->numsections = $this->numsections;\n }\n if ($this->format != null) {\n $record->format= $this->format;\n }\n if ($this->cr_delete != null) {\n $record->cr_delete = $this->cr_delete;\n }\n if ($this->moodleid != null) {\n $record->moodleid = $this->moodleid;\n }\n\n if (!$this->id) {\n\n $this->id = insert_record('block_courseprefs_users', $record, true);\n\n if (!$this->id) {\n throw new Exception('Unable to create new courseprefs user within database');\n }\n\n } else {\n\n $record->id = $this->id;\n\n if (!update_record('block_courseprefs_users', $record)) {\n throw new Exception('Unable to update existing courseprefs user within database');\n }\n }\n }", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "function save_additional_user_meta( $user_id ) {\n if ( !current_user_can( 'edit_user', $user_id ) )\n return false;\n\tif ( isset( $_POST['user_meta_image'] ) ) {\n\t\tupdate_usermeta( $user_id, 'user_meta_image', $_POST['user_meta_image'] );\n\t}\n}", "function jmw_buddypress_profile_update( $user_id, $posted_field_ids, $errors, $old_values, $new_values ) {\n\t\n\tif( current_user_can( 'manage_options' ) ) {\n\t\t// If administrator is making the changes don't email\n\t\treturn;\n\t}\n\n $message_subject = sprintf( '%s: Profile moderation required for %s',\n \tesc_html( get_bloginfo( 'name' ) ),\n \tesc_html( bp_core_get_user_displayname( $user_id ) )\n );\n\n $message = sprintf( 'Member %s has updated their profile. See %s',\n \tesc_html( bp_core_get_user_displayname( $user_id ) ),\n \tesc_url( bp_loggedin_user_domain() )\n );\n\n wp_mail( get_bloginfo( 'admin_email' ), $message_subject, $message );\n }", "function ajax_update_profile() {\n $_POST['nonce'] = empty($_POST['nonce']) ? '' : trim($_POST['nonce']);\n $member = wp_get_current_user();\n\n if( !wp_verify_nonce($_POST['nonce'], 'member_action') ) {\n die(json_encode(array(\n 'status' => 'fail',\n 'message' => '<div class=\"alert alert-danger\">'.__('<strong>Error:</strong> wrong data given.', 'tst').'</div>',\n )));\n } else if($member->user_email != $_POST['email'] && email_exists($_POST['email'])) {\n die(json_encode(array(\n 'status' => 'fail',\n 'message' => '<div class=\"alert alert-danger\">'.__('Email already exists!', 'tst').'</div>',\n )));\n } else {\n $params = array(\n 'ID' => $_POST['id'],\n 'user_email' => $_POST['email'],\n 'first_name' => $_POST['first_name'],\n 'last_name' => $_POST['last_name'],\n );\n if( !empty($_POST['pass']) )\n $params['user_pass'] = $_POST['pass'];\n\n $user_id = wp_update_user($params);\n if(is_wp_error($user_id)) {\n die(json_encode(array(\n 'status' => 'fail',\n 'message' => '<div class=\"alert alert-danger\">'.__('We are very sorry :( Some error occured while updating your profile.', 'tst').'</div>',\n )));\n } else {\n\n // Update another fields...\n update_user_meta($member->ID, 'description', htmlentities($_POST['bio'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_city', htmlentities($_POST['city'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_workplace', htmlentities(@$_POST['user_workplace'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_speciality', htmlentities($_POST['spec'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_professional', htmlentities($_POST['pro'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_contacts', htmlentities($_POST['user_contacts_text'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_website', htmlentities($_POST['user_website'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'twitter', htmlentities($_POST['twitter'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'facebook', htmlentities($_POST['facebook'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'vk', htmlentities($_POST['vk'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'googleplus', htmlentities($_POST['googleplus'], ENT_QUOTES, 'UTF-8'));\n update_user_meta($member->ID, 'user_skills', @$_POST['user_skills']);\n\n die(json_encode(array(\n 'status' => 'ok',\n 'message' => '<div class=\"alert alert-success\">'.sprintf(__('Your profile is successfully updated! <a href=\"%s\" class=\"alert-link\">View it</a>', 'tst'), tst_get_member_url($member)).'</div>',\n )));\n }\n }\n}", "public function onsave() {\n\n\tif( filter_input( INPUT_POST, 'content' ) ) {\n\t global $post;\n do_shortcode( stripslashes( filter_input( INPUT_POST, 'content' ) ) );\n\t if( isset( $this->shortcode['elements'] ) ) {\n $this->assign_repeatable();\n }\n $meta = get_post_meta( $post->ID, 'pwp_form', true );\n $meta['definition'] = $this->shortcode;\n update_post_meta( $post->ID, 'definition', $meta );\n }\n }", "public function save()\n {\n $this->validate();\n $user = User::findOrFail($this->userId);\n if(strtolower($this->origName) == strtolower($this->newName)){\n $this->updateName($user);\n return;\n }else{\n $user->info->update(['company_name' => $this->newName]);\n $user->save();\n $this->updateName($user);\n }\n\n\n }", "public function update_simple($f3) {\n \n if(!isset($_POST[\"password\"]))\n {\n LoggingUtility::LogActivity(\"Updated his own profile settings\",json_encode($f3->get('POST') ));\n }\n else\n {\n LoggingUtility::LogActivity(\"Updated his own password\");\n }\n\n $user = new User($f3->get('DB'));\n $user->edit($f3->get('POST.id'));\n \n if ($user->isFirstLogin()) {\n $f3->reroute('/');\n } else {\n $f3->reroute('/section/settings.profile');\n }\n }", "public function saveEmail()\n {\n $this->validate([\n 'email' => [\n 'sometimes',\n 'required',\n 'email',\n Rule::unique(shopper_table('users'), 'email')->ignore($this->customer_id),\n ],\n ]);\n\n $this->updateValue(\n 'email',\n $this->email,\n 'Customer Email address updated successfully.'\n );\n\n $this->emailUpdate = false;\n $this->emit('profileUpdate');\n }", "function updates_meta( $user_id, $old_user_data ) {\n \t $field_name = $_POST['field_name'];\n\t\t$field_key = $_POST['field_key'];\n\t\t$company_names = $_POST['company_names'];\n\t \t$job_role = $_POST['job_role'];\n \t\tif( !empty( $field_name ) && !empty( $field_key ) ) {\n\t\t\tupdate_user_meta( $user_id, $field_name, $company_names );\n\t\t\tupdate_user_meta( $user_id, '_' . $field_name, $company_names );\n\t\t\tupdate_user_meta( $user_id, 'job_role' , $job_role );\n\t\t\tupdate_user_meta( $user_id, '_job_role', $job_role );\n\t\t}\n}", "public function user_updated( $ui ) {\n\n //fish out all the needed params\n $dirty_phone_number = $ui->getAttribute('phone_number');\n $full_country_code = (string)$ui->getAttribute('phone_country_code');\n $email_addr = $ui->getUserEmail();\n\n //and request the update\n self::updateUserAuthy( $ui, $email_addr, $dirty_phone_number, $full_country_code );\n }", "protected function saveProfile($user)\n\t{\n\t}", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "function handle_profile_form( int $user_id ) {\n\tif ( ! check_admin_referer( 'update-user_' . $user_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $_POST['altis_telemetry_opt_in_toggle'] ) ) {\n\t\topt_in( true );\n\t} else {\n\t\topt_in( false );\n\t}\n}", "public function profile()\n {\n if (isset($_REQUEST['submit'])) {\n\n $fullname = $_POST['fullname'];\n\n $phone = $_POST['phone'];\n\n $username = $_POST['username'];\n\n $des = $_POST['des'];\n\n $user = $_POST['user'];\n\n\n //Checking for User login or not\n $change = $this->getChange($username, $fullname, $phone ,$des, $user);\n\n if ($change) {\n $success = 'Change profile successful!';\n echo \"<p><span class='error' style='color: green'>\" . $success . \"</span></p><br>\";\n } else {\n // Registration Failed\n $fail = 'Change profile failed. Account already not exits, please try again.';\n echo \"<p><span class='error' style='color: red;'>\" . $fail . \"</span></p><br>\";\n };\n }\n }", "public function updateUserLinked\t(){\n\t\t\n\t\t}", "public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}", "public function set_user_info($data){\n\t\t\treturn $result=$this->save($data);\n\t\t}", "protected function changeFollow()\n\t{\n\t\tif ( !\\IPS\\Member::loggedIn()->modPermission('can_modify_profiles') AND ( \\IPS\\Member::loggedIn()->member_id !== $this->member->member_id OR !$this->member->group['g_edit_profile'] ) )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'no_permission_edit_profile', '2C138/3', 403, '' );\n\t\t}\n\n\t\t\\IPS\\Session::i()->csrfCheck();\n\n\t\t\\IPS\\Member::loggedIn()->members_bitoptions['pp_setting_moderate_followers'] = ( \\IPS\\Request::i()->enabled == 1 ? FALSE : TRUE );\n\t\t\\IPS\\Member::loggedIn()->save();\n\n\t\tif( \\IPS\\Request::i()->isAjax() )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( 'OK' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->redirect( $this->member->url(), 'follow_saved' );\n\t\t}\n\t}", "function jmw_moderate_profile_field_data( $field_id, $value ) {\n\n\tif( current_user_can( 'manage_options' ) ) {\n\t\t$field = xprofile_get_field( $field_id );\n\t\t$visibility_level = $field->default_visibility;\n\t} else {\n\t\t$visibility_level = 'moderated';\n\t}\n\n\txprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );\n}", "function save_user_anaytics_on_registration( $user_id ) {\n $user_analytics = $this->get_user_analytics_info();\n update_user_meta( $user_id, 'user_analytics_info_during_register', $user_analytics );\n }", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }", "function save_my_meta_box_data2( $post_id ) {\n\n\n // Check if our nonce is set.\n if ( ! isset( $_POST['post_meta_box_nonce'] ) ) {\n return;\n }\n\n // Verify that the nonce is valid.\n if ( ! wp_verify_nonce( $_POST['post_meta_box_nonce'], 'post_meta_box' ) ) {\n return;\n }\n\n // If this is an autosave, our form has not been submitted, so we don't want to do anything.\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n\n // Check the user's permissions.\n if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) {\n\n if ( ! current_user_can( 'edit_page', $post_id ) ) {\n return;\n }\n\n } else {\n\n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n }\n\n /* OK, it's safe for us to save the data now. */\n\n // Make sure that it is set.\n if ( ! isset( $_POST['second_title'] ) ) {\n return;\n }\n // Make sure that it is set.\n if ( ! isset( $_POST['fexid'] ) ) {\n return;\n }\n // Make sure that it is set.\n if ( ! isset( $_POST['po_sources'] ) ) {\n return;\n }\n\n // Sanitize user input.\n $my_sec_title = sanitize_text_field( $_POST['second_title'] );\n $my_post_sources = sanitize_text_field( $_POST['po_sources'] );\n $my_fexid = sanitize_text_field( $_POST['fexid'] );\n\n // Update the meta field in the database.\n update_post_meta( $post_id, 'post_second_title', $my_sec_title );\n update_post_meta( $post_id, 'post_sources', $my_post_sources );\n update_post_meta( $post_id, 'post_fexid', $my_fexid );\n}", "function ajax_genmapper_user_country_selected() {\n\t\n\t$choosed_country = isset($_POST['choosed_country']) ? $_POST['choosed_country'] : '';\n\t\n\tif ( $choosed_country )\n\t{\n\t\t\t$meta=get_user_meta(get_current_user_id(), 'genmapper_country_code', true);\n\t\t\tif ( $meta == '' || (is_array($meta) && count($meta)==0 ) )\n\t\t\t{\n\t\t \tupdate_user_meta(get_current_user_id(), 'genmapper_country_code',$choosed_country);\n\t\t\t\techo 'country_set';\n\t\t\t}\n\n\t}\n\telse\n\t{\n\t\t\n\t}\n\t\n\twp_die();\n}", "public function update(){\n\t\tparent::update(\"UPDATE Users set privacy_setting = \" . $this->privacy_setting . \" where id = \" . $this->id);\n\t}", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "public function saveLastName()\n {\n $this->validate(['lastName' => 'sometimes|required']);\n\n $this->updateValue(\n 'last_name',\n $this->lastName,\n 'Customer Last name updated successfully.'\n );\n\n $this->lastNameUpdate = false;\n $this->emit('profileUpdate');\n }", "public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}", "public function save_widget_state() {\n\n\t\tcheck_ajax_referer( 'mi-admin-nonce', 'nonce' );\n\n\t\t$default = self::$default_options;\n\t\t$current_options = $this->get_options();\n\n\t\t$reports = $default['reports'];\n\t\tif ( isset( $_POST['reports'] ) ) {\n\t\t\t$reports = json_decode( sanitize_text_field( wp_unslash( $_POST['reports'] ) ), true );\n\t\t\tforeach ( $reports as $report => $reports_sections ) {\n\t\t\t\t$reports[ $report ] = array_map( 'boolval', $reports_sections );\n\t\t\t}\n\t\t}\n\n\t\t$options = array(\n\t\t\t'width' => ! empty( $_POST['width'] ) ? sanitize_text_field( wp_unslash( $_POST['width'] ) ) : $default['width'],\n\t\t\t'interval' => ! empty( $_POST['interval'] ) ? absint( wp_unslash( $_POST['interval'] ) ) : $default['interval'],\n\t\t\t'compact' => ! empty( $_POST['compact'] ) ? 'true' === sanitize_text_field( wp_unslash( $_POST['compact'] ) ) : $default['compact'],\n\t\t\t'reports' => $reports,\n\t\t\t'notice30day' => $current_options['notice30day'],\n\t\t);\n\n\t\tarray_walk( $options, 'sanitize_text_field' );\n\t\tupdate_user_meta( get_current_user_id(), 'monsterinsights_user_preferences', $options );\n\n\t\twp_send_json_success();\n\n\t}" ]
[ "0.73462313", "0.723618", "0.70732504", "0.70146304", "0.7012971", "0.6718732", "0.6687673", "0.6663015", "0.6590528", "0.65704334", "0.656078", "0.6551978", "0.65470994", "0.6532287", "0.637698", "0.6376947", "0.6240358", "0.6227925", "0.6225642", "0.6209789", "0.6204842", "0.61991364", "0.6171636", "0.61402094", "0.6129416", "0.61276203", "0.6122928", "0.61127806", "0.6108875", "0.61006147", "0.60951626", "0.60766834", "0.60707337", "0.60681385", "0.60647917", "0.6051772", "0.6050764", "0.60424966", "0.60296685", "0.602421", "0.6023037", "0.60140955", "0.60082036", "0.59964997", "0.59889394", "0.5979182", "0.596103", "0.59550184", "0.59462863", "0.5944654", "0.594029", "0.59254926", "0.59241253", "0.5905629", "0.58793753", "0.58541733", "0.5831105", "0.5827066", "0.58215785", "0.58212835", "0.58168995", "0.5809072", "0.5778714", "0.5771366", "0.57642347", "0.57623", "0.5756344", "0.5752715", "0.57494265", "0.5742936", "0.5739221", "0.5738674", "0.57326317", "0.5732077", "0.57300514", "0.57283825", "0.5726817", "0.5711388", "0.5708541", "0.56998944", "0.5697623", "0.5682072", "0.5676013", "0.56747174", "0.5671474", "0.56702274", "0.566517", "0.5662414", "0.5658161", "0.5655441", "0.5654463", "0.5653535", "0.56527317", "0.5651888", "0.56486666", "0.5648252", "0.56473935", "0.5641621", "0.56391364", "0.5639119" ]
0.69565976
5
Save the field when the value is changed on the EDD profile editor
function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) { $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : ''; $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0'; // Make sure user enters a fairaddress number if ( ! $fairsaving && ! $fairaddress ) { edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) ); } // update fairaddress number update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress ); update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile->{Yii::$app->request->post()['flag']} = Yii::$app->request->post()['val'];\n\n\t\t$updatedProfile->save();\n\t}", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function save() {\n\n $columnName = $this->profileField->internal_name;\n\n // Try create column name\n if (!Profile::model()->columnExists($columnName)) {\n $sql = \"ALTER TABLE profile ADD `\" . $columnName . \"` INT;\";\n $this->profileField->dbConnection->createCommand($sql)->execute();\n }\n\n parent::save();\n }", "function save() {\n //save the added fields\n }", "function OnAfterEdit(){\n }", "public function save()\n {\n $this->checkModel();\n if (!is_null($this->profile)) $this->saved = $this->profile->save();\n }", "public function onAfterSave();", "public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}", "protected function hook_afterSave(){}", "public function save()\n {\n update_option($this->optionKey, $this->fields);\n }", "public function afterSave(){\n\t}", "public function saveField($value) {\n return $this->setProperty('saveField', $value);\n }", "public function saveField($value) {\n return $this->setProperty('saveField', $value);\n }", "function save() {\n\t\tif ($this->input->post('contracts_show_due')) {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', $this->input->post('contracts_show_due'));\n\n\t\t}\n\n\t\telse {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', \"FALSE\");\n\n\t\t}\n\t}", "protected function afterSave() {\n\n }", "public function afterSave()\n {\n\n }", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save( $value = null ) {\n\t\t$submited_value = json_decode( stripslashes( $_REQUEST['customized'] ) );\n\t\tparent::save( explode( ',', $submited_value->{$this->field->alias} ) );\n\t\t/* dirty hack to make multiple elms on customize.php page */\n\n\t}", "public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}", "protected function _beforeSave()\n {\n $value = $this->getValue();\n $value = Mage::helper('mail/connectfields')->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "function after_save() {}", "function after_validation_on_update() {}", "public function save()\n {\n $this->user->setCulture($this->getValue('language'));\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n if (is_array($value)) {\n $value = $this->_helper->makeStorableArrayFieldValue($value);\n }\n \n $this->setValue($value);\n }", "public function save()\n {\n // Quantity is reset to 1 if it's not specified, so make sure it's included\n if (count($this->updatedFields) AND !in_array('Quantity', $this->updatedFields)) {\n $this->updatedFields[] = 'Quantity';\n }\n\n // Need to save custom fields first\n $this->saveCustom();\n parent::save();\n }", "public function save()\n {\n $db = DatabaseUtil::db_connect($this->database);\n $db->query('update ' . $this->table . 'set ' . $this->column . ' = ' . $this->value . ' where ID=' . $this->ID);\n $db->close();\n }", "public function save($model, $value, $loaded);", "public function saveEmail()\n {\n $this->validate([\n 'email' => [\n 'sometimes',\n 'required',\n 'email',\n Rule::unique(shopper_table('users'), 'email')->ignore($this->customer_id),\n ],\n ]);\n\n $this->updateValue(\n 'email',\n $this->email,\n 'Customer Email address updated successfully.'\n );\n\n $this->emailUpdate = false;\n $this->emit('profileUpdate');\n }", "public function onSaveSuccess($type, $id) {\nglobal $_LW;\nif (!isset($_LW->ENV->editors[$_LW->page])) {\n\t// if not saving from the editor, this is coming from the ->update() API and these steps can be skipped\n\treturn false;\n}\nif ($type=='events' && ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit')) { // if saving an event from the editor\n\t$_LW->setCustomFields($type, $id, ['sample_textarea'=>@$_LW->_POST['sample_textarea']], []); // store the value entered for sample_textarea, allowing the sample_textarea field full visibility (on details pages, in widget results, and /live/* requests such as /live/json)\n\t/*\n\tNote:\n \tTo optionally hide the field (i.e. store it in the database but not expose it to the public on the frontend web site or API requests, add \"sample_textarea\" to the empty array above, registering it as a hidden field).\n\tNon-hidden fields may be added to a details template via <xphp var=\"details_custom_sample_textarea\"/> or to a widget format arg via {custom_sample_textarea}.\n\t*/\n\t$_LW->setCustomFields($type, $id, ['sample_text'=>@$_LW->_POST['sample_text']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_select'=>@$_LW->_POST['sample_select']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_checkbox'=>@$_LW->_POST['sample_checkbox']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_radio'=>@$_LW->_POST['sample_radio']], []); // store the value\n};\n}", "function registrationProcess_afterSaveEdit($currentArr, &$pObj) {\n//\t\tdebug($currentArr,'$currentArr');\n//\t\tdebug($pObj,'$pObj');\n\n\t\t//notify observer\n\t\tfeusers_observer::update('update', $currentArr['uid'], $currentArr);\n\t}", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "function save()\n {\n parent::save();\n }", "public function onBeforeSave();", "protected function _postSave()\r\n\t{\r\n\t}", "public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}", "function facebook_instant_articles_field_ui_fields_save($form, &$form_state) {\n // Setup some variables.\n $entity_type = $form['#entity_type'];\n $bundle = $form['#bundle'];\n $view_mode = $form['#view_mode'];\n\n // Delete previous field configuration configuration.\n db_delete('facebook_instant_articles_field_settings')\n ->condition('entity_type', $entity_type)\n ->condition('bundle', $bundle)\n ->condition('view_mode', $view_mode)\n ->execute();\n\n if (empty($form_state['layout_saved'])) {\n return;\n }\n\n $field_settings = array();\n\n // Save settings for each field.\n $fields = $form['#fbia_fields'];\n foreach ($fields as $field) {\n\n // Field settings.\n $field_values = $form_state['values']['fields'][$field];\n\n // In case the region is hidden, do not save.\n if (isset($field_values['region']) && $field_values['region'] == 'hidden') {\n continue;\n }\n\n // Build settings.\n $settings = array();\n $settings['weight'] = $field_values['weight'];\n $settings['label'] = $field_values['label'];\n $settings['format'] = $field_values['format']['type'];\n\n // Any formatter settings.\n if (isset($form_state['formatter_settings'][$field])) {\n $settings['formatter_settings'] = $form_state['formatter_settings'][$field];\n }\n\n $field_settings[$field] = $settings;\n }\n\n // Allow other modules to modify the field settings before they get saved.\n drupal_alter('facebook_instant_articles_field_settings', $field_settings, $form, $form_state);\n\n // Save the record.\n if (!empty($field_settings)) {\n $record = new stdClass();\n $record->id = $form['#export_id'];\n $record->entity_type = $entity_type;\n $record->bundle = $bundle;\n $record->view_mode = $view_mode;\n $record->settings = $field_settings;\n drupal_write_record('facebook_instant_articles_field_settings', $record);\n }\n\n // Clear the field cache.\n cache_clear_all('facebook_instant_articles_fields:', 'cache', TRUE);\n cache_clear_all('facebook_instant_articles_field_settings', 'cache');\n}", "public function beforeSave()\n {\n $value = $this->getValue();\n $value = $this->makeStorableArrayFieldValue($value);\n $this->setValue($value);\n }", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function postSave() {}", "public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "public function setUserfield($value);", "public function save_core_field( $post_id, $field, $value ) {\n\n\t\tswitch ( $field['name'] ) {\n\n\t\t\tcase 'assignee':\n\n\t\t\t\tif ( $value !== get_post_meta( $post_id, '_dev_assignee', true ) ) {\n\t\t\t\t\tdev_assign_ticket( $post_id, $value, $field['args']['log'] );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}", "public function onsave() {\n\n\tif( filter_input( INPUT_POST, 'content' ) ) {\n\t global $post;\n do_shortcode( stripslashes( filter_input( INPUT_POST, 'content' ) ) );\n\t if( isset( $this->shortcode['elements'] ) ) {\n $this->assign_repeatable();\n }\n $meta = get_post_meta( $post->ID, 'pwp_form', true );\n $meta['definition'] = $this->shortcode;\n update_post_meta( $post->ID, 'definition', $meta );\n }\n }", "function docdirect_save_custom_user_profile_fields($user_id){\n\t\tif(!current_user_can('manage_options'))\n\t\t\treturn false;\n\t\n\t\t# save my custom field\n\t\tupdate_user_meta($user_id, 'verify_user', 'off');\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', false );\n\t}", "function save_c_p_tab_field($field){\n if (isset($_POST[$field['id']])){\n $option_value = $_POST[$field['id']];\n update_option($field['id'],$option_value);\n }else{\n delete_option($field['id']);\n }\n }", "function OnBeforeEdit(){\n }", "public function autosaved()\n {\n }", "public function save() {\n\t\t\t\n\t\t}", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "protected function onSaving()\n {\n return true;\n }", "public function preSave() {}", "protected function hook_beforeSave(){}", "function after_change()\n\t{\n\t\treturn true;\n\t}", "public function onAfterEdit($module, $page, $id) {\nglobal $_LW;\nif ($page=='events_edit' || $page=='events_sub_edit') { // if loading data for the events editor form\n\tif (!empty($_LW->is_first_load) && !empty($id)) { // if loading the editor for the first time for an existing item\n\t\tif ($fields=$_LW->getCustomFields($module, $id)) { // getCustomFields($module, $id) gets any previously saved custom data for the item of this $module and $id\n\t\t\tforeach($fields as $key=>$val) { // add previously saved data to POST data so it prepopulates in the editor form\n\t\t\t\t$_LW->_POST[$key]=$val;\n\t\t\t};\n\t\t};\n\t};\n};\nif ($page=='profiles_edit' && $_LW->_GET['tid']==1) { // if loading the profiles editor, but only for profile type with ID = 1\n\t// do something for this type only\n};\n}", "public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}", "public function updateFieldsPersonalization()\n\t{\n\t\tConfiguration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1'));\n\t\t$this->_html .= '<div class=\"conf confirm\"><img src=\"'._PS_ADMIN_IMG_.'/ok.gif\" alt=\"\" /> '.$this->l('Settings updated').'</div>';\t\t\n\t}", "public function onUpdateField()\n {\n //TODO Validate input\n\n $post = post();\n\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::updateField(\n $post['name'],\n $post['code'],\n $post['description'],\n $post['type'],\n $validation,\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }", "public function save()\r\n {\r\n \r\n }", "public function onSaving(Step $step): void\n {\n }", "public function saveEditedFieldData($field) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$field_type_id = getArrayKey($info, 'field_type_id');\n\t\t\t$guide_id = getArrayKey($info, 'guide_id');\n\t\t\t$in_search = getArrayKey($info, 'in_search');\n\t\t\t$in_filter = getArrayKey($info, 'in_filter');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\t\t\t$isRequired = getArrayKey($info, 'is_required');\n\t\t\t$restrictionId = getArrayKey($info, 'restriction_id');\n\t\t\t$isImportant = getArrayKey($info, 'is_important');\n\n\t\t\tif($field instanceof umiField) {\n\t\t\t\t$field->setTitle($title);\n\t\t\t\t$field->setName($name);\n\t\t\t\t$field->setIsVisible($is_visible);\n\t\t\t\t$field->setFieldTypeId($field_type_id);\n\t\t\t\t$field->setIsInSearch($in_search);\n\t\t\t\t$field->setIsInFilter($in_filter);\n\t\t\t\t$field->setTip($tip);\n\t\t\t\t$field->setIsRequired($isRequired);\n\t\t\t\t$field->setRestrictionId($restrictionId);\n\t\t\t\t$field->setImportanceStatus($isImportant);\n\n\t\t\t\t//Choose or create public guide for unlinked relation field\n\t\t\t\t$field_type_obj = umiFieldTypesCollection::getInstance()->getFieldType($field_type_id);\n\t\t\t\t$field_data_type = $field_type_obj->getDataType();\n\n\t\t\t\tif($field_data_type == \"relation\" && $guide_id == 0) {\n\t\t\t\t\t$guide_id = self::getAutoGuideId($title);\n\t\t\t\t}\n\n\t\t\t\tif($field_data_type == \"optioned\" && $guide_id == 0) {\n\t\t\t\t\t$parent_guide_id = umiObjectTypesCollection::getInstance()->getTypeIdByGUID('emarket-itemoption');\n\t\t\t\t\t$guide_id = self::getAutoGuideId($title, $parent_guide_id);\n\t\t\t\t}\n\n\t\t\t\t$field->setGuideId($guide_id);\n\n\t\t\t\t$field->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiField\");\n\t\t\t}\n\t\t}", "function SaveMemberEditor () {\n\n global $gSITEDOMAIN;\n\n global $gGROUPMEMBERACTION, $gGROUPMEMBERUSERNAME, $gGROUPMEMBERDOMAIN;\n\n // Loop through the action list.\n foreach ($gGROUPMEMBERACTION as $count => $action) {\n $username = $gGROUPMEMBERUSERNAME[$count];\n $domain = $gGROUPMEMBERDOMAIN[$count];\n switch ($action) {\n case GROUP_ACTION_APPROVE:\n $this->Approve ($username, $domain);\n break;\n case GROUP_ACTION_REMOVE:\n $USER = new cOLDUSER ();\n $USER->Select (\"Username\", $username);\n $USER->FetchArray ();\n if ($USER->uID != $this->userAuth_uID) {\n //$this->Leave ($username, $domain);\n } // if\n unset ($USER);\n break;\n } // switch\n } // foreach\n\n $this->Message = __(\"Member List Saved\");\n return (TRUE);\n }", "public function update_editor_value_callback() {\n\n // grab current post ID\n $post_ID = $_POST['post_ID'];\n\n // grab current editor value\n $current_editor = $_POST['current_editor'];\n\n // Update the database option\n update_post_meta( $post_ID, '_cv_active_editor', $current_editor );\n\n die();\n\n }", "protected function saveUpdate()\n {\n }", "function onSave( $editor ) {\n\t\treturn;\n\t}", "protected function _storeProfile()\n {\n $projectProfileFile = $this->_loadedProfile->search('ProjectProfileFile');\n\n $name = $projectProfileFile->getContext()->getPath();\n\n $this->_registry->getResponse()->appendContent('Updating project profile \\'' . $name . '\\'');\n\n $projectProfileFile->getContext()->save();\n }", "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "function save_custom_user_profile_fields($user_id){\n if(!current_user_can('edit_posts'))\n return false;\n\n // save my custom field\n update_user_meta($user_id, 'learner', esc_html($_POST['learner']));\n}", "function getfaircoin_edd_save_extra_profile_fields( $user_id ) {\r\n if ( ! current_user_can( 'edit_user', $user_id ) )\r\n return false;\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['_edd_user_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['_edd_user_fairsaving'] );\r\n}", "public function get_saved_value() {\n\t\treturn $this->saved_value;\n\t}", "public function saveLastName()\n {\n $this->validate(['lastName' => 'sometimes|required']);\n\n $this->updateValue(\n 'last_name',\n $this->lastName,\n 'Customer Last name updated successfully.'\n );\n\n $this->lastNameUpdate = false;\n $this->emit('profileUpdate');\n }", "public function afterSubmit() {\n\t\t$this->setValue($this->serializeData($this->getValue()));\n\t}", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "protected function onSaved()\n {\n return true;\n }", "function save() {\n $modified_fields = $this->modified_fields;\n $is_new = $this->isNew();\n\n if($is_new && ($this->getToken() == '')) {\n $this->resetToken();\n } // if\n\n $save = parent::save();\n if($save && !is_error($save)) {\n if($is_new || in_array('email', $modified_fields) || in_array('first_name', $modified_fields) || in_array('last_name', $modified_fields)) {\n $content = $this->getEmail();\n if($this->getFirstName() || $this->getLastName()) {\n $content .= \"\\n\\n\" . trim($this->getFirstName() . ' ' . $this->getLastName());\n } // if\n\n search_index_set($this->getId(), 'User', $content);\n cache_remove_by_pattern('object_assignments_*_rendered');\n } // if\n\n // Role changed?\n if(in_array('role_id', $modified_fields)) {\n clean_user_permissions_cache($this);\n } // if\n } // if\n\n return $save;\n }", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function save()\n {\n // For V2.0\n }", "public static function profile_model_saved($model) {\n\t\t$model->preference('timezone', Arr::get($_POST, 'timezone'));\n\t}", "public function preSave() { }", "public function save($name,$value) { \r\n \r\n $this->finalizeSaving($name, $value);\r\n }", "public function post_save(){\n\n }", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\n\t}", "public function save()\n {\n }", "protected function _afterSave()\n {\n if ($this->isValueChanged()) {\n Mage::getModel('core/design_package')->cleanMergedJsCss();\n }\n }", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\r\n\t}", "public final function save() {\n }", "protected function callAfterSuccessfulSave()\n\t{\n\t\tforeach($this->editFields as $f)\n\t\t{\n\t\t\t$this->getControl($f, $this->id)->afterSuccessfulSave();\n\t\t}\n\t}", "public function onSaveSuccess($type, $id) {\nglobal $_LW;\nif ($_LW->page=='groups_edit') { // if on the group editor page\n\tif ($type=='groups') { // if saving a group\n\t\tif ($this->initEMS()) { // if EMS loaded\n\t\t\t$_LW->setCustomFields($type, $id, ['ems_group'=>@$_LW->_POST['ems_group']], []); // store the value entered for ems_group\n\t\t};\n\t};\n};\n}", "public function onSave()\n\t{\n\t\t$value = $this->getValue();\n\t\tif(!empty( $value ))\n\t\t{\n\t\t\treturn $this->getLookupTable()->set(\n\t\t\t\t $this->getValue(),\n\t\t\t\t $this->getValueObject()->getKey()\n\t\t\t ) > 0;\n\t\t}\n\t\treturn false;\n\t}", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function save( $user_id ) {\r\n\t\t// Unhook action to garantee single save\r\n\t\tremove_action( 'profile_update', array( $this, '_save' ) );\r\n\r\n\t\t$this->set_user_id( $user_id );\r\n\r\n\t\tforeach ( $this->fields as $field ) {\r\n\t\t\t$field->set_value_from_input();\r\n\t\t\t$field->save();\r\n\t\t}\r\n\r\n\t\tdo_action( 'carbon_after_save_user_meta', $user_id );\r\n\t}", "public function saveFirstName()\n {\n $this->validate(['firstName' => 'sometimes|required']);\n\n $this->updateValue(\n 'first_name',\n $this->firstName,\n 'Customer First name updated successfully.'\n );\n\n $this->firstNameUpdate = false;\n $this->emit('profileUpdate');\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function save()\r\n {\r\n //\r\n }", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "function onsave(){\n\t\treturn true;\n\t}", "public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty Expiration\" for use with searching for the customID\n if (array_key_exists($updatedField, $this->customFieldMap)) {\n $realField = $this->customFieldMap[$updatedField];\n } else {\n $realField = $updatedField;\n }\n\n // Now see if Warranty Expiration is in the list of Custom fields\n if (array_key_exists($realField, $this->customFields)) {\n\n // If it is, get the ID needed for the API call\n $customID = $this->customFields[$realField];\n\n $args = [];\n $args['fieldId'] = $customID;\n // The value is stored in the main details array using WarrantyExpiration\n $args['value'] = $this->details->$updatedField;\n $args['id'] = $this->ID;\n $this->api->_request('POST', '/api/SetCustomFieldForAsset'.\"?\".http_build_query($args));\n // Remove it from the updatedFields list so the main save() doesn't try to update it\n unset($this->updatedFields[$id]);\n }\n }\n\n }" ]
[ "0.6899949", "0.6502823", "0.6432639", "0.64065826", "0.6285118", "0.6282568", "0.6278094", "0.6227341", "0.62263227", "0.62053835", "0.6190062", "0.6131143", "0.6131143", "0.6074683", "0.60573465", "0.6053664", "0.60045433", "0.5992285", "0.5988352", "0.5953267", "0.5935589", "0.59300554", "0.5929223", "0.59282875", "0.5907632", "0.5888783", "0.58701783", "0.5856189", "0.584726", "0.5839248", "0.5828031", "0.5828031", "0.5828031", "0.5818573", "0.5814003", "0.5799676", "0.579091", "0.5783417", "0.5777762", "0.57651204", "0.57462776", "0.57365566", "0.5734978", "0.5724047", "0.5722969", "0.57148725", "0.57083964", "0.5688983", "0.5681338", "0.56806993", "0.56700546", "0.5660619", "0.5649031", "0.56468314", "0.56463975", "0.5645599", "0.56428015", "0.5639337", "0.56382054", "0.5637972", "0.5637243", "0.563576", "0.56334656", "0.5629382", "0.5627906", "0.5617182", "0.56171083", "0.56145656", "0.5614143", "0.5596995", "0.5596363", "0.5595434", "0.5593849", "0.5589966", "0.55814487", "0.5580653", "0.5578326", "0.55769056", "0.55769056", "0.5575175", "0.55741787", "0.55679786", "0.5567939", "0.556747", "0.5560782", "0.55391145", "0.5537519", "0.55352426", "0.5535158", "0.55340135", "0.5528883", "0.5527803", "0.55254626", "0.5523916", "0.5522897", "0.5521516", "0.5519871", "0.5517384", "0.5516322", "0.5503715", "0.550316" ]
0.0
-1
Add the FairAddress to the "Contact Info" section on the user's WP profile page
function getfaircoin_user_contactmethods( $methods, $user ) { $methods['_edd_user_fairaddress'] = 'Faircoin Address'; $methods['_edd_user_fairsaving'] = 'FairSaving Service'; return $methods; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }", "function get_contact_address_markup() {\n\t$address = get_theme_mod( 'organization_address' );\n\tif ( !empty( $address ) ) {\n\t\tob_start();\n\t?>\n\t<address class=\"address\">\n\t\t<?php echo wptexturize( nl2br( $address ) ); ?>\n\t</address>\n\t<?php\n\t\treturn ob_get_clean();\n\t}\n\treturn;\n}", "function get_footer_address() {\n\t$street_address = '';\n\t$city = '';\n\t$postal_code = '';\n\t$country = '';\n\t/**\n\t * Check if we are in front-page:\n\t */\n\tif (is_page_template('page-templates/front-page.php')){\n\t\tif ( get_field('front_page_contact_street_address') )\n\t\t\t$street_address = get_field('front_page_contact_street_address');\n\t\tif ( get_field('front_page_contact_city') )\n\t\t\t$city = get_field('front_page_contact_city');\n\t\tif ( get_field('front_page_contact_postal_code') )\n\t\t\t$postal_code = get_field('front_page_contact_postal_code');\n\t\tif ( get_field('front_page_contact_country') )\n\t\t\t$country = get_field('front_page_contact_country');\n\t}\n\t/**\n\t * If NOT in front-page:\n\t */\n\telse {\n\t\t/**\n\t\t * Check if we are in companies page:\n\t\t */\n\t\tif (is_singular('companies')) {\n\t\t\tif ( get_field('company_contact_street_address') )\n\t\t\t\t$street_address = get_field('company_contact_street_address');\n\t\t\tif ( get_field('company_contact_city') )\n\t\t\t\t$city = get_field('company_contact_city');\n\t\t\tif ( get_field('company_contact_postal_code') )\n\t\t\t\t$postal_code = get_field('company_contact_postal_code');\n\t\t\tif ( get_field('company_contact_country') )\n\t\t\t\t$country = get_field('company_contact_country');\n\t\t}\n\t\t/**\n\t\t * Check if we are in group of companies page:\n\t\t */\n\t\tif (is_singular('group_of_companies')) {\n\t\t\tif ( get_field('group_of_companies_contact_street_address') )\n\t\t\t\t$street_address = get_field('group_of_companies_contact_street_address');\n\t\t\tif ( get_field('group_of_companies_contact_city') )\n\t\t\t\t$city = get_field('group_of_companies_contact_city');\n\t\t\tif ( get_field('group_of_companies_contact_postal_code') )\n\t\t\t\t$postal_code = get_field('group_of_companies_contact_postal_code');\n\t\t\tif ( get_field('group_of_companies_contact_country') )\n\t\t\t\t$country = get_field('group_of_companies_contact_country');\n\t\t}\n\t}\n\tif ($street_address == '' && $city == '' && $postal_code == '' && $country == '') {\n\t\t/**\n\t\t * Don't show the red marker for address.\n\t\t */\n\t}\n\telse {\n\t\t/**\n\t\t * Generate google_maps_url:\n\t\t */\n\t\t$google_maps_url = 'http://maps.google.com/?q='.$street_address.','.$city.','.$postal_code;\n\t\t?>\n\t\t<a href=\"<?php echo $google_maps_url; ?>\" class=\"contact-link\" target=\"_blank\">\n\t\t\t<img src=\"<?php echo get_template_directory_uri().'/images/icon_address.png'; ?>\" class=\"footer-icon\">\n\t\t\t<br>\n\t\t\t<span class=\"contact-street-address\"><?php echo $street_address; ?></span>\n\t\t\t<span class=\"contact-postal-code-and-city\"><?php echo $postal_code; ?> <?php echo $city; ?></span>\n\t\t\t<span class=\"contact-country\"><?php echo $country; ?></span>\n\t\t</a>\n\t\t<?php\n\t}\n}", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "function getfaircoin_edd_display_checkout_fields() { // get user's fairaddress number if they already have one stored\r\n if ( is_user_logged_in() ) {\r\n $user_id = get_current_user_id();\r\n $fairaddress = get_the_author_meta( '_edd_user_fairaddress', $user_id );\r\n $fairsaving = get_the_author_meta( '_edd_user_fairsaving', $user_id );\r\n }\r\n $fairaddress = isset( $fairaddress ) ? esc_attr( $fairaddress ) : '';\r\n $fairsaving = isset( $fairsaving ) ? esc_attr( $fairsaving ) : '0';\r\n ?>\r\n <p id=\"edd-fairsaving-wrap\">\r\n <label class=\"edd-label\" for=\"edd_fairsaving\">\r\n <?php echo _e('FairSaving Service', 'edd-getfaircoin'); ?>\r\n </label>\r\n <span class=\"edd-description\">\r\n <?php echo _e('Check this if you\\'re not managing your own wallet yet, and want the FairSaving service team to take care of it.', 'edd-getfaircoin'); ?>\r\n </span>\r\n <input class=\"edd-checkbox\" type=\"checkbox\" name=\"edd_fairsaving\" id=\"edd-fairsaving\" value=\"<?php echo $fairsaving; ?>\" onclick=\"fairsaving_hide_fairaddress(this)\" />\r\n <br />\r\n </p>\r\n <p id=\"edd-fairaddress-wrap\">\r\n <label class=\"edd-label\" for=\"edd_fairaddress\">\r\n <?php echo _e('Faircoin Address', 'edd-getfaircoin'); ?>\r\n </label>\r\n <span class=\"edd-description\">\r\n <?php echo _e('Enter your FAIR Address so we can send your Faircoins to your wallet.', 'edd-getfaircoin'); ?>\r\n </span>\r\n <input class=\"edd-input\" type=\"text\" name=\"edd_fairaddress\" id=\"edd-fairaddress\" placeholder=\"<?php echo _e('Faircoin Address', 'edd-getfaircoin'); ?>\" value=\"<?php echo $fairaddress; ?>\" />\r\n </p>\r\n <?php\r\n}", "public function contact()\n {\n add_settings_field(\n 'contact',\n apply_filters($this->plugin_name . 'label-contact', esc_html__('Contact', $this->plugin_name)),\n [$this->builder, 'text'],\n $this->plugin_name,\n $this->plugin_name . '-directives',\n [\n 'description' => 'Your contact address. Valid formats: e-mail, URL, phone number. (Required)',\n 'id' => 'contact',\n 'class' => 'text widefat hide-when-disabled',\n 'value' => isset($this->options['contact']) ? $this->options['contact'] : false,\n 'placeholder' => get_bloginfo('admin_email'),\n ]\n );\n }", "function foucs_contact_add_meta_box() {\n\tadd_meta_box(\n\t\t'contact_email', \n\t\t'User Email', \n\t\t'foucs_contact_email_callback', \n\t\t'foucs-contact', \n\t\t'side' \n\t);\n}", "function give_user_info_fields( $form_id ) {\n\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\t$title = ! empty( $give_user_info['give_title'] ) ? $give_user_info['give_title'] : '';\n\t$first_name = ! empty( $give_user_info['give_first'] ) ? $give_user_info['give_first'] : '';\n\t$last_name = ! empty( $give_user_info['give_last'] ) ? $give_user_info['give_last'] : '';\n\t$company_name = ! empty( $give_user_info['company_name'] ) ? $give_user_info['company_name'] : '';\n\t$email = ! empty( $give_user_info['give_email'] ) ? $give_user_info['give_email'] : '';\n\t$title_prefixes = give_get_name_title_prefixes( $form_id );\n\n\t/**\n\t * Fire before user personal information fields\n\t *\n\t * @since 1.7\n\t */\n\tdo_action( 'give_donation_form_before_personal_info', $form_id );\n\n\t$title_prefix_classes = '';\n\tif ( give_is_name_title_prefix_enabled( $form_id ) ) {\n\t\t$title_prefix_classes = 'give-title-prefix-wrap';\n\t}\n\t?>\n\t<fieldset id=\"give_checkout_user_info\" class=\"<?php echo esc_html( $title_prefix_classes ); ?>\">\n\t\t<legend>\n\t\t\t<?php echo esc_html( apply_filters( 'give_checkout_personal_info_text', __( 'Personal Info', 'give' ) ) ); ?>\n\t\t</legend>\n\n\t\t<?php if ( give_is_name_title_prefix_enabled( $form_id ) && is_array( $title_prefixes ) && count( $title_prefixes ) > 0 ) { ?>\n\t\t\t<p id=\"give-title-wrap\" class=\"form-row form-row-title form-row-responsive\">\n\t\t\t\t<label class=\"give-label\" for=\"give-title\">\n\t\t\t\t\t<?php esc_attr_e( 'Title', 'give' ); ?>\n\t\t\t\t\t<?php if ( give_field_is_required( 'give_title', $form_id ) ) : ?>\n\t\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t\t<?php endif ?>\n\t\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'Title is used to personalize your donation record..', 'give' ) ); ?>\n\t\t\t\t</label>\n\t\t\t\t<select\n\t\t\t\t\tclass=\"give-input required\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tname=\"give_title\"\n\t\t\t\t\tid=\"give-title\"\n\t\t\t\t\t<?php echo( give_field_is_required( 'give_title', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t\t>\n\t\t\t\t\t<?php foreach ( $title_prefixes as $key => $value ) { ?>\n\t\t\t\t\t\t<option\n\t\t\t\t\t\t\tvalue=\"<?php echo esc_html( $value ); ?>\" <?php selected( $value, $title, true ); ?>><?php echo esc_html( $value ); ?></option>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t</select>\n\t\t\t</p>\n\t\t<?php } ?>\n\n\t\t<p id=\"give-first-name-wrap\" class=\"form-row form-row-first form-row-responsive\">\n\t\t\t<label class=\"give-label\" for=\"give-first\">\n\t\t\t\t<?php esc_attr_e( 'First Name', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'give_first', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'First Name is used to personalize your donation record.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\tclass=\"give-input required\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tname=\"give_first\"\n\t\t\t\tautocomplete=\"given-name\"\n\t\t\t\tplaceholder=\"<?php esc_attr_e( 'First Name', 'give' ); ?>\"\n\t\t\t\tid=\"give-first\"\n\t\t\t\tvalue=\"<?php echo esc_html( $first_name ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'give_first', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-last-name-wrap\" class=\"form-row form-row-last form-row-responsive\">\n\t\t\t<label class=\"give-label\" for=\"give-last\">\n\t\t\t\t<?php esc_attr_e( 'Last Name', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'give_last', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'Last Name is used to personalize your donation record.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\tclass=\"give-input<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tname=\"give_last\"\n\t\t\t\tautocomplete=\"family-name\"\n\t\t\t\tid=\"give-last\"\n\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Last Name', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo esc_html( $last_name ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'give_last', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php if ( give_is_company_field_enabled( $form_id ) ) : ?>\n\t\t\t<?php $give_company = give_field_is_required( 'give_company_name', $form_id ); ?>\n\t\t\t<p id=\"give-company-wrap\" class=\"form-row form-row-wide\">\n\t\t\t\t<label class=\"give-label\" for=\"give-company\">\n\t\t\t\t\t<?php esc_attr_e( 'Company Name', 'give' ); ?>\n\t\t\t\t\t<?php if ( $give_company ) : ?>\n\t\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'Donate on behalf of Company', 'give' ) ); ?>\n\t\t\t\t</label>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"give-input<?php echo( $give_company ? ' required' : '' ); ?>\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tname=\"give_company_name\"\n\t\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Company Name', 'give' ); ?>\"\n\t\t\t\t\tid=\"give-company\"\n\t\t\t\t\tvalue=\"<?php echo esc_html( $company_name ); ?>\"\n\t\t\t\t\t<?php echo( $give_company ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t\t/>\n\t\t\t</p>\n\t\t<?php endif ?>\n\n\t\t<?php\n\t\t/**\n\t\t * Fire before user email field\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_email', $form_id );\n\t\t?>\n\t\t<p id=\"give-email-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label class=\"give-label\" for=\"give-email\">\n\t\t\t\t<?php esc_attr_e( 'Email Address', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'give_email', $form_id ) ) { ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'We will send the donation receipt to this address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\tclass=\"give-input required\"\n\t\t\t\ttype=\"email\"\n\t\t\t\tname=\"give_email\"\n\t\t\t\tautocomplete=\"email\"\n\t\t\t\tplaceholder=\"<?php esc_attr_e( 'Email Address', 'give' ); ?>\"\n\t\t\t\tid=\"give-email\"\n\t\t\t\tvalue=\"<?php echo esc_html( $email ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'give_email', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\n\t\t</p>\n\n\t\t<?php if ( give_is_anonymous_donation_field_enabled( $form_id ) ) : ?>\n\t\t\t<?php $is_anonymous_donation = isset( $_POST['give_anonymous_donation'] ) ? absint( $_POST['give_anonymous_donation'] ) : 0; ?>\n\t\t\t<p id=\"give-anonymous-donation-wrap\" class=\"form-row form-row-wide\">\n\t\t\t\t<label class=\"give-label\" for=\"give-anonymous-donation\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tclass=\"give-input<?php echo( give_field_is_required( 'give_anonymous_donation', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t\t\tname=\"give_anonymous_donation\"\n\t\t\t\t\t\tid=\"give-anonymous-donation\"\n\t\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\t\t<?php echo( give_field_is_required( 'give_anonymous_donation', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t\t\t\t<?php checked( 1, $is_anonymous_donation ); ?>\n\t\t\t\t\t>\n\t\t\t\t\t<?php\n\t\t\t\t\t/**\n\t\t\t\t\t * Filters the checkbox label.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 2.4.1\n\t\t\t\t\t */\n\t\t\t\t\techo apply_filters( 'give_anonymous_donation_checkbox_label', __( 'Make this an anonymous donation.', 'give' ), $form_id );\n\n\t\t\t\t\tif ( give_field_is_required( 'give_comment', $form_id ) ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php\n\t\t\t\t\t// Conditional tooltip text when comments enabled:\n\t\t\t\t\t// https://github.com/impress-org/give/issues/3911\n\t\t\t\t\t$anonymous_donation_tooltip = give_is_donor_comment_field_enabled( $form_id ) ? esc_html__( 'Would you like to prevent your name, image, and comment from being displayed publicly?', 'give' ) : esc_html__( 'Would you like to prevent your name and image from being displayed publicly?', 'give' );\n\n\t\t\t\t\techo Give()->tooltips->render_help( $anonymous_donation_tooltip );\n\t\t\t\t\t?>\n\n\t\t\t\t</label>\n\t\t\t</p>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( give_is_donor_comment_field_enabled( $form_id ) ) : ?>\n\t\t\t<p id=\"give-comment-wrap\" class=\"form-row form-row-wide\">\n\t\t\t\t<label class=\"give-label\" for=\"give-comment\">\n\t\t\t\t\t<?php _e( 'Comment', 'give' ); ?>\n\t\t\t\t\t<?php if ( give_field_is_required( 'give_comment', $form_id ) ) { ?>\n\t\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t\t<?php } ?>\n\t\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'Would you like to add a comment to this donation?', 'give' ) ); ?>\n\t\t\t\t</label>\n\n\t\t\t\t<textarea\n\t\t\t\t\tclass=\"give-input<?php echo( give_field_is_required( 'give_comment', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t\tname=\"give_comment\"\n\t\t\t\t\tplaceholder=\"<?php _e( 'Leave a comment', 'give' ); ?>\"\n\t\t\t\t\tid=\"give-comment\"\n\t\t\t\t\t<?php echo( give_field_is_required( 'give_comment', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t\t><?php echo isset( $_POST['give_comment'] ) ? give_clean( $_POST['give_comment'] ) : ''; ?></textarea>\n\n\t\t\t</p>\n\t\t<?php endif; ?>\n\t\t<?php\n\t\t/**\n\t\t * Fire after user email field\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_after_email', $form_id );\n\n\t\t/**\n\t\t * Fire after personal email field\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_user_info', $form_id );\n\t\t?>\n\t</fieldset>\n\t<?php\n\t/**\n\t * Fire after user personal information fields\n\t *\n\t * @since 1.7\n\t */\n\tdo_action( 'give_donation_form_after_personal_info', $form_id );\n}", "function wooadmin_my_custom_userfields( $contactmethods ) {\n\n //Adds customer contact details\n\n $contactmethods['company_name'] = 'Customer Note';\n\n return $contactmethods;\n\n }", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "function getfaircoin_edd_save_extra_profile_fields( $user_id ) {\r\n if ( ! current_user_can( 'edit_user', $user_id ) )\r\n return false;\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['_edd_user_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['_edd_user_fairsaving'] );\r\n}", "function ywig_company_address_1_callback() {\n\techo '<p class=\"description\">Company Address Line 1</p><input type=\"text\" name=\"company_address_1\" value=\"' . esc_html( get_option( 'company_address_1' ) ) . '\" placeholder=\"Company Address 1\" />';\n}", "function storefront_footer_site_info()\n {\n ?>\n <div class=\"content-copyright text-center\" itemprop=\"streetAddress\">Central Jakarta, Indonesia</div>\n <div class=\"content-copyright text-center\">Developed by <a target=\"_blank\" href=\"https://taufiqelrahman.com\">taufiqelrahman.com</a>.</div>\n <?php\n }", "function address_box_callback( $post ) {\n\twp_nonce_field( 'contact_address', 'contact_address_nonce' );\n ?>\n <textarea id=\"contact_address\" style=\"display:block; width: 100%; height: 200px;\"><?php echo get_post_meta($post->ID, 'contact_address', true);?></textarea>\n <?php\n}", "public static function editProfile( $address, $phone, $mail){\n\t}", "function ywig_company_address_2_callback() {\n\techo '<p class=\"description\">Company Address Line 2</p><input type=\"text\" name=\"company_address_2\" value=\"' . esc_html( get_option( 'company_address_2' ) ) . '\" placeholder=\"Company Address 2\" />';\n}", "function profile_cct_add_secondary_address_fields_filter($type_of= null){\n\t// if(in_array($type_of, array('page','list')) )\n\tadd_filter( 'profile_cct_dynamic_fields', 'profile_cct_add_secondary_address_fields' );\n\t\t\n\tadd_action('profile_cct_display_shell_secondary_address', 'profile_cct_address_display_shell',10, 3);\n\tadd_action('profile_cct_field_shell_secondary_address', 'profile_cct_address_field_shell',10, 3);\n\t\n}", "function ywig_company_address_3_callback() {\n\techo '<p class=\"description\">Company Address Line 3</p><input type=\"text\" name=\"company_address_3\" value=\"' . esc_html( get_option( 'company_address_3' ) ) . '\" placeholder=\"Company Address 3\" />';\n}", "function give_default_cc_address_fields( $form_id ) {\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give_cc_address\" class=\"cc-address\">\n\t\t<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, before address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_top' );\n\n\t\t// For Country.\n\t\t$selected_country = give_get_country();\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\t\t$countries = give_get_country_list();\n\n\t\t// For state.\n\t\t$selected_state = '';\n\t\tif ( $selected_country === give_get_country() ) {\n\t\t\t// Get default selected state by admin.\n\t\t\t$selected_state = give_get_state();\n\t\t}\n\t\t// Get the last payment made by user states.\n\t\tif ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {\n\t\t\t$selected_state = $give_user_info['card_state'];\n\t\t}\n\t\t// Get the country code.\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\n\n\t\t// Get the country list that does not require city.\n\t\t$city_required = ! array_key_exists( $selected_country, give_city_not_required_country_list() );\n\n\t\t?>\n\t\t<p id=\"give-card-country-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"billing_country\" class=\"give-label\">\n\t\t\t\t<?php esc_html_e( 'Country', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\n\t\t\t<select\n\t\t\t\tname=\"billing_country\"\n\t\t\t\tautocomplete=\"country\"\n\t\t\t\tid=\"billing_country\"\n\t\t\t\tclass=\"billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $countries as $country_code => $country ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 1', 'give' ); ?>\n\t\t\t\t<?php\n\t\t\t\tif ( give_field_is_required( 'card_address', $form_id ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The primary billing address for your credit card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address\"\n\t\t\t\tname=\"card_address\"\n\t\t\t\tautocomplete=\"address-line1\"\n\t\t\t\tclass=\"card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 1', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-2-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address_2\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 2', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( '(optional) The suite, apartment number, post office box (etc) associated with your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address_2\"\n\t\t\t\tname=\"card_address_2\"\n\t\t\t\tautocomplete=\"address-line2\"\n\t\t\t\tclass=\"card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 2', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-city-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_city\" class=\"give-label\">\n\t\t\t\t<?php _e( 'City', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator <?php echo( $city_required ? '' : 'give-hidden' ); ?>\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The city for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_city\"\n\t\t\t\tname=\"card_city\"\n\t\t\t\tautocomplete=\"address-level2\"\n\t\t\t\tclass=\"card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'City', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo( isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_city', $form_id ) && $city_required ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php\n\t\t/**\n\t\t * State field logic.\n\t\t */\n\t\t$state_label = __( 'State', 'give' );\n\t\t$states_label = give_get_states_label();\n\t\t// Check if $country code exists in the array key for states label.\n\t\tif ( array_key_exists( $selected_country, $states_label ) ) {\n\t\t\t$state_label = $states_label[ $selected_country ];\n\t\t}\n\t\t$states = give_get_states( $selected_country );\n\t\t// Get the country list that do not have any states.\n\t\t$no_states_country = give_no_states_country_list();\n\t\t// Get the country list that does not require states.\n\t\t$states_not_required_country_list = give_states_not_required_country_list();\n\t\t// Used to determine if state is required.\n\t\t$require_state = ! array_key_exists( $selected_country, $no_states_country ) && give_field_is_required( 'card_state', $form_id );\n\t\t// Used to determine is state input should be marked as required.\n\t\t$validate_state = ! array_key_exists( $selected_country, $states_not_required_country_list ) && give_field_is_required( 'card_state', $form_id );\n\n\t\t?>\n\t\t<p id=\"give-card-state-wrap\"\n\t\t class=\"form-row form-row-first form-row-responsive <?php echo ( ! empty( $selected_country ) && ! $require_state ) ? 'give-hidden' : ''; ?> \">\n\t\t\t<label for=\"card_state\" class=\"give-label\">\n\t\t\t\t<span class=\"state-label-text\"><?php echo $state_label; ?></span>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"give-required-indicator <?php echo $validate_state ? '' : 'give-hidden'; ?> \">*</span>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\t\t\t<?php\n\n\t\t\tif ( ! empty( $states ) ) :\n\t\t\t\t?>\n\t\t\t\t<select\n\t\t\t\t\tname=\"card_state\"\n\t\t\t\t\tautocomplete=\"address-level1\"\n\t\t\t\t\tid=\"card_state\"\n\t\t\t\t\tclass=\"card_state give-select<?php echo $validate_state ? ' required' : ''; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $states as $state_code => $state ) {\n\t\t\t\t\t\techo '<option value=\"' . $state_code . '\"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t<?php else : ?>\n\t\t\t\t<input type=\"text\" size=\"6\" name=\"card_state\" id=\"card_state\" class=\"card_state give-input\"\n\t\t\t\t placeholder=\"<?php echo $state_label; ?>\" value=\"<?php echo $selected_state; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>\n\t\t\t\t/>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\n\t\t<p id=\"give-card-zip-wrap\" class=\"form-row <?php echo $require_state ? 'form-row-last' : ''; ?> form-row-responsive\">\n\t\t\t<label for=\"card_zip\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Zip / Postal Code', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The zip or postal code for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tsize=\"4\"\n\t\t\t\tid=\"card_zip\"\n\t\t\t\tname=\"card_zip\"\n\t\t\t\tautocomplete=\"postal-code\"\n\t\t\t\tclass=\"card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Zip / Postal Code', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, after address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_bottom' );\n\t\t?>\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}", "function ganesh_contact_add_meta_box(){\r\n\tadd_meta_box('contact_email', 'User Email', 'ganesh_contact_email_callback', 'ganesh-contact', 'normal', 'high');\t\r\n}", "public function mtii_utilities_show_extra_profile_fields($user) {\n $gender = get_the_author_meta('gender', $user->ID);\n $gender_label = $gender=='' ? 'Pick a Gender' : $gender;\n $phone_number = get_the_author_meta('phone_number', $user->ID);\n $state_city = get_the_author_meta('state_city', $user->ID);\n ?>\n <h3><?php esc_html_e('Personal Information (for Mtii Utilities User)', 'mtii-utilities-josbiz'); ?></h3>\n\n <table class=\"form-table\">\n <tr>\n <th>\n <label for=\"gender\"><?php _e( 'Gender', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <select name=\"gender\" id=\"gender\" class=\"input\">\n <option disabled value=\"<?php _e($gender, 'mtii-utilities-josbiz'); ?>\"><?php echo $gender_label; ?></option>\n <option value=\"<?php _e('Male', 'mtii-utilities-josbiz'); ?>\">Male</option>\n <option value=\"<?php _e('Female', 'mtii-utilities-josbiz'); ?>\">Female</option>\n </select>\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"phone_number\"><?php _e( 'Phone Number', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"number\" name=\"phone_number\" id=\"phone_number\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($phone_number)); ?>\" size=\"25\" />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"state_city\"><?php _e( 'State/City', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"text\" name=\"state_city\" id=\"state_city\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($state_city)); ?>\" size=\"25\" />\n </td>\n </tr>\n </table>\n <?php\n }", "public function _settings_field_contact_form_details() {\n global $zendesk_support;\n $value = $zendesk_support->_is_default( 'contact_form_details' ) ? '' : $zendesk_support->settings['contact_form_details'];\n ?>\n <input type=\"text\" class=\"regular-text\" name=\"zendesk-settings[contact_form_details]\" value=\"<?php echo $value; ?>\"\n placeholder=\"<?php echo $zendesk_support->default_settings['contact_form_details']; ?>\"/>\n <?php\n }", "function get_primary_contact_details() : array {\n\n\treturn array(\n\t\tarray(\n\t\t\t'icon' => 'map-marker-alt',\n\t\t\t'title' => 'OFFICE',\n\t\t\t'value' => get_theme_mod( 'address_primary' ),\n\t\t),\n\t\tarray(\n\t\t\t'icon' => 'phone',\n\t\t\t'title' => 'PHONE',\n\t\t\t'value' => get_theme_mod( 'phone_primary' ),\n\t\t),\n\t\tarray(\n\t\t\t'icon' => 'envelope',\n\t\t\t'title' => 'EMAIL ADDRESS',\n\t\t\t'value' => get_theme_mod( 'email_primary' ),\n\t\t),\n\t\tarray(\n\t\t\t'icon' => 'business-time',\n\t\t\t'title' => 'OPENING HOURS',\n\t\t\t'value' => get_theme_mod( 'working_hrs_primary' ),\n\t\t),\n\t);\n\n}", "public function sender_info_section() {\n \n ?><p><?php _e( 'Information about sender header', JPEN_DOMAIN ); ?></p><?php\n\n add_settings_field( \n 'jpen_smtp_from', \n __( 'SMTP From', JPEN_DOMAIN ), \n [ $this, 'smtp_from_field' ], \n $this->page_slug, \n 'jpen_sender_info', \n array(\n 'label_for' => 'jpen_smtp_from',\n 'default' => 'example@email.com',\n ) \n );\n\n add_settings_field( \n 'jpen_smtp_name', \n __( 'SMTP Name', JPEN_DOMAIN ), \n [ $this, 'smtp_name_field' ], \n $this->page_slug, \n 'jpen_sender_info', \n array(\n 'label_for' => 'jpen_smtp_name',\n 'default' => \"Sender Name\",\n ) \n );\n }", "function add_to_author_profile( $contactmethods ) {\n \n $contactmethods['rss_url'] = 'RSS URL';\n $contactmethods['google_profile'] = 'Google Profile URL';\n $contactmethods['twitter_profile'] = 'Twitter Profile URL';\n $contactmethods['facebook_profile'] = 'Facebook Profile URL';\n $contactmethods['linkedin_profile'] = 'Linkedin Profile URL';\n $contactmethods['github_profile'] = 'github_profile URL';\n \n return $contactmethods;\n }", "function modify_contact_methods($profile_fields) {\n\n // Add new fields\n $profile_fields['publication'] = 'Publication';\n $profile_fields['display_title'] = 'Title (i.e.: \\'Editor\\'; leave blank to not display)';\n $profile_fields['instagram'] = 'Instagram username';\n $profile_fields['email_public'] = 'Public E-mail address (displayed on site)';\n\n return $profile_fields;\n}", "function clea_base_custom_address( $wp_customize ) {\n\t\n\t/* Get the theme prefix. */\n\t$prefix = hybrid_get_prefix();\n\t\n\t$ald_description = __( \"Les coordonnées qui apparaissent dans l'en-tête, à droite\" );\t\n\t\n\t\t/* Add the test textarea section. */\n\t\t$wp_customize->add_section(\n\t\t\t'unique-impact-1-address',\n\t\t\tarray(\n\t\t\t\t'title' \t=> esc_html__( 'Coordonnées', 'clea-base' ),\n\t\t\t\t'priority' \t=> 200,\n\t\t\t\t'capability' \t=> 'edit_theme_options',\n\t\t\t\t'description'\t=> $ald_description\n\t\t\t)\n\t\t);\n\n\t/** demander Adresse **/\n\t$wp_customize->add_setting( \n\t\t\"{$prefix}_theme_settings[adresse]\", \n\t\tarray(\n\t\t\t'type' \t=> 'option',\n\t\t\t'default' => 'Adresse 22222 ville',\n\t\t\t'sanitize_callback' => 'clea_base_address_sanitize',\n\t\t)\n\t);\t\n\n\t$wp_customize->add_control(\n \"{$prefix}_theme_settings[adresse]\",\n\t\tarray(\n\t\t\t'label' => __('Adresse en une ligne', 'clea-base'),\n\t\t\t'section' => 'unique-impact-1-address',\n\t\t\t'type' => 'text',\n\t\t)\n\t);\t\n\n\t\t\n\t/** demander Téléphone **/\n\t$wp_customize->add_setting( \n\t\t\"{$prefix}_theme_settings[telephone]\", \n\t\tarray(\n\t\t\t'type' \t=> 'option',\n\t\t\t'default' => '00 00 00 00',\n\t\t\t'sanitize_callback' => 'clea_base_address_sanitize',\n\t\t)\n\t);\t\n\n\t$wp_customize->add_control(\n \"{$prefix}_theme_settings[telephone]\",\n\t\tarray(\n\t\t\t'label' => __('Téléphone', 'clea-base'),\n\t\t\t'section' => 'unique-impact-1-address',\n\t\t\t'type' => 'text',\n\t\t)\n\t);\t\n\t\n\t\t\n\t/** demander Adresse **/\n\t$wp_customize->add_setting( \n\t\t\"{$prefix}_theme_settings[mail]\", \n\t\tarray(\n\t\t\t'type' \t=> 'option',\n\t\t\t'default' => 'nnn.gggggg@test.com',\n\t\t\t'sanitize_callback' => 'clea_base_address_sanitize',\n\t\t)\n\t);\t\n\n\t$wp_customize->add_control(\n \"{$prefix}_theme_settings[mail]\",\n\t\tarray(\n\t\t\t'label' => __('E-mail (sera crypté)', 'clea-base'),\n\t\t\t'section' => 'unique-impact-1-address',\n\t\t\t'type' => 'text',\n\t\t)\n\t);\t\t\n}", "function _wp_credits_add_profile_link(&$display_name, $username, $profiles)\n {\n }", "function display_contact() {\n ?>\n <p>All messages from contact page will be redirected to this email:</p>\n </br>\n <input \n type=\"email\" \n name=\"contact_email\"\n value=\"<?php echo esc_attr( get_option('contact_email') ); ?>\" \n \n /> \n <?php\n}", "function devindavid_add_site_info() {\n\t\t\n\t\t$site_info = sprintf(\n\t\t\t\n\t\t\t'<div id=\"copyrights\" class=\"noselect\">\n\t\t\t<span>©%1$s </span>\n\t\t\t<span class=\"footerLogo\" style=\"margin: 0 0 0 6px; display:inline-block; color:transparent;\">%2$s</span>\n\t\t\t</div>',\n\t\t\t\n\t\t\tsprintf( esc_html__( '%s', 'devindavid' ),\n\t\t\t\t'2021'\n\t\t\t),\n\t\t\tsprintf( esc_html__( '%s', 'devindavid' ),\n\t\t\t\t'Devin David'\n\t\t\t)\n\t\t);\n\n\t\techo apply_filters( 'devindavid_site_info_content', $site_info ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t}", "function voyage_mikado_add_user_custom_fields($user_contact) {\n\n /**\n * Function that add custom user fields\n **/\n $user_contact['position'] = esc_html__('Position', 'voyage');\n $user_contact['instagram'] = esc_html__('Instagram', 'voyage');\n $user_contact['twitter'] = esc_html__('Twitter', 'voyage');\n $user_contact['pinterest'] = esc_html__('Pinterest', 'voyage');\n $user_contact['tumblr'] = esc_html__('Tumbrl', 'voyage');\n $user_contact['facebook'] = esc_html__('Facebook', 'voyage');\n $user_contact['googleplus'] = esc_html__('Google Plus', 'voyage');\n $user_contact['linkedin'] = esc_html__('Linkedin', 'voyage');\n\n return $user_contact;\n }", "function classiera_author_new_contact( $contactmethods ) {\r\n\r\n\t// Add telephone\r\n\t$contactmethods['phone'] = esc_html__( 'Phone', 'classiera');\r\n\t$contactmethods['phone2'] = esc_html__( 'Mobile', 'classiera');\t\r\n\t// add address\r\n\t$contactmethods['address'] = esc_html__( 'Address', 'classiera');\t\r\n\t// add social\r\n\t$contactmethods['facebook'] = esc_html__( 'Facebook', 'classiera');\r\n\t$contactmethods['twitter'] = esc_html__( 'Twitter', 'classiera');\r\n\t$contactmethods['googleplus'] = esc_html__( 'Google Plus', 'classiera');\r\n\t$contactmethods['linkedin'] = esc_html__( 'Linkedin', 'classiera');\r\n\t$contactmethods['pinterest'] = esc_html__( 'Pinterest', 'classiera');\r\n\t$contactmethods['vimeo'] = esc_html__( 'vimeo', 'classiera');\r\n\t$contactmethods['youtube'] = esc_html__( 'YouTube', 'classiera');\r\n\t$contactmethods['country'] = esc_html__( 'Country', 'classiera');\r\n\t$contactmethods['state'] = esc_html__( 'State', 'classiera');\r\n\t$contactmethods['city'] = esc_html__( 'City', 'classiera');\r\n\t$contactmethods['postcode'] = esc_html__( 'Postcode', 'classiera');\r\n \r\n\treturn $contactmethods;\r\n\t\r\n}", "public function meta_box_address( $post ) {\n\t\t\t?>\n\t\t\t<input id=\"meetup[town]\" name=\"meetup[town]\" type=\"text\" value=\"<?php echo $meetup_meta[ 'town' ]; ?>\" tabindex=\"1\" style=\"float: right;\" />\n\t\t\t<label for=\"meetup[town]\" style=\"display: block; float: right; padding: 5px 7px 0;\">Stadt</label>\n\t\t\t<br class=\"clear\" />\n\t\t\t<input id=\"meetup[plz]\" name=\"meetup[plz]\" type=\"text\" value=\"<?php echo $meetup_meta[ 'plz' ]; ?>\" tabindex=\"1\" style=\"float: right;\" />\n\t\t\t<label for=\"meetup[plz]\" style=\"display: block; float: right; padding: 5px 7px 0;\">Postleitzahl</label>\n\t\t\t<br class=\"clear\" />\n\t\t\t<input id=\"meetup[street]\" name=meetup[street] type=\"text\" value=\"<?php echo $meetup_meta[ 'street' ]; ?>\" tabindex=\"1\" style=\"float: right;\" />\n\t\t\t<label for=\"meetup[street]\" style=\"display: block; float: right; padding: 5px 7px 0;\">Strasse</label>\n\t\t\t<br class=\"clear\" />\n\t\t\t<input id=\"meetup[number]\" name=\"meetup[number]\" type=\"text\" value=\"<?php echo $meetup_meta[ 'number' ]; ?>\" tabindex=\"1\" style=\"float: right;\" />\n\t\t\t<label for=\"meetup[number]\" style=\"display: block; float: right; padding: 5px 7px 0;\">Nummer</label>\n\t\t\t<br class=\"clear\" />\n\t\t\t<?php\t\n\t\t}", "function hook_openid_connect_userinfo_alter(array &$userinfo, array $context) {\n // Add some custom information.\n if ($context['plugin_id'] == 'generic') {\n $userinfo['my_info'] = [\n 'full_name' => $userinfo['first_name'] . ' ' . $userinfo['last_name'],\n 'remarks' => 'Information provided by generic client plugin.',\n ];\n }\n}", "function itstar_extra_user_profile_fields( $user ) {\n?>\n <h3><?php _e(\"Extra profile information\", \"itstar\"); ?></h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"birthday\"><?php echo __(\"birthday\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthday\" id=\"Birth Day\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthday' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birthday.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthmonth\"><?php echo __(\"Birth Month\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthmonth\" id=\"birthmonth\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthmonth' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Month.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthyear\"><?php echo __(\"Birth Year\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthyear\" id=\"birthyear\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthyear' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Year.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"phone\"><?php echo __(\"Phone\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"phone\" id=\"phone\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'phone',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your phone.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"job\"><?php echo __(\"Job\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"job\" id=\"job\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'job',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Job.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"viraclub\"><?php __(\"Vira club ID\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" disabled name=\"viraclub\" id=\"viraclub\" class=\"regular-text\" \n value=\"<?php echo 'V'.esc_attr( get_user_meta( $user->ID,'viraclub' ,true) ); ?>\" /><br />\n \n </td>\n </tr>\n </table>\n<?php\n}", "function add_prof_field($contactmethods) {\n\t$contactmethods['twitter'] = 'Twitter';\n\t$contactmethods['facebook'] = 'Facebook';\n\treturn $contactmethods;\n}", "function _s_modify_user_contact_methods( $user_contact ) {\n\t$user_contact['facebook'] = __( 'Facebook URL' );\n\t$user_contact['twitter'] = __( 'Twitter URL' );\n $user_contact['instagram'] = __( 'Instagram URL' );\n $user_contact['youtube'] = __( 'YouTube URL' );\n \n\treturn $user_contact;\n}", "function addProfileFields($user) {\n\t\tif($this->checkPermissions()) {\n\t\t\techo '<h3>LePress Teacher</h3>';\n\t\t\techo '<table class=\"form-table\">';\n\t\t\techo '<tr>';\n\t\t\techo\t'<th><label for=\"lepress-organization\">'.__('Organization', lepress_textdomain).'</label></th>';\n\t\t\techo '<td><input type=\"text\" name=\"lepress-organization\" id=\"lepress-organization\" value=\"'.esc_attr( get_the_author_meta( 'lepress-organization', $user->ID)).'\" class=\"regular-text\"/><br />';\n\t\t\techo '<span class=\"description\">'.__('Your organization - university, college, high school, primary school etc..', lepress_textdomain).'</span></td>';\n\t\t\techo '</tr></table>';\n\t\t}\n\t}", "function loccontact_meta_box() {\n\t\tglobal $post;\n\t\techo '<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_telephone\">' . __( 'Telephone', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_telephone\" type=\"text\" id=\"location_contact_telephone\" value=\"' . get_post_meta( $post->ID, '_location_contact_telephone', true ) . '\" class=\"regular-text\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_email\">' . __( 'Email', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_email\" type=\"text\" id=\"location_contact_email\" value=\"' . get_post_meta( $post->ID, '_location_contact_email', true ) . '\" class=\"regular-text\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_web\">' . __( 'Web', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_web\" type=\"text\" id=\"location_contact_web\" value=\"' . get_post_meta( $post->ID, '_location_contact_web', true ) . '\" class=\"regular-text\" placeholder=\"http://\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>';\n\t\twp_nonce_field( 'update_location_contact', '_nonce_location_contact' );\n\t}", "function display_custom_info_fields(){\n\t\n\tadd_settings_section(\"section\", \"Virksomhedsinformation\", null, \"theme-options\");\n\n add_settings_field(\"business_name\", \"Virksomhedsnavn\", \"display_business_name_element\", \"theme-options\", \"section\");\n\tadd_settings_field(\"support_phone\", \"Support Telefon\", \"display_support_phone_element\", \"theme-options\", \"section\");\n\tadd_settings_field(\"support_email\", \"Support Email\", \"display_support_email_element\", \"theme-options\", \"section\");\n\tadd_settings_field(\"street_address\", \"Gade\", \"display_street_address_element\", \"theme-options\", \"section\");\n\tadd_settings_field(\"city\", \"By og postnummer\", \"display_city_element\", \"theme-options\", \"section\");\n\n register_setting(\"section\", \"business_name\");\n\tregister_setting(\"section\", \"support_phone\");\n\tregister_setting(\"section\", \"support_email\");\n\tregister_setting(\"section\", \"street_address\");\n\tregister_setting(\"section\", \"city\");\n\t\n}", "function add_custom_info_menu_item(){\n\t\n\tadd_options_page(\"Virksomhedsinformation\", \"Virksomhedsinformation\", \"manage_options\", \"contact-info\", \"theme_settings_page\");\n\t\n}", "public function all_social_address_info(){\r\n $query = \"SELECT * FROM tbl_contact_us_social_address\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "function medigroup_mikado_add_user_custom_fields($user_contact) {\n\n /**\n * Function that add custom user fields\n **/\n $user_contact['position'] = esc_html__('Position', 'medigroup');\n $user_contact['instagram'] = esc_html__('Instagram', 'medigroup');\n $user_contact['twitter'] = esc_html__('Twitter', 'medigroup');\n $user_contact['pinterest'] = esc_html__('Pinterest', 'medigroup');\n $user_contact['tumblr'] = esc_html__('Tumbrl', 'medigroup');\n $user_contact['facebook'] = esc_html__('Facebook', 'medigroup');\n $user_contact['google-plus'] = esc_html__('Google Plus', 'medigroup');\n $user_contact['linkedin'] = esc_html__('Linkedin', 'medigroup');\n\n return $user_contact;\n }", "function contact_fields() {\n\t\n?>\t<div class=\"contact-address two-fifths first\" >\n\n\t<?php\n\techo do_shortcode('[contact-card]');//}\n\t ?>\n\t\t\n\t\t</div> \n\t\t\n\t\t<div class=\"three-fifths\"> <?php\tif( get_field('contact_page_message') ): \n\t\t\t the_field('contact_page_message'); \n\t\tendif; \n\t\t\t\n\t\t\n\t\techo do_shortcode('[contact]' );?>\n\t\t\n\t\t</div><?php\n\t\n\t\t\n\t\t}", "function ve_get_contact_us_section() {\n\t$background_color = \"#40bfc7\";\n\t$text_color = \"#ffffff\";\n\tif (get_field('contact_background_color')) {\n\t\t$background_color = get_field('contact_background_color');\n\t}\n\tif (get_field('contact_text_color')) {\n\t\t$text_color = get_field('contact_text_color');\n\t}\n\t?>\n\t<div class=\"full-width contact-us-section padded-top-bottom dark-grey-bg\" style=\"background-color: <?php echo $background_color;?>\">\n\t\t<div class=\"container\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-lg-12 text-center padded-bottom\">\n\t\t\t\t<span class=\"section-title-text white-text\" id=\"contact-us-title\" style=\"color: <?php echo $text_color; ?>\">\n\t\t\t\t\t<?php echo __('Contact Us', 'threedee-expo') ?>\n\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<?php get_contact_form(); ?>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\n}", "function register_contact_in_theme_settings_fields() {\n add_settings_section(\"contact-section\", \"Contact\", null, \"contact-options\");\n add_settings_field(\"contact_email\", \"Email Address\", \"display_contact\", \"contact-options\", \"contact-section\");\n add_settings_field(\"contact_google_key\", \"ReCaptcha API key\", \"display_contact_google_key\", \"contact-options\", \"contact-section\");\n \n $args = array(\n 'type' => 'string', \n 'default' => NULL,\n );\n\n register_setting(\"contact-section\", \"contact_email\", $args);\n register_setting(\"contact-section\", \"contact_google_key\", $args);\n}", "public function property_address() {\n\n\t\t\t$out = '<h6>Business Name:</strong></h6>';\n\t\t\t$out .= '<p>' . get_field( 'practice_name' ) . '</p>';\n\t\t\t$out .= '<h6>Address:</h6>';\n\t\t\t$out .= '<p>' . get_field( 'address_street' ) . '<br/>';\n\t\t\t$out .= get_field( 'address_city' ) . ', ' . get_field( 'address_state' ) . ' ' . get_field( 'address_postcode' ) . '</p>';\n\n\t\t\treturn $out;\n\t\t}", "function netfunktheme_contact_meta( $atts ){\n\t\n\textract( shortcode_atts( array(\n\t\t'user_id' => '0',\n\t), $atts ) );\n\t\n\t$html_out = '';\n\t\n\tif ($atts['user_id'] != 0) {\n\n\t\t$html_out = '<div class=\"small-12 lb-shortcode-meta lb_contact_meta\">'\n\n\t\t//. '<div class=\"panel radius\">'\n\n\t\t. '<table cellpadding=\"4\" callspacing=\"0\" border=\"0\" width=\"100%\" class=\"contact_meta_table\">'\n\n\t\t. '<tr><td align=\"right\" valign=\"top\">'\n\n\t\t. '<strong>Email: </strong></td><td align=\"left\">' \n\t\t\n\t\t. '<a href=\"mailto:' . get_the_author_meta('user_email',$atts['user_id']) . '\">'\n\t\t\n\t\t. get_the_author_meta('user_email',$atts['user_id']) \n\t\t\n\t\t. '</a>'\n\t\t\n\t\t. '</td></tr><tr><td align=\"right\" valign=\"top\">'\n\t\t\n\t\t. '<strong>Phone: </strong></td><td align=\"left\">' . get_the_author_meta('lb_phone',$atts['user_id']) . '</td></tr><tr><td align=\"right\" valign=\"top\">'\n\t\t\n\t\t. '<strong>Cell: </strong></td><td align=\"left\">' . get_the_author_meta('lb_cell',$atts['user_id']) . '</td></tr><tr><td align=\"right\" valign=\"top\">'\n\t\t\n\t\t. '<strong>Fax: </strong></td><td align=\"left\">' . get_the_author_meta('lb_fax',$atts['user_id']) . '</td></tr><tr><td align=\"right\" valign=\"top\">'\n\t\t\n\t\t. '<strong>Address: </strong></td><td align=\"left\">' \n\t\t\n\t\t\t. get_the_author_meta('lb_company',$atts['user_id']) . '<br />'\n\t\t\t\n\t\t\t. get_the_author_meta('lb_address',$atts['user_id']) . ', <br />'\n\t\t\t\n\t\t\t. get_the_author_meta('lb_city',$atts['user_id']) . ', ' \n\t\t\t\n\t\t\t. get_the_author_meta('lb_state',$atts['user_id']) . ' ' \n\t\t\t\n\t\t\t. get_the_author_meta('lb_zip',$atts['user_id']) . '<br />' \n\t\t\t\n\t\t\t. get_the_author_meta('lb_country',$atts['user_id']) \n\t\t\t\n\n\t\t. '</td></tr>'\t\n\t\t\n\t\t. '</table>'\n\t\t\n\t\t//. '</div>'\n\t\t\n\t\t. '</div>';\n\n\t}\n\t\n\treturn $html_out;\n\t\n}", "public function contactInfo($atts)\n {\n $adres = get_option('adres');\n $postcode = get_option('postcode');\n $woonplaats = get_option('woonplaats');\n $tel = get_option('telefoon');\n $mail = get_option('email');\n\n $smOptions = explode(',', SOCIAL_MEDIA_OPTIONS);\n\n $class = '';\n if (!empty($atts['class'])) {\n $class = $atts['class'];\n }\n\n $ra_start = '<ul class=\"contactInfo ' . $class . '\">';\n $ra_end = '</ul>';\n $ra = array(\n 'adres' => '<li class=\"adres\">' . $adres . '</li>' . '<li class=\"adres2\">' . $postcode . ' ' . $woonplaats . '</li>',\n 'tel' => '<li class=\"tel\">' . $tel . '</li>',\n 'mail' => '<li class=\"mail\"><a href=\"mailto:' . $mail . '\">' . $mail . '</a></li>',\n );\n\n foreach ($smOptions as $socialChannel) {\n $option = get_option($socialChannel);\n if ($option == true && $option !== '') {\n $option = str_replace('http://', '', $option);\n $option = str_replace('https://', '', $option);\n $ra[$socialChannel] = '<li class=\"social ' . $socialChannel . '\"><a href=\"//' . $option . '\" title=\"' . $socialChannel . ' pagina\" target=\"_blank\">' . $socialChannel . '</a></li>';\n }\n }\n\n if (!empty($atts['include'])) {\n $items = explode(',', $atts['include']);\n $rs = $ra_start;\n foreach ($items as $item) {\n // trim and lower\n $item = strtolower(trim($item));\n \n foreach ($ra as $name => $returnItem) {\n if ($item == $name) {\n $rs .= $returnItem;\n }\n }\n }\n $rs .= $ra_end;\n\n } else if (!empty($atts['exclude'])) {\n $items = explode(',', $atts['exclude']);\n $rs = $ra_start;\n foreach ($ra as $name => $returnItem) {\n $toPrint = true;\n foreach ($items as $item) {\n // trim and lower\n $item = strtolower(trim($item)); \n if ($item == $name) {\n $toPrint = false;\n }\n }\n if ($toPrint) {\n $rs .= $returnItem;\n }\n }\n $rs .= $ra_end;\n \n\n } else {\n $rs = $ra_start;\n foreach ($ra as $name => $returnItem) {\n $rs .= $returnItem;\n }\n $rs .= $ra_end;\n }\n\n return $rs;\n }", "public function toString()\n\t{\n\t\treturn \"Customer on checkout page - Shipping address popup - created address is shown on [Shipping address] and [Billing address] section\";\n\t}", "function femail_user_add($form_state, $account){\n $form['femail_email'] = array(\n '#type' => 'textfield',\n '#title' => t('Email')\n );\n $form['femail_uid'] = array(\n '#type' => 'hidden',\n '#value' => $account->uid\n );\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Add an additional Email')\n );\n return $form;\n}", "public function populate() {\n\n\t\tif ( bp_is_active( 'xprofile' ) )\n\t\t\t$this->profile_data = $this->get_profile_data();\n\n\t\tif ( !empty( $this->profile_data ) ) {\n\t\t\t$full_name_field_name = bp_xprofile_fullname_field_name();\n\n\t\t\t$this->user_url = bp_core_get_user_domain( $this->id, $this->profile_data['user_nicename'], $this->profile_data['user_login'] );\n\t\t\t$this->fullname = esc_attr( $this->profile_data[$full_name_field_name]['field_data'] );\n\t\t\t$this->user_link = \"<a href='{$this->user_url}'>{$this->fullname}</a>\";\n\t\t\t$this->email = esc_attr( $this->profile_data['user_email'] );\n\t\t} else {\n\t\t\t$this->user_url = bp_core_get_user_domain( $this->id );\n\t\t\t$this->user_link = bp_core_get_userlink( $this->id );\n\t\t\t$this->fullname = esc_attr( bp_core_get_user_displayname( $this->id ) );\n\t\t\t$this->email = esc_attr( bp_core_get_user_email( $this->id ) );\n\t\t}\n\n\t\t$this->avatar = bp_core_fetch_avatar(\n\t\t\tarray(\n\t\t\t\t'item_id' => $this->id,\n\t\t\t\t'type' => 'full',\n\t\t\t\t'alt' => sprintf(\n\t\t\t\t\t/* translators: %s: member name */\n\t\t\t\t\t__( 'Profile photo of %s', 'buddypress' ),\n\t\t\t\t\t$this->fullname\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->avatar_thumb = bp_core_fetch_avatar(\n\t\t\tarray(\n\t\t\t\t'item_id' => $this->id,\n\t\t\t\t'type' => 'thumb',\n\t\t\t\t'alt' => sprintf(\n\t\t\t\t\t/* translators: %s: member name */\n\t\t\t\t\t__( 'Profile photo of %s', 'buddypress' ),\n\t\t\t\t\t$this->fullname\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$this->avatar_mini = bp_core_fetch_avatar(\n\t\t\tarray(\n\t\t\t\t'item_id' => $this->id,\n\t\t\t\t'type' => 'thumb',\n\t\t\t\t'alt' => sprintf(\n\t\t\t\t\t/* translators: %s: member name */\n\t\t\t\t\t__( 'Profile photo of %s', 'buddypress' ),\n\t\t\t\t\t$this->fullname\n\t\t\t\t),\n\t\t\t\t'width' => 30,\n\t\t\t\t'height' => 30\n\t\t\t)\n\t\t);\n\n\t\t/* translators: %s: human time diff of the last time the user was active on the site. */\n\t\t$this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), _x( 'active %s', 'last time the user was active', 'buddypress' ) );\n\t}", "function wp_user_personal_data_exporter($email_address)\n {\n }", "function horizon_contact_section() {\n\t\tget_template_part('inc/partials/homepage', 'contact');\n\t}", "public static function show_user_extra_field( $user ) {\n\t\t$phone = get_user_meta( $user->ID, 'phone', true );\n\t\tif ( empty( $phone ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<h3><?php echo esc_html__( 'Extra profile information', 'uael' ); ?></h3>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th><label for=\"phone\"><?php echo esc_html__( 'Phone Number', 'uael' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"phone\" id=\"phone\" value=\"<?php echo esc_attr( $phone ); ?>\" class=\"regular-text\" placeholder=\"<?php echo esc_attr( 'Enter your phone number' ); ?>\" /><br />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<?php\n\t}", "public function display_account_personal_information( ){\n\t\tif( $this->is_page_visible( \"personal_information\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_personal_information.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_personal_information.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_personal_information.php' );\n\t\t}\n\t}", "private function addAddress($options)\n {\n $address = $options['billing_address']\n ?: $options['address'];\n\n $this->post['card']['address_line1'] = $address['address1'];\n $this->post['card']['address_line2'] = $address['address2'];\n $this->post['card']['address_city'] = $address['city'];\n $this->post['card']['address_postcode'] = $address['zip'];\n $this->post['card']['address_state'] = $address['state'];\n $this->post['card']['address_country'] = $address['country'];\n }", "public function fullAddress(){\n\n return ' '.$this->house. ' '. $this->address. ', '. $this->postcode;\n }", "public function getContactInfo() {\n return $this->contactInfo;\n }", "public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \"&nbsp;by&nbsp;\" . $this->userName;\n\t}", "function displayContactData($a_omit_init = false)\n\t{\n\t\t$this->checkDisplayMode(\"setup_contact_data\");\n\t\t$settings = $this->setup->getClient()->getAllSettings();\n\n\t\tif (!$a_omit_init)\n\t\t{\n\t\t\t$this->initContactDataForm();\n\t\t\t$this->getContactValues();\n\t\t}\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", $this->form->getHTML());\n\t\t$this->tpl->setVariable(\"TXT_INFO\", $this->lng->txt(\"info_text_contact\"));\n\t\t$this->setButtonPrev(\"lang\");\n\n\t\t$check = $this->setup->checkClientContact($this->setup->client);\n\n\t\t$this->setup->getClient()->status[\"contact\"][\"status\"] = $check[\"status\"];\n\t\t$this->setup->getClient()->status[\"contact\"][\"comment\"] = $check[\"comment\"];\n\n\t\tif ($check[\"status\"])\n\t\t{\n\t\t\t$this->setButtonNext(\"proxy\");\n\t\t}\n\n\t\t$this->checkPanelMode();\n\t}", "function address_shortcode() {\n ob_start();\n get_template_part('address');\n return ob_get_clean();\n}", "public function display_address( $post ) {\n\t\t\t// output buffer start\n\t\t\tob_start();\n\n\t\t\t//nonce field for address meta box\n\t\t\twp_nonce_field( 'rt_restaurant_address_nonce', 'restaurant_address_nonce', false );\n\n\t\t\t// Array for address fields\n\t\t\t$addr = array( \"streetAddress\" => \"Street Address\", \"addressLocality\" => \"Locality\", \"addressRegion\" => \"Region\", \"postalCode\" => \"Postal Code\", \"addressCountry\" => \"Country\" );\n\n\t\t\t// Retriving address post meta for particular post.\n\t\t\t$add = get_post_meta( $post->ID, '_restaurant_address', true );\n\n\t\t\t//includes address html\n\t\t\trequire \\rtCamp\\WP\\rtRestaurants\\PATH . 'includes/views/address.php';\n\n\t\t\t// Get output buffer value into variable and clear output buffer\n\t\t\t$ob_address = ob_get_clean();\n\n\t\t\t/**\n\t\t\t * Filter for change post meta box display of address post meta.\n\t\t\t *\n\t\t\t * This filter allow user to change meta box of address post meta by passing output string.\n\t\t\t *\n\t\t\t * @since 0.1\n\t\t\t *\n\t\t\t * @param string $var Filter name\n\t\t\t * @param string $ob_address\n\t\t\t */\n\t\t\t$ob_address = apply_filters( 'rt_restaurant_address_html', $ob_address );\n\n\n\t\t\t/**\n\t\t\t * Action to add extra fields in address display\n\t\t\t * \n\t\t\t * @param string $ob_address\n\t\t\t */\n\t\t\tdo_action( 'rt_restaurants_address_display', $ob_address );\n\n\t\t\treturn $ob_address;\n\t\t}", "function aidtransparency_print_sidebar_contact( $email = null)\r\n{\r\n $contact = null;\r\n if(filter_var($email, FILTER_VALIDATE_EMAIL)){\r\n $contact = $email;\r\n }else{\r\n $contact = sweetapple_get_theme_option('contact_email');\r\n }\r\n if($contact == null){\r\n return \"\";\r\n }else{\r\n ?>\r\n <aside id=\"sidebar_contact_email\" class=\"widget widget_contact_email\">\r\n <h3 class=\"widget-title\"><?php _e('Media Contact'); ?></h3>\r\n <div class=\"textcontact\">\r\n <p>Media Contact<br />\r\n <a href=\"mailto:<?php echo $contact; ?>\"><?php echo $contact; ?></a>\r\n </p>\r\n </div>\r\n </aside>\r\n\r\n <?php\r\n }\r\n}", "function wp_comments_personal_data_eraser($email_address, $page = 1)\n {\n }", "function get_wp_aff_custom_args($args) {\n $aff_id = wp_affiliate_get_referrer();\n $ip_addr = wp_aff_get_user_ip();\n $custom_var = 'ap_id=' . $aff_id . '&ip=' . $ip_addr;\n return $custom_var;\n}", "function pixelgrade_the_author_info_box() {\n\tif ( pixelgrade_user_has_access( 'pro-features' ) ) {\n\t\techo pixelgrade_get_the_author_info_box(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t}\n}", "public function wc_address_book_make_primary() {\n\n\t\t$customer_id = get_current_user_id();\n\t\t$address_book = $this->get_address_book( $customer_id );\n\n\t\t$primary_address_name = 'shipping';\n\t\t$alt_address_name = $_POST['name'];\n\n\t\t// Loop through and swap values between shipping names.\n\t\tforeach ( $address_book[ $primary_address_name ] as $field => $value ) {\n\n\t\t\t$alt_field = preg_replace( '/^[^_]*_\\s*/', $alt_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $alt_address_name ][ $alt_field ] );\n\t\t}\n\n\t\tforeach ( $address_book[ $alt_address_name ] as $field => $value ) {\n\n\t\t\t$primary_field = preg_replace( '/^[^_]*_\\s*/', $primary_address_name . '_', $field );\n\t\t\t$resp = update_user_meta( $customer_id, $field, $address_book[ $primary_address_name ][ $primary_field ] );\n\t\t}\n\n\t\tdie();\n\t}", "static function add_email(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::email, [\r\n\t\t\t'label' => 'Email',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => '(Optional)',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'placeholder' => 'someone@themedium.ca'\r\n\t\t]);\r\n\t}", "function jt_cmb2_address_field( $metakey, $post_id = 0 ) {\n\techo jt_cmb2_get_address_field( $metakey, $post_id );\n}", "public function renderAddress()\n {\n echo $this->getAddressStringSingleLine();\n }", "protected function insertAddress(&$page, $store = null)\r\n {\r\n $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));\r\n $font = $this->_setFontRegular($page, 10);\r\n $page->setLineWidth(0);\r\n $this->y = $this->y ? $this->y : 815;\r\n $top = 815;\r\n\r\n $collection = Mage::getModel('marketplace/userprofile')->getCollection()\r\n ->addFieldToFilter('mageuserid',array('eq'=>Mage::getSingleton('customer/session')->getCustomerId()));\r\n foreach ($collection as $row) {\r\n $address=$row->getOthersInfo();\r\n }\r\n\r\n foreach (explode(\"\\n\", $address) as $value){\r\n if ($value !== '') {\r\n $value = preg_replace('/<br[^>]*>/i', \"\\n\", $value);\r\n foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {\r\n $page->drawText(trim(strip_tags($_value)),\r\n $this->getAlignRight($_value, 130, 440, $font, 10),\r\n $top,\r\n 'UTF-8');\r\n $top -= 10;\r\n }\r\n }\r\n }\r\n $this->y = ($this->y > $top) ? $top : $this->y;\r\n }", "public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}", "function ffl_save_extra_profile_fields( $user_id ) \n{\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\treturn false;\n\n\t//set the display name\n\t$display_name = trim($_POST['first_name'] . \" \" . $_POST['last_name']);\n\tif(!$display_name)\n\t\t$display_name = $_POST['user_login'];\n\t\t\n\t$_POST['display_name'] = $display_name;\n\t\n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t); \n\twp_update_user( $args ) ;\n}", "function cs_contact_options( $contactoptions ) {\n\t$contactoptions['twitter'] = 'Twitter';\n\treturn $contactoptions;\n}", "function faculty_settings_post_info() {\n faculty_setting_line(faculty_add_background_color_setting('post_info_background_color', __('Background', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_color_setting('post_info_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('post_info_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('post_info_text_transform', __('Text Transform', FACULTY_DOMAIN), 'transform'));\n do_action('faculty_settings_post_info');\n}", "function new_geo_info(){\n\t\tadd_meta_box( \n\t\t\t'geo_info_section',\n\t\t\t'geo_info',\n\t\t\t'geo_custom_box',\n\t\t\t'post'\n\t\t);\n\t}", "function pixelgrade_get_the_author_info_box() {\n\t\t// Get the current post for easy use\n\t\t$post = get_post();\n\n\t\t// Bail if no post\n\t\tif ( empty( $post ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// If we aren't on a single post or it's a single post without author, don't continue.\n\t\tif ( ! is_single() || ! isset( $post->post_author ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$options = get_theme_support( 'jetpack-content-options' );\n\t\t$author_bio = ( ! empty( $options[0]['author-bio'] ) ) ? $options[0]['author-bio'] : null;\n\t\t$author_bio_default = ( isset( $options[0]['author-bio-default'] ) && false === $options[0]['author-bio-default'] ) ? '' : 1;\n\n\t\t// If the theme doesn't support 'jetpack-content-options[ 'author-bio' ]', don't continue.\n\t\tif ( true !== $author_bio ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// If 'jetpack_content_author_bio' is false, don't continue.\n\t\tif ( ! get_option( 'jetpack_content_author_bio', $author_bio_default ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Get author's biographical information or description\n\t\t$user_description = get_the_author_meta( 'user_description', $post->post_author );\n\t\t// If an author doesn't have a description, don't display the author info box\n\t\tif ( empty( $user_description ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$author_details = '';\n\n\t\t// Get author's display name\n\t\t$display_name = get_the_author_meta( 'display_name', $post->post_author );\n\n\t\t// If display name is not available then use nickname as display name\n\t\tif ( empty( $display_name ) ) {\n\t\t\t$display_name = get_the_author_meta( 'nickname', $post->post_author );\n\t\t}\n\n\t\tif ( ! empty( $user_description ) ) {\n\t\t\t$author_details .= '<div class=\"c-author has-description\" itemscope itemtype=\"http://schema.org/Person\">';\n\t\t} else {\n\t\t\t$author_details .= '<div class=\"c-author\" itemscope itemtype=\"http://schema.org/Person\">';\n\t\t}\n\n\t\t// The author avatar\n\t\t$author_avatar = get_avatar( get_the_author_meta( 'user_email' ), 100 );\n\t\tif ( ! empty( $author_avatar ) ) {\n\t\t\t$author_details .= '<div class=\"c-author__avatar\">' . $author_avatar . '</div>';\n\t\t}\n\n\t\t$author_details .= '<div class=\"c-author__details\">';\n\n\t\tif ( ! empty( $display_name ) ) {\n\t\t\t$author_details .= '<span class=\"c-author__name h3\">' . esc_html( $display_name ) . '</span>';\n\t\t}\n\n\t\t// The author bio\n\t\tif ( ! empty( $user_description ) ) {\n\t\t\t$author_details .= '<p class=\"c-author__description\" itemprop=\"description\">' . nl2br( $user_description ) . '</p>';\n\t\t}\n\n\t\t$author_details .= '<footer class=\"c-author__footer\">';\n\n\t\t$author_details .= pixelgrade_get_author_bio_links( $post->ID );\n\n\t\t$author_details .= '</footer>';\n\t\t$author_details .= '</div><!-- .c-author__details -->';\n\t\t$author_details .= '</div><!-- .c-author -->';\n\n\t\treturn $author_details;\n\t}", "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}", "function display_user_profile_fields() {\r\n global $wpdb, $user_id, $wpi_settings;\r\n $profileuser = get_user_to_edit($user_id);\r\n\r\n include($wpi_settings['admin']['ui_path'] . '/profile_page_content.php');\r\n }", "function extra_profile_fields( $user ) { ?>\n <h3>Author Information Display</h3>\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th>\n <label for=\"list_author_single\">Show author bio on article pages</label>\n </th>\n <td>\n <input type=\"checkbox\" name=\"list_author_single\" id=\"list_author_single\" value=\"true\" <?php if ( esc_attr( get_the_author_meta('list_author_single', $user->ID) ) == true ) echo 'checked'; ?> />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"list_author_about\">Show author on About page</label>\n </th>\n <td>\n <input type=\"checkbox\" name=\"list_author_about\" id=\"list_author_about\" value=\"true\" <?php if ( esc_attr( get_the_author_meta('list_author_about', $user->ID) ) == true ) echo 'checked'; ?> />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"display_author_as\">List author on About Page as</label>\n </th>\n <td>\n <?php \n //get dropdown saved value\n $selected = get_the_author_meta( 'display_author_as', $user->ID ); \n ?>\n <select name=\"display_author_as\" id=\"display_author_as\">\n <option value=\"editor\" <?php echo ($selected == \"editor\")? 'selected=\"selected\"' : '' ?>>Editor</option>\n <option value=\"writer\" <?php echo ($selected == \"writer\")? 'selected=\"selected\"' : '' ?>>Writer</option>\n <option value=\"photographer\" <?php echo ($selected == \"photographer\")? 'selected=\"selected\"' : '' ?>>Photographer</option>\n <span class=\"description\">Simple text field</span>\n </td>\n </tr>\n </tbody>\n </table>\n <br />\n<?php }", "function wpb_author_info_box( $content ) {\n \n\tglobal $post;\n\t \n\t// Detect if it is a single post with a post author\n\tif ( is_single() && isset( $post->post_author ) ) {\n\t \n\t\t// Get author's display name \n\t\t$display_name = get_the_author_meta( 'display_name', $post->post_author );\n\t \n\t// If display name is not available then use nickname as display name\n\tif ( empty( $display_name ) )\n\t$display_name = get_the_author_meta( 'nickname', $post->post_author );\n\t \n\t\t// Get author's biographical information or description\n\t\t$user_description = get_the_author_meta( 'user_description', $post->post_author );\n\t\t \n\t\t// Get author's website URL \n\t\t$user_website = get_the_author_meta('url', $post->post_author);\n\t\t \n\t\t// Get link to the author archive page\n\t\t$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));\n\t \n\tif ( ! empty( $display_name ) )\n\n\t\t// If author has a biography, display the bio box...\n\t\tif (get_the_author_meta('description')) {\n\t\t\t\t$author_details = '<div class=\"panel-title\"><p class=\"author_name\">Posted by <a class=\"blue-color\" href=\"'. $user_posts .'\"> ' . $display_name . '</a></p></div>';\n\t \t\t}\n\n\tif ( ! empty( $user_description ) )\n\t\n\t\t// If author bio is not blank...\n\t\tif (get_the_author_meta('description')) {\n\t\t\t// Author avatar and bio\n\t\t\t$author_details .= '<p class=\"author_details\">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</p>';\n\t\t}\n\n\t\t// If author bio is not blank... \n\t\t\tif (get_the_author_meta('description')) {\n\t\t\t\t// Pass all this info to post content \n\t\t\t\t$content = $content . '<footer class=\"author_bio_section\" >' . $author_details . '</footer>';\n\t\t\t}\n\t\t}\n\n\treturn $content;\n\n\t}", "public static function addressFirstName()\n {\n return new TextNode('address_first_name');\n }", "function getfaircoin_edd_view_order_details( $payment_meta, $user_info ) {\r\n $fairaddress = isset( $payment_meta['fairaddress'] ) ? $payment_meta['fairaddress'] : 'none';\r\n $fairsaving = isset( $payment_meta['fairsaving'] ) ? $payment_meta['fairsaving'] : '0';\r\n ?>\r\n <div class=\"column-container\">\r\n <div class=\"column\">\r\n <strong><?php echo _e('FairSaving: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairsaving\" value=\"<?php esc_attr_e( $fairsaving ); ?>\" class=\"small-text\" />\r\n <p class=\"description\"><?php _e( 'Customer FairSaving choice', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n <div class=\"column\">\r\n <strong><?php echo _e('FaircoinAddress: ', 'edd-getfaircoin'); ?></strong>\r\n <input type=\"text\" name=\"edd_fairaddress\" value=\"<?php esc_attr_e( $fairaddress ); ?>\" class=\"medium-text\" />\r\n <p class=\"description\"><?php _e( 'Customer Faircoin address', 'edd-getfaircoin' ); ?></p>\r\n </div>\r\n </div>\r\n <?php\r\n}", "function mozilla_get_user_info($me, $user, $logged_in) {\n $object = new stdClass();\n $object->value = $user->user_nicename;\n $object->display = true;\n \n $data = Array(\n 'username' => $object,\n 'id' => $user->ID\n );\n\n $is_me = $logged_in && intval($me->ID) === intval($user->ID);\n $meta = get_user_meta($user->ID);\n $community_fields = isset($meta['community-meta-fields'][0]) ? unserialize($meta['community-meta-fields'][0]) : Array();\n\n // First Name\n $object = new stdClass();\n $object->value = isset($meta['first_name'][0]) ? $meta['first_name'][0] : false;\n $object->display = mozilla_display_field('first_name', isset($meta['first_name_visibility'][0]) ? $meta['first_name_visibility'][0] : false, $is_me, $logged_in);\n \n $data['first_name'] = $object;\n\n // Last Name\n $object = new stdClass();\n $object->value = isset($meta['last_name'][0]) ? $meta['last_name'][0] : false;\n $object->display = mozilla_display_field('last_name', isset($meta['last_name_visibility'][0]) ? $meta['last_name_visibility'][0] : false, $is_me, $logged_in);\n $data['last_name'] = $object;\n\n // Email\n $object = new stdClass();\n $object->value = isset($meta['email'][0]) ? $meta['email'][0] : false;\n $object->display = mozilla_display_field('email', isset($meta['email_visibility'][0]) ? $meta['email_visibility'][0] : false , $is_me, $logged_in);\n $data['email'] = $object;\n\n // Location\n global $countries;\n $object = new stdClass();\n if(isset($community_fields['city']) && strlen($community_fields['city']) > 0 && isset($community_fields['country']) && strlen($community_fields['country']) > 1) {\n $object->value = \"{$community_fields['city']}, {$countries[$community_fields['country']]}\";\n } else {\n if(isset($community_fields['city']) && strlen($community_fields['city']) > 0) {\n $object->value = $community_fields['city'];\n } elseif(isset($community_fields['country']) && strlen($community_fields['country']) > 0) {\n $object->value = $countries[$community_fields['country']];\n } else {\n $object->value = false;\n }\n }\n \n $object->display = mozilla_display_field('location', isset($meta['profile_location_visibility'][0]) ? $meta['profile_location_visibility'][0] : false , $is_me, $logged_in);\n $data['location'] = $object;\n\n // Profile Image\n $object = new stdClass();\n $object->value = isset($community_fields['image_url']) && strlen($community_fields['image_url']) > 0 ? $community_fields['image_url'] : false;\n $object->display = mozilla_display_field('image_url', isset($community_fields['profile_image_url_visibility']) ? $community_fields['profile_image_url_visibility'] : false , $is_me, $logged_in);\n $data['profile_image'] = $object;\n\n // Bio\n $object = new stdClass();\n $object->value = isset($community_fields['bio']) && strlen($community_fields['bio']) > 0 ? $community_fields['bio'] : false;\n $object->display = mozilla_display_field('bio', isset($community_fields['bio_visibility']) ? $community_fields['bio_visibility'] : false , $is_me, $logged_in);\n $data['bio'] = $object;\n\n // Pronoun Visibility \n $object = new stdClass();\n $object->value = isset($community_fields['pronoun']) && strlen($community_fields['pronoun']) > 0 ? $community_fields['pronoun'] : false;\n $object->display = mozilla_display_field('pronoun', isset($community_fields['pronoun_visibility']) ? $community_fields['pronoun_visibility'] : false , $is_me, $logged_in);\n $data['pronoun'] = $object;\n\n // Phone\n $object = new stdClass();\n $object->value = isset($community_fields['phone']) ? $community_fields['phone'] : false;\n $object->display = mozilla_display_field('phone', isset($community_fields['phone_visibility']) ? $community_fields['phone_visibility'] : false , $is_me, $logged_in);\n $data['phone'] = $object;\n\n // Groups Joined\n $object = new stdClass();\n $object->display = mozilla_display_field('groups_joined', isset($community_fields['profile_groups_joined_visibility']) ? $community_fields['profile_groups_joined_visibility'] : false , $is_me, $logged_in);\n $data['groups'] = $object;\n\n // Events Attended\n $object = new stdClass();\n $object->display = mozilla_display_field('events_attended', isset($community_fields['profile_events_attended_visibility']) ? $community_fields['profile_events_attended_visibility'] : false , $is_me, $logged_in);\n $data['events_attended'] = $object;\n\n // Events Organized\n $object = new stdClass();\n $object->display = mozilla_display_field('events_organized', isset($community_fields['profile_events_organized_visibility']) ? $community_fields['profile_events_organized_visibility'] : false , $is_me, $logged_in);\n $data['events_organized'] = $object;\n \n // Campaigns\n $object = new StdClass();\n $object->display = mozilla_display_field('campaigns_participated', isset($community_fields['profile_campaigns_visibility']) ? $community_fields['profile_campaigns_visibility'] : false , $is_me, $logged_in);\n $data['campaigns_participated'] = $object;\n\n // Social Media \n $object = new stdClass();\n $object->value = isset($community_fields['telegram']) && strlen($community_fields['telegram']) > 0 ? $community_fields['telegram'] : false;\n $object->display = mozilla_display_field('telegram', isset($community_fields['profile_telegram_visibility']) ? $community_fields['profile_telegram_visibility'] : false , $is_me, $logged_in);\n $data['telegram'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['facebook']) && strlen($community_fields['facebook']) > 0 ? $community_fields['facebook'] : false;\n $object->display = mozilla_display_field('facebook', isset($community_fields['profile_facebook_visibility']) ? $community_fields['profile_facebook_visibility'] : false , $is_me, $logged_in);\n $data['facebook'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['twitter']) && strlen($community_fields['twitter']) > 0 ? $community_fields['twitter'] : false;\n $object->display = mozilla_display_field('twitter', isset($community_fields['profile_twitter_visibility']) ? $community_fields['profile_twitter_visibility'] : false , $is_me, $logged_in);\n $data['twitter'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['linkedin']) && strlen($community_fields['linkedin']) > 0 ? $community_fields['linkedin'] : false;\n $object->display = mozilla_display_field('linkedin', isset($community_fields['profile_linkedin_visibility']) ? $community_fields['profile_linkedin_visibility'] : false , $is_me, $logged_in);\n $data['linkedin'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['discourse']) && strlen($community_fields['discourse']) > 0 ? $community_fields['discourse'] : false;\n $object->display = mozilla_display_field('discourse', isset($community_fields['profile_discourse_visibility']) ? $community_fields['profile_discourse_visibility'] : false , $is_me, $logged_in);\n $data['discourse'] = $object;\n\n $object = new stdClass();\n $object->value = isset($community_fields['github']) && strlen($community_fields['github']) > 0 ? $community_fields['github'] : false;\n $object->display = mozilla_display_field('github', isset($community_fields['profile_github_visibility']) ? $community_fields['profile_github_visibility'] : false , $is_me, $logged_in);\n\t$data['github'] = $object;\n\t\n\t$object = new stdClass();\n $object->value = isset($community_fields['matrix']) && strlen($community_fields['matrix']) > 0 ? $community_fields['matrix'] : false;\n $object->display = mozilla_display_field('matrix', isset($community_fields['profile_matrix_visibility']) ? $community_fields['profile_matrix_visibility'] : false , $is_me, $logged_in);\n $data['matrix'] = $object;\n\n //Languages\n $object = new stdClass();\n $object->value = isset($community_fields['languages']) && sizeof($community_fields['languages']) > 0 ? $community_fields['languages'] : false;\n $object->display = mozilla_display_field('languages', isset($community_fields['profile_languages_visibility']) ? $community_fields['profile_languages_visibility'] : false , $is_me, $logged_in);\n $data['languages'] = $object;\n\n // Tags\n $object = new stdClass();\n $object->value = isset($community_fields['tags']) && strlen($community_fields['tags']) > 0 ? $community_fields['tags'] : false;\n $object->display = mozilla_display_field('tags', isset($community_fields['profile_tags_visibility']) ? $community_fields['profile_tags_visibility'] : false , $is_me, $logged_in);\n $data['tags'] = $object;\n \n $object = null;\n return $data;\n}", "public function show_user_analytics_info( $user ) {\n\n $user_analytics_info = get_user_meta( $user->ID, 'user_analytics_info_during_register', true );\n\n if ( !$user_analytics_info && empty( $user_analytics_info ) ) {\n return;\n }\n ?>\n <hr>\n <h3>User Analytics Info</h3>\n <table class=\"form-table wpuf-user-analytics-listing-profile\">\n <thead>\n <tr>\n <th><?php _e( 'User info title', 'wpuf-pro' ); ?></th>\n <th><?php _e( 'Value', 'wpuf-pro' ); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php foreach ( $user_analytics_info as $key => $value ): ?>\n <tr>\n <td><strong><?php echo ucfirst( str_replace( '_', ' ', $key ) ); ?></strong></td>\n <td><?php echo $value; ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <style>\n .wpuf-user-analytics-listing-profile{\n border: 1px solid #ccc;\n background-color: #fff;\n }\n\n .wpuf-user-analytics-listing-profile thead {\n border: 1px solid #ccc;\n }\n\n .wpuf-user-analytics-listing-profile tbody tr {\n border: 1px solid #ccc;\n }\n\n .wpuf-user-analytics-listing-profile td {\n font-size: 13px;\n }\n .wpuf-user-analytics-listing-profile td, .wpuf-user-analytics-listing-profile th {\n padding: 5px 8px;\n }\n </style>\n <?php\n }", "function address_information(){\r\n\t\tregister_post_type('address_information', array(\r\n\t\t\t'supports' => array('title', 'editor'),\r\n\t\t\t'has_archive' => false,\r\n\t\t\t'public' => true,\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => 'Address Information',\r\n\t\t\t\t'add new_item' => 'Add New Address Information',\r\n\t\t\t\t'edit_item' => 'Edit Address Information',\r\n\t\t\t\t'singular_name' => 'Address Information'\r\n\t\t\t),\r\n\t\t\t'menu_icon' => 'dashicons-store'\r\n\t\t));\r\n\t}", "function getfaircoin_edd_store_usermeta( $payment_id ) {\r\n // return if user is not logged in\r\n if ( ! is_user_logged_in() )\r\n return;\r\n // get the user's ID\r\n $user_id = get_current_user_id();\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['edd_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['edd_fairsaving'] );\r\n}", "public function saveAddress()\n\t{\n\t\trequire_once Component::path('com_members') . DS . 'models' . DS . 'address.php';\n\n\t\t// get request vars\n\t\t$data = Request::getArray('address', array());\n\t\t$data['uidNumber'] = User::get('id');\n\n\t\t// set up objects\n\t\t$address = Components\\Members\\Models\\Address::blank()->set($data);\n\n\t\t// attempt to save\n\t\tif (!$address->save())\n\t\t{\n\t\t\t$this->setError($address->getError());\n\t\t\treturn $this->editAddress($address);\n\t\t}\n\n\t\t//inform and redirect\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=com_members&id=' . User::get('id') . '&active=profile'),\n\t\t\tLang::txt('PLG_MEMBERS_PROFILE_ADDRESS_SAVED'),\n\t\t\t'passed'\n\t\t);\n\t}", "public function getUserAddressId()\n {\n return parent::getValue('user_address_id');\n }", "public function _settings_field_account() {\n global $zendesk_support;\n ?>\n <?php if ( ! $zendesk_support->settings['account'] ): ?>\n <strong>http://<input type=\"text\" style=\"width: 120px;\" class=\"regular-text\" id=\"zendesk_account\"\n name=\"zendesk-settings[account]\"\n value=\"<?php echo $zendesk_support->settings[\"account\"]; ?>\"/>.zendesk.com</strong> <br/>\n <span class=\"description\">Even if you have host mapping, please use your subdomain here.<br/>\n We will automatically detect if you use SSL or not.</span>\n <?php else: ?>\n http://<input type=\"text\" style=\"width: 120px; display: none;\" class=\"regular-text\" id=\"zendesk_account\"\n name=\"zendesk-settings[account]\" value=\"<?php echo $zendesk_support->settings[\"account\"]; ?>\"/>\n <strong id=\"zendesk_account_string\"><?php echo $zendesk_support->settings['account']; ?></strong>.zendesk.com<br/>\n <span class=\"description\">\n <a id=\"zendesk_account_change\" href=\"#\"><?php _e( 'Click here to change your subdomain', 'zendesk' ); ?></a>\n </span>\n <?php endif; ?>\n <?php\n }", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "function twitter_add_contact(string $addr, bool $probe, int $uid): bool\n{\n\t$contact = Contact::getByURL($addr, $probe ? null : false, ['id', 'url', 'network']);\n\tif (empty($contact)) {\n\t\tLogger::debug('Not a contact address', ['uid' => $uid, 'probe' => $probe, 'addr' => $addr]);\n\t\treturn false;\n\t}\n\n\tif (!in_array($contact['network'], Protocol::FEDERATED)) {\n\t\tLogger::debug('Not a federated network', ['uid' => $uid, 'addr' => $addr, 'contact' => $contact]);\n\t\treturn false;\n\t}\n\n\tif (Contact::isSharing($contact['id'], $uid)) {\n\t\tLogger::debug('Contact has already been added', ['uid' => $uid, 'addr' => $addr, 'contact' => $contact]);\n\t\treturn true;\n\t}\n\n\tLogger::info('Add contact', ['uid' => $uid, 'addr' => $addr, 'contact' => $contact]);\n\tWorker::add(Worker::PRIORITY_LOW, 'AddContact', $uid, $contact['url']);\n\n\treturn true;\n}", "public function setAutoResponderToAddressField($value) { $this->_autoResponderToAddressField = $value; }", "function link_wp_org_callback() {\n\t\t$wp_link_option_value = bp_get_option( 'thaim_link_wordpress_org', '' );\n\t\t?>\n\t\t<input id=\"thaim_link_wordpress_org\" name=\"thaim_link_wordpress_org\" type=\"text\" value=\"<?php echo esc_attr( $wp_link_option_value ); ?>\" />\n\t\t<label for=\"thaim_link_wordpress_org\"><?php esc_html_e( 'WordPress.org username', 'thaim-utilities' ); ?></label>\n\t\t<?php\n\t}", "public function addAddress(){\n\t\t$name = $_REQUEST['name'];\n\t\t$address = $_REQUEST['address'];\n $stuid = $_REQUEST['stuid'];\n\t\t$phone = $_REQUEST['phone'];\n\t\t$form = M(\"addressinfo\");\n\t\t$data['name'] = $name;\n \t$data['address'] = $address;\n \t$data['phone'] = $phone;\n $data['stuid'] = $stuid;\n \t$result = $form->add($data);\n\t\tif ($result) {$this->redirect('/fastfood/index.php/Admin/admin');}\n\t\t\telse {$this->error('添加失败');}\n }", "public function updateInformation() {\n $response = null;\n try {\n // Returns a `FacebookFacebookResponse` object\n $response = Facebook::get(\n $this->app_scoped_id . '?fields=first_name,last_name,profile_pic&access_token=' . $this->restaurant->fb_page_access_token,\n null,\n $this->restaurant->fb_page_access_token\n );\n } catch(Exception $e) {\n return;\n }\n $result = $response->getGraphObject()->asArray();\n if ($result) {\n if(array_key_exists(\"first_name\", $result)) {\n $this->attributes['first_name'] = $result[\"first_name\"];\n }\n if(array_key_exists(\"last_name\", $result)) {\n $this->attributes['last_name'] = $result[\"last_name\"];\n }\n if(array_key_exists(\"profile_pic\", $result)) {\n $this->attributes['profile_pic'] = $result[\"profile_pic\"];\n }\n $this->save();\n }\n }", "function address_meta_box()\n{\n\n\tadd_meta_box('main_address', 'Address Real Estate' , 'address_input', array('apartment', 'villa','land' , 'store') , 'advanced' , 'high',null);\n\n\tadd_meta_box('district_address', 'District Real Estate' , 'address_district_input', array('apartment', 'villa','land' , 'store') , 'advanced' , 'high',null);\n\t\tadd_meta_box('rew_floor', 'Floor Number' , 'rew_floors', array('apartment', 'villa') , 'advanced' , 'high',null);\n\t\tadd_meta_box('rew_rooms', 'Rooms Number' , 'rew_rooms',array('apartment', 'villa') , 'advanced' , 'high',null);\n\t\tadd_meta_box('Apartment_area', 'Real Estate Area' , 'rew_area', array('apartment', 'villa','land' , 'store') , 'advanced' , 'high',null);\n\tadd_meta_box('rew_price', 'Real Estat Price' , 'rew_price', array('apartment', 'villa','land' , 'store') , 'advanced' , 'high',null);\n\n\t/// villa rew_garden\n\tadd_meta_box('rew_garden', 'Garden Real Estate' , 'rew_garden', array( 'villa') , 'advanced' , 'high',null);\n\n}", "function coenv_setting_public_email_address() {\n\t$value = get_option('public_email_address');\n\n\t?>\t\n\t\t<p>The public email address of the unit.</p>\n\t\t\t\t<input name=\"public_email_address\" type=\"text\" id=\"public_email_address\" value=\"<?php echo $value; ?>\" class=\"regular-text\">\n\t<?php\n}", "function getFieldPortalAddressStreet($value1 = null, $value2 = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_street');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_street');\n\t\t$tooltip = setToolTipNotification(\"street\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('street') === 'street' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label><br><input type='text' name='streetNo' value='\".$value1.\"' id='streetNo' size='4' style='width:28%;'>\";\n\t\t\t$form_ret .= \"<input type='text' name='streetName' value='\".$value2.\"' id='streetName' size='12' class='srms-field \".(get_axl_req_fields('street') === 'street' ? 'input-text-required' : '').\"' style='width:70%;'></br>\";\n\t\t}\n\t\treturn $form_ret;\n\t}", "function get_squarecandy_acf_events_address_display( $event, $style = '2line', $maplink = true ) {\n\n\t$home_country = get_option( 'options_home_country' );\n\n\t$output = '<div class=\"venue venue-' . $style . '\" itemprop=\"location\" itemscope=\"\" itemtype=\"http://schema.org/MusicVenue\">';\n\tif ( ! empty( $event['venue'] ) ) {\n\t\t// link the venue name to the venue website, unless this is the map popup\n\t\tif ( ! empty( $event['venue_link'] ) && 'infowindow' !== $style ) {\n\t\t\t$output .= '<a href=\"' . $event['venue_link'] . '\" itemprop=\"url\">';\n\t\t}\n\t\t// link the venue name to the full version of google maps in the map popup style\n\t\tif ( ! empty( $event['venue_location'] ) && ! empty( $event['venue_location']['address'] ) && 'infowindow' === $style ) {\n\t\t\t$output .= '<a href=\"https://www.google.com/maps/search/' . rawurlencode( $event['venue_location']['address'] ) . '\"><strong>';\n\t\t}\n\n\t\t\t$output .= '<span itemprop=\"name\">' . $event['venue'] . '</span> ';\n\n\t\tif ( ! empty( $event['venue_link'] ) && 'infowindow' !== $style ) {\n\t\t\t$output .= '</a> ';\n\t\t}\n\t\tif ( ! empty( $event['venue_location'] ) && ! empty( $event['venue_location']['address'] ) && 'infowindow' === $style ) {\n\t\t\t$output .= '</strong></a><br> ';\n\t\t}\n\n\t\tif ( '1line' === $style ) {\n\t\t\t$output .= ', ';\n\t\t}\n\t\tif ( '2line' === $style || '3line' === $style ) {\n\t\t\t$output .= '<br>';\n\t\t}\n\t}\n\tswitch ( $style ) {\n\t\tcase '1line':\n\t\tcase '2line':\n\t\tcase '3line':\n\t\t\tif ( ! empty( $event['address'] ) ) {\n\t\t\t\t$output .= '<span class=\"address\">' . $event['address'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['address'] ) && ! empty( $event['city'] ) ) {\n\t\t\t\tif ( '1line' === $style || '2line' === $style ) {\n\t\t\t\t\t$output .= ', ';\n\t\t\t\t}\n\t\t\t\tif ( '3line' === $style ) {\n\t\t\t\t\t$output .= '<br>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( ! empty( $event['city'] ) ) {\n\t\t\t\t$output .= '<span class=\"city\">' . $event['city'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['city'] ) && ! empty( $event['state'] ) ) {\n\t\t\t\t$output .= ', ';\n\t\t\t}\n\t\t\tif ( ! empty( $event['state'] ) ) {\n\t\t\t\t$output .= '<span class=\"state\">' . $event['state'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['zip'] ) ) {\n\t\t\t\t$output .= ' <span class=\"zip\">' . $event['zip'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['country'] ) && $home_country !== $event['country'] ) {\n\t\t\t\tif ( ! empty( $event['address'] ) || ! empty( $event['city'] ) || ! empty( $event['state'] ) || ! empty( $event['zip'] ) ) {\n\t\t\t\t\t$output .= ', ';\n\t\t\t\t}\n\t\t\t\t$output .= '<span class=\"country\">' . $event['country'] . '</span>';\n\t\t\t}\n\n\t\t\t$map_location = '';\n\t\t\tif ( $maplink && get_option( 'options_map_link' ) ) :\n\t\t\t\t// to get full adress: if google map field exists, use that, otherwise try to concatenate address fields\n\t\t\t\tif ( ! empty( $event['venue_location']['address'] ) ) :\n\t\t\t\t\t$map_location = $event['venue_location']['address'];\n\t\t\t\telseif ( $event['address'] && ( ( $event['city'] && $event['state'] ) || $event['zip'] ) ) :\n\t\t\t\t\t$address_fields = array( 'city', 'state', 'zip', 'country' );\n\t\t\t\t\t$map_location = $event['address'];\n\t\t\t\t\tforeach ( $address_fields as $address_field ) {\n\t\t\t\t\t\tif ( $event[ $address_field ] ) :\n\t\t\t\t\t\t\t$map_location .= ' ' . $event[ $address_field ];\n\t\t\t\t\t\t\t$map_location .= 'city' === $address_field ? ',' : '';\n\t\t\t\t\t\tendif;\n\t\t\t\t\t}\n\t\t\t\tendif;\n\t\t\t\t$map_link = $map_location ? 'https://www.google.com/maps/search/' . rawurlencode( $map_location ) : '';\n\t\t\t\t$map_link = apply_filters( 'squarecandy_events_map_link', $map_link, $map_location );\n\t\t\t\tif ( $map_link ) :\n\t\t\t\t\t$output .= '<a class=\"button small button-gray button-map\" href=\"' . $map_link . '\">';\n\t\t\t\t\t$output .= '<i class=\"fa fa-map\"></i> ' . __( 'map', 'squarecandy-acf-events' );\n\t\t\t\t\t$output .= '</a>';\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\tif ( $map_location ) :\n\t\t\t\t$output .= '<meta itemprop=\"address\" content=\"' . $map_location . '\">';\n\t\t\tendif;\n\n\t\t\tbreak;\n\n\t\tcase 'infowindow':\n\t\t\t// for use with google maps\n\t\t\tif ( ! empty( $event['address'] ) ) {\n\t\t\t\t$output .= '<span class=\"address\">' . $event['address'] . '</span><br>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['city'] ) ) {\n\t\t\t\t$output .= '<span class=\"city\">' . $event['city'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['city'] ) && ! empty( $event['state'] ) ) {\n\t\t\t\t$output .= ', ';\n\t\t\t}\n\t\t\tif ( ! empty( $event['state'] ) ) {\n\t\t\t\t$output .= '<span class=\"state\">' . $event['state'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['zip'] ) ) {\n\t\t\t\t$output .= ' <span class=\"zip\">' . $event['zip'] . '</span>';\n\t\t\t}\n\t\t\tif ( ! empty( $event['country'] ) && $home_country !== $event['country'] ) {\n\t\t\t\t$output .= ', <span class=\"country\">' . $event['country'] . '</span>';\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'citystate':\n\t\tdefault:\n\t\t\t// for short display\n\t\t\tif ( ! empty( $event['city'] ) ) {\n\t\t\t\t$output .= '<span class=\"city\">' . $event['city'] . '</span>';\n\t\t\t}\n\t\t\tif ( $home_country && $event['country'] !== $home_country ) {\n\t\t\t\tif ( ! empty( $event['city'] ) ) {\n\t\t\t\t\t$output .= ', ';\n\t\t\t\t}\n\t\t\t\t$output .= '<span class=\"country\">' . $event['country'] . '</span>';\n\t\t\t} elseif ( ! empty( $event['state'] ) ) {\n\t\t\t\tif ( ! empty( $event['city'] ) ) {\n\t\t\t\t\t$output .= ', ';\n\t\t\t\t}\n\t\t\t\t$output .= '<span class=\"state\">' . $event['state'] . '</span>';\n\t\t\t}\n\t\t\tbreak;\n\n\t}\n\t$output .= '</div>';\n\treturn $output;\n}" ]
[ "0.63586575", "0.61061895", "0.6074119", "0.5827117", "0.57701993", "0.5763107", "0.5718681", "0.56439626", "0.5638342", "0.56327605", "0.5628657", "0.56158274", "0.5598621", "0.55870736", "0.5579986", "0.5571622", "0.5562785", "0.5561705", "0.554408", "0.55123574", "0.55083865", "0.5481702", "0.5448692", "0.5447379", "0.54337883", "0.5428083", "0.54104984", "0.5368541", "0.5349949", "0.5317753", "0.53014153", "0.5293579", "0.5277523", "0.52637994", "0.5261583", "0.5250242", "0.5212948", "0.51952964", "0.51900136", "0.5185102", "0.51841676", "0.5182573", "0.51744694", "0.51715994", "0.5171508", "0.517002", "0.51697356", "0.5169385", "0.51672393", "0.5165846", "0.5160438", "0.5159525", "0.51554394", "0.5143504", "0.51409316", "0.51308095", "0.51168466", "0.51134753", "0.5105761", "0.5104674", "0.5099226", "0.5084937", "0.5083451", "0.5074475", "0.50732005", "0.5068123", "0.50605625", "0.50525534", "0.5048684", "0.5047527", "0.5046519", "0.5046219", "0.50431484", "0.5035665", "0.5034739", "0.5028015", "0.500559", "0.500544", "0.5003925", "0.4993838", "0.49888852", "0.49716824", "0.4967739", "0.49598384", "0.49554512", "0.49486834", "0.49474147", "0.49466246", "0.49346727", "0.49333104", "0.49316093", "0.4928587", "0.49274856", "0.49246556", "0.49217552", "0.4920564", "0.491941", "0.49160868", "0.49148422", "0.49104637", "0.49015224" ]
0.0
-1
Returns completely builded JSON Schema
public function getSchema($fName, $forceNoCache = false) { if ($this->useCache && !$forceNoCache) { $cached = $this->getFromCache($fName); if ($cached !== false) { return $cached; } } // Not from cache, so build schema $rawSchema = $this->getRawSchema($fName); $dirname = dirname($fName); try { $builder = new Builder(); $builded = $builder->buildSchema($this, $rawSchema, $dirname); } catch (SchemaBuilderException $e) { switch ($e->getCode()) { case SchemaBuilderException::NO_EXTEND_FILE: case SchemaBuilderException::BROKEN_EXTEND: case SchemaBuilderException::INVALID_TYPE: case SchemaBuilderException::INVALID_PROPERTY: throw new InvalidSchemaException($e->getMessage()); break; default: throw new Exception($e->getMessage()); } } if ($this->useCache && !$forceNoCache) { $this->putToCache($fName, $builded); } return $builded; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function jsonschema() {\n return $this->service->jsonschema();\n }", "public static function schema() {\n\t\treturn array(\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'attribute' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'meta' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'multiline' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'query' => array(\n\t\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'selector' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'source' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'attribute', 'text', 'html', 'query' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'type' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'null', 'boolean', 'object', 'array', 'number', 'string', 'integer' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'required' => array( 'type' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'category' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'comment' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'editorScript' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.js$',\n\t\t\t\t),\n\t\t\t\t'editorStyle' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.css$',\n\t\t\t\t),\n\t\t\t\t'example' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'keywords' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'parent' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'script' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.js$',\n\t\t\t\t),\n\t\t\t\t'style' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.css$',\n\t\t\t\t),\n\t\t\t\t'styles' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'isDefault' => array(\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'label' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'supports' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'align' => array(\n\t\t\t\t\t\t\t'type' => array( 'boolean', 'array' ),\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'alignWide' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'anchor' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'className' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'customClassName' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'html' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'inserter' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'multiple' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'reusable' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'textdomain' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'title' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'required' => array( 'name', 'title' ),\n\t\t\t'additionalProperties' => false,\n\t\t);\n\t}", "public function get_item_schema() {\n\t\t$options = $this->get_registered_options();\n\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'settings',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(),\n\t\t);\n\n\t\tforeach ( $options as $option_name => $option ) {\n\t\t\t$schema['properties'][ $option_name ] = $option['schema'];\n\t\t}\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function getSchema() {}", "public function getSchema();", "public function getSchema();", "public function getSchema();", "public function getSchema(): Schema;", "public static function getSchema()\n {\n }", "public function get_item_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'report_orders',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'order_id' => array(\n\t\t\t\t\t'description' => __( 'Order ID.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'order_number' => array(\n\t\t\t\t\t'description' => __( 'Order Number.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_created' => array(\n\t\t\t\t\t'description' => __( \"Date the order was created, in the site's timezone.\", 'woocommerce' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_created_gmt' => array(\n\t\t\t\t\t'description' => __( 'Date the order was created, as GMT.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'Order status.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'customer_id' => array(\n\t\t\t\t\t'description' => __( 'Customer ID.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'num_items_sold' => array(\n\t\t\t\t\t'description' => __( 'Number of items sold.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'net_total' => array(\n\t\t\t\t\t'description' => __( 'Net total revenue.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'float',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'customer_type' => array(\n\t\t\t\t\t'description' => __( 'Returning or new customer.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'extended_info' => array(\n\t\t\t\t\t'products' => array(\n\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t'description' => __( 'List of order product IDs, names, quantities.', 'woocommerce' ),\n\t\t\t\t\t),\n\t\t\t\t\t'coupons' => array(\n\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t'description' => __( 'List of order coupons.', 'woocommerce' ),\n\t\t\t\t\t),\n\t\t\t\t\t'customer' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t'description' => __( 'Order customer information.', 'woocommerce' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function get_import_public_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'report_import',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'Regeneration status.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'message' => array(\n\t\t\t\t\t'description' => __( 'Regenerate data message.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "protected function getSchema()\n {\n return '{\n \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n \"title\":\"' . $this->name . ' Schema\",\n \"description\":\"' . $this->description . '\",\n \"type\":\"object\",\n \"additionalProperties\":false,\n \"properties\":{\n \"string\":{\n \"type\":\"string\",\n \"description\": \"The input string to process\"\n }\n },\n \"required\":[\n \"string\"\n ]\n }';\n }", "public function getSchemaJson()\n {\n $schemaJson = '';\n\n switch ($this->ImportClass) {\n case 'Questionnaire':\n $pathToSchema = BASE_PATH . $this->config()->json_schema_questionnaire;\n $schemaJson = file_get_contents($pathToSchema);\n break;\n case 'Task':\n $pathToSchema = BASE_PATH . $this->config()->json_schema_task;\n $schemaJson = file_get_contents($pathToSchema);\n break;\n case 'Security Component':\n $pathToSchema = BASE_PATH . $this->config()->json_schema_security_component;\n $schemaJson = file_get_contents($pathToSchema);\n break;\n }\n\n return $schemaJson;\n }", "public function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'url-details',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'title' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML title tag. */\n\t\t\t\t\t\t__( 'The contents of the %s element from the URL.' ),\n\t\t\t\t\t\t'<title>'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML link tag. */\n\t\t\t\t\t\t__( 'The favicon image link of the %s element from the URL.' ),\n\t\t\t\t\t\t'<link rel=\"icon\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML meta tag. */\n\t\t\t\t\t\t__( 'The content of the %s element from the URL.' ),\n\t\t\t\t\t\t'<meta name=\"description\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'image' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: 1: HTML meta tag, 2: HTML meta tag. */\n\t\t\t\t\t\t__( 'The Open Graph image link of the %1$s or %2$s element from the URL.' ),\n\t\t\t\t\t\t'<meta property=\"og:image\">',\n\t\t\t\t\t\t'<meta property=\"og:image:url\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}", "public abstract function getSchemaListToGenerate();", "public function get_item_schema() {\n\t\t$weight_unit = get_option( 'woocommerce_weight_unit' );\n\t\t$dimension_unit = get_option( 'woocommerce_dimension_unit' );\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'product',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'id' => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the resource.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'description' => __( 'Product name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_filter_post_kses',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'slug' => array(\n\t\t\t\t\t'description' => __( 'Product slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'permalink' => array(\n\t\t\t\t\t'description' => __( 'Product URL.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_created' => array(\n\t\t\t\t\t'description' => __( \"The date the product was created, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_created_gmt' => array(\n\t\t\t\t\t'description' => __( 'The date the product was created, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_modified' => array(\n\t\t\t\t\t'description' => __( \"The date the product was last modified, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_modified_gmt' => array(\n\t\t\t\t\t'description' => __( 'The date the product was last modified, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'type' => array(\n\t\t\t\t\t'description' => __( 'Product type.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'simple',\n\t\t\t\t\t'enum' => array_keys( wc_get_product_types() ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'Product status (post status).', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'publish',\n\t\t\t\t\t'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'featured' => array(\n\t\t\t\t\t'description' => __( 'Featured product.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'catalog_visibility' => array(\n\t\t\t\t\t'description' => __( 'Catalog visibility.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'visible',\n\t\t\t\t\t'enum' => array( 'visible', 'catalog', 'search', 'hidden' ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => __( 'Product description.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_filter_post_kses',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'short_description' => array(\n\t\t\t\t\t'description' => __( 'Product short description.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_filter_post_kses',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'sku' => array(\n\t\t\t\t\t'description' => __( 'Unique identifier.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wc_clean',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'price' => array(\n\t\t\t\t\t'description' => __( 'Current product price.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'regular_price' => array(\n\t\t\t\t\t'description' => __( 'Product regular price.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'sale_price' => array(\n\t\t\t\t\t'description' => __( 'Product sale price.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_from' => array(\n\t\t\t\t\t'description' => __( \"Start date of sale price, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_from_gmt' => array(\n\t\t\t\t\t'description' => __( 'Start date of sale price, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_to' => array(\n\t\t\t\t\t'description' => __( \"End date of sale price, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_to_gmt' => array(\n\t\t\t\t\t'description' => __( \"End date of sale price, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'price_html' => array(\n\t\t\t\t\t'description' => __( 'Price formatted in HTML.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'on_sale' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product is on sale.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'purchasable' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product can be bought.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'total_sales' => array(\n\t\t\t\t\t'description' => __( 'Amount of sales.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'virtual' => array(\n\t\t\t\t\t'description' => __( 'If the product is virtual.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'downloadable' => array(\n\t\t\t\t\t'description' => __( 'If the product is downloadable.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'downloads' => array(\n\t\t\t\t\t'description' => __( 'List of downloadable files.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'File ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'File name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'file' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'File URL.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'download_limit' => array(\n\t\t\t\t\t'description' => __( 'Number of times downloadable files can be downloaded after purchase.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => -1,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'download_expiry' => array(\n\t\t\t\t\t'description' => __( 'Number of days until access to downloadable files expires.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => -1,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'external_url' => array(\n\t\t\t\t\t'description' => __( 'Product external URL. Only for external products.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'button_text' => array(\n\t\t\t\t\t'description' => __( 'Product external button text. Only for external products.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'tax_status' => array(\n\t\t\t\t\t'description' => __( 'Tax status.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'taxable',\n\t\t\t\t\t'enum' => array( 'taxable', 'shipping', 'none' ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'tax_class' => array(\n\t\t\t\t\t'description' => __( 'Tax class.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'manage_stock' => array(\n\t\t\t\t\t'description' => __( 'Stock management at product level.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'stock_quantity' => array(\n\t\t\t\t\t'description' => __( 'Stock quantity.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'stock_status' => array(\n\t\t\t\t\t'description' => __( 'Controls the stock status of the product.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'instock',\n\t\t\t\t\t'enum' => array_keys( wc_get_product_stock_status_options() ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'backorders' => array(\n\t\t\t\t\t'description' => __( 'If managing stock, this controls if backorders are allowed.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t'enum' => array( 'no', 'notify', 'yes' ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'backorders_allowed' => array(\n\t\t\t\t\t'description' => __( 'Shows if backorders are allowed.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'backordered' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product is on backordered.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'sold_individually' => array(\n\t\t\t\t\t'description' => __( 'Allow one item to be bought in a single order.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'weight' => array(\n\t\t\t\t\t/* translators: %s: weight unit */\n\t\t\t\t\t'description' => sprintf( __( 'Product weight (%s).', 'woocommerce-rest-api' ), $weight_unit ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'dimensions' => array(\n\t\t\t\t\t'description' => __( 'Product dimensions.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'length' => array(\n\t\t\t\t\t\t\t/* translators: %s: dimension unit */\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Product length (%s).', 'woocommerce-rest-api' ), $dimension_unit ),\n\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'width' => array(\n\t\t\t\t\t\t\t/* translators: %s: dimension unit */\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Product width (%s).', 'woocommerce-rest-api' ), $dimension_unit ),\n\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'height' => array(\n\t\t\t\t\t\t\t/* translators: %s: dimension unit */\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Product height (%s).', 'woocommerce-rest-api' ), $dimension_unit ),\n\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'shipping_required' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product need to be shipped.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'shipping_taxable' => array(\n\t\t\t\t\t'description' => __( 'Shows whether or not the product shipping is taxable.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'shipping_class' => array(\n\t\t\t\t\t'description' => __( 'Shipping class slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'shipping_class_id' => array(\n\t\t\t\t\t'description' => __( 'Shipping class ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'reviews_allowed' => array(\n\t\t\t\t\t'description' => __( 'Allow reviews.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => true,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'average_rating' => array(\n\t\t\t\t\t'description' => __( 'Reviews average rating.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'rating_count' => array(\n\t\t\t\t\t'description' => __( 'Amount of reviews that the product have.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'related_ids' => array(\n\t\t\t\t\t'description' => __( 'List of related products IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'upsell_ids' => array(\n\t\t\t\t\t'description' => __( 'List of up-sell products IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'cross_sell_ids' => array(\n\t\t\t\t\t'description' => __( 'List of cross-sell products IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'parent_id' => array(\n\t\t\t\t\t'description' => __( 'Product parent ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'purchase_note' => array(\n\t\t\t\t\t'description' => __( 'Optional note to send the customer after purchase.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_kses_post',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'categories' => array(\n\t\t\t\t\t'description' => __( 'List of categories.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Category ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Category name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Category slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'tags' => array(\n\t\t\t\t\t'description' => __( 'List of tags.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Tag ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Tag name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Tag slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'images' => array(\n\t\t\t\t\t'description' => __( 'List of images.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_created' => array(\n\t\t\t\t\t\t\t\t'description' => __( \"The date the image was created, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_created_gmt' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'The date the image was created, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_modified' => array(\n\t\t\t\t\t\t\t\t'description' => __( \"The date the image was last modified, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_modified_gmt' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'The date the image was last modified, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'src' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image URL.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'alt' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image alternative text.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'description' => __( 'List of attributes.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'position' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute position.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'visible' => array(\n\t\t\t\t\t\t\t\t'description' => __( \"Define if the attribute is visible on the \\\"Additional information\\\" tab in the product's page.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t\t'default' => false,\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'variation' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Define if the attribute can be used as variation.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t\t'default' => false,\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'List of available term names of the attribute.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default_attributes' => array(\n\t\t\t\t\t'description' => __( 'Defaults variation attributes.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Selected attribute term name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'variations' => array(\n\t\t\t\t\t'description' => __( 'List of variations IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'grouped_products' => array(\n\t\t\t\t\t'description' => __( 'List of grouped products ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'menu_order' => array(\n\t\t\t\t\t'description' => __( 'Menu order, used to custom sort products.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'meta_data' => array(\n\t\t\t\t\t'description' => __( 'Meta data.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Meta ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'key' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Meta key.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'value' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Meta value.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'mixed',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function vieSchemaAction() {\n\t\t$this->response->setHeader('Content-Type', 'application/json');\n\n\t\treturn json_encode($this->vieSchemaBuilder->generateVieSchema());\n\t}", "protected function updateSchema() {\n $params = array();\n if(self::$schemaLanguage != null) {\n $params['language'] = self::$schemaLanguage;\n }\n $result = WebApi::getJSONData('ITFItems_440', 'GetSchema', 1, $params);\n\n self::$attributeSchema = array();\n foreach($result->attributes->attribute as $attributeData) {\n self::$attributeSchema[$attributeData->name] = $attributeData;\n }\n\n self::$itemSchema = array();\n foreach($result->items->item as $itemData) {\n self::$itemSchema[$itemData->defindex] = $itemData;\n }\n\n self::$qualities = array();\n foreach($result->qualities as $quality => $id) {\n self::$qualities[$id] = $quality;\n }\n }", "public function get_item_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'status',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'name' => array(\n\t\t\t\t\t'description' => __( 'The title for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'private' => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be private.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'protected' => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be protected.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'public' => array(\n\t\t\t\t\t'description' => __( 'Whether posts of this status should be shown in the front end of the site.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'queryable' => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be publicly-queryable.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'show_in_list' => array(\n\t\t\t\t\t'description' => __( 'Whether to include posts in the edit listing for their post type.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'slug' => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public static function get_schema()\n {\n }", "public function get_item_schema(): array {\n\t\tif ( $this->schema ) {\n\t\t\t/**\n\t\t\t * Schema.\n\t\t\t *\n\t\t\t * @phpstan-var Schema $schema\n\t\t\t */\n\t\t\t$schema = $this->add_additional_fields_schema( $this->schema );\n\t\t\treturn $schema;\n\t\t}\n\n\t\t$schema = [\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'status',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => [\n\t\t\t\t'success' => [\n\t\t\t\t\t'description' => __( 'Whether check was successful', 'web-stories' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => [ 'view', 'edit', 'embed' ],\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$this->schema = $schema;\n\n\t\t/**\n\t\t * Schema.\n\t\t *\n\t\t * @phpstan-var Schema $schema\n\t\t */\n\t\t$schema = $this->add_additional_fields_schema( $this->schema );\n\t\treturn $schema;\n\t}", "public function generateSchema(): array\n {\n if (! $this->context->get('is_entry')) {\n return [];\n }\n\n // Site owner: Organization/Person.\n $siteOwner = $this->generateOwnerSchema();\n\n // WebSite.\n $website = $this->generateWebSiteSchema();\n $website->addData('publisher', ['@id' => $siteOwner->getData('@id')]);\n\n // WebPage.\n $webpage = $this->generateWebPageSchema();\n $webpage->addData('isPartOf', ['@id' => $website->getData('@id')]);\n $webpage->addData('about', ['@id' => $siteOwner->getData('@id')]);\n\n // Article (Posts collection only).\n $article = null;\n\n if ($this->context->get('collection')->handle() === 'posts') {\n $article = $this->generateArticleSchema();\n $article->addData('mainEntityOfPage', ['@id' => $webpage->getData('@id')]);\n $article->addData('publisher', ['@id' => $siteOwner->getData('@id')]);\n }\n\n // Featured image.\n $primaryImage = $this->generateFeaturedImageSchema();\n\n // Schema Graph\n $schema = new Schema();\n $schema->addGraph($siteOwner);\n $schema->addGraph($website);\n $schema->addGraph($webpage);\n $schema->addGraph($article);\n\n if ($primaryImage) {\n $webpage->addData('primaryImageOfPage', ['@id' => $primaryImage->getData('@id')]);\n $article->addData('image', ['@id' => $primaryImage->getData('@id')]);\n\n $schema->addGraph($primaryImage);\n }\n\n return array_filter([\n $schema->generate(),\n $this->getAdditionalSchema()\n ]);\n }", "protected function get_public_batch_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'batch',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'create' => array(\n\t\t\t\t\t'description' => __( 'List of created resources.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'update' => array(\n\t\t\t\t\t'description' => __( 'List of updated resources.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'delete' => array(\n\t\t\t\t\t'description' => __( 'List of delete resources.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $schema;\n\t}", "public function schema();", "private function init(): void {\n\t\t$this->required = $this->json['required'] ?? array();\n\t\t$this->additional_properties = $this->json['additionalProperties'] ?? false;\n\t\t$this->required = $this->json['required'] ?? array();\n\n\t\t$properties = $this->json['properties'] ?? array();\n\t\t$definitions = $this->json['definitions'] ?? array();\n\t\t$all_of = $this->json['allOf'] ?? array();\n\n\t\tforeach ( $definitions as $key => $definition ) {\n\t\t\t$this->definitions[ $key ] = self::from_json( $this->get_name() . '/definitions/' . $key, array( 'properties' => $definition ) );\n\t\t}\n\n\t\tforeach ( $properties as $key => $property ) {\n\t\t\t// If object, create a new schema.\n\t\t\tif ( 'object' === ( $property['type'] ?? '' ) ) {\n\t\t\t\t$this->properties[ $key ] = self::from_json( $this->get_name() . '/properties/' . $key, $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$this->properties[ $key ] = $this->get_reference( $property );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->properties[ $key ] = Property::from_json( $this, $key, $property );\n\t\t}\n\n\t\tforeach ( $all_of as $one_key => $one_value ) {\n\t\t\t$key = array_key_first( $one_value );\n\t\t\t$value = $one_value[ $key ];\n\n\t\t\tswitch ( $key ) {\n\t\t\t\tcase self::REF__KEY:\n\t\t\t\t\t$reference = $this->get_reference( $value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $reference->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $reference->get_required() );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'properties':\n\t\t\t\t\t$one_prop = self::from_json( $this->get_name() . '/oneof/' . $one_key, $one_value );\n\t\t\t\t\t$this->properties = array_merge( $this->properties, $one_prop->get_properties() );\n\t\t\t\t\t$this->required = array_merge( $this->required, $one_prop->get_required() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function get_schema()\n {\n }", "public function getSchema(): string;", "public function getSchema(): string;", "public static function output_schema() {\n\n\t\t\t$pre_data_schema = self::pre_data_schema();\n\n\t\t\tforeach ( $pre_data_schema as $json ) {\n\n\t\t\t\techo '<script type=\"application/ld+json\">' . wp_json_encode( $json, JSON_PRETTY_PRINT ) . '</script>';\n\t\t\t}\n\t\t}", "public function get_stats_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics',\n\t\t\t\t'parent' => 'quiz',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID.',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'description' => __( 'User ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'date' => array(\n\t\t\t\t\t\t'description' => __( 'Date.', 'learndash' ),\n\t\t\t\t\t\t'type' => array( 'string', null ),\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_correct' => array(\n\t\t\t\t\t\t'description' => __( 'Answer correct.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_incorrect' => array(\n\t\t\t\t\t\t'description' => __( 'Answer incorrect.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "static public function get_settings_schema() {\n\n $_schema = json_decode( wp_remote_retrieve_body( wp_remote_get( WPP_API_URL_STANDARDS . '/schema' ) ), true );\n\n return isset( $_schema['data'] ) ? $_schema['data'] : array();\n\n }", "public function fullSchema() {\n if (!isset($this->fullSchema)) {\n $this->fullSchema = $this->schema([\n 'accessTokenID:i' => 'The unique numeric ID.',\n 'name:s|n' => 'A user-specified label.',\n 'dateInserted:dt' => 'When the token was generated.'\n ], 'Token');\n }\n return $this->fullSchema;\n }", "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "private function resolveSchema() : Schema\n {\n return resolve('Schema');\n }", "function getBodySchema()\r\n {\r\n }", "public function build()\n {\n return $this->schema->toArray();\n }", "function raptor_scheduling_schema()\n{\n $schema = array();\n\n $oSH = new \\raptor_sched\\DBScheduleSchema();\n $oSH->addToSchema($schema);\n \n return $schema;\n}", "public function schema()\n {\n $queryType = new ObjectType([\n 'name' => 'Query',\n 'fields' => $this->queries,\n ]);\n\n $mutationType = new ObjectType([\n 'name' => 'Mutation',\n 'fields' => $this->mutations,\n ]);\n\n return new Schema([\n 'query' => $queryType,\n 'mutation' => $mutationType,\n // usually inferred from 'query', but required for polymorphism on InterfaceType-based query results\n 'types' => $this->types,\n ]);\n }", "public function get_stats_questions_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics-questions',\n\t\t\t\t'parent' => 'quiz-statistics',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique ID for Statistics Question.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'statistic' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question_type' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s Type',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_scored' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points scored.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_total' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points total.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'The collection of %s answers.',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'student' => array(\n\t\t\t\t\t\t'description' => __( 'The collection of student submitted answers.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "protected function _buildSchema(Schema $schema)\n {\n return $schema->addField('url', 'string')\n ->addField('webroot', ['type' => 'string'])\n ->addField('force', ['type' => 'boolean']);\n }", "public function nodeTypeSchemaAction() {\n\t\t$this->response->setHeader('Content-Type', 'application/json');\n\n\t\treturn json_encode($this->nodeTypeSchemaBuilder->generateNodeTypeSchema());\n\t}", "public static function getSchemaBuilder()\n {\n }", "public function getSchema(): SchemaInterface;", "public function createSchema() : string;", "public function generate()\n {\n $this->schema->put('@graph', $this->expandGraphs());\n\n return $this->schema->toJson();\n }", "abstract protected function getSchema(): string;", "public function parse(): ResponseSchema\n {\n return new ResponseSchema();\n }", "protected function schemaDefinition() {\n $schema = parent::schemaDefinition();\n\n $schema['views_test_data']['fields']['uid'] = [\n 'description' => \"The {users}.uid of the author of the beatle entry.\",\n 'type' => 'int',\n 'unsigned' => TRUE,\n 'not null' => TRUE,\n 'default' => 0,\n ];\n\n return $schema;\n }", "public static function schemaDef()\n {\n return array(\n 'description' => 'Record of answers to questions',\n 'fields' => array(\n 'id' => array(\n 'type' => 'char',\n 'length' => 36,\n 'not null' => true, 'description' => 'UUID of the response'),\n 'uri' => array(\n 'type' => 'varchar',\n 'length' => 255,\n 'not null' => true,\n 'description' => 'UUID to the answer notice'\n ),\n 'question_id' => array(\n 'type' => 'char',\n 'length' => 36,\n 'not null' => true,\n 'description' => 'UUID of question being responded to'\n ),\n 'content' => array('type' => 'text'), // got a better name?\n 'best' => array('type' => 'int', 'size' => 'tiny'),\n 'revisions' => array('type' => 'int'),\n 'profile_id' => array('type' => 'int'),\n 'created' => array('type' => 'datetime', 'not null' => true),\n ),\n 'primary key' => array('id'),\n 'unique keys' => array(\n 'question_uri_key' => array('uri'),\n 'question_id_profile_id_key' => array('question_id', 'profile_id'),\n ),\n 'indexes' => array(\n 'profile_id_question_id_index' => array('profile_id', 'question_id'),\n )\n );\n }", "public function get_public_item_schema()\n {\n }", "protected function _buildSchema(Schema $schema)\n {\n return $schema;\n }", "private function generateSchema(string $schemaClassName): object\n {\n $schemaReflection = new \\ReflectionClass($schemaClassName);\n\n $scan = \\OpenApi\\scan($schemaReflection->getFileName(), [\n 'analysis' => new TestAnalysis()\n ]);\n\n return json_decode($scan->components->schemas[0]->toJson());\n }", "function getRequestSchema($path, $method, $asJson, $jsonTidy)\n {\n $this->log->debug(\"Method: getRequestSchema\");\n\n $schema = $this->schemaManager->getRequestSchema($path, $method);\n\n if (!$asJson) {\n return $schema;\n }\n\n if ($jsonTidy) {\n return json_encode($schema, JSON_PRETTY_PRINT);\n } else {\n return json_encode($schema);\n }\n }", "public function json_ld() {\n\t\t$deprecated_data = array(\n\t\t\t'_deprecated' => 'Please use the \"wpseo_schema_*\" filters to extend the Yoast SEO schema data - see the WPSEO_Schema class.',\n\t\t);\n\n\t\t/**\n\t\t * Filter: 'wpseo_json_ld_output' - Allows disabling Yoast's schema output entirely.\n\t\t *\n\t\t * @api mixed If false or an empty array is returned, disable our output.\n\t\t */\n\t\t$return = apply_filters( 'wpseo_json_ld_output', $deprecated_data, '' );\n\t\tif ( $return === array() || $return === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdo_action( 'wpseo_json_ld' );\n\t}", "public static function get_static_schema()\n {\n }", "public function schema()\n\t{\n\t\treturn $this->schema;\n\t}", "public function schema()\n {\n return [\n 'post' => [\n 'name' => 'string', \n 'surname' => 'string', \n 'description' => 'string', \n 'gender' => 'string[male|female]', \n 'phone' => 'string', \n 'email' => 'string[email]', \n 'pobox' => 'string', \n 'group_id' => 'number',\n 'address' => [\n 'billing' => [\n 'name' => 'string',\n 'surname' => 'string',\n 'phone' => 'string',\n 'address_1' => 'string',\n 'address_2' => 'string',\n 'country' => 'string',\n 'city' => 'string',\n 'pobox' => 'string',\n 'company' => 'string',\n ], \n 'shipping' => [\n 'name' => 'string',\n 'surname' => 'string',\n 'phone' => 'string',\n 'address_1' => 'string',\n 'address_2' => 'string',\n 'country' => 'string',\n 'city' => 'string',\n 'pobox' => 'string',\n 'company' => 'string',\n ]\n ]\n ], \n 'put' => [\n 'name' => 'string', \n 'surname' => 'string', \n 'description' => 'string', \n 'gender' => 'string[male|female]', \n 'phone' => 'string', \n 'email' => 'string[email]', \n 'pobox' => 'string', \n 'group_id' => 'number'\n ]\n ];\n }", "public function getSchema()\n {\n if ($this->schema) {\n return $this->schema;\n }\n\n return $this->schema = resolve(Bakery::getModelSchema($this));\n }", "public function getSchema()\n {\n return [\n \"name\" => \"RecapHoldRequest\",\n \"type\" => \"record\",\n \"fields\" => [\n [\"name\" => \"id\", \"type\" => \"int\"],\n [\"name\" => \"trackingId\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"patronBarcode\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"itemBarcode\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"createdDate\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"updatedDate\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"owningInstitutionId\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"description\", \"type\" => [\n \"null\",\n [\n \"name\" => \"description\",\n \"type\" => \"record\",\n \"fields\" => [\n [\"name\" => \"title\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"author\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"callNumber\", \"type\" => [\"string\", \"null\"]],\n ]\n ]\n ]\n ],\n ]\n ];\n }", "public function getSchema(): Schema\n {\n if ($this->_schema === null) {\n $this->_schema = $this->_initializeSchema($this->getWebservice()->describe($this->getName()));\n }\n\n return $this->_schema;\n }", "public function createSchema(): OpenApi\n {\n }", "public function get_schema() {\n\t\treturn $this->schema;\n\t}", "public function getSchema()\n {\n return $this->source;\n }", "public function getSchema()\n {\n if (empty($this->schema)) {\n return 'public';\n } else {\n return $this->schema;\n }\n }", "public abstract function getSchemaHelperListToGenerate();", "public function compileSchema();", "function exportsSchema(){\n\t\t\treturn $this->exportsSchema;\n\t\t}", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }" ]
[ "0.76166433", "0.7243173", "0.7202124", "0.716033", "0.69248503", "0.69248503", "0.69248503", "0.6869203", "0.6858565", "0.67767495", "0.67184454", "0.67168903", "0.6711997", "0.6698887", "0.66834754", "0.6657636", "0.6648612", "0.655978", "0.65495557", "0.65265256", "0.64868915", "0.6485047", "0.64597726", "0.64479387", "0.6425528", "0.6411162", "0.6406587", "0.6406587", "0.64049053", "0.64038014", "0.6396363", "0.63645303", "0.6347321", "0.63163906", "0.6289523", "0.62488693", "0.6234212", "0.6171106", "0.61539215", "0.6143324", "0.6143324", "0.6143324", "0.6143324", "0.6143324", "0.6143324", "0.61363596", "0.6090204", "0.6086482", "0.6081254", "0.60810244", "0.60758865", "0.60470945", "0.60413206", "0.6027071", "0.60046685", "0.6002633", "0.5995392", "0.5990373", "0.5987644", "0.59828013", "0.5977527", "0.5974441", "0.59670556", "0.5960161", "0.5958444", "0.59297705", "0.5923341", "0.59218943", "0.5908682", "0.5904681", "0.58977735", "0.5882925", "0.587172", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307", "0.5869307" ]
0.0
-1
Returns raw JSON Schema
public function getRawSchema($fName) { $fName = $this->schemaDir . '/' . $fName; if (!file_exists($fName)) { $msg = sprintf("Schema file '%s' not found", $fName); $code = SchemaProviderException::SCHEMA_NOT_FOUND; throw new SchemaProviderException($msg, $code); } $schema = file_get_contents($fName); $decoded = json_decode($schema); if (is_null($decoded)) { $msg = sprintf("Unable to decode file '%s' as JSON", $fName); $code = SchemaProviderException::UNPARSABLE_JSON; throw new SchemaProviderException($msg, $code); } return $schema; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function jsonschema() {\n return $this->service->jsonschema();\n }", "protected function getSchema()\n {\n return '{\n \"$schema\":\"http://json-schema.org/draft-04/schema#\",\n \"title\":\"' . $this->name . ' Schema\",\n \"description\":\"' . $this->description . '\",\n \"type\":\"object\",\n \"additionalProperties\":false,\n \"properties\":{\n \"string\":{\n \"type\":\"string\",\n \"description\": \"The input string to process\"\n }\n },\n \"required\":[\n \"string\"\n ]\n }';\n }", "public function getSchema() {}", "public function getSchema();", "public function getSchema();", "public function getSchema();", "public function getSchema(): Schema;", "public static function schema() {\n\t\treturn array(\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'attribute' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'meta' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'multiline' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'query' => array(\n\t\t\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'selector' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'source' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'attribute', 'text', 'html', 'query' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'type' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'null', 'boolean', 'object', 'array', 'number', 'string', 'integer' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'required' => array( 'type' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'category' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'comment' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'editorScript' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.js$',\n\t\t\t\t),\n\t\t\t\t'editorStyle' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.css$',\n\t\t\t\t),\n\t\t\t\t'example' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'additionalProperties' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'keywords' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'parent' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'script' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.js$',\n\t\t\t\t),\n\t\t\t\t'style' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'pattern' => '\\.css$',\n\t\t\t\t),\n\t\t\t\t'styles' => array(\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'isDefault' => array(\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'label' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'supports' => array(\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'align' => array(\n\t\t\t\t\t\t\t'type' => array( 'boolean', 'array' ),\n\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'enum' => array( 'left', 'center', 'right', 'wide', 'full' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'alignWide' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'anchor' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'className' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'customClassName' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'html' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'inserter' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'multiple' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'reusable' => array(\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'textdomain' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t\t'title' => array(\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'required' => array( 'name', 'title' ),\n\t\t\t'additionalProperties' => false,\n\t\t);\n\t}", "public function getSchema(): string;", "public function getSchema(): string;", "public function getSchemaJson()\n {\n $schemaJson = '';\n\n switch ($this->ImportClass) {\n case 'Questionnaire':\n $pathToSchema = BASE_PATH . $this->config()->json_schema_questionnaire;\n $schemaJson = file_get_contents($pathToSchema);\n break;\n case 'Task':\n $pathToSchema = BASE_PATH . $this->config()->json_schema_task;\n $schemaJson = file_get_contents($pathToSchema);\n break;\n case 'Security Component':\n $pathToSchema = BASE_PATH . $this->config()->json_schema_security_component;\n $schemaJson = file_get_contents($pathToSchema);\n break;\n }\n\n return $schemaJson;\n }", "public function get_item_schema() {\n\t\t$options = $this->get_registered_options();\n\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'settings',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(),\n\t\t);\n\n\t\tforeach ( $options as $option_name => $option ) {\n\t\t\t$schema['properties'][ $option_name ] = $option['schema'];\n\t\t}\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "public static function getSchema()\n {\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function vieSchemaAction() {\n\t\t$this->response->setHeader('Content-Type', 'application/json');\n\n\t\treturn json_encode($this->vieSchemaBuilder->generateVieSchema());\n\t}", "public static function get_schema()\n {\n }", "public function schema()\n\t{\n\t\treturn $this->schema;\n\t}", "public function get_schema()\n {\n }", "public function get_item_schema() {\n\t\tif ( $this->schema ) {\n\t\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t\t}\n\n\t\t$this->schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'url-details',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'title' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML title tag. */\n\t\t\t\t\t\t__( 'The contents of the %s element from the URL.' ),\n\t\t\t\t\t\t'<title>'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML link tag. */\n\t\t\t\t\t\t__( 'The favicon image link of the %s element from the URL.' ),\n\t\t\t\t\t\t'<link rel=\"icon\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: %s: HTML meta tag. */\n\t\t\t\t\t\t__( 'The content of the %s element from the URL.' ),\n\t\t\t\t\t\t'<meta name=\"description\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'image' => array(\n\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t/* translators: 1: HTML meta tag, 2: HTML meta tag. */\n\t\t\t\t\t\t__( 'The Open Graph image link of the %1$s or %2$s element from the URL.' ),\n\t\t\t\t\t\t'<meta property=\"og:image\">',\n\t\t\t\t\t\t'<meta property=\"og:image:url\">'\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $this->schema );\n\t}", "public function schema();", "public function fullSchema() {\n if (!isset($this->fullSchema)) {\n $this->fullSchema = $this->schema([\n 'accessTokenID:i' => 'The unique numeric ID.',\n 'name:s|n' => 'A user-specified label.',\n 'dateInserted:dt' => 'When the token was generated.'\n ], 'Token');\n }\n return $this->fullSchema;\n }", "public function get_item_schema(): array {\n\t\tif ( $this->schema ) {\n\t\t\t/**\n\t\t\t * Schema.\n\t\t\t *\n\t\t\t * @phpstan-var Schema $schema\n\t\t\t */\n\t\t\t$schema = $this->add_additional_fields_schema( $this->schema );\n\t\t\treturn $schema;\n\t\t}\n\n\t\t$schema = [\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'status',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => [\n\t\t\t\t'success' => [\n\t\t\t\t\t'description' => __( 'Whether check was successful', 'web-stories' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => [ 'view', 'edit', 'embed' ],\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$this->schema = $schema;\n\n\t\t/**\n\t\t * Schema.\n\t\t *\n\t\t * @phpstan-var Schema $schema\n\t\t */\n\t\t$schema = $this->add_additional_fields_schema( $this->schema );\n\t\treturn $schema;\n\t}", "abstract protected function getSchema(): string;", "public function get_schema() {\n\t\treturn $this->schema;\n\t}", "public function getSchema()\n {\n return $this->source;\n }", "public function getSchema()\n {\n return [\n \"name\" => \"RecapHoldRequest\",\n \"type\" => \"record\",\n \"fields\" => [\n [\"name\" => \"id\", \"type\" => \"int\"],\n [\"name\" => \"trackingId\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"patronBarcode\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"itemBarcode\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"createdDate\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"updatedDate\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"owningInstitutionId\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"description\", \"type\" => [\n \"null\",\n [\n \"name\" => \"description\",\n \"type\" => \"record\",\n \"fields\" => [\n [\"name\" => \"title\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"author\", \"type\" => [\"string\", \"null\"]],\n [\"name\" => \"callNumber\", \"type\" => [\"string\", \"null\"]],\n ]\n ]\n ]\n ],\n ]\n ];\n }", "public function nodeTypeSchemaAction() {\n\t\t$this->response->setHeader('Content-Type', 'application/json');\n\n\t\treturn json_encode($this->nodeTypeSchemaBuilder->generateNodeTypeSchema());\n\t}", "public function get_item_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'report_orders',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'order_id' => array(\n\t\t\t\t\t'description' => __( 'Order ID.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'order_number' => array(\n\t\t\t\t\t'description' => __( 'Order Number.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_created' => array(\n\t\t\t\t\t'description' => __( \"Date the order was created, in the site's timezone.\", 'woocommerce' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_created_gmt' => array(\n\t\t\t\t\t'description' => __( 'Date the order was created, as GMT.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'Order status.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'customer_id' => array(\n\t\t\t\t\t'description' => __( 'Customer ID.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'num_items_sold' => array(\n\t\t\t\t\t'description' => __( 'Number of items sold.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'net_total' => array(\n\t\t\t\t\t'description' => __( 'Net total revenue.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'float',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'customer_type' => array(\n\t\t\t\t\t'description' => __( 'Returning or new customer.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'extended_info' => array(\n\t\t\t\t\t'products' => array(\n\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t'description' => __( 'List of order product IDs, names, quantities.', 'woocommerce' ),\n\t\t\t\t\t),\n\t\t\t\t\t'coupons' => array(\n\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t'description' => __( 'List of order coupons.', 'woocommerce' ),\n\t\t\t\t\t),\n\t\t\t\t\t'customer' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t'description' => __( 'Order customer information.', 'woocommerce' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function getSchema()\n {\n if (empty($this->schema)) {\n return 'public';\n } else {\n return $this->schema;\n }\n }", "public function get_item_schema() {\n\t\t$weight_unit = get_option( 'woocommerce_weight_unit' );\n\t\t$dimension_unit = get_option( 'woocommerce_dimension_unit' );\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'product',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'id' => array(\n\t\t\t\t\t'description' => __( 'Unique identifier for the resource.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'description' => __( 'Product name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_filter_post_kses',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'slug' => array(\n\t\t\t\t\t'description' => __( 'Product slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t),\n\t\t\t\t'permalink' => array(\n\t\t\t\t\t'description' => __( 'Product URL.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_created' => array(\n\t\t\t\t\t'description' => __( \"The date the product was created, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_created_gmt' => array(\n\t\t\t\t\t'description' => __( 'The date the product was created, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_modified' => array(\n\t\t\t\t\t'description' => __( \"The date the product was last modified, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'date_modified_gmt' => array(\n\t\t\t\t\t'description' => __( 'The date the product was last modified, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'type' => array(\n\t\t\t\t\t'description' => __( 'Product type.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'simple',\n\t\t\t\t\t'enum' => array_keys( wc_get_product_types() ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'Product status (post status).', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'publish',\n\t\t\t\t\t'enum' => array_merge( array_keys( get_post_statuses() ), array( 'future' ) ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'featured' => array(\n\t\t\t\t\t'description' => __( 'Featured product.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'catalog_visibility' => array(\n\t\t\t\t\t'description' => __( 'Catalog visibility.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'visible',\n\t\t\t\t\t'enum' => array( 'visible', 'catalog', 'search', 'hidden' ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'description' => __( 'Product description.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_filter_post_kses',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'short_description' => array(\n\t\t\t\t\t'description' => __( 'Product short description.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_filter_post_kses',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'sku' => array(\n\t\t\t\t\t'description' => __( 'Unique identifier.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wc_clean',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'price' => array(\n\t\t\t\t\t'description' => __( 'Current product price.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'regular_price' => array(\n\t\t\t\t\t'description' => __( 'Product regular price.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'sale_price' => array(\n\t\t\t\t\t'description' => __( 'Product sale price.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_from' => array(\n\t\t\t\t\t'description' => __( \"Start date of sale price, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_from_gmt' => array(\n\t\t\t\t\t'description' => __( 'Start date of sale price, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_to' => array(\n\t\t\t\t\t'description' => __( \"End date of sale price, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'date_on_sale_to_gmt' => array(\n\t\t\t\t\t'description' => __( \"End date of sale price, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'price_html' => array(\n\t\t\t\t\t'description' => __( 'Price formatted in HTML.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'on_sale' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product is on sale.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'purchasable' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product can be bought.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'total_sales' => array(\n\t\t\t\t\t'description' => __( 'Amount of sales.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'virtual' => array(\n\t\t\t\t\t'description' => __( 'If the product is virtual.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'downloadable' => array(\n\t\t\t\t\t'description' => __( 'If the product is downloadable.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'downloads' => array(\n\t\t\t\t\t'description' => __( 'List of downloadable files.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'File ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'File name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'file' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'File URL.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'download_limit' => array(\n\t\t\t\t\t'description' => __( 'Number of times downloadable files can be downloaded after purchase.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => -1,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'download_expiry' => array(\n\t\t\t\t\t'description' => __( 'Number of days until access to downloadable files expires.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => -1,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'external_url' => array(\n\t\t\t\t\t'description' => __( 'Product external URL. Only for external products.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'button_text' => array(\n\t\t\t\t\t'description' => __( 'Product external button text. Only for external products.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'tax_status' => array(\n\t\t\t\t\t'description' => __( 'Tax status.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'taxable',\n\t\t\t\t\t'enum' => array( 'taxable', 'shipping', 'none' ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'tax_class' => array(\n\t\t\t\t\t'description' => __( 'Tax class.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'manage_stock' => array(\n\t\t\t\t\t'description' => __( 'Stock management at product level.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'stock_quantity' => array(\n\t\t\t\t\t'description' => __( 'Stock quantity.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'stock_status' => array(\n\t\t\t\t\t'description' => __( 'Controls the stock status of the product.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'instock',\n\t\t\t\t\t'enum' => array_keys( wc_get_product_stock_status_options() ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'backorders' => array(\n\t\t\t\t\t'description' => __( 'If managing stock, this controls if backorders are allowed.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t'enum' => array( 'no', 'notify', 'yes' ),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'backorders_allowed' => array(\n\t\t\t\t\t'description' => __( 'Shows if backorders are allowed.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'backordered' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product is on backordered.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'sold_individually' => array(\n\t\t\t\t\t'description' => __( 'Allow one item to be bought in a single order.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'weight' => array(\n\t\t\t\t\t/* translators: %s: weight unit */\n\t\t\t\t\t'description' => sprintf( __( 'Product weight (%s).', 'woocommerce-rest-api' ), $weight_unit ),\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'dimensions' => array(\n\t\t\t\t\t'description' => __( 'Product dimensions.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t'length' => array(\n\t\t\t\t\t\t\t/* translators: %s: dimension unit */\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Product length (%s).', 'woocommerce-rest-api' ), $dimension_unit ),\n\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'width' => array(\n\t\t\t\t\t\t\t/* translators: %s: dimension unit */\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Product width (%s).', 'woocommerce-rest-api' ), $dimension_unit ),\n\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'height' => array(\n\t\t\t\t\t\t\t/* translators: %s: dimension unit */\n\t\t\t\t\t\t\t'description' => sprintf( __( 'Product height (%s).', 'woocommerce-rest-api' ), $dimension_unit ),\n\t\t\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'shipping_required' => array(\n\t\t\t\t\t'description' => __( 'Shows if the product need to be shipped.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'shipping_taxable' => array(\n\t\t\t\t\t'description' => __( 'Shows whether or not the product shipping is taxable.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'shipping_class' => array(\n\t\t\t\t\t'description' => __( 'Shipping class slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'shipping_class_id' => array(\n\t\t\t\t\t'description' => __( 'Shipping class ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'reviews_allowed' => array(\n\t\t\t\t\t'description' => __( 'Allow reviews.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'default' => true,\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'average_rating' => array(\n\t\t\t\t\t'description' => __( 'Reviews average rating.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'rating_count' => array(\n\t\t\t\t\t'description' => __( 'Amount of reviews that the product have.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'related_ids' => array(\n\t\t\t\t\t'description' => __( 'List of related products IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'upsell_ids' => array(\n\t\t\t\t\t'description' => __( 'List of up-sell products IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'cross_sell_ids' => array(\n\t\t\t\t\t'description' => __( 'List of cross-sell products IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'parent_id' => array(\n\t\t\t\t\t'description' => __( 'Product parent ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'purchase_note' => array(\n\t\t\t\t\t'description' => __( 'Optional note to send the customer after purchase.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'arg_options' => array(\n\t\t\t\t\t\t'sanitize_callback' => 'wp_kses_post',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'categories' => array(\n\t\t\t\t\t'description' => __( 'List of categories.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Category ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Category name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Category slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'tags' => array(\n\t\t\t\t\t'description' => __( 'List of tags.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Tag ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Tag name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'slug' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Tag slug.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'images' => array(\n\t\t\t\t\t'description' => __( 'List of images.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit', 'embed' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_created' => array(\n\t\t\t\t\t\t\t\t'description' => __( \"The date the image was created, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_created_gmt' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'The date the image was created, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_modified' => array(\n\t\t\t\t\t\t\t\t'description' => __( \"The date the image was last modified, in the site's timezone.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'date_modified_gmt' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'The date the image was last modified, as GMT.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'date-time',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'src' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image URL.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'alt' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Image alternative text.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'description' => __( 'List of attributes.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'position' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute position.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'visible' => array(\n\t\t\t\t\t\t\t\t'description' => __( \"Define if the attribute is visible on the \\\"Additional information\\\" tab in the product's page.\", 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t\t'default' => false,\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'variation' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Define if the attribute can be used as variation.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t\t\t'default' => false,\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'List of available term names of the attribute.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default_attributes' => array(\n\t\t\t\t\t'description' => __( 'Defaults variation attributes.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'name' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Attribute name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Selected attribute term name.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'variations' => array(\n\t\t\t\t\t'description' => __( 'List of variations IDs.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'grouped_products' => array(\n\t\t\t\t\t'description' => __( 'List of grouped products ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'menu_order' => array(\n\t\t\t\t\t'description' => __( 'Menu order, used to custom sort products.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t),\n\t\t\t\t'meta_data' => array(\n\t\t\t\t\t'description' => __( 'Meta data.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'properties' => array(\n\t\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Meta ID.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'key' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Meta key.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'value' => array(\n\t\t\t\t\t\t\t\t'description' => __( 'Meta value.', 'woocommerce-rest-api' ),\n\t\t\t\t\t\t\t\t'type' => 'mixed',\n\t\t\t\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function get_item_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'status',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'name' => array(\n\t\t\t\t\t'description' => __( 'The title for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'private' => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be private.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'protected' => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be protected.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'public' => array(\n\t\t\t\t\t'description' => __( 'Whether posts of this status should be shown in the front end of the site.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'queryable' => array(\n\t\t\t\t\t'description' => __( 'Whether posts with this status should be publicly-queryable.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'show_in_list' => array(\n\t\t\t\t\t'description' => __( 'Whether to include posts in the edit listing for their post type.' ),\n\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t'context' => array( 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'slug' => array(\n\t\t\t\t\t'description' => __( 'An alphanumeric identifier for the status.' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'embed', 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "public function getSchema(): SchemaInterface;", "static public function get_settings_schema() {\n\n $_schema = json_decode( wp_remote_retrieve_body( wp_remote_get( WPP_API_URL_STANDARDS . '/schema' ) ), true );\n\n return isset( $_schema['data'] ) ? $_schema['data'] : array();\n\n }", "protected function _getSchema() {\n\t\treturn $this->__schema;\n\t}", "public function getSchema()\n {\n if ($this->schema) {\n return $this->schema;\n }\n\n return $this->schema = resolve(Bakery::getModelSchema($this));\n }", "public function get_import_public_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'report_import',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'status' => array(\n\t\t\t\t\t'description' => __( 'Regeneration status.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t\t'message' => array(\n\t\t\t\t\t'description' => __( 'Regenerate data message.', 'woocommerce' ),\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'readonly' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $this->add_additional_fields_schema( $schema );\n\t}", "function getBodySchema()\r\n {\r\n }", "protected function get_public_batch_schema() {\n\t\t$schema = array(\n\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t'title' => 'batch',\n\t\t\t'type' => 'object',\n\t\t\t'properties' => array(\n\t\t\t\t'create' => array(\n\t\t\t\t\t'description' => __( 'List of created resources.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'update' => array(\n\t\t\t\t\t'description' => __( 'List of updated resources.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'delete' => array(\n\t\t\t\t\t'description' => __( 'List of delete resources.', 'woocommerce-rest-api' ),\n\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t'context' => array( 'view', 'edit' ),\n\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\treturn $schema;\n\t}", "public function createSchema() : string;", "public function get_stats_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics',\n\t\t\t\t'parent' => 'quiz',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID.',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'user' => array(\n\t\t\t\t\t\t'description' => __( 'User ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'date' => array(\n\t\t\t\t\t\t'description' => __( 'Date.', 'learndash' ),\n\t\t\t\t\t\t'type' => array( 'string', null ),\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_correct' => array(\n\t\t\t\t\t\t'description' => __( 'Answer correct.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers_incorrect' => array(\n\t\t\t\t\t\t'description' => __( 'Answer incorrect.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "private function resolveSchema() : Schema\n {\n return resolve('Schema');\n }", "protected function get_schema() {\n\t\treturn [\n\t\t\t'description' => __( 'Content of the reminder.' ),\n\t\t\t'type' => Type::STRING,\n\t\t];\n\t}", "public function get_field_schema()\n {\n }", "public function getSchema(): ?string;", "public function generate()\n {\n $this->schema->put('@graph', $this->expandGraphs());\n\n return $this->schema->toJson();\n }", "public function schema()\n {\n $queryType = new ObjectType([\n 'name' => 'Query',\n 'fields' => $this->queries,\n ]);\n\n $mutationType = new ObjectType([\n 'name' => 'Mutation',\n 'fields' => $this->mutations,\n ]);\n\n return new Schema([\n 'query' => $queryType,\n 'mutation' => $mutationType,\n // usually inferred from 'query', but required for polymorphism on InterfaceType-based query results\n 'types' => $this->types,\n ]);\n }", "public function getSchema()\n {\n $cacheKey = strtolower('resource-customFieldData-schema');\n $schemaRecourceInfo = $this->getWrapper()->persistent->get($cacheKey, null);\n\n if ($schemaRecourceInfo === null) {\n // Get CustomFieldData Schema fields and update/merge with any Custom Fields\n $schemaRecourceInfo = $this->getWrapper()->schema->resource($this->getResourceName());\n $schemaRecourceInfo->fields = array_merge(\n $this->getSchemaFieldsForCustomFields(),\n $schemaRecourceInfo->fields\n );\n\n $this->getWrapper()->persistent->set($cacheKey, $schemaRecourceInfo);\n }\n return $schemaRecourceInfo;\n }", "public function schema()\r\n {\r\n return $this->getKey('schema', true);\r\n }", "function getRequestSchema($path, $method, $asJson, $jsonTidy)\n {\n $this->log->debug(\"Method: getRequestSchema\");\n\n $schema = $this->schemaManager->getRequestSchema($path, $method);\n\n if (!$asJson) {\n return $schema;\n }\n\n if ($jsonTidy) {\n return json_encode($schema, JSON_PRETTY_PRINT);\n } else {\n return json_encode($schema);\n }\n }", "protected function schema()\n {\n return $this->connection()->getSchemaBuilder();\n }", "protected function schema()\n {\n return $this->connection()->getSchemaBuilder();\n }", "protected function schema()\n {\n return $this->connection()->getSchemaBuilder();\n }", "public function getReferencedSchema(): string;", "public function getFromSchema()\n {\n return $this->getMetaValue(self::META_FROM_SCHEMA, '');\n }", "public function get_public_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public function get_item_schema()\n {\n }", "public abstract function getSchemaListToGenerate();", "public static function output_schema() {\n\n\t\t\t$pre_data_schema = self::pre_data_schema();\n\n\t\t\tforeach ( $pre_data_schema as $json ) {\n\n\t\t\t\techo '<script type=\"application/ld+json\">' . wp_json_encode( $json, JSON_PRETTY_PRINT ) . '</script>';\n\t\t\t}\n\t\t}", "private function generateSchema(string $schemaClassName): object\n {\n $schemaReflection = new \\ReflectionClass($schemaClassName);\n\n $scan = \\OpenApi\\scan($schemaReflection->getFileName(), [\n 'analysis' => new TestAnalysis()\n ]);\n\n return json_decode($scan->components->schemas[0]->toJson());\n }", "public static function schemaDef()\n {\n return array(\n 'description' => 'Record of answers to questions',\n 'fields' => array(\n 'id' => array(\n 'type' => 'char',\n 'length' => 36,\n 'not null' => true, 'description' => 'UUID of the response'),\n 'uri' => array(\n 'type' => 'varchar',\n 'length' => 255,\n 'not null' => true,\n 'description' => 'UUID to the answer notice'\n ),\n 'question_id' => array(\n 'type' => 'char',\n 'length' => 36,\n 'not null' => true,\n 'description' => 'UUID of question being responded to'\n ),\n 'content' => array('type' => 'text'), // got a better name?\n 'best' => array('type' => 'int', 'size' => 'tiny'),\n 'revisions' => array('type' => 'int'),\n 'profile_id' => array('type' => 'int'),\n 'created' => array('type' => 'datetime', 'not null' => true),\n ),\n 'primary key' => array('id'),\n 'unique keys' => array(\n 'question_uri_key' => array('uri'),\n 'question_id_profile_id_key' => array('question_id', 'profile_id'),\n ),\n 'indexes' => array(\n 'profile_id_question_id_index' => array('profile_id', 'question_id'),\n )\n );\n }", "public function getPropertySchema(): array;" ]
[ "0.80089015", "0.7503423", "0.74398416", "0.7336927", "0.7336927", "0.7336927", "0.7197562", "0.7189564", "0.7166568", "0.7166568", "0.7121255", "0.7112228", "0.70814776", "0.69912016", "0.6852991", "0.6852991", "0.6852991", "0.6852991", "0.6852991", "0.6852991", "0.67712134", "0.6717106", "0.6694539", "0.6689377", "0.665679", "0.6655979", "0.6628125", "0.66271853", "0.6609925", "0.65997696", "0.65931886", "0.65826124", "0.65703464", "0.6560236", "0.65520316", "0.6550467", "0.6540826", "0.648097", "0.6479161", "0.64739025", "0.64357585", "0.64042795", "0.63711184", "0.6368167", "0.6339144", "0.6338547", "0.6330522", "0.63256377", "0.6297033", "0.628083", "0.6255456", "0.62416977", "0.62397075", "0.6222888", "0.6217293", "0.61900866", "0.61900866", "0.61900866", "0.61563426", "0.6155946", "0.61510664", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.61436254", "0.6133258", "0.6074136", "0.60572565", "0.6027074", "0.6021006" ]
0.0
-1
Reads schema from cache
private function getFromCache($fName) { $cacheFile = $this->cacheDir . '/' . md5($fName); if (!file_exists($cacheFile)) { return false; } $schema = file_get_contents($cacheFile); $decoded = json_decode($schema); if (is_null($decoded)) { $msg = sprintf( "Broken cache for schema '%s', cache file '%s'", $fName, $cacheFile ); $code = SchemaProviderException::BROKEN_CACHE; throw new SchemaProviderException($msg, $code); } return $schema; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadCachedSchema(): array\n {\n return unserialize($this->files->get($this->getCachedSchemaPath()));\n }", "public function getSchemaCacheMetadata() {\n return $this->schemaMetadata;\n }", "public function cacheSchema(): void\n {\n $this->files->put($this->getCachedSchemaPath(), serialize($this->selectSchema()));\n }", "public function getCachingFrameworkRequiredDatabaseSchema() {}", "public function read()\r\n {\r\n $dataDict = Doctrine_Manager::getInstance()->getCurrentConnection()->getDataDict();\r\n\r\n $schema = new Doctrine_Schema(); /* @todo FIXME i am incomplete*/\r\n $db = new Doctrine_Schema_Database();\r\n $schema->addDatabase($db);\r\n\r\n $dbName = 'XXtest'; // @todo FIXME where should we get\r\n\r\n $this->conn->set(\"name\",$dbName);\r\n $tableNames = $dataDict->listTables();\r\n foreach ($tableNames as $tableName) {\r\n $table = new Doctrine_Schema_Table();\r\n $table->set(\"name\",$tableName);\r\n $tableColumns = $dataDict->listTableColumns($tableName);\r\n foreach ($tableColumns as $tableColumn) {\r\n $table->addColumn($tableColumn);\r\n }\r\n $this->conn->addTable($table);\r\n if ($fks = $dataDict->listTableConstraints($tableName)) {\r\n foreach ($fks as $fk) {\r\n $relation = new Doctrine_Schema_Relation();\r\n $relation->setRelationBetween($fk['referencingColumn'],$fk['referencedTable'],$fk['referencedColumn']);\r\n $table->setRelation($relation);\r\n }\r\n }\r\n }\r\n\r\n return $schema;\r\n }", "public function getSchema() {}", "public function cacheSchema($forceCache = false) {\n\t\tif (!$forceCache && !is_null(self::$memcache)) {\n\t\t\t$schema = self::$memcache->get(self::MEMCACHE_PREFIX . $this->table);\n\t\t\tif ($schema) {\n\t\t\t\t$this->schema = json_decode($schema, true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$query = self::$pdo->prepare('DESCRIBE ' . $this->table);\n\t\t$query->execute();\n\n\t\twhile ($row = $query->fetch(\\PDO::FETCH_ASSOC))\n\t\t\t$this->schema[$row['Field']] = array(\n\t\t\t\t'type' => $row['Type'],\n\t\t\t\t'null' => $row['Null'] == 'YES'\n\t\t\t);\n\n\t\tif (!is_null(self::$memcache))\n\t\t\t$x = self::$memcache->set(\n\t\t\t\tself::MEMCACHE_PREFIX . $this->table,\n\t\t\t\tjson_encode($this->schema)\n\t\t\t);\n\t}", "public function getSchema();", "public function getSchema();", "public function getSchema();", "function testSchemaInCache() {\n\t\t// If the revision was in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\n\t\t// ...no HTTP call will need to be made\n\t\t$this->http\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'get' );\n\n\t\t// ...so no lock will be acquired\n\t\t$this->cache\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'add' );\n\n\t\t$this->assertEquals( $this->statusSchema, $this->schema->get() );\n\t}", "public function readCache()\n {\n return $this->readFile()->unpackData();\n }", "protected function readFromCache()\r\n {\r\n $result = null;\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n $result = apc_fetch($this->getCacheKey());\r\n }\r\n return $result;\r\n }", "private function _getSchemaFields(){\n $file = SCHEMA_PATH . $this->_core . SCHEMA_FILE;\n $key = md5($file);\n if (!($this->_cache->test($key))) {\n if(file_exists($file)){\n $xml = simplexml_load_file($file);\n $schemaFields = array();\n foreach($xml->fields->field as $field){\n $string = get_object_vars($field->attributes());\n //This bit looks honky, couldn't get it to work with object notation\n $schemaFields[] = $string[\"@attributes\"]['name'];\n }\n }\n\n $this->_cache->save($schemaFields);\n } else {\n $schemaFields = $this->_cache->load($key);\n }\n $this->_schemaFields = $schemaFields;\n return $this->_schemaFields;\n }", "private function generateCache()\n {\n $schmaTabls = [];\n foreach (self::$allSchema as $Schema) {\n $schmaTabls[] = Tools::parse_object_TO_array($Schema);\n }\n self::setgenerateCACHE_SELECT($schmaTabls);\n }", "private function readCache(): void{\n //stdClass é uma classe predefinido ou dinamica\n $this->cache = new stdClass();\n if(file_exists('cache.cache')){\n $this->cache = json_decode(file_get_contents('cache.cache'));\n }\n }", "private function getFromCache($strTblName) {\n $strFileName = $strTblName . \".json\";\n $strFileContents = \"\";\n\t\t$strFilePath = dirname(__FILE__) . \"\\..\".DS.\"stash\".DS.$strFileName;\n\n if (file_exists($strFilePath)) {\n //get file modification time\n $strFileCreatedTime = date(\"H:i:s\", filemtime($strFilePath));\n $strCurrentTime = date(\"H:i:s\");\n $strDiff = strtotime($strCurrentTime) - strtotime($strFileCreatedTime);\n if ($strDiff < $this->iSchemaCacheDelayTime) {\n $strFileContents = file_get_contents($strFilePath);\n if (json_decode($strFileContents, true)) {\n $this->schema = json_decode($strFileContents, true);\n return true;\n } else {\n return false;\n }\n } else {\n unlink($strFilePath);\n return false;\n }\n } else {\n return false;\n }\n }", "function schema() {\n\t\tif(empty($this->table)) {\n\t\t\tthrow new ConnerException('Unknown table for schema in model '.get_class($this));\n\t\t}\n\n\t\tif(empty($this->schema)) {\n\n\t\t\t$cacheKey = 'MysqlModel.'.get_class($this).'.schema';\n\n\t\t\tif(is_null($schema = cache\\file($cacheKey, null, MONTH))) {\n\t\t\t\t$schema = array();\n\t\t\t\t$res = $this->query('DESCRIBE `'.$this->table.'`');\n\n\t\t\t\tif(empty($res)) { // false on error\n\t\t\t\t\treturn array(); // perhaps throwing an exception here may be a better way? i not sure.\n\t\t\t\t}\n\n\t\t\t\twhile ($row = $res->fetch_row()) {\n\t\t\t\t\t$schema[$row[0]] = array(\n\t\t\t\t\t\t'key'=>$row[0],\n\t//\t\t\t\t\t'type'=>$row[1], // todo: parse this into something better\n\t\t\t\t\t\t'primary'=>($row[3]=='PRI'),\n\t\t\t\t\t\t'default'=>$row[4],\n\t\t\t\t\t);\n\t\t }\n\t\t\t\t$res->free();\n\t\t\t\tcache\\file($cacheKey, $schema, MONTH);\n\t\t\t}\n\t\t\t$this->schema = $schema;\n\t\t}\n\n\t\treturn $this->schema;\n\t}", "public function schema(string $contentName)\n {\n $contentName = $this->validate($contentName);\n return $this->cache->get(\"schema_{$contentName}\");\n }", "protected function loadCache()\n {\n $this->types = $this\n ->getContext()\n ->dbConnection\n ->query(\"SELECT id, type FROM {apb_msg_type}\")\n ->fetchAllKeyed();\n }", "public static function getSchema()\n {\n }", "public static function get_schema()\n {\n }", "public function getFromCache() {}", "protected function loadFromCache() {}", "function testContentLocallyCached() {\n\t\t$this->cache\n\t\t\t->expects( $this->once() ) // <-- the assert\n\t\t\t->method( 'get' )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t}", "public function getSchema(bool $ignoreCache = false): Schema\n {\n if ($this->schema === null) {\n $cacheKey = $this->getCachePrefix().'_immutable_schema';\n if (!$ignoreCache && $this->cache->contains($cacheKey)) {\n $this->schema = $this->cache->fetch($cacheKey);\n } elseif (!file_exists($this->getLockFilePath())) {\n throw new TDBMException('No tdbm lock file found. Please regenerate DAOs and Beans.');\n } else {\n $this->schema = $this->schemaVersionControlService->loadSchemaFile();\n ImmutableCaster::castSchemaToImmutable($this->schema);\n ColumnsReorderer::reorderTableColumns($this->schema);\n $this->cache->save($cacheKey, $this->schema);\n }\n }\n\n return $this->schema;\n }", "public function get_schema()\n {\n }", "public function getSchema()\n {\n return $this->get(self::SCHEMA);\n }", "function getCache() {\n\t\t// The following line is only for classloading purposes\n\t\t$categoryEntryDao =& $this->getEntryDAO();\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\n\t\t// Load and return the cache, building it if necessary.\n\t\t$filename = $this->getCacheFilename();\n\t\tif (!file_exists($filename)) $this->rebuildCache();\n\t\t$contents = file_get_contents($filename);\n\t\tif ($contents) return unserialize($contents);\n\t\treturn null;\n\t}", "public function getCacheTable() {}", "public function getSchema(): Schema;", "public function getCache();", "public function cacheRead( $name ) {\n\t\tif ( ZC_CACHE == 'none' || $this->isAdmin() ) return null; // admin -> no cache\n\t\t\n\t\t$content = null;\n\t\t$name = $this->_cacheName( $name );\n\t\tif ( ZC_CACHE == 'apc' ) {\n\t\t\t$content = apc_fetch( ZC_CACHE_PREFIX. $name, $success );\n\t\t\tif ( ! $success ) $content = null;\n\t\t}\n\t\telse {\n\t\t\t$file = ZC_CACHE_DIR . '/'. $name. '.cache';\n\t\t\tif ( file_exists( $file ) )\n\t\t\t\t$content = unserialize( file_get_contents( $file ) );\n\t\t}\n\t\treturn $content;\n\t}", "function testSchemaNotInCacheNoUpdate() {\n\t\t// If the revision was not in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// ...we'll see an attempt to acquire update lock,\n\t\t// which we'll deny:\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'add' )\n\t\t\t->with( 'schema:Test:99:lock' )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// Without a lock, no HTTP requests will be made:\n\t\t$this->http\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'get' );\n\n\t\t// When unable to retrieve from memcached or acquire an update\n\t\t// lock to retrieve via HTTP, getSchema() will return false.\n\t\t$this->assertFalse( $this->schema->get() );\n\t}", "public static function getCachedComponentDefinitions(string $path)\n {\n return Cache::new($path)->load(CacheableTables::class);\n }", "public function readCache() {\n\t\tif(file_exists($this -> sCacheDir . $this -> sCacheFile)) {\n\t\t\treturn file_get_contents($this -> sCacheDir . $this -> sCacheFile);\n\t\t}\n\t\treturn false;\n\t}", "protected function getCachedMapping()\n {\n $cache = Injector::inst()->get(CacheInterface::class .'.gridfieldimporter');\n if ($result = $cache->get($this->cacheKey())) {\n return unserialize($result);\n }\n }", "protected function analyzeCachingTables() {}", "public static function readCache(){\r\n\t\trequire('./config.php');\r\n\t\tif(!file_exists($cachePath)){\r\n\t\t\treturn self::refreshCache();\r\n\t\t}\r\n\t\t//$myFile = $cachePath;\r\n\t\t$myFile = \"catalogCache.txt\";\r\n\t\t$fh = fopen($myFile, 'r');\r\n\t\t$catalogJson = fread($fh, filesize($myFile));\r\n\t\tfclose($fh);\r\n\t\t$catalog_groups = json_decode($catalogJson);\r\n\r\n\r\n\r\n\t\t//error_log(print_r($catalog_groups, true));\r\n\r\n\t\treturn $catalog_groups;\r\n\t}", "public static function getCache() {}", "abstract public function getCache( $cacheID = '', $unserialize = true );", "public function get($cache_name);", "private static function _readCacheFile() {\r\n if (!self::$_hasCacheFile) {\r\n self::_createCacheFile();\r\n }\r\n\r\n $paths = array();\r\n require(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH);\r\n self::$_paths = $paths;\r\n }", "private function _get_cache($key){\n if(is_file(_ENVATO_TMP_DIR.'cache-'.basename($key))){\n return @unserialize(file_get_contents(_ENVATO_TMP_DIR.'cache-'.basename($key)));\n }\n return false;\n }", "public function getSchema(): SchemaInterface;", "function InPlaceCache_readCache(/* $hash, */ $path)\r\n{\r\n//\t$path = InPlaceCache_checkCache($hash);\r\n\t\r\n\tif($path[0] === false)\r\n\t\treturn false;\r\n\t\t\r\n\treturn unserialize(file_get_contents($path[1]));\r\n}", "function getXSD($XSDkey, $XSDfile){\n\t\t $frontendOptions = array('lifetime' => self::cacheLife,'automatic_serialization' => true );\n\t\t $backendOptions = array('cache_dir' => self::cacheDir );\n\t\t\t \n\t\t $cache = Zend_Cache::factory('Core','File',$frontendOptions,$backendOptions);\n\t\t $cache_id = $XSDkey;\n\t\t \n\t\t if(!$cache_result = $cache->load($cache_id)) {\n\t\t\t\t@$xsdString = file_get_contents(self::XSDprefix.$XSDfile); //not in cache / cache expired, go get from source\n\t\t\t\tif(!$xsdString){\n\t\t\t\t\t $this->recordError(\"$XSDfile not retrieved\");\n\t\t\t\t\t return false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $cache->save($xsdString, $cache_id); //save XSD to the cache\n\t\t\t\t}\n\t\t }\n\t\t else{\n\t\t\t\t$xsdString = $cache_result;\n\t\t }\n\t\t \n\t\t //quick validation\n\t\t @$xml = simplexml_load_string($xsdString);\n\t\t if($xml != false){\n\t\t\t\tunset($xml);\n\t\t\t\treturn $xsdString;\n\t\t }\n\t\t else{\n\t\t\t\t$this->recordError(\"$XSDfile invalid\");\n\t\t\t\treturn false;\n\t\t }\n\t }", "public function getCache() {\n $db = \\Helper::getDB();\n $db->join('cached_assets c', 'dc.cacheId = c.id', 'LEFT');\n $db->where('dc.fileId', $db->escape($this->getId()));\n $results = $db->get('document_files_cache dc');\n\n return $results;\n }", "abstract protected function getSchema(): string;", "protected function getRuntimeCache() {}", "protected function getCachedDefinitions() {\n if (!isset($this->definitions)) {\n $this->definitions = NULL;\n if ($cache = $this->cacheGet($this->cacheKey)) {\n $this->definitions = $cache->data;\n }\n }\n return $this->definitions;\n }", "private function resolveSchema() : Schema\n {\n return resolve('Schema');\n }", "public function loadSchema($ref) {\n\t\t$refParts = parse_url($ref);\n\t\t$base = '/schemas/base/common/schema/';\n\t\t$baseLen = strlen($base);\n\t\tif (isset($refParts['host']) and $refParts['host'] == 'commerce.mesh.mx' and substr_compare($refParts['path'], $base, 0, $baseLen)==0) {\n\t\t\t$ref = substr($refParts['path'], $baseLen);\n\t\t}\n\n\t\tif(!property_exists($this, $ref)){\n\t\t\techo json_encode($refParts);\n\t\t\tthrow new \\Exception('BAD ' . $ref . \"\\n\");\n\t\t}\n\t\treturn $this->$ref;\n\t}", "public function getSchema()\n {\n if ($this->schema) {\n return $this->schema;\n }\n\n return $this->schema = resolve(Bakery::getModelSchema($this));\n }", "function GetFromCache()\n {\n return File::GetContents($this->file);\n }", "private function loadSchema($strTblName) {\n if (!$this->getFromCache($strTblName)) {\n $this->result = $this->query($this->getSchemaQuery($strTblName));\n $schema = $this->fetchValues($this->result);\n foreach ($schema as $value) {\n $this->schema[$strTblName][$value['Field']]['type'] = $value['Type'];\n $this->schema[$strTblName][$value['Field']]['length'] = $value['Length'];\n }\n $this->processSchemaCache($strTblName);\n }\n }", "abstract protected function getSchemaMetadata(string $schema, string $type, bool $refresh): array;", "public function testDatabaseToCache()\n {\n $cache = Services::cache();\n $databaseHandler = new DatabaseHandler($this->config, 'tests');\n $cacheHandler = new CacheArchiver($this->config, $cache);\n\n $this->schemas->draft([$databaseHandler])->archive([$cacheHandler]);\n $this->assertEmpty($this->schemas->getErrors());\n\n $schemaFromService = $this->schemas->get();\n $schemaFromCache = $cache->get('schema-testing');\n $this->assertCount(is_countable($schemaFromCache->tables) ? count($schemaFromCache->tables) : 0, $schemaFromService->tables);\n\n $this->assertObjectHasAttribute('factories', $schemaFromCache->tables);\n }", "public function schema();", "public function getSchema(): string;", "public function getSchema(): string;", "private function readFromCache()\n\t{\n\t\t$q = 'SELECT searchResults FROM twitterSearch WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\t$r = mysql_query($q, CONN) or die('could not fetch the cached search results');\n\t\t$arr = mysql_fetch_array($r);\n\t\t$searchResults = $arr['searchResults'];\n\t\t\n\t\tif ($this->_testMode) { echo \"fetching the cached<br />\"; }\n\t\t\n\t\treturn $searchResults;\n\t\t//var_dump($fData);\n\t}", "private function loadCache()\r\n {\r\n if (file_exists(WEMO_CACHE)) {\r\n $fp = fopen(WEMO_CACHE, 'r');\r\n $json = fread($fp, filesize(WEMO_CACHE));\r\n fclose($fp);\r\n return json_decode($json);\r\n } else {\r\n return false;\r\n }\r\n }", "public function getSchema() {\n return Cool::getInstance()->getSchema($this->databaseName);\n }", "public function GetWsdlFromCache($file=null,$force=false,$nounserialize=false){\r\n\t\tself::Debug('Get WSDL from cache');\r\n\t\tif(!is_null($this->WSDL))\r\n\t\t\treturn $this->WSDL;\r\n\t\tif(is_null($file))\r\n\t\t\t$file=$this->GetCacheFileName();\r\n\t\tif(!$force){\r\n\t\t\tif(!$this->IsCacheValid($file))\r\n\t\t\t\treturn null;\r\n\t\t}else if(!$this->CacheFileExists($file)){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t$this->WSDL=file_get_contents($file);\r\n\t\tif(!$nounserialize){\r\n\t\t\tself::Debug('Unserialize methods, types and files');\r\n\t\t\t$data=unserialize(file_get_contents($file.'.obj'));\r\n\t\t\t$this->Methods=$data['methods'];\r\n\t\t\t$this->Types=$data['types'];\r\n\t\t\t$this->Files=$data['files'];\r\n\t\t\t$this->Name=$data['name'];\r\n\t\t\t$this->Docs=$data['docs'];\r\n\t\t\t$this->HTML=$data['html'];\r\n\t\t\t$this->PHP=$data['php'];\r\n\t\t\t$this->WsdlUri=$data['wsdluri'];\r\n\t\t\t$this->PhpUri=$data['phpuri'];\r\n\t\t\t$this->DocUri=$data['docuri'];\r\n\t\t\tself::CallHook(\r\n\t\t\t\t'ReadCacheHook',\r\n\t\t\t\tArray(\r\n\t\t\t\t\t'server'\t\t=>\t$this,\r\n\t\t\t\t\t'data'\t\t\t=>\t&$data\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tif($data['version']!=self::$VERSION){\r\n\t\t\t\tself::Debug('Could not use cache from version '.$data['version']);\r\n\t\t\t\t$this->Methods=Array();\r\n\t\t\t\t$this->Types=Array();\r\n\t\t\t\t$this->Files=Array();\r\n\t\t\t\t$this->Name=null;\r\n\t\t\t\t$this->Docs=null;\r\n\t\t\t\t$this->HTML=null;\r\n\t\t\t\t$this->PHP=null;\r\n\t\t\t\t$this->WsdlUri=null;\r\n\t\t\t\t$this->PhpUri=null;\r\n\t\t\t\t$this->DocUri=null;\r\n\t\t\t\t$this->WSDL=null;\r\n\t\t\t\t$this->TidyCacheFolder(true);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->ConfigurationDetermined=true;\r\n\t\t$this->SourcesParsed=true;\r\n\t\treturn $this->WSDL;\r\n\t}", "public static function get_static_schema()\n {\n }", "protected static function getRuntimeCache() {}", "public function loadCache()\r\n {\r\n if (!file_exists($this->cachePath)) {\r\n $this->rebuildCache();\r\n }\r\n\r\n // $data = json_decode(file_get_contents($this->cachePath), true);\r\n\r\n $data = include $this->cachePath;\r\n\r\n if ($data === null) {\r\n throw new \\Exception(\"Invalid theme cache json file [{$this->cachePath}]\");\r\n }\r\n return $data;\r\n }", "protected function _getSchema() {\n\t\treturn $this->__schema;\n\t}", "private function getCache() {\n // cache for single run\n // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)\n if (isset($this->parsed)) {\n return $this->parsed;\n }\n\n // check from cache first\n $cache = null;\n $cacheId = $this->getCacheId();\n if ($this->cache->isValid($cacheId, 0)) {\n if ($cache = $this->cache->fetch($cacheId)) {\n $cache = unserialize($cache);\n }\n }\n\n $less = $this->getCompiler();\n $input = $cache ? $cache : $this->filepath;\n $cache = $less->cachedCompile($input);\n\n if (!is_array($input) || $cache['updated'] > $input['updated']) {\n $this->cache->store($cacheId, serialize($cache));\n }\n\n return $this->parsed = $cache;\n }", "public static function cache_load($name) {\n if(self::$adapter === false)\n throw new rcException('The Cache system is not initialized');\n return unserialize( self::$adapter->cache_load($name) );\n }", "public static function getItemSchema() {\n if(self::$itemSchema == null) {\n self::updateSchema();\n }\n\n return self::$itemSchema;\n }", "protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }", "public function getSchema()\r\n {\r\n // if existed (like post): begiresh va be view pass bede\r\n // if not (like blog,index): default schema template\r\n // include schema.view\r\n }", "public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}", "abstract protected function _getSchemaFile();", "private function _readCache($key)\n\t{\n\t\t$cache = FALSE;\n\t\t$cache_path = APPPATH.'cache/' . __CLASS__;\n\t\t$filepath = $cache_path .\"/\". $key . \".xml\";\n\n\t\tif ( ! file_exists($filepath))\n\t\t\treturn FALSE;\n\t\tif ( ! $fp = fopen($filepath, FOPEN_READ))\n\t\t\treturn FALSE;\n\n\t\tif( filemtime($filepath) + $this->cache_lifetime < time() )\n\t\t{\n\t\t\tunlink($filepath);\n\t\t\t// print(\"<!-- Cache file has expired. File deleted: \" . $filepath . \" -->\\n\");\n\t\t\tlog_message('debug', \"Cache file has expired. File deleted\");\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tflock($fp, LOCK_SH);\n\t\t$cache = fread($fp, filesize($filepath));\n\t\tflock($fp, LOCK_UN);\n\t\tfclose($fp);\n\n\t\t//print(\"<!-- Loaded file from cache: \" . $filepath . \" -->\\n\");\n\n\t\treturn $cache;\n\t}", "public function check_solr_cache() \r\n\t{\r\n\t\tif (!is_readable($this->solr_cache_file))\r\n\t\t{\r\n\t\t\t$this->generate_solr_cache();\r\n\t\t}\r\n\t\t$contents = file_get_contents($this->solr_cache_file);\r\n\t\treturn $contents;\r\n\t}", "public function read($path)\n {\n $fileKey = sha1($path);\n $localPath = $this->getContentCache()->get($fileKey);\n if ($localPath) {\n $contents = file_get_contents($localPath);\n return ['type' => 'file', 'path' => $path, 'contents' => $contents];\n }\n\n // Cache miss, call and warm\n $result = $this->getBackend()->read($path);\n if ($result) {\n $this->getContentCache()->warmFromString($fileKey, $result['contents']);\n }\n return $result;\n }", "public function read() {\n if ($this->_expires > 0) {\n $name = preg_replace(\n '([^A-Za-z\\d]+)', '_', get_class($this->_source)\n );\n $cacheData = $this->_cache->read(\n $name, $this->_identifier, $this->_expires\n );\n if ($cacheData) {\n $dom = new \\DOMDocument();\n $dom->loadXml($cacheData);\n return $dom;\n } else {\n $dom = $this->_source->read();\n $this->_cache->write(\n $name, $this->_identifier, $this->_expires, $dom->saveXml()\n );\n return $dom;\n }\n }\n return NULL;\n }", "public function getSchema()\n {\n $cacheKey = strtolower('resource-customFieldData-schema');\n $schemaRecourceInfo = $this->getWrapper()->persistent->get($cacheKey, null);\n\n if ($schemaRecourceInfo === null) {\n // Get CustomFieldData Schema fields and update/merge with any Custom Fields\n $schemaRecourceInfo = $this->getWrapper()->schema->resource($this->getResourceName());\n $schemaRecourceInfo->fields = array_merge(\n $this->getSchemaFieldsForCustomFields(),\n $schemaRecourceInfo->fields\n );\n\n $this->getWrapper()->persistent->set($cacheKey, $schemaRecourceInfo);\n }\n return $schemaRecourceInfo;\n }", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "protected function _getMetadata()\n {\n if (!count($this->_metadata)) {\n $cachedData = false;\n $cacheMetadata = $this->_getCache('cacheMetadata');\n $cacheFile = null;\n\n if ($cacheMetadata !== false) {\n $cacheFile = md5(\"DESCRIBE \" . $this->_prefix . $this->_name);\n }\n\n if ($cacheMetadata !== false) {\n if (($data = $this->_cache->read($cacheFile)) !== false) {\n $this->_metadata = $data;\n $cachedData = true;\n }\n }\n\n if ($cachedData === false) {\n $this->_metadata = $this->_adapter->describeTable($this->_prefix . $this->_name);\n\n if ($cacheMetadata !== false) {\n $this->_cache->write($cacheFile, $this->_metadata);\n }\n }\n }\n\n return $this->_metadata;\n }", "protected function _readTable() {}", "protected function _readTable() {}", "public static function getCacheType();", "protected function load_cache(){\r\n\t\tstatic $cached = null;\r\n\t\t\r\n\t\tif(!$cached){\r\n\t\t\t\r\n\t\t\tif($this->_cfg->get('sfversion') == 'auto'){\r\n\t\t\t\t// get version from sourceforge/cache\r\n\t\t\t\tif (!$this->is_cached()) $this->update_cache();\r\n\t\t\t\t$cached = (object)include($this->get_cache());\r\n\t\t\t}else{\r\n\t\t\t\t// use predefined version from config\r\n\t\t\t\t$cached = (object)$this->_cfg->get('sfversion');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $cached;\r\n\t}", "function get_cached_json($widget) {\n global $cachedb;\n\n if ( isset($cachedb) ) {\n $result=mysqli_query($cachedb, \"SELECT json FROM cache_table WHERE widget = '$widget'\");\n if ( $result ) {\n return mysqli_fetch_row($result)[0];\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "public function get($path) {\n\t\treturn $this->cache[$path] ?? null;\n\t}", "function testSchemaNotInCacheDoUpdate() {\n\t\t// If the revision was not in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// ...RemoteSchema will attempt to acquire an update lock:\n\t\t$this->cache\n\t\t\t->expects( $this->any() )\n\t\t\t->method( 'add' )\n\t\t\t->with( $this->stringContains( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( true ) );\n\n\t\t// With the lock acquired, we'll see an HTTP request\n\t\t// for the revision:\n\t\t$this->http\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with(\n\t\t\t\t$this->stringContains( '?' ),\n\t\t\t\t$this->lessThan( RemoteSchema::LOCK_TIMEOUT ) )\n\t\t\t->will( $this->returnValue( FormatJson::encode( $this->statusSchema ) ) );\n\n\t\t$this->assertEquals( $this->statusSchema, $this->schema->get() );\n\t}", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "public function getSchema()\n {\n return $this->schema;\n }", "abstract protected function _load_schema($information_schema);", "public function get($key) {\n $filename = $key.'.cache';\n $file = $this->file_path_for_key($key);\n $ttl = $this->definition->get_ttl();\n $maxtime = 0;\n if ($ttl) {\n $maxtime = cache::now() - $ttl;\n }\n $readfile = false;\n if ($this->prescan && array_key_exists($filename, $this->keys)) {\n if ((!$ttl || $this->keys[$filename] >= $maxtime) && file_exists($file)) {\n $readfile = true;\n } else {\n $this->delete($key);\n }\n } else if (file_exists($file) && (!$ttl || filemtime($file) >= $maxtime)) {\n $readfile = true;\n }\n if (!$readfile) {\n return false;\n }\n // Open ensuring the file for reading in binary format.\n if (!$handle = fopen($file, 'rb')) {\n return false;\n }\n // Lock it up!\n // We don't care if this succeeds or not, on some systems it will, on some it won't, meah either way.\n flock($handle, LOCK_SH);\n $data = '';\n // Read the data in 1Mb chunks. Small caches will not loop more than once. We don't use filesize as it may\n // be cached with a different value than what we need to read from the file.\n do {\n $data .= fread($handle, 1048576);\n } while (!feof($handle));\n // Unlock it.\n flock($handle, LOCK_UN);\n // Return it unserialised.\n return $this->prep_data_after_read($data);\n }", "private function processSchemaCache($strTblName) {\n $strJsonCode = \"\";\n $strFileName = $strTblName . \".json\";\n $strFilePath = dirname(__FILE__) . \"\\..\".DS.\"stash\".DS.$strFileName;\n $strJsonCode = json_encode($this->schema);\n $fileHandler = fopen($strFilePath, 'w');\n fwrite($fileHandler, $strJsonCode);\n fclose($fileHandler);\n }", "function _biurnal_conf_get_conf_cache($name) {\n ctools_include('object-cache');\n $cache = ctools_object_cache_get('biurnal_conf', $name);\n if (!$cache) {\n $cache = biurnal_conf_load($name);\n if ($cache) {\n $cache->locked = ctools_object_cache_test('biurnal_conf', $name);\n }\n }\n\n return $cache;\n}" ]
[ "0.7523043", "0.69560015", "0.6828277", "0.67577785", "0.63988805", "0.62446165", "0.61863565", "0.6089297", "0.6089297", "0.6089297", "0.60627306", "0.60503453", "0.598789", "0.5966337", "0.59106106", "0.5901311", "0.5900115", "0.5862899", "0.5861313", "0.58465666", "0.5827092", "0.5795033", "0.57437617", "0.57358307", "0.57095146", "0.5709061", "0.5602577", "0.5590603", "0.55880773", "0.5585721", "0.55803007", "0.557945", "0.5521747", "0.5510802", "0.54921067", "0.54912645", "0.5481373", "0.54810977", "0.54746425", "0.5467286", "0.5465603", "0.54613745", "0.54595923", "0.5400471", "0.5358539", "0.5349589", "0.5330814", "0.5319749", "0.5307437", "0.5302598", "0.5286591", "0.5277757", "0.5258538", "0.52550274", "0.52510464", "0.5245136", "0.5222057", "0.5220614", "0.5215159", "0.52121645", "0.52121645", "0.52005494", "0.5198169", "0.5195335", "0.51895344", "0.517495", "0.51746386", "0.5174612", "0.51725787", "0.51686555", "0.51668036", "0.5158696", "0.5154347", "0.5150644", "0.5149447", "0.51489574", "0.5147704", "0.5146988", "0.51378155", "0.5136657", "0.51346093", "0.5127134", "0.5125131", "0.51083773", "0.5107747", "0.51003116", "0.5098332", "0.50955915", "0.5091733", "0.50897396", "0.50874645", "0.50874645", "0.50874645", "0.50874645", "0.50874645", "0.50874645", "0.50864506", "0.5071698", "0.50701416", "0.5067525" ]
0.6380193
5
Puts schema into cache
private function putToCache($fName, $schema) { $cacheFile = $this->cacheDir . '/' . md5($fName); $result = file_put_contents($cacheFile, $schema); if (is_null($result)) { $msg = sprintf( "Unable to write schema '%s' to cache '%s'", $fName, $cacheFile ); $code = SchemaProviderException::BROKEN_CACHE; throw new SchemaProviderException($msg, $code); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cacheSchema(): void\n {\n $this->files->put($this->getCachedSchemaPath(), serialize($this->selectSchema()));\n }", "private function generateCache()\n {\n $schmaTabls = [];\n foreach (self::$allSchema as $Schema) {\n $schmaTabls[] = Tools::parse_object_TO_array($Schema);\n }\n self::setgenerateCACHE_SELECT($schmaTabls);\n }", "public function cacheSchema($forceCache = false) {\n\t\tif (!$forceCache && !is_null(self::$memcache)) {\n\t\t\t$schema = self::$memcache->get(self::MEMCACHE_PREFIX . $this->table);\n\t\t\tif ($schema) {\n\t\t\t\t$this->schema = json_decode($schema, true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$query = self::$pdo->prepare('DESCRIBE ' . $this->table);\n\t\t$query->execute();\n\n\t\twhile ($row = $query->fetch(\\PDO::FETCH_ASSOC))\n\t\t\t$this->schema[$row['Field']] = array(\n\t\t\t\t'type' => $row['Type'],\n\t\t\t\t'null' => $row['Null'] == 'YES'\n\t\t\t);\n\n\t\tif (!is_null(self::$memcache))\n\t\t\t$x = self::$memcache->set(\n\t\t\t\tself::MEMCACHE_PREFIX . $this->table,\n\t\t\t\tjson_encode($this->schema)\n\t\t\t);\n\t}", "private function processSchemaCache($strTblName) {\n $strJsonCode = \"\";\n $strFileName = $strTblName . \".json\";\n $strFilePath = dirname(__FILE__) . \"\\..\".DS.\"stash\".DS.$strFileName;\n $strJsonCode = json_encode($this->schema);\n $fileHandler = fopen($strFilePath, 'w');\n fwrite($fileHandler, $strJsonCode);\n fclose($fileHandler);\n }", "public function testDatabaseToCache()\n {\n $cache = Services::cache();\n $databaseHandler = new DatabaseHandler($this->config, 'tests');\n $cacheHandler = new CacheArchiver($this->config, $cache);\n\n $this->schemas->draft([$databaseHandler])->archive([$cacheHandler]);\n $this->assertEmpty($this->schemas->getErrors());\n\n $schemaFromService = $this->schemas->get();\n $schemaFromCache = $cache->get('schema-testing');\n $this->assertCount(is_countable($schemaFromCache->tables) ? count($schemaFromCache->tables) : 0, $schemaFromService->tables);\n\n $this->assertObjectHasAttribute('factories', $schemaFromCache->tables);\n }", "public function getSchemaCacheMetadata() {\n return $this->schemaMetadata;\n }", "protected function createCacheTables() {}", "function testSchemaInCache() {\n\t\t// If the revision was in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\n\t\t// ...no HTTP call will need to be made\n\t\t$this->http\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'get' );\n\n\t\t// ...so no lock will be acquired\n\t\t$this->cache\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'add' );\n\n\t\t$this->assertEquals( $this->statusSchema, $this->schema->get() );\n\t}", "private function loadCachedSchema(): array\n {\n return unserialize($this->files->get($this->getCachedSchemaPath()));\n }", "public function reloadSchema()\n {\n $em = $this->getEntityManager();\n $tool = new SchemaTool($em);\n $tool->dropSchema($em->getMetadataFactory()->getAllMetadata());\n $tool->createSchema($em->getMetadataFactory()->getAllMetadata());\n $this->schemaReloaded = true;\n }", "protected function silentCacheFrameworkTableSchemaMigration() {}", "public function getCachingFrameworkRequiredDatabaseSchema() {}", "private function warmCache()\n {\n $cached_tables = config('ninja.cached_tables');\n\n foreach ($cached_tables as $name => $class) {\n if (! Cache::has($name)) {\n // check that the table exists in case the migration is pending\n if (! Schema::hasTable((new $class())->getTable())) {\n continue;\n }\n if ($name == 'payment_terms') {\n $orderBy = 'num_days';\n } elseif ($name == 'fonts') {\n $orderBy = 'sort_order';\n } elseif (in_array($name, ['currencies', 'industries', 'languages', 'countries', 'banks'])) {\n $orderBy = 'name';\n } else {\n $orderBy = 'id';\n }\n $tableData = $class::orderBy($orderBy)->get();\n if ($tableData->count()) {\n Cache::forever($name, $tableData);\n }\n }\n }\n }", "protected function setSchema($schema) {}", "protected function saveToPackageCache() {}", "private function createSchema()\n {\n $tool = new SchemaTool($this->container->get('models'));\n $classes = [\n $this->container->get('models')->getClassMetadata(Store::class),\n ];\n $tool->updateSchema($classes, true);\n }", "public function updateSchema()\n {\n WFCustomManager::getInstance()->updateSchema();\n }", "function importSchema(){\n\t\t\t$this->exportsSchema = false;\n\t\t}", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "protected function updateSchema() {\n $params = array();\n if(self::$schemaLanguage != null) {\n $params['language'] = self::$schemaLanguage;\n }\n $result = WebApi::getJSONData('ITFItems_440', 'GetSchema', 1, $params);\n\n self::$attributeSchema = array();\n foreach($result->attributes->attribute as $attributeData) {\n self::$attributeSchema[$attributeData->name] = $attributeData;\n }\n\n self::$itemSchema = array();\n foreach($result->items->item as $itemData) {\n self::$itemSchema[$itemData->defindex] = $itemData;\n }\n\n self::$qualities = array();\n foreach($result->qualities as $quality => $id) {\n self::$qualities[$id] = $quality;\n }\n }", "protected function analyzeCachingTables() {}", "private function generate_solr_cache()\r\n\t{\r\n\t\tfile_put_contents($this->solr_cache_file, $this->solr_stream);\r\n\t}", "public function rebuildCache()\r\n {\r\n $themes = $this->scanJsonFiles();\r\n // file_put_contents($this->cachePath, json_encode($themes, JSON_PRETTY_PRINT));\r\n\r\n $stub = file_get_contents(__DIR__ . '/stubs/cache.stub');\r\n $contents = str_replace('[CACHE]', var_export($themes, true), $stub);\r\n file_put_contents($this->cachePath, $contents);\r\n }", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t}", "protected function saveToCache() {}", "public function flushCaches() {}", "public function saveSchema()\n {\n $db = ezcDbInstance::get();\n $schema = ezcDbSchema::createFromDb( $db );\n $schema->writeToFile( \"array\", dirname( __FILE__ ) . \"/relation.dba\" );\n }", "public function getCacheTable() {}", "protected function createAllCaches() {}", "public static function update_schema(): void {\n\t\tglobal $wpdb;\n\n\t\t$table_name = static::table_name();\n\t\t$table_fields = static::FIELDS;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t\t$table_fields\n\t\t\tPRIMARY KEY (id)\n\t\t) $charset_collate;\";\n\n\t\tif ( md5( $sql ) === get_option( static::TABLE . '_schemaver', '' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tdbDelta( $sql );\n\n\t\tupdate_option( static::TABLE . '_schemaver', md5( $sql ) );\n\t}", "public function storeCache() {\n\t\tif ($this->cacheFilePath) {\n\t\t\tfile_put_contents($this->cacheFilePath, serialize($this->classFileIndex));\n\t\t}\n\t}", "protected static function createExtTablesCacheEntry() {}", "public function updateCache();", "public static function clearCache()\n {\n self::$database[get_called_class()] = array();\n }", "function testContentLocallyCached() {\n\t\t$this->cache\n\t\t\t->expects( $this->once() ) // <-- the assert\n\t\t\t->method( 'get' )\n\t\t\t->will( $this->returnValue( $this->statusSchema ) );\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t\t$this->schema->get();\n\t}", "public function refreshCache() {\n\t\t$this->_cache->clean(Zend_Cache::CLEANING_MODE_ALL);\n\t\t$this->_loadTableNames();\n\n\t\t$this->_tableInfo = array();\n\t}", "public static function cache()\n {\n $cache = Cache::instance('system');\n if (!$cache->get('config-autoload')) {\n $cache->set('config-autoload', self::$data);\n }\n }", "protected function initCaches() {}", "protected function cacheModel()\n {\n $xmlObject = $this->getSimpleXmlObject();\n if ($xmlObject === null) {\n return;\n }\n\n $this->cache = $this->convertItem($xmlObject);\n }", "public function saveToCacheForever();", "function raptor_scheduling_schema()\n{\n $schema = array();\n\n $oSH = new \\raptor_sched\\DBScheduleSchema();\n $oSH->addToSchema($schema);\n \n return $schema;\n}", "public static function flushInternalRuntimeCaches() {}", "public function flushCache();", "function testSchemaNotInCacheDoUpdate() {\n\t\t// If the revision was not in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// ...RemoteSchema will attempt to acquire an update lock:\n\t\t$this->cache\n\t\t\t->expects( $this->any() )\n\t\t\t->method( 'add' )\n\t\t\t->with( $this->stringContains( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( true ) );\n\n\t\t// With the lock acquired, we'll see an HTTP request\n\t\t// for the revision:\n\t\t$this->http\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with(\n\t\t\t\t$this->stringContains( '?' ),\n\t\t\t\t$this->lessThan( RemoteSchema::LOCK_TIMEOUT ) )\n\t\t\t->will( $this->returnValue( FormatJson::encode( $this->statusSchema ) ) );\n\n\t\t$this->assertEquals( $this->statusSchema, $this->schema->get() );\n\t}", "abstract protected function cacheData();", "public static function clear_schema()\n {\n }", "protected function setTableCache($tblSrc)\n {\n $dat = $this->establishDatabaseAndTable($tblSrc);\n if (!isset($this->advCache['tableStructureCache'][$dat[0]][$dat[1]])) {\n $this->advCache['workingDatabase'] = $dat[0];\n $this->advCache['tableStructureCache'][$dat[0]][$dat[1]] = $this->getMySQLlistColumns([\n 'TABLE_SCHEMA' => $dat[0],\n 'TABLE_NAME' => $dat[1],\n ]);\n $this->setTableForeignKeyCache($dat[0], $dat[1]);\n }\n }", "protected function _initDbMetaCache()\n {\n // make sure the db bootstrap is done\n $this->bootstrap('db');\n \n // First, set up the Cache\n $frontendOptions = array(\n 'automatic_serialization' => true\n );\n $backendOptions = array(\n 'cache_dir' => APPLICATION_PATH . '/../data/cache'\n );\n $cache = Zend_Cache::factory(\n 'Core', 'File', $frontendOptions, $backendOptions\n );\n // set the default cache\n Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);\n }", "public function loadAndCache(): void\n {\n $this->fetchPermissions();\n\n $this->cachePermissions();\n\n $this->savePermissions();\n }", "function wp_cache_flush_runtime()\n {\n }", "public function saveSchema()\n {\n $db = ezcDbInstance::get();\n $schema = ezcDbSchema::createFromDb( $db );\n $schema->writeToFile( 'array', dirname( __FILE__ ) . '/database_type.dba' );\n }", "public function clearCachedDefinitions();", "function resetDBSchema($includeExtraDataObjects = false) {\n\t\tif(self::using_temp_db()) {\n\t\t\t// clear singletons, they're caching old extension info which is used in DatabaseAdmin->doBuild()\n\t\t\tglobal $_SINGLETONS;\n\t\t\t$_SINGLETONS = array();\n\n\t\t\t$dataClasses = ClassInfo::subclassesFor('DataObject');\n\t\t\tarray_shift($dataClasses);\n\n\t\t\t$conn = DB::getConn();\n\t\t\t$conn->beginSchemaUpdate();\n\t\t\tDB::quiet();\n\n\t\t\tforeach($dataClasses as $dataClass) {\n\t\t\t\t// Check if class exists before trying to instantiate - this sidesteps any manifest weirdness\n\t\t\t\tif(class_exists($dataClass)) {\n\t\t\t\t\t$SNG = singleton($dataClass);\n\t\t\t\t\tif(!($SNG instanceof TestOnly)) $SNG->requireTable();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have additional dataobjects which need schema, do so here:\n\t\t\tif($includeExtraDataObjects && $this->extraDataObjects) {\n\t\t\t\tforeach($this->extraDataObjects as $dataClass) {\n\t\t\t\t\t$SNG = singleton($dataClass);\n\t\t\t\t\tif(singleton($dataClass) instanceof DataObject) $SNG->requireTable();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$conn->endSchemaUpdate();\n\n\t\t\tClassInfo::reset_db_cache();\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t}\n\t}", "public function cache() {\n $this->select(null,null,'slug asc');\n\t\tforeach ($this->cursor as $rec) {\n\t\t\t$this->cache[$rec->slug] = $rec->value;\n\t\t}\n\t}", "public function read()\r\n {\r\n $dataDict = Doctrine_Manager::getInstance()->getCurrentConnection()->getDataDict();\r\n\r\n $schema = new Doctrine_Schema(); /* @todo FIXME i am incomplete*/\r\n $db = new Doctrine_Schema_Database();\r\n $schema->addDatabase($db);\r\n\r\n $dbName = 'XXtest'; // @todo FIXME where should we get\r\n\r\n $this->conn->set(\"name\",$dbName);\r\n $tableNames = $dataDict->listTables();\r\n foreach ($tableNames as $tableName) {\r\n $table = new Doctrine_Schema_Table();\r\n $table->set(\"name\",$tableName);\r\n $tableColumns = $dataDict->listTableColumns($tableName);\r\n foreach ($tableColumns as $tableColumn) {\r\n $table->addColumn($tableColumn);\r\n }\r\n $this->conn->addTable($table);\r\n if ($fks = $dataDict->listTableConstraints($tableName)) {\r\n foreach ($fks as $fk) {\r\n $relation = new Doctrine_Schema_Relation();\r\n $relation->setRelationBetween($fk['referencingColumn'],$fk['referencedTable'],$fk['referencedColumn']);\r\n $table->setRelation($relation);\r\n }\r\n }\r\n }\r\n\r\n return $schema;\r\n }", "function &createCache() {}", "public function prewarmCache()\n {\n //Now that installation is complete, we need to set this to false to have the caches build correctly\n $GLOBALS['installing'] = false;\n $this->log(\"Populating metadata cache\");\n $GLOBALS['app_list_strings'] = return_app_list_strings_language('en_us');\n require_once 'include/MetaDataManager/MetaDataManager.php';\n MetaDataManager::setupMetadata(array('base'), array('en_us'));\n $this->log(\"Metadata cache populated\");\n }", "function testSchemaNotInCacheNoUpdate() {\n\t\t// If the revision was not in memcached...\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( $this->equalTo( 'schema:Test:99' ) )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// ...we'll see an attempt to acquire update lock,\n\t\t// which we'll deny:\n\t\t$this->cache\n\t\t\t->expects( $this->once() )\n\t\t\t->method( 'add' )\n\t\t\t->with( 'schema:Test:99:lock' )\n\t\t\t->will( $this->returnValue( false ) );\n\n\t\t// Without a lock, no HTTP requests will be made:\n\t\t$this->http\n\t\t\t->expects( $this->never() )\n\t\t\t->method( 'get' );\n\n\t\t// When unable to retrieve from memcached or acquire an update\n\t\t// lock to retrieve via HTTP, getSchema() will return false.\n\t\t$this->assertFalse( $this->schema->get() );\n\t}", "public function testSchemaCacheInvalidation()\n {\n\n $client = static::createRestClient();\n $client->request('GET', '/schema/testcase/schema-cache-invalidation/item');\n\n // 'en' must exist\n $this->assertObjectHasAttribute('en', $client->getResults()->properties->name->properties);\n\n // make sure they not exist before - no properties\n $this->assertObjectNotHasAttribute('es', $client->getResults()->properties->name->properties);\n $this->assertObjectNotHasAttribute('properties', $client->getResults()->properties->apps);\n\n // insert new Language\n $newLang = (object) [\n 'id' => 'es',\n 'name' => (object) [\n 'en' => 'Spanish'\n ]\n ];\n $client = static::createRestClient();\n $client->put('/i18n/language/es', $newLang);\n\n // insert new App\n $newApp = (object) [\n 'id' => 'testapp',\n 'name' => (object) [\n 'en' => 'TestApp'\n ],\n 'showInMenu' => true\n ];\n $client = static::createRestClient();\n $client->put('/core/app/testapp', $newApp);\n\n $client = static::createRestClient();\n $client->request('GET', '/schema/testcase/schema-cache-invalidation/item');\n\n // now, 'es' should be in the translatable schema\n $this->assertObjectHasAttribute('es', $client->getResults()->properties->name->properties);\n\n // and our testapp should be a property of the x-dynamic-key\n $this->assertObjectHasAttribute('testapp', $client->getResults()->properties->apps->properties);\n }", "protected function createSchemas()\n {\n $this->connection->query(\"ATTACH DATABASE ':memory:' AS aura_test_schema2\");\n }", "private function prepareSchema()\n {\n $connection = Yii::app()->db;\n if ($connection->schema->getTable($this->table)) {\n try {\n $this->dropTableIfExist($connection, $this->tableMemory);\n $connection->createCommand('CREATE TABLE ' . $connection->quoteTableName($this->tableMemory) . ' LIKE ' . $connection->quoteTableName($this->table) . ';')->execute();\n $connection->createCommand('ALTER TABLE ' . $connection->quoteTableName($this->tableMemory) . ' ENGINE=MEMORY;')->execute();\n return true;\n } catch (Exception $e) {\n $this->dropTableIfExist($connection, $this->tableMemory);\n Yii::log('Schema preparation error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n }\n } else {\n Yii::log('Nothing to copy.', 'error', 'extensions.CodMtfs.Mtfs');\n }\n return false;\n }", "public function setCaching($cache);", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "function optimizeDatabase() {}", "function flushCache() {\n\t\t// monograph ID, flush both caches on update.\n\t\t$cache =& $this->_getCache();\n\t\t$cache->flush();\n\t\tunset($cache);\n\n\t\t//TODO: flush cache of publishedMonographDAO once created\n\t}", "private function initializeSchema(): void\n {\n $definition = AccountSyncSchema::getSchemaDefinition();\n $queries = $definition->toSql($this->connection->getDatabasePlatform());\n\n foreach ($queries as $query) {\n $this->connection->executeQuery($query);\n }\n }", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "public function setUpCache();", "public function store()\n {\n $this->storeKeys();\n }", "public static function initCache()\n {\n// $cache->delete('config');\n }", "private function loadSchema($strTblName) {\n if (!$this->getFromCache($strTblName)) {\n $this->result = $this->query($this->getSchemaQuery($strTblName));\n $schema = $this->fetchValues($this->result);\n foreach ($schema as $value) {\n $this->schema[$strTblName][$value['Field']]['type'] = $value['Type'];\n $this->schema[$strTblName][$value['Field']]['length'] = $value['Length'];\n }\n $this->processSchemaCache($strTblName);\n }\n }", "public function reloadCaches() {}", "public function enableCache()\n\t{\n\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t$this->cacheType = $args['type'];\n\n\t\t$this->cache_expire = ( array_key_exists( 'cache_expire', $args ) ) ? $args['cache_expire'] : '3600';\n\t\t$this->cache_table = ( array_key_exists( 'table', $args ) ) ? $args['table'] : 'phpsmug_cache';\n\n if ( $this->cacheType == 'db' ) {\n \t\trequire_once 'MDB2.php';\n\n\t\t\t$db =& MDB2::connect( $args['dsn'] );\n\t\t\tif ( PEAR::isError( $db ) ) {\n\t\t\t\t$this->cacheType = FALSE;\n\t\t\t\treturn \"CACHING DISABLED: {$db->getMessage()} {$db->getUserInfo()} ({$db->getCode()})\";\n\t\t\t}\n\t\t\t$this->cache_db = $db;\n\n\t\t\t$options = array( 'comment' => 'phpSmug cache', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci' );\n\t\t\t$fields = array( 'request' => array( 'type' => 'text', 'length' => '35', 'notnull' => TRUE ),\n\t\t\t\t\t\t\t 'response' => array( 'type' => 'clob', 'notnull' => TRUE ),\n\t\t\t\t\t\t\t 'expiration' => array( 'type' => 'integer', 'notnull' => TRUE )\n\t\t\t\t\t\t );\n\t\t\t$db->loadModule('Manager');\n\t\t\t$db->createTable( $this->cache_table, $fields, $options );\n\t\t\t$db->setOption('idxname_format', '%s'); // Make sure index name doesn't have the prefix\n\t\t\t$db->createIndex( $this->cache_table, 'request', array( 'fields' => array( 'request' => array() ) ) );\n\n if ( $db->queryOne( \"SELECT COUNT(*) FROM $this->cache_table\") > $this->max_cache_rows ) {\n\t\t\t\t$diff = time() - $this->cache_expire;\n $db->exec( \"DELETE FROM {$this->cache_table} WHERE expiration < {$diff}\" );\n $db->query( 'OPTIMIZE TABLE ' . $this->cache_table );\n }\n } elseif ( $this->cacheType == 'fs' ) {\n\t\t\tif ( file_exists( $args['cache_dir'] ) && ( is_dir( $args['cache_dir'] ) ) ) {\n\t\t\t\t$this->cache_dir = realpath( $args['cache_dir'] ).'/phpSmug/';\n\t\t\t\tif ( is_writeable( realpath( $args['cache_dir'] ) ) ) {\n\t\t\t\t\tif ( !is_dir( $this->cache_dir ) ) {\n\t\t\t\t\t\tmkdir( $this->cache_dir, 0755 );\n\t\t\t\t\t}\n\t\t\t\t\t$dir = opendir( $this->cache_dir );\n \twhile ( $file = readdir( $dir ) ) {\n \tif ( substr( $file, -6 ) == '.cache' && ( ( filemtime( $this->cache_dir . '/' . $file ) + $this->cache_expire ) < time() ) ) {\n \tunlink( $this->cache_dir . '/' . $file );\n \t}\n \t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->cacheType = FALSE;\n\t\t\t\t\treturn 'CACHING DISABLED: Cache Directory \"'.$args['cache_dir'].'\" is not writeable.';\n\t\t\t\t}\n\t\t\t} else \t{\n\t\t\t\t$this->cacheType = FALSE;\n\t\t\t\treturn 'CACHING DISABLED: Cache Directory \"'.$args['cache_dir'].'\" doesn\\'t exist, is a file or is not readable.';\n\t\t\t}\n\t\t}\n\t\treturn (bool) TRUE;\n }", "function schema() {\n\t\tif(empty($this->table)) {\n\t\t\tthrow new ConnerException('Unknown table for schema in model '.get_class($this));\n\t\t}\n\n\t\tif(empty($this->schema)) {\n\n\t\t\t$cacheKey = 'MysqlModel.'.get_class($this).'.schema';\n\n\t\t\tif(is_null($schema = cache\\file($cacheKey, null, MONTH))) {\n\t\t\t\t$schema = array();\n\t\t\t\t$res = $this->query('DESCRIBE `'.$this->table.'`');\n\n\t\t\t\tif(empty($res)) { // false on error\n\t\t\t\t\treturn array(); // perhaps throwing an exception here may be a better way? i not sure.\n\t\t\t\t}\n\n\t\t\t\twhile ($row = $res->fetch_row()) {\n\t\t\t\t\t$schema[$row[0]] = array(\n\t\t\t\t\t\t'key'=>$row[0],\n\t//\t\t\t\t\t'type'=>$row[1], // todo: parse this into something better\n\t\t\t\t\t\t'primary'=>($row[3]=='PRI'),\n\t\t\t\t\t\t'default'=>$row[4],\n\t\t\t\t\t);\n\t\t }\n\t\t\t\t$res->free();\n\t\t\t\tcache\\file($cacheKey, $schema, MONTH);\n\t\t\t}\n\t\t\t$this->schema = $schema;\n\t\t}\n\n\t\treturn $this->schema;\n\t}", "public function writeToCache(CacheObject $object) {\n $type = $object->getType();\n $id = $object->getId();\n\n $this->readType($type);\n\n if (!array_key_exists($type, $this->cache)) {\n $this->cache[$type] = array();\n }\n\n $this->cache[$type][$id] = $object;\n }", "function __initTransSchema() {\n\t\t$fields = $this->settings[$this->model->alias]['fields'];\n\t\t$primary = $this->model->primaryKey;\n\t\t$results = array();\n\t\t$schema = $this->model->_schema;\n\t\t$results = am($results, $this->__setSchemaField($primary, $schema[$primary]));\n\t\tforeach ($schema as $fieldname => $descArray) {\n\t\t\tif (!empty($fields)) {\n\t\t\t\tif (array_key_exists($fieldname, $fields)) {\n\t\t\t\t\t$results = am($results, $this->__setSchemaField($fieldname, $descArray));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($fieldname !== $primary) {\n\t\t\t\t\t$results = am($results, $this->__setSchemaField($fieldname, $descArray));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->__transSchema = $results;\n\t}", "public function warmUpCache(): void\n {\n $this->cache = [];\n foreach ($this->entityAliasResolvers as [$serviceId, $expression]) {\n /** @var EntityAliasResolver $entityAliasResolver */\n $entityAliasResolver = $this->container->get($serviceId);\n $entityAliasResolver->warmUpCache();\n }\n }", "public function schema();", "protected function initializeCache() {}", "private function setup_cache() {\n // Set up non-persistent object caching groups\n wp_cache_add_non_persistent_groups( [ '_np_pedestal' ] );\n }", "protected function initializeCache() {}", "protected function _saveTableNamesCache() {\n\t\tif (!$this->_cache) {\n\t\t\treturn;\n\t\t}\n\n\t\t// store table list for 12 hours\n\t\t$this->_cache->save($this->_tableNames, 'rsc_simpledb_tablenames', array(), 43200);\n\t}", "public function define(Schema $schema): void\n {\n }", "function start_cache()\r\n\t{\r\n\t\t$this->db->start_cache();\r\n\t}", "private function cachePermissions(): void\n {\n Cache::put($this->cacheKey(), [\n 'isPayor' => $this->isPayor,\n 'isAgencyBankAccountSetup' => $this->isAgencyBankAccountSetup,\n 'canViewDocumentation' => $this->canViewDocumentation,\n ]);\n }", "public function sync()\n {\n $sql = null;\n $module = new \\ZPM\\Core\\Setup\\Schema();\n $modData = new \\ZPM\\Core\\Setup\\Info();\n\n $module->install();\n }", "function wp_clear_object_cache() {\n\tglobal $wpdb, $wp_object_cache;\n\n\t$wpdb->queries = array(); // or define( 'WP_IMPORTING', true );\n\n\tif ( ! is_object( $wp_object_cache ) ) {\n\t\treturn;\n\t}\n\n\t$wp_object_cache->group_ops = array();\n\t$wp_object_cache->stats = array();\n\t$wp_object_cache->memcache_debug = array();\n\t$wp_object_cache->cache = array();\n\n\tif ( is_callable( $wp_object_cache, '__remoteset' ) ) {\n\t\t$wp_object_cache->__remoteset(); // important\n\t}\n}", "public function initialize(){\n $this->setSchema(\"\");\n }", "public function compileSchema();", "public static function clearCache()\n\t{\n\t\tself::$definitions = null;\n\t}", "public function flush()\r\n {\r\n foreach ($this->_collections as $key => $coll) {\r\n $coll->takeSnapshot();\r\n }\r\n foreach ($this->_tables as $table) {\r\n $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);\r\n }\r\n $this->_initializedRelations = null;\r\n $this->_collections = null;\r\n $this->_tables = null;\r\n }", "protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }", "public function getSchema(): SchemaInterface;", "public function flushDataStore()\n {\n $this->database->flushAll(); \n }", "public function getSchema() {}", "public function initTable()\n\t{\n\t\t$this->db->exec(\"\n\t\t\tCREATE TABLE `cache` (\n\t\t\t `id` varbinary(255) NOT NULL,\n\t\t\t `data` longblob NOT NULL,\n\t\t\t `date_expire` datetime DEFAULT NULL,\n\t\t\t INDEX date_expire_idx (date_expire),\n\t\t\t PRIMARY KEY (`id`)\n\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\t\t\");\n\t}", "public function warmUpCache($mode = self::MODE_ALL)\n {\n if (!$this->configManager->isDatabaseReadyToWork()) {\n return;\n }\n\n $this->loadConfigurable($mode === self::MODE_CONFIGURABLE_ENTITY_ONLY);\n if ($mode === self::MODE_ALL) {\n // disallow to load new models\n $this->configModelLockObject->lock();\n try {\n $this->loadNonConfigurable();\n $this->loadVirtualFields();\n $this->configModelLockObject->unlock();\n } catch (\\Exception $e) {\n $this->configModelLockObject->unlock();\n throw $e;\n }\n }\n }", "static public function flush_cache( ) {\n\n foreach( array( 'wpp_categorical', 'wpp_location') as $taxonomy ) {\n wp_cache_delete( 'all_ids', $taxonomy );\n wp_cache_delete( 'get', $taxonomy );\n delete_option( \"{$taxonomy}_children\" );\n _get_term_hierarchy( $taxonomy );\n }\n\n }", "public function flush()\n {\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheIndex)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheIndex);\n touch($this->CacheFolder . \"/\" . $this->CacheIndex);\n }\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheDB)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheDB);\n touch($this->CacheFolder . \"/\" . $this->CacheDB);\n }\n }", "public function set(){\n\n /**\n * New Schema or Connect to existing schema\n */\n\n $schema = new Schema('Staff');\n $schema->destroy('id');\n $schema->build('id')->Primary()->Integer()->AutoIncrement();\n $schema->build('firstname')->String();\n $schema->build('lastname')->String();\n $schema->build('email')->String()->Unique();\n $schema->build('password')->String();\n $schema->build('IPPIS_NO')->String()->Unique(); \n $schema->build('religion')->String();\n $schema->build('denomination')->String();\n $schema->build('residential_address')->String();\n $schema->build('oauth_file_no')->String();\n $schema->build('Staff_rank')->String();\n $schema->build('department')->String();\n $schema->build('last_seen')->Timestamp();\n $schema->build('created_at')->Timestamp();\n }" ]
[ "0.8440461", "0.68191123", "0.67032254", "0.61993545", "0.6166446", "0.6092475", "0.60177207", "0.60010564", "0.59326756", "0.5921189", "0.5851219", "0.5810602", "0.57415044", "0.5700828", "0.56863827", "0.5648211", "0.55333555", "0.54751956", "0.5432691", "0.5420737", "0.5413247", "0.54031014", "0.5396627", "0.53584325", "0.5320794", "0.5312071", "0.52968585", "0.5257803", "0.52568626", "0.5253909", "0.5245136", "0.51949805", "0.5182782", "0.51665324", "0.5156442", "0.5134264", "0.5129468", "0.5124169", "0.5119322", "0.50947666", "0.50872374", "0.50865316", "0.50772357", "0.50696576", "0.50630766", "0.5056184", "0.5050494", "0.50471646", "0.5039137", "0.5034865", "0.5034451", "0.50186604", "0.50101775", "0.49977228", "0.49963728", "0.49862823", "0.49704307", "0.49685594", "0.49620453", "0.49524465", "0.49429968", "0.4942914", "0.49409395", "0.49385443", "0.4936669", "0.4934465", "0.49344584", "0.49329618", "0.49228737", "0.49217835", "0.4910404", "0.4899324", "0.48963886", "0.48963177", "0.48923916", "0.48914412", "0.48797703", "0.48714742", "0.48645344", "0.48623052", "0.48603365", "0.48368183", "0.4827459", "0.4823931", "0.48210967", "0.4815002", "0.4812066", "0.47968915", "0.4791338", "0.47876748", "0.47833472", "0.47753584", "0.47746876", "0.47724152", "0.47691625", "0.47587344", "0.47548598", "0.47525784", "0.47507766", "0.47504508" ]
0.61667764
4
Display a listing of the resource.
public function getAuthors(){ if(Auth::check()) if(Auth::user()->tipo_utilizador == "admin") return $autoresAll=Utilizador::where("tipo_utilizador","autor")->with("tutoriais")->get(); return view("pages.error"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function myAcc($id=null){ if(Auth::check() ) { if (Auth::User()->tipo_utilizador == "admin") { if ($id != null) { //editing others $user = utilizador::find($id); $tutoriais = Tutorial::where("id_utilizador", $user->id)->get(); return view("templates.templateOthersAccAdmin", ["user" => $user, "tutoriais" => $tutoriais]); } } } if(Auth::check() ){ $user = Auth::user(); $tutoriais=Tutorial::where("id_utilizador",$user->id)->get(); // dd($tutoriais); return view("templates.templateMyacc",["user"=>$user,"tutoriais"=>$tutoriais]); } return view("pages.error"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Intenta crear una cerveza
public function createCerveza($params) { $tc = new TipoCerveza(); try { $tc->find(['descripcion' => $params['descripcion']]); if ($tc !== null) { throw new Exception("La cerveza " . $params['descripcion'] . " ya se encuentra dada de alta en el sistema"); } } catch (NotFoundException $ex) { // Proceso imagen $path_imagen = null; if ($this->resizeImage($params['foto'], 'cervezas', $path_imagen)) { $this->initCerveza($tc, $params, $path_imagen); $tc->setCreadoPor($this->getUsuario()); $tc->setCreadoEn(Utils::getCurrentTimestamp()); $tc->create(); } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crearCorreoInstitucional(){\n $nom0 = $this->attributes['nombre'];\n //tomo el/los apellido/s del preinscripto\n $ape0 = $this->attributes['apellido'];\n //defino el dominio que tendrá cada mail creado\n $dominio = \"@udc.edu.ar\";\n \n $nom = $this->inicialesDeNombres($nom0);\n $nom1 = $this->sanear_string($nom);\n \n $ape = $this->apellidosCompletos($ape0);\n $ape1 = $this->sanear_string($ape);\n \n \n $correo_institucional = $nom1.$ape1.$dominio; \n $this->attributes['email_institucional'] = $correo_institucional;\n $this->save();\n }", "public function crear()\n {\n can('crear-certificado');\n return view('certificado.crear');\n }", "function doCreate() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\n\t\t\n\t\t// Create a new annonce with uniq id\r\n\t\t$this->annonce = new Annonce();\n\t\t$this->annonce->id = uniqid();\n\t\t\n\t\t// Populate from request\n\t\t$this->populateAnnonce();\n\t\t\n\t\t// Publish this announce\t\n\t\t$this->annonce->publish();\n\t\t\n\t\t// Make nice benevolat be notified of future canditatures\n\t\t$req = new Candidature();\n\t\t$req->annonceID = $this->annonce->id;\n\t\t$req->subscribe(ProfileNiceBenevolat::$USERID);\n\t\t\n\t\t// Succes message\r\n\t\t$this->setSuccess(_(\"Votre annonce a bien été publiée\"));\n\t\t\n\t\t// Show the new annonce\n\t\t$this->forwardTo(\"annonce:details\", array(\"id\" => $this->annonce->id));\n\r\n\t}", "public function create()\n {\n echo \"Criaçao de novos clientes\";\n }", "public function create()\n {\n return 'okey c';\n }", "public function crear()\n {\n //\n }", "public function createInvoice()\n {\n //seccion para registrar certificaos relacionados con un RFC \n /* $params = [ \n 'Rfc' => 'AAA010101AAA',\n 'Certificate' => 'MIIF+TCCA+GgAwIBAgIUMzAwMDEwMDAwMDAzMDAwMjM3MDEwDQYJKoZIhvcNAQELBQAwggFmMSAwHgYDVQQDDBdBLkMuIDIgZGUgcHJ1ZWJhcyg0MDk2KTEvMC0GA1UECgwmU2VydmljaW8gZGUgQWRtaW5pc3RyYWNpw7NuIFRyaWJ1dGFyaWExODA2BgNVBAsML0FkbWluaXN0cmFjacOzbiBkZSBTZWd1cmlkYWQgZGUgbGEgSW5mb3JtYWNpw7NuMSkwJwYJKoZIhvcNAQkBFhphc2lzbmV0QHBydWViYXMuc2F0LmdvYi5teDEmMCQGA1UECQwdQXYuIEhpZGFsZ28gNzcsIENvbC4gR3VlcnJlcm8xDjAMBgNVBBEMBTA2MzAwMQswCQYDVQQGEwJNWDEZMBcGA1UECAwQRGlzdHJpdG8gRmVkZXJhbDESMBAGA1UEBwwJQ295b2Fjw6FuMRUwEwYDVQQtEwxTQVQ5NzA3MDFOTjMxITAfBgkqhkiG9w0BCQIMElJlc3BvbnNhYmxlOiBBQ0RNQTAeFw0xNzA1MTgwMzU0NTFaFw0yMTA1MTgwMzU0NTFaMIHlMSkwJwYDVQQDEyBBQ0NFTSBTRVJWSUNJT1MgRU1QUkVTQVJJQUxFUyBTQzEpMCcGA1UEKRMgQUNDRU0gU0VSVklDSU9TIEVNUFJFU0FSSUFMRVMgU0MxKTAnBgNVBAoTIEFDQ0VNIFNFUlZJQ0lPUyBFTVBSRVNBUklBTEVTIFNDMSUwIwYDVQQtExxBQUEwMTAxMDFBQUEgLyBIRUdUNzYxMDAzNFMyMR4wHAYDVQQFExUgLyBIRUdUNzYxMDAzTURGUk5OMDkxGzAZBgNVBAsUEkNTRDEwX0FBQTAxMDEwMUFBQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIiV+76Q7p9i5Bj4G1YuYuPtf/cO/dyNX19o6y57CiKcgGYEqPqb88cJ/IPPyFPIFtBdxYJmqikxMwxDHTIsolI0GMvqEO1BsokcDOL4UfMZt7NmYaH1P8Nj/fO5xn0b1qSnSfQHGdPLMgXsLPhaR69HREsVEIowEMM5ucoNArSNzel4XJU8X/dnoumZvaOyCdvEC076NzB3UJA53ZD1xvvPEedUfAfj2eaUCQJYPnToyf7TAOGzzGkX5EGcjxC3YfcXGwG2eNdbSbxSiADPx6QACgslCu1vzmCzwQAmfeHWQvirpZccJyD/8shd7z7fv5A/G0g3aDloM5AXwA3nDVsCAwEAAaMdMBswDAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCBsAwDQYJKoZIhvcNAQELBQADggIBAJepSmoMRmasH1IyLe68oM6+Qpm/kXjwQw8ALMkhHTI3XmxjUVqpJ6k9zZQfwyTLc2UZIo8jdO4WH3bcRBDcYOkciW3KxhKAbLgJPHAieVOyObXViET0ktLL6xeDHnf5Au4LOi0m01E8IPFbxYKb+RU1xpOKqJuRHH5dfRBg4HV8y+OTa5lVZil+sAhwdyXFsPf9FqN1SNn9EuKjYc9+lkRiGcHPNb1ZAtDsaQdGzoAbR+Z6m9FdZB/XU+Huls+ePdkw1t2/37AJZkYqr3wVNKrrpQkax9DrnFT8E+7xKXLcbpw3YOYBoENj2+NuMn29sn3U97wKlpyn/GeMwbkCmOGBAMtK9O6+wRrcEmu9Js68asHd5JQSzA39BRAUjb/9aefmWTb6DNm22IUUSSOT9MK5yWGncdWxKrNtMvx7OyYlYV2/qG4p/rMlj6nZcIpwONhyLUwxr74kO0Jo3zus81t9S/J91jumiwyNVqJZ77vmAy6lQnr8Og9/YaIzDH5L/byJQJquDKEmLvuya4sQ2iJj+p282RNpBscO/iyma8T+bZjG2CFYUTwGtOEZ2aLqApJ4cCBW7Ip569B+g7mgG8fdij6E1OlJ8Y3+ovBMak8LtnFVxsfthdWOK+AU2hWGU88rfZkLJ0RJn8oAq/6ri0iJNCKym/mc9g0JpNw+asMM',\n 'PrivateKey' => 'MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS9AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucRBAKNQXH8tz2zJ7hdZaOZx7PEfMiWh5Nh6e8G8kxY+GW4YCSbLxslkhBtfTR6v5JYv3vhgH7XzMCwJPOfX6gxeeCYZ4HTdDNAyBVCjTbJpqbo778ri33o+I4yx7zgMqA3mzVE61re6MPrGXh1YT/K9zZeEdmwvXQfPs9VnioKUhiswoMcJ3kc3FxGLrEAsjQqv/ZVOHPY3NrbcfpQUyprsCKv3rRdxkIRdMPY4eiA720mffzvDqyzeQ8xfwHTE8Xjunja4KXvW/mV7ItTH0vRXHc3HJQ0dNnyawXmbC1FiYbCVdswoYuVQmslvq3QEXUGwP3KYfxQzKatnU7nprkmsipPqPBqDrzqc6NSN/8rxIc5zTAL4bFul+CEKz9VybwdavgewEy7u3fPnKPN+y4HilNgmlbtS7seWpbIgVPA+woG2Ph5hsgREXZCjGKSRuI77/FLcI5CMrZR+FvbnaqG+gXDBTz2lWhK9pmWlVawT2pvfiHOLzYRf2YyuVbJ79D2EgbUKyp3kCQ6fddMzspPhD/pvLQizExeyIxImb/kQXs2mmtDnyFIsj4Hcn5wCcs+SDIj+FJnwRiKB6YfdzjIig/ZMfpgMpl0u69LX649uL318o+Hy3d5t3wxgSkTaJ5McKhWyh9x9vlHZhYyM6HArBNfP9cGF86M3GwAMHAiJQl9UevyKe6rlvAIDlop6l3M02m5hHUXUpPjz4j7inFXZzvSv0tFoSbEqGgno0Pa+0gWHqRwBEGLGEwHVfyEy+Of8g4+0jzo0jNPIcurA5xRh9HSRSAd3kdEhx75eeVL7lBdLjRUkbtRtg7nelSjqAX7tQZK6Awp5C/17W96+f/vtjB+Y+ZgrSUjnQDADnZCnapIrzHgE3ZanhGAtnMMl+o4aLd1+74inG4jht/GJB60raSQfYrDrM3kBs0oyfpbEk5TI8ISzRlRmejv+mqpTogJaAqhnLP7rAli3d4pRhUjbACn/xQSFKxl2OURdmnMlvlbb6pleXviJHRxzPPQ25NVdWvmCYWrDfAZYn8X1sABOdyrth38BfmAVsyyPATYFB+5cXuNIZkPz1swz3859iZWTn5JRfPEAGICu5G6w6nrgOLYM9UqOPmxofzEdiEPafLQ5orMxdSWF6+3mD2Yw/VP+B43B/oYehgfrYjBUJt2D04VU/v8XK1ZUVgX/Co0odcdcszAP+ljQ7UVhW+uxVMd2sEprwepPPjYT3HvdI6RBB94yYBWfkoCSo/jsrrRpw2DVEyvoDp/hOXKyt8Y/8UGLCxJUhhv5fEiezYnlUAmwAGjgZfzfAErx0gkQFBgNKglEA7jz0Dqc2Z92pGVGTyPtXqRsqX3IYX5WsZVUoJim0wI7+LNmKpu147ePC0G4Sf4AGoZyPWVXq2SZSPpN261pIKSoLEDeA8WIKj2U5JG2DMMYokV0bZ1TsabrwHvwsp3muLnaP8L+n2fBplbhAEE2buBXvsATixMGu57ZI5WKFLnHn4KIBrZzALCtGehfFbCsdf1nBR6aAt+BpWhhZki54fZTurgMr6zuC5hAaP4rExW+LCc3upHMW7R9DcHWaZuZIfwnVDImnAQ9UOsz+A=',\n 'PrivateKeyPassword' => '12345678a'\n ];\n $lstNameIds = $this->facturama->post('api-lite/csds', $params ); */\n\n\n $params = [\n \"Issuer\" => [\n \"FiscalRegime\" => \"601\",\n \"Rfc\" => \"AAA010101AAA\",\n \"Name\" => \"EXPRESION EN SOFTWARE\"\n ],\n \"Receiver\" => [\n \"Name\" => \"Entidad receptora\",\n \"CfdiUse\" => \"P01\",\n \"Rfc\" => \"AAA010101AAA\"\n ],\n //agregado NO \n 'Folio' => '102',\n \"CfdiType\" => \"I\",\n \"NameId\" => \"1\",\n \"ExpeditionPlace\" => \"12345\",\n \"PaymentForm\" => \"03\",\n \"PaymentMethod\" => \"PUE\",\n \"Currency\" => \"MXN\",\n \"Date\" => \"2021-01-19T09:51:39\",\n \"Items\" => [\n [\n \"Quantity\" => \"100\",\n \"ProductCode\" => \"84111506\",\n \"UnitCode\" => \"E48\",\n \"Unit\" => \"Unidad de servicio\",\n \"Description\" => \" API folios adicionales\",\n \"IdentificationNumber\" => \"23\",\n \"UnitPrice\" => \"0.50\",\n \"Subtotal\" => \"50.00\",\n \"Discount\" => \"10\",\n \"DiscountVal\" => \"10\",\n \"Taxes\" => [\n [\n \"Name\" => \"IVA\",\n \"Rate\" => \"0.16\",\n \"Total\" => \"6.4\",\n \"Base\" => \"40\",\n \"IsRetention\" => \"false\"\n ]\n ],\n \"Total\" => \"46.40\"\n ],\n [\n \"Quantity\" => \"1\",\n \"ProductCode\" => \"84111506\",\n \"UnitCode\" => \"E48\",\n \"Unit\" => \"Unidad de servicio\",\n \"Description\" => \" API Implementación \",\n \"IdentificationNumber\" => \"21\",\n \"UnitPrice\" => \"6000.00\",\n \"Subtotal\" => \"6000.00\",\n \"Taxes\" => [\n [\n \"Name\" => \"IVA\",\n \"Rate\" => \"0.16\",\n \"Total\" => \"960\",\n \"Base\" => \"6000\",\n \"IsRetention\" => \"false\"\n ]\n ],\n \"Total\" => \"6960.00\"\n ]\n ]\n ];\n\n // $result = $this->facturama->post('2/cfdis', $params);\n // api-lite\n $result = $this->facturama->post('api-lite/2/cfdis', $params);\n return $result;\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "public function create()\n {\n //Valida se usuário possui permissão para acessar esta opção\n if(App\\Models\\User::getPermission('couriers_add',Auth::user()->user_type_code)){\n\n return view('partners.couriers.create');\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return redirect(route('couriers.index'));\n }\n }", "function create() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\n\t\t\n\t\t// Dummy empty annonce\n\t\t$this->annonce = new Annonce();\n\t\t$this->annonce->competences = $this->extendedProfile->competences;\n\t\t$this->annonce->begin = date(DATE_FORMAT);\n\t\t$this->renderView(\"createAnnonce\");\n\t\t\n\t}", "public function create(){\n\n $clave=Input::get('clave');\n $cuenta=Input::get('cuenta');\n $tramite_id=Input::get('tramite_id');\n //Todos los catalogos que se utilizan en combos y opciones en la forma de la manifestacion\n $vars = $this->catalogos();\n\n $JsonColindancias = json_encode([]);\n\n $manifestacion = $this->manifestacion;\n\n $vars['JsonColindancias'] = $JsonColindancias;\n $vars['manifestacion'] = $manifestacion;\n $vars['clave']=$clave;\n $vars['cuenta']=$cuenta;\n $vars['tramite_id']=$tramite_id;\n \n return View::make('ofvirtual.notario.manifestacion.createTramite', $vars);\n }", "public function crear() {\n\t\t$this->load->model('pais_model');\n\t\t$datos['body']['paises'] = $this->pais_model-> getAll($filtro=\"\");\n\t\t\n\t\tenmarcar($this, 'autor/crear', $datos);\n\t}", "public function admin_creacion_contacto(){\n\n\t\t$this->layout = 'dialog';\n\n\t\t$data = $this->request->data;\n\n\t\t$id_dialog = 'main-dialog';\n\n\t\tif ( isset( $data['id_dialog'] ) ){\n\n\t\t\t$id_dialog = $data['id_dialog'];\n\t\t}\n\n\t\t$title = '';\n\n\t\tif ( isset( $data['title'] ) ){\n\n\t\t\t$title = $data['title'];\n\t\t}\n\n\t\t$classes = '';\n\n\t\tif ( isset( $data['classes'] ) ){\n\n\t\t\t$classes = $data['classes'];\n\t\t}\n\n\t\t$this->set('id_dialog', $id_dialog);\n\n\t\t$this->set('title', $title);\t\n\t\t\n\t\t$this->set('classes', $classes);\t\n\t}", "public function create()\n {\n \n echo \"Syntax: POST: /api?telefon=*telefon*&id_agencija=*id*<br>/api?email=*email*&id_agencija=*id*\";\n \n }", "public function createCredential(Request $request)\n {\n $request->validate([\n 'code' => 'required|string',\n ]);\n\n $response = Http::withHeaders([\n 'accept' => 'application/json',\n 'content-type' => 'application/x-www-form-urlencoded',\n ])->post('https://api.mercadopago.com/oauth/token', [\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => config('mp.redirect_url'),\n 'client_secret' => config('mp.access_token'),\n 'code' => $request->input('code'),\n ]);\n\n if ($response->ok()) {\n $credential = $response->json();\n Auth::user()->credential()->create([\n 'mp_user_id' => $credential['user_id'],\n 'public_key' => $credential['public_key'],\n 'access_token' => $credential['access_token'],\n 'refresh_token' => $credential['refresh_token'],\n 'expires_in' => $credential['expires_in'],\n ]);\n\n return response()->json(['message' => __('common.created_credential_success')], 201);\n }\n\n return response()->json(['message' => __('common.created_credential_fail')], 422);\n }", "public function create()\n {\n Encargado::create($request->all());\n return ['created'=>true];\n }", "static public function ctrCrearClase(){\r\n\r\n\t\tif(isset($_POST[\"nuevoDescripClase\"])){\r\n\r\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoDescripClase\"])){\r\n\r\n\t\t\t\t$tabla = \"tbl_clases\";\r\n\r\n\r\n\t\t\t\t$datos = array(\"DescripClase\" => strtoupper($_POST[\"nuevoDescripClase\"]),\r\n \"Duracion\" => $_POST[\"nuevoDuracion\"]);\r\n\r\n\r\n\t\t\t\t$respuesta = ModeloClases::mdlIngresarClases($tabla, $datos);\r\n\r\n\t\t\t\tif($respuesta == \"ok\"){\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\tswal({\r\n\r\n\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\ttitle: \"¡La Clase sido guardada correctamente!\",\r\n\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\tcloseOnConfirm: false\r\n\r\n\t\t\t\t\t}).then((result)=>{\r\n\r\n\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\twindow.location = \"modalidades\";\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\t</script>';\r\n\r\n\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\tswal({\r\n\r\n\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\ttitle: \"¡El nombre de la Clase no puede ir vacía o llevar caracteres especiales!\",\r\n\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\tcloseOnConfirm: false\r\n\r\n\t\t\t\t\t}).then((result)=>{\r\n\r\n\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\twindow.location = \"modalidades\";\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t</script>';\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\r\n\t}", "public function create()\n {\n $this->cpAuthorize();\n }", "static public function ctrCrearAtencionCPANEL(){\r\n\t\t\tif (isset($_POST[\"nuevoCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"idUser\"])){\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCIONL =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta = \"\";\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 2 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta2 = \"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho2, $alto2) = getimagesize($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio2, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico2\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho2, $alto2);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta2);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico2\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho2, $alto2);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta2);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 3 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta3 = \"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico3\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta3 = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta3);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico3\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta3 = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta3);\r\n\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 4 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta4 =\"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico4\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta4 = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta4);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico4\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta4 = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta4);\r\n\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"codigo_atencion\" => $_POST[\"nuevoCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"idUsuario\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"nuevaPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"nuevoPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"nuevaUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"nuevoServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"nuevaEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"nuevoDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico\" => $ruta,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico2\" => $ruta2,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico3\" => $ruta3,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico4\" => $ruta4,\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"nuevaFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlIngresarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido guardado correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro atenciones CPANEL ======*/\t\t\t\t\t\r\n\t }", "public function run()\n {\n factory(Commande::class, 150)->create(); \n }", "public function create(){\n\n\t\t$organizaciones = DB::table('organizaciones as org')->select('org.idorganizacion', 'org.organizacion', 'org.nit')->get();\n\t\t$personas = DB::table('clientes as cli')->select('cli.id','cli.name','cli.last_name','cli.document')->get(); \n\n\t\t// dd($organizaciones,$personas);\n\n\t\treturn view ('clientes.contactos.create',[\"organizaciones\"=>$organizaciones,\"personas\"=>$personas]) ;\n\n\t}", "function createCampaign($sender, $text, $list_id, $datetime, $batch, $batchinterval, $sms_lifetime, $controlnumber){\n\t\treturn $this->gateway->execCommad('createCampaign',array('sender' => $sender, 'text' => $text, 'list_id' => $list_id, 'datetime' => $datetime, 'batch' => $batch, 'batchinterval' => $batchinterval, 'sms_lifetime' => $sms_lifetime, 'controlnumber' => $controlnumber));\n\t}", "public function executeEnviarclave() {\n\n\n }", "static public function ctrCrearCcuerpo(){\n\n if(isset($_POST[\"nuevoCcuerpo\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\- ]+$/', $_POST[\"nuevoCcuerpo\"])){\n\n\t\t\t\t$tabla = \"cuartel_cuerpos\";\n\n\t\t\t\t$datos = array(\"tipo_sep\"=> $_POST[\"nuevoTproducto\"],\n \"nombre\"=> $_POST[\"nuevoCcuerpo\"],\n \"id_sociedad\" => '0',\n \"id_cementerio\"=> $_POST[\"nuevoCementerio\"]);\n\n\t\t\t\t$respuesta = ModeloCcuerpo::mdlIngresarCcuerpo($tabla, $datos);\n print_r($respuesta);\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El Cuartel-Cuerpo ha sido guardado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El Cuartel-Cuerpo no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"cuartel-cuerpo\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function crear_carpeta_banco(){\n\t\t\t$x = $this->consultar_id();\n\t\t\tif(file_exists(\"../Process/BANCO\")){\n\t\t\t\t$destino = \"../Process/BANCO/\".$x;\n\t\t\t\tmkdir($destino);\n\t\t\t\t$destino = \"../Process/BANCO/\".$x.\"/DOCUMENTOS\";\n\t\t\t\tmkdir($destino);\n\t\t\t}else{\n\t\t\t\t$destino = \"../Process/BANCO\";\n\t\t\t\tmkdir($destino);\n\t\t\t\t$destino = \"../Process/BANCO/\".$x;\n\t\t\t\tmkdir($destino);\n\t\t\t\t$destino = \"../Process/BANCO/\".$x.\"/DOCUMENTOS\";\n\t\t\t\tmkdir($destino);\n\t\t\t}\n\t\t}", "public function createCarte()\n {\n $this->utils->Restreindre($this->userConnecter->admin, $this->utils->Est_autoriser(9, $this->userConnecter->profil));\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $data['profession'] = $this->utils->professions();\n $data['typepiece'] = $this->utils->typepiece();\n $data['pays'] = $this->utils->listePays();\n $data['nationalites'] = $this->utils->nationalites();\n $data['regions'] = $this->utils->allRegionByPays();\n $paramsview = array('view' => 'compte/new-carte');\n $this->view($paramsview, $data);\n }", "public function createAction() {\n $model = new Application_Model_Compromisso();\n //persisto os dados no banco\n $model->insert($this->_getAllParams());\n //redireciono para o index\n $this->_redirect('compromisso/index');\n }", "public function create()\n {\n //\n $certificaciones = TipoCertificacion::get();\n return view('preinscripcion/create', compact('certificaciones'));\n }", "public function creaCliente()\n {\n $id=null; // id del cliente, esto es lo que se debe guardar en la DB\n $this->cliente = $this->pasarela->customer()->create([\n 'firstName' => 'Mike',\n 'lastName' => 'Jones', \n 'company' => 'Jones Co.',\n 'email' => 'mike.jones@example.com',\n 'phone' => '281.330.8004',\n 'fax' => '419.555.1235',\n 'website' => 'http://example.com'\n ]);\n $this->cliente=$this->cliente->customer->id; // asi es como se obtiene el id del cliente\n // se guarda en la DB\n $c=new Cliente();\n $c->token=$this->cliente;\n $c->save();\n }", "public function actionCreate()\n {\n $session = Yii::$app->session;\n\n $model = new Manutencao();\n\n //Encaminhado para providências\n $model->tipo_solic_id = 2; // Solicitação de Manutenção\n $model->idusuario_solic = $session['sess_codusuario'];\n $model->usuario_solic_nome = $session['sess_nomeusuario'];\n $model->cod_unidade_solic = $session['sess_codunidade'];\n $model->data_solicitacao = date('Y-m-d');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n //ENVIANDO EMAIL PARA OS RESPONSÁVEIS DO GMT INFORMANDO SOBRE O RECEBIMENTO DE UMA NOVA SOLICITAÇÃO DE MANUTENÇÃO \n //-- 12 - GERENCIA DE MANUTENÇÃO E TRANSPORTE // 16 - SEDE ADMINISTRATIVA GMT\n $sql_email = \"SELECT DISTINCT emus_email FROM emailusuario_emus,colaborador_col,responsavelambiente_ream,responsaveldepartamento_rede WHERE ream_codunidade = '12' AND rede_coddepartamento = '16' AND rede_codcolaborador = col_codcolaborador AND col_codusuario = emus_codusuario\";\n \n $email_solicitacao = Emailusuario::findBySql($sql_email)->all(); \n foreach ($email_solicitacao as $email)\n {\n $email_usuario = $email[\"emus_email\"];\n\n Yii::$app->mailer->compose()\n ->setFrom(['gmt.suporte@am.senac.br' => 'GMT - INFORMA'])\n ->setTo($email_usuario)\n ->setSubject('Solicitação de Manutenção - ' . $model->id)\n ->setTextBody('Existe uma solicitação de '.$model->tipoSolic->descricao.' de código: '.$model->id.' - PENDENTE')\n ->setHtmlBody('<p>Prezado(a) Senhor(a),</p>\n\n <p>Existe uma solicita&ccedil;&atilde;o de '.$model->tipoSolic->descricao.' de c&oacute;digo: <strong><span style=\"color:#F7941D\">'.$model->id.' </span></strong>- <strong><span style=\"color:#F7941D\">PENDENTE</span></strong></p>\n\n <p>Por favor, n&atilde;o responda esse e-mail. Acesse https://portalsenac.am.senac.br para ANALISAR a solicita&ccedil;&atilde;o de '.$model->tipoSolic->descricao.'.</p>\n\n <p>Atenciosamente,</p>\n\n <p>Ger&ecirc;ncia de Manuten&ccedil;&atilde;o e Transporte -&nbsp;GMT</p>\n ')\n ->send();\n } \n\n\n //MENSAGEM DE CONFIRMAÇÃO\n Yii::$app->session->setFlash('success', '<strong>SUCESSO! </strong> Solicitação de '.$model->tipoSolic->descricao.' <strong> criada!</strong>');\n\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create() {\n $corredores = Persona::where('tipo_cargo', '=', 'Corredor - Externo')\n ->Orwhere('tipo_cargo', '=', 'Empleado')\n ->select(DB::raw('id , CONCAT_WS(\" \",nombre,apellido_paterno,apellido_materno) as Corredor'))\n ->pluck('Corredor', 'id');\n $portales = Portales::pluck('nombre', 'id');\n return view('captaciones.create', compact('portales', 'corredores'));\n }", "private function fn_suivi_cc()\n\t\t{\t\n\t\t\t\n\t\t\tif($this->get_request_method() != \"GET\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t\n\t\t\t$result=fn_suivi_cc();\n\t\t\t$this->response($this->json($result), 200);\n\t\t\t$this->response('',204);\t\n\t\t}", "private function CreateCustomTask() {\n\t\t$lRecipientsData = $this->m_taskModel->GetCustomTaskRecipientsData($this->m_customRecipients, $this->m_customReplaceSql);\n\t\t$lCnt = 0;\n\t\tforeach ($lRecipientsData as $key => $value) {\n\t\t\t$lTempl = $this->ReplaceEmailTaskTemplate($this->m_customTemplate, $value[0]);\n\t\t\t$lSubj = $this->ReplaceEmailTaskTemplate($this->m_customSubject, $value[0]);\n\t\t\t\n\t\t\t\n\t\t\t$lUsersArr[] = (int)$value[0]['id'];\n\t\t\t$lUserTemplArr[] = '\\'' . q($lTempl) . '\\'';\n\t\t\t$lUserSubjArr[] = '\\'' . q($lSubj) . '\\'';\n\t\t\t$lUsersRoleArr[] = 0;\n\t\t\t\n\t\t\t$lCnt++;\n\t\t}\n\t\t$lUsersArrString = 'ARRAY[' . implode(\",\", $lUsersArr) . ']';\n\t\t$lUsersRoleArrString = 'ARRAY[' . implode(\",\", $lUsersRoleArr) . ']';\n\t\t$lUserTemplArrString = 'ARRAY[' . implode(\",\", $lUserTemplArr) . ']';\n\t\t$lUserSubjArrString = 'ARRAY[' . implode(\",\", $lUserSubjArr) . ']';\n\t\t\n\t\t$lTaskData = $this->m_taskModel->CreateTask(\n\t\t\t(int)$this->m_eventId, \n\t\t\t(int)SEND_EMAIL_TASK_DEFINITION_ID, \n\t\t\t$lUsersArrString, \n\t\t\t$lUserTemplArrString, \n\t\t\t$lUsersRoleArrString, \n\t\t\t'false', \n\t\t\t$lUserSubjArrString,\n\t\t\t''\n\t\t);\n\t}", "public function create() {\n\n\t}", "public function create()\n {\n echo 'Estoy en en create';\n }", "public function actionCreate()\n {\n if(\\Yii::$app->user->can('gerenciamento-cadastros-basicos')){\n $model = new Pessoa();\n $alerta = \"Pessoa já cadastrada\";\n \n \n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $validacpf = Pessoa::find()->where(['cpf' => $model->cpf])->one();\n if($validacpf == true){\n return $this->redirect(['create',\n 'model' => $model, 'alerta' => $alerta\n ]);\n }else{\n\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n }else{\n return $this->render('create', [\n 'model' => $model, \n ]);\n }\n }else {\n throw new \\yii\\web\\ForbiddenHttpException('Você não está autorizado a realizar essa ação.');\n }\n \n }", "public function enviarContactos(){\n $this->enviarPeticion(\"VIDEOCONFERENCIA:CONTACTOS:LISTA:DIOCE=0,LOOPBACK\n1=0,LOOPBACK 2=0,MIGUEL ALTUNA=1,POLYCOM AUSTIN STEREO=0,POLYCOM AUSTIN\nSTEREO=0,POLYCOM AUSTIN USA=0,POLYCOM AUSTIN USA IP=0,POLYCOM\nAUSTRALIA=0,POLYCOM BRAZIL=0,POLYCOM EUROPE=0,POLYCOM HONG\nKONG=0,POLYCOM JAPAN=0,POLYCOM JAPAN=0,POLYCOM MEXICO=0,POLYCOM MILPITAS\nLOBBY=0,POLYCOM PERU=0,POLYCOM SOUTHERN EUROPE=0,TELESONIC=0\");\n }", "public function store(CreateCasoRequest $request)\n {\n /* @var $caso Caso */\n $input = $request->all();\n\n if(Auth::user()->hasRole('CAPTADOR')){\n $input['captador'] = Auth::user()->empleado->id;\n $input['fecha_captacion'] = Carbon::now();;\n }\n\n $cliente = Interviniente::find($request->cliente_id);\n $cliente->isapre;\n $cliente->region;\n $cliente->comuna;\n $cliente->provincia;\n $input['cliente'] = $cliente;\n\n $contraparte = Interviniente::find($request->contraparte_id);\n $contraparte->isapre;\n $contraparte->region;\n $contraparte->comuna;\n $contraparte->provincia;\n $input['contraparte'] = $contraparte;\n\n $caso = $this->casoRepository->create($input);\n\n if(isset($caso->datosResponsable->user)){\n $caso->datosResponsable->user->notify(new ResponsableCasoAsignado($caso));\n }\n\n if(isset($caso->datosCaptador->user)){\n $caso->datosCaptador->user->notify(new CaptadorCasoAsignado($caso));\n }\n\n Flash::success('Caso guardado exitosamente.');\n\n return redirect(route('casos.index'));\n }", "public function createTerminalAccount($vprovidername, $serviceID, $url, $login,\n $password, $aid, $currency, $email, $fname,\n $lname, $dayphone, $evephone, $addr1, $addr2,\n $city, $country, $province,\n $zip, $userID, $birthdate, $fax, $occupation,\n $sex, $alias, $casinoID, $ip, $mac, $downloadID,\n $clientID, $putInAffPID, $calledFromCasino,\n $hashedPassword,$agentID,$currentPosition,\n $thirdPartyPID, $capiusername, $capipassword,\n $capiplayername, $capiserverID,$isVIP='',$usermode='')\n {\n //check if this will be created to MG\n switch (true){\n case strstr($vprovidername, \"MG\"):\n $casinoApiHandler = $this->configureMG($serviceID, $url, $capiusername,\n $capipassword, $capiplayername,\n $capiserverID);\n if($usermode == 1){\n $createTerminalResult = array(\"IsSucceed\"=>true); \n }\n else{\n $createTerminalResult = $casinoApiHandler->CreateTerminalAccount($login, $password,\n $aid, $currency, $email, $fname, $lname, $dayphone, $evephone,\n $addr1, $addr2, $city, $country, $province, $zip, $userID,\n $birthdate, $fax, $occupation, $sex, $alias, $casinoID, $ip,\n $mac, $downloadID, $clientID, $putInAffPID, $calledFromCasino,\n $hashedPassword, $agentID, $currentPosition, $thirdPartyPID);\n }\n \n break;\n case strstr($vprovidername, \"RTG\"):\n if($usermode == 1){\n $createTerminalResult = array(\"IsSucceed\"=>true); \n }\n else{\n $isplayerAPI = 1;\n $casinoApiHandler = $this->configureRTG($serviceID, $url, $isplayerAPI,$usermode);\n $createTerminalResult = $casinoApiHandler->CreateTerminalAccount($login, $password,\n $aid, $currency, $email, $fname, $lname, $dayphone, $evephone,\n $addr1, $addr2, $city, $country, $province, $zip, $userID,\n $birthdate, $fax, $occupation, $sex, $alias, $casinoID, $ip,\n $mac, $downloadID, $clientID, $putInAffPID, $calledFromCasino,\n $hashedPassword, $agentID, $currentPosition, $thirdPartyPID);\n }\n \n break;\n case strstr($vprovidername, \"PT\"):\n \n $casinoApiHandler = $this->configurePT($url, $capiusername, $capipassword);\n \n// $createTerminalResult = $casinoApiHandler->CreateTerminalAccount($login, $password,\n// $aid, $currency, $email, $fname, $lname, $dayphone, $evephone,\n// $addr1, $addr2, $city, $country, $province, $zip, $userID,\n// $birthdate, $fax, $occupation, $sex, $alias, $casinoID, $ip,\n// $mac, $downloadID, $clientID, $putInAffPID, $calledFromCasino,\n// $hashedPassword, $agentID, $currentPosition, $thirdPartyPID,$isVIP);\n \n \n //always pass true in order to mapped PT casino in a\n //specific terminal\n $createTerminalResult = array(\"IsSucceed\"=>true); \n break;\n default:\n echo 'Invalid Casino Name.';\n break;\n }\n return $createTerminalResult;\n }", "public function create()\n {\n return 'can`t create ';\n }", "public function create()\n {\n // Gate::authorize('haveaccess', 'curso.create');\n \n \n return \\view('Cursos.createc');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function createAction() {\n\t}", "public function create() {\n\t \n }", "public function createOneFromSystemAction() {\n $requestData = $this->get('json.service')->decode($this->getRequest()->get('json_data'));\n\n $receiver = $requestData['receiver'];\n $subject = $requestData['subject'];\n $content = $requestData['content'];\n\n $email = $this->get('email.service')->createOne(\"system\", $receiver, $subject, $content);\n\n if ($email) {\n return $this->get('json.service')->sucessResponse();\n }\n\n return $this->get('json.service')->errorResponse(new ResponseEmailCreateFailure());\n }", "function evel_construct_email($spec) {\n global $evel_client;\n $params = func_get_args();\n $result = $evel_client->call('EvEl.construct_email', $params);\n return $result;\n}", "public function actionCreate()\n {\n $post = Yii::$app->request->post();\n\n //参数检查\n if (!isset($post['name'])\n || !isset($post['address'])\n || !isset($post['tel'])\n || !isset($post['chief'])\n || !isset($post['idcard'])\n || !isset($post['Business_license_img'])\n || !isset($post['local_img'])\n || !isset($post['doctor_certificate_img'])\n ) {\n return Service::sendError(10400, '缺少参数');\n }\n\n //当前用户\n $user = \\yii::$app->user->identity;\n\n //判断当前用户类型,只有诊所(type=2)才可以注册,并且之前没有注册过\n if ($user->type != User::USER_CLINIC) {\n return Service::sendError(20701, '用户类型错误,不能注册诊所');\n }\n\n if (Clinic::findOne(['user_uuid' => $user->uuid])) {\n return Service::sendError(20702, '用户已经注册过诊所了');\n }\n\n //检查名字是否已经被注册\n if (Clinic::findOne(['name' => $post['name']])) {\n return Service::sendError(20702, '诊所名称已经被注册了');\n }\n\n $clinic = new Clinic();\n $clinic->name = $post['name'];\n $clinic->address = $post['address'];\n $clinic->tel = $post['tel'];\n $clinic->chief = $post['chief'];\n $clinic->idcard = $post['idcard'];\n $clinic->Business_license_img = $post['Business_license_img'];\n $clinic->local_img = $post['local_img'];\n $clinic->doctor_certificate_img = $post['doctor_certificate_img'];\n $clinic->user_uuid = $user->uuid;\n if ($clinic->save()) {\n return Service::sendSucc();\n } else {\n return Service::sendError(20703, '注册出错');\n }\n }", "function crear_carpeta($ruta,$nombre_carpeta)\r\n\t{\r\n\t}", "public function create(){\n\t\t//\n\t}", "public function create(){\n\t\t//\n\t}", "public function create(){\n\t\t//\n\t}", "public function create(){\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "static public function ctrCrearTransportadoraExterno(){\n\n\t\tif(isset($_POST[\"nuevaTransportadora\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\. ]+$/', $_POST[\"nuevaTransportadora\"])){\n\n\t\t\t /*=============================================\n\t\t\t\tVALIDAR IMAGEN DEL LOGO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$ruta = \"\";\n\n\t\t\t\tif(isset($_FILES[\"nuevoLogo\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR EL LOGO DE LA TRANSPORTADORA\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$nuevaTransportadoraDir = str_replace(array('ñ','Ñ','á','é','í','ó','ú','Á','É','Í','Ó','Ú','.',' '),array('n','N','a','e','i','o','u','A','E','I','O','U','_','_'),trim($_POST[\"nuevaTransportadora\"]));\n\n\t\t\t\t\t$directorio = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir;\n\n\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif($_FILES[\"nuevoLogo\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir.\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES[\"nuevoLogo\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir.\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/* =====================================\n\t\t\t\t\tVALIDAR TRANSPORTADORA\n\t\t\t\t========================================== */\n\n\t\t\t\t$tabla = \"transportadoras\";\n\n\t\t\t\t$datos = array(\"transportadora\" => $_POST[\"nuevaTransportadora\"],\n\t\t\t\t\t \"logo\"=>$ruta);\n\n\t\t\t\t$respuesta = ModeloTransportadoras::mdlIngresarTransportadora($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡La transportadora ha sido guardada correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"radicador\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\n\t\t\t\t\t</script>';\n\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡La transportadora no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"radicador\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\n\t\t\t\t</script>';\n\n\t\t\t}\n\n\n\t\t}\n\n\n\t}", "public function create()\n {\n\t\t$lang = \\App::getLocale(session('lang'));\n\t\tif(Gate::allows('administradores', Auth::user())){\n\t\t\t$medicos = Medico::All();\n\t\t\t$pacientes = Paciente::All();\n \treturn view('clinica.citas.create-citas', compact('medicos','pacientes'));\n\t\t}else{\n\t\t\tif($lang == 'es'){\n\t\t\t\tSession::flash('mensaje_autorizacion', 'Su cuenta de usuario no estรก autorizada para crear nuevas citas.');\t\n\t\t\t}else{\n\t\t\t\tSession::flash('mensaje_autorizacion', 'Your account does not have permission to create new appointments.');\t\n\t\t\t}\n\t\t\treturn redirect('citas');\n\t\t}\n }", "public function create()\n {\n // Check Access\n has_access(generate_method(__METHOD__), Auth::user()->role);\n\n // View\n return view('faturcms::admin.cabang.create');\n }", "public function run()\n {\n Acceso::create([\n 'nombre' => 'Canjes',\n 'key' => 'keycan' \n ]);\n }", "public function creat()\n {\n\n }", "public function createTicket()\n {\n Zendesk::tickets()->create([\n 'subject' => 'Subject',\n 'comment' => [\n 'body' => 'Ticket content.'\n ],\n 'priority' => 'normal'\n ]);\n return \"success\";\n }", "function enviar_contacto(){\n $this->asignar_ingreso();\n $nombre_sede = $this->sede;\n\n $resultado = $this->datoSede($nombre_sede);\n $cuerpo =\"<img src='http://prevaler.diazcreativos.net.ve/imagenes/PREVALER.png' /><br /><br />\n\t\t<u>Datos de Entrada:</u><br />\";\n $cuerpo .=\"<br />\";\n $cuerpo .= \"<strong>Nombre Completo: </strong>\".utf8_decode($this->nombre).\"<br />\" ;\n $cuerpo .= \"<strong>Número de telefono: </strong>\".$this->telefono.\"<br />\" ;\n $cuerpo .= \"<strong>E-mail: </strong>\".$this->email.\"<br />\" ;\n $cuerpo .= \"<strong>Mensaje: </strong>\".$this->comentario.\"<br />\";\n $cuerpo .= \"<br />\";\n $cuerpo .= \"---- Fin ----\";\n $cuerpo .= \"<br />\";\n $subject= \"Contacto Web Prevaler\";\n $subject2= \"Contacto Web Prevaler\";\n $basemailfor=$resultado['email_sede'];\n //$basemailfor=\"sales@nickautoglass.com\";\n $basemailfrom = $this->email;\n $respuesta =\"<img src='http://prevaler.diazcreativos.net.ve/imagenes/PREVALER.png' /><br />\n\t\t<strong>Saludos Sr(a).: $this->nombre $this->apellido</strong><br /><br />\n\t\tNosotros hemos recibido su mensaje, nuestro departamento de atención al cliente le responderá lo más pronto posible<br />\n\t\tGracias por contactar a Prevaler.<br />\n\t\tPrevaler<br /><br />\n\t\tTel&eacute;fonos: <br/>\n\t\t\".$resultado['telefono_sede'].\"<br />\n\t\tTwitter: <a href='https://twitter.com/Prevaler_VE'>@Prevaler_VE</a><br />\n\t\tInstagram: <a href='https://www.instagram.com/prevaler_ve/'>@prevaler_ve</a><br />\n\t\t\".$resultado['email_sede'].\"\n\t\t<br /><br />\n\t\tAtentamente,<br />\n\t\tClínica Prevaler.\";\n $this->mensaje=\"<strong>&iexcl;Excelente!</strong> Su Mensaje ha sido enviado exitosamente.\";\n\n $mail = new PHPMailer();\n $mail->From = $basemailfrom;\n $mail->FromName = utf8_decode($subject);\n $mail->AddAddress($basemailfor, $this->nombre.\" \".$this->apellido);\n $mail->Subject = utf8_decode($subject);\n $mail->Body = $cuerpo;\n $mail->AltBody = $cuerpo;\n $exito = $mail->Send();\n\n $mail2 = new PHPMailer();\n $mail2->From = $basemailfor;\n $mail2->FromName = utf8_decode($subject2);\n $mail2->AddAddress($basemailfrom, $this->nombre.\" \".$this->apellido);\n $mail2->Subject = utf8_decode($subject2);\n $mail2->Body = $respuesta;\n $mail2->AltBody = $respuesta;\n $exito = $mail2->Send();\n }", "public function creating()\n {\n # code...\n }", "public function create()\n {\n\n /*lấy dữ liệu post để truyền sang view*/\n\n /*$data['masterkey'] = User::orderBy('masterkey', 'asc')->get();\n\n \n /*Get the current user*/\n \n $user= \\Auth::user();\n\n $id = $user->id;\n\n $publickey = $user->publickey;\n\n /*Nếu đã có publickey thì không cho tạo privatekey, chuyển lại trang sang home*/\n\n if ($publickey == true) {\n\n return redirect()-> route('home');\n }\n\n\n /*get the username of the current usser\n Return an array\n */\n\n $data['user'] = User::where('id', $id)->first();\n\n\n \n //$flight = App\\Flight::where('active', 1)->first();\n\n\n return view('account/createkey', $data);\n\n }", "public function createOneFromAccountAction() {\n $requestData = $this->get('json.service')->decode($this->getRequest()->get('json_data'));\n\n $sender = $requestData['sender'];\n $receiver = $requestData['receiver'];\n $subject = $requestData['subject'];\n $content = $requestData['content'];\n\n $email = $this->get('email.service')->createOne($sender, $receiver, $subject, $content);\n\n if ($email) {\n return $this->get('json.service')->sucessResponse();\n }\n\n return $this->get('json.service')->errorResponse(new ResponseEmailCreateFailure());\n }", "public function create()\n {\n return view(\"annonce.createAnnonce\");\n }", "public function getCreator() {}", "public function create(Request $request)\n {\n $solicitud = $request->except('_token', 'email','user');\n $this->store($request, $solicitud);\n Mail::to($request->email)->send(new EmailServicio($request));\n return redirect()->route('servicio.index')->with('status','Se ha enviado la solicitud'); \n }", "public function create(){}", "public function create() {\n if (!Gate::allows('speakers_congress_create')) {\n return abort(401);\n }\n\n $id_congresses = \\App\\Congress::get()->pluck('nome', 'id')->prepend(trans('global.app_please_select'), '');\n $id_speakers = \\App\\Speaker::get()->pluck('nome', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('admin.speakers_congresses.create', compact('id_congresses', 'id_speakers'));\n }", "public function create()\n {\n if (auth()->user()->can('createComites')) {\n return view('comites.create');\n }else{\n abort(403, 'El usuario no se encuentra autorizado para crear comites');\n }\n \n }", "public function afterCreate()\n {\n // $this->getDI()\n // ->getMail()\n // ->send([\"admin@gamanads.com\" => \"Admin GamanAds\"],\"New Adspace\", 'newadspace',\n // [ 'emailBody'=> \"New Adspace : <b>$this->ad_url</b> from Client Id : <b>$this->client_id</b> Client Name: <b>$this->client_name</b>\"]);\n }", "public function create()\n {\n return response() -> json([\n \"success\" => true,\n \"services\" => \"Crear\"\n ], 200);\n }", "function CrearColectivos()\n {\t\n \t$user = User::where('id', 1)->first();\n \\Auth::loginUsingId($user->id);\n\n $response = $this->json('POST', '/colectivo',[\n 'empresa' => '28 de Julio S.R.L',\n 'numero' => '2'\n ]);\n\n $response\n ->assertStatus(200);\n\n \t$response\n \t\t->assertJsonStructure([\n \t\t\t\t'message',\n \t\t\t'colectivo' => [\n \t\t\t'id',\n \t\t\t'empresa',\n \t\t\t'num_coche'\n \t\t],\n \t\t]);\n }", "public function run()\r\n {\r\n Cso::create([\r\n 'id' => '1',\r\n 'email' => 'cso1@cso.mk',\r\n 'password' => '$2y$10$VTkMD9uOZHYCqqlFg5Y.q.5Us6GOp93ieJW/SdNmTtR.JiP739Whu', //csocso\r\n 'first_name' => 'Игор',\r\n 'last_name' => 'Пирковски',\r\n 'phone' => '071234567',\r\n 'address' => 'Женевска 34/6',\r\n 'organization_id' => '3',\r\n 'location_id' => '2',\r\n 'profile_image_id' => null,\r\n 'notifications' => '1',\r\n 'status' => 'active',\r\n ]);\r\n }", "public function create()\n {\n return view('contactos.create',[ ]);\n }", "public function create() {}", "public function crear()\n {\n can('crear-tipoentrega');\n return view('tipoentrega.crear');\n }", "public function createOwner();", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_historico_atleta_cameponato/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_historico_atleta_cameponato.create')\n;\n\t}", "public function run()\n {\n General::create([\n 'name' => 'Traddee.com',\n 'description' => 'Pasar Online milenial'\n ]);\n }", "public static function crtCrearCliente(){\n\n if (isset($_POST['nuevoCliente'])) {\n \n if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST['nuevoCliente']) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST['nuevoRfc']) &&\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST['nuevoEmail']) &&\n preg_match('/^[()\\-0-9 ]+$/', $_POST['nuevoTelefono']) && \n\t\t\t preg_match('/^[#\\.\\,\\-a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST['nuevaDireccion'])){\n\n /*====================Comentario====================\n VALIDAR SI EXISTE RFC\n ==================================================*/ \n\n $tabla = \"clientes\";\n $item = \"rfc\";\n $valor = strtoupper($_POST['nuevoRfc']);\n\n $validar = ModeloClientes::mdlMostrarClientes($tabla, $item, $valor);\n \n if ($validar['rfc'] == $valor) {\n $datos = [];\n echo '<script>\n \n\n\t\t\t\t\tswal.fire({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El RFC del cliente ya existe en la base de datos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"clientes\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t </script>';\n die();\n }\n \n $rfc = strtoupper($_POST['nuevoRfc']);\n \n $tabla = 'clientes';\n $datos = array('nombre' => $_POST['nuevoCliente'],\n 'rfc' => $rfc,\n 'email' => $_POST['nuevoEmail'],\n 'telefono' => $_POST['nuevoTelefono'],\n 'direccion' => $_POST['nuevaDireccion'],\n 'fecha_nacimiento' => $_POST['nuevaFechaNacimiento']);\n\n $respuesta = ModeloClientes::mdlIngresarCliente($tabla, $datos);\n\n if ($respuesta == \"ok\") {\n\n echo '<script>\n\n\t\t\t\t\tswal.fire({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El cliente ha sido guardado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"clientes\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n \n }\n\n }else{\n echo '<script>\n\n\t\t\t\t\tswal.fire({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El cliente no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"clientes\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n \n }\n \n }\n\n }", "public function enviar_carta(){\n\n\t\t$data['solicitud'] = array (\n\t\t\t\t\t\t\t\t\"nombre\" => $this->input->post('name'), \n\t\t\t\t\t\t\t\t\"person\" => $this->input->post('person'),\n\t\t\t\t\t\t\t\t\"observaciones\" => $this->input->post('observaciones'),\n\t\t\t\t\t\t\t\t\"sueldo\" => $this->input->post('sueldo'), \n\t\t\t\t\t\t\t\t\"imss\" => $this->input->post('imss'),\n\t\t\t\t\t\t\t\t\"rfc\" => $this->input->post('rfc'),\n\t\t\t\t\t\t\t\t\"curp\" => $this->input->post('curp'),\n\t\t\t\t\t\t\t\t\"antiguedad\" => $this->input->post('antiguedad'),\n\t\t\t\t\t\t\t\t\"puesto\" => $this->input->post('puesto'),\n\t\t\t\t\t\t\t\t\"domicilio\" => $this->input->post('domicilio')\n\t\t\t\t\t\t\t\t);\n\n\t\t$destinatario = \"micaela.llano@advanzer.com\";\n\t\t$mensaje=$this->load->view(\"layout/solicitud/carta\",$data,true);\n\n\t\tif(!$this->sendMail($destinatario,$mensaje)){\n\t\t\t$response['msg']=\"ok\";\n\t\t}else{\n\t\t\t$response['msg']=\"cancel\";\n\t\t}\n\n\t\techo json_encode($response);\n\t}", "public function create()\n\t{\n\t\t$req = json_decode($this->request->getBody());\n\t\tif ($req->norm != \"\") {\n\t\t\t$cek = $this->model->cekExist($req->norm);\n\t\t} else {\n\t\t\t$save_baru = $this->model->insert($req);\n\t\t}\n\t\treturn $this->respondCreated($cek);\n\t}", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function create() {\n // Insert the client in the db\n $db = new Database('cliente');\n $this->id = $db->insert([\n 'name' => $this->name,\n 'address' => $this->address,\n 'zip' => $this->zip,\n 'phone' => $this->phone,\n 'mPhone' => $this->mPhone,\n 'email' => $this->email,\n 'gender' => $this->gender,\n 'obs' => $this->obs,\n ]);\n\n // Return success\n return true;\n }", "public function create()\n {\n //\n $agents = User::where([['role','mandataire'],['id','<>',Auth::user()->id]])->orderBy(\"nom\")->get();\n return view ('compromis.add',compact('agents'));\n }", "public function create()\n {\n return view('proyectos_clientes.create');\n }", "public function actionCreate()\n {\n if (Yii::$app->user->can('criarPi')) {\n\n $model = new Estiloconstrucao();\n\n if ($model->load(Yii::$app->request->post())) {\n $verificaEC = $this->verificaEstiloConstrucao($model);\n if ($verificaEC == true) {\n return $this->redirect(['index']);\n } else {\n Yii::$app->session->setFlash('error', 'Estilo de Construção já registado!');\n return $this->redirect(['index']);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n return $this->redirect(['index']);\n }\n }" ]
[ "0.60012364", "0.5906113", "0.5864711", "0.5675195", "0.56732804", "0.56216764", "0.5572272", "0.5572238", "0.548885", "0.5441946", "0.5440154", "0.54368466", "0.54246306", "0.5368795", "0.5363992", "0.5354739", "0.5353825", "0.5342327", "0.53394985", "0.53011584", "0.52927995", "0.52901226", "0.5283575", "0.5270789", "0.5252392", "0.52484703", "0.5233471", "0.52287287", "0.52122134", "0.5205562", "0.5185602", "0.5180801", "0.5178842", "0.5174578", "0.51640904", "0.5162826", "0.5161402", "0.51605415", "0.51592165", "0.51572025", "0.51535213", "0.51440614", "0.5142717", "0.51409256", "0.51406527", "0.5137083", "0.51370317", "0.51334345", "0.513183", "0.5130514", "0.5121195", "0.5121195", "0.5121195", "0.5121195", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5120293", "0.5117507", "0.51172304", "0.5116524", "0.5102819", "0.50954646", "0.5094627", "0.509452", "0.5091763", "0.50895023", "0.5087671", "0.5083292", "0.5082766", "0.5078551", "0.50783604", "0.50709003", "0.5068489", "0.50679815", "0.50647783", "0.50642776", "0.5063446", "0.50597095", "0.5056546", "0.50559866", "0.50538915", "0.5052262", "0.50499994", "0.5049752", "0.5049458", "0.50427777", "0.5041738", "0.5041539", "0.504052", "0.5035076", "0.50261045", "0.5026078" ]
0.0
-1
Intenta modificar una cerveza y modificar su foto si fue subida nuevamente
public function updateCerveza(TipoCerveza $tc, $params) { // Proceso imagen $foto = $params['foto']; $path_imagen = $tc->getRutaImagen(); if (isset($foto) && $foto['error'] !== UPLOAD_ERR_NO_FILE) { if ($this->resizeImage($foto, 'cervezas', $path_imagen)) { unlink($tc->getRutaImagen()); // Borro la anterior } else { return false; } } $this->initCerveza($tc, $params, $path_imagen); $tc->setModificadoEn(Utils::getCurrentTimestamp()); $tc->update(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ctrActualizarPerfil()\n {\n if (isset($_POST['editarNombre'])) {\n\n\n /*====================================*/\n /*VALIDAR IMAGEN QUE SUBE COMO FOTO*/\n /*====================================*/\n $ruta = \"\";\n $directorio = \"vistas/img/usuarios/{$_POST['idUsuario']}\";\n if (isset($_FILES['datosImagen']['tmp_name'])) {\n\n //primero preuntamos si existe otra imagen en la base de datos\n if (!empty($_POST['foto'])) { // valido el post oculto de foto\n unlink($_POST['foto']); //eliminamos el archivo en el hosting\n unlink($directorio);\n } else {\n // si no existe ninguna imagen, creamos el directorio\n @mkdir($directorio, 0755); // pasamos el directorio, y los permisos\n }\n\n\n $aleatorio = mt_rand(100, 999);\n $ruta = \"vistas/img/usuarios/{$_POST['idUsuario']}/\" . $aleatorio . \".jpg\"; // ruta de la foto a almcenar\n\n //Modificamos tamaño de la foto\n //capturao en un array las medidas ancho y alto\n // list (0 , 1) // indices\n list($ancho, $alto) = getimagesize($_FILES['datosImagen']['tmp_name']);\n\n $nuevoAncho = 500;\n $nuevoAlto = 500;\n\n\n /*=====================================*/\n /*SOLO SIRVE PARA IAMGEN JPG JPEG*/\n /*=====================================*/\n\n //creamos una nueva imagen\n $origen = imagecreatefromjpeg($_FILES['datosImagen']['tmp_name']);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n //cortamos la imagen pasando los parametros\n //(destino, origen, posicionx, posiciony, )\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n\n\n }\n\n\n //validacion si se escibio algo en el input de contraseña\n if ($_POST['editarPassword'] != \"\") {\n $password = $_POST['passUsuario'];\n } else {\n\n $password = crypt($_POST['editarPassword'], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\n }\n\n\n $datos = [\n 'nombre' => $_POST['editarNombre'],\n 'email' => $_POST['editarEmail'],\n 'password' => $password,\n 'foto' => $ruta,\n 'id' => $_POST['idUsuario']\n ];\n\n $tabla = 'usuarios';\n $respuesta = @ModeloUsuarios::mdlActualizarPerfil($tabla, $datos);\n\n if ($respuesta == 'ok') {\n //si se ejcuto el update, actualizacmos las variables de sesion del usuario\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $datos['id'];\n $_SESSION['nombre'] = $datos['nombre'];\n $_SESSION['foto'] = $datos['foto'];\n $_SESSION['email'] = $datos['email'];\n $_SESSION['password'] = $datos['password'];\n $_SESSION['modo'] = $_POST['modoUsuario'];\n\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡OK!\",\n\t\t\t\t\t\t\t\t text: \"¡Su cuenta ha sido actualizada correctamente\",\n\t\t\t\t\t\t\t\t type:\"success\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>';\n\n }\n\n }\n }", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "function modificar()\n {\n if (isset($_POST[\"nombre\"])) {\n \n $datos[\"numero\"] = $_GET[\"numero\"];\n \n if (isset($_POST[\"nombre\"])) {\n $datos[\"nombre\"] = $_POST[\"nombre\"];\n }\n if (isset($_POST[\"tipo1\"])) {\n $datos[\"tipo1\"] = $_POST[\"tipo1\"];\n }\n if (isset($_POST[\"tipo2\"])) {\n $datos[\"tipo2\"] = $_POST[\"tipo2\"];\n }\n if (isset($_POST[\"descripcion\"])) {\n $datos[\"descripcion\"] = $_POST[\"descripcion\"];\n }\n \n if ($_FILES && isset($_FILES[\"imagen\"]) && $_FILES[\"imagen\"][\"size\"] != 0) {\n $datos[\"imagen\"] = time() . \"_imagen_\" . $_FILES[\"imagen\"][\"name\"];\n if (!$this->upLoadFile->guardarImagen($_FILES[\"imagen\"], $datos[\"imagen\"])) {\n $this->falla();\n }\n }\n \n if ($_FILES && isset($_FILES[\"sprite\"]) && $_FILES[\"sprite\"][\"size\"] != 0) {\n $datos[\"sprite\"] = time() . \"_sprite_\" . $_FILES[\"sprite\"][\"name\"];\n if (!$this->upLoadFile->guardarImagen($_FILES[\"sprite\"], $datos[\"sprite\"])) {\n $this->falla();\n }\n }\n \n if ($this->pokemonModel->updatePokemon($datos)) {\n $_SESSION[\"mensaje\"][\"mensaje\"] = \"Pokemon modificado con exito\";\n $_SESSION[\"mensaje\"][\"class\"] = \"w3-pale-green \";\n header('Location: /');\n } else {\n $_SESSION[\"mensaje\"][\"mensaje\"] = \"Error al actualizar el pokemon\";\n $_SESSION[\"mensaje\"][\"class\"] = \"w3-pale-red \";\n $this->falla();\n }\n \n } //Si no, llamo a la vista con los datos\n else {\n $this->falla();\n }\n }", "public static function ModificarHelado($sabor,$precio,$foto){\r\n\r\n if(Helado::VerificarHelado($sabor)==\"El sabor esta\"){\r\n \r\n $direc=fopen(\"./helados/sabores.txt\",\"r\");\r\n $listadoHelados=\"\";\r\n \r\n while(!feof($direc)){\r\n\r\n $helado=fgets($direc);\r\n\r\n if($helado==\"\"){\r\n continue;\r\n }\r\n\r\n $heladoSeparado=explode(\"-\",$helado);\r\n\r\n if($heladoSeparado[0]==$sabor){\r\n echo \"s\";\r\n $heladoSeparado[1]=$precio;\r\n $destino=\"./heladosImagen/\".$sabor.\".\".date(\"His\").\".jpg\";\r\n move_uploaded_file($foto,$destino);\r\n\r\n unlink(\"C:/xampp/htdocs/PracticaParcialPRO/Programacion3/PracticaPP2/heladosImagen/\".trim($heladoSeparado[2]));\r\n echo $heladoSeparado[2];\r\n $heladoSeparado[2]=pathinfo($destino,PATHINFO_FILENAME).\".jpg\";\r\n echo $heladoSeparado[2];\r\n $helado=$heladoSeparado[0].\"-\".$heladoSeparado[1].\"-\".$heladoSeparado[2].\"\\r\\n\";\r\n \r\n }\r\n\r\n $listadoHelados.=$helado;\r\n \r\n }\r\n //echo $listadoHelados;\r\n fclose($direc);\r\n\r\n $direc=fopen(\"./helados/sabores.txt\",\"w\");\r\n\r\n if(0<fwrite($direc,$listadoHelados)){\r\n\r\n return \"Se modifico correctamente..\";\r\n }\r\n\r\n fclose($direc);\r\n\r\n }\r\n\r\n }", "function actualizarDatos(){\n $e = new Empresa();\n \n $e->ruc = $_POST['ruc'];\n\n $imagenName = $_FILES['file']['name']; \n\n if($_POST['nameimage'] ==\"\"){\n\n \n \n //-------- MODIFIED NAME --------------\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n //copy($imagenTemp,$imagenUrl);\n }else{\n \n\n $eliminarimage = \"./vistas/panel_usuario/logoemp/\" . $_POST['nameimage'];\n unlink($eliminarimage);\n\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n\n }\n //ad in controller \n $e->logo = $newname;\n $e->logoUrl = $imageurl;\n\n $e->emailEmp = str_replace(\" \",\"\",$_POST['email']);\n $e->descripcion = trim($_POST['descripcion']);\n $e->direccion = trim($_POST['direccion']);\n $e->distrito = $_POST['distrito'];\n $e->telefono = $_POST['telefono'];\n $e->whatsapp = $_POST['whatsapp'];\n $e->facebook = trim($_POST['facebook']);\n $e->instagram = trim($_POST['instagram']);\n if (empty($e->descripcion) || empty($e->direccion) || $_POST['departamento'] == '0' || strlen($e->telefono) != 9 || strlen($e->whatsapp) > 9) {\n return ['bool' => false, 'msg' => 'datosIncorrectos'];\n }\n return ($this->modelo->actualizarEmpresa($e)) ?\n $this->modelo->buscarByRuc($e->ruc) :\n ['bool' => true, 'msg' => 'problemaSQL'];\n }", "function modificaAutore()\n{\n global $connection;\n $_SESSION['authorModifySuccess'] = false;\n $_SESSION['authorModifyError'] = false;\n $_SESSION['extModifyError'] = false;\n\n if (isset($_POST['modificaAutore'])) {\n $nome = mysqli_real_escape_string($connection, $_POST['nomeModal']);\n $cognome = mysqli_real_escape_string($connection, $_POST['cognomeModal']);\n $citta = mysqli_real_escape_string($connection, $_POST['cittaModal']);\n $descrizione = mysqli_real_escape_string($connection, $_POST['descrizioneModal']);\n\n $photo = mysqli_real_escape_string($connection, $_FILES['fotoModal']['name']);\n $photoLocationFolder = '../../../image/autoreImg/';\n $photoPath = $photoLocationFolder.$photo;\n $extArrPhoto = ['jpg', 'jpeg', 'png'];\n $extPhoto = pathinfo($photoPath, PATHINFO_EXTENSION);\n $extPhoto = strtolower($extPhoto);\n $photoTimestampTitle = time().'.'.$extPhoto;\n $photoPathNew = $photoLocationFolder.$photoTimestampTitle;\n\n $facebook = mysqli_real_escape_string($connection, $_POST['facebookModal']);\n $twitter = mysqli_real_escape_string($connection, $_POST['twitterModal']);\n $linkedin = mysqli_real_escape_string($connection, $_POST['linkedinModal']);\n $instagram = mysqli_real_escape_string($connection, $_POST['instagramModal']);\n\n $autoreId = $_POST['autoreIdModal'];\n\n if (in_array($extPhoto, $extArrPhoto)) {\n if (move_uploaded_file($_FILES['fotoModal']['tmp_name'], $photoPathNew)) {\n $update_autore = \"UPDATE autore_video SET nome_autore='$nome', cognome_autore='$cognome', citta_autore = '$citta', desc_autore = '$descrizione', img_autore = '$photoTimestampTitle', fb_autore = '$facebook', linkedin_autore = '$linkedin', twitter_autore = '$twitter', insta_autore = '$instagram'\n WHERE id_autore='$autoreId'\";\n\n $result_update_autore = mysqli_query($connection, $update_autore);\n if ($result_update_autore) {\n $_SESSION['authorModifySuccess'] = true;\n } else {\n $_SESSION['authorModifyError'] = true;\n }\n }\n } else {\n $_SESSION['extModifyError'] = true;\n }\n }\n}", "static public function ctrActualizarMarca()\n {\n\n if (isset($_POST[\"editNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \n \"nombre\" => $_POST[\"editNomMarca\"],\n \"idMarca\" => $_POST[\"editIdMarca\"]\n );\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, false);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n /*=============================================\n VALIDAR LA EXISTENCIA DE LA IMAGEN\n =============================================*/\n if (isset($_FILES[\"editfotoMarca\"][\"tmp_name\"]) && $_FILES[\"editfotoMarca\"][\"tmp_name\"] != \"\") {\n list($ancho, $alto) = getimagesize($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Preguntar si existe una Imagen en la BD\n if (!empty($_POST[\"editFotoActualMarca\"])) {\n unlink($_POST[\"editFotoActualMarca\"]);\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n\n #Valida si existe el directorio y con la imagen actual\n if (file_exists($directorioActual)) {\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n } else {\n mkdir(\"views/img/Marcas/\" . $_POST[\"editNomMarca\"], 0755);\n }\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n } else { #En caso de no venir una imagen nueva\n #Asigna la ruta actual que tiene el producto\n $ruta = $_POST[\"editFotoActualMarca\"];\n if ($ruta) { #Evaluar si el producto tiene un imagen o no en la ruta actual\n #Separa la ruta\n $valoresRuta = explode(\"/\", $ruta);\n #Obtiene el nombre de la imagen\n $nombreImagen = $valoresRuta[4];\n #Asinga un nueva ruta cambiando el nombre de la carpeta por el nuevo nombre del producto\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $nombreImagen;\n } else {\n #Deja la ruta vacía en caso de que el producto no tenga una imagen asignada\n $ruta = \"\";\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n }\n\n $datos += [\"foto\" => $ruta];\n\n $actualizar = ModeloMarca::mdlActualizarMarca($tabla, $datos);\n\n return $actualizar;\n }\n }\n }", "static function changePhoto() {\n\t\t\n\t\t$case_intra = rcube_utils::get_input_value('photo_intra', RCUBE_INPUT_POST);\n\t\t$case_ader = rcube_utils::get_input_value('photo_ader', RCUBE_INPUT_POST);\n\n\t\t$info = array();\n\t\tif ( !empty($case_intra) && $case_intra == '1') {\n\t\t\t$info['mineqpublicationphotointranet'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotointranet'] = 0;\n\t\t}\n\t\t\n\t\tif ( !empty($case_ader) && $case_ader == '1' && !empty($case_intra) && $case_intra == '1')\n\t\t{\n\t\t\t$info['mineqpublicationphotoader'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotoader'] = 0;\n\t\t}\n\t\t\t\n\t\t$user_infos = melanie2::get_user_infos(Moncompte::get_current_user_name());\n\t\t\n\t\t$user_dn = $user_infos['dn'];\n\t\t$password = rcmail::get_instance()->get_user_password();\n\t\t\n\t\t$auth = Ldap::GetInstance(Config::$MASTER_LDAP)->authenticate($user_dn, $password);\n\t\t\n\t\tif(Ldap::GetInstance(Config::$MASTER_LDAP)->modify($user_dn, $info)) {\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_ok', 'melanie2_moncompte'), 'confirmation');\n\t\t} else {\n\t\t\t$err = Ldap::GetInstance(Config::$MASTER_LDAP)->getError();\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_nok', 'melanie2_moncompte') . $err, 'error');\n\t\t}\n\t\t\n\t}", "function modificationCompte() {\n\t\tif (isset($_POST['name']) || isset($_POST['email']) || isset($_POST['birthday'])) {\n\t\t\tif ($this -> modele -> verifExist($_POST['email']) && $_SESSION['id'] != $this -> modele -> getId($_POST['email']))\n\t\t\t\t$this -> compte($this -> vue -> existeDeja($_POST['email']));\n\t\t\telse {\n\t\t\t\t$valide = 1;\n\t\t\t\t// Image\n\t\t\t\tif ($_FILES['photo']['name'] == '')\n\t\t\t\t\t$dir = $this -> modele -> getCompte($_SESSION['id'])[6];\n\t\t\t\telse {\n\t\t\t\t\t$target_chemin = \"img/profil/\";\n\t\t\t\t\t$target_fichier = $target_chemin . basename($_FILES['photo']['name']);\n\t\t\t\t\t$imageType = strtolower(pathinfo($target_fichier, PATHINFO_EXTENSION));\n\t\t\t\t\t$dir = $target_chemin . \"profil_\" . $_SESSION['id'] . \".png\";\n\n\t\t\t\t\tif (isset($_POST[\"submit\"])) {\n\t\t\t\t\t\tif (!getimagesize($_FILES['photo']['tmp_name'])) {\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> photoEchec());\n\t\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($imageType != \"jpg\" && $imageType != \"png\" && $imageType != \"jpeg\" && $imageType != null) {\n\t\t\t\t\t\t$this -> compte($this -> vue -> photoMauvaisFormat());\n\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($_FILES['photo']['size'] > 2097152 || $_FILES['photo']['size'] == 0) {\n\t\t\t\t\t\t$this -> compte($this -> vue -> photoVolumineux());\n\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($valide == 1) {\n\t\t\t\t\t\tif (move_uploaded_file($_FILES['photo']['tmp_name'], $target_fichier))\n\t\t\t\t\t\t\trename($target_fichier, $dir);\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> photoEchec());\n\t\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($valide == 1) {\n\t\t\t\t\tif ($_POST['birthday'] == $this -> modele -> getCompte($_SESSION['id'])[4] && $_POST['name'] == '' && $_POST['email'] == '' && $_FILES['photo']['name'] == '')\n\t\t\t\t\t\t$this -> compte($this -> vue -> aucuneModification());\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($this -> modele -> update($this -> modele -> getCompte($_SESSION['id']), $_POST['name'] != '' ? $_POST['name'] : $this -> modele -> getCompte($_SESSION['id'])[1], $_POST['email'] != '' ? $_POST['email'] : $this -> modele -> getCompte($_SESSION['id'])[2], $_POST['birthday'], $dir)) {\n\t\t\t\t\t\t\tif ($_POST['email'] != '') {\n\t\t\t\t\t\t\t\tunset($_SESSION['id']);\n\t\t\t\t\t\t\t\tsession_destroy();\n\t\t\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t\t\t$_SESSION['id'] = $this -> modele -> getId($_POST['email']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> modificationFaite());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> erreurModification());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\t$this -> compte($this -> vue -> erreurModification());\n\t}", "static public function ctrEditarAtencionCPANEL(){\r\n\t\t\tif (isset($_POST[\"editarCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarUser\"])){\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta = $_POST[\"fotoActual2\"];\r\n\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]) && !empty($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/\".$_POST[\"editarFotoDiagnostico\"];\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= PRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif (!empty($_POST[\"fotoActual2\"])){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual2\"]);\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"editarFotoDiagnostico\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"editarCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"editarFotoDiagnostico\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"editarCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"id_atencion\" => $_POST[\"idAtencion\"],\r\n\t\t\t\t\t\t\t\t\t \"codigo_atencion\" => $_POST[\"editarCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"editarUser\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"editarPersonalSalud2\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"editarPaciente2\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"editarUps2\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"editarServicio2\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"editarEspecialidad2\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"editarDiagnostico2\"],\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico\" => $ruta,\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"editarFechaAtencion2\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlEditarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido modificada correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN editar antenciones CPANEL ======*/\t\t\t\t\t\r\n\t }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public static function modifImage($fichier,$id){\r\n $im = ModelProgramme::getImage($id);\r\n $var = str_replace(\"images/\",\"\",$im);\r\n $fichier=\"images/\".$var;\r\n $fichier= str_replace(\" \",\"\",$fichier);\r\n $array = array(\r\n \"suppression\" => \"bar\",\r\n \"edit\" => \"foo\",\r\n );\r\n\r\n\r\n\r\n if (file_exists($fichier)) {\r\n if (@unlink($fichier)) {\r\n $array[\"suppression\"]=\"Suppression de $fichier réussite </br>\";\r\n } else {\r\n $array[\"suppression\"]=\"Echec de suppression de $fichier : $php_errormsg\";\r\n }\r\n } else {\r\n $array[\"suppression\"]=\"Le fichier $fichier n'existe pas </br>\";\r\n\r\n }\r\n\r\n // Vérifier si le formulaire a été soumis\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\r\n // Vérifie si le fichier a été uploadé sans erreur.\r\n if (isset($_FILES[\"photo\"]) && $_FILES[\"photo\"][\"error\"] == 0) {\r\n $allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\r\n $filename = $_FILES[\"photo\"][\"name\"];\r\n $filetype = $_FILES[\"photo\"][\"type\"];\r\n $filesize = $_FILES[\"photo\"][\"size\"];\r\n\r\n // Vérifie l'extension du fichier\r\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n if (!array_key_exists($ext, $allowed)) die(\"Erreur : Veuillez sélectionner un format de fichier valide.\");\r\n\r\n // Vérifie la taille du fichier - 5Mo maximum\r\n $maxsize = 5 * 1024 * 1024;\r\n if ($filesize > $maxsize) die(\"Error: La taille du fichier est supérieure à la limite autorisée.\");\r\n\r\n // Vérifie le type MIME du fichier\r\n if (in_array($filetype, $allowed)) {\r\n // Vérifie si le fichier existe avant de le télécharger.\r\n if (file_exists(\"upload/\" . $_FILES[\"photo\"][\"name\"])) {\r\n $array[\"edit\"]=$_FILES[\"photo\"][\"name\"] . \" existe déjà.\";\r\n\r\n } else {\r\n move_uploaded_file($_FILES[\"photo\"][\"tmp_name\"], \"images/\" . $_FILES[\"photo\"][\"name\"]);\r\n $array[\"edit\"]= \"Votre fichier a été téléchargé avec succès. \".$_FILES[\"photo\"][\"name\"];\r\n\r\n\r\n $adresse = \"images/\".$filename;\r\n $adresse = str_replace(\" \",\"\",$adresse);\r\n ModelProgramme::update($id,\"urlImage\",$adresse);\r\n }\r\n } else {\r\n $array[\"edit\"]= \"Error: Il y a eu un problème de téléchargement de votre fichier. Veuillez réessayer.\";\r\n }\r\n } else {\r\n echo \"Error: \" . $_FILES[\"photo\"][\"error\"];\r\n }\r\n\r\n }\r\n return $array;\r\n }", "public function modificar()\n {\n $resp = false;\n $base = new BaseDatos();\n $sql = \"UPDATE archivocargado SET acnombre='\" . $this->getAcNombre() . \"', acdescripcion='\" . $this->getAcDescripcion() . \"', acicono='\" . $this->getAcIcono() . \"', idusuario=\" . $this->getObjUsuario()->getIdUsuario() . \", aclinkacceso='\" . $this->getAcLinkAcceso() . \"', accantidaddescarga=\" . $this->getAcCantidadDescarga() . \", accantidadusada=\" . $this->getAcCantidadUsada() . \", acfechainiciocompartir='\" . $this->getAcFechaInicioCompartir() . \"', acefechafincompartir='\" . $this->getAceFechaFinCompartir() . \"', acprotegidoclave='\" . $this->getAcProtegidoClave() . \"' WHERE idarchivocargado=\" . $this->getIdArchivoCargado() ;\n if ($base->Iniciar()) {\n if ($base->Ejecutar($sql)>=0) {\n $resp = true;\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->modificar: \" . $base->getError());\n }\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->modificar: \" . $base->getError());\n }\n return $resp;\n }", "public function UpdatePersonnage(){\r\n $this->idPost();\r\n $this->lastFileNamePost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->personnage(); \r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){\r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/personnage/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/personnage/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_personnageManager->updatePersonnage($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionPersonnage'); \r\n }", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function Editar($idMotorista){\n $motorista = new Motorista();\n\n require_once('trata_imagem.php');\n\n // echo $idOnibus;\n\n // iniciado variaveis\n $diretorio_completo=Null;\n $MovUpload=false;\n $imagem_file=Null;\n $foto=\"nada\";\n\n //pegando a foto\n if (!empty($_FILES['imagem']['name'])) {\n $imagem_file = true;\n $diretorio_completo=salvarFoto($_FILES['imagem'],'arquivo');\n if ($diretorio_completo == \"Erro\") {\n $MovUpload=false;\n }else {\n $MovUpload=true;\n }\n }else {\n $imagem_file = false;\n }\n\n if ($imagem_file == true && $MovUpload==true) {\n $foto =$diretorio_completo;\n }else {\n $foto=\"nada\";\n }\n $motorista->id = $idMotorista;\n $motorista->imagem=$diretorio_completo;\n $motorista->imagem = $foto;\n $motorista->nome = $_POST['txtNome'];\n $motorista->email = $_POST['txtEmail'];\n $motorista->data_nasc = $_POST['txtDataNasc'];\n $motorista->sexo = $_POST['rdoSexo'];\n $motorista->telefone = $_POST['txtTelefone'];\n $motorista->celular = $_POST['txtCelular'];\n $motorista->cpf = $_POST['txtCPF'];\n $motorista->rg = $_POST['txtRG'];\n $motorista->cnh = $_POST['txtcnh'];\n $motorista->ativar = $_POST['chkAtivo'];\n if(isset($_POST['ativo'])){\n $motorista->ativo = '1';\n }else{\n $motorista->ativo = '0';\n }\n\n $motorista::Update($motorista);\n\n }", "public function NuevoPermiso(){\n\t\t$AlCg = new HomeController();\n\t\t$AlCdatos = array();\n\t\tarray_push($AlCdatos, $_POST[\"inicio\"]);\n\t\tarray_push($AlCdatos, $_POST[\"fin\"]);\n\t\tarray_push($AlCdatos, $_FILES[\"uploadedfile\"]);\n\t\t$AlCvalidado = $AlCg->ValidarNoVacio($AlCdatos);\n\t\tif ($AlCvalidado) {\n\t\t\tif ($_FILES['uploadedfile'][\"error\"] > 0 ){\n\t\t\t\treturn Redirect::to(\"/inicio\");\n\t\t\t}else{\n\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t$AlCfecha = date('Y-m-d');\n\t\t\t\t$AlCalumno = DB::table(\"alumno\")->where(\"idAlumno\",Session::get(\"usuario\"))->first();\n\t\t\t\t$AlCpermiso = DB::table(\"permiso\")->insertGetId(array(\n\t\t\t\t\t\"Alumno_idAlumno\" => Session::get(\"usuario\"),\n\t\t\t\t\t\"matriculaa\" => $AlCalumno->matriculaa,\n\t\t\t\t\t\"descripcion\" => $_POST[\"address\"],\n\t\t\t\t\t\"fechaSolicitud\" => $AlCfecha,\n\t\t\t\t\t\"fechaInicio\" => $_POST[\"inicio\"],\n\t\t\t\t\t\"fechaFin\" => $_POST[\"fin\"]));\n\t\t\t\t$AlCext=$AlCg->obtenerExt($_FILES['uploadedfile']['name']);\n\t\t\t\tmove_uploaded_file($_FILES['uploadedfile']['tmp_name'], \"permisos/\".$AlCpermiso.\".\".$AlCext);\n\t\t\t\tDB::table(\"permiso\")->where(\"idpermiso\",$AlCpermiso)->update(array(\"URL\" => \"permisos/\".$AlCpermiso.\".\".$AlCext));\n\t\t\t\treturn Redirect::to(\"/inicio\");\n\t\t\t}\n\t\t}else{\n\t\t\treturn Redirect::to(\"/inicio\");\n\t\t}\n\t}", "public function actualizarComuna(Request $requerimiento, Commune $comuna){ \n \n $mensajes =[\n 'commune.required' =>'El campo servicio es obligatorio',\n 'commune.min' =>'El campo servicio debe tener al menos 2 caracteres',\n 'commune.max' =>'El campo servicio debe tener como maximo 60 caracteres',\n 'commune.regex' => 'El campo servicio solo acepta cadenas de texto y valores numericos',\n 'image.mimes' => 'La imagen debe ser un archivo de tipo: jpg, jpeg, bmp, png.',\n 'regions_id.exists' =>'Debe seleccionar una region',\n ];\n\n $reglas = [\n 'commune' => 'required|min:2|max:60|regex:/^([a-zA-ZñÑáéíóúÁÉÍÓÚ])+((\\s*)+([a-zA-ZñÑáéíóúÁÉÍÓÚ]*)*)+$/',\n 'image' => 'mimes:jpg,jpeg,bmp,png',\n 'region_id' => 'exists:regions,id' \n ];\n\n $this->validate($requerimiento,$reglas,$mensajes);\n\n if($requerimiento->hasFile('image')){\n $foto = $requerimiento->file('image');\n $ruta = public_path().'/imagenes/comunas';\n $nombreFoto = uniqid().$foto->getClientOriginalName();\n $movido = $foto->move($ruta,$nombreFoto);\n\n if($movido){\n $imagenAnterior = $ruta.'/'.$comuna->image;\n $comuna->image = $nombreFoto;\n $exito = $comuna->save(); \n if($exito){\n File::delete($imagenAnterior);\n alert()->success('La comuna fue modificada correctamente','Comuna Modificada')->autoclose(3000);\n }\n }\n }else{\n $modificada = $comuna->update($requerimiento->only('commune','region_id'));\n if($modificada){\n alert()->success('La comuna fue modificada correctamente','Comuna Modificada')->autoclose(3000);\n }else{\n alert()->error('la comuna no pudo ser modificado','Ocurrio un Error')->autoclose(3000);\n }\n } \n return redirect('administrador/comunas');\n }", "function evt__form_integrante_i__modificacion($datos)\r\n {\r\n $perfil = toba::usuario()->get_perfil_datos();\r\n if ($perfil == null) {//es usuario de SCyT\r\n if($this->chequeo_formato_norma($datos['rescd_bm'])){ \r\n $datos2['rescd_bm']=$datos['rescd_bm'];\r\n $datos2['resaval']=$datos['resaval'];\r\n $datos2['cat_investigador']=$datos['cat_investigador'];\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos2);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar('Guardado. Solo modifica ResCD baja/modif, Res Aval, Cat Investigador', 'info');\r\n }\r\n }else{//es usuario de la UA\r\n $pi=$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->get();\r\n $int=$this->dep('datos')->tabla('integrante_interno_pi')->get(); \r\n if($datos['desde']<$pi['fec_desde'] or $datos['hasta']>$pi['fec_hasta']){//no puede ir fuera del periodo del proyecto\r\n //toba::notificacion()->agregar('Revise las fechas. Fuera del periodo del proyecto!', 'error'); \r\n throw new toba_error(\"Revise las fechas. Fuera del periodo del proyecto!\");\r\n }else{ \r\n //Pendiente verificar que la modificacion no haga que se superpongan las fechas\r\n $haysuperposicion=false;//no es igual al del alta porque no tengo que considerar el registro vigente$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->superposicion_modif($pi['id_pinv'],$datos['id_docente'],$datos['desde'],$datos['hasta'],$registro['id_designacion'],$registro['desde']);\r\n if(!$haysuperposicion){\r\n $band=false;\r\n if($pi['estado']=='A'){\r\n $band=$this->dep('datos')->tabla('logs_integrante_interno_pi')->fue_chequeado($int['id_designacion'],$int['pinvest'],$int['desde']);\r\n } \r\n $regenorma = '/^[0-9]{4}\\/[0-9]{4}$/';\r\n if ( !preg_match($regenorma, $datos['rescd'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if (isset($datos['rescd_bm']) && !preg_match($regenorma, $datos['rescd_bm'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD Baja/Modif invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if($band){//si alguna vez fue chequeado por SCyT entonces solo puede modificar fecha_hasta y nada mas (se supone que lo demas ya es correcto) \r\n //fecha_hasta porque puede ocurrir que haya una baja del participante o la modificacion de funcion o carga horaria\r\n unset($datos['funcion_p']);\r\n unset($datos['cat_investigador']);\r\n unset($datos['identificador_personal']);\r\n unset($datos['carga_horaria']);\r\n unset($datos['desde']);\r\n unset($datos['rescd']);\r\n unset($datos['cat_invest_conicet']);\r\n unset($datos['resaval']);\r\n unset($datos['hs_finan_otrafuente']);\r\n //Solo si cambia hasta y resol bm pierde el check\r\n if( $int['hasta']<>$datos['hasta'] or $int['rescd_bm']<>$datos['rescd_bm'] ){\r\n $datos['check_inv']=0;//pierde el check si es que lo tuviera. Solo cuando cambia algo\r\n }\r\n $mensaje='Ha sido chequeado por SCyT, solo puede modificar fecha hasta y resCD baja/modif';\r\n }else{//band false significa que puede modificar cualquier cosa\r\n //esto lo hago porque el set de toba no modifica la fecha desde por ser parte de la clave \r\n $this->dep('datos')->tabla('integrante_interno_pi')->modificar_fecha_desde($int['id_designacion'],$int['pinvest'],$int['desde'],$datos['desde']);\r\n $mensaje=\"Los datos se han guardado correctamente\";\r\n }\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar($mensaje, 'info'); \r\n }\r\n }\r\n }else{\r\n //toba::notificacion()->agregar('Hay superposicion de fechas', 'error'); \r\n throw new toba_error(\"Hay superposicion de fechas\");\r\n }\r\n }\r\n }\r\n //nuevo Lo coloco para que el formulario se oculte al finalizar\r\n $this->dep('datos')->tabla('integrante_interno_pi')->resetear();\r\n $this->s__mostrar_i=0;\r\n }", "public function edit2Action(Request $request, RendezVous $rendezVous)\n {\n\n global $kernel;\n $user = $kernel->getContainer()->get('security.token_storage')->getToken()->getUser();\n\n\n if ($user!=='anon.' && $user->getFonctionuser()==2){\n\n $deleteForm = $this->createDeleteForm($rendezVous);\n $editForm = $this->createForm('VeterinaireBundle\\Form\\confirmationType', $rendezVous);\n $editForm->handleRequest($request);\n $file = $rendezVous->getPhotoa();\n if ($editForm->isSubmitted()) {\n\n $rendezVous->setPhotoa($file);\n $rendezVous->setVerif(true);\n $this->getDoctrine()->getManager()->flush();\n\n return $this->redirectToRoute('r_show', array('id' => $rendezVous->getId()));\n }\n\n return $this->render('rendezvous/confirmation.html.twig', array(\n 'rendezVous' => $rendezVous,\n 'form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }else{\nreturn $this->redirectToRoute('user_homepage');\n\n}\n\n}", "public function actionModificar()\n {\n $model = Yii::$app->user->identity->usuariosDatos;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->localidad === null && $model->direccion === null) {\n $model->geoloc = null;\n }\n if ($model->save() && $model->upload()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Has actualizado tus datos correctamente'));\n }\n }\n\n return $this->render('/usuarios/update', [\n 'modelDatos' => $model,\n 'seccion' => 'personal',\n 'generos' => Utiles::translateArray(UsuariosGeneros::find()\n ->select('sexo')\n ->indexBy('id')\n ->column()),\n ]);\n }", "public function ctrCambiarFotoPerfil(){\n\n\t\tif(isset($_POST[\"idUsuarioFoto\"])){\n\n\t\t\t$ruta = $_POST[\"fotoActual\"];\n\n\t\t\tif(isset($_FILES[\"cambiarImagen\"][\"tmp_name\"]) && !empty($_FILES[\"cambiarImagen\"][\"tmp_name\"])){\n\n\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\n\n\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t/*=============================================\n\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$directorio = \"views/img/usuarios/\".$_POST[\"idUsuarioFoto\"];\n\n\t\t\t\t/*=============================================\n\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD Y EL CARPETA\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($ruta != \"\"){\n\n\t\t\t\t\tunlink($ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(!file_exists($directorio)){\t\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($_FILES[\"cambiarImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio.\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\timagejpeg($destino, $ruta);\t\n\n\n\t\t\t\t}else if($_FILES[\"cambiarImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio.\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\t\n\n\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\n\t\t\t\t\timagesavealpha($destino, TRUE);\t\t\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\t\t\n\n\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\t\t \ttext: \"¡No se permiten formatos diferentes a JPG y/o PNG!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\t// final condicion\n\n\t\t\t$tabla = \"genusuario\";\n\t\t\t$id = $_POST[\"idUsuarioFoto\"];\n\t\t\t$item = \"usufoto\";\n\t\t\t$valor = $ruta;\n\n\t\t\t$respuesta = UserModel::mdlActualizarUsuario($tabla, $id, $item, $valor);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t \ttitle: \"¡CORRECTO!\",\n\t\t\t\t\t \ttext: \"¡La foto de perfil ha sido actualizada!\",\n\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t \n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t } \n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function modificarPresupuesto(){\n\t\t$this->procedimiento='pre.ft_presupuesto_ime';\n\t\t$this->transaccion='PRE_PRE_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_presupuesto','id_presupuesto','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('descripcion','descripcion','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('gestion','gestion','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificar_contenido($nick_user, $nivel, $ubi_tema, $nom_user, $cor_user)\r\n\t\t\t{\r\n\t\t\t\t$clave_seccion_enviada = $_GET[\"clave_seccion\"];\r\n\t\t\t\tif(isset($_POST[\"guardar\"]) && $_POST[\"guardar\"]==\"si\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$formulario_final = $_POST[\"formulario_final\"];\r\n\t\t\t\t\t\t$fecha_inicio = $_POST[\"ano_i\"].\"-\".$_POST[\"mes_i\"].\"-\".$_POST[\"dia_i\"];\r\n\t\t\t\t\t\t$fecha_termino = $_POST[\"ano_t\"].\"-\".$_POST[\"mes_t\"].\"-\".$_POST[\"dia_t\"];\r\n\t\t\t\t\t\t$situacion_total = $_POST[\"situacion_total\"];\r\n\t\t\t\t\t\t$ver_actualizacion = $_POST[\"ver_actualizacion\"];\r\n\t\t\t\t\t\t$usar_caducidad = $_POST[\"usar_caducidad\"];\r\n\r\n\t\t\t\t\t\t$clave_seccion = $_POST[\"clave_seccion\"];\r\n\t\t\t\t\t\t$clave_modulo= $_POST[\"clave_modulo\"];\r\n\t\t\t\t\t\t$clave_contenido = $_POST[\"clave_contenido\"];\r\n\t\t\t\t\t\t$fecha_hoy = date(\"Y-m-d\");\r\n\t\t\t\t\t\t$hora_hoy = date (\"H:i:s\");\r\n\t\t\t\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t\t\t\t\t$motivo = $this->escapar_caracteres($_POST[\"motivo\"]);\r\n\t\t\t\t\t\t$motivo = strip_tags($motivo);\r\n\t\t\t\t\t\t$correo = $_POST[\"correo\"];\r\n\t\t\t\t\t\t$nombre = $_POST[\"nombre\"];\r\n\t\t\t\t\t\t$situacion_temporal = $_POST[\"situacion_temporal\"];\t\r\n\t\t\t\t\t\tif($correo==\"\")\r\n\t\t\t\t\t\t\t{$correo = $cor_user;}\r\n\t\t\t\t\t\tif($nombre==\"\")\r\n\t\t\t\t\t\t\t{$nombre = $nom_user;}\r\n\t\t\t\t\t\t$nombre = strip_tags($nombre);\r\n\t\t\t\t\t\t$sql_adicional = \"null, '0000-00-00','00:00:00', '', '', '','',\";\r\n\t\t\t\t\t\tif($situacion_temporal==\"activo\")\r\n\t\t\t\t\t\t\t{$sql_adicional = \"'$nick_user', '$fecha_hoy', '$hora_hoy', '$ip', '$motivo', '$nombre', '$correo',\";}\r\n\t\t\t\t\t\t$insert_camb = \"insert into nazep_zmod_contenido_cambios \r\n\t\t\t\t\t\t(clave_contenido, situacion, nick_user_propone, fecha_propone, hora_propone, ip_propone, motivo_propone,\r\n\t\t\t\t\t\tnombre_propone, correo_propone,\r\n\t\t\t\t\t\tnick_user_decide, fecha_decide, hora_decide, ip_decide, motivo_decide,\r\n\t\t\t\t\t\tnombre_decide, correo_decide,\r\n\t\t\t\t\t\tnuevo_situacion, nuevo_ver_actualizacion, nuevo_usar_caducidad, nuevo_fecha_incio, nuevo_fecha_fin, \r\n\t\t\t\t\t\tanterior_situacion, anterior_ver_actualizacion, anterior_usar_caducidad, anterior_fecha_incio, anterior_fecha_fin)\t\t\t\t\t\r\n\t\t\t\t\t\tselect '$clave_contenido', '$situacion_temporal','$nick_user', '$fecha_hoy', '$hora_hoy', '$ip', '$motivo',\r\n\t\t\t\t\t\t'$nombre','$correo',\r\n\t\t\t\t\t\t\".$sql_adicional.\"\r\n\t\t\t\t\t\t'$situacion_total', '$ver_actualizacion', '$usar_caducidad', '$fecha_inicio', '$fecha_termino',\r\n\t\t\t\t\t\tsituacion, ver_actualizacion, usar_caducidad, fecha_incio, fecha_fin\r\n\t\t\t\t\t\tfrom nazep_zmod_contenido \r\n\t\t\t\t\t\twhere clave_contenido = '$clave_contenido'\";\r\n\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t$conexion = $this->conectarse();\r\n\t\t\t\t\t\tmysql_query(\"START TRANSACTION;\");\r\n\t\t\t\t\t\tif (!@mysql_query($insert_camb))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t$error = 1;\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$paso = true;\r\n\t\t\t\t\t\t\t\t$clave_contenido_cambios_db = mysql_insert_id();\r\n\t\t\t\t\t\t\t\t$clave_contenido_detalle = $_POST[\"clave_contenido_detalle\"];\r\n\t\t\t\t\t\t\t\t$pagina = $_POST[\"pagina\"];\r\n\t\t\t\t\t\t\t\t$texto = $this->escapar_caracteres($_POST[\"conte_texto\"]);\r\n\t\t\t\t\t\t\t\t$situacion_p = $_POST[\"situacion\"];\r\n\t\t\t\t\t\t\t\t$insert_con_cam = \"insert into nazep_zmod_contenido_detalle_cambios\r\n\t\t\t\t\t\t\t\t(clave_contenido_cambios, clave_contenido_detalle, nuevo_pagina, nuevo_texto, nuevo_situacion,\r\n\t\t\t\t\t\t\t\tanterior_pagina, anterior_texto, anterior_situacion)\r\n\t\t\t\t\t\t\t\tselect '$clave_contenido_cambios_db', '$clave_contenido_detalle',\r\n\t\t\t\t\t\t\t\t'$pagina', '$texto', '$situacion_p', pagina, texto, situacion\r\n\t\t\t\t\t\t\t\tfrom nazep_zmod_contenido_detalle\r\n\t\t\t\t\t\t\t\twhere clave_contenido_detalle = '$clave_contenido_detalle'\";\r\n\t\t\t\t\t\t\t\tif (!@mysql_query($insert_con_cam))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t\t\t$error = \"2\";\r\n\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{$paso = true;}\r\n\t\t\t\t\t\t\t\tif($situacion_temporal==\"activo\")\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$update_2 = \"update nazep_zmod_contenido\r\n\t\t\t\t\t\t\t\t\t\tset situacion = '$situacion_total', ver_actualizacion = '$ver_actualizacion', usar_caducidad ='$usar_caducidad', \r\n\t\t\t\t\t\t\t\t\t\tfecha_incio = '$fecha_inicio', fecha_fin = '$fecha_termino',\r\n\t\t\t\t\t\t\t\t\t\tuser_actualizacion = '$nick_user', fecha_actualizacion = '$fecha_hoy', hora_actualizacion = '$hora_hoy',\r\n\t\t\t\t\t\t\t\t\t\tip_actualizacion = '$ip', nombre_actualizacion = '$nombre', correo_actualizacion = '$correo'\r\n\t\t\t\t\t\t\t\t\t\twhere clave_contenido = '$clave_contenido' and clave_modulo = '$clave_modulo'\";\r\n\t\t\t\t\t\t\t\t\t\tif (!@mysql_query($update_2))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$error = 3;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paso = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$clave_contenido_detalle = $_POST[\"clave_contenido_detalle\"];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$pagina = $_POST[\"pagina\"];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$situacion = $_POST[\"situacion\"];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$texto = $this->escapar_caracteres($_POST[\"conte_texto\"]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$update3 = \"update nazep_zmod_contenido_detalle set pagina = '$pagina', texto = '$texto', situacion = '$situacion' \r\n\t\t\t\t\t\t\t\t\t\t\t\twhere clave_contenido_detalle = '$clave_contenido_detalle'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!@mysql_query($update3))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$error = \"4\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{$paso = true;}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($paso)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmysql_query(\"COMMIT;\");\r\n\t\t\t\t\t\t\t\techo \"termino-,*-$formulario_final\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"Error: Insertar en la base de datos, la consulta: <strong>$error</strong> <br/> con el siguiente mensaje: $men\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->desconectarse($conexion);\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$paginas_contenido= $_POST[\"paginas_contenido\"];\r\n\t\t\t\t\t\t$clave_modulo= $_POST[\"clave_modulo\"];\t\t\t\t\t\t\r\n\t\t\t\t\t\t$nombre_sec = HtmlAdmon::historial($clave_seccion_enviada);\r\n\t\t\t\t\t\tHtmlAdmon::titulo_seccion(\"Modificar contenido html de la secci&oacute;n \\\"$nombre_sec\\\"\");\r\n\t\t\t\t\t\t$con_veri = \"select cc.clave_contenido_cambios from nazep_zmod_contenido_cambios cc, nazep_zmod_contenido c\r\n\t\t\t\t\t\twhere c.clave_seccion = '$clave_seccion_enviada' and c.clave_modulo = '$clave_modulo' and \r\n\t\t\t\t\t\t(cc.situacion = 'pendiente' or cc.situacion = 'nueva_pagina' or cc.situacion = 'nuevo')\r\n\t\t\t\t\t\tand c.clave_contenido = cc.clave_contenido\";\r\n\t\t\t\t\t\t$conexion = $this->conectarse();\r\n\t\t\t\t\t\t$res = mysql_query($con_veri);\r\n\t\t\t\t\t\t$cantidad = mysql_num_rows($res);\r\n\t\t\t\t\t\t$this->desconectarse($conexion);\r\n\t\t\t\t\t\tif($cantidad!=0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\techo '<tr><td align=\"center\"><br /><strong>'.cont_txt_tiene_cambio_pen.'</strong><br /><br /></td></tr>';\r\n\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\tHtmlAdmon::boton_regreso(array('clave_usar'=>$clave_seccion_enviada,'texto'=>regresar_opc_mod));\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$variable_archivos = directorio_archivos.\"$clave_seccion_enviada/\";\r\n\t\t\t\t\t\t\t\t$_SESSION[\"direccion_archivos\"] = $variable_archivos;\t\r\n\t\t\t\t\t\t\t\t$con_contenido = \"select fecha_incio, fecha_fin, situacion, ver_actualizacion, usar_caducidad, clave_contenido \r\n\t\t\t\t\t\t\t\tfrom nazep_zmod_contenido where clave_seccion = '$clave_seccion_enviada' and clave_modulo = '$clave_modulo'\";\r\n\t\t\t\t\t\t\t\t$conexion = $this->conectarse();\r\n\t\t\t\t\t\t\t\t$res_contenido = mysql_query($con_contenido);\r\n\t\t\t\t\t\t\t\t$ren = mysql_fetch_array($res_contenido);\r\n\t\t\t\t\t\t\t\t$fecha_incio = $ren[\"fecha_incio\"];\r\n\t\t\t\t\t\t\t\tlist($ano_i, $mes_i, $dia_i) = explode(\"-\",$fecha_incio);\r\n\t\t\t\t\t\t\t\t$fecha_fin = $ren[\"fecha_fin\"];\r\n\t\t\t\t\t\t\t\tlist($ano_t, $mes_t, $dia_t) = explode(\"-\",$fecha_fin);\r\n\t\t\t\t\t\t\t\t$situacion_total = $ren[\"situacion\"];\r\n\t\t\t\t\t\t\t\t$ver_actualizacion = $ren[\"ver_actualizacion\"];\r\n\t\t\t\t\t\t\t\t$usar_caducidad = $ren[\"usar_caducidad\"];\r\n\t\t\t\t\t\t\t\t$clave_contenido = $ren[\"clave_contenido\"];\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\techo '\r\n\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\techo'\r\n\t\t\t\t\t\t\t\t$(document).ready(function()\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$.frm_elem_color(\"#FACA70\",\"\");\r\n\t\t\t\t\t\t\t\t\t\t\t$.guardar_valores(\"frm_modificar_contenido\");\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\tfunction validar_form(formulario, situacion_temporal, nombre_formulario)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.situacion_temporal.value = situacion_temporal;\r\n\t\t\t\t\t\t\t\t\t\t\tif(formulario.motivo.value == \"\") \r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.jv_campo_motivo.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.motivo.focus(); \t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tseparador = \"/\";\r\n\t\t\t\t\t\t\t\t\t\t\tfecha_ini = formulario.dia_i.value+\"/\"+formulario.mes_i.value+\"/\"+formulario.ano_i.value;\r\n\t\t\t\t\t\t\t\t\t\t\tfecha_fin = formulario.dia_t.value+\"/\"+formulario.mes_t.value+\"/\"+formulario.ano_t.value;\r\n\t\t\t\t\t\t\t\t\t\t\tif(!Comparar_Fecha(fecha_ini, fecha_fin))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.comparar_fecha_veri.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.dia_i.focus(); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif(!verificar_fecha(fecha_ini, separador))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.verificar_fecha_ini.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.dia_i.focus(); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif(!verificar_fecha(fecha_fin, separador))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.verificar_fecha_fin.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.dia_t.focus(); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tvalorTemporal = FCKeditorAPI.__Instances[\\'conte_texto\\'].GetHTML();\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.conte_texto.value = valorTemporal;\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.btn_guardar1.style.visibility=\"hidden\";\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.btn_guardar1a.style.visibility=\"hidden\";\r\n\t\t\t\t\t\t\t\t\t\t\tdocument.crear_nueva_pagina.btn_nueva_pagina.style.visibility=\"hidden\";\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\t\tif($nivel == 1 or $nivel == 2)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo 'formulario.btn_guardar2.style.visibility=\"hidden\";\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.btn_guardar2a.style.visibility=\"hidden\";';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\techo '\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.formulario_final.value = nombre_formulario;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\techo '<form name=\"regresar_pantalla\" id=\"regresar_pantalla\" method=\"post\" action=\"index.php?opc=111&amp;clave_seccion='.$clave_seccion_enviada.'\" class=\"margen_cero\">';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"archivo\" value = \"../librerias/modulos/contenido/contenido_admon.php\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clase\" value = \"clase_contenido\"/>';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"metodo\" value = \"modificar_contenido\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_modulo\" value = \"'.$clave_modulo.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"paginas_contenido\" value = \"'.$paginas_contenido.'\" />';\r\n\t\t\t\t\t\t\t\techo '</form>';\t\r\n\t\t\t\t\t\t\t\techo '<form name=\"recargar_pantalla\" id= \"recargar_pantalla\" method=\"get\" action=\"index.php\" class=\"margen_cero\"><input type=\"hidden\" name=\"opc\" value = \"11\" /><input type=\"hidden\" name=\"clave_seccion\" value = \"'.$clave_seccion_enviada.'\" /></form>';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\techo '<form name=\"frm_modificar_contenido\" id=\"frm_modificar_contenido\" method=\"post\" action=\"index.php?opc=111&amp;clave_seccion='.$clave_seccion_enviada.'\" class=\"margen_cero\" >';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td width=\"400\">'.persona_cambio.'</td><td><input type =\"text\" name = \"nombre\" size = \"60\" /></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.correo_cambio.'</td><td><input type = \"text\" name = \"correo\" size = \"60\" /></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.motivo_cambio.'</td><td><textarea name=\"motivo\" cols=\"45\" rows=\"5\"></textarea></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.situacion.'</td><td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion_total\" id =\"situacion_act\" value=\"activo\" '; if ($situacion_total == \"activo\") { echo 'checked=\"checked\"'; } echo '/> '.activo.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion_total\" id =\"situacion_no\" value=\"cancelado\" '; if ($situacion_total == \"cancelado\") { echo 'checked=\"checked\"'; } echo '/> '.cancelado.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.cont_txt_ver_fec_ac.'</td><td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"ver_actualizacion\" id =\"ver_actualizacion_si\" value=\"SI\" '; if ($ver_actualizacion == \"SI\") { echo 'checked=\"checked\"'; } echo '/> '.si.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"ver_actualizacion\" id =\"ver_actualizacion_no\" value=\"NO\" '; if ($ver_actualizacion == \"NO\") { echo 'checked=\"checked\"'; } echo '/> '.no.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.cont_txt_usar_cad_cont.'</td><td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"usar_caducidad\" id =\"usar_caducidad_si\" value=\"SI\" '; if ($usar_caducidad == \"SI\") { echo 'checked=\"checked\"'; } echo ' /> '.si.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"usar_caducidad\" id =\"usar_caducidad_no\" value=\"NO\" '; if ($usar_caducidad == \"NO\") { echo 'checked=\"checked\"'; } echo ' /> '.no.'&nbsp;';\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.fecha_ini_vig.'</td>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t$areglo_meses = FunGral::MesesNumero();\r\n\t\t\t\t\t\t\t\t\t\t\t\techo dia.'&nbsp;<select name = \"dia_i\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($a = 1; $a<=31; $a++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$a.'\" '; if ($dia_i == $a) { echo 'selected=\"selected\"'; } echo ' >'.$a.'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo mes.'&nbsp;<select name = \"mes_i\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($b=1; $b<=12; $b++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$b.'\" '; if ($mes_i == $b) {echo ' selected=\"selected\" ';} echo ' >'. $areglo_meses[$b] .'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo ano.'&nbsp;<select name = \"ano_i\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($c=$ano_i-10; $c<=$ano_i+10; $c++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$c.'\" '; if ($ano_i == $c) {echo ' selected=\"selected\" ';} echo '>'.$c.'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.fecha_fin_vig.'</td>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo dia.'&nbsp;<select name = \"dia_t\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($a = 1; $a<=31; $a++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$a.'\" '; if ($dia_t == $a) { echo 'selected'; } echo '>'.$a.'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo mes.'&nbsp;<select name = \"mes_t\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($b=1; $b<=12; $b++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$b.'\" '; if ($mes_t == $b) {echo 'selected ';} echo '>'.$areglo_meses[$b].'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo ano.'&nbsp;<select name = \"ano_t\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($c=$ano_t-10; $c<=$ano_t+10; $c++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{echo '<option value = \"'.$c.'\" '; if ($ano_t == $c) {echo ' selected ';} echo '>'.$c.'</option>';}\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\t\techo '<br /><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td align=\"center\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"submit\" name=\"btn_guardar1a\" value=\"'.guardar.'\" onclick= \"return validar_form(this.form,\\'pendiente\\', \\'recargar_pantalla\\')\" />';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\t\tif($nivel == 1 or $nivel == 2)\r\n\t\t\t\t\t\t\t\t\t\t\t\t{echo '<td align=\"center\"><input type=\"submit\" name=\"btn_guardar2a\" value=\"'.guardar_puliblicar.'\" onclick= \"return validar_form(this.form,\\'activo\\', \\'regresar_pantalla\\')\" /></td>';}\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table><br/>';\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$cons_con_detalle = \"select clave_contenido_detalle, pagina, texto, situacion from nazep_zmod_contenido_detalle\r\n\t\t\t\t\t\t\t\t\twhere clave_contenido = '$clave_contenido' and pagina ='$paginas_contenido' \";\r\n\t\t\t\t\t\t\t\t\t$res = mysql_query($cons_con_detalle);\r\n\t\t\t\t\t\t\t\t\t$con = 1;\r\n\t\t\t\t\t\t\t\t\t$ren = mysql_fetch_array($res);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$pagina = $ren[\"pagina\"];\r\n\t\t\t\t\t\t\t\t\t$texto = stripslashes($ren[\"texto\"]);\r\n\t\t\t\t\t\t\t\t\t$clave_contenido_detalle_base = $ren[\"clave_contenido_detalle\"];\r\n\t\t\t\t\t\t\t\t\t$situacion_texto = $ren[\"situacion\"];\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_contenido_detalle\" value = \"'.$clave_contenido_detalle_base.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td align=\"center\"><strong>'.cont_txt_con_html_pag.' '.$pagina.'</strong></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td width=\"377\">'.cont_txt_num_pag.' '.$pagina.'<input type = \"hidden\" name = \"pagina\" size = \"5\" value =\"'.$pagina.'\" /></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td align=\"center\">'.cont_txt_sit_pag.' '.$pagina.'&nbsp;&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion\" id =\"situacion_act\" value=\"activo\" '; if ($situacion_texto == \"activo\") { echo 'checked=\"checked\"'; } echo '/> '.activo.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion\" id =\"situacion_no\" value=\"cancelado\" '; if ($situacion_texto == \"cancelado\") { echo 'checked=\"checked\"'; } echo '/> '.cancelado.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td><a name=\"texto_link\" id=\"texto_link\"></a>';\r\n\t\t\t\t\t\t\t\t\t\t\t$texto = ($texto!='')?$texto:'&nbsp;'; \r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con] = new FCKeditor(\"conte_texto\");\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->BasePath = '../librerias/fckeditor/';\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Value = $texto;\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Config['EditorAreaCSS'] = $ubi_tema.'fck_editorarea.css';\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Config['StylesXmlPath'] = $ubi_tema.'fckstyles.xml';\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Width = \"100%\";\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Height = \"500\";\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Create();\r\n\t\t\t\t\t\t\t\t\t\techo '</td></tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"formulario_final\" value = \"\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_contenido\" value = \"'.$clave_contenido.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"archivo\" value = \"../librerias/modulos/contenido/contenido_admon.php\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clase\" value = \"clase_contenido\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"metodo\" value = \"modificar_contenido\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"guardar\" value = \"si\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_seccion\" value = \"'.$clave_seccion_enviada.'\" />';\t\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_modulo\" value = \"'.$clave_modulo.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"situacion_temporal\" value = \"pendiente\" />';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td align=\"center\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"submit\" name=\"btn_guardar1\" value=\"'.guardar.'\" onclick= \"return validar_form(this.form,\\'pendiente\\', \\'recargar_pantalla\\')\" />';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\t\tif($nivel == 1 or $nivel == 2)\r\n\t\t\t\t\t\t\t\t\t\t\t\t{echo '<td align=\"center\"><input type=\"submit\" name=\"btn_guardar2\" value=\"'.guardar_puliblicar.'\" onclick= \"return validar_form(this.form,\\'activo\\', \\'regresar_pantalla\\')\" /></td>';}\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\techo '</form>';\r\n\t\t\t\t\t\t\t\t\techo '<hr />';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td align=\"center\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<form id=\"crear_nueva_pagina\" name=\"crear_nueva_pagina\" action=\"index.php?opc=111&amp;clave_seccion='.$clave_seccion_enviada.'\" method=\"post\" class=\"margen_cero\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"archivo\" value =\"../librerias/modulos/contenido/contenido_admon.php\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clase\" value = \"clase_contenido\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"metodo\" value = \"nueva_pagina\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_modulo\" value = \"'.$clave_modulo.'\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"paginas_contenido\" value = \"'.$paginas_contenido.'\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"submit\" name=\"btn_nueva_pagina\" value=\"'.cont_btn_7_cre_pag.'\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</form>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\tHtmlAdmon::div_res_oper(array());\r\n\t\t\t\t\t\t\t\tHtmlAdmon::boton_regreso(array('clave_usar'=>$clave_seccion_enviada,'texto'=>regresar_opc_mod));\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$this->desconectarse($conexion);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}", "static public function ctrEditarUsuario()\n\t{\n\t\tif(isset($_POST['editarUsuario']))\n\t\t{\n\t\t\t//vamos a permitir caracteres especiales con tilde,espacio en blanco y numericos con expresion regular\n\t\t\t// vamos a solo editar el nombre del usuario y no usuario para evitar crear carpeta basura en img/usuarios\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓü ]+$/', $_POST['editarNombre']))\n\t\t\t{\n\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t\t// recuperamos la ruta de la imagen del input oculto\n\t\t\t\t$ruta = $_POST['fotoActual'];\n\n\t\t\t\t// si existe la variable $_FILE(en nuestro caso siempre existe) y viene diferente a vacio el archivo temporal de la imagen\n\t\t\t\tif(isset($_FILES['editarFoto']['tmp_name']) && !empty($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t// if(isset($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\t// vamos a recortar la imagen 500 x 500 px\n\n\t\t\t\t\t// list — Asignar variables como si fueran un array\n\t\t\t\t\t// getimagesize — Obtener el tamaño de una imagen\n\t\t\t\t\t//en list() toma el indice 0 de [nuevaFoto][tmp_name](los indice del archivo temporal son medidas de la imagen) y asigna a $ancho y el indice 1 asigna a $alto \n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t// redimensionamos\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t// creamos la ruta donde se va a guardar la imagen\n\t\t\t\t\t$directorio = 'vistas/img/usuarios/'.$_POST['editarUsuario'];\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE LA IMAGEN EN LA BD \n\t\t\t\t\t======================================================================*/\n\t\t\t\t\t\n\t\t\t\t\t// si la ruta de la db es diferente a vacio \n\t\t\t\t\tif(!empty($_POST['fotoActual']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// unlink — Borra un fichero\n\t\t\t\t\t\t// vamos a borrar ese archivo en esa carpeta\n\t\t\t\t\t\t// console.log('foto actual');\n\t\t\t\t\t\tunlink($_POST['fotoActual']);\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// en caso de que venga vacio, vamos a crear el directorioo carpeta\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tDEACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP \n\t\t\t\t\t======================================================================*/\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/jpeg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/png\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagepng($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\t// var_dump($_FILES['nuevaFoto']['tmp_name']);\n\t\t\t\t\t// var_dump(getimagesize($_FILES['nuevaFoto']['tmp_name']));\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t\n\t\t\t\t// si el nuevo pass es diferente a vacio\n\t\t\t\tif($_POST['editarPassword'] != \"\")\n\t\t\t\t{\n\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"editarPassword\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t//almacenamos en la variable encriptar y encriptamos el nuevo pass y usamos el hash de tipo CRYPT_BLOWFISH\n\t\t\t\t\t\t// crypt — Hash de cadenas de un sólo sentido, se encripta la pass ingresado\n\t\t\t\t\t\t$encriptar = crypt($_POST[\"editarPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\ttitle: \"La contrasena no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\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\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //si editarPassword viene vacio\n\t\t\t\t{\n\t\t\t\t\t$encriptar = $_POST[\"passwordActual\"];\n\t\t\t\t}\n\n\t\t\t\t$datos = array\n\t\t\t\t(\n\t\t\t\t\t\"nombre\"=> $_POST['editarNombre'],\n\t\t\t\t\t\"usuario\"=> $_POST['editarUsuario'],\t\n\t\t\t\t\t\"password\"=> $encriptar,\t\n\t\t\t\t\t\"perfil\"=> $_POST['editarPerfil'],\n\t\t\t\t\t\"ruta\" => $ruta\t\n\t\t\t\t);\n\n\t\t\t\t// llamamos al metodo mdlEditarUsuario de la clase modelo Usuario\n\t\t\t\t$respuesta = ModeloUsuarios::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t// mostramos mensaje de edicion exitosa\n\t\t\t\tif($respuesta == \"ok\")\n\t\t\t\t{\n\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se editó correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\ttitle: \"El nombre no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t</script>';\t\n\t\t\t}\n\t\t}\n\t}", "public function actualizarusuario($imagenperfil,$datosuser,$id){\n // NOTE: obtener los usuarios en usuarios.json, transformandolos en un array\n $usuarios = $this->buscarUsuarios();\n // NOTE: recorrer array de todos los usuarios y sobreescribir el registro que corresponda al usuario a editar\n if (!empty($usuarios)) {\n // NOTE: vacio el archivo usuarios.json para poder insertar las modificaciones sin duplicar al usuario\n file_put_contents('usuarios.json', '');\n foreach ($usuarios as $usuario) {\n // NOTE: si encuentro al usuario guardo las modificaciones\n if (strtolower($id) == strtolower($usuario['id'])) {\n $usuario['nombre'] = $datosuser['nombre'];\n $usuario['apellido'] = $datosuser['apellido'];\n $usuario['email'] = $datosuser['email'];\n if ($usuario['password'] != $datosuser['password']) {\n $usuario['password'] = password_hash($datosuser['password'],PASSWORD_DEFAULT);\n }\n if ($imagenperfil['imgperfil']['error'] === UPLOAD_ERR_OK) {\n $ext = strtolower(pathinfo($imagenperfil['imgperfil']['name'], PATHINFO_EXTENSION));\n $hasta = '/images/profileImg/'.'perf'.$id.'.'.$ext;\n $usuario['srcImagenperfil'] = $hasta;\n }\n $userjson = json_encode($usuario);\n file_put_contents('usuarios.json', $userjson . PHP_EOL, FILE_APPEND);\n $this->subirImgPerfil($imagenperfil,$id);\n }else {\n // NOTE: si no encuentro al usuario guardo a los demas sin cambios\n $userjson = json_encode($usuario);\n file_put_contents('usuarios.json', $userjson . PHP_EOL, FILE_APPEND);\n }\n }\n }\n // NOTE: volver a convertir a json y guardar archivo usuarios.json\n //$userjson = json_encode($usuarios);\n //file_put_contents('usuarios2.json', $userjson . PHP_EOL, FILE_APPEND);\n //subirImgPerfil($imagenperfil,$id);\n\n\n }", "function modificarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_herrajeaccesorio','id_herrajeaccesorio','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('herrajeaccesorio','herrajeaccesorio','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function UpdateManga(){\r\n $this->idPost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->manga();\r\n $this->lastFileNamePost();\r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){ \r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/manga/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/manga/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_mangaManager->updateManga($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionManga'); \r\n }", "public function editAvatar(EditUserForm $request){\n if(Auth::check()){\n $valid = User::select('id')\n ->where('email', $request->email)\n ->where('id', '<>' , $request->id)\n ->get();\n if(count($valid) <= 0){\n\n $user = User::find($request->id);\n $oldAvatar = $user->avatar; \n\n if ($request->avatar == $oldAvatar){\n\n $fileName = $request->avatar;\n }\n else{\n\n if ( $oldAvatar =='img/img_profile_users/default-avatar2.jpg') {\n\n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n }\n else{\n \n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n unlink($oldAvatar);\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n };\n } \n\n $sessionUser = Auth::user()->name;\n //$user = User::find($request->id);\n $user->name = $request->name;\n $user->email = $request->email;\n $user->telephone = $request->telephone;\n $user->dependence = $request->dependence;\n $user->role = $request->role;\n $user->avatar = $fileName;\n $user->save();\n $audi_users = new Audi_Users;\n $audi_users->name = $request->name;\n $audi_users->email = $request->email;\n $audi_users->telephone = $request->telephone;\n $audi_users->dependence = $request->dependence;\n $audi_users->role = $request->role;\n $audi_users->avatar = $fileName;\n $audi_users->id_user = Auth::user()->id;\n $audi_users->tipo_audi = 2;\n $audi_users->save();\n return ['success'=>'ok'];\n }else{\n return ['error'=>'Este correo ya esta asignado a otro usuario'];\n }\n }\n else{\n return ['error'=>'no se pudo completar la operacion'];\n }\n }", "public function Modificar(): bool\n {\n $retorno = false;\n $objetoAccesoDato = AccesoDatos::RetornarObjetoAcceso();\n\n\n $consulta =$objetoAccesoDato->RetornarConsulta(\"UPDATE usuarios SET nombre = :nombre, correo = :correo, clave = :clave, id_perfil = :id_perfil\n WHERE usuarios.id = :id\");\n // $consulta = $objetoAccesoDato->RetornarConsulta(\"UPDATE `usuarios` SET `nombre`='$this->nombre',`correo`='$this->correo',\"\n // . \"`clave`='$this->clave',`id_perfil`='$this->id_perfil' WHERE `id`='$this->id'\");\n\n\n $consulta->bindParam(':correo', $this->correo, PDO::PARAM_STR);\n $consulta->bindParam(':clave', $this->clave, PDO::PARAM_STR);\n $consulta->bindParam(':nombre', $this->nombre, PDO::PARAM_STR);\n $consulta->bindParam(':id_perfil', $this->perfil, PDO::PARAM_INT);\n $consulta->bindParam(':id', $this->id, PDO::PARAM_INT);\n\n $consulta->execute();\n $filasAfectadas = $consulta->rowCount();\n if ($filasAfectadas > 0)\n $retorno = true;\n\n\n return $retorno;\n }", "public function nuevoInstructor() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST' &&\n isset($_POST['tipoD']) &&\n !empty($_POST['tipoD']) &&\n isset($_POST['numero_documento']) &&\n !empty($_POST['numero_documento']) &&\n isset($_POST['nombre_user']) &&\n !empty($_POST['nombre_user']) &&\n isset($_POST['apellido_user']) &&\n !empty($_POST['apellido_user']) &&\n isset($_POST['correo_user']) &&\n !empty($_POST['correo_user']) &&\n isset($_POST['telefono_user']) &&\n !empty($_POST['telefono_user']) \n\n\n // $_FILES['imagen']['name']\n ) {\n \t#echo \"<script>alert('Entro al controlador')</script>\";\n /* $nom_arch = $_FILES['imagen']['name']; //obtener el nombre del imagen\n $ext_img = explode(\".\", $nom_arch);\n $ext_img = end($ext_img);\n $nombre_img = strtolower($_POST['nombre_user'] .'_'. $_POST['apellido_user']) . '.' . $ext_img; */\n\n\n $clave = $_POST['numero_documento'];\n\n $clavecifrada = password_hash($clave, PASSWORD_DEFAULT);\n\n $valores = array('tipo_documento' => $_POST['tipoD'],\n 'num_documento' => $_POST['numero_documento'],\n 'nombre_user' => $_POST['nombre_user'],\n 'apellido_user' => $_POST['apellido_user'],\n 'correo_user' => $_POST['correo_user'],\n 'telefono_user' => $_POST['telefono_user'],\n 'telefono_user' => $_POST['telefono_user'],\n 'pass' => $clavecifrada\n );\n //porceder a guardar mediante un metodo del modelo\n $guardar = ModeloInstructor::guardarInstructor($valores);\n //echo $guardar['id'];\n if($guardar['guardar'] != FALSE){\n echo '<script>\n swal({\n title: \"Guardo\",\n text: \"Instructor Guardado Correctamente\",\n icon: \"success\"\n }).then((willDelete) => {\n if (willDelete) {\n window.location.replace(\"registrarInstructor\");\n }\n });\n </script>';\n }\n\n $valoresU = array('pass' => $clavecifrada,\n 'num_documento' => $_POST['numero_documento'],\n 'nombre_user' => $_POST['nombre_user'],\n 'id_instructor' => $guardar['id']\n );\n //GUARDAMOS TAMBIEN EL USUARIO DE INGRESO AL APLICATIVO\n $guardarUser = ModeloInstructor::guardarInstructorUsuario($valoresU);\n /////////////////////\n if($guardarUser['guardar'] != FALSE){\n echo '<script>\n swal({\n title: \"Guardo\",\n text: \"Guardado Correctamente Usuario\",\n icon: \"success\"\n }).then((willDelete) => {\n if (willDelete) {\n window.location.replace(\"registrarInstructor\");\n }\n });\n </script>';\n }else{\n echo '<script>\n swal({\n title: \"Oops!\",\n text: \"Ha ocurrido un error al guardar Usuario\",\n icon: \"error\"\n });\n </script>';\n }\n ////////////////////\n } else {\n echo '<script>\n swal({\n title: \"Oops!\",\n text: \"No se recibieron algunos datos\",\n icon: \"error\"\n });\n </script>';\n }\n }", "public function modificarConcurso() {\n\n\t\tif(!$_SESSION[\"currentuser\"]){\n\t\t\techo \"<script>window.location.replace('index.php');</script>\";\n\t\t}\n\n\t\t$concu= new Concurso();\n\n\t\tif (isset($_POST[\"nombreC\"])){\n\t\t\t/*Metodo de la clase concurso que devuelve un boolean indicando si\n\t\t\tel concurso existe en la base de datos*/\n\t\t\t$existe=$concu->existConcurso();\n\n\t\t\t/*Si el concurso no existe devuelve un mensaje de error*/\n\t\t\tif(!$existe){\n\t\t\t\t$errors = array();\n\t\t\t\t$errors[\"nombreC\"] = \"Este concurso no existe, por lo que no se puede modificar\";\n\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t/*Si el concurso si que existe, se guardan los valores introducidos en la\n\t\t\t\tmodificacion en la clase concurso*/\n\t\t\t}else{\n\t\t\t\t$concu->setIdC('1');\n\t\t\t\t$concu->setNombreC($_POST[\"nombreC\"]);\n\n\t\t\t\t$ruta=\"./resources/bases/\";//ruta carpeta donde queremos copiar las imagenes\n\t\t\t\t$basesCTemp=$_FILES['basesC']['tmp_name'];//guarda el directorio temporal en el que se sube la imagen\n\t\t\t\t$basesC=$ruta.$_FILES['basesC']['name'];//indica el directorio donde se guardaran las imagenes\n\t\t\t\tmove_uploaded_file($basesCTemp, $basesC);\n\n\t\t\t\t$concu->setBasesC($basesC,$basesCTemp);\n\t\t\t\t$concu->setCiudadC($_POST[\"ciudadC\"]);\n\t\t\t\t$concu->setFechaInicioC($_POST[\"fechaInicioC\"]);\n\t\t\t\t$concu->setFechaFinalC($_POST[\"fechaFinalC\"]);\n\t\t\t\t$concu->setFechaFinalistasC($_POST[\"fechaFinalistasC\"]);\n\t\t\t\t$concu->setPremioC($_POST[\"premioC\"]);\n\t\t\t\t$concu->setPatrocinadorC($_POST[\"patrocinadorC\"]);\n\n\t\t\t\ttry{\n\t\t\t\t\t/*Comprueba si los datos introducidos son validos*/\n\t\t\t\t\t$concu->checkIsValidForRegister();\n\n\t\t\t\t\t// Actualiza los datos del concurso\n\t\t\t\t\t$concu->update();\n\n\t\t\t\t\t//mensaje de confirmación y redirige al metodo consultarConcurso del controlador ConcursoCotroller\n\t\t\t\t\techo \"<script> alert('Modificación realizada correctamente'); </script>\";\n\t\t\t\t\techo \"<script>window.location.replace('index.php?controller=concurso&action=consultarConcurso');</script>\";\n\n\t\t\t\t}catch(ValidationException $ex) {\n\n\t\t\t\t\t$errors = $ex->getErrors();\n\t\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*Devuelve los datos del concurso para mostrarlos en la vista*/\n\t\t$concu = $this->concurso->ver_datos();\n\n\t\t/* Guarda el valor de la variable $concu en la variable concu accesible\n\t\tdesde la vista*/\n\t\t$this->view->setVariable(\"concu\", $concu);\n\n\t\t/*Permite visualizar: view/vistas/modificacionConcurso.php */\n\t\t$this->view->render(\"vistas\", \"modificacionConcurso\");\n\t}", "function editar_perfil() {\r\n\t//Comprueba que los campos tien cosas, si las tiene las actualiza y si no las omite.\r\n\r\n\tif(!empty($_FILES['imagen_perfil']['tmp_name'])) \r\n\t\trecibir_fichero();\r\n\t\r\n\tif(!empty($_POST['estado_usuario']))\r\n\t\teditar_estado();\r\n\t\r\n\tif(!empty($_POST['nombre']))\r\n\t\teditar_nombre();\r\n\r\n\treturn true;\r\n}", "private function processUpdateUser(){\n\n\t\tif($_FILES[\"foto_usuario\"][\"error\"] == 0){\n\t\t\t$randNumber = rand(0, 999999);\n\t\t\t$imgName = $randNumber . $_FILES['foto_usuario']['name'];\n\t\t\t$image_upload = Config::$userDirImage . $imgName;\n\t\t\tif (move_uploaded_file($_FILES['foto_usuario']['tmp_name'], $image_upload)) {\n\t\t\t\t$result = $this->users->updateUser($_REQUEST[\"idusuario\"], $imgName); //Devuelve 1 si inserta user\n\t\t\t\tif($result){\n\t\t\t\t\tif($_REQUEST[\"nombre_foto\"] != \"\")\n\t\t\t\t\t\tunlink(Config::$userDirImage.$_REQUEST[\"nombre_foto\"]);\n\t\t\t\t\tView::redireccion(\"user\", \"userController\");\n\t\t\t\t} else {\n\t\t\t\t\tunlink($image_upload);\n\t\t\t\t\techo \"Ocurrio un error al insertar el usuario.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"Ocurrio un error al guardar el archivo.\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"Ocurrio un error al cargar el archivo.\";\n\t\t}\n\t}", "public function actualizar($req,$id){\n\t\t//$stringCamposActualizar = \"\";\n\t\t$conexion = $GLOBALS['conexion'];\t\t\n\t\t//if(isset($req['nombres'])){\n\t\tif(isset($req['nombres']) && !empty($_FILES[0]['tmp_name'])){\t\t\t\n\t\t\t$nombre \t\t\t= addslashes(strip_tags($req['nombres']));\n\t\t\t$apellidos \t\t\t= addslashes(strip_tags($req['apellidos']));\n\t\t\t$email \t\t\t\t= addslashes(strip_tags($req['email']));\n\t\t\t$movil \t\t\t\t= addslashes(strip_tags($req['telefono_movil']));\n\t\t\t$fijo \t\t\t\t= addslashes(strip_tags($req['telefono_fijo']));\t\t\t\n\t\t\t$presentacion \t\t= addslashes(strip_tags($req['presentacion']));\n\t\t\t$fecha_modificacion = addslashes(date(\"Y-m-d\"));\t\t\t\n\t\t\t$CVNpdf \t\t\t= addslashes(file_get_contents($_FILES[0]['tmp_name']));\n\t\t\t\n\t\t\ttry{\n\t\t\t\t//Actualizar de acuerdo al id y solo si es diferente de procesado. Es decir si está en pendiente o error\t\t\t\n\t\t\t\t$query = \"UPDATE persona SET nombre='$nombre',\n\t\t\t\t\t\t\t\t\t\t\t apellidos='$apellidos', \n\t\t\t\t\t\t\t\t\t\t\t email='$email', \n\t\t\t\t\t\t\t\t\t\t\t telefono_movil='$movil', \n\t\t\t\t\t\t\t\t\t\t\t telefono_fijo='$fijo', \n\t\t\t\t\t\t\t\t\t\t\t presentacion='$presentacion', \n\t\t\t\t\t\t\t\t\t\t\t CVNPdf='$CVNpdf',\n\t\t\t\t\t\t\t\t\t\t\t fecha_modificacion='$fecha_modificacion',\n\t\t\t\t\t\t\t\t\t\t\t estado_procesado='_PENDIENTE', \n\t\t\t\t\t\t\t\t\t\t\t estado='publico'\n\t\t\t\t\t\t\t\t\t\tWHERE id=$id \";\t\t\t\t\t\t\n\t\t\t\t$status = $conexion->query($query);//devuelve true or false\t\t\t\t\n\t\t\t\t$mensaje = \"Los datos fueron actualizados satisfactoriamente\";\n\t\t\t\t\n\t\t\t}catch(Exception $ex){\n\t\t\t\t$status = false;\n\t\t\t\t$mensaje = \"Error al actualizar. Mensaje: \".$ex->getMessage();\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t$data = array('status'=>$status, 'mensaje'=>$mensaje);\n\t\treturn $data;\t\t\n\t}", "public function update(Request $request, $id)\n {\n\n //Solo los miembros pueden editar\n $consulta=RsuParticipante::where('rsu_proyecto_id',$id)\n ->where('user_id',Auth::user()->id)->get();\n //return $consulta;\n if($consulta->isEmpty()){\n return redirect()->route('rsu.mp.index')->with('rojo','Ud. no tiene permiso para editar este proyecto');\n }\n //inicializamos las ruta de los archivos\n\n $myProyect= RsuProyecto::find($id);\n //si se cargaron archivos que guarden las imagenes en el servidor\n if($request->file('aprobacion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_aprobacion);\n $fileAprobacion= $request->file('aprobacion-file')->store('public/rsu/aprobacion');\n $myProyect->file_aprobacion=$fileAprobacion;\n }\n if($request->file('culminacion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_culminacion);\n $fileCulminacion= $request->file('culminacion-file')->store('public/rsu/culminacion');\n $myProyect->file_culminacion=$fileCulminacion;\n }\n if($request->file('satisfaccion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_satisfaccion);\n $fileSatisfaccion=$request->file('satisfaccion-file')->store('public/rsu/satisfaccion');\n $myProyect->file_satisfaccion=$fileSatisfaccion;\n }\n //guardar datos a la tabla rsu_proyectos\n \n $myProyect->titulo=$request->get('titulo');\n $myProyect->doc_aprobacion=$request->get('doc_aprobacion');\n $myProyect->lugar=$request->get('lugar');\n $myProyect->beneficiarios=$request->get('beneficiarios');\n $myProyect->aliados=$request->get('aliados');\n $myProyect->porcentaje=$request->get('porcentaje');\n $myProyect->doc_culminacion=$request->get('doc_culminacion');\n $myProyect->objetivos=$request->get('objetivos');\n $myProyect->justificacion=$request->get('justificacion');\n $myProyect->logros=$request->get('logros');\n $myProyect->dificultades=$request->get('dificultades');\n $myProyect->satisfaccion=$request->get('satisfaccion');\n $myProyect->mas_lineamientos=$request->get('mas_lineamientos');\n $myProyect->save();\n //Guardamos el ID del proyecto registrado\n// $ultimoID=$myProyect->id;\n\n// $array1 = array(1, 2,3,4);\n// $array2 = array(2,11,6);\n\n //return array_diff($array1, $array2);\n //Para eliminar\n //return $paraEliminar=RsuLineamientoProyecto::where('rsu_proy_id',$id)->whereNotBetween('rsu_lin_id',[100,12])->get(); \n //return $request->get('lineas');\n $lineas=$request->get('lineas');\n if($lineas){\n return $paraEliminar=RsuLineamientoProyecto::where('rsu_proy_id',$id)->whereNotIn('rsu_lin_id',$lineas)->pluck('rsu_lin_id');\n foreach($request->get('lineas') as $linea){\n $lineamientos=new RsuLineamientoProyecto;\n $lineamientos->rsu_lin_id=$linea;\n $lineamientos->rsu_proy_id=$ultimoID;\n $lineamientos->save();\n }\n }\n return redirect()->route('rsu.mp.index')->with('verde','Actualizó el proyecto \\''.$myProyect->titulo.'\\' correctamente');\n }", "function modificarUcedifobracivil(){\n\t\t$this->procedimiento='snx.ft_ucedifobracivil_ime';\n\t\t$this->transaccion='SNX_UDOC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_ucedifobracivil','id_ucedifobracivil','int4');\n\t\t$this->setParametro('id_ucedifsubgrupo','id_ucedifsubgrupo','int4');\n\t\t$this->setParametro('cantidadobracivil','cantidadobracivil','numeric');\n\t\t$this->setParametro('id_obracivilmoe','id_obracivilmoe','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function actualizar_imagen($id_imagen,$id_tipo_imagen,$estado,$registrado,$id_licencia,$id_autor,$tags,$tipo_pictograma,$validos_senyalectica) {\n\t\t\n\t\t$timestamp=time();\n\t\t$fecha=date(\"Y-m-d H:i:s\",$timestamp);\n\t\t\t\t\n\t\t$UpdateRecords = \"UPDATE imagenes \n\t\tSET estado='$estado', \n\t\tregistrado='$registrado', ultima_modificacion='$fecha',\n\t\tid_licencia='$id_licencia', id_autor='$id_autor',\n\t\ttags_imagen='$tags', id_tipo_imagen='$id_tipo_imagen',\n\t\ttipo_pictograma=$tipo_pictograma,\n\t\tvalidos_senyalectica='$validos_senyalectica'\n\t\tWHERE id_imagen='$id_imagen'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords); \n\t\tmysql_close($connection);\n\t\t\t\n\t}", "public function updatefile(Request $request, $id)\n {\n //\n\n $validar=validator::make($request->all(),[\n 'imagenup'=>'image|mimes:jpeg,jpg,png,gif',\n ]);\n if($validar->passes()){\n $noticiaold=Noticia::find($id);\n\n //$Tesiold->delete();\n $archivo=$request->file('imagenup');\n $nombre=$archivo->getClientOriginalName();\n $carpeta=\"img/noticias/\".$nombre;\n /* $fileregistro = new Tesi;\n $fileregistro->documento =$nombre;\n $fileregistro->directorio=$carpeta;\n */\n // \\Storage::disk('local')->put($nombre, \\File::get($archivo));\n $archivo->move('img/noticias',$nombre);\n // $entrada['documento']=$nombre;\n\n $noticiaold->fill($request->all());\n $noticiaold->save();\n\n return response()->json();\n }else{\n foreach ($validar->errors()->all() as $message) {\n\n return response()->json(['error'=>$message]);\n }\n\n }\n }", "function update_photo($pseudo,$pd){\n \tif (isset($pd) && $pd['error']== 0){\n \n if ($pd['size'] <= 7000000)\n {\n $infosfichier = pathinfo($pd['name']);\n $extension_upload = $infosfichier['extension'];\n $extensions_autorisees = array('jpg', 'jpeg','JPG','JPEG','png','PNG');\n $nomFichier = basename($pd['name']) ;\n\n if (in_array($extension_upload,$extensions_autorisees)){\n\n \t move_uploaded_file($pd['tmp_name'], 'admin/fichiers/photos/' . basename($pd['name']));\n \t $re = new DbManager();\n \t $re -> update_pdp($pseudo,$nomFichier); \n return true;\n }\n }else echo 'erreur de taille du fichiers ';\n \n\n \t }\n }", "public function alterarFotoCapaGrupo($grupoID)\n { \n\n $usuarioID = $_SESSION['usuario_id'];\n\n // Verifica se este usuário é administrador deste grupo\n $verificaUsuarioCriouGrupo = COUNT($this->mapper->grupo(array('usuario_criacao' => $usuarioID, 'id' => $grupoID))->fetchall());\n\n if($verificaUsuarioCriouGrupo == 1){\n\n $grupoPagina = 0;\n\n // Configurações de acesso ao bucket no s3\n $bucket=\"bucket-socialgroups\";\n $awsAccessKey=\"AKIAIKVT6CC24NGCKLPQ\";\n $awsSecretKey=\"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\";\n $s3 = new S3($awsAccessKey, $awsSecretKey);\n // Configurações de acesso ao bucket no s3\n\n $posicao = 0;\n\n\n foreach($_FILES as $file){\n\n $tmpname = $file['tmp_name'];\n\n // Armazena a extensão do arquivo em uma url\n $extencao = strrchr($file['name'], '.');\n $codigoFile = md5($file['name'][$posicao].date('Y-m-d H:i:s'));\n\n $posicao++;\n\n\n if($s3->putObjectFile($tmpname, $bucket , $codigoFile.$extencao, S3::ACL_PUBLIC_READ) ){\n\n $s3file='https://'.$bucket.'.s3.amazonaws.com/'.$codigoFile.$extencao;\n $capa = $s3file;\n\n }\n\n\n // Atualiza Foto capa do grupo\n $atualizaFotoCapaGrupo = $this->mapper->grupo(array('id' => $grupoID))->fetch();\n $atualizaFotoCapaGrupo->grupo_avatar = $capa;\n $this->mapper->grupo->persist($atualizaFotoCapaGrupo);\n $this->mapper->flush();\n // Atualiza Foto capa do grupo\n\n }\n\n\n // Retorna dados após reload na pagina\n $GetGrupos = new GetGrupos();\n // Retorna dados após reload na pagina\n\n $returnacao = 'alterarCapaGrupo';\n\n return $GetGrupos->grupoSelecionado($grupoID, $grupoPagina, $returnacao);\n\n }\n\n\n\n\n \n\n }", "function updateHuitre($id,$nomHuitre,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n\n $target_file = $path . basename($upfile[\"name\"]);\n\n if (isset($_POST[\"submit\"])) \n {\n \n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false) {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n var_dump($target_file);\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=huitres');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n \n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');}\n }\n }", "function modificarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function ActualizarColectivos()\n {\t\n $user = User::where('id', 1)->first();\n \\Auth::loginUsingId($user->id);\n \n $response = $this->json('PATCH', '/colectivo/69', [\n 'empresa' => 'Empresa Rawson S.R.L',\n 'numero' => '2'\n ]);\n\n $response\n ->assertStatus(200);\n $response\n \t\t->assertJsonStructure([\n \t\t\t\t'message',\n \t\t]);\n\n }", "function updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n $target_file = $path . basename($upfile[\"name\"]);\n if (isset($_POST[\"submit\"])) \n {\n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false)\n {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $producers = new ProducerManager();\n $updateProducer = $producers->updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=producers');\n }else{\n $producers = new ProducerManager();\n $newProducer = $producers->newProducer($nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n\n header('location: hbAdmin.php?action=producers');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $producers = new ProducerManager();\n $updateProducer = $producers->updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=producers');\n }else{\n $producers = new ProducerManager();\n $newProducer = $producers->newProducer($nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n\n header('location: hbAdmin.php?action=producers');}\n }\n}", "function modificarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_ime';\n\t\t$this->transaccion='PRE_PAREJE_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_partida_ejecucion','id_partida_ejecucion','int4');\n\t\t$this->setParametro('id_int_comprobante','id_int_comprobante','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('id_presupuesto','id_presupuesto','int4');\n\t\t$this->setParametro('id_partida','id_partida','int4');\n\t\t$this->setParametro('nro_tramite','nro_tramite','varchar');\n\t\t$this->setParametro('tipo_cambio','tipo_cambio','numeric');\n\t\t$this->setParametro('columna_origen','columna_origen','varchar');\n\t\t$this->setParametro('tipo_movimiento','tipo_movimiento','varchar');\n\t\t$this->setParametro('id_partida_ejecucion_fk','id_partida_ejecucion_fk','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha','fecha','date');\n\t\t$this->setParametro('monto_mb','monto_mb','numeric');\n\t\t$this->setParametro('monto','monto','numeric');\n\t\t$this->setParametro('valor_id_origen','valor_id_origen','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function updatePhoto()\n {\n //Intenta subir la foto que viene en el campo 'photo'\n if ($photo = $this->uploadPhoto('photo')) {\n //Modifica el campo photo del usuario y lo intenta actualizar\n $this->photo = $photo;\n return $this->update();\n }\n }", "public function actualizar($id, Request $request){\n\n try {\n\n// $rules = array(\n// 'nombres' => array( 'required', 'string', 'min:10' ),\n// 'apellidos' => array( 'required', 'string', 'min:10' ),\n// 'biografia' => array( 'required', 'string', 'min:50'),\n// 'foto' => array('image','image_size:>=300,>=300')\n// );\n// $this->validate( $request,$rules );\n\n $registro = User::find($id);\n\n// dd($registro);\n\n if(\\Input::get('avatar')){\n $avatar = BRequest::file('foto');\n $extension = $avatar->getClientOriginalExtension();\n $avatar_name = preg_replace('/\\s*/', '', \\Input::get('nombres'));\n $avatar_name = strtolower($avatar_name);\n Storage::disk('image')->put($avatar_name.'.'.$extension, File::get($avatar));\n $registro ->avatar = $avatar_name.'.'.$extension;\n }\n $registro ->name = \\Input::get('nombres');\n\n if(\\Input::get('password')){\n $registro ->password = \\Hash::make(\\Input::get('password'));\n }\n\n $registro ->type = 0;\n $registro ->email = \\Input::get('email');\n $registro ->save();\n\n \\DB::table('role_user')\n ->where('user_id',$registro ->id)\n ->update(['role_id' => \\Input::get('rol')]);\n\n return \\Redirect::route('adminEmpleados')\n ->with('alerta','El integrante ha sido modificado con exito!');\n\n } catch ( ValidationException $e ) {\n\n return \\Redirect::action( 'EquipoCtrl@editar',array('id'=>$id) )\n ->withInput()\n ->withErrors( $e->get_errors() );\n\n }\n\n }", "public function modificar_visibilidad_archivo() {\n $this->load->model('archivo');\n\n //recuperar el ID\n $idAModificar = intval($this->input->post('idArchivo', TRUE));\n\n // validar el ID y verificar que no este vacio\n if (empty($idAModificar) || !$this->archivo->init($idAModificar)) {\n session_redirect(UI_MESSAGE_ERROR, \"No encontramos el archivo que quiere modificar\", site_url(\"admin\"));\n }\n\n //intentar modificar la visibilidad\n if ($this->archivo->modificar_visibilidad()) {\n session_redirect(UI_MESSAGE_OK, \"Se ha modificado la visibilidad del archivo seleccionado\", site_url(\"admin\"));\n } else {\n session_redirect(UI_MESSAGE_ERROR, \"No se ha podido modificar la visibilidad del archivo seleccionado\", site_url(\"admin\"));\n }\n }", "public function update(Request $request, $id_comer)\n {\n $sw1 = 0;\n $rules = [\n 'archi_comer' => 'required',\n 'tipo_comer' => 'required'\n ];\n \n $messages = [\n 'archi_comer.required' => 'El Nombre del Archivo no puede ser nulo',\n 'tipo_comer.required' => 'El Tipo de Archivo no puede ser nulo'\n ];\n\n $this->validate($request, $rules, $messages);\n\n $cc_user = auth()->user()->cc_user;\n// $id_comer = $request->input('id_comer');\n// $id_comer = $id;\n $name = 'parqueos5.jpg';\n\n $comerciales = Comercial::where('id_comer', '=', $id_comer);\n\n if($request->hasFile('archi_comer')){\n $file = $request->file('archi_comer');\n $name = $file->getClientOriginalName();\n $file->move(public_path().'/img/', $name);\n// return $name;\n }\n\n $comerciales->update(['archi_comer'=> $name,\n 'tipo_comer'=> $request->input('tipo_comer')\n ]);\n Session::flash('message','Registro Actualizado Correctamente!');\n Session::flash('class','info');\n\n return Redirect::to('t_comercial/show/'.$id_comer)->with('status','Actualizado Correctamente....!');\n\n }", "function modificarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_ime';\n\t\t$this->transaccion='DIR_EMP_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_empresa','id_empresa','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo_sociedad','tipo_sociedad','varchar');\n\t\t$this->setParametro('objeto','objeto','text');\n\t\t$this->setParametro('dir_comercial','dir_comercial','varchar');\n\t\t$this->setParametro('nit','nit','varchar');\n\t\t$this->setParametro('clase','clase','varchar');\n\t\t$this->setParametro('domicilio','domicilio','text');\n\t\t$this->setParametro('matricula','matricula','int8');\n\t\t$this->setParametro('renovado','renovado','int4');\n\t\t$this->setParametro('domicilio_legal','domicilio_legal','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('seccion','seccion','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('divission','divission','varchar');\n\t\t$this->setParametro('estado_matricula','estado_matricula','varchar');\n\t\t$this->setParametro('mail','mail','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function postCargarInformacion(){\n\t\t$fecha = date(\"Y-d-m H:i:s\");\n\t\t$registro = DB::SELECT(\"SELECT ident_current('MODBID_INFORMACIONPUBLIC') AS [LastID_1]\");\t\t\n\t\t$id_foto = (($registro[0]->LastID_1)+1).\".jpg\";\n\t\t\t\t\n\t\tDB::table('MODBID_INFORMACIONPUBLIC')->insert(\n\t\t \tarray(\n\t\t \t\t'id_usuario' => Auth::user()->id,\t\t \t\t\n\t\t \t\t'titulo' => Input::get('titulo'),\n\t\t \t\t'foto' => $id_foto,\n\t\t \t\t'tipo' => Input::get('tipo'),\n\t\t \t\t'texto' => Input::get('texto'),\t\t\t \t\t\n\t\t \t\t'created_at' => $fecha,\n\t \t\t\t'updated_at' => $fecha,\n\t \t\t\t'fecha_noticia' => Input::get('fecha_info')\n\n\t\t \t)\n\t\t);\n\n\t\t$path_foto = public_path().'/assets/bid/informacion/'.(($registro[0]->LastID_1)+1).\"/\";\n\t\tInput::file('foto')->move($path_foto,$id_foto);\n\t\treturn Redirect::to('vista1_bid')->with('status', 'ok_estatus');\n\t}", "function evt__form_cargo__modificacion($datos)\r\n\t{\r\n $res=0;\r\n if($this->controlador()->dep('datos')->tabla('cargo')->esta_cargada()){//es una modificacion\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n \r\n if(isset($datos['id_puesto'])){\r\n $res=$this->controlador()->dep('datos')->tabla('puesto')->hay_superposicion_con($car['id_cargo'],$datos['id_puesto'],$datos['fec_alta'],$datos['fec_baja']);\r\n }\r\n if($res==1){//hay otro puesto \r\n toba::notificacion()->agregar('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos', 'error'); \r\n }else{\r\n $this->controlador()->dep('datos')->tabla('cargo')->set($datos);\r\n $this->controlador()->dep('datos')->tabla('cargo')->sincronizar(); \r\n }\r\n }else{//es un alta\r\n if(isset($datos['id_puesto'])){\r\n $res=$this->controlador()->dep('datos')->tabla('puesto')->hay_superposicion_con(0,$datos['id_puesto'],$datos['fec_alta'],$datos['fec_baja']); \r\n }\r\n if($res==1){//hay otro puesto \r\n throw new toba_error('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos');\r\n // toba::notificacion()->agregar('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos', 'error'); \r\n }else{\r\n $pers=$this->controlador()->dep('datos')->tabla('persona')->get(); \r\n $datos['generado_x_pase']=0;\r\n $datos['id_persona']=$pers['id_persona'];\r\n $this->controlador()->dep('datos')->tabla('cargo')->set($datos);\r\n $this->controlador()->dep('datos')->tabla('cargo')->sincronizar();\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $cargo['id_cargo']=$car['id_cargo'];\r\n $this->controlador()->dep('datos')->tabla('cargo')->cargar($cargo);\r\n } \r\n }\r\n\t}", "private function aksi_upload_foto_profil_profil_saya($id_admin)\n {\n $config['upload_path'] = './../assets/uploads/admin/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf';\n $config['file_name'] = 'foto_admin-' . date('ymd') . '-' . substr(md5(rand()), 0, 10);\n\n $this->load->library('upload', $config);\n $id_admin = $this->input->post('id_admin');\n\n if (!empty($_FILES['berkas']['name'])) {\n\n if ($this->upload->do_upload('berkas')) {\n\n $uploadData = $this->upload->data();\n\n //Compres Foto\n $config['image_library'] = 'gd2';\n $config['source_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['quality'] = '50%';\n $config['width'] = 600;\n $config['height'] = 400;\n\n $config['new_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n\n $item = $this->db->where('id_admin', $id_admin)->get('admin')->row();\n\n //replace foto lama \n if ($item->foto_profil_admin != \"placeholder_profil.png\") {\n $target_file = './../assets/uploads/admin/' . $item->foto_profil_admin;\n unlink($target_file);\n }\n\n $data['foto_profil_admin'] = $uploadData['file_name'];\n\n $this->db->where('id_admin', $id_admin);\n $this->db->update('admin', $data);\n }\n }\n }", "public function ActualizarPerfilAlumnoC(){\n\n\t\tif(isset($_POST[\"idAl\"])){\n\n\t\t\t$rutaImg = $_POST[\"imgActual\"];\n\n\t\t\tif(isset($_FILES[\"imgAl\"][\"tmp_name\"]) && !empty($_FILES[\"imgAl\"][\"tmp_name\"])){\n\n\t\t\t\tif(!empty($_POST[\"imgActual\"])){\n\n\t\t\t\t\tunlink($_POST[\"imgActual\"]);\n\n\t\t\t\t}\n\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".png\";\n\n\t\t\t\t\t$foto = imagecreatefrompng($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagepng($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".jpg\";\n\n\t\t\t\t\t$foto = imagecreatefromjpeg($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagejpeg($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$tablaBD = \"alumnos\";\n\n\t\t\t$datosC = array(\"id\"=>$_POST[\"idAl\"], \"nombre\"=>$_POST[\"nombreAl\"], \"apellidopaterno\"=>$_POST[\"apellidopaternoAl\"], \"apellidomaterno\"=>$_POST[\"apellidomaternoAl\"], \"noControl\"=>$_POST[\"noControl\"], \"correo\"=>$_POST[\"correoAl\"], \"clave\"=>$_POST[\"claveAl\"], \"foto\"=>$rutaImg);\n\n\t\t\t$resultado = AlumnosM::ActualizarPerfilAlumnoM($tablaBD, $datosC);\n\n\t\t\tif($resultado == true){\n\n\t\t\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\t\t\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/perfil-'.$_SESSION[\"rol\"].'\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\"){\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/alumnos\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function agregar_noticia_controlador(){\n\n\t\t$not_titulo = mainModel::limpiar_cadena($_POST['noticia_titulo']);\n\t\t$not_imagen = mainModel::limpiar_cadena($_FILES['imagen']['name']);\n\t\t$not_drescripcion = mainModel::limpiar_cadena($_POST['descripcion']);\n\t\t$dir = SEVERURL.'assets/imagenes/';\n\n\t\tif ($_FILES['imagen']['size'] > 2000000) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Solo se permiten archivos menores a 2 MB',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}\n\n\t\tif ($_FILES['imagen']['type'] != 'image/png') {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Solo se permiten archivos de tipo imagen',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}\n\n\t\t/*if (!move_uploaded_file($_FILES['imagen']['tmp_name'], $dir.$not_imagen)) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Error al subir archivo',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}*/\n\n\t\t$notDatos = [\n\t\t\t'titulo' => $not_titulo,\n\t\t\t'imagen' => $not_imagen,\n\t\t\t'descripcion' => $not_drescripcion\n\t\t];\n\n\t\t$respuesta = NoticiasModelo::agregar_noticia_modelo($notDatos);\n\n\t\tif ($respuesta->rowCount() >= 1) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'limpiar',\n\t\t\t\t'Titulo'=>'Bien hecho!',\n\t\t\t\t'Texto'=>'La noticia se registró exitosamente',\n\t\t\t\t'Tipo'=>'success'\n\t\t\t];\n\t\t}else{\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'No se pudo registrar la noticia',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\t\t}\n\n\t\treturn mainModel::sweetalert($alerta);\n\n\t}", "function subidaFichero($bd,$usuario,$entrada){\n if(isset($_FILES['imagen']['name']) && strlen ($_FILES['imagen']['name'])>0) {\n $dir_subida = $usuario . \"/\";\n ///////////NO TENGO PERMISOS DE CREAR CARPETAS!!!!!!!\n if ( !is_dir($dir_subida) && is_writable(\"../redsocial\")) {\n mkdir($dir_subida,0755, true);\n }else\n $dir_subida=\"img/\";\n $path = $_FILES['imagen']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION);\n $fichero_subido = $dir_subida . $usuario . date(\"Ymd_Hm\").\".\".$ext;\n /////NO TENGO PERMISOS PARA SUBIR ARCHIVOS!!!!\n if(is_writable($dir_subida)) {\n if (!move_uploaded_file($_FILES['imagen']['tmp_name'], $fichero_subido)) {\n echo \"Problema de ataque de subida de ficheros!.\\n\";\n }\n }\n $imagen = new Imagen(null, $fichero_subido, $entrada->getId());\n $daoImagenes = new Imagenes($bd);\n $daoImagenes->addImagen($imagen, $entrada);\n return $fichero_subido;\n }\n\n}", "public function actualizar(ValidarCertificado $request, $id)\n {\n /*\n $image = $request->file('foto_up');\n $filename = $request->usuario . '.' . $image->getClientOriginalExtension();\n $image->storeAs('public/certificado/usuario',$filename);\n //$request->file('foto_up')->storeAs('public/imagenes/usuario',$request->usuario . '.jpg');\n $request->request->add(['foto' => $filename]);\n $certificado = Certificado::findOrFail($id);\n $certificado->update(array_filter($request->all()));\n */\n \n $certificado = Certificado::findOrFail($id);\n //dd($request->foto_up);\n\n if ($foto = Certificado::setFotoCertificado($request->foto_up,$certificado->foto)){\n $request->request->add(['foto' => $foto]);\n }\n Certificado::findOrFail($id)->update($request->all());\n return redirect('certificado')->with('mensaje','Certificado actualizado con exito');\n }", "public function update(Request $request, $id_permohonan)\n {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n \n if(Session::get('roles') == 2 or Session::get('roles') == 1) {\n // dd(!empty($request->file('krs')));die(); \n if (empty($request->file('krs')) and empty($request->file('bukti_tf')) and empty($request->file('transkip_nilai')))\n {\n $data->krs = $data->krs;\n $data->transkip_nilai = $data->transkip_nilai;\n $data->bukti_tf = $data->bukti_tf;\n }elseif (!empty($request->file('krs'))) {\n unlink('uploads/krs/'.$data->krs); //menghapus file lama\n $krs = $request->file('krs');\n $ext = $krs->getClientOriginalExtension();\n $newName = \"krs \".date('Ymd_his').\".\".$ext;\n $krs->move('uploads/krs',$newName);\n $data->krs = $newName;\n }\n elseif (!empty($request->file('transkip_nilai'))) {\n unlink('uploads/transkip_nilai/'.$data->transkip_nilai); //menghapus file lama\n $transkip_nilai = $request->file('transkip_nilai');\n $ext1 = $transkip_nilai->getClientOriginalExtension();\n $newName1 = \"transkip_nilai \".date('Ymd_his').\".\".$ext1;\n $transkip_nilai->move('uploads/transkip_nilai',$newName1);\n $data->transkip_nilai = $newName1;\n } elseif (!empty($request->file('bukti_tf'))) {\n unlink('uploads/bukti_tf/'.$data->bukti_tf); //menghapus file lama\n $bukti_tf = $request->file('bukti_tf');\n $ext2 = $bukti_tf->getClientOriginalExtension();\n $newName2 = \"bukti_tf \".date('Ymd_his').\".\".$ext2;\n $bukti_tf->move('uploads/bukti_tf',$newName2);\n $data->bukti_tf = $newName2;\n }\n } elseif(Session::get('roles') == 3)\n { \n if(Input::get('Terima'))\n {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 2;\n // $data->save();\n } elseif (Input::get('Tolak')) {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 1;\n // $data->save();\n }\n } elseif(Session::get('roles') == 4)\n { \n if(Input::get('Terima'))\n {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 3;\n // $data->save();\n } elseif (Input::get('Tolak')) {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 1;\n // $data->save();\n }\n }\n $data->save();\n return redirect()->route('permohonan.index')->with('alert-success','Data berhasil diubah!'); \n }", "function alterFotoFisi($conexao, $foto_coment, $foto_nome, $foto_tel, $foto_cel, $foto_cpf, $foto_end, $foto_num, $foto_estado, $foto_cidade, $foto_email, $foto_especi, $foto_img,$foto_emp='', $foto_cep=''){\n\t\techo \"<br/>Dentro do foto_especi: \".print_r($foto_especi).\"<br/>\";\n\n\t\t$sql_update = sprintf(\"\n\t\t\t\tupdate fotografo f, fotografo_fisico fs, localizacao_foto lf\n\t\t\t\tset f.foto_comentario = '%s', f.foto_img_perf = '%s',\n\t\t\t\t fs.foto_fisi_nome = '%s', fs.foto_fisi_tel = '%s', fs.foto_fisi_cel = '%s', fs.foto_fisi_cpf = '%s',\n\t\t\t\t lf.loca_end_foto = '%s',lf.loca_num_foto = '%s', lf.loca_estado_foto = %u, lf.loca_cidade_foto = %u,\n\t\t\t\t fs.foto_fisi_nome_emp = '%s', lf.loca_cep_foto = '%s'\n\t\t\t\twhere f.foto_cod = fs.foto_cod\n\t\t\t\tand f.foto_cod\t = lf.foto_cod\n\t\t\t\tand fs.foto_fisi_email = '%s' \", $foto_coment, $foto_img,$foto_nome, $foto_tel, $foto_cel, $foto_cpf, $foto_end, $foto_num, $foto_estado, $foto_cidade, $foto_emp, $foto_cep, $foto_email);\n\t\t$resultado_update = mysqli_query($conexao, $sql_update) or die(mysqli_error($conexao).\"<br/>\".$sql_update);\n\t\t$resulUpEspeci \t = atualizarEspecialidadeFotografo($conexao,$foto_email,$foto_especi);\n\n\t\tif($resultado_update){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t}", "function modificarFactura(){\r\n\t\t$this->procedimiento='tesor.ft_factura_ime';\r\n\t\t$this->transaccion='TSR_FAC_MOD';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('nro_factura','nro_factura','int4');\r\n\t\t$this->setParametro('nombre_emisor','nombre_emisor','varchar');\r\n\t\t$this->setParametro('domicilio_emisor','domicilio_emisor','varchar');\r\n\t\t$this->setParametro('nit_emisor','nit_emisor','int4');\r\n\t\t$this->setParametro('nombre_cliente','nombre_cliente','varchar');\r\n\t\t$this->setParametro('domicilio_cliente','domicilio_cliente','varchar');\r\n\t\t$this->setParametro('nit_cliente','nit_cliente','int4');\t\t\r\n\t\t$this->setParametro('fecha_emision','fecha_emision','date');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('banco','banco','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t\r\n\t\t$parametros = $this->aParam->getArregloParametros('asignacion');\r\n\t\t//si esdel tipo matriz verifica en la primera posicion el tipo de vista\r\n\t\tif($this->esMatriz){\r\n\t\t $tipo_operacion =$parametros[0]['tipo_operacion'];\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$tipo_operacion =$parametros['tipo_operacion'];\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif($tipo_operacion=='asignacion'){\r\n\t\t $this->transaccion='tgv_SERVIC_MOD';\r\n } \r\n elseif($tipo_operacion=='cambiar_estado'){ \r\n\t\t $this->transaccion='tgv_SERCAMEST_MOD';\r\n\t\t $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\telseif ($tipo_operacion=='def_fechas'){ \r\n\t\t $this->transaccion='tgv_DEFFECHA_MOD';\r\n\t\t // $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\t\t$this->setParametro('estado','estado','varchar');\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('id_lugar_destino','id_lugar_destino','int4');\r\n\t\t$this->setParametro('id_ep','id_ep','int4');\r\n\t\t$this->setParametro('fecha_asig_fin','fecha_asig_fin','date');\r\n\t\t$this->setParametro('fecha_sol_ini','fecha_sol_ini','date');\r\n\t\t$this->setParametro('descripcion','descripcion','varchar');\r\n\t\t$this->setParametro('id_lugar_origen','id_lugar_origen','int4');\r\n\t\t$this->setParametro('cant_personas','cant_personas','int4');\r\n\t\t$this->setParametro('fecha_sol_fin','fecha_sol_fin','date');\r\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\r\n\t\t$this->setParametro('fecha_asig_ini','fecha_asig_ini','date');\r\n\t\t$this->setParametro('id_funcionario_autoriz','id_funcionario_autoriz','int4');\r\n\t\t$this->setParametro('observaciones','observaciones','varchar');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function modificarReenvioFactura(){\n\t\t$this->procedimiento='vef.ft_reenvio_factura_ime';\n\t\t$this->transaccion='VF_REFACOR_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_reenvio_factura','id_reenvio_factura','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_venta','id_venta','int4');\n\t\t$this->setParametro('correo','correo','varchar');\n\t\t$this->setParametro('observacion','observacion','text');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function procesar_foto()\n {\n $image = file_get_contents($_FILES['imagen']['tmp_name']);\n $id_carro = $_POST['id_carro'];\n $numero_foto = $_POST['img_number'];\n\n file_put_contents('/home2/gpautos/sv_gpautos/web/images_cont/' . $id_carro . ' (' . $numero_foto . ').jpg', $image);\n }", "public function update(UpdateUserRequest $request, User $user)\n {\n $this->authorize('update', $user);\n if(Input::hasFile('photo')){\n $file=Input::file('photo');\n if($user->type=='Empleado'){\n $file->move(public_path().'/images/employees/',$file->getClientOriginalName());\n }elseif($user->type=='Proveedor'){\n $file->move(public_path().'/images/providers/',$file->getClientOriginalName());\n }else{\n $file->move(public_path().'/images/customers/',$file->getClientOriginalName());\n }\n $user->photo=$file->getClientOriginalName();\n }\n $user->name=$request->get('name');\n $user->last_name=$request->get('last_name');\n $user->sex=$request->get('sex');\n $user->nationality=$request->get('nationality');\n $user->address=$request->get('address');\n $user->phone=$request->get('phone');\n $user->email=$request->get('email');\n $user->update($request->validated());\n\n $bitacora = new Bitacora();\n $bitacora->user = Auth::user()->name;\n $bitacora->last_name = Auth::user()->last_name;\n $bitacora->action = 'Editó un usuario';\n $now=Carbon::now('America/La_Paz');\n $bitacora->date =$now->toDateTimeString();\n $bitacora->hour =$now->toDateTimeString();\n $bitacora->save();\n\n if ($user->hasRole('Cliente')){\n return redirect()->route('admin.customers.index')->withFlash('Cliente actualizado');\n }elseif ($user->hasRole('Administrador') || $user->hasRole('Empleado') || $user->hasRole('Encargado de almacen') || $user->hasRole('Limpieza')){\n return redirect()->route('admin.employees.index')->withFlash('Empleado actualizado');\n }elseif ($user->hasRole('Proveedor')){\n return redirect()->route('admin.providers.index')->withFlash('Usuario actualizado');\n }\n\n }", "public function altPerfil()\n {\n $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT);\n if (!empty($this->Dados['EditPerfil']))\n {\n unset($this->Dados['EditPerfil']);\n //var_dump($this->Dados);\n\n $this->Dados['imagem'] = ($_FILES['imagem'] ? $_FILES['imagem'] : null);\n $altPerfilBd = new AdmsEditarPerfil();\n $altPerfilBd->altPerfil($this->Dados);\n if ($altPerfilBd->getResultado()) {\n\n $UrlDestino = URLADM . 'ver-perfil/perfil';\n header(\"Location: $UrlDestino\");\n\n } else {\n\n $this->Dados['form'] = $this->Dados;\n $this->altPerfilPriv();\n\n }\n\n }\n else {\n\n $verPerfil = new AdmsVerPerfil();\n $this->Dados['form'] = $verPerfil->verPerfil();\n $this->altPerfilPriv();\n\n\n }\n\n\n }", "function modificarConceptoCta(){\n\t\t$this->procedimiento='pre.f_concepto_cta_ime';\n\t\t$this->transaccion='PRE_CCTA_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_concepto_cta','id_concepto_cta','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_auxiliar','id_auxiliar','int4');\n\t\t$this->setParametro('id_cuenta','id_cuenta','int4');\n\t\t$this->setParametro('id_concepto_ingas','id_concepto_ingas','int4');\n\t\t$this->setParametro('id_partida','id_partida','int4');\n\t\t$this->setParametro('id_centro_costo','id_centro_costo','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function updatePhoto(Request $request)\n {\n// 'photo' => 'required', // required| SEPONE ESTO mimes:jpeg,bmp,png'\n// 'apodo'=>'required',\n// 'altura'=>'required',\n// 'peso'=>'required',\n// 'pie_dominante'=>'required'\n// ]);\n\n $token=$request->get('api_token');\n $jugador=DB::table('jugador')\n ->select('id_jugador')\n ->where('api_token','=',$token)\n ->get();\n\n $datos = Jugador::find($jugador[0]->id_jugador);\n\n// OPC Foto\n $file = $request->get('img');\n $publicId=\"fotoPerfil\".$jugador[0]->id_jugador;\n if(Cloudder::upload(\"data:image/png;base64,\".$file,$publicId,array(\"width\" => 250, \"height\" => 250))){\n $datos->tiene_imagen=1;\n $datos->update();\n return response()->json(['success' => true]);\n }else{\n return response()->json(['success' => false]);\n }\n\n }", "public function editAction(Request $request, Annonce_appart $annonce_appart) {\n $user = $this->getUser();\n $deleteForm = $this->createDeleteForm($annonce_appart);\n $editForm = $this->createForm('ImmoNotaire\\ImmoAnnonceBundle\\Form\\Annonce_appartType', $annonce_appart);\n $editForm->handleRequest($request);\n\n $em = $this->getDoctrine()->getManager();\n\n $pubs = $em->getRepository(\"PubliciteBundle:Publicite\")->findAll();\n // var_dump($annonce);\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n\n\n if ($annonce_appart->getAnnonce()->getMedia()->getFile() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile($request->get('file'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file */\n //die('file1');\n $file = $annonce_appart->getAnnonce()->getMedia()->getFile();\n $img = md5(uniqid()) . '.' . $file->guessExtension();\n $file->move($this->getParameter('image_annonce'), $img);\n $annonce_appart->getAnnonce()->getMedia()->setFile($img);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile1() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile1($request->get('file1'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file1 */\n //die('file1');\n $file1 = $annonce_appart->getAnnonce()->getMedia()->getFile1();\n $img1 = md5(uniqid()) . '.' . $file1->guessExtension();\n $file1->move($this->getParameter('image_annonce'), $img1);\n $annonce_appart->getAnnonce()->getMedia()->setFile1($img1);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile2() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile2($request->get('file2'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file2 */\n $file2 = $annonce_appart->getAnnonce()->getMedia()->getFile2();\n $img2 = md5(uniqid()) . '.' . $file2->guessExtension();\n $file2->move($this->getParameter('image_annonce'), $img2);\n $annonce_appart->getAnnonce()->getMedia()->setFile2($img2);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile3() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile3($request->get('file3'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file3 */\n $file3 = $annonce_appart->getAnnonce()->getMedia()->getFile3();\n $img3 = md5(uniqid()) . '.' . $file3->guessExtension();\n $file3->move($this->getParameter('image_annonce'), $img3);\n $annonce_appart->getAnnonce()->getMedia()->setFile3($img3);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile4() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile4($request->get('file4'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file4 */\n $file4 = $annonce_appart->getAnnonce()->getMedia()->getFile4();\n $img4 = md5(uniqid()) . '.' . $file4->guessExtension();\n $file4->move($this->getParameter('image_annonce'), $img4);\n $annonce_appart->getAnnonce()->getMedia()->setFile4($img4);\n }\n\n $em->flush();\n\n $modif = new Notification();\n $modif->setType(\"appartement\");\n $modif->setAction(\"modification\");\n $modif->setUser($user);\n\n $em->persist($modif);\n $em->flush();\n $session = new session();\n $session->getFlashBag()->add('info', \"L'annonce a bien été modifié\");\n\n return $this->redirectToRoute('immo_notaire_self_annonce_archive');\n }\n\n return $this->render('annonce_appart/edit.html.twig', array(\n 'annonce_appart' => $annonce_appart,\n 'form' => $editForm->createView(),\n 'user' => $user,\n 'pubs' => $pubs,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function cambiarFoto(Request $request){\n Validator::make($request->all(), [\n 'foto' => 'required|image|max:1024',\n ])->validate();\n\n //obtenemos el campo file definido en el formulario\n $foto = $request->file('foto');\n\n //obtenemos el nombre del archivo\n $nombre = time().$foto->getClientOriginalName();\n\n //obtenemos el usuario a editar\n $usuario = Usuario::find(Auth::user()->id);\n\n // verificamos que el usuario no tenga una imagen ya guardada.\n if ($usuario->foto == 'usuario.png') {\n\n //si la imagen es por defecto, la cambiamos.\n }else{\n\n //Si ya tenia una imagen personalizada, primero borramos esa imagen.\n \\Storage::disk('usuarios')->delete($usuario->foto);\n }\n $usuario->foto = $nombre;\n $usuario->save();\n\n //indicamos que queremos guardar un nuevo archivo en el disco local\n \\Storage::disk('usuarios')->put($nombre, \\File::get($foto));\n\n return redirect('editar-usuario')->with('correcto', 'SU FOTO FUE ACTUALIZADA.');\n }", "function modificar($Id_Pedido = 0, $tipo = '')\r\n\t{\r\n\t\t$Permitido = array('Gerencia' => '', 'Plani' => '', 'Sistemas' => '', 'Ventas' => '');\r\n\t\t$this->ver_sesion_m->acceso($Permitido);\r\n\t\t\r\n\t\t$Id_Pedido += 0;\r\n\t\tif(0 == $Id_Pedido)\r\n\t\t{\r\n\t\t\tshow_404();\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t//Extraemos toda la informacion del proceso\r\n\t\t$this->load->model('procesos/buscar_proceso_m', 'buscar_proc');\r\n\t\t$Info_Proceso = $this->buscar_proc->busqueda_pedido($Id_Pedido);\r\n\t\t\r\n\t\tif(0 == $Info_Proceso)\r\n\t\t{\r\n\t\t\tshow_404();\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Si es un cliente, no debe ver cosas prohibidas\r\n\t\t$this->ver_sesion_m->solo_un_cliente(\r\n\t\t\t$Info_Proceso['id_cliente']\r\n\t\t);\r\n\t\t\r\n\t\t//Validacion: Solo los pedidos que estan en proceso pueden ser modificados\r\n\t\t//en sus especificaciones\r\n\t\t//Modelo que verifica si tiene ruta sin finalizar este proceso\r\n\t\t$this->load->model('pedidos/procesando_m', 'procesando');\r\n\t\t//Se realiza la verificacion\r\n\t\t$Estado = $this->procesando->pedido($Id_Pedido);\r\n\t\t\r\n\t\t\r\n\t\t//Especificaciones del pedido a modificar\r\n\t\t$this->load->model('pedidos/especificacion_informacion_m', 'esp_inf');\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Listado de los materiales recibidos y solicitados\r\n\t\t$this->load->model('pedidos/materiales_m', 'materiales');\r\n\t\t$Materiales['recibido'] = $this->materiales->recibidos_id('s');\r\n\t\t$Materiales['solicitado'] = $this->materiales->solicitados_id('s');\r\n\t\t\r\n\t\t/*\r\n\t\t$this->load->model('pedidos/enlaces_m', 'enlace');\r\n\t\t$Es_Hijo = $this->enlace->es_hijo($Id_Pedido);\r\n\t\t\r\n\t\t\r\n\t\t//Es este pedido hijo de otro?\r\n\t\t\r\n\t\tif(0 == $Es_Hijo)\r\n\t\t{\r\n\t\t\t*/\r\n\t\t\t$Especs = $this->esp_inf->pedido($Id_Pedido);\r\n\t\t\t/*\r\n\t\t\t//Listado de los tipos de acabados\r\n\t\t\t$this->load->model('pedidos/impresion_digital_m', 'matdigi');\r\n\t\t\t$Tipo_Acabado = $this->matdigi->tipo_impd_acabado();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$Especs = $this->esp_inf->pedido(\r\n\t\t\t\t$Id_Pedido,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'matrecgru' => array(),\r\n\t\t\t\t\t'matsolgru' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t//print_r($Especs);\r\n\t\t\t$Tipo_Acabado = array();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(isset($Es_Hijo['id_pedido_pedido']))\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$Especs = $this->esp_inf->pedido(\r\n\t\t\t\t$Es_Hijo['id_ped_primario'],\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'general' => array(),\r\n\t\t\t\t\t'colores' => array(),\r\n\t\t\t\t\t'distorsion' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t//Modificacion de las especificaciones\r\n\t\t\t$this->load->model('pedidos/especificacion_modificar_m', 'esp_modi');\r\n\t\t\t$this->esp_modi->modificar(\r\n\t\t\t\t$Es_Hijo['id_ped_primario'],\r\n\t\t\t\t$Especs,\r\n\t\t\t\tarray('recibido' => array(), 'solicitado' => array()),\r\n\t\t\t\tarray()\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$Especs = $this->esp_inf->pedido(\r\n\t\t\t\t$Id_Pedido,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'matrecgru' => array(),\r\n\t\t\t\t\t'matsolgru' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t//Modificacion de las especificaciones\r\n\t\t$this->load->model('pedidos/especificacion_modificar_m', 'esp_modi');\r\n\t\t$this->esp_modi->modificar(\r\n\t\t\t$Id_Pedido,\r\n\t\t\t$Especs,\r\n\t\t\t$Materiales\r\n\t\t);\r\n\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\tif('Ventas' != $this->session->userdata('codigo'))\r\n\t\t{\r\n\t\t\tif($tipo == 'm')\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/administrar/info/'.$Info_Proceso['id_proceso']);\r\n\t\t\t}\r\n\t\t\telseif($tipo == 'l')\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/preingreso/estado/Pendientes');\r\n\t\t\t}\r\n\t\t\telseif($tipo == 'i')\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/modificar/index/'.$Id_Pedido.'/i');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/modificar/index/'.$Id_Pedido);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif('' != $this->session->userdata('id_cliente'))\r\n\t\t\t{\r\n\t\t\t\theader('location: /ventas/v_preingreso/pendientes');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/preingreso/estado/Pendientes');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function update(Request $request, $id)\n {\n $prespel = Respel::where('ID_Respel', $id)->first();\n if (!$prespel) {\n abort(404);\n }\n if (isset($request['RespelHojaSeguridad'])) {\n if($prespel->RespelHojaSeguridad <> null && file_exists(public_path().'/img/HojaSeguridad/'.$prespel->RespelHojaSeguridad)){\n // unlink(public_path().'/img/HojaSeguridad/'.$prespel->RespelHojaSeguridad);\n }\n $file1 = $request['RespelHojaSeguridad'];\n $hoja = hash('sha256', rand().time().$file1->getClientOriginalName()).'.pdf';\n $file1->move(public_path().'/img/HojaSeguridad/',$hoja);\n }\n else{\n $hoja = $prespel->RespelHojaSeguridad;\n }\n\n /*verificar si se cargo un documento en este campo*/\n if (isset($request['RespelTarj'])) {\n if($prespel->RespelTarj <> null && file_exists(public_path().'/img/TarjetaEmergencia/'.$prespel->RespelTarj)){\n // unlink(public_path().'/img/TarjetaEmergencia/'.$prespel->RespelTarj);\n }\n $file2 = $request['RespelTarj'];\n $tarj = hash('sha256', rand().time().$file2->getClientOriginalName()).'.pdf';\n $file2->move(public_path().'/img/TarjetaEmergencia/',$tarj);\n }else{\n $tarj = $prespel->RespelTarj;\n }\n\n /*verificar si se cargo un documento en este campo*/\n if (isset($request['RespelFoto'])) {\n if($prespel->RespelFoto <> null && file_exists(public_path().'/img/fotoRespelCreate/'.$prespel->RespelFoto)){\n // unlink(public_path().'/img/fotoRespelCreate/'.$prespel->RespelFoto);\n }\n $file3 = $request['RespelFoto'];\n $foto = hash('sha256', rand().time().$file3->getClientOriginalName()).'.png';\n $file3->move(public_path().'/img/fotoRespelCreate/',$foto);\n }else{\n $foto = $prespel->RespelFoto;\n }\n \n /*verificar si se cargo un documento en este campo*/\n if (isset($request['SustanciaControladaDocumento'])) {\n if($prespel->SustanciaControladaDocumento <> null && file_exists(public_path().'/img/SustanciaControlDoc/'.$prespel->SustanciaControladaDocumento)){\n // unlink(public_path().'/img/SustanciaControlDoc/'.$prespel->SustanciaControladaDocumento);\n }\n $file4 = $request['SustanciaControladaDocumento'];\n $ctrlDoc = hash('sha256', rand().time().$file4->getClientOriginalName()).'.pdf';\n $file4->move(public_path().'/img/SustanciaControlDoc/',$ctrlDoc);\n }else{\n $ctrlDoc = $prespel->SustanciaControladaDocumento;\n }\n $prespel->RespelStatus = \"Pendiente\";\n // $prespel->RespelStatus = $request['RespelStatus'];\n $prespel->RespelName = $request['RespelName'];\n $prespel->RespelDescrip = $request['RespelDescrip'];\n $prespel->RespelIgrosidad = $request['RespelIgrosidad'];\n $prespel->YRespelClasf4741 = $request['YRespelClasf4741'];\n $prespel->ARespelClasf4741 = $request['ARespelClasf4741'];\n $prespel->RespelEstado = $request['RespelEstado'];\n $prespel->SustanciaControlada = $request['SustanciaControlada'];\n $prespel->SustanciaControladaTipo = $request['SustanciaControladaTipo'];\n $prespel->SustanciaControladaNombre = $request['SustanciaControladaNombre'];\n $prespel->RespelHojaSeguridad = $hoja;\n $prespel->RespelTarj = $tarj;\n $prespel->RespelFoto = $foto;\n $prespel->SustanciaControladaDocumento = $ctrlDoc;\n $prespel->RespelPublic = 1;\n $prespel->RespelDeclaracion = $request['RespelDeclaracion'];\n $prespel->FK_SubCategoryRP = $request['FK_SubCategoryRP'];\n $prespel->update();\n\n $log = new audit();\n $log->AuditTabla=\"respelpublic\";\n $log->AuditType=\"Modificado\";\n $log->AuditRegistro=$prespel->ID_Respel;\n $log->AuditUser=Auth::user()->email;\n $log->Auditlog=json_encode($request->all());\n $log->save();\n \n return redirect()->route('respelspublic.index');\n }", "public function getUpdatetoRevisado() {\n\n $id_boleta = \"\";\n $destino = \"\";\n $nombre = \"\";\n $time = \"\";\n $fecha = \"\";\n\n $id_boleta = $_POST['id_boleta'];\n\n $target_dir = \"public/uploads/recibos/\";\n\n opendir($target_dir);\n\n $destino = $target_dir.$_FILES['archivo']['name'];\n\n copy($_FILES['archivo']['tmp_name'], $destino);\n\n echo '<div class=\"notification success\" style=\"\"><div></div><p><span>LISTO:</span> El archivo se ha cargado correctamente.</p></div>';\n\n $nombre = $_FILES['archivo']['name'];\n\n\n $time = date(\"H:i:s\", time());\n $fecha = date(\"y-m-d\");\n\n $sql_model = \"\";\n\n $sql_model = \"UPDATE recibos SET estado = 'REVISADA', archivo='$nombre', horarevision = '$time', fecharevision = '$fecha' WHERE id_boleta = \".$id_boleta;\n\n $query = $this->db->prepare($sql_model);\n $inserted=$query->execute();\n\n if ($inserted) {\n\n return true;\n } else {\n\n return false;\n }\n }", "function saveEditPerfil(){\n\t\t$cont = $this->dper->getContadorPerfilByNombre($this->nombre);\n\t\tif($cont == 0){\n\t\t\t$r = $this->dper->updatePerfil($this->id,$this->nombre);\n\t\t\tif($r=='true'){\n\t\t\t\t$msg = PERFIL_EDITADO;\n\t\t\t}else{\n\t\t\t\t$msg = ERROR_EDIT_PERFIL;\n\t\t\t}\n\t\t}else{\n\t\t\t$msg = ERROR_EDIT_PERFIL;\n\t\t}\n\t\treturn $msg;\n\t}", "static public function ctrCrearMarca()\n {\n\n if (isset($_POST[\"ingNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \"nombre\" => $_POST[\"ingNomMarca\"] );\n $ruta = \"\";\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, true);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n\n if (isset($_FILES[\"ingfotoMarca\"][\"tmp_name\"])) {\n\n list($ancho, $alto) = getimagesize($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Crear directorio donde se guardaran las imagenes\n $directorio = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"];\n mkdir($directorio, 0755);\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"ingfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"ingfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n }\n\n $datos += [\"foto\" => $ruta];\n\n $ingresar = ModeloMarca::mdlCrearMarca($tabla, $datos);\n return $ingresar;\n }\n }\n }", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function ctrCrearInversion(){\n\t\tif(isset($_POST[\"idUsuarioInversion\"])){\n\n\t\t\t\n\t\t\tif(isset($_FILES[\"soporteimg\"][\"tmp_name\"]) && !empty($_FILES[\"soporteimg\"][\"tmp_name\"])){\n\n\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"soporteimg\"][\"tmp_name\"]);\n\n\t\t\t\t$nuevoAncho = 1500;\n\t\t\t\t$nuevoAlto = 1500;\n\t\t\t\t/*=============================================\n\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t=============================================*/\n\t\t\t\tdate_default_timezone_set(\"America/Bogota\");\n\t\t\t\t$fecha_img = date(\"d\").\"_\".date(\"m\").\"_\".date(\"y\").\"_\".date(\"h\").\"_\".date(\"i\").\"_\".date(\"s\").\"_\".date(\"a\"); \n\n\t\t\t\t$directorio_inv = \"views/img/inversion/\".$_POST[\"idUsuarioInversion\"];\n\n\t\t\t\tif(!file_exists($directorio_inv)){\t\n\n\t\t\t\t\tmkdir($directorio_inv, 0755);\n\n\t\t\t\t}\n\n\t\t\t\t//echo $directorio_inv;\n\t\t\t\t/*=============================================\n\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($_FILES[\"soporteimg\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio_inv.\"/\".$aleatorio.\"_\".$fecha_img.\".jpg\";\n\n\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"soporteimg\"][\"tmp_name\"]);\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\timagejpeg($destino, $ruta);\t\n\n\n\t\t\t\t}else if($_FILES[\"soporteimg\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio_inv.\"/\".$aleatorio.\"_\".$fecha_img.\".png\";\n\n\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"soporteimg\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\t\n\n\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\n\t\t\t\t\timagesavealpha($destino, TRUE);\t\t\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\t\t\n\n\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\t\t \ttext: \"¡No se permiten formatos diferentes a JPG y/o PNG invsersion!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t\t/* espacio para insertar datos en la tabla */\n\t\t\t\t$tabla = \"sol_inversion\";\n\t\t\t\t$fecha_solictud= substr(date(\"c\"), 0, -6);\n\t\t\t\t$plan = $_POST[\"options\"];\n\t\t\t\t//$fecha_fin = substr(date(\"c\") + $plan, 0, -6).\"Z\";\n\n\n\t\t\t\t$fechaInicial = substr($fecha_solictud,0,-10);\n\t\t\t\t$fechaVencimiento = strtotime('+'.$plan.' days', strtotime($fechaInicial) );\n\t\t\t\t$vencimiento = date(\"Y-m-d\", $fechaVencimiento);\n\n\n\t\t\t/*\t$datos_inv = array(\"fecha_solicitud\" => $fecha_solictud ,\n\t\t\t\t\"id_usuario\" => $_POST[\"idUsuarioInversion\"] ,\n\t\t\t\t\"email_fondos\" => $_POST[\"email_fondo\"],\n\t\t\t\t\"monto\" => $_POST[\"monto\"],\n\t\t\t\t\"plan_inversion\" => $plan,\n\t\t\t\t\"fecha_final\" => $vencimiento,\n\t\t\t\t\"soporte\" => $ruta,\n\t\t\t\t\"estado\" => \"1\",\n\t\t\t\t\"fecha_apobacion\" =>\"\",\n\t\t\t\t\"id_user_aprobo\" =>\"\",\n\t\t\t\t\"observacion\" =>\"\"); */\n\n\t\t\t$datos_inv = array(\"fecha_solicitud\" => $fecha_solictud ,\n\t\t\t\t\t\t\"id_usuario\" => $_POST[\"idUsuarioInversion\"] ,\n\t\t\t\t\t\t\"email_fondos\" => $_POST[\"email_fondo\"] ,\n\t\t\t\t\t\t\"monto\" => $_POST[\"monto\"] ,\n\t\t\t\t\t\t\"plan_inversion\" => $plan ,\n\t\t\t\t\t\t\"fecha_final\" => $vencimiento ,\n\t\t\t\t\t\t\"soporte\" => $ruta ,\n\t\t\t\t\t\t\"estado\" => \"1\" ,\n\t\t\t\t\t\t\"fecha_apobacion\" => NULL ,\n\t\t\t\t\t\t\"id_user_aprobo\" => NULL ,\n\t\t\t\t\t\t\"observacion\" => NULL );\n\n\t\t\t\t//echo '<pre>'; print_r($datos_inv); echo '</pre>';\n\n\t\t\t\t$respuesta = UserModel::mdlRegistroInversion($tabla, $datos_inv);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tVerificación Correo Electrónico\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$elcorreo = $_POST[\"email_fondo\"];\n\t\t\t\t\t\t//$rutainv = RouteController::ctrRoute();\n\n\t\t\t\t\t\tdate_default_timezone_set(\"America/Bogota\");\n\n\t\t\t\t\t\t$mail = new PHPMailer;\n\n\t\t\t\t\t\t$mail->Charset = \"UTF-8\";\n\n\t\t\t\t\t\t$mail->isMail();\n\n\t\t\t\t\t\t$mail->setFrom(\"info@valientesdigitales.com.co\", \"Valientes Digitales\");\n\n\t\t\t\t\t\t$mail->addReplyTo(\"info@valientesdigitales.com.co\", \"Valientes Digitales\");\n\n\t\t\t\t\t\t$mail->Subject = \"Solicitud de inversion programa capitalVAD\";\n\n\t\t\t\t\t\t$mail->addAddress($elcorreo);\n\n\t\t\t\t\t\t$mail->msgHTML('<div style=\"width:100%; background:#eee; position:relative; font-family:sans-serif; padding-bottom:40px\">\n\t\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<img style=\"padding:20px; width:10%\" src=\"http://capital.valientesdigitales.com.co/views/img/logo.png\">\n\n\t\t\t\t\t\t</center>\n\n\t\t\t\t\t\t<div style=\"position:relative; margin:auto; width:600px; background:white; padding:20px\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<center>\n\n\t\t\t\t\t\t\t\t<img style=\"padding:20px; width:15%\" src=\"http://capital.valientesdigitales.com.co/views/img/logo.png\">\n\n\t\t\t\t\t\t\t\t<h3 style=\"font-weight:100; color:#999\">SOLICITUD DE INVERSION EN CAPITALVAD</h3>\n\n\t\t\t\t\t\t\t\t<hr style=\"border:1px solid #ccc; width:80%\">\n\n\t\t\t\t\t\t\t\t<h4 style=\"font-weight:100; color:#999; padding:0 20px\">Nuestros colaboradores est&aacute;n verificando su transferencia, por favor espere la aprobaci&oacute;n. Esta puede tardar hasta tres días h&aacute;biles.</h4>\n\n\t\t\t\t\t\t\t\t<a href=\"http://capital.valientesdigitales.com.co\" target=\"_blank\" style=\"text-decoration:none\">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div style=\"line-height:60px; background:#0aa; width:60%; color:white\">Monto de inverion de \"'.$_POST[\"monto\"] .'\" USD, Con un plazo de \"'.$plan.'\" dias.</div>\n\n\t\t\t\t\t\t\t\t</a>\n\n\t\t\t\t\t\t\t\t<br>\n\n\t\t\t\t\t\t\t\t<hr style=\"border:1px solid #ccc; width:80%\">\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t</center>\t\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$envio = $mail->Send();\n\n\t\t\t\t\t\tif(!$envio){\n\n\t\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t\ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t\ttext: \"¡¡Ha ocurrido un problema enviando verificación de correo electrónico a '.$elcorreo.' '.$mail->ErrorInfo.', por favor inténtelo nuevamente\",\n\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t\t</script>';\n\n\n\t\t\t\t\t\t}else{\n\n\n\t\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\t\t\ttitle: \"¡SU SOLICITUD HA SIDO ENVIADA!\",\n\t\t\t\t\t\t\t\t\ttext: \"¡Por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico al igual que en la opcion de Inversiones / Historico ver el estado de la solicitud!\",\n\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t\t</script>';\n\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t} // fin swl if que valida para enviar el mail\n\n\t\t\t\t/* Fin de la insercion de datos de la tabla*/\n\n\n\n\t\t\t}// fin del if interno donde pregunta por el file\n\t\t}// fin del primer if donde pregunta si se envio el id del usuario\t\t\n\t}", "private function modificarCita(){\n $query = \"UPDATE \" . $this->table . \" SET PacienteId ='\" . $this->idpaciente . \"',Fecha = '\" . $this->fecha . \"', HoraInicio = '\" . $this->horarioIn . \"', HoraFin = '\" .\n $this->horarioFn . \"', Motivo = '\" . $this->motivo . \"' WHERE CitaId = '\" . $this->idcita . \"'\"; \n $resp = parent::nonQuery($query);\n if($resp >= 1){\n return $resp;\n }else{\n return 0;\n }\n }", "public function actualizar(){\n\textract($_REQUEST);\n\t$db=new clasedb();\n\t$conex=$db->conectar();//conectando con la base de datos\n\n\t$sql=\"SELECT * FROM usuarios WHERE correo='\".$correo.\"' AND id!=\".$_SESSION['id_usuario'];;\n\t$res=mysqli_query($conex,$sql);\n\t$cuantos=mysqli_num_rows($res);\n\t//echo $cuantos;\n\tif ($cuantos>0) {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\talert(\"Ya existe un usuario con este correo\");\n\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t</script>\n\t\t\t<?php\n\n\t\t}else{\n\t\t\n\t\t\t$sql=\"UPDATE usuarios SET nombre='\".$nombre.\"', correo='\".$correo.\"', pregunta='\".$pregunta.\"',respuesta='\".$respuesta.\"' WHERE usuarios.id=\".$_SESSION['id_usuario'];;\n\n\n\t\t\t$res=mysqli_query($conex,$sql);\n\t\t\tif ($res) {\n\t\t\t\t$sql=\"INSERT INTO auditoria VALUES (NULL, '\".$_SESSION['id_usuario'].\"', 'modificó perfil', 'usuarios', CURRENT_TIMESTAMP, '\".$_SESSION['tipo_usuario'].\"')\";\n\n\t\t $resultado=mysqli_query($conex,$sql);\n ?>\n\t\t\t\t\t\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\talert(\"Registro modificado\");\n\t\t\t\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\talert(\"Error al modificar el registro\");\n\t\t\t\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\t\t\t\n\t\t\t\n\t\n\t}\n}", "public function update(Request $request, User $usuario)\n {\n try{\n $this->authorize($usuario);\n\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string|max:255',\n //'email' => [\n // 'required',\n // 'string',\n // 'email',\n // 'max:255',\n // Rule::unique('users')->ignore($usuario->id)\n //],\n 'email' => 'required|string|email|max:255|unique:users,email,'.$usuario->id,\n 'role_id' => 'required|integer|exists:roles,id',\n 'perfiles' => 'required|array|min:1|exists:perfiles,id'\n ],[\n 'email.required' => 'el campo correo es awebo',\n 'email.unique' => 'ese correo ya esta en uso.',\n 'name.required' => 'el nombre es obligatorio',\n 'role_id.required' => 'el rol es awebo',\n 'role_id.exists' => 'el rol no existe',\n 'perfiles.required' => 'los perfiles son necesarios.',\n 'perfiles.min' => 'mínimo es un perfil.',\n 'perfiles.exists' => 'ese perfil no esta registrado'\n ]);\n\n if ($validator->fails()){\n\n return redirect()->back()->withErrors($validator)->withInput();\n }\n $data = $request->except('_token','_method');\n\n $usuario->update($data);\n $usuario->perfiles()->sync($data['perfiles']);\n //$usuario->perfiles()->detach();\n //\n //foreach ($data['perfiles'] as $perfil)\n //{\n // $usuario->perfiles()->attach($perfil);\n //}\n\n return redirect()->route('usuarios.index')\n ->with('info','el usuario fue editado correctamente :)');\n\n }catch(AuthorizationException $e){\n return redirect()->route('usuarios.show',$usuario->id)->with('error',$e->getMessage());\n }\n\n }", "public function update(Request $request,$id)\n {\n $usuario = User::find($id);\n if(isset($request->foto))\n {\n if($usuario->foto!=\"fotoperfil/perfilDefault.jpg\"){\n Storage::delete($usuario->foto);//Elimino foto anterior\n }\n $foto = $request->file('foto')->store('fotoperfil');//subo foto nueva\n if(session()->get('user_id')==$id){\n session()->put('foto','storage/app/'.$foto);\n }\n $usuario->update([\"foto\"=>$foto]);\n echo $foto;\n }else{\n $idrol = $usuario->idrol;\n if($idrol==1){\n $request->validate([\n 'name' => 'required|unique:users,name,'.$usuario->id.',id',\n 'email' => 'required|unique:users,email,'.$usuario->id.',id',\n 'idrol' => 'required'\n ]);\n }else{\n $request->validate([\n 'name' => 'required|unique:users,name,'.$usuario->id.',id',\n 'email' => 'required|unique:users,email,'.$usuario->id.',id'\n ]);\n }\n if($id==1){//Si es supervisor\n $request->idrol = 1;\n }\n $usuario->update($request->all());\n $perfil = $request->perfil;\n if(isset($perfil))\n {\n return redirect()->route('aj_perfil')->with('mensaje','Datos guardados correctamente');\n }else{\n return redirect()->route('usuarios.index')->with('mensaje','Datos guardados correctamente');\n }\n }\n }", "function modificarProcesoCompra(){\n\t\t$this->procedimiento='adq.f_proceso_compra_ime';\n\t\t$this->transaccion='ADQ_PROC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t$this->setParametro('id_depto','id_depto','int4');\n\t\t$this->setParametro('num_convocatoria','num_convocatoria','varchar');\n\t\t$this->setParametro('id_solicitud','id_solicitud','int4');\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\n\t\t$this->setParametro('fecha_ini_proc','fecha_ini_proc','date');\n\t\t$this->setParametro('obs_proceso','obs_proceso','varchar');\n\t\t$this->setParametro('id_proceso_wf','id_proceso_wf','int4');\n\t\t$this->setParametro('num_tramite','num_tramite','varchar');\n\t\t$this->setParametro('codigo_proceso','codigo_proceso','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('num_cotizacion','num_cotizacion','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function enviar_correo_datos()\r\n {\r\n \tif ($this->session->userdata(\"session_id\")==\"\") {\r\n redirect(base_url().'Inicio/Zona_roja/');\r\n }\r\n\r\n $id_paciente = $this->input->post(\"id_paciente_update\");\r\n $correo_paciente = $this->input->post(\"correo_valid\");\r\n echo \"mosytramos_id:\".$this->input->post(\"id_paciente_update\");\r\n\r\n //aqui buscamos los datos del mismo\r\n \t$query = $this->db->query(\"select * from exam_datos_generales where Id='\".$id_paciente.\"'\");\r\n\t\tforeach ($query->result() as $emp) {\r\n\t\t\t$nombrexxx = $emp->apellido_paterno.\" \".$emp->apellido_materno.\", \".$emp->nombre;\r\n\t\t}\r\n\r\n if(!empty($_FILES['imagen']['name'])) {\r\n $config['upload_path'] = 'upload/Resultado_analisis/';\r\n $config['allowed_types'] = 'jpg|jpeg|png|gif|pdf';\r\n $config['file_name'] = $nombrexxx.\" \".rand(100000000000000,900000000000000).md5($_FILES['imagen']['name']);\r\n \r\n //Load upload library and initialize configuration\r\n $this->load->library('upload',$config);\r\n $this->upload->initialize($config);\r\n \r\n if($this->upload->do_upload('imagen')){\r\n $uploadDataI = $this->upload->data();\r\n $imagen = $uploadDataI['file_name'];\r\n } else {\r\n $imagen = '';\r\n }\r\n\r\n } else {\r\n $imagen = '';\r\n }\r\n\r\n $data_update = array(\r\n \t'update_result_date' =>date('Y-m-d G:i:s'),\r\n \t'correo'=> $correo_paciente,\r\n \t'status'=>\"3\",\r\n \t'archivo'=> $imagen\r\n );\r\n\r\n $this->ResultadoFinal_model->update_insert_file($id_paciente,$data_update);\r\n\r\n\r\n //aqui buscamos los datos del mismo\r\n $query_result = $this->db->query(\"select * from exam_datos_generales where Id='\".$id_paciente.\"'\");\r\n \r\n\t\tforeach ($query_result->result() as $emp) {\r\n\t\t\t$nombrex = $emp->apellido_paterno.\" \".$emp->apellido_materno.\", \".$emp->nombre;\r\n\t\t\t$archivo1_xx = $emp->archivo;\r\n\t\t\t$url_unico = $emp->url_unico;\r\n\t\t}\r\n\r\n\r\n \r\n if ($this->input->post(\"options\")==\"si\") {\r\n \t$acceso_link = base_url().'ResultadoFinal/ResultadoFinal/view_result_data_list_details/'.$url_unico;\r\n } elseif ($this->input->post(\"options\")==\"no\") {\r\n \t$acceso_link = \"\";\r\n }\r\n\r\n \r\n\t\t$mail = new PHPMailer();\r\n\r\n // Esta configuracion solo funciona en godaddy, no en el servidor local\r\n /*$mail->isSMTP();\r\n\t\t$mail->Host = 'localhost';\r\n\t\t$mail->SMTPSecure = false;\r\n\t\t$mail->SMTPDebug = 3;\r\n\t\t$mail->Username = 'pagina_web@innomedic.pe';\r\n\t\t$mail->Password = '';\r\n\t\t$mail->SMTPAuth = false;\r\n\t\t$mail->SMTPAutoTLS = false; \r\n\t\t$mail->SMTPSecure = ''; \r\n\t\t$mail->Port = 25;\r\n\t\t$mail->CharSet = 'UTF-8'; \r\n\t\t$mail->AllowEmpty = true;\r\n \r\n\r\n $mail->setFrom('pagina_web@innomedic.pe', 'Innomedic.pe | Resultados de la Clinica Innomedic International E.I.R.L');\r\n\r\n */\r\n\r\n\r\n\r\n // Configuracion para el servidor local\r\n \r\n $mail->isSMTP();\r\n\t\t$mail->Host = 'localhost';\r\n\t\t$mail->SMTPSecure = false;\r\n\t\t$mail->SMTPDebug = 3;\r\n\t\t$mail->Username = 'pagina_web@innomedic.pe';\r\n\t\t$mail->Password = '';\r\n\t\t$mail->SMTPAuth = false;\r\n\t\t$mail->SMTPAutoTLS = false; \r\n\t\t$mail->SMTPSecure = ''; \r\n\t\t$mail->Port = 25;\r\n\t\t$mail->CharSet = 'UTF-8'; \r\n\t\t$mail->AllowEmpty = true;\r\n\r\n // De: \r\n $mail->setFrom('pagina_web@innomedic.pe', 'Innomedic.pe | Resultados de la Clinica Innomedic International E.I.R.L');\r\n\r\n // Archivo a adjuntar en el correo. El archivo ya fue subido\r\n $archivo1 = 'upload/Resultado_analisis/'.$archivo1_xx;\r\n\r\n\r\n \r\n //Mandamos a los correos\r\n $mail->addReplyTo('reenviadorweb@innomedic.pe', 'Innomedic.pe | Reenviar Email');\r\n $mail->addAddress($correo_paciente, $nombrex); \r\n $mail->Subject = 'Innomedic.pe '.$nombrex.' | Verificar Tus resultados';\r\n \r\n // Set email format to HTML\r\n $mail->isHTML(true);\r\n $mailContent = '<!DOCTYPE html>\r\n\t\t\t<html>\r\n\t\t\t<head>\r\n\t\t\t\t<title>Acceso al Sistema</title>\r\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n\t\t\t</head>\r\n\t\t\t<body>\r\n\t\t\t\t<tr><td valign=\"top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" style=\"background-color: #ffffff; width: 600px\"><tbody><tr><td style=\"vertical-align: top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width: 600px\"><tbody><tr><td class=\"logo\" width=\"588\" align=\"right\" valign=\"top\" style=\"color: #ffffff; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; padding-bottom: 12px; text-align: right; width: 588px\"><img class=\"logo\" alt=\"Adobe\" src=\"http://innomedic.pe/public/assets/images/logo.png\" border=\"0\" hspace=\"0\" vspace=\"0\" style=\" display: inline-block; vertical-align: top; width: 205px; height: 60px\"></td>\r\n\t\t\t <td width=\"12\" style=\"width: 12px\">&nbsp;</td>\r\n\t\t\t </tr></tbody></table></td>\r\n\t\t\t </tr><tr><td valign=\"top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" style=\"background-color: #ffffff; width: 600px\"><tbody><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp; </td>\r\n\t\t\t <td style=\"color: #555555; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; padding-top: 20px\">Estimado(a) Cliente; '.$nombrex.' <br>\r\n\t\t\t Envió los resultados Médicos <a href=\"'.$acceso_link.'\" style=\"color: #1473e6; text-decoration: none\">Link de Acceso: </a></td>\r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t \r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t <td style=\"color: #555555; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; padding-top: 20px\">En caso de un error, <a href=\"http://innomedic.pe/\" style=\"color: #1473e6; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">ponte en contacto con nosotros inmediatamente</a>.</td>\r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t <td style=\"color: #555555; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; padding-top: 20px; padding-bottom: 30px\">Muchas gracias,<br> INNOMEDIC INTERNATIONAL E.I.R.L</td>\r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr></tbody></table></td>\r\n\t\t\t </tr><tr><td valign=\"top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#313A3E\" style=\"background-color: #313A3E; width: 600px\"><tbody><tr><td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\t\t\t \t\t\t<td align=\"center\" style=\"color: #ffffff; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; padding-top: 30px; text-align: center\"><strong><a href=\"http://intranet.innomedic.pe/\" style=\"color: #ffffff; font-weight: bold; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">Administrar tu cuenta</a> | <a href=\"http://innomedic.pe\" style=\"color: #ffffff; font-weight: bold; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">Asistencia al colaborador</a> | <a href=\"http://innomedic.pe/\" style=\"color: #ffffff; font-weight: bold; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">Foros</a> </strong></td>\r\n\t\t\t \t\t\t<td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\t\t\t \t\t</tr>\r\n\t\t\t \t\t<tr>\r\n\t\t\t \t\t\t<td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\t\t\t \t\t\t<td class=\"legal\" style=\"color: #999999; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; padding-top: 30px; padding-bottom: 30px\">\r\n\t\t\t \t\t\t\tIntranet Innomedic | desarrollado especialmente para los clientes de Innomedic International E.I.R.L &copy; todo los derechos reservados.<br><br> \r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t&reg; Av. Javier Prado Este 2638, San Borja, Lima, Perú<br/>\r\n\t\t\t <a target=\"_blank\" href=\"http://innomedic.pe\" style=\"color: #ffffff;\"><font color=\"#ffffff\">Mas informacion</font></a> Área de Sistemas T.I\r\n\t\t\t <br /><br />\r\n\t\t\t <a color=\"#ffffff\" style=\"color: #ffffff;\">Desarrollado por: Area de Sistemas</a>\r\n\t\t\t \t\t\t</td>\r\n\r\n\t\t\t \t\t\t<td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\r\n\t\t\t \t\t</tr>\r\n\t\t\t \t</tbody></table></td>\r\n\t\t\t </tr></tbody></table></td>\r\n\t\t\t </tr>\r\n\r\n\t\t\t</body>\r\n\r\n\t\t\t</html>';\r\n\r\n $mail->AddAttachment($archivo1);\r\n\r\n $mail->Body = $mailContent;\r\n\r\n // Enviando email. Notese que send() devuelve true ó false a parte de enviar el correo\r\n if(!$mail->send()){\r\n echo 'Mailer Error: ' . $mail->ErrorInfo;\r\n $this->output->set_status_header(400);\r\n } else {\r\n $this->ResultadoFinal_model->actualizarResultadoProgreso($id_paciente, \"1\");\r\n $this->actualizarEstadoProgreso($id_paciente);\r\n echo \"Su petición ha sido enviada\";\r\n }\r\n\r\n }", "function modificarVacacion(){\n\t\t$this->procedimiento='asis.ft_vacacion_ime';\n\t\t$this->transaccion='ASIS_VAC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_vacacion','id_vacacion','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\n\t\t$this->setParametro('fecha_inicio','fecha_inicio','date');\n\t\t$this->setParametro('fecha_fin','fecha_fin','date');\n\t\t$this->setParametro('dias','dias','numeric');\n\t\t$this->setParametro('descripcion','descripcion','text');\n $this->setParametro('medio_dia','medio_dia','integer');\n $this->setParametro('dias_efectivo','dias_efectivo', 'numeric');\n\n// medio_dia\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "protected function actualizar(Request $request, User $user ){\n\n\n $datosUsua = request()->except(['_token','_method']);\n\n if($request->hasFile('foto')){\n\n \n\n\n // $request = request();\n\n\n\n\n\n $profileImage = $request->file('foto');\n\n\n $usua=User::findOrFail( auth()->user()->id );\n Storage::delete($usua->foto);\n // $datosUsua['foto']= $request->file('foto')->store('uploads','public');\n\n $profileImageSaveAsName = time() . Auth::id() . \"-profile.\" . $profileImage->getClientOriginalExtension();\n \n $upload_path = 'storage/app/public/uploads/';\n $datosUsua = $upload_path . $profileImageSaveAsName;\n $success = $profileImage->move($upload_path, $profileImageSaveAsName);\n\n\n\n }\n \n\n User::where('id','=', auth()->user()->id)->update($datosUsua);\n\n $usua=User::findOrFail(auth()->user()->id);\n\n\n\n// $user->update($request->foto);\nreturn response()->json($usua);\n\n}", "static public function ctrEditarUsuario(){\n\n\t\tif (isset($_POST['editUser'])) {\n\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"newName\"])) {\n\t\t\t \t/*======================================\n\t\t\t \t= Validar Imagen =\n\t\t\t \t======================================*/\n\t\t\t \t$ruta=$_POST['lastPhoto'];\n\t\t\t \tif (isset($_FILES['photo']['tmp_name']) && !empty($_FILES['photo']['tmp_name'])) {\n\t\t\t \t\tlist($ancho,$alto) = getimagesize($_FILES['photo']['tmp_name']);\n\t\t\t \t\t$nuevoAncho = 500;\n\t\t\t \t\t$nuevoAlto = 500;\n\t\t\t \t\t/*==========================================\n\t\t\t \t\t= CREANDO DIRECTORIO =\n\t\t\t \t\t==========================================*/\n\t\t\t \t\t$directorio = \"Views/img/usuarios/\".$_POST['newUsername'];\n\t\t\t \t\tif (!empty($_POST['lastPhoto'])) {\n\t\t\t \t\t\tunlink($_POST['lastPhoto']);\n\t\t\t \t\t}else{\n\t\t\t \t\t\tmkdir($directorio,0755);\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t\t/*===========================================================================\n\t\t\t \t\t= Funciones defecto PHP dependiendo de tipo de imagen =\n\t\t\t \t\t===========================================================================*/\n\t\t\t \t\tswitch ($_FILES['photo']['type']) {\n\t\t\t \t\t\tcase 'image/jpeg':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.jpg';\n\t\t\t \t\t\t\t$origen = imagecreatefromjpeg($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagejpeg($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tcase 'image/png':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.png';\n\t\t\t \t\t\t\t$origen = imagecreatefrompng($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagepng($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tdefault:\n\t\t\t \t\t\t\t# code...\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t}\n\t\t\t\t$answer = adminph\\User::where('username',$_POST['newUsername'])->first();\n\t\t\t \tif ($_POST['newPassword'] != \"\") {\n\t\t\t \t\t$password = password_hash($_POST[\"newPassword\"], PASSWORD_DEFAULT);\n\t\t\t \t}else{\n\t\t\t \t\t$password=$_POST['password'];\n\t\t\t \t}\n\t\t\t \t$answer->name = $_POST['newName'];\n\t\t\t \t$answer->username = $_POST['newUsername'];\n\t\t\t \t$answer->password = $password;\n\t\t\t \t$answer->type = $_POST['rol'];\n\t\t\t \t$answer->code = $_POST['newOrganizationCode'];\n\t\t\t \t$answer->photo = $ruta;\n\t\t\t if ($answer->save()) {\n\t\t\t \treturn redirect('usuarios');\t\t\t }\n\t\t\t } else {\n\t\t\t \treturn view('layouts.users_error');\n\t\t\t }\n\t\t}\n\n\t}", "function recibir_fichero(){\r\n\t$usuario = $_SESSION['user'];\r\n\r\n\t$dir_subida = 'usuarios/'.$usuario;\r\n\t$fichero_subido = $dir_subida . '/perfil.png';\r\n\r\n\tif(exif_imagetype($_FILES['imagen_perfil']['tmp_name']) != IMAGETYPE_PNG) {\r\n\t\tshow_msg(\"El archivo no es el adecuado\");\r\n\t}else if (move_uploaded_file($_FILES['imagen_perfil']['tmp_name'], $fichero_subido)){\r\n\t\t//El archivo se ha movido correctame\r\n\t}\r\n}", "public function updateWorkAgreement()\n {\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n if (\\Input::file('picture')) {\n\n $image = \\Input::file('picture');\n $filename = \\Auth::user()->idPerson . '.' . $image->getClientOriginalExtension();\n echo 'hey';\n $path = public_path(\"WorkAgreement/\" . $filename);\n Image::make($image->getRealPath())->save($path);\n $tenant->work_Agreement = $filename;\n $tenant->save();\n }\n return \\Redirect::to('tenant');\n }", "function modificarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\t\t$this->setParametro('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function update(Request $request, Fichee $fichee)\n {\n\n $this->validate($request, [\n 'photo' => 'image|nullable|max:1999',\n 'nom' => 'required',\n 'adresse' => 'required',\n 'num' => 'required',\n 'site' => 'required',\n 'raison_sociale' => 'required',\n 'date_de_creation' => 'required',\n 'activité'=>'required',\n 'gerant_id' =>'required',\n \n ]);\n\n $fichee->nom = $request->input('nom');\n $fichee->adresse = $request->input('adresse');\n $fichee->site = $request->input('site');\n $fichee->code_postal = $request->input('code_postal');\n $fichee->num = $request->input('num');\n $fichee->date_de_creation = $request->input('date_de_creation');\n $fichee->raison_sociale = $request->input('raison_sociale');\n $fichee->activité = $request->input('activité');\n $fichee->gerant_id = $request->input('gerant_id');\n $fichee->save();\n \n\n // User image\n if($request->hasFile('photo')){\n // Get filename with the extension\n $filenameWithExt = $request->file('photo')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $request->file('photo')->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore5= $filename.'_'.time().'.'.$extension;\n // Upload Image\n $path = $request->file('photo')->storeAs('public/user_images', $fileNameToStore5);\n // Delete file if exists\n Storage::delete('public/fichees_images/'.$fichee->photo);\n $fichee->photo = $fileNameToStore5;\n\n }\n\n $fichee->save();\n\n\n\n return redirect('/fichee'.'/'. $fichee->id . '/edit')->with('success', 'Mise à Jour Réussie');\n }", "function modificarPrograma(){\n\t\t$this->procedimiento='sigep.ft_programa_ime';\n\t\t$this->transaccion='SIGEP_PRO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_programa_boa','id_programa_boa','int4');\n\t\t$this->setParametro('id_cp_programa','id_cp_programa','int4');\n\t\t$this->setParametro('id_gestion','id_gestion','int4');\n\t\t$this->setParametro('programa','programa','int4');\n\t\t$this->setParametro('desc_catprg','desc_catprg','varchar');\n\t\t$this->setParametro('id_entidad','id_entidad','int4');\n\t\t$this->setParametro('nivel','nivel','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_catprg','id_catprg','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarJuegoInternamente($id, $datos = array()) {\n global $textos, $sql, $configuracion, $archivo_imagen;\n\n $juego = new Juego($id);\n $destino = \"/ajax\".$juego->urlBase.\"/edit\";\n\n if (empty($datos)) {\n \n $codigo = HTML::campoOculto(\"procesar\", \"true\");\n $codigo .= HTML::campoOculto(\"id\", $id);\n $codigo .= HTML::campoOculto(\"datos[id_imagen]\", $juego->idImagen);\n $codigo .= HTML::parrafo($textos->id(\"NOMBRE\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"datos[nombre]\", 50, 255, $juego->nombre);\n $codigo .= HTML::parrafo($textos->id(\"DESCRIPCION\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[descripcion]\", 10, 60, $juego->descripcion, \"editor\");\n $codigo .= HTML::parrafo($textos->id(\"SCRIPT\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[script]\", 5, 60, $juego->script);\n $codigo .= HTML::parrafo($textos->id(\"IMAGEN\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoArchivo(\"imagen\", 50, 255);\n $codigo .= HTML::parrafo(HTML::campoChequeo(\"datos[activo]\", $juego->activo).$textos->id(\"ACTIVO\"), \"margenSuperior\"); \n $codigo .= HTML::parrafo(HTML::boton(\"chequeo\", $textos->id(\"ACEPTAR\"), \"botonOk\", \"botonOk\", \"botonOk\").HTML::frase(\" \".$textos->id(\"REGISTRO_MODIFICADO\"), \"textoExitoso\", \"textoExitoso\"), \"margenSuperior\");\n \n $codigo = HTML::forma($destino, $codigo, \"P\", true);\n\n $respuesta[\"generar\"] = true;\n $respuesta[\"codigo\"] = $codigo;\n $respuesta[\"titulo\"] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id(\"MODIFICAR_JUEGO\"), \"letraNegra negrilla\"), \"bloqueTitulo-IS\"), \"encabezadoBloque-IS\");\n $respuesta[\"destino\"] = \"#cuadroDialogo\";\n $respuesta[\"ancho\"] = 500;\n $respuesta[\"alto\"] = 570; \n\n } else {\n $respuesta[\"error\"] = true;\n if(!empty($archivo_imagen[\"tmp_name\"])){\n $validarFormato = Archivo::validarArchivo($archivo_imagen, array(\"jpg\",\"png\",\"gif\", \"jpeg\"));\n $area = getimagesize($archivo_imagen[\"tmp_name\"]);\n }\n\n if (empty($datos[\"nombre\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_NOMBRE\");\n\n } elseif (empty($datos[\"descripcion\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_DESCRIPCION\");\n\n } elseif (empty($datos[\"script\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_SCRIPT\");\n\n } elseif ($area[0] != $configuracion[\"DIMENSIONES\"][\"JUEGOS\"][0] || $area[1] != $configuracion[\"DIMENSIONES\"][\"JUEGOS\"][1]) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_AREA_IMAGEN_JUEGO\");\n\n } else { \n \n if ($juego->modificar($datos)) {\n /********************** En este Bloque se Arma el Contenido del nuevo Juego que se acaba de Registrar **********************/\n $juego = new Juego($id); \n // if (isset($sesion_usuarioSesion) && $sesion_usuarioSesion->idTipo == 0) {\n $botones = \"\";\n $botones .= HTML::nuevoBotonEliminarItemInterno($juego->id, $juego->urlBase);\n $botones .= HTML::nuevoBotonModificarItemInterno($juego->id, $juego->urlBase); \n $botones = HTML::contenedor($botones, \"botonesInternos\", \"botonesInternos\");\n // }\n $contenidoJuego = $botones;\n $contenidoJuego .= HTML::contenedor($juego->script, \"centrado\");\n $contenidoJuego .= HTML::contenedor(HTML::nuevosBotonesCompartir());\n $contenidoJuego = HTML::bloque(\"juego_\".$juego->id, $juego->nombre, $contenidoJuego, \"\", \"botonesOcultos\");\n \n /*******************************************************************************************************************************/\n\n $respuesta[\"error\"] = false;\n $respuesta[\"accion\"] = \"insertar\";\n $respuesta[\"contenido\"] = $contenidoJuego;\n $respuesta[\"idContenedor\"] = \"#bloqueComentariosJuego\".$id;\n $respuesta[\"modificarAjaxInterno\"] = true;\n //$respuesta[\"destino\"] = \"#nuevosRegistros\";\n\n } else {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_DESCONOCIDO\");\n }\n\n\n }\n \n }\n Servidor::enviarJSON($respuesta);\n \n }", "public function editarUsuarioSinFoto($datos)\n {\n $id= (int)$datos[\"id\"];\n $stmt = Conexion::conectar()->prepare(\"UPDATE usuarios SET nombre=:nombre , apellido=:apellido,\n nombre_usuario=:nombre_usuario, password=:password,correo=:correo WHERE idUsuario=:id\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":apellido\", $datos[\"apellido\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":nombre_usuario\", $datos[\"user\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":password\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $id);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\n }", "function subirFotoElemento($campo, $tipo, $id, $refresh, $backdir) {\n\t\tif($_FILES[$campo]['type'] != 'image/jpeg' AND $_FILES[$campo]['type'] != 'image/gif' AND $_FILES[$campo]['type'] != 'image/png') {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'El formato de imagen no es válido, sólo se aceptan JPG, GIF o PNG';\n\t\t}\n\n\t\t//Obtengo las dimensiones de la imagen, si se puede entonces es una imagen de verdad y evito una shell en el server\n\t\t$check = getimagesize($_FILES[$campo]['tmp_name']);\n\n\t\tif($check == FALSE) {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'Seleccione una imagen válida';\n\t\t}\n\n\t\t//Si no hay ningún error, arranco la subida...\n\t\tif($error_img == FALSE) {\n\t\t\tif($_FILES[$campo]['type'] == 'image/jpeg') {\n\t\t\t\t$extension_img = '.jpg';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/gif') {\n\t\t\t\t$extension_img = '.gif';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/png') {\n\t\t\t\t$extension_img = '.png';\n\t\t\t}\n\n\t\t\t$directorio_subida = $backdir . '../sitio/fotos/' . $tipo . '/ampl/';\n\t\t\t$directorio_subida_m = $backdir . '../sitio/fotos/' . $tipo . '/';\n\n\t\t\tif($img = glob($directorio_subida . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\tif($img = glob($directorio_subida_m . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\t$sin_punto = explode('.', $_FILES[$campo]['name']);\n\t\t\tmove_uploaded_file($_FILES[$campo]['tmp_name'],$directorio_subida . $_FILES[$campo]['name']);\n\t\t\trename($directorio_subida . $_FILES[$campo]['name'],$directorio_subida . $id . $extension_img);\n\n\t\t\t$modulo_variable_ancho_imagen_chica = 'modulo_' . $tipo . '_ancho_imagen_chica';\n\t\t\t$modulo_variable_alto_imagen_chica = 'modulo_' . $tipo . '_alto_imagen_chica';\n\t\t\t$modulo_variable_ancho_imagen_grande = 'modulo_' . $tipo . '_ancho_imagen_grande';\n\t\t\t$modulo_variable_alto_imagen_grande = 'modulo_' . $tipo . '_alto_imagen_grande';\n\t\t\t$modulo_variable_tipo_resize = 'modulo_' . $tipo . '_tipo_resize';\n\t\t\t$modulo_variable_watermark = 'modulo_' . $tipo . '_watermark';\n\t\t\t$modulo_variable_watermark_dir = 'modulo_' . $tipo . '_watermark_dir';\n\n\t\t\tglobal $$modulo_variable_ancho_imagen_chica;\n\t\t\tglobal $$modulo_variable_alto_imagen_chica;\n\t\t\tglobal $$modulo_variable_ancho_imagen_grande;\n\t\t\tglobal $$modulo_variable_alto_imagen_grande;\n\t\t\tglobal $$modulo_variable_tipo_resize;\n\t\t\tglobal $$modulo_variable_watermark;\n\t\t\tglobal $$modulo_variable_watermark_dir;\n\n\t\t\tif($_FILES[$campo]['type'] != 'image/gif') {\n\t\t\t\trequire($backdir . 'lib/Simpleimage/SimpleImage.php');\n\n\t\t\t\t$img = new \\claviska\\SimpleImage($directorio_subida . $id . $extension_img);\n\t\t\t\t$img->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t$img_thumb = new \\claviska\\SimpleImage($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\tif($$modulo_variable_tipo_resize == 'recortar') { //////////////////////////////////////////////////////////////Si está en modo recorte\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t} else { /////////////////////////////////////////////////////////////////////////////////////////////////////////Si está en modo proporcionar\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($refresh == TRUE) {\n\t\t\t\techo refresh();\n\t\t\t}\n\t\t} else {\n\t\t\techo '<br><div class=\"alert alert-danger\"><strong>Error</strong> ' . $msg . '</div>';\n\t\t}\n\t}", "public function actionAtualizar($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n\n $foto1 = UploadedFile::getInstanceByName('foto1');\n $foto2 = UploadedFile::getInstanceByName('foto2');\n $foto3 = UploadedFile::getInstanceByName('foto3');\n $foto4 = UploadedFile::getInstanceByName('foto4');\n $foto5 = UploadedFile::getInstanceByName('foto5');\n\n// dd( Yii::$app->request->post(), $foto1, $model);\n\n $model->save();\n\n $caminho = $model->localSalvarImagens();\n\n if ($foto1 && Yii::$app->request->post('atualiza_foto1') == 'on') {\n @unlink($caminho . '/' . $model->foto1);\n $arq = 'foto1_' . time() . '.' . $foto1->getExtension();\n $model->foto1 = $arq;\n $foto1->saveAs($caminho . '/'.$arq);\n }\n if (Yii::$app->request->post('atualiza_foto2') == 'on') {\n if ($foto2) {\n @unlink($caminho . '/' . $model->foto2);\n $arq = 'foto2_' . time() . '.' . $foto2->getExtension();\n $model->foto2 = $arq;\n $foto2->saveAs($caminho . '/' . $arq);\n } else\n $model->foto2 = null;\n }\n if (Yii::$app->request->post('atualiza_foto3') == 'on') {\n if ($foto3) {\n @unlink($caminho . '/' . $model->foto3);\n $arq = 'foto3_' . time() . '.' . $foto3->getExtension();\n $model->foto3 = $arq;\n $foto3->saveAs($caminho . '/' . $arq);\n } else\n $model->foto3 = null;\n }\n if (Yii::$app->request->post('atualiza_foto4') == 'on') {\n if ($foto4) {\n @unlink($caminho . '/' . $model->foto4);\n $arq = 'foto4_' . time() . '.' . $foto4->getExtension();\n $model->foto4 = $arq;\n $foto4->saveAs($caminho . '/' . $arq);\n } else\n $model->foto4 = null;\n }\n if (Yii::$app->request->post('atualiza_foto5') == 'on') {\n if ($foto5) {\n @unlink($caminho . '/' . $model->foto5);\n $arq = 'foto5_' . time() . '.' . $foto5->getExtension();\n $model->foto5 = $arq;\n $foto5->saveAs($caminho . '/' . $arq);\n } else\n $model->foto5 = null;\n }\n\n Yii::$app->session->setFlash('success', 'Produto atualizado com sucesso');\n $model->update(false);\n\n\n return $this->redirect(['exibir', 'id' => $model->id]);\n }\n\n return $this->render('atualizar', [\n 'model' => $model,\n ]);\n }", "public function subir_datos() {\n $datos = array(\n 'nombre' => $this->helper->cleanInput($_POST['cname']),\n 'email' => $this->helper->cleanInput($_POST['email']),\n 'telefono' => $this->helper->cleanInput($_POST['phone']),\n 'message' => $this->helper->cleanInput($_POST['message'])\n );\n $insert = $this->model->subir_datos($datos);\n $id = $insert['id'];\n #SUBIMOS EL ARCHIVO\n $dir = 'public/archivos/cv/';\n $serverdir = $dir;\n $filename = \"\";\n foreach ($_FILES as $inputname => $file) {\n $newname = $this->helper->cleanUrl($_POST[$inputname . '_name']);\n //$extension = strtolower(end(explode('.', $file['name'])));\n $ext = explode('.', $file['name']);\n $extension = strtolower(end($ext));\n $fname = $id . '_' . $newname . '.' . $extension;\n $contents = file_get_contents($file['tmp_name']);\n\n $handle = fopen($serverdir . $fname, 'w');\n fwrite($handle, $contents);\n fclose($handle);\n\n $filename = $fname;\n var_dump($filename);\n }\n $update = array(\n 'id' => $id,\n 'archivo' => $filename\n );\n $updateTrabaja = $this->model->updateTrabaja($update);\n if (!empty($id)) {\n $data = array(\n 'type' => 'succes',\n 'message' => $this->helper->messageAlert('success', 'Gracias, tu C.V. se ha agregado correctamente a nuestra Base de Datos.')\n );\n } else {\n $data = array(\n 'type' => 'error',\n 'message' => $this->helper->messageAlert('error', 'Lo sentimos ha ocurrido un error, por favor vuelva a intertarlo')\n );\n }\n Session::set('result', $data);\n header('Location: ' . URL . 'trabaja_con_nosotros/');\n }", "function modificarCotizacion(){\n\t\t$this->procedimiento='adq.f_cotizacion_ime';\n\t\t$this->transaccion='ADQ_COT_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cotizacion','id_cotizacion','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('lugar_entrega','lugar_entrega','varchar');\n\t\t$this->setParametro('tipo_entrega','tipo_entrega','varchar');\n\t\t$this->setParametro('fecha_coti','fecha_coti','date');\n\t\t$this->setParametro('numero_oc','numero_oc','varchar');\n\t\t$this->setParametro('id_proveedor','id_proveedor','int4');\n\t\t$this->setParametro('precio_total','precio_total','numeric');\n\t\t$this->setParametro('fecha_entrega','fecha_entrega','date');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t$this->setParametro('fecha_venc','fecha_venc','date');\n\t\t$this->setParametro('obs','obs','text');\n\t\t$this->setParametro('fecha_adju','fecha_adju','date');\n\t\t$this->setParametro('nro_contrato','nro_contrato','varchar');\n\t\t$this->setParametro('tipo_cambio_conv','tipo_cambio_conv','numeric');\n $this->setParametro('tiempo_entrega','tiempo_entrega','varchar');\n\t\t$this->setParametro('funcionario_contacto','funcionario_contacto','varchar');\n\t\t$this->setParametro('telefono_contacto','telefono_contacto','varchar');\n\t\t$this->setParametro('correo_contacto','correo_contacto','varchar');\n\t\t$this->setParametro('prellenar_oferta','prellenar_oferta','varchar');\n\t\t$this->setParametro('forma_pago','forma_pago','varchar');\n\n $this->setParametro('id_solicitud','id_solicitud','int4');\n $this->setParametro('justificacion','justificacion','text');\n\n \n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n //var_dump('llega', $this->respuesta);\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function Editar(){\n \n $id = $_GET['id'];\n $imagem = $_GET['imagem'];\n \n if(!empty($_FILES['btnImagem']['name'])){\n // Caminho da pasta onde as imagens serão armazenadas.\n $upload_dir = \"imagens/\";\n\n // Para manipular arquivos, deve ser usado \"$_FILES\"!!!\n // Armazenando o nome e a extensão do arquivo que foi selecionado.\n $nome_arq = basename($_FILES['btnImagem']['name']);\n\n // Verifica o tipo de extensão permitida para o upload do arquivo,\n // usamos o comando \"strstr()\" para localizar a sequência de caracteres.\n if(strstr($nome_arq,'.jpg') || strstr($nome_arq,'.png') || strstr($nome_arq,'.gif')){\n\n $upload_file = $upload_dir . $nome_arq;\n\n if(move_uploaded_file($_FILES['btnImagem']['tmp_name'], $upload_file)){\n\n $frota = new Frota();\n\n $frota->id = $id;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $upload_file;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n \n// var_dump($frota);\n\n }else{\n echo(\"Falha ao mover o arquivo!\");\n }\n\n }\n }else{\n \n\n $idFrota = $_GET['id'];\n\n $frota = new Frota();\n\n $frota->id = $idFrota;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $imagem;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n }\n }", "public static function updateProfiloPersonale()\n {\n define(\"nome_completo_regexpr\", \"/^[a-zA-Z \\xE0\\xE8\\xE9\\xEC\\xF2\\xF9]{3,64}/\");\n define(\"email_personale_regexpr\", \"/^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/\");\n define(\"username_regexpr\", \"/^[A-Za-z0-9\\xE0\\xE8\\xE9\\xEC\\xF2\\xF9 ]{3,64}$/\");\n define(\"password_regexpr\", \"/^[a-zA-Z0-9\\xE0\\xE8\\xE9\\xEC\\xF2\\xF9]+$/\");\n $name = trim($_REQUEST['nome_completo_azienda']);\n $task = trim($_REQUEST['tipo_incarichi_id']);\n $mail = trim($_REQUEST['email_personale_azienda']);\n $username = trim($_REQUEST['username_azienda']);\n $pass = trim($_REQUEST['password_azienda']);\n $id = $_SESSION['current_user']->getId();\n $error_rec = 0; //verifica la presenza di un generico errore\n \n $utente = new Azienda();\n // verifica la correttezza dei valori inseriti nella compliazione del form\n if (!empty($name)) {\n unset($_SESSION['nome_completo_azienda']);\n if (1 === preg_match(nome_completo_regexpr, $name)) {\n $utente->setNomeCompleto($name);\n } else {\n $_SESSION['nome_completo_azienda'] = \"<div class='messaggio-errore'>Il campo nome completo contiene caratteri non validi.<br>Verifica eventuali errori di battitura.</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['nome_completo_azienda'] = \"<div class='messaggio-errore'>Il campo nome completo &egrave; vuoto</div>\";\n $error_rec++;\n }\n if (!empty($task)) {\n unset($_SESSION['tipo_incarichi_id']);\n $utente->setTipo_incarichi_id($task);\n }\n if ($task == \"-1\") {\n $_SESSION['tipo_incarichi_id'] = \"<div class='messaggio-errore'>Il campo tipo di incarico non &egrave; stato schelto</div>\";\n $error_rec++;\n }\n if (!empty($mail)) {\n unset($_SESSION['email_personale_azienda']);\n if (1 === preg_match(email_personale_regexpr, $mail)) {\n $valido = UtenteFactory::cercaEmailUpdate($mail, 1, $id);\n if ($valido == 'SI') {\n $utente->setEmailPersonale($mail);\n } else {\n $_SESSION['email_personale_azienda'] = \"<div class='messaggio-errore'>Questa email &egrave; gi&agrave; stato utilizzata<br></div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['email_personale_azienda'] = \"<div class='messaggio-errore'>Questo indirizzo email non &egrave; valido.<br>Verifica eventuali errori di battitura.<br>Esempio email valida: email@esempio.com</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['email_personale_azienda'] = \"<div class='messaggio-errore'>Il campo email &egrave; vuoto</div>\";\n $error_rec++;\n }\n if (!empty($username)) {\n unset($_SESSION['username_azienda']);\n if (1 === preg_match(username_regexpr, $username)) {\n $valido = UtenteFactory::cercaUsernameUpdate($username, 1, $id);\n if ($valido == 'SI') {\n $utente->setUsername($username);\n } else {\n $_SESSION['username_azienda'] = \"<div class='messaggio-errore'>Questo Username &egrave; gi&agrave; stato utilizzato<br>scegline un altro</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['username_azienda'] = \"<div class='messaggio-errore'>Il campo username completo contiene caratteri non validi.<br>Verifica eventuali errori di battitura.</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['username_azienda'] = \"<div class='messaggio-errore'>Il campo username completo &egrave; vuoto</div>\";\n $error_rec++;\n }\n if (!empty($pass)) {\n unset($_SESSION['password_azienda']);\n if (1 === preg_match(password_regexpr, $pass)) {\n $utente->setPassword($pass);\n } else {\n $_SESSION['password_azienda'] = \"<div class='messaggio-errore'>Il campo password non &egrave; valido.<br>Verifica eventuali errori di battitura.</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['password_azienda'] = \"<div class='messaggio-errore'>Il campo password &egrave; vuoto</div>\";\n $error_rec++;\n }\n if ($error_rec == 0) {\n $update = UtenteFactory::updateProfiloPersonale($id, $utente);\n if ($update == 'INSUCCESSO') {\n $_SESSION['errore'] = 6;\n } elseif ($update == 'SUCCESSO') {\n $_SESSION['errore'] = 5;\n }\n }\n \n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_modifica_profilo.php\");\n $vd->setContentFile(\"../view/in/azienda/modifica_profilo_personale.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once '../view/Master.php';\n }", "static public function ctrCrearAtencionCPANEL(){\r\n\t\t\tif (isset($_POST[\"nuevoCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"idUser\"])){\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCIONL =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta = \"\";\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 2 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta2 = \"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho2, $alto2) = getimagesize($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio2, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico2\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho2, $alto2);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta2);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico2\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta2 = \"vistas/img/atenciones/i2/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico2\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho2, $alto2);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta2);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 3 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta3 = \"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico3\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta3 = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta3);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico3\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta3 = \"vistas/img/atenciones/i3/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico3\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta3);\r\n\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN ATENCION 4 =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta4 =\"\";\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"];\r\n\r\n\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico4\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta4 = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta4);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"fotoDiagnostico4\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta4 = \"vistas/img/atenciones/i4/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"fotoDiagnostico4\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta4);\r\n\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"codigo_atencion\" => $_POST[\"nuevoCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"idUsuario\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"nuevaPersonalSalud\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"nuevoPaciente\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"nuevaUps\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"nuevoServicio\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"nuevaEspecialidad\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"nuevoDiagnostico\"],\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico\" => $ruta,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico2\" => $ruta2,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico3\" => $ruta3,\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico4\" => $ruta4,\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"nuevaFechaAtencion\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlIngresarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido guardado correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN registro atenciones CPANEL ======*/\t\t\t\t\t\r\n\t }" ]
[ "0.6745769", "0.66719973", "0.6524641", "0.65071243", "0.6490285", "0.64767736", "0.6475452", "0.6472741", "0.64653677", "0.6412398", "0.6377657", "0.63616437", "0.63601184", "0.6352886", "0.62729454", "0.6232757", "0.623195", "0.62280613", "0.62139904", "0.62106305", "0.6203633", "0.6192054", "0.6177692", "0.6157126", "0.6148207", "0.61470705", "0.6141577", "0.6141178", "0.6113878", "0.61015046", "0.6099117", "0.609273", "0.60823315", "0.6077702", "0.6070052", "0.6051457", "0.6040043", "0.60355645", "0.6035067", "0.603396", "0.6027164", "0.6026962", "0.6024781", "0.6005715", "0.599396", "0.59778893", "0.5968835", "0.59673697", "0.59598005", "0.59571135", "0.59542555", "0.5950762", "0.59458023", "0.59372926", "0.5935121", "0.5933958", "0.5922957", "0.59201306", "0.591694", "0.5911024", "0.59097165", "0.5891605", "0.58837706", "0.58835524", "0.5878387", "0.58715236", "0.58711314", "0.58685166", "0.5867063", "0.5862381", "0.5861323", "0.5860575", "0.5854589", "0.5849272", "0.5846159", "0.58317107", "0.5828314", "0.5821551", "0.58211213", "0.5816783", "0.58148944", "0.58135766", "0.5800578", "0.5799022", "0.579783", "0.57969606", "0.579035", "0.5789548", "0.5785282", "0.5781976", "0.57786095", "0.5774417", "0.5774294", "0.5763599", "0.57498896", "0.5743033", "0.57423633", "0.57324463", "0.57302344", "0.5727928", "0.57207054" ]
0.0
-1
Inicializa un objeto del tipo cerveza
private function initCerveza(TipoCerveza $tc, $params, $path_imagen) { $tc->setDescripcion($params['descripcion']); $tc->setAbv($params['abv']); $tc->setIbu($params['ibu']); $tc->setSrm($params['srm']); $tc->setRutaImagen(str_replace('\\', '/', $path_imagen)); $tc->setPrecioXLitro($params['precio_x_litro']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct()\n {\n $this->obj_contato_anunciante = new OBJ_Contato_Anunciante();\n }", "public function __init(){}", "public function __construct()\n {\n $this->data['messagetype'] = get_class($this);\n }", "protected function construct(){\n\n }", "public function construct() {\n\n }", "function _construct() {\n \t\n\t\t\n\t}", "public function construct()\n\t\t{\n\t\t}", "function _construct(){ }", "protected function initializeObject() {}", "protected function __init__() { }", "public function init(){}", "public function init(){}", "public function __construct(){\n\t\t//asi poder tener dispoble la vista que le pertenece a esta clase\n\t\tparent::__construct();\n\t}", "public function __construct() {\n $this->miConexion = Conexion::singleton();\n $this->retorno = new stdClass();\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "function __construct(){\n \t$this->comentario = new Comentarios();\n\n }", "public function __construct()\n\t{\n\t\t$this->inicializarSistemaExterno();\n\t}", "function __construct(){\n //constructor vacio\n }", "private function __construct() {\n\t\t}", "public function _construct()\n\t{\n\n\t}", "final private function __construct() {\n\t\t\t}", "function __construct(){\n\t\t// nowt much...\n\t}", "private function __construct(){\n \t\n }", "function __construct() {\n\t\t$this->cotizacionModel = new cotizacionModel();\n\t}", "public function __construct() {\n // Aqui todo lo que se define para este constructor\n }", "public function __construct() {\n\n $this->vista = new Vista();\n $this->usuario = new Usuario();\n $this->reserva = new Reserva();\n $this->instalacion = new Instalacion();\n $this->horario = new Horario();\n $this->rol = new Rol();\n $this->seguridad = new Seguridad();\n\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function _init(){}", "public function __construct()\n {\n $this->init('atos');\n }", "function __construct() {\n\t\t\t\t// INSTANSIASI CLASS KONEKSI \n\t\t\t\tparent::__construct();\t\n\n\t\t\t}", "function __construct() {\n\t\t\t\t// INSTANSIASI CLASS KONEKSI \n\t\t\t\tparent::__construct();\t\n\n\t\t\t}", "function __construct() {\n\t\t\t\t// INSTANSIASI CLASS KONEKSI \n\t\t\t\tparent::__construct();\t\n\n\t\t\t}", "protected final function __construct() {}", "private function __construct() {\r\n\t\r\n\t}", "public function _init_obj()\n {\n // dummy\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "public function __construct() {\n\n\t\t}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "private function __construct()\t{}", "protected function __construct() {\n\t\t\n\t}", "protected function __construct() {\n\t\t\n\t}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}", "public function initializeObject() {}" ]
[ "0.6959237", "0.6849996", "0.6834418", "0.6776566", "0.67461365", "0.6731934", "0.6713792", "0.6657856", "0.66468525", "0.6628255", "0.6610043", "0.6610043", "0.6608626", "0.660049", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.65928775", "0.6591637", "0.6591637", "0.6591637", "0.6591637", "0.6591637", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6591175", "0.6568511", "0.6551122", "0.653836", "0.65247136", "0.652086", "0.6519001", "0.6513318", "0.65030324", "0.6466835", "0.64661014", "0.64654607", "0.6454149", "0.6454149", "0.6454149", "0.6454149", "0.6453958", "0.6453958", "0.6453561", "0.6453561", "0.6453561", "0.6453561", "0.6453561", "0.6453561", "0.64474386", "0.64430946", "0.6436111", "0.6436111", "0.6436111", "0.643549", "0.64337057", "0.64221615", "0.6418497", "0.64150494", "0.6412352", "0.6412352", "0.6412352", "0.63996696", "0.63949955", "0.63949955", "0.6393079", "0.6393079", "0.6393079", "0.6393079", "0.6393079", "0.6393079", "0.6393079", "0.6393079", "0.6393079", "0.63919365", "0.63919365" ]
0.0
-1
Intenta crear un producto
public function createProducto($params) { $p = new Producto(); try { $p->find(['descripcion' => $params['descripcion']]); if ($p !== null) { throw new Exception("El producto " . $params['descripcion'] . " ya se encuentra dado de alta en el sistema"); } } catch (NotFoundException $ex) { // Proceso imagen $path_imagen = null; if ($this->resizeImage($params['foto'], 'productos', $path_imagen)) { $this->initProducto($p, $params, $path_imagen); $p->setCreadoPor($this->getUsuario()); $p->setCreadoEn(Utils::getCurrentTimestamp()); $p->create(); } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createProducto(){\n $sql='INSERT INTO producto(nombre, precio, descripcion,foto,estado, idCategoria, cantidad, idProveedor,estadoEliminacion) VALUES (?,?,?,?,?,?,?,?,1)';\n $params=array($this->nombre, $this->precio, $this->descripcion, $this->foto, $this->estado, $this->categoria, $this->cantidad, $this->proveedor);\n return Database::executeRow($sql, $params);\n }", "function createProduct($nome, $categoria, $descricao, $quantidade, $preco, $foto) {\n return [\n 'id' => hash('sha256', uniqid(\"\")), // gera um idenficador unico para o registro\n 'nome' => $nome,\n 'categoria' => $categoria, \n 'descricao' => $descricao,\n 'quantidade' => $quantidade,\n 'preco' => $preco, \n 'foto' => $foto\n ];\n}", "static public function createProduct($datos){\n\n\t\tif(isset($datos[\"tituloProducto\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $datos[\"tituloProducto\"]) && preg_match('/^[,\\\\.\\\\a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"descripcionProducto\"]) ){\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN PORTADA\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaPortada = \"../views/img/cabeceras/default/default.jpg\";\n\n\t\t\t\tif(isset($datos[\"fotoPortada\"][\"tmp_name\"]) && !empty($datos[\"fotoPortada\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoPortada\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$nuevoAncho = 1280;\n\t\t\t\t\t$nuevoAlto = 720;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoPortada\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaPortada = \"../views/img/cabeceras/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoPortada\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaPortada);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoPortada\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaPortada = \"../views/img/cabeceras/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoPortada\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaPortada);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN PRINCIPAL\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/default/default.jpg\";\n\n\t\t\t\tif(isset($datos[\"fotoPrincipal\"][\"tmp_name\"]) && !empty($datos[\"fotoPrincipal\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$nuevoAncho = 400;\n\t\t\t\t\t$nuevoAlto = 450;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoPrincipal\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaFotoPrincipal);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoPrincipal\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaFotoPrincipal = \"../views/img/productos/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoPrincipal\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaFotoPrincipal);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN OFERTA\n\t\t\t\t=============================================*/\n\t\t\t\t$rutaOferta = \"\";\n\n\t\t\t\tif(isset($datos[\"fotoOferta\"][\"tmp_name\"]) && !empty($datos[\"fotoOferta\"][\"tmp_name\"])){\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDEFINIMOS LAS MEDIDAS\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($datos[\"fotoOferta\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 640;\n\t\t\t\t\t$nuevoAlto = 430;\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\t\t\t\t\tif($datos[\"fotoOferta\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaOferta = \"../views/img/ofertas/\".$datos[\"rutaProducto\"].\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($datos[\"fotoOferta\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $rutaOferta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($datos[\"fotoOferta\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$rutaOferta = \"../views/img/ofertas/\".$datos[\"rutaProducto\"].\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($datos[\"fotoOferta\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\t\t\n\t\t\t\t\t\timagesavealpha($destino, TRUE);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $rutaOferta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tPREGUNTAMOS SI VIENE OFERTE EN CAMINO\n\t\t\t\t=============================================*/\n\t\t\t\tif($datos[\"selActivarOferta\"] == \"oferta\"){\n\n\t\t\t\t\t$datosProducto = array(\n\t\t\t\t\t\t \"titulo\"=>$datos[\"tituloProducto\"],\n\t\t\t\t\t\t \"idCategoria\"=>$datos[\"categoria\"],\n\t\t\t\t\t\t \"idSubCategoria\"=>$datos[\"subCategoria\"],\n\t\t\t\t\t\t \"tipo\"=>$datos[\"tipo\"],\n\t\t\t\t\t\t \"detalles\"=>$datos[\"detalles\"],\n\t\t\t\t\t\t \"multimedia\"=>$datos[\"multimedia\"],\n\t\t\t\t\t\t \"ruta\"=>$datos[\"rutaProducto\"],\n\t\t\t\t\t\t \"estado\"=> 1,\n\t\t\t\t\t\t \"titular\"=> substr($datos[\"descripcionProducto\"], 0, 225).\"...\",\n\t\t\t\t\t\t \"descripcion\"=> $datos[\"descripcionProducto\"],\n\t\t\t\t\t\t \"palabrasClave\"=> $datos[\"pClavesProducto\"],\n\t\t\t\t\t\t \"precio\"=> $datos[\"precio\"],\n\t\t\t\t\t\t \"peso\"=> $datos[\"peso\"],\n\t\t\t\t\t\t \"entrega\"=> $datos[\"entrega\"], \n\t\t\t\t\t\t \"imgPortada\"=>substr($rutaPortada,3),\n\t\t\t\t\t\t \"imgFotoPrincipal\"=>substr($rutaFotoPrincipal,3),\n\t\t\t\t\t\t \"oferta\"=>1,\n\t\t\t\t\t\t \"precioOferta\"=>$datos[\"precioOferta\"],\n\t\t\t\t\t\t \"descuentoOferta\"=>$datos[\"descuentoOferta\"],\n\t\t\t\t\t\t \"imgOferta\"=>substr($rutaOferta,3),\n\t\t\t\t\t\t \"finOferta\"=>$datos[\"finOferta\"]\n\t\t\t\t\t );\n\n\t\t\t\t}else{\n\n\t\t\t\t\t$datosProducto = array(\n\t\t\t\t\t\t \"titulo\"=>$datos[\"tituloProducto\"],\n\t\t\t\t\t\t \"idCategoria\"=>$datos[\"categoria\"],\n\t\t\t\t\t\t \"idSubCategoria\"=>$datos[\"subCategoria\"],\n\t\t\t\t\t\t \"tipo\"=>$datos[\"tipo\"],\n\t\t\t\t\t\t \"detalles\"=>$datos[\"detalles\"],\n\t\t\t\t\t\t \"multimedia\"=>$datos[\"multimedia\"],\n\t\t\t\t\t\t \"ruta\"=>$datos[\"rutaProducto\"],\n\t\t\t\t\t\t \"estado\"=> 1,\n\t\t\t\t\t\t \"titular\"=> substr($datos[\"descripcionProducto\"], 0, 225).\"...\",\n\t\t\t\t\t\t \"descripcion\"=> $datos[\"descripcionProducto\"],\n\t\t\t\t\t\t \"palabrasClave\"=> $datos[\"pClavesProducto\"],\n\t\t\t\t\t\t \"precio\"=> $datos[\"precio\"],\n\t\t\t\t\t\t \"peso\"=> $datos[\"peso\"],\n\t\t\t\t\t\t \"entrega\"=> $datos[\"entrega\"], \n\t\t\t\t\t\t \"imgPortada\"=>substr($rutaPortada,3),\n\t\t\t\t\t\t \"imgFotoPrincipal\"=>substr($rutaFotoPrincipal,3),\n\t\t\t\t\t\t \"oferta\"=>0,\n\t\t\t\t\t\t \"precioOferta\"=>0,\n\t\t\t\t\t\t \"descuentoOferta\"=>0,\n\t\t\t\t\t\t \"imgOferta\"=>\"\",\n\t\t\t\t\t\t \"finOferta\"=>\"\"\n\t\t\t\t\t );\n\n\t\t\t\t}\n\n\t\t\t\t//return $datosProducto;\n\n\t\t\t\tHeadersModel::createHeader(\"headers\", $datosProducto);\n\n\t\t\t\t$respuesta = ProductsModel::createProduct(\"products\", $datosProducto);\n\n\t\t\t\treturn $respuesta;\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"error\",\n\t\t\t\t\t title: \"¡El nombre del producto no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\tif (result.value) {\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\t\t\t}\n\t\t}\n\t}", "public function actionCreate()\n {\n if (Yii::$app->user->isGuest) {\n return $this->redirect([\"site/login\"]); \n }\n if(Permiso::requerirRol('lider')){\n $this->layout='/main2';\n }elseif(Permiso::requerirRol('vendedor')){\n $this->layout='/main3';\n }\n $model = new Producto();\n\n \n if ($model->load(Yii::$app->request->post())){ \n \n $model->imagenproducto = UploadedFile::getInstance($model, 'imagen');\n if(isset($model->imagenproducto)){\n $imagen_nombre=rand(0,4000).'image_'.$model->idproveedor.'.'.$model->imagenproducto->extension;\n $imagen_dir='archivo/catalogo/'.$imagen_nombre;\n //print '<pre>';print_r ($model);print $imagen_nombre;print '</pre>';exit;\n $model->imagenproducto->saveAs($imagen_dir);\n $model->imagenproducto=$imagen_dir;\n }\n if($model->save(false)) {\n return $this->redirect(['view', 'id' => $model->idproducto]);\n }\n \n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //funcion para mostrar vista crear\n return view(\"productos.create\");\n }", "public function actionCreate()\n\t{\n\t\t$model=new Productos;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Productos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Productos'];\n $model->precioUnitario=str_replace(\",\",\"\",$model->precioUnitario);\n\t\t\t$model->precioUnitario=str_replace(\"$\",\"\",$model->precioUnitario); \n\t\t\tif($model->save())\n {\n $objBitacora = new Bitacora();\n $objBitacora->setMovimiento('CREAR','Productos','',$model->id,'',4);\n Yii::app()->user->setFlash('success',Yii::t('app','Item successfully added'));\n $this->redirect(array('admin'));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function createProduct($parent = null);", "static public function ctrCreateProduct(){\n\n if(isset($_POST[\"nuevaDescripcion\"])){\n\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaDescripcion\"]) &&\n\t\t\t\t\t\t\tpreg_match('/^[0-9]+$/', $_POST[\"nuevoStock\"]) &&\t\n\t\t\t\t\t\t\tpreg_match('/^[0-9.]+$/', $_POST[\"nuevoPrecioCompra\"]) &&\n\t\t\t\t\t\t\tpreg_match('/^[0-9.]+$/', $_POST[\"nuevoPrecioVenta\"])){\n\n\t\t\t\t\t$ruta = \"views/img/products/default/productos.png\";\n\t\t\t\t\n\t\t\t\t\tif(isset($_FILES[\"nuevaImagen\"][\"tmp_name\"])){\n\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevaImagen\"][\"tmp_name\"]);\n\t\t\t\t\t\t// var_dump(getimagesize($_FILES[\"nuevaImagen\"][\"tmp_name\"]));\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*========================================\n\t\t\t\t\t\t= Creacion del directorio donde se \n\t\t\t\t\t\t\tguarda la foto del usuario =\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$directorio = \"views/img/products/\".$_POST[\"nuevoCodigo\"];\n\t\t\t\t\t\t// 0705 son los permisos de lectura y escritura\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tde acuerdo a ltipo de imagen se colocan\n\t\t\t\t\t\tlas funciones poor defecto de PHP\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\tif($_FILES[\"nuevaImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGuardamos la imagen en el directrorio.\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t\t$ruta = \"views/img/products/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".jpg\";\n\t\t\t\t\t\t\t// cortando la imagen,\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevaImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t\t// para que mantenga las mimas propiedades\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t\t\t\t\t// ajustar la imagen al tamaño de 500x500\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\t// Guardar la imagen en la ruta que le estamos asignando\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"nuevaImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGuardamos la imagen en el directrorio.\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\t\t\t\t\n\t\t\t\t\t\t\t$ruta = \"views/img/products/\".$_POST[\"nuevoCodigo\"].\"/\".$aleatorio.\".png\";\n\t\t\t\t\t\t\t// cortando la imagen,\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevaImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\t\t\t\t\t\t\t// para que mantenga las mimas propiedades\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t\t\t\t\t// ajustar la imagen al tamaño de 500x500\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\t// Guardar la imagen en la ruta que le estamos asignando\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n $tabla = \"productos\";\n\n\t\t\t\t$datos = array(\"id_categoria\" => $_POST[\"nuevaCategoria\"],\n\t\t\t\t\t\t\"codigo\" => $_POST[\"nuevoCodigo\"],\n\t\t\t\t\t\t\"descripcion\" => $_POST[\"nuevaDescripcion\"],\n\t\t\t\t\t\t\"stock\" => $_POST[\"nuevoStock\"],\n\t\t\t\t\t\t\"precio_compra\" => $_POST[\"nuevoPrecioCompra\"],\n\t\t\t\t\t\t\"precio_venta\" => $_POST[\"nuevoPrecioVenta\"],\n\t\t\t\t\t\t\"imagen\" => $ruta);\n\n\n $reply = ModelProducts::mdlEnterProducts($tabla, $datos);\n\n if($reply == \"ok\"){\n\n echo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t\t title: \"El producto ha sido guardado correctamente\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t</script>';\n }\n\n\n }else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El producto no puede ir con los campos vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\t\t\t}\n }\n\n\n\t\t}", "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 actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create(Product $product)\n {\n \n }", "public function createProduct($data);", "public function create()\n {\n return view(\"productos.productos_create\");\n }", "public function create()\n {\n //\n return view(\"productos.create\");\n }", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\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}", "private function createProducts()\n {\n $chicken = $this->newProduct(self::PRODUCT_CHICKEN_EAN, self::PRODUCT_CHICKEN_NAME);\n $turkey = $this->newProduct(self::PRODUCT_TURKEY_EAN, self::PRODUCT_TURKEY_NAME);\n \n try\n {\n $isChickenCreated = $this->productDao->create($chicken);\n $isTurkeyCreated = $this->productDao->create($turkey);\n\n echo self::PRODUCT_CHICKEN_NAME . ' created ' . \n (($isChickenCreated) ? '' : 'un') .\n 'successfuly!' . PHP_EOL;\n\n echo self::PRODUCT_TURKEY_NAME . ' created ' . \n (($isTurkeyCreated) ? '' : 'un') . \n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n \n }", "public static function ctrCrearProducto(){\n\n\n\n\n\n\t\tif (isset($_POST['nuevaDescripcion'])) {\n\n\n\n\n\n\t\t\t\t /*=============================================\n\n\t\t\t\t\t VALIDAR IMAGEN\n\n\t\t\t\t\t =============================================*/\n\n\t\t\t\t\t $ruta = 'vistas/img/productos/default/anonymous.png';\n\n\n\n\t\t\t\t\t if (isset($_FILES['nuevaImagen'][\"tmp_name\"])) {\n\n\n\n\t\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevaImagen\"][\"tmp_name\"]); //saber las propiedades\n\n\n\n\t\t\t\t\t\t\t$nuevoAncho = 500;\n\n\t\t\t\t\t\t\t$nuevoAlto = 500;\n\n\n\n\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\n\t\t\t\t\t\t\t=============================================*/\n\n\n\n\t\t\t\t\t\t\t$directorio = \"vistas/img/productos/\".$_POST['nuevoCodigo'];\n\n\n\n\t\t\t\t\t\t\tmkdir(utf8_decode($directorio), 0755);\n\n\n\n\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\n\t\t\t\t\t\t\t=============================================*/\n\n\n\n\t\t\t\t\t\t\tif($_FILES[\"nuevaImagen\"][\"type\"] == \"image/jpeg\"){\n\n\n\n\t\t\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\n\t\t\t\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\n\n\t\t\t\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST['nuevoCodigo'].\"/\".$aleatorio.\".jpg\";\n\n\n\n\t\t\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevaImagen\"][\"tmp_name\"]);\n\n\n\n\t\t\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\n\t\t\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\n\n\t\t\t\t\t\t\t\t\timagejpeg($destino, utf8_decode($ruta));\n\n\n\n\n\n\t\t\t\t\t\t\t\t}\n\n\n\n\n\n\t\t\t\t\t\t\t\tif($_FILES[\"nuevaImagen\"][\"type\"] == \"image/png\"){\n\n\n\n\t\t\t\t\t\t\t\t\t/*=============================================\n\n\t\t\t\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\n\t\t\t\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\n\n\t\t\t\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST['nuevoCodigo'].\"/\".$aleatorio.\".png\";\n\n\n\n\t\t\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevaImagen\"][\"tmp_name\"]);\n\n\n\n\t\t\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\n\t\t\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\n\n\t\t\t\t\t\t\t\t\timagepng($destino, utf8_decode($ruta));\n\n\n\n\n\n\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t$tabla = 'productos';\t\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t\t\t$datos = array('id_categoria' => $_POST['nuevaCategoria'],\n\n\t\t\t\t\t\t\t\t'codigo' => $_POST['nuevoCodigo'],\n\n\t\t\t\t\t\t\t\t'descripcion' => $_POST['nuevaDescripcion'],\n\n\t\t\t\t\t\t\t\t'stock' => $_POST['nuevoStock'],\n\n\t\t\t\t\t\t\t\t'precio_compra' => $_POST['nuevoPrecioCompra'],\n\n\t\t\t\t\t\t\t\t'precio_venta' => $_POST['nuevoPrecioVenta'],\n\n\t\t\t\t\t\t\t\t'imagen' => $ruta);\n\n\n\n\t\t\t\t\t\t\t$respuesta = ModeloProducto::mdlCrearProducto($tabla, $datos);\n\n\n\n\t\t\t\t\t\t\tif ($respuesta == 'ok') { ?>\n\n\n\n\t\t\t\t\t\t\t\t<script>\n\n\n\n\t\t\t\t\t\t\t\t\tswal({\n\n\n\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡El servicio se registro correctamente!\",\n\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\n\n\n\t\t\t\t\t\t\t\t\t}).then((result)=>{\n\n\n\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\n\n\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"tareas\";\n\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t});\n\n\n\n\n\n\t\t\t\t\t\t\t\t</script> \n\n\n\n\t\t\t\t\t\t\t\t<?php\t\t\n\n\t\t\t\t\t\t\t} \n\n\n\n\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\n\n\n\n\n\n\t\t\t\t}", "function newProducto($producto)\n{\n\t$con = getDBConnection();\n\t$stmt = $con->prepare(\"INSERT INTO productos (nombre, descripcion, precio) VALUES (:nombre, :descripcion, :precio)\");\n\t$stmt->bindParam(':nombre', $producto->nombre);\n\t$stmt->bindParam(':descripcion', $producto->descripcion);\n\t$stmt->bindParam(':precio', $producto->precio);\n\t$stmt->execute();\n}", "function create() {\r\n\t\tglobal $ufoSession;\r\n\t\tglobal $ufoDb;\r\n\t\t$link = $ufoDb->getLink();\r\n\t\t$this->uid = $ufoSession->userId();\r\n\r\n\t\t// insert\r\n\t\t$query = \"INSERT INTO ufo_product (uid, name, description) VALUES ($this->uid, '$this->name', '$this->description')\";\r\n\t\t$result = pg_query($query) or die(\"Query failed : \" . pg_last_error());\r\n\t\t/* Get the auto increment Id of the last insert. */\r\n\t\t$this->oid = $ufoDb->insert_id(\"ufo_product_seq\");\r\n\t\t$this->initialized = True;\r\n\t}", "public function create()\n {\n //\n return View('productos.create');\n }", "private function createViewProducto()\n {\n $this->addView('ListProductoSample', 'ProductoSample', 'products', 'fas fa-cubes');\n $this->addSearchFields('ListProductoSample', ['referencia', 'descripcion', 'observaciones']);\n $this->addOrderBy('ListProductoSample', ['referencia'], 'reference');\n $this->addOrderBy('ListProductoSample', ['descripcion'], 'description');\n $this->addOrderBy('ListProductoSample', ['precio'], 'price');\n $this->addOrderBy('ListProductoSample', ['stockfis'], 'stock');\n $this->addOrderBy('ListProductoSample', ['actualizado'], 'update-time');\n\n $manufacturers = $this->codeModel::all('fabricantes', 'codfabricante', 'nombre');\n $this->addFilterSelect('ListProductoSample', 'codfabricante', 'manufacturer', 'codfabricante', $manufacturers);\n\n $families = $this->codeModel::all('familias', 'codfamilia', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codfamilia', 'family', 'codfamilia', $families);\n\n $taxes = $this->codeModel::all('impuestos', 'codimpuesto', 'descripcion');\n $this->addFilterSelect('ListProductoSample', 'codimpuesto', 'tax', 'codimpuesto', $taxes);\n\n $this->addFilterCheckbox('ListProductoSample', 'nostock', 'no-stock', 'nostock');\n $this->addFilterCheckbox('ListProductoSample', 'bloqueado', 'locked', 'bloqueado');\n $this->addFilterCheckbox('ListProductoSample', 'secompra', 'for-purchase', 'secompra');\n $this->addFilterCheckbox('ListProductoSample', 'sevende', 'for-sale', 'sevende');\n $this->addFilterCheckbox('ListProductoSample', 'publico', 'public', 'publico');\n }", "public function addproducttopoAction() {\n $id = $this->getRequest()->getParam('id');\n $sku = $this->getRequest()->getParam('sku');\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')->load($id);\n try {\n $productId = Mage::getModel('catalog/product')->getIdBySku($sku);\n if (!$productId) {\n throw new Exception($this->helper()->__('Not found sku: %s', \"<i>$sku</i>\"));\n }\n $model->addProduct($productId);\n Mage::getSingleton('vendors/session')->addSuccess(\n $this->helper()->__('Product %s has been added.', \"<i>$sku</i>\")\n );\n $this->_redirect('*/*/view', array('id' => $id));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError($this->helper()->__('There is error while adding product.'));\n Mage::getSingleton('vendors/session')->addError($e->getMessage());\n $this->_redirect('*/*/view', array('id' => $id));\n }\n }", "public function createAction(Request $request)\n {\n \n $entity = new Productosprogramas();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $accion = '';\n $this->get(\"gema.utiles\")->traza($accion);\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_productosprogramas'));\n }\n\n\n\n $helper=new MyHelper();\n return $this->render('gemaBundle:Productosprogramas:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'guid'=>$helper->GUID()\n ));\n }", "function createProduct ($prodName,$typeCode,$prodPic,$prodStock,$prodValue,\n $prodDescription){\n \n return insertProduct ($prodName,$typeCode,$prodPic,$prodStock,$prodValue,\n $prodDescription);\n }", "public function createAddonProduct()\n {\n ++$this->productCount;\n\n // Create basic product.\n $product = $this->productFactory->createEntity();\n $this->entityManager->persist($product);\n $product->setNumber('AddonProductNumber-' . $this->productCount);\n $product->setManufacturer('EnglishManufacturer-' . $this->productCount);\n $product->setType($this->addonProductType);\n $product->setStatus($this->productStatus);\n $product->setCreated(new DateTime());\n $product->setChanged(new DateTime());\n $product->setSupplier($this->contactTestData->accountSupplier);\n $product->setOrderUnit($this->orderUnit);\n $product->setContentUnit($this->contentUnit);\n $product->setOrderContentRatio(2.0);\n $product->setTaxClass($this->taxClass);\n\n // Add prices\n $this->addPrice($product, 5.99);\n $this->addPrice($product, 3.85, 4.0);\n\n // Product translation\n $this->addProductTranslation($product);\n\n return $product;\n }", "public function create()\n {\n \n $ultCodigo = Producto::orderBy('id','DESC')->first();\n $proveedor = Proveedor::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $categorias = Categoria::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $familias = Familia::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $subfamilias = Subfamilia::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $monedas = Moneda::orderBy('nombre', 'ASC')->pluck('nombre', 'id');\n $currency = '';\n $origin = null;\n\n \n if(is_null($ultCodigo)){\n $ultCodigo = '-';\n } else {\n $ultCodigo = $ultCodigo->codigo;\n }\n\n return view('vadmin.productos.create')\n ->with('ultCodigo', $ultCodigo)\n ->with('proveedor', $proveedor)\n ->with('categorias', $categorias)\n ->with('familias', $familias)\n ->with('subfamilias', $subfamilias)\n ->with('monedas', $monedas)\n ->with('origin', $origin)\n ->with('currency', $currency);\n\n }", "public function create(Produto $produto){\n $sql = 'INSERT INTO produtos (nome, descricao) VALUES(?,?)';\n \n // Preparar a query\n $stmt = Conexao::getConn()->prepare($sql);\n // Associando oque vai ser inserido no banco, com o objeto que foi passado no parametro\n $stmt->bindValue(1,$produto->getNome());\n $stmt->bindValue(2,$produto->getDescricao());\n\n // Executando query\n $stmt->execute();\n\n }", "public function create()\n {\n //\n return view('productos.create');\n }", "public function actionCreate()\n {\n\t\tif(!$this->IsAdmin())\n\t\t{\n\t\t\treturn $this->render('error', ['name' => 'Not Found (#404)', 'message' => 'Puuduvad piisavad õigused.']);\n\t\t}\n $model = new Product();\n\t\t\t$model->setAttribute('mfr', '-');\n\t\t\t$model->setAttribute('model', '-');\n\t\t\t$model->setAttribute('description', '-');\n\t\t\t$model->setAttribute('price', 0);\n\t\t\t$model->setAttribute('cut_price', 0);\n\t\t\t$model->setAttribute('stock', 0);\n\t\t\t$model->setAttribute('active', 1);\n\t\t\t\n\t\t$model->save();\n\t\t\n\t\treturn $this->redirect(['update', 'id' => $model->id]);\n\n }", "public function create()\n {\n /*$productos = Producto::create($request->all());*/\n\n /*$newProducto = new Producto($request->all());\n\n $producto->Referencia = $request->Referencia;\n $producto->Marca = $request->Marca;\n $producto->Descripcion = $request->Descripcion;\n $producto->Precio = $request->Precio;\n $profile->save();*/\n return view('productos.create');\n }", "public function createAction()\n {\n\t $form = new Core_Form_Product_Create;\n $action = $this->_helper->url('create', 'product', 'default');\n $form->setAction($action);\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n $this->_model->create($form->getValues());\n\t \t $this->_helper->FlashMessenger('Product added successfully');\n $this->_helper->Redirector('index','product','default');\n } else {\n $form->populate($_POST);\n }\n } \n $this->view->form = $form;\n }", "public function create(Product $product) {\n\n $sql = 'INSERT INTO products (name, description) VALUES (?,?)';\n\n $register = Connection::getConn() -> prepare($sql);\n $register -> bindValue(1, $product -> getName());//este valor é equivalente a primeira interrogação do VALUES da linha 9, assim por diante\n $register -> bindValue(2, $product -> getDescription());\n $register -> execute();\n\n }", "public function crearProductos(){\n $categoria = new categoria();\n $categorias = $categoria->getCategorias();\n $admin = Utilities::admin();\n if($admin){\n require_once 'views/producto/crear.php';\n if($_POST){\n $nombre = isset($_POST['nombre']) ? $_POST['nombre'] : false;\n $id_categoria = isset($_POST['categoria']) ? $_POST['categoria'] : false;\n $descripcion = isset($_POST['descripcion']) ? $_POST['descripcion'] : false;\n $precio = isset($_POST['precio']) ? $_POST['precio'] : false;\n $stock = isset($_POST['stock']) ? $_POST['stock'] : false;\n $oferta = isset($_POST['oferta']) ? $_POST['oferta'] : false;\n\n //inicializando array de errores para validar las variables\n $errores = array();\n $producto = new producto(); \n \n //validar nombre\n if(!empty($nombre) && !preg_match(\"/[0-9]/\", $nombre)){\n $producto->setNombre($nombre);\n }\n else{\n $errores['nombre'] = 'El nombre no es valido';\n } \n\n //validar precio\n if(!empty($precio) && is_numeric($precio)){\n $producto->setPrecio($precio);\n }\n else{\n $errores['precio'] = 'El precio no es valido';\n }\n\n //validar stock\n if(!empty($stock) && is_numeric($stock)){\n $producto->setStock($stock);\n }\n else{\n $errores['stock'] = 'El stock no es valido';\n }\n\n //validar oferta\n if(!empty($oferta) && is_numeric($oferta)){\n $producto->setOferta($oferta);\n }\n else{\n $errores['oferta'] = 'La oferta no es valido';\n }\n \n if(isset($_FILES['image'])){ \n //guardar imagen \n $file = $_FILES['image'];\n $filename = $file['name'];\n $mimetype = $file['type']; \n $flag = false;\n if($mimetype == 'image/jpg' || $mimetype == 'image/jpeg' || $mimetype == 'image/png' || $mimetype == 'image/gif'){\n if(!is_dir('uploads/images')){\n mkdir('uploads/images', 0777, true);\n }\n move_uploaded_file($file['tmp_name'], 'uploads/images/'.$filename); \n $flag = true;\n }\n if(count($errores) == \"\" && $id_categoria && $flag){\n $producto->setImage($filename);\n $producto->setCategoria_id($id_categoria);\n $producto->setDescripcion($descripcion);\n //Crear Producto\n $save = $producto->create(); \n if($save){\n $_SESSION['msg'] = true;\n }\n else{\n $_SESSION['msg'] = false;\n } \n }\n else {\n $_SESSION['errores'] = $errores;\n }\n }\n }\n }\n else\n echo 'La pagina que buscas no existe'; \n }", "public function run()\n {\n $productCount = 24;\n $productName = 'Producto';\n $productDescription = 'Lorem ipsum dolor sit amet, consectetur adipisicing 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.';\n $productImgUrl = 'img/productos/producto.jpg';\n $categoriaMov = 'Movilidad y Rehabilitación';\n $categoriaOrt = 'Ortopedia y Prótesis';\n $categoriaCir = 'Cirugía e Implantes';\n\n for ($i=1; $i < $productCount; $i++) {\n $newProduct = new Product;\n $newProduct->name = $productName.$i;\n $newProduct->description = $productDescription;\n $newProduct->img_url = $productImgUrl;\n if ($i <= 12) {\n $newProduct->category = $categoriaOrt;\n }\n // if ($i > 6 && $i <= 12) {\n // $newProduct->category = $categoriaOrt;\n // }\n if ($i > 12) {\n $newProduct->category = $categoriaCir;\n }\n $newProduct->save();\n\n }\n }", "public function create()\r\n {\r\n return view('backEnd.productos.create');\r\n }", "public function create()\n\t{\n return view('productos.create');\n\t}", "public function actionCreate()\n {\n $model = new Produto();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n \n $model->file = UploadedFile::getInstance($model, 'file');\n\n\n if ($model->file == null) {\n } else {\n $model->atribuirImagem();\n }\n\n $model->save();\n\n Yii::$app->getSession()->setFlash('success', 'Produto criado com sucesso');\n return $this->redirect(['view', 'id' => $model->IDproduto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $shop = DB::table('categories')->select(\n 'categories.*'\n )\n ->where('user_id', Auth::user()->id)\n ->orderBy('id', 'asc')\n ->get();\n\n $data['objs'] = $shop;\n\n $brander = DB::table('branders')->select(\n 'branders.*'\n )\n ->where('user_id', Auth::user()->id)\n ->orderBy('id', 'desc')\n ->get();\n\n $data['brander'] = $brander;\n\n $shop_id = DB::table('shops')->select(\n 'shops.*'\n )\n ->where('user_id', Auth::user()->id)\n ->orderBy('id', 'desc')\n ->get();\n\n $data['shop_id'] = $shop_id;\n\n\n $data['method'] = \"post\";\n $data['url'] = url('admin/product');\n $data['header'] = \"สร้างสินค้า ของคุณใหม่\";\n return view('admin.product.create', $data);\n }", "public function postCreate(Request $request)\n {\n\t\t$this->validate($request, [\n\t\t\t'name' => 'required|min:2',\n\t\t\t'description' => 'required|max:50',\n\t\t\t'image_link' => 'url',\n\t\t\t'image' => 'mimes:jpeg,bmp,png|max:2000kb',\n\t\t]);\n\t\t\n\t\t\n\t\t$product = new \\marketplaceniaja\\Product();\n\t\t$product->name = $request->name;\n\t\t$product->state_id = $request->state_id;\n\t\t$product->type_id = $request->type_id;\n\t\t\n\t\t$product->image_link = $request->image_link;\n\t\t$product->description = $request->description;\n\t\t$product->auth_id = $request->user_id;\n\t\t\n\t\t# If an image was selected...\n\t\tif($request->image) {\n\t\t\t$product->image = $request->image;\n\t\t}\n\t\t# If there were no image selected\n\t\t# default to an empty string\n\t\telse {\n\t\t\t$product->image = '';\n\t\t}\t\t\n\t\t\n\t\t$product->save();\n\t\t\n\t\t\\Session::flash('message', 'Your product has been added');\n\t\t\n\t\treturn redirect('/products');\n }", "public function new_productos($com_id){\n $enlaces=$this->menu_modelo->get_Modulos_programacion(2);\n $data['enlaces'] = $enlaces;\n $data['componente'] = $this->model_componente->get_componente($com_id);\n\n\n if(count($data['componente'])!=0){\n $fase=$this->model_faseetapa->get_fase($data['componente'][0]['pfec_id']);\n $data['nro_fase'] = $this->model_faseetapa->nro_fase($fase[0]['proy_id']); /// nro de fases y etapas registrados\n $data['proyecto'] = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); \n $data['id_f'] = $this->model_faseetapa->get_id_fase($fase[0]['proy_id']); //// recupera datos de la tabla fase activa\n $data['indi'] = $this->model_proyecto->indicador(); /// indicador\n $data['metas'] = $this->model_producto->tp_metas(); /// tp metas\n $data['oestrategicos'] = $this->model_mestrategico->list_objetivos_estrategicos(); /// Objetivos Estrategicos\n $data['mod']=1;\n if(count($this->model_producto->ult_operacion($com_id))!=0){\n $data['cod_ope']=$this->model_producto->ult_operacion($com_id);\n }\n else{\n $data['cod_ope']=0;\n }\n \n/* if($data['proyecto'][0]['tp_id']==1){\n $data['componente'] = $this->model_componente->get_componente_pi($com_id); \n }\n else{\n $data['componente'] = $this->model_componente->get_componente($com_id);\n }*/\n \n $this->load->view('admin/programacion/producto/form_prod', $data); \n }\n else{\n redirect('admin/dashboard');\n }\n }", "public function create() {\n $product = DB::table( 'product' )\n ->join( 'type', 'type.id', '=', 'product.type' )\n ->join( 'producer', 'producer.id', '=', 'product.producer' )\n ->select( DB::raw( 'product.id, product.name, type.name as type, producer.name as producer, product.amount, product.image, product.price_input' ) )\n ->orderby( 'product.id', 'desc' )\n ->get();\n $type = Type::all();\n $producer = Producer::all();\n return view( 'product.create', compact( 'type', 'producer' ) );\n }", "public function newAction()\n {\n $entity = new Productosprogramas();\n $form = $this->createCreateForm($entity);\n\n $helper=new MyHelper();\n return $this->render('gemaBundle:Productosprogramas:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'guid'=> $helper->GUID(),\n ));\n }", "public function create()\n\t{\n /*if(!in_array('viewProduct', $this->permission)) {\n redirect('dashboard', 'refresh');\n }*/\n\n $this->data['vendor'] = $this->model_products->getVendorData();\n $this->data['products'] = $this->model_products->getProductData();\n\n\t\t$this->render_template('invoice/create', $this->data);\t\n\t}", "public function create()\n {\n\n return view('productos.create');\n\n \n }", "public function createproductActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n if (hasKeyPost(\"doCreate\")) {\n $name = getPost(\"name\");\n\n // Executes SQL statement\n $this->admin->createProduct($name);\n\n // Retrieves id\n $id = $this->app->db->lastInsertId();\n }\n\n // Redirects\n return $this->app->response->redirect(\"admin/editproduct?id=$id\");\n }", "public function actionCreate()\n {\n $model = new Produto();\n\n $model->produtoDataCriacao = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post())) {\n\n $images = [];\n\n for ($k=1; $k<5; $k++)\n {\n $images[] = UploadedFile::getInstance($model, ('produtoImagem'.$k));\n\n if ($images[$k-1] != null)\n {\n\n $model->{'produtoImagem'.$k} = (preg_replace('/\\s+/', '_', $images[$k-1]->baseName)).'.'.$images[$k-1]->extension;\n }\n }\n\n if ($model->save())\n {\n $path = Url::to('@frontend/web/images/products/'.$model->idprodutos);\n\n FileHelper::createDirectory($path);\n\n for ($i=0; $i<count($images); $i++)\n {\n if ($images[$i]!=null)\n {\n\n $images[$i]->saveAs($path.'/'.$model->{'produtoImagem'.($i+1)});\n }\n }\n\n return $this->redirect(['view', 'id' => $model->idprodutos]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('productos.create');\n }", "public function create()\n {\n $data['rightButton']['iconClass'] = 'fa fa-list';\n $data['rightButton']['text'] = 'Product List';\n $data['rightButton']['link'] = 'products';\n $data[\"all_categories\"] = Category::where(\"parent_id\", 0)->get();\n $data[\"size_lists\"] = Attribute::Size()->orderBy('title')->pluck('title', 'id');\n $data[\"color_lists\"] = Attribute::Color()->orderBy('title')->pluck('title', 'id');\n $data[\"all_brands\"] = Brand::orderBy('title')->pluck('title', 'id');\n $data[\"all_units\"] = Unit::orderBy('title')->pluck('title', 'id');\n $data[\"author_lists\"] = Author::orderBy('title')->pluck('title', 'id');\n $data[\"publisher_lists\"] = Publisher::orderBy('title')->pluck('title', 'id');\n $data[\"country_lists\"] = Country::orderBy('name')->pluck('name', 'id');\n\n return view(\"nptl-admin/common/product/add_product\", $data);\n }", "public function create()\n {\n\n $tipo_producto = DB::table('deta_parametros')\n -> where('deta_parametros.cod_parametro','=',$this->cod_tipo_producto)\n -> lists('deta_parametro','id');\n\n\n return view('productos.create', compact('tipo_producto'));\n }", "public function products_add($param = null)\r\n {\r\n if (isset($_POST[\"pro_title\"]) && !empty($_POST[\"pro_title\"])) {\r\n $action = $_POST[\"pro_title\"];\r\n $product = Product::updateOrCreate([\r\n 'pro_title' => $_POST[\"pro_title\"],\r\n 'pro_subtitle1' => $_POST[\"pro_subtitle1\"],\r\n 'pro_subtitle2' => $_POST[\"pro_subtitle2\"],\r\n 'pro_img_url_recto' => $_POST[\"pro_img_url_recto\"],\r\n 'pro_img_url_verso' => $_POST[\"pro_img_url_verso\"],\r\n 'pro_descr' => $_POST[\"pro_descr\"],\r\n 'pro_price_euro' => $_POST[\"pro_price_euro\"],\r\n ]);\r\n\r\n echo $product;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}", "public function create()\n {\n $product_types = ProductType::get();\n\n // 抓到資料要打包\n return view('admin.product.create', compact('product_types'));\n }", "public function create()\n {\n return view('administracion.productos.create');\n }", "public function create()\n {\n $productor=\\App\\producto::All();\n $ventas=\\App\\ventasp::All();\n $cont=0;\n foreach ($productor as $key ) {\n # code...c\n\n $productor[$cont]->cPromedio=0;\n $productor[$cont]->gUni=0;\n foreach ($ventas as $key2) {\n # code...\n if($key->id==$key2->idProd)\n {\n $productor[$cont]->cPromedio=$productor[$cont]->cPromedio+$key2->preciov;\n $productor[$cont]->gUni=$productor[$cont]->gUni+$key2->cantidadv;\n }\n }\n $cont++;\n //for($cont=$p; $cont<count($comp2); $cont++)\n \n //$comp=\\App\\ventasp::where('idProd',$key->id)->get();\n\n }\n \n\n //$lotes=ventasp::where('idProd',1)->get();\n \n// $x=0; \n // foreach ($lotes as $key ) {\n // $x=$x+$key->preciov; \n //}\n //$lotes = lotes::proLot();\n return view('Productos.index',compact('productor'));\n }", "function premio_products_create() {\n global $wpdb;\n $product_container_table = $wpdb->prefix . \"premio_product_container\";\n $program_table = $wpdb->prefix . \"premio_program\";\n $product_containers = $wpdb->get_results(\"SELECT * from $product_container_table\");\n $programs = $wpdb->get_results(\"SELECT * from $program_table\");\n\n $name = $_POST[\"name\"];\n $description = $_POST[\"description\"];\n $product_container_id = $_POST['productContainerDpw'];\n\n //insert\n if (isset($_POST['insert'])) {\n $table_name = $wpdb->prefix . \"premio_product\";\n\n $wpdb->query(\"CALL create_product('{$name}', '{$description}', '{$product_container_id}')\");\n\n if(!empty($_POST['checkbox'])) {\n foreach($_POST[\"checkbox\"] as $v) {\n $program_id_to_int = (int)$v;\n\n $last_inserted_product_id = $wpdb->get_row($wpdb->prepare(\n \"SELECT product_id as last_inserted_product_id FROM wp_premio_product ORDER BY product_id DESC LIMIT 1\"\n ));\n\n $wpdb->insert(\n $wpdb->prefix.'premio_product_by_program', \n array(\n 'product_by_program_id' => NULL,\n 'program_id_fk' => $program_id_to_int, \n 'product_id_fk' => $last_inserted_product_id->last_inserted_product_id)\n );\n }\n }\n \n $message.=\"Product inserted\";\n }\n ?>\n <link type=\"text/css\" href=\"<?php echo plugins_url(); ?>/premio-products/style-admin.css\" rel=\"stylesheet\" />\n <div class=\"wrap\">\n <h2 class=\"testJC\">Add New Product</h2>\n <?php if (isset($message)): ?><div class=\"updated\"><p><?php echo $message; ?></p></div><?php endif; ?>\n <form method=\"post\" action=\"<?php echo $_SERVER['REQUEST_URI']; ?>\">\n <table class='wp-list-table widefat fixed'>\n <tr>\n <th class=\"ss-th-width\">Name</th>\n <td><input type=\"text\" name=\"name\" value=\"<?php echo $name; ?>\" class=\"ss-field-width\" /></td>\n </tr>\n <tr>\n <th class=\"ss-th-width\">Description</th>\n <td><textarea name=\"description\" rows=\"5\" cols=\"40\" class=\"ss-field-width\" /><?php echo $description; ?></textarea></td>\n </tr>\n <tr>\n <th class=\"ss-th-width\">Container</th>\n <td>\n <select name=\"productContainerDpw\">\n <?php foreach ($product_containers as $container) { ?>\n <option value=\"<?php echo $container->product_container_id; ?>\"><?php echo $container->name; ?></option>\n <?php } ?>\n </select>\n </td>\n </tr>\n <tr>\n <th class=\"ss-th-width\">Programs</th>\n <td>\n <?php foreach ($programs as $program) { ?>\n <input name=\"checkbox[]\" type=\"checkbox\" id=\"checkbox[]\" value=\"<?php echo $program->program_id; ?>\"> <?php echo $program->name; ?> <br>\n <?php } ?>\n </td>\n </tr>\n </table>\n <input type='submit' name=\"insert\" value='Save' class='button'>\n </form>\n <div class=\"tablenav top\">\n <div class=\"alignleft actions\">\n <a href=\"<?php echo admin_url('admin.php?page=premio_products_list'); ?>\">Back to Products</a>\n </div>\n <br class=\"clear\">\n </div>\n </div>\n <?php\n}", "public function newAction(Request $request)\n {\n\n $em = $this->getDoctrine()->getManager();\n\n $product = new Product();\n $form = $this->createForm('LilWorks\\StoreBundle\\Form\\ProductType', $product);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n\n foreach ($product->getPictures() as $pictureFromForm) {\n $pictureFromForm->setProduct($product);\n $em->persist($pictureFromForm);\n }\n\n\n\n if($product->getDocfiles() && count($product->getDocfiles() )>0){\n foreach ($product->getDocfiles() as $docfile) {\n $docfile->addProduct($product);\n $em->persist($docfile);\n }\n }\n\n if($product->getTags() && count($product->getTags() )>0){\n foreach ($product->getTags() as $tag) {\n $tag->addProduct($product);\n $em->persist($tag);\n }\n }\n\n $em->persist($product);\n $em->flush();\n\n return $this->redirectToRoute('product_show', array('product_id' => $product->getId()));\n }\n\n $this->get('store.setSeo')->setTitle('storebundle.title.new',array(),'storebundle.prefix.products');\n\n return $this->render('LilWorksStoreBundle:Product:new.html.twig', array(\n 'product' => $product,\n 'form' => $form->createView(),\n ));\n }", "public function addProdotto(Request $request, $idFornitore)\n { \n /*$prodotto = new Product();\n $prodotto->nome = $request[\"nome\"];\n $prodotto->descrizione = $request[\"descrizione\"];\n $prodotto->quantita = $request[\"quantita\"];\n $prodotto->quantita = $request[\"quantita\"];\n $prodotto->save();\n */\n $request[\"prezzo\"] = str_replace(\",\", \".\", $request[\"prezzo\"]);\n $request[\"fornitore_id\"] = $idFornitore;\n $prodotto = Product::create($request->all());\n return $prodotto;\n }", "public function run()\n {\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina1.jpg\",\n \"nombre\" => \"Whey Protein\",\n \"descripcion\"=>\"Es un suplemento con amplia evidencia científica y que se encuentra en el grupo A de la clasificación del Instituto Australiano \n del Deporte (AIS), una entidad referente en cuanto a nutrición deportiva.\",\n \"valor\"=>88000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina2.jpg\",\n \"nombre\" => \"Isopure\",\n \"descripcion\"=>\"Isopure proteina cero carbohidratos vainilla - 3 Lb. Suplemento a base de albúmina de huevo en polvo, \n fuente de proteínas de alto valor biológico con el menor contenido de fósforo, potasio y sodio.\",\n \"valor\"=>100000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina3.jpg\",\n \"nombre\" => \"Nitro Tech\",\n \"descripcion\"=>\"Nitrotech 100% Whey Gold de Muscletech es una mezcla de proteína de suero aislada y concentrada de alta calidad y pureza, con péptidos\n de suero lácteo añadidos. Esta proteína tiene una rápida absorción y digestibilidad, ideal para recuperarse después de un entrenamiento.\",\n \"valor\"=>160000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina4.jpg\",\n \"nombre\" => \"Mass Tech\",\n \"descripcion\"=>\"Es un producto de avanzada para ganar masa muscular diseñado para cualquier persona a quien le cueste trabajo aumentar el tamaño, \n que esté en fase de voluminización o deseen adquirir incluso más fuerza.\",\n \"valor\"=>150000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina5.jpg\",\n \"nombre\" => \"Mega Whey\",\n \"descripcion\"=>\"MEGA WHEY PROTEIN es proteína de suero altamente bioasimilable adicionada con: Picolinato de cromo, y un excelente balance de vitaminas; \n de esta manera los deportistas obtienen mejores resultados en comparación con otras fórmulas comunes de proteína de suero.\",\n \"valor\"=>170000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina6.jpg\",\n \"nombre\" => \"Cell Tech\",\n \"descripcion\"=>\"Cell Tech Performance Series de Muscletech es un producto alimenticio en polvo con un 79% de hidratos de carbono de lenta y rápida \n absorción, creatina y aminoácidos esenciales.\",\n \"valor\"=>150000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina7.jpg\",\n \"nombre\" => \"Creatine Power\",\n \"descripcion\"=>\"Por esta compra obtienes la Proteína Megaplex Creatine Power por 10Lb con nueva fórmula que incluye HMB.\n Adicional recibes la bolsa por 2Lb de la versión clásica (hasta agotar existencias).\",\n \"valor\"=>167000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina8.jpg\",\n \"nombre\" => \"Super Mega Gainer\",\n \"descripcion\"=>\"Super mega gainer de GMN es un excelente complemento alimenticio capaz de mejorar en forma notable tu disponibilidad energética \n en el entrenamiento y de aumentar tu masa muscular, peso y fuerza rápidamente\",\n \"valor\"=>50000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina9.jpg\",\n \"nombre\" => \"Hydroxycut Elite\",\n \"descripcion\"=>\"Hydroxycut Hardcore Elite es un super termogénico 4 en 1 con una fórmula que ofrece una experiencia sensorial increíble y que aporta cuatro ventajas distintas:\n Super-termogénesis, Energía extrema, Mayor concentración, Pérdida de peso de gran alcance.\",\n \"valor\"=>98000\n ]);\n }", "public function create()\n {\n $productos=Productos::all();\n if (!empty($productos)) {\n \n return view('atletas.create',compact('productos'));\n } else {\n flash('<i class=\"icon-circle-check\"></i> No existen productos registrados necesarios para registrar un atleta!')->warning()->important();\n return redirect()->back(); \n }\n \n }", "public function createAction(Request $request)\n {\n $dm = $this->get('doctrine_phpcr')->getManager();\n $product = new Product();\n $form = $this->createCreateForm($product);\n $form->handleRequest($request);\n\n $rootProduct = $dm->find(null, '/shop/products');\n $product->setParent($rootProduct);\n $product->setName($product->getTitle());\n $product->setSlug($product->getTitle());\n $product->setInsertDate(new \\Datetime('now'));\n $product->setUpdateDate(new \\Datetime('now'));\n if ($form->isValid()) {\n\n $dm->persist($product);\n $dm->flush();\n\n return $this->redirect($this->generateUrl('caravane_admin_shop_product'));\n }\n\n return $this->render('CaravaneShopBundle:Product:new.html.twig', array(\n 'product' => $product,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('Backend.pages.product.createproduct');\n }", "public function create() {\n\t\t$product = Product::create([\n\t\t\t'title' => '',\n\t\t]);\n\n\t\tif ($product) {\n\t\t\treturn redirect()->route('products.edit', $product->id);\n\t\t}\n\t}", "public function create()\n {\n $sql1 = \"SELECT id, nombre FROM tb_marcas\";\n $marcas = DB::select($sql1);\n $sql2 = \"SELECT id, nombre_tipo_alimento FROM tb_tipos_alimentos\";\n $tipo_alimentos = DB::select($sql2);\n $sql3 = \"SELECT id, nombres FROM tb_dirigidos\";\n $dirigidos = DB::select($sql3);\n return view('productos.crear', compact('marcas', 'tipo_alimentos', 'dirigidos'));\n }", "public function create()\n {\n $title = 'create product';\n $purchases = Purchase::query();\n return view('admin.products.create',compact(\n 'title'\n ));\n }", "public function create()\n {\n return view(\"admin.product.create\");\n }", "public function create(){\n return view(\"admin.addProduct\");\n }", "public function create()\n {\n $categorias = Categoria::get();\n $marcas = Marca::get();\n $medidas = Medida::get();\n return view('productos.create',compact('categorias','marcas','medidas'));\n }", "public function create()\n {\n //\n return view('producte.create');\n\n }", "public function create()\n {\n return view(\"produto.create\");\n }", "public function create()\n {\n $categorias = Categoria::all();\n $marcas = Marca::all();\n \n \n return view('productos.create', [\"categorias\" => $categorias,\"marcas\"=>$marcas]);\n }", "public function actionCreate()\n {\n $model = new Product();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'langs' => $this->getLangs(),\n ]);\n }", "function createProduct(ProductEntity $product)\n {\n $sql = \"INSERT INTO \" . DB_NAME . \".`products`(`name`, `doamine realise`, `tache realisee`, `image`) \n VALUES (:name,:doamine realise,:tache realisee,:image)\";\n try {\n $result = $this->connexion->prepare($sql);\n $data = $result->execute(array(\n ':name' => $product->getName(),\n ':doamine realise' => $product->getDomaine_realise(),\n ':tache realisee' => $product->getTache_realisee(),\n ':image' => $product->getImage()\n ));\n if ($data) {\n return $this->connexion->lastInsertId();\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "public function create()\n {\n //\n\n $matrizListado= SeccionTiendaCategoria::select('id', 'nombre')->get();\n $arrayListado = array();\n\n foreach($matrizListado as $arr) {\n $arrayListado[$arr->id] = $arr->nombre;\n }\n\n return view('adm.seccion_tienda_productos.crear', ['arrayListado' => $arrayListado, 'accion' => 'store', 'verbo' => 'post', 'nombreDeAccion' => 'Crear producto']);\n }", "public function create( $name, $quantity, $price )\n {\n $model = $this->model();\n if ( $model->createNewProduct( $name, $quantity, $price ) )\n echo 'product created';\n else\n echo 'sorry some error whappen';\n }", "public function createProduct() {\n $publishedCategories = Category::where('publicationStatus', 1)->get();\n $publishedManufacturers = Manufacturer::where('publicationStatus', 1)->get();\n return view('admin.product.createProduct', ['publishedCategories' => $publishedCategories, 'publishedManufacturers' => $publishedManufacturers]);\n }", "public function producto(){\n\t \t$this->load->template('catalogo_producto');\n\t }", "public function createProduct(Product $product) {\n $stmt = $this->db->prepare(\"insert into product values (0, :username, :title, :description, :price, :category, :image, 1);\");\n $stmt->bindValue(\"username\", $product->getUsername(), PDO::PARAM_STR);\n $stmt->bindValue(\"title\", $product->getTitle(), PDO::PARAM_STR);\n $stmt->bindValue(\"description\", $product->getDescription(), PDO::PARAM_STR);\n $stmt->bindValue(\"price\", $product->getPrice(), PDO::PARAM_STR);\n $stmt->bindValue(\"category\", $product->getCategory(), PDO::PARAM_STR);\n $stmt->bindValue(\"image\", $product->getImage(), PDO::PARAM_STR);\n $stmt->execute();\n }", "public function create($request) {\n\n\t\t$image = $request['photo'];\n\t\tif($image !== null) {\n\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t$request['photo'] = $name;\n\t\t} else {\n\t\t\t$request['photo'] = \"product-empty.png\";\n\t\t}\n\t\t$request['user_id'] = auth()->user()->id;\n\t\treturn $this->product->create($request);\n\t}", "public function actionCreate()\n {\n /* @var $modelProduct \\common\\models\\Product */\n\n $modelProduct = Product::findOne(Yii::$app->session->get('tempId'));\n\n if(!isset($modelProduct)):\n Yii::$app->session->remove('tempModel');\n Yii::$app->session->remove('tempId');\n endif;\n\n if (isset($modelProduct) && $modelProduct->load(Yii::$app->request->post())):\n if($modelProduct->updateObject($modelProduct)):\n return $this->redirect(['view', 'id' => $modelProduct->id]);\n endif;\n endif;\n\n if(Yii::$app->session->get('tempModel') != 'Product'):\n\n $modelProduct = new Product();\n $modelProduct = $modelProduct->createObject();\n endif;\n\n return $this->render('create', [\n 'modelProduct' => $modelProduct,\n ]);\n }", "public function create()\n {\n $loaigiay = loaigiay::join('theloai' , 'theloai.id_theloai', '=' ,'loaigiay.id_theloai' )->select('loaigiay.*' , 'theloai.name as theloainame')->get();\n return view('admin.add_product' , ['loaigiays' => $loaigiay]);\n }", "public function actionCreateForm()\n\t{\n\t\t$model=new TProducto;\n\t\t$modelInventario=new TInventario;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProducto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProducto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_almacen));\n\t\t}\n\t\tYii::app()->theme = 'admin';\n\t\t$this->layout ='//layouts/portalAdmin';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'modelInventario'=>$modelInventario\n\t\t));\n\t}", "function createProduct($params = array()){\n\t\t\n\t\t//echo json_encode($params['data']); die();\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::POST , '/multivendor/product/create/product.json' , false, $params['data'] ),true);\n\t}", "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 create(Productquestion $productquestion)\n {\n //\n }", "public function actionCreate()\n {\n $model = new Product();\n $model->scenario = 'create';\n $sku = \\app\\helpers\\AppHelper::generateSkuProduct();\n $model->SKU = $sku;\n if ($model->load(Yii::$app->request->post())) {\n $request = Yii::$app->request->bodyParams;\n $model->is_active = 1;\n $model->created_at = date('Y-m-d H:i:s');\n $model->updated_at = date('Y-m-d H:i:s');\n if (isset($request['Product']['quantity']) && $request['Product']['quantity'] != \"\") {\n $model->remaining_quantity = $request['Product']['quantity'];\n }\n if ($model->save()) {\n if (isset($request['Product']['quantity']) && $request['Product']['quantity'] != \"\") {\n $productQty = new \\app\\models\\ProductStock();\n $productQty->product_id = $model->product_id;\n $productQty->quantity = $request['Product']['quantity'];\n $productQty->created_date = date('Y-m-d H:i:s');\n $productQty->save();\n }\n Yii::$app->session->setFlash('success', 'Product successfully added');\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function newprodadd()\n {\n $kcalnewprod = $_POST['kcalnewprod'];\n $namenewprod = $_POST['namenewprod'];\n //Tworze instancje obiektu klasy NewprodPrototype (dodawania nowego produktu do sesji), i dodaje nowy produkt (pierwszy)\n $NewProductObject = new NewprodPrototype($namenewprod[0],$kcalnewprod);\n $NewProductObject->setNameAndKcalToSession();\n\n //Sprawdzam czy jest ich więcej ( wtedy skopiuje produkt używając Prototypu)\n if(count($namenewprod)>1)\n {\n //jeśli tak usuń pierwszy element (dodany już) i za pomocą prototypu dodawaj następne\n array_shift($namenewprod);\n\n foreach ($namenewprod as $namenewPRD)\n {\n //używam wbudowanej implementacji w php (clone) bazującej na wzorcu prototypu\n $newProduct_NewObject = clone $NewProductObject;\n //kopiuje obiekt i do skopiowanego obiektu zmieniam tylko nazwę (modyfikuję skopiowany obiekt) ( bo kalorie pozostawiam takie same )\n $newProduct_NewObject->setNameAndKcalToSession($namenewPRD);\n }\n }\n //\n\n return redirect('/');\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 newProduct($options = array())\n {\n return $this->newItem(\"product\", \"products\", $options);\n }", "public function testAdminNewProduct(): void\n {\n $name = 'Product Title '.mt_rand();\n $summary = $this->generateRandomString(255);\n $content = $this->generateRandomString(1024);\n $price = 600900;\n //$imageUrl = \"https://telecomtalk.info/wp-content/uploads/2020/05/bsnl-rs2-prepaid-plan-extension-you-should-know.jpg\";\n \n $client = static::createClient([], [\n 'PHP_AUTH_USER' => 'vandana_admin',\n 'PHP_AUTH_PW' => 'vandana@admin',\n ]);\n\n $crawler = $client->request('POST', '/en/admin/product/new');\n $form = $crawler->selectButton('Create product')->form([\n 'product[name]' => $name,\n 'product[summary]' => $summary,\n 'product[content]' => $content,\n 'product[price]' => $price,\n //'product[imageUrl]' => $imageUrl,\n ]);\n $client->submit($form);\n\n /** @var \\App\\Entity\\Product $product */\n $product = self::$container->get(ProductRepository::class)->findOneBy(array('name' => $name));\n $this->assertNotNull($product);\n $this->assertSame($name, $product->getName());\n $this->assertSame($content, $product->getContent());\n }", "public function create()\n {\n //\n $vendor = Vendor::all();\n $category = Category::all();\n return view('admin.superadmin.products.product_create', compact('category', 'vendor'));\n }", "public function create()\n\t{\n\t\t$clientes = Cliente::orderBy('razon_social')->lists('razon_social','id');\n\t\t$tiposProducto = TipoProducto::all()->lists('tipo','id');\n\t\treturn View::make('productos.create')->with(compact('clientes','tiposProducto'));\n\t}", "public function create()\n {\n $cmp_id = Session::get('cmp_id');\n $gro_id = Session::get('gro_id');\n $tipos = Productype::getTipoProductos($gro_id);\n if ($gro_id ==1) {\n return view('product.gasolineras.form_create',compact('tipos'));\n }\n if ($gro_id ==2) {\n return view('product.farmacias.form_create',compact('tipos'));\n }\n }", "public function create()\n {\n $categorys = ['eletronicos', 'moveis', 'limpeza'];\n\n return view('painel.products.create-edit', compact('categorys'));\n /*\n $insert = $this->product->create([\n 'name' => 'celular',\n 'number' => 123,\n 'active' => false,\n 'category' => 'eletronicos',\n 'description' => 'Descrição do celular'\n ]);\n if ($insert)\n return \"{$insert->name} inserido com sucesso\";\n else\n return 'O produto não foi inserido';\n */\n }", "public function create()\n {\n $data['purchase_type'] = Config(\"constanta.purchase_type\");\n $data['currency'] = Config(\"constanta.currency\");\n $data['solicitation_type'] = Config(\"constanta.solicitation_type\");\n $data['product'] = KodamiProduct::select('name', 'id', 'name_alias')->where('status', 1)->get();\n return view('request_for_quotation.add', $data);\n }", "public function create() {\n //mostramos el formulario para crear el producto\n $datos = array(\n \"categorias\" => \\App\\Categoria::all()\n );\n return view(\"admin.producto.create\", $datos);\n }", "public function create()\n {\n $product=new Producto();\n return view(\"producto.create\",[\"product\"=>$product]);\n }", "function create(Request $request) {\n // create order\n $data = [\n 'client_name' => $request->client_name,\n 'date' => $request->order_date,\n ];\n $order = $this->orders->create($data);\n\n // add products to order\n $num_products = $this->products->numProducts();\n for($i = 1; $i < $num_products + 1; $i++) {\n $key = 'product-' . $i;\n if($request[$key] != null) {\n $this->orders->addProduct($order->id, $i, $request[$key]);\n } \n }\n Redirect::to('encomendas');\n }", "public function create()\n {\n \n //取得商品分类数据\n $cates=PcatesController::category();\n //取得规格数据\n $propertys=PropertyName::all();\n //处理规格数据\n $arr=[];\n foreach($propertys as $k=>$v){\n //dd($v->properties);\n $zu=json_decode($v->properties,true);\n //dd($zu);\n $da=$this->array_group($zu,'name');\n $da=$this->orders($da);\n //dd($da);\n //将模板id作为键\n $arr[$v->id]=$da;\n }\n //dump($arr);\n $json=json_encode($arr);\n //取得品牌数据\n $brands=ProductBrand::all();\n return view('admin.product.create',['cates'=>$cates,'propertys'=>$propertys,'brands'=>$brands,'json'=>$json]);\n }", "public function create() {\n $facilities = $this->facilitiesRepo->readFacilitiesByParentAdmin();\n $options1 = $this->productRepo->allProduct(\\App\\Product::TYPE_PRODUCT);\n $product_html = \\App\\Helpers\\StringHelper::getSelectOptions($options1);\n $type = \\Auth::user()->user_type_id;\n if($type == 3){\n $item = $this->productRepo->allProduct();\n }\n else if($type == 1){\n $item = $this->productRepo->allProductByUser();\n }\n return view('backend/room/create', compact('product_html', 'facilities','item'));\n }" ]
[ "0.733163", "0.71831304", "0.7003944", "0.69842696", "0.69713396", "0.69697905", "0.6960777", "0.6863722", "0.6853565", "0.68507814", "0.6840837", "0.68188107", "0.68133605", "0.67986137", "0.6774684", "0.6757803", "0.67554367", "0.67503875", "0.6734602", "0.67060286", "0.6677231", "0.6667531", "0.6657177", "0.66483945", "0.66099083", "0.66034025", "0.65931904", "0.65840614", "0.65840477", "0.6559282", "0.6552104", "0.6551343", "0.65511554", "0.6542263", "0.6535866", "0.653004", "0.652096", "0.6519954", "0.6483887", "0.6477272", "0.6465985", "0.6456941", "0.64545614", "0.6444372", "0.64278996", "0.642514", "0.642377", "0.6421927", "0.64152217", "0.64076257", "0.640196", "0.64002824", "0.6385245", "0.63718283", "0.6369307", "0.6360536", "0.6360382", "0.63588923", "0.63567775", "0.63408136", "0.6339368", "0.6335602", "0.633188", "0.633084", "0.6329522", "0.63251126", "0.6316826", "0.63121504", "0.6304647", "0.6300802", "0.63005394", "0.6297921", "0.629527", "0.6293691", "0.6291489", "0.6289856", "0.6285533", "0.62852365", "0.6281905", "0.62814987", "0.6268389", "0.6264836", "0.6259273", "0.62401205", "0.6237976", "0.62378275", "0.6234437", "0.62252986", "0.6225226", "0.6224705", "0.62246096", "0.62201184", "0.6217868", "0.6217768", "0.6215556", "0.62131155", "0.62109375", "0.6204709", "0.620273", "0.62017083" ]
0.64570296
41
Intenta modificar una cerveza y modificar su foto si fue subida nuevamente
public function updateProducto(Producto $p, $params) { // Proceso imagen $foto = $params['foto']; $path_imagen = $p->getRutaImagen(); if (isset($foto) && $foto['error'] !== UPLOAD_ERR_NO_FILE) { if ($this->resizeImage($foto, 'productos', $path_imagen)) { unlink($p->getRutaImagen()); // Borro la anterior } else { return false; } } $this->initProducto($p, $params, $path_imagen); $p->setModificadoEn(Utils::getCurrentTimestamp()); $p->update(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ctrActualizarPerfil()\n {\n if (isset($_POST['editarNombre'])) {\n\n\n /*====================================*/\n /*VALIDAR IMAGEN QUE SUBE COMO FOTO*/\n /*====================================*/\n $ruta = \"\";\n $directorio = \"vistas/img/usuarios/{$_POST['idUsuario']}\";\n if (isset($_FILES['datosImagen']['tmp_name'])) {\n\n //primero preuntamos si existe otra imagen en la base de datos\n if (!empty($_POST['foto'])) { // valido el post oculto de foto\n unlink($_POST['foto']); //eliminamos el archivo en el hosting\n unlink($directorio);\n } else {\n // si no existe ninguna imagen, creamos el directorio\n @mkdir($directorio, 0755); // pasamos el directorio, y los permisos\n }\n\n\n $aleatorio = mt_rand(100, 999);\n $ruta = \"vistas/img/usuarios/{$_POST['idUsuario']}/\" . $aleatorio . \".jpg\"; // ruta de la foto a almcenar\n\n //Modificamos tamaño de la foto\n //capturao en un array las medidas ancho y alto\n // list (0 , 1) // indices\n list($ancho, $alto) = getimagesize($_FILES['datosImagen']['tmp_name']);\n\n $nuevoAncho = 500;\n $nuevoAlto = 500;\n\n\n /*=====================================*/\n /*SOLO SIRVE PARA IAMGEN JPG JPEG*/\n /*=====================================*/\n\n //creamos una nueva imagen\n $origen = imagecreatefromjpeg($_FILES['datosImagen']['tmp_name']);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n //cortamos la imagen pasando los parametros\n //(destino, origen, posicionx, posiciony, )\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n\n\n }\n\n\n //validacion si se escibio algo en el input de contraseña\n if ($_POST['editarPassword'] != \"\") {\n $password = $_POST['passUsuario'];\n } else {\n\n $password = crypt($_POST['editarPassword'], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\n }\n\n\n $datos = [\n 'nombre' => $_POST['editarNombre'],\n 'email' => $_POST['editarEmail'],\n 'password' => $password,\n 'foto' => $ruta,\n 'id' => $_POST['idUsuario']\n ];\n\n $tabla = 'usuarios';\n $respuesta = @ModeloUsuarios::mdlActualizarPerfil($tabla, $datos);\n\n if ($respuesta == 'ok') {\n //si se ejcuto el update, actualizacmos las variables de sesion del usuario\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $datos['id'];\n $_SESSION['nombre'] = $datos['nombre'];\n $_SESSION['foto'] = $datos['foto'];\n $_SESSION['email'] = $datos['email'];\n $_SESSION['password'] = $datos['password'];\n $_SESSION['modo'] = $_POST['modoUsuario'];\n\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡OK!\",\n\t\t\t\t\t\t\t\t text: \"¡Su cuenta ha sido actualizada correctamente\",\n\t\t\t\t\t\t\t\t type:\"success\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>';\n\n }\n\n }\n }", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "function modificar()\n {\n if (isset($_POST[\"nombre\"])) {\n \n $datos[\"numero\"] = $_GET[\"numero\"];\n \n if (isset($_POST[\"nombre\"])) {\n $datos[\"nombre\"] = $_POST[\"nombre\"];\n }\n if (isset($_POST[\"tipo1\"])) {\n $datos[\"tipo1\"] = $_POST[\"tipo1\"];\n }\n if (isset($_POST[\"tipo2\"])) {\n $datos[\"tipo2\"] = $_POST[\"tipo2\"];\n }\n if (isset($_POST[\"descripcion\"])) {\n $datos[\"descripcion\"] = $_POST[\"descripcion\"];\n }\n \n if ($_FILES && isset($_FILES[\"imagen\"]) && $_FILES[\"imagen\"][\"size\"] != 0) {\n $datos[\"imagen\"] = time() . \"_imagen_\" . $_FILES[\"imagen\"][\"name\"];\n if (!$this->upLoadFile->guardarImagen($_FILES[\"imagen\"], $datos[\"imagen\"])) {\n $this->falla();\n }\n }\n \n if ($_FILES && isset($_FILES[\"sprite\"]) && $_FILES[\"sprite\"][\"size\"] != 0) {\n $datos[\"sprite\"] = time() . \"_sprite_\" . $_FILES[\"sprite\"][\"name\"];\n if (!$this->upLoadFile->guardarImagen($_FILES[\"sprite\"], $datos[\"sprite\"])) {\n $this->falla();\n }\n }\n \n if ($this->pokemonModel->updatePokemon($datos)) {\n $_SESSION[\"mensaje\"][\"mensaje\"] = \"Pokemon modificado con exito\";\n $_SESSION[\"mensaje\"][\"class\"] = \"w3-pale-green \";\n header('Location: /');\n } else {\n $_SESSION[\"mensaje\"][\"mensaje\"] = \"Error al actualizar el pokemon\";\n $_SESSION[\"mensaje\"][\"class\"] = \"w3-pale-red \";\n $this->falla();\n }\n \n } //Si no, llamo a la vista con los datos\n else {\n $this->falla();\n }\n }", "public static function ModificarHelado($sabor,$precio,$foto){\r\n\r\n if(Helado::VerificarHelado($sabor)==\"El sabor esta\"){\r\n \r\n $direc=fopen(\"./helados/sabores.txt\",\"r\");\r\n $listadoHelados=\"\";\r\n \r\n while(!feof($direc)){\r\n\r\n $helado=fgets($direc);\r\n\r\n if($helado==\"\"){\r\n continue;\r\n }\r\n\r\n $heladoSeparado=explode(\"-\",$helado);\r\n\r\n if($heladoSeparado[0]==$sabor){\r\n echo \"s\";\r\n $heladoSeparado[1]=$precio;\r\n $destino=\"./heladosImagen/\".$sabor.\".\".date(\"His\").\".jpg\";\r\n move_uploaded_file($foto,$destino);\r\n\r\n unlink(\"C:/xampp/htdocs/PracticaParcialPRO/Programacion3/PracticaPP2/heladosImagen/\".trim($heladoSeparado[2]));\r\n echo $heladoSeparado[2];\r\n $heladoSeparado[2]=pathinfo($destino,PATHINFO_FILENAME).\".jpg\";\r\n echo $heladoSeparado[2];\r\n $helado=$heladoSeparado[0].\"-\".$heladoSeparado[1].\"-\".$heladoSeparado[2].\"\\r\\n\";\r\n \r\n }\r\n\r\n $listadoHelados.=$helado;\r\n \r\n }\r\n //echo $listadoHelados;\r\n fclose($direc);\r\n\r\n $direc=fopen(\"./helados/sabores.txt\",\"w\");\r\n\r\n if(0<fwrite($direc,$listadoHelados)){\r\n\r\n return \"Se modifico correctamente..\";\r\n }\r\n\r\n fclose($direc);\r\n\r\n }\r\n\r\n }", "function actualizarDatos(){\n $e = new Empresa();\n \n $e->ruc = $_POST['ruc'];\n\n $imagenName = $_FILES['file']['name']; \n\n if($_POST['nameimage'] ==\"\"){\n\n \n \n //-------- MODIFIED NAME --------------\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n //copy($imagenTemp,$imagenUrl);\n }else{\n \n\n $eliminarimage = \"./vistas/panel_usuario/logoemp/\" . $_POST['nameimage'];\n unlink($eliminarimage);\n\n $extension = pathinfo($imagenName, PATHINFO_EXTENSION);\n $random = rand(0,99);\n $rename = $random.date('Ymd').$imagenName;\n $newname = $rename;\n //for obtain extension of image .'.'.$extension\n $imageurl = \"./vistas/panel_usuario/logoemp/\" . $newname;\n \n $imagenTemp = $_FILES['file']['tmp_name'];\n move_uploaded_file($imagenTemp, $imageurl);\n\n }\n //ad in controller \n $e->logo = $newname;\n $e->logoUrl = $imageurl;\n\n $e->emailEmp = str_replace(\" \",\"\",$_POST['email']);\n $e->descripcion = trim($_POST['descripcion']);\n $e->direccion = trim($_POST['direccion']);\n $e->distrito = $_POST['distrito'];\n $e->telefono = $_POST['telefono'];\n $e->whatsapp = $_POST['whatsapp'];\n $e->facebook = trim($_POST['facebook']);\n $e->instagram = trim($_POST['instagram']);\n if (empty($e->descripcion) || empty($e->direccion) || $_POST['departamento'] == '0' || strlen($e->telefono) != 9 || strlen($e->whatsapp) > 9) {\n return ['bool' => false, 'msg' => 'datosIncorrectos'];\n }\n return ($this->modelo->actualizarEmpresa($e)) ?\n $this->modelo->buscarByRuc($e->ruc) :\n ['bool' => true, 'msg' => 'problemaSQL'];\n }", "function modificaAutore()\n{\n global $connection;\n $_SESSION['authorModifySuccess'] = false;\n $_SESSION['authorModifyError'] = false;\n $_SESSION['extModifyError'] = false;\n\n if (isset($_POST['modificaAutore'])) {\n $nome = mysqli_real_escape_string($connection, $_POST['nomeModal']);\n $cognome = mysqli_real_escape_string($connection, $_POST['cognomeModal']);\n $citta = mysqli_real_escape_string($connection, $_POST['cittaModal']);\n $descrizione = mysqli_real_escape_string($connection, $_POST['descrizioneModal']);\n\n $photo = mysqli_real_escape_string($connection, $_FILES['fotoModal']['name']);\n $photoLocationFolder = '../../../image/autoreImg/';\n $photoPath = $photoLocationFolder.$photo;\n $extArrPhoto = ['jpg', 'jpeg', 'png'];\n $extPhoto = pathinfo($photoPath, PATHINFO_EXTENSION);\n $extPhoto = strtolower($extPhoto);\n $photoTimestampTitle = time().'.'.$extPhoto;\n $photoPathNew = $photoLocationFolder.$photoTimestampTitle;\n\n $facebook = mysqli_real_escape_string($connection, $_POST['facebookModal']);\n $twitter = mysqli_real_escape_string($connection, $_POST['twitterModal']);\n $linkedin = mysqli_real_escape_string($connection, $_POST['linkedinModal']);\n $instagram = mysqli_real_escape_string($connection, $_POST['instagramModal']);\n\n $autoreId = $_POST['autoreIdModal'];\n\n if (in_array($extPhoto, $extArrPhoto)) {\n if (move_uploaded_file($_FILES['fotoModal']['tmp_name'], $photoPathNew)) {\n $update_autore = \"UPDATE autore_video SET nome_autore='$nome', cognome_autore='$cognome', citta_autore = '$citta', desc_autore = '$descrizione', img_autore = '$photoTimestampTitle', fb_autore = '$facebook', linkedin_autore = '$linkedin', twitter_autore = '$twitter', insta_autore = '$instagram'\n WHERE id_autore='$autoreId'\";\n\n $result_update_autore = mysqli_query($connection, $update_autore);\n if ($result_update_autore) {\n $_SESSION['authorModifySuccess'] = true;\n } else {\n $_SESSION['authorModifyError'] = true;\n }\n }\n } else {\n $_SESSION['extModifyError'] = true;\n }\n }\n}", "static public function ctrActualizarMarca()\n {\n\n if (isset($_POST[\"editNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \n \"nombre\" => $_POST[\"editNomMarca\"],\n \"idMarca\" => $_POST[\"editIdMarca\"]\n );\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, false);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n /*=============================================\n VALIDAR LA EXISTENCIA DE LA IMAGEN\n =============================================*/\n if (isset($_FILES[\"editfotoMarca\"][\"tmp_name\"]) && $_FILES[\"editfotoMarca\"][\"tmp_name\"] != \"\") {\n list($ancho, $alto) = getimagesize($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Preguntar si existe una Imagen en la BD\n if (!empty($_POST[\"editFotoActualMarca\"])) {\n unlink($_POST[\"editFotoActualMarca\"]);\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n\n #Valida si existe el directorio y con la imagen actual\n if (file_exists($directorioActual)) {\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n } else {\n mkdir(\"views/img/Marcas/\" . $_POST[\"editNomMarca\"], 0755);\n }\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"editfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"editfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n } else { #En caso de no venir una imagen nueva\n #Asigna la ruta actual que tiene el producto\n $ruta = $_POST[\"editFotoActualMarca\"];\n if ($ruta) { #Evaluar si el producto tiene un imagen o no en la ruta actual\n #Separa la ruta\n $valoresRuta = explode(\"/\", $ruta);\n #Obtiene el nombre de la imagen\n $nombreImagen = $valoresRuta[4];\n #Asinga un nueva ruta cambiando el nombre de la carpeta por el nuevo nombre del producto\n $ruta = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"] . \"/\" . $nombreImagen;\n } else {\n #Deja la ruta vacía en caso de que el producto no tenga una imagen asignada\n $ruta = \"\";\n }\n\n #Ruta Actual\n $directorioActual = \"views/img/Marcas/\" . $_POST[\"editNomActualMarca\"];\n #Ruta Nueva\n $directorioNuevo = \"views/img/Marcas/\" . $_POST[\"editNomMarca\"];\n rename($directorioActual, $directorioNuevo);\n }\n\n $datos += [\"foto\" => $ruta];\n\n $actualizar = ModeloMarca::mdlActualizarMarca($tabla, $datos);\n\n return $actualizar;\n }\n }\n }", "static function changePhoto() {\n\t\t\n\t\t$case_intra = rcube_utils::get_input_value('photo_intra', RCUBE_INPUT_POST);\n\t\t$case_ader = rcube_utils::get_input_value('photo_ader', RCUBE_INPUT_POST);\n\n\t\t$info = array();\n\t\tif ( !empty($case_intra) && $case_intra == '1') {\n\t\t\t$info['mineqpublicationphotointranet'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotointranet'] = 0;\n\t\t}\n\t\t\n\t\tif ( !empty($case_ader) && $case_ader == '1' && !empty($case_intra) && $case_intra == '1')\n\t\t{\n\t\t\t$info['mineqpublicationphotoader'] = 1;\n\t\t} else {\n\t\t\t$info['mineqpublicationphotoader'] = 0;\n\t\t}\n\t\t\t\n\t\t$user_infos = melanie2::get_user_infos(Moncompte::get_current_user_name());\n\t\t\n\t\t$user_dn = $user_infos['dn'];\n\t\t$password = rcmail::get_instance()->get_user_password();\n\t\t\n\t\t$auth = Ldap::GetInstance(Config::$MASTER_LDAP)->authenticate($user_dn, $password);\n\t\t\n\t\tif(Ldap::GetInstance(Config::$MASTER_LDAP)->modify($user_dn, $info)) {\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_ok', 'melanie2_moncompte'), 'confirmation');\n\t\t} else {\n\t\t\t$err = Ldap::GetInstance(Config::$MASTER_LDAP)->getError();\n\t\t\trcmail::get_instance()->output->show_message(rcmail::get_instance()->gettext('photo_pub_nok', 'melanie2_moncompte') . $err, 'error');\n\t\t}\n\t\t\n\t}", "function modificationCompte() {\n\t\tif (isset($_POST['name']) || isset($_POST['email']) || isset($_POST['birthday'])) {\n\t\t\tif ($this -> modele -> verifExist($_POST['email']) && $_SESSION['id'] != $this -> modele -> getId($_POST['email']))\n\t\t\t\t$this -> compte($this -> vue -> existeDeja($_POST['email']));\n\t\t\telse {\n\t\t\t\t$valide = 1;\n\t\t\t\t// Image\n\t\t\t\tif ($_FILES['photo']['name'] == '')\n\t\t\t\t\t$dir = $this -> modele -> getCompte($_SESSION['id'])[6];\n\t\t\t\telse {\n\t\t\t\t\t$target_chemin = \"img/profil/\";\n\t\t\t\t\t$target_fichier = $target_chemin . basename($_FILES['photo']['name']);\n\t\t\t\t\t$imageType = strtolower(pathinfo($target_fichier, PATHINFO_EXTENSION));\n\t\t\t\t\t$dir = $target_chemin . \"profil_\" . $_SESSION['id'] . \".png\";\n\n\t\t\t\t\tif (isset($_POST[\"submit\"])) {\n\t\t\t\t\t\tif (!getimagesize($_FILES['photo']['tmp_name'])) {\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> photoEchec());\n\t\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($imageType != \"jpg\" && $imageType != \"png\" && $imageType != \"jpeg\" && $imageType != null) {\n\t\t\t\t\t\t$this -> compte($this -> vue -> photoMauvaisFormat());\n\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($_FILES['photo']['size'] > 2097152 || $_FILES['photo']['size'] == 0) {\n\t\t\t\t\t\t$this -> compte($this -> vue -> photoVolumineux());\n\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($valide == 1) {\n\t\t\t\t\t\tif (move_uploaded_file($_FILES['photo']['tmp_name'], $target_fichier))\n\t\t\t\t\t\t\trename($target_fichier, $dir);\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> photoEchec());\n\t\t\t\t\t\t\t$valide = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($valide == 1) {\n\t\t\t\t\tif ($_POST['birthday'] == $this -> modele -> getCompte($_SESSION['id'])[4] && $_POST['name'] == '' && $_POST['email'] == '' && $_FILES['photo']['name'] == '')\n\t\t\t\t\t\t$this -> compte($this -> vue -> aucuneModification());\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($this -> modele -> update($this -> modele -> getCompte($_SESSION['id']), $_POST['name'] != '' ? $_POST['name'] : $this -> modele -> getCompte($_SESSION['id'])[1], $_POST['email'] != '' ? $_POST['email'] : $this -> modele -> getCompte($_SESSION['id'])[2], $_POST['birthday'], $dir)) {\n\t\t\t\t\t\t\tif ($_POST['email'] != '') {\n\t\t\t\t\t\t\t\tunset($_SESSION['id']);\n\t\t\t\t\t\t\t\tsession_destroy();\n\t\t\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t\t\t$_SESSION['id'] = $this -> modele -> getId($_POST['email']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> modificationFaite());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this -> compte($this -> vue -> erreurModification());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\telse\n\t\t\t$this -> compte($this -> vue -> erreurModification());\n\t}", "static public function ctrEditarAtencionCPANEL(){\r\n\t\t\tif (isset($_POST[\"editarCodigo\"])){\r\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarUser\"])){\r\n\r\n\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t= VALIDAR IMAGEN =\r\n\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t$ruta = $_POST[\"fotoActual2\"];\r\n\r\n\r\n\t\t\t\t\tif (isset($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]) && !empty($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"])){\r\n\r\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]);\r\n\r\n\t\t\t\t\t\t$nuevoAncho = 791;\r\n\t\t\t\t\t\t$nuevoAlto = 1024;\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= CREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t$directorio = \"vistas/img/atenciones/\".$_POST[\"editarFotoDiagnostico\"];\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= PRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif (!empty($_POST[\"fotoActual2\"])){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual2\"]);\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t= DE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP =\r\n\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"editarFotoDiagnostico\"][\"type\"] == \"image/jpeg\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"editarCodigo\"].\"/\".$aleatorio.\".jpg\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ($_FILES[\"editarFotoDiagnostico\"][\"type\"] == \"image/png\"){\r\n\r\n\t\t\t\t\t\t\t/*=============================================\r\n\t\t\t\t\t\t\t= GUARDAMOS LA IMAGEN EN EL DIRECTORIO =\r\n\t\t\t\t\t\t\t=============================================*/\r\n\r\n\t\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\r\n\t\t\t\t\t\t\t$ruta = \"vistas/img/atenciones/\".$_POST[\"editarCodigo\"].\"/\".$aleatorio.\".png\";\r\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFotoDiagnostico\"][\"tmp_name\"]);\r\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\r\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\r\n\t\t\t\t\t\t\timagepng($destino, $ruta);\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t$tabla = \"atencion\";\r\n\r\n\t\t\t\t\t\t$datos = array(\"id_atencion\" => $_POST[\"idAtencion\"],\r\n\t\t\t\t\t\t\t\t\t \"codigo_atencion\" => $_POST[\"editarCodigo\"],\r\n\t\t\t\t\t\t\t\t\t \"id_usuario\" => $_POST[\"editarUser\"],\r\n\t\t\t\t\t\t\t\t\t \"id_personal_salud\" => $_POST[\"editarPersonalSalud2\"],\r\n\t\t\t\t\t\t\t\t\t \"id_paciente\" => $_POST[\"editarPaciente2\"],\r\n\t\t\t\t\t\t\t\t\t \"ups\" => $_POST[\"editarUps2\"],\r\n\t\t\t\t\t\t\t\t\t \"servicio\" => $_POST[\"editarServicio2\"],\r\n\t\t\t\t\t\t\t\t\t \"especialidad\" => $_POST[\"editarEspecialidad2\"],\r\n\t\t\t\t\t\t\t\t\t \"diagnostico\" => $_POST[\"editarDiagnostico2\"],\r\n\t\t\t\t\t\t\t\t\t \"imagen_diagnostico\" => $ruta,\r\n\t\t\t\t\t\t\t\t\t \"fecha_atencion\" => $_POST[\"editarFechaAtencion2\"]);\r\n\r\n\t\t\t\t\t\t$respuesta = ModeloAtenciones::mdlEditarAtenciones($tabla, $datos);\r\n\r\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\r\n\t\t\t\t\t\t\t\t\t\ttitle: \"¡La Atención ha sido modificada correctamente!\",\r\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t \t\t </script>';\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\techo '<script>\r\n\r\n\t\t\t\t\t\t\tswal({\r\n\t\t\t\t\t\t\t\ttype: \"error\",\r\n\t\t\t\t\t\t\t\ttitle: \"¡La Atención no puede ir vacía o llevar caracteres especiales !\",\r\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\r\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\r\n\t\t\t\t\t\t\t\t}).then((result)=>{\r\n\t\t\t\t\t\t\t\t\tif(result.value){\r\n\r\n\t\t\t\t\t\t\t\t\t\twindow.location = \"historias-clinicas-crear\";\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\t </script>';\r\n\r\n\t\t\t}\r\n\t\t }\r\n\t\t/*===== FIN editar antenciones CPANEL ======*/\t\t\t\t\t\r\n\t }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public static function modifImage($fichier,$id){\r\n $im = ModelProgramme::getImage($id);\r\n $var = str_replace(\"images/\",\"\",$im);\r\n $fichier=\"images/\".$var;\r\n $fichier= str_replace(\" \",\"\",$fichier);\r\n $array = array(\r\n \"suppression\" => \"bar\",\r\n \"edit\" => \"foo\",\r\n );\r\n\r\n\r\n\r\n if (file_exists($fichier)) {\r\n if (@unlink($fichier)) {\r\n $array[\"suppression\"]=\"Suppression de $fichier réussite </br>\";\r\n } else {\r\n $array[\"suppression\"]=\"Echec de suppression de $fichier : $php_errormsg\";\r\n }\r\n } else {\r\n $array[\"suppression\"]=\"Le fichier $fichier n'existe pas </br>\";\r\n\r\n }\r\n\r\n // Vérifier si le formulaire a été soumis\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\r\n // Vérifie si le fichier a été uploadé sans erreur.\r\n if (isset($_FILES[\"photo\"]) && $_FILES[\"photo\"][\"error\"] == 0) {\r\n $allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\r\n $filename = $_FILES[\"photo\"][\"name\"];\r\n $filetype = $_FILES[\"photo\"][\"type\"];\r\n $filesize = $_FILES[\"photo\"][\"size\"];\r\n\r\n // Vérifie l'extension du fichier\r\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n if (!array_key_exists($ext, $allowed)) die(\"Erreur : Veuillez sélectionner un format de fichier valide.\");\r\n\r\n // Vérifie la taille du fichier - 5Mo maximum\r\n $maxsize = 5 * 1024 * 1024;\r\n if ($filesize > $maxsize) die(\"Error: La taille du fichier est supérieure à la limite autorisée.\");\r\n\r\n // Vérifie le type MIME du fichier\r\n if (in_array($filetype, $allowed)) {\r\n // Vérifie si le fichier existe avant de le télécharger.\r\n if (file_exists(\"upload/\" . $_FILES[\"photo\"][\"name\"])) {\r\n $array[\"edit\"]=$_FILES[\"photo\"][\"name\"] . \" existe déjà.\";\r\n\r\n } else {\r\n move_uploaded_file($_FILES[\"photo\"][\"tmp_name\"], \"images/\" . $_FILES[\"photo\"][\"name\"]);\r\n $array[\"edit\"]= \"Votre fichier a été téléchargé avec succès. \".$_FILES[\"photo\"][\"name\"];\r\n\r\n\r\n $adresse = \"images/\".$filename;\r\n $adresse = str_replace(\" \",\"\",$adresse);\r\n ModelProgramme::update($id,\"urlImage\",$adresse);\r\n }\r\n } else {\r\n $array[\"edit\"]= \"Error: Il y a eu un problème de téléchargement de votre fichier. Veuillez réessayer.\";\r\n }\r\n } else {\r\n echo \"Error: \" . $_FILES[\"photo\"][\"error\"];\r\n }\r\n\r\n }\r\n return $array;\r\n }", "public function modificar()\n {\n $resp = false;\n $base = new BaseDatos();\n $sql = \"UPDATE archivocargado SET acnombre='\" . $this->getAcNombre() . \"', acdescripcion='\" . $this->getAcDescripcion() . \"', acicono='\" . $this->getAcIcono() . \"', idusuario=\" . $this->getObjUsuario()->getIdUsuario() . \", aclinkacceso='\" . $this->getAcLinkAcceso() . \"', accantidaddescarga=\" . $this->getAcCantidadDescarga() . \", accantidadusada=\" . $this->getAcCantidadUsada() . \", acfechainiciocompartir='\" . $this->getAcFechaInicioCompartir() . \"', acefechafincompartir='\" . $this->getAceFechaFinCompartir() . \"', acprotegidoclave='\" . $this->getAcProtegidoClave() . \"' WHERE idarchivocargado=\" . $this->getIdArchivoCargado() ;\n if ($base->Iniciar()) {\n if ($base->Ejecutar($sql)>=0) {\n $resp = true;\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->modificar: \" . $base->getError());\n }\n } else {\n $this->setmensajeoperacion(\"ArchivoCargado->modificar: \" . $base->getError());\n }\n return $resp;\n }", "public function UpdatePersonnage(){\r\n $this->idPost();\r\n $this->lastFileNamePost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->personnage(); \r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){\r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/personnage/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/personnage/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_personnageManager->updatePersonnage($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionPersonnage'); \r\n }", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function NuevoPermiso(){\n\t\t$AlCg = new HomeController();\n\t\t$AlCdatos = array();\n\t\tarray_push($AlCdatos, $_POST[\"inicio\"]);\n\t\tarray_push($AlCdatos, $_POST[\"fin\"]);\n\t\tarray_push($AlCdatos, $_FILES[\"uploadedfile\"]);\n\t\t$AlCvalidado = $AlCg->ValidarNoVacio($AlCdatos);\n\t\tif ($AlCvalidado) {\n\t\t\tif ($_FILES['uploadedfile'][\"error\"] > 0 ){\n\t\t\t\treturn Redirect::to(\"/inicio\");\n\t\t\t}else{\n\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t$AlCfecha = date('Y-m-d');\n\t\t\t\t$AlCalumno = DB::table(\"alumno\")->where(\"idAlumno\",Session::get(\"usuario\"))->first();\n\t\t\t\t$AlCpermiso = DB::table(\"permiso\")->insertGetId(array(\n\t\t\t\t\t\"Alumno_idAlumno\" => Session::get(\"usuario\"),\n\t\t\t\t\t\"matriculaa\" => $AlCalumno->matriculaa,\n\t\t\t\t\t\"descripcion\" => $_POST[\"address\"],\n\t\t\t\t\t\"fechaSolicitud\" => $AlCfecha,\n\t\t\t\t\t\"fechaInicio\" => $_POST[\"inicio\"],\n\t\t\t\t\t\"fechaFin\" => $_POST[\"fin\"]));\n\t\t\t\t$AlCext=$AlCg->obtenerExt($_FILES['uploadedfile']['name']);\n\t\t\t\tmove_uploaded_file($_FILES['uploadedfile']['tmp_name'], \"permisos/\".$AlCpermiso.\".\".$AlCext);\n\t\t\t\tDB::table(\"permiso\")->where(\"idpermiso\",$AlCpermiso)->update(array(\"URL\" => \"permisos/\".$AlCpermiso.\".\".$AlCext));\n\t\t\t\treturn Redirect::to(\"/inicio\");\n\t\t\t}\n\t\t}else{\n\t\t\treturn Redirect::to(\"/inicio\");\n\t\t}\n\t}", "public function Editar($idMotorista){\n $motorista = new Motorista();\n\n require_once('trata_imagem.php');\n\n // echo $idOnibus;\n\n // iniciado variaveis\n $diretorio_completo=Null;\n $MovUpload=false;\n $imagem_file=Null;\n $foto=\"nada\";\n\n //pegando a foto\n if (!empty($_FILES['imagem']['name'])) {\n $imagem_file = true;\n $diretorio_completo=salvarFoto($_FILES['imagem'],'arquivo');\n if ($diretorio_completo == \"Erro\") {\n $MovUpload=false;\n }else {\n $MovUpload=true;\n }\n }else {\n $imagem_file = false;\n }\n\n if ($imagem_file == true && $MovUpload==true) {\n $foto =$diretorio_completo;\n }else {\n $foto=\"nada\";\n }\n $motorista->id = $idMotorista;\n $motorista->imagem=$diretorio_completo;\n $motorista->imagem = $foto;\n $motorista->nome = $_POST['txtNome'];\n $motorista->email = $_POST['txtEmail'];\n $motorista->data_nasc = $_POST['txtDataNasc'];\n $motorista->sexo = $_POST['rdoSexo'];\n $motorista->telefone = $_POST['txtTelefone'];\n $motorista->celular = $_POST['txtCelular'];\n $motorista->cpf = $_POST['txtCPF'];\n $motorista->rg = $_POST['txtRG'];\n $motorista->cnh = $_POST['txtcnh'];\n $motorista->ativar = $_POST['chkAtivo'];\n if(isset($_POST['ativo'])){\n $motorista->ativo = '1';\n }else{\n $motorista->ativo = '0';\n }\n\n $motorista::Update($motorista);\n\n }", "public function actualizarComuna(Request $requerimiento, Commune $comuna){ \n \n $mensajes =[\n 'commune.required' =>'El campo servicio es obligatorio',\n 'commune.min' =>'El campo servicio debe tener al menos 2 caracteres',\n 'commune.max' =>'El campo servicio debe tener como maximo 60 caracteres',\n 'commune.regex' => 'El campo servicio solo acepta cadenas de texto y valores numericos',\n 'image.mimes' => 'La imagen debe ser un archivo de tipo: jpg, jpeg, bmp, png.',\n 'regions_id.exists' =>'Debe seleccionar una region',\n ];\n\n $reglas = [\n 'commune' => 'required|min:2|max:60|regex:/^([a-zA-ZñÑáéíóúÁÉÍÓÚ])+((\\s*)+([a-zA-ZñÑáéíóúÁÉÍÓÚ]*)*)+$/',\n 'image' => 'mimes:jpg,jpeg,bmp,png',\n 'region_id' => 'exists:regions,id' \n ];\n\n $this->validate($requerimiento,$reglas,$mensajes);\n\n if($requerimiento->hasFile('image')){\n $foto = $requerimiento->file('image');\n $ruta = public_path().'/imagenes/comunas';\n $nombreFoto = uniqid().$foto->getClientOriginalName();\n $movido = $foto->move($ruta,$nombreFoto);\n\n if($movido){\n $imagenAnterior = $ruta.'/'.$comuna->image;\n $comuna->image = $nombreFoto;\n $exito = $comuna->save(); \n if($exito){\n File::delete($imagenAnterior);\n alert()->success('La comuna fue modificada correctamente','Comuna Modificada')->autoclose(3000);\n }\n }\n }else{\n $modificada = $comuna->update($requerimiento->only('commune','region_id'));\n if($modificada){\n alert()->success('La comuna fue modificada correctamente','Comuna Modificada')->autoclose(3000);\n }else{\n alert()->error('la comuna no pudo ser modificado','Ocurrio un Error')->autoclose(3000);\n }\n } \n return redirect('administrador/comunas');\n }", "function evt__form_integrante_i__modificacion($datos)\r\n {\r\n $perfil = toba::usuario()->get_perfil_datos();\r\n if ($perfil == null) {//es usuario de SCyT\r\n if($this->chequeo_formato_norma($datos['rescd_bm'])){ \r\n $datos2['rescd_bm']=$datos['rescd_bm'];\r\n $datos2['resaval']=$datos['resaval'];\r\n $datos2['cat_investigador']=$datos['cat_investigador'];\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos2);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar('Guardado. Solo modifica ResCD baja/modif, Res Aval, Cat Investigador', 'info');\r\n }\r\n }else{//es usuario de la UA\r\n $pi=$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->get();\r\n $int=$this->dep('datos')->tabla('integrante_interno_pi')->get(); \r\n if($datos['desde']<$pi['fec_desde'] or $datos['hasta']>$pi['fec_hasta']){//no puede ir fuera del periodo del proyecto\r\n //toba::notificacion()->agregar('Revise las fechas. Fuera del periodo del proyecto!', 'error'); \r\n throw new toba_error(\"Revise las fechas. Fuera del periodo del proyecto!\");\r\n }else{ \r\n //Pendiente verificar que la modificacion no haga que se superpongan las fechas\r\n $haysuperposicion=false;//no es igual al del alta porque no tengo que considerar el registro vigente$this->controlador()->controlador()->dep('datos')->tabla('pinvestigacion')->superposicion_modif($pi['id_pinv'],$datos['id_docente'],$datos['desde'],$datos['hasta'],$registro['id_designacion'],$registro['desde']);\r\n if(!$haysuperposicion){\r\n $band=false;\r\n if($pi['estado']=='A'){\r\n $band=$this->dep('datos')->tabla('logs_integrante_interno_pi')->fue_chequeado($int['id_designacion'],$int['pinvest'],$int['desde']);\r\n } \r\n $regenorma = '/^[0-9]{4}\\/[0-9]{4}$/';\r\n if ( !preg_match($regenorma, $datos['rescd'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if (isset($datos['rescd_bm']) && !preg_match($regenorma, $datos['rescd_bm'], $matchFecha) ) {\r\n throw new toba_error('Nro Resolucion CD Baja/Modif invalida. Debe ingresar en formato XXXX/YYYY');\r\n }else{\r\n if($band){//si alguna vez fue chequeado por SCyT entonces solo puede modificar fecha_hasta y nada mas (se supone que lo demas ya es correcto) \r\n //fecha_hasta porque puede ocurrir que haya una baja del participante o la modificacion de funcion o carga horaria\r\n unset($datos['funcion_p']);\r\n unset($datos['cat_investigador']);\r\n unset($datos['identificador_personal']);\r\n unset($datos['carga_horaria']);\r\n unset($datos['desde']);\r\n unset($datos['rescd']);\r\n unset($datos['cat_invest_conicet']);\r\n unset($datos['resaval']);\r\n unset($datos['hs_finan_otrafuente']);\r\n //Solo si cambia hasta y resol bm pierde el check\r\n if( $int['hasta']<>$datos['hasta'] or $int['rescd_bm']<>$datos['rescd_bm'] ){\r\n $datos['check_inv']=0;//pierde el check si es que lo tuviera. Solo cuando cambia algo\r\n }\r\n $mensaje='Ha sido chequeado por SCyT, solo puede modificar fecha hasta y resCD baja/modif';\r\n }else{//band false significa que puede modificar cualquier cosa\r\n //esto lo hago porque el set de toba no modifica la fecha desde por ser parte de la clave \r\n $this->dep('datos')->tabla('integrante_interno_pi')->modificar_fecha_desde($int['id_designacion'],$int['pinvest'],$int['desde'],$datos['desde']);\r\n $mensaje=\"Los datos se han guardado correctamente\";\r\n }\r\n $this->dep('datos')->tabla('integrante_interno_pi')->set($datos);\r\n $this->dep('datos')->tabla('integrante_interno_pi')->sincronizar();\r\n toba::notificacion()->agregar($mensaje, 'info'); \r\n }\r\n }\r\n }else{\r\n //toba::notificacion()->agregar('Hay superposicion de fechas', 'error'); \r\n throw new toba_error(\"Hay superposicion de fechas\");\r\n }\r\n }\r\n }\r\n //nuevo Lo coloco para que el formulario se oculte al finalizar\r\n $this->dep('datos')->tabla('integrante_interno_pi')->resetear();\r\n $this->s__mostrar_i=0;\r\n }", "public function edit2Action(Request $request, RendezVous $rendezVous)\n {\n\n global $kernel;\n $user = $kernel->getContainer()->get('security.token_storage')->getToken()->getUser();\n\n\n if ($user!=='anon.' && $user->getFonctionuser()==2){\n\n $deleteForm = $this->createDeleteForm($rendezVous);\n $editForm = $this->createForm('VeterinaireBundle\\Form\\confirmationType', $rendezVous);\n $editForm->handleRequest($request);\n $file = $rendezVous->getPhotoa();\n if ($editForm->isSubmitted()) {\n\n $rendezVous->setPhotoa($file);\n $rendezVous->setVerif(true);\n $this->getDoctrine()->getManager()->flush();\n\n return $this->redirectToRoute('r_show', array('id' => $rendezVous->getId()));\n }\n\n return $this->render('rendezvous/confirmation.html.twig', array(\n 'rendezVous' => $rendezVous,\n 'form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }else{\nreturn $this->redirectToRoute('user_homepage');\n\n}\n\n}", "public function actionModificar()\n {\n $model = Yii::$app->user->identity->usuariosDatos;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->localidad === null && $model->direccion === null) {\n $model->geoloc = null;\n }\n if ($model->save() && $model->upload()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Has actualizado tus datos correctamente'));\n }\n }\n\n return $this->render('/usuarios/update', [\n 'modelDatos' => $model,\n 'seccion' => 'personal',\n 'generos' => Utiles::translateArray(UsuariosGeneros::find()\n ->select('sexo')\n ->indexBy('id')\n ->column()),\n ]);\n }", "public function ctrCambiarFotoPerfil(){\n\n\t\tif(isset($_POST[\"idUsuarioFoto\"])){\n\n\t\t\t$ruta = $_POST[\"fotoActual\"];\n\n\t\t\tif(isset($_FILES[\"cambiarImagen\"][\"tmp_name\"]) && !empty($_FILES[\"cambiarImagen\"][\"tmp_name\"])){\n\n\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\n\n\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t/*=============================================\n\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$directorio = \"views/img/usuarios/\".$_POST[\"idUsuarioFoto\"];\n\n\t\t\t\t/*=============================================\n\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD Y EL CARPETA\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($ruta != \"\"){\n\n\t\t\t\t\tunlink($ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(!file_exists($directorio)){\t\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/*=============================================\n\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($_FILES[\"cambiarImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio.\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\timagejpeg($destino, $ruta);\t\n\n\n\t\t\t\t}else if($_FILES[\"cambiarImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio.\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"cambiarImagen\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\t\n\n\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\n\t\t\t\t\timagesavealpha($destino, TRUE);\t\t\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\t\t\n\n\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\t\t \ttext: \"¡No se permiten formatos diferentes a JPG y/o PNG!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t\t// final condicion\n\n\t\t\t$tabla = \"genusuario\";\n\t\t\t$id = $_POST[\"idUsuarioFoto\"];\n\t\t\t$item = \"usufoto\";\n\t\t\t$valor = $ruta;\n\n\t\t\t$respuesta = UserModel::mdlActualizarUsuario($tabla, $id, $item, $valor);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t \ttitle: \"¡CORRECTO!\",\n\t\t\t\t\t \ttext: \"¡La foto de perfil ha sido actualizada!\",\n\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t \n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t } \n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\t}", "function modificarPresupuesto(){\n\t\t$this->procedimiento='pre.ft_presupuesto_ime';\n\t\t$this->transaccion='PRE_PRE_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_presupuesto','id_presupuesto','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('descripcion','descripcion','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('gestion','gestion','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificar_contenido($nick_user, $nivel, $ubi_tema, $nom_user, $cor_user)\r\n\t\t\t{\r\n\t\t\t\t$clave_seccion_enviada = $_GET[\"clave_seccion\"];\r\n\t\t\t\tif(isset($_POST[\"guardar\"]) && $_POST[\"guardar\"]==\"si\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$formulario_final = $_POST[\"formulario_final\"];\r\n\t\t\t\t\t\t$fecha_inicio = $_POST[\"ano_i\"].\"-\".$_POST[\"mes_i\"].\"-\".$_POST[\"dia_i\"];\r\n\t\t\t\t\t\t$fecha_termino = $_POST[\"ano_t\"].\"-\".$_POST[\"mes_t\"].\"-\".$_POST[\"dia_t\"];\r\n\t\t\t\t\t\t$situacion_total = $_POST[\"situacion_total\"];\r\n\t\t\t\t\t\t$ver_actualizacion = $_POST[\"ver_actualizacion\"];\r\n\t\t\t\t\t\t$usar_caducidad = $_POST[\"usar_caducidad\"];\r\n\r\n\t\t\t\t\t\t$clave_seccion = $_POST[\"clave_seccion\"];\r\n\t\t\t\t\t\t$clave_modulo= $_POST[\"clave_modulo\"];\r\n\t\t\t\t\t\t$clave_contenido = $_POST[\"clave_contenido\"];\r\n\t\t\t\t\t\t$fecha_hoy = date(\"Y-m-d\");\r\n\t\t\t\t\t\t$hora_hoy = date (\"H:i:s\");\r\n\t\t\t\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\r\n\t\t\t\t\t\t$motivo = $this->escapar_caracteres($_POST[\"motivo\"]);\r\n\t\t\t\t\t\t$motivo = strip_tags($motivo);\r\n\t\t\t\t\t\t$correo = $_POST[\"correo\"];\r\n\t\t\t\t\t\t$nombre = $_POST[\"nombre\"];\r\n\t\t\t\t\t\t$situacion_temporal = $_POST[\"situacion_temporal\"];\t\r\n\t\t\t\t\t\tif($correo==\"\")\r\n\t\t\t\t\t\t\t{$correo = $cor_user;}\r\n\t\t\t\t\t\tif($nombre==\"\")\r\n\t\t\t\t\t\t\t{$nombre = $nom_user;}\r\n\t\t\t\t\t\t$nombre = strip_tags($nombre);\r\n\t\t\t\t\t\t$sql_adicional = \"null, '0000-00-00','00:00:00', '', '', '','',\";\r\n\t\t\t\t\t\tif($situacion_temporal==\"activo\")\r\n\t\t\t\t\t\t\t{$sql_adicional = \"'$nick_user', '$fecha_hoy', '$hora_hoy', '$ip', '$motivo', '$nombre', '$correo',\";}\r\n\t\t\t\t\t\t$insert_camb = \"insert into nazep_zmod_contenido_cambios \r\n\t\t\t\t\t\t(clave_contenido, situacion, nick_user_propone, fecha_propone, hora_propone, ip_propone, motivo_propone,\r\n\t\t\t\t\t\tnombre_propone, correo_propone,\r\n\t\t\t\t\t\tnick_user_decide, fecha_decide, hora_decide, ip_decide, motivo_decide,\r\n\t\t\t\t\t\tnombre_decide, correo_decide,\r\n\t\t\t\t\t\tnuevo_situacion, nuevo_ver_actualizacion, nuevo_usar_caducidad, nuevo_fecha_incio, nuevo_fecha_fin, \r\n\t\t\t\t\t\tanterior_situacion, anterior_ver_actualizacion, anterior_usar_caducidad, anterior_fecha_incio, anterior_fecha_fin)\t\t\t\t\t\r\n\t\t\t\t\t\tselect '$clave_contenido', '$situacion_temporal','$nick_user', '$fecha_hoy', '$hora_hoy', '$ip', '$motivo',\r\n\t\t\t\t\t\t'$nombre','$correo',\r\n\t\t\t\t\t\t\".$sql_adicional.\"\r\n\t\t\t\t\t\t'$situacion_total', '$ver_actualizacion', '$usar_caducidad', '$fecha_inicio', '$fecha_termino',\r\n\t\t\t\t\t\tsituacion, ver_actualizacion, usar_caducidad, fecha_incio, fecha_fin\r\n\t\t\t\t\t\tfrom nazep_zmod_contenido \r\n\t\t\t\t\t\twhere clave_contenido = '$clave_contenido'\";\r\n\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t$conexion = $this->conectarse();\r\n\t\t\t\t\t\tmysql_query(\"START TRANSACTION;\");\r\n\t\t\t\t\t\tif (!@mysql_query($insert_camb))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t$error = 1;\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$paso = true;\r\n\t\t\t\t\t\t\t\t$clave_contenido_cambios_db = mysql_insert_id();\r\n\t\t\t\t\t\t\t\t$clave_contenido_detalle = $_POST[\"clave_contenido_detalle\"];\r\n\t\t\t\t\t\t\t\t$pagina = $_POST[\"pagina\"];\r\n\t\t\t\t\t\t\t\t$texto = $this->escapar_caracteres($_POST[\"conte_texto\"]);\r\n\t\t\t\t\t\t\t\t$situacion_p = $_POST[\"situacion\"];\r\n\t\t\t\t\t\t\t\t$insert_con_cam = \"insert into nazep_zmod_contenido_detalle_cambios\r\n\t\t\t\t\t\t\t\t(clave_contenido_cambios, clave_contenido_detalle, nuevo_pagina, nuevo_texto, nuevo_situacion,\r\n\t\t\t\t\t\t\t\tanterior_pagina, anterior_texto, anterior_situacion)\r\n\t\t\t\t\t\t\t\tselect '$clave_contenido_cambios_db', '$clave_contenido_detalle',\r\n\t\t\t\t\t\t\t\t'$pagina', '$texto', '$situacion_p', pagina, texto, situacion\r\n\t\t\t\t\t\t\t\tfrom nazep_zmod_contenido_detalle\r\n\t\t\t\t\t\t\t\twhere clave_contenido_detalle = '$clave_contenido_detalle'\";\r\n\t\t\t\t\t\t\t\tif (!@mysql_query($insert_con_cam))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t\t\t$error = \"2\";\r\n\t\t\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{$paso = true;}\r\n\t\t\t\t\t\t\t\tif($situacion_temporal==\"activo\")\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$update_2 = \"update nazep_zmod_contenido\r\n\t\t\t\t\t\t\t\t\t\tset situacion = '$situacion_total', ver_actualizacion = '$ver_actualizacion', usar_caducidad ='$usar_caducidad', \r\n\t\t\t\t\t\t\t\t\t\tfecha_incio = '$fecha_inicio', fecha_fin = '$fecha_termino',\r\n\t\t\t\t\t\t\t\t\t\tuser_actualizacion = '$nick_user', fecha_actualizacion = '$fecha_hoy', hora_actualizacion = '$hora_hoy',\r\n\t\t\t\t\t\t\t\t\t\tip_actualizacion = '$ip', nombre_actualizacion = '$nombre', correo_actualizacion = '$correo'\r\n\t\t\t\t\t\t\t\t\t\twhere clave_contenido = '$clave_contenido' and clave_modulo = '$clave_modulo'\";\r\n\t\t\t\t\t\t\t\t\t\tif (!@mysql_query($update_2))\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$error = 3;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$paso = true;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$clave_contenido_detalle = $_POST[\"clave_contenido_detalle\"];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$pagina = $_POST[\"pagina\"];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$situacion = $_POST[\"situacion\"];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$texto = $this->escapar_caracteres($_POST[\"conte_texto\"]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t$update3 = \"update nazep_zmod_contenido_detalle set pagina = '$pagina', texto = '$texto', situacion = '$situacion' \r\n\t\t\t\t\t\t\t\t\t\t\t\twhere clave_contenido_detalle = '$clave_contenido_detalle'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!@mysql_query($update3))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$men = mysql_error();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"ROLLBACK;\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$paso = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$error = \"4\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{$paso = true;}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif($paso)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tmysql_query(\"COMMIT;\");\r\n\t\t\t\t\t\t\t\techo \"termino-,*-$formulario_final\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo \"Error: Insertar en la base de datos, la consulta: <strong>$error</strong> <br/> con el siguiente mensaje: $men\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->desconectarse($conexion);\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$paginas_contenido= $_POST[\"paginas_contenido\"];\r\n\t\t\t\t\t\t$clave_modulo= $_POST[\"clave_modulo\"];\t\t\t\t\t\t\r\n\t\t\t\t\t\t$nombre_sec = HtmlAdmon::historial($clave_seccion_enviada);\r\n\t\t\t\t\t\tHtmlAdmon::titulo_seccion(\"Modificar contenido html de la secci&oacute;n \\\"$nombre_sec\\\"\");\r\n\t\t\t\t\t\t$con_veri = \"select cc.clave_contenido_cambios from nazep_zmod_contenido_cambios cc, nazep_zmod_contenido c\r\n\t\t\t\t\t\twhere c.clave_seccion = '$clave_seccion_enviada' and c.clave_modulo = '$clave_modulo' and \r\n\t\t\t\t\t\t(cc.situacion = 'pendiente' or cc.situacion = 'nueva_pagina' or cc.situacion = 'nuevo')\r\n\t\t\t\t\t\tand c.clave_contenido = cc.clave_contenido\";\r\n\t\t\t\t\t\t$conexion = $this->conectarse();\r\n\t\t\t\t\t\t$res = mysql_query($con_veri);\r\n\t\t\t\t\t\t$cantidad = mysql_num_rows($res);\r\n\t\t\t\t\t\t$this->desconectarse($conexion);\r\n\t\t\t\t\t\tif($cantidad!=0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\techo '<tr><td align=\"center\"><br /><strong>'.cont_txt_tiene_cambio_pen.'</strong><br /><br /></td></tr>';\r\n\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\tHtmlAdmon::boton_regreso(array('clave_usar'=>$clave_seccion_enviada,'texto'=>regresar_opc_mod));\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$variable_archivos = directorio_archivos.\"$clave_seccion_enviada/\";\r\n\t\t\t\t\t\t\t\t$_SESSION[\"direccion_archivos\"] = $variable_archivos;\t\r\n\t\t\t\t\t\t\t\t$con_contenido = \"select fecha_incio, fecha_fin, situacion, ver_actualizacion, usar_caducidad, clave_contenido \r\n\t\t\t\t\t\t\t\tfrom nazep_zmod_contenido where clave_seccion = '$clave_seccion_enviada' and clave_modulo = '$clave_modulo'\";\r\n\t\t\t\t\t\t\t\t$conexion = $this->conectarse();\r\n\t\t\t\t\t\t\t\t$res_contenido = mysql_query($con_contenido);\r\n\t\t\t\t\t\t\t\t$ren = mysql_fetch_array($res_contenido);\r\n\t\t\t\t\t\t\t\t$fecha_incio = $ren[\"fecha_incio\"];\r\n\t\t\t\t\t\t\t\tlist($ano_i, $mes_i, $dia_i) = explode(\"-\",$fecha_incio);\r\n\t\t\t\t\t\t\t\t$fecha_fin = $ren[\"fecha_fin\"];\r\n\t\t\t\t\t\t\t\tlist($ano_t, $mes_t, $dia_t) = explode(\"-\",$fecha_fin);\r\n\t\t\t\t\t\t\t\t$situacion_total = $ren[\"situacion\"];\r\n\t\t\t\t\t\t\t\t$ver_actualizacion = $ren[\"ver_actualizacion\"];\r\n\t\t\t\t\t\t\t\t$usar_caducidad = $ren[\"usar_caducidad\"];\r\n\t\t\t\t\t\t\t\t$clave_contenido = $ren[\"clave_contenido\"];\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\techo '\r\n\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\techo'\r\n\t\t\t\t\t\t\t\t$(document).ready(function()\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$.frm_elem_color(\"#FACA70\",\"\");\r\n\t\t\t\t\t\t\t\t\t\t\t$.guardar_valores(\"frm_modificar_contenido\");\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\tfunction validar_form(formulario, situacion_temporal, nombre_formulario)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.situacion_temporal.value = situacion_temporal;\r\n\t\t\t\t\t\t\t\t\t\t\tif(formulario.motivo.value == \"\") \r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.jv_campo_motivo.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.motivo.focus(); \t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tseparador = \"/\";\r\n\t\t\t\t\t\t\t\t\t\t\tfecha_ini = formulario.dia_i.value+\"/\"+formulario.mes_i.value+\"/\"+formulario.ano_i.value;\r\n\t\t\t\t\t\t\t\t\t\t\tfecha_fin = formulario.dia_t.value+\"/\"+formulario.mes_t.value+\"/\"+formulario.ano_t.value;\r\n\t\t\t\t\t\t\t\t\t\t\tif(!Comparar_Fecha(fecha_ini, fecha_fin))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.comparar_fecha_veri.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.dia_i.focus(); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif(!verificar_fecha(fecha_ini, separador))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.verificar_fecha_ini.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.dia_i.focus(); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif(!verificar_fecha(fecha_fin, separador))\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"'.verificar_fecha_fin.'\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tformulario.dia_t.focus(); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tvalorTemporal = FCKeditorAPI.__Instances[\\'conte_texto\\'].GetHTML();\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.conte_texto.value = valorTemporal;\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.btn_guardar1.style.visibility=\"hidden\";\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.btn_guardar1a.style.visibility=\"hidden\";\r\n\t\t\t\t\t\t\t\t\t\t\tdocument.crear_nueva_pagina.btn_nueva_pagina.style.visibility=\"hidden\";\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\t\tif($nivel == 1 or $nivel == 2)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo 'formulario.btn_guardar2.style.visibility=\"hidden\";\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.btn_guardar2a.style.visibility=\"hidden\";';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\techo '\r\n\t\t\t\t\t\t\t\t\t\t\tformulario.formulario_final.value = nombre_formulario;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t';\r\n\t\t\t\t\t\t\t\techo '</script>';\r\n\t\t\t\t\t\t\t\techo '<form name=\"regresar_pantalla\" id=\"regresar_pantalla\" method=\"post\" action=\"index.php?opc=111&amp;clave_seccion='.$clave_seccion_enviada.'\" class=\"margen_cero\">';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"archivo\" value = \"../librerias/modulos/contenido/contenido_admon.php\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clase\" value = \"clase_contenido\"/>';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"metodo\" value = \"modificar_contenido\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_modulo\" value = \"'.$clave_modulo.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"paginas_contenido\" value = \"'.$paginas_contenido.'\" />';\r\n\t\t\t\t\t\t\t\techo '</form>';\t\r\n\t\t\t\t\t\t\t\techo '<form name=\"recargar_pantalla\" id= \"recargar_pantalla\" method=\"get\" action=\"index.php\" class=\"margen_cero\"><input type=\"hidden\" name=\"opc\" value = \"11\" /><input type=\"hidden\" name=\"clave_seccion\" value = \"'.$clave_seccion_enviada.'\" /></form>';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\techo '<form name=\"frm_modificar_contenido\" id=\"frm_modificar_contenido\" method=\"post\" action=\"index.php?opc=111&amp;clave_seccion='.$clave_seccion_enviada.'\" class=\"margen_cero\" >';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td width=\"400\">'.persona_cambio.'</td><td><input type =\"text\" name = \"nombre\" size = \"60\" /></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.correo_cambio.'</td><td><input type = \"text\" name = \"correo\" size = \"60\" /></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.motivo_cambio.'</td><td><textarea name=\"motivo\" cols=\"45\" rows=\"5\"></textarea></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.situacion.'</td><td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion_total\" id =\"situacion_act\" value=\"activo\" '; if ($situacion_total == \"activo\") { echo 'checked=\"checked\"'; } echo '/> '.activo.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion_total\" id =\"situacion_no\" value=\"cancelado\" '; if ($situacion_total == \"cancelado\") { echo 'checked=\"checked\"'; } echo '/> '.cancelado.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.cont_txt_ver_fec_ac.'</td><td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"ver_actualizacion\" id =\"ver_actualizacion_si\" value=\"SI\" '; if ($ver_actualizacion == \"SI\") { echo 'checked=\"checked\"'; } echo '/> '.si.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"ver_actualizacion\" id =\"ver_actualizacion_no\" value=\"NO\" '; if ($ver_actualizacion == \"NO\") { echo 'checked=\"checked\"'; } echo '/> '.no.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.cont_txt_usar_cad_cont.'</td><td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"usar_caducidad\" id =\"usar_caducidad_si\" value=\"SI\" '; if ($usar_caducidad == \"SI\") { echo 'checked=\"checked\"'; } echo ' /> '.si.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"usar_caducidad\" id =\"usar_caducidad_no\" value=\"NO\" '; if ($usar_caducidad == \"NO\") { echo 'checked=\"checked\"'; } echo ' /> '.no.'&nbsp;';\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.fecha_ini_vig.'</td>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t$areglo_meses = FunGral::MesesNumero();\r\n\t\t\t\t\t\t\t\t\t\t\t\techo dia.'&nbsp;<select name = \"dia_i\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($a = 1; $a<=31; $a++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$a.'\" '; if ($dia_i == $a) { echo 'selected=\"selected\"'; } echo ' >'.$a.'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo mes.'&nbsp;<select name = \"mes_i\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($b=1; $b<=12; $b++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$b.'\" '; if ($mes_i == $b) {echo ' selected=\"selected\" ';} echo ' >'. $areglo_meses[$b] .'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo ano.'&nbsp;<select name = \"ano_i\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($c=$ano_i-10; $c<=$ano_i+10; $c++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$c.'\" '; if ($ano_i == $c) {echo ' selected=\"selected\" ';} echo '>'.$c.'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td>'.fecha_fin_vig.'</td>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo dia.'&nbsp;<select name = \"dia_t\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($a = 1; $a<=31; $a++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$a.'\" '; if ($dia_t == $a) { echo 'selected'; } echo '>'.$a.'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo mes.'&nbsp;<select name = \"mes_t\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($b=1; $b<=12; $b++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ echo '<option value = \"'.$b.'\" '; if ($mes_t == $b) {echo 'selected ';} echo '>'.$areglo_meses[$b].'</option>'; }\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo ano.'&nbsp;<select name = \"ano_t\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\tfor ($c=$ano_t-10; $c<=$ano_t+10; $c++)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{echo '<option value = \"'.$c.'\" '; if ($ano_t == $c) {echo ' selected ';} echo '>'.$c.'</option>';}\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</select>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\t\techo '<br /><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td align=\"center\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"submit\" name=\"btn_guardar1a\" value=\"'.guardar.'\" onclick= \"return validar_form(this.form,\\'pendiente\\', \\'recargar_pantalla\\')\" />';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\t\tif($nivel == 1 or $nivel == 2)\r\n\t\t\t\t\t\t\t\t\t\t\t\t{echo '<td align=\"center\"><input type=\"submit\" name=\"btn_guardar2a\" value=\"'.guardar_puliblicar.'\" onclick= \"return validar_form(this.form,\\'activo\\', \\'regresar_pantalla\\')\" /></td>';}\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table><br/>';\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$cons_con_detalle = \"select clave_contenido_detalle, pagina, texto, situacion from nazep_zmod_contenido_detalle\r\n\t\t\t\t\t\t\t\t\twhere clave_contenido = '$clave_contenido' and pagina ='$paginas_contenido' \";\r\n\t\t\t\t\t\t\t\t\t$res = mysql_query($cons_con_detalle);\r\n\t\t\t\t\t\t\t\t\t$con = 1;\r\n\t\t\t\t\t\t\t\t\t$ren = mysql_fetch_array($res);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$pagina = $ren[\"pagina\"];\r\n\t\t\t\t\t\t\t\t\t$texto = stripslashes($ren[\"texto\"]);\r\n\t\t\t\t\t\t\t\t\t$clave_contenido_detalle_base = $ren[\"clave_contenido_detalle\"];\r\n\t\t\t\t\t\t\t\t\t$situacion_texto = $ren[\"situacion\"];\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_contenido_detalle\" value = \"'.$clave_contenido_detalle_base.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td align=\"center\"><strong>'.cont_txt_con_html_pag.' '.$pagina.'</strong></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td width=\"377\">'.cont_txt_num_pag.' '.$pagina.'<input type = \"hidden\" name = \"pagina\" size = \"5\" value =\"'.$pagina.'\" /></td></tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td align=\"center\">'.cont_txt_sit_pag.' '.$pagina.'&nbsp;&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion\" id =\"situacion_act\" value=\"activo\" '; if ($situacion_texto == \"activo\") { echo 'checked=\"checked\"'; } echo '/> '.activo.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"radio\" name=\"situacion\" id =\"situacion_no\" value=\"cancelado\" '; if ($situacion_texto == \"cancelado\") { echo 'checked=\"checked\"'; } echo '/> '.cancelado.'&nbsp;';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr><td><a name=\"texto_link\" id=\"texto_link\"></a>';\r\n\t\t\t\t\t\t\t\t\t\t\t$texto = ($texto!='')?$texto:'&nbsp;'; \r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con] = new FCKeditor(\"conte_texto\");\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->BasePath = '../librerias/fckeditor/';\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Value = $texto;\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Config['EditorAreaCSS'] = $ubi_tema.'fck_editorarea.css';\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Config['StylesXmlPath'] = $ubi_tema.'fckstyles.xml';\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Width = \"100%\";\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Height = \"500\";\r\n\t\t\t\t\t\t\t\t\t\t\t$oFCKeditor[$con]->Create();\r\n\t\t\t\t\t\t\t\t\t\techo '</td></tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"formulario_final\" value = \"\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_contenido\" value = \"'.$clave_contenido.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"archivo\" value = \"../librerias/modulos/contenido/contenido_admon.php\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clase\" value = \"clase_contenido\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"metodo\" value = \"modificar_contenido\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"guardar\" value = \"si\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_seccion\" value = \"'.$clave_seccion_enviada.'\" />';\t\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_modulo\" value = \"'.$clave_modulo.'\" />';\r\n\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"situacion_temporal\" value = \"pendiente\" />';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td align=\"center\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"submit\" name=\"btn_guardar1\" value=\"'.guardar.'\" onclick= \"return validar_form(this.form,\\'pendiente\\', \\'recargar_pantalla\\')\" />';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\t\tif($nivel == 1 or $nivel == 2)\r\n\t\t\t\t\t\t\t\t\t\t\t\t{echo '<td align=\"center\"><input type=\"submit\" name=\"btn_guardar2\" value=\"'.guardar_puliblicar.'\" onclick= \"return validar_form(this.form,\\'activo\\', \\'regresar_pantalla\\')\" /></td>';}\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\techo '</form>';\r\n\t\t\t\t\t\t\t\t\techo '<hr />';\r\n\t\t\t\t\t\t\t\t\techo '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" >';\r\n\t\t\t\t\t\t\t\t\t\techo '<tr>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<td align=\"center\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<form id=\"crear_nueva_pagina\" name=\"crear_nueva_pagina\" action=\"index.php?opc=111&amp;clave_seccion='.$clave_seccion_enviada.'\" method=\"post\" class=\"margen_cero\">';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"archivo\" value =\"../librerias/modulos/contenido/contenido_admon.php\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clase\" value = \"clase_contenido\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"metodo\" value = \"nueva_pagina\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"clave_modulo\" value = \"'.$clave_modulo.'\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"paginas_contenido\" value = \"'.$paginas_contenido.'\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<input type=\"submit\" name=\"btn_nueva_pagina\" value=\"'.cont_btn_7_cre_pag.'\" />';\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '</form>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\techo '</tr>';\r\n\t\t\t\t\t\t\t\t\techo '</table>';\r\n\t\t\t\t\t\t\t\tHtmlAdmon::div_res_oper(array());\r\n\t\t\t\t\t\t\t\tHtmlAdmon::boton_regreso(array('clave_usar'=>$clave_seccion_enviada,'texto'=>regresar_opc_mod));\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$this->desconectarse($conexion);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}", "static public function ctrEditarUsuario()\n\t{\n\t\tif(isset($_POST['editarUsuario']))\n\t\t{\n\t\t\t//vamos a permitir caracteres especiales con tilde,espacio en blanco y numericos con expresion regular\n\t\t\t// vamos a solo editar el nombre del usuario y no usuario para evitar crear carpeta basura en img/usuarios\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓü ]+$/', $_POST['editarNombre']))\n\t\t\t{\n\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t\t// recuperamos la ruta de la imagen del input oculto\n\t\t\t\t$ruta = $_POST['fotoActual'];\n\n\t\t\t\t// si existe la variable $_FILE(en nuestro caso siempre existe) y viene diferente a vacio el archivo temporal de la imagen\n\t\t\t\tif(isset($_FILES['editarFoto']['tmp_name']) && !empty($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t// if(isset($_FILES['editarFoto']['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\t// vamos a recortar la imagen 500 x 500 px\n\n\t\t\t\t\t// list — Asignar variables como si fueran un array\n\t\t\t\t\t// getimagesize — Obtener el tamaño de una imagen\n\t\t\t\t\t//en list() toma el indice 0 de [nuevaFoto][tmp_name](los indice del archivo temporal son medidas de la imagen) y asigna a $ancho y el indice 1 asigna a $alto \n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t// redimensionamos\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t// creamos la ruta donde se va a guardar la imagen\n\t\t\t\t\t$directorio = 'vistas/img/usuarios/'.$_POST['editarUsuario'];\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE LA IMAGEN EN LA BD \n\t\t\t\t\t======================================================================*/\n\t\t\t\t\t\n\t\t\t\t\t// si la ruta de la db es diferente a vacio \n\t\t\t\t\tif(!empty($_POST['fotoActual']))\n\t\t\t\t\t{\n\t\t\t\t\t\t// unlink — Borra un fichero\n\t\t\t\t\t\t// vamos a borrar ese archivo en esa carpeta\n\t\t\t\t\t\t// console.log('foto actual');\n\t\t\t\t\t\tunlink($_POST['fotoActual']);\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// en caso de que venga vacio, vamos a crear el directorioo carpeta\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tDEACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP \n\t\t\t\t\t======================================================================*/\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/jpeg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES['editarFoto']['type'] == \"image/png\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['editarUsuario'].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES['editarFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagepng($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\t// var_dump($_FILES['nuevaFoto']['tmp_name']);\n\t\t\t\t\t// var_dump(getimagesize($_FILES['nuevaFoto']['tmp_name']));\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t\n\t\t\t\t// si el nuevo pass es diferente a vacio\n\t\t\t\tif($_POST['editarPassword'] != \"\")\n\t\t\t\t{\n\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"editarPassword\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t//almacenamos en la variable encriptar y encriptamos el nuevo pass y usamos el hash de tipo CRYPT_BLOWFISH\n\t\t\t\t\t\t// crypt — Hash de cadenas de un sólo sentido, se encripta la pass ingresado\n\t\t\t\t\t\t$encriptar = crypt($_POST[\"editarPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\ttitle: \"La contrasena no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\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\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse //si editarPassword viene vacio\n\t\t\t\t{\n\t\t\t\t\t$encriptar = $_POST[\"passwordActual\"];\n\t\t\t\t}\n\n\t\t\t\t$datos = array\n\t\t\t\t(\n\t\t\t\t\t\"nombre\"=> $_POST['editarNombre'],\n\t\t\t\t\t\"usuario\"=> $_POST['editarUsuario'],\t\n\t\t\t\t\t\"password\"=> $encriptar,\t\n\t\t\t\t\t\"perfil\"=> $_POST['editarPerfil'],\n\t\t\t\t\t\"ruta\" => $ruta\t\n\t\t\t\t);\n\n\t\t\t\t// llamamos al metodo mdlEditarUsuario de la clase modelo Usuario\n\t\t\t\t$respuesta = ModeloUsuarios::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t// mostramos mensaje de edicion exitosa\n\t\t\t\tif($respuesta == \"ok\")\n\t\t\t\t{\n\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se editó correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\ttitle: \"El nombre no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t</script>';\t\n\t\t\t}\n\t\t}\n\t}", "public function actualizarusuario($imagenperfil,$datosuser,$id){\n // NOTE: obtener los usuarios en usuarios.json, transformandolos en un array\n $usuarios = $this->buscarUsuarios();\n // NOTE: recorrer array de todos los usuarios y sobreescribir el registro que corresponda al usuario a editar\n if (!empty($usuarios)) {\n // NOTE: vacio el archivo usuarios.json para poder insertar las modificaciones sin duplicar al usuario\n file_put_contents('usuarios.json', '');\n foreach ($usuarios as $usuario) {\n // NOTE: si encuentro al usuario guardo las modificaciones\n if (strtolower($id) == strtolower($usuario['id'])) {\n $usuario['nombre'] = $datosuser['nombre'];\n $usuario['apellido'] = $datosuser['apellido'];\n $usuario['email'] = $datosuser['email'];\n if ($usuario['password'] != $datosuser['password']) {\n $usuario['password'] = password_hash($datosuser['password'],PASSWORD_DEFAULT);\n }\n if ($imagenperfil['imgperfil']['error'] === UPLOAD_ERR_OK) {\n $ext = strtolower(pathinfo($imagenperfil['imgperfil']['name'], PATHINFO_EXTENSION));\n $hasta = '/images/profileImg/'.'perf'.$id.'.'.$ext;\n $usuario['srcImagenperfil'] = $hasta;\n }\n $userjson = json_encode($usuario);\n file_put_contents('usuarios.json', $userjson . PHP_EOL, FILE_APPEND);\n $this->subirImgPerfil($imagenperfil,$id);\n }else {\n // NOTE: si no encuentro al usuario guardo a los demas sin cambios\n $userjson = json_encode($usuario);\n file_put_contents('usuarios.json', $userjson . PHP_EOL, FILE_APPEND);\n }\n }\n }\n // NOTE: volver a convertir a json y guardar archivo usuarios.json\n //$userjson = json_encode($usuarios);\n //file_put_contents('usuarios2.json', $userjson . PHP_EOL, FILE_APPEND);\n //subirImgPerfil($imagenperfil,$id);\n\n\n }", "function modificarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_herrajeaccesorio','id_herrajeaccesorio','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('herrajeaccesorio','herrajeaccesorio','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function UpdateManga(){\r\n $this->idPost();\r\n $this->titlePost();\r\n $this->contentPost();\r\n $this->manga();\r\n $this->lastFileNamePost();\r\n // Testons si le fichier a bien été envoyé et s'il n'y a pas d'erreur\r\nif (isset($_FILES['file']) AND $_FILES['file']['error'] == 0){ \r\n // Testons si le fichier n'est pas trop gros\r\n if ($_FILES['file']['size'] <= 2000000)\r\n {\r\n \r\n unlink(\"public/images/manga/\" . $_POST['lastFileName']);\r\n \r\n $infosfichier = pathinfo($_FILES['file']['name']);// le'extention du fichier envoye .jpg etc\r\n \r\n $extension_upload = $infosfichier['extension'];//on le met dans un tableau\r\n \r\n $extensions_autorisees = array('jpg', 'jpeg', 'gif', 'png');// les extention qu'on acceptes\r\n \r\n\t\t $name = $infosfichier['filename'];// On recupere le nom du fichier envoye\r\n \r\n\t\t $file = 'Time' .time(). 'Name' .$name. '.' .$extension_upload;\r\n //Nom du fichier qu'on lui donne Time du moment + name + nom du fichier + extention\r\n \r\n // Testons si l'extension du fichier est egale a celle que l'on autorise\r\n if (in_array($extension_upload, $extensions_autorisees))\r\n {\r\n // On peut valider le fichier et le stocker définitivement\r\n move_uploaded_file($_FILES['file']['tmp_name'], 'public/images/manga/' . $file);\r\n }else{\t \r\n echo \"<script>alert(\\\"L'extension du fichier n'est pas autorisée. Seuls les fichiers jpg, jpeg, png sont acceptés.\\\")</script>\";\r\n}\r\n }else{\r\n echo \"<script>alert(\\\"Le fichier est trop volumineux (Poids limité à 4Mo)\\\")</script>\";\r\n\t\t}\r\n }else{\r\n $file = $this->_lastFileNamePostSecure;\r\n} \r\n $this->_mangaManager->updateManga($this->_idPostSecure, $this->_titlePostSecure, $this->_contentPostSecure, $file);\r\n \r\n header('location: GestionManga'); \r\n }", "public function editAvatar(EditUserForm $request){\n if(Auth::check()){\n $valid = User::select('id')\n ->where('email', $request->email)\n ->where('id', '<>' , $request->id)\n ->get();\n if(count($valid) <= 0){\n\n $user = User::find($request->id);\n $oldAvatar = $user->avatar; \n\n if ($request->avatar == $oldAvatar){\n\n $fileName = $request->avatar;\n }\n else{\n\n if ( $oldAvatar =='img/img_profile_users/default-avatar2.jpg') {\n\n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n }\n else{\n \n $idUnique = time();\n list(, $request->avatar) = explode(';', $request->avatar);\n list(, $request->avatar) = explode(',', $request->avatar);\n //Decodificamos $request->avatar codificada en base64.\n $avatar = base64_decode($request->avatar);\n $fileName = \"img/img_profile_users/\" . $idUnique . \"-\" . $request->name .\".jpg\";\n unlink($oldAvatar);\n //escribimos la información obtenida en un archivo llamado \n //$idUnico = time().jpg para que se cree la imagen correctamente\n file_put_contents($fileName, $avatar); //se crea la imagen en la ruta \n };\n } \n\n $sessionUser = Auth::user()->name;\n //$user = User::find($request->id);\n $user->name = $request->name;\n $user->email = $request->email;\n $user->telephone = $request->telephone;\n $user->dependence = $request->dependence;\n $user->role = $request->role;\n $user->avatar = $fileName;\n $user->save();\n $audi_users = new Audi_Users;\n $audi_users->name = $request->name;\n $audi_users->email = $request->email;\n $audi_users->telephone = $request->telephone;\n $audi_users->dependence = $request->dependence;\n $audi_users->role = $request->role;\n $audi_users->avatar = $fileName;\n $audi_users->id_user = Auth::user()->id;\n $audi_users->tipo_audi = 2;\n $audi_users->save();\n return ['success'=>'ok'];\n }else{\n return ['error'=>'Este correo ya esta asignado a otro usuario'];\n }\n }\n else{\n return ['error'=>'no se pudo completar la operacion'];\n }\n }", "public function Modificar(): bool\n {\n $retorno = false;\n $objetoAccesoDato = AccesoDatos::RetornarObjetoAcceso();\n\n\n $consulta =$objetoAccesoDato->RetornarConsulta(\"UPDATE usuarios SET nombre = :nombre, correo = :correo, clave = :clave, id_perfil = :id_perfil\n WHERE usuarios.id = :id\");\n // $consulta = $objetoAccesoDato->RetornarConsulta(\"UPDATE `usuarios` SET `nombre`='$this->nombre',`correo`='$this->correo',\"\n // . \"`clave`='$this->clave',`id_perfil`='$this->id_perfil' WHERE `id`='$this->id'\");\n\n\n $consulta->bindParam(':correo', $this->correo, PDO::PARAM_STR);\n $consulta->bindParam(':clave', $this->clave, PDO::PARAM_STR);\n $consulta->bindParam(':nombre', $this->nombre, PDO::PARAM_STR);\n $consulta->bindParam(':id_perfil', $this->perfil, PDO::PARAM_INT);\n $consulta->bindParam(':id', $this->id, PDO::PARAM_INT);\n\n $consulta->execute();\n $filasAfectadas = $consulta->rowCount();\n if ($filasAfectadas > 0)\n $retorno = true;\n\n\n return $retorno;\n }", "public function nuevoInstructor() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST' &&\n isset($_POST['tipoD']) &&\n !empty($_POST['tipoD']) &&\n isset($_POST['numero_documento']) &&\n !empty($_POST['numero_documento']) &&\n isset($_POST['nombre_user']) &&\n !empty($_POST['nombre_user']) &&\n isset($_POST['apellido_user']) &&\n !empty($_POST['apellido_user']) &&\n isset($_POST['correo_user']) &&\n !empty($_POST['correo_user']) &&\n isset($_POST['telefono_user']) &&\n !empty($_POST['telefono_user']) \n\n\n // $_FILES['imagen']['name']\n ) {\n \t#echo \"<script>alert('Entro al controlador')</script>\";\n /* $nom_arch = $_FILES['imagen']['name']; //obtener el nombre del imagen\n $ext_img = explode(\".\", $nom_arch);\n $ext_img = end($ext_img);\n $nombre_img = strtolower($_POST['nombre_user'] .'_'. $_POST['apellido_user']) . '.' . $ext_img; */\n\n\n $clave = $_POST['numero_documento'];\n\n $clavecifrada = password_hash($clave, PASSWORD_DEFAULT);\n\n $valores = array('tipo_documento' => $_POST['tipoD'],\n 'num_documento' => $_POST['numero_documento'],\n 'nombre_user' => $_POST['nombre_user'],\n 'apellido_user' => $_POST['apellido_user'],\n 'correo_user' => $_POST['correo_user'],\n 'telefono_user' => $_POST['telefono_user'],\n 'telefono_user' => $_POST['telefono_user'],\n 'pass' => $clavecifrada\n );\n //porceder a guardar mediante un metodo del modelo\n $guardar = ModeloInstructor::guardarInstructor($valores);\n //echo $guardar['id'];\n if($guardar['guardar'] != FALSE){\n echo '<script>\n swal({\n title: \"Guardo\",\n text: \"Instructor Guardado Correctamente\",\n icon: \"success\"\n }).then((willDelete) => {\n if (willDelete) {\n window.location.replace(\"registrarInstructor\");\n }\n });\n </script>';\n }\n\n $valoresU = array('pass' => $clavecifrada,\n 'num_documento' => $_POST['numero_documento'],\n 'nombre_user' => $_POST['nombre_user'],\n 'id_instructor' => $guardar['id']\n );\n //GUARDAMOS TAMBIEN EL USUARIO DE INGRESO AL APLICATIVO\n $guardarUser = ModeloInstructor::guardarInstructorUsuario($valoresU);\n /////////////////////\n if($guardarUser['guardar'] != FALSE){\n echo '<script>\n swal({\n title: \"Guardo\",\n text: \"Guardado Correctamente Usuario\",\n icon: \"success\"\n }).then((willDelete) => {\n if (willDelete) {\n window.location.replace(\"registrarInstructor\");\n }\n });\n </script>';\n }else{\n echo '<script>\n swal({\n title: \"Oops!\",\n text: \"Ha ocurrido un error al guardar Usuario\",\n icon: \"error\"\n });\n </script>';\n }\n ////////////////////\n } else {\n echo '<script>\n swal({\n title: \"Oops!\",\n text: \"No se recibieron algunos datos\",\n icon: \"error\"\n });\n </script>';\n }\n }", "public function modificarConcurso() {\n\n\t\tif(!$_SESSION[\"currentuser\"]){\n\t\t\techo \"<script>window.location.replace('index.php');</script>\";\n\t\t}\n\n\t\t$concu= new Concurso();\n\n\t\tif (isset($_POST[\"nombreC\"])){\n\t\t\t/*Metodo de la clase concurso que devuelve un boolean indicando si\n\t\t\tel concurso existe en la base de datos*/\n\t\t\t$existe=$concu->existConcurso();\n\n\t\t\t/*Si el concurso no existe devuelve un mensaje de error*/\n\t\t\tif(!$existe){\n\t\t\t\t$errors = array();\n\t\t\t\t$errors[\"nombreC\"] = \"Este concurso no existe, por lo que no se puede modificar\";\n\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t/*Si el concurso si que existe, se guardan los valores introducidos en la\n\t\t\t\tmodificacion en la clase concurso*/\n\t\t\t}else{\n\t\t\t\t$concu->setIdC('1');\n\t\t\t\t$concu->setNombreC($_POST[\"nombreC\"]);\n\n\t\t\t\t$ruta=\"./resources/bases/\";//ruta carpeta donde queremos copiar las imagenes\n\t\t\t\t$basesCTemp=$_FILES['basesC']['tmp_name'];//guarda el directorio temporal en el que se sube la imagen\n\t\t\t\t$basesC=$ruta.$_FILES['basesC']['name'];//indica el directorio donde se guardaran las imagenes\n\t\t\t\tmove_uploaded_file($basesCTemp, $basesC);\n\n\t\t\t\t$concu->setBasesC($basesC,$basesCTemp);\n\t\t\t\t$concu->setCiudadC($_POST[\"ciudadC\"]);\n\t\t\t\t$concu->setFechaInicioC($_POST[\"fechaInicioC\"]);\n\t\t\t\t$concu->setFechaFinalC($_POST[\"fechaFinalC\"]);\n\t\t\t\t$concu->setFechaFinalistasC($_POST[\"fechaFinalistasC\"]);\n\t\t\t\t$concu->setPremioC($_POST[\"premioC\"]);\n\t\t\t\t$concu->setPatrocinadorC($_POST[\"patrocinadorC\"]);\n\n\t\t\t\ttry{\n\t\t\t\t\t/*Comprueba si los datos introducidos son validos*/\n\t\t\t\t\t$concu->checkIsValidForRegister();\n\n\t\t\t\t\t// Actualiza los datos del concurso\n\t\t\t\t\t$concu->update();\n\n\t\t\t\t\t//mensaje de confirmación y redirige al metodo consultarConcurso del controlador ConcursoCotroller\n\t\t\t\t\techo \"<script> alert('Modificación realizada correctamente'); </script>\";\n\t\t\t\t\techo \"<script>window.location.replace('index.php?controller=concurso&action=consultarConcurso');</script>\";\n\n\t\t\t\t}catch(ValidationException $ex) {\n\n\t\t\t\t\t$errors = $ex->getErrors();\n\t\t\t\t\t$this->view->setVariable(\"errors\", $errors);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*Devuelve los datos del concurso para mostrarlos en la vista*/\n\t\t$concu = $this->concurso->ver_datos();\n\n\t\t/* Guarda el valor de la variable $concu en la variable concu accesible\n\t\tdesde la vista*/\n\t\t$this->view->setVariable(\"concu\", $concu);\n\n\t\t/*Permite visualizar: view/vistas/modificacionConcurso.php */\n\t\t$this->view->render(\"vistas\", \"modificacionConcurso\");\n\t}", "function editar_perfil() {\r\n\t//Comprueba que los campos tien cosas, si las tiene las actualiza y si no las omite.\r\n\r\n\tif(!empty($_FILES['imagen_perfil']['tmp_name'])) \r\n\t\trecibir_fichero();\r\n\t\r\n\tif(!empty($_POST['estado_usuario']))\r\n\t\teditar_estado();\r\n\t\r\n\tif(!empty($_POST['nombre']))\r\n\t\teditar_nombre();\r\n\r\n\treturn true;\r\n}", "private function processUpdateUser(){\n\n\t\tif($_FILES[\"foto_usuario\"][\"error\"] == 0){\n\t\t\t$randNumber = rand(0, 999999);\n\t\t\t$imgName = $randNumber . $_FILES['foto_usuario']['name'];\n\t\t\t$image_upload = Config::$userDirImage . $imgName;\n\t\t\tif (move_uploaded_file($_FILES['foto_usuario']['tmp_name'], $image_upload)) {\n\t\t\t\t$result = $this->users->updateUser($_REQUEST[\"idusuario\"], $imgName); //Devuelve 1 si inserta user\n\t\t\t\tif($result){\n\t\t\t\t\tif($_REQUEST[\"nombre_foto\"] != \"\")\n\t\t\t\t\t\tunlink(Config::$userDirImage.$_REQUEST[\"nombre_foto\"]);\n\t\t\t\t\tView::redireccion(\"user\", \"userController\");\n\t\t\t\t} else {\n\t\t\t\t\tunlink($image_upload);\n\t\t\t\t\techo \"Ocurrio un error al insertar el usuario.\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"Ocurrio un error al guardar el archivo.\";\n\t\t\t}\n\t\t} else {\n\t\t\techo \"Ocurrio un error al cargar el archivo.\";\n\t\t}\n\t}", "public function actualizar($req,$id){\n\t\t//$stringCamposActualizar = \"\";\n\t\t$conexion = $GLOBALS['conexion'];\t\t\n\t\t//if(isset($req['nombres'])){\n\t\tif(isset($req['nombres']) && !empty($_FILES[0]['tmp_name'])){\t\t\t\n\t\t\t$nombre \t\t\t= addslashes(strip_tags($req['nombres']));\n\t\t\t$apellidos \t\t\t= addslashes(strip_tags($req['apellidos']));\n\t\t\t$email \t\t\t\t= addslashes(strip_tags($req['email']));\n\t\t\t$movil \t\t\t\t= addslashes(strip_tags($req['telefono_movil']));\n\t\t\t$fijo \t\t\t\t= addslashes(strip_tags($req['telefono_fijo']));\t\t\t\n\t\t\t$presentacion \t\t= addslashes(strip_tags($req['presentacion']));\n\t\t\t$fecha_modificacion = addslashes(date(\"Y-m-d\"));\t\t\t\n\t\t\t$CVNpdf \t\t\t= addslashes(file_get_contents($_FILES[0]['tmp_name']));\n\t\t\t\n\t\t\ttry{\n\t\t\t\t//Actualizar de acuerdo al id y solo si es diferente de procesado. Es decir si está en pendiente o error\t\t\t\n\t\t\t\t$query = \"UPDATE persona SET nombre='$nombre',\n\t\t\t\t\t\t\t\t\t\t\t apellidos='$apellidos', \n\t\t\t\t\t\t\t\t\t\t\t email='$email', \n\t\t\t\t\t\t\t\t\t\t\t telefono_movil='$movil', \n\t\t\t\t\t\t\t\t\t\t\t telefono_fijo='$fijo', \n\t\t\t\t\t\t\t\t\t\t\t presentacion='$presentacion', \n\t\t\t\t\t\t\t\t\t\t\t CVNPdf='$CVNpdf',\n\t\t\t\t\t\t\t\t\t\t\t fecha_modificacion='$fecha_modificacion',\n\t\t\t\t\t\t\t\t\t\t\t estado_procesado='_PENDIENTE', \n\t\t\t\t\t\t\t\t\t\t\t estado='publico'\n\t\t\t\t\t\t\t\t\t\tWHERE id=$id \";\t\t\t\t\t\t\n\t\t\t\t$status = $conexion->query($query);//devuelve true or false\t\t\t\t\n\t\t\t\t$mensaje = \"Los datos fueron actualizados satisfactoriamente\";\n\t\t\t\t\n\t\t\t}catch(Exception $ex){\n\t\t\t\t$status = false;\n\t\t\t\t$mensaje = \"Error al actualizar. Mensaje: \".$ex->getMessage();\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t$data = array('status'=>$status, 'mensaje'=>$mensaje);\n\t\treturn $data;\t\t\n\t}", "public function update(Request $request, $id)\n {\n\n //Solo los miembros pueden editar\n $consulta=RsuParticipante::where('rsu_proyecto_id',$id)\n ->where('user_id',Auth::user()->id)->get();\n //return $consulta;\n if($consulta->isEmpty()){\n return redirect()->route('rsu.mp.index')->with('rojo','Ud. no tiene permiso para editar este proyecto');\n }\n //inicializamos las ruta de los archivos\n\n $myProyect= RsuProyecto::find($id);\n //si se cargaron archivos que guarden las imagenes en el servidor\n if($request->file('aprobacion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_aprobacion);\n $fileAprobacion= $request->file('aprobacion-file')->store('public/rsu/aprobacion');\n $myProyect->file_aprobacion=$fileAprobacion;\n }\n if($request->file('culminacion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_culminacion);\n $fileCulminacion= $request->file('culminacion-file')->store('public/rsu/culminacion');\n $myProyect->file_culminacion=$fileCulminacion;\n }\n if($request->file('satisfaccion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_satisfaccion);\n $fileSatisfaccion=$request->file('satisfaccion-file')->store('public/rsu/satisfaccion');\n $myProyect->file_satisfaccion=$fileSatisfaccion;\n }\n //guardar datos a la tabla rsu_proyectos\n \n $myProyect->titulo=$request->get('titulo');\n $myProyect->doc_aprobacion=$request->get('doc_aprobacion');\n $myProyect->lugar=$request->get('lugar');\n $myProyect->beneficiarios=$request->get('beneficiarios');\n $myProyect->aliados=$request->get('aliados');\n $myProyect->porcentaje=$request->get('porcentaje');\n $myProyect->doc_culminacion=$request->get('doc_culminacion');\n $myProyect->objetivos=$request->get('objetivos');\n $myProyect->justificacion=$request->get('justificacion');\n $myProyect->logros=$request->get('logros');\n $myProyect->dificultades=$request->get('dificultades');\n $myProyect->satisfaccion=$request->get('satisfaccion');\n $myProyect->mas_lineamientos=$request->get('mas_lineamientos');\n $myProyect->save();\n //Guardamos el ID del proyecto registrado\n// $ultimoID=$myProyect->id;\n\n// $array1 = array(1, 2,3,4);\n// $array2 = array(2,11,6);\n\n //return array_diff($array1, $array2);\n //Para eliminar\n //return $paraEliminar=RsuLineamientoProyecto::where('rsu_proy_id',$id)->whereNotBetween('rsu_lin_id',[100,12])->get(); \n //return $request->get('lineas');\n $lineas=$request->get('lineas');\n if($lineas){\n return $paraEliminar=RsuLineamientoProyecto::where('rsu_proy_id',$id)->whereNotIn('rsu_lin_id',$lineas)->pluck('rsu_lin_id');\n foreach($request->get('lineas') as $linea){\n $lineamientos=new RsuLineamientoProyecto;\n $lineamientos->rsu_lin_id=$linea;\n $lineamientos->rsu_proy_id=$ultimoID;\n $lineamientos->save();\n }\n }\n return redirect()->route('rsu.mp.index')->with('verde','Actualizó el proyecto \\''.$myProyect->titulo.'\\' correctamente');\n }", "function modificarUcedifobracivil(){\n\t\t$this->procedimiento='snx.ft_ucedifobracivil_ime';\n\t\t$this->transaccion='SNX_UDOC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_ucedifobracivil','id_ucedifobracivil','int4');\n\t\t$this->setParametro('id_ucedifsubgrupo','id_ucedifsubgrupo','int4');\n\t\t$this->setParametro('cantidadobracivil','cantidadobracivil','numeric');\n\t\t$this->setParametro('id_obracivilmoe','id_obracivilmoe','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function actualizar_imagen($id_imagen,$id_tipo_imagen,$estado,$registrado,$id_licencia,$id_autor,$tags,$tipo_pictograma,$validos_senyalectica) {\n\t\t\n\t\t$timestamp=time();\n\t\t$fecha=date(\"Y-m-d H:i:s\",$timestamp);\n\t\t\t\t\n\t\t$UpdateRecords = \"UPDATE imagenes \n\t\tSET estado='$estado', \n\t\tregistrado='$registrado', ultima_modificacion='$fecha',\n\t\tid_licencia='$id_licencia', id_autor='$id_autor',\n\t\ttags_imagen='$tags', id_tipo_imagen='$id_tipo_imagen',\n\t\ttipo_pictograma=$tipo_pictograma,\n\t\tvalidos_senyalectica='$validos_senyalectica'\n\t\tWHERE id_imagen='$id_imagen'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords); \n\t\tmysql_close($connection);\n\t\t\t\n\t}", "public function updatefile(Request $request, $id)\n {\n //\n\n $validar=validator::make($request->all(),[\n 'imagenup'=>'image|mimes:jpeg,jpg,png,gif',\n ]);\n if($validar->passes()){\n $noticiaold=Noticia::find($id);\n\n //$Tesiold->delete();\n $archivo=$request->file('imagenup');\n $nombre=$archivo->getClientOriginalName();\n $carpeta=\"img/noticias/\".$nombre;\n /* $fileregistro = new Tesi;\n $fileregistro->documento =$nombre;\n $fileregistro->directorio=$carpeta;\n */\n // \\Storage::disk('local')->put($nombre, \\File::get($archivo));\n $archivo->move('img/noticias',$nombre);\n // $entrada['documento']=$nombre;\n\n $noticiaold->fill($request->all());\n $noticiaold->save();\n\n return response()->json();\n }else{\n foreach ($validar->errors()->all() as $message) {\n\n return response()->json(['error'=>$message]);\n }\n\n }\n }", "function update_photo($pseudo,$pd){\n \tif (isset($pd) && $pd['error']== 0){\n \n if ($pd['size'] <= 7000000)\n {\n $infosfichier = pathinfo($pd['name']);\n $extension_upload = $infosfichier['extension'];\n $extensions_autorisees = array('jpg', 'jpeg','JPG','JPEG','png','PNG');\n $nomFichier = basename($pd['name']) ;\n\n if (in_array($extension_upload,$extensions_autorisees)){\n\n \t move_uploaded_file($pd['tmp_name'], 'admin/fichiers/photos/' . basename($pd['name']));\n \t $re = new DbManager();\n \t $re -> update_pdp($pseudo,$nomFichier); \n return true;\n }\n }else echo 'erreur de taille du fichiers ';\n \n\n \t }\n }", "function modificarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function updateHuitre($id,$nomHuitre,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n\n $target_file = $path . basename($upfile[\"name\"]);\n\n if (isset($_POST[\"submit\"])) \n {\n \n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false) {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n var_dump($target_file);\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=huitres');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n \n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $huitres = new HuitreManager();\n $updateHuitre = $huitres->updateHuitre($id,$nomHuitre,$content,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');\n }else{\n $huitres = new HuitreManager();\n $newHuitre = $huitres->newHuitre($nomHuitre,$content,$alt,$target_file);\n\n header('Location: hbAdmin.php?action=huitres');}\n }\n }", "public function alterarFotoCapaGrupo($grupoID)\n { \n\n $usuarioID = $_SESSION['usuario_id'];\n\n // Verifica se este usuário é administrador deste grupo\n $verificaUsuarioCriouGrupo = COUNT($this->mapper->grupo(array('usuario_criacao' => $usuarioID, 'id' => $grupoID))->fetchall());\n\n if($verificaUsuarioCriouGrupo == 1){\n\n $grupoPagina = 0;\n\n // Configurações de acesso ao bucket no s3\n $bucket=\"bucket-socialgroups\";\n $awsAccessKey=\"AKIAIKVT6CC24NGCKLPQ\";\n $awsSecretKey=\"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\";\n $s3 = new S3($awsAccessKey, $awsSecretKey);\n // Configurações de acesso ao bucket no s3\n\n $posicao = 0;\n\n\n foreach($_FILES as $file){\n\n $tmpname = $file['tmp_name'];\n\n // Armazena a extensão do arquivo em uma url\n $extencao = strrchr($file['name'], '.');\n $codigoFile = md5($file['name'][$posicao].date('Y-m-d H:i:s'));\n\n $posicao++;\n\n\n if($s3->putObjectFile($tmpname, $bucket , $codigoFile.$extencao, S3::ACL_PUBLIC_READ) ){\n\n $s3file='https://'.$bucket.'.s3.amazonaws.com/'.$codigoFile.$extencao;\n $capa = $s3file;\n\n }\n\n\n // Atualiza Foto capa do grupo\n $atualizaFotoCapaGrupo = $this->mapper->grupo(array('id' => $grupoID))->fetch();\n $atualizaFotoCapaGrupo->grupo_avatar = $capa;\n $this->mapper->grupo->persist($atualizaFotoCapaGrupo);\n $this->mapper->flush();\n // Atualiza Foto capa do grupo\n\n }\n\n\n // Retorna dados após reload na pagina\n $GetGrupos = new GetGrupos();\n // Retorna dados após reload na pagina\n\n $returnacao = 'alterarCapaGrupo';\n\n return $GetGrupos->grupoSelecionado($grupoID, $grupoPagina, $returnacao);\n\n }\n\n\n\n\n \n\n }", "function ActualizarColectivos()\n {\t\n $user = User::where('id', 1)->first();\n \\Auth::loginUsingId($user->id);\n \n $response = $this->json('PATCH', '/colectivo/69', [\n 'empresa' => 'Empresa Rawson S.R.L',\n 'numero' => '2'\n ]);\n\n $response\n ->assertStatus(200);\n $response\n \t\t->assertJsonStructure([\n \t\t\t\t'message',\n \t\t]);\n\n }", "function updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file)\n {\n $upfile=$_FILES[\"img\"];\n if($upfile[\"name\"]!=''){ \n $typelist=array(\"image/jpeg\",\"image/jpg\",\"image/png\",\"image/gif\");\n $path=\"app\\public\\\\front\\images\\\\\";\n $target_file = $path . basename($upfile[\"name\"]);\n if (isset($_POST[\"submit\"])) \n {\n $check = getimagesize($upfile[\"tmp_name\"]);\n if ($check !== false)\n {\n if($upfile['size']>500000){\n }\n if(!in_array($upfile[\"type\"],$typelist)){\n die(\"Seuls les formats JPG, JPEG, PNG & GIF files sont authorisés.\");\n }\n if (move_uploaded_file($upfile[\"tmp_name\"], $target_file)) {\n\n if($id>0){\n $producers = new ProducerManager();\n $updateProducer = $producers->updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=producers');\n }else{\n $producers = new ProducerManager();\n $newProducer = $producers->newProducer($nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n\n header('location: hbAdmin.php?action=producers');}\n }else\n {\n echo \"Désolé, une erreur est survenue dans l'envoi de votre fichier. \";\n } \n }\n } else {\n echo \"Ce fichier n'est pas une image. \";\n }\n }else{\n if($id>0){\n $producers = new ProducerManager();\n $updateProducer = $producers->updateProducer($id,$nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n \n header('Location: hbAdmin.php?action=producers');\n }else{\n $producers = new ProducerManager();\n $newProducer = $producers->newProducer($nomproducteur,$adresse,$tel,$huitre_n,$content,$alt,$target_file);\n\n header('location: hbAdmin.php?action=producers');}\n }\n}", "function modificarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_ime';\n\t\t$this->transaccion='PRE_PAREJE_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_partida_ejecucion','id_partida_ejecucion','int4');\n\t\t$this->setParametro('id_int_comprobante','id_int_comprobante','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('id_presupuesto','id_presupuesto','int4');\n\t\t$this->setParametro('id_partida','id_partida','int4');\n\t\t$this->setParametro('nro_tramite','nro_tramite','varchar');\n\t\t$this->setParametro('tipo_cambio','tipo_cambio','numeric');\n\t\t$this->setParametro('columna_origen','columna_origen','varchar');\n\t\t$this->setParametro('tipo_movimiento','tipo_movimiento','varchar');\n\t\t$this->setParametro('id_partida_ejecucion_fk','id_partida_ejecucion_fk','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha','fecha','date');\n\t\t$this->setParametro('monto_mb','monto_mb','numeric');\n\t\t$this->setParametro('monto','monto','numeric');\n\t\t$this->setParametro('valor_id_origen','valor_id_origen','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function actualizar($id, Request $request){\n\n try {\n\n// $rules = array(\n// 'nombres' => array( 'required', 'string', 'min:10' ),\n// 'apellidos' => array( 'required', 'string', 'min:10' ),\n// 'biografia' => array( 'required', 'string', 'min:50'),\n// 'foto' => array('image','image_size:>=300,>=300')\n// );\n// $this->validate( $request,$rules );\n\n $registro = User::find($id);\n\n// dd($registro);\n\n if(\\Input::get('avatar')){\n $avatar = BRequest::file('foto');\n $extension = $avatar->getClientOriginalExtension();\n $avatar_name = preg_replace('/\\s*/', '', \\Input::get('nombres'));\n $avatar_name = strtolower($avatar_name);\n Storage::disk('image')->put($avatar_name.'.'.$extension, File::get($avatar));\n $registro ->avatar = $avatar_name.'.'.$extension;\n }\n $registro ->name = \\Input::get('nombres');\n\n if(\\Input::get('password')){\n $registro ->password = \\Hash::make(\\Input::get('password'));\n }\n\n $registro ->type = 0;\n $registro ->email = \\Input::get('email');\n $registro ->save();\n\n \\DB::table('role_user')\n ->where('user_id',$registro ->id)\n ->update(['role_id' => \\Input::get('rol')]);\n\n return \\Redirect::route('adminEmpleados')\n ->with('alerta','El integrante ha sido modificado con exito!');\n\n } catch ( ValidationException $e ) {\n\n return \\Redirect::action( 'EquipoCtrl@editar',array('id'=>$id) )\n ->withInput()\n ->withErrors( $e->get_errors() );\n\n }\n\n }", "public function updatePhoto()\n {\n //Intenta subir la foto que viene en el campo 'photo'\n if ($photo = $this->uploadPhoto('photo')) {\n //Modifica el campo photo del usuario y lo intenta actualizar\n $this->photo = $photo;\n return $this->update();\n }\n }", "public function modificar_visibilidad_archivo() {\n $this->load->model('archivo');\n\n //recuperar el ID\n $idAModificar = intval($this->input->post('idArchivo', TRUE));\n\n // validar el ID y verificar que no este vacio\n if (empty($idAModificar) || !$this->archivo->init($idAModificar)) {\n session_redirect(UI_MESSAGE_ERROR, \"No encontramos el archivo que quiere modificar\", site_url(\"admin\"));\n }\n\n //intentar modificar la visibilidad\n if ($this->archivo->modificar_visibilidad()) {\n session_redirect(UI_MESSAGE_OK, \"Se ha modificado la visibilidad del archivo seleccionado\", site_url(\"admin\"));\n } else {\n session_redirect(UI_MESSAGE_ERROR, \"No se ha podido modificar la visibilidad del archivo seleccionado\", site_url(\"admin\"));\n }\n }", "function modificarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_ime';\n\t\t$this->transaccion='DIR_EMP_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_empresa','id_empresa','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo_sociedad','tipo_sociedad','varchar');\n\t\t$this->setParametro('objeto','objeto','text');\n\t\t$this->setParametro('dir_comercial','dir_comercial','varchar');\n\t\t$this->setParametro('nit','nit','varchar');\n\t\t$this->setParametro('clase','clase','varchar');\n\t\t$this->setParametro('domicilio','domicilio','text');\n\t\t$this->setParametro('matricula','matricula','int8');\n\t\t$this->setParametro('renovado','renovado','int4');\n\t\t$this->setParametro('domicilio_legal','domicilio_legal','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('seccion','seccion','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('divission','divission','varchar');\n\t\t$this->setParametro('estado_matricula','estado_matricula','varchar');\n\t\t$this->setParametro('mail','mail','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function update(Request $request, $id_comer)\n {\n $sw1 = 0;\n $rules = [\n 'archi_comer' => 'required',\n 'tipo_comer' => 'required'\n ];\n \n $messages = [\n 'archi_comer.required' => 'El Nombre del Archivo no puede ser nulo',\n 'tipo_comer.required' => 'El Tipo de Archivo no puede ser nulo'\n ];\n\n $this->validate($request, $rules, $messages);\n\n $cc_user = auth()->user()->cc_user;\n// $id_comer = $request->input('id_comer');\n// $id_comer = $id;\n $name = 'parqueos5.jpg';\n\n $comerciales = Comercial::where('id_comer', '=', $id_comer);\n\n if($request->hasFile('archi_comer')){\n $file = $request->file('archi_comer');\n $name = $file->getClientOriginalName();\n $file->move(public_path().'/img/', $name);\n// return $name;\n }\n\n $comerciales->update(['archi_comer'=> $name,\n 'tipo_comer'=> $request->input('tipo_comer')\n ]);\n Session::flash('message','Registro Actualizado Correctamente!');\n Session::flash('class','info');\n\n return Redirect::to('t_comercial/show/'.$id_comer)->with('status','Actualizado Correctamente....!');\n\n }", "public function postCargarInformacion(){\n\t\t$fecha = date(\"Y-d-m H:i:s\");\n\t\t$registro = DB::SELECT(\"SELECT ident_current('MODBID_INFORMACIONPUBLIC') AS [LastID_1]\");\t\t\n\t\t$id_foto = (($registro[0]->LastID_1)+1).\".jpg\";\n\t\t\t\t\n\t\tDB::table('MODBID_INFORMACIONPUBLIC')->insert(\n\t\t \tarray(\n\t\t \t\t'id_usuario' => Auth::user()->id,\t\t \t\t\n\t\t \t\t'titulo' => Input::get('titulo'),\n\t\t \t\t'foto' => $id_foto,\n\t\t \t\t'tipo' => Input::get('tipo'),\n\t\t \t\t'texto' => Input::get('texto'),\t\t\t \t\t\n\t\t \t\t'created_at' => $fecha,\n\t \t\t\t'updated_at' => $fecha,\n\t \t\t\t'fecha_noticia' => Input::get('fecha_info')\n\n\t\t \t)\n\t\t);\n\n\t\t$path_foto = public_path().'/assets/bid/informacion/'.(($registro[0]->LastID_1)+1).\"/\";\n\t\tInput::file('foto')->move($path_foto,$id_foto);\n\t\treturn Redirect::to('vista1_bid')->with('status', 'ok_estatus');\n\t}", "function evt__form_cargo__modificacion($datos)\r\n\t{\r\n $res=0;\r\n if($this->controlador()->dep('datos')->tabla('cargo')->esta_cargada()){//es una modificacion\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n \r\n if(isset($datos['id_puesto'])){\r\n $res=$this->controlador()->dep('datos')->tabla('puesto')->hay_superposicion_con($car['id_cargo'],$datos['id_puesto'],$datos['fec_alta'],$datos['fec_baja']);\r\n }\r\n if($res==1){//hay otro puesto \r\n toba::notificacion()->agregar('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos', 'error'); \r\n }else{\r\n $this->controlador()->dep('datos')->tabla('cargo')->set($datos);\r\n $this->controlador()->dep('datos')->tabla('cargo')->sincronizar(); \r\n }\r\n }else{//es un alta\r\n if(isset($datos['id_puesto'])){\r\n $res=$this->controlador()->dep('datos')->tabla('puesto')->hay_superposicion_con(0,$datos['id_puesto'],$datos['fec_alta'],$datos['fec_baja']); \r\n }\r\n if($res==1){//hay otro puesto \r\n throw new toba_error('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos');\r\n // toba::notificacion()->agregar('Hay superposicion. El puesto id:'.$datos['id_puesto']. ' esta ocupado por otro cargo en ese periodo. Ver en Informes->Puestos', 'error'); \r\n }else{\r\n $pers=$this->controlador()->dep('datos')->tabla('persona')->get(); \r\n $datos['generado_x_pase']=0;\r\n $datos['id_persona']=$pers['id_persona'];\r\n $this->controlador()->dep('datos')->tabla('cargo')->set($datos);\r\n $this->controlador()->dep('datos')->tabla('cargo')->sincronizar();\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $cargo['id_cargo']=$car['id_cargo'];\r\n $this->controlador()->dep('datos')->tabla('cargo')->cargar($cargo);\r\n } \r\n }\r\n\t}", "private function aksi_upload_foto_profil_profil_saya($id_admin)\n {\n $config['upload_path'] = './../assets/uploads/admin/';\n $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf';\n $config['file_name'] = 'foto_admin-' . date('ymd') . '-' . substr(md5(rand()), 0, 10);\n\n $this->load->library('upload', $config);\n $id_admin = $this->input->post('id_admin');\n\n if (!empty($_FILES['berkas']['name'])) {\n\n if ($this->upload->do_upload('berkas')) {\n\n $uploadData = $this->upload->data();\n\n //Compres Foto\n $config['image_library'] = 'gd2';\n $config['source_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $config['create_thumb'] = FALSE;\n $config['maintain_ratio'] = TRUE;\n $config['quality'] = '50%';\n $config['width'] = 600;\n $config['height'] = 400;\n\n $config['new_image'] = './../assets/uploads/admin/' . $uploadData['file_name'];\n $this->load->library('image_lib', $config);\n $this->image_lib->resize();\n\n $item = $this->db->where('id_admin', $id_admin)->get('admin')->row();\n\n //replace foto lama \n if ($item->foto_profil_admin != \"placeholder_profil.png\") {\n $target_file = './../assets/uploads/admin/' . $item->foto_profil_admin;\n unlink($target_file);\n }\n\n $data['foto_profil_admin'] = $uploadData['file_name'];\n\n $this->db->where('id_admin', $id_admin);\n $this->db->update('admin', $data);\n }\n }\n }", "public function ActualizarPerfilAlumnoC(){\n\n\t\tif(isset($_POST[\"idAl\"])){\n\n\t\t\t$rutaImg = $_POST[\"imgActual\"];\n\n\t\t\tif(isset($_FILES[\"imgAl\"][\"tmp_name\"]) && !empty($_FILES[\"imgAl\"][\"tmp_name\"])){\n\n\t\t\t\tif(!empty($_POST[\"imgActual\"])){\n\n\t\t\t\t\tunlink($_POST[\"imgActual\"]);\n\n\t\t\t\t}\n\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".png\";\n\n\t\t\t\t\t$foto = imagecreatefrompng($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagepng($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t\tif($_FILES[\"imgAl\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$nombre = mt_rand(100,999);\n\n\t\t\t\t\t$rutaImg = \"Vistas/img/Alumnos/Al-\".$nombre.\".jpg\";\n\n\t\t\t\t\t$foto = imagecreatefromjpeg($_FILES[\"imgAl\"][\"tmp_name\"]);\n\n\t\t\t\t\timagejpeg($foto, $rutaImg);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$tablaBD = \"alumnos\";\n\n\t\t\t$datosC = array(\"id\"=>$_POST[\"idAl\"], \"nombre\"=>$_POST[\"nombreAl\"], \"apellidopaterno\"=>$_POST[\"apellidopaternoAl\"], \"apellidomaterno\"=>$_POST[\"apellidomaternoAl\"], \"noControl\"=>$_POST[\"noControl\"], \"correo\"=>$_POST[\"correoAl\"], \"clave\"=>$_POST[\"claveAl\"], \"foto\"=>$rutaImg);\n\n\t\t\t$resultado = AlumnosM::ActualizarPerfilAlumnoM($tablaBD, $datosC);\n\n\t\t\tif($resultado == true){\n\n\t\t\t\tif ($_SESSION[\"rol\"] == \"Alumno\") {\n\t\t\t\t\t\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/perfil-'.$_SESSION[\"rol\"].'\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}else if ($_SESSION[\"rol\"] == \"Administrador\"){\n\n\t\t\t\t\techo '<script>\n\t\t\t\t\twindow.location = \"http://localhost/psicologiaitsur/alumnos\";\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function agregar_noticia_controlador(){\n\n\t\t$not_titulo = mainModel::limpiar_cadena($_POST['noticia_titulo']);\n\t\t$not_imagen = mainModel::limpiar_cadena($_FILES['imagen']['name']);\n\t\t$not_drescripcion = mainModel::limpiar_cadena($_POST['descripcion']);\n\t\t$dir = SEVERURL.'assets/imagenes/';\n\n\t\tif ($_FILES['imagen']['size'] > 2000000) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Solo se permiten archivos menores a 2 MB',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}\n\n\t\tif ($_FILES['imagen']['type'] != 'image/png') {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Solo se permiten archivos de tipo imagen',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}\n\n\t\t/*if (!move_uploaded_file($_FILES['imagen']['tmp_name'], $dir.$not_imagen)) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'Error al subir archivo',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\n\t\t\treturn mainModel::sweetalert($alerta);\n\t\t}*/\n\n\t\t$notDatos = [\n\t\t\t'titulo' => $not_titulo,\n\t\t\t'imagen' => $not_imagen,\n\t\t\t'descripcion' => $not_drescripcion\n\t\t];\n\n\t\t$respuesta = NoticiasModelo::agregar_noticia_modelo($notDatos);\n\n\t\tif ($respuesta->rowCount() >= 1) {\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'limpiar',\n\t\t\t\t'Titulo'=>'Bien hecho!',\n\t\t\t\t'Texto'=>'La noticia se registró exitosamente',\n\t\t\t\t'Tipo'=>'success'\n\t\t\t];\n\t\t}else{\n\t\t\t$alerta = [\n\t\t\t\t'Alerta' => 'simple',\n\t\t\t\t'Titulo'=>'Ocurrio un error inesperado',\n\t\t\t\t'Texto'=>'No se pudo registrar la noticia',\n\t\t\t\t'Tipo'=>'error'\n\t\t\t];\n\t\t}\n\n\t\treturn mainModel::sweetalert($alerta);\n\n\t}", "function subidaFichero($bd,$usuario,$entrada){\n if(isset($_FILES['imagen']['name']) && strlen ($_FILES['imagen']['name'])>0) {\n $dir_subida = $usuario . \"/\";\n ///////////NO TENGO PERMISOS DE CREAR CARPETAS!!!!!!!\n if ( !is_dir($dir_subida) && is_writable(\"../redsocial\")) {\n mkdir($dir_subida,0755, true);\n }else\n $dir_subida=\"img/\";\n $path = $_FILES['imagen']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION);\n $fichero_subido = $dir_subida . $usuario . date(\"Ymd_Hm\").\".\".$ext;\n /////NO TENGO PERMISOS PARA SUBIR ARCHIVOS!!!!\n if(is_writable($dir_subida)) {\n if (!move_uploaded_file($_FILES['imagen']['tmp_name'], $fichero_subido)) {\n echo \"Problema de ataque de subida de ficheros!.\\n\";\n }\n }\n $imagen = new Imagen(null, $fichero_subido, $entrada->getId());\n $daoImagenes = new Imagenes($bd);\n $daoImagenes->addImagen($imagen, $entrada);\n return $fichero_subido;\n }\n\n}", "public function actualizar(ValidarCertificado $request, $id)\n {\n /*\n $image = $request->file('foto_up');\n $filename = $request->usuario . '.' . $image->getClientOriginalExtension();\n $image->storeAs('public/certificado/usuario',$filename);\n //$request->file('foto_up')->storeAs('public/imagenes/usuario',$request->usuario . '.jpg');\n $request->request->add(['foto' => $filename]);\n $certificado = Certificado::findOrFail($id);\n $certificado->update(array_filter($request->all()));\n */\n \n $certificado = Certificado::findOrFail($id);\n //dd($request->foto_up);\n\n if ($foto = Certificado::setFotoCertificado($request->foto_up,$certificado->foto)){\n $request->request->add(['foto' => $foto]);\n }\n Certificado::findOrFail($id)->update($request->all());\n return redirect('certificado')->with('mensaje','Certificado actualizado con exito');\n }", "public function update(Request $request, $id_permohonan)\n {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n \n if(Session::get('roles') == 2 or Session::get('roles') == 1) {\n // dd(!empty($request->file('krs')));die(); \n if (empty($request->file('krs')) and empty($request->file('bukti_tf')) and empty($request->file('transkip_nilai')))\n {\n $data->krs = $data->krs;\n $data->transkip_nilai = $data->transkip_nilai;\n $data->bukti_tf = $data->bukti_tf;\n }elseif (!empty($request->file('krs'))) {\n unlink('uploads/krs/'.$data->krs); //menghapus file lama\n $krs = $request->file('krs');\n $ext = $krs->getClientOriginalExtension();\n $newName = \"krs \".date('Ymd_his').\".\".$ext;\n $krs->move('uploads/krs',$newName);\n $data->krs = $newName;\n }\n elseif (!empty($request->file('transkip_nilai'))) {\n unlink('uploads/transkip_nilai/'.$data->transkip_nilai); //menghapus file lama\n $transkip_nilai = $request->file('transkip_nilai');\n $ext1 = $transkip_nilai->getClientOriginalExtension();\n $newName1 = \"transkip_nilai \".date('Ymd_his').\".\".$ext1;\n $transkip_nilai->move('uploads/transkip_nilai',$newName1);\n $data->transkip_nilai = $newName1;\n } elseif (!empty($request->file('bukti_tf'))) {\n unlink('uploads/bukti_tf/'.$data->bukti_tf); //menghapus file lama\n $bukti_tf = $request->file('bukti_tf');\n $ext2 = $bukti_tf->getClientOriginalExtension();\n $newName2 = \"bukti_tf \".date('Ymd_his').\".\".$ext2;\n $bukti_tf->move('uploads/bukti_tf',$newName2);\n $data->bukti_tf = $newName2;\n }\n } elseif(Session::get('roles') == 3)\n { \n if(Input::get('Terima'))\n {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 2;\n // $data->save();\n } elseif (Input::get('Tolak')) {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 1;\n // $data->save();\n }\n } elseif(Session::get('roles') == 4)\n { \n if(Input::get('Terima'))\n {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 3;\n // $data->save();\n } elseif (Input::get('Tolak')) {\n $data = ModelPermohonan::where('id_permohonan',$id_permohonan)->first();\n $data->catatan = $request->catatan;\n $data->status = 1;\n // $data->save();\n }\n }\n $data->save();\n return redirect()->route('permohonan.index')->with('alert-success','Data berhasil diubah!'); \n }", "function modificarFactura(){\r\n\t\t$this->procedimiento='tesor.ft_factura_ime';\r\n\t\t$this->transaccion='TSR_FAC_MOD';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('nro_factura','nro_factura','int4');\r\n\t\t$this->setParametro('nombre_emisor','nombre_emisor','varchar');\r\n\t\t$this->setParametro('domicilio_emisor','domicilio_emisor','varchar');\r\n\t\t$this->setParametro('nit_emisor','nit_emisor','int4');\r\n\t\t$this->setParametro('nombre_cliente','nombre_cliente','varchar');\r\n\t\t$this->setParametro('domicilio_cliente','domicilio_cliente','varchar');\r\n\t\t$this->setParametro('nit_cliente','nit_cliente','int4');\t\t\r\n\t\t$this->setParametro('fecha_emision','fecha_emision','date');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function alterFotoFisi($conexao, $foto_coment, $foto_nome, $foto_tel, $foto_cel, $foto_cpf, $foto_end, $foto_num, $foto_estado, $foto_cidade, $foto_email, $foto_especi, $foto_img,$foto_emp='', $foto_cep=''){\n\t\techo \"<br/>Dentro do foto_especi: \".print_r($foto_especi).\"<br/>\";\n\n\t\t$sql_update = sprintf(\"\n\t\t\t\tupdate fotografo f, fotografo_fisico fs, localizacao_foto lf\n\t\t\t\tset f.foto_comentario = '%s', f.foto_img_perf = '%s',\n\t\t\t\t fs.foto_fisi_nome = '%s', fs.foto_fisi_tel = '%s', fs.foto_fisi_cel = '%s', fs.foto_fisi_cpf = '%s',\n\t\t\t\t lf.loca_end_foto = '%s',lf.loca_num_foto = '%s', lf.loca_estado_foto = %u, lf.loca_cidade_foto = %u,\n\t\t\t\t fs.foto_fisi_nome_emp = '%s', lf.loca_cep_foto = '%s'\n\t\t\t\twhere f.foto_cod = fs.foto_cod\n\t\t\t\tand f.foto_cod\t = lf.foto_cod\n\t\t\t\tand fs.foto_fisi_email = '%s' \", $foto_coment, $foto_img,$foto_nome, $foto_tel, $foto_cel, $foto_cpf, $foto_end, $foto_num, $foto_estado, $foto_cidade, $foto_emp, $foto_cep, $foto_email);\n\t\t$resultado_update = mysqli_query($conexao, $sql_update) or die(mysqli_error($conexao).\"<br/>\".$sql_update);\n\t\t$resulUpEspeci \t = atualizarEspecialidadeFotografo($conexao,$foto_email,$foto_especi);\n\n\t\tif($resultado_update){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t}", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('banco','banco','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarReenvioFactura(){\n\t\t$this->procedimiento='vef.ft_reenvio_factura_ime';\n\t\t$this->transaccion='VF_REFACOR_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_reenvio_factura','id_reenvio_factura','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_venta','id_venta','int4');\n\t\t$this->setParametro('correo','correo','varchar');\n\t\t$this->setParametro('observacion','observacion','text');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t\r\n\t\t$parametros = $this->aParam->getArregloParametros('asignacion');\r\n\t\t//si esdel tipo matriz verifica en la primera posicion el tipo de vista\r\n\t\tif($this->esMatriz){\r\n\t\t $tipo_operacion =$parametros[0]['tipo_operacion'];\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$tipo_operacion =$parametros['tipo_operacion'];\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif($tipo_operacion=='asignacion'){\r\n\t\t $this->transaccion='tgv_SERVIC_MOD';\r\n } \r\n elseif($tipo_operacion=='cambiar_estado'){ \r\n\t\t $this->transaccion='tgv_SERCAMEST_MOD';\r\n\t\t $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\telseif ($tipo_operacion=='def_fechas'){ \r\n\t\t $this->transaccion='tgv_DEFFECHA_MOD';\r\n\t\t // $this->setParametro('operacion','operacion','varchar');// cuando finaliza los requerimientos, su valor es fin_requerimiento\r\n\t\t //$this->setParametro('id_abogado','id_abogado','int4');\r\n\t\t}\r\n\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\t\t$this->setParametro('estado','estado','varchar');\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('id_lugar_destino','id_lugar_destino','int4');\r\n\t\t$this->setParametro('id_ep','id_ep','int4');\r\n\t\t$this->setParametro('fecha_asig_fin','fecha_asig_fin','date');\r\n\t\t$this->setParametro('fecha_sol_ini','fecha_sol_ini','date');\r\n\t\t$this->setParametro('descripcion','descripcion','varchar');\r\n\t\t$this->setParametro('id_lugar_origen','id_lugar_origen','int4');\r\n\t\t$this->setParametro('cant_personas','cant_personas','int4');\r\n\t\t$this->setParametro('fecha_sol_fin','fecha_sol_fin','date');\r\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\r\n\t\t$this->setParametro('fecha_asig_ini','fecha_asig_ini','date');\r\n\t\t$this->setParametro('id_funcionario_autoriz','id_funcionario_autoriz','int4');\r\n\t\t$this->setParametro('observaciones','observaciones','varchar');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function procesar_foto()\n {\n $image = file_get_contents($_FILES['imagen']['tmp_name']);\n $id_carro = $_POST['id_carro'];\n $numero_foto = $_POST['img_number'];\n\n file_put_contents('/home2/gpautos/sv_gpautos/web/images_cont/' . $id_carro . ' (' . $numero_foto . ').jpg', $image);\n }", "public function altPerfil()\n {\n $this->Dados = filter_input_array(INPUT_POST, FILTER_DEFAULT);\n if (!empty($this->Dados['EditPerfil']))\n {\n unset($this->Dados['EditPerfil']);\n //var_dump($this->Dados);\n\n $this->Dados['imagem'] = ($_FILES['imagem'] ? $_FILES['imagem'] : null);\n $altPerfilBd = new AdmsEditarPerfil();\n $altPerfilBd->altPerfil($this->Dados);\n if ($altPerfilBd->getResultado()) {\n\n $UrlDestino = URLADM . 'ver-perfil/perfil';\n header(\"Location: $UrlDestino\");\n\n } else {\n\n $this->Dados['form'] = $this->Dados;\n $this->altPerfilPriv();\n\n }\n\n }\n else {\n\n $verPerfil = new AdmsVerPerfil();\n $this->Dados['form'] = $verPerfil->verPerfil();\n $this->altPerfilPriv();\n\n\n }\n\n\n }", "public function update(UpdateUserRequest $request, User $user)\n {\n $this->authorize('update', $user);\n if(Input::hasFile('photo')){\n $file=Input::file('photo');\n if($user->type=='Empleado'){\n $file->move(public_path().'/images/employees/',$file->getClientOriginalName());\n }elseif($user->type=='Proveedor'){\n $file->move(public_path().'/images/providers/',$file->getClientOriginalName());\n }else{\n $file->move(public_path().'/images/customers/',$file->getClientOriginalName());\n }\n $user->photo=$file->getClientOriginalName();\n }\n $user->name=$request->get('name');\n $user->last_name=$request->get('last_name');\n $user->sex=$request->get('sex');\n $user->nationality=$request->get('nationality');\n $user->address=$request->get('address');\n $user->phone=$request->get('phone');\n $user->email=$request->get('email');\n $user->update($request->validated());\n\n $bitacora = new Bitacora();\n $bitacora->user = Auth::user()->name;\n $bitacora->last_name = Auth::user()->last_name;\n $bitacora->action = 'Editó un usuario';\n $now=Carbon::now('America/La_Paz');\n $bitacora->date =$now->toDateTimeString();\n $bitacora->hour =$now->toDateTimeString();\n $bitacora->save();\n\n if ($user->hasRole('Cliente')){\n return redirect()->route('admin.customers.index')->withFlash('Cliente actualizado');\n }elseif ($user->hasRole('Administrador') || $user->hasRole('Empleado') || $user->hasRole('Encargado de almacen') || $user->hasRole('Limpieza')){\n return redirect()->route('admin.employees.index')->withFlash('Empleado actualizado');\n }elseif ($user->hasRole('Proveedor')){\n return redirect()->route('admin.providers.index')->withFlash('Usuario actualizado');\n }\n\n }", "function modificarConceptoCta(){\n\t\t$this->procedimiento='pre.f_concepto_cta_ime';\n\t\t$this->transaccion='PRE_CCTA_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_concepto_cta','id_concepto_cta','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_auxiliar','id_auxiliar','int4');\n\t\t$this->setParametro('id_cuenta','id_cuenta','int4');\n\t\t$this->setParametro('id_concepto_ingas','id_concepto_ingas','int4');\n\t\t$this->setParametro('id_partida','id_partida','int4');\n\t\t$this->setParametro('id_centro_costo','id_centro_costo','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function updatePhoto(Request $request)\n {\n// 'photo' => 'required', // required| SEPONE ESTO mimes:jpeg,bmp,png'\n// 'apodo'=>'required',\n// 'altura'=>'required',\n// 'peso'=>'required',\n// 'pie_dominante'=>'required'\n// ]);\n\n $token=$request->get('api_token');\n $jugador=DB::table('jugador')\n ->select('id_jugador')\n ->where('api_token','=',$token)\n ->get();\n\n $datos = Jugador::find($jugador[0]->id_jugador);\n\n// OPC Foto\n $file = $request->get('img');\n $publicId=\"fotoPerfil\".$jugador[0]->id_jugador;\n if(Cloudder::upload(\"data:image/png;base64,\".$file,$publicId,array(\"width\" => 250, \"height\" => 250))){\n $datos->tiene_imagen=1;\n $datos->update();\n return response()->json(['success' => true]);\n }else{\n return response()->json(['success' => false]);\n }\n\n }", "function modificar($Id_Pedido = 0, $tipo = '')\r\n\t{\r\n\t\t$Permitido = array('Gerencia' => '', 'Plani' => '', 'Sistemas' => '', 'Ventas' => '');\r\n\t\t$this->ver_sesion_m->acceso($Permitido);\r\n\t\t\r\n\t\t$Id_Pedido += 0;\r\n\t\tif(0 == $Id_Pedido)\r\n\t\t{\r\n\t\t\tshow_404();\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t//Extraemos toda la informacion del proceso\r\n\t\t$this->load->model('procesos/buscar_proceso_m', 'buscar_proc');\r\n\t\t$Info_Proceso = $this->buscar_proc->busqueda_pedido($Id_Pedido);\r\n\t\t\r\n\t\tif(0 == $Info_Proceso)\r\n\t\t{\r\n\t\t\tshow_404();\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Si es un cliente, no debe ver cosas prohibidas\r\n\t\t$this->ver_sesion_m->solo_un_cliente(\r\n\t\t\t$Info_Proceso['id_cliente']\r\n\t\t);\r\n\t\t\r\n\t\t//Validacion: Solo los pedidos que estan en proceso pueden ser modificados\r\n\t\t//en sus especificaciones\r\n\t\t//Modelo que verifica si tiene ruta sin finalizar este proceso\r\n\t\t$this->load->model('pedidos/procesando_m', 'procesando');\r\n\t\t//Se realiza la verificacion\r\n\t\t$Estado = $this->procesando->pedido($Id_Pedido);\r\n\t\t\r\n\t\t\r\n\t\t//Especificaciones del pedido a modificar\r\n\t\t$this->load->model('pedidos/especificacion_informacion_m', 'esp_inf');\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Listado de los materiales recibidos y solicitados\r\n\t\t$this->load->model('pedidos/materiales_m', 'materiales');\r\n\t\t$Materiales['recibido'] = $this->materiales->recibidos_id('s');\r\n\t\t$Materiales['solicitado'] = $this->materiales->solicitados_id('s');\r\n\t\t\r\n\t\t/*\r\n\t\t$this->load->model('pedidos/enlaces_m', 'enlace');\r\n\t\t$Es_Hijo = $this->enlace->es_hijo($Id_Pedido);\r\n\t\t\r\n\t\t\r\n\t\t//Es este pedido hijo de otro?\r\n\t\t\r\n\t\tif(0 == $Es_Hijo)\r\n\t\t{\r\n\t\t\t*/\r\n\t\t\t$Especs = $this->esp_inf->pedido($Id_Pedido);\r\n\t\t\t/*\r\n\t\t\t//Listado de los tipos de acabados\r\n\t\t\t$this->load->model('pedidos/impresion_digital_m', 'matdigi');\r\n\t\t\t$Tipo_Acabado = $this->matdigi->tipo_impd_acabado();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$Especs = $this->esp_inf->pedido(\r\n\t\t\t\t$Id_Pedido,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'matrecgru' => array(),\r\n\t\t\t\t\t'matsolgru' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t//print_r($Especs);\r\n\t\t\t$Tipo_Acabado = array();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tif(isset($Es_Hijo['id_pedido_pedido']))\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$Especs = $this->esp_inf->pedido(\r\n\t\t\t\t$Es_Hijo['id_ped_primario'],\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'general' => array(),\r\n\t\t\t\t\t'colores' => array(),\r\n\t\t\t\t\t'distorsion' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\t//Modificacion de las especificaciones\r\n\t\t\t$this->load->model('pedidos/especificacion_modificar_m', 'esp_modi');\r\n\t\t\t$this->esp_modi->modificar(\r\n\t\t\t\t$Es_Hijo['id_ped_primario'],\r\n\t\t\t\t$Especs,\r\n\t\t\t\tarray('recibido' => array(), 'solicitado' => array()),\r\n\t\t\t\tarray()\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$Especs = $this->esp_inf->pedido(\r\n\t\t\t\t$Id_Pedido,\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'matrecgru' => array(),\r\n\t\t\t\t\t'matsolgru' => array()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\t//Modificacion de las especificaciones\r\n\t\t$this->load->model('pedidos/especificacion_modificar_m', 'esp_modi');\r\n\t\t$this->esp_modi->modificar(\r\n\t\t\t$Id_Pedido,\r\n\t\t\t$Especs,\r\n\t\t\t$Materiales\r\n\t\t);\r\n\r\n\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\tif('Ventas' != $this->session->userdata('codigo'))\r\n\t\t{\r\n\t\t\tif($tipo == 'm')\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/administrar/info/'.$Info_Proceso['id_proceso']);\r\n\t\t\t}\r\n\t\t\telseif($tipo == 'l')\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/preingreso/estado/Pendientes');\r\n\t\t\t}\r\n\t\t\telseif($tipo == 'i')\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/modificar/index/'.$Id_Pedido.'/i');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/modificar/index/'.$Id_Pedido);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif('' != $this->session->userdata('id_cliente'))\r\n\t\t\t{\r\n\t\t\t\theader('location: /ventas/v_preingreso/pendientes');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\theader('location: /pedidos/preingreso/estado/Pendientes');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function editAction(Request $request, Annonce_appart $annonce_appart) {\n $user = $this->getUser();\n $deleteForm = $this->createDeleteForm($annonce_appart);\n $editForm = $this->createForm('ImmoNotaire\\ImmoAnnonceBundle\\Form\\Annonce_appartType', $annonce_appart);\n $editForm->handleRequest($request);\n\n $em = $this->getDoctrine()->getManager();\n\n $pubs = $em->getRepository(\"PubliciteBundle:Publicite\")->findAll();\n // var_dump($annonce);\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n\n\n if ($annonce_appart->getAnnonce()->getMedia()->getFile() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile($request->get('file'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file */\n //die('file1');\n $file = $annonce_appart->getAnnonce()->getMedia()->getFile();\n $img = md5(uniqid()) . '.' . $file->guessExtension();\n $file->move($this->getParameter('image_annonce'), $img);\n $annonce_appart->getAnnonce()->getMedia()->setFile($img);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile1() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile1($request->get('file1'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file1 */\n //die('file1');\n $file1 = $annonce_appart->getAnnonce()->getMedia()->getFile1();\n $img1 = md5(uniqid()) . '.' . $file1->guessExtension();\n $file1->move($this->getParameter('image_annonce'), $img1);\n $annonce_appart->getAnnonce()->getMedia()->setFile1($img1);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile2() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile2($request->get('file2'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file2 */\n $file2 = $annonce_appart->getAnnonce()->getMedia()->getFile2();\n $img2 = md5(uniqid()) . '.' . $file2->guessExtension();\n $file2->move($this->getParameter('image_annonce'), $img2);\n $annonce_appart->getAnnonce()->getMedia()->setFile2($img2);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile3() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile3($request->get('file3'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file3 */\n $file3 = $annonce_appart->getAnnonce()->getMedia()->getFile3();\n $img3 = md5(uniqid()) . '.' . $file3->guessExtension();\n $file3->move($this->getParameter('image_annonce'), $img3);\n $annonce_appart->getAnnonce()->getMedia()->setFile3($img3);\n }\n if ($annonce_appart->getAnnonce()->getMedia()->getFile4() == null) {\n $annonce_appart->getAnnonce()->getMedia()->setFile4($request->get('file4'));\n } else {\n /** @var Symfony\\Component\\HttpFoundation\\File\\UploadedFile $file4 */\n $file4 = $annonce_appart->getAnnonce()->getMedia()->getFile4();\n $img4 = md5(uniqid()) . '.' . $file4->guessExtension();\n $file4->move($this->getParameter('image_annonce'), $img4);\n $annonce_appart->getAnnonce()->getMedia()->setFile4($img4);\n }\n\n $em->flush();\n\n $modif = new Notification();\n $modif->setType(\"appartement\");\n $modif->setAction(\"modification\");\n $modif->setUser($user);\n\n $em->persist($modif);\n $em->flush();\n $session = new session();\n $session->getFlashBag()->add('info', \"L'annonce a bien été modifié\");\n\n return $this->redirectToRoute('immo_notaire_self_annonce_archive');\n }\n\n return $this->render('annonce_appart/edit.html.twig', array(\n 'annonce_appart' => $annonce_appart,\n 'form' => $editForm->createView(),\n 'user' => $user,\n 'pubs' => $pubs,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function cambiarFoto(Request $request){\n Validator::make($request->all(), [\n 'foto' => 'required|image|max:1024',\n ])->validate();\n\n //obtenemos el campo file definido en el formulario\n $foto = $request->file('foto');\n\n //obtenemos el nombre del archivo\n $nombre = time().$foto->getClientOriginalName();\n\n //obtenemos el usuario a editar\n $usuario = Usuario::find(Auth::user()->id);\n\n // verificamos que el usuario no tenga una imagen ya guardada.\n if ($usuario->foto == 'usuario.png') {\n\n //si la imagen es por defecto, la cambiamos.\n }else{\n\n //Si ya tenia una imagen personalizada, primero borramos esa imagen.\n \\Storage::disk('usuarios')->delete($usuario->foto);\n }\n $usuario->foto = $nombre;\n $usuario->save();\n\n //indicamos que queremos guardar un nuevo archivo en el disco local\n \\Storage::disk('usuarios')->put($nombre, \\File::get($foto));\n\n return redirect('editar-usuario')->with('correcto', 'SU FOTO FUE ACTUALIZADA.');\n }", "public function update(Request $request, $id)\n {\n $prespel = Respel::where('ID_Respel', $id)->first();\n if (!$prespel) {\n abort(404);\n }\n if (isset($request['RespelHojaSeguridad'])) {\n if($prespel->RespelHojaSeguridad <> null && file_exists(public_path().'/img/HojaSeguridad/'.$prespel->RespelHojaSeguridad)){\n // unlink(public_path().'/img/HojaSeguridad/'.$prespel->RespelHojaSeguridad);\n }\n $file1 = $request['RespelHojaSeguridad'];\n $hoja = hash('sha256', rand().time().$file1->getClientOriginalName()).'.pdf';\n $file1->move(public_path().'/img/HojaSeguridad/',$hoja);\n }\n else{\n $hoja = $prespel->RespelHojaSeguridad;\n }\n\n /*verificar si se cargo un documento en este campo*/\n if (isset($request['RespelTarj'])) {\n if($prespel->RespelTarj <> null && file_exists(public_path().'/img/TarjetaEmergencia/'.$prespel->RespelTarj)){\n // unlink(public_path().'/img/TarjetaEmergencia/'.$prespel->RespelTarj);\n }\n $file2 = $request['RespelTarj'];\n $tarj = hash('sha256', rand().time().$file2->getClientOriginalName()).'.pdf';\n $file2->move(public_path().'/img/TarjetaEmergencia/',$tarj);\n }else{\n $tarj = $prespel->RespelTarj;\n }\n\n /*verificar si se cargo un documento en este campo*/\n if (isset($request['RespelFoto'])) {\n if($prespel->RespelFoto <> null && file_exists(public_path().'/img/fotoRespelCreate/'.$prespel->RespelFoto)){\n // unlink(public_path().'/img/fotoRespelCreate/'.$prespel->RespelFoto);\n }\n $file3 = $request['RespelFoto'];\n $foto = hash('sha256', rand().time().$file3->getClientOriginalName()).'.png';\n $file3->move(public_path().'/img/fotoRespelCreate/',$foto);\n }else{\n $foto = $prespel->RespelFoto;\n }\n \n /*verificar si se cargo un documento en este campo*/\n if (isset($request['SustanciaControladaDocumento'])) {\n if($prespel->SustanciaControladaDocumento <> null && file_exists(public_path().'/img/SustanciaControlDoc/'.$prespel->SustanciaControladaDocumento)){\n // unlink(public_path().'/img/SustanciaControlDoc/'.$prespel->SustanciaControladaDocumento);\n }\n $file4 = $request['SustanciaControladaDocumento'];\n $ctrlDoc = hash('sha256', rand().time().$file4->getClientOriginalName()).'.pdf';\n $file4->move(public_path().'/img/SustanciaControlDoc/',$ctrlDoc);\n }else{\n $ctrlDoc = $prespel->SustanciaControladaDocumento;\n }\n $prespel->RespelStatus = \"Pendiente\";\n // $prespel->RespelStatus = $request['RespelStatus'];\n $prespel->RespelName = $request['RespelName'];\n $prespel->RespelDescrip = $request['RespelDescrip'];\n $prespel->RespelIgrosidad = $request['RespelIgrosidad'];\n $prespel->YRespelClasf4741 = $request['YRespelClasf4741'];\n $prespel->ARespelClasf4741 = $request['ARespelClasf4741'];\n $prespel->RespelEstado = $request['RespelEstado'];\n $prespel->SustanciaControlada = $request['SustanciaControlada'];\n $prespel->SustanciaControladaTipo = $request['SustanciaControladaTipo'];\n $prespel->SustanciaControladaNombre = $request['SustanciaControladaNombre'];\n $prespel->RespelHojaSeguridad = $hoja;\n $prespel->RespelTarj = $tarj;\n $prespel->RespelFoto = $foto;\n $prespel->SustanciaControladaDocumento = $ctrlDoc;\n $prespel->RespelPublic = 1;\n $prespel->RespelDeclaracion = $request['RespelDeclaracion'];\n $prespel->FK_SubCategoryRP = $request['FK_SubCategoryRP'];\n $prespel->update();\n\n $log = new audit();\n $log->AuditTabla=\"respelpublic\";\n $log->AuditType=\"Modificado\";\n $log->AuditRegistro=$prespel->ID_Respel;\n $log->AuditUser=Auth::user()->email;\n $log->Auditlog=json_encode($request->all());\n $log->save();\n \n return redirect()->route('respelspublic.index');\n }", "public function getUpdatetoRevisado() {\n\n $id_boleta = \"\";\n $destino = \"\";\n $nombre = \"\";\n $time = \"\";\n $fecha = \"\";\n\n $id_boleta = $_POST['id_boleta'];\n\n $target_dir = \"public/uploads/recibos/\";\n\n opendir($target_dir);\n\n $destino = $target_dir.$_FILES['archivo']['name'];\n\n copy($_FILES['archivo']['tmp_name'], $destino);\n\n echo '<div class=\"notification success\" style=\"\"><div></div><p><span>LISTO:</span> El archivo se ha cargado correctamente.</p></div>';\n\n $nombre = $_FILES['archivo']['name'];\n\n\n $time = date(\"H:i:s\", time());\n $fecha = date(\"y-m-d\");\n\n $sql_model = \"\";\n\n $sql_model = \"UPDATE recibos SET estado = 'REVISADA', archivo='$nombre', horarevision = '$time', fecharevision = '$fecha' WHERE id_boleta = \".$id_boleta;\n\n $query = $this->db->prepare($sql_model);\n $inserted=$query->execute();\n\n if ($inserted) {\n\n return true;\n } else {\n\n return false;\n }\n }", "function saveEditPerfil(){\n\t\t$cont = $this->dper->getContadorPerfilByNombre($this->nombre);\n\t\tif($cont == 0){\n\t\t\t$r = $this->dper->updatePerfil($this->id,$this->nombre);\n\t\t\tif($r=='true'){\n\t\t\t\t$msg = PERFIL_EDITADO;\n\t\t\t}else{\n\t\t\t\t$msg = ERROR_EDIT_PERFIL;\n\t\t\t}\n\t\t}else{\n\t\t\t$msg = ERROR_EDIT_PERFIL;\n\t\t}\n\t\treturn $msg;\n\t}", "static public function ctrCrearMarca()\n {\n\n if (isset($_POST[\"ingNomMarca\"])) {\n\n $tabla = \"marca\";\n $datos = array( \"nombre\" => $_POST[\"ingNomMarca\"] );\n $ruta = \"\";\n\n $verificarDuplicado = ModeloMarca::mdlVerificarMarca($tabla, $datos, true);\n\n if ($verificarDuplicado) {\n return \"duplicado\";\n } else {\n\n if (isset($_FILES[\"ingfotoMarca\"][\"tmp_name\"])) {\n\n list($ancho, $alto) = getimagesize($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n $nuevoAncho = 512;\n $nuevoAlto = 512;\n\n #Crear directorio donde se guardaran las imagenes\n $directorio = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"];\n mkdir($directorio, 0755);\n\n #Vincular foto de acuerdo al tipo de foto\n if ($_FILES[\"ingfotoMarca\"][\"type\"] == \"image/jpeg\") {\n #Guardar la imagen JPG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"] . \"/\" . $aleatario . \".jpg\";\n\n $origen = imagecreatefromjpeg($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagejpeg($destino, $ruta);\n }\n\n if ($_FILES[\"ingfotoMarca\"][\"type\"] == \"image/png\") {\n #Guardar la imagen PNG en el directorio\n $aleatario = mt_rand(100, 999);\n $ruta = \"views/img/Marcas/\" . $_POST[\"ingNomMarca\"] . \"/\" . $aleatario . \".png\";\n\n $origen = imagecreatefrompng($_FILES[\"ingfotoMarca\"][\"tmp_name\"]);\n\n $destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n imagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n imagepng($destino, $ruta);\n }\n }\n\n $datos += [\"foto\" => $ruta];\n\n $ingresar = ModeloMarca::mdlCrearMarca($tabla, $datos);\n return $ingresar;\n }\n }\n }", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function modificarCita(){\n $query = \"UPDATE \" . $this->table . \" SET PacienteId ='\" . $this->idpaciente . \"',Fecha = '\" . $this->fecha . \"', HoraInicio = '\" . $this->horarioIn . \"', HoraFin = '\" .\n $this->horarioFn . \"', Motivo = '\" . $this->motivo . \"' WHERE CitaId = '\" . $this->idcita . \"'\"; \n $resp = parent::nonQuery($query);\n if($resp >= 1){\n return $resp;\n }else{\n return 0;\n }\n }", "public function ctrCrearInversion(){\n\t\tif(isset($_POST[\"idUsuarioInversion\"])){\n\n\t\t\t\n\t\t\tif(isset($_FILES[\"soporteimg\"][\"tmp_name\"]) && !empty($_FILES[\"soporteimg\"][\"tmp_name\"])){\n\n\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"soporteimg\"][\"tmp_name\"]);\n\n\t\t\t\t$nuevoAncho = 1500;\n\t\t\t\t$nuevoAlto = 1500;\n\t\t\t\t/*=============================================\n\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t=============================================*/\n\t\t\t\tdate_default_timezone_set(\"America/Bogota\");\n\t\t\t\t$fecha_img = date(\"d\").\"_\".date(\"m\").\"_\".date(\"y\").\"_\".date(\"h\").\"_\".date(\"i\").\"_\".date(\"s\").\"_\".date(\"a\"); \n\n\t\t\t\t$directorio_inv = \"views/img/inversion/\".$_POST[\"idUsuarioInversion\"];\n\n\t\t\t\tif(!file_exists($directorio_inv)){\t\n\n\t\t\t\t\tmkdir($directorio_inv, 0755);\n\n\t\t\t\t}\n\n\t\t\t\t//echo $directorio_inv;\n\t\t\t\t/*=============================================\n\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t=============================================*/\n\n\t\t\t\tif($_FILES[\"soporteimg\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio_inv.\"/\".$aleatorio.\"_\".$fecha_img.\".jpg\";\n\n\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"soporteimg\"][\"tmp_name\"]);\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\timagejpeg($destino, $ruta);\t\n\n\n\t\t\t\t}else if($_FILES[\"soporteimg\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t$ruta = $directorio_inv.\"/\".$aleatorio.\"_\".$fecha_img.\".png\";\n\n\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"soporteimg\"][\"tmp_name\"]);\t\n\n\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\t\n\n\t\t\t\t\timagealphablending($destino, FALSE);\n\t\t\n\t\t\t\t\timagesavealpha($destino, TRUE);\t\t\n\n\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\t\t\n\n\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\t\t \ttext: \"¡No se permiten formatos diferentes a JPG y/o PNG invsersion!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t\t/* espacio para insertar datos en la tabla */\n\t\t\t\t$tabla = \"sol_inversion\";\n\t\t\t\t$fecha_solictud= substr(date(\"c\"), 0, -6);\n\t\t\t\t$plan = $_POST[\"options\"];\n\t\t\t\t//$fecha_fin = substr(date(\"c\") + $plan, 0, -6).\"Z\";\n\n\n\t\t\t\t$fechaInicial = substr($fecha_solictud,0,-10);\n\t\t\t\t$fechaVencimiento = strtotime('+'.$plan.' days', strtotime($fechaInicial) );\n\t\t\t\t$vencimiento = date(\"Y-m-d\", $fechaVencimiento);\n\n\n\t\t\t/*\t$datos_inv = array(\"fecha_solicitud\" => $fecha_solictud ,\n\t\t\t\t\"id_usuario\" => $_POST[\"idUsuarioInversion\"] ,\n\t\t\t\t\"email_fondos\" => $_POST[\"email_fondo\"],\n\t\t\t\t\"monto\" => $_POST[\"monto\"],\n\t\t\t\t\"plan_inversion\" => $plan,\n\t\t\t\t\"fecha_final\" => $vencimiento,\n\t\t\t\t\"soporte\" => $ruta,\n\t\t\t\t\"estado\" => \"1\",\n\t\t\t\t\"fecha_apobacion\" =>\"\",\n\t\t\t\t\"id_user_aprobo\" =>\"\",\n\t\t\t\t\"observacion\" =>\"\"); */\n\n\t\t\t$datos_inv = array(\"fecha_solicitud\" => $fecha_solictud ,\n\t\t\t\t\t\t\"id_usuario\" => $_POST[\"idUsuarioInversion\"] ,\n\t\t\t\t\t\t\"email_fondos\" => $_POST[\"email_fondo\"] ,\n\t\t\t\t\t\t\"monto\" => $_POST[\"monto\"] ,\n\t\t\t\t\t\t\"plan_inversion\" => $plan ,\n\t\t\t\t\t\t\"fecha_final\" => $vencimiento ,\n\t\t\t\t\t\t\"soporte\" => $ruta ,\n\t\t\t\t\t\t\"estado\" => \"1\" ,\n\t\t\t\t\t\t\"fecha_apobacion\" => NULL ,\n\t\t\t\t\t\t\"id_user_aprobo\" => NULL ,\n\t\t\t\t\t\t\"observacion\" => NULL );\n\n\t\t\t\t//echo '<pre>'; print_r($datos_inv); echo '</pre>';\n\n\t\t\t\t$respuesta = UserModel::mdlRegistroInversion($tabla, $datos_inv);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tVerificación Correo Electrónico\n\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t$elcorreo = $_POST[\"email_fondo\"];\n\t\t\t\t\t\t//$rutainv = RouteController::ctrRoute();\n\n\t\t\t\t\t\tdate_default_timezone_set(\"America/Bogota\");\n\n\t\t\t\t\t\t$mail = new PHPMailer;\n\n\t\t\t\t\t\t$mail->Charset = \"UTF-8\";\n\n\t\t\t\t\t\t$mail->isMail();\n\n\t\t\t\t\t\t$mail->setFrom(\"info@valientesdigitales.com.co\", \"Valientes Digitales\");\n\n\t\t\t\t\t\t$mail->addReplyTo(\"info@valientesdigitales.com.co\", \"Valientes Digitales\");\n\n\t\t\t\t\t\t$mail->Subject = \"Solicitud de inversion programa capitalVAD\";\n\n\t\t\t\t\t\t$mail->addAddress($elcorreo);\n\n\t\t\t\t\t\t$mail->msgHTML('<div style=\"width:100%; background:#eee; position:relative; font-family:sans-serif; padding-bottom:40px\">\n\t\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<img style=\"padding:20px; width:10%\" src=\"http://capital.valientesdigitales.com.co/views/img/logo.png\">\n\n\t\t\t\t\t\t</center>\n\n\t\t\t\t\t\t<div style=\"position:relative; margin:auto; width:600px; background:white; padding:20px\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<center>\n\n\t\t\t\t\t\t\t\t<img style=\"padding:20px; width:15%\" src=\"http://capital.valientesdigitales.com.co/views/img/logo.png\">\n\n\t\t\t\t\t\t\t\t<h3 style=\"font-weight:100; color:#999\">SOLICITUD DE INVERSION EN CAPITALVAD</h3>\n\n\t\t\t\t\t\t\t\t<hr style=\"border:1px solid #ccc; width:80%\">\n\n\t\t\t\t\t\t\t\t<h4 style=\"font-weight:100; color:#999; padding:0 20px\">Nuestros colaboradores est&aacute;n verificando su transferencia, por favor espere la aprobaci&oacute;n. Esta puede tardar hasta tres días h&aacute;biles.</h4>\n\n\t\t\t\t\t\t\t\t<a href=\"http://capital.valientesdigitales.com.co\" target=\"_blank\" style=\"text-decoration:none\">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div style=\"line-height:60px; background:#0aa; width:60%; color:white\">Monto de inverion de \"'.$_POST[\"monto\"] .'\" USD, Con un plazo de \"'.$plan.'\" dias.</div>\n\n\t\t\t\t\t\t\t\t</a>\n\n\t\t\t\t\t\t\t\t<br>\n\n\t\t\t\t\t\t\t\t<hr style=\"border:1px solid #ccc; width:80%\">\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t</center>\t\n\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$envio = $mail->Send();\n\n\t\t\t\t\t\tif(!$envio){\n\n\t\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t\ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t\ttext: \"¡¡Ha ocurrido un problema enviando verificación de correo electrónico a '.$elcorreo.' '.$mail->ErrorInfo.', por favor inténtelo nuevamente\",\n\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t\t</script>';\n\n\n\t\t\t\t\t\t}else{\n\n\n\t\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\t\t\ttitle: \"¡SU SOLICITUD HA SIDO ENVIADA!\",\n\t\t\t\t\t\t\t\t\ttext: \"¡Por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico al igual que en la opcion de Inversiones / Historico ver el estado de la solicitud!\",\n\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t\t</script>';\n\n\n\t\t\t\t\t\t}\n\n\n\t\t\t\t} // fin swl if que valida para enviar el mail\n\n\t\t\t\t/* Fin de la insercion de datos de la tabla*/\n\n\n\n\t\t\t}// fin del if interno donde pregunta por el file\n\t\t}// fin del primer if donde pregunta si se envio el id del usuario\t\t\n\t}", "public function actualizar(){\n\textract($_REQUEST);\n\t$db=new clasedb();\n\t$conex=$db->conectar();//conectando con la base de datos\n\n\t$sql=\"SELECT * FROM usuarios WHERE correo='\".$correo.\"' AND id!=\".$_SESSION['id_usuario'];;\n\t$res=mysqli_query($conex,$sql);\n\t$cuantos=mysqli_num_rows($res);\n\t//echo $cuantos;\n\tif ($cuantos>0) {\n\t\t?>\n\t\t<script type=\"text/javascript\">\n\t\t\talert(\"Ya existe un usuario con este correo\");\n\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t</script>\n\t\t\t<?php\n\n\t\t}else{\n\t\t\n\t\t\t$sql=\"UPDATE usuarios SET nombre='\".$nombre.\"', correo='\".$correo.\"', pregunta='\".$pregunta.\"',respuesta='\".$respuesta.\"' WHERE usuarios.id=\".$_SESSION['id_usuario'];;\n\n\n\t\t\t$res=mysqli_query($conex,$sql);\n\t\t\tif ($res) {\n\t\t\t\t$sql=\"INSERT INTO auditoria VALUES (NULL, '\".$_SESSION['id_usuario'].\"', 'modificó perfil', 'usuarios', CURRENT_TIMESTAMP, '\".$_SESSION['tipo_usuario'].\"')\";\n\n\t\t $resultado=mysqli_query($conex,$sql);\n ?>\n\t\t\t\t\t\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\talert(\"Registro modificado\");\n\t\t\t\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t} else {\n\t\t\t\t\t?>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\talert(\"Error al modificar el registro\");\n\t\t\t\t\t\twindow.location=\"ControladorPerfil.php?operacion=verperfil\";\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\t\t\t\n\t\t\t\n\t\n\t}\n}", "public function update(Request $request, User $usuario)\n {\n try{\n $this->authorize($usuario);\n\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string|max:255',\n //'email' => [\n // 'required',\n // 'string',\n // 'email',\n // 'max:255',\n // Rule::unique('users')->ignore($usuario->id)\n //],\n 'email' => 'required|string|email|max:255|unique:users,email,'.$usuario->id,\n 'role_id' => 'required|integer|exists:roles,id',\n 'perfiles' => 'required|array|min:1|exists:perfiles,id'\n ],[\n 'email.required' => 'el campo correo es awebo',\n 'email.unique' => 'ese correo ya esta en uso.',\n 'name.required' => 'el nombre es obligatorio',\n 'role_id.required' => 'el rol es awebo',\n 'role_id.exists' => 'el rol no existe',\n 'perfiles.required' => 'los perfiles son necesarios.',\n 'perfiles.min' => 'mínimo es un perfil.',\n 'perfiles.exists' => 'ese perfil no esta registrado'\n ]);\n\n if ($validator->fails()){\n\n return redirect()->back()->withErrors($validator)->withInput();\n }\n $data = $request->except('_token','_method');\n\n $usuario->update($data);\n $usuario->perfiles()->sync($data['perfiles']);\n //$usuario->perfiles()->detach();\n //\n //foreach ($data['perfiles'] as $perfil)\n //{\n // $usuario->perfiles()->attach($perfil);\n //}\n\n return redirect()->route('usuarios.index')\n ->with('info','el usuario fue editado correctamente :)');\n\n }catch(AuthorizationException $e){\n return redirect()->route('usuarios.show',$usuario->id)->with('error',$e->getMessage());\n }\n\n }", "public function update(Request $request,$id)\n {\n $usuario = User::find($id);\n if(isset($request->foto))\n {\n if($usuario->foto!=\"fotoperfil/perfilDefault.jpg\"){\n Storage::delete($usuario->foto);//Elimino foto anterior\n }\n $foto = $request->file('foto')->store('fotoperfil');//subo foto nueva\n if(session()->get('user_id')==$id){\n session()->put('foto','storage/app/'.$foto);\n }\n $usuario->update([\"foto\"=>$foto]);\n echo $foto;\n }else{\n $idrol = $usuario->idrol;\n if($idrol==1){\n $request->validate([\n 'name' => 'required|unique:users,name,'.$usuario->id.',id',\n 'email' => 'required|unique:users,email,'.$usuario->id.',id',\n 'idrol' => 'required'\n ]);\n }else{\n $request->validate([\n 'name' => 'required|unique:users,name,'.$usuario->id.',id',\n 'email' => 'required|unique:users,email,'.$usuario->id.',id'\n ]);\n }\n if($id==1){//Si es supervisor\n $request->idrol = 1;\n }\n $usuario->update($request->all());\n $perfil = $request->perfil;\n if(isset($perfil))\n {\n return redirect()->route('aj_perfil')->with('mensaje','Datos guardados correctamente');\n }else{\n return redirect()->route('usuarios.index')->with('mensaje','Datos guardados correctamente');\n }\n }\n }", "function modificarProcesoCompra(){\n\t\t$this->procedimiento='adq.f_proceso_compra_ime';\n\t\t$this->transaccion='ADQ_PROC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t$this->setParametro('id_depto','id_depto','int4');\n\t\t$this->setParametro('num_convocatoria','num_convocatoria','varchar');\n\t\t$this->setParametro('id_solicitud','id_solicitud','int4');\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\n\t\t$this->setParametro('fecha_ini_proc','fecha_ini_proc','date');\n\t\t$this->setParametro('obs_proceso','obs_proceso','varchar');\n\t\t$this->setParametro('id_proceso_wf','id_proceso_wf','int4');\n\t\t$this->setParametro('num_tramite','num_tramite','varchar');\n\t\t$this->setParametro('codigo_proceso','codigo_proceso','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('num_cotizacion','num_cotizacion','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarVacacion(){\n\t\t$this->procedimiento='asis.ft_vacacion_ime';\n\t\t$this->transaccion='ASIS_VAC_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_vacacion','id_vacacion','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_funcionario','id_funcionario','int4');\n\t\t$this->setParametro('fecha_inicio','fecha_inicio','date');\n\t\t$this->setParametro('fecha_fin','fecha_fin','date');\n\t\t$this->setParametro('dias','dias','numeric');\n\t\t$this->setParametro('descripcion','descripcion','text');\n $this->setParametro('medio_dia','medio_dia','integer');\n $this->setParametro('dias_efectivo','dias_efectivo', 'numeric');\n\n// medio_dia\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function enviar_correo_datos()\r\n {\r\n \tif ($this->session->userdata(\"session_id\")==\"\") {\r\n redirect(base_url().'Inicio/Zona_roja/');\r\n }\r\n\r\n $id_paciente = $this->input->post(\"id_paciente_update\");\r\n $correo_paciente = $this->input->post(\"correo_valid\");\r\n echo \"mosytramos_id:\".$this->input->post(\"id_paciente_update\");\r\n\r\n //aqui buscamos los datos del mismo\r\n \t$query = $this->db->query(\"select * from exam_datos_generales where Id='\".$id_paciente.\"'\");\r\n\t\tforeach ($query->result() as $emp) {\r\n\t\t\t$nombrexxx = $emp->apellido_paterno.\" \".$emp->apellido_materno.\", \".$emp->nombre;\r\n\t\t}\r\n\r\n if(!empty($_FILES['imagen']['name'])) {\r\n $config['upload_path'] = 'upload/Resultado_analisis/';\r\n $config['allowed_types'] = 'jpg|jpeg|png|gif|pdf';\r\n $config['file_name'] = $nombrexxx.\" \".rand(100000000000000,900000000000000).md5($_FILES['imagen']['name']);\r\n \r\n //Load upload library and initialize configuration\r\n $this->load->library('upload',$config);\r\n $this->upload->initialize($config);\r\n \r\n if($this->upload->do_upload('imagen')){\r\n $uploadDataI = $this->upload->data();\r\n $imagen = $uploadDataI['file_name'];\r\n } else {\r\n $imagen = '';\r\n }\r\n\r\n } else {\r\n $imagen = '';\r\n }\r\n\r\n $data_update = array(\r\n \t'update_result_date' =>date('Y-m-d G:i:s'),\r\n \t'correo'=> $correo_paciente,\r\n \t'status'=>\"3\",\r\n \t'archivo'=> $imagen\r\n );\r\n\r\n $this->ResultadoFinal_model->update_insert_file($id_paciente,$data_update);\r\n\r\n\r\n //aqui buscamos los datos del mismo\r\n $query_result = $this->db->query(\"select * from exam_datos_generales where Id='\".$id_paciente.\"'\");\r\n \r\n\t\tforeach ($query_result->result() as $emp) {\r\n\t\t\t$nombrex = $emp->apellido_paterno.\" \".$emp->apellido_materno.\", \".$emp->nombre;\r\n\t\t\t$archivo1_xx = $emp->archivo;\r\n\t\t\t$url_unico = $emp->url_unico;\r\n\t\t}\r\n\r\n\r\n \r\n if ($this->input->post(\"options\")==\"si\") {\r\n \t$acceso_link = base_url().'ResultadoFinal/ResultadoFinal/view_result_data_list_details/'.$url_unico;\r\n } elseif ($this->input->post(\"options\")==\"no\") {\r\n \t$acceso_link = \"\";\r\n }\r\n\r\n \r\n\t\t$mail = new PHPMailer();\r\n\r\n // Esta configuracion solo funciona en godaddy, no en el servidor local\r\n /*$mail->isSMTP();\r\n\t\t$mail->Host = 'localhost';\r\n\t\t$mail->SMTPSecure = false;\r\n\t\t$mail->SMTPDebug = 3;\r\n\t\t$mail->Username = 'pagina_web@innomedic.pe';\r\n\t\t$mail->Password = '';\r\n\t\t$mail->SMTPAuth = false;\r\n\t\t$mail->SMTPAutoTLS = false; \r\n\t\t$mail->SMTPSecure = ''; \r\n\t\t$mail->Port = 25;\r\n\t\t$mail->CharSet = 'UTF-8'; \r\n\t\t$mail->AllowEmpty = true;\r\n \r\n\r\n $mail->setFrom('pagina_web@innomedic.pe', 'Innomedic.pe | Resultados de la Clinica Innomedic International E.I.R.L');\r\n\r\n */\r\n\r\n\r\n\r\n // Configuracion para el servidor local\r\n \r\n $mail->isSMTP();\r\n\t\t$mail->Host = 'localhost';\r\n\t\t$mail->SMTPSecure = false;\r\n\t\t$mail->SMTPDebug = 3;\r\n\t\t$mail->Username = 'pagina_web@innomedic.pe';\r\n\t\t$mail->Password = '';\r\n\t\t$mail->SMTPAuth = false;\r\n\t\t$mail->SMTPAutoTLS = false; \r\n\t\t$mail->SMTPSecure = ''; \r\n\t\t$mail->Port = 25;\r\n\t\t$mail->CharSet = 'UTF-8'; \r\n\t\t$mail->AllowEmpty = true;\r\n\r\n // De: \r\n $mail->setFrom('pagina_web@innomedic.pe', 'Innomedic.pe | Resultados de la Clinica Innomedic International E.I.R.L');\r\n\r\n // Archivo a adjuntar en el correo. El archivo ya fue subido\r\n $archivo1 = 'upload/Resultado_analisis/'.$archivo1_xx;\r\n\r\n\r\n \r\n //Mandamos a los correos\r\n $mail->addReplyTo('reenviadorweb@innomedic.pe', 'Innomedic.pe | Reenviar Email');\r\n $mail->addAddress($correo_paciente, $nombrex); \r\n $mail->Subject = 'Innomedic.pe '.$nombrex.' | Verificar Tus resultados';\r\n \r\n // Set email format to HTML\r\n $mail->isHTML(true);\r\n $mailContent = '<!DOCTYPE html>\r\n\t\t\t<html>\r\n\t\t\t<head>\r\n\t\t\t\t<title>Acceso al Sistema</title>\r\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n\t\t\t</head>\r\n\t\t\t<body>\r\n\t\t\t\t<tr><td valign=\"top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" style=\"background-color: #ffffff; width: 600px\"><tbody><tr><td style=\"vertical-align: top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width: 600px\"><tbody><tr><td class=\"logo\" width=\"588\" align=\"right\" valign=\"top\" style=\"color: #ffffff; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; padding-bottom: 12px; text-align: right; width: 588px\"><img class=\"logo\" alt=\"Adobe\" src=\"http://innomedic.pe/public/assets/images/logo.png\" border=\"0\" hspace=\"0\" vspace=\"0\" style=\" display: inline-block; vertical-align: top; width: 205px; height: 60px\"></td>\r\n\t\t\t <td width=\"12\" style=\"width: 12px\">&nbsp;</td>\r\n\t\t\t </tr></tbody></table></td>\r\n\t\t\t </tr><tr><td valign=\"top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" style=\"background-color: #ffffff; width: 600px\"><tbody><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp; </td>\r\n\t\t\t <td style=\"color: #555555; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; padding-top: 20px\">Estimado(a) Cliente; '.$nombrex.' <br>\r\n\t\t\t Envió los resultados Médicos <a href=\"'.$acceso_link.'\" style=\"color: #1473e6; text-decoration: none\">Link de Acceso: </a></td>\r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t \r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t <td style=\"color: #555555; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; padding-top: 20px\">En caso de un error, <a href=\"http://innomedic.pe/\" style=\"color: #1473e6; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">ponte en contacto con nosotros inmediatamente</a>.</td>\r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr><tr><td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t <td style=\"color: #555555; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; padding-top: 20px; padding-bottom: 30px\">Muchas gracias,<br> INNOMEDIC INTERNATIONAL E.I.R.L</td>\r\n\t\t\t <td class=\"mobile-spacer\" width=\"30\" style=\"width: 30px\">&nbsp;</td>\r\n\t\t\t </tr></tbody></table></td>\r\n\t\t\t </tr><tr><td valign=\"top\"><table class=\"full-width\" align=\"center\" width=\"600\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#313A3E\" style=\"background-color: #313A3E; width: 600px\"><tbody><tr><td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\t\t\t \t\t\t<td align=\"center\" style=\"color: #ffffff; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; padding-top: 30px; text-align: center\"><strong><a href=\"http://intranet.innomedic.pe/\" style=\"color: #ffffff; font-weight: bold; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">Administrar tu cuenta</a> | <a href=\"http://innomedic.pe\" style=\"color: #ffffff; font-weight: bold; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">Asistencia al colaborador</a> | <a href=\"http://innomedic.pe/\" style=\"color: #ffffff; font-weight: bold; text-decoration: none\" target=\"_blank\" rel=\"noreferrer\">Foros</a> </strong></td>\r\n\t\t\t \t\t\t<td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\t\t\t \t\t</tr>\r\n\t\t\t \t\t<tr>\r\n\t\t\t \t\t\t<td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\t\t\t \t\t\t<td class=\"legal\" style=\"color: #999999; font-family: adobe-clean, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; padding-top: 30px; padding-bottom: 30px\">\r\n\t\t\t \t\t\t\tIntranet Innomedic | desarrollado especialmente para los clientes de Innomedic International E.I.R.L &copy; todo los derechos reservados.<br><br> \r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t&reg; Av. Javier Prado Este 2638, San Borja, Lima, Perú<br/>\r\n\t\t\t <a target=\"_blank\" href=\"http://innomedic.pe\" style=\"color: #ffffff;\"><font color=\"#ffffff\">Mas informacion</font></a> Área de Sistemas T.I\r\n\t\t\t <br /><br />\r\n\t\t\t <a color=\"#ffffff\" style=\"color: #ffffff;\">Desarrollado por: Area de Sistemas</a>\r\n\t\t\t \t\t\t</td>\r\n\r\n\t\t\t \t\t\t<td width=\"22\" style=\"width: 22px\">&nbsp;</td>\r\n\r\n\t\t\t \t\t</tr>\r\n\t\t\t \t</tbody></table></td>\r\n\t\t\t </tr></tbody></table></td>\r\n\t\t\t </tr>\r\n\r\n\t\t\t</body>\r\n\r\n\t\t\t</html>';\r\n\r\n $mail->AddAttachment($archivo1);\r\n\r\n $mail->Body = $mailContent;\r\n\r\n // Enviando email. Notese que send() devuelve true ó false a parte de enviar el correo\r\n if(!$mail->send()){\r\n echo 'Mailer Error: ' . $mail->ErrorInfo;\r\n $this->output->set_status_header(400);\r\n } else {\r\n $this->ResultadoFinal_model->actualizarResultadoProgreso($id_paciente, \"1\");\r\n $this->actualizarEstadoProgreso($id_paciente);\r\n echo \"Su petición ha sido enviada\";\r\n }\r\n\r\n }", "protected function actualizar(Request $request, User $user ){\n\n\n $datosUsua = request()->except(['_token','_method']);\n\n if($request->hasFile('foto')){\n\n \n\n\n // $request = request();\n\n\n\n\n\n $profileImage = $request->file('foto');\n\n\n $usua=User::findOrFail( auth()->user()->id );\n Storage::delete($usua->foto);\n // $datosUsua['foto']= $request->file('foto')->store('uploads','public');\n\n $profileImageSaveAsName = time() . Auth::id() . \"-profile.\" . $profileImage->getClientOriginalExtension();\n \n $upload_path = 'storage/app/public/uploads/';\n $datosUsua = $upload_path . $profileImageSaveAsName;\n $success = $profileImage->move($upload_path, $profileImageSaveAsName);\n\n\n\n }\n \n\n User::where('id','=', auth()->user()->id)->update($datosUsua);\n\n $usua=User::findOrFail(auth()->user()->id);\n\n\n\n// $user->update($request->foto);\nreturn response()->json($usua);\n\n}", "static public function ctrEditarUsuario(){\n\n\t\tif (isset($_POST['editUser'])) {\n\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"newName\"])) {\n\t\t\t \t/*======================================\n\t\t\t \t= Validar Imagen =\n\t\t\t \t======================================*/\n\t\t\t \t$ruta=$_POST['lastPhoto'];\n\t\t\t \tif (isset($_FILES['photo']['tmp_name']) && !empty($_FILES['photo']['tmp_name'])) {\n\t\t\t \t\tlist($ancho,$alto) = getimagesize($_FILES['photo']['tmp_name']);\n\t\t\t \t\t$nuevoAncho = 500;\n\t\t\t \t\t$nuevoAlto = 500;\n\t\t\t \t\t/*==========================================\n\t\t\t \t\t= CREANDO DIRECTORIO =\n\t\t\t \t\t==========================================*/\n\t\t\t \t\t$directorio = \"Views/img/usuarios/\".$_POST['newUsername'];\n\t\t\t \t\tif (!empty($_POST['lastPhoto'])) {\n\t\t\t \t\t\tunlink($_POST['lastPhoto']);\n\t\t\t \t\t}else{\n\t\t\t \t\t\tmkdir($directorio,0755);\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t\t/*===========================================================================\n\t\t\t \t\t= Funciones defecto PHP dependiendo de tipo de imagen =\n\t\t\t \t\t===========================================================================*/\n\t\t\t \t\tswitch ($_FILES['photo']['type']) {\n\t\t\t \t\t\tcase 'image/jpeg':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.jpg';\n\t\t\t \t\t\t\t$origen = imagecreatefromjpeg($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagejpeg($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tcase 'image/png':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.png';\n\t\t\t \t\t\t\t$origen = imagecreatefrompng($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagepng($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tdefault:\n\t\t\t \t\t\t\t# code...\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \t}\n\t\t\t\t$answer = adminph\\User::where('username',$_POST['newUsername'])->first();\n\t\t\t \tif ($_POST['newPassword'] != \"\") {\n\t\t\t \t\t$password = password_hash($_POST[\"newPassword\"], PASSWORD_DEFAULT);\n\t\t\t \t}else{\n\t\t\t \t\t$password=$_POST['password'];\n\t\t\t \t}\n\t\t\t \t$answer->name = $_POST['newName'];\n\t\t\t \t$answer->username = $_POST['newUsername'];\n\t\t\t \t$answer->password = $password;\n\t\t\t \t$answer->type = $_POST['rol'];\n\t\t\t \t$answer->code = $_POST['newOrganizationCode'];\n\t\t\t \t$answer->photo = $ruta;\n\t\t\t if ($answer->save()) {\n\t\t\t \treturn redirect('usuarios');\t\t\t }\n\t\t\t } else {\n\t\t\t \treturn view('layouts.users_error');\n\t\t\t }\n\t\t}\n\n\t}", "function recibir_fichero(){\r\n\t$usuario = $_SESSION['user'];\r\n\r\n\t$dir_subida = 'usuarios/'.$usuario;\r\n\t$fichero_subido = $dir_subida . '/perfil.png';\r\n\r\n\tif(exif_imagetype($_FILES['imagen_perfil']['tmp_name']) != IMAGETYPE_PNG) {\r\n\t\tshow_msg(\"El archivo no es el adecuado\");\r\n\t}else if (move_uploaded_file($_FILES['imagen_perfil']['tmp_name'], $fichero_subido)){\r\n\t\t//El archivo se ha movido correctame\r\n\t}\r\n}", "function modificarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\t\t$this->setParametro('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function updateWorkAgreement()\n {\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n if (\\Input::file('picture')) {\n\n $image = \\Input::file('picture');\n $filename = \\Auth::user()->idPerson . '.' . $image->getClientOriginalExtension();\n echo 'hey';\n $path = public_path(\"WorkAgreement/\" . $filename);\n Image::make($image->getRealPath())->save($path);\n $tenant->work_Agreement = $filename;\n $tenant->save();\n }\n return \\Redirect::to('tenant');\n }", "public function update(Request $request, Fichee $fichee)\n {\n\n $this->validate($request, [\n 'photo' => 'image|nullable|max:1999',\n 'nom' => 'required',\n 'adresse' => 'required',\n 'num' => 'required',\n 'site' => 'required',\n 'raison_sociale' => 'required',\n 'date_de_creation' => 'required',\n 'activité'=>'required',\n 'gerant_id' =>'required',\n \n ]);\n\n $fichee->nom = $request->input('nom');\n $fichee->adresse = $request->input('adresse');\n $fichee->site = $request->input('site');\n $fichee->code_postal = $request->input('code_postal');\n $fichee->num = $request->input('num');\n $fichee->date_de_creation = $request->input('date_de_creation');\n $fichee->raison_sociale = $request->input('raison_sociale');\n $fichee->activité = $request->input('activité');\n $fichee->gerant_id = $request->input('gerant_id');\n $fichee->save();\n \n\n // User image\n if($request->hasFile('photo')){\n // Get filename with the extension\n $filenameWithExt = $request->file('photo')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $request->file('photo')->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore5= $filename.'_'.time().'.'.$extension;\n // Upload Image\n $path = $request->file('photo')->storeAs('public/user_images', $fileNameToStore5);\n // Delete file if exists\n Storage::delete('public/fichees_images/'.$fichee->photo);\n $fichee->photo = $fileNameToStore5;\n\n }\n\n $fichee->save();\n\n\n\n return redirect('/fichee'.'/'. $fichee->id . '/edit')->with('success', 'Mise à Jour Réussie');\n }", "function modificarPrograma(){\n\t\t$this->procedimiento='sigep.ft_programa_ime';\n\t\t$this->transaccion='SIGEP_PRO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_programa_boa','id_programa_boa','int4');\n\t\t$this->setParametro('id_cp_programa','id_cp_programa','int4');\n\t\t$this->setParametro('id_gestion','id_gestion','int4');\n\t\t$this->setParametro('programa','programa','int4');\n\t\t$this->setParametro('desc_catprg','desc_catprg','varchar');\n\t\t$this->setParametro('id_entidad','id_entidad','int4');\n\t\t$this->setParametro('nivel','nivel','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_catprg','id_catprg','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function modificarJuegoInternamente($id, $datos = array()) {\n global $textos, $sql, $configuracion, $archivo_imagen;\n\n $juego = new Juego($id);\n $destino = \"/ajax\".$juego->urlBase.\"/edit\";\n\n if (empty($datos)) {\n \n $codigo = HTML::campoOculto(\"procesar\", \"true\");\n $codigo .= HTML::campoOculto(\"id\", $id);\n $codigo .= HTML::campoOculto(\"datos[id_imagen]\", $juego->idImagen);\n $codigo .= HTML::parrafo($textos->id(\"NOMBRE\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"datos[nombre]\", 50, 255, $juego->nombre);\n $codigo .= HTML::parrafo($textos->id(\"DESCRIPCION\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[descripcion]\", 10, 60, $juego->descripcion, \"editor\");\n $codigo .= HTML::parrafo($textos->id(\"SCRIPT\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[script]\", 5, 60, $juego->script);\n $codigo .= HTML::parrafo($textos->id(\"IMAGEN\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoArchivo(\"imagen\", 50, 255);\n $codigo .= HTML::parrafo(HTML::campoChequeo(\"datos[activo]\", $juego->activo).$textos->id(\"ACTIVO\"), \"margenSuperior\"); \n $codigo .= HTML::parrafo(HTML::boton(\"chequeo\", $textos->id(\"ACEPTAR\"), \"botonOk\", \"botonOk\", \"botonOk\").HTML::frase(\" \".$textos->id(\"REGISTRO_MODIFICADO\"), \"textoExitoso\", \"textoExitoso\"), \"margenSuperior\");\n \n $codigo = HTML::forma($destino, $codigo, \"P\", true);\n\n $respuesta[\"generar\"] = true;\n $respuesta[\"codigo\"] = $codigo;\n $respuesta[\"titulo\"] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id(\"MODIFICAR_JUEGO\"), \"letraNegra negrilla\"), \"bloqueTitulo-IS\"), \"encabezadoBloque-IS\");\n $respuesta[\"destino\"] = \"#cuadroDialogo\";\n $respuesta[\"ancho\"] = 500;\n $respuesta[\"alto\"] = 570; \n\n } else {\n $respuesta[\"error\"] = true;\n if(!empty($archivo_imagen[\"tmp_name\"])){\n $validarFormato = Archivo::validarArchivo($archivo_imagen, array(\"jpg\",\"png\",\"gif\", \"jpeg\"));\n $area = getimagesize($archivo_imagen[\"tmp_name\"]);\n }\n\n if (empty($datos[\"nombre\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_NOMBRE\");\n\n } elseif (empty($datos[\"descripcion\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_DESCRIPCION\");\n\n } elseif (empty($datos[\"script\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_SCRIPT\");\n\n } elseif ($area[0] != $configuracion[\"DIMENSIONES\"][\"JUEGOS\"][0] || $area[1] != $configuracion[\"DIMENSIONES\"][\"JUEGOS\"][1]) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_AREA_IMAGEN_JUEGO\");\n\n } else { \n \n if ($juego->modificar($datos)) {\n /********************** En este Bloque se Arma el Contenido del nuevo Juego que se acaba de Registrar **********************/\n $juego = new Juego($id); \n // if (isset($sesion_usuarioSesion) && $sesion_usuarioSesion->idTipo == 0) {\n $botones = \"\";\n $botones .= HTML::nuevoBotonEliminarItemInterno($juego->id, $juego->urlBase);\n $botones .= HTML::nuevoBotonModificarItemInterno($juego->id, $juego->urlBase); \n $botones = HTML::contenedor($botones, \"botonesInternos\", \"botonesInternos\");\n // }\n $contenidoJuego = $botones;\n $contenidoJuego .= HTML::contenedor($juego->script, \"centrado\");\n $contenidoJuego .= HTML::contenedor(HTML::nuevosBotonesCompartir());\n $contenidoJuego = HTML::bloque(\"juego_\".$juego->id, $juego->nombre, $contenidoJuego, \"\", \"botonesOcultos\");\n \n /*******************************************************************************************************************************/\n\n $respuesta[\"error\"] = false;\n $respuesta[\"accion\"] = \"insertar\";\n $respuesta[\"contenido\"] = $contenidoJuego;\n $respuesta[\"idContenedor\"] = \"#bloqueComentariosJuego\".$id;\n $respuesta[\"modificarAjaxInterno\"] = true;\n //$respuesta[\"destino\"] = \"#nuevosRegistros\";\n\n } else {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_DESCONOCIDO\");\n }\n\n\n }\n \n }\n Servidor::enviarJSON($respuesta);\n \n }", "public function editarUsuarioSinFoto($datos)\n {\n $id= (int)$datos[\"id\"];\n $stmt = Conexion::conectar()->prepare(\"UPDATE usuarios SET nombre=:nombre , apellido=:apellido,\n nombre_usuario=:nombre_usuario, password=:password,correo=:correo WHERE idUsuario=:id\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":apellido\", $datos[\"apellido\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":nombre_usuario\", $datos[\"user\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":password\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $id);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\n }", "function subirFotoElemento($campo, $tipo, $id, $refresh, $backdir) {\n\t\tif($_FILES[$campo]['type'] != 'image/jpeg' AND $_FILES[$campo]['type'] != 'image/gif' AND $_FILES[$campo]['type'] != 'image/png') {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'El formato de imagen no es válido, sólo se aceptan JPG, GIF o PNG';\n\t\t}\n\n\t\t//Obtengo las dimensiones de la imagen, si se puede entonces es una imagen de verdad y evito una shell en el server\n\t\t$check = getimagesize($_FILES[$campo]['tmp_name']);\n\n\t\tif($check == FALSE) {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'Seleccione una imagen válida';\n\t\t}\n\n\t\t//Si no hay ningún error, arranco la subida...\n\t\tif($error_img == FALSE) {\n\t\t\tif($_FILES[$campo]['type'] == 'image/jpeg') {\n\t\t\t\t$extension_img = '.jpg';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/gif') {\n\t\t\t\t$extension_img = '.gif';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/png') {\n\t\t\t\t$extension_img = '.png';\n\t\t\t}\n\n\t\t\t$directorio_subida = $backdir . '../sitio/fotos/' . $tipo . '/ampl/';\n\t\t\t$directorio_subida_m = $backdir . '../sitio/fotos/' . $tipo . '/';\n\n\t\t\tif($img = glob($directorio_subida . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\tif($img = glob($directorio_subida_m . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\t$sin_punto = explode('.', $_FILES[$campo]['name']);\n\t\t\tmove_uploaded_file($_FILES[$campo]['tmp_name'],$directorio_subida . $_FILES[$campo]['name']);\n\t\t\trename($directorio_subida . $_FILES[$campo]['name'],$directorio_subida . $id . $extension_img);\n\n\t\t\t$modulo_variable_ancho_imagen_chica = 'modulo_' . $tipo . '_ancho_imagen_chica';\n\t\t\t$modulo_variable_alto_imagen_chica = 'modulo_' . $tipo . '_alto_imagen_chica';\n\t\t\t$modulo_variable_ancho_imagen_grande = 'modulo_' . $tipo . '_ancho_imagen_grande';\n\t\t\t$modulo_variable_alto_imagen_grande = 'modulo_' . $tipo . '_alto_imagen_grande';\n\t\t\t$modulo_variable_tipo_resize = 'modulo_' . $tipo . '_tipo_resize';\n\t\t\t$modulo_variable_watermark = 'modulo_' . $tipo . '_watermark';\n\t\t\t$modulo_variable_watermark_dir = 'modulo_' . $tipo . '_watermark_dir';\n\n\t\t\tglobal $$modulo_variable_ancho_imagen_chica;\n\t\t\tglobal $$modulo_variable_alto_imagen_chica;\n\t\t\tglobal $$modulo_variable_ancho_imagen_grande;\n\t\t\tglobal $$modulo_variable_alto_imagen_grande;\n\t\t\tglobal $$modulo_variable_tipo_resize;\n\t\t\tglobal $$modulo_variable_watermark;\n\t\t\tglobal $$modulo_variable_watermark_dir;\n\n\t\t\tif($_FILES[$campo]['type'] != 'image/gif') {\n\t\t\t\trequire($backdir . 'lib/Simpleimage/SimpleImage.php');\n\n\t\t\t\t$img = new \\claviska\\SimpleImage($directorio_subida . $id . $extension_img);\n\t\t\t\t$img->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t$img_thumb = new \\claviska\\SimpleImage($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\tif($$modulo_variable_tipo_resize == 'recortar') { //////////////////////////////////////////////////////////////Si está en modo recorte\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t} else { /////////////////////////////////////////////////////////////////////////////////////////////////////////Si está en modo proporcionar\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($refresh == TRUE) {\n\t\t\t\techo refresh();\n\t\t\t}\n\t\t} else {\n\t\t\techo '<br><div class=\"alert alert-danger\"><strong>Error</strong> ' . $msg . '</div>';\n\t\t}\n\t}", "public function actionAtualizar($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n\n $foto1 = UploadedFile::getInstanceByName('foto1');\n $foto2 = UploadedFile::getInstanceByName('foto2');\n $foto3 = UploadedFile::getInstanceByName('foto3');\n $foto4 = UploadedFile::getInstanceByName('foto4');\n $foto5 = UploadedFile::getInstanceByName('foto5');\n\n// dd( Yii::$app->request->post(), $foto1, $model);\n\n $model->save();\n\n $caminho = $model->localSalvarImagens();\n\n if ($foto1 && Yii::$app->request->post('atualiza_foto1') == 'on') {\n @unlink($caminho . '/' . $model->foto1);\n $arq = 'foto1_' . time() . '.' . $foto1->getExtension();\n $model->foto1 = $arq;\n $foto1->saveAs($caminho . '/'.$arq);\n }\n if (Yii::$app->request->post('atualiza_foto2') == 'on') {\n if ($foto2) {\n @unlink($caminho . '/' . $model->foto2);\n $arq = 'foto2_' . time() . '.' . $foto2->getExtension();\n $model->foto2 = $arq;\n $foto2->saveAs($caminho . '/' . $arq);\n } else\n $model->foto2 = null;\n }\n if (Yii::$app->request->post('atualiza_foto3') == 'on') {\n if ($foto3) {\n @unlink($caminho . '/' . $model->foto3);\n $arq = 'foto3_' . time() . '.' . $foto3->getExtension();\n $model->foto3 = $arq;\n $foto3->saveAs($caminho . '/' . $arq);\n } else\n $model->foto3 = null;\n }\n if (Yii::$app->request->post('atualiza_foto4') == 'on') {\n if ($foto4) {\n @unlink($caminho . '/' . $model->foto4);\n $arq = 'foto4_' . time() . '.' . $foto4->getExtension();\n $model->foto4 = $arq;\n $foto4->saveAs($caminho . '/' . $arq);\n } else\n $model->foto4 = null;\n }\n if (Yii::$app->request->post('atualiza_foto5') == 'on') {\n if ($foto5) {\n @unlink($caminho . '/' . $model->foto5);\n $arq = 'foto5_' . time() . '.' . $foto5->getExtension();\n $model->foto5 = $arq;\n $foto5->saveAs($caminho . '/' . $arq);\n } else\n $model->foto5 = null;\n }\n\n Yii::$app->session->setFlash('success', 'Produto atualizado com sucesso');\n $model->update(false);\n\n\n return $this->redirect(['exibir', 'id' => $model->id]);\n }\n\n return $this->render('atualizar', [\n 'model' => $model,\n ]);\n }", "public function subir_datos() {\n $datos = array(\n 'nombre' => $this->helper->cleanInput($_POST['cname']),\n 'email' => $this->helper->cleanInput($_POST['email']),\n 'telefono' => $this->helper->cleanInput($_POST['phone']),\n 'message' => $this->helper->cleanInput($_POST['message'])\n );\n $insert = $this->model->subir_datos($datos);\n $id = $insert['id'];\n #SUBIMOS EL ARCHIVO\n $dir = 'public/archivos/cv/';\n $serverdir = $dir;\n $filename = \"\";\n foreach ($_FILES as $inputname => $file) {\n $newname = $this->helper->cleanUrl($_POST[$inputname . '_name']);\n //$extension = strtolower(end(explode('.', $file['name'])));\n $ext = explode('.', $file['name']);\n $extension = strtolower(end($ext));\n $fname = $id . '_' . $newname . '.' . $extension;\n $contents = file_get_contents($file['tmp_name']);\n\n $handle = fopen($serverdir . $fname, 'w');\n fwrite($handle, $contents);\n fclose($handle);\n\n $filename = $fname;\n var_dump($filename);\n }\n $update = array(\n 'id' => $id,\n 'archivo' => $filename\n );\n $updateTrabaja = $this->model->updateTrabaja($update);\n if (!empty($id)) {\n $data = array(\n 'type' => 'succes',\n 'message' => $this->helper->messageAlert('success', 'Gracias, tu C.V. se ha agregado correctamente a nuestra Base de Datos.')\n );\n } else {\n $data = array(\n 'type' => 'error',\n 'message' => $this->helper->messageAlert('error', 'Lo sentimos ha ocurrido un error, por favor vuelva a intertarlo')\n );\n }\n Session::set('result', $data);\n header('Location: ' . URL . 'trabaja_con_nosotros/');\n }", "function modificarCotizacion(){\n\t\t$this->procedimiento='adq.f_cotizacion_ime';\n\t\t$this->transaccion='ADQ_COT_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cotizacion','id_cotizacion','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('lugar_entrega','lugar_entrega','varchar');\n\t\t$this->setParametro('tipo_entrega','tipo_entrega','varchar');\n\t\t$this->setParametro('fecha_coti','fecha_coti','date');\n\t\t$this->setParametro('numero_oc','numero_oc','varchar');\n\t\t$this->setParametro('id_proveedor','id_proveedor','int4');\n\t\t$this->setParametro('precio_total','precio_total','numeric');\n\t\t$this->setParametro('fecha_entrega','fecha_entrega','date');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t$this->setParametro('fecha_venc','fecha_venc','date');\n\t\t$this->setParametro('obs','obs','text');\n\t\t$this->setParametro('fecha_adju','fecha_adju','date');\n\t\t$this->setParametro('nro_contrato','nro_contrato','varchar');\n\t\t$this->setParametro('tipo_cambio_conv','tipo_cambio_conv','numeric');\n $this->setParametro('tiempo_entrega','tiempo_entrega','varchar');\n\t\t$this->setParametro('funcionario_contacto','funcionario_contacto','varchar');\n\t\t$this->setParametro('telefono_contacto','telefono_contacto','varchar');\n\t\t$this->setParametro('correo_contacto','correo_contacto','varchar');\n\t\t$this->setParametro('prellenar_oferta','prellenar_oferta','varchar');\n\t\t$this->setParametro('forma_pago','forma_pago','varchar');\n\n $this->setParametro('id_solicitud','id_solicitud','int4');\n $this->setParametro('justificacion','justificacion','text');\n\n \n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n //var_dump('llega', $this->respuesta);\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function Editar(){\n \n $id = $_GET['id'];\n $imagem = $_GET['imagem'];\n \n if(!empty($_FILES['btnImagem']['name'])){\n // Caminho da pasta onde as imagens serão armazenadas.\n $upload_dir = \"imagens/\";\n\n // Para manipular arquivos, deve ser usado \"$_FILES\"!!!\n // Armazenando o nome e a extensão do arquivo que foi selecionado.\n $nome_arq = basename($_FILES['btnImagem']['name']);\n\n // Verifica o tipo de extensão permitida para o upload do arquivo,\n // usamos o comando \"strstr()\" para localizar a sequência de caracteres.\n if(strstr($nome_arq,'.jpg') || strstr($nome_arq,'.png') || strstr($nome_arq,'.gif')){\n\n $upload_file = $upload_dir . $nome_arq;\n\n if(move_uploaded_file($_FILES['btnImagem']['tmp_name'], $upload_file)){\n\n $frota = new Frota();\n\n $frota->id = $id;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $upload_file;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n \n// var_dump($frota);\n\n }else{\n echo(\"Falha ao mover o arquivo!\");\n }\n\n }\n }else{\n \n\n $idFrota = $_GET['id'];\n\n $frota = new Frota();\n\n $frota->id = $idFrota;\n// $frota->titulo_frota = $_POST['titulo_frota'];\n $frota->imagem = $imagem;\n $frota->descricao = $_POST['txt_sobre'];\n $frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];\n\n $frota::Update($frota);\n \n }\n }", "public static function updateProfiloPersonale()\n {\n define(\"nome_completo_regexpr\", \"/^[a-zA-Z \\xE0\\xE8\\xE9\\xEC\\xF2\\xF9]{3,64}/\");\n define(\"email_personale_regexpr\", \"/^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/\");\n define(\"username_regexpr\", \"/^[A-Za-z0-9\\xE0\\xE8\\xE9\\xEC\\xF2\\xF9 ]{3,64}$/\");\n define(\"password_regexpr\", \"/^[a-zA-Z0-9\\xE0\\xE8\\xE9\\xEC\\xF2\\xF9]+$/\");\n $name = trim($_REQUEST['nome_completo_azienda']);\n $task = trim($_REQUEST['tipo_incarichi_id']);\n $mail = trim($_REQUEST['email_personale_azienda']);\n $username = trim($_REQUEST['username_azienda']);\n $pass = trim($_REQUEST['password_azienda']);\n $id = $_SESSION['current_user']->getId();\n $error_rec = 0; //verifica la presenza di un generico errore\n \n $utente = new Azienda();\n // verifica la correttezza dei valori inseriti nella compliazione del form\n if (!empty($name)) {\n unset($_SESSION['nome_completo_azienda']);\n if (1 === preg_match(nome_completo_regexpr, $name)) {\n $utente->setNomeCompleto($name);\n } else {\n $_SESSION['nome_completo_azienda'] = \"<div class='messaggio-errore'>Il campo nome completo contiene caratteri non validi.<br>Verifica eventuali errori di battitura.</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['nome_completo_azienda'] = \"<div class='messaggio-errore'>Il campo nome completo &egrave; vuoto</div>\";\n $error_rec++;\n }\n if (!empty($task)) {\n unset($_SESSION['tipo_incarichi_id']);\n $utente->setTipo_incarichi_id($task);\n }\n if ($task == \"-1\") {\n $_SESSION['tipo_incarichi_id'] = \"<div class='messaggio-errore'>Il campo tipo di incarico non &egrave; stato schelto</div>\";\n $error_rec++;\n }\n if (!empty($mail)) {\n unset($_SESSION['email_personale_azienda']);\n if (1 === preg_match(email_personale_regexpr, $mail)) {\n $valido = UtenteFactory::cercaEmailUpdate($mail, 1, $id);\n if ($valido == 'SI') {\n $utente->setEmailPersonale($mail);\n } else {\n $_SESSION['email_personale_azienda'] = \"<div class='messaggio-errore'>Questa email &egrave; gi&agrave; stato utilizzata<br></div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['email_personale_azienda'] = \"<div class='messaggio-errore'>Questo indirizzo email non &egrave; valido.<br>Verifica eventuali errori di battitura.<br>Esempio email valida: email@esempio.com</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['email_personale_azienda'] = \"<div class='messaggio-errore'>Il campo email &egrave; vuoto</div>\";\n $error_rec++;\n }\n if (!empty($username)) {\n unset($_SESSION['username_azienda']);\n if (1 === preg_match(username_regexpr, $username)) {\n $valido = UtenteFactory::cercaUsernameUpdate($username, 1, $id);\n if ($valido == 'SI') {\n $utente->setUsername($username);\n } else {\n $_SESSION['username_azienda'] = \"<div class='messaggio-errore'>Questo Username &egrave; gi&agrave; stato utilizzato<br>scegline un altro</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['username_azienda'] = \"<div class='messaggio-errore'>Il campo username completo contiene caratteri non validi.<br>Verifica eventuali errori di battitura.</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['username_azienda'] = \"<div class='messaggio-errore'>Il campo username completo &egrave; vuoto</div>\";\n $error_rec++;\n }\n if (!empty($pass)) {\n unset($_SESSION['password_azienda']);\n if (1 === preg_match(password_regexpr, $pass)) {\n $utente->setPassword($pass);\n } else {\n $_SESSION['password_azienda'] = \"<div class='messaggio-errore'>Il campo password non &egrave; valido.<br>Verifica eventuali errori di battitura.</div>\";\n $error_rec++;\n }\n } else {\n $_SESSION['password_azienda'] = \"<div class='messaggio-errore'>Il campo password &egrave; vuoto</div>\";\n $error_rec++;\n }\n if ($error_rec == 0) {\n $update = UtenteFactory::updateProfiloPersonale($id, $utente);\n if ($update == 'INSUCCESSO') {\n $_SESSION['errore'] = 6;\n } elseif ($update == 'SUCCESSO') {\n $_SESSION['errore'] = 5;\n }\n }\n \n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_modifica_profilo.php\");\n $vd->setContentFile(\"../view/in/azienda/modifica_profilo_personale.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once '../view/Master.php';\n }", "static public function ctrEditarRepuesto(){\n\n\t\tif(isset($_POST[\"editDescripcion\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editDescripcion\"]) &&\n\t\t\t preg_match('/^[0-9]+$/', $_POST[\"editStock\"]) &&\t\n\t\t\t preg_match('/^[0-9.]+$/', $_POST[\"editPrecioCompra\"]) &&\n\t\t\t preg_match('/^[0-9.]+$/', $_POST[\"editPrecioVenta\"])){\n\n\t\t \t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t \t$ruta = $_POST[\"imagenActualProducto\"];\n\n\t\t\t \tif(isset($_FILES[\"editImagen\"][\"tmp_name\"]) && !empty($_FILES[\"editImagen\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editImagen\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$directorio = \"vistas/img/productos/\".$_POST[\"editCodigo\"];\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif(!empty($_POST[\"imagenActualProducto\"]) && $_POST[\"imagenActualProducto\"] != \"vistas/img/productos/default/anonymous.png\"){\n\n\t\t\t\t\t\tunlink($_POST[\"imagenActualProducto\"]);\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif($_FILES[\"editImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST[\"editCodigo\"].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES[\"editImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST[\"editCodigo\"].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"repuestos\";\n\n\t\t\t\t$datos = array(\"id_categoria\" => $_POST[\"editCategoria\"],\n\t\t\t\t\t\t\t \"codigo\" => $_POST[\"editCodigo\"],\n\t\t\t\t\t\t\t \"descripcion\" => $_POST[\"editDescripcion\"],\n\t\t\t\t\t\t\t \"stock\" => $_POST[\"editStock\"],\n\t\t\t\t\t\t\t \"precio_unidad\" => $_POST[\"editPrecioCompra\"],\n\t\t\t\t\t\t\t \"total_pagar\" => $_POST[\"editPrecioVenta\"],\n\t\t\t\t\t\t\t \"imagen\" => $ruta);\n\n\t\t\t\t$respuesta = ModeloProductos::mdlEditarRepuesto($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t\t title: \"El producto ha sido editado correctamente\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El producto no puede ir con los campos vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\t\t\t}\n\t\t}\n\n\t}" ]
[ "0.6746065", "0.6672834", "0.6527036", "0.65063375", "0.6490109", "0.6478167", "0.6476187", "0.6471835", "0.64662313", "0.6412877", "0.63792735", "0.6362754", "0.63617253", "0.6353534", "0.62735033", "0.6233567", "0.6233462", "0.62284786", "0.6215859", "0.6212221", "0.62062687", "0.61915565", "0.61800295", "0.61596537", "0.61488795", "0.61473763", "0.61444896", "0.61410964", "0.6113005", "0.6104085", "0.6101768", "0.60942", "0.6082366", "0.6077011", "0.60724086", "0.60517234", "0.6041952", "0.6036054", "0.603443", "0.60324115", "0.6027809", "0.6027467", "0.6026133", "0.60062337", "0.59946966", "0.59808075", "0.59683794", "0.59666735", "0.5960375", "0.5957353", "0.59560806", "0.595105", "0.59482926", "0.5936409", "0.59363914", "0.593543", "0.5921099", "0.59204465", "0.59170943", "0.5912772", "0.5911459", "0.58945465", "0.58864295", "0.58859676", "0.58772314", "0.58725756", "0.58712614", "0.5870997", "0.58656174", "0.58645135", "0.58621746", "0.58595365", "0.5853528", "0.5848245", "0.5848125", "0.5831513", "0.58312875", "0.5823787", "0.5821344", "0.58196485", "0.58163476", "0.5814027", "0.5802657", "0.58006924", "0.57994807", "0.57949656", "0.57911605", "0.5787875", "0.5785367", "0.5783849", "0.5779352", "0.5778009", "0.57770437", "0.5764116", "0.5749064", "0.57428086", "0.5741586", "0.57348895", "0.5731138", "0.5730262", "0.5722622" ]
0.0
-1
Intenta redimensionar una imagen
private function resizeImage($nombre_archivo, $concepto, &$path_destino) { $handle = new Upload($nombre_archivo, 'es_ES'); if ($handle->uploaded) { $handle->file_name_body_pre = 'thumb_'; $handle->image_resize = true; $handle->image_x = 300; $handle->image_y = 200; $handle->image_ratio = true; $handle->image_ratio_crop = true; $handle->process('Assets/img/' . $concepto); $path_destino = $handle->file_dst_pathname; $handle->clean(); } else { throw new Exception($handle->error); } return $handle->processed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redimensionarImagen($origin,$destino,$newWidth,$newHeight,$jpgQuality=100)\n{\n // texto con el valor correcto height=\"yyy\" width=\"xxx\"\n $datos=getimagesize($origin);\n \n // comprobamos que la imagen sea superior a los tamaños de la nueva imagen\n if($datos[0]>$newWidth || $datos[1]>$newHeight)\n {\n \n // creamos una nueva imagen desde el original dependiendo del tipo\n if($datos[2]==1)\n $img=imagecreatefromgif($origin);\n if($datos[2]==2)\n $img=imagecreatefromjpeg($origin);\n if($datos[2]==3)\n $img=imagecreatefrompng($origin);\n \n // Redimensionamos proporcionalmente\n if(rad2deg(atan($datos[0]/$datos[1]))>rad2deg(atan($newWidth/$newHeight)))\n {\n $anchura=$newWidth;\n $altura=round(($datos[1]*$newWidth)/$datos[0]);\n }else{\n $altura=$newHeight;\n $anchura=round(($datos[0]*$newHeight)/$datos[1]);\n }\n \n // creamos la imagen nueva\n $newImage = imagecreatetruecolor($anchura,$altura);\n \n // redimensiona la imagen original copiandola en la imagen\n imagecopyresampled($newImage, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);\n \n // guardar la nueva imagen redimensionada donde indicia $destino\n if($datos[2]==1)\n imagegif($newImage,$destino);\n if($datos[2]==2)\n imagejpeg($newImage,$destino,$jpgQuality);\n if($datos[2]==3)\n imagepng($newImage,$destino);\n \n // eliminamos la imagen temporal\n imagedestroy($newImage);\n \n return true;\n }\n return false;\n}", "function redim($ruta1,$ruta2,$ancho,$alto)\n {\n $datos=getimagesize ($ruta1);\n \n $ancho_orig = $datos[0]; # Anchura de la imagen original\n $alto_orig = $datos[1]; # Altura de la imagen original\n $tipo = $datos[2];\n \n if ($tipo==1){ # GIF\n if (function_exists(\"imagecreatefromgif\")){\n $img = imagecreatefromgif($ruta1);\n echo \"<script>\n\t\t\t\talert('entro a gif');\n\t\t\t\t</script>\";\n }else{\n return false;\n }\n }\n else if ($tipo==2){ # JPG\n if (function_exists(\"imagecreatefromjpeg\")){\n $img = imagecreatefromjpeg($ruta1);\n\n }else{\n return false;\n }\n }\n else if ($tipo==3){ # PNG\n if (function_exists(\"imagecreatefrompng\")){\n $img = imagecreatefrompng($ruta1);\n \n }else{\n return false;\n }\n }\n \n # Se calculan las nuevas dimensiones de la imagen\n if ($ancho_orig>$alto_orig)\n {\n $ancho_dest=$ancho;\n $alto_dest=($ancho_dest/$ancho_orig)*$alto_orig;\n }\n else\n {\n $alto_dest=$alto;\n $ancho_dest=($alto_dest/$alto_orig)*$ancho_orig;\n }\n\n // imagecreatetruecolor, solo estan en G.D. 2.0.1 con PHP 4.0.6+\n $img2=@imagecreatetruecolor($ancho_dest,$alto_dest) or $img2=imagecreate($ancho_dest,$alto_dest);\n\n // Redimensionar\n // imagecopyresampled, solo estan en G.D. 2.0.1 con PHP 4.0.6+\n @imagecopyresampled($img2,$img,0,0,0,0,$ancho_dest,$alto_dest,$ancho_orig,$alto_orig) or imagecopyresized($img2,$img,0,0,0,0,$ancho_dest,$alto_dest,$ancho_orig,$alto_orig);\n\n // Crear fichero nuevo, según extensión.\n if ($tipo==1) // GIF\n if (function_exists(\"imagegif\"))\n imagegif($img2, $ruta2);\n else\n return false;\n\n if ($tipo==2) // JPG\n if (function_exists(\"imagejpeg\"))\n imagejpeg($img2, $ruta2);\n else\n return false;\n\n if ($tipo==3) // PNG\n if (function_exists(\"imagepng\"))\n imagepng($img2, $ruta2);\n else\n return false;\n \n return true;\n }", "function redimensionne_image($photo)\n{\n\t$info_image = getimagesize($photo);\n\t// largeur et hauteur de l'image d'origine\n\t$largeur = $info_image[0];\n\t$hauteur = $info_image[1];\n\t// largeur et/ou hauteur maximum à afficher\n\tif(basename($_SERVER['PHP_SELF'],\".php\") === \"trombi_impr\") {\n\t\t// si pour impression\n\t\t$taille_max_largeur = getSettingValue(\"l_max_imp_trombinoscopes\");\n\t\t$taille_max_hauteur = getSettingValue(\"h_max_imp_trombinoscopes\");\n\t} else {\n\t// si pour l'affichage écran\n\t\t$taille_max_largeur = getSettingValue(\"l_max_aff_trombinoscopes\");\n\t\t$taille_max_hauteur = getSettingValue(\"h_max_aff_trombinoscopes\");\n\t}\n\n\t// calcule le ratio de redimensionnement\n\t$ratio_l = $largeur / $taille_max_largeur;\n\t$ratio_h = $hauteur / $taille_max_hauteur;\n\t$ratio = ($ratio_l > $ratio_h)?$ratio_l:$ratio_h;\n\n\t// définit largeur et hauteur pour la nouvelle image\n\t$nouvelle_largeur = $largeur / $ratio;\n\t$nouvelle_hauteur = $hauteur / $ratio;\n\n\treturn array($nouvelle_largeur, $nouvelle_hauteur);\n}", "function redimensionne_image_petit($photo)\n{\n\tglobal $photo_redim_taille_max_largeur, $photo_redim_taille_max_hauteur;\n\n\tif((!preg_match(\"/^[0-9]{1,}$/\", $photo_redim_taille_max_largeur))||($photo_redim_taille_max_largeur<=0)) {\n\t\t$photo_redim_taille_max_largeur=35;\n\t}\n\n\tif((!preg_match(\"/^[0-9]{1,}$/\", $photo_redim_taille_max_hauteur))||($photo_redim_taille_max_hauteur<=0)) {\n\t\t$photo_redim_taille_max_hauteur=35;\n\t}\n\n\t// prendre les informations sur l'image\n\t$info_image = getimagesize($photo);\n\t// largeur et hauteur de l'image d'origine\n\t$largeur = $info_image[0];\n\t$hauteur = $info_image[1];\n\t// largeur et/ou hauteur maximum à afficher\n\t//$taille_max_largeur = 35;\n\t//$taille_max_hauteur = 35;\n\n\t// calcule le ratio de redimensionnement\n\t$ratio_l = $largeur / $photo_redim_taille_max_largeur;\n\t$ratio_h = $hauteur / $photo_redim_taille_max_hauteur;\n\t$ratio = ($ratio_l > $ratio_h)?$ratio_l:$ratio_h;\n\n\t// définit largeur et hauteur pour la nouvelle image\n\t$nouvelle_largeur = $largeur / $ratio;\n\t$nouvelle_hauteur = $hauteur / $ratio;\n\n\t// on renvoit la largeur et la hauteur\n\treturn array($nouvelle_largeur, $nouvelle_hauteur);\n}", "protected function scaleImages() {}", "private function recortarImagen()\n\t{\n\t\t$ImgTemporal=\"temporal_clase_Imagen.\".strtolower($this->extencion);\n\n\t\t$CoefAncho\t\t= $this->propiedadesImagen[0]/$this->anchoDestino;\n\t\t$CoefAlto\t\t= $this->propiedadesImagen[1]/$this->altoDestino;\n\t\t$Coeficiente=0;\n\t\tif ($CoefAncho>1 && $CoefAlto>1)\n\t\t{ if($CoefAncho>$CoefAlto){ $Coeficiente=$CoefAlto; } else {$Coeficiente=$CoefAncho;} }\n\n\t\tif ($Coeficiente!=0)\n\t\t{\n\t\t\t$anchoTmp\t= ceil($this->propiedadesImagen[0]/$Coeficiente);\n\t\t\t$altoTmp\t= ceil($this->propiedadesImagen[1]/$Coeficiente);\n\n\t\t\t$ImgMediana = imagecreatetruecolor($anchoTmp,$altoTmp);\n\t\t\timagecopyresampled($ImgMediana,$this->punteroImagen,0,0,0,0,$anchoTmp,$altoTmp,$this->propiedadesImagen[0],$this->propiedadesImagen[1]);\n\t\t\t\n\t\t\t// Tengo que desagregar la funcion de image para crear para reUtilizarla\n\t\t\t//imagejpeg($ImgMediana,$ImgTemporal,97);\n\t\t\t$this->crearArchivoDeImagen($ImgMediana,$ImgTemporal);\n\t\t}\n\n\t\t$fila\t\t\t= floor($this->recorte['centrado']/$this->recorte['columnas']);\n\t\t$columna\t\t= $this->recorte['centrado'] - ($fila*$this->recorte[\"columnas\"]);\n\t\t\n\t\t$centroX \t= floor(($anchoTmp / $this->recorte[\"columnas\"])/2)+$columna*floor($anchoTmp / $this->recorte[\"columnas\"]);\n\t\t$centroY \t= floor(($altoTmp / $this->recorte[\"filas\"])/2)+$fila*floor($altoTmp / $this->recorte[\"filas\"]);\n\n\t\t$centroX\t-= floor($this->anchoDestino/2);\n\t\t$centroY \t-= floor($this->altoDestino/2);\n\n\t\tif ($centroX<0) {$centroX = 0;}\n\t\tif ($centroY<0) {$centroY = 0;}\n\n\t\tif (($centroX+$this->anchoDestino)>$anchoTmp) {$centroX = $anchoTmp-$this->anchoDestino;}\n\t\tif (($centroY+$this->altoDestino)>$altoTmp) {$centroY = $altoTmp-$this->altoDestino;}\n\n\t\t$ImgRecortada = imagecreatetruecolor($this->anchoDestino,$this->altoDestino);\n\t\timagecopymerge ( $ImgRecortada,$ImgMediana,0,0,$centroX, $centroY, $this->anchoDestino, $this->altoDestino,100);\n\n\t\t//imagejpeg($ImgRecortada,$this->imagenDestino,97);\n\t\t$this->crearArchivoDeImagen($ImgRecortada,$this->imagenDestino);\n\t\timagedestroy($ImgRecortada);\n\t\tunlink($ImgTemporal);\n\t}", "function redimage($img_src,$img_dest,$dst_w,$dst_h) {\n // Lit les dimensions de l'image\n $size = GetImageSize($img_src); \n $src_w = $size[0]; $src_h = $size[1]; \n // Teste les dimensions tenant dans la zone\n $test_h = round(($dst_w / $src_w) * $src_h);\n $test_w = round(($dst_h / $src_h) * $src_w);\n // Si Height final non précisé (0)\n if(!$dst_h) $dst_h = $test_h;\n // Sinon si Width final non précisé (0)\n elseif(!$dst_w) $dst_w = $test_w;\n // Sinon teste quel redimensionnement tient dans la zone\n elseif($test_h>$dst_h) $dst_w = $test_w;\n else $dst_h = $test_h;\n\n // La vignette existe ?\n $test = (file_exists($img_dest));\n // L'original a été modifié ?\n if($test)\n $test = (filemtime($img_dest)>filemtime($img_src));\n // Les dimensions de la vignette sont correctes ?\n if($test) {\n $size2 = GetImageSize($img_dest);\n $test = ($size2[0]==$dst_w);\n $test = ($size2[1]==$dst_h);\n }\n\n // Créer la vignette ?\n if(!$test) {\n // Crée une image vierge aux bonnes dimensions\t\n $dst_im = ImageCreateTrueColor($dst_w,$dst_h); \n // Copie dedans l'image initiale redimensionnée\n $src_im = ImageCreateFromJpeg($img_src);\n ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);\n // Sauve la nouvelle image\n ImageJpeg($dst_im,$img_dest);\n // Détruis les tampons\n ImageDestroy($dst_im);\n ImageDestroy($src_im);\n }\n}", "function redimensionne_logo($photo, $L_max, $H_max)\n{\n\t// prendre les informations sur l'image\n\t$info_image = getimagesize($photo);\n\t// largeur et hauteur de l'image d'origine\n\t$largeur = $info_image[0];\n\t$hauteur = $info_image[1];\n\t// largeur et/ou hauteur maximum à afficher en pixel\n\t$taille_max_largeur = $L_max;\n\t$taille_max_hauteur = $H_max;\n\n\t// calcule le ratio de redimensionnement\n\t$ratio_l = $largeur / $taille_max_largeur;\n\t$ratio_h = $hauteur / $taille_max_hauteur;\n\t$ratio = ($ratio_l > $ratio_h)?$ratio_l:$ratio_h;\n\n\t// définit largeur et hauteur pour la nouvelle image\n\t$nouvelle_largeur = $largeur / $ratio;\n\t$nouvelle_hauteur = $hauteur / $ratio;\n\n\t// des Pixels vers Millimetres\n\t$nouvelle_largeur = $nouvelle_largeur / 2.8346;\n\t$nouvelle_hauteur = $nouvelle_hauteur / 2.8346;\n\n\treturn array($nouvelle_largeur, $nouvelle_hauteur);\n}", "function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}", "public function reseize($path, $source, $width, $height, $nama_ori){\n \t//$source = sumber gambar yang akan di reseize\n $config['image_library'] = 'gd2';\n $config['source_image'] = $source;\n $config['new_image'] = $path.$width.'_'.$nama_ori;\n $config['overwrite'] = TRUE;\n $config['create_thumb'] = false;\n $config['width'] = $width;\n if($height>0){\n \t$config['maintain_ratio'] = false;\n \t$config['height'] = $height;\n }else{\n \t$config['maintain_ratio'] = true;\n }\n\n $this->image_lib->initialize($config);\n\n $this->image_lib->resize();\n $this->image_lib->clear();\n }", "public function ejecutarRedimension(){\r\n\t\t$this->Redimensionar();\r\n\r\n\t\tif ($this->tipo_imagen_original=='image/jpeg') {\r\n\t\t\timagejpeg($this->lienzoNuevaImagen,$this->carpeta_destino.$this->nuevo_nombre_imagen,$this->calidadImagen);\r\n\t\t}else if($this->tipo_imagen_original=='image/gif'){\r\n\t\t\timagegif($this->lienzoNuevaImagen,$this->carpeta_destino.$this->nuevo_nombre_imagen,$this->calidadImagen);\r\n\t\t}else if($this->tipo_imagen_original=='image/png'){\r\n\t\t\timagepng($this->lienzoNuevaImagen,$this->carpeta_destino.$this->nuevo_nombre_imagen,$this->calidadImagen);\r\n\t\t}else if($this->tipo_imagen_original=='image/wbmp'){\r\n\t\t\timagewbmp($this->lienzoNuevaImagen,$this->carpeta_destino.$this->nuevo_nombre_imagen,$this->calidadImagen);\r\n\t\t}else{\r\n\t\t\t$this->erroreEncontrados[]= \"Problemas para Ejecutar la Redimension\";\r\n\t\t}\r\n\t}", "function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }", "function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }", "function subir_imagenes($tipo,$imagen,$descripcion,$ruta,$size)\n\t{\n\t\t\t//return \"La imagen\".$tipo.\" No se subio\";\n\t\t\tif(strstr($tipo,\"image\"))\n\t\t\t{\n\n\t\t\t\tif(strstr($tipo,\"jpeg\"))\n\t\t\t\t\t$extension=\".jpg\";\n\t\t\t\telse if(strstr($tipo,\"gif\"))\n\t\t\t\t\t$extension=\".gif\";\n\t\t\t\telse if(strstr($tipo,\"png\"))\n\t\t\t\t\t$extension=\".png\";\n\t\t\t\t//para saber si la imagen tiene el ancho correcto es de 420px\n\t\t\t\t$tam_img=getimagesize($imagen);\n\t\t\t\t$ancho_img=$tam_img[0];\n\t\t\t\t$alto_img =$tam_img[1];\n\t\t\t\t$ancho_img_deseado=$size;\n\n\t\t\t\t//sii la imagen es maor en su ancho a 420px reajusto su tamaño\n\t\t\t\t\tif($ancho_img > $ancho_img_deseado)\n\t\t\t\t\t{\n\t\t\t\t\t\t//reajustamos\n\t\t\t\t\t\t//por una regla de tres obtengo el alto de la imagen de manera \n\t\t\t\t\t\t//proporciaonal el ancho nuevo que sera 420\n\t\t\t\t\t\t$nuevo_ancho_img = $ancho_img_deseado;\n\t\t\t\t\t\t$nuevo_alto_img=($alto_img*$nuevo_ancho_img)/$ancho_img;\n\t\t\t\t\t\t//CREO UNA IMAGEN EN COLOR REAL CON LA NUEVAS DIMENSIONES\n\t\t\t\t\t\n\t\t\t\t\t\t$img_reajustada=imagecreatetruecolor($nuevo_ancho_img, $nuevo_alto_img);\n\t\t\t\t\t\t//CREO UNA IMAGEN BASADA EN LA ORIGINAL DEPENDIENDO DE SU EXTENSION ES EL TIPO QUE CREARE\n\t\t\t\t\t\tswitch ($extension) {\n\t\t\t\t\t\t\tcase '.jpg':\n\t\t\t\t\t\t\t\t$img_original=imagecreatefromjpeg($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagejpeg($img_reajustada,$nombre_img_ext,100);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".jpg\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '.gif':\n\t\t\t\t\t\t\t\t$img_original=imagecreatefromgif($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagegif($img_reajustada,$nombre_img_ext,100);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".gif\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '.png':\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$img_original=imagecreatefrompng($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\timagesavealpha($img_reajustada, true);\n\t\t\t\t\t\t\t\timagealphablending($img_reajustada, false);\t\n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\timagecolortransparent($img_reajustada);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagepng($img_reajustada,$nombre_img_ext,0);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".png\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//no se reajusta y se sube\n\t\t\t\t\t\t$destino=$ruta.$descripcion.$extension;\n\n\t\t\t\t\t\t//Se sube la foto\n\t\t\t\t\t\tmove_uploaded_file($imagen,$destino) /*or die(\"No se pudo subir la imagen\")*/;\n\n\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles para el perfil\n\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\tborrar_imagenes($nombre_img,$extension);\n\t\t\t\t\t}\n\t\t\t\t\t//Asigno el nombre que el que se guardara en la base de datos\n\t\t\t\t\t$imagen=$descripcion.$extension;\n\t\t\t\t\treturn $imagen;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"La imagen\".$imagen.\" No se subio\";\n\t\t\t}\n\n\t}", "function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}", "function resizeToWidth($width)\n {\n //obtine ratio dividiendo ancho dada entre el ancho actual de la imagen.\n $ratio = $width / $this->getWidth();\n //obtiene altura con la altura actual de la imagen por el ratio.\n $height = $this->getheight() * $ratio;\n //redimensiona imagen.\n $this->resize($width,$height);\n }", "function imageresize($im, $width, $height) {\n list($w, $h) = [imagesx($im), imagesy($im)];\n $res = newTransparentImage($w + $width, $h + $height);\n imagecopy($res, $im, 0, 0, 0, 0, $w, $h);\n imagedestroy($im);\n return $res;\n}", "function cria_miniatura($img, $original, $miniatura, $largura_miniatura, $altura_miniatura ) {\r\n\t\tif($img['type'] == \"image/jpeg\"){\r\n\t\t\t$imagem_original = imagecreatefromjpeg($original);\r\n\t\t}\r\n\t\telse if($img['type'] == \"image/png\"){\r\n\t\t\t$imagem_original = imagecreatefrompng($original);\r\n\t\t}\r\n\t\telse if($img['type'] == \"image/gif\"){\t\r\n\t\t\t$imagem_original = imagecreatefromgif($original);\r\n\t }\r\n\t\t\r\n\t\t/* Calcula a proporção com base na largura */\r\n\t\t$largura_original = imagesx($imagem_original);\r\n\t $altura_original = imagesy($imagem_original);\r\n\t\t\r\n\t\tif(empty($largura_miniatura) and !empty($altura_miniatura)){\r\n\t\t\t$largura_miniatura = round(($largura_original * $altura_miniatura) / $altura_original); \r\n\t\t}\r\n\t\telse if(!empty($largura_miniatura) and empty($altura_miniatura)){\r\n\t\t\t$altura_miniatura = round(($largura_miniatura / $largura_original) * $altura_original);\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$largura_miniatura = $largura_original;\r\n\t\t\t$altura_miniatura = $altura_original;\r\n\t\t}\r\n\t\t\r\n\t $imagem_miniatura = imagecreatetruecolor($largura_miniatura, $altura_miniatura);\r\n\t imagecopyresampled($imagem_miniatura, $imagem_original, 0, 0, 0, 0, $largura_miniatura, $altura_miniatura, $largura_original, $altura_original);\r\n\t\t\r\n\t\t/* Cria a miniatura */\r\n\t if($img['type'] == \"image/jpeg\"){\r\n\t\t\timagejpeg($imagem_miniatura, $miniatura);\r\n\t\t}\r\n\t\telse if($img['type'] == \"image/png\"){\r\n\t\t\timagepng($imagem_miniatura, $miniatura);\r\n\t\t}\r\n\t\telse if($img['type'] == \"image/gif\"){\r\n\t\t\timagegif($imagem_miniatura, $miniatura);\r\n\t\t}\r\n\t}", "function resize_img($dir_in, $dir_out, $imedat='defaultname.jpg', $max=500,$new) {\r\n\r\n $img = $dir_in . '/' . $imedat;\r\n $extension = array_pop(explode('.', $imedat));\r\n $fileExt = strtolower(end(explode('.',$imedat)));\r\n $imedat = $new.$fileExt;\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n $image = ImageCreateFromJPEG($img);\r\n break;\r\n \r\n case 'png':\r\n $image = ImageCreateFromPNG($img);\r\n break;\r\n \r\n default:\r\n $image = false;\r\n }\r\n\r\n\r\nif(!$image){\r\n // not valid img stop processing\r\n return false; \r\n}\r\n\r\n $vis = imagesy($image);\r\n $sir = imagesx($image);\r\n\r\n if(($vis < $max) && ($sir < $max)) {\r\n $nvis=$vis; $nsir=$sir;\r\n } else {\r\n if($vis > $sir) { $nvis=$max; $nsir=($sir*$max)/$vis;}\r\n elseif($vis < $sir) { $nvis=($max*$vis)/$sir; $nsir=$max;}\r\n else { $nvis=$max; $nsir=$max;}\r\n }\r\n\r\n $out = ImageCreateTrueColor($nsir,$nvis);\r\n ImageCopyResampled($out, $image, 0, 0, 0, 0, $nsir, $nvis, $sir, $vis);\r\n\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n imageinterlace($out ,1);\r\n ImageJPEG($out, $dir_out . '/' . $imedat, 75);\r\n break;\r\n \r\n case 'png':\r\n ImagePNG($out, $dir_out . '/' . $imedat);\r\n break;\r\n \r\n default:\r\n $out = false;\r\n }\r\n\r\n if(!$out){\r\n return false;\r\n }\r\n \r\nImageDestroy($image);\r\nImageDestroy($out);\r\n\r\nreturn true;\r\n}", "function marcadeagua($img_original, $img_marcadeagua, $img_nueva, $calidad)\n{\n $info_original = getimagesize($img_original);\n $anchura_original = $info_original[0];\n $altura_original = $info_original[1];\n // obtener datos de la \"marca de agua\" \n $info_marcadeagua = getimagesize($img_marcadeagua);\n $anchura_marcadeagua = $info_marcadeagua[0];\n $altura_marcadeagua = $info_marcadeagua[1];\n // calcular la posición donde debe copiarse la \"marca de agua\" en la fotografia \n $horizmargen = ($anchura_original - $anchura_marcadeagua)/2;\n $vertmargen = ($altura_original - $altura_marcadeagua)/2;\n // crear imagen desde el original \n $original = ImageCreateFromJPEG($img_original);\n ImageAlphaBlending($original, true);\n // crear nueva imagen desde la marca de agua \n $marcadeagua = ImageCreateFromPNG($img_marcadeagua);\n // copiar la \"marca de agua\" en la fotografia \n ImageCopy($original, $marcadeagua, $horizmargen, $vertmargen, 0, 0, $anchura_marcadeagua, $altura_marcadeagua);\n // guardar la nueva imagen \n ImageJPEG($original, $img_nueva, $calidad);\n // cerrar las imágenes \n ImageDestroy($original);\n ImageDestroy($marcadeagua);\n}", "function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }", "function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}", "private function generateThumbnailImagick(){\n\t}", "public function drawDimensions() {\n\t\tset_image_header();\n\n\t\t$this->selectTriggers();\n\t\t$this->calcDimentions();\n\n\t\tif (function_exists('imagecolorexactalpha') && function_exists('imagecreatetruecolor')\n\t\t\t\t&& @imagecreatetruecolor(1, 1)\n\t\t) {\n\t\t\t$this->im = imagecreatetruecolor(1, 1);\n\t\t}\n\t\telse {\n\t\t\t$this->im = imagecreate(1, 1);\n\t\t}\n\n\t\t$this->initColors();\n\n\t\timageOut($this->im);\n\t}", "function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}", "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}", "function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }", "protected function processImage()\n {\n // Start from the last scale (bigger image).\n $tier = (count($this->_scaleInfo) - 1);\n $row = 0;\n $ul_y = 0;\n $lr_y = 0;\n\n list($root, $ext) = $this->getRootAndDotExtension($this->_imageFilename);\n\n // Create a row from the original image and process it.\n while ($row * $this->tileSize < $this->_originalHeight) {\n $ul_y = $row * $this->tileSize;\n $lr_y = ($ul_y + $this->tileSize < $this->_originalHeight)\n ? $ul_y + $this->tileSize\n : $this->_originalHeight;\n $saveFilename = $root . '-' . $tier . '-' . $row . '.' . $ext;\n $width = $this->_originalWidth;\n $height = abs($lr_y - $ul_y);\n $crop = [];\n $crop['width'] = $width;\n $crop['height'] = $height;\n $crop['x'] = 0;\n $crop['y'] = $ul_y;\n $this->imageResizeCrop($this->_imageFilename, $saveFilename, [], $crop);\n\n $this->processRowImage($tier, $row);\n ++$row;\n }\n }", "function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }", "function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}", "public function image_reproportion()\n\t{\n\t\tif (($this->width === 0 && $this->height === 0) OR $this->orig_width === 0 OR $this->orig_height === 0\n\t\t\tOR ( ! ctype_digit((string) $this->width) && ! ctype_digit((string) $this->height))\n\t\t\tOR ! ctype_digit((string) $this->orig_width) OR ! ctype_digit((string) $this->orig_height))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Sanitize\n\t\t$this->width = (int) $this->width;\n\t\t$this->height = (int) $this->height;\n\n\t\tif ($this->master_dim !== 'width' && $this->master_dim !== 'height')\n\t\t{\n\t\t\tif ($this->width > 0 && $this->height > 0)\n\t\t\t{\n\t\t\t\t$this->master_dim = ((($this->orig_height/$this->orig_width) - ($this->height/$this->width)) < 0)\n\t\t\t\t\t\t\t? 'width' : 'height';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->master_dim = ($this->height === 0) ? 'width' : 'height';\n\t\t\t}\n\t\t}\n\t\telseif (($this->master_dim === 'width' && $this->width === 0)\n\t\t\tOR ($this->master_dim === 'height' && $this->height === 0))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->master_dim === 'width')\n\t\t{\n\t\t\t$this->height = (int) ceil($this->width*$this->orig_height/$this->orig_width);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width = (int) ceil($this->orig_width*$this->height/$this->orig_height);\n\t\t}\n\t}", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}", "function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }", "function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}", "function resize_image($path, $filename, $maxwidth, $maxheight, $quality=75, $type = \"small_\", $new_path = \"\")\n{\n $filename = DIRECTORY_SEPARATOR.basename($filename);\n $sExtension = substr($filename, (strrpos($filename, \".\") + 1));\n $sExtension = strtolower($sExtension);\n\n // check ton tai thu muc khong\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n // Get new dimensions\n $size = getimagesize($path . $filename);\n $width = $size[0];\n $height = $size[1];\n if($width != 0 && $height !=0)\n {\n if($maxwidth / $width > $maxheight / $height) $percent = $maxheight / $height;\n else $percent = $maxwidth / $width;\n }\n\n $new_width\t= $width * $percent;\n $new_height\t= $height * $percent;\n\n // Resample\n $image_p = imagecreatetruecolor($new_width, $new_height);\n //check extension file for create\n switch($size['mime'])\n {\n case 'image/gif':\n $image = imagecreatefromgif($path . $filename);\n break;\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $image = imagecreatefromjpeg($path . $filename);\n break;\n case 'image/png':\n $image = imagecreatefrompng($path . $filename);\n break;\n }\n //Copy and resize part of an image with resampling\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\n // Output\n // check new_path, nếu new_path tồn tại sẽ save ra đó, thay path = new_path\n if($new_path != \"\")\n {\n $path = $new_path;\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n }\n\n switch($sExtension)\n {\n case \"gif\":\n imagegif($image_p, $path . $type . $filename);\n break;\n case $sExtension == \"jpg\" || $sExtension == \"jpe\" || $sExtension == \"jpeg\":\n imagejpeg($image_p, $path . $type . $filename, $quality);\n break;\n case \"png\":\n imagepng($image_p, $path . $type . $filename);\n break;\n }\n imagedestroy($image_p);\n}", "function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}", "public function image();", "public function image();", "private function resize($width,$height) {\n $newImage = imagecreatetruecolor($width, $height);\n imagealphablending($newImage, false);\n imagesavealpha($newImage, true);\n imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $newImage;\n }", "public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }", "function resize( $width, $height ) \r\n\t{\r\n //\t\t$new_image = imagecreatetruecolor($width, $height);\r\n //\t\t\r\n //\t\t imagesavealpha($new_image, true);\r\n //\t\t $trans_colour = imagecolorallocatealpha($new_image, 255, 255, 255, 256);\r\n //\t\t imagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t header(\"Content-type: image/png\");\r\n //\t\t imagepng($new_image);\r\n //\t\t\t\t\r\n //\t\timagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\r\n //\t\t\r\n //\t\timagefill($new_image, 0, 0, $trans_colour);\r\n //\t\t\r\n //\t\t$this->image = $new_image;\r\n\t\t\r\n\t\t/****************/\r\n\t\t\r\n \t$image_resized = imagecreatetruecolor( $width, $height );\r\n \r\n if ( ($this->type == IMAGETYPE_GIF) || ($this->type == IMAGETYPE_PNG) ) \r\n {\r\n $transparency_index = imagecolortransparent($this->image);\r\n \r\n // If we have a specific transparent color\r\n if ($transparency_index >= 0) \r\n {\r\n // Get the original image's transparent color's RGB values\r\n $transparent_color = imagecolorsforindex($this->image, $transparency_index);\r\n \r\n // Allocate the same color in the new image resource\r\n $transparency_index = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $transparency_index);\r\n \r\n // Set the background color for new image to transparent\r\n imagecolortransparent($image_resized, $transparency_index);\r\n }\r\n elseif ($this->type == IMAGETYPE_PNG) \r\n {\r\n // Always make a transparent background color for PNGs that don't have one allocated already\r\n\r\n // Turn off transparency blending (temporarily)\r\n imagealphablending($image_resized, false);\r\n \r\n // Create a new transparent color for image\r\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\r\n \r\n // Completely fill the background of the new image with allocated color.\r\n imagefill($image_resized, 0, 0, $color);\r\n \r\n // Restore transparency blending\r\n imagesavealpha($image_resized, true);\r\n }\r\n }\r\n\r\n imagecopyresampled( $image_resized, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );\r\n \r\n $this->image = $image_resized;\r\n\t}", "public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function _resizeImageGD2($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD can only handle JPG, PNG & GIF images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\" && $imgobj->_type !== \"gif\") {\r\n return false;\r\n }\r\n if ($imgobj->_type == \"gif\" && !function_exists(\"imagecreatefromgif\")) {\r\n \treturn false;\r\n }\r\n \r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = @imagecreatefromjpeg($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n } else if ($imgobj->_type == \"png\") {\r\n $src_img = @imagecreatefrompng($src_file);\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n \t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n } else {\r\n \t$src_img = @imagecreatefromgif($src_file);\r\n \t$dst_img = imagecreatetruecolor($destWidth,$destHeight);\r\n\t\t\t$img_white = imagecolorallocate($dst_img, 255, 255, 255); // set background to white\r\n\t\t\t$img_return = @imagefill($dst_img, 0, 0, $img_white);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, $destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else if ($imgobj->_type == \"png\") {\r\n imagepng($dst_img, $dest_file);\r\n } else {\r\n \timagegif($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true;\r\n }", "public function apply() {\n\t\t$w = $this->getWidth();\n\t\t$h = $this->getHeight();\n\n\t\timagecopyresampled($this->original->getImage(), $this->getImage(), $this->x, $this->y, 0, 0, $w, $h, $w, $h);\n\t}", "public static function resize(){\n\n}", "private function setDimensions(){\r\n list($width, $height) = getimagesize($this->fileName);\r\n $this->imageDimensions = array('width'=>$width,\r\n 'height'=>$height);\r\n \r\n }", "function UploadSlideshow($nama_file_unik, $folder){\n $file_upload = $folder . $nama_file_unik;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"gb_slideshow\"][\"tmp_name\"], $file_upload);\n \n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = 180;\n $thumb_tinggi = 180;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $nama_file_unik);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "public static function imaggaScale()\n {\n return new CropMode(CropMode::IMAGGA_SCALE);\n }", "function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}", "function resize($width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->get_width(), $this->get_height());\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }", "function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }", "function imgResize($file_ori,$UploadPath,$Resize=1,$imgx=130,$imgy=150,$clean=0,$postFix=\"\") {\n\t\t$dest_filename='';\n\t\t$handle = new upload($file_ori);\n\t\t$img_proper=getimagesize($file_ori['tmp_name']);\n\t\tif ($handle->uploaded) {\n\t\t\tif($img_proper[0]>$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]>$imgx && $img_proper[1]<$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_x = $imgx;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_y = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t} else if($img_proper[0]<$imgx && $img_proper[1]>$imgy && $Resize==1)\t{\n\t\t\t\t$handle->image_y = $imgy;\n\t\t\t\t$handle->image_resize = true;\n\t\t\t\t$handle->image_ratio_x = true;\n\t\t\t\t$handle->dir_auto_create = true;\n\t\t\t\t$handle->dir_auto_chmod = true;\n\t\t\t\t$handle->dir_chmod = 0777;\n\t\t\t}\n\t\t\t$handle->file_name_body_add = $postFix;\n\t\t\t$handle->process($UploadPath);\n\t\t\tif ($handle->processed) {\n\t\t\t\t$dest_filename=$handle->file_dst_name;\n\t\t\t\tif($clean==1)\n\t\t\t\t\t$handle->clean();\n\t\t\t} else\n\t\t\t\t$dest_filename='';\n\t\t}\n\t\treturn $dest_filename;\n\t}", "function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}", "function resize( $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the size of the current image\n\t\t$oldsize = $this->size();\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, 0, 0, $w, $h, $oldsize->w, $oldsize->h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "function createThumbImg($aprox)\n {\n // imagem de origem\n $img_origem= $this->createImg();\n\n // obtm as dimenses da imagem original\n $origem_x= ImagesX($img_origem);\n $origem_y= ImagesY($img_origem);\n \n // obtm as dimenses do thumbnail\n $vetor= $this->getThumbXY($origem_x, $origem_y, $aprox);\n $x= $vetor['x'];\n $y= $vetor['y'];\n \n // cria a imagem do thumbnail\n $img_final = ImageCreateTrueColor($x, $y);\n ImageCopyResampled($img_final, $img_origem, 0, 0, 0, 0, $x+1, $y+1, $origem_x, $origem_y);\n // o arquivo gravado\n if ($this->ext == \"png\")\n imagepng($img_final, $this->destino);\n\t\telseif ($this->ext == \"gif\")\n imagegif($img_final, $this->destino);\n elseif ($this->ext == \"jpg\")\n imagejpeg($img_final, $this->destino);\n\t\t\telseif ($this->ext == \"bmp\")\n imagewbmp($img_final, $this->destino);\n }", "public function image_resize()\n {\n $url = $this->input->get('pic');\n $width = $this->input->get('width');\n $height = $this->input->get('height');\n $bgcolor = $this->input->get('color');\n $type = $this->input->get('type');\n $loc = $this->input->get('loc');\n if (empty($type)) {\n $type = 'fit'; // fit, fill\n }\n if (empty($loc)) {\n $loc = 'Center'; // NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast\n }\n $strict = FALSE;\n if (substr($width, -1) == \"*\" && substr($height, -1) == \"*\") {\n $width = substr($width, 0, -1);\n $height = substr($height, 0, -1);\n $strict = TRUE;\n }\n\n// $bgcolor = (trim($bgcolor) == \"\") ? \"FFFFFF\" : $bgcolor;\n// $props = array(\n// 'picture' => $url,\n// 'resize_width' => $width,\n// 'resize_height' => $height,\n// 'bg_color' => $bgcolor\n// );\n//\n// $this->load->library('Image_resize', $props);\n// $this->skip_template_view();\n\n $dest_folder = APPPATH . 'cache' . DS . 'temp' . DS;\n $this->general->createFolder($dest_folder);\n\n $pic = trim($url);\n $pic = base64_decode($pic);\n $pic = str_replace(\" \", \"%20\", $pic);\n $url = $pic;\n $url = str_replace(\" \", \"%20\", $url);\n $props = array(\n 'picture' => $url,\n 'resize_width' => $width,\n 'resize_height' => $height,\n 'bg_color' => $bgcolor\n );\n $md5_url = md5($url . serialize($props));\n $tmp_path = $tmp_file = $dest_folder . $md5_url;\n\n if (strpos($url, $this->config->item('site_url')) === FALSE && strpos($url, 's3.amazonaws') === FALSE) {\n $this->output->set_status_header(400);\n exit;\n }\n \n if (!is_file($tmp_path)) {\n $image_data = file_get_contents($url);\n if ($image_data == FALSE) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($curl, CURLOPT_TIMEOUT, 600);\n curl_setopt($curl, CURLOPT_COOKIEJAR, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_COOKIEFILE, \"cookie.txt\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n //curl_setopt($curl, CURLOPT_HEADER, TRUE);\n $image_data = curl_exec($curl);\n\n if ($image_data == FALSE) {\n \t\n $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($httpCode != 200) {\n $this->output->set_status_header($httpCode);\n exit;\n }\n }\n curl_close($curl);\n// $headers = parse_response_header($http_response_header);\n// if ($headers['reponse_code'] != 200) {\n// $this->output->set_status_header($headers['reponse_code']);\n// exit;\n// }\n }\n $handle = fopen($tmp_path, 'w+');\n fwrite($handle, $image_data);\n fclose($handle);\n\n $img_info = getimagesize($tmp_path);\n $img_ext = end(explode(\"/\", $img_info['mime']));\n if ($img_ext == 'jpeg' || $img_ext == \"pjpeg\") {\n $img_ext = 'jpg';\n }\n if ($strict == TRUE && $img_info[0] < $width && $img_info[1] < $height) {\n $tmp_file = $tmp_path;\n } else {\n\n $this->load->library('image_lib');\n\n $image_process_tool = $this->config->item('imageprocesstool');\n $config['image_library'] = $image_process_tool;\n if ($image_process_tool == \"imagemagick\") {\n $config['library_path'] = $this->config->item('imagemagickinstalldir');\n }\n// if ($img_ext == \"jpg\") {\n// $png_convert = $this->image_lib->convet_jpg_png($tmp_path, $tmp_path . \".png\", $config['library_path']);\n// if ($png_convert) {\n// unlink($tmp_path);\n// rename($tmp_path . \".png\", $tmp_path);\n// }\n// }\n\n if ($type == 'fill') {\n $img_info = getimagesize($tmp_path);\n $org_width = $img_info[0];\n $org_height = $img_info[1];\n\n $width_ratio = $width / $org_width;\n $height_ratio = $height / $org_height;\n if ($width_ratio > $height_ratio) {\n $resize_width = $org_width * $width_ratio;\n $resize_height = $org_height * $width_ratio;\n } else {\n $resize_width = $org_width * $height_ratio;\n $resize_height = $org_height * $height_ratio;\n }\n\n $crop_width = $width;\n $crop_height = $height;\n\n $width = $resize_width;\n $height = $resize_height;\n }\n\n $config['source_image'] = $tmp_path;\n $config['width'] = $width;\n $config['height'] = $height;\n $config['gravity'] = $loc; //center/West/East\n $config['bgcolor'] = (trim($bgcolor) != \"\") ? trim($bgcolor) : $this->config->item('imageresizebgcolor');\n $this->image_lib->initialize($config);\n $this->image_lib->resize();\n\n if ($type == 'fill') {\n $config['source_image'] = $tmp_path;\n $config['width'] = $crop_width;\n $config['height'] = $crop_height;\n $config['gravity'] = 'center';\n $config['maintain_ratio'] = FALSE;\n\n $this->image_lib->initialize($config);\n $this->image_lib->crop();\n }\n }\n }\n\n $this->image_display($tmp_file);\n }", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }", "function scaleByLength($size)\r\n {\r\n if ($this->img_x >= $this->img_y) {\r\n $new_x = $size;\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n } else {\r\n $new_y = $size;\r\n $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);\r\n }\r\n return $this->_resize($new_x, $new_y);\r\n }", "function resize( $width, $height ) {\n $new_image = imagecreatetruecolor( $width, $height );\n if ( $this->mimetype == 'image/gif' || $this->mimetype == 'image/png' ) {\n $current_transparent = imagecolortransparent( $this->image );\n if ( $current_transparent != -1 ) {\n $transparent_color = imagecolorsforindex( $this->image, $current_transparent );\n $current_transparent = imagecolorallocate( $new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue'] );\n imagefill( $new_image, 0, 0, $current_transparent );\n imagecolortransparent( $new_image, $current_transparent );\n } elseif ( $this->mimetype == 'image/png' ) {\n imagealphablending( $new_image, false );\n $color = imagecolorallocatealpha( $new_image, 0, 0, 0, 127 );\n imagefill( $new_image, 0, 0, $color );\n imagesavealpha( $new_image, true );\n }\n }\n imagecopyresampled( $new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->width, $this->height );\n $this->image = $new_image;\n return $this;\n }", "function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }", "function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}", "public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }", "protected static function GDResize($in_file, $out_file, $format, $switch)\n {\n $source = self::imageCreateFrom($in_file);\n\n $src_width = imagesx($source);\n $src_height = imagesy($source);\n\n $f = explode('x', $format);\n if ($src_width > $src_height) {\n $new_width = $f[0];\n $new_height = $f[1];\n } else {\n $new_width = $f[1];\n $new_height = $f[0];\n }\n\n $destination = imagecreatetruecolor($new_width, $new_height);\n\n $new_dwh = $new_width / $new_height; // stosunek dł/wys.\n $src_dwh = $src_width / $src_height;\n\n if ($src_dwh == $new_dwh)\n { // proporcjonalne\n $fin_x = 0;\n $fin_y = 0;\n $fin_width = $src_width;\n $fin_height = $src_height;\n } elseif ($src_dwh > $new_dwh) { // src bardziej horyzontalny, new bardziej wertykalny\n $fin_height = $src_height;\n $fin_width = ceil($src_height * $new_width / $new_height);\n $fin_x = ($src_width - $fin_width) / 2;\n $fin_y = 0;\n } elseif ($src_dwh < $new_dwh) { // src bardziej wertykalny, new bardziej horyzontalny\n $fin_height = ceil($src_width * $new_height / $new_width);\n $fin_width = $src_width;\n $fin_x = 0;\n $fin_y = ($src_height - $fin_height) / 2;\n }\n\n imagecopyresampled(\n $destination, $source,\n 0, 0, // odkąd smarować na wyniku\n $fin_x, $fin_y, // skąd pobierać źródło\n $new_width, $new_height,\n $fin_width, $fin_height\n );\n\n self::imagePut($destination, $out_file);\n\n imagedestroy($source);\n }", "function image_arr_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $tmp_dest = $destination_folder;\n for ($index = 0; $index < count($source_pic['tmp_name']); $index++) {\n $destination_folder = $tmp_dest;\n $image_info = getimagesize($source_pic['tmp_name'][$index]);\n $source_pic_name = $source_pic['name'][$index];\n $source_pic_tmpname = $source_pic['tmp_name'][$index];\n $source_pic_size = $source_pic['size'][$index];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].gif\";\n $namafile = \"$filename[$index].gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].png\";\n $namafile = \"$filename[$index].png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].bmp\";\n $namafile = \"$filename[$index].bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n $url[] = $namafile;\n }\n return ($url);\n}", "function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}", "public function resizeImage()\n {\n \treturn view('resizeImage');\n }", "function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}", "function img_op( $task = Array() ){\n\t\t\n\t\tif(isset($task[0])){\n\t\t\t\n\t\t\tif($task[0] == \"resize\"){\n\t\t\t\t\n\t\t\t\t$src \t\t= $task[1];\n\t\t\t\t$dest \t\t= $task[2];\n\t\t\t\t$img_geo \t= $task[3];\n\t\t\t\t\n\t\t\t\t$new_dim \t= explode(\"x\", $img_geo);\n\t\t\t\t$max_width \t= intval($new_dim[0]);\n\t\t\t\t$max_height = intval($new_dim[1]);\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$img = new Imagick();\n\t\t\t\t\t$img->readImageBlob(file_get_contents($src));\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\tdie('Error: ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_dim = img_op_max_dimensions($src, $max_width, $max_height);\n\t\t\t\t\n\t\t\t\tif($new_dim){\n\t\t\t\t\t$img->resizeImage($new_dim[0], $new_dim[1], 1, 1, 0);\n\t\t\t\t\t$img = $img->writeImage($dest);\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tif(isset($task[4]))\n\t\t\t\t\t$extra = \" \".$task[4];\n\t\t\t\telse\n\t\t\t\t\t$extra = \"\";\n\t\t\t\t\n\t\t\t\texec(\"convert \".$src.\" -resize \".$img_geo.$extra.\" \".$dest);*/\n\t\t\t}\n\t\t\tif($task[0] == \"crop\"){\n\t\t\t\t\n\t\t\t\t$src \t\t= $task[1];\n\t\t\t\t$dest \t\t= $task[2];\n\t\t\t\t$dimensions\t= $task[3];\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$img = new Imagick();\n\t\t\t\t\t$img->readImageBlob(file_get_contents($src));\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\tdie('Error: ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_dim \t= explode(\"x\", $dimensions);\n\t\t\t\t$new_width \t= intval($new_dim[0]);\n\t\t\t\t$new_height = intval($new_dim[1]);\n\t\t\t\t\n\t\t\t\t$img->cropThumbnailImage($new_width, $new_height);\n\t\t\t\t$img = $img->writeImage($dest);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tif(isset($task[4]))\n\t\t\t\t\t$gravity = $task[4];\n\t\t\t\telse\n\t\t\t\t\t$gravity = \"center\";\n\t\t\t\t\n\t\t\t\tif(isset($task[5]))\n\t\t\t\t\t$extra = \" \".$task[5];\n\t\t\t\telse\n\t\t\t\t\t$extra = \"\";\n\t\t\t\t\n\t\t\t\t//get min_width/height\n\t\t\t\t$dimensions_old = img_op( [\"dimensions\", $src] );\n\t\t\t\t$dimensions_new = explode(\"x\", $dimensions);\n\t\t\t\t$aspect_ratio\t= $dimensions_old[0]/$dimensions_old[1];\n\t\t\t\t\n\t\t\t\tif($dimensions_new[1]*$aspect_ratio >= $dimensions_new[0])\n\t\t\t\t\t$dimensions_resize = \"x\".$dimensions_new[1];\n\t\t\t\telse\n\t\t\t\t\t$dimensions_resize = $dimensions_new[0].\"x\";\n\t\t\t\t\n\t\t\t\texec(\"convert \".$src.\" -gravity \".$gravity.\" -resize \".$dimensions_resize.\"^\".$extra.\" -crop \".$dimensions.\"+0+0 \".$dest);*/\n\t\t\t}\n\t\t\tif($task[0] == \"dimensions\"){\n\t\t\t\t\n\t\t\t\t$src \t\t= $task[1];\n\t\t\t\t\n\t\t\t\t$result = Array();\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\t$img = new Imagick();\n\t\t\t\t\t$img->readImageBlob(file_get_contents($src));\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\tdie('Error: ' . $e->getMessage());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[0] = $img->getImageWidth();\n\t\t\t\t$result[1] = $img->getImageHeight();\n\t\t\t\t\n\t\t\t\t//$result[0] = intval(exec(\"magick identify -ping -format %w \".$src));\n\t\t\t\t//$result[1] = intval(exec(\"magick identify -ping -format %h \".$src));\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\treturn \"missing value\";\n\t}", "public function saveAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $box = $this->getImageBox($size);\n\n if (($size->getWidth() <= $box->getWidth() && $size->getHeight() <= $box->getHeight()) || (!$box->getWidth() && !$box->getHeight())) {\n $widthDiff = abs($size->getWidth() - $box->getWidth()) / $size->getWidth();\n $heightDiff = abs($size->getHeight() - $box->getHeight()) / $size->getHeight();\n if($widthDiff > $heightDiff) {\n $resizeBox = new Box($box->getWidth(), $size->getHeight() * $box->getWidth()/$size->getWidth());\n } else {\n $resizeBox = new Box($size->getWidth() * $box->getHeight()/$size->getHeight(), $box->getHeight());\n }\n $imagine->resize($resizeBox);\n\n // var_dump($width);\n // var_dump($height);\n // die;\n // // $imagine->crop($point, $box);\n // $imagine->save($this->getFilePath());\n // return $this->save(false);\n }\n\n $imagine = $imagine->thumbnail($box, ManipulatorInterface::THUMBNAIL_OUTBOUND);\n $imagine->save($this->getFilePath());\n\n // create empty image to preserve aspect ratio of thumbnail\n // $thumb = Image::getImagine()->create($box, new Color('FFF', 100));\n\n // // calculate points\n // $startX = 0;\n // $startY = 0;\n // if ($size->getWidth() < $box->getWidth()) {\n // $startX = ceil($box->getWidth() - $size->getWidth()) / 2;\n // }\n // if ($size->getHeight() < $box->getHeight()) {\n // $startY = ceil($box->getHeight() - $size->getHeight()) / 2;\n // }\n\n // $thumb->paste($img, new Point($startX, $startY));\n // $thumb->save($this->getFilePath());\n\n return $this->save(false);\n }", "function resizer($image_file_name,$desc_location=null,$new_width=null,$new_height=null,$min_size=null,$show_image=true)\n\t{\n\t list($width, $height) = @getimagesize($image_file_name);\n\t if (empty($width) or empty($height)) {return false;}\n\n\t if (!is_null($min_size)) {\n\t if (is_null($min_size)) {$min_size=$new_width;}\n\t if (is_null($min_size)) {$min_size=$new_height;}\n\n\t if ($width>$height) {$new_height=$min_size;$new_width=null;}\n\t else {$new_width=$min_size;$new_height=null;}\n\t }\n\n\t// $my_new_height=$new_height;\n\t if (is_null($new_height) and !is_null($new_width))\n\t { $my_new_height=round($height*$new_width/$width);$my_new_width=$new_width; }\n\t elseif (!is_null($new_height))\n\t { $my_new_width=round($width*$new_height/$height);$my_new_height=$new_height; }\n\t//echo \"$my_new_width, $my_new_height <br/>\";\n\t $image_resized = imagecreatetruecolor($my_new_width, $my_new_height);\n\t $image = imagecreatefromjpeg($image_file_name);\n\t imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $my_new_width, $my_new_height, $width, $height);\n\n\t //--(BEGIN)-->save , show or send image pointer as result\n\t if (!is_null($desc_location))\n\t imagejpeg($image_resized, $desc_location,100);\n\t elseif ($show_image==true)\n\t imagejpeg($image_resized);\n\t return $image_resized;\n\t //--(END)-->save , show or send image pointer as result\n\t}", "private function generateThumbnailGD(){\n\t\t\n\t}", "function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}", "function UploadGallery($nama_file_unik, $folder){\n $file_upload = $folder . $nama_file_unik;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"gb_gallery\"][\"tmp_name\"], $file_upload);\n \n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = 180;\n $thumb_tinggi = 180;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $nama_file_unik);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "public function resize(IImageInformation $src, $width, $height);", "public function rutaImageFly()\n {\n\n // primero vemos a que galeria pertenece\n $galeria = ORM::factory( 'Galeria', $this->galeria );\n\n return( $galeria->rutaImageFly().$this->imagen );\n\n }", "function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){\n if(!file_exists($image)){\n return false;\n }\n $images = array();\n if($wm !== '' && $wm !== NULL && file_exists($wm)){\n $images['wmimg'] = $wm;\n }\n $images['img'] = $image;\n foreach($images as $key=>$value){\n $type = substr($value,strrpos($value,'.'));\n if(stristr($type,'i')){\n $$key = imagecreatefromgif($value);\n }\n if(stristr($type,'j')){\n $$key = imagecreatefromjpeg($value);\n }\n if(stristr($type,'n')){\n $$key = imagecreatefrompng($value);\n }\n }\n $size = array();\n if($y === '' || $y === NULL){\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n if($size['x'] >= $size['y']){\n $size['dest_x'] = $x;\n $size['dest_y'] = ceil($size['y'] * ($x / $size['x']));\n }else{\n $size['dest_y'] = $x;\n $size['dest_x'] = ceil($size['x'] * ($x / $size['y']));\n }\n $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']);\n }else{\n $dest = imagecreatetrueColor($x,$y);\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n $size['dest_x'] = $x;\n $size['dest_y'] = $y;\n }\n imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']);\n if(isset($wmimg)){\n $size['wmx'] = imageSX($wmimg);\n $size['wmy'] = imageSY($wmimg);\n $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0;\n $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0;\n imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']);\n imagedestroy($wmimg);\n }\n imagedestroy($img);\n return $dest;\n }", "public function size()\n { \n $props = $this->uri->ruri_to_assoc();\n\n if (!isset($props['o'])) exit(0);\n $w = -1;\n $h = -1;\n $m = 0;\n if (isset($props['w'])) $w = $props['w'];\n if (isset($props['h'])) $h = $props['h'];\n if (isset($props['m'])) $m = $props['m'];\n\n $this->img->set_img($props['o']);\n $this->img->set_size($w, $h, $m);\n $this->img->set_square($m);\n $this->img->get_img();\n }", "function resizeGambar1($pathFileTujuan,$lebarGambar1,$folder1,$namaFileTujuan,$prefix){\n $tipe = preg_replace(\"/.*\\.(.*)$/\",\"\\\\1\",$pathFileTujuan);\n //@header(\"Content-type: image/\".$tipe);\n \n list($lebar1,$tinggi1) = getimagesize($pathFileTujuan);\n $lebar_baru1 = $lebarGambar1;\n $tinggi_baru1= ($lebar_baru1/$lebar1) * $tinggi1;\n // proses copy resize\n $gambar_baru1 = imagecreatetruecolor($lebar_baru1, $tinggi_baru1) or die('Problem In Creating image thumb');\n if($tipe=='jpg' || $tipe=='jpeg') {\n $gambar_asli1 = imagecreatefromjpeg($pathFileTujuan) or die('Problem In opening Source JPEG Image');\n } elseif($tipe=='JPG' || $tipe=='JPEG') {\n $gambar_asli1 = imagecreatefromJPEG($pathFileTujuan) or die('Problem In opening Source GIF Image');\n } elseif($tipe=='gif') {\n $gambar_asli1 = imagecreatefromgif($pathFileTujuan) or die('Problem In opening Source GIF Image');\n } elseif($tipe=='png') {\n $gambar_asli1 = imagecreatefrompng($pathFileTujuan) or die('Problem In opening Source PNG Image');\n } elseif($tipe=='PNG') {\n $gambar_asli1 = imagecreatefrompng($pathFileTujuan) or die('Problem In opening Source PNG Image');\n }\n imagecopyresampled($gambar_baru1, $gambar_asli1, 0, 0, 0, 0, $lebar_baru1, $tinggi_baru1, $lebar1, $tinggi1) or die('Problem In resizing');\n \n // Keluaran\n if($tipe=='jpg' || $tipe=='jpeg') {\n imagejpeg($gambar_baru1, $folder1.$prefix.$namaFileTujuan) or die('Problem In saving JPEG');\n } elseif($tipe=='JPG' || $tipe=='JPEG') {\n imageJPEG($gambar_baru1, $folder1.$prefix.$namaFileTujuan) or die('Problem In saving GIF');\n } elseif($tipe=='gif') {\n imagegif($gambar_baru1, $folder1.$prefix.$namaFileTujuan) or die('Problem In saving GIF');\n } elseif($tipe=='png') {\n imagepng($gambar_baru1, $folder1.$prefix.$namaFileTujuan) or die('Problem In saving PNG');\n } elseif($tipe=='PNG') {\n imagepng($gambar_baru1, $folder1.$prefix.$namaFileTujuan) or die('Problem In saving PNG');\n }\n //hapus resource gambar\n}", "function resize($iNewWidth, $iNewHeight)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t$ResizedImageStream = imagecreatetruecolor($iNewWidth, $iNewHeight);\n\t\t\timagecopyresampled($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t} else {\n\t\t\t$ResizedImageStream = imagecreate($iNewWidth, $iNewHeight);\n\t\t\timagecopyresized($ResizedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t}\n\n\t\t$this->ImageStream = $ResizedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}", "function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}", "public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }", "function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}", "private function resizeImage($i,$source)\n\t{\n\t\t$mime = $this->mimeType($source);\n \n\t\t$t = imagecreatetruecolor(8, 8);\n\t\t\n\t\t$source = $this->createImage($source);\n\t\t\n\t\timagecopyresized($t, $source, 0, 0, 0, 0, 8, 8, $mime[0], $mime[1]);\n\t\t\n\t\treturn $t;\n\t}", "public function setOriginalImageWidthHeight() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n /*\n * get original width and height\n */\n $this->__originalImageWidth = imagesx($this->__image);\n $this->__originalImageHeight = imagesy($this->__image);\n \n }\n \n }", "public function createImage2(){\n $this->createCircle(100, 100, 50, 50, 0, 360);\n $this->createCircle(400, 100, 50, 50, 0, 360);\n $this->createCircle(110, 200, 50, 50, 0, 360);\n $this->createCircle(250, 300, 50, 50, 0, 360);\n $this->createCircle(390, 200, 50, 50, 0, 360);\n $this->createLine(125, 100, 375, 100);\n $this->createLine(100, 125, 100, 175);\n $this->createLine(400, 125, 400, 175);\n $this->createLine(125, 220, 225, 300);\n $this->createLine(275, 300, 375, 220);\n $this->generateImage();\n }", "function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}", "function resizeImage($old_image_path, $new_image_path, $max_width, $max_height)\n{\n\n // Get image type\n $image_info = getimagesize($old_image_path);\n $image_type = $image_info[2];\n\n // Set up the function names\n switch ($image_type) {\n case IMAGETYPE_JPEG:\n $image_from_file = 'imagecreatefromjpeg';\n $image_to_file = 'imagejpeg';\n break;\n case IMAGETYPE_GIF:\n $image_from_file = 'imagecreatefromgif';\n $image_to_file = 'imagegif';\n break;\n case IMAGETYPE_PNG:\n $image_from_file = 'imagecreatefrompng';\n $image_to_file = 'imagepng';\n break;\n default:\n return;\n } // ends the swith\n\n // Get the old image and its height and width\n $old_image = $image_from_file($old_image_path);\n $old_width = imagesx($old_image);\n $old_height = imagesy($old_image);\n\n // Calculate height and width ratios\n $width_ratio = $old_width / $max_width;\n $height_ratio = $old_height / $max_height;\n\n // If image is larger than specified ratio, create the new image\n if ($width_ratio > 1 || $height_ratio > 1) {\n\n // Calculate height and width for the new image\n $ratio = max($width_ratio, $height_ratio);\n $new_height = round($old_height / $ratio);\n $new_width = round($old_width / $ratio);\n\n // Create the new image\n $new_image = imagecreatetruecolor($new_width, $new_height);\n\n // Set transparency according to image type\n if ($image_type == IMAGETYPE_GIF) {\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\n imagecolortransparent($new_image, $alpha);\n }\n\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n }\n\n // Copy old image to new image - this resizes the image\n $new_x = 0;\n $new_y = 0;\n $old_x = 0;\n $old_y = 0;\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\n\n // Write the new image to a new file\n $image_to_file($new_image, $new_image_path);\n // Free any memory associated with the new image\n imagedestroy($new_image);\n } else {\n // Write the old image to a new file\n $image_to_file($old_image, $new_image_path);\n }\n // Free any memory associated with the old image\n imagedestroy($old_image);\n}", "function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}", "static function resize($sourcePath, $newWidth = 100, $newHeight = 100)\n {\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n $sourceImage = imagecreatefromjpeg($sourcePath);\n break;\n case IMAGETYPE_PNG :\n $sourceImage = imagecreatefrompng($sourcePath);\n break;\n case IMAGETYPE_GIF :\n $sourceImage = imagecreatefromgif($sourcePath);\n break;\n default:\n return;\n }\n\n // Create the new image (still blank/empty)\n $newImage = imagecreatetruecolor($newWidth, $newHeight);\n imagesetinterpolation($newImage, IMG_SINC);\n\n // Determine the source image Dimensions\n $sourceImageWidth = imagesx($sourceImage);\n $sourceImageHeight = imagesy($sourceImage);\n $sourceImageAspectRatio = $sourceImageWidth / $sourceImageHeight;\n $newImageAspectRatio = $newWidth / $newHeight;\n\n // Determine parameters and copy part of the source image into the new image\n if ($newImageAspectRatio >= $sourceImageAspectRatio) { // width is the limiting factor for the source image\n $src_x = 0;\n $src_w = $sourceImageWidth;\n $src_h = $src_w / $newImageAspectRatio;\n $src_y = ($sourceImageHeight - $src_h) / 2;\n } else { // height of source image is limiting factor\n $src_y = 0;\n $src_h = $sourceImageHeight;\n $src_w = $src_h * $newImageAspectRatio;\n $src_x = ($sourceImageWidth - $src_w) / 2;\n }\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, $src_x, $src_y, $newWidth, $newHeight, $src_w, $src_h);\n\n // Save new image to destination path\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n imagejpeg($newImage, $sourcePath, 100);\n break;\n case IMAGETYPE_PNG :\n imagepng($newImage, $sourcePath);\n break;\n case IMAGETYPE_GIF :\n imagegif($newImage, $sourcePath);\n break;\n }\n\n // Remove image resources to reallocate space\n imagedestroy($sourceImage);\n imagedestroy($newImage);\n }", "function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}", "function scale_image($arg)\n\t{\n\t\t// max_width, max_height, cur_width, cur_height\n\t\t\n\t\t$ret = array(\n\t\t\t\t\t 'img_width' => $arg['cur_width'],\n\t\t\t\t\t 'img_height' => $arg['cur_height']\n\t\t\t\t\t);\n\t\t\n\t\tif ( $arg['cur_width'] > $arg['max_width'] )\n\t\t{\n\t\t\t$ret['img_width'] = $arg['max_width'];\n\t\t\t$ret['img_height'] = ceil( ( $arg['cur_height'] * ( ( $arg['max_width'] * 100 ) / $arg['cur_width'] ) ) / 100 );\n\t\t\t$arg['cur_height'] = $ret['img_height'];\n\t\t\t$arg['cur_width'] = $ret['img_width'];\n\t\t}\n\t\t\n\t\tif ( $arg['cur_height'] > $arg['max_height'] )\n\t\t{\n\t\t\t$ret['img_height'] = $arg['max_height'];\n\t\t\t$ret['img_width'] = ceil( ( $arg['cur_width'] * ( ( $arg['max_height'] * 100 ) / $arg['cur_height'] ) ) / 100 );\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}", "function make_thumb($img_name, $filename, $new_w, $new_h) {\n //get image extension.\n $ext = getExtension($img_name);\n //creates the new image using the appropriate function from gd library\n if (!strcmp(\"jpg\", $ext) || !strcmp(\"jpeg\", $ext))\n $src_img = imagecreatefromjpeg($img_name);\n\n if (!strcmp(\"png\", $ext))\n $src_img = imagecreatefrompng($img_name);\n\n //gets the dimmensions of the image\n $old_x = imageSX($src_img);\n $old_y = imageSY($src_img);\n\n // next we will calculate the new dimmensions for the thumbnail image\n // the next steps will be taken: \n // 1. calculate the ratio by dividing the old dimmensions with the new ones\n // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n // and the height will be calculated so the image ratio will not change\n // 3. otherwise we will use the height ratio for the image\n // as a result, only one of the dimmensions will be from the fixed ones\n $ratio1 = $old_x / $new_w;\n $ratio2 = $old_y / $new_h;\n if ($ratio1 > $ratio2) {\n $thumb_w = $new_w;\n $thumb_h = $old_y / $ratio1;\n } else {\n $thumb_h = $new_h;\n $thumb_w = $old_x / $ratio2;\n }\n\n // we create a new image with the new dimmensions\n $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);\n\n // resize the big image to the new created one\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);\n\n // output the created image to the file. Now we will have the thumbnail into the file named by $filename\n if (!strcmp(\"png\", $ext))\n imagepng($dst_img, $filename);\n else\n imagejpeg($dst_img, $filename);\n\n //destroys source and destination images. \n imagedestroy($dst_img);\n imagedestroy($src_img);\n}", "function playerPortraitCreate ($base, $player)\r\n{\r\n list($width_orig, $height_orig) = getimagesize($base);\r\n list($width_orig2, $height_orig2) = getimagesize($player);\r\n \r\n // Calculando a proporção\r\n $ratio_orig = $width_orig / $height_orig;\r\n $ratio_orig2 = $width_orig2 / $height_orig2;\r\n /// Largura e altura máximos (máximo, pois como é proporcional, o resultado varia)\r\n // No caso da pergunta, basta usar $_GET['width'] e $_GET['height'], ou só\r\n // $_GET['width'] e adaptar a fórmula de proporção abaixo.\r\n $width = 500;\r\n $height = 500;\r\n $width2 = 100;\r\n $height2 = 100;\r\n if ($width / $height > $ratio_orig) {\r\n $width = $height * $ratio_orig;\r\n } else {\r\n $height = $width / $ratio_orig;\r\n }\r\n if ($width2 / $height2 > $ratio_orig2) {\r\n $width2 = $height2 * $ratio_orig2;\r\n } else {\r\n $height2 = $width2 / $ratio_orig2;\r\n }\r\n // O resize propriamente dito. Na verdade, estamos gerando uma nova imagem.\r\n $extension = explode(\".\", $base);\r\n $extension = $extension[count($extension) - 1];\r\n $image_p = imagecreatetruecolor($width, $height);\r\n $image = NULL;\r\n if ($extension == \"jpg\" || $extension == \"jpeg\") {\r\n $image = imagecreatefromjpeg($base);\r\n } elseif ($extension == \"gif\") {\r\n $image = imagecreatefromgif($base);\r\n } elseif ($extension == \"png\") {\r\n $image = imagecreatefrompng($base);\r\n }\r\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\r\n \r\n $image_player = imagecreatetruecolor($width2, $height2);\r\n $marcadagua = imagecreatefromgif($player);\r\n setTransparency($image_player, $marcadagua);\r\n imagecopyresized($image_player, $marcadagua, 0, 0, 0, 0, $width2, $height2, $width_orig2, $height_orig2);\r\n// imagedestroy($marcadagua);\r\n \r\n //pega o tamanho da imagem principal\r\n $dwidth = imagesx($image_p);\r\n $dheight = imagesy($image_p);\r\n \r\n //pega o tamanho da imagem que vai ser centralizada\r\n $mwidth = imagesx($image_player);\r\n $mheight = imagesy($image_player);\r\n //Calcula a x e y posição pra colocar a imagem no centro da outra\r\n //A função round arredonda os valores\r\n $xPos = round(($dwidth - $mwidth) / 2 - 40);\r\n $yPos = round(($dheight - $mheight) / 2 - 40);\r\n imagecopymerge($image_p, $image_player, $xPos, $yPos, 0, 0, $mwidth, $mheight, 100);\r\n// imagedestroy($image_player);\r\n// imagecopyresampled($image_p, $image_player, $xPos, $yPos, 0, 0, $mwidth, $mheight, 100,100);\r\n return $image_p;\r\n}", "function UploadLogo($fupload_name, $folder, $ukuran, $tinggix){\n $file_upload = $folder . $fupload_name;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"fupload\"][\"tmp_name\"], $file_upload);\n\n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = $ukuran;\n $thumb_tinggi = $tinggix;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $fupload_name);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function saveResizedImage($format,$imgData,$resizedFilename){\n \tswitch( $format ){\n\t\tcase 1:\n\t\timagegif($imgData, $resizedFilename);\n\t\tbreak;\n\t\tcase 2:\n\t\timagejpeg($imgData, $resizedFilename, 75);\n\t\tbreak;\n\t\tcase 3:\n\t\timagepng($imgData, $resizedFilename, 1);\n\t}\n}", "function UploadFoto($fupload_name, $folder, $ukuran){\n // File gambar yang di upload\n $file_upload = $folder . $fupload_name;\n\n // Simpan gambar dalam ukuran aslinya\n move_uploaded_file($_FILES[\"fupload\"][\"tmp_name\"], $file_upload);\n\n // Identitas file asli\n $gbr_asli = imagecreatefromjpeg($file_upload);\n $lebar = imageSX($gbr_asli);\n $tinggi \t= imageSY($gbr_asli);\n\n // Simpan dalam versi thumbnail\n $thumb_lebar = $ukuran;\n $thumb_tinggi = $ukuran;\n\n // Proses perubahan dimensi ukuran\n $gbr_thumb = imagecreatetruecolor($thumb_lebar,$thumb_tinggi);\n imagecopyresampled($gbr_thumb, $gbr_asli, 0, 0, 0, 0, $thumb_lebar, $thumb_tinggi, $lebar, $tinggi);\n\n // Simpan gambar thumbnail\n imagejpeg($gbr_thumb,$folder . \"small_\" . $fupload_name);\n \n // Hapus gambar di memori komputer\n imagedestroy($gbr_asli);\n imagedestroy($gbr_thumb);\n}", "function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }" ]
[ "0.7296069", "0.7011974", "0.6970435", "0.68163097", "0.6417263", "0.63404655", "0.6283369", "0.61683387", "0.61020124", "0.6091813", "0.60651046", "0.5964339", "0.5951894", "0.59412974", "0.5865323", "0.585945", "0.5834341", "0.58323467", "0.5821707", "0.58180904", "0.5814759", "0.5810327", "0.5806787", "0.5784548", "0.57814103", "0.57727695", "0.5761657", "0.5756828", "0.57464963", "0.56836575", "0.5675595", "0.5674419", "0.56646806", "0.56644875", "0.5652171", "0.56504995", "0.5649519", "0.56439257", "0.56306374", "0.56306374", "0.56031954", "0.5600679", "0.5598035", "0.5590538", "0.55789906", "0.55540377", "0.55514777", "0.55265534", "0.55248296", "0.55246377", "0.5514626", "0.55127275", "0.5510477", "0.55094564", "0.5496905", "0.54914606", "0.5489668", "0.5479457", "0.5473052", "0.5471071", "0.54695576", "0.54570055", "0.54502636", "0.54310715", "0.5430238", "0.5427234", "0.5426331", "0.54198503", "0.54162383", "0.54159373", "0.5410184", "0.54055554", "0.5403682", "0.53991455", "0.5397304", "0.5395787", "0.539403", "0.5392621", "0.5387833", "0.5382631", "0.5376863", "0.53765225", "0.5368954", "0.5363941", "0.53608483", "0.53587025", "0.53559303", "0.5351651", "0.5349615", "0.5346774", "0.5345057", "0.5341192", "0.5340993", "0.53390396", "0.5337758", "0.5332165", "0.53249377", "0.53227204", "0.53093785", "0.530849", "0.5306036" ]
0.0
-1
Add your code here
public function prePersist() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function custom()\n\t{\n\t}", "function script()\n {\n }", "function use_codepress()\n {\n }", "public function add_short_code()\n {\n add_shortcode('colorYourLife', array($this, 'generate_short_code_content'));\n }", "protected function addCustomJS()\n\t{\n\t\t\n\t}", "public function setup()\n {\n add_action('admin_head', function () {\n echo \"\n <style>\n i.mce-i-raph { font: 400 20px/1 dashicons; background-color: #777; }\n i.mce-i-raph:before { color: #fff!important; }\n </style>\n \";\n });\n add_action('admin_enqueue_scripts', function () {\n wp_localize_script('editor', 'Raph', $this->formData->data());\n });\n add_filter('mce_buttons', function (array $buttons) {\n return array_merge($buttons, ['raphRender']);\n });\n add_filter('mce_external_plugins', function (array $plugins) {\n return array_merge($plugins, ['raphRender' => $this->scriptUrl()]);\n });\n }", "public function preExecute(){\n\n\t\n\t}", "function add_comScore(){ ?>\n\n\t<!-- Begin comScore Inline Tag 1.1302.13 -->\n\t<script type=\"text/javascript\" language=\"JavaScript1.3\" src=\"http://b.scorecardresearch.com/c2/9734177/ct.js\"></script>\n\t<!-- End comScore Inline Tag -->\n\n<?php\n}", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "function addPOSEntry()\n{\n\n}", "public function event()\n\t{\n\t\tif (defined('ADMIN_THEME'))\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_admin', null));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_entry_form', null));\n\t\t}\n\t}", "public function onLoad() {\n \n }", "function run_on_startup(): void {\r\n\r\n\t // Add the current page to GT\r\n\t $this->gtpage = MJKGTAPI::add_page([\r\n\t\t 'id' => 'masthead',\r\n\t\t 'name' => 'Masthead',\r\n\t\t 'source' => self::source,\r\n\t\t 'renderer' => 'MJKMH_Renderer',\r\n\t\t 'settings' => [JKNAPI::settings_page('roles')]\r\n\t ]);\r\n\r\n // Add the ACF filters\r\n\t MJKMH_ACF_Roles::add_filters();\r\n\t MJKMH_ACF_User::add_filters();\r\n\r\n\t // Add the dynamic field loading on the user ACF page\r\n\t global $pagenow;\r\n\t if (($pagenow === 'user-edit.php') || ($pagenow == 'user-new.php')) {\r\n\t \tMJKMH_ACF_User::enqueue_js();\r\n\t }\r\n\r\n }", "public function event()\n {\n $this->CI->type->add_css('textarea_limited', 'textarea_limited.css');\n $this->CI->type->add_js('textarea_limited', 'jquery.textareaCounter.plugin.js');\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "function of_admin_head() {\n\t\tdo_action( 'lcarsframework_custom_scripts' );\n\t}", "function addthis_scripts(){\n ?>\n <script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-546f51e739399f5b\" async=\"async\"></script>\n<?php\n}", "public function inline_custom_data(){}", "function add_support_script_frontend(){\n}", "public function scripts()\n\t\t{\n\t\t}", "public function embed_scripts()\n {\n }", "public function onRun()\n {\n }", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "public function addCustomCodeToHead($code) {\n $this->custom[] = $code;\n }", "public function pre()\n {}", "public function admin_section_code_settings() {\n\t\t\techo '<p>' . esc_html( 'Insert Drip API Token & Account ID bellow' ) . '</p>';\n\t\t}", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function after_load(){\n\n\n }", "protected function script()\n {\n $message = 'Tải lại thành công';\n\n return <<<EOT\n\n$('.grid-refresh').on('click', function() {\n $.pjax.reload('#pjax-container');\n toastr.success('{$message}');\n});\n\nEOT;\n }", "public function run()\n {\n //\n \n }", "protected function add() {\n\t}", "function wck_add_meta(){\n\t\tparent::wck_add_meta();\n\t}", "public function demo()\n {\n // xu ly logic\n }", "protected function addOnSubmitJavaScriptCode() {}", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "function _wp_admin_html_begin()\n {\n }", "public function admin() {\n\t\tinclude_once(\"paywithafacebookpost_admin.php\");\n\t}", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "private function public_hooks()\n\t{\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "public function run()\n\t{\n\t\t//\n\t}", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function _barony_base_file_additions() {\n // Add Font Awesome\n drupal_add_js('//use.fontawesome.com/76948938e9.js', 'external');\n // Add Google Fonts\n drupal_add_css('//fonts.googleapis.com/css?family=Uncial+Antiqua|Metamorphous', array('group' => CSS_THEME));\n\n // Custom additions\n drupal_add_js(drupal_get_path('theme', 'barony_base') . '/js/header-movement.js', array('type' => 'file', 'scope' => 'footer'));\n}", "protected function main()\n /**/\n {\n parent::run();\n }", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "function spreadshop_assortment_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortmentdetail.php');\nadd_filter('wp_head', 'sources');\n}", "public static function add() {\n\t\t\\Layout::addJs('/composer/nnnick/chartjs/dist/Chart.min.js', 10000);\n\t\t\\Layout::addCss('/composer/nnnick/chartjs/dist/Chart.min.css', 10000);\n\t}", "function addWPActions ()\n\t{\n\t\t//Frontend\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontendEnqueues' ), 1 );\n\t\tadd_shortcode( 'imperial-document-upload', array( $this, 'drawDocumentUploadShortcode' ) );\n\t\t\n\n\t}", "public function register_scripts()\n {\n }", "function addtoTranscript()\r\n {\r\n \r\n }", "function wpplusonethis() {\r\n echo \"\\n\".'<!-- Start wpplusonethis -->'.\"\\n\";\r\n echo '<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\"></script>' . \"\\n\"; \r\n echo '<!-- End Of wpplusonethis -->'.\"\\n\";\r\n }", "private function _actions()\n {\n add_action('init', array($this, 'add_short_code'));\n add_action('wp_enqueue_scripts', array($this, 'cyl_enqueue_script'));\n }", "private function add_actions()\n {\n }", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run()\n {\n \n DB::table('abouts')->insert([\n 'texte' => \"voici mon projet\",\n 'src'=> \"bg-masthead.jpg\"\n\n ]\n );\n \n }", "function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}", "function phorum_mod_bbcode_google_javascript_register($data)\n{\n $data[] = array(\n \"module\" => \"bbcode_google\",\n \"source\" => \"file(mods/bbcode_google/bbcode_google.js)\"\n );\n return $data;\n}", "public function includes() {\n\t\t\trequire_once( CHERRY_SITE_SHORTCODES_DIR . 'includes/public/tools.php' );\n\n\t\t\t$this->shortcodes();\n\t\t}", "function on_add_extra()\r\n\t{\r\n\t}", "public function onLoad() {\nglobal $_LW;\nif ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit') { // if on the events editor page\n\t//$_LW->REGISTERED_CSS[]='/path/to/custom/stylesheet.css'; // load in some custom CSS for styling the new field (optional)\n\t$_LW->ENV->input_filter['events_edit']['sample_textarea']=['tags'=>'*', 'wysiwyg'=>1]; // configure the input filter to present the textarea custom field as a WYSIWYG field (omit this line entirely for no HTML allowed, or change \"wysiwyg\" to \"wysiwyg_limited\" for the limited set of toolbar options)\n};\n}", "public function onLoad() {\n\t}", "function __construct() {\n\t\t\n\t//TODO - Insert your code here\n\t}", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "static function init() {\n // For more info see: https://codex.wordpress.org/Roles_and_Capabilities#unfiltered_html\n add_filter('wp_kses_allowed_html', array('CubxRuntime', 'returnAllowedCustomTags'), 10, 2);\n add_filter('tiny_mce_before_init', array('CubxRuntime', 'filterTinyMceBeforeInit'));\n // use this filter to replace all custom tags with dashes before kses filter is applied\n add_filter('content_save_pre', array('CubxRuntime', 'transformCustomTags'), 9);\n // use this to retransform filtered html before saving\n add_filter('content_save_pre', array('CubxRuntime', 'retransformCustomTags'), 11);\n\n // adding the needed cubbles platform scripts\n add_action('wp_enqueue_scripts', array('CubxRuntime', 'addRuntime'));\n // add cif init attribute to crc loader script tag\n add_filter('clean_url', array('CubxRuntime', 'addCifScriptAttr'), 10, 1);\n // make the content get wrapped by a client runtime container (<div cubx-core-crc>[the content]</div>)\n add_filter('the_content', array('CubxRuntime', 'wrapContent'));\n\n // add admin menu\n add_action('admin_menu', array('CubxRuntime', 'addAdminMenu'));\n }", "public function helper()\n\t{\n\t\n\t}", "public function addWidget()\r\n {\r\n }", "function insert_header_code () {\r\n\techo '\r\n\t<script language=\"javascript\" type=\"text/javascript\" src=\"'.get_settings('siteurl').'/wp-content/plugins/sanebull/sbq.js\"></script>\r\n\t<link rel=\"stylesheet\" href=\"'.get_settings('siteurl').'/wp-content/plugins/sanebull/sbq.css\" type=\"text/css\" media=\"screen\" />';\r\n}", "private function __construct()\r\r\n {\r\r\n // TODO - Insert your code here\r\r\n }", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "function poco_before_content() {\n echo <<<HTML\n<div id=\"primary\" class=\"content-area\">\n <main id=\"main\" class=\"site-main\" role=\"main\">\nHTML;\n\n }", "public function run()\r\n {\r\n\r\n }", "public function library()\n\t{\n\t\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function admin_head()\n {\n }", "function bones_ahoy()\n{\n\n //Allow editor style.\n add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css');\n\n // let's get language support going, if you need it\n load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation');\n\n // launching operation cleanup\n add_action('init', 'bones_head_cleanup');\n // A better title\n add_filter('wp_title', 'rw_title', 10, 3);\n // remove WP version from RSS\n add_filter('the_generator', 'bones_rss_version');\n // remove pesky injected css for recent comments widget\n add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1);\n // clean up comment styles in the head\n add_action('wp_head', 'bones_remove_recent_comments_style', 1);\n // clean up gallery output in wp\n add_filter('gallery_style', 'bones_gallery_style');\n\n // enqueue base scripts and styles\n add_action('wp_enqueue_scripts', 'bones_scripts_and_styles', 999);\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // cleaning up random code around images\n add_filter('the_content', 'bones_filter_ptags_on_images');\n // cleaning up excerpt\n add_filter('excerpt_more', 'bones_excerpt_more');\n}", "function before_render_tealium_html() {\r\n \r\n }", "function add_shortcode_interface() {\n\tob_start();\n?>\n\t<a href=\"#TB_inline?width=600&height=700&inlineId=select-shortcode-form\" class=\"thickbox button\" id=\"add-shortcode\" title=\"Add Shortcode\">Add Shortcode</a>\n<?php\n\techo ob_get_clean();\n}", "function run()\r\n {\r\n }", "public function main()\r\n {\r\n \r\n }", "function udesign_html_before() {\r\n do_action('udesign_html_before');\r\n}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function run() {\n $class = \"\";\n if ($this->style != \"basic\") {\n if ($this->gradient) {\n $class .= \"background_$this->gradient color_$this->gradient\";\n \n }\n if ($this->roundStyle) {\n $class .= \" $this->roundStyle\";\n }\n if ($this->displayShadow && $this->shadowDirection ) {\n $class .= \" shadow_$this->shadowDirection\";\n }\n }\n \n echo CHtml::closeTag(\"div\");\n $script = \"\n $('#$this->id').find('.question').addClass( '$class' );\n $('#$this->id').faq({\n expandIconClass : '$this->expandIconClass',\n collapseIconClass : '$this->collapseIconClass'\n });\n \";\n Yii::app()->getClientScript()->registerScript($this->id, $script);\n }", "public function addCustomField()\r\n {\r\n $data['field'] = array('custom_field_id' => '', 'label' => '', 'value' => '');\r\n echo $this->load->view('admin/jobs/custom-field', $data, TRUE);\r\n }", "function wpcr_add_base_js() {\n\t$options = get_option('wpcr_options');\n\t//wpcr_load_api($options['facebook_apikey']);\n}", "function setup() {\n\n\t/* Disable the admin bar */\n\t// show_admin_bar(false);\n\n\t/* Enable post thumbnails (featured images) */\n\t// add_theme_support('post-thumbnails');\n\n\t/* image sizes */\n\t// add_image_size( 'name', 240, 240, array('center', 'top') );\n\n\t/* Nav Menus */\n\t// register_nav_menus( array(\n\t// \t'main' => 'Main Nav',\n\t// \t'footer_1' => 'Footer - Col 1',\n\t// \t'footer_2' => 'Footer - Col 2',\n\t// \t'footer_3' => 'Footer - Col 3'\n\t// ) );\n\n}", "function plugin_post_new_scripts() {\r\n\t// Register & enqueue our admin.js file along with its dependancies\r\n\t\t\twp_register_script('framework', $this->plugin_url .'framework.js', array('jquery','media-upload','thickbox','editor'));\r\n\t\t\twp_enqueue_script('framework');\r\n\t\t\twp_enqueue_script('farbtastic'); \r\n\t\t\twp_enqueue_script('suggest'); // Allow Jquery Chosen\r\n\t\t\t\r\n\t\t}", "public function run() {\n }", "public function before_run() {}", "function wp_add_inline_script($handle, $data, $position = 'after')\n {\n }", "public function before_run(){}", "public function main()\n\t{\n\t}", "public function run()\n {\n DB::table('contents')->insert([\n 'name' => 'お名前',\n 'gender' => '性別',\n 'email' => 'メールアドレス',\n 'postal' => '郵便番号',\n 'adress' => '住所',\n 'billding' => '建物',\n 'contents' => 'お問い合わせ内容',\n ]);//\n }", "public function add_shortcode_content(){\n\n //turn on output buffering to capture script output\n ob_start();\n\n $this->enqueue_frontend();\n $this->timepicker_style();\n\n //include the specified file\n require_once(\"$this->plugin_path/page-templates/questionnaire-template.php\");\n\n //assign the file output to $content variable and clean buffer\n $content = ob_get_clean();\n //return the $content\n //return is important for the output to appear at the correct position\n return $content; \n }" ]
[ "0.6100715", "0.6061334", "0.6020178", "0.58575314", "0.5849049", "0.5683733", "0.5681454", "0.5674236", "0.564153", "0.5633695", "0.56247514", "0.5603149", "0.5592025", "0.5583759", "0.55766463", "0.55766463", "0.55766463", "0.5547106", "0.5538133", "0.55381036", "0.5525829", "0.5524825", "0.5512648", "0.549201", "0.5488231", "0.54842585", "0.5475858", "0.54724616", "0.5469133", "0.543333", "0.5430643", "0.54279965", "0.5427527", "0.5427392", "0.54257953", "0.5423334", "0.54208595", "0.5419772", "0.54175353", "0.54175353", "0.5416943", "0.54126775", "0.54096043", "0.54096043", "0.5405655", "0.53930914", "0.5390885", "0.53895086", "0.53789866", "0.53705996", "0.53655064", "0.53473914", "0.5346792", "0.5346479", "0.53428525", "0.53427017", "0.5340674", "0.5338147", "0.53316563", "0.5330319", "0.53122807", "0.5309871", "0.5308195", "0.530568", "0.530273", "0.5298576", "0.5296202", "0.52956426", "0.5291072", "0.52908355", "0.5288954", "0.5275311", "0.52718574", "0.5270477", "0.5269355", "0.526601", "0.526601", "0.5258304", "0.5255549", "0.5255352", "0.52551705", "0.5253866", "0.52536076", "0.5253407", "0.525306", "0.525218", "0.52497137", "0.52493185", "0.52483815", "0.5239427", "0.5238691", "0.5238621", "0.5232467", "0.5229705", "0.52282774", "0.5226443", "0.52263325", "0.5223484", "0.5223064", "0.52173024", "0.5215421" ]
0.0
-1
Add your code here
public function preUpdate() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function custom()\n\t{\n\t}", "function script()\n {\n }", "function use_codepress()\n {\n }", "public function add_short_code()\n {\n add_shortcode('colorYourLife', array($this, 'generate_short_code_content'));\n }", "protected function addCustomJS()\n\t{\n\t\t\n\t}", "public function setup()\n {\n add_action('admin_head', function () {\n echo \"\n <style>\n i.mce-i-raph { font: 400 20px/1 dashicons; background-color: #777; }\n i.mce-i-raph:before { color: #fff!important; }\n </style>\n \";\n });\n add_action('admin_enqueue_scripts', function () {\n wp_localize_script('editor', 'Raph', $this->formData->data());\n });\n add_filter('mce_buttons', function (array $buttons) {\n return array_merge($buttons, ['raphRender']);\n });\n add_filter('mce_external_plugins', function (array $plugins) {\n return array_merge($plugins, ['raphRender' => $this->scriptUrl()]);\n });\n }", "public function preExecute(){\n\n\t\n\t}", "function add_comScore(){ ?>\n\n\t<!-- Begin comScore Inline Tag 1.1302.13 -->\n\t<script type=\"text/javascript\" language=\"JavaScript1.3\" src=\"http://b.scorecardresearch.com/c2/9734177/ct.js\"></script>\n\t<!-- End comScore Inline Tag -->\n\n<?php\n}", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "function addPOSEntry()\n{\n\n}", "public function event()\n\t{\n\t\tif (defined('ADMIN_THEME'))\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_admin', null));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->type->add_misc($this->CI->type->load_view('codemirror', 'codemirror_entry_form', null));\n\t\t}\n\t}", "public function onLoad() {\n \n }", "function run_on_startup(): void {\r\n\r\n\t // Add the current page to GT\r\n\t $this->gtpage = MJKGTAPI::add_page([\r\n\t\t 'id' => 'masthead',\r\n\t\t 'name' => 'Masthead',\r\n\t\t 'source' => self::source,\r\n\t\t 'renderer' => 'MJKMH_Renderer',\r\n\t\t 'settings' => [JKNAPI::settings_page('roles')]\r\n\t ]);\r\n\r\n // Add the ACF filters\r\n\t MJKMH_ACF_Roles::add_filters();\r\n\t MJKMH_ACF_User::add_filters();\r\n\r\n\t // Add the dynamic field loading on the user ACF page\r\n\t global $pagenow;\r\n\t if (($pagenow === 'user-edit.php') || ($pagenow == 'user-new.php')) {\r\n\t \tMJKMH_ACF_User::enqueue_js();\r\n\t }\r\n\r\n }", "public function event()\n {\n $this->CI->type->add_css('textarea_limited', 'textarea_limited.css');\n $this->CI->type->add_js('textarea_limited', 'jquery.textareaCounter.plugin.js');\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "function of_admin_head() {\n\t\tdo_action( 'lcarsframework_custom_scripts' );\n\t}", "function addthis_scripts(){\n ?>\n <script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-546f51e739399f5b\" async=\"async\"></script>\n<?php\n}", "public function inline_custom_data(){}", "function add_support_script_frontend(){\n}", "public function scripts()\n\t\t{\n\t\t}", "public function embed_scripts()\n {\n }", "public function onRun()\n {\n }", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "public function addCustomCodeToHead($code) {\n $this->custom[] = $code;\n }", "public function pre()\n {}", "public function admin_section_code_settings() {\n\t\t\techo '<p>' . esc_html( 'Insert Drip API Token & Account ID bellow' ) . '</p>';\n\t\t}", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function after_load(){\n\n\n }", "protected function script()\n {\n $message = 'Tải lại thành công';\n\n return <<<EOT\n\n$('.grid-refresh').on('click', function() {\n $.pjax.reload('#pjax-container');\n toastr.success('{$message}');\n});\n\nEOT;\n }", "public function run()\n {\n //\n \n }", "protected function add() {\n\t}", "function wck_add_meta(){\n\t\tparent::wck_add_meta();\n\t}", "public function demo()\n {\n // xu ly logic\n }", "protected function addOnSubmitJavaScriptCode() {}", "public function add_hooks()\n {\n }", "public function add_hooks()\n {\n }", "function _wp_admin_html_begin()\n {\n }", "public function admin() {\n\t\tinclude_once(\"paywithafacebookpost_admin.php\");\n\t}", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "private function public_hooks()\n\t{\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "public function run()\n\t{\n\t\t//\n\t}", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function _barony_base_file_additions() {\n // Add Font Awesome\n drupal_add_js('//use.fontawesome.com/76948938e9.js', 'external');\n // Add Google Fonts\n drupal_add_css('//fonts.googleapis.com/css?family=Uncial+Antiqua|Metamorphous', array('group' => CSS_THEME));\n\n // Custom additions\n drupal_add_js(drupal_get_path('theme', 'barony_base') . '/js/header-movement.js', array('type' => 'file', 'scope' => 'footer'));\n}", "protected function main()\n /**/\n {\n parent::run();\n }", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "function spreadshop_assortment_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortmentdetail.php');\nadd_filter('wp_head', 'sources');\n}", "public static function add() {\n\t\t\\Layout::addJs('/composer/nnnick/chartjs/dist/Chart.min.js', 10000);\n\t\t\\Layout::addCss('/composer/nnnick/chartjs/dist/Chart.min.css', 10000);\n\t}", "function addWPActions ()\n\t{\n\t\t//Frontend\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'frontendEnqueues' ), 1 );\n\t\tadd_shortcode( 'imperial-document-upload', array( $this, 'drawDocumentUploadShortcode' ) );\n\t\t\n\n\t}", "public function register_scripts()\n {\n }", "function addtoTranscript()\r\n {\r\n \r\n }", "function wpplusonethis() {\r\n echo \"\\n\".'<!-- Start wpplusonethis -->'.\"\\n\";\r\n echo '<script type=\"text/javascript\" src=\"https://apis.google.com/js/plusone.js\"></script>' . \"\\n\"; \r\n echo '<!-- End Of wpplusonethis -->'.\"\\n\";\r\n }", "private function _actions()\n {\n add_action('init', array($this, 'add_short_code'));\n add_action('wp_enqueue_scripts', array($this, 'cyl_enqueue_script'));\n }", "private function add_actions()\n {\n }", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run()\n {\n \n DB::table('abouts')->insert([\n 'texte' => \"voici mon projet\",\n 'src'=> \"bg-masthead.jpg\"\n\n ]\n );\n \n }", "function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}", "function phorum_mod_bbcode_google_javascript_register($data)\n{\n $data[] = array(\n \"module\" => \"bbcode_google\",\n \"source\" => \"file(mods/bbcode_google/bbcode_google.js)\"\n );\n return $data;\n}", "public function includes() {\n\t\t\trequire_once( CHERRY_SITE_SHORTCODES_DIR . 'includes/public/tools.php' );\n\n\t\t\t$this->shortcodes();\n\t\t}", "function on_add_extra()\r\n\t{\r\n\t}", "public function onLoad() {\nglobal $_LW;\nif ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit') { // if on the events editor page\n\t//$_LW->REGISTERED_CSS[]='/path/to/custom/stylesheet.css'; // load in some custom CSS for styling the new field (optional)\n\t$_LW->ENV->input_filter['events_edit']['sample_textarea']=['tags'=>'*', 'wysiwyg'=>1]; // configure the input filter to present the textarea custom field as a WYSIWYG field (omit this line entirely for no HTML allowed, or change \"wysiwyg\" to \"wysiwyg_limited\" for the limited set of toolbar options)\n};\n}", "public function onLoad() {\n\t}", "function __construct() {\n\t\t\n\t//TODO - Insert your code here\n\t}", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "static function init() {\n // For more info see: https://codex.wordpress.org/Roles_and_Capabilities#unfiltered_html\n add_filter('wp_kses_allowed_html', array('CubxRuntime', 'returnAllowedCustomTags'), 10, 2);\n add_filter('tiny_mce_before_init', array('CubxRuntime', 'filterTinyMceBeforeInit'));\n // use this filter to replace all custom tags with dashes before kses filter is applied\n add_filter('content_save_pre', array('CubxRuntime', 'transformCustomTags'), 9);\n // use this to retransform filtered html before saving\n add_filter('content_save_pre', array('CubxRuntime', 'retransformCustomTags'), 11);\n\n // adding the needed cubbles platform scripts\n add_action('wp_enqueue_scripts', array('CubxRuntime', 'addRuntime'));\n // add cif init attribute to crc loader script tag\n add_filter('clean_url', array('CubxRuntime', 'addCifScriptAttr'), 10, 1);\n // make the content get wrapped by a client runtime container (<div cubx-core-crc>[the content]</div>)\n add_filter('the_content', array('CubxRuntime', 'wrapContent'));\n\n // add admin menu\n add_action('admin_menu', array('CubxRuntime', 'addAdminMenu'));\n }", "public function helper()\n\t{\n\t\n\t}", "public function addWidget()\r\n {\r\n }", "function insert_header_code () {\r\n\techo '\r\n\t<script language=\"javascript\" type=\"text/javascript\" src=\"'.get_settings('siteurl').'/wp-content/plugins/sanebull/sbq.js\"></script>\r\n\t<link rel=\"stylesheet\" href=\"'.get_settings('siteurl').'/wp-content/plugins/sanebull/sbq.css\" type=\"text/css\" media=\"screen\" />';\r\n}", "private function __construct()\r\r\n {\r\r\n // TODO - Insert your code here\r\r\n }", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "function poco_before_content() {\n echo <<<HTML\n<div id=\"primary\" class=\"content-area\">\n <main id=\"main\" class=\"site-main\" role=\"main\">\nHTML;\n\n }", "public function run()\r\n {\r\n\r\n }", "public function library()\n\t{\n\t\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function admin_head()\n {\n }", "function bones_ahoy()\n{\n\n //Allow editor style.\n add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css');\n\n // let's get language support going, if you need it\n load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation');\n\n // launching operation cleanup\n add_action('init', 'bones_head_cleanup');\n // A better title\n add_filter('wp_title', 'rw_title', 10, 3);\n // remove WP version from RSS\n add_filter('the_generator', 'bones_rss_version');\n // remove pesky injected css for recent comments widget\n add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1);\n // clean up comment styles in the head\n add_action('wp_head', 'bones_remove_recent_comments_style', 1);\n // clean up gallery output in wp\n add_filter('gallery_style', 'bones_gallery_style');\n\n // enqueue base scripts and styles\n add_action('wp_enqueue_scripts', 'bones_scripts_and_styles', 999);\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // cleaning up random code around images\n add_filter('the_content', 'bones_filter_ptags_on_images');\n // cleaning up excerpt\n add_filter('excerpt_more', 'bones_excerpt_more');\n}", "function before_render_tealium_html() {\r\n \r\n }", "function add_shortcode_interface() {\n\tob_start();\n?>\n\t<a href=\"#TB_inline?width=600&height=700&inlineId=select-shortcode-form\" class=\"thickbox button\" id=\"add-shortcode\" title=\"Add Shortcode\">Add Shortcode</a>\n<?php\n\techo ob_get_clean();\n}", "function run()\r\n {\r\n }", "public function main()\r\n {\r\n \r\n }", "function udesign_html_before() {\r\n do_action('udesign_html_before');\r\n}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function run() {\n $class = \"\";\n if ($this->style != \"basic\") {\n if ($this->gradient) {\n $class .= \"background_$this->gradient color_$this->gradient\";\n \n }\n if ($this->roundStyle) {\n $class .= \" $this->roundStyle\";\n }\n if ($this->displayShadow && $this->shadowDirection ) {\n $class .= \" shadow_$this->shadowDirection\";\n }\n }\n \n echo CHtml::closeTag(\"div\");\n $script = \"\n $('#$this->id').find('.question').addClass( '$class' );\n $('#$this->id').faq({\n expandIconClass : '$this->expandIconClass',\n collapseIconClass : '$this->collapseIconClass'\n });\n \";\n Yii::app()->getClientScript()->registerScript($this->id, $script);\n }", "public function addCustomField()\r\n {\r\n $data['field'] = array('custom_field_id' => '', 'label' => '', 'value' => '');\r\n echo $this->load->view('admin/jobs/custom-field', $data, TRUE);\r\n }", "function wpcr_add_base_js() {\n\t$options = get_option('wpcr_options');\n\t//wpcr_load_api($options['facebook_apikey']);\n}", "function setup() {\n\n\t/* Disable the admin bar */\n\t// show_admin_bar(false);\n\n\t/* Enable post thumbnails (featured images) */\n\t// add_theme_support('post-thumbnails');\n\n\t/* image sizes */\n\t// add_image_size( 'name', 240, 240, array('center', 'top') );\n\n\t/* Nav Menus */\n\t// register_nav_menus( array(\n\t// \t'main' => 'Main Nav',\n\t// \t'footer_1' => 'Footer - Col 1',\n\t// \t'footer_2' => 'Footer - Col 2',\n\t// \t'footer_3' => 'Footer - Col 3'\n\t// ) );\n\n}", "function plugin_post_new_scripts() {\r\n\t// Register & enqueue our admin.js file along with its dependancies\r\n\t\t\twp_register_script('framework', $this->plugin_url .'framework.js', array('jquery','media-upload','thickbox','editor'));\r\n\t\t\twp_enqueue_script('framework');\r\n\t\t\twp_enqueue_script('farbtastic'); \r\n\t\t\twp_enqueue_script('suggest'); // Allow Jquery Chosen\r\n\t\t\t\r\n\t\t}", "public function run() {\n }", "public function before_run() {}", "function wp_add_inline_script($handle, $data, $position = 'after')\n {\n }", "public function before_run(){}", "public function main()\n\t{\n\t}", "public function run()\n {\n DB::table('contents')->insert([\n 'name' => 'お名前',\n 'gender' => '性別',\n 'email' => 'メールアドレス',\n 'postal' => '郵便番号',\n 'adress' => '住所',\n 'billding' => '建物',\n 'contents' => 'お問い合わせ内容',\n ]);//\n }", "public function add_shortcode_content(){\n\n //turn on output buffering to capture script output\n ob_start();\n\n $this->enqueue_frontend();\n $this->timepicker_style();\n\n //include the specified file\n require_once(\"$this->plugin_path/page-templates/questionnaire-template.php\");\n\n //assign the file output to $content variable and clean buffer\n $content = ob_get_clean();\n //return the $content\n //return is important for the output to appear at the correct position\n return $content; \n }" ]
[ "0.6100715", "0.6061334", "0.6020178", "0.58575314", "0.5849049", "0.5683733", "0.5681454", "0.5674236", "0.564153", "0.5633695", "0.56247514", "0.5603149", "0.5592025", "0.5583759", "0.55766463", "0.55766463", "0.55766463", "0.5547106", "0.5538133", "0.55381036", "0.5525829", "0.5524825", "0.5512648", "0.549201", "0.5488231", "0.54842585", "0.5475858", "0.54724616", "0.5469133", "0.543333", "0.5430643", "0.54279965", "0.5427527", "0.5427392", "0.54257953", "0.5423334", "0.54208595", "0.5419772", "0.54175353", "0.54175353", "0.5416943", "0.54126775", "0.54096043", "0.54096043", "0.5405655", "0.53930914", "0.5390885", "0.53895086", "0.53789866", "0.53705996", "0.53655064", "0.53473914", "0.5346792", "0.5346479", "0.53428525", "0.53427017", "0.5340674", "0.5338147", "0.53316563", "0.5330319", "0.53122807", "0.5309871", "0.5308195", "0.530568", "0.530273", "0.5298576", "0.5296202", "0.52956426", "0.5291072", "0.52908355", "0.5288954", "0.5275311", "0.52718574", "0.5270477", "0.5269355", "0.526601", "0.526601", "0.5258304", "0.5255549", "0.5255352", "0.52551705", "0.5253866", "0.52536076", "0.5253407", "0.525306", "0.525218", "0.52497137", "0.52493185", "0.52483815", "0.5239427", "0.5238691", "0.5238621", "0.5232467", "0.5229705", "0.52282774", "0.5226443", "0.52263325", "0.5223484", "0.5223064", "0.52173024", "0.5215421" ]
0.0
-1
Test ternary expr ? expr : expr
#[@test] public function ternary() { $this->assertEquals(array(new TernaryNode(array( 'condition' => new VariableNode('i'), 'expression' => new IntegerNode('1'), 'conditional' => new IntegerNode('2'), ))), $this->parse(' $i ? 1 : 2; ')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function convertTernary($template)\n\t{\n\t\tpreg_match_all('(<xf:(?:else)?if is=\"([^\"]+)\"/?>([^<]*))', $template, $m, PREG_SET_ORDER);\n\n\t\t$expr = '';\n\t\tforeach ($m as $i => list($match, $condition, $content))\n\t\t{\n\t\t\tif ($i > 0)\n\t\t\t{\n\t\t\t\t$expr .= '(';\n\t\t\t}\n\n\t\t\t// Make sure compound conditions are in parentheses\n\t\t\tif (preg_match('( (?:and|or) )', $condition))\n\t\t\t{\n\t\t\t\t$condition = '(' . $condition . ')';\n\t\t\t}\n\n\t\t\t$expr .= $condition . ' ? ' . $this->convertMixedContent($content) . ' : ';\n\t\t}\n\t\tif (preg_match('(<xf:else/>\\\\K[^<]*)', $template, $m))\n\t\t{\n\t\t\t$else = $this->convertMixedContent($m[0]);\n\t\t\tif (str_contains($else, ' '))\n\t\t\t{\n\t\t\t\t// Add parentheses if the else clause is more than one token\n\t\t\t\t$else = '(' . $else . ')';\n\t\t\t}\n\t\t\t$expr .= $else;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expr .= \"''\";\n\t\t}\n\t\t$expr .= str_repeat(')', $i);\n\n\t\treturn '{{ ' . $expr . ' }}';\n\t}", "public function testStandardTernaryOperators()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php');\n $this->assertNoViolation($this->_sniffFile, 5);\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit('?');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit(':');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit_operator('?', 'ternary');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit_operator(':', 'ternary');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "#[@test]\n public function withoutExpression() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ?: 2;\n '));\n }", "function prephp_ternary($tokenStream, $iQuestion) {\n if (!($iColon = $tokenStream->skipWhitespace($iQuestion))\n || !$tokenStream[$iColon]->is(T_COLON)) {\n return;\n }\n \n $i = $iQuestion;\n while ($i--) {\n if ($tokenStream[$i]->is(T_CLOSE_ROUND, T_CLOSE_SQUARE, T_CLOSE_CURLY)) {\n $i = $tokenStream->complementaryBracket($i);\n continue;\n }\n \n if ($tokenStream[$i]->is(array(\n // operators with lower precedence\n T_EQUAL,\n T_PLUS_EQUAL,\n T_PLUS_EQUAL,\n T_MUL_EQUAL,\n T_DIV_EQUAL,\n T_CONCAT_EQUAL,\n T_MOD_EQUAL,\n T_AND_EQUAL,\n T_OR_EQUAL,\n T_XOR_EQUAL,\n T_SL_EQUAL,\n T_SR_EQUAL,\n T_DOUBLE_ARROW,\n T_LOGICAL_AND,\n T_LOGICAL_XOR,\n T_LOGICAL_OR,\n T_COMMA,\n \n // other ending tokens\n T_OPEN_ROUND,\n T_OPEN_SQUARE,\n T_OPEN_CURLY,\n T_SEMICOLON,\n ))) {\n break;\n }\n }\n \n if ($i == 0) {\n throw new Prephp_TokenException('ternary not terminated on left side');\n }\n \n // we went one too far\n $iBegin = $tokenStream->skipWhitespace($i);\n \n // put result of ternary condition in a temporary variable\n // and insert it as middle part\n $variable = new Prephp_Token(\n T_VARIABLE,\n uniqid('$prephp_var_')\n );\n \n // insert middle part\n $tokenStream->insert($iColon, $variable);\n \n // insert closing bracket (opening inserted later)\n $tokenStream->insert($iQuestion - 1, ')');\n \n // insert ($variable = ...\n $tokenStream->insert($iBegin, array(\n '(',\n $variable,\n '='\n ));\n }", "private function isElse()\n\t{\n\t\treturn $this->expression=='';\n\t}", "abstract public function getOrElse($else);", "#[@test]\n public function nested() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new BracedExpressionNode(new TernaryNode(array(\n 'condition' => new VariableNode('f'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n )))\n ))), $this->parse('\n $i ?: ($f ? 1 : 2);\n '));\n }", "public function visitConditionalExpression(\n /*IConditionalExpression*/ $node) /*: mixed*/ {\n $cond = $node->getCondition();\n $condition = /*(string)*/$cond->accept($this);\n $value_if_true = /*(string)*/$node->getValueIfTrue()->accept($this);\n $val_if_false = $node->getValueIfFalse();\n $value_if_false = /*(string)*/$val_if_false->accept($this);\n\n if ($this->leftExprNeedsParentheses(\n BinaryOperators::PHP_CONDITIONAL, $cond)) {\n $condition = '('.$condition.')';\n }\n if ($val_if_false instanceof ConditionalExpression) {\n $value_if_false = '('.$value_if_false.')';\n }\n return $condition.' ? '.$value_if_true.' : '.$value_if_false;\n }", "public function getOrElse($dflt)\n {\n return $this->isEmpty() ? $dflt : $this->val;\n }", "function sif($condition,$true_value,$false_value)\n{\n\treturn $condition?$true_value:$false_value;\n}", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "protected function convertTernaries($template)\n\t{\n\t\t$old = $template;\n\t\t$template = preg_replace_callback(\n\t\t\t'(<xf:if is=\"[^\"]+\">[^<]*(?:<xf:else[^>]*?/>[^<]*)*</xf:if>)',\n\t\t\tfunction ($m)\n\t\t\t{\n\t\t\t\treturn $this->convertTernary($m[0]);\n\t\t\t},\n\t\t\t$template\n\t\t);\n\t\tif ($template !== $old)\n\t\t{\n\t\t\t$template = $this->convertTernaries($template);\n\t\t}\n\n\t\treturn $template;\n\t}", "public function process_token($stackPtr)\n {\n $token = $this->tokens[$stackPtr];\n // Check if the condition for the ternary is bracketed.\n $prev = $this->phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, \\true);\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$prev]['code']) {\n if (!isset($this->tokens[$prev]['parenthesis_opener'])) {\n return;\n }\n $opener = $this->tokens[$prev]['parenthesis_opener'];\n $closer = $prev;\n } elseif (isset($token['nested_parenthesis'])) {\n $opener = Parentheses::getLastOpener($this->phpcsFile, $stackPtr);\n $closer = Parentheses::getLastCloser($this->phpcsFile, $stackPtr);\n $next_statement_closer = BCFile::findEndOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_CLOSE_PARENTHESIS, \\T_CLOSE_SQUARE_BRACKET));\n if (\\false !== $next_statement_closer && $next_statement_closer < $closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n $prev_statement_closer = BCFile::findStartOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_OPEN_PARENTHESIS, \\T_OPEN_SQUARE_BRACKET));\n if (\\false !== $prev_statement_closer && $opener < $prev_statement_closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n if ($closer > $stackPtr) {\n $closer = $stackPtr;\n }\n } else {\n // No parenthesis found, can't determine where the conditional part of the ternary starts.\n return;\n }\n $startPos = $opener;\n do {\n $hasAssignment = $this->phpcsFile->findNext($this->assignment_tokens, $startPos + 1, $closer);\n if (\\false === $hasAssignment) {\n return;\n }\n // Examine whether the left side is a variable.\n $hasVariable = \\false;\n $conditionStart = $startPos;\n $altConditionStart = $this->phpcsFile->findPrevious($this->condition_start_tokens, $hasAssignment - 1, $startPos);\n if (\\false !== $altConditionStart) {\n $conditionStart = $altConditionStart;\n }\n for ($i = $hasAssignment; $i > $conditionStart; $i--) {\n if (isset(Tokens::$emptyTokens[$this->tokens[$i]['code']])) {\n continue;\n }\n // If this is a variable or array, we've seen all we need to see.\n if (\\T_VARIABLE === $this->tokens[$i]['code'] || \\T_CLOSE_SQUARE_BRACKET === $this->tokens[$i]['code']) {\n $hasVariable = \\true;\n break;\n }\n // If this is a function call or something, we are OK.\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$i]['code']) {\n break;\n }\n }\n if (\\true === $hasVariable) {\n $this->phpcsFile->addWarning('Variable assignment found within a condition. Did you mean to do a comparison?', $hasAssignment, 'FoundInTernaryCondition');\n }\n $startPos = $hasAssignment;\n } while ($startPos < $closer);\n }", "function ternaryCheckout($number)\n{\n $result = ($number <= 12) ? \"express lane\" :\"regular lane\";\n return $result; \n}", "public function orElse($alternative);", "#[@test]\n public function assignment() {\n $this->assertEquals(array(new AssignmentNode(array(\n 'variable' => new VariableNode('a'),\n 'expression' => new TernaryNode(array(\n 'condition' => new VariableNode('argc'),\n 'expression' => new VariableNode('args0'),\n 'conditional' => new IntegerNode('1')\n )),\n 'op' => '='\n ))), $this->parse('\n $a= $argc ? $args0 : 1;\n '));\n }", "public function getTernaryMethod($testMethod = null, $method = null)\n {\n /**\n * Get a method that return current date-time if $testMethod applied on it return true,\n * else return the result of $method called on it.\n *\n * @param string $testMethod method for the condition.\n * @param string $method method to apply if condition is false.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface\n */\n return static function () use ($testMethod, $method) {\n $date = static::this();\n\n return $date->$testMethod() ? $date : $date->$method();\n };\n }", "public function conditional( $cond, $trueVal, $falseVal ) {\n\t\tif ( is_array( $cond ) ) {\n\t\t\t$cond = $this->makeList( $cond, LIST_AND );\n\t\t}\n\n\t\treturn \" (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) \";\n\t}", "function yy_r144(){$this->_retvalue = '==='; }", "public function isShortTernary(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n if (isset($tokens[$stackPtr]) === false\n || $tokens[$stackPtr]['code'] !== \\T_INLINE_THEN\n ) {\n return false;\n }\n\n $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n if ($nextNonEmpty === false) {\n // Live coding or parse error.\n return false;\n }\n\n if ($tokens[$nextNonEmpty]['code'] === \\T_INLINE_ELSE) {\n return true;\n }\n\n return false;\n }", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "public function expression(){\n try {\n // Sparql11query.g:375:3: ( conditionalOrExpression ) \n // Sparql11query.g:376:3: conditionalOrExpression \n {\n $this->pushFollow(self::$FOLLOW_conditionalOrExpression_in_expression1283);\n $this->conditionalOrExpression();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function pseudoTypeFalse(false $var = false) {}", "function if_else(callable $cond): Closure\n{\n return function (callable $then) use ($cond) {\n return function (callable $else) use ($cond, $then) {\n return function ($value) use ($cond, $then, $else) {\n return $cond($value) ? $then($value) : $else($value);\n };\n };\n };\n}", "protected function evaluateBoolStatement()\n {\n /**\n * If expression contains only 1 math block - return as math expression result,\n * otherwise cast type of result to boolean\n */\n $result = $this->evaluateBoolExpression();\n while ($booleanOp = $this->readChar(true)) {\n switch ($booleanOp) {\n case '|':\n $nextChar = $this->readChar();\n if ($nextChar == '|') {\n if ($result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('||', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n case '&':\n $nextChar = $this->readChar();\n if ($nextChar == '&') {\n if (!$result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('&&', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n // end of argument\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $booleanOp . '\".');\n break;\n }\n }\n return $result;\n }", "#[@test]\n public function boolCast() {\n $this->assertSourcecodeEquals(\n '$s= (bool)$num;',\n $this->emit('$s= (bool)$num;')\n );\n }", "function iif($e, $t, $f){\r\n\t\tif($e){\r\n\t\t\treturn $t;\r\n\t\t}else{\r\n\t\t\treturn $f;\r\n\t\t}\r\n\t}", "function stage_string_to_bool($string)\n{\n return is_bool($string) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string );\n}", "public function getOrElse($default);", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "public function visitConditionalStatement(\n /*IConditionalStatement*/ $node) /*: mixed*/ {\n $condition = /*(string)*/$node->getCondition()->accept($this);\n $this->blockIndent = ' ';\n $true_block = /*(string)*/$node->getTrueBlock()->accept($this);\n $this->blockIndent = ' ';\n $false_block = /*(string)*/$node->getFalseBlock()->accept($this);\n $result = $this->indent.'if ('.$condition.')'.$true_block;\n if ($false_block !== '') {\n $result .= ' else'.$false_block;\n }\n return $result.\"\\n\";\n }", "private function boolArg($value)\n {\n return ($value ? 1 : null);\n }", "function array_if($arr,$op,$val) {\n\t$ret = TRUE;\n\tfor($a=0;$a<count($arr);$a++) {\n\t\t$if = 'if( '.$arr[$a].' '.$op.' '.$val.' ) { return TRUE; } else { return FALSE; }';\n\t\t$if = eval($if);\n\t\tif(!$if && $ret) $ret = FALSE;\n\t}\n\n\treturn $ret;\n}", "protected function evaluateBoolExpression()\n {\n $result = $this->evaluateMathBlock();\n while ($mathOp = $this->readChar(true)) {\n switch ($mathOp) {\n case '+':\n $result->join('+', $this->evaluateMathBlock());\n break;\n case '-': \n $result->join('-', $this->evaluateMathBlock());\n break;\n case '=':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('==', $this->evaluateMathBlock());\n } elseif ($nextChar == '>') {\n $this->unreadChar(2);\n return $result;\n break;\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '!':\n $nextChar = $this->readChar();\n if ($nextChar == '=') {\n $result->join('!=', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '>':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('>=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('>', $this->evaluateMathBlock());\n }\n break;\n case '<':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('<=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('<', $this->evaluateMathBlock());\n }\n break;\n case 'i': // find in set\n $nextChar = $this->readChar(true);\n if ($nextChar == 'n') { \n $result->join('in', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case 'l': // check against regex\n $this->evaluateLikeExpression($result);\n break;\n // Lower lever operators\n case '&': // boolean \"and\" &&\n case '|': // boolean \"or\" ||\n // end of argument or statement\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';': \n // array value parsed\n case ']':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $mathOp . '\".');\n break;\n }\n }\n return $result;\n }", "function yy_r138(){$this->_retvalue = '=='; }", "public function addElseIf(BooleanExpression $expression)\n\t{\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$can_eval = $expression->canEvaluate();\n\n\t\tif ($can_eval)\n\t\t{\n\t\t\t$result = $this->evaluate($expression);\n\n\t\t\t// If not all previous ones have evaluated, then we can't\n\t\t\t// make a determination on a true branch since a previous one may\n\t\t\t// also be true. However, we do know that subsequent ones cannot be\n\t\t\t// reached, so we can remove them. This then becomes the else branch,\n\t\t\t// making it easy to parse on subsequent passes.\n\t\t\tif ( ! $this->all_previous_could_eval && $result == TRUE)\n\t\t\t{\n\t\t\t\t$this->parser->output('{if:else}');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->parser->outputLastAnnotation();\n\t\t\t$this->outputCondition($expression->stringify());\n\t\t}\n\n\t\t$this->setLastCouldEval($can_eval);\n\n\t\treturn $this->shouldAddBody();\n\t}", "private function postfixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // (a ? b : c) op != a ? b : c op in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a bop b)\n // (a bop b) op != a bop b op if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a bop (b) op == a bop b op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // (a uop) op == a uop op in all cases\n return false;\n }\n // let (expr) == (uop a)\n // check if uop (a) op == uop a op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "public function visitConditional(Node $node): UnionType\n {\n $cond_node = $node->children['cond'];\n $cond_truthiness = self::checkCondUnconditionalTruthiness($cond_node);\n // For the shorthand $a ?: $b, the cond node will be the truthy value.\n // Note: an ast node will never be null(can be unset), it will be a const AST node with the name null.\n $true_node = $node->children['true'] ?? $cond_node;\n $false_node = $node->children['false'];\n\n // Rarely, a conditional will always be true or always be false.\n if ($cond_truthiness !== null) {\n // TODO: Add no-op checks in another PR, if they don't already exist for conditional.\n if ($cond_truthiness) {\n // The condition is unconditionally true\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $true_node,\n $this->should_catch_issue_exception\n );\n } else {\n // The condition is unconditionally false\n\n // Add the type for the 'false' side\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n }\n }\n if ($true_node !== $cond_node) {\n // Visit the condition to check for undefined variables.\n UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $cond_node,\n $this->should_catch_issue_exception\n );\n }\n // TODO: emit no-op if $cond_node is a literal, such as `if (2)`\n // - Also note that some things such as `true` and `false` are \\ast\\AST_NAME nodes.\n\n if ($cond_node instanceof Node) {\n $base_context = $this->context;\n // TODO: Use different contexts and merge those, in case there were assignments or assignments by reference in both sides of the conditional?\n // Reuse the BranchScope (sort of unintuitive). The ConditionVisitor returns a clone and doesn't modify the original.\n $base_context_scope = $this->context->getScope();\n if ($base_context_scope instanceof GlobalScope) {\n $base_context = $base_context->withScope(new BranchScope($base_context_scope));\n }\n // Doesn't seem to be necessary to run BlockAnalysisVisitor\n // $base_context = (new BlockAnalysisVisitor($this->code_base, $base_context))->__invoke($cond_node);\n $true_context = (new ConditionVisitor(\n $this->code_base,\n isset($node->children['true']) ? $base_context : $this->context // special case: $c = (($d = foo()) ?: 'fallback')\n ))->__invoke($cond_node);\n $false_context = (new NegatedConditionVisitor(\n $this->code_base,\n $base_context\n ))->__invoke($cond_node);\n\n if (!isset($node->children['true'])) {\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $false_node,\n $this->should_catch_issue_exception\n );\n if ($false_node instanceof Node && BlockExitStatusChecker::willUnconditionallyThrowOrReturn($false_node)) {\n return $true_type->nonFalseyClone();\n }\n\n $true_type_is_empty = $true_type->isEmpty();\n if (!$false_type->isEmpty()) {\n // E.g. `foo() ?: 2` where foo is nullable or possibly false.\n if ($true_type->containsFalsey()) {\n $true_type = $true_type->nonFalseyClone();\n }\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type_is_empty xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }\n } else {\n $true_context = $this->context;\n $false_context = $this->context;\n }\n // Postcondition: This is (cond_expr) ? (true_expr) : (false_expr)\n\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n if ($false_type->isNeverType()) {\n return $true_type;\n }\n if ($true_type->isNeverType()) {\n return $false_type;\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type->isEmpty() xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }", "abstract public function is_correct( $a, $comparison_operator, $b );", "function printyn ($val) {\n\treturn ($val ? 'yes':'no');\n}", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "public function addElse()\n\t{\n\t\t// Don't process if done or we've encountered a condition\n\t\t// that evaluated to TRUE. Even if other ones have not been\n\t\t// evaluated, that one will shortcut our else, so we prune\n\t\t// the else branch.\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ( ! $this->all_previous_could_eval)\n\t\t{\n\t\t\t$this->parser->output('{if:else}');\n\t\t}\n\n\t\t$this->last_result = TRUE;\n\t\t$this->setLastCouldEval(TRUE);\n\n\t\treturn $this->shouldAddBody();\n\t}", "function yy_r139(){$this->_retvalue = '!='; }", "public function whenTrue($truthy_value, callable $callback, callable $default=null);", "function yy_r51(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }", "private function leftExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (x) == (a ? b : c)\n // (a ? b : c) op y != a ? b : c op y in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a op1 b)\n // (a op1 b) op y != a op1 b op y if\n if (BinaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a op1 (b) op y == a op1 b op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n // let (x) == (!a)\n // (!a) op y != !a op y if\n if ($expr->getOperation() == UnaryOperators::PHP_NOT_OP &&\n BinaryOperators::hasPriority(\n $op, BinaryOperators::PHP_MULTIPLY)) {\n return true;\n }\n // check if !(a) op y == !a op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }", "public function testMissingMiddleExpression5dot2()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php', '5.2-5.4');\n $this->assertError($this->_sniffFile, 8,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n $this->assertError($this->_sniffFile, 10,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n }", "function isset_or(&$var, $or = null) {\n return isset($var) ? $var : $or;\n}", "public function isBinaryOperator(int $index): bool\n {\n static $nonArrayOperators = [\n '=' => true,\n '*' => true,\n '/' => true,\n '%' => true,\n '<' => true,\n '>' => true,\n '|' => true,\n '^' => true,\n '.' => true,\n ];\n\n static $potentialUnaryNonArrayOperators = [\n '+' => true,\n '-' => true,\n '&' => true,\n ];\n\n static $arrayOperators;\n\n if (null === $arrayOperators) {\n $arrayOperators = [\n T_AND_EQUAL => true, // &=\n T_BOOLEAN_AND => true, // &&\n T_BOOLEAN_OR => true, // ||\n T_CONCAT_EQUAL => true, // .=\n T_DIV_EQUAL => true, // /=\n T_DOUBLE_ARROW => true, // =>\n T_IS_EQUAL => true, // ==\n T_IS_GREATER_OR_EQUAL => true, // >=\n T_IS_IDENTICAL => true, // ===\n T_IS_NOT_EQUAL => true, // !=, <>\n T_IS_NOT_IDENTICAL => true, // !==\n T_IS_SMALLER_OR_EQUAL => true, // <=\n T_LOGICAL_AND => true, // and\n T_LOGICAL_OR => true, // or\n T_LOGICAL_XOR => true, // xor\n T_MINUS_EQUAL => true, // -=\n T_MOD_EQUAL => true, // %=\n T_MUL_EQUAL => true, // *=\n T_OR_EQUAL => true, // |=\n T_PLUS_EQUAL => true, // +=\n T_POW => true, // **\n T_POW_EQUAL => true, // **=\n T_SL => true, // <<\n T_SL_EQUAL => true, // <<=\n T_SR => true, // >>\n T_SR_EQUAL => true, // >>=\n T_XOR_EQUAL => true, // ^=\n T_SPACESHIP => true, // <=>\n T_COALESCE => true, // ??\n T_COALESCE_EQUAL => true, // ??=\n ];\n }\n\n $tokens = $this->tokens;\n $token = $tokens[$index];\n\n if ($token->isGivenKind([T_INLINE_HTML, T_ENCAPSED_AND_WHITESPACE, CT::T_TYPE_INTERSECTION])) {\n return false;\n }\n\n if (isset($potentialUnaryNonArrayOperators[$token->getContent()])) {\n return !$this->isUnaryPredecessorOperator($index);\n }\n\n if ($token->isArray()) {\n return isset($arrayOperators[$token->getId()]);\n }\n\n if (isset($nonArrayOperators[$token->getContent()])) {\n return true;\n }\n\n return false;\n }", "protected function evaluate($expression)\n\t{\n\t\t$result = (bool) $expression->evaluate();\n\n\t\tif ($result === TRUE)\n\t\t{\n\t\t\t$this->encountered_true_condition = TRUE;\n\t\t}\n\n\t\t$this->last_result = $result;\n\n\t\treturn $result;\n\t}", "private function rightExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($op == BinaryOperators::PHP_ARRAY_ELEMENT) {\n // x[y] == x[(y)]\n return false;\n }\n if ($expr instanceof ConditionalExpression) {\n // let (y) == (a ? b : c)\n // x op (a ? b : c) != x op a ? b : c if\n return $this->rightExprNeedsParentheses(\n $op, $expr->getCondition());\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (y) == (a op1 b)\n // x op (a op1 b) != x op a op1 b if\n if (!BinaryOperators::hasPriority($expr->getOperation(), $op)) {\n return true;\n }\n // check if x op (a) op1 b == x op a op1 b\n return $this->rightExprNeedsParentheses($op, $expr->getExpression1());\n }\n\n // don't worry about unary operations:\n // prefix unaries do not have left operands hence\n // x op (uop a) == x op uop a in all cases.\n // postfix unaries trump binaries that get here hence\n // x op (a uop) == x op a uop in all cases.\n return false;\n }", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "function smarty_function_boolean($params, &$smarty) {\n if($params['b']) {\n return \"<img src='/icons/tick.png' /><span class='hiddenSpan'>Ja</span>\";\n } else {\n return \"<img src='/icons/cross.png' /><span class='hiddenSpan'>Nee</span>\";\n }\n}", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function boolean() {\n //dd($this->lookahead->type);\n if ($this->lookahead->type !== ControlFunctionLexer::BOOLEAN) {\n return null;\n }\n $bool_node = new ControlFunctionParseTree($this->lookahead->type, $this->lookahead->text);\n //dd($bool_node);\n $this->match(ControlFunctionLexer::BOOLEAN);\n return $bool_node;\n }", "public function logicalOperator($operator = null);", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "function converter(&$value, $key){\n if($value === \"true\") {\n $value = TRUE;\n } elseif ($value === \"false\") {\n $value = FALSE;\n }\n if ($key === \"not\") {\n if ($value === \"1\") {\n $value = TRUE;\n }\n if ($value === \"0\") {\n $value = FALSE;\n }\n }\n }", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "function is_logical($x){\n\t//note blank is interpreted as false\n\tif(in_array(strtolower(trim($x)),array(/*true: */'y','yes','1','true','t', /*false: */'n','no','0','false','f','')))return true;\n}", "function bool ($value)\r\n{\r\n\tif ($value === true || $value === false)\r\n\t\treturn $value;\r\n\r\n\treturn $value === 'true' || ($value !== 'false' && !!$value);\r\n}", "static function false($X, $Alt) {\n\t\treturn $X ? $X : $Alt;\n\t}", "function testRuleAppliesToMultilevelIfConditions()\n{\n if (1 || 0) { // not applied\n if (1 == 1 || $foo = 'baz') { // applied\n // ...\n } elseif (1 != array() && 'foo' != 'baz' && $bar = 'baz') { // applied\n // ...\n } elseif (1 % 2 !== !false && $baz = 1 + 1 + 1 - 3) { // applied\n // ...\n if ($foo == 'baz') { // not applied\n // ...\n if (3 - 2 == 3) { // not applied\n // ...\n if (true) { // not applied\n // ...\n if (1) { // not applied\n // ...\n } elseif ($foo = 1) { // applied\n // ...\n } elseif ($foo = 2) { // applied\n // ...\n } elseif (5 % 5 == 0) { // not applied\n // ...\n }\n }\n }\n }\n }\n }\n if (1 == 1 || 1 && 0 and 4 % 2 || ($foo = 1) xor 5 * 4 * 3 * 2 * 1) { // applied\n // ...\n }\n}", "public function testMissingMiddleExpression5dot3()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php', '5.3');\n $this->assertNoViolation($this->_sniffFile, 8,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n $this->assertNoViolation($this->_sniffFile, 10,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n }", "public function parseConditionals($text, $data, $callback)\n {\n // Added by Ivan Tcholakov, 24-JAN-2016.\n $no_value = new Parser_Lex_No_Value;\n //\n\n $this->setupRegex();\n preg_match_all($this->conditionalRegex, $text, $matches, PREG_SET_ORDER);\n\n $this->conditionalData = $data;\n\n /**\n * $matches[][0] = Full Match\n * $matches[][1] = Either 'if', 'unless', 'elseif', 'elseunless'\n * $matches[][2] = Condition\n */\n foreach ($matches as $match) {\n $this->inCondition = true;\n\n $condition = $match[2];\n\n // Extract all literal string in the conditional to make it easier\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n $condition = preg_replace($this->conditionalNotRegex, '$1!$2', $condition);\n\n if (preg_match_all($this->conditionalExistsRegex, $condition, $existsMatches, PREG_SET_ORDER)) {\n foreach ($existsMatches as $m) {\n $exists = 'true';\n // Modified by Ivan Tcholakov, 24-JAN-2016.\n //if ($this->getVariable($m[2], $data, '__doesnt_exist__') === '__doesnt_exist__') {\n if ($this->getVariable($m[2], $data, $no_value) === $no_value) {\n //\n $exists = 'false';\n }\n $condition = $this->createExtraction('__cond_exists', $m[0], $m[1].$exists.$m[3], $condition);\n }\n }\n\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n\n if ($callback) {\n $condition = preg_replace('/\\b(?!\\{\\s*)('.$this->callbackNameRegex.')(?!\\s+.*?\\s*\\})\\b/', '{$1}', $condition);\n $condition = $this->parseCallbackTags($condition, $data, $callback);\n }\n\n // Re-extract the strings that have now been possibly added.\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n\n\n // Re-process for variables, we trick processConditionVar so that it will return null\n $this->inCondition = false;\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n $this->inCondition = true;\n\n // Re-inject any strings we extracted\n $condition = $this->injectExtractions($condition, '__cond_str');\n $condition = $this->injectExtractions($condition, '__cond_exists');\n\n $conditional = '<?php ';\n\n if ($match[1] == 'unless') {\n $conditional .= 'if ( ! ('.$condition.'))';\n } elseif ($match[1] == 'elseunless') {\n $conditional .= 'elseif ( ! ('.$condition.'))';\n } else {\n $conditional .= $match[1].' ('.$condition.')';\n }\n\n $conditional .= ': ?>';\n\n $text = preg_replace('/'.preg_quote($match[0], '/').'/m', addcslashes($conditional, '\\\\$'), $text, 1);\n }\n\n $text = preg_replace($this->conditionalElseRegex, '<?php else: ?>', $text);\n $text = preg_replace($this->conditionalEndRegex, '<?php endif; ?>', $text);\n\n $text = $this->parsePhp($text);\n $this->inCondition = false;\n\n return $text;\n }", "public function isTrue()\n {\n \n return !!$this->value;\n \n }", "function return_if($condition, $value)\n {\n if ($condition) {\n return $value;\n }\n }", "public function parseBoolean($int)\r\n {\r\n if ($int = 1) {\r\n return true;\r\n } else if ($int = 0) {\r\n return false;\r\n } else {\r\n return $int;\r\n }\r\n }", "public function whenFalse($falsy_value, callable $callback, callable $default=null);", "private static function _parse_condition_comparison($params, $operator, &$prepared_values)\n\t{\n\t\tif (count($params) < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[3] ?? null;\n\t\t$val = self::_convert_data($params[2], $type, $prepared_values);\n\t\treturn $operator . ' ' . $val;\n\t}", "public function if_($sql_test){\r\n $this->throwExceptionIfNotSQLTest($sql_test);\r\n return SQLIFFunction::IfTrueThat($sql_test,$this,new SQLNull());\r\n }", "function if_then(callable $predicate): Closure\n{\n return function (callable $then) use ($predicate) {\n if ($predicate()) {\n $then();\n }\n };\n}", "function taptap(mixed $value, callable $callback = null): mixed\n {\n return tap(tap($value, $callback));\n }", "public function testOperators()\n {\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var + some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var + some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') + \\$_o(\\$p, 'some_other_var'))?>\", \n $output\n );\n $output = $parser->parse('${some_var < some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var < some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') < \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var <= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var <= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') <= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var > some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var > some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') > \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var >= some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var >= some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') >= \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var == some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var == some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') == \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var != some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var != some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') != \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${(some_var % some_other_var) == 0}');\n $this->assertEquals(\n \"<?php /* {(some_var % some_other_var) == 0} */ echo htmlentities((\\$_o(\\$p, 'some_var') % \\$_o(\\$p, 'some_other_var')) == 0)?>\", $output\n );\n $output = $parser->parse('${some_var / some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var / some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') / \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var * some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var * some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') * \\$_o(\\$p, 'some_other_var'))?>\", $output\n );\n $output = $parser->parse('${some_var - some_other_var}');\n $this->assertEquals(\n \"<?php /* {some_var - some_other_var} */ echo htmlentities(\\$_o(\\$p, 'some_var') - \\$_o(\\$p, 'some_other_var'))?>\", $output, \"my name\"\n );\n $output = $parser->parse('${(a + b + c) * (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) * (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) * (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) && (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) && (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) && (\\$_o(\\$p, 'd') - 3))?>\", \n $output\n );\n $output = $parser->parse('${(a + b + c) || (d - 3)}');\n $this->assertEquals(\n \"<?php /* {(a + b + c) || (d - 3)} */ echo htmlentities((\\$_o(\\$p, 'a') + \\$_o(\\$p, 'b') + \\$_o(\\$p, 'c')) || (\\$_o(\\$p, 'd') - 3))?>\",\n $output\n );\n $output = $parser->parse('${foo == \\'a\\'}');\n $this->assertEquals(\"<?php /* {foo == 'a'} */ echo htmlentities(\\$_o(\\$p, 'foo') == 'a')?>\", $output);\n $output = $parser->parse('${foo == \"b\"}');\n $this->assertEquals(\"<?php /* {foo == \\\"b\\\"} */ echo htmlentities(\\$_o(\\$p, 'foo') == \\\"b\\\")?>\", $output); \n \n $output = $parser->parse('${(foo == \"b\" ? \"black\" : \"red\")}');\n $this->assertEquals(\n \"<?php /* {(foo == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\")} */ echo htmlentities((\\$_o(\\$p, 'foo') == \\\"b\\\" ? \\\"black\\\" : \\\"red\\\"))?>\", \n $output\n ); \n $output = $parser->parseExpression('director->isLoggedIn() &amp;&amp; director->isSiteAdmin()');\n $this->assertEquals(\n \"\\$_o(\\$p, 'director')->isLoggedIn() && \\$_o(\\$p, 'director')->isSiteAdmin()\", \n $output\n );\n \n\n $parser->registerVariable(null, \"_field\");\n $output = $parser->parse('${_field->class != \\'\\' ? _field->class : \\'\\'}${(_field->error != \\'\\' ? \\' errored\\' : \\'\\')}');\n $this->assertEquals(\n '<?php /* {_field->class != \\'\\' ? _field->class : \\'\\'} */ echo htmlentities($_field->class != \\'\\' ? $_field->class : \\'\\')?><?php /* {(_field->error != \\'\\' ? \\' errored\\' : \\'\\')} */ echo htmlentities(($_field->error != \\'\\' ? \\' errored\\' : \\'\\'))?>',\n $output);\n $parser->unregisterVariable(null, \"_field\");\n \n }", "function to_boolean ($value) {\n\tif (\n\n\t\t// Falsy\n\t\t!$value or\n\n\t\t// Empty\n\t\tempty($value) or\n\n\t\t// Zero or less\n\t\t(is_numeric($value) and strval($value) <= 0) or\n\n\t\t// Keyword\n\t\t(is_string($value) and in_array(trim(strtolower($value)), array('null', 'nul', 'nil', 'false')))\n\n\t) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function aquamin_is_truty_or_zero( $mixed ) {\n\treturn ( !! $mixed || is_int( $mixed ) || is_float( $mixed ) || '0' === $mixed );\n}", "function mm_auto_update_make_bool( $value, $default = true ) {\n\tif ( 'false' === $value ) { $value = false; }\n\tif ( 'true' === $value ) { $value = true; }\n\tif ( true !== $value && false !== $value ) { $value = $default; }\n\treturn $value;\n}", "function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }", "function example67($a, $b, $c, $x, $y) {\n return [\n 1 ? 0 : 1 ? 3 : 0,\n $a ? $b : $c ? $x : $y,\n 1 ? 0 : 1 ?: 0,\n $a ? $b : $c ?: $x,\n $a ?: $b ? $c : $undefined,\n 1 ?: 0 ? 1 : 0,\n\n // These have parentheses, and Phan should not warn\n ($a ? $b : $c) ? $x : $y,\n $a ? $b : ($c ? $x : $y),\n ($a ? $b : $c) ?: $x,\n ($a ?: $b) ? $c : $x,\n // The parsing order doesn't affect the behavior, so Phan should not warn.\n $a ?: $c ?: $x,\n ($a ?: $c) ?: $undefined,\n ];\n}", "protected function getConditional($condition){\n\t\t$condition=(string)$condition;\n\t\tif($condition[0]=='!'){\n\t\t\t//取反\n\t\t\treturn !$this->getConditional(substr($condition,1));\n\t\t}\n\t\tif(false && $this->conditionalMode){\n\t\t\t/*\n\t\t\t * eval模式\n\t\t\t * 删除一些可能被用户操作的危险全局变量/eval和全局变量一起使用是超级危险的\n\t\t\t */\n\t\t\t/*\n\t\t\tif(strpos($condition,'$')!==false){\n\t\t\t\tthrow new \\Exception('为安全起见:条件编译不能包含变量'.$condition);\n\t\t\t}\n\t\t\t//组成php代码|return (1 && 22 || 33);\n\t\t\t$condition=\"return ({$condition});\";\n\t\t\t//$res=@eval($condition);\n\t\t\t//$res=eval($condition);\n\t\t\t*/\n\t\t\t$res=false;\n\t\t\treturn $res;\n\t\t}else{\n\t\t\t/*@var $self \\qingtpl\\Compiler */\n\t\t\t$self=$this;\n\t\t\t/*\n\t\t\t * #安全模式:\n\t\t\t * - 只支持常量:APP_DEBUG\n\t\t\t * - 函数?\n\t\t\t * - 模版变量/模版宏定义\n\t\t\t */\n\t\t\tif(defined($condition)){\n\t\t\t\t//#常量\n\t\t\t\treturn (bool)constant($condition);\n\t\t\t}else if($self->hasConst($condition)){\n\t\t\t\t//#模版宏定义常量\n\t\t\t\treturn (bool)$self->getConst($condition);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public static function tryParseBoolean(&$fld)\n\t{\n\t\t$fld = $fld == 'Y';\n\t\treturn $fld;\n\t}", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\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 }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "public static function trueOrNull($value)\n {\n return ($value == 1) ? 1 : null;\n }", "function bool(): Closure\n{\n return function ($value): bool {\n return (bool)$value;\n };\n}", "function boolval( $val ) {\r\n\t\treturn (bool) $val;\r\n\t}", "function to_boolean($val);", "private function if_expr(&$match) {\r\n\t\r\n\r\n\t\t//if it's IF .. \r\n\t\tif (strtolower(trim($match[1])) == 'if') {\r\n\t\t\r\n\t\t\t$result .= 'if ('; \r\n\t\t\t\r\n\t\t}elseif(strtolower(trim($match[1])) == 'elseif') {\r\n\t\t\r\n\t\t\t$result .= '} elseif('; \r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t///its for loop or just normal if .. [ loop begin with __\r\n\t\tif (strpos($match[2], '__') !== false) {\r\n\t\t\r\n\t\t\t$val = str_replace('__','',$match[2]);\r\n\t\t\t$result .= '$this->value[\\''.trim($val).'\\']'; \r\n\t\t\t\r\n\t\t}else{\r\n\t\t\r\n\t\t\t$result .= '$this->vars[\\''.trim($match[2]).'\\']'; \r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//so , now experssions signs .. \r\n\t\t\r\n\t\tif (!empty($match[3])) {\r\n\t\t\r\n\t\t\t$expr = trim(strtolower($match[3]));\r\n\t\t\t\r\n\t\t\t\tswitch($expr) {\r\n\t\t\t\t\tcase '==':\r\n\t\t\t\t\tcase 'eq':\r\n\t\t\t\t\t$expr_is = '==';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '!=':\r\n\t\t\t\t\tcase '<>':\r\n\t\t\t\t\tcase 'ne':\r\n\t\t\t\t\tcase 'neq':\r\n\t\t\t\t\t$expr_is = '!=';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '<':\r\n\t\t\t\t\tcase 'lt':\r\n\t\t\t\t\t$expr_is = '<';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '<=':\r\n\t\t\t\t\tcase 'le':\r\n\t\t\t\t\tcase 'lte':\r\n\t\t\t\t\t$expr_is = '<=';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '>':\r\n\t\t\t\t\tcase 'gt':\r\n\t\t\t\t\t$expr_is = '>';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '>=':\r\n\t\t\t\t\tcase 'ge':\r\n\t\t\t\t\tcase 'gte':\r\n\t\t\t\t\t$expr_is = '>=';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '&&':\r\n\t\t\t\t\tcase 'and':\r\n\t\t\t\t\t$expr_is = '&&';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '||':\r\n\t\t\t\t\tcase 'or':\r\n\t\t\t\t\t$expr_is = '||';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '!':\r\n\t\t\t\t\tcase 'not':\r\n\t\t\t\t\t$expr_is = '!';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '%':\r\n\t\t\t\t\tcase 'mod':\r\n\t\t\t\t\t$expr_is = '%';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t$expr_is = $expr;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$result .= ' ' . $expr_is . ' '; \r\n\t\t}\r\n\t\t\r\n\t\t//whats match4 .. its something cant change it now .. i will do something good with it later .. \r\n\t\t\r\n\t\t\t\t$result .= $match[4];\r\n\t\t\t\t\r\n\t\t\t\t//some .. additions\r\n\t\t\t\t$result .= '){';\r\n\t\t\r\n\t\r\n\t\t//return it \r\n\t\treturn '<?php '.$result. '?>';\r\n\t}", "public function orNull();", "private function fixTrueFalse(&$value, $key) {\r\n if ($value == 'false') {\r\n \t$value = false;\r\n } elseif ($value == 'true') {\r\n $value = true;\r\n }\r\n }", "function apply_condition($node, $cond){\n\tif(empty($cond)){\n\t\treturn NULL;\n\t}\n\n\t// vytazeni vsech poduzlu, pokud jsou\n\t$left = apply_condition($node, $cond->left);\n\t$right = apply_condition($node, $cond->right);\n\n\tswitch($cond->type){\n\t\tcase \"op\":\n\t\t\tswitch($cond->value){\n\t\t\t\tcase \"<\":\n\t\t\t\tcase \">\":\n\t\t\t\tcase \"=\":\n\t\t\t\tcase \"CONTAINS\":\n\t\t\t\t\t// pro vsechny prvky zleva \n\t\t\t\t\tif($cond->value == '<'){\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\t\t\t\t\t\tif($left < $right)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if($cond->value == '>'){\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\t\t\t\t\t\tif($left > $right)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if($cond->value == '='){\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\t\t\t\t\t\tif($left == $right)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if(preg_match(\"/CONTAINS/\", $cond->value)){\n\t\t\t\t\t\tif(!preg_match(\"/^\\\".*\\\"$/\",$right)){\n\t\t\t\t\t\t\tfwrite(STDERR,\"error - chyba dotazu\\n\");\n\t\t\t\t\t\t\texit(80);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\n\t\t\t\t\t\tif(stripos($left, $right) !== false)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\tcase \"NOT\":\n\t\t\t\t\treturn !$left;\n\t\t\t\tdefault:\n\t\t\t\t\tfwrite(STDERR,\"error - neznamy operator ($cond->value)\\n\");\n\t\t\t\t\texit(80); \n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lit\":\n\t\t\t// jak str tak num musi vratit obsah\n\t\t\treturn $cond->value;\n\t\tcase \"elem\":\n\t\t\t// podle vyhodnoceni typu identifikatoru se ulozi do nasledujicich promennych nazvy\n\t\t\t$elem = NULL;\n\t\t\t$attr = NULL;\n\t\t\t//je to element.atribut\n\t\t\tif(preg_match(\"/^[a-zA-Z_]([a-zA-Z0-9_\\-])*\\.[a-zA-Z_]([a-zA-Z0-9_\\-])*$/\", $cond->value)){\n\t\t\t\t$spl = explode(\".\", $cond->value);\n\t\t\t\t$elem = $spl[0];\n\t\t\t\t$attr = $spl[1];\n\t\t\t}\n\t\t\t//je to element\n\t\t\telse if(preg_match(\"/^[a-zA-Z_]([a-zA-Z0-9_\\-])*$/\", $cond->value)){\n\t\t\t\t$elem = $cond->value;\n\t\t\t}\n\t\t\t//je to atribut \n\t\t\telse if(preg_match(\"/^\\.[a-zA-Z_]([a-zA-Z0-9_\\-])*$/\", $cond->value)){\n\t\t\t\t$attr = substr($cond->value, 1);\n\t\t\t}\n\t\t\t//jinak vracim chybu\n\t\t\telse {\n\t\t\t\tfwrite(STDERR,\"error - nepodporovany element\\n\");\n\t\t\t\texit(80); \n\t\t\t}\n\n\t\t\t// uvnitr $node najit vsechny vyskyty elem.attr\n\t\t\t// vratit vsechny nalezene hodnoty\n\t\t\treturn find($node, $elem, $attr);\n\t\tdefault:\n\t\t\tfwrite(STDERR,\"error - neznamy typ\\n\");\n\t\t\texit(80); \n\t}\n}", "public function testStringWithZeroCastedToBoolGivesFalse() {\n\t\t$this->assertFalse((bool)'0');\n\t}", "function yy_r34()\n {\n $tag = trim(substr($this->yystack[$this->yyidx + - 2]->minor, $this->lex->ldel_length));\n $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, $this->yystack[$this->yyidx + 0]->minor, array('if condition' => $this->yystack[$this->yyidx + - 1]->minor));\n }", "public function conditionalAndExpression(){\n try {\n // Sparql11query.g:389:3: ( valueLogical ( AND valueLogical )* ) \n // Sparql11query.g:390:3: valueLogical ( AND valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1326);\n $this->valueLogical();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:390:16: ( AND valueLogical )* \n //loop49:\n do {\n $alt49=2;\n $LA49_0 = $this->input->LA(1);\n\n if ( ($LA49_0==$this->getToken('AND')) ) {\n $alt49=1;\n }\n\n\n switch ($alt49) {\n \tcase 1 :\n \t // Sparql11query.g:390:17: AND valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1329); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1331);\n \t $this->valueLogical();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop49;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function bool_val(string $key, bool $default = null): ?bool\n{\n $val = env($key, $default);\n\n if ($val === null) {\n return $default;\n }\n\n if ($val === 'false') {\n return false;\n }\n\n if ($val === '[]') {\n return false;\n }\n\n if ($val === '{}') {\n return false;\n }\n\n return boolval($val);\n}", "private function parenthesizeIfLowerThanArrow(\n /*IExpression*/ $expression, /*string*/ $expr) /*: string*/ {\n if ($expression instanceof BinaryOpExpression ||\n $expression instanceof ClosureExpression ||\n $expression instanceof ConditionalExpression ||\n $expression instanceof ListAssignmentExpression ||\n $expression instanceof NewObjectExpression ||\n $expression instanceof UnaryOpExpression) {\n $expr = '('.$expr.')';\n }\n return $expr;\n }" ]
[ "0.64476025", "0.6359436", "0.6320251", "0.6246338", "0.5947816", "0.58526367", "0.5641716", "0.5529516", "0.54381126", "0.5407863", "0.53105885", "0.53084046", "0.5276536", "0.5194583", "0.5068855", "0.5037836", "0.50144833", "0.49884233", "0.49586186", "0.495108", "0.49399614", "0.4870419", "0.48535615", "0.4843907", "0.48215035", "0.47709668", "0.4753007", "0.47347203", "0.46855015", "0.46234578", "0.46069252", "0.46046472", "0.45990264", "0.45922264", "0.4576459", "0.45565042", "0.45514795", "0.45496756", "0.45426944", "0.45253363", "0.45225897", "0.44858202", "0.4481327", "0.44465354", "0.44391", "0.44204485", "0.44084564", "0.4403806", "0.43939596", "0.43853328", "0.43848172", "0.4377893", "0.437162", "0.43361902", "0.4330455", "0.43090555", "0.43078762", "0.42986614", "0.4293206", "0.42918298", "0.426348", "0.4254639", "0.4241767", "0.4230882", "0.4229897", "0.42221832", "0.42204043", "0.42165172", "0.42048687", "0.41963017", "0.41847396", "0.41780305", "0.41715136", "0.41668016", "0.4159417", "0.4158213", "0.41549736", "0.41541895", "0.41507247", "0.4149477", "0.4148531", "0.4148211", "0.41480926", "0.4141941", "0.41298965", "0.41232157", "0.41186213", "0.4117523", "0.41170773", "0.41170162", "0.4116221", "0.4113988", "0.41018504", "0.4098449", "0.40927547", "0.40814555", "0.4080182", "0.4076153", "0.4069337", "0.40665084" ]
0.7442562
0
Test ternary expr ?: expr
#[@test] public function assignment() { $this->assertEquals(array(new AssignmentNode(array( 'variable' => new VariableNode('a'), 'expression' => new TernaryNode(array( 'condition' => new VariableNode('argc'), 'expression' => new VariableNode('args0'), 'conditional' => new IntegerNode('1') )), 'op' => '=' ))), $this->parse(' $a= $argc ? $args0 : 1; ')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#[@test]\n public function ternary() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ? 1 : 2;\n '));\n }", "public function testStandardTernaryOperators()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php');\n $this->assertNoViolation($this->_sniffFile, 5);\n }", "protected function convertTernary($template)\n\t{\n\t\tpreg_match_all('(<xf:(?:else)?if is=\"([^\"]+)\"/?>([^<]*))', $template, $m, PREG_SET_ORDER);\n\n\t\t$expr = '';\n\t\tforeach ($m as $i => list($match, $condition, $content))\n\t\t{\n\t\t\tif ($i > 0)\n\t\t\t{\n\t\t\t\t$expr .= '(';\n\t\t\t}\n\n\t\t\t// Make sure compound conditions are in parentheses\n\t\t\tif (preg_match('( (?:and|or) )', $condition))\n\t\t\t{\n\t\t\t\t$condition = '(' . $condition . ')';\n\t\t\t}\n\n\t\t\t$expr .= $condition . ' ? ' . $this->convertMixedContent($content) . ' : ';\n\t\t}\n\t\tif (preg_match('(<xf:else/>\\\\K[^<]*)', $template, $m))\n\t\t{\n\t\t\t$else = $this->convertMixedContent($m[0]);\n\t\t\tif (str_contains($else, ' '))\n\t\t\t{\n\t\t\t\t// Add parentheses if the else clause is more than one token\n\t\t\t\t$else = '(' . $else . ')';\n\t\t\t}\n\t\t\t$expr .= $else;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expr .= \"''\";\n\t\t}\n\t\t$expr .= str_repeat(')', $i);\n\n\t\treturn '{{ ' . $expr . ' }}';\n\t}", "#[@test]\n public function withoutExpression() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ?: 2;\n '));\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit('?');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit(':');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit_operator('?', 'ternary');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit_operator(':', 'ternary');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "private function isElse()\n\t{\n\t\treturn $this->expression=='';\n\t}", "abstract public function getOrElse($else);", "function prephp_ternary($tokenStream, $iQuestion) {\n if (!($iColon = $tokenStream->skipWhitespace($iQuestion))\n || !$tokenStream[$iColon]->is(T_COLON)) {\n return;\n }\n \n $i = $iQuestion;\n while ($i--) {\n if ($tokenStream[$i]->is(T_CLOSE_ROUND, T_CLOSE_SQUARE, T_CLOSE_CURLY)) {\n $i = $tokenStream->complementaryBracket($i);\n continue;\n }\n \n if ($tokenStream[$i]->is(array(\n // operators with lower precedence\n T_EQUAL,\n T_PLUS_EQUAL,\n T_PLUS_EQUAL,\n T_MUL_EQUAL,\n T_DIV_EQUAL,\n T_CONCAT_EQUAL,\n T_MOD_EQUAL,\n T_AND_EQUAL,\n T_OR_EQUAL,\n T_XOR_EQUAL,\n T_SL_EQUAL,\n T_SR_EQUAL,\n T_DOUBLE_ARROW,\n T_LOGICAL_AND,\n T_LOGICAL_XOR,\n T_LOGICAL_OR,\n T_COMMA,\n \n // other ending tokens\n T_OPEN_ROUND,\n T_OPEN_SQUARE,\n T_OPEN_CURLY,\n T_SEMICOLON,\n ))) {\n break;\n }\n }\n \n if ($i == 0) {\n throw new Prephp_TokenException('ternary not terminated on left side');\n }\n \n // we went one too far\n $iBegin = $tokenStream->skipWhitespace($i);\n \n // put result of ternary condition in a temporary variable\n // and insert it as middle part\n $variable = new Prephp_Token(\n T_VARIABLE,\n uniqid('$prephp_var_')\n );\n \n // insert middle part\n $tokenStream->insert($iColon, $variable);\n \n // insert closing bracket (opening inserted later)\n $tokenStream->insert($iQuestion - 1, ')');\n \n // insert ($variable = ...\n $tokenStream->insert($iBegin, array(\n '(',\n $variable,\n '='\n ));\n }", "public function getOrElse($dflt)\n {\n return $this->isEmpty() ? $dflt : $this->val;\n }", "#[@test]\n public function nested() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new BracedExpressionNode(new TernaryNode(array(\n 'condition' => new VariableNode('f'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n )))\n ))), $this->parse('\n $i ?: ($f ? 1 : 2);\n '));\n }", "public function visitConditionalExpression(\n /*IConditionalExpression*/ $node) /*: mixed*/ {\n $cond = $node->getCondition();\n $condition = /*(string)*/$cond->accept($this);\n $value_if_true = /*(string)*/$node->getValueIfTrue()->accept($this);\n $val_if_false = $node->getValueIfFalse();\n $value_if_false = /*(string)*/$val_if_false->accept($this);\n\n if ($this->leftExprNeedsParentheses(\n BinaryOperators::PHP_CONDITIONAL, $cond)) {\n $condition = '('.$condition.')';\n }\n if ($val_if_false instanceof ConditionalExpression) {\n $value_if_false = '('.$value_if_false.')';\n }\n return $condition.' ? '.$value_if_true.' : '.$value_if_false;\n }", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "public function orElse($alternative);", "function sif($condition,$true_value,$false_value)\n{\n\treturn $condition?$true_value:$false_value;\n}", "function yy_r144(){$this->_retvalue = '==='; }", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "public function expression(){\n try {\n // Sparql11query.g:375:3: ( conditionalOrExpression ) \n // Sparql11query.g:376:3: conditionalOrExpression \n {\n $this->pushFollow(self::$FOLLOW_conditionalOrExpression_in_expression1283);\n $this->conditionalOrExpression();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function orNull();", "function isset_or(&$var, $or = null) {\n return isset($var) ? $var : $or;\n}", "public function getOrElse($default);", "public function process_token($stackPtr)\n {\n $token = $this->tokens[$stackPtr];\n // Check if the condition for the ternary is bracketed.\n $prev = $this->phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, \\true);\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$prev]['code']) {\n if (!isset($this->tokens[$prev]['parenthesis_opener'])) {\n return;\n }\n $opener = $this->tokens[$prev]['parenthesis_opener'];\n $closer = $prev;\n } elseif (isset($token['nested_parenthesis'])) {\n $opener = Parentheses::getLastOpener($this->phpcsFile, $stackPtr);\n $closer = Parentheses::getLastCloser($this->phpcsFile, $stackPtr);\n $next_statement_closer = BCFile::findEndOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_CLOSE_PARENTHESIS, \\T_CLOSE_SQUARE_BRACKET));\n if (\\false !== $next_statement_closer && $next_statement_closer < $closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n $prev_statement_closer = BCFile::findStartOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_OPEN_PARENTHESIS, \\T_OPEN_SQUARE_BRACKET));\n if (\\false !== $prev_statement_closer && $opener < $prev_statement_closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n if ($closer > $stackPtr) {\n $closer = $stackPtr;\n }\n } else {\n // No parenthesis found, can't determine where the conditional part of the ternary starts.\n return;\n }\n $startPos = $opener;\n do {\n $hasAssignment = $this->phpcsFile->findNext($this->assignment_tokens, $startPos + 1, $closer);\n if (\\false === $hasAssignment) {\n return;\n }\n // Examine whether the left side is a variable.\n $hasVariable = \\false;\n $conditionStart = $startPos;\n $altConditionStart = $this->phpcsFile->findPrevious($this->condition_start_tokens, $hasAssignment - 1, $startPos);\n if (\\false !== $altConditionStart) {\n $conditionStart = $altConditionStart;\n }\n for ($i = $hasAssignment; $i > $conditionStart; $i--) {\n if (isset(Tokens::$emptyTokens[$this->tokens[$i]['code']])) {\n continue;\n }\n // If this is a variable or array, we've seen all we need to see.\n if (\\T_VARIABLE === $this->tokens[$i]['code'] || \\T_CLOSE_SQUARE_BRACKET === $this->tokens[$i]['code']) {\n $hasVariable = \\true;\n break;\n }\n // If this is a function call or something, we are OK.\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$i]['code']) {\n break;\n }\n }\n if (\\true === $hasVariable) {\n $this->phpcsFile->addWarning('Variable assignment found within a condition. Did you mean to do a comparison?', $hasAssignment, 'FoundInTernaryCondition');\n }\n $startPos = $hasAssignment;\n } while ($startPos < $closer);\n }", "private function boolArg($value)\n {\n return ($value ? 1 : null);\n }", "function ternaryCheckout($number)\n{\n $result = ($number <= 12) ? \"express lane\" :\"regular lane\";\n return $result; \n}", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "#[@test]\n public function boolCast() {\n $this->assertSourcecodeEquals(\n '$s= (bool)$num;',\n $this->emit('$s= (bool)$num;')\n );\n }", "protected function convertTernaries($template)\n\t{\n\t\t$old = $template;\n\t\t$template = preg_replace_callback(\n\t\t\t'(<xf:if is=\"[^\"]+\">[^<]*(?:<xf:else[^>]*?/>[^<]*)*</xf:if>)',\n\t\t\tfunction ($m)\n\t\t\t{\n\t\t\t\treturn $this->convertTernary($m[0]);\n\t\t\t},\n\t\t\t$template\n\t\t);\n\t\tif ($template !== $old)\n\t\t{\n\t\t\t$template = $this->convertTernaries($template);\n\t\t}\n\n\t\treturn $template;\n\t}", "function pseudoTypeFalse(false $var = false) {}", "public function conditional( $cond, $trueVal, $falseVal ) {\n\t\tif ( is_array( $cond ) ) {\n\t\t\t$cond = $this->makeList( $cond, LIST_AND );\n\t\t}\n\n\t\treturn \" (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) \";\n\t}", "function yy_r138(){$this->_retvalue = '=='; }", "public static function trueOrNull($value)\n {\n return ($value == 1) ? 1 : null;\n }", "protected function evaluateBoolStatement()\n {\n /**\n * If expression contains only 1 math block - return as math expression result,\n * otherwise cast type of result to boolean\n */\n $result = $this->evaluateBoolExpression();\n while ($booleanOp = $this->readChar(true)) {\n switch ($booleanOp) {\n case '|':\n $nextChar = $this->readChar();\n if ($nextChar == '|') {\n if ($result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('||', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n case '&':\n $nextChar = $this->readChar();\n if ($nextChar == '&') {\n if (!$result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('&&', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n // end of argument\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $booleanOp . '\".');\n break;\n }\n }\n return $result;\n }", "function stage_string_to_bool($string)\n{\n return is_bool($string) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string );\n}", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "function if_else(callable $cond): Closure\n{\n return function (callable $then) use ($cond) {\n return function (callable $else) use ($cond, $then) {\n return function ($value) use ($cond, $then, $else) {\n return $cond($value) ? $then($value) : $else($value);\n };\n };\n };\n}", "public function isShortTernary(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n if (isset($tokens[$stackPtr]) === false\n || $tokens[$stackPtr]['code'] !== \\T_INLINE_THEN\n ) {\n return false;\n }\n\n $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n if ($nextNonEmpty === false) {\n // Live coding or parse error.\n return false;\n }\n\n if ($tokens[$nextNonEmpty]['code'] === \\T_INLINE_ELSE) {\n return true;\n }\n\n return false;\n }", "public function whenTrue($truthy_value, callable $callback, callable $default=null);", "public function visitConditional(Node $node): UnionType\n {\n $cond_node = $node->children['cond'];\n $cond_truthiness = self::checkCondUnconditionalTruthiness($cond_node);\n // For the shorthand $a ?: $b, the cond node will be the truthy value.\n // Note: an ast node will never be null(can be unset), it will be a const AST node with the name null.\n $true_node = $node->children['true'] ?? $cond_node;\n $false_node = $node->children['false'];\n\n // Rarely, a conditional will always be true or always be false.\n if ($cond_truthiness !== null) {\n // TODO: Add no-op checks in another PR, if they don't already exist for conditional.\n if ($cond_truthiness) {\n // The condition is unconditionally true\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $true_node,\n $this->should_catch_issue_exception\n );\n } else {\n // The condition is unconditionally false\n\n // Add the type for the 'false' side\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n }\n }\n if ($true_node !== $cond_node) {\n // Visit the condition to check for undefined variables.\n UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $cond_node,\n $this->should_catch_issue_exception\n );\n }\n // TODO: emit no-op if $cond_node is a literal, such as `if (2)`\n // - Also note that some things such as `true` and `false` are \\ast\\AST_NAME nodes.\n\n if ($cond_node instanceof Node) {\n $base_context = $this->context;\n // TODO: Use different contexts and merge those, in case there were assignments or assignments by reference in both sides of the conditional?\n // Reuse the BranchScope (sort of unintuitive). The ConditionVisitor returns a clone and doesn't modify the original.\n $base_context_scope = $this->context->getScope();\n if ($base_context_scope instanceof GlobalScope) {\n $base_context = $base_context->withScope(new BranchScope($base_context_scope));\n }\n // Doesn't seem to be necessary to run BlockAnalysisVisitor\n // $base_context = (new BlockAnalysisVisitor($this->code_base, $base_context))->__invoke($cond_node);\n $true_context = (new ConditionVisitor(\n $this->code_base,\n isset($node->children['true']) ? $base_context : $this->context // special case: $c = (($d = foo()) ?: 'fallback')\n ))->__invoke($cond_node);\n $false_context = (new NegatedConditionVisitor(\n $this->code_base,\n $base_context\n ))->__invoke($cond_node);\n\n if (!isset($node->children['true'])) {\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $false_node,\n $this->should_catch_issue_exception\n );\n if ($false_node instanceof Node && BlockExitStatusChecker::willUnconditionallyThrowOrReturn($false_node)) {\n return $true_type->nonFalseyClone();\n }\n\n $true_type_is_empty = $true_type->isEmpty();\n if (!$false_type->isEmpty()) {\n // E.g. `foo() ?: 2` where foo is nullable or possibly false.\n if ($true_type->containsFalsey()) {\n $true_type = $true_type->nonFalseyClone();\n }\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type_is_empty xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }\n } else {\n $true_context = $this->context;\n $false_context = $this->context;\n }\n // Postcondition: This is (cond_expr) ? (true_expr) : (false_expr)\n\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n if ($false_type->isNeverType()) {\n return $true_type;\n }\n if ($true_type->isNeverType()) {\n return $false_type;\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type->isEmpty() xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }", "function to_boolean ($value) {\n\tif (\n\n\t\t// Falsy\n\t\t!$value or\n\n\t\t// Empty\n\t\tempty($value) or\n\n\t\t// Zero or less\n\t\t(is_numeric($value) and strval($value) <= 0) or\n\n\t\t// Keyword\n\t\t(is_string($value) and in_array(trim(strtolower($value)), array('null', 'nul', 'nil', 'false')))\n\n\t) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function array_if($arr,$op,$val) {\n\t$ret = TRUE;\n\tfor($a=0;$a<count($arr);$a++) {\n\t\t$if = 'if( '.$arr[$a].' '.$op.' '.$val.' ) { return TRUE; } else { return FALSE; }';\n\t\t$if = eval($if);\n\t\tif(!$if && $ret) $ret = FALSE;\n\t}\n\n\treturn $ret;\n}", "function yy_r139(){$this->_retvalue = '!='; }", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\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 }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "function iif($e, $t, $f){\r\n\t\tif($e){\r\n\t\t\treturn $t;\r\n\t\t}else{\r\n\t\t\treturn $f;\r\n\t\t}\r\n\t}", "function aquamin_is_truty_or_zero( $mixed ) {\n\treturn ( !! $mixed || is_int( $mixed ) || is_float( $mixed ) || '0' === $mixed );\n}", "private function postfixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // (a ? b : c) op != a ? b : c op in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a bop b)\n // (a bop b) op != a bop b op if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a bop (b) op == a bop b op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // (a uop) op == a uop op in all cases\n return false;\n }\n // let (expr) == (uop a)\n // check if uop (a) op == uop a op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "abstract public function is_correct( $a, $comparison_operator, $b );", "function printyn ($val) {\n\treturn ($val ? 'yes':'no');\n}", "private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }", "protected function evaluateBoolExpression()\n {\n $result = $this->evaluateMathBlock();\n while ($mathOp = $this->readChar(true)) {\n switch ($mathOp) {\n case '+':\n $result->join('+', $this->evaluateMathBlock());\n break;\n case '-': \n $result->join('-', $this->evaluateMathBlock());\n break;\n case '=':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('==', $this->evaluateMathBlock());\n } elseif ($nextChar == '>') {\n $this->unreadChar(2);\n return $result;\n break;\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '!':\n $nextChar = $this->readChar();\n if ($nextChar == '=') {\n $result->join('!=', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '>':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('>=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('>', $this->evaluateMathBlock());\n }\n break;\n case '<':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('<=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('<', $this->evaluateMathBlock());\n }\n break;\n case 'i': // find in set\n $nextChar = $this->readChar(true);\n if ($nextChar == 'n') { \n $result->join('in', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case 'l': // check against regex\n $this->evaluateLikeExpression($result);\n break;\n // Lower lever operators\n case '&': // boolean \"and\" &&\n case '|': // boolean \"or\" ||\n // end of argument or statement\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';': \n // array value parsed\n case ']':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $mathOp . '\".');\n break;\n }\n }\n return $result;\n }", "public function isNullable(): ?bool;", "private function leftExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (x) == (a ? b : c)\n // (a ? b : c) op y != a ? b : c op y in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a op1 b)\n // (a op1 b) op y != a op1 b op y if\n if (BinaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a op1 (b) op y == a op1 b op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n // let (x) == (!a)\n // (!a) op y != !a op y if\n if ($expr->getOperation() == UnaryOperators::PHP_NOT_OP &&\n BinaryOperators::hasPriority(\n $op, BinaryOperators::PHP_MULTIPLY)) {\n return true;\n }\n // check if !(a) op y == !a op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "public function logicalOperator($operator = null);", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "public function evaluateCondition($value)\n {\n return is_object($value) ||\n !(is_null($value) || (is_string($value) && strlen($value) == 0));\n }", "function yy_r51(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }", "public function testStringWithZeroCastedToBoolGivesFalse() {\n\t\t$this->assertFalse((bool)'0');\n\t}", "public function addElseIf(BooleanExpression $expression)\n\t{\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$can_eval = $expression->canEvaluate();\n\n\t\tif ($can_eval)\n\t\t{\n\t\t\t$result = $this->evaluate($expression);\n\n\t\t\t// If not all previous ones have evaluated, then we can't\n\t\t\t// make a determination on a true branch since a previous one may\n\t\t\t// also be true. However, we do know that subsequent ones cannot be\n\t\t\t// reached, so we can remove them. This then becomes the else branch,\n\t\t\t// making it easy to parse on subsequent passes.\n\t\t\tif ( ! $this->all_previous_could_eval && $result == TRUE)\n\t\t\t{\n\t\t\t\t$this->parser->output('{if:else}');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->parser->outputLastAnnotation();\n\t\t\t$this->outputCondition($expression->stringify());\n\t\t}\n\n\t\t$this->setLastCouldEval($can_eval);\n\n\t\treturn $this->shouldAddBody();\n\t}", "public function getTernaryMethod($testMethod = null, $method = null)\n {\n /**\n * Get a method that return current date-time if $testMethod applied on it return true,\n * else return the result of $method called on it.\n *\n * @param string $testMethod method for the condition.\n * @param string $method method to apply if condition is false.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface\n */\n return static function () use ($testMethod, $method) {\n $date = static::this();\n\n return $date->$testMethod() ? $date : $date->$method();\n };\n }", "function bool ($value)\r\n{\r\n\tif ($value === true || $value === false)\r\n\t\treturn $value;\r\n\r\n\treturn $value === 'true' || ($value !== 'false' && !!$value);\r\n}", "public function visitConditionalStatement(\n /*IConditionalStatement*/ $node) /*: mixed*/ {\n $condition = /*(string)*/$node->getCondition()->accept($this);\n $this->blockIndent = ' ';\n $true_block = /*(string)*/$node->getTrueBlock()->accept($this);\n $this->blockIndent = ' ';\n $false_block = /*(string)*/$node->getFalseBlock()->accept($this);\n $result = $this->indent.'if ('.$condition.')'.$true_block;\n if ($false_block !== '') {\n $result .= ' else'.$false_block;\n }\n return $result.\"\\n\";\n }", "public function addElse()\n\t{\n\t\t// Don't process if done or we've encountered a condition\n\t\t// that evaluated to TRUE. Even if other ones have not been\n\t\t// evaluated, that one will shortcut our else, so we prune\n\t\t// the else branch.\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ( ! $this->all_previous_could_eval)\n\t\t{\n\t\t\t$this->parser->output('{if:else}');\n\t\t}\n\n\t\t$this->last_result = TRUE;\n\t\t$this->setLastCouldEval(TRUE);\n\n\t\treturn $this->shouldAddBody();\n\t}", "public function fnParseMaybeConditional($oNoIn=null, $oRefDestructuringErrors=null) \n {\n $iStartPos = $this->iStart;\n $oStartLoc = $this->oStartLoc;\n $oExpr = $this->fnParseExprOps($oNoIn, $oRefDestructuringErrors);\n if ($this->fnCheckExpressionErrors($oRefDestructuringErrors)) \n return $oExpr;\n if ($this->fnEat(TokenTypes::$aTypes['question'])) {\n $oNode = $this->fnStartNodeAt($iStartPos, $oStartLoc);\n $oNode->oTest = $oExpr;\n $oNode->oConsequent = $this->fnParseMaybeAssign();\n $this->fnExpect(TokenTypes::$aTypes['colon']);\n $oNode->oAlternate = $this->fnParseMaybeAssign(noIn);\n return $this->fnFinishNode($oNode, \"ConditionalExpression\");\n }\n return $oExpr;\n }", "function bool_val(string $key, bool $default = null): ?bool\n{\n $val = env($key, $default);\n\n if ($val === null) {\n return $default;\n }\n\n if ($val === 'false') {\n return false;\n }\n\n if ($val === '[]') {\n return false;\n }\n\n if ($val === '{}') {\n return false;\n }\n\n return boolval($val);\n}", "function is_logical($x){\n\t//note blank is interpreted as false\n\tif(in_array(strtolower(trim($x)),array(/*true: */'y','yes','1','true','t', /*false: */'n','no','0','false','f','')))return true;\n}", "protected function evaluate($expression)\n\t{\n\t\t$result = (bool) $expression->evaluate();\n\n\t\tif ($result === TRUE)\n\t\t{\n\t\t\t$this->encountered_true_condition = TRUE;\n\t\t}\n\n\t\t$this->last_result = $result;\n\n\t\treturn $result;\n\t}", "function to_boolean($val);", "public function isTrue()\n {\n \n return !!$this->value;\n \n }", "public function boolean() {\n //dd($this->lookahead->type);\n if ($this->lookahead->type !== ControlFunctionLexer::BOOLEAN) {\n return null;\n }\n $bool_node = new ControlFunctionParseTree($this->lookahead->type, $this->lookahead->text);\n //dd($bool_node);\n $this->match(ControlFunctionLexer::BOOLEAN);\n return $bool_node;\n }", "public function isBinaryOperator(int $index): bool\n {\n static $nonArrayOperators = [\n '=' => true,\n '*' => true,\n '/' => true,\n '%' => true,\n '<' => true,\n '>' => true,\n '|' => true,\n '^' => true,\n '.' => true,\n ];\n\n static $potentialUnaryNonArrayOperators = [\n '+' => true,\n '-' => true,\n '&' => true,\n ];\n\n static $arrayOperators;\n\n if (null === $arrayOperators) {\n $arrayOperators = [\n T_AND_EQUAL => true, // &=\n T_BOOLEAN_AND => true, // &&\n T_BOOLEAN_OR => true, // ||\n T_CONCAT_EQUAL => true, // .=\n T_DIV_EQUAL => true, // /=\n T_DOUBLE_ARROW => true, // =>\n T_IS_EQUAL => true, // ==\n T_IS_GREATER_OR_EQUAL => true, // >=\n T_IS_IDENTICAL => true, // ===\n T_IS_NOT_EQUAL => true, // !=, <>\n T_IS_NOT_IDENTICAL => true, // !==\n T_IS_SMALLER_OR_EQUAL => true, // <=\n T_LOGICAL_AND => true, // and\n T_LOGICAL_OR => true, // or\n T_LOGICAL_XOR => true, // xor\n T_MINUS_EQUAL => true, // -=\n T_MOD_EQUAL => true, // %=\n T_MUL_EQUAL => true, // *=\n T_OR_EQUAL => true, // |=\n T_PLUS_EQUAL => true, // +=\n T_POW => true, // **\n T_POW_EQUAL => true, // **=\n T_SL => true, // <<\n T_SL_EQUAL => true, // <<=\n T_SR => true, // >>\n T_SR_EQUAL => true, // >>=\n T_XOR_EQUAL => true, // ^=\n T_SPACESHIP => true, // <=>\n T_COALESCE => true, // ??\n T_COALESCE_EQUAL => true, // ??=\n ];\n }\n\n $tokens = $this->tokens;\n $token = $tokens[$index];\n\n if ($token->isGivenKind([T_INLINE_HTML, T_ENCAPSED_AND_WHITESPACE, CT::T_TYPE_INTERSECTION])) {\n return false;\n }\n\n if (isset($potentialUnaryNonArrayOperators[$token->getContent()])) {\n return !$this->isUnaryPredecessorOperator($index);\n }\n\n if ($token->isArray()) {\n return isset($arrayOperators[$token->getId()]);\n }\n\n if (isset($nonArrayOperators[$token->getContent()])) {\n return true;\n }\n\n return false;\n }", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "function testRuleAppliesToMultilevelIfConditions()\n{\n if (1 || 0) { // not applied\n if (1 == 1 || $foo = 'baz') { // applied\n // ...\n } elseif (1 != array() && 'foo' != 'baz' && $bar = 'baz') { // applied\n // ...\n } elseif (1 % 2 !== !false && $baz = 1 + 1 + 1 - 3) { // applied\n // ...\n if ($foo == 'baz') { // not applied\n // ...\n if (3 - 2 == 3) { // not applied\n // ...\n if (true) { // not applied\n // ...\n if (1) { // not applied\n // ...\n } elseif ($foo = 1) { // applied\n // ...\n } elseif ($foo = 2) { // applied\n // ...\n } elseif (5 % 5 == 0) { // not applied\n // ...\n }\n }\n }\n }\n }\n }\n if (1 == 1 || 1 && 0 and 4 % 2 || ($foo = 1) xor 5 * 4 * 3 * 2 * 1) { // applied\n // ...\n }\n}", "function _checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id = 0)\n\t{\n\t\treturn true;\n\t}", "function issetor(&$variable, $placeholder = ''){\n if(isset($variable)){\n return $variable;\n } else {\n return $placeholder;\n }\n}", "function coalesce($value, $default1=null, $default2=false, $default3=false, $default4=false) {\n return isnull(isnull(isnull(isnull($value, $default1), $default2), $default3), $default4);\n }", "function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "function example67($a, $b, $c, $x, $y) {\n return [\n 1 ? 0 : 1 ? 3 : 0,\n $a ? $b : $c ? $x : $y,\n 1 ? 0 : 1 ?: 0,\n $a ? $b : $c ?: $x,\n $a ?: $b ? $c : $undefined,\n 1 ?: 0 ? 1 : 0,\n\n // These have parentheses, and Phan should not warn\n ($a ? $b : $c) ? $x : $y,\n $a ? $b : ($c ? $x : $y),\n ($a ? $b : $c) ?: $x,\n ($a ?: $b) ? $c : $x,\n // The parsing order doesn't affect the behavior, so Phan should not warn.\n $a ?: $c ?: $x,\n ($a ?: $c) ?: $undefined,\n ];\n}", "public function parseConditionals($text, $data, $callback)\n {\n // Added by Ivan Tcholakov, 24-JAN-2016.\n $no_value = new Parser_Lex_No_Value;\n //\n\n $this->setupRegex();\n preg_match_all($this->conditionalRegex, $text, $matches, PREG_SET_ORDER);\n\n $this->conditionalData = $data;\n\n /**\n * $matches[][0] = Full Match\n * $matches[][1] = Either 'if', 'unless', 'elseif', 'elseunless'\n * $matches[][2] = Condition\n */\n foreach ($matches as $match) {\n $this->inCondition = true;\n\n $condition = $match[2];\n\n // Extract all literal string in the conditional to make it easier\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n $condition = preg_replace($this->conditionalNotRegex, '$1!$2', $condition);\n\n if (preg_match_all($this->conditionalExistsRegex, $condition, $existsMatches, PREG_SET_ORDER)) {\n foreach ($existsMatches as $m) {\n $exists = 'true';\n // Modified by Ivan Tcholakov, 24-JAN-2016.\n //if ($this->getVariable($m[2], $data, '__doesnt_exist__') === '__doesnt_exist__') {\n if ($this->getVariable($m[2], $data, $no_value) === $no_value) {\n //\n $exists = 'false';\n }\n $condition = $this->createExtraction('__cond_exists', $m[0], $m[1].$exists.$m[3], $condition);\n }\n }\n\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n\n if ($callback) {\n $condition = preg_replace('/\\b(?!\\{\\s*)('.$this->callbackNameRegex.')(?!\\s+.*?\\s*\\})\\b/', '{$1}', $condition);\n $condition = $this->parseCallbackTags($condition, $data, $callback);\n }\n\n // Re-extract the strings that have now been possibly added.\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n\n\n // Re-process for variables, we trick processConditionVar so that it will return null\n $this->inCondition = false;\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n $this->inCondition = true;\n\n // Re-inject any strings we extracted\n $condition = $this->injectExtractions($condition, '__cond_str');\n $condition = $this->injectExtractions($condition, '__cond_exists');\n\n $conditional = '<?php ';\n\n if ($match[1] == 'unless') {\n $conditional .= 'if ( ! ('.$condition.'))';\n } elseif ($match[1] == 'elseunless') {\n $conditional .= 'elseif ( ! ('.$condition.'))';\n } else {\n $conditional .= $match[1].' ('.$condition.')';\n }\n\n $conditional .= ': ?>';\n\n $text = preg_replace('/'.preg_quote($match[0], '/').'/m', addcslashes($conditional, '\\\\$'), $text, 1);\n }\n\n $text = preg_replace($this->conditionalElseRegex, '<?php else: ?>', $text);\n $text = preg_replace($this->conditionalEndRegex, '<?php endif; ?>', $text);\n\n $text = $this->parsePhp($text);\n $this->inCondition = false;\n\n return $text;\n }", "function converter(&$value, $key){\n if($value === \"true\") {\n $value = TRUE;\n } elseif ($value === \"false\") {\n $value = FALSE;\n }\n if ($key === \"not\") {\n if ($value === \"1\") {\n $value = TRUE;\n }\n if ($value === \"0\") {\n $value = FALSE;\n }\n }\n }", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "public static function tryParseBoolean(&$fld)\n\t{\n\t\t$fld = $fld == 'Y';\n\t\treturn $fld;\n\t}", "public function ifNum($num);", "private function rightExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($op == BinaryOperators::PHP_ARRAY_ELEMENT) {\n // x[y] == x[(y)]\n return false;\n }\n if ($expr instanceof ConditionalExpression) {\n // let (y) == (a ? b : c)\n // x op (a ? b : c) != x op a ? b : c if\n return $this->rightExprNeedsParentheses(\n $op, $expr->getCondition());\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (y) == (a op1 b)\n // x op (a op1 b) != x op a op1 b if\n if (!BinaryOperators::hasPriority($expr->getOperation(), $op)) {\n return true;\n }\n // check if x op (a) op1 b == x op a op1 b\n return $this->rightExprNeedsParentheses($op, $expr->getExpression1());\n }\n\n // don't worry about unary operations:\n // prefix unaries do not have left operands hence\n // x op (uop a) == x op uop a in all cases.\n // postfix unaries trump binaries that get here hence\n // x op (a uop) == x op a uop in all cases.\n return false;\n }", "function variant_or($left, $right) {}", "function boolval( $val ) {\r\n\t\treturn (bool) $val;\r\n\t}", "public function mapOr(callable $f, mixed $default): mixed\n {\n if (!$this->isOk()) {\n return $default;\n }\n\n return call_user_func($f, $this->value);\n }", "function yy_r128(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }", "public function conditionalAndExpression(){\n try {\n // Sparql11query.g:389:3: ( valueLogical ( AND valueLogical )* ) \n // Sparql11query.g:390:3: valueLogical ( AND valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1326);\n $this->valueLogical();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:390:16: ( AND valueLogical )* \n //loop49:\n do {\n $alt49=2;\n $LA49_0 = $this->input->LA(1);\n\n if ( ($LA49_0==$this->getToken('AND')) ) {\n $alt49=1;\n }\n\n\n switch ($alt49) {\n \tcase 1 :\n \t // Sparql11query.g:390:17: AND valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1329); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1331);\n \t $this->valueLogical();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop49;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "private static function _parse_condition_comparison($params, $operator, &$prepared_values)\n\t{\n\t\tif (count($params) < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[3] ?? null;\n\t\t$val = self::_convert_data($params[2], $type, $prepared_values);\n\t\treturn $operator . ' ' . $val;\n\t}", "public function whenFalse($falsy_value, callable $callback, callable $default=null);", "function mm_auto_update_make_bool( $value, $default = true ) {\n\tif ( 'false' === $value ) { $value = false; }\n\tif ( 'true' === $value ) { $value = true; }\n\tif ( true !== $value && false !== $value ) { $value = $default; }\n\treturn $value;\n}", "public function if_($sql_test){\r\n $this->throwExceptionIfNotSQLTest($sql_test);\r\n return SQLIFFunction::IfTrueThat($sql_test,$this,new SQLNull());\r\n }", "function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}", "public function testMissingMiddleExpression5dot2()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php', '5.2-5.4');\n $this->assertError($this->_sniffFile, 8,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n $this->assertError($this->_sniffFile, 10,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n }", "static function false($X, $Alt) {\n\t\treturn $X ? $X : $Alt;\n\t}", "function coalescenull($value, $default1) {\n if (is_null($value)) {\n return $default1;\n } else {\n return $value;\n }\n }" ]
[ "0.7200672", "0.6228922", "0.6137607", "0.5964518", "0.5902801", "0.58070105", "0.5732051", "0.5680187", "0.5615486", "0.5489646", "0.5416351", "0.53470606", "0.5333378", "0.53021437", "0.5180551", "0.5166459", "0.50652635", "0.5058424", "0.49531278", "0.49290705", "0.49059653", "0.4901741", "0.4893713", "0.48612055", "0.48186672", "0.48009372", "0.4791474", "0.47831795", "0.47537753", "0.47488576", "0.4733475", "0.4722981", "0.47189257", "0.4690766", "0.4679537", "0.4673328", "0.46635744", "0.461943", "0.46176466", "0.46093214", "0.4606697", "0.46062496", "0.46003437", "0.45995513", "0.4594311", "0.45926204", "0.45832965", "0.4578594", "0.45608374", "0.45567858", "0.45529523", "0.4535912", "0.45273674", "0.45231166", "0.45152733", "0.45130396", "0.44899014", "0.44746894", "0.4473631", "0.44714424", "0.44540334", "0.44539994", "0.44404685", "0.4420059", "0.44195867", "0.44186905", "0.44145733", "0.44116664", "0.44040877", "0.43922898", "0.43865943", "0.43789202", "0.43772072", "0.43761337", "0.43716505", "0.4369523", "0.43555686", "0.43477935", "0.43459833", "0.4344735", "0.43372524", "0.4329048", "0.4316241", "0.43077683", "0.43069986", "0.43023854", "0.42999724", "0.42963153", "0.4291546", "0.4283147", "0.42805138", "0.42717418", "0.42665416", "0.4263058", "0.4255757", "0.42501095", "0.4249988", "0.42496702", "0.4240895", "0.4234904" ]
0.52264184
14
Test ternary expr ?: expr
#[@test] public function withoutExpression() { $this->assertEquals(array(new TernaryNode(array( 'condition' => new VariableNode('i'), 'expression' => NULL, 'conditional' => new IntegerNode('2'), ))), $this->parse(' $i ?: 2; ')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#[@test]\n public function ternary() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ? 1 : 2;\n '));\n }", "public function testStandardTernaryOperators()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php');\n $this->assertNoViolation($this->_sniffFile, 5);\n }", "protected function convertTernary($template)\n\t{\n\t\tpreg_match_all('(<xf:(?:else)?if is=\"([^\"]+)\"/?>([^<]*))', $template, $m, PREG_SET_ORDER);\n\n\t\t$expr = '';\n\t\tforeach ($m as $i => list($match, $condition, $content))\n\t\t{\n\t\t\tif ($i > 0)\n\t\t\t{\n\t\t\t\t$expr .= '(';\n\t\t\t}\n\n\t\t\t// Make sure compound conditions are in parentheses\n\t\t\tif (preg_match('( (?:and|or) )', $condition))\n\t\t\t{\n\t\t\t\t$condition = '(' . $condition . ')';\n\t\t\t}\n\n\t\t\t$expr .= $condition . ' ? ' . $this->convertMixedContent($content) . ' : ';\n\t\t}\n\t\tif (preg_match('(<xf:else/>\\\\K[^<]*)', $template, $m))\n\t\t{\n\t\t\t$else = $this->convertMixedContent($m[0]);\n\t\t\tif (str_contains($else, ' '))\n\t\t\t{\n\t\t\t\t// Add parentheses if the else clause is more than one token\n\t\t\t\t$else = '(' . $else . ')';\n\t\t\t}\n\t\t\t$expr .= $else;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expr .= \"''\";\n\t\t}\n\t\t$expr .= str_repeat(')', $i);\n\n\t\treturn '{{ ' . $expr . ' }}';\n\t}", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit('?');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit(':');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit_operator('?', 'ternary');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit_operator(':', 'ternary');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "private function isElse()\n\t{\n\t\treturn $this->expression=='';\n\t}", "abstract public function getOrElse($else);", "function prephp_ternary($tokenStream, $iQuestion) {\n if (!($iColon = $tokenStream->skipWhitespace($iQuestion))\n || !$tokenStream[$iColon]->is(T_COLON)) {\n return;\n }\n \n $i = $iQuestion;\n while ($i--) {\n if ($tokenStream[$i]->is(T_CLOSE_ROUND, T_CLOSE_SQUARE, T_CLOSE_CURLY)) {\n $i = $tokenStream->complementaryBracket($i);\n continue;\n }\n \n if ($tokenStream[$i]->is(array(\n // operators with lower precedence\n T_EQUAL,\n T_PLUS_EQUAL,\n T_PLUS_EQUAL,\n T_MUL_EQUAL,\n T_DIV_EQUAL,\n T_CONCAT_EQUAL,\n T_MOD_EQUAL,\n T_AND_EQUAL,\n T_OR_EQUAL,\n T_XOR_EQUAL,\n T_SL_EQUAL,\n T_SR_EQUAL,\n T_DOUBLE_ARROW,\n T_LOGICAL_AND,\n T_LOGICAL_XOR,\n T_LOGICAL_OR,\n T_COMMA,\n \n // other ending tokens\n T_OPEN_ROUND,\n T_OPEN_SQUARE,\n T_OPEN_CURLY,\n T_SEMICOLON,\n ))) {\n break;\n }\n }\n \n if ($i == 0) {\n throw new Prephp_TokenException('ternary not terminated on left side');\n }\n \n // we went one too far\n $iBegin = $tokenStream->skipWhitespace($i);\n \n // put result of ternary condition in a temporary variable\n // and insert it as middle part\n $variable = new Prephp_Token(\n T_VARIABLE,\n uniqid('$prephp_var_')\n );\n \n // insert middle part\n $tokenStream->insert($iColon, $variable);\n \n // insert closing bracket (opening inserted later)\n $tokenStream->insert($iQuestion - 1, ')');\n \n // insert ($variable = ...\n $tokenStream->insert($iBegin, array(\n '(',\n $variable,\n '='\n ));\n }", "public function getOrElse($dflt)\n {\n return $this->isEmpty() ? $dflt : $this->val;\n }", "#[@test]\n public function nested() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new BracedExpressionNode(new TernaryNode(array(\n 'condition' => new VariableNode('f'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n )))\n ))), $this->parse('\n $i ?: ($f ? 1 : 2);\n '));\n }", "public function visitConditionalExpression(\n /*IConditionalExpression*/ $node) /*: mixed*/ {\n $cond = $node->getCondition();\n $condition = /*(string)*/$cond->accept($this);\n $value_if_true = /*(string)*/$node->getValueIfTrue()->accept($this);\n $val_if_false = $node->getValueIfFalse();\n $value_if_false = /*(string)*/$val_if_false->accept($this);\n\n if ($this->leftExprNeedsParentheses(\n BinaryOperators::PHP_CONDITIONAL, $cond)) {\n $condition = '('.$condition.')';\n }\n if ($val_if_false instanceof ConditionalExpression) {\n $value_if_false = '('.$value_if_false.')';\n }\n return $condition.' ? '.$value_if_true.' : '.$value_if_false;\n }", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "public function orElse($alternative);", "#[@test]\n public function assignment() {\n $this->assertEquals(array(new AssignmentNode(array(\n 'variable' => new VariableNode('a'),\n 'expression' => new TernaryNode(array(\n 'condition' => new VariableNode('argc'),\n 'expression' => new VariableNode('args0'),\n 'conditional' => new IntegerNode('1')\n )),\n 'op' => '='\n ))), $this->parse('\n $a= $argc ? $args0 : 1;\n '));\n }", "function sif($condition,$true_value,$false_value)\n{\n\treturn $condition?$true_value:$false_value;\n}", "function yy_r144(){$this->_retvalue = '==='; }", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "public function expression(){\n try {\n // Sparql11query.g:375:3: ( conditionalOrExpression ) \n // Sparql11query.g:376:3: conditionalOrExpression \n {\n $this->pushFollow(self::$FOLLOW_conditionalOrExpression_in_expression1283);\n $this->conditionalOrExpression();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function orNull();", "function isset_or(&$var, $or = null) {\n return isset($var) ? $var : $or;\n}", "public function getOrElse($default);", "public function process_token($stackPtr)\n {\n $token = $this->tokens[$stackPtr];\n // Check if the condition for the ternary is bracketed.\n $prev = $this->phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, \\true);\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$prev]['code']) {\n if (!isset($this->tokens[$prev]['parenthesis_opener'])) {\n return;\n }\n $opener = $this->tokens[$prev]['parenthesis_opener'];\n $closer = $prev;\n } elseif (isset($token['nested_parenthesis'])) {\n $opener = Parentheses::getLastOpener($this->phpcsFile, $stackPtr);\n $closer = Parentheses::getLastCloser($this->phpcsFile, $stackPtr);\n $next_statement_closer = BCFile::findEndOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_CLOSE_PARENTHESIS, \\T_CLOSE_SQUARE_BRACKET));\n if (\\false !== $next_statement_closer && $next_statement_closer < $closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n $prev_statement_closer = BCFile::findStartOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_OPEN_PARENTHESIS, \\T_OPEN_SQUARE_BRACKET));\n if (\\false !== $prev_statement_closer && $opener < $prev_statement_closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n if ($closer > $stackPtr) {\n $closer = $stackPtr;\n }\n } else {\n // No parenthesis found, can't determine where the conditional part of the ternary starts.\n return;\n }\n $startPos = $opener;\n do {\n $hasAssignment = $this->phpcsFile->findNext($this->assignment_tokens, $startPos + 1, $closer);\n if (\\false === $hasAssignment) {\n return;\n }\n // Examine whether the left side is a variable.\n $hasVariable = \\false;\n $conditionStart = $startPos;\n $altConditionStart = $this->phpcsFile->findPrevious($this->condition_start_tokens, $hasAssignment - 1, $startPos);\n if (\\false !== $altConditionStart) {\n $conditionStart = $altConditionStart;\n }\n for ($i = $hasAssignment; $i > $conditionStart; $i--) {\n if (isset(Tokens::$emptyTokens[$this->tokens[$i]['code']])) {\n continue;\n }\n // If this is a variable or array, we've seen all we need to see.\n if (\\T_VARIABLE === $this->tokens[$i]['code'] || \\T_CLOSE_SQUARE_BRACKET === $this->tokens[$i]['code']) {\n $hasVariable = \\true;\n break;\n }\n // If this is a function call or something, we are OK.\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$i]['code']) {\n break;\n }\n }\n if (\\true === $hasVariable) {\n $this->phpcsFile->addWarning('Variable assignment found within a condition. Did you mean to do a comparison?', $hasAssignment, 'FoundInTernaryCondition');\n }\n $startPos = $hasAssignment;\n } while ($startPos < $closer);\n }", "private function boolArg($value)\n {\n return ($value ? 1 : null);\n }", "function ternaryCheckout($number)\n{\n $result = ($number <= 12) ? \"express lane\" :\"regular lane\";\n return $result; \n}", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "#[@test]\n public function boolCast() {\n $this->assertSourcecodeEquals(\n '$s= (bool)$num;',\n $this->emit('$s= (bool)$num;')\n );\n }", "protected function convertTernaries($template)\n\t{\n\t\t$old = $template;\n\t\t$template = preg_replace_callback(\n\t\t\t'(<xf:if is=\"[^\"]+\">[^<]*(?:<xf:else[^>]*?/>[^<]*)*</xf:if>)',\n\t\t\tfunction ($m)\n\t\t\t{\n\t\t\t\treturn $this->convertTernary($m[0]);\n\t\t\t},\n\t\t\t$template\n\t\t);\n\t\tif ($template !== $old)\n\t\t{\n\t\t\t$template = $this->convertTernaries($template);\n\t\t}\n\n\t\treturn $template;\n\t}", "function pseudoTypeFalse(false $var = false) {}", "public function conditional( $cond, $trueVal, $falseVal ) {\n\t\tif ( is_array( $cond ) ) {\n\t\t\t$cond = $this->makeList( $cond, LIST_AND );\n\t\t}\n\n\t\treturn \" (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) \";\n\t}", "function yy_r138(){$this->_retvalue = '=='; }", "public static function trueOrNull($value)\n {\n return ($value == 1) ? 1 : null;\n }", "protected function evaluateBoolStatement()\n {\n /**\n * If expression contains only 1 math block - return as math expression result,\n * otherwise cast type of result to boolean\n */\n $result = $this->evaluateBoolExpression();\n while ($booleanOp = $this->readChar(true)) {\n switch ($booleanOp) {\n case '|':\n $nextChar = $this->readChar();\n if ($nextChar == '|') {\n if ($result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('||', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n case '&':\n $nextChar = $this->readChar();\n if ($nextChar == '&') {\n if (!$result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('&&', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n // end of argument\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $booleanOp . '\".');\n break;\n }\n }\n return $result;\n }", "function stage_string_to_bool($string)\n{\n return is_bool($string) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string );\n}", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "function if_else(callable $cond): Closure\n{\n return function (callable $then) use ($cond) {\n return function (callable $else) use ($cond, $then) {\n return function ($value) use ($cond, $then, $else) {\n return $cond($value) ? $then($value) : $else($value);\n };\n };\n };\n}", "public function isShortTernary(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n if (isset($tokens[$stackPtr]) === false\n || $tokens[$stackPtr]['code'] !== \\T_INLINE_THEN\n ) {\n return false;\n }\n\n $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n if ($nextNonEmpty === false) {\n // Live coding or parse error.\n return false;\n }\n\n if ($tokens[$nextNonEmpty]['code'] === \\T_INLINE_ELSE) {\n return true;\n }\n\n return false;\n }", "public function whenTrue($truthy_value, callable $callback, callable $default=null);", "public function visitConditional(Node $node): UnionType\n {\n $cond_node = $node->children['cond'];\n $cond_truthiness = self::checkCondUnconditionalTruthiness($cond_node);\n // For the shorthand $a ?: $b, the cond node will be the truthy value.\n // Note: an ast node will never be null(can be unset), it will be a const AST node with the name null.\n $true_node = $node->children['true'] ?? $cond_node;\n $false_node = $node->children['false'];\n\n // Rarely, a conditional will always be true or always be false.\n if ($cond_truthiness !== null) {\n // TODO: Add no-op checks in another PR, if they don't already exist for conditional.\n if ($cond_truthiness) {\n // The condition is unconditionally true\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $true_node,\n $this->should_catch_issue_exception\n );\n } else {\n // The condition is unconditionally false\n\n // Add the type for the 'false' side\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n }\n }\n if ($true_node !== $cond_node) {\n // Visit the condition to check for undefined variables.\n UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $cond_node,\n $this->should_catch_issue_exception\n );\n }\n // TODO: emit no-op if $cond_node is a literal, such as `if (2)`\n // - Also note that some things such as `true` and `false` are \\ast\\AST_NAME nodes.\n\n if ($cond_node instanceof Node) {\n $base_context = $this->context;\n // TODO: Use different contexts and merge those, in case there were assignments or assignments by reference in both sides of the conditional?\n // Reuse the BranchScope (sort of unintuitive). The ConditionVisitor returns a clone and doesn't modify the original.\n $base_context_scope = $this->context->getScope();\n if ($base_context_scope instanceof GlobalScope) {\n $base_context = $base_context->withScope(new BranchScope($base_context_scope));\n }\n // Doesn't seem to be necessary to run BlockAnalysisVisitor\n // $base_context = (new BlockAnalysisVisitor($this->code_base, $base_context))->__invoke($cond_node);\n $true_context = (new ConditionVisitor(\n $this->code_base,\n isset($node->children['true']) ? $base_context : $this->context // special case: $c = (($d = foo()) ?: 'fallback')\n ))->__invoke($cond_node);\n $false_context = (new NegatedConditionVisitor(\n $this->code_base,\n $base_context\n ))->__invoke($cond_node);\n\n if (!isset($node->children['true'])) {\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $false_node,\n $this->should_catch_issue_exception\n );\n if ($false_node instanceof Node && BlockExitStatusChecker::willUnconditionallyThrowOrReturn($false_node)) {\n return $true_type->nonFalseyClone();\n }\n\n $true_type_is_empty = $true_type->isEmpty();\n if (!$false_type->isEmpty()) {\n // E.g. `foo() ?: 2` where foo is nullable or possibly false.\n if ($true_type->containsFalsey()) {\n $true_type = $true_type->nonFalseyClone();\n }\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type_is_empty xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }\n } else {\n $true_context = $this->context;\n $false_context = $this->context;\n }\n // Postcondition: This is (cond_expr) ? (true_expr) : (false_expr)\n\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n if ($false_type->isNeverType()) {\n return $true_type;\n }\n if ($true_type->isNeverType()) {\n return $false_type;\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type->isEmpty() xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }", "function to_boolean ($value) {\n\tif (\n\n\t\t// Falsy\n\t\t!$value or\n\n\t\t// Empty\n\t\tempty($value) or\n\n\t\t// Zero or less\n\t\t(is_numeric($value) and strval($value) <= 0) or\n\n\t\t// Keyword\n\t\t(is_string($value) and in_array(trim(strtolower($value)), array('null', 'nul', 'nil', 'false')))\n\n\t) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function array_if($arr,$op,$val) {\n\t$ret = TRUE;\n\tfor($a=0;$a<count($arr);$a++) {\n\t\t$if = 'if( '.$arr[$a].' '.$op.' '.$val.' ) { return TRUE; } else { return FALSE; }';\n\t\t$if = eval($if);\n\t\tif(!$if && $ret) $ret = FALSE;\n\t}\n\n\treturn $ret;\n}", "function yy_r139(){$this->_retvalue = '!='; }", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\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 }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "function iif($e, $t, $f){\r\n\t\tif($e){\r\n\t\t\treturn $t;\r\n\t\t}else{\r\n\t\t\treturn $f;\r\n\t\t}\r\n\t}", "function aquamin_is_truty_or_zero( $mixed ) {\n\treturn ( !! $mixed || is_int( $mixed ) || is_float( $mixed ) || '0' === $mixed );\n}", "private function postfixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // (a ? b : c) op != a ? b : c op in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a bop b)\n // (a bop b) op != a bop b op if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a bop (b) op == a bop b op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // (a uop) op == a uop op in all cases\n return false;\n }\n // let (expr) == (uop a)\n // check if uop (a) op == uop a op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "abstract public function is_correct( $a, $comparison_operator, $b );", "function printyn ($val) {\n\treturn ($val ? 'yes':'no');\n}", "private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }", "protected function evaluateBoolExpression()\n {\n $result = $this->evaluateMathBlock();\n while ($mathOp = $this->readChar(true)) {\n switch ($mathOp) {\n case '+':\n $result->join('+', $this->evaluateMathBlock());\n break;\n case '-': \n $result->join('-', $this->evaluateMathBlock());\n break;\n case '=':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('==', $this->evaluateMathBlock());\n } elseif ($nextChar == '>') {\n $this->unreadChar(2);\n return $result;\n break;\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '!':\n $nextChar = $this->readChar();\n if ($nextChar == '=') {\n $result->join('!=', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '>':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('>=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('>', $this->evaluateMathBlock());\n }\n break;\n case '<':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('<=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('<', $this->evaluateMathBlock());\n }\n break;\n case 'i': // find in set\n $nextChar = $this->readChar(true);\n if ($nextChar == 'n') { \n $result->join('in', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case 'l': // check against regex\n $this->evaluateLikeExpression($result);\n break;\n // Lower lever operators\n case '&': // boolean \"and\" &&\n case '|': // boolean \"or\" ||\n // end of argument or statement\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';': \n // array value parsed\n case ']':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $mathOp . '\".');\n break;\n }\n }\n return $result;\n }", "public function isNullable(): ?bool;", "private function leftExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (x) == (a ? b : c)\n // (a ? b : c) op y != a ? b : c op y in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a op1 b)\n // (a op1 b) op y != a op1 b op y if\n if (BinaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a op1 (b) op y == a op1 b op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n // let (x) == (!a)\n // (!a) op y != !a op y if\n if ($expr->getOperation() == UnaryOperators::PHP_NOT_OP &&\n BinaryOperators::hasPriority(\n $op, BinaryOperators::PHP_MULTIPLY)) {\n return true;\n }\n // check if !(a) op y == !a op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "public function logicalOperator($operator = null);", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "public function evaluateCondition($value)\n {\n return is_object($value) ||\n !(is_null($value) || (is_string($value) && strlen($value) == 0));\n }", "function yy_r51(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }", "public function testStringWithZeroCastedToBoolGivesFalse() {\n\t\t$this->assertFalse((bool)'0');\n\t}", "public function addElseIf(BooleanExpression $expression)\n\t{\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$can_eval = $expression->canEvaluate();\n\n\t\tif ($can_eval)\n\t\t{\n\t\t\t$result = $this->evaluate($expression);\n\n\t\t\t// If not all previous ones have evaluated, then we can't\n\t\t\t// make a determination on a true branch since a previous one may\n\t\t\t// also be true. However, we do know that subsequent ones cannot be\n\t\t\t// reached, so we can remove them. This then becomes the else branch,\n\t\t\t// making it easy to parse on subsequent passes.\n\t\t\tif ( ! $this->all_previous_could_eval && $result == TRUE)\n\t\t\t{\n\t\t\t\t$this->parser->output('{if:else}');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->parser->outputLastAnnotation();\n\t\t\t$this->outputCondition($expression->stringify());\n\t\t}\n\n\t\t$this->setLastCouldEval($can_eval);\n\n\t\treturn $this->shouldAddBody();\n\t}", "public function getTernaryMethod($testMethod = null, $method = null)\n {\n /**\n * Get a method that return current date-time if $testMethod applied on it return true,\n * else return the result of $method called on it.\n *\n * @param string $testMethod method for the condition.\n * @param string $method method to apply if condition is false.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface\n */\n return static function () use ($testMethod, $method) {\n $date = static::this();\n\n return $date->$testMethod() ? $date : $date->$method();\n };\n }", "function bool ($value)\r\n{\r\n\tif ($value === true || $value === false)\r\n\t\treturn $value;\r\n\r\n\treturn $value === 'true' || ($value !== 'false' && !!$value);\r\n}", "public function visitConditionalStatement(\n /*IConditionalStatement*/ $node) /*: mixed*/ {\n $condition = /*(string)*/$node->getCondition()->accept($this);\n $this->blockIndent = ' ';\n $true_block = /*(string)*/$node->getTrueBlock()->accept($this);\n $this->blockIndent = ' ';\n $false_block = /*(string)*/$node->getFalseBlock()->accept($this);\n $result = $this->indent.'if ('.$condition.')'.$true_block;\n if ($false_block !== '') {\n $result .= ' else'.$false_block;\n }\n return $result.\"\\n\";\n }", "public function addElse()\n\t{\n\t\t// Don't process if done or we've encountered a condition\n\t\t// that evaluated to TRUE. Even if other ones have not been\n\t\t// evaluated, that one will shortcut our else, so we prune\n\t\t// the else branch.\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ( ! $this->all_previous_could_eval)\n\t\t{\n\t\t\t$this->parser->output('{if:else}');\n\t\t}\n\n\t\t$this->last_result = TRUE;\n\t\t$this->setLastCouldEval(TRUE);\n\n\t\treturn $this->shouldAddBody();\n\t}", "public function fnParseMaybeConditional($oNoIn=null, $oRefDestructuringErrors=null) \n {\n $iStartPos = $this->iStart;\n $oStartLoc = $this->oStartLoc;\n $oExpr = $this->fnParseExprOps($oNoIn, $oRefDestructuringErrors);\n if ($this->fnCheckExpressionErrors($oRefDestructuringErrors)) \n return $oExpr;\n if ($this->fnEat(TokenTypes::$aTypes['question'])) {\n $oNode = $this->fnStartNodeAt($iStartPos, $oStartLoc);\n $oNode->oTest = $oExpr;\n $oNode->oConsequent = $this->fnParseMaybeAssign();\n $this->fnExpect(TokenTypes::$aTypes['colon']);\n $oNode->oAlternate = $this->fnParseMaybeAssign(noIn);\n return $this->fnFinishNode($oNode, \"ConditionalExpression\");\n }\n return $oExpr;\n }", "function bool_val(string $key, bool $default = null): ?bool\n{\n $val = env($key, $default);\n\n if ($val === null) {\n return $default;\n }\n\n if ($val === 'false') {\n return false;\n }\n\n if ($val === '[]') {\n return false;\n }\n\n if ($val === '{}') {\n return false;\n }\n\n return boolval($val);\n}", "function is_logical($x){\n\t//note blank is interpreted as false\n\tif(in_array(strtolower(trim($x)),array(/*true: */'y','yes','1','true','t', /*false: */'n','no','0','false','f','')))return true;\n}", "protected function evaluate($expression)\n\t{\n\t\t$result = (bool) $expression->evaluate();\n\n\t\tif ($result === TRUE)\n\t\t{\n\t\t\t$this->encountered_true_condition = TRUE;\n\t\t}\n\n\t\t$this->last_result = $result;\n\n\t\treturn $result;\n\t}", "function to_boolean($val);", "public function isTrue()\n {\n \n return !!$this->value;\n \n }", "public function boolean() {\n //dd($this->lookahead->type);\n if ($this->lookahead->type !== ControlFunctionLexer::BOOLEAN) {\n return null;\n }\n $bool_node = new ControlFunctionParseTree($this->lookahead->type, $this->lookahead->text);\n //dd($bool_node);\n $this->match(ControlFunctionLexer::BOOLEAN);\n return $bool_node;\n }", "public function isBinaryOperator(int $index): bool\n {\n static $nonArrayOperators = [\n '=' => true,\n '*' => true,\n '/' => true,\n '%' => true,\n '<' => true,\n '>' => true,\n '|' => true,\n '^' => true,\n '.' => true,\n ];\n\n static $potentialUnaryNonArrayOperators = [\n '+' => true,\n '-' => true,\n '&' => true,\n ];\n\n static $arrayOperators;\n\n if (null === $arrayOperators) {\n $arrayOperators = [\n T_AND_EQUAL => true, // &=\n T_BOOLEAN_AND => true, // &&\n T_BOOLEAN_OR => true, // ||\n T_CONCAT_EQUAL => true, // .=\n T_DIV_EQUAL => true, // /=\n T_DOUBLE_ARROW => true, // =>\n T_IS_EQUAL => true, // ==\n T_IS_GREATER_OR_EQUAL => true, // >=\n T_IS_IDENTICAL => true, // ===\n T_IS_NOT_EQUAL => true, // !=, <>\n T_IS_NOT_IDENTICAL => true, // !==\n T_IS_SMALLER_OR_EQUAL => true, // <=\n T_LOGICAL_AND => true, // and\n T_LOGICAL_OR => true, // or\n T_LOGICAL_XOR => true, // xor\n T_MINUS_EQUAL => true, // -=\n T_MOD_EQUAL => true, // %=\n T_MUL_EQUAL => true, // *=\n T_OR_EQUAL => true, // |=\n T_PLUS_EQUAL => true, // +=\n T_POW => true, // **\n T_POW_EQUAL => true, // **=\n T_SL => true, // <<\n T_SL_EQUAL => true, // <<=\n T_SR => true, // >>\n T_SR_EQUAL => true, // >>=\n T_XOR_EQUAL => true, // ^=\n T_SPACESHIP => true, // <=>\n T_COALESCE => true, // ??\n T_COALESCE_EQUAL => true, // ??=\n ];\n }\n\n $tokens = $this->tokens;\n $token = $tokens[$index];\n\n if ($token->isGivenKind([T_INLINE_HTML, T_ENCAPSED_AND_WHITESPACE, CT::T_TYPE_INTERSECTION])) {\n return false;\n }\n\n if (isset($potentialUnaryNonArrayOperators[$token->getContent()])) {\n return !$this->isUnaryPredecessorOperator($index);\n }\n\n if ($token->isArray()) {\n return isset($arrayOperators[$token->getId()]);\n }\n\n if (isset($nonArrayOperators[$token->getContent()])) {\n return true;\n }\n\n return false;\n }", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "function testRuleAppliesToMultilevelIfConditions()\n{\n if (1 || 0) { // not applied\n if (1 == 1 || $foo = 'baz') { // applied\n // ...\n } elseif (1 != array() && 'foo' != 'baz' && $bar = 'baz') { // applied\n // ...\n } elseif (1 % 2 !== !false && $baz = 1 + 1 + 1 - 3) { // applied\n // ...\n if ($foo == 'baz') { // not applied\n // ...\n if (3 - 2 == 3) { // not applied\n // ...\n if (true) { // not applied\n // ...\n if (1) { // not applied\n // ...\n } elseif ($foo = 1) { // applied\n // ...\n } elseif ($foo = 2) { // applied\n // ...\n } elseif (5 % 5 == 0) { // not applied\n // ...\n }\n }\n }\n }\n }\n }\n if (1 == 1 || 1 && 0 and 4 % 2 || ($foo = 1) xor 5 * 4 * 3 * 2 * 1) { // applied\n // ...\n }\n}", "function _checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id = 0)\n\t{\n\t\treturn true;\n\t}", "function issetor(&$variable, $placeholder = ''){\n if(isset($variable)){\n return $variable;\n } else {\n return $placeholder;\n }\n}", "function coalesce($value, $default1=null, $default2=false, $default3=false, $default4=false) {\n return isnull(isnull(isnull(isnull($value, $default1), $default2), $default3), $default4);\n }", "function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "function example67($a, $b, $c, $x, $y) {\n return [\n 1 ? 0 : 1 ? 3 : 0,\n $a ? $b : $c ? $x : $y,\n 1 ? 0 : 1 ?: 0,\n $a ? $b : $c ?: $x,\n $a ?: $b ? $c : $undefined,\n 1 ?: 0 ? 1 : 0,\n\n // These have parentheses, and Phan should not warn\n ($a ? $b : $c) ? $x : $y,\n $a ? $b : ($c ? $x : $y),\n ($a ? $b : $c) ?: $x,\n ($a ?: $b) ? $c : $x,\n // The parsing order doesn't affect the behavior, so Phan should not warn.\n $a ?: $c ?: $x,\n ($a ?: $c) ?: $undefined,\n ];\n}", "public function parseConditionals($text, $data, $callback)\n {\n // Added by Ivan Tcholakov, 24-JAN-2016.\n $no_value = new Parser_Lex_No_Value;\n //\n\n $this->setupRegex();\n preg_match_all($this->conditionalRegex, $text, $matches, PREG_SET_ORDER);\n\n $this->conditionalData = $data;\n\n /**\n * $matches[][0] = Full Match\n * $matches[][1] = Either 'if', 'unless', 'elseif', 'elseunless'\n * $matches[][2] = Condition\n */\n foreach ($matches as $match) {\n $this->inCondition = true;\n\n $condition = $match[2];\n\n // Extract all literal string in the conditional to make it easier\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n $condition = preg_replace($this->conditionalNotRegex, '$1!$2', $condition);\n\n if (preg_match_all($this->conditionalExistsRegex, $condition, $existsMatches, PREG_SET_ORDER)) {\n foreach ($existsMatches as $m) {\n $exists = 'true';\n // Modified by Ivan Tcholakov, 24-JAN-2016.\n //if ($this->getVariable($m[2], $data, '__doesnt_exist__') === '__doesnt_exist__') {\n if ($this->getVariable($m[2], $data, $no_value) === $no_value) {\n //\n $exists = 'false';\n }\n $condition = $this->createExtraction('__cond_exists', $m[0], $m[1].$exists.$m[3], $condition);\n }\n }\n\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n\n if ($callback) {\n $condition = preg_replace('/\\b(?!\\{\\s*)('.$this->callbackNameRegex.')(?!\\s+.*?\\s*\\})\\b/', '{$1}', $condition);\n $condition = $this->parseCallbackTags($condition, $data, $callback);\n }\n\n // Re-extract the strings that have now been possibly added.\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n\n\n // Re-process for variables, we trick processConditionVar so that it will return null\n $this->inCondition = false;\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n $this->inCondition = true;\n\n // Re-inject any strings we extracted\n $condition = $this->injectExtractions($condition, '__cond_str');\n $condition = $this->injectExtractions($condition, '__cond_exists');\n\n $conditional = '<?php ';\n\n if ($match[1] == 'unless') {\n $conditional .= 'if ( ! ('.$condition.'))';\n } elseif ($match[1] == 'elseunless') {\n $conditional .= 'elseif ( ! ('.$condition.'))';\n } else {\n $conditional .= $match[1].' ('.$condition.')';\n }\n\n $conditional .= ': ?>';\n\n $text = preg_replace('/'.preg_quote($match[0], '/').'/m', addcslashes($conditional, '\\\\$'), $text, 1);\n }\n\n $text = preg_replace($this->conditionalElseRegex, '<?php else: ?>', $text);\n $text = preg_replace($this->conditionalEndRegex, '<?php endif; ?>', $text);\n\n $text = $this->parsePhp($text);\n $this->inCondition = false;\n\n return $text;\n }", "function converter(&$value, $key){\n if($value === \"true\") {\n $value = TRUE;\n } elseif ($value === \"false\") {\n $value = FALSE;\n }\n if ($key === \"not\") {\n if ($value === \"1\") {\n $value = TRUE;\n }\n if ($value === \"0\") {\n $value = FALSE;\n }\n }\n }", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "public static function tryParseBoolean(&$fld)\n\t{\n\t\t$fld = $fld == 'Y';\n\t\treturn $fld;\n\t}", "public function ifNum($num);", "private function rightExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($op == BinaryOperators::PHP_ARRAY_ELEMENT) {\n // x[y] == x[(y)]\n return false;\n }\n if ($expr instanceof ConditionalExpression) {\n // let (y) == (a ? b : c)\n // x op (a ? b : c) != x op a ? b : c if\n return $this->rightExprNeedsParentheses(\n $op, $expr->getCondition());\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (y) == (a op1 b)\n // x op (a op1 b) != x op a op1 b if\n if (!BinaryOperators::hasPriority($expr->getOperation(), $op)) {\n return true;\n }\n // check if x op (a) op1 b == x op a op1 b\n return $this->rightExprNeedsParentheses($op, $expr->getExpression1());\n }\n\n // don't worry about unary operations:\n // prefix unaries do not have left operands hence\n // x op (uop a) == x op uop a in all cases.\n // postfix unaries trump binaries that get here hence\n // x op (a uop) == x op a uop in all cases.\n return false;\n }", "function variant_or($left, $right) {}", "function boolval( $val ) {\r\n\t\treturn (bool) $val;\r\n\t}", "public function mapOr(callable $f, mixed $default): mixed\n {\n if (!$this->isOk()) {\n return $default;\n }\n\n return call_user_func($f, $this->value);\n }", "function yy_r128(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }", "public function conditionalAndExpression(){\n try {\n // Sparql11query.g:389:3: ( valueLogical ( AND valueLogical )* ) \n // Sparql11query.g:390:3: valueLogical ( AND valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1326);\n $this->valueLogical();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:390:16: ( AND valueLogical )* \n //loop49:\n do {\n $alt49=2;\n $LA49_0 = $this->input->LA(1);\n\n if ( ($LA49_0==$this->getToken('AND')) ) {\n $alt49=1;\n }\n\n\n switch ($alt49) {\n \tcase 1 :\n \t // Sparql11query.g:390:17: AND valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1329); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1331);\n \t $this->valueLogical();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop49;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "private static function _parse_condition_comparison($params, $operator, &$prepared_values)\n\t{\n\t\tif (count($params) < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[3] ?? null;\n\t\t$val = self::_convert_data($params[2], $type, $prepared_values);\n\t\treturn $operator . ' ' . $val;\n\t}", "public function whenFalse($falsy_value, callable $callback, callable $default=null);", "function mm_auto_update_make_bool( $value, $default = true ) {\n\tif ( 'false' === $value ) { $value = false; }\n\tif ( 'true' === $value ) { $value = true; }\n\tif ( true !== $value && false !== $value ) { $value = $default; }\n\treturn $value;\n}", "public function if_($sql_test){\r\n $this->throwExceptionIfNotSQLTest($sql_test);\r\n return SQLIFFunction::IfTrueThat($sql_test,$this,new SQLNull());\r\n }", "function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}", "public function testMissingMiddleExpression5dot2()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php', '5.2-5.4');\n $this->assertError($this->_sniffFile, 8,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n $this->assertError($this->_sniffFile, 10,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n }", "static function false($X, $Alt) {\n\t\treturn $X ? $X : $Alt;\n\t}", "function coalescenull($value, $default1) {\n if (is_null($value)) {\n return $default1;\n } else {\n return $value;\n }\n }" ]
[ "0.7200672", "0.6228922", "0.6137607", "0.5902801", "0.58070105", "0.5732051", "0.5680187", "0.5615486", "0.5489646", "0.5416351", "0.53470606", "0.5333378", "0.53021437", "0.52264184", "0.5180551", "0.5166459", "0.50652635", "0.5058424", "0.49531278", "0.49290705", "0.49059653", "0.4901741", "0.4893713", "0.48612055", "0.48186672", "0.48009372", "0.4791474", "0.47831795", "0.47537753", "0.47488576", "0.4733475", "0.4722981", "0.47189257", "0.4690766", "0.4679537", "0.4673328", "0.46635744", "0.461943", "0.46176466", "0.46093214", "0.4606697", "0.46062496", "0.46003437", "0.45995513", "0.4594311", "0.45926204", "0.45832965", "0.4578594", "0.45608374", "0.45567858", "0.45529523", "0.4535912", "0.45273674", "0.45231166", "0.45152733", "0.45130396", "0.44899014", "0.44746894", "0.4473631", "0.44714424", "0.44540334", "0.44539994", "0.44404685", "0.4420059", "0.44195867", "0.44186905", "0.44145733", "0.44116664", "0.44040877", "0.43922898", "0.43865943", "0.43789202", "0.43772072", "0.43761337", "0.43716505", "0.4369523", "0.43555686", "0.43477935", "0.43459833", "0.4344735", "0.43372524", "0.4329048", "0.4316241", "0.43077683", "0.43069986", "0.43023854", "0.42999724", "0.42963153", "0.4291546", "0.4283147", "0.42805138", "0.42717418", "0.42665416", "0.4263058", "0.4255757", "0.42501095", "0.4249988", "0.42496702", "0.4240895", "0.4234904" ]
0.5964518
3
Test ternary expr ?: (expr ? expr : expr)
#[@test] public function nested() { $this->assertEquals(array(new TernaryNode(array( 'condition' => new VariableNode('i'), 'expression' => NULL, 'conditional' => new BracedExpressionNode(new TernaryNode(array( 'condition' => new VariableNode('f'), 'expression' => new IntegerNode('1'), 'conditional' => new IntegerNode('2'), ))) ))), $this->parse(' $i ?: ($f ? 1 : 2); ')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#[@test]\n public function ternary() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => new IntegerNode('1'),\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ? 1 : 2;\n '));\n }", "protected function convertTernary($template)\n\t{\n\t\tpreg_match_all('(<xf:(?:else)?if is=\"([^\"]+)\"/?>([^<]*))', $template, $m, PREG_SET_ORDER);\n\n\t\t$expr = '';\n\t\tforeach ($m as $i => list($match, $condition, $content))\n\t\t{\n\t\t\tif ($i > 0)\n\t\t\t{\n\t\t\t\t$expr .= '(';\n\t\t\t}\n\n\t\t\t// Make sure compound conditions are in parentheses\n\t\t\tif (preg_match('( (?:and|or) )', $condition))\n\t\t\t{\n\t\t\t\t$condition = '(' . $condition . ')';\n\t\t\t}\n\n\t\t\t$expr .= $condition . ' ? ' . $this->convertMixedContent($content) . ' : ';\n\t\t}\n\t\tif (preg_match('(<xf:else/>\\\\K[^<]*)', $template, $m))\n\t\t{\n\t\t\t$else = $this->convertMixedContent($m[0]);\n\t\t\tif (str_contains($else, ' '))\n\t\t\t{\n\t\t\t\t// Add parentheses if the else clause is more than one token\n\t\t\t\t$else = '(' . $else . ')';\n\t\t\t}\n\t\t\t$expr .= $else;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expr .= \"''\";\n\t\t}\n\t\t$expr .= str_repeat(')', $i);\n\n\t\treturn '{{ ' . $expr . ' }}';\n\t}", "public function testStandardTernaryOperators()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php');\n $this->assertNoViolation($this->_sniffFile, 5);\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit('?');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit(':');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "protected function _expressionTernary($ternary, $class, $method) {\n $this->_processExpression($ternary['left'], $class, $method);\n $this->_emitter->emit_operator('?', 'ternary');\n $this->_processExpression($ternary['right'], $class, $method);\n $this->_emitter->emit_operator(':', 'ternary');\n $this->_processExpression($ternary['extra'], $class, $method);\n }", "#[@test]\n public function withoutExpression() {\n $this->assertEquals(array(new TernaryNode(array(\n 'condition' => new VariableNode('i'),\n 'expression' => NULL,\n 'conditional' => new IntegerNode('2'),\n ))), $this->parse('\n $i ?: 2;\n '));\n }", "private function isElse()\n\t{\n\t\treturn $this->expression=='';\n\t}", "function prephp_ternary($tokenStream, $iQuestion) {\n if (!($iColon = $tokenStream->skipWhitespace($iQuestion))\n || !$tokenStream[$iColon]->is(T_COLON)) {\n return;\n }\n \n $i = $iQuestion;\n while ($i--) {\n if ($tokenStream[$i]->is(T_CLOSE_ROUND, T_CLOSE_SQUARE, T_CLOSE_CURLY)) {\n $i = $tokenStream->complementaryBracket($i);\n continue;\n }\n \n if ($tokenStream[$i]->is(array(\n // operators with lower precedence\n T_EQUAL,\n T_PLUS_EQUAL,\n T_PLUS_EQUAL,\n T_MUL_EQUAL,\n T_DIV_EQUAL,\n T_CONCAT_EQUAL,\n T_MOD_EQUAL,\n T_AND_EQUAL,\n T_OR_EQUAL,\n T_XOR_EQUAL,\n T_SL_EQUAL,\n T_SR_EQUAL,\n T_DOUBLE_ARROW,\n T_LOGICAL_AND,\n T_LOGICAL_XOR,\n T_LOGICAL_OR,\n T_COMMA,\n \n // other ending tokens\n T_OPEN_ROUND,\n T_OPEN_SQUARE,\n T_OPEN_CURLY,\n T_SEMICOLON,\n ))) {\n break;\n }\n }\n \n if ($i == 0) {\n throw new Prephp_TokenException('ternary not terminated on left side');\n }\n \n // we went one too far\n $iBegin = $tokenStream->skipWhitespace($i);\n \n // put result of ternary condition in a temporary variable\n // and insert it as middle part\n $variable = new Prephp_Token(\n T_VARIABLE,\n uniqid('$prephp_var_')\n );\n \n // insert middle part\n $tokenStream->insert($iColon, $variable);\n \n // insert closing bracket (opening inserted later)\n $tokenStream->insert($iQuestion - 1, ')');\n \n // insert ($variable = ...\n $tokenStream->insert($iBegin, array(\n '(',\n $variable,\n '='\n ));\n }", "public function getOrElse($dflt)\n {\n return $this->isEmpty() ? $dflt : $this->val;\n }", "abstract public function getOrElse($else);", "public function visitConditionalExpression(\n /*IConditionalExpression*/ $node) /*: mixed*/ {\n $cond = $node->getCondition();\n $condition = /*(string)*/$cond->accept($this);\n $value_if_true = /*(string)*/$node->getValueIfTrue()->accept($this);\n $val_if_false = $node->getValueIfFalse();\n $value_if_false = /*(string)*/$val_if_false->accept($this);\n\n if ($this->leftExprNeedsParentheses(\n BinaryOperators::PHP_CONDITIONAL, $cond)) {\n $condition = '('.$condition.')';\n }\n if ($val_if_false instanceof ConditionalExpression) {\n $value_if_false = '('.$value_if_false.')';\n }\n return $condition.' ? '.$value_if_true.' : '.$value_if_false;\n }", "#[@test]\n public function assignment() {\n $this->assertEquals(array(new AssignmentNode(array(\n 'variable' => new VariableNode('a'),\n 'expression' => new TernaryNode(array(\n 'condition' => new VariableNode('argc'),\n 'expression' => new VariableNode('args0'),\n 'conditional' => new IntegerNode('1')\n )),\n 'op' => '='\n ))), $this->parse('\n $a= $argc ? $args0 : 1;\n '));\n }", "public function process_token($stackPtr)\n {\n $token = $this->tokens[$stackPtr];\n // Check if the condition for the ternary is bracketed.\n $prev = $this->phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, \\true);\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$prev]['code']) {\n if (!isset($this->tokens[$prev]['parenthesis_opener'])) {\n return;\n }\n $opener = $this->tokens[$prev]['parenthesis_opener'];\n $closer = $prev;\n } elseif (isset($token['nested_parenthesis'])) {\n $opener = Parentheses::getLastOpener($this->phpcsFile, $stackPtr);\n $closer = Parentheses::getLastCloser($this->phpcsFile, $stackPtr);\n $next_statement_closer = BCFile::findEndOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_CLOSE_PARENTHESIS, \\T_CLOSE_SQUARE_BRACKET));\n if (\\false !== $next_statement_closer && $next_statement_closer < $closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n $prev_statement_closer = BCFile::findStartOfStatement($this->phpcsFile, $stackPtr, array(\\T_COLON, \\T_OPEN_PARENTHESIS, \\T_OPEN_SQUARE_BRACKET));\n if (\\false !== $prev_statement_closer && $opener < $prev_statement_closer) {\n // Parentheses are unrelated to the ternary.\n return;\n }\n if ($closer > $stackPtr) {\n $closer = $stackPtr;\n }\n } else {\n // No parenthesis found, can't determine where the conditional part of the ternary starts.\n return;\n }\n $startPos = $opener;\n do {\n $hasAssignment = $this->phpcsFile->findNext($this->assignment_tokens, $startPos + 1, $closer);\n if (\\false === $hasAssignment) {\n return;\n }\n // Examine whether the left side is a variable.\n $hasVariable = \\false;\n $conditionStart = $startPos;\n $altConditionStart = $this->phpcsFile->findPrevious($this->condition_start_tokens, $hasAssignment - 1, $startPos);\n if (\\false !== $altConditionStart) {\n $conditionStart = $altConditionStart;\n }\n for ($i = $hasAssignment; $i > $conditionStart; $i--) {\n if (isset(Tokens::$emptyTokens[$this->tokens[$i]['code']])) {\n continue;\n }\n // If this is a variable or array, we've seen all we need to see.\n if (\\T_VARIABLE === $this->tokens[$i]['code'] || \\T_CLOSE_SQUARE_BRACKET === $this->tokens[$i]['code']) {\n $hasVariable = \\true;\n break;\n }\n // If this is a function call or something, we are OK.\n if (\\T_CLOSE_PARENTHESIS === $this->tokens[$i]['code']) {\n break;\n }\n }\n if (\\true === $hasVariable) {\n $this->phpcsFile->addWarning('Variable assignment found within a condition. Did you mean to do a comparison?', $hasAssignment, 'FoundInTernaryCondition');\n }\n $startPos = $hasAssignment;\n } while ($startPos < $closer);\n }", "public function orElse($alternative);", "function sif($condition,$true_value,$false_value)\n{\n\treturn $condition?$true_value:$false_value;\n}", "public function expression(){\n try {\n // Sparql11query.g:375:3: ( conditionalOrExpression ) \n // Sparql11query.g:376:3: conditionalOrExpression \n {\n $this->pushFollow(self::$FOLLOW_conditionalOrExpression_in_expression1283);\n $this->conditionalOrExpression();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function yy_r144(){$this->_retvalue = '==='; }", "public function getOrElse($default);", "function if_else(callable $cond): Closure\n{\n return function (callable $then) use ($cond) {\n return function (callable $else) use ($cond, $then) {\n return function ($value) use ($cond, $then, $else) {\n return $cond($value) ? $then($value) : $else($value);\n };\n };\n };\n}", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "function isset_or(&$var, $or = null) {\n return isset($var) ? $var : $or;\n}", "protected function convertTernaries($template)\n\t{\n\t\t$old = $template;\n\t\t$template = preg_replace_callback(\n\t\t\t'(<xf:if is=\"[^\"]+\">[^<]*(?:<xf:else[^>]*?/>[^<]*)*</xf:if>)',\n\t\t\tfunction ($m)\n\t\t\t{\n\t\t\t\treturn $this->convertTernary($m[0]);\n\t\t\t},\n\t\t\t$template\n\t\t);\n\t\tif ($template !== $old)\n\t\t{\n\t\t\t$template = $this->convertTernaries($template);\n\t\t}\n\n\t\treturn $template;\n\t}", "public function isShortTernary(File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n if (isset($tokens[$stackPtr]) === false\n || $tokens[$stackPtr]['code'] !== \\T_INLINE_THEN\n ) {\n return false;\n }\n\n $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);\n if ($nextNonEmpty === false) {\n // Live coding or parse error.\n return false;\n }\n\n if ($tokens[$nextNonEmpty]['code'] === \\T_INLINE_ELSE) {\n return true;\n }\n\n return false;\n }", "public function conditional( $cond, $trueVal, $falseVal ) {\n\t\tif ( is_array( $cond ) ) {\n\t\t\t$cond = $this->makeList( $cond, LIST_AND );\n\t\t}\n\n\t\treturn \" (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) \";\n\t}", "function ternaryCheckout($number)\n{\n $result = ($number <= 12) ? \"express lane\" :\"regular lane\";\n return $result; \n}", "public function visitConditional(Node $node): UnionType\n {\n $cond_node = $node->children['cond'];\n $cond_truthiness = self::checkCondUnconditionalTruthiness($cond_node);\n // For the shorthand $a ?: $b, the cond node will be the truthy value.\n // Note: an ast node will never be null(can be unset), it will be a const AST node with the name null.\n $true_node = $node->children['true'] ?? $cond_node;\n $false_node = $node->children['false'];\n\n // Rarely, a conditional will always be true or always be false.\n if ($cond_truthiness !== null) {\n // TODO: Add no-op checks in another PR, if they don't already exist for conditional.\n if ($cond_truthiness) {\n // The condition is unconditionally true\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $true_node,\n $this->should_catch_issue_exception\n );\n } else {\n // The condition is unconditionally false\n\n // Add the type for the 'false' side\n return UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n }\n }\n if ($true_node !== $cond_node) {\n // Visit the condition to check for undefined variables.\n UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $cond_node,\n $this->should_catch_issue_exception\n );\n }\n // TODO: emit no-op if $cond_node is a literal, such as `if (2)`\n // - Also note that some things such as `true` and `false` are \\ast\\AST_NAME nodes.\n\n if ($cond_node instanceof Node) {\n $base_context = $this->context;\n // TODO: Use different contexts and merge those, in case there were assignments or assignments by reference in both sides of the conditional?\n // Reuse the BranchScope (sort of unintuitive). The ConditionVisitor returns a clone and doesn't modify the original.\n $base_context_scope = $this->context->getScope();\n if ($base_context_scope instanceof GlobalScope) {\n $base_context = $base_context->withScope(new BranchScope($base_context_scope));\n }\n // Doesn't seem to be necessary to run BlockAnalysisVisitor\n // $base_context = (new BlockAnalysisVisitor($this->code_base, $base_context))->__invoke($cond_node);\n $true_context = (new ConditionVisitor(\n $this->code_base,\n isset($node->children['true']) ? $base_context : $this->context // special case: $c = (($d = foo()) ?: 'fallback')\n ))->__invoke($cond_node);\n $false_context = (new NegatedConditionVisitor(\n $this->code_base,\n $base_context\n ))->__invoke($cond_node);\n\n if (!isset($node->children['true'])) {\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $false_node,\n $this->should_catch_issue_exception\n );\n if ($false_node instanceof Node && BlockExitStatusChecker::willUnconditionallyThrowOrReturn($false_node)) {\n return $true_type->nonFalseyClone();\n }\n\n $true_type_is_empty = $true_type->isEmpty();\n if (!$false_type->isEmpty()) {\n // E.g. `foo() ?: 2` where foo is nullable or possibly false.\n if ($true_type->containsFalsey()) {\n $true_type = $true_type->nonFalseyClone();\n }\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type_is_empty xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }\n } else {\n $true_context = $this->context;\n $false_context = $this->context;\n }\n // Postcondition: This is (cond_expr) ? (true_expr) : (false_expr)\n\n $true_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $true_context,\n $true_node,\n $this->should_catch_issue_exception\n );\n\n $false_type = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $false_context,\n $node->children['false'],\n $this->should_catch_issue_exception\n );\n if ($false_type->isNeverType()) {\n return $true_type;\n }\n if ($true_type->isNeverType()) {\n return $false_type;\n }\n\n // Add the type for the 'true' side to the 'false' side\n $union_type = $true_type->withUnionType($false_type);\n\n // If one side has an unknown type but the other doesn't\n // we can't let the unseen type get erased. Unfortunately,\n // we need to add 'mixed' in so that we know it could be\n // anything at all.\n //\n // See Issue #104\n if ($true_type->isEmpty() xor $false_type->isEmpty()) {\n $union_type = $union_type->withType(\n MixedType::instance(false)\n );\n }\n\n return $union_type;\n }", "public function addElseIf(BooleanExpression $expression)\n\t{\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$can_eval = $expression->canEvaluate();\n\n\t\tif ($can_eval)\n\t\t{\n\t\t\t$result = $this->evaluate($expression);\n\n\t\t\t// If not all previous ones have evaluated, then we can't\n\t\t\t// make a determination on a true branch since a previous one may\n\t\t\t// also be true. However, we do know that subsequent ones cannot be\n\t\t\t// reached, so we can remove them. This then becomes the else branch,\n\t\t\t// making it easy to parse on subsequent passes.\n\t\t\tif ( ! $this->all_previous_could_eval && $result == TRUE)\n\t\t\t{\n\t\t\t\t$this->parser->output('{if:else}');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->parser->outputLastAnnotation();\n\t\t\t$this->outputCondition($expression->stringify());\n\t\t}\n\n\t\t$this->setLastCouldEval($can_eval);\n\n\t\treturn $this->shouldAddBody();\n\t}", "private function postfixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // (a ? b : c) op != a ? b : c op in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a bop b)\n // (a bop b) op != a bop b op if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a bop (b) op == a bop b op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // (a uop) op == a uop op in all cases\n return false;\n }\n // let (expr) == (uop a)\n // check if uop (a) op == uop a op\n return $this->postfixExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "protected function evaluateBoolStatement()\n {\n /**\n * If expression contains only 1 math block - return as math expression result,\n * otherwise cast type of result to boolean\n */\n $result = $this->evaluateBoolExpression();\n while ($booleanOp = $this->readChar(true)) {\n switch ($booleanOp) {\n case '|':\n $nextChar = $this->readChar();\n if ($nextChar == '|') {\n if ($result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('||', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n case '&':\n $nextChar = $this->readChar();\n if ($nextChar == '&') {\n if (!$result->toBool()) {\n // in order to reduce amount of calculations,\n // skip the rest of expression and return result\n $this->rewindUntil([';', ')'], '(');\n $this->unreadChar();\n return $result;\n }\n $result->join('&&', $this->evaluateBoolExpression());\n } else {\n throw new \\Exception('Unexpected token \"' . $booleanOp . $nextChar . '\".');\n }\n break;\n // end of argument\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $booleanOp . '\".');\n break;\n }\n }\n return $result;\n }", "public function getTernaryMethod($testMethod = null, $method = null)\n {\n /**\n * Get a method that return current date-time if $testMethod applied on it return true,\n * else return the result of $method called on it.\n *\n * @param string $testMethod method for the condition.\n * @param string $method method to apply if condition is false.\n *\n * @return \\Carbon\\Carbon|\\Carbon\\CarbonImmutable|\\Carbon\\CarbonInterface\n */\n return static function () use ($testMethod, $method) {\n $date = static::this();\n\n return $date->$testMethod() ? $date : $date->$method();\n };\n }", "private function boolArg($value)\n {\n return ($value ? 1 : null);\n }", "public function visitConditionalStatement(\n /*IConditionalStatement*/ $node) /*: mixed*/ {\n $condition = /*(string)*/$node->getCondition()->accept($this);\n $this->blockIndent = ' ';\n $true_block = /*(string)*/$node->getTrueBlock()->accept($this);\n $this->blockIndent = ' ';\n $false_block = /*(string)*/$node->getFalseBlock()->accept($this);\n $result = $this->indent.'if ('.$condition.')'.$true_block;\n if ($false_block !== '') {\n $result .= ' else'.$false_block;\n }\n return $result.\"\\n\";\n }", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "public function orNull();", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "function yy_r51(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }", "public function testMissingMiddleExpression5dot2()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php', '5.2-5.4');\n $this->assertError($this->_sniffFile, 8,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n $this->assertError($this->_sniffFile, 10,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n }", "function yy_r138(){$this->_retvalue = '=='; }", "public function addElse()\n\t{\n\t\t// Don't process if done or we've encountered a condition\n\t\t// that evaluated to TRUE. Even if other ones have not been\n\t\t// evaluated, that one will shortcut our else, so we prune\n\t\t// the else branch.\n\t\tif ($this->isDone() || $this->encountered_true_condition)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ( ! $this->all_previous_could_eval)\n\t\t{\n\t\t\t$this->parser->output('{if:else}');\n\t\t}\n\n\t\t$this->last_result = TRUE;\n\t\t$this->setLastCouldEval(TRUE);\n\n\t\treturn $this->shouldAddBody();\n\t}", "function array_if($arr,$op,$val) {\n\t$ret = TRUE;\n\tfor($a=0;$a<count($arr);$a++) {\n\t\t$if = 'if( '.$arr[$a].' '.$op.' '.$val.' ) { return TRUE; } else { return FALSE; }';\n\t\t$if = eval($if);\n\t\tif(!$if && $ret) $ret = FALSE;\n\t}\n\n\treturn $ret;\n}", "private function prefixExprNeedsParentheses(\n /*UnaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (expr) == (a ? b : c)\n // op (a ? b : c) != op a ? b : c in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (expr) == (a bop b)\n // op (a bop b) != op a bop b if\n if (UnaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if op (a) bop b == op a bop b\n return $this->prefixExprNeedsParentheses($op, $expr->getExpression1());\n }\n if ($expr instanceof UnaryOpExpression) {\n switch ($expr->getOperation()) {\n case UnaryOperators::PHP_ARRAY_APPEND_POINT_OP:\n case UnaryOperators::PHP_POST_DECREMENT_OP:\n case UnaryOperators::PHP_POST_INCREMENT_OP:\n // let (expr) == (a uop)\n // op (a uop) op != op a uop if\n return $op == UnaryOperators::PHP_CLONE_OP;\n }\n // let (expr) == (uop a)\n // op (uop a) == op uop a in all cases\n return false;\n }\n return false;\n }", "public function conditionalOrExpression(){\n try {\n // Sparql11query.g:382:3: ( conditionalAndExpression ( OR conditionalAndExpression )* ) \n // Sparql11query.g:383:3: conditionalAndExpression ( OR conditionalAndExpression )* \n {\n $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1301);\n $this->conditionalAndExpression();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:383:28: ( OR conditionalAndExpression )* \n //loop48:\n do {\n $alt48=2;\n $LA48_0 = $this->input->LA(1);\n\n if ( ($LA48_0==$this->getToken('OR')) ) {\n $alt48=1;\n }\n\n\n switch ($alt48) {\n \tcase 1 :\n \t // Sparql11query.g:383:29: OR conditionalAndExpression \n \t {\n \t $this->match($this->input,$this->getToken('OR'),self::$FOLLOW_OR_in_conditionalOrExpression1304); \n \t $this->pushFollow(self::$FOLLOW_conditionalAndExpression_in_conditionalOrExpression1306);\n \t $this->conditionalAndExpression();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop48;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "private function leftExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($expr instanceof ConditionalExpression) {\n // let (x) == (a ? b : c)\n // (a ? b : c) op y != a ? b : c op y in all cases\n return true;\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (x) == (a op1 b)\n // (a op1 b) op y != a op1 b op y if\n if (BinaryOperators::hasPriority($op, $expr->getOperation())) {\n return true;\n }\n // check if a op1 (b) op y == a op1 b op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression2());\n }\n if ($expr instanceof UnaryOpExpression) {\n // let (x) == (!a)\n // (!a) op y != !a op y if\n if ($expr->getOperation() == UnaryOperators::PHP_NOT_OP &&\n BinaryOperators::hasPriority(\n $op, BinaryOperators::PHP_MULTIPLY)) {\n return true;\n }\n // check if !(a) op y == !a op y\n return $this->leftExprNeedsParentheses($op, $expr->getExpression());\n }\n return false;\n }", "function coalesce($value, $default1=null, $default2=false, $default3=false, $default4=false) {\n return isnull(isnull(isnull(isnull($value, $default1), $default2), $default3), $default4);\n }", "public function isNullable(): ?bool;", "function yy_r139(){$this->_retvalue = '!='; }", "function taptap(mixed $value, callable $callback = null): mixed\n {\n return tap(tap($value, $callback));\n }", "private function rightExprNeedsParentheses(\n /*BinaryOperator*/ $op, /*IExpression*/ $expr) /* : bool */ {\n if ($op == BinaryOperators::PHP_ARRAY_ELEMENT) {\n // x[y] == x[(y)]\n return false;\n }\n if ($expr instanceof ConditionalExpression) {\n // let (y) == (a ? b : c)\n // x op (a ? b : c) != x op a ? b : c if\n return $this->rightExprNeedsParentheses(\n $op, $expr->getCondition());\n }\n if ($expr instanceof BinaryOpExpression) {\n // let (y) == (a op1 b)\n // x op (a op1 b) != x op a op1 b if\n if (!BinaryOperators::hasPriority($expr->getOperation(), $op)) {\n return true;\n }\n // check if x op (a) op1 b == x op a op1 b\n return $this->rightExprNeedsParentheses($op, $expr->getExpression1());\n }\n\n // don't worry about unary operations:\n // prefix unaries do not have left operands hence\n // x op (uop a) == x op uop a in all cases.\n // postfix unaries trump binaries that get here hence\n // x op (a uop) == x op a uop in all cases.\n return false;\n }", "#[@test]\n public function boolCast() {\n $this->assertSourcecodeEquals(\n '$s= (bool)$num;',\n $this->emit('$s= (bool)$num;')\n );\n }", "function iif($e, $t, $f){\r\n\t\tif($e){\r\n\t\t\treturn $t;\r\n\t\t}else{\r\n\t\t\treturn $f;\r\n\t\t}\r\n\t}", "public static function trueOrNull($value)\n {\n return ($value == 1) ? 1 : null;\n }", "function issetor(&$variable, $placeholder = ''){\n if(isset($variable)){\n return $variable;\n } else {\n return $placeholder;\n }\n}", "function stage_string_to_bool($string)\n{\n return is_bool($string) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string );\n}", "protected function evaluate($expression)\n\t{\n\t\t$result = (bool) $expression->evaluate();\n\n\t\tif ($result === TRUE)\n\t\t{\n\t\t\t$this->encountered_true_condition = TRUE;\n\t\t}\n\n\t\t$this->last_result = $result;\n\n\t\treturn $result;\n\t}", "public function fnParseMaybeConditional($oNoIn=null, $oRefDestructuringErrors=null) \n {\n $iStartPos = $this->iStart;\n $oStartLoc = $this->oStartLoc;\n $oExpr = $this->fnParseExprOps($oNoIn, $oRefDestructuringErrors);\n if ($this->fnCheckExpressionErrors($oRefDestructuringErrors)) \n return $oExpr;\n if ($this->fnEat(TokenTypes::$aTypes['question'])) {\n $oNode = $this->fnStartNodeAt($iStartPos, $oStartLoc);\n $oNode->oTest = $oExpr;\n $oNode->oConsequent = $this->fnParseMaybeAssign();\n $this->fnExpect(TokenTypes::$aTypes['colon']);\n $oNode->oAlternate = $this->fnParseMaybeAssign(noIn);\n return $this->fnFinishNode($oNode, \"ConditionalExpression\");\n }\n return $oExpr;\n }", "function example67($a, $b, $c, $x, $y) {\n return [\n 1 ? 0 : 1 ? 3 : 0,\n $a ? $b : $c ? $x : $y,\n 1 ? 0 : 1 ?: 0,\n $a ? $b : $c ?: $x,\n $a ?: $b ? $c : $undefined,\n 1 ?: 0 ? 1 : 0,\n\n // These have parentheses, and Phan should not warn\n ($a ? $b : $c) ? $x : $y,\n $a ? $b : ($c ? $x : $y),\n ($a ? $b : $c) ?: $x,\n ($a ?: $b) ? $c : $x,\n // The parsing order doesn't affect the behavior, so Phan should not warn.\n $a ?: $c ?: $x,\n ($a ?: $c) ?: $undefined,\n ];\n}", "function bool_val(string $key, bool $default = null): ?bool\n{\n $val = env($key, $default);\n\n if ($val === null) {\n return $default;\n }\n\n if ($val === 'false') {\n return false;\n }\n\n if ($val === '[]') {\n return false;\n }\n\n if ($val === '{}') {\n return false;\n }\n\n return boolval($val);\n}", "public function testMissingMiddleExpression5dot3()\n {\n $this->_sniffFile = $this->sniffFile('sniff-examples/ternary_operator.php', '5.3');\n $this->assertNoViolation($this->_sniffFile, 8,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n $this->assertNoViolation($this->_sniffFile, 10,\n \"Middle may not be omitted from ternary operators in PHP < 5.3\");\n }", "function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}", "function pseudoTypeFalse(false $var = false) {}", "public function parseConditionals($text, $data, $callback)\n {\n // Added by Ivan Tcholakov, 24-JAN-2016.\n $no_value = new Parser_Lex_No_Value;\n //\n\n $this->setupRegex();\n preg_match_all($this->conditionalRegex, $text, $matches, PREG_SET_ORDER);\n\n $this->conditionalData = $data;\n\n /**\n * $matches[][0] = Full Match\n * $matches[][1] = Either 'if', 'unless', 'elseif', 'elseunless'\n * $matches[][2] = Condition\n */\n foreach ($matches as $match) {\n $this->inCondition = true;\n\n $condition = $match[2];\n\n // Extract all literal string in the conditional to make it easier\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n $condition = preg_replace($this->conditionalNotRegex, '$1!$2', $condition);\n\n if (preg_match_all($this->conditionalExistsRegex, $condition, $existsMatches, PREG_SET_ORDER)) {\n foreach ($existsMatches as $m) {\n $exists = 'true';\n // Modified by Ivan Tcholakov, 24-JAN-2016.\n //if ($this->getVariable($m[2], $data, '__doesnt_exist__') === '__doesnt_exist__') {\n if ($this->getVariable($m[2], $data, $no_value) === $no_value) {\n //\n $exists = 'false';\n }\n $condition = $this->createExtraction('__cond_exists', $m[0], $m[1].$exists.$m[3], $condition);\n }\n }\n\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n\n if ($callback) {\n $condition = preg_replace('/\\b(?!\\{\\s*)('.$this->callbackNameRegex.')(?!\\s+.*?\\s*\\})\\b/', '{$1}', $condition);\n $condition = $this->parseCallbackTags($condition, $data, $callback);\n }\n\n // Re-extract the strings that have now been possibly added.\n if (preg_match_all('/([\"\\']).*?(?<!\\\\\\\\)\\1/', $condition, $str_matches)) {\n foreach ($str_matches[0] as $m) {\n $condition = $this->createExtraction('__cond_str', $m, $m, $condition);\n }\n }\n\n\n // Re-process for variables, we trick processConditionVar so that it will return null\n $this->inCondition = false;\n $condition = preg_replace_callback('/\\b('.$this->variableRegex.')\\b/', array($this, 'processConditionVar'), $condition);\n $this->inCondition = true;\n\n // Re-inject any strings we extracted\n $condition = $this->injectExtractions($condition, '__cond_str');\n $condition = $this->injectExtractions($condition, '__cond_exists');\n\n $conditional = '<?php ';\n\n if ($match[1] == 'unless') {\n $conditional .= 'if ( ! ('.$condition.'))';\n } elseif ($match[1] == 'elseunless') {\n $conditional .= 'elseif ( ! ('.$condition.'))';\n } else {\n $conditional .= $match[1].' ('.$condition.')';\n }\n\n $conditional .= ': ?>';\n\n $text = preg_replace('/'.preg_quote($match[0], '/').'/m', addcslashes($conditional, '\\\\$'), $text, 1);\n }\n\n $text = preg_replace($this->conditionalElseRegex, '<?php else: ?>', $text);\n $text = preg_replace($this->conditionalEndRegex, '<?php endif; ?>', $text);\n\n $text = $this->parsePhp($text);\n $this->inCondition = false;\n\n return $text;\n }", "public function whenTrue($truthy_value, callable $callback, callable $default=null);", "function emptyCoalesce($data, $default = null)\n {\n return ($data === null || $data === false) ? $default : $data;\n }", "protected function evaluateBoolExpression()\n {\n $result = $this->evaluateMathBlock();\n while ($mathOp = $this->readChar(true)) {\n switch ($mathOp) {\n case '+':\n $result->join('+', $this->evaluateMathBlock());\n break;\n case '-': \n $result->join('-', $this->evaluateMathBlock());\n break;\n case '=':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('==', $this->evaluateMathBlock());\n } elseif ($nextChar == '>') {\n $this->unreadChar(2);\n return $result;\n break;\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '!':\n $nextChar = $this->readChar();\n if ($nextChar == '=') {\n $result->join('!=', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case '>':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('>=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('>', $this->evaluateMathBlock());\n }\n break;\n case '<':\n $nextChar = $this->readChar();\n if ($nextChar == '=') { \n $result->join('<=', $this->evaluateMathBlock());\n } else {\n $this->unreadChar(); \n $result->join('<', $this->evaluateMathBlock());\n }\n break;\n case 'i': // find in set\n $nextChar = $this->readChar(true);\n if ($nextChar == 'n') { \n $result->join('in', $this->evaluateMathBlock());\n } else {\n throw new \\Exception('Unexpected token \"' . $mathOp . $nextChar . '\".');\n }\n break;\n case 'l': // check against regex\n $this->evaluateLikeExpression($result);\n break;\n // Lower lever operators\n case '&': // boolean \"and\" &&\n case '|': // boolean \"or\" ||\n // end of argument or statement\n case ',':\n // end of subexpression\n case ')':\n // end of statement\n case ';': \n // array value parsed\n case ']':\n $this->unreadChar();\n // return result from recursive call\n return $result;\n break;\n default:\n throw new \\Exception('Unexpected token \"' . $mathOp . '\".');\n break;\n }\n }\n return $result;\n }", "public function unwrapOr(mixed $default): mixed\n {\n if ($this->isOk()) {\n return $this->value;\n }\n\n return $default;\n }", "function testRuleAppliesToMultilevelIfConditions()\n{\n if (1 || 0) { // not applied\n if (1 == 1 || $foo = 'baz') { // applied\n // ...\n } elseif (1 != array() && 'foo' != 'baz' && $bar = 'baz') { // applied\n // ...\n } elseif (1 % 2 !== !false && $baz = 1 + 1 + 1 - 3) { // applied\n // ...\n if ($foo == 'baz') { // not applied\n // ...\n if (3 - 2 == 3) { // not applied\n // ...\n if (true) { // not applied\n // ...\n if (1) { // not applied\n // ...\n } elseif ($foo = 1) { // applied\n // ...\n } elseif ($foo = 2) { // applied\n // ...\n } elseif (5 % 5 == 0) { // not applied\n // ...\n }\n }\n }\n }\n }\n }\n if (1 == 1 || 1 && 0 and 4 % 2 || ($foo = 1) xor 5 * 4 * 3 * 2 * 1) { // applied\n // ...\n }\n}", "function coalescenull($value, $default1) {\n if (is_null($value)) {\n return $default1;\n } else {\n return $value;\n }\n }", "public function evaluateCondition($value)\n {\n return is_object($value) ||\n !(is_null($value) || (is_string($value) && strlen($value) == 0));\n }", "function printyn ($val) {\n\treturn ($val ? 'yes':'no');\n}", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "public function isBinaryOperator(int $index): bool\n {\n static $nonArrayOperators = [\n '=' => true,\n '*' => true,\n '/' => true,\n '%' => true,\n '<' => true,\n '>' => true,\n '|' => true,\n '^' => true,\n '.' => true,\n ];\n\n static $potentialUnaryNonArrayOperators = [\n '+' => true,\n '-' => true,\n '&' => true,\n ];\n\n static $arrayOperators;\n\n if (null === $arrayOperators) {\n $arrayOperators = [\n T_AND_EQUAL => true, // &=\n T_BOOLEAN_AND => true, // &&\n T_BOOLEAN_OR => true, // ||\n T_CONCAT_EQUAL => true, // .=\n T_DIV_EQUAL => true, // /=\n T_DOUBLE_ARROW => true, // =>\n T_IS_EQUAL => true, // ==\n T_IS_GREATER_OR_EQUAL => true, // >=\n T_IS_IDENTICAL => true, // ===\n T_IS_NOT_EQUAL => true, // !=, <>\n T_IS_NOT_IDENTICAL => true, // !==\n T_IS_SMALLER_OR_EQUAL => true, // <=\n T_LOGICAL_AND => true, // and\n T_LOGICAL_OR => true, // or\n T_LOGICAL_XOR => true, // xor\n T_MINUS_EQUAL => true, // -=\n T_MOD_EQUAL => true, // %=\n T_MUL_EQUAL => true, // *=\n T_OR_EQUAL => true, // |=\n T_PLUS_EQUAL => true, // +=\n T_POW => true, // **\n T_POW_EQUAL => true, // **=\n T_SL => true, // <<\n T_SL_EQUAL => true, // <<=\n T_SR => true, // >>\n T_SR_EQUAL => true, // >>=\n T_XOR_EQUAL => true, // ^=\n T_SPACESHIP => true, // <=>\n T_COALESCE => true, // ??\n T_COALESCE_EQUAL => true, // ??=\n ];\n }\n\n $tokens = $this->tokens;\n $token = $tokens[$index];\n\n if ($token->isGivenKind([T_INLINE_HTML, T_ENCAPSED_AND_WHITESPACE, CT::T_TYPE_INTERSECTION])) {\n return false;\n }\n\n if (isset($potentialUnaryNonArrayOperators[$token->getContent()])) {\n return !$this->isUnaryPredecessorOperator($index);\n }\n\n if ($token->isArray()) {\n return isset($arrayOperators[$token->getId()]);\n }\n\n if (isset($nonArrayOperators[$token->getContent()])) {\n return true;\n }\n\n return false;\n }", "function coalesce(&$var, $default = null)\r\n {\r\n return isset($var) && !is_null($var) ? $var : $default;\r\n }", "function return_if($condition, $value)\n {\n if ($condition) {\n return $value;\n }\n }", "private static function _parse_condition_comparison($params, $operator, &$prepared_values)\n\t{\n\t\tif (count($params) < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$type = $params[3] ?? null;\n\t\t$val = self::_convert_data($params[2], $type, $prepared_values);\n\t\treturn $operator . ' ' . $val;\n\t}", "public function conditionalAndExpression(){\n try {\n // Sparql11query.g:389:3: ( valueLogical ( AND valueLogical )* ) \n // Sparql11query.g:390:3: valueLogical ( AND valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1326);\n $this->valueLogical();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:390:16: ( AND valueLogical )* \n //loop49:\n do {\n $alt49=2;\n $LA49_0 = $this->input->LA(1);\n\n if ( ($LA49_0==$this->getToken('AND')) ) {\n $alt49=1;\n }\n\n\n switch ($alt49) {\n \tcase 1 :\n \t // Sparql11query.g:390:17: AND valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1329); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1331);\n \t $this->valueLogical();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop49;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function bool ($value)\r\n{\r\n\tif ($value === true || $value === false)\r\n\t\treturn $value;\r\n\r\n\treturn $value === 'true' || ($value !== 'false' && !!$value);\r\n}", "abstract public function is_correct( $a, $comparison_operator, $b );", "protected function check_first_operand($node, &$is_alternative = false) {\n $parent = $this->get_parent_node($this->tree, $node->id);\n if ($parent != null) {\n if ($parent->type == qtype_preg_node::TYPE_NODE_ALT) {\n $is_alternative = true;\n }\n $index = array_search($node, $parent->operands);\n if (($index === false || $index !== 0) && !$is_alternative) {\n return false;\n }\n return $this->check_first_operand($parent, $is_alternative);\n }\n\n return true;\n }", "protected function getDefaultValue( $value )\n\t{\n\t\tif ( $value instanceof Expression )\n\t\t{\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( is_bool( $value ) )\n\t\t{\n\t\t\treturn \"'\" . (int) $value . \"'\";\n\t\t}\n\n\t\treturn \"'\" . strval( $value ) . \"'\";\n\t}", "private function if_expr(&$match) {\r\n\t\r\n\r\n\t\t//if it's IF .. \r\n\t\tif (strtolower(trim($match[1])) == 'if') {\r\n\t\t\r\n\t\t\t$result .= 'if ('; \r\n\t\t\t\r\n\t\t}elseif(strtolower(trim($match[1])) == 'elseif') {\r\n\t\t\r\n\t\t\t$result .= '} elseif('; \r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t///its for loop or just normal if .. [ loop begin with __\r\n\t\tif (strpos($match[2], '__') !== false) {\r\n\t\t\r\n\t\t\t$val = str_replace('__','',$match[2]);\r\n\t\t\t$result .= '$this->value[\\''.trim($val).'\\']'; \r\n\t\t\t\r\n\t\t}else{\r\n\t\t\r\n\t\t\t$result .= '$this->vars[\\''.trim($match[2]).'\\']'; \r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//so , now experssions signs .. \r\n\t\t\r\n\t\tif (!empty($match[3])) {\r\n\t\t\r\n\t\t\t$expr = trim(strtolower($match[3]));\r\n\t\t\t\r\n\t\t\t\tswitch($expr) {\r\n\t\t\t\t\tcase '==':\r\n\t\t\t\t\tcase 'eq':\r\n\t\t\t\t\t$expr_is = '==';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '!=':\r\n\t\t\t\t\tcase '<>':\r\n\t\t\t\t\tcase 'ne':\r\n\t\t\t\t\tcase 'neq':\r\n\t\t\t\t\t$expr_is = '!=';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '<':\r\n\t\t\t\t\tcase 'lt':\r\n\t\t\t\t\t$expr_is = '<';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '<=':\r\n\t\t\t\t\tcase 'le':\r\n\t\t\t\t\tcase 'lte':\r\n\t\t\t\t\t$expr_is = '<=';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '>':\r\n\t\t\t\t\tcase 'gt':\r\n\t\t\t\t\t$expr_is = '>';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '>=':\r\n\t\t\t\t\tcase 'ge':\r\n\t\t\t\t\tcase 'gte':\r\n\t\t\t\t\t$expr_is = '>=';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '&&':\r\n\t\t\t\t\tcase 'and':\r\n\t\t\t\t\t$expr_is = '&&';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '||':\r\n\t\t\t\t\tcase 'or':\r\n\t\t\t\t\t$expr_is = '||';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '!':\r\n\t\t\t\t\tcase 'not':\r\n\t\t\t\t\t$expr_is = '!';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase '%':\r\n\t\t\t\t\tcase 'mod':\r\n\t\t\t\t\t$expr_is = '%';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t$expr_is = $expr;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$result .= ' ' . $expr_is . ' '; \r\n\t\t}\r\n\t\t\r\n\t\t//whats match4 .. its something cant change it now .. i will do something good with it later .. \r\n\t\t\r\n\t\t\t\t$result .= $match[4];\r\n\t\t\t\t\r\n\t\t\t\t//some .. additions\r\n\t\t\t\t$result .= '){';\r\n\t\t\r\n\t\r\n\t\t//return it \r\n\t\treturn '<?php '.$result. '?>';\r\n\t}", "public function logicalOperator($operator = null);", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "public function if_($sql_test){\r\n $this->throwExceptionIfNotSQLTest($sql_test);\r\n return SQLIFFunction::IfTrueThat($sql_test,$this,new SQLNull());\r\n }", "protected function getConditional($condition){\n\t\t$condition=(string)$condition;\n\t\tif($condition[0]=='!'){\n\t\t\t//取反\n\t\t\treturn !$this->getConditional(substr($condition,1));\n\t\t}\n\t\tif(false && $this->conditionalMode){\n\t\t\t/*\n\t\t\t * eval模式\n\t\t\t * 删除一些可能被用户操作的危险全局变量/eval和全局变量一起使用是超级危险的\n\t\t\t */\n\t\t\t/*\n\t\t\tif(strpos($condition,'$')!==false){\n\t\t\t\tthrow new \\Exception('为安全起见:条件编译不能包含变量'.$condition);\n\t\t\t}\n\t\t\t//组成php代码|return (1 && 22 || 33);\n\t\t\t$condition=\"return ({$condition});\";\n\t\t\t//$res=@eval($condition);\n\t\t\t//$res=eval($condition);\n\t\t\t*/\n\t\t\t$res=false;\n\t\t\treturn $res;\n\t\t}else{\n\t\t\t/*@var $self \\qingtpl\\Compiler */\n\t\t\t$self=$this;\n\t\t\t/*\n\t\t\t * #安全模式:\n\t\t\t * - 只支持常量:APP_DEBUG\n\t\t\t * - 函数?\n\t\t\t * - 模版变量/模版宏定义\n\t\t\t */\n\t\t\tif(defined($condition)){\n\t\t\t\t//#常量\n\t\t\t\treturn (bool)constant($condition);\n\t\t\t}else if($self->hasConst($condition)){\n\t\t\t\t//#模版宏定义常量\n\t\t\t\treturn (bool)$self->getConst($condition);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function to_boolean ($value) {\n\tif (\n\n\t\t// Falsy\n\t\t!$value or\n\n\t\t// Empty\n\t\tempty($value) or\n\n\t\t// Zero or less\n\t\t(is_numeric($value) and strval($value) <= 0) or\n\n\t\t// Keyword\n\t\t(is_string($value) and in_array(trim(strtolower($value)), array('null', 'nul', 'nil', 'false')))\n\n\t) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function apply_condition($node, $cond){\n\tif(empty($cond)){\n\t\treturn NULL;\n\t}\n\n\t// vytazeni vsech poduzlu, pokud jsou\n\t$left = apply_condition($node, $cond->left);\n\t$right = apply_condition($node, $cond->right);\n\n\tswitch($cond->type){\n\t\tcase \"op\":\n\t\t\tswitch($cond->value){\n\t\t\t\tcase \"<\":\n\t\t\t\tcase \">\":\n\t\t\t\tcase \"=\":\n\t\t\t\tcase \"CONTAINS\":\n\t\t\t\t\t// pro vsechny prvky zleva \n\t\t\t\t\tif($cond->value == '<'){\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\t\t\t\t\t\tif($left < $right)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if($cond->value == '>'){\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\t\t\t\t\t\tif($left > $right)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if($cond->value == '='){\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\t\t\t\t\t\tif($left == $right)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse if(preg_match(\"/CONTAINS/\", $cond->value)){\n\t\t\t\t\t\tif(!preg_match(\"/^\\\".*\\\"$/\",$right)){\n\t\t\t\t\t\t\tfwrite(STDERR,\"error - chyba dotazu\\n\");\n\t\t\t\t\t\t\texit(80);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$right = trim($right, \"\\\"\");\n\n\t\t\t\t\t\tif(stripos($left, $right) !== false)\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\tcase \"NOT\":\n\t\t\t\t\treturn !$left;\n\t\t\t\tdefault:\n\t\t\t\t\tfwrite(STDERR,\"error - neznamy operator ($cond->value)\\n\");\n\t\t\t\t\texit(80); \n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"lit\":\n\t\t\t// jak str tak num musi vratit obsah\n\t\t\treturn $cond->value;\n\t\tcase \"elem\":\n\t\t\t// podle vyhodnoceni typu identifikatoru se ulozi do nasledujicich promennych nazvy\n\t\t\t$elem = NULL;\n\t\t\t$attr = NULL;\n\t\t\t//je to element.atribut\n\t\t\tif(preg_match(\"/^[a-zA-Z_]([a-zA-Z0-9_\\-])*\\.[a-zA-Z_]([a-zA-Z0-9_\\-])*$/\", $cond->value)){\n\t\t\t\t$spl = explode(\".\", $cond->value);\n\t\t\t\t$elem = $spl[0];\n\t\t\t\t$attr = $spl[1];\n\t\t\t}\n\t\t\t//je to element\n\t\t\telse if(preg_match(\"/^[a-zA-Z_]([a-zA-Z0-9_\\-])*$/\", $cond->value)){\n\t\t\t\t$elem = $cond->value;\n\t\t\t}\n\t\t\t//je to atribut \n\t\t\telse if(preg_match(\"/^\\.[a-zA-Z_]([a-zA-Z0-9_\\-])*$/\", $cond->value)){\n\t\t\t\t$attr = substr($cond->value, 1);\n\t\t\t}\n\t\t\t//jinak vracim chybu\n\t\t\telse {\n\t\t\t\tfwrite(STDERR,\"error - nepodporovany element\\n\");\n\t\t\t\texit(80); \n\t\t\t}\n\n\t\t\t// uvnitr $node najit vsechny vyskyty elem.attr\n\t\t\t// vratit vsechny nalezene hodnoty\n\t\t\treturn find($node, $elem, $attr);\n\t\tdefault:\n\t\t\tfwrite(STDERR,\"error - neznamy typ\\n\");\n\t\t\texit(80); \n\t}\n}", "function if_then(callable $predicate): Closure\n{\n return function (callable $then) use ($predicate) {\n if ($predicate()) {\n $then();\n }\n };\n}", "function aquamin_is_truty_or_zero( $mixed ) {\n\treturn ( !! $mixed || is_int( $mixed ) || is_float( $mixed ) || '0' === $mixed );\n}", "protected function getValue($value)\n {\n if (is_array($value) || is_bool($value)) {\n return $value;\n }\n\n return new Expr($value);\n }", "public function mapOr(callable $f, mixed $default): mixed\n {\n if (!$this->isOk()) {\n return $default;\n }\n\n return call_user_func($f, $this->value);\n }", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "abstract public function getOrElse($key, \\Closure $default);", "public function boolean() {\n //dd($this->lookahead->type);\n if ($this->lookahead->type !== ControlFunctionLexer::BOOLEAN) {\n return null;\n }\n $bool_node = new ControlFunctionParseTree($this->lookahead->type, $this->lookahead->text);\n //dd($bool_node);\n $this->match(ControlFunctionLexer::BOOLEAN);\n return $bool_node;\n }", "function _checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id = 0)\n\t{\n\t\treturn true;\n\t}", "public function whenFalse($falsy_value, callable $callback, callable $default=null);", "function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\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 }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "static function false($X, $Alt) {\n\t\treturn $X ? $X : $Alt;\n\t}" ]
[ "0.73170257", "0.62123495", "0.6096165", "0.602557", "0.5964896", "0.5912812", "0.56614363", "0.562273", "0.5536588", "0.53484154", "0.5285165", "0.5220613", "0.502605", "0.4938618", "0.4891053", "0.48820257", "0.47877526", "0.4748484", "0.47270855", "0.47052443", "0.46943155", "0.46943086", "0.46811277", "0.46567684", "0.4590787", "0.45436677", "0.45383236", "0.45347106", "0.4533435", "0.45212656", "0.45022857", "0.44980216", "0.44817218", "0.44802904", "0.44738865", "0.44382563", "0.44256347", "0.44186983", "0.4370969", "0.43695155", "0.43664968", "0.43546557", "0.43544742", "0.43525377", "0.434464", "0.43306696", "0.43153656", "0.43133512", "0.43069547", "0.4296249", "0.42959058", "0.42768058", "0.4263518", "0.42529833", "0.4251146", "0.42313272", "0.42313188", "0.42056075", "0.42011952", "0.41947597", "0.41842538", "0.4180664", "0.41769147", "0.41651243", "0.416051", "0.41595364", "0.415066", "0.4149355", "0.41364872", "0.41313612", "0.40973946", "0.40916497", "0.40736565", "0.40703085", "0.40689316", "0.4068034", "0.40575448", "0.4051258", "0.40269408", "0.40127492", "0.4004552", "0.40035248", "0.39959052", "0.39933535", "0.39870968", "0.39725152", "0.39724603", "0.39686438", "0.39657295", "0.39588416", "0.39558166", "0.39557883", "0.3954154", "0.3949096", "0.39216122", "0.39131576", "0.39123586", "0.39099818", "0.39084688", "0.39033234" ]
0.5583868
8
mysql_close closes the nonpersistent connection to the MySQL server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is used. Open nonpersistent MySQL connections and result sets are automatically destroyed when a PHP script finishes its execution. So, while explicitly closing open connections and freeing result sets is optional, doing so is recommended. This will immediately return resources to PHP and MySQL, which can improve performance. For related information, see freeing resources
function mysql_close($link_identifier = null): void { error_clear_last(); $result = \mysql_close($link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CloseDatabase($link)\n{\n mysql_close($link);\n}", "function close($link = 0) {\n @mysql_close($link ? $link : $this->link) or $this->error(\"Connection close failed.\");\n }", "function Close() {\r\n if (!@mysql_close($this->link_id)) {\r\n $this->oops(\"Connection close failed.\");\r\n }\r\n }", "function close() {\r\n\t\tmysql_free_result($this->result);\r\n\t\tmysql_close($this->link);\r\n\t}", "public function close()\n\t{\n\t\t\n\t\t//disconnect db\n\t\tmysql_close($this->link);\n\t\t\n\t}", "public function close_connection() {\n mysql_close($this->link);\n }", "function close()\n\t{\n\t\tmysql_close($this->db_server_link);\n\t}", "function close($link) {\r\n $retval = mysqli_close($link);\r\n if (!$retval) {\r\n die('Could not close connection:' . mysqli_errno($link));\r\n }\r\n}", "function db_close($db_link) {\n mysqli_close($db_link);\n}", "function disconnect()\n {\n @mysql_close( $this->link_id() );\n }", "function closeDatabasesConnection($link) {\n mysqli_close($link);\n}", "function __destruct()\n\t{\n\t\tmysql_close( $this->link );\t\n\t}", "function __destruct()\n {\n if($this->link)\n {\n mysql_close($this->link);\n }\n }", "function database_close()\n {\n // DO DATABASE QUERY LOGGING\n if( $this->log_stats ) $this->database_log_stats();\n if( $this->log_stats ) $this->database_log_stats_cleanup();\n \n\t return mysql_close($this->database_connection);\n\t}", "public function disconnect()\n\t\t{\tif (isset($this->link))\n\t\t\t\t$mysql_close($this->link);\n\n\t\t\tunset($this->link);\n\t\t}", "function close() {\n if ($this->is_valid())\n @mysql_close($this->connection);\n }", "function destruct()\n {\n mysql_close($this->link);\n }", "function Disconnect()\n {\n //SQL::CleanOverhead();\n mysql_close($this->LinkID);\n #$mysqli->close;\n }", "public function mysqlclose() {\n // close connection\n $this->mySQLConnection->close();\n }", "function closedbconnection() {\r\n\t\t\r\n\t\t\r\n #if ($this->dbconnection = TRUE) {\r\n mysql_close($this->dbconnection);\r\n #}\r\n \r\n }", "function close()\n\t{\n\t\t@mysqli_close($this->dbLink);\n\t}", "function closeConnection() {\n return mysql_close();\n }", "function close()\n\t{\n\t\tmysql_close();\n\t}", "function dbclose($dbc) {\n\t$GLOBALS['kDBConnection'] = null;\n\treturn mysql_close($dbc);\n}", "public function cerrar() {\n @mysql_close($this->link_id);\n }", "public function close()\n {\n mysqli_free_result($this->resulset);\n mysqli_close($this->databaseLink);\n }", "public function closeConnection() {\r\n\t\tif(is_resource($this->connection)) {\r\n\t\t\t@mysql_close($this->connection);\r\n\t\t}\r\n\t}", "function db_disconnect( $linkid )\n\t{\n\t\treturn mysqli_close( $linkid );\n\t}", "function closeDatabaseConnection($db_connection)\r\n\t{\r\n\t\tmysql_close($db_connection);\r\n\t}", "function sql_close()\n{\n global $ctx;\n $ctx['sqlconn']->close();\n}", "function close() {\n // closing db connection\n mysql_close();\n }", "function conn_close() \n {\n\t\t\tmysql_close($this->conn);\n\t\t\tunset($this->conn);\n\t\t\t$this->connectionStatus = false;\n\t\t}", "protected function _close()\n\t{\n\t\t$this->connID->close();\n\t}", "function __destruct() {\r\n\t\t\r\n\t\tif( $this->isOK() ) mysql_close();\r\n\t}", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "function Close(){\n\n mysql_close($this->connection);\n\n }", "public function close_database_connection($link)\n {\n $link = null;\n }", "function closeDB($connection){\n mysql_close($connection);\n}", "function closeDB2($connection){\n mysql_close($connection);\n}", "function closedb($sql)\r\n{\r\n if ($sql) {\r\n // Close resources\r\n $sql->Close();\r\n $sql->mode_id('r'); // switch to alternate mode, if any\r\n $sql->Close();\r\n }\r\n}", "public function Close()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\t$this->activeRow = -1;\r\n\t\t$success = $this->Release();\r\n\t\tif( $success )\r\n\t\t{\r\n\t\t\t$success = @mysql_close( $this->db_link );\r\n\t\t\tif( !$success )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tunset( $this->last_sql );\r\n\t\t\t\tunset( $this->last_result );\r\n\t\t\t\tunset( $this->db_link );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $success;\r\n\t}", "function close() { \n// closing db connection \nmysql_close(); \n}", "public function close() {\n\t\tif ($this->queryresult != \"\")\n\t\t\tmysql_free_result($this->queryresult);\n\t\tmysql_close();\n\t}", "function close_server($link)\n\t{\n\t\tmysqli_close($link);\n\t}", "public function __destruct() {\r\n @mysql_close($this->resource);\r\n }", "function close_mysql_connection(){\n global $mysqli;\n $mysqli->close();\n}", "public function __destruct() {\r\n\t\tif (!is_null($this -> link)) {\r\n\t\t\tif (!$this -> pdo) {\r\n\t\t\t\tmysql_close($this -> link);\r\n\t\t\t}\r\n\r\n\t\t\t$this -> link = null;\r\n\t\t\tself::$singleton = null;\r\n\t\t}\r\n\t}", "public static function close()\n\t{\n\t\tself::$link->close();\n\t}", "function close() {\n mysql_close($this->db);\n }", "function ssDbClose($dbConnection) {\n mysql_close($dbConnection);\n}", "function disconnect(&$link)\n {\n mysqli_close($link);\n }", "function disconnect(&$link)\n {\n mysqli_close($link);\n }", "function DbClose() {\n mysqli_close($this->link);\n }", "function fvls_db_close(){\n\t\tglobal $FLVS_db_link;\n\t\t$return = $FLVS_db_link->close();\t// Close the connection and store success status (boolean response)\n\t\tif( $return )\n\t\t\t$FLVS_db_link = NULL;\t// Closing the connectino doesn't change the variable resource type - so we need to manually alter it\n\n\t\treturn $return;\t// Kick back out the boolean status\n\t}", "function odbc_close($connection_id)\n{\n}", "public function closeConnection() {\n mysql_close();\n }", "function __destruct()\n\t{\n\t\t$this->dblink->close();\n\t}", "public function close_connection() {\n if($this->connection) {\n mysql_close($this->connection);\n $this->connection = \"\";\n }\n }", "public function __destruct() {\n if($this->link)\n mysqli_close($this->link);\n }", "function close_db() {\n\t\tmysql_close($this -> dbc);\n\t}", "function dbclose() {\n\treturn true;\n/*\n global $db;\n mysql_close($db);\n*/\n}", "function closeConection($link){\n pg_close($link);\n\t}", "function db_close()\n\n\t{\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::db_close() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\t$this->optimize_database();//12022007\n\n\t\tmysql_close($this->dbresource_id);\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::db_close() - Return Value : ', 'Closing Database Connection and Returning Void.', true);\n\n\t\t\n\n\t}", "function __destruct() {\n\t\tmysql_close($this->connection);\n\t}", "function db_close()\n{\n\tglobal $db;\n\t$db->close();\n}", "private function close()\n\t{\n\t\tif ($this->memcache_connected)\n\t\t{\n\t\t\t$this->connection->close();\n\t\t\t$this->memcache_connected = false;\n\t\t}\n\t}", "function DBClose(\\Simplon\\Mysql\\Mysql $dbh) {\n $dbh->close();\n}", "function disconnect()\r\n {\r\n if(!mysql_close($this->link))\r\n {\r\n $this->error_msg = \"Could not close the $this->db_name database\";\r\n return 0;\r\n }\r\n return 1;\r\n }", "function db_disconnect($link) // Colorize: green\n { // Colorize: green\n $link->close(); // Colorize: green\n }", "function __destruct() {\n\t\treturn @mysql_close($this->objConnect);\n\t}", "public function db_close(){\n mysqli_close($this->mysql);\n }", "private function deconnexion()\n\t\t{\n\t\t\tmysql_close($this->id);\n\t\t\t\n\t\t}", "function __destruct(){\n mysql_close();\n }", "function close()\n {\n switch ($this->engine)\n {\n case \"mysql\":\n mysql_close($this->connection);\n break;\n }\n }", "public static function closeConnection(){\n //Check if instance exists\n if(isset(self::$instance)){\n //Closes connection\n self::$connection = null;\n //unset the instance, following connections will require re-connection to the DB.\n self::$instance = null;\n }\n }", "function _close()\n\t{\n\t\t@ldap_close( $this->_connectionID );\n\t\t$this->_connectionID = false;\n\t}", "function close_connection($connection) {\n mysql_close($connection);\n }", "public function close()\r\n\t{\r\n\t\treturn mysqli_close($this->link);\r\n\t}", "function __destruct() {\n //@, Error when no linked to db open. \n\t @mysql_close($this->con);\n\t \n\t}", "public function __destruct()\r\n\t{\r\n\t\tis_resource($this->link) and odbc_close($this->link);\r\n\t}", "function close() \n {\n if($this->rsQry==false)\n {\n\t\t\t mysql_free_result($this->rsQry);\n\t\t\t unset($this->rsQry);\n }\n\t\t}", "public function disconnect()\n {\n \t//$GLOBALS['log']->debug('Calling DBManager::disconnect()');\n $close = $this->backendFunctions['close'];\n if(isset($this->database)){\n $this->freeResult();\n if ( is_resource($this->database) || is_object($this->database) )\n\t\t\t\t$close($this->database);\n unset($this->database);\n }\n }", "function closeDataBase()\n{\n\tglobal $mysql_db;\n\t$mysql_db->close();\n}", "public function close(){\r\n\t\tself::$dbh = null;\r\n\t\tself::$db = null;\r\n\t}", "public function close()\n {\n if (isset($this->handle)) {\n $this->stats->benchmark('bedrockWorkerManager.db.close', function () {\n $startTime = microtime(true);\n $this->handle->close();\n unset($this->handle);\n });\n }\n }", "public static function disconnect() {\n mysqli_close(self::$link);\n }", "function __destruct() {\n mysql_close($this->db_conn);\n }", "public function __destruct() {\r\n\t\tif (isset($this->sql)) {\r\n\t\t\tmysql_close($this->sql);\r\n\t\t}\r\n\t\tif (isset($this->sql)) {\r\n\t\t\tmysql_close($this->sql2);\r\n\t\t}\r\n\t}", "private function _closeConnection() {\n\t\tif (is_resource($this->connection)) {\n\t\t\t// close connection\n\t\t\t@odbc_close($this->connection);\n\t\t}\n\t}", "function closeDBConnection() {\n\t\tglobal $dbh;\n\t\tif($dbh) {\n\t\t\t/*if(mysqli_close($dbh)) {\n\t\t\t\tprint \"Close successfull else {\";\n\t\t\t} else {\n\t\t\t\tprint \"Cannot Close successfull else {\";\n\t\t\t}\t*/\n\t\t\tmysqli_close($dbh);\n\t\t\t$dbh = null;\n\t\t}\n\t}", "function db_disconnect()\n{\n\tglobal $dbh;\n\n\tif (!isset($dbh))\n\t\t// Already disconnected.\n\t\treturn;\n\n\t$dbh->close();\n\t$dbh = NULL;\n\treturn;\n}", "private function _disconnect()\n\t{\n\t\t// you can't close a persistent connection, so don't bother disconnecting\n\t\tif ($this->_persistent === true)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif (is_resource($this->_connection) === true)\n\t\t{\n\t\t\tif (mysql_close($this->_connection) === false)\n\t\t\t{\n\t\t\t\tthrow new DbDatabaseException('',\n\t\t\t\t\tDatabaseException::CONNECTION_INVALID);\n\t\t\t}\n\t\t}\n\t\t// clear the connection string\n\t\tunset($this->_connection);\n\t\t$this->_connection = null;\n\t}", "function closeDbConnection() {\n global $objDb;\n\n if (isset($objDb)) {\n @$objDb->Close();\n }\n }", "public function close_connection()\n {\n $this->db = null;\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "function disconnect() {\n\t\tmysql_close();\n\t}", "function closeDb(&$connection) {\n mysqli_close($connection);\n}", "public function CloseDB(){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t\tmysqli_close($this->connection);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\todbc_close($this->connection);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->connection = NULL;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public static function close(){\n//\t\techo 'close'.\"\\n<br>\";\n//\t\t$db = RuntimeInfo::instance()->connections()->MySQL(RuntimeInfo::instance()->helpers()->Session()->getSessionConfig()->getHosts());\n\t\t\n\t\t// just because i'm closing a session, why does that mean i need to close the db connection?\n// \t\tif($db instanceof MySQLAbstraction)\n// \t\t{\n// \t\t\treturn $db->close();\n// \t\t}\n// \t\telse { return false; }\n\t}", "function db_close($connection){\n if(isset($connection)) {\n mysqli_close($connection);\n }\n}" ]
[ "0.7457207", "0.7214802", "0.7109842", "0.7090685", "0.7044499", "0.70262545", "0.6992743", "0.69614786", "0.6935577", "0.6880512", "0.6868947", "0.68623626", "0.6786172", "0.67621034", "0.67420584", "0.67391497", "0.6709325", "0.66953814", "0.6629414", "0.6623718", "0.66061515", "0.66026247", "0.6588205", "0.654013", "0.65363926", "0.65282583", "0.6519699", "0.65187573", "0.6518108", "0.65173155", "0.65160996", "0.6506177", "0.6481698", "0.6479879", "0.6479327", "0.64785296", "0.6475893", "0.6464357", "0.6460635", "0.64553875", "0.6442224", "0.64397603", "0.64381546", "0.64269114", "0.6412774", "0.63869625", "0.63646185", "0.63618493", "0.6359917", "0.6351081", "0.63207215", "0.63207215", "0.6315077", "0.6308105", "0.6303182", "0.63006073", "0.629294", "0.62881047", "0.6279501", "0.6275677", "0.62632436", "0.6262674", "0.62415326", "0.6233816", "0.6225891", "0.6225661", "0.6224692", "0.62226754", "0.62100995", "0.6205863", "0.61946064", "0.6183222", "0.6164539", "0.61570007", "0.6152794", "0.61518764", "0.6150433", "0.6147478", "0.61416924", "0.61411226", "0.6136312", "0.61193794", "0.61005896", "0.60882246", "0.6077618", "0.6071993", "0.607074", "0.6057992", "0.60518", "0.6046895", "0.6029492", "0.60244006", "0.60155946", "0.60022676", "0.59972656", "0.59909016", "0.59868544", "0.59650177", "0.5950566", "0.595052" ]
0.7871526
0
mysql_drop_db attempts to drop (remove) an entire database from the server associated with the specified link identifier. This function is deprecated, it is preferable to use mysql_query to issue an sql DROP DATABASE statement instead.
function mysql_drop_db(string $database_name, $link_identifier = null): void { error_clear_last(); $result = \mysql_drop_db($database_name, $link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drop_db($db) {\n\t\treturn mysql_drop_db($db, $this -> dbc);\n\t}", "public function drop_db($dbname) {\n $sql = \"DROP DATABASE \".$dbname;\n try {\n $result = $this->conn->exec($sql);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }", "function DropDB() {\n $sql = \"DROP DATABASE IF EXISTS `mydb`;\";\n performSQL($sql);\n}", "public function dropDatabase($name);", "function drop_db( $name )\n\t{\n\t\tif ( $this->checkup( \"\", $name ) != true ) {\n\t\t\treturn $this->error( \"no database name given\" );\n\t\t}\n\t\t\n\t\tif ( !mysql_query( \"DROP DATABASE \" . $name, $this->CONN ) ) {\n\t\t\treturn $this->error ( \"could not drop database!\" );\n\t\t}\n\t\t// if db dropped, change to last database, if exists\n\t\tif ( $name == $this->akt_DBASE && $this->last_DBASE != \"\" ) {\n\t\t\t$this->change_db( $this->last_DBASE );\n\t\t}\n\t\treturn true;\n\t}", "function drop_db($name) {\n\t\t\tif ($this->checkup(\"\", $name) != true) {\n\t\t\t\treturn $this->error(\"no database name given\");\n\t\t\t}\n\t\t\t#if ( $this->one_query ( \"DROP DATABASE IF EXISTS \" . $name ) ){ // seems to be buggy\n\t\t\tif (!mysqli_query($this->CONN, \"DROP DATABASE IF EXISTS \".$name)) {\n\t\t\t\treturn $this->error(\"could not drop database!\");\n\t\t\t}\n\t\t\t// if db dropped, change to last database, if exists\n\t\t\tif ($name == $this->akt_DBASE && $this->last_DBASE != \"\") {\n\t\t\t\t$this->change_db($this->last_DBASE);\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public function dropDatabase($database);", "function upgrade_79_mysql() { # MySQL only\n $result = db_query_parsed(_drop_index('admin', 'username'), True);\n $result = db_query_parsed(_drop_index('alias', 'address'), True);\n $result = db_query_parsed(_drop_index('domain', 'domain'), True);\n $result = db_query_parsed(_drop_index('mailbox', 'username'), True);\n}", "function drop_all_tables($db)\n{\n $db->query(\"SET foreign_key_checks = 0\");\n\n if ($result = $db->query(\"SHOW TABLES\")) {\n while ($row = $result->fetch_array(MYSQLI_NUM)) {\n $db->query(\"DROP TABLE IF EXISTS \" . $row[0]);\n }\n }\n\n $db->query(\"SET foreign_key_checks = 1\");\n}", "public function dropDatabase($dbName)\n {\n $this->connection->exec(\n sprintf(\n 'DROP DATABASE IF EXISTS `%s`',\n $dbName\n )\n );\n }", "function plugin_remove_database() {\n\n global $wpdb;\n\n\n\n $trips_tbl=$wpdb->prefix.'tb_trips_tbl';\n\n $sql_1 = \"DROP TABLE IF EXISTS $trips_tbl\";\n\n\n\n $tb_contacts_tbl=$wpdb->prefix.'tb_contacts_tbl';\n\n $sql_4 = \"DROP TABLE IF EXISTS $tb_contacts_tbl\";\n\n\n\n $tb_booking_tbl=$wpdb->prefix.'tb_booking_tbl';\n\n $sql_5 = \"DROP TABLE IF EXISTS $tb_booking_tbl\";\n\n\n\n\n\n $tb_zoho_crm_auth=$wpdb->prefix.'tb_zoho_crm_auth';\n\n $sql_2 = \"DROP TABLE IF EXISTS $tb_zoho_crm_auth\";\n\n $tb_zoho_books_auth=$wpdb->prefix.'tb_zoho_books_auth';\n\n $sql_3 = \"DROP TABLE IF EXISTS $tb_zoho_books_auth\";\n\n\n\n $wpdb->query($sql_1);\n\n $wpdb->query($sql_4);\n\n $wpdb->query($sql_5);\n\n\n\n $wpdb->query($sql_2);\n\n $wpdb->query($sql_3);\n\n delete_option(\"my_plugin_db_version\");\n\n }", "function ibase_drop_db($connection = null): void\n{\n error_clear_last();\n if ($connection !== null) {\n $safeResult = \\ibase_drop_db($connection);\n } else {\n $safeResult = \\ibase_drop_db();\n }\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "function CloseDatabase($link)\n{\n mysql_close($link);\n}", "function deleteDatabase()\n{\n // codes to perform during unistallation\n $free_book_table = $GLOBALS['wpdb']->prefix . 'free_books';\n $sale_book_table = $GLOBALS['wpdb']->prefix . 'sale_books';\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $free_book_table . \"`\");\n $GLOBALS['wpdb']->query(\"DROP TABLE IF EXISTS `\" . $sale_book_table . \"`\");\n}", "function deconnexion_DB() {\n\tmysql_close();\n}", "static function kill_temp_db() {\n\t\tif(self::using_temp_db()) {\n\t\t\t$dbConn = DB::getConn();\n\t\t\t$dbName = $dbConn->currentDatabase();\n\t\t\tif($dbName && DB::query(\"SHOW DATABASES LIKE '$dbName'\")->value()) {\n\t\t\t\t// echo \"Deleted temp database \" . $dbConn->currentDatabase() . \"\\n\";\n\t\t\t\t$dbConn->dropDatabase();\n\t\t\t}\n\t\t}\n\t}", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'DROP TABLE `stores`;');\n\t\t$db->query(NULL, 'DROP TABLE `store_inventories`;');\n\t\t$db->query(NULL, 'DROP TABLE `store_restocks`;');\n\t\t$db->query(NULL, 'DROP TABLE `user_shops`;');\n\t}", "public function drop_wps_database(){\n\n\t\t\t$this->load->dbforge();\n\t\t\t$this->dbforge->drop_database('wpadmin_localhost');\n\t\t}", "public function dropDatabase($name)\r\n {\r\n $sql = <<<SQL\r\nBEGIN\r\n -- user_tables contains also materialized views\r\n FOR I IN (SELECT table_name FROM user_tables WHERE table_name NOT IN (SELECT mview_name FROM user_mviews))\r\n LOOP \r\n EXECUTE IMMEDIATE 'DROP TABLE \"'||I.table_name||'\" CASCADE CONSTRAINTS';\r\n END LOOP;\r\n \r\n FOR I IN (SELECT SEQUENCE_NAME FROM USER_SEQUENCES)\r\n LOOP\r\n EXECUTE IMMEDIATE 'DROP SEQUENCE \"'||I.SEQUENCE_NAME||'\"';\r\n END LOOP;\r\nEND;\r\n\r\nSQL;\r\n\r\n $this->conn->exec($sql);\r\n\r\n if ($this->conn->getAttribute(Doctrine_Core::ATTR_EMULATE_DATABASE)) {\r\n $username = $name;\r\n $this->conn->exec('DROP USER ' . $username . ' CASCADE');\r\n }\r\n }", "public static function drop()\n {\n global $wpdb;\n $tableName = static::getTableName($wpdb->prefix);\n\n $sql = \"DROP TABLE IF EXISTS $tableName;\";\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n $wpdb->query($sql);\n \\delete_option($tableName . '_version');\n }", "function dropsql()\r\n {\r\n $this->connector();\r\n if(!isset($_GET['tbl'])){\r\n $d=$this->qe(\"DROP DATABASE $_GET[db]\");\r\n header(\"location:?act=mysql\");\r\n }\r\n elseif(isset($_GET['db'])&&isset($_GET['tbl']))\r\n {\r\n $this->qe(\"DROP TABLE $_GET[db].$_GET[tbl]\");\r\n header(\"location:?act=showtable&db=$_GET[db]\");\r\n }\r\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t// $db->query(NULL, 'DROP TABLE ... ');\n\t}", "public function down(Kohana_Database $db)\n\t{\n\t\t// $db->query(NULL, 'DROP TABLE ... ');\n\t}", "protected function _teardownDb()\n {\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n try {\n Sopha_Db::deleteDb($db, $host, $port);\n } catch (Sopha_Db_Exception $e) {\n if ($e->getCode() != 404) {\n throw $e;\n }\n }\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t $db->query(NULL, 'DROP TABLE `user_shops` ');\n\t}", "public function Dropdb(){\n $post = $this->input->post();\n if(!empty($post)){\n $db_name = $post['database'];\n //COMPILE FOR DROP DATABASE\n if ($this->dbforge->drop_database($db_name))\n {\n echo 'Database deleted!<br/>Compile for drop database '.$db_name.' success <br/> <a href=\"'.base_url().'compiler/createdb\">Click here to back</a>';\n }\n }else{\n echo('Compile for drop database Failed');\n }\n }", "public function uninstallDb()\n {\n return Db::getInstance()->execute('DROP TABLE `' . _DB_PREFIX_ . 'doofinder_updates`')\n && Db::getInstance()->execute('DROP TABLE `' . _DB_PREFIX_ . 'doofinder_landing`');\n }", "public function uninstallDB()\n {\n Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_rulesets`;');\n return Db::getInstance()->execute('DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'onehop_sms_templates`;');\n }", "abstract protected function dropTableDb(string $table, array $options = []);", "function closeDatabasesConnection($link) {\n mysqli_close($link);\n}", "function drop_schema($schema) {\n\t\t$sql = \"DROP SCHEMA IF EXISTS \" .$schema . \" CASCADE;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4,0);\n\t}", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'DROP TABLE `services`');\n\t}", "function db_disconnect()\n{\n\tglobal $dbh;\n\n\tif (!isset($dbh))\n\t\t// Already disconnected.\n\t\treturn;\n\n\t$dbh->close();\n\t$dbh = NULL;\n\treturn;\n}", "static function kill_temp_db() {\n\t\tif(self::using_temp_db()) {\n\t\t\t$dbConn = DB::getConn();\n\t\t\t$dbName = $dbConn->currentDatabase();\n\t\t\tif($dbName && DB::getConn()->databaseExists($dbName)) {\n\t\t\t\t// Some DataExtensions keep a static cache of information that needs to \n\t\t\t\t// be reset whenever the database is killed\n\t\t\t\tforeach(ClassInfo::subclassesFor('DataExtension') as $class) {\n\t\t\t\t\t$toCall = array($class, 'on_db_reset');\n\t\t\t\t\tif(is_callable($toCall)) call_user_func($toCall);\n\t\t\t\t}\n\n\t\t\t\t// echo \"Deleted temp database \" . $dbConn->currentDatabase() . \"\\n\";\n\t\t\t\t$dbConn->dropDatabase();\n\t\t\t}\n\t\t}\n\t}", "function DropTable_UserDetails($dbhandle)\n{\n $logger = LoggerSingleton::GetInstance();\n $logger->LogInfo(\"DropTable_UserDetails : enter\");\n\n global $UserDetailsTable_Name;\n\n $query = \"DROP TABLE $UserDetailsTable_Name\";\n $status = $dbhandle->query($query);\n\n if(false == $status)\n {\n $logger->LogError(\"DeleteTable_UserDetails : Unable to Delete table - \n $dbhandle->error\"); \n }\n\n $logger->LogInfo(\"DeleteTable_UserDetails : Status - $status\");\n return $status;\n}", "public function down() {\n\n\t\t$query = 'DROP TABLE sites;';\n\n\t\ttry {\n\t\t\tself::$pdo->exec( $query );\n\t\t} catch ( PDOException $exception ) {\n\t\t\tEE::error( 'Encountered Error while dropping table: ' . $exception->getMessage(), false );\n\t\t}\n\t}", "function uninstall() {\n SQLExec('DROP TABLE IF EXISTS lagartoservers');\n SQLExec('DROP TABLE IF EXISTS lagartoendpoints');\n parent::uninstall();\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'ALTER TABLE `forum_categories` DROP `topics_count`;');\n\t}", "public function uninstall()\n\t{\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_site;\n\t\t\t\");\n\t\t$this->db->query(\"\n\t\t\tDROP TABLE \".Kohana::config('database.default.table_prefix').\"sharing_incident;\n\t\t\t\");\n\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "function dropTable($table);", "public function del($database, $url);", "function Sql_DB_Delete($db=\"\")\n {\n $query=$this->DB_Delete_Query($db);\n $this->DB_Query($query);\n }", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "function drop_table( $name )\n\t{\n\t\t$name = trim( $name );\n\t\tif ( empty( $name ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( empty( $this->CONN ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( mysql_query ( \"DROP TABLE IF EXISTS \" . $name, $this->CONN ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error ( \"error dropping table!\" );\n\t\t\treturn false;\n\t\t}\n\t}", "function db_disconnect( $linkid )\n\t{\n\t\treturn mysqli_close( $linkid );\n\t}", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function close_database_connection($link)\n {\n $link = null;\n }", "function db_close($db_link) {\n mysqli_close($db_link);\n}", "function emp_delete_blog( $blog_id ){\n\tglobal $wpdb;\n\t$prefix = $wpdb->get_blog_prefix($blog_id);\n\t$wpdb->query('DROP TABLE '.$prefix.'em_transactions');\n\t$wpdb->query('DROP TABLE '.$prefix.'em_coupons');\n\t$wpdb->query('DROP TABLE '.$prefix.'em_email_queue');\n\t$wpdb->query('DROP TABLE '.$prefix.'em_bookings_relationships');\n}", "function dropOldTables(Sqlite3 $db)\n{\n\t$drop_script = \"DROP TABLE \";\n\tforeach (['airports', 'carriers', 'statistics', 'statistics_flights', 'statistics_delays', 'statistics_minutes_delayed'] as $table_name) {\n\t //echo \"\\tDropping \" . $table_name . PHP_EOL;\n\t $db->query($drop_script . $table_name);\n\t}\n\t//echo 'Done.' . PHP_EOL;\n}", "function truncate_database($db, $excluded_names)\n{\n $excluded_names[] = 'sqlite_sequence';\n $excluded_names[] = 'sqlite_master';\n $excluded_names = array_unique($excluded_names);\n\n $db->exec(\"PRAGMA writable_schema = 1;\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'table' AND name NOT IN ('\" . join(\"', '\", $excluded_names) . \"');\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'index';\");\n $db->exec(\"DELETE FROM sqlite_master WHERE type = 'trigger';\");\n $db->exec(\"PRAGMA writable_schema = 0;\");\n\n $in_transaction = $db->inTransaction();\n if ($in_transaction) {\n $db->commit();\n }\n $db->exec(\"VACUUM\");\n if ($in_transaction) {\n $db->beginTransaction();\n }\n}", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "function sql_deleteTable() {\n global $database;\n $thisQuery = \"DROP TABLE \".TABLE_PREFIX.\"mod_dirlist\";\n $oldErrorReporting = error_reporting(0);\n $database->query($thisQuery);\n error_reporting($oldErrorReporting);\n if ($database->is_error()) {\n $this->errorPlace = 'sql_deleteTable()';\n $this->error = $database->get_error();\n return false; }\n else {\n return true; }\n }", "public function destroy()\n {\n $forge = \\Config\\Database::forge();\n if ($forge->dropDatabase(env('database.default.database'))) {\n echo 'Database deleted!';\n }\n }", "private function dropTempTable(){\r\n $sql = <<<EOT\r\n DROP TABLE %s\r\nEOT;\r\n \r\n $sql = sprintf($sql, $this->userId); \r\n return mysql_query( $sql );\r\n }", "function disconnect_from_db () {\n\tglobal $conn;\n\t$conn = null;\n}", "public static function uninstall() {\n $sql = 'DROP TABLE IF EXISTS `'.self::tableName.'`;';\n db_query($sql);\n }", "function delete_db($table, $id) {\n\t\t$tmp = \"delete from $table where id='$id'\";\n\t\t$sts = mysql_query($tmp, $this -> dbc) or print mysql_error($this -> CONST_ERRO);\n\t\treturn ($sts);\n\t}", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, 'ALTER TABLE `advertisement_popup` DROP `start_date` , DROP `end_date` ;');\n\t}", "function mysql_close($link_identifier = null): void\n{\n error_clear_last();\n $result = \\mysql_close($link_identifier);\n if ($result === false) {\n throw MysqlException::createFromPhpError();\n }\n}", "public function drop()\r\n\t{\r\n\t\t$this->db->drop('users');\r\n\t}", "function sql_disconnect(&$dbh=NULL) {\n global $SQL_DBH;\n if (is_null($dbh)) $SQL_DBH = NULL;\n else $dbh = NULL;\n }", "function Drop_Table($id){\n\t\t$database=DatabaseName();\n\t\t$name='table_'.$id;$StudentID=getuserid();\n\t\tmysql_query(\"DELETE FROM `$database`.`filerating` WHERE `filerating`.`FileID` = $id\");\n\t\tmysql_query(\"DROP TABLE IF EXISTS `$database`.`$name`\");\t\t\n\t\tmysql_query(\"DELETE FROM `$database`.`keywords` WHERE `keywords`.`FileID` = $id\");\n\t\tmysql_query(\"DELETE FROM `$database`.`uploadinfo` WHERE `uploadinfo`.`FileID` = $id\");\n\t}", "public function dropTable()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\t// Does the table exist?\n\t\tif (blx()->db->getSchema()->getTable('{{'.$table.'}}'))\n\t\t{\n\t\t\tblx()->db->createCommand()->dropTable($table);\n\t\t}\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "private static function _dropTables()\n\t{\n\t\tMySQL::query(\"\n\t\t\tSET FOREIGN_KEY_CHECKS = 0;\n\t\t\tSET GROUP_CONCAT_MAX_LEN=32768;\n\t\t\tSET @views = NULL;\n\t\t\tSELECT GROUP_CONCAT('`', TABLE_NAME, '`') INTO @views\n\t\t\t FROM information_schema.views\n\t\t\t WHERE table_schema = (SELECT DATABASE());\n\t\t\tSELECT IFNULL(@views,'dummy') INTO @views;\n\n\t\t\tSET @views = CONCAT('DROP VIEW IF EXISTS ', @views);\n\t\t\tPREPARE stmt FROM @views;\n\t\t\tEXECUTE stmt;\n\t\t\tDEALLOCATE PREPARE stmt;\n\t\t\tSET FOREIGN_KEY_CHECKS = 1;\n\t\t\");\n\t}", "function closeDataBase()\n{\n\tglobal $mysql_db;\n\t$mysql_db->close();\n}", "public function drop_table($tablename, $flag = false) {\n if ($flag) {\n $sql = \"DROP TABLE \".$tablename;\n try {\n $result = $this->conn->query($sql);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }\n }", "function uninstall() {\n SQLExec('DROP TABLE IF EXISTS AliIPRelays');\n SQLExec('DROP TABLE IF EXISTS AliIPRelay');\n SQLExec('DROP TABLE IF EXISTS AliIPRelays_queue');\n parent::uninstall();\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "function uninstall() {\n\t\t/** globalising of the needed variables, objects and arrays */\n\t\tglobal $db, $apcms;\n\t\t\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['plugins'].\"` WHERE `name`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['rightsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['leftsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\t$query = \"DELETE FROM `\".$apcms['table']['global']['rightsidebar'].\"` WHERE `plugin`='apcms_sidebar_poweredby';\";\n\t\t$db->unbuffered_query($query);\n\t\n\t}", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down(Kohana_Database $db)\n\t{\n\t\t$db->query(NULL, \"ALTER TABLE shop_restocks CHANGE id id INT( 11 ) NOT NULL\");\n\t\t$db->query(NULL, \"ALTER TABLE shop_restocks DROP PRIMARY KEY\");\n\t}", "protected static function dropTable(): void\n {\n $pdo = static::getDb();\n $pdo->query('DROP TABLE IF EXISTS ' . Store\\MySQL::DEFAULT_TABLE);\n }", "public function erase_db($name) {\n return UPS_SUCCESS;\n }", "public function drop()\n {\n $this->db->command(array('drop'=>$this->name));\n }", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }", "public function down(Database $db)\n {\n }", "public function down(Database $db)\n {\n }", "public function down(Database $db)\n {\n }", "function delBook($id)\n{\n $conn = mysqli_connect(constant(\"DBSERVER\"),constant(\"DBUSER\"),constant(\"DBPASSWORD\"));\n $db_selected = mysqli_select_db($conn,MYDB);\n if (!$db_selected)\n {\n exit('Error open '.MYDB.' : ' .mysqli_error($conn));\t\t\n } \n if (!mysqli_query($conn,\"DELETE FROM \".MYTABLE.\" WHERE id=$id;\"))\n exit(\"Error Delete MySQL : \".mysqli_error($conn).\" \".$id.\"<br>\");\n}", "public function dropDatabase($name) {\n\t\t// What is the path?\n\t\tthrow new RuntimeException(\n\t\t\t\"Dropping SQLite databases is not currently supported\"\n\t\t);\n\t}", "public static function truncate()\n {\n include self::dbFile();\n $pdo = self::createPDO($dbuser, $dbpass);\n $pdo->query(\"DROP DATABASE IF EXISTS $dbname\");\n $pdo->query(\"DROP DATABASE IF EXISTS {$dbname}_test\");\n $pdo->query(\"CREATE DATABASE $dbname\");\n $pdo->query(\"CREATE DATABASE {$dbname}_test\");\n }", "function closeDatabaseConnection($db_connection)\r\n\t{\r\n\t\tmysql_close($db_connection);\r\n\t}", "function delete() {\n\t\t$sqlStatements = array();\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS tags\";\n\t\t$sqlStatements[] = \"DROP TABLE IF EXISTS siteViews\";\n\t\texecuteSqlStatements($sqlStatements);\n\t}", "public function safeDown()\n {\n //return false;\n $this->dropTable($this->tablePost);\n $this->dropTable($this->tableUser);\n }", "function drop_table($name) {\n\t\t\t$name = trim($name);\n\t\t\tif (empty ($name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (empty ($this->CONN)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t#if ( mysql_query ( \"DROP TABLE IF EXISTS \" . $name, $this->CONN ) ) {\n\t\t\tif ($this->one_query(\"DROP TABLE IF EXISTS \".$name)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->error(\"error dropping table!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function delDBHandler($name = null) {\n $this->db[$name] = null;\n }", "function Sql_DB_Delete_Query($db=\"\")\n {\n if (empty($db)) { $db=$this->DBHash[ \"DB\" ]; }\n \n $query=\"DROB DATABASE IF EXISTS \".$db;\n return $query;\n }", "public function tearDown() {\r\n global $cfg;\r\n try {\r\n $dbConn = new mysqli(\r\n $cfg['db']['host'],\r\n $cfg['db']['user'],\r\n $cfg['db']['pass'],\r\n $cfg['db']['db']\r\n );\r\n }catch (Exception $e){\r\n throw new Exception(\"connection error\");\r\n }\r\n $sql = \"DROP TABLE `users`\";\r\n //run sql query\r\n $dbConn->query($sql);\r\n }", "public function down()\n {\n $this->dbforge->drop_table($this->table_name);\n \t$this->db->delete('settings', array('name' => 'hybridauth_enabled'));\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "function closeDatabase($db) {\n}", "function cubrid_drop($conn_identifier, $oid)\n{\n}", "public function down(PhoreDba $db)\n {\n }", "function uninstall() {\r\n SQLExec('DROP TABLE IF EXISTS products');\r\n SQLExec('DROP TABLE IF EXISTS product_categories');\r\n SQLExec('DROP TABLE IF EXISTS shopping_list_items');\r\n parent::uninstall();\r\n }", "function dropTable( string $name, PDO $db ) {\n $drop = \"DROP TABLE \".$name;\n try{\n // Preparamos la eliminacion\n $stmt = $db->prepare($drop);\n \n // Ejecutamos\n $stmt->execute();\n }\n\n catch( Exception $exception ){\n echo \"<br>\";\n echo \"Error al eliminar la tabla\".$name.\": \".$exception->getMessage();\n }\n}", "function db_disconnect($link) // Colorize: green\n { // Colorize: green\n $link->close(); // Colorize: green\n }", "function db_disconnect() {\n\n\tmysqli_close();\n}" ]
[ "0.7477976", "0.67750174", "0.6740574", "0.6674233", "0.6667135", "0.6493347", "0.64208776", "0.6257039", "0.6226178", "0.6187178", "0.6186469", "0.61241454", "0.61033297", "0.6093636", "0.60415906", "0.60410416", "0.6032999", "0.60047656", "0.59740895", "0.5943753", "0.59369886", "0.58993214", "0.58993214", "0.58977306", "0.58701575", "0.5853487", "0.5766747", "0.57284987", "0.57255787", "0.56986517", "0.56676644", "0.56228334", "0.56213325", "0.5616521", "0.5563947", "0.5542855", "0.554179", "0.5541291", "0.5540938", "0.5538252", "0.55265915", "0.55265254", "0.5496874", "0.54941094", "0.54919344", "0.5485602", "0.54683775", "0.54600066", "0.54553187", "0.54531825", "0.5451728", "0.5447706", "0.5446085", "0.5442082", "0.54413724", "0.5432632", "0.54166585", "0.5411646", "0.5398038", "0.53817326", "0.5378454", "0.5367811", "0.5364323", "0.53557813", "0.5327089", "0.53075737", "0.53040564", "0.5302973", "0.53026336", "0.5300511", "0.52975863", "0.5296894", "0.52941704", "0.5293456", "0.5285577", "0.527028", "0.5269407", "0.5267922", "0.5265032", "0.5265032", "0.5265032", "0.5264676", "0.52618927", "0.52425873", "0.5238422", "0.5231068", "0.5228932", "0.5228824", "0.5227224", "0.52248704", "0.5219145", "0.52158237", "0.52157354", "0.5215149", "0.52115923", "0.52099144", "0.5199186", "0.51925397", "0.51899886", "0.5188968" ]
0.8445797
0
Retrieves the MySQL protocol.
function mysql_get_proto_info($link_identifier = null): int { error_clear_last(); $result = \mysql_get_proto_info($link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function protocol()\n {\n return $this->connection->protocol();\n }", "public function GetProtocolInfo()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->protocol_version; \r\n }", "function database_get_proto_info()\n {\n\t return ( function_exists('mysql_get_proto_info') ? mysql_get_proto_info($this->database_connection) : FALSE );\n\t}", "public static function getProtocol() {\n\t\treturn self::$protocol;\n\t}", "function getProtocol() {\n\t\treturn $this->getParam(self::PARAM_PROTOCOL);\n\t}", "public function protocol() {\n\t\treturn $this->getProtocol();\n\t}", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->protocol;\n }", "public function getProtocol()\n {\n return $this->_protocol;\n }", "public function getProtocol() {\n return $this->protocol;\n }", "static function Protocol()\n {\n return self::Variable('SERVER_PROTOCOL');\n }", "function getServerProtocol() {\n\t\treturn $this->getParam(self::PARAM_SERVER_PROTOCOL);\n\t}", "public function\n\tGetProtocol():\n\t?String {\n\n\t\treturn ((array_key_exists('HTTPS',$_SERVER))?\n\t\t('https'):\n\t\t('http'));\n\t}", "public function getProtocol() : string;", "public function getProtocol(): string;", "static function Protocol ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn 'cli';\n\t\t\t$x = (isset($_SERVER['HTTPS'])) ? $_SERVER['HTTPS'] : '';\n\t\t\tif ($x == \"off\" or $x == \"\")\n\t\t\t\treturn \"http\";\n\t\t\telse\n\t\t\t\treturn \"https\";\n\t\t}", "public function getProtocol()\n\t{\n\t\tif (isset($_SERVER[\"HTTPS\"]) && ($_SERVER[\"HTTPS\"] == 'on')) {\n\t\t\treturn 'https';\n\t\t} else {\n\t\t\treturn 'http';\n\t\t}\n\t}", "public function getResponseProtocol()\n\t\t{\n\t\t\treturn $this->getHeader( \"protocol\" );\n\t\t}", "public function sslGetProtocol(): string {}", "public function getProtocol() {\n if (isset($_SERVER['HTTPS']) &&\n ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||\n isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&\n $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $protocol = 'https';\n }\n else {\n $protocol = 'http';\n }\n\n return $protocol;\n }", "public function getProtocol(){\n\t\treturn \"http\"; //TODO\n\t}", "public function serverProtocol()\n {\n return $this->_serverProtocol;\n }", "public function getProtocol()\n {\n $protocol = $this->serverAttributes()['SERVER_PROTOCOL'];\n\n if (!$protocol) {\n return false;\n }\n\n return $protocol;\n }", "public function protocol()\n\t{\n\t\tif (\n\t\t\t$this->server('HTTPS') == 'on' OR\n\t\t\t$this->server('HTTPS') == 1 OR\n\t\t\t$this->server('SERVER_PORT') == 443\n\t\t) {\n\t\t\treturn 'https';\n\t\t}\n\n\t\treturn 'http';\n\t}", "public function protocol() \n\t{\n\t\treturn ( ( $this->has_server( 'HTTPS' ) && $this->server( 'HTTPS' ) != 'off' ) || $this->server( 'SERVER_PORT' ) == 443 ) ? 'https' : 'http';\n\t}", "public static function getConnectionType() {\n\t\t\n\t\tself::initializeSession ();\n\t\t\n\t\tif (! isset ( $_SESSION ['s_dbConnectionType'] ) || $_SESSION ['s_dbConnectionType'] == '') {\n\t\t\t\n\t\t\t$_SESSION ['s_dbConnectionType'] = 'mysql';\n\t\t\t\n\t\t\tself::$logger->debug ( 'DBConnectionType loaded: ' . $_SESSION ['s_dbConnectionType'] );\n\t\t\n\t\t}\n\t\t\n\t\treturn $_SESSION ['s_dbConnectionType'];\n\t}", "public function get_protocol_version(): string {\n return $this->protocol_version ?? '1.1';\n }", "public function getServerProtocol(): string;", "public function protocol(){\n\t\tif (isset($_SERVER['HTTPS']) &&\n\t\t\t($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||\n\t\t\tisset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&\n\t\t\t$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')\n\t\t{\n\t\t\t$protocol = 'https://';\n\t\t} else {\n\t\t\t$protocol = 'http://';\n\t\t}\n\t\treturn $protocol;\n\t}", "public function getProtocolName()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['0'];\n }", "public function protocol($protocol = self::SSL_DEFAULT);", "public static function getProtocol(): ?string {\r\n return $_SERVER['SERVER_PROTOCOL'] ?? null;\r\n }", "public function version()\n {\n return $this->protocol;\n }", "public function getProtocol(): ProtocolInterface\n {\n return $this->protocol;\n }", "public function protocol($protocol = null) {\n\t\tif ($protocol !== null) {\n\t\t\t$this->_protocol = $protocol;\n\t\t}\n\t\treturn $this->_protocol;\n\t}", "public function protocolVersion(): string\n {\n return $this->protocolVersion;\n }", "function findProtocol()\n{\n $protocol = \"http://\";\n\n if (isset($_SERVER[\"SERVER_PORT\"]) && $_SERVER[\"SERVER_PORT\"] == 443) {\n $protocol = \"https://\";\n }\n\n return $protocol;\n}", "public function getProtocolName() : string;", "public static function protocol()\n\t{\n\t\treturn (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) === 'on') ? 'https://' : 'http://';\n\t}", "function wp_get_server_protocol()\n {\n }", "public function getBinaryProtocol()\n {\n return $this->binaryProtocol;\n }", "public function getProtocolVersion()\n {\n $protocol = $this->getProtocol();\n\n if (!$protocol) {\n return false;\n }\n\n return explode('/', strtolower($protocol))['1'];\n }", "function searchProtocol()\t{\n\t\treturn $this->getRandomProtocol();\n\t}", "function getProtocol() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_PROTOCOL);\n\t}", "public function getProtocolVersion();", "public function protocol() {\n\t\tif($_SERVER['HTTP_X_FORWARDED_PORT'] == '80') return 'http';\n\t\tif($_SERVER['HTTP_X_FORWARDED_PORT'] == '443') return 'https';\n\t\treturn ($_SERVER['HTTPS'] == 'on')? 'https' : 'http';\n\t}", "public function getProtocolVersion(): string\n {\n return $this->protocolVersion;\n }", "public function getProtocolVersion(): string {\n return $this->protocolVersion;\n }", "public function getVersion() {\n return mysql_get_server_info();\n }", "public function getProtocolVersion() {}", "function sql_get_proto_info($dbh=NULL)\n {\n //not implemented\n global $SQL_DBH;\n if (is_null($dbh))\n return false;\n else\n return false;\n }", "public function getProtocolVersion(): string\n\t{\n\t\treturn $this->protocolVersion ?? '1.1';\n\t}", "public static function mysqlVersion()\n {\n if (self::isEnabled('shell_exec')) {\n $raw = explode(',', shell_exec('mysql -V'));\n $raw = explode('Distrib', $raw[0]);\n return trim($raw[1]);\n } else {\n return 'Unknown';\n }\n }", "public function socket() {\n return $this->db['socket'];\n }", "public function getDefaultDriver()\n {\n return 'mysql';\n }", "private function connector(){\n switch ($this->connection_type) {\n case self::CONN_TYPE_PDO:\n return $this->pdo;\n break;\n\n case self::CONN_TYPE_MYSQLI:\n return $this->mysqli;\n break;\n\n default:\n echo \"Error: connection type '\".$this->connection_type.\"' not suppordted\" . PHP_EOL;\n exit;\n break;\n }\n }", "function getProtocol(){\n return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';\n}", "function get_request_protocol()\n{\n return Request::GetProtocol();\n}", "public function getMysql()\n {\n return $this->readOneof(100);\n }", "function serverProtocol() {\r\n\t return (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')\t|| $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://');\r\n\t}", "function getMySQLVersion() { \n $output = shell_exec('mysql -V'); \n preg_match('@[0-9]+\\.[0-9]+\\.[0-9]+@', $output, $version); \n return $version[0]; \n }", "public function getScheme()\n {\n $secure = ($this->getUseSsl() ? \"s\" : \"\");\n return sprintf(\"%s%s%s\", $this->getProtocol(), $secure, \"://\");\n }", "public function getConnectionType();", "function getMysqlVersion($host='localhost',$port=3306)\n {\n $res=\"\";\n $fp = @fsockopen ($host, $port, $errno, $errstr, 30);\n if( !$fp )\n {\n return false;\n }\n \n while(false!==($c=fgetc($fp)))\n {\n $res.=$c;\n preg_match(\"/((\\d\\.)+[\\d]*[A-Za-z-]*)[^0-9A-Za-z\\.-]+$/\", $res, $matches);\n if(isset($matches[1]))\n {\n fclose($fp);\n return $matches[1]; \n } \n }\n preg_match(\"/((\\d\\.)+[\\d]*[A-Za-z-]*)[^0-9A-Za-z\\.-]+$/\", $res, $matches);\n if(isset($matches[1]))\n {\n fclose($fp);\n return $matches[1];\n }\n \n /* \n \n \n \n while (!feof($fp))\n {\n $r = fgets ($fp, 1024);\n $res.=$r;\n preg_match(\"/([\\d\\.]+[\\d]*[A-Za-z-]*)/\", $res, $matches);\n if(isset($matches[0]))\n {\n fclose($fp);\n return $matches[0];\n }\n } */\n fclose($fp); \n return false; \n }", "public function getProtocolVersion(): int;", "public function getIncomingMailServerProtocol() {\n\t\treturn $this->ic_mail_server_protocol;\n\t}", "public function getProtocolVersion()\n {\n }", "public function getProtocolVersion()\n {\n }", "function wmfGetProtocolAndHost() {\n\tif ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {\n\t\t$protocol = 'https';\n\t} else {\n\t\t$protocol = 'http';\n\t}\n\tif ( defined( 'MISSING_PHP_TEST' ) && isset( $_GET['host'] ) ) {\n\t\t$host = $_GET['host'];\n\t} else {\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t}\n\t$host = strtolower( $host );\n\treturn [ $protocol, $host ];\n}", "public static function getDatabasePlatform(): string;", "public function getManagingSystemConnection(): ?string\n {\n return 'mysql-admin';\n }", "public function getProtocolVersion()\n {\n return $this->wrapped->getProtocolVersion();\n }", "public function MySQL_version()\n\t{\n\t\t$name = $this->MySQL_config('version_comment');\n\t\t$version = $this->MySQL_config('version');\n\n\t\tif (!$name && !$version) {\n\t\t\treturn 'Unknown MySQL version';\n\t\t}\n\t\treturn $name . ' ' . $version;\n\t}", "public function getConnectionString() {\n return $this->type.(!empty($this->dbName)?':dbname='.$this->dbName:'').(!empty($this->dbServer)?';host='.$this->dbServer:'').(!empty($this->dbApi)?';api='.$this->dbApi:'').';port='.$this->dbPort.';charset=utf8;user='.$this->dbUsername;\n }", "public function getProtocolVersion()\n {\n return $this->protocolVersion;\n }", "public function scheme() {\n\t\treturn $this->wire('config')->https ? 'https' : 'http'; \n\t}", "public function getConnectionType()\n {\n return $this->_connectionType;\n }", "public function getConnectionType()\n\t{\n\t\treturn $this->connectionType;\n\t}", "public function getProtocolVersion()\r\n {\r\n return $this->protocolVersion;\r\n }", "public function getPDOConnectionString() {\n if ($this->type==self::TYPE_MYSQL){\n return 'mysql:host='.$this->dbServer.';'.(!empty($this->port)?'port='.$this->port.';':'').(!empty($this->dbName)?'dbname='.$this->dbName.';':'').'charset=utf8';\n }else{\n throw new NotSupportedException('PDO connection is not available for DB type '.$this->type);\n }\n }", "public function getCurrenProtocol() {\n\t\t$pageURL = 'http';\n\t\tif (isset ( $_SERVER [\"HTTPS\"] ) && $_SERVER [\"HTTPS\"] == \"on\") {\n\t\t\t$pageURL .= \"s\";\n\t\t}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER [\"SERVER_PORT\"] != \"80\") {\n\t\t\t$pageURL .= $_SERVER [\"SERVER_NAME\"] . \":\" . $_SERVER [\"SERVER_PORT\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER [\"SERVER_NAME\"] . $_SERVER[\"REQUEST_URI\"];\n\t\t}\n\t\treturn $pageURL;\n\t}", "public function getScheme()\n {\n return ($this->getServer('HTTPS') == 'on')\n ? static::SCHEME_HTTPS : static::SCHEME_HTTP;\n }", "public function getSiteProtocol() {\n return isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http' . '://';\n }", "public function GetConn() {\n\n return $this->\n config['dbconn'];\n }", "public function getClientInfo(){\n return mysql_get_client_info();\n }", "public function getProtocolVersion()\n {\n // TODO: Implement getProtocolVersion() method.\n }", "public function __toString()\n {\n return 'MySQL';\n }", "public static function getScheme(): ?string {\r\n return $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? $_SERVER['REQUEST_SCHEME'] ?? null;\r\n }", "public function port() {\n return $this->db['port'];\n }", "public function getProtocolSeparator() : string;", "public static function getScheme() {\n\t if(!isset(self::$scheme)) {\n\t\t\tif(self::$trust && isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n\t\t\t\tself::$scheme = $_SERVER['HTTP_X_FORWARDED_PROTO'];\n\t\t\t} else if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {\n\t\t\t\tself::$scheme = \"https\";\n\t\t\t} else if(443 == self::getPort() || 8443 == self::getPort()) {\n\t\t\t\tself::$scheme = \"https\";\n\t\t\t} else\t{\n\t\t\t\tself::$scheme = \"http\";\n\t\t\t}\n\t\t}\n\t\treturn self::$scheme;\n\t}", "public static function getConnection(): ?string {\r\n return $_SERVER['HTTP_CONNECTION'] ?? null;\r\n }", "function getEncoding() {\n\t\treturn mysql_client_encoding($this->connection);\n\t}", "public static function getTableDbType($name)\n {\n if (static::isTableInScheme($name)) {\n $scheme = static::getTableScheme($name);\n return isset($scheme['dbtype']) ? $scheme['dbtype'] : 'mysql';\n }\n }", "protected function getProtocol ()\n\t{\n\t\treturn new AenoaServerProtocol () ;\n\t}" ]
[ "0.7231074", "0.7187874", "0.6978822", "0.689634", "0.68935406", "0.6739767", "0.67125034", "0.67125034", "0.67125034", "0.67125034", "0.67125034", "0.67125034", "0.67125034", "0.66605455", "0.6633298", "0.66179615", "0.6610265", "0.6542467", "0.6522816", "0.65176207", "0.6301992", "0.6294803", "0.62767977", "0.6257526", "0.6225508", "0.62250435", "0.6199913", "0.6183372", "0.61785173", "0.6177926", "0.6132696", "0.60822254", "0.6067173", "0.60590875", "0.60523134", "0.602941", "0.6021934", "0.5986973", "0.59711283", "0.59678113", "0.5950266", "0.588354", "0.5882743", "0.5869827", "0.58678573", "0.5842702", "0.584067", "0.5836148", "0.5781778", "0.5695297", "0.56878126", "0.5681099", "0.5677493", "0.5674154", "0.5673043", "0.56621623", "0.56554586", "0.56532454", "0.5641679", "0.56228006", "0.56130606", "0.5606824", "0.5602859", "0.5585346", "0.55845666", "0.5581092", "0.5551642", "0.55234957", "0.55023706", "0.5494189", "0.5487377", "0.5471663", "0.5471663", "0.54266053", "0.54236907", "0.54107714", "0.54005444", "0.53747106", "0.53625965", "0.53271455", "0.5316913", "0.5284543", "0.52817976", "0.5271566", "0.52714044", "0.525396", "0.52537745", "0.5229928", "0.5221448", "0.52041525", "0.5188315", "0.5186261", "0.51827997", "0.5182004", "0.5179785", "0.51797193", "0.5172144", "0.51660204", "0.51625913", "0.51582915" ]
0.60698724
32
Retrieves the current MySQL server threads.
function mysql_list_processes($link_identifier = null) { error_clear_last(); $result = \mysql_list_processes($link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_threads() {\n\n\t\t//return $query->result();\n\t}", "private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function threads()\n\t{\n\t\treturn $this->hasMany(Thread::class)->latest();\n\t}", "public static function getMarkedThreads() {\n\t\t$sessionVars = WCF::getSession()->getVars();\n\t\tif (isset($sessionVars['markedThreads'])) {\n\t\t\treturn $sessionVars['markedThreads'];\n\t\t}\n\t\treturn null;\n\t}", "public function getServers() {\n\t\treturn $this->dbHandler->getAllServer();\n\t}", "public function getThreads()\n {\n $user = request()->user();\n\n $messages = $user->threadsWithMessagesWithUsers($user->id)->get();\n\n /**\n * Returns unread messages given the userId.\n */\n //$messages = Message::unreadForUser($user->id)->get();\n\n return ThreadsResource::collection($messages);\n //return response()->json($messages);\n }", "public function threads()\n {\n return $this->hasMany(Thread::class);\n }", "static public function connections()\n {\n return self::$_connection_data;\n }", "static public function getServers() {\n\t\tself::loadSettings();\n\t\treturn self::$servers;\n\t}", "public function get_threading() {\n\n return $this->threading;\n }", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "function threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\n\n\t\t$posts = $this->post->get_latest(get_selected_radix(), $page, array('per_page' => $per_page));\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}", "public function getServerInfo(){\n return mysql_get_server_info($this->connection);\n }", "public function get_topics()\n {\n return $this->connection->query_select_value('threads', 'COUNT(*)');\n }", "public function getTopThreads()\n {\n $db = DB::conn();\n $threads = array();\n \n $rows = $db->rows('SELECT t.id, t.user_id, t.title, u.username, t.created, t.last_modified, u.usertype, \n COUNT(c.id) AS thread_count FROM comment c \n INNER JOIN thread t ON c.thread_id=t.id \n INNER JOIN user u ON t.user_id=u.id \n GROUP BY t.id ORDER BY COUNT(c.id) DESC, t.last_modified DESC');\n\n foreach ($rows as $row) {\n $threads[] = new Thread($row);\n }\n\n return $threads;\n }", "public function getDbConnectionPool()\r\n\t{\r\n\t\treturn $this->dbConnectionPool;\r\n\t}", "public function getPoolSize();", "public function threads()\n {\n return $this->morphedByMany('App\\Thread', 'taggable');\n }", "public function getconnectioncount()\n\t{\n\t\treturn $this->connect('getconnectioncount');\n\t}", "public function getThreadId();", "public function getThreadId();", "public function getWorkers()\n {\n }", "public function getDatabaseClusters()\n {\n return $this['db_clusters'];\n }", "public function getConnections()\n {\n return $this->connections;\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function all()\n {\n return $this->connections;\n }", "public function GetCurrentThreadID()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->thread_id;\r\n }", "function getServerInfo() {\n $serverInfo = mysql_get_server_info();\n return $serverInfo;\n }", "function getServers() {\n\t\treturn $this->servers;\n\t}", "public function getOneThread()\n\t{\t\n\t\tglobal $ilDB;\n\t\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_threads WHERE ';\n\t\t\n\t\tif($this->getMDB2Query() != '' && $this->getMDB2DataType() != '' && $this->getMDB2DataValue() != '')\n\t\t{\n\t\t\t$query .= $this->getMDB2Query();\n\t\t\t$data_type = $data_type + $this->getMDB2DataType();\n\t\t\t$data_value = $data_value + $this->getMDB2DataValue();\n\t\t\t\n\t\t\t$sql_res = $ilDB->queryf($query, $data_type, $data_value);\n\t\t\t$result = $sql_res->fetchRow(DB_FETCHMODE_ASSOC);\n\t\t\t$result[\"thr_subject\"] = trim($result[\"thr_subject\"]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function setWorkers()\r\n {\r\n if (!is_array($this->workers)) {\r\n\r\n $gearmanCache = $this->container->get('gearman.cache');\r\n $this->workers = $gearmanCache->get();\r\n }\r\n\r\n /**\r\n * Always will be an Array\r\n */\r\n\r\n return $this->workers;\r\n }", "function getMySqlServerGroups() {\n if ($this->connectToMySqlWithParams('localhost:3307', 'root', 'myzconun')) {\n $query = sprintf(\"SELECT * FROM scuola.mysql_servers_groups\");\n\n // Perform Query\n $result = mysql_query($query);\n }\n $this->closeConnection();\n return $result;\n }", "public static function getJobs() {\n\t\treturn self::$jobs;\n\t}", "public function get_databases()\n\t{\n\t\treturn $this->databases;\n\t}", "public function getMysqlReplicaConfiguration()\n {\n return $this->mysql_replica_configuration;\n }", "public function obtainWebservers()\n {\n return $this->performRequest('GET', '/webservers');\n }", "public function getWorkers()\n {\n $workers = $this->redis->hGetAll(self::$workerKey);\n $temp = array();\n \n foreach ($workers as $name => $value) {\n $temp[$name] = unserialize($value);\n }\n return $temp;\n }", "function database_get_server_info()\n {\n\t return ( function_exists('mysql_get_server_info') ? mysql_get_server_info($this->database_connection) : FALSE );\n\t}", "public function getConnections()\n {\n return [$this->entityManager->getConnection()];\n }", "public static function all()\n\t{\n\t\t$workers = Resque::redis()->smembers('workers');\n\t\tif (!is_array($workers)) {\n\t\t\t$workers = array();\n\t\t}\n\n\t\t$instances = array();\n\t\tforeach ($workers as $workerId) {\n\t\t\t$instances[] = self::find($workerId);\n\t\t}\n\t\treturn $instances;\n\t}", "public function getConnections(): array\n {\n return $this->connections;\n }", "public function getConnections(): array\n {\n return $this->connections;\n }", "public function getDBConnections(): array {\n return $this->configVars['database-connections'];\n }", "function getThreadById($id){\n \n return $this->find($id)->toArray(); \n }", "protected function getThreads(Channel $channel, ThreadFilters $filters)\n {\n \n $threads = Thread::latest()->filter($filters);\n if ($channel->exists) {\n $threads->where('channel_id', $channel->id);\n }\n\n // dd($threads->toSql());\n\n return $threads->get();\n }", "public function getConnectionNames()\n {\n return $this->connections;\n }", "public function getDatabases() {\n\t\treturn $this->databases;\n\t}", "function ghost_threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\t\t$page = intval($page);\n\n\t\t$posts = $this->post->get_latest_ghost(get_selected_radix(), $page, array('per_page' => $per_page));\n\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no comics\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}", "public function articles()\n {\n return Board::where('news', 1)->first()->threads;\n }", "public static function getNumberOfWorkers();", "protected function connections()\n {\n return [];\n }", "function get_updated_threads($forum_id, $since) {\n return $this->call('get_updated_threads', array('forum_id' => $forum_id, 'since' => $since));\n }", "function os2forms_server_communication_get_servers() {\n $query = db_select('os2forms_server_communication_servers_list', 's');\n $query->fields('s', array('id', 'server_name', 'url', 'username', 'psw'));\n $servers = $query->execute()\n ->fetchAllAssoc('id');\n\n return $servers;\n}", "public function GetConnectionStatistics()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->get_connection_stats();\r\n }", "public function getVersion() {\n return mysql_get_server_info();\n }", "public function hasThreads() {\n\t\treturn false;\n\t}", "public function GetServerStatus()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->stat();\r\n }", "protected function fetchForums()\n\t{\n\t\t$forums = array();\n\n\t\tforeach( $this->db->select( '*', 'node', array( \"node.nodeid<>2 AND closure.parent=? AND node.contenttypeid=?\", $this->fetchType( 'Thread' ), $this->fetchType( 'Channel' ) ) )->join( 'closure', \"closure.child = node.nodeid\" ) AS $node )\n\t\t{\n\t\t\t$forums[$node['nodeid']] = $node;\n\t\t}\n\n\t\treturn $forums;\n\t}", "public function queues()\n\t{\n\t\treturn Resque::queues();\n\t}", "function get_thread_list($forum_id, $limit = 25, $start = 0) {\n return $this->call('get_thread_list', array('forum_id' => $forum_id, 'limit' => $limit, 'start' => 0));\n }", "static public function master_pool()\n\t{\n\t\trequire( LOCAL_DOCUMENT_ROOT.\"/configure/db.php\" );\n\t\treturn $master_pool[ array_rand( $master_pool ) ];\n\t}", "function getSlave();", "function get_database_server()\n\t{\n\t\treturn ($this->database_server);\n\t}", "function pdo_thread_id($link=NULL) {\r\n return pdo_query(\"SELECT connection_id() AS id\", pdo_handle($link))->fetchObject()->id;\r\n }", "function mysqli_list_processes() {\n\tglobal $link;\n $query = \"SHOW PROCESSLIST\";\n\tif ($res = mysqli_query($link, $query)) {\n // while ($row = mysqli_fetch_assoc($res)) $recs[$i++] = $row;\n\t\t// mysqli_free_result($res);\n // return $recs;\n\t\treturn $res;\n } else {\n return false;\n }\n}", "public function getQueueableConnection()\n {\n return $this->_getConnection()->getName();\n }", "public static function checkForOldThreads()\r\n {\r\n /* @var $threadModel XenForo_Model_Thread */\r\n $threadModel = XenForo_Model::create('XenForo_Model_Thread');\r\n \r\n $lastPostDate = array(\r\n '>=<', \r\n XenForo_Application::$time - (XenForo_Application::get('options')->th_notifyOldThreads_oldThreadMaxDays * 86400),\r\n XenForo_Application::$time - (XenForo_Application::get('options')->th_notifyOldThreads_oldThreadMinDays * 86400),\r\n );\r\n \r\n $conditions = array(\r\n 'last_post_date' => $lastPostDate,\r\n \t'reply_count_th' => 0,\r\n 'discussion_state' => 'visible',\r\n 'discussion_open' => 1,\r\n );\r\n \r\n $excludedNodeIds = XenForo_Application::getOptions()->th_notifyOldThreads_forumIds;\r\n if (!empty($excludedNodeIds)) {\r\n $allowedNodeIds = array_keys(XenForo_Model::create('XenForo_Model_Node')->getAllNodes());\r\n $allowedNodeIds = array_diff($allowedNodeIds, $excludedNodeIds);\r\n $conditions['node_id'] = $allowedNodeIds;\r\n }\r\n \r\n $threadIds = $threadModel->getThreadIds($conditions);\r\n \r\n if (!empty($threadIds)) {\r\n $dw = XenForo_DataWriter::create('XenForo_DataWriter_Option');\r\n $dw->setExistingData('th_notifyOldThreads_threadIds');\r\n $dw->set('option_value', $threadIds);\r\n $dw->save();\r\n }\r\n }", "function pdo_list_processes($link=NULL) {\r\n return pdo_query(\"SHOW FULL PROCESSLIST\", pdo_handle($link));\r\n }", "public function get_dbs()\n\t{\n\t\treturn $this->driver_query('db_list');\n\t}", "public function monitoring()\n {\n return (array) $this->connection()->smembers('monitoring');\n }", "public function getConnections()\n {\n $connections = array();\n foreach ($this->connections as $name => $id) {\n $connections[$name] = $this->container->get($id);\n }\n\n return $connections;\n }", "function cpu_cores(){\n if( !isset( $this->cpu_cores ) ){\n $cpu_cores_check = $this->single_rec(\"select value cpu_cores from v\\$osstat where osstat_id=0\");\n $this->cpu_cores = $cpu_cores_check->CPU_CORES;\n }\n \n return $this->cpu_cores;\n }", "public function getServers();", "public function getServers() {}", "public function getIdleWorkerCount(): int;", "private function _getCores() {\n if (!($this->_cache->test('solrCores'))) {\n $dir = new DirectoryIterator(SCHEMA_PATH);\n $cores = array();\n foreach ($dir as $dirEntry) {\n if($dirEntry->isDir() && !$dirEntry->isDot()){\n $cores[] = $dirEntry->getFilename();\n }\n }\n $this->_cache->save($cores);\n } else {\n $cores = $this->_cache->load('solrCores');\n }\n return $cores;\n }", "public function getThreadType();", "public function GetServerInfo()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->server_info; \r\n }", "public function getMysqlVersions()\n {\n\n // Load models\n $this->load->model('Mysqlversions_model');\n\n return $this->Mysqlversions_model->getMysqlVersions();\n\n }", "public function getConnections();", "public function getConnections();", "protected function getConfiguredMemcachedServers() {}", "public function getJobs()\n {\n $this->refreshConfig();\n return $this->get();\n }", "public function index()\n {\n\n // All threads, ignore deleted/archived participants\n $threads = Thread::getAllLatest()->get();\n\n\n return response()->json($threads);\n }", "public function max_connections()\n {\n $channel = ChannelRepository::getPublic($this);\n\n return $channel->max_connections;\n }", "public function getThreadName() : mixed\n {\n if ($this->threadName === null) {\n $this->threadName = (string)getmypid();\n }//end if\n \n return $this->threadName;\n \n }", "function get_forum_list() {\n return $this->call('get_forum_list');\n }", "private function get_server()\n\t{\n\t\treturn $this->m_server;\n\t}", "public function get_databases() {\r\n\t\t$dbs = $this->query_select ( \"SHOW DATABASES;\" );\r\n\t\tif (! function_exists ( '__tmp_huy_db_databases' )) {\r\n\t\t\tfunction __tmp_huy_db_databases($val) {\r\n\t\t\t\treturn $val ['Database'];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array_map ( '__tmp_huy_db_databases', $dbs );\r\n\t}", "function getLocks();", "public function httpConnections()\n {\n if (function_exists('exec')) {\n $www_total_count = 0;\n $unique = [];\n $command = 'netstat -an '\n . '| egrep \\':80|:443\\' '\n . '| awk \\'{print $5}\\' '\n . '| grep -v \\':::\\*\\' '\n . '| grep -v \\'0.0.0.0\\'';\n @exec($command, $results);\n foreach ($results as $result) {\n $array = explode(':', $result);\n $www_total_count ++;\n if (preg_match('/^::/', $result)) {\n $ipaddr = $array[3];\n } else {\n $ipaddr = $array[0];\n }\n if (!in_array($ipaddr, $unique)) {\n $unique[] = $ipaddr;\n $www_unique_count ++;\n }\n }\n unset($results);\n $this->httpconnections = count($unique);\n return $this->httpconnections;\n }\n return 0;\n }", "public function getThreads()\r\n{\r\n $query_string = \"SELECT postid, postsubject, postdate, postcategory FROM posts \";\r\n $query_string .= \"WHERE postcategory = :postcategory\";\r\n\r\n return $query_string;\r\n\r\n}", "public function getNumberOfConcurrency()\n {\n return $this->_numberOfConcurrency;\n }", "public function getGuildAppQueue()\n {\n return $this->get(self::_GUILD_APP_QUEUE);\n }", "public function getNewestThreads() {\n $topic_1 = 4; // Đánh giá phần mềm\n $topic_2 = 8; // Games Online\n $topic_3 = 10; // Thể Thao\n $limit = 5;\n\n $data = [];\n $data[$topic_1]['name'] = 'Đánh giá phần mềm';\n $data[$topic_2]['name'] = 'Games Online';\n $data[$topic_3]['name'] = 'Thể Thao';\n\n $threadModel = new thread_model();\n $result = $threadModel->excute(\"\n SELECT * FROM threads WHERE topic_id = {$topic_1}\n ORDER BY id DESC LIMIT {$limit} OFFSET 0\n \");\n while ($row = $result->fetch_assoc()) {\n $data[$topic_1]['threads'][] = ['id' => $row['id'], 'title' => $row['title']];\n }\n\n $result = $threadModel->excute(\"\n SELECT * FROM threads WHERE topic_id = {$topic_2}\n ORDER BY id DESC LIMIT {$limit} OFFSET 0\n \");\n while ($row = $result->fetch_assoc()) {\n $data[$topic_2]['threads'][] = ['id' => $row['id'], 'title' => $row['title']];\n }\n\n $result = $threadModel->excute(\"\n SELECT * FROM threads WHERE topic_id = {$topic_3}\n ORDER BY id DESC LIMIT {$limit} OFFSET 0\n \");\n while ($row = $result->fetch_assoc()) {\n $data[$topic_3]['threads'][] = ['id' => $row['id'], 'title' => $row['title']];\n }\n\n return $data;\n }", "static public function getWorkersPlanning()\n {\n return Worker::all();\n }", "private function get_current_sites() {\n\t\t\tif ( empty( $this->current_sites ) ) {\n\t\t\t\t$sites = $this->get_value( 'sites', 'list' );\n\t\t\t\tif ( ! empty( $sites ) ) {\n\t\t\t\t\t$this->current_sites = array_filter( $sites );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->current_sites;\n\t\t}", "public function workers()\n {\n $workerManager = $this->container->get('dtc_queue.manager.worker');\n $workers = $workerManager->getWorkers();\n\n $workerList = [];\n foreach ($workers as $workerName => $worker) {\n /* @var Worker $worker */\n $workerList[$workerName] = get_class($worker);\n }\n $params = ['workers' => $workerList];\n $this->addCssJs($params);\n\n return $this->render('@DtcQueue/Queue/workers.html.twig', $params);\n }", "public function getDatabases(){\n $pdo = $this->pdo;\n $databases = $pdo->prepare(\"SHOW DATABASES;\");\n $databases->execute();\n $databases = $databases->fetchAll($pdo::FETCH_NUM);\n foreach($databases as &$database)\n $database = $database[0];\n return $databases;\n }", "public function selectServers() {\n \n $query = $this->conection->query(\"SELECT nameserver FROM Servidor\");\n $result = array();\n while ($rst = $this->conection->result($query)) {\n\n $name = $rst[\"nameserver\"]; \n array_push($result, $name);\n }\n\n $this->conection->free($query);\n //$this->conection->closeConection();\n return $result;\n }" ]
[ "0.6596997", "0.5806274", "0.58050853", "0.5743514", "0.5502259", "0.54994166", "0.5358289", "0.53518206", "0.52923644", "0.52655643", "0.525861", "0.5246739", "0.52325606", "0.5222674", "0.5188708", "0.5182393", "0.5163504", "0.5129983", "0.51107466", "0.5109008", "0.5109008", "0.50779617", "0.5064864", "0.5054213", "0.5052756", "0.5052756", "0.503205", "0.50197387", "0.49694628", "0.49536002", "0.49523607", "0.4892942", "0.48664346", "0.48663774", "0.48628512", "0.48430914", "0.48237053", "0.48224685", "0.48198038", "0.48142952", "0.4780798", "0.4780723", "0.4780723", "0.47722134", "0.47694147", "0.47648233", "0.4722689", "0.4708147", "0.4706447", "0.46968284", "0.46868607", "0.46814778", "0.4676679", "0.46738258", "0.4666668", "0.46540123", "0.46524033", "0.46498883", "0.4637713", "0.4635153", "0.459395", "0.45825073", "0.45776513", "0.45739943", "0.45708793", "0.45604008", "0.45427883", "0.4542443", "0.4535532", "0.45179823", "0.45170566", "0.45079288", "0.44968143", "0.44955632", "0.44921666", "0.4487336", "0.44813", "0.44641998", "0.4462474", "0.44614494", "0.44540685", "0.44540685", "0.44521183", "0.44513106", "0.44480506", "0.443993", "0.44395122", "0.44269937", "0.4424857", "0.44201523", "0.44152158", "0.44054383", "0.43932837", "0.4384649", "0.43812105", "0.43735862", "0.4369539", "0.43671933", "0.43633142", "0.43623388", "0.4346161" ]
0.0
-1
Retrieves a list of table names from a MySQL database. This function is deprecated. It is preferable to use mysql_query to issue an SQL SHOW TABLES [FROM db_name] [LIKE 'pattern'] statement instead.
function mysql_list_tables(string $database, $link_identifier = null) { error_clear_last(); $result = \mysql_list_tables($database, $link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTableList() {\n\t\t$db = new mysql_db();\n\n\t\t$result = $db -> query(\"show tables\");\n\n\t\t$db -> fetch_array($result);\n\t\t$db -> close_connection();\n\t\treturn $arr;\n\t}", "public function getTableList()\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"show tables\");\n\t\t\n\t\t$db->fetch_array($result);\n\t\t\n\t\treturn $arr;\n\t}", "function getTables() {\n return mysql_query('SHOW TABLES');\n }", "function pdo_list_tables($dbname, $link=NULL) {\r\n $dbname = str_replace(\"`\", \"``\", $dbname);\r\n return pdo_query(\"SHOW TABLES FROM `$dbname`\", pdo_handle($link));\r\n }", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SHOW TABLES\");\n\t}", "function Table_Names(){\n\t\t$database=DatabaseName();\n\t\t$tables = array();\n\t\t$list_tables_sql = \"SHOW TABLES FROM {$database};\";\n\t\t$result = mysql_query($list_tables_sql);\n\t\tif($result){\n\t\t\twhile($table = mysql_fetch_row($result))\n\t\t\t{\n\t\t\t\t$tables[] = $table[0];\n\t\t\t}\n\t\t}\n\t\treturn $tables;\n\t}", "function sql_list_tables() {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$query = 'SHOW TABLES';\n\tsql_dump($query);\n\t$query = $sql->query($query);\n\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n}", "public function getDatabaseTables()\n {\n\n $db_name = $this->db->database;\n\n $show_table_query = $this->db->query(\"SHOW TABLES from $db_name\");\n\n $table_result = $show_table_query->result_array();\n\n $table_list = [];\n\n foreach($table_result as $key => $val) {\n $table_list[] = $val['Tables_in_' . $db_name];\n }\n\n return $table_list;\n }", "public function get_tables() {\r\n\t\t$tables = $this->query_select ( \"SHOW TABLES;\", \"num\" );\r\n\t\tif (! function_exists ( '__tmp_huy_db_tables' )) {\r\n\t\t\tfunction __tmp_huy_db_tables($val) {\r\n\t\t\t\treturn $val [0];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array_map ( '__tmp_huy_db_tables', $tables );\r\n\t}", "public function getAllTables()\n {\n return $this->fetchColumn(\"SHOW TABLES\");\n }", "function listeTables() {\n $sql = \"SHOW TABLES\";\n\t $resultat = mysql_query($sql);\n if($resultat) {\n //$tables=mysql_fetch_array($resultat);\n while ($row = mysql_fetch_array($resultat, MYSQL_NUM)) {\n $tables[] = $row[0];\n }\n mysql_free_result($resultat);\n return $tables;\n } \n }", "function get_tables_from_db( ){\n\t\t\t$db_connect = mysql_connect($this->host,$this->username, $this->password);\n\t\t\t$tables = mysql_list_tables($this->db); \n\t\t\twhile($row = mysql_fetch_assoc($tables)){\n\t\t\t\tforeach($row as $k=>$v){\n\t\t \t\t\t$a_tables[]=$v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $a_tables;\n\t\t}", "function get_tables() {\r\n\t\t$tables = $this->query_array('SHOW TABLES');\r\n\t\t$table_names = array();\r\n\r\n\t\tforeach ($tables as $table) {\r\n\t\t\t$table_name = current($table);\r\n\r\n\t\t\t$table_names[$table_name] = $table_name;\r\n\r\n\t\t}\r\n\r\n\t\treturn $table_names;\r\n\r\n\t}", "public function getTableList($options = array()) {\n if (($req = $this->execute('SHOW TABLES', $options)) === false)\n return false;\n\n $data = array();\n\n while ($row = mysql_fetch_row($req))\n $data[] = $row[0];\n\n return $data;\n }", "public function list_tables() {\n try {\n $sql = \"SHOW TABLES\";\n $result = $this->conn->query($sql);\n //return $result->fetchAll(PDO::FETCH_NUM);\n\n $tables = array();\n foreach($result as $row) {\n //echo $row[0].\"<br>\";\n array_push($tables, $row[0]);\n }\n return $tables;\n\n } catch (PDOException $e) {\n echo(\"DB ERROR: \".$e->getMessage());\n }\n }", "public function qsGetDbTables()\n {\n $sql = 'show tables';\n $d = $this->qExecPluck($sql);\n\n return $d;\n }", "function get_tables()\n{\n $tableList = array();\n $res = mysqli_query($this->conn,\"SHOW TABLES\");\n while($cRow = mysqli_fetch_array($res))\n {\n $tableList[] = $cRow[0];\n }\n return $tableList;\n}", "public function get_tables()\n\t{\n\t\treturn $this->driver_query('table_list');\n\t}", "public function listTables() {\r\n\t\tswitch ($this->getDbtype()) {\r\n\t\t\tcase 'mysql':\r\n\t\t\t\t$sql = \"SHOW FULL TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'pgsql':\r\n\t\t\t\t$sql = \"SELECT CONCAT(table_schema,'.',table_name) AS name FROM information_schema.tables \r\n WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog','information_schema')\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'sqlite':\r\n\t\t\t\t$sql = 'SELECT name FROM sqlite_master WHERE type = \"table\" AND name != \"sqlite_sequence\"';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mssql':\r\n\t\t\t\t$sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\tcase 'oracle':\r\n\t\t\t\t$sql = \"SELECT * FROM dba_tables\";\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception($this->getDbtype() . ' does not support listing table');\r\n\t\t}\r\n\t\t$result = $this->query($sql);\r\n\t\t$result->setFetchMode(PDO::FETCH_NUM);\r\n\t\t$meta = array();\r\n\t\tforeach ($result as $row) {\r\n\t\t\t$meta[] = $row[0];\r\n\t\t}\r\n\t\treturn $meta;\r\n\t}", "function get_mdb_table_names(){\n $prohitsManagerDB = new mysqlDB(MANAGER_DB);\n $mDBname = MANAGER_DB;\n $SQL = \"SHOW TABLES FROM $mDBname\";\n //echo $SQL;\n $result = mysqli_query($prohitsManagerDB->link, $SQL);\n if(!$result){\n echo \"DB Error, could not list tables\\n\";\n echo 'MySQL Error: ' . mysqli_error($prohitsManagerDB->link);\n exit;\n }\n $mTablesNameArr = array();\n while($row = mysqli_fetch_row($result)){\n $mTablesNameArr[strtoupper($row[0])] = $row[0];\n }\n return $mTablesNameArr;\n}", "public function listTables()\n {\n $schema = $this->fetchDatabase();\n\n $rows = $this->fetchAll(\"SELECT table_name, table_rows \n FROM information_schema.tables \n WHERE table_schema = '{$schema}' \n ORDER BY table_name\n \");\n\n $tables = [];\n foreach ($rows as $row) {\n $tables[$row['table_name']] = $row['table_rows'];\n }\n\n return $tables;\n }", "public function GetTables()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\t// Query to get the tables in the current database:\r\n\t\t$records = mysql_query( 'SHOW TABLES' );\r\n\t\tif( !$records )\r\n\t\t{\r\n\t\t\t$this->SetError();\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile( $array_data = mysql_fetch_array( $records ) )\r\n\t\t\t{\r\n\t\t\t\t$tables[] = $array_data[0];\r\n\t\t\t}\r\n\r\n\t\t\t// Returns the array or NULL\r\n\t\t\tif( count( $tables ) > 0 )\r\n\t\t\t{\r\n\t\t\t\treturn $tables;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function list_tables($like = NULL)\n\t{\n\t\t// Make sure the database is connected\n\t\t$this->_connection OR $this->connect();\n\n\t\tis_string($like)\n\t\t\t// Search for table names\n\t\t\t? $result = $this->_connection->query('select', 'SHOW TABLES LIKE '.$this->quote($like), FALSE)\n\t\t\t// Find all table names\n\t\t\t: $result = $this->_connection->query('select', 'SHOW TABLES', FALSE);\n\n\t\t$tables = array();\n\n\t\tforeach ($result as $row)\n\t\t\t$tables[] = reset($row);\n\n\t\treturn $tables;\n\t}", "function dbTablesName() {\n $data = array();\n $tablesname = mysql_list_tables(DB_DATABASE);\n\n $i = 0;\n //var_dump($tablesname);\n while ($row = mysql_fetch_array($tablesname)) {\n if ($row[0] <> \"admin\" && $row[0] <> \"grid\")\n $data[$i] = $row[0];\n\n $i++;\n }\n\n return $data;\n }", "function raw_db_list_database_tables()\r\n{\r\n global $g_current_db;\r\n\r\n $tables = array();\r\n $sql = \"SELECT name FROM sqlite_master WHERE (type = 'table')\";\r\n $res = sqlite_query($g_current_db, $sql);\r\n if ($res) {\r\n while (sqlite_has_more($res)) {\r\n $tables[] = sqlite_fetch_single($res);\r\n }\r\n } else return false;\r\n return $tables;\r\n}", "function listTables($args) {\n\n $conn = mysql_pconnect($args['server'], $args['username'], $args['password']);\n if($conn === false) {\n throw 'Connection failed.';\n }\n\n $results = mysql_list_tables($args['database'], $conn);\n $tables = array();\n while( $row = mysql_fetch_assoc($results) ) {\n $tables[] = $row;\n }\n\n return array( 'tables' => $tables );\n }", "public function getTables($database= NULL) {\n $t= array();\n $database= $this->database($database);\n $q= $this->conn->query(\n 'show tables from %c',\n $database\n );\n while ($table= $q->next()) {\n $t[]= $this->getTable($table[key($table)], $database);\n }\n return $t;\n }", "public function getTables()\n {\n\treturn $this->query('select [name] from [tables]');\n }", "function get_db_tables(){\n\t\tglobal $GonxAdmin;\n\t\t\n\t\t$result = @$this->list_tables($this->dbName);\n\t\tif (!$result) {\n\t\t print \"Erreur : impossible de lister les tables\\n\";\n\t\t print 'Erreur '.$GonxAdmin[\"dbtype\"].' : ' . $this->error();\n\t\t exit;\n\t\t}\n\t while ($row = $this->fetch_row($result)) {\n\t\t\t$Tables[] = $row[0];\n\t }\n\t\treturn $Tables;\t\t\n\t}", "function getTableNames() {\n\n //Gets tablenames from the database\n Global $serverInfo;\n $conn = connect();\n $sql = \"SHOW TABLES FROM \" . $serverInfo[3];\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $tableArray = [];\n if ($result->num_rows > 0) {\n\n //Writes found data into an array\n $i = 0;\n while ($row = $result->fetch_assoc() ) {\n $tableArray[$i] = $row[\"Tables_in_\" . $serverInfo[3] ];\n $i++;\n }\n return $tableArray;\n }\n}", "public function getTables(){\n $pdo = $this->pdo;\n $statement = $pdo->prepare(\"SHOW TABLES FROM $this->name;\");\n $statement->execute();\n $tables = $statement->fetchAll($pdo::FETCH_NUM);\n foreach($tables as &$table)\n $table = $table[0];\n return $tables;\n }", "public function listTables($database = null){\n\t\treturn $this->instance->listTables($database);\n\t}", "function mysql_table_exists($tablename) {\n\t$tables = array();\n\t$tablename = escape_data($tablename);\n\t$query = \"SHOW TABLES FROM DB_NAME LIKE '$tablename'\";\n\t$result = mysqli_query($dbc, $query);\n\tif ($result){\n\t\twhile ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {\n\t\t\t$tables = $row[0];\n\t\t}\n\t} else {\n\t\t$tables = NULL;\n\t}\n\n\treturn $tables;\n}", "public function show_tables()\n\t{\n\t\t$results = $this->get_rows('SHOW TABLES');\n\t\tforeach ($results as $row)\n\t\t{\n\t\t\t$array[] = $row[0];\n\t\t}\n\n\t\treturn $array;\n\t}", "public function getTables(): array {\n global $wpdb;\n return $wpdb->get_results('SHOW TABLES', ARRAY_N);\n }", "public function listTables()\n {\n $nextTableName = null;\n $tables = array();\n \n do {\n $options = new QueryTablesOptions();\n $options->setNextTableName($nextTableName);\n $result = $this->_tableProxy->queryTables();\n $nextTableName = $result->getNextTableName();\n $tables = array_merge($tables, $result->getTables());\n } while(!is_null($nextTableName));\n \n return $tables;\n }", "public function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}", "public static function getTables()\n {\n static $tables = [];\n\n if (!$tables) {\n $prepare = self::getConn()->prepare(\"SHOW TABLES FROM `\" . self::$config['database'] . \"`\");\n $prepare->setFetchMode(PDO::FETCH_ASSOC);\n $prepare->execute();\n $result = $prepare->fetchAll();\n foreach ($result as $key => $value) {\n $result[$key] = current($value);\n }\n }\n return $result;\n }", "function m2p_get_tables($prefix='')\n{\n $tables = array();\n\n $query = '\nSHOW TABLES\n;';\n $result = pwg_query($query);\n\n while ($row = pwg_db_fetch_row($result))\n {\n if (preg_match('/^'.$prefix.'/', $row[0]))\n {\n $tables[] = $row[0];\n }\n }\n\n return $tables;\n}", "public static function tables()\n {\n $tables = false;\n //\n $Tables = Driver::read('SHOW TABLES', Driver::INDEX);\n // die(var_dump($Tables));\n //\n foreach ($Tables as $row) {\n $target_tables[] = $row[0];\n }\n //\n if ($tables !== false) {\n $target_tables = array_intersect($target_tables, $tables);\n }\n //\n return $target_tables;\n }", "function get_tables($database_connection) {\r\n\r\n $tables = array();\r\n $result = mysqli_query($database_connection, \"SHOW TABLES\");\r\n\r\n $rows = array();\r\n while($row = mysqli_fetch_assoc($result)) {\r\n array_push($rows, $row);\r\n }\r\n\r\n $tables_in_database_name_array = array_keys($rows[0]); // This exists solely for the purpose of getting $tables_in_database_name\r\n $tables_in_database_name = $tables_in_database_name_array[0];\r\n\r\n for($i = 0; $i < count($rows); $i++) {\r\n array_push($tables, $rows[$i][$tables_in_database_name]);\r\n }\r\n\r\n return $tables;\r\n }", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SELECT c.relname AS table FROM pg_class c, pg_user u \"\n .\"WHERE c.relowner = u.usesysid AND c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND c.relname !~ '^(pg_|sql_)' UNION \"\n .\"SELECT c.relname AS table_name FROM pg_class c \"\n .\"WHERE c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) \"\n .\"AND c.relname !~ '^pg_'\");\n\t}", "public function getTables($prefix = null)\n {\n $tmp_tables_list = $this->_db->listTables();\n\n if ( $prefix === null ) {\n $prefix = PREFIX_DB;\n }\n\n $tables_list = array();\n //filter table_list: we only want PREFIX_DB tables\n foreach ( $tmp_tables_list as $t ) {\n if ( preg_match('/^' . $prefix . '/', $t) ) {\n $tables_list[] = $t;\n }\n }\n return $tables_list;\n }", "public function getTables() {\n\t\treturn $this->adapter->getCol( \"SELECT name FROM sqlite_master\n\t\t\tWHERE type='table' AND name!='sqlite_sequence';\" );\n\t}", "abstract public function list_tables($db_name_str = false, $filter = false);", "function get_managerDB_base_tableNames(){\n global $msManager_link, $managerDBname;\n $tableNameArr = array();\n $sql = \"SHOW TABLES FROM $managerDBname\";\n $result = mysqli_query($msManager_link, $sql);\n if($result){\n while($row = mysqli_fetch_row($result)){\n if(!strstr($row[0], 'SearchResults') && !strstr($row[0], 'SearchTasks') && !strstr($row[0], 'Plate_Conf')){\n array_push($tableNameArr, $row[0]);\n } \n }\n mysqli_free_result($result);\n }\n if($tableNameArr){\n return $tableNameArr;\n }else{\n return 0;\n } \n}", "function table_list()\n{\n\t//TODO - a similar function is in db_verify.php. Should probably all be moved to mysql_class.php.\n\n\t$exclude = array();\n\t$exclude[] = \"core\";\n\t$exclude[] = \"rbinary\";\n\t$exclude[] = \"parser\";\n\t$exclude[] = \"tmp\";\n\t$exclude[] = \"online\";\n\t$exclude[] = \"upload\";\n\t$exclude[] = \"user_extended_country\";\n\t$exclude[] = \"plugin\";\n\n\t$coreTables = e107::getDb()->db_TableList('nolan');\n\n\t$tables = array_diff($coreTables,$exclude);\n\n\tforeach($tables as $e107tab)\n\t{\n\t\t$count = e107::getDb()->gen(\"SELECT * FROM #\".$e107tab);\n\n\t\tif($count)\n\t\t{\n\t\t\t$tabs[$e107tab] = $count;\n\t\t}\n\t}\n\n\treturn $tabs;\n}", "function get_chado_table_list() {\n $sql_table_list = \"SELECT table_name FROM information_schema.tables WHERE table_schema = 'chado' ORDER BY table_name;\";\n $result_table = db_query($sql_table_list);\n $input_table = $result_table->fetchAll();\n $table_list = [];\n foreach ($input_table as $value) {\n $table_list[] = $value->table_name;\n }\n return $table_list;\n}", "public function getTables() {\n $stmt = $this->pdo->query(\"SELECT table_name \n FROM information_schema.tables \n WHERE table_schema= 'public' \n AND table_type='BASE TABLE'\n ORDER BY table_name\");\n $tableList = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $tableList[] = $row['table_name'];\n }\n\n return $tableList;\n }", "function diy_get_all_tables($connection = null) {\n\t\treturn collect(DB::connection($connection)->select('show tables'))->map(function ($val) {\n\t\t\tforeach ($val as $tbl) return $tbl;\n\t\t});\n\t}", "public function schema_tables($schema = NULL)\n\t{\n\t\tif ($schema instanceof Database_Identifier)\n\t\t{\n\t\t\t$schema = $schema->name;\n\t\t}\n\t\telseif (is_array($schema))\n\t\t{\n\t\t\t$schema = array_pop($schema);\n\t\t}\n\n\t\tif (empty($schema))\n\t\t{\n\t\t\t$schema = $this->_config['connection']['database'];\n\t\t}\n\n\t\t$sql =\n\t\t\t'SELECT table_name, table_type,'\n\t\t\t.' engine, auto_increment, table_collation, table_comment'\n\t\t\t.' FROM information_schema.tables WHERE table_schema = '.$this->quote_literal($schema);\n\n\t\tif ( ! $prefix = $this->table_prefix())\n\t\t{\n\t\t\t// No table prefix\n\t\t\treturn $this->execute_query($sql)->as_array('table_name');\n\t\t}\n\n\t\t// Filter on table prefix\n\t\t$sql .= \" AND table_name LIKE '\".strtr($prefix, array('_' => '\\_', '%' => '\\%')).\"%'\";\n\n\t\t$prefix = strlen($prefix);\n\t\t$result = array();\n\n\t\tforeach ($this->execute_query($sql) as $table)\n\t\t{\n\t\t\t// Strip table prefix from table name\n\t\t\t$table['table_name'] = substr($table['table_name'], $prefix);\n\t\t\t$result[$table['table_name']] = $table;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getTables()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL TABLES\"\n ));\n\n return $result;\n\t}", "public function _get_table_names() {\n // Must be overridden.\n return array();\n }", "function tableNames() {\n\t\treturn \"SELECT name FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence' ORDER BY name\";\n\t}", "public function getTables() {\n $stmt = $this->pdo->query(\"SELECT table_name \n FROM information_schema.tables \n WHERE table_schema= 'public' \n AND table_type='BASE TABLE'\n ORDER BY table_name\");\n $tableList = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $tableList[] = $row['table_name'];\n }\n \n return $tableList;\n }", "public function getTables($db = null, $prefix = null)\n {\n if (null !== $db) {\n $this->exec(\"use $db;\");\n }\n\n\n $query = $this->query('show tables');\n $tables = $query->fetchAll(\\PDO::FETCH_COLUMN);\n\n\n if (null !== $prefix) {\n $tables = array_filter($tables, function ($v) use ($prefix) {\n if (0 === strpos($v, $prefix)) {\n return true;\n }\n return false;\n });\n }\n return $tables;\n }", "public function get_table_names() {\n // Must be overridden.\n $out = $this->_get_table_names();\n return $out;\n }", "public function show_tables($database=false, $show_columns=true){\n\t\n\t\t$this->set_db($database);\n\t\t\n\t\t$query = \"SHOW TABLES FROM \".$this->database.\"\";\n\t\n\t\t$result = $this->sql_query($query, 'LISTING TABLES');\n\t\n\t\t$data = $this->fetch_data($result, 'row');\n\t\t\t\n\t\tif($show_columns){\n\t\t\t\n\t\t\t$list = $this->show_columns(false, $data);\n\n\t\t}\n\t\n\t\treturn $list;\n\t\n\t}", "public function list_tables(){\n if (!$this->select_db($this->_currentDB))\n \t return FALSE;\n \t$tables=array();\n \t$table_exts=array($this->_index_ext,$this->_data_ext,$this->_frame_ext);\n \t$dbpath=$this->_db_root_dir.$this->_currentDB;\n \t$d=dir($dbpath);\n \twhile($tmp=$d->read()){\n $fileInfo = pathinfo($dbpath.'/'.$tmp);\n if(is_file($dbpath.'/'.$tmp) && $fileInfo['extension']=='txt'){\n \t$tmp=str_replace($table_exts,'',$tmp);\n \t\t$tables[]=$tmp;\t\n }\n \t}\n \t$tables=array_unique($tables);\n \treturn $tables;\n }", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))\n );\n }", "public function getTables($refresh = FALSE) {\n\t\tif (!isset($this->tableList) || $refresh) {\n\t\t\t$response = $this->_query(\"SHOW TABLES\");\n\t\t\tif ($response) {\n\t\t\t\t$this->tableList = array_combine($response->get_column(0), $response->get_column(1));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// The request failed so we just set an empty array for not to retry again\n\t\t\t\t$this->tableList = array();\n\t\t\t}\n\t\t}\n\t\treturn $this->tableList;\n\t}", "function tablesList ()\n {\n $sql = \"SELECT a.relname AS name\n FROM pg_class a, pg_user b\n WHERE ( relkind = 'r') and relname !~ '^pg_' AND relname !~ '^sql_'\n AND relname !~ '^xin[vx][0-9]+' AND b.usesysid = a.relowner\n AND NOT (EXISTS (SELECT viewname FROM pg_views WHERE viewname=a.relname));\";\n\n $result = $this->all($sql);\n\n if (!$result)\n {\n trigger_error(ERROR_NO_TABLE_LIST, E_USER_ERROR);\n exit;\n }\n else\n {\n $tables = array();\n foreach ($result as $item) $tables[] = $item['name'];\n return $tables;\n }\n }", "public function getTableNames()\n {\n $query = \"\n SELECT DISTINCT\n TABLE_NAME\n FROM INFORMATION_SCHEMA.TABLES\n WHERE\n TABLE_TYPE='BASE TABLE' AND\n TABLE_SCHEMA = ?\n ORDER BY TABLE_NAME\n \";\n\n $query = \"\n select\n RDB$RELATION_NAME as TABLE_NAME\n from RDB$RELATIONS\n where\n ((RDB$RELATION_TYPE = 0) or\n (RDB$RELATION_TYPE is null)) and\n (RDB$SYSTEM_FLAG = 0)\n order by (RDB$RELATION_NAME)\n \";\n\n\n $statement = $this->pdo->prepare($query);\n $statement->execute(array($this->getSchema()));\n\n $tableNames = array();\n while ($tableName = $statement->fetchColumn(0)) {\n $tableNames[] = $tableName;\n }\n\n return $tableNames;\n }", "public function getTables() {\n $tables = array_map('reset', \\DB::select('SHOW TABLES'));\n return json_encode($tables);\n }", "private function getTables()\n {\n $this->emTypeVerify();\n $conn = $this->getDoctrine()->getManager($this->emType)->getConnection();\n $db = $conn->getDatabase();\n $tables = $conn->fetchAll(\"SHOW TABLES FROM $db\");\n return $tables;\n }", "protected function getTables() {\n \n $sm = $this->db->getSchemaManager();\n\n $tables = array(); \n \n foreach ($sm->listTables() as $table) {\n if ( strpos($table->getName(), $this->prefix) == 0 ) {\n foreach ($table->getColumns() as $column) {\n $tables[ $table->getName() ][ $column->getName() ] = $column->getType(); \n }\n // $output[] = \"Found table <tt>\" . $table->getName() . \"</tt>.\";\n }\n }\n \n return $tables;\n \n }", "protected function tablesInDb(Connection $db) : array\n {\n return $db->getDoctrineSchemaManager()->listTableNames();\n }", "function GetTablesList()\n\t{\n\t\t$this->FillTablesList();\n\t\t$res=array();\n\t\tforeach($this->lstTables as $tbl)\n\t\t\t$res[]=$tbl[\"name\"];\n\t\treturn $res;\n\t}", "protected function _fetchExistingDatabaseTables()\n {\n $query = 'SHOW TABLES';\n $this->_existingTables = $this->_readConn->fetchCol($query);\n }", "protected function getAllTables()\n {\n return $this->getConnection()->select(\n $this->grammar->compileGetAllTables()\n );\n }", "public function showTables($database = null){\n\t\treturn $this->instance->listTables($database);\n\t}", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables(\n $this->parseSearchPath(\n $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema')\n )\n )\n );\n }", "public function showTables(){\n $resultQuery = $this->executeQuery(\"SHOW TABLES;\");\n echo \"Liste des tables : <br><br>\";\n while( $row = mysqli_fetch_row($resultQuery) ){\n echo \" - \".$row[0].\"<br>\";\n }\n echo \"<br>\";\n }", "function table_names($includeViews=true)\n\t{\n\t\t// query\n\t\t$this->query(\"SHOW \".(!$includeViews ? \"FULL\" : \"\").\" TABLES\");\n\n\t\t// get table names\n\t\t$result = array();\n\t\tfor ($i=0; $info = mysqli_fetch_row($this->m_query_id); $i++)\n\t\t{\n\t\t\t// ignore views?\n\t\t\tif (!$includeViews && strtoupper($info[1]) == 'VIEW') continue;\n\n\t\t\t$result[$i][\"table_name\"] = $info[0];\n\t\t\t$result[$i][\"tablespace_name\"] = $this->m_database;\n\t\t\t$result[$i][\"database\"] = $this->m_database;\n\t\t}\n\n\t\t// return result\n\t\treturn $result;\n\t}", "public function getTablesDefinition()\n {\n $query = $this->db_instance->query('SHOW TABLES');\n $tables_a = $query->result_array();\n $tables = array();\n\n foreach ($tables_a as $table) {\n $table = array_pop($table);\n $tables[$table] = $this->getDefinitionFromTable($table);\n }\n\n return $tables;\n }", "public function getTables()\n {\n $sqlStm = \"SELECT TABLE_NAME as tableName,\n CASE TABLE_TYPE WHEN 'VIEW' THEN 'true'\n ELSE 'false'\n END as isView\n FROM information_schema.tables\n WHERE TABLE_SCHEMA = ?\";\n \n $query = new DataQuery($sqlStm);\n $param = new DataParameter('schema', DataParameter::TYPE_VARCHAR , $this->schema);\n return $this->query($query, array($param));\n }", "private function getTables($conn)\n {\n $result = $conn->query(\"SHOW TABLES\");\n $empty = array();\n if (!$result) {\n return $empty;\n }\n $tables = array();\n while ($row = $result->fetch_row()) {\n $tables[] = $row[0];\n }\n return $tables;\n }", "protected function getDatabaseTables() {}", "protected function findTableNames($schema='')\n\t{\n\t\t// CUBRID does not allow to look into another database from within another connection.\n\t\t// If necessary user has to establish a connection to that particular database and\n\t\t// query to show all tables. For this reason if a user executes this funtion\n\t\t// we will return all table names of the currently connected database.\n\t\treturn $this->getDbConnection()->createCommand('SHOW TABLES')->queryColumn();\n\t}", "public function tables($schema)\n\t{\n\t \t$sql=\"select tablename from pg_tables where tablename not like 'pg\\_%' \"\n\t\t\t.\"and tablename not in ('sql_features', 'sql_implementation_info', 'sql_languages', \"\n\t \t\t.\"'sql_packages', 'sql_sizing', 'sql_sizing_profiles') and schemaname='$schema';\";\n\t\n\t\treturn $this->execute($sql);\n\t}", "public function listTables(string $schemaName = null) : string\n {\n $sql = 'SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES';\n if ($schemaName) {\n $sql .= \" WHERE TABLE_SCHEMA = '{$schemaName}'\";\n }\n\n return $sql;\n }", "public function schema_tables($schema = NULL)\n\t{\n\t\tif ( ! $schema)\n\t\t{\n\t\t\t// Use default schema\n\t\t\t$schema = 'main';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! $schema instanceof SQL_Identifier)\n\t\t\t{\n\t\t\t\t// Convert to identifier\n\t\t\t\t$schema = new SQL_Identifier($schema);\n\t\t\t}\n\n\t\t\t$schema = $schema->name;\n\t\t}\n\n\t\t$sql =\n\t\t\t\"SELECT tbl_name AS table_name, CASE type WHEN 'table'\"\n\t\t\t.\" THEN 'BASE TABLE' ELSE 'VIEW' END AS table_type, sql\"\n\t\t\t.' FROM '.$this->_quote_left.$schema.$this->_quote_right\n\t\t\t.\".sqlite_master WHERE type IN ('table', 'view')\";\n\n\t\tif ( ! $this->_table_prefix)\n\t\t{\n\t\t\t// No table prefix\n\t\t\treturn $this->execute_query($sql)->as_array('table_name');\n\t\t}\n\n\t\t// Filter on table prefix\n\t\t$sql .= ' AND tbl_name LIKE '.$this->quote_literal(\n\t\t\tstrtr($this->_table_prefix, array('_' => '\\_', '%' => '\\%')).'%'\n\t\t).\" ESCAPE '\\'\";\n\n\t\t$prefix = strlen($this->_table_prefix);\n\t\t$result = array();\n\n\t\tforeach ($this->execute_query($sql) as $table)\n\t\t{\n\t\t\t// Strip table prefix from table name\n\t\t\t$table['table_name'] = substr($table['table_name'], $prefix);\n\t\t\t$result[$table['table_name']] = $table;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function showTables()\n {\n switch($this->db_type){\n case 'mssql';\n case 'sqlsrv':\n $sql = 'SELECT * FROM sys.all_objects WHERE type = \\'U\\'';\n break;\n case 'pgsql':\n $sql = 'SELECT tablename FROM pg_tables WHERE tableowner = current_user';\n break;\n case 'sqlite':\n $sql = 'SELECT * FROM sqlite_master WHERE type=\\'table\\'';\n break;\n case 'oci':\n $sql = 'SELECT * FROM system.tab';\n break;\n case 'ibm':\n $schema = '';\n $sql = 'SELECT TABLE_NAME FROM qsys2.systables'.\n (($schema != '') ? ' WHERE TABLE_SCHEMA = \\''.$schema.'\\'' : '');\n break;\n case 'mysql':\n default:\n $sql = 'SHOW TABLES IN `'.$this->db_name.'`';\n break;\n }\n\n try{\n $sth = $this->query($sql);\n $result = $sth->fetchAll();\n }catch(PDOException $e){\n $this->error( $e->getMessage());\n $result = false;\n }\n return $result;\n }", "public function findTableNames($schema='')\n\t{\n\t\tif($schema==='')\n\t\t{\n\t\t\t$sql=<<<EOD\nSELECT table_name, '{$schema}' as table_schema FROM user_tables\nEOD;\n\t\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql=<<<EOD\nSELECT object_name as table_name, owner as table_schema FROM all_objects\nWHERE object_type = 'TABLE' AND owner=:schema\nEOD;\n\t\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t\t$command->bindParam(':schema',$schema);\n\t\t}\n\n\t\t$rows=$command->queryAll();\n\t\t$names=array();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\tif($schema===$this->getDefaultSchema() || $schema==='')\n\t\t\t\t$names[]=$row['TABLE_NAME'];\n\t\t\telse\n\t\t\t\t$names[]=$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];\n\t\t}\n\t\treturn $names;\n\t}", "function get_table_list() {\n $sql_public_table_list = \"SELECT table_name FROM information_schema.tables WHERE (table_schema = 'public') ORDER BY table_name\";\n $sql_chado_table_list = \"SELECT table_name FROM information_schema.tables WHERE (table_schema = 'chado') ORDER BY table_name\";\n $public_table_results = db_query($sql_public_table_list)->fetchAll();\n $chado_table_results = db_query($sql_chado_table_list)->fetchAll();\n\n $public_tables = [];\n $chado_tables = [];\n foreach ($public_table_results as $value) {\n $public_tables[] = $value->table_name;\n }\n foreach ($chado_table_results as $value) {\n $chado_tables[] = 'chado.' . $value->table_name;\n }\n return array_merge($public_tables, $chado_tables);\n}", "protected function getTables()\n {\n $sm = $this->app['db']->getSchemaManager();\n\n $tables = array();\n\n foreach ($sm->listTables() as $table) {\n if (strpos($table->getName(), $this->prefix) == 0) {\n foreach ($table->getColumns() as $column) {\n $tables[$table->getName()][$column->getName()] = $column->getType();\n }\n }\n }\n\n return $tables;\n\n }", "private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }", "function get_all_tables_in_schema($schema) {\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\ttable_name\n\t\t\tFROM\n\t\t\t\tinformation_schema.tables\n\t\t\tWHERE\n\t\t\t\ttable_schema = '\" .$schema . \"'\n\t\t\t;\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_all($ret[1]);\n\t\t//$result = (!empty($result)) ? array_column($result, 'table_name') : array();\n\t\treturn $result;\n\t}", "public function getAllTables(): array\n {\n $names_Tables = [];\n $Schemas = $this->getALLschema();\n foreach ($Schemas as $schema) {\n $names_Tables[] = $schema->getNameTable();\n }\n return $names_Tables;\n }", "final public function fetchTableNames() {\n if ($this->tableNames !== null) {\n return array_values($this->tableNames);\n }\n\n $names = $this->fetchTableNamesDb();\n\n $this->tableNames = [];\n foreach ($names as $name) {\n $name = $this->stripPrefix($name);\n $this->tableNames[strtolower($name)] = $name;\n }\n\n return array_values($this->tableNames);\n }", "public function get_system_tables()\n\t{\n\t\treturn $this->driver_query('system_table_list');\n\t}", "function get_tables_name(){\n $tables = null;\n $query = \"SHOW TABLES FROM cozagro_db\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result){\n $_SESSION['message'] = \"<br>Eroare la get_tables_name\".Database::getInstance()->getConnection()->error;\n $_SESSION['status'] = \"danger\";\n $_SESSION['icon'] = \"exclamation-sign\";\n echo status_baloon();\n die(\"mort!!\");\n }\n while ($row = $result->fetch_row()){\n $table = ucfirst(str_replace(\"_\", \" \", $row[0]));\n $tables[] = ['name' => $table, 'tab' => $row[0]];\n }\n $result ->free_result();\n return $tables;\n}", "public function listTables($database, $userRemoveTables = array())\n\t{\n\t\tif (!is_array($userRemoveTables))\n\t\t{\n\t\t\tthrow new MainException(gettype($userRemoveDatabases),\n\t\t\t\tMainException::TYPE_ARRAY);\n\t\t}\n\n\t\t$removeTables = array();\n\t\t$tmp = array_merge($removeTables, $userRemoveTables);\n\t\t$tmpTables = array();\n\n\t\t// Create a new object, otherwise (with the db being changed)\n\t\t// it'll reset the connection and further access will error\n\t\t$db = new Mysql($database, $this->_host, $this->_user,\n\t\t\t$this->_password, $this->_port);\n\n\t\t// get all the tables\n\t\t$db->query('\n\t\t\tSHOW TABLES\n\t\t\tFROM `'.$database.'`\n\t\t');\n\t\twhile ($db->nextRecord())\n\t\t{\n\t\t\tif (!in_array($db->record('Tables_in_'.$database), $tmp))\n\t\t\t{\n\t\t\t $tmpTables[] = $db->record('Tables_in_'.$database);\n\t\t\t}\n\t\t}\n\n\t\t// return if valid array\n\t\tif (is_array($tmpTables))\n\t\t{\n\t\t\treturn $tmpTables;\n\t\t}\n\t\treturn array();\n\t}", "function get_tables( $scope = 'regular' ) {\n\t\tglobal $wpdb;\n\t\t$prefix = ( $scope == 'temp' ? $this->temp_prefix : $wpdb->prefix );\n\t\t$tables = $wpdb->get_results( 'SHOW FULL TABLES', ARRAY_N );\n\t\tforeach ( $tables as $table ) {\n\t\t\tif ( ( ( $scope == 'temp' || $scope == 'prefix' ) && 0 !== strpos( $table[0], $prefix ) ) || $table[1] == 'VIEW' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$clean_tables[] = $table[0];\n\t\t}\n\t\treturn apply_filters( 'wpmdb_tables', $clean_tables, $scope );\n\t}", "public function get_table_schema() {\n\t\tglobal $wpdb;\n\n\t\t$tables = array_keys( $this->get_all_tables() );\n\t\t$show = array();\n\n\t\tforeach ( $tables as $table ) {\n\t\t\t// These are known queries without user input\n\t\t\t// phpcs:ignore\n\t\t\t$row = $wpdb->get_row( 'SHOW CREATE TABLE ' . $table, ARRAY_N );\n\n\t\t\tif ( $row ) {\n\t\t\t\t$show = array_merge( $show, explode( \"\\n\", $row[1] ) );\n\t\t\t\t$show[] = '';\n\t\t\t} else {\n\t\t\t\t/* translators: 1: table name */\n\t\t\t\t$show[] = sprintf( __( 'Table \"%s\" is missing', 'redirection' ), $table );\n\t\t\t}\n\t\t}\n\n\t\treturn $show;\n\t}", "static public function list_all_tables()\n\t{\n\t\t$file_array = array_filter( scandir( LOCAL_DOCUMENT_ROOT.\"/schema/\" ), \"Common::filter_table_folder\" );\n\t\t$table_array = array();\n\t\tforeach( $file_array as $file_name ) {\n\t\t\t$table_array[] = substr( $file_name, 0, -4 ); //remove .php\n\t\t}\n\t\treturn $table_array;\n\t}", "public function getTableNames();", "public function listTables($schemaName=null){ }", "public function getAllTables() {\n return array_unique(array_values($this->alias2table));\n }", "public function findTableNames($schema='')\n\t{\n\t\t$sql=\"SELECT DISTINCT tbl_name FROM sqlite_master WHERE tbl_name<>'sqlite_sequence'\";\n\t\treturn $this->getDbConnection()->createCommand($sql)->queryColumn();\n\t}" ]
[ "0.75148666", "0.7508492", "0.74907815", "0.748324", "0.7426012", "0.73636156", "0.7329825", "0.7292531", "0.7259914", "0.72039014", "0.712859", "0.71266305", "0.7099667", "0.6977364", "0.69743675", "0.6963513", "0.6961839", "0.6960904", "0.69022596", "0.6875812", "0.683967", "0.6834914", "0.6832263", "0.6823953", "0.68119764", "0.6798275", "0.67944884", "0.67855734", "0.6740022", "0.6733871", "0.67337227", "0.66706", "0.6660298", "0.66279054", "0.66268843", "0.66257393", "0.65785825", "0.65561676", "0.65555394", "0.65477675", "0.65474474", "0.65210414", "0.65101784", "0.64970326", "0.6496048", "0.64883435", "0.6483219", "0.64724135", "0.64639395", "0.6449528", "0.6418943", "0.64096475", "0.63983744", "0.6390285", "0.63892704", "0.6387724", "0.63856983", "0.63826025", "0.6377744", "0.63707256", "0.6370187", "0.6365355", "0.6358323", "0.6328235", "0.6317168", "0.6299664", "0.6248772", "0.62460464", "0.62199813", "0.61911875", "0.61871153", "0.61753166", "0.6171737", "0.61662", "0.61603427", "0.61567736", "0.6154475", "0.61363965", "0.61321056", "0.6127613", "0.6098336", "0.60935396", "0.6061753", "0.60589164", "0.60560006", "0.6047713", "0.6039286", "0.6038645", "0.5980533", "0.5972193", "0.59646755", "0.59562063", "0.5928795", "0.5913856", "0.58861935", "0.5876903", "0.5855275", "0.58547515", "0.585319", "0.5848169" ]
0.69927025
13
Sets the default character set for the current connection.
function mysql_set_charset(string $charset, $link_identifier = null): void { error_clear_last(); $result = \mysql_set_charset($charset, $link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_charset($cs) {\n $this->default_charset = $cs;\n }", "public static function setCharsetEncoding () {\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::getInstance ();\r\n\t\t}\r\n\t\tself::$instance->exec (\r\n\t\t\t\"SET NAMES 'utf8';\r\n\t\t\tSET character_set_connection=utf8;\r\n\t\t\tSET character_set_client=utf8;\r\n\t\t\tSET character_set_results=utf8\" );\r\n\t}", "public function setCharSet($charSet) {}", "function Set_CharacterEncoding($charSet)\r\n\t{\r\n $this->_charEncoding = $charSet;\r\n\t}", "private function charset()\n\t{\n\t\tif (isset($this->_conf['charset']) AND $this->_conf['charset'] != '')\n\t\t{\n\t\t\tif (isset($this->_conf['collation']) AND $this->_conf['collation'] != '')\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset'].' COLLATE '.$this->_conf['collation']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_con->exec('SET NAMES '.$this->_conf['charset']);\n\t\t\t}\n\t\t}\n\t}", "private function setCharSet()\n {\n // preparing csConvObj\n if (!is_object($GLOBALS['TSFE']->csConvObj)) {\n if (is_object($GLOBALS['LANG'])) {\n $GLOBALS['TSFE']->csConvObj = $GLOBALS['LANG']->csConvObj;\n\n } else {\n $GLOBALS['TSFE']->csConvObj = Tx_Smarty_Service_Compatibility::makeInstance('t3lib_cs');\n }\n }\n\n // preparing renderCharset\n if (!is_object($GLOBALS['TSFE']->renderCharset)) {\n if (is_object($GLOBALS['LANG'])) {\n $GLOBALS['TSFE']->renderCharset = $GLOBALS['LANG']->charSet;\n\n } else {\n $GLOBALS['TSFE']->renderCharset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];\n }\n }\n }", "private function set_charset() {\n\t\t//regresa bool\n\t\t$this->conn->set_charset(\"utf8\");\n\t}", "public static function getDefaultCharset()\n\t{\n\t\tif (MHTTPD::$charset !== null) {\n\t\t\treturn MHTTPD::$charset;\n\t\t}\n\t\t$charset = ini_get('default_charset');\n\t\tif ($charset != '') {$charset = \"; charset={$charset}\";}\n\t\tMHTTPD::$charset = $charset;\n\t\t\n\t\treturn $charset;\n\t}", "final public function setUTF() {\n mysqli_query($this->resourceId,\"SET NAMES 'utf8'\");\n }", "public function setUTF()\n\t{\n\t\t$this->connect();\n\n\t\treturn false;\n\t}", "protected function setCharacterSet() {}", "protected function setUtf8Context()\n {\n setlocale(LC_ALL, $locale = 'en_US.UTF-8');\n putenv('LC_ALL=' . $locale);\n }", "public function init_charset()\n {\n }", "protected function setUtf8Context()\n {\n $locale = 'en_US.UTF-8';\n setlocale(LC_ALL, $locale);\n putenv('LC_ALL=' . $locale);\n }", "public function set_charset($charset){\n if (in_array($charset,$this->_supported_charsets))\n $this->_charset=$charset;\n }", "public function setCharSet($characters)\n {\n self::$charSet = $characters;\n $this->setCharLen($characters);\n }", "public function setCharset($charset);", "abstract protected function set_charset($charset);", "public function setCharset($charset) {\n\t\tif($charset == self::CHARSET_ISO){\n\t\t\t$this->charset = self::CHARSET_ISO;\n\t\t} else {\n\t\t\t$this->charset = self::CHARSET_UTF;\n\t\t}\n\t}", "public static function getCurrentCharset() {}", "public function setConnectionCharset($connectionCharset = 'utf8')\n {\n $this->disconnectIfConnected();\n $this->connectionCharset = $connectionCharset;\n }", "public function getDefaultCharacterSet()\n {\n $characterSet = $this->config->get('database.preferred_character_set');\n $characterSet = $this->normalizeCharacterSet($characterSet);\n\n return $characterSet;\n }", "public function setCharset($charset) {\r\n\t\t$this->charset = $charset;\r\n\t}", "public function setCharset(string $charset = 'utf-8');", "abstract protected function setCharset($charset, $collation);", "function setCharset($value)\n {\n $this->setAttribute(\"charset\", $value);\n return $this;\n }", "public function set_charset($dbh, $charset = \\null, $collate = \\null)\n {\n }", "function setDefaultEncoding($default_encoding) {\n $this->fields['default_encoding'] = $default_encoding;\n return $this;\n }", "function setDefaultEncoding($default_encoding) {\n $this->fields['default_encoding'] = $default_encoding;\n return $this;\n }", "public function SetCharacterSetName($argCharacterSetName)\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->set_charset($argCharacterSetName);\r\n }", "function setCharEncoding($sEncoding)\n\t{\n\t\t$this->sEncoding = $sEncoding;\n\t}", "function atkGetCharset()\n{\n\treturn atkconfig('default_charset',atktext('charset','atk'));\n}", "public function setUTF()\n\t{\n\t\treturn true;\n\t}", "function setContentCharset($content_charset){\n\t\tsettype($content_charset,\"string\");\n\t\t$this->_ContentCharset_Redefined = true;\n\t\t$this->_ContentCharset = $content_charset;\n\t}", "public function setCharset($charset)\n {\n $this->charset = strtoupper($charset);\n }", "public function setCharset($charset)\n\t{\n\t\t$this->charset = $charset;\n\t}", "function set_encoding($encoding=\"\")\r\n {\r\n if(\"\" == $encoding)\r\n $encoding = $this->encoding;\r\n $sql = \"SET SESSION character_set_database = \" . $encoding; //'character_set_database' MySQL server variable is [also] to parse file with rigth encoding\r\n $res = @mysql_query($sql);\r\n return mysql_error();\r\n }", "public function getCharset()\n {\n return $this->_db->getOption('charset');\n }", "private function setCharset(string $charset): void {\n\t\t$this->charset = $charset;\n\t}", "public function getCharset()\n {\n return $this->options['charset'];\n }", "function setDocumentCharset($charset)\n {\n $this->documentCharset = $charset;\n }", "public function set_charset($charset)\n {\n $this->charset = $charset;\n }", "public function setCharset($cs)\n\t{\n\t\tif(is_string($cs))\n\t\t{\n\t\t\t$this->charset = $cs;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function setCharset($charset)\n {\n $this->charset = $charset;\n }", "public function setCharset($charset)\n {\n $this->charset = $charset;\n }", "public function setCharset($charset)\n {\n $this->charset = $charset;\n }", "public function setCharset($charset)\n {\n $this->charset = $charset;\n }", "function setCharsetHandler($method = \"none\", $php, $sql) {\n\t\t$this->_charsetMethod = $method;\n\t\t$this->_charsetPhp = $php;\n\t\t$this->_charsetSql = $sql;\n\t}", "public function set_charset($charset) {\r\n $this->charset = $charset;\r\n ini_set('php-gtk.codepage', $this->charset);\r\n bind_textdomain_codeset($this->domain, $this->charset);\r\n Application::config()->charset = $this->charset;\r\n return true;\r\n }", "public function setCharset($charsetName)\n {\n $this->charset = $charsetName;\n }", "protected function setConn() {\n try {\n // Connect and create the PDO object\n self::$conn = new PDO(\"mysql:host=\".DBHOST.\"; dbname=\".DBNAME, DBUSER, DBPASS);\n\n // Sets to handle the errors in the ERRMODE_EXCEPTION mode\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n self::$conn->exec('SET character_set_client=\"utf8\",character_set_connection=\"utf8\",character_set_results=\"utf8\";'); // Sets encoding UTF-8\n \n }\n catch(PDOException $e) {\n $this->eror = 'Unable to connect to MySQL: '. $e->getMessage();\n }\n }", "public function __construct()\n {\n $this->charset = strtoupper('UTF-8');\n }", "public function setCharset(string $charset)\n {\n $this->charset = $charset;\n }", "public static function reset_mbstring_encoding() {\n\t\tself::mbstring_binary_safe_encoding(true);\n\t}", "function setDoXmlUtf8Encoding($value)\n {\n $this->_props['DoXmlUtf8Encoding'] = $value;\n }", "public function setUTF()\n {\n return false;\n }", "public function setCharEncoding($encoding) {\n\t\t$this->_text[$this->_lineNumber][$this->_section]['encoding']=$encoding;\n\t}", "abstract public function setUTF();", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "public function setDefaultValue($value, $encoding = 'UTF-8') {}", "protected static function resolveDefaultEncoding() {}", "public function admin_get_charsets() {}", "public function admin_get_charsets() {}", "protected function getCharsetConversion() {}", "function reset_mbstring_encoding() {\r\n\t\tmbstring_binary_safe_encoding( true );\r\n\t}", "public function setCharset($charset)\n {\n $this->headers->setAttribute(\"Content-Type\", \"charset\", $charset);\n if (($this->getEncoding() == \"7bit\") && (strtolower($charset) == \"utf-8\" || strtolower($charset) == \"utf8\")) $this->setEncoding(\"8bit\");\n }", "public function setCharset($var)\n {\n GPBUtil::checkString($var, True);\n $this->charset = $var;\n\n return $this;\n }", "public function getDefaultChar() {}", "Public Function getCharset() { Return $this->charset; }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function getCharset()\n {\n return $this->charset;\n }", "public function setCharset($charset)\n {\n parent::setCharset($charset);\n if (isset($this->paramEncoder)) {\n $this->paramEncoder->charsetChanged($charset);\n }\n }", "public function setCharacterSet($characterSet)\n {\n if ($characterSet !== null) {\n $characterSet = $this->normalizeCharacterSet($characterSet);\n }\n $this->characterSet = $characterSet;\n\n return $this;\n }", "public function setDefaultValue($value, $encoding = 'UTF-8');", "public function get_charset(){\n return $this->_charset;\n }", "public function setDefaultCwd() {\n $connConf = $this->getConnectionModel();\n $dn = $connConf->getBaseDN();\n if(!$dn) // no BaseDN given, guess the Base dir\n $dn = $this->helper->suggestBaseDNFromName($connConf->getBindDN());\n $this->setBaseDN($dn);\n $this->setCwd($dn);\n }", "public function __construct(){\n // Conectar no banco de dados\n mysql_connect(DBHOST, DBUSER, DBPASS) or die ('Erro ao conectar no banco: '. mysql_error());\n // Selecionar o banco \n mysql_select_db(DBNAME);\n \n $this->execQuery('SET character_set_connection=utf8');\n $this->execQuery('SET character_set_client=utf8');\n $this->execQuery('SET character_set_results=utf8');\n }", "public function charset()\n\t{\n\t\treturn Kohana::$charset;\n\t}", "public static function setUtf8EncodingHeader() : void {\n if (!headers_sent()) {\n header('Content-Type: text/html; charset=utf-8');\n }\n }", "public function getCharset()\n\t{\n\t\treturn $this->charset;\n\t}", "public function getCharset()\n\t{\n\t\treturn $this->charset;\n\t}", "public function setUpCharacterStrings() {}", "public function setPrinterToDefault()\n {\n $command = chr(94).'default'.self::CRLF;\n $this->device->buffer .= $command;\n return $command;\n }", "function setEncoding($encode){\n\t\t$this->encodetext=$encode;\n\t}", "function setCharset ($a_charset,$a_overwrite = false)\n\t{\n\t\tif (is_integer($this->doc->charset) or ($a_overwrite)) {\n\t\t\t$this->doc->charset = $a_charset;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "private function reset_mbstring_encoding() {\n\t\t$this->mbstring_binary_safe_encoding( true );\n\t}", "public function getCharset()\n\t{\n\t\treturn $this->_charset;\n\t}", "public function setDefaultLocale()\n {\n $this->setLocale('en');\n $locale = \\Locale::getDefault();\n if ($locale) {\n $this->setLocale($locale);\n }\n }", "function reset_mbstring_encoding()\n {\n }", "public function __construct()\n\t{\n\t\t// default from encoding\n\t\t$this->from = 'CP1252';\n\n\t\t// default to encoding\n\t\t$this->to = 'UTF-8';\n\t}" ]
[ "0.73494357", "0.70323133", "0.67905945", "0.6746517", "0.66157854", "0.6614336", "0.66137016", "0.62324524", "0.6198515", "0.6136783", "0.61302584", "0.60767865", "0.6060498", "0.59832424", "0.5975909", "0.59705186", "0.59582525", "0.59291756", "0.5928294", "0.5915921", "0.5895634", "0.5883445", "0.5790905", "0.57895064", "0.57834435", "0.57581055", "0.5755468", "0.5754381", "0.5754381", "0.57364583", "0.57360977", "0.5730926", "0.570878", "0.56975114", "0.56732315", "0.56631714", "0.56627566", "0.5622256", "0.56016093", "0.56008124", "0.5598773", "0.559462", "0.55944777", "0.5594252", "0.5594252", "0.5594252", "0.5594252", "0.5541908", "0.5465713", "0.5461266", "0.5442506", "0.5420925", "0.54187024", "0.5402693", "0.538615", "0.53547806", "0.53533477", "0.5347267", "0.5344995", "0.53441375", "0.53441375", "0.53441375", "0.53441375", "0.53441375", "0.5342589", "0.5334562", "0.53341883", "0.5331541", "0.531778", "0.5316421", "0.5313967", "0.52927023", "0.528834", "0.52867377", "0.52811396", "0.52811396", "0.52811396", "0.52811396", "0.52811396", "0.52811396", "0.52811396", "0.52811396", "0.527724", "0.52690923", "0.52600884", "0.52508646", "0.524266", "0.5242254", "0.5229465", "0.5226477", "0.5224312", "0.5224312", "0.52219456", "0.5215055", "0.5198553", "0.519565", "0.5193392", "0.5187023", "0.51841545", "0.5184081", "0.51813424" ]
0.0
-1
Retrieves the table name from a result. This function is deprecated. It is preferable to use mysql_query to issue an SQL SHOW TABLES [FROM db_name] [LIKE 'pattern'] statement instead.
function mysql_tablename($result, int $i): string { error_clear_last(); $result = \mysql_tablename($result, $i); if ($result === false) { throw MysqlException::createFromPhpError(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function RetCheckTable() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: Table not properly provided in QueryHelper.\");\n }\n\n return \"SHOW TABLES LIKE '{$this->\n tables[0]}';\";\n }", "function getTables() {\n return mysql_query('SHOW TABLES');\n }", "function getTableNames() {\n\n //Gets tablenames from the database\n Global $serverInfo;\n $conn = connect();\n $sql = \"SHOW TABLES FROM \" . $serverInfo[3];\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $tableArray = [];\n if ($result->num_rows > 0) {\n\n //Writes found data into an array\n $i = 0;\n while ($row = $result->fetch_assoc() ) {\n $tableArray[$i] = $row[\"Tables_in_\" . $serverInfo[3] ];\n $i++;\n }\n return $tableArray;\n }\n}", "function get_tables_name(){\n $tables = null;\n $query = \"SHOW TABLES FROM cozagro_db\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result){\n $_SESSION['message'] = \"<br>Eroare la get_tables_name\".Database::getInstance()->getConnection()->error;\n $_SESSION['status'] = \"danger\";\n $_SESSION['icon'] = \"exclamation-sign\";\n echo status_baloon();\n die(\"mort!!\");\n }\n while ($row = $result->fetch_row()){\n $table = ucfirst(str_replace(\"_\", \" \", $row[0]));\n $tables[] = ['name' => $table, 'tab' => $row[0]];\n }\n $result ->free_result();\n return $tables;\n}", "public function table_name(){\n $q = \"SHOW FULL TABLES FROM \".DATABASE;\n $re = $this->Request_model->peticion($q);\n $tabla = array();\n for ($i=0; $i <count($re) ; $i++):\n $db = 'Tables_in_'.DATABASE;\n $value = $re[$i][$db];\n $tabla[] = $value;\n endfor; \n return $tabla;\n }", "function Table_Names(){\n\t\t$database=DatabaseName();\n\t\t$tables = array();\n\t\t$list_tables_sql = \"SHOW TABLES FROM {$database};\";\n\t\t$result = mysql_query($list_tables_sql);\n\t\tif($result){\n\t\t\twhile($table = mysql_fetch_row($result))\n\t\t\t{\n\t\t\t\t$tables[] = $table[0];\n\t\t\t}\n\t\t}\n\t\treturn $tables;\n\t}", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SHOW TABLES\");\n\t}", "function nombreTabla($result,$indice){\n\t if (isset($result) and isset ($indice)){\n\t\treturn mysql_field_table($result, $indice);\n\t }\n\t}", "protected static function table_name(): mixed\n\t{\n\t\treturn self::$query->table_name;\n\t}", "public function getTableList()\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"show tables\");\n\t\t\n\t\t$db->fetch_array($result);\n\t\t\n\t\treturn $arr;\n\t}", "public function getTables()\n {\n\treturn $this->query('select [name] from [tables]');\n }", "function getTablename(){\n $ci = & get_instance();\n $ci->load->database();\n $query = $ci->db->query(\"SELECT table_name FROM information_schema.tables WHERE table_schema = 'anjwekhs_anjwebtech_pms'\");\n return $query->result_array();\n}", "public function getTableList() {\n\t\t$db = new mysql_db();\n\n\t\t$result = $db -> query(\"show tables\");\n\n\t\t$db -> fetch_array($result);\n\t\t$db -> close_connection();\n\t\treturn $arr;\n\t}", "function get_managerDB_base_tableNames(){\n global $msManager_link, $managerDBname;\n $tableNameArr = array();\n $sql = \"SHOW TABLES FROM $managerDBname\";\n $result = mysqli_query($msManager_link, $sql);\n if($result){\n while($row = mysqli_fetch_row($result)){\n if(!strstr($row[0], 'SearchResults') && !strstr($row[0], 'SearchTasks') && !strstr($row[0], 'Plate_Conf')){\n array_push($tableNameArr, $row[0]);\n } \n }\n mysqli_free_result($result);\n }\n if($tableNameArr){\n return $tableNameArr;\n }else{\n return 0;\n } \n}", "function get_tables() {\r\n\t\t$tables = $this->query_array('SHOW TABLES');\r\n\t\t$table_names = array();\r\n\r\n\t\tforeach ($tables as $table) {\r\n\t\t\t$table_name = current($table);\r\n\r\n\t\t\t$table_names[$table_name] = $table_name;\r\n\r\n\t\t}\r\n\r\n\t\treturn $table_names;\r\n\r\n\t}", "public function getAllTables()\n {\n return $this->fetchColumn(\"SHOW TABLES\");\n }", "public function list_tables() {\n try {\n $sql = \"SHOW TABLES\";\n $result = $this->conn->query($sql);\n //return $result->fetchAll(PDO::FETCH_NUM);\n\n $tables = array();\n foreach($result as $row) {\n //echo $row[0].\"<br>\";\n array_push($tables, $row[0]);\n }\n return $tables;\n\n } catch (PDOException $e) {\n echo(\"DB ERROR: \".$e->getMessage());\n }\n }", "public function get_tables() {\r\n\t\t$tables = $this->query_select ( \"SHOW TABLES;\", \"num\" );\r\n\t\tif (! function_exists ( '__tmp_huy_db_tables' )) {\r\n\t\t\tfunction __tmp_huy_db_tables($val) {\r\n\t\t\t\treturn $val [0];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn array_map ( '__tmp_huy_db_tables', $tables );\r\n\t}", "function mysql_table_exists($tablename) {\n\t$tables = array();\n\t$tablename = escape_data($tablename);\n\t$query = \"SHOW TABLES FROM DB_NAME LIKE '$tablename'\";\n\t$result = mysqli_query($dbc, $query);\n\tif ($result){\n\t\twhile ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {\n\t\t\t$tables = $row[0];\n\t\t}\n\t} else {\n\t\t$tables = NULL;\n\t}\n\n\treturn $tables;\n}", "function get_table_name($table_name)\n{\n\tglobal $project_vars;\n\treturn $project_vars['mysql_table_prefix'] . $table_name;\n}", "function listeTables() {\n $sql = \"SHOW TABLES\";\n\t $resultat = mysql_query($sql);\n if($resultat) {\n //$tables=mysql_fetch_array($resultat);\n while ($row = mysql_fetch_array($resultat, MYSQL_NUM)) {\n $tables[] = $row[0];\n }\n mysql_free_result($resultat);\n return $tables;\n } \n }", "public function show_tables()\n\t{\n\t\t$results = $this->get_rows('SHOW TABLES');\n\t\tforeach ($results as $row)\n\t\t{\n\t\t\t$array[] = $row[0];\n\t\t}\n\n\t\treturn $array;\n\t}", "function type_of_table($db,$tb_pre,$tb_name){\n\tglobal $conn;\n\t$sql=\"select table_type from information_schema.tables where table_schema='$db' and table_name='$tb_name'\";\n\t$res=mysqli_query($conn,$sql);\n\tif($res) $rs=mysqli_fetch_array($res);\n\tif($rs['table_type']==\"VIEW\") return 'V';\n\telse {\t// table\n\t\tif(strtolower(substr($tb_name,strlen($tb_pre),6))==\"_code_\") return 'C'; // code table\n\t\telse return 'T'; // normal table\n\t}\n}", "function get_mdb_table_names(){\n $prohitsManagerDB = new mysqlDB(MANAGER_DB);\n $mDBname = MANAGER_DB;\n $SQL = \"SHOW TABLES FROM $mDBname\";\n //echo $SQL;\n $result = mysqli_query($prohitsManagerDB->link, $SQL);\n if(!$result){\n echo \"DB Error, could not list tables\\n\";\n echo 'MySQL Error: ' . mysqli_error($prohitsManagerDB->link);\n exit;\n }\n $mTablesNameArr = array();\n while($row = mysqli_fetch_row($result)){\n $mTablesNameArr[strtoupper($row[0])] = $row[0];\n }\n return $mTablesNameArr;\n}", "function return_table($table) {\n\t\tif(!$table) {\n\t\t\t$array_keys = array_keys($this->table_schema);\n\t\t\t$table = $array_keys[0];\n\t\t}\n\t\tif($table) {\n\t\t\tglobal $wpdb;\n\t\t\treturn $wpdb->prefix . $table;\n\t\t}\n\t\treturn false;\n\t}", "private function tableName($name = null)\n {\n if ($name) {\n $this->query['table'] = $name;\n }\n\n return $this->query['table'];\n }", "function sql_table($name) {\n global $MYSQL_PREFIX;\n\n if ($MYSQL_PREFIX) {\n return $MYSQL_PREFIX . 'nucleus_' . $name;\n } else {\n return 'nucleus_' . $name;\n }\n}", "public function get_table($table = null)\n {\n return $this->get_connection()->table($table);\n }", "function m2p_get_tables($prefix='')\n{\n $tables = array();\n\n $query = '\nSHOW TABLES\n;';\n $result = pwg_query($query);\n\n while ($row = pwg_db_fetch_row($result))\n {\n if (preg_match('/^'.$prefix.'/', $row[0]))\n {\n $tables[] = $row[0];\n }\n }\n\n return $tables;\n}", "public function getTables()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL TABLES\"\n ));\n\n return $result;\n\t}", "function pdo_list_tables($dbname, $link=NULL) {\r\n $dbname = str_replace(\"`\", \"``\", $dbname);\r\n return pdo_query(\"SHOW TABLES FROM `$dbname`\", pdo_handle($link));\r\n }", "function dbTablesName() {\n $data = array();\n $tablesname = mysql_list_tables(DB_DATABASE);\n\n $i = 0;\n //var_dump($tablesname);\n while ($row = mysql_fetch_array($tablesname)) {\n if ($row[0] <> \"admin\" && $row[0] <> \"grid\")\n $data[$i] = $row[0];\n\n $i++;\n }\n\n return $data;\n }", "public function showTables()\n {\n switch($this->db_type){\n case 'mssql';\n case 'sqlsrv':\n $sql = 'SELECT * FROM sys.all_objects WHERE type = \\'U\\'';\n break;\n case 'pgsql':\n $sql = 'SELECT tablename FROM pg_tables WHERE tableowner = current_user';\n break;\n case 'sqlite':\n $sql = 'SELECT * FROM sqlite_master WHERE type=\\'table\\'';\n break;\n case 'oci':\n $sql = 'SELECT * FROM system.tab';\n break;\n case 'ibm':\n $schema = '';\n $sql = 'SELECT TABLE_NAME FROM qsys2.systables'.\n (($schema != '') ? ' WHERE TABLE_SCHEMA = \\''.$schema.'\\'' : '');\n break;\n case 'mysql':\n default:\n $sql = 'SHOW TABLES IN `'.$this->db_name.'`';\n break;\n }\n\n try{\n $sth = $this->query($sql);\n $result = $sth->fetchAll();\n }catch(PDOException $e){\n $this->error( $e->getMessage());\n $result = false;\n }\n return $result;\n }", "protected function table()\n {\n return $this->conn->table($this->table);\n }", "public function getTableList($options = array()) {\n if (($req = $this->execute('SHOW TABLES', $options)) === false)\n return false;\n\n $data = array();\n\n while ($row = mysql_fetch_row($req))\n $data[] = $row[0];\n\n return $data;\n }", "public static function getTable() : string {\n\t\t$namespacedClassParts = explode(\"\\\\\", get_called_class());\n\t\t$table = array_pop($namespacedClassParts);\n\t\t$table = preg_replace(\"/([a-z0-9])([A-Z0-9])/\", '$1_$2', $table);\n\t\t$table = strtolower($table);\n\t\treturn $table;\n\t}", "private static function getTable(): string\n {\n return DB_TABLES[static::class];\n }", "public function table( $tname )\n {\n global $UNDERQL;\n if ( !array_key_exists( $tname, $this->table_fields_names ))\n {\n /* Get tables list for the current database to check if $tname is a valid table name*/\n $l_result = @ mysql_query( 'SHOW TABLES FROM `' . $UNDERQL['db']['name'] . '`' );\n $l_count = @ mysql_num_rows( $l_result );\n if ( $l_count == 0 )\n $this->error( $tname . ' dose not exist. ' . mysql_error( ));\n while ( $l_t = @ mysql_fetch_row( $l_result ))\n {\n if ( strcmp( $tname, $l_t[0] ) == 0 )\n {\n $this->table_name = $tname;\n @ mysql_free_result( $l_result );\n $this->readFields( );\n return;\n }\n }\n if( $l_result )\n @ mysql_free_result( $l_result );\n }\n else\n {\n /*\n To avoid double check, therefore, if the table exist tables array\n that's menas we don't need to check again*/\n $this->table_name = $tname;\n $this->readFields( );\n return;\n }\n @ mysql_free_result( $l_result );\n $this->error( $tname . ' dose not exist' );\n }", "public function getTable(): string\n {\n return $this->_table;\n }", "function getTable($primary, $table) {\n return mysql_query(sprintf('SELECT %s FROM %s', $primary, $table));\n }", "public function getTables(){\n $pdo = $this->pdo;\n $statement = $pdo->prepare(\"SHOW TABLES FROM $this->name;\");\n $statement->execute();\n $tables = $statement->fetchAll($pdo::FETCH_NUM);\n foreach($tables as &$table)\n $table = $table[0];\n return $tables;\n }", "function get_Table_Name(){\n global $mysqli;\n $query = new Query($mysqli, \"SELECT tb_inscritos_new_year,tb_resultados_new_year FROM sgra_config_tb\");\n $parametros = array();\n $data = $query->getresults();\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}", "function pdo_tablename($stmt, $i) {\r\n return pdo_result($stmt, $i, 0);\r\n }", "public function listTables() {\r\n\t\tswitch ($this->getDbtype()) {\r\n\t\t\tcase 'mysql':\r\n\t\t\t\t$sql = \"SHOW FULL TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'pgsql':\r\n\t\t\t\t$sql = \"SELECT CONCAT(table_schema,'.',table_name) AS name FROM information_schema.tables \r\n WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog','information_schema')\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'sqlite':\r\n\t\t\t\t$sql = 'SELECT name FROM sqlite_master WHERE type = \"table\" AND name != \"sqlite_sequence\"';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mssql':\r\n\t\t\t\t$sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\tcase 'oracle':\r\n\t\t\t\t$sql = \"SELECT * FROM dba_tables\";\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception($this->getDbtype() . ' does not support listing table');\r\n\t\t}\r\n\t\t$result = $this->query($sql);\r\n\t\t$result->setFetchMode(PDO::FETCH_NUM);\r\n\t\t$meta = array();\r\n\t\tforeach ($result as $row) {\r\n\t\t\t$meta[] = $row[0];\r\n\t\t}\r\n\t\treturn $meta;\r\n\t}", "public function getTable(): string\n {\n return $this->table;\n }", "public function getTable(): string\n {\n return $this->table;\n }", "public function getTable(): string\n {\n return $this->prefix . $this->table;\n }", "public function get_tables()\n\t{\n\t\treturn $this->driver_query('table_list');\n\t}", "function display_table($tab_name) {\n $mysqli = $this->mysqli;\n $sql = \"SELECT * FROM $tab_name\";\n if ($val = $mysqli->query($sql)) return $val;\n else {\n echo $mysqli->error;\n }\n }", "function table_names($includeViews=true)\n\t{\n\t\t// query\n\t\t$this->query(\"SHOW \".(!$includeViews ? \"FULL\" : \"\").\" TABLES\");\n\n\t\t// get table names\n\t\t$result = array();\n\t\tfor ($i=0; $info = mysqli_fetch_row($this->m_query_id); $i++)\n\t\t{\n\t\t\t// ignore views?\n\t\t\tif (!$includeViews && strtoupper($info[1]) == 'VIEW') continue;\n\n\t\t\t$result[$i][\"table_name\"] = $info[0];\n\t\t\t$result[$i][\"tablespace_name\"] = $this->m_database;\n\t\t\t$result[$i][\"database\"] = $this->m_database;\n\t\t}\n\n\t\t// return result\n\t\treturn $result;\n\t}", "public function GetTables()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\t// Query to get the tables in the current database:\r\n\t\t$records = mysql_query( 'SHOW TABLES' );\r\n\t\tif( !$records )\r\n\t\t{\r\n\t\t\t$this->SetError();\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile( $array_data = mysql_fetch_array( $records ) )\r\n\t\t\t{\r\n\t\t\t\t$tables[] = $array_data[0];\r\n\t\t\t}\r\n\r\n\t\t\t// Returns the array or NULL\r\n\t\t\tif( count( $tables ) > 0 )\r\n\t\t\t{\r\n\t\t\t\treturn $tables;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getTable()\n\t{\n\t\treturn empty($this->table) ? $this->table = Db_Inflector::pluralize($this->getSingular()) : $this->table;\n\t}", "function sql_list_tables() {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$query = 'SHOW TABLES';\n\tsql_dump($query);\n\t$query = $sql->query($query);\n\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n}", "public function getTable()\n {\n if (! isset($this->table)) {\n return str_replace(\n '\\\\',\n '',\n Str::snake(Str::plural(class_basename(self::class)))\n );\n }\n\n return $this->table;\n }", "function getTableName($fieldname){\n\t\tif ( isset( $this->_cache[__FUNCTION__][$fieldname] ) ){\n\t\t\t// Let's check the cache first to see if we have already calculated this value.\n\t\t\treturn $this->_cache[__FUNCTION__][$fieldname];\n\t\t}\n\t\t\n\t\t// It is not in the cache, let's check the sql data structure to see if it is in there.\n\t\t$data = $this->_parseSQL();\n\t\t$this->_expandGlobs($data);\n\t\t\n\t\t$column = null;\n\t\tforeach ($data['columns'] as $columninfo){\n\t\t\tif ( $fieldname == $columninfo['alias'] ) {\n\t\t\t\t$column = $columninfo;\n\t\t\t\tbreak;\n\t\t\t} else if ( !$columninfo['alias'] and $fieldname == $columninfo['value'] ){\n\t\t\t\t$column = $columninfo;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( $column['type'] == 'ident' ){\n\t\t\t// The column is an identifier so we should be able to find its table.\n\t\t\t$tablename = null;\n\t\t\tif ( $column['table'] ) $tablename = $column['table'];\n\t\t\telse {\n\t\t\t\t// The table isn't defined, so we must guess the table.\n\t\t\t\t$tables =& $this->tables();\n\t\t\t\tforeach (array_keys($tables) as $key){\n\t\t\t\t\t$field = $tables[$key]->getField($fieldname);\n\t\t\t\t\tif ( !PEAR::isError($field) and $field ){\n\t\t\t\t\t\t$tablename = $key;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tunset($field);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// The column is most likely a function result\n\t\t\t// there will be no table.\n\t\t\treturn null;\n\t\t}\n\t\t$this->_cache[__FUNCTION__][$fieldname] = $tablename;\n\t\treturn $tablename;\n\t}", "function get_tables()\n{\n $tableList = array();\n $res = mysqli_query($this->conn,\"SHOW TABLES\");\n while($cRow = mysqli_fetch_array($res))\n {\n $tableList[] = $cRow[0];\n }\n return $tableList;\n}", "public static function tableName(): string;", "function _getTableType($table)\n\t{\n\t\t$this->connect('r');\n\t\t$id = $this->_query(\"SHOW TABLE STATUS LIKE '\" .$table .\"'\", true);\n\t\t$status = @mysqli_fetch_array($id, MYSQLI_ASSOC|atkconfig(\"mysqlfetchmode\"));\n\t\t$result = $status != NULL && isset($status['Engine']) ? $status['Engine'] : NULL;\n\t\tatkdebug(\"Table type? $table => $result\");\n\t\treturn $result;\n\t}", "public static function get_db_table_name(){\n global $TFUSE;\n return $TFUSE->ext->seek->get_db_table_name();\n }", "public function getTable()\n {\n if (! isset($this->table)) {\n return str_replace('\\\\', '', Str::snake(Str::plural(class_basename($this))));\n }\n\n return $this->table;\n }", "private static function get_table_name() {\n\n $class = get_called_class();\n\n return strtolower($class);\n\n }", "protected function resolveTable() {\r\n\r\n\t\t$tableName = $this->_salt_obj->MODEL()->getTableName();\r\n\r\n\t\tif ($this->_salt_database !== NULL) {\r\n\t\t\t$tableName = SqlBindField::escapeName($this->_salt_database).'.'.$tableName;\r\n\t\t}\r\n\r\n\t\tif ($this->_salt_noAlias) {\r\n\t\t\treturn $tableName;\r\n\t\t}\r\n\t\treturn $tableName.' '.$this->_salt_alias;\r\n\t}", "protected function table()\n\t{\n\t\treturn $this->connection->table($this->table);\n\t}", "public function get_table_name() {\n return $this->table_name;\n }", "private function getTableName()\n {\n $class = get_class($this);\n\n $mem = new Cache();\n if ($tableName = $mem->get($class . '-table-name')) {\n return $tableName;\n }\n\n $break = explode('\\\\', $class);\n $ObjectName = end($break);\n $className = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $ObjectName));\n $tableName = Inflect::pluralize($className);\n\n $mem->add($class . '-table-name', $tableName, 1440);\n\n return $tableName;\n }", "function MysqlResultsTable ($mysql_results, $table_id='') {\n while ($myrow = mysql_fetch_assoc($mysql_results)) {\n if (! ($headers))\n $headers = array_keys($myrow);\n $rows .= \" <tr>\\n\";\n foreach ($headers as $k)\n $rows .= \" <td class=$k>$myrow[$k]</td>\\n\";\n $rows .= \" </tr>\\n\";\n } // end while myrow\n $header = join(\"</th><th>\",$headers);\n $header = \"<tr><th>$header</th></tr>\\n\";\n if ($table_id != '') { $id = ' id=\"'.$table_id.'\"'; }\n $rows = \"<table$id>$header$rows</table>\\n\";\n return ($rows);\n}", "protected static function get_table_name() {\n return null;\n }", "public function getTable(string $name)\n {\n if (isset($this->tables[$name])) {\n return $this->tables[$name];\n } else {\n //throw new \\BadMethodCallException('Error : table ' . $name . ' not found');\n return false;\n }\n }", "public function get_table_name(){\n return $this->table_name();\n }", "public function tableNoSel()\n {\n RlDebug::logger(\"SQL query can't be run, it isn't table name selected\", null, null, 'Warning');\n return 'Table not selected, see error log';\n }", "public function getTable() {\n if ( isset( $this->table ) ) {\n return $this->table;\n }\n\n $table = str_replace( '\\\\', '', snake_case( str_plural( class_basename( $this ) ) ) );\n\n return $this->getConnection()->db->prefix . $table ;\n }", "function queryToTable($QUERY)\n{\n $RESULT = array();\n if ($QUERY) {\n while ($row = mysql_fetch_array($QUERY, MYSQL_ASSOC)) $RESULT[] = $row;\n }\n return $RESULT;\n}", "public function getTables()\n {\n $sqlStm = \"SELECT TABLE_NAME as tableName,\n CASE TABLE_TYPE WHEN 'VIEW' THEN 'true'\n ELSE 'false'\n END as isView\n FROM information_schema.tables\n WHERE TABLE_SCHEMA = ?\";\n \n $query = new DataQuery($sqlStm);\n $param = new DataParameter('schema', DataParameter::TYPE_VARCHAR , $this->schema);\n return $this->query($query, array($param));\n }", "public function showTables(){\n $resultQuery = $this->executeQuery(\"SHOW TABLES;\");\n echo \"Liste des tables : <br><br>\";\n while( $row = mysqli_fetch_row($resultQuery) ){\n echo \" - \".$row[0].\"<br>\";\n }\n echo \"<br>\";\n }", "public function getTableNames();", "function get_table($table)\n {\n return $GLOBALS ['ZUIZZ']->config->db ['prefix'] . $this->config ['tables'] [$table];\n }", "public function get_table_name()\n {\n return $this->prefix . $this->table;\n }", "function get_tables($database_connection) {\r\n\r\n $tables = array();\r\n $result = mysqli_query($database_connection, \"SHOW TABLES\");\r\n\r\n $rows = array();\r\n while($row = mysqli_fetch_assoc($result)) {\r\n array_push($rows, $row);\r\n }\r\n\r\n $tables_in_database_name_array = array_keys($rows[0]); // This exists solely for the purpose of getting $tables_in_database_name\r\n $tables_in_database_name = $tables_in_database_name_array[0];\r\n\r\n for($i = 0; $i < count($rows); $i++) {\r\n array_push($tables, $rows[$i][$tables_in_database_name]);\r\n }\r\n\r\n return $tables;\r\n }", "public static function tables()\n {\n $tables = false;\n //\n $Tables = Driver::read('SHOW TABLES', Driver::INDEX);\n // die(var_dump($Tables));\n //\n foreach ($Tables as $row) {\n $target_tables[] = $row[0];\n }\n //\n if ($tables !== false) {\n $target_tables = array_intersect($target_tables, $tables);\n }\n //\n return $target_tables;\n }", "protected function table()\n {\n return $this->connection->table($this->table);\n }", "public function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}", "protected function table(): string\n {\n return $this->tableName;\n }", "function GetSqlTable($tablename, $filter = \"\")\n{\n $loc = \"databaselib.php->GetSqlTable\";\n $sql = \"SELECT * FROM \" . $tablename;\n if(!empty($filter)) $sql .= ' ' . $filter;\n $result = SqlQuery($loc, $sql);\n $table = array();\n while($row = $result->fetch_assoc()) $table[] = $row;\n return $table;\n}", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SELECT c.relname AS table FROM pg_class c, pg_user u \"\n .\"WHERE c.relowner = u.usesysid AND c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND c.relname !~ '^(pg_|sql_)' UNION \"\n .\"SELECT c.relname AS table_name FROM pg_class c \"\n .\"WHERE c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) \"\n .\"AND c.relname !~ '^pg_'\");\n\t}", "public static function getTableName()\n {\n return ((new self)->getTable());\n }", "protected function table () : string {\n return $this->guessName();\n }", "public static function table_name() {\n $table_name = strtolower(get_called_class());\n\n if (!in_array($table_name, ApplicationSql::tablenames()))\n throw new TableNotFoundException(\"Veritabanında böyle bir tablo mevcut değil\", $table_name);\n\n return $table_name;\n }", "public function getTable()\n {\n return $this->_from[0]['table'];\n }", "public function getTableName();", "public function getTableName();", "private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }", "function table_exists( $db, $the_table_name )\n{\n if (empty($the_table_name))\n return null;\n\n // NOTE: there must be a better & more robust \n // way to do this, but this works for now\n $table_check_result = $db->query( \"SHOW TABLES LIKE '$the_table_name'\" );\n if ($table_check_result)\n {\n $row = $table_check_result->fetch_row();\n $found_table_name = $row[0];\n if ( $found_table_name == $the_table_name )\n $exists = true;\n else\n $exists = false;\n $table_check_result->close();\n return $exists;\n }\n else\n {\n return null;\n }\n}", "function get_table_name () {\r\n\t\treturn $this->wpdb->prefix . $this->_table_name;\r\n\t}", "public static function getTables()\n {\n static $tables = [];\n\n if (!$tables) {\n $prepare = self::getConn()->prepare(\"SHOW TABLES FROM `\" . self::$config['database'] . \"`\");\n $prepare->setFetchMode(PDO::FETCH_ASSOC);\n $prepare->execute();\n $result = $prepare->fetchAll();\n foreach ($result as $key => $value) {\n $result[$key] = current($value);\n }\n }\n return $result;\n }", "public function qsGetDbTables()\n {\n $sql = 'show tables';\n $d = $this->qExecPluck($sql);\n\n return $d;\n }", "function nav_sqltabele() {\n\n\tglobal $db;\n\n\techo \"Lista svih tabela: \";\n\t\n $komanda = 'SHOW tables';\n\t$result = mysql_query($komanda, $db);\n\t$br_redova = mysql_num_rows($result);\n\t\n\tfor ($i = 0; $i < $br_redova; $i++) {\n\n\t\t\techo \"<a href='?tab=\" . mysql_tablename($result, $i) . \"'>\" . mysql_tablename($result, $i) . \"</a>\";\n\t\t\techo \" | \";\t\t\t\n\n\t}\n\n\t\n\n}", "public function get_table()\n\t{\n\t\treturn $this->_table;\n\t}", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "public static function get_table_name()\n {\n return self::TABLE_NAME;\n }", "public function getTableName() {\n\t\t$dbName = empty($this->_dbName) ? '' : ($this->_dbName . '.');\n\t\t$tableName = $dbName . $this->_tableName;\n\t\treturn ($tableName);\n\t}" ]
[ "0.6664714", "0.65714943", "0.6522103", "0.6502911", "0.6490979", "0.646907", "0.6446757", "0.6432287", "0.64198655", "0.6346996", "0.6344181", "0.6326609", "0.62896514", "0.62125707", "0.61811334", "0.6178353", "0.6165131", "0.614667", "0.6146494", "0.6132932", "0.61135143", "0.6113111", "0.6100227", "0.60718644", "0.605498", "0.6049954", "0.6039863", "0.60357606", "0.6019886", "0.5966176", "0.5944105", "0.59355795", "0.5930595", "0.59263515", "0.5920392", "0.5919992", "0.5918529", "0.5905466", "0.5900012", "0.5897831", "0.5896105", "0.58934563", "0.5872586", "0.58705044", "0.586368", "0.586368", "0.5846715", "0.5832887", "0.5829275", "0.58279175", "0.58248943", "0.5823983", "0.5817494", "0.58121586", "0.5810952", "0.580077", "0.5792284", "0.57813066", "0.5777828", "0.5777342", "0.5761566", "0.5760273", "0.5755238", "0.5751642", "0.57439643", "0.574271", "0.5739067", "0.57368565", "0.57355356", "0.5735202", "0.5730076", "0.572536", "0.572023", "0.5710376", "0.5707021", "0.57035816", "0.5702358", "0.5692463", "0.5688293", "0.56853354", "0.56820405", "0.5681431", "0.5680956", "0.5679172", "0.5679034", "0.56778604", "0.5670254", "0.5666896", "0.5663412", "0.5663412", "0.5658721", "0.56506586", "0.5643514", "0.56412965", "0.56354815", "0.5633573", "0.56277895", "0.561574", "0.5613825", "0.5609344" ]
0.7074861
0
Retrieves the current thread ID. If the connection is lost, and a reconnect with mysql_ping is executed, the thread ID will change. This means only retrieve the thread ID when needed.
function mysql_thread_id($link_identifier = null): int { error_clear_last(); $result = \mysql_thread_id($link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetCurrentThreadID()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->thread_id;\r\n }", "function pdo_thread_id($link=NULL) {\r\n return pdo_query(\"SELECT connection_id() AS id\", pdo_handle($link))->fetchObject()->id;\r\n }", "public function getThreadId();", "public function getThreadId();", "public function getThreadName() : mixed\n {\n if ($this->threadName === null) {\n $this->threadName = (string)getmypid();\n }//end if\n \n return $this->threadName;\n \n }", "private function getThreadId() {\n $event = $this->getEvent();\n return (empty($event['thread_ts'])) ? $event['ts']: $event['thread_ts'];\n }", "public function getThreadGUID() {\n\t\tif (isset($this->thread_guid)) {\n\t\t\treturn (int) $this->thread_guid;\n\t\t}\n\t\t\n\t\treturn $this->guid;\n\t}", "public static function tid()\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return 0;\n }\n\n $id = SwCoroutine::getuid();\n\n return self::$idMap[$id] ?? $id;\n }", "public function getConnectionId()\n\t{\n\t\tif ( $this->pdo === null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\treturn $this->pdo->query('SELECT CONNECTION_ID()')->fetch(PDO::FETCH_COLUMN);\n\t\t} catch ( \\PDOException $e ) {\n\t\t\treturn null;\n\t\t}\n\t}", "private function getThreadId($url)\n {\n if(FALSE !== preg_match('/^(\\/(app_dev\\.php|app\\.php))?\\/api\\/threads\\/\\d+/', mb_strtolower($url['path']),$matches) && !empty($matches[0]))\n {\n $aMatches = explode('/',$matches[0]);\n $threadId = (int)$aMatches[count($aMatches)-1];\n return $threadId;\n\n }\n return FALSE;\n }", "public function getInstanceId()\n {\n if ($id = $this->_getParam(\\MUtil_Model::REQUEST_ID)) {\n return $id;\n }\n }", "private function getCurrentID() {\n if ($this->sessionid > 0) {\n\t\t\treturn $this->sessionid;\n\t\t}\n $cookie_id = 0;\n\t\tif (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) {\n\t\t\t$cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$cookie_id = $cookie_array[0];\n\t\t\t}\n\t\t}\n\t\treturn $cookie_id;\n }", "function get_id(){\n\t\t$new_id;\n\t\tglobal $con;\n\n\t\t$result=mysqli_fetch_array(mysqli_query($con,\"SELECT * FROM spip_forum ORDER BY id_forum DESC LIMIT 1\"));\n\t\t$id=(int)$result[0];\n\t\t$new_id=$id+1;\n\t\treturn $new_id;\n\t}", "private function get_current_id() {\n\n\t\tstatic $id = null;\n\n\t\treturn $id ?: $id = \\get_queried_object_id();\n\t}", "function get_current_network_id()\n {\n }", "function _lock_id() {\n // Do not use drupal_static(). This identifier refers to the current\n // client request, and must not be changed under any circumstances\n // else the shutdown handler may fail to release our locks.\n static $lock_id;\n\n if (!isset($lock_id)) {\n // Assign a unique id.\n $lock_id = uniqid(mt_rand(), TRUE);\n // We only register a shutdown function if a lock is used.\n drupal_register_shutdown_function('lock_release_all', $lock_id);\n }\n return $lock_id;\n}", "function ts_get_current_id()\r\n{\r\n\treturn CURRENT_ID;\r\n}", "function getThread($threadid)\n {\n\t try {\n\t\t $db = JFusionFactory::getDatabase($this->getJname());\n\n\t\t $query = $db->getQuery(true)\n\t\t\t ->select('topic_id AS threadid, forum_id AS forumid, topic_first_post_id AS postid')\n\t\t\t ->from('#__topics')\n\t\t\t ->where('topic_id = ' . (int) $threadid);\n\n\t\t $db->setQuery($query);\n\t\t $result = $db->loadObject();\n\t } catch (Exception $e) {\n\t\t $result = null;\n\t }\n\t return $result;\n }", "protected function getMsgId() {\n $this->msg_id++;\n return $this->msg_id;\n }", "protected function _getId()\r\n\t{\r\n\t\t$select\t\t= $this->_db->select()->from('Cron_Jobs', array('id'))->where('name = ?', $this->_name);\r\n\t\tlist($id)\t= $this->_db->fetchCol($select);\r\n\t\t\r\n\t\treturn $id;\r\n\t}", "protected function GetParentId()\n {\n $instance = @IPS_GetInstance($this->InstanceID);\n return $instance['ConnectionID'];\n }", "public static function get_id() {\n self::$_id = $_SESSION['id'];\n return self::$_id;\n }", "public function getThreadType();", "protected function getInboxThread()\n {\n if ($this->inboxMessageBeingReplyingTo) {\n return $this->inboxMessageBeingReplyingTo->thread;\n }\n\n return $this->createInboxThread();\n }", "final function getSession_id() {\n\t\treturn $this->getSessionId();\n\t}", "public function getTid()\n {\n return $this->get(self::_TID);\n }", "public function getTid()\n {\n return $this->get(self::_TID);\n }", "public function getTid()\n {\n return $this->get(self::_TID);\n }", "public function getTid()\n {\n return $this->get(self::_TID);\n }", "final public function getId(){\n\t\tif($this->_id === false){\n\t\t\t$this->_id = $this->getNextId();\n\t\t}\n\t\treturn get_class($this) . \"_\" . $this->_id;\n\t}", "public function getOneThread()\n\t{\t\n\t\tglobal $ilDB;\n\t\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_threads WHERE ';\n\t\t\n\t\tif($this->getMDB2Query() != '' && $this->getMDB2DataType() != '' && $this->getMDB2DataValue() != '')\n\t\t{\n\t\t\t$query .= $this->getMDB2Query();\n\t\t\t$data_type = $data_type + $this->getMDB2DataType();\n\t\t\t$data_value = $data_value + $this->getMDB2DataValue();\n\t\t\t\n\t\t\t$sql_res = $ilDB->queryf($query, $data_type, $data_value);\n\t\t\t$result = $sql_res->fetchRow(DB_FETCHMODE_ASSOC);\n\t\t\t$result[\"thr_subject\"] = trim($result[\"thr_subject\"]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getTid()\n {\n return $this->_tid;\n }", "function get_last_id() {\n if ($this->is_valid())\n return @mysql_insert_id($this->connection);\n }", "public function getId(): ?string\n {\n return $this->isStarted() ? session_id() : null;\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return session_id();\n }", "public function getId()\n {\n // TODO: Implement getId() method.\n return $this->tch_id;\n }", "public function getTicketId() {\n\t\treturn($this->ticketId);\n\t}", "public function getTid()\n {\n return $this->tid;\n }", "protected function _getId ()\n {\n return session_id();\n }", "public function getId()\n {\n return $this->currentId;\n }", "public static function getThread($thread_id, $last_token)\n {\n // Load thread\n $thread = Thread::load($thread_id, $last_token);\n // Check thread\n if (!$thread) {\n throw new ThreadProcessorException(\n 'Wrong thread',\n ThreadProcessorException::ERROR_WRONG_THREAD\n );\n }\n\n // Return thread\n return $thread;\n }", "function get_id () {\n\t\treturn $this->session_id ?: false;\n\t}", "function getChatId()\r\n\t{\r\n\t\t$chatid = \"SELECT chat_id, map_id FROM chat WHERE map_id = '$map_id'\";\r\n\t\t$chatResult = mysql_query($chatid);\r\r\n\t\tif(mysql_affected_rows() == 1)\r\n\t\t{\r\n\t\t\t$row = mysql_fetch_row($chatResult);\r\n\t\t\t$chat_id = $row[0];\r\r\n\t\t\treturn $chat_id;\r\n\t\t}\r\n\t}", "public function getLatestThread() {\n\t\t$latestThread = FALSE;\n\t\tif ($this->threads->count()) {\n\t\t\t$threads = $this->threads->toArray();\n\t\t\t$latestThread = $threads[$this->threads->count() - 1];\n\t\t}\n\n\t\treturn $latestThread;\n\t}", "public static function getId(){\n\t\treturn session_id();\n\t}", "function getTid() {\n return $this->tid;\n }", "public function getConnectionId();", "public function getSessionId()\n {\n $this->connect();\n return $this->stomp->getSessionId();\n }", "public function getInstanceId()\n {\n if ($this->instance_id) {\n return $this->instance_id;\n }\n\n return $this->instance_id = get_class($this).':'.spl_object_id($this);\n }", "public function getWorkerId()\n {\n return $this->worker_id;\n }", "public function getWorkerId()\n {\n return $this->worker_id;\n }", "public function getWorkerId()\n {\n return $this->worker_id;\n }", "public static function getID()\n {\n return self::getInstance()->_getID();\n }", "function createThread() {\n\t//create thread\n\techo $_POST[\"title\"] . \"<br/>\";\n\t$db = DB::$connection;\n\t$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );\n\n\t$sql = \"INSERT INTO threads(title,userid,date) VALUES (?,?,NOW())\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->execute(array(htmlspecialchars($_POST[\"title\"]),$_SESSION['currentUser']));\n\t$trd_id = $db->lastInsertId();\n\techo $trd_id;\n\n\t// post to thread\n\t$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );\n\n\n\t$threadid = $trd_id;\n\t$postbody = $_POST[\"postbody\"];\n\t$userid = $_SESSION['currentUser'];\n\n\t// post to thread\n\t$sql = 'INSERT INTO posts(threadid,postbody,userid,date) VALUES(?,?,?,NOW())';\n\t$stmt = $db->prepare($sql);\n\t$stmt->execute(array(htmlspecialchars($threadid),($postbody),($userid)));\n\treturn $trd_id;\n}", "public function getid(){\r\n\t\tif($this::isLoggedIn()){\r\n\t\t\t$id2=$this->id;\r\n\t\t\treturn $id2;}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t//throw new Exception('Nessun utente loggato!');}\r\n\t}", "function getInstanceId() \n {\n return $this->instance->getInstanceId();\n }", "public function get_threading() {\n\n return $this->threading;\n }", "public function getThread() {\r\n if (!$this->thread instanceof Thread) {\r\n throw new Exception(\"Cannot find the thread that this post belongs to\");\r\n }\r\n \r\n return $this->thread;\r\n }", "public function get_context_id()\n {\n return $this->get_default_property(self::PROPERTY_CONTEXT_ID);\n }", "public function getId() {\n\t\treturn session_id();\n\t}", "public\n\tfunction ultimo_id() {\n\n\t\t$id = mysqli_insert_id( $this->connection );\n\n\t\treturn $id;\n\n\t}", "protected function _getCurrentRoleInstanceId()\n\t{\n\t\tif (!isset($_SERVER['RdRoleId'])) {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Diagnostics/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Diagnostics_Exception('Server variable \\'RdRoleId\\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');\n\t\t}\n\n\t\tif (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {\n\t\t\treturn $_SERVER['RdRoleId'];\n\t\t} else {\n\t\t\t$roleIdParts = explode('.', $_SERVER['RdRoleId']);\n\t\t\treturn $roleIdParts[0] . '/' . $roleIdParts[2] . '/' . $_SERVER['RdRoleId'];\n\t\t}\n\n\t\tif (!isset($_SERVER['RoleDeploymentID']) && !isset($_SERVER['RoleInstanceID']) && !isset($_SERVER['RoleName'])) {\n\t\t\tthrow new Exception('Server variables \\'RoleDeploymentID\\', \\'RoleInstanceID\\' and \\'RoleName\\' are unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');\n\t\t}\n\n\t\tif (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {\n\t\t\treturn $_SERVER['RdRoleId'];\n\t\t} else {\n\t\t\treturn $_SERVER['RoleDeploymentID'] . '/' . $_SERVER['RoleInstanceID'] . '/' . $_SERVER['RoleName'];\n\t\t}\n\t}", "function get_TID() {\n return $this->ID;\n }", "public function lastId()\n\t{\n\t\treturn mysqli_insert_id($this->connection);\n\t}", "function lastId() {\n return mysqli_insert_id($this->con);\n }", "public function getTicketid()\n {\n return $this->ticketid;\n }", "public function setTID() {\n $q = \"SELECT teacher_id FROM \".$this->table.\" WHERE user_id = ?\";\n $stmt = $this->conn->prepare($q);\n $stmt->execute(array($this->uid));\n return intval($stmt->fetch()[0]);\n }", "public static function getSessionId() {\n\t\tif(empty($id = session_id())) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $id;\n\t\t\n\t}", "public function the_insert_id() {\n\t\treturn mysqli_insert_id($this->connection);\n\t}", "protected function getSessionId() {\r\n\t\treturn $this->id;\r\n\t}", "public function get_connection_id() {\n return empty($this->username) || empty($this->url) ? FALSE : sha1($this->username . '@' . $this->url);\n }", "public function getCurrentBlogId()\n {\n return $this->wpDatabase->blogid;\n }", "public function get_id() {\n return str_replace('_forum_feature', '', get_class($this));\n }", "protected function _getCurrentRoleInstanceId()\n {\n if (!isset($_SERVER['RdRoleId'])) {\n throw new Microsoft_WindowsAzure_Diagnostics_Exception('Server variable \\'RdRoleId\\' is unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');\n }\n \n if (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {\n return $_SERVER['RdRoleId'];\n } else {\n $roleIdParts = explode('.', $_SERVER['RdRoleId']);\n return $roleIdParts[0] . '/' . $roleIdParts[2] . '/' . $_SERVER['RdRoleId'];\n }\n\n if (!isset($_SERVER['RoleDeploymentID']) && !isset($_SERVER['RoleInstanceID']) && !isset($_SERVER['RoleName'])) {\n throw new Exception('Server variables \\'RoleDeploymentID\\', \\'RoleInstanceID\\' and \\'RoleName\\' are unknown. Please verify the application is running in Development Fabric or Windows Azure Fabric.');\n }\n \n if (strpos($_SERVER['RdRoleId'], 'deployment(') === false) {\n return $_SERVER['RdRoleId'];\n } else {\n return $_SERVER['RoleDeploymentID'] . '/' . $_SERVER['RoleInstanceID'] . '/' . $_SERVER['RoleName'];\n }\n }", "function insert_id()\n {\n // $link = $this->connect();\n // Get the ID generated from the previous INSERT operation\n $last_id = mysqli_insert_id($this->link);\n // return last ID\n return $last_id;\n }", "public function insert_id() {\n\t\t// get the last id inserted over the current db connection\n\t\treturn mysqli_insert_id($this->connection);\n\t}", "function insertId()\n\t{\n\t\treturn mysql_insert_id($this->conn);\n\t}", "public static function getTraceId()\n {\n static::checkInit();\n return static::$traceId;\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return $this->sessionId;\n }", "abstract public function get_instanceid_from_currentcontext();", "public function getPid() {}", "function getThreadCountById($userid){\n\ttry{\t$db=pdoConnect();\n\t$sqlVars=array();\n\t$query=\"SELECT count(id) from fo_threads where added_by=:userid\";\n\t$stmt=$db->prepare($query);\n\t$sqlVars[':userid']=$userid;\n\tif(!$stmt->execute($sqlVars)){\n\t\treturn false;\n\t}\n\t$ansArr=$stmt->fetchall();\n\n\treturn $ansArr[0][0];\n\t}\n\tcatch (PDOException $e) {\n\t\taddAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n\t\terror_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n\t\treturn false;\n\t} catch (ErrorException $e) {\n\t\taddAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n\t\treturn false;\n\t}\n}", "public function getQueueId() {\n\t\t$db = JFactory::getDbo();\n\t\t$query = \"SELECT * FROM joomla3_queue ORDER BY queue_id DESC \";\n\n\t\t$db->setQuery($query, 0, 1);\n\t\t$rows_id = $db->loadAssoc();\n\n//\t\t$electrical_id = $row['electrical_status'];\n if($rows_id == \"\"){ //while the electrical table has delete or anyway trouble but the time will update\n\t\t\t/*$db = JFactory::getDbo();\n\t\t $query = \"select * from #__electrical where datetime > $time_pos ORDER BY electrical_id ASC\";\n\t\t\t$db->setQuery($query,0, $limit);\n\t\t $rows = $db->loadAssocList();\n\t\t\t*/\n\t\t}else{\n\t\t\t$queue_id = $rows_id['queue_id'];\n\t\t return $queue_id;\n\t\t\t\n\t\t}\t\n\t}", "public static function id()\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return 0;\n }\n\n return SwCoroutine::getuid();\n }", "public function getMsgId()\n {\n return $this->msg_id;\n }", "public function getTopicId()\n {\n return (int)$this->topic_id;\n }", "public static function id()\n {\n return self::$id;\n }", "public function the_insert_id(){\n return mysqli_insert_id($this->connection);\n }", "function getContextId() {\n\t\treturn $this->_contextId;\n\t}", "public function findById(int $threadId): ?\\Gazelle\\ForumThread {\n $key = sprintf(self::ID_KEY, $threadId);\n $id = self::$cache->get_value($key);\n if ($id === false) {\n $id = self::$db->scalar(\"\n SELECT ID FROM forums_topics WHERE ID = ?\n \", $threadId\n );\n if (!is_null($id)) {\n self::$cache->cache_value($key, $id, 7200);\n }\n }\n return $id ? new \\Gazelle\\ForumThread($id) : null;\n }", "public function fetch_the_id() {}", "function getId()\n\t {\n\t\treturn $this->task_id;\n\t }", "public function getId() {\n return $this->sessionId;\n }", "function getLastInsertID() {\n return mysql_insert_id($this->CONNECTION);\n }", "function getInsertID(){\n\t\tif(!$id=mysql_insert_id($this->conId)){\n\t\t\ttrigger_error('Error getting ID');\n\t\t\texit();\n\t\t}\n\t\treturn $id;\n\t}", "public function getBoardId()\n {\n return $this->getCurrentBoard()->getId();\n }", "public static function get()\n {\n return self::$id;\n }", "public function getSelfId(): string\n {\n $result = $this->sendGetRequest($this->getRequestUrl('selfId'));\n\n return isset($result->id) ? $result->id : $result;\n }", "private function getInstanceId()\n\t{\n\t\t// Loop until the server's id is known (loop is a failsafe)\n\t\twhile(!$this->instanceId)\n\t\t{\n\t\t\t// Get the instance id of the currently running instance\n\t\t\t$this->instanceId = exec(\"wget -q -O - http://169.254.169.254/latest/meta-data/instance-id\");\n\n\t\t\t// If request failed\n\t\t\tif(!$this->instanceId)\n\t\t\t{\n\t\t\t\techo \"instance id problem. sleeping...\";\n\n\t\t\t\t// Wait 10 seconds before trying again.\n\t\t\t\tsleep(10);\n\t\t\t}\t\n\t\t}\t\n\t}", "protected function getCurrentId()\n {\n return (array_key_exists($this->idfieldName(), $this->data)) ? $this->data[$this->idfieldName()] : NULL;\n }" ]
[ "0.7633409", "0.7484173", "0.68687385", "0.68687385", "0.637813", "0.62958544", "0.60807323", "0.60070616", "0.5882125", "0.5825176", "0.58078474", "0.577311", "0.55834955", "0.5577487", "0.5517846", "0.5482278", "0.5470543", "0.5458047", "0.5427733", "0.54253453", "0.5415865", "0.54155934", "0.5389678", "0.53876674", "0.53829247", "0.5377023", "0.5377023", "0.5377023", "0.5377023", "0.53732497", "0.5357348", "0.5355212", "0.53538334", "0.5349984", "0.53471255", "0.5325315", "0.5323619", "0.530805", "0.5296968", "0.5289479", "0.5287432", "0.52867997", "0.52815694", "0.5276733", "0.52720416", "0.524786", "0.5238762", "0.5230631", "0.5224306", "0.5221519", "0.5221519", "0.5221519", "0.5212933", "0.5187336", "0.5185422", "0.51750654", "0.5173451", "0.5164598", "0.516312", "0.51587003", "0.51578975", "0.5155622", "0.5149906", "0.51485443", "0.51436126", "0.51415855", "0.5137156", "0.51309556", "0.5129729", "0.5128364", "0.51211196", "0.5114644", "0.5107198", "0.5094656", "0.5089323", "0.50880885", "0.50870377", "0.5086162", "0.5078866", "0.50769", "0.5074671", "0.5073759", "0.5072887", "0.5068576", "0.5067771", "0.5065215", "0.50589156", "0.50521266", "0.5051536", "0.50474906", "0.5042598", "0.5042358", "0.5040017", "0.50375056", "0.5033069", "0.5031385", "0.50259066", "0.5024523", "0.5021236", "0.50199276" ]
0.7099455
2
mysql_unbuffered_query sends the SQL query query to MySQL without automatically fetching and buffering the result rows as mysql_query does. This saves a considerable amount of memory with SQL queries that produce large result sets, and you can start working on the result set immediately after the first row has been retrieved as you don't have to wait until the complete SQL query has been performed. To use mysql_unbuffered_query while multiple database connections are open, you must specify the optional parameter link_identifier to identify which connection you want to use.
function mysql_unbuffered_query(string $query, $link_identifier = null) { error_clear_last(); $result = \mysql_unbuffered_query($query, $link_identifier); if ($result === false) { throw MysqlException::createFromPhpError(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pdo_unbuffered_query($sql, $link=NULL, $params=NULL) {\r\n \r\n // find optional $link param\r\n $params = func_get_args();\r\n $link = array_filter($params, \"is_object\");\r\n $link = pdo_handle($link ? reset($link) : NULL);\r\n $link->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);\r\n \r\n // invoke real pdo_query()\r\n $result = call_user_func_array(\"pdo_query\", $params);\r\n\r\n // reset to buffered mode\r\n $link->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\r\n \r\n // done\r\n return $result;\r\n }", "function db_multi_query($query, $link_id,$debug=false, $die_on_debug=true, $silent=false,$executedto=\"Local\") {\n if ($link_id!=\"mlks\"){\n\t\n \n\tif ($GLOBALS['DB_DEBUG']||$debug) {\n\t\techo \"<pre>\" . htmlspecialchars($query) . \"(\".$executedto.\")</pre>\";\nif ($die_on_debug&&$GLOBALS['DB_DIE_ON_DEBUG']) die;\n\t\n\t}\n/*\n$query=(substr($query,0,stripos($query,\"FROM\"))).strtolower(substr($query,stripos($query,\"FROM\")));\n$query=LowTblNames($query,\",\");\n*/\n if (mysqli_multi_query($link_id,$query)) { \n $i = 0; \n do { \n $i++; \n } while ($res[]=mysqli_next_result($link_id)); \n} \nif (mysqli_errno($link_id)) { \n echo \"Batch execution prematurely ended on statement $i.\\n\"; \n var_dump(mysqli_error($link_id)); \n} \n \t\n //db_log($query,$executedto);\n return $res;\n }\n}", "function clearConnection($mysql) {\n while ($mysql->more_results()) {\n $mysql->next_result();\n $mysql->use_result();\n }\n}", "static private function connection_unbuffered($name)\n {\n if(!self::is_open($name))\n {\n throw new DBException(\"DB class error: Can't created an unbuffered connection: it has to be connected or predicted!\");\n }\n $c = self::$connections[$name]['info'];\n return self::add_connection($name, $c['db_host'], $c['db_user'], $c['db_pass'], $c['db_base'], true);\n }", "function db_query($query, $link = 'db_link') {\n\tglobal $link;\n\t$result = mysql_query($query, $link) or die($query);\n\treturn $result;\n}", "function mysql_query($query)\n{\n $link = Session::get('db_link');\n if ($query == \"START TRANSACTION\") return mysqli_autocommit($link, FALSE);\n else if ($query == \"COMMIT\") return mysqli_commit($link);\n else return mysqli_query($link, $query);\n}", "function pdo_mysql_stmt_closecursor($db) {\n\t\t// If no error messages gets printed do not know if proper usage of closeCursor() makes any\n\t\t// difference or not. That's why we need to cause an error here.\n\t\t$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);\n\t\t$stmt1 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t// query() shall fail!\n\t\t$stmt2 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t$stmt1->closeCursor();\n\n\t\t// This is proper usage of closeCursor(). It shall prevent any further error messages.\n\t\tif (MySQLPDOTest::isPDOMySQLnd()) {\n\t\t\t$stmt1 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t} else {\n\t\t\t// see pdo_mysql_stmt_unbuffered_2050.phpt for an explanation\n\t\t\tunset($stmt1);\n\t\t\t$stmt1 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t}\n\t\t// fetch only the first rows and let closeCursor() clean up\n\t\t$row1 = $stmt1->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt1->closeCursor();\n\n\t\t$stmt2 = $db->prepare('UPDATE test SET label = ? WHERE id = ?');\n\t\t$stmt2->bindValue(1, \"z\");\n\n\t\t$stmt2->bindValue(2, $row1['id']);\n\t\t$stmt2->execute();\n\t\t$stmt2->closeCursor();\n\n\t\t$db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n\t\t// check if changing the fetch mode from unbuffered to buffered will\n\t\t// cause any harm to a statement created prior to the change\n\t\t$stmt1->execute();\n\t\t$row2 = $stmt1->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt1->closeCursor();\n\t\tif (!isset($row2['label']) || ('z' !== $row2['label']))\n\t\t\tprintf(\"Expecting array(id => 1, label => z) got %s\\n\", var_export($row2, true));\n\t\tunset($stmt1);\n\n\t\t$stmt1 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t// should work\n\t\t$stmt2 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t$stmt1->closeCursor();\n\n\t\t$stmt1 = $db->query('SELECT id, label FROM test ORDER BY id ASC');\n\t\t// fetch only the first rows and let closeCursor() clean up\n\t\t$row3 = $stmt1->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt1->closeCursor();\n\t\tassert($row3 == $row2);\n\n\t\t$stmt2 = $db->prepare('UPDATE test SET label = ? WHERE id = ?');\n\t\t$stmt2->bindValue(1, \"a\");\n\t\t$stmt2->bindValue(2, $row1['id']);\n\t\t$stmt2->execute();\n\t\t$stmt2->closeCursor();\n\n\t\t$stmt1->execute();\n\t\t$row4 = $stmt1->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt1->closeCursor();\n\t\tassert($row4 == $row1);\n\n\t\t$offset = 0;\n\t\t$stmt = $db->prepare('SELECT id, label FROM test WHERE id > ? ORDER BY id ASC LIMIT 2');\n\t\t$in = 0;\n\t\tif (!$stmt->bindParam(1, $in))\n\t\t\tprintf(\"[%03d + 1] Cannot bind parameter, %s %s\\n\", $offset,\n\t\t\t\t$stmt->errorCode(), var_export($stmt->errorInfo(), true));\n\n\t\t$stmt->execute();\n\t\t$id = $label = null;\n\n\t\tif (!$stmt->bindColumn(1, $id, PDO::PARAM_INT))\n\t\t\tprintf(\"[%03d + 2] Cannot bind integer column, %s %s\\n\", $offset,\n\t\t\t\t$stmt->errorCode(), var_export($stmt->errorInfo(), true));\n\n\t\tif (!$stmt->bindColumn(2, $label, PDO::PARAM_STR))\n\t\t\tprintf(\"[%03d + 3] Cannot bind string column, %s %s\\n\", $offset,\n\t\t\t\t$stmt->errorCode(), var_export($stmt->errorInfo(), true));\n\n\t\twhile ($stmt->fetch(PDO::FETCH_BOUND))\n\t\t\tprintf(\"in = %d -> id = %s (%s) / label = %s (%s)\\n\",\n\t\t\t\t$in,\n\t\t\t\tvar_export($id, true), gettype($id),\n\t\t\t\tvar_export($label, true), gettype($label));\n\n\t\t$stmt->closeCursor();\n\t\t$stmt->execute();\n\n\t}", "function query($sql, $link = 0) {\n $this->link = $link ? $link : $this->link;\n if($this->logQueries) $start = $this->getMicrotime();\n $this->query = @mysql_query($sql, $this->link) or $this->error(\"Query fail: {$sql}\");\n $this->affected = @mysql_affected_rows($this->link);\n if ($this->query && $this->logQueries) $this->log('QUERY', \"EXEC -> \" . number_format($this->getMicrotime() - $start, 8) . \" -> \" . $sql);\n return $this->query ? $this->query : FALSE;\n }", "function BufferedUpdates ( $dblink, $table_name, $row_count, $buffer_size )\r\n\t {\r\n\t\t$buffer\t\t= new DbBufferedUpdate ( $table_name, [ 'id' ], [ 'intvalue', 'date', 'randvalue', 'strvalue1', 'strvalue2', 'strvalue3' ], $buffer_size, $dblink ) ;\r\n\r\n\t\tfor ( $i = 1 ; $i <= $row_count ; $i ++ )\r\n\t\t {\r\n\t\t\t$buffer -> Add\r\n\t\t\t ([\r\n\t\t\t\t'keys'\t\t=> [ 'id' => $i ],\r\n\t\t\t\t'columns'\t=>\r\n\t\t\t\t [ \r\n\t\t\t\t\t'intvalue'\t=> $i,\r\n\t\t\t\t\t'randvalue'\t=> $i + 10000000, \r\n\t\t\t\t\t'strvalue1'\t=> 'XXA' . $i, \r\n\t\t\t\t\t'strvalue2'\t=> 'ZZB' . $i, \r\n\t\t\t\t\t'strvalue3'\t=> 'ZZC' . $i \r\n\t\t\t\t ],\r\n\t\t\t\t'computed-columns' =>\r\n\t\t\t\t [\r\n\t\t\t\t\t'date'\t\t=> 'NOW()', \r\n\t\t\t\t ]\r\n\t\t\t ]) ;\r\n\t\t }\r\n\r\n\t\t$buffer -> Flush ( ) ;\r\n\t }", "function BufferedLoads ( $dblink, $table_name, $row_count, $buffer_size )\r\n\t {\r\n\t\tmysqli_query ( $dblink, \"TRUNCATE TABLE $table_name\" ) ;\t\t// Make sure we start from a clean state\r\n\t\t$buffer\t\t= new DbBufferedLoadFile ( $table_name, [ 'intvalue', 'randvalue', 'strvalue1', 'strvalue2', 'strvalue3' ], $buffer_size, $dblink ) ;\r\n\r\n\t\tfor ( $i = 1 ; $i <= $row_count ; $i ++ )\r\n\t\t {\r\n\t\t\t$strvalue\t= sha1 ( microtime ( true ) ) ;\t\t// Well, we have to fill columns with some data...\r\n\t\t\t$intvalue\t= mt_rand ( ) ;\r\n\t\t\t$buffer -> Add \r\n\t\t\t ([ \r\n\t\t\t\t'columns' =>\r\n\t\t\t\t [\r\n\t\t\t\t\t'randvalue'\t=> $intvalue, \r\n\t\t\t\t\t'intvalue'\t=> $i,\r\n\t\t\t\t\t'strvalue1'\t=> $strvalue, \r\n\t\t\t\t\t'strvalue2'\t=> $strvalue, \r\n\t\t\t\t\t'strvalue3'\t=> $strvalue \r\n\t\t\t\t ]\r\n\t\t\t ]) ;\r\n\t\t }\r\n\r\n\t\t$buffer -> Flush ( ) ;\r\n\t }", "function pp_run_query_old($query)\n{\n global $debug, $host, $db, $user, $pass;\n $the_db_link = mysql_connect($host, $user, $pass, $db) or die('pp_run_query_old: no link to db possible');\n mysql_select_db($db, $the_db_link) or die('pp_run_query_old: no db select possible');\n $res = mysql_query($query, $the_db_link);\n $error_nr = mysql_errno($the_db_link);\n if ($error_nr != 0) {\n $error_buffer .= '|'.mysql_error($the_db_link).'|';\n }\n if ($debug and $error_buffer != \"\") {\n echo('<div class=\"debug\">got error(s):|'.$error_buffer.'| when running the query \"'.$query.'\"</div>');\n }\n mysql_close($the_db_link);\n return $res;\n}", "function db_query($query, $link = 'db_link') {\n global $$link;\n\n $result = mysql_query($query) or $this->db_error($query, mysql_errno(), mysql_error());\n\n return $result;\n }", "function query($query) \n \t{\n \t\tif ( is_object($query) )\n \t\t\t$queryString = $query->getSQL();\n \t\telse\n \t\t\t$queryString = $query;\n \t\t\t\n \t\tif ($this->queryId) \n \t\t{\n \t\t\t@mysql_free_result($this->queryId);\n \t\t\t$this->queryId = 0;\n \t\t}\n\n \t\t$this->queryId = @mysql_query($queryString, $this->linkId);\n\t \tif (!$this->queryId)\n\t \t{\n\t \t\techo $query . \"<br>\";\n\t \t\tnew CException(mysql_error(), __FILE__, __LINE__);\n\t \t}\n\n \t\t$this->row = 0;\n \t\t\n \t\treturn $this->queryId;\n \t}", "function do_mysql_query($query, $silence = 0)\n{\n\t$res=mysql_query($query);\n\tif (!$res & $silence == 0)\n\t\techo mysql_error().\"<br> Request was : \".$query.\"<br>\";\n\treturn $res;\n}", "function query_batch( $abort_on_error=true, $p_transaction_safe = false) {\n $this->_errorNum = 0;\n $this->_errorMsg = '';\n if ($p_transaction_safe) {\n $si = mysql_get_server_info();\n preg_match_all( \"/(\\d+)\\.(\\d+)\\.(\\d+)/i\", $si, $m );\n if ($m[1] >= 4) {\n $this->_sql = 'START TRANSACTION;' . $this->_sql . '; COMMIT;';\n } else if ($m[2] >= 23 && $m[3] >= 19) {\n $this->_sql = 'BEGIN WORK;' . $this->_sql . '; COMMIT;';\n } else if ($m[2] >= 23 && $m[3] >= 17) {\n $this->_sql = 'BEGIN;' . $this->_sql . '; COMMIT;';\n }\n }\n\n $query_split = preg_split (\"/[;]+/\", $this->_sql);\n $error = 0;\n $counter = 0;\n foreach ($query_split as $command_line) {\n $counter++;\n $command_line = trim( $command_line );\n if ($command_line != '') {\n $this->_cursor = mysql_query( $command_line, $this->_resource );\n if (!$this->_cursor) {\n $error = 1;\n $this->_errorNum .= mysql_errno( $this->_resource ) . ' ';\n $this->_errorMsg .= mysql_error( $this->_resource ).\" SQL=$command_line <br />\";\n\n if ($abort_on_error) {\n handle_error($this->getPrettyErrorMessage());\n return $this->_cursor;\n }\n }\n }\n }\n return $error ? false : true;\n\t}", "public function query($sql, $Buffer = FALSE)\n\t{\n\t\tGLOBAL $query_count;\n\n\t\t$objQuery = TRUE;\n\n\t\tif (!$Buffer) {\n\t\t\t$this->query \t= $sql;\n\t\t\t$query \t\t\t= mysql_query($sql) OR die($this->__mysql_error($sql));\n\t\t\t//---- result Array erstellen\n\t\t\t$result \t\t= array();\n\t\t\t//echo \"<br>\";\n\t\t\t//var_dump($query);\n\t\t\twhile(@$row = mysql_fetch_assoc($query)){\n\t\t\t\t$result[] = $row;\n\t\t\t}\n\t\t\t$objQuery \t\t= new Query($result);\n\t\t\t$this->querySafe[$sql] = $result;\n\t\t\t$query_count[\"REL\"]++;\n\t\t}else {\n\t\t\tif (array_key_exists($sql, $this->querySafe)) {\n\t\t\t\t$objQuery = new Query($this->querySafe[$sql]);\n\t\t\t}else {\n\t\t\t\t$this->query \t= $sql;\n\t\t\t\t$query \t\t\t= mysql_query($sql);\n\t\t\t\t//---- result Array erstellen\n\t\t\t\t$result \t\t= array();\n\t\t\t\twhile(@$row = mysql_fetch_assoc($query)){\n\t\t\t\t\t$result[] = $row;\n\t\t\t\t}\n\t\t\t\t$objQuery \t\t= new Query($result);\n\t\t\t\t$this->querySafe[$sql] = $result;\n\t\t\t\t$query_count[\"REL\"]++;\n\t\t\t}\n\t\t}\n\n\t\t$query_count[\"ALL\"]++;\n\n\t\t#echo $query_count;\n\n\n\t\tif (!$query && !$Buffer) {\n\t\t\t//return $this->__error(\"Der Query[$sql] konnte nicht erfolgreich ausgeführt werden.\");\n\t\t\t$this->__mysql_error($sql);\n\t\t} else {\n\t\t\t$this->queryresult = $query;\n\n\t\t\treturn $objQuery;\n\t\t}\n\t}", "public function select_unbuffered($sql, $parameters=array()) {\n\t\tif ($this->isAvailable() === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$statement = $this->conn->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n\t\t\t$statement->execute($parameters);\n\t\t\t$this->opencursor = $statement;\n\t\t\treturn true;\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function clearConnection($mysql) {\n while ($mysql->more_results()) {\n $mysql->next_result();\n $mysql->use_result();\n }\n }", "private function q($query) {\n $this->last_query = $query;\n $this->result = mysql_query($query,$this->link) or $this->err(mysql_error());\n $this->queries++;\n $this->affected_rows = mysql_affected_rows($this->link);\n if(is_resource($this->result)) {\n $this->num_rows = mysql_num_rows($this->result);\n } else {\n $this->num_rows = 0;\n }\n \n $this->insert_id = mysql_insert_id($this->link); // <-- Ugly sollution, I know\n }", "public function toUnbuffered(): IResultAdapter;", "function LaChunkNewGet($mysql_link) {\n global $LA;\n\n\t$chunk = array();\n\t$timestamp = date(\"Y-m-d H:i:s\");\n\t\n\t# starting a transaction and lock using 'for update' on the selection of the row.\n\tmysql_query(\"START TRANSACTION\", $mysql_link);\n\t\n\t# get id\n\t$result = mysql_query(\"SELECT chunk_id,chunk_from,chunk_to FROM log_analyze_chunk WHERE chunk_status = 'new' ORDER BY `chunk_from` LIMIT 1 FOR UPDATE\", $mysql_link);\n\t\n\tif ($result && mysql_num_rows($result) == 1) {\n\t\t$result_row = mysql_fetch_assoc($result);\n\t\t$chunk['id'] = $result_row['chunk_id'];\n\t\t$chunk['from'] = $result_row['chunk_from'];\n\t\t$chunk['to'] = $result_row['chunk_to'];\n\t\n\t\t# update status\n\t\t$query = \"UPDATE log_analyze_chunk SET chunk_status = 'process' WHERE chunk_id = \".$chunk['id'];\n\t\t$result = mysql_query($query, $mysql_link);\n\t\tif (mysql_affected_rows($mysql_link) != 1) {\n\t\t\tcatchMysqlError(\"LaChunkNewGet ($query): \".mysql_affected_rows($mysql_link), $mysql_link);\n\t\t}\n\t}\n\t\n\t# 'update' done\n\tmysql_query(\"COMMIT\", $mysql_link);\n\t\n\treturn $chunk;\n}", "function mysql_close($link_identifier = null): void\n{\n error_clear_last();\n $result = \\mysql_close($link_identifier);\n if ($result === false) {\n throw MysqlException::createFromPhpError();\n }\n}", "function pp_run_query_unprepared($query)\n{\n global $debug;\n $res = mysqli_query(getDBLink(), $query);\n \n $error_nr = mysqli_errno(getDBLink());\n if ($error_nr != 0) {\n $error_buffer .= '|'.mysqli_error(getDBLink()).'|';\n }\n if ($error_buffer != \"\") {\n echo('<div class=\"debug\">got error(s):|'.$error_buffer.'| when running the query \"'.$query.'\"</div>');\n }\n \n return $res;\n}", "function db_query($db_link, $query) {\n $result = mysqli_query($db_link, $query);\n if($result === FALSE) die(mysqli_error($db_link));\n return $result;\n}", "public function free_result(){\n\t\t\n\t\tif($this->query_id !== 0 && !@mysql_free_result($this->query_id)) {\n\t\n\t\t\t$this->errorMessage(\"Not possible to free query id \".$this->query_id .\"\");\n\t\t\texit;\n\t\t\t\t\n\t\t}\n\t}", "function query($q)\r\n {\r\n if($this->link)\r\n {\r\n $start = microtime(true);\r\n $this->res_id = mysql_query($q, $this->link);\r\n $end = microtime(true);\r\n $query->sql = $q;\r\n $query->exec_time = $end-$start;\r\n $this->queries[] = $query;\r\n \r\n }else\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong database link\";\r\n return 0;\r\n }\r\n if(!$this->res_id)\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong result id\";\r\n return 0;\r\n }\r\n return $this->res_id;\r\n }", "public function queryOnce($query, $freeResults = true)\n\t{\n\t\t// run query\n\t\t$this->query($query);\n\n\t\t// get next record\n\t\tif ($this->nextRecord($freeResults) === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($freeResults === true)\n\t\t{\n\t\t\t// try to free the results\n\t\t\tif (mysql_free_result($this->_results) === false)\n\t\t\t{\n\t\t\t\tthrow new DatabaseException('Unable to free results');\n\t\t\t}\n\t\t\t$this->_results = null;\n\t\t}\n\t}", "protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}", "function db_query($link, $query) {\n\n if (!isset($link)) {\n throw new Exception('Connection with MySQL server needed before execute a SQL query.');\n }\n else {\n return mysqli_query($link, $query);\n }\n}", "function dbQuery($query, $link = 'db_link') {\n global $dblink;\n $result = mysqli_query($dblink, $query) or dbError(); // either it connects or gives an error\n return $result; // get the result from queries\n}", "function db_querym($query, $i,$link_id, $link_id2=\"\" , $debug=false, $die_on_debug=true, $silent=false) {\n\n\t\n\n\tif ($debug) {\n\t\techo \"<pre>\" . htmlspecialchars($query[$i]) . \"</pre>\";\n\n\t\tif ($die_on_debug) die;\n\t}\n\n\tif ($link_id2!=\"\"){\n\t$qid = db_query($query[$i],$link_id2);}\n\n\t$qid = db_query($query[$i],$link_id,\"\",\"\",\"\",\"Central\");\n\n\treturn $qid;\n}", "function dobatch ($p_query) {\n $query_split = preg_split (\"/[;]+/\", $p_query);\n foreach ($query_split as $command_line) {\n $command_line = trim($command_line);\n if ($command_line != '') {\n $query_result = mysql_query($command_line);\n if ($query_result == 0) {\n break;\n };\n };\n };\n return $query_result;\n}", "function doQuery($db, $sql) {\r\n\tconnect();\r\n\tglobal $l, $errmsg;\r\n\t$c1 = chr(1);\r\n\t$c2 = chr(2);\r\n\t$c3 = chr(3);\r\n\t$sBuffer = \"\";\r\n\t$sRowBuffer = \"\";\r\n\t$r = mysql_db_query($db, $sql , $l);\r\n\t$errmsg = mysql_errno().\": \".mysql_error();\r\n\tif (mysql_error() != \"\") {\r\n\t\terrormsg(\"Database Error\", $errmsg);\r\n\t\t$r = 0;\r\n\t\treturn $r;\r\n\t}\r\n\t\r\n\twhile ($obj = mysql_fetch_field($r)) {\r\n\t \tif ($sBuffer != \"\") { $sBuffer = \"$sBuffer$c3\"; }\r\n\t\t$sBuffer = \"$sBuffer$obj->name\"; \r\n\t} \r\n\r\n\twhile ($row = mysql_fetch_row($r)) {\r\n\t \t$sRowBuffer = \"\";\r\n\t\tfor ($i=0; $i<mysql_num_fields($r); $i++) { \r\n\t\t\tif ($sRowBuffer != \"\") { $sRowBuffer = \"$sRowBuffer$c3\"; } \r\n\t\t\t$sRowBuffer = \"$sRowBuffer\" . safeString($row[$i]); \r\n\t\t}\r\n\t \tif ($sBuffer != \"\") { $sBuffer = \"$sBuffer$c2\"; }\r\n\t \t$sBuffer = \"$sBuffer$sRowBuffer\";\r\n\t} \r\n\tmysql_free_result($r);\r\n\treturn $sBuffer;\r\n}", "public function execute($sql) {\n\tif (!is_resource($this->link)) {\n\t $this->connect();\n\t}\n\t$this->lastqueryid = mysql_query($sql, $this->link) or $this->halt(mysql_error(), $sql);\n\t$this->querycount++;\n\treturn $this->lastqueryid;\n }", "public function freeResult( $query_id=null );", "function LT_query($query, $die = TRUE) {\n\tglobal $LT_SQL;\n\n\t// perform query\n\t$success = $LT_SQL->multi_query($query);\n\tif (!$success) {\n\t\tif ($die) die('Query failed: ' . $LT_SQL->error);\n\t\telse return FALSE;\n\t}\n\n\t// get the first result set as an array of associative arrays\n\t$rows = array();\n\t$result = $LT_SQL->store_result();\n\tif ($result) {\n\t\twhile ($row = $result->fetch_assoc())\n\t\t\t$rows[] = $row;\n\t\t$result->close();\n\t}\n\n\t// ignore subsequent result sets\n\twhile ($LT_SQL->more_results())\n\t\t$LT_SQL->next_result();\n\n\t// return first result set array\n\treturn $rows;\n}", "function query( $query ){\r\n\t\t\r\n\t\tif( ( $query || $query=$this->query ) && !isset( $this->result[$query] ) ){\r\n\t\t\tif( $this->result[$query] = mysql_query( $query, $this->link ) ){\t\r\n\t\t\t\tmysql::$nquery++;\r\n\t\t\t\treturn $this->result[ $this->query = $query ];\r\n\t\t\t}\r\n\t\t\telse{\r\n \t\ttrigger_error( mysql_error($this->link) . \"<br/><font color=\\\"red\\\">$query</font><br/>\", E_USER_ERROR );\r\n \t\t// if debug mode on query error stop the execution\r\n\t \tif( isset($GLOBALS['debug']) && $GLOBALS['debug'] == true )\r\n\t\t \texit;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn $this->result[ $query ];\r\n\t}", "function db_query($query, $link_id,$debug=false, $die_on_debug=true, $silent=false,$executedto=\"Local\") {\n if ($link_id!=\"mlks\"){\n\t\n \t\n \n\tif ($GLOBALS['DB_DEBUG']) {\n\t\techo \"<pre>\" . htmlspecialchars($query) . \"(\".$executedto.\")</pre>\";\nif ($die_on_debug&&$GLOBALS['DB_DIE_ON_DEBUG']) die;\n\t\n\t}\n/*\n$query=(substr($query,0,stripos($query,\"FROM\"))).strtolower(substr($query,stripos($query,\"FROM\")));\n$query=LowTblNames($query,\",\");\n*/\n\t$qid = mysqli_query($link_id,$query);\n\n\n\tif (! $qid && ! $silent) {\n\t\tif ($GLOBALS['DB_DEBUG']||$debug) {\n\t\t\techo \"<h2>Can't execute query</h2>\";\n\t\t\techo \"<pre>\" . htmlspecialchars($query) . \"</pre>\";\n\t\t\techo \"<p><b>MySQL Error</b>: \", mysqli_error($link_id);\n\t\t} else {\n\t\t\t$file=fopen(\"./errorlog/mysqlerrors.html\",\"ab\");\n\t\t\tfwrite($file,\"<p>user \".$GLOBALS['USER'][\"user\"][\"firstname\"].\" \".$GLOBALS['USER'][\"user\"][\"lastname\"].\" from \".$GLOBALS['USER'][\"user\"][\"us_cc_id\"].\" at \".date('r').\"</p>\");\n\t\t\tfwrite($file,\"<h2>Can't execute query</h2>\".\"<pre>\" . htmlspecialchars($query) . \"</pre>\".\"<p><b>MySQL Error</b>: \".mysqli_error($link_id));\n\t\t\t$serializedPost = serialize($_POST);\n\t$res = date('l jS \\of F Y h:i:s A');\n\t\n\t$message = \"<br><i>executed at: \".$res.\" details: \".$executedto.\"</i><br><b>\".$query.\" </b>\".$serializedPost.\"<br>\";\t\n\tfwrite($file,$message);\n\t\t\tfclose($file);\n\t\t\techo \"<h2>Database error encountered</h2>\";\n\t\t}\n\n\t\tif (($GLOBALS['DB_DIE_ON_FAIL'])&&(!$silent)) {\n\t\t\techo \"<p>Oops, problem at :</p><p> $executedto </p>\";\n\n\t\t\tdb_log($query,$executedto);\n\t\t\tdie();\n\t\t}\n\t}elseif(! $qid && $silent){\n return $qid;\n }\n\t//db_log($query,$executedto);\n if ($debug) {\n\t\techo \"<pre>\" . htmlspecialchars($query) . \"(\".$executedto.\")</pre>\";\n }\n\treturn $qid;\n }\n //db_log($query,$executedto);\n return \"aaa\";\n}", "#[@test]\n public function unbufferedReadNoResults() {\n $this->createTable();\n $db= $this->db();\n\n $db->open('select * from unittest');\n\n $this->assertEquals(1, $db->query('select 1 as num')->next('num'));\n }", "function BufferedInserts ( $dblink, $table_name, $row_count, $buffer_size )\r\n\t {\r\n\t\tmysqli_query ( $dblink, \"TRUNCATE TABLE $table_name\" ) ;\t\t// Make sure we start from a clean state\r\n\t\t$buffer\t\t= new DbBufferedInsert ( $table_name, [ 'date', 'intvalue', 'randvalue', 'strvalue1', 'strvalue2', 'strvalue3' ], $buffer_size, $dblink ) ;\r\n\r\n\t\tfor ( $i = 1 ; $i <= $row_count ; $i ++ )\r\n\t\t {\r\n\t\t\t$strvalue\t= sha1 ( microtime ( true ) ) ;\t\t// Well, we have to fill columns with some data...\r\n\t\t\t$intvalue\t= mt_rand ( ) ;\r\n\t\t\t$buffer -> Add \r\n\t\t\t ([ \r\n\t\t\t\t'columns' =>\r\n\t\t\t\t [\r\n\t\t\t\t\t'randvalue'\t=> $intvalue, \r\n\t\t\t\t\t'intvalue'\t=> $i,\r\n\t\t\t\t\t'strvalue1'\t=> $strvalue, \r\n\t\t\t\t\t'strvalue2'\t=> $strvalue, \r\n\t\t\t\t\t'strvalue3'\t=> $strvalue \r\n\t\t\t\t ],\r\n\t\t\t\t'computed-columns' =>\r\n\t\t\t\t [\r\n\t\t\t\t\t'date'\t\t=> 'NOW()', \r\n\t\t\t\t ]\r\n\t\t\t ]) ;\r\n\t\t }\r\n\r\n\t\t$buffer -> Flush ( ) ;\r\n\t }", "public function fetch( $query_id=null );", "function close() {\r\n\t\tmysql_free_result($this->result);\r\n\t\tmysql_close($this->link);\r\n\t}", "function mysql_thread_id($link_identifier = null): int\n{\n error_clear_last();\n $result = \\mysql_thread_id($link_identifier);\n if ($result === false) {\n throw MysqlException::createFromPhpError();\n }\n return $result;\n}", "function mysql_list_processes($link_identifier = null)\n{\n error_clear_last();\n $result = \\mysql_list_processes($link_identifier);\n if ($result === false) {\n throw MysqlException::createFromPhpError();\n }\n return $result;\n}", "protected function execute_single_query() \n\t\t{\n \t\t\t$this->open_connection();\n \t\t\t$this->conn->query($this->query);\n \t\t\t$this->close_connection();\n\t\t}", "function freeResult($query = 0) {\n $this->query = $query ? $query : $this->query;\n @mysql_free_result($this->query) or $this->error(\"Result ID: {$this->query} could not be freed.\");\n }", "function pdo_query($sql, $link=NULL, $params=NULL) {\r\n\r\n // separate params from $sql and $link \r\n $params = func_get_args();\r\n $sql = TRIM( array_shift($params) );\r\n $flags = array();\r\n $direct = false;\r\n \r\n\r\n // find pdo $link \r\n if (count($params)) {\r\n // $link can be the first element\r\n if (is_object(reset($params))) {\r\n $link = array_shift($params);\r\n }\r\n // or the last\r\n elseif (is_object(end($params))) {\r\n $link = array_pop($params);\r\n }\r\n }\r\n // or we use the default $pdo\r\n $link = pdo_handle($link);\r\n \r\n // is $params a list to pdo_query(), or just one array with :key=>value pairs?\r\n if (count($params)==1 && is_array($params[0])) {\r\n $params = array_shift($params);\r\n }\r\n\r\n\r\n // add PDO_MySQL driver flag / workaround for specific query types\r\n switch (strtoupper(substr($sql, 0, strspn(strtoupper($sql), \"SELECT,USE,CREATE\")))) {\r\n\r\n // ought to make ->rowCount() work\r\n case \"SELECT\":\r\n $flags[PDO::MYSQL_ATTR_FOUND_ROWS] = true;\r\n break;\r\n\r\n // temporarily disable prepared statement mode for unbindable directives\r\n case \"USE\":\r\n $direct = true;\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\r\n break;\r\n\r\n default:\r\n }\r\n\r\n\r\n // unparameterized query()\r\n if ($direct) {\r\n $stmt = $link->query($sql);\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\r\n }\r\n // or prepare() and execute()\r\n else {\r\n if ($stmt = $link->prepare($sql, $flags)) { // no try-catch in _WARNING mode\r\n $stmt->execute($params);\r\n }\r\n }\r\n \r\n // result\r\n if (!$stmt and PDO_HELPFUL) {\r\n pdo_trigger_error(\"pdo_query() SQL query failed, see pdo_error()\", E_USER_WARNING);\r\n }\r\n elseif (PDO_SEEKABLE & !$direct) {\r\n return new PDOStatement_Seekable($stmt, $params);\r\n }\r\n else {\r\n return $stmt;\r\n }\r\n }", "function free()\n {\n @mysql_free_result( $this->Query_ID );\n $this->Query_ID = 0;\n }", "public function fetchMulti($query, Database_Config $databaseConfig = NULL);", "private function do_query($sql, $return_array = FALSE) {\n\t\n\t\t$this->db_resource_id = mysql_connect(self::DB_HOST, self::DB_USER, self::DB_PASS);\n\t\tmysql_select_db(self::MAIN_DB);\n\t\n\t\t$query = mysql_query($sql) or die(mysql_error());\n\t\t\n\t\tif($return_array == FALSE) {\n\t\t\treturn $query;\n\t\t} else {\n\t\t\t\n\t\t\twhile($row = mysql_fetch_assoc($query)) {\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\t\n\t\t\treturn $data;\t\n\t\t}\n\t}", "function db_free_result($qid) {\n\n\tmysqli_free_result($qid);\n}", "function wb_query($query, $con)\n{\n\t$resource = mysql_query($query, $con);\n\tif(!$resource)\n\t\techo 'Invalid query: ' . mysql_error() . \"\\nQuery: $query\\n\";\n\t\t\n\treturn $resource;\n}", "function Sql_query1( $query ) {\n\tglobal $db;\n\t$res=mysql_query( $query, $db );\n\treturn $res;\n}", "function database_free_result($database_result)\n {\n\t return mysql_free_result($database_result);\n\t}", "function db_query_random($sql, $upper_bound = 10) {\n\t$query = db_query($sql);\n\t$upper_bound = ($query->num_rows > $upper_bound) ? $upper_bound : $query->num_rows;\n\t$used_indices = array();\n\t$results = array();\n\twhile(count($results) < $upper_bound) {\n\t\t$index = rand(0, $query->num_rows - 1);\n\t\tif(false == in_array($index, $used_indices)) {\n\t\t\t$query->data_seek($index);\n\t\t\t$results[] = $query->fetch_assoc();\n\t\t\t$used_indices[] = $index;\n\t\t}\n\t}\n\treturn $results;\n}", "#[@test]\n public function unbufferedReadOneResult() {\n $this->createTable();\n $db= $this->db();\n\n $q= $db->open('select * from unittest');\n $this->assertEquals(array('pk' => 1, 'username' => 'kiesel'), $q->next());\n\n $this->assertEquals(1, $db->query('select 1 as num')->next('num'));\n }", "function Query($query)\n {\n switch ($this->_DB) {\n case 'mysql':\n\n //print \"<hr size=1 noshade>\".$query.\"<hr size=1 noshade>\";\n $handle = mysqli_query($this->_link, $query);\n if (!$handle) {\n die(mysqli_error($this->_link));\n }\n break;\n }\n if ($this->ErrorNo() > 0) {\n echo $query;\n print(\"<hr />Database Error: \" . $this->Error() . \"><br><pre >\");\n print_r(debug_backtrace());\n die(\"</pre><hr />\");\n\n };\n $this->_lastHandle = $handle;\n return $handle;\n }", "function dbQuery1($sql)\r\n{\r\n \t global $dbConn1;\r\n\t $result = mysql_query($sql,$dbConn1) or die(mysql_error()); \r\n\t \r\n\treturn $result;\r\n}", "public function query( $sql ) {\r\n\t\tif (! $this->conn) {\r\n\t\t\t$this->connect ();\r\n\t\t}\r\n\t\t\r\n\t\t$this->last_link = mysql_query ( $sql, $this->conn );\r\n\t\t$this->last_query = $sql;\r\n\t\t\r\n\t\tif (! $this->last_link) {\r\n\t\t\t$this->log_error ( @mysql_error () );\r\n\t\t\tprint \"<span style='color: red'>SQL error occurred. Log written.</span>\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->last_link;\r\n\t}", "public function close() {\n\t\tif ($this->queryresult != \"\")\n\t\t\tmysql_free_result($this->queryresult);\n\t\tmysql_close();\n\t}", "private function query ($sql_query)\n\t{\n\t\tif ($this->mlink === null)\n\t\t{\n\t\t\t$this->connect (DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);\n\t\t}\n\t\n\t\t$sql = mysql_query ($sql_query, $this->mlink);\n\t\t\n\t\t$this->lastSQL = $sql_query;\n\t\t$this->qcounter ++;\n\t\t\n\t\t$this->allQueries[] = $sql_query;\n\t\t\n\t\t//echo $sql_query.\"\\n\";\n\t\tif (mysql_error ())\n\t\t{\n\t\t\n\t\t\techo '<b>'.$sql_query.'</b><br>';\n\t\t\techo mysql_error ();\n\t\t\texit ();\n\t\t\n\t\t}\n\t\t\n\t\telse {\n\t\t\n\t\t\treturn $sql;\n\t\t\n\t\t}\n\t}", "function query($query=\"\")\n\t{\n\t\t$start = $this->getTime();\n\t\tif($query)\n\t\t{\n // debug(\"query\",$query);\n\t\t\t$this->_result_id=mysql_query($query,$this->_link_id);\n\t\t\t$this->_mysql_errno=mysql_errno($this->_link_id);\n\t\t\tif(!$this->_mysql_errno)\n\t\t\t{\n\t\t\t\tif(ereg(\"^insert\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas an insert type query\n\t\t\t\t\t$this->_query_type=4;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^select\", strtolower($query)) || ereg(\"^show\",strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a select or show query type\n\t\t\t\t\t$this->_query_type=1;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^delete\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a delete query type\n\t\t\t\t\t$this->_query_type=3;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^update\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a update query type\n\t\t\t\t\t$this->_query_type=2;\n\t\t\t\t}\n elseif(ereg(\"^create\",strtolower($query)))\n {\n $this->_query_type=5;\n }\n elseif(ereg(\"^drop\",strtolower($query)))\n {\n $this->_query_type=6;\n }\n\n\t\t\t\tif($this->_query_type>0)\n\t\t\t\t{\n\t\t\t\t\tif($this->_query_type>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_num_rows=mysql_affected_rows();\n\t\t\t\t\t}elseif($this->_query_type<5){\n if(is_resource($this->_result_id)){\n $this->_num_rows=mysql_num_rows($this->_result_id);\n }else{\n $this->_num_rows=0;\n }\n\t\t\t\t\t}\n\t\t\t\t\tif($this->_query_type==4)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_insert_id=mysql_insert_id();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_mysql_error=mysql_error();\n\t\t\t}\n\t\t}\n if($this->error_text()){\n Debug(\"Query\",$query);\n Debug(\"Error\",$this->error_text());\n }\n $this->logquery($query,$start);\n\t\treturn $this->_query_type;\n\t}", "public function free( )\n {\n if ( $this->db_query_result )\n @ mysql_free_result( $this->db_query_result );\n }", "function db_query_first($sql, $args=array()) {\n $sth = db_query($sql, $args);\n $row = $sth->fetch(PDO::FETCH_BOTH);\n $sth->closeCursor();\n return $row ? $row : NULL;\n}", "function queryMysql($query)\n\t{\n\t\tglobal $connection;\n\t\t$result = $connection->query($query);\n\t\tif(!$result) die ($connection->error);\n\t\treturn $result;\n\n\t}", "function my_one($query)\n{\nglobal $dbserver,$dbuser,$dbpassword,$dbname;\n$connection_id=mysqli_connect($dbserver,$dbuser,$dbpassword,$dbname) or die(\"connection failed\");\n//mysqli_select_db($dbname,$connection_id);\n$recieve=mysqli_query($connection_id,$query);\n$row=mysqli_fetch_array($recieve);\nmysqli_close($connection_id);\nreturn $row;\n}", "function mkr_query($strsql,$conn)\n{\n\t$rs = mysql_query($strsql,$conn);\n\treturn $rs;\n}", "function db_query($query,$exit=0) {\r\n\r\n\tif ($exit) {\r\n\t\t\r\n\t\techo $query;\r\n\t\texit;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t$rc = @mysql_query($query);\r\n\t\t\r\n\t\tif ($rc) return $rc;\r\n\t\telse {\r\n\t\t\r\n\t\t\techo $query;\r\n\t\t\texit;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function free() { return mysql_free_result( $this->recordSet ); }", "function sql_query($sql, $returnid = 0) {\r\n\r\n\t$link \t= mysql_connect($GLOBALS['cfg']['sql_server'], $GLOBALS['cfg']['sql_user'], $GLOBALS['cfg']['sql_pawd']) \r\n\t\tor die(\"Could not connect: \" . mysql_error());\r\n\t\r\n\tmysql_select_db($GLOBALS['cfg']['sql_dbname'], $link) \r\n\t\tor die (\"Can't use db \". $GLOBALS['cfg']['sql_dbname'] . mysql_error());\r\n\r\n\t$result = mysql_query($sql) \r\n\t\tor die(\"Could not query: \" . mysql_error());\r\n\t\r\n\tif ($returnid != 0) {\r\n\t\t$result = mysql_insert_id();\r\n\t}\r\n\r\n\tmysql_close($link);\r\n\r\n\treturn $result;\r\n}", "function close() \n {\n if($this->rsQry==false)\n {\n\t\t\t mysql_free_result($this->rsQry);\n\t\t\t unset($this->rsQry);\n }\n\t\t}", "function oci_set_prefetch($statement, $rows)\n{\n}", "function mysql_fetch_all($result) {\n while($row=mysql_fetch_array($result)) {\n $return[] = $row;\n }\n return $return;\n}", "function db_query($query, $args = array()) {\n $fnc = $this->slave_safe ? 'db_query_slave' : 'db_query';\n return $fnc($query, $args);\n }", "function db_query($query_string, $link = false) {\n global $fwlog, $db_link;\n\n if (!$link) {\n $link = $db_link;\n }\n\n if (!$link) {\n throw new Exception('Ung&uuml;ltiger Aufruf: Ein DB-Link muss angegeben werden.');\n }\n\n $fwlog->info(\"SQL-Query: $query_string\");\n $res = mysqli_query($link, $query_string);\n\n if (!$res) {\n throw new Exception('Ung&uuml;ltige Abfrage: ' . mysqli_error($link) . \". SQL-Query: {$query_string}\");\n }\n\n\treturn $res;\n}", "function runDBQuery($queryString) {\n\t$query = @mysql_query($queryString) or throwMySQLError(mysql_error(), $queryString);\n\treturn $query;\n}", "function query($query, $handle='')\n\t{\n\t\t//Perform the MySQL query\n\t\t$result = mysql_query($query, $this->link);\n\n\t\t//if result was straight-up false, return\n\t\tif( $result === FALSE )\n\t\t{\n\t\t\t$this->throw_mysql_error();\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//if query was one that returns a resultset, grab and store it\n\t\tif( preg_match( '%^(select|show|describe|explain)%is', $query ) > 0 )\n\t\t\t$this->set_handle( $result, $handle );\n\n\t\t//if query was a 'SELECT', return the number of affected rows\n\t\tif( preg_match( '%^(select)%is', $query ) > 0 )\n\t\t{\n\t\t\treturn mysql_num_rows($result);\n\t\t}\n\t\t//if query was one that affected existing rows (ie UPDATE, DELETE etc), return the number of affected rows\n\t\telseif( preg_match( '%^(update|replace|delete)%is', $query ) > 0 )\n\t\t{\n\t\t\treturn mysql_affected_rows($this->link);\n\t\t}\n\t\t//if query was an insert, return the new ID\n\t\telseif( preg_match( '%^(insert)%is', $query ) > 0 )\n\t\t{\n\t\t\treturn mysql_insert_id( $this->link );\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function DbGetRow($query){\n \t\t$link = mysql_query($query);\n \t\t$id = mysql_insert_id();\n \t\t\n \t\t$link ? $this->querycount['success']++ : $this->querycount['error']++;\n \t\t\n \t\t$a = mysql_fetch_assoc($link);\n \t\t\n \t\t$this->cacheQuery($query, $a);\n \t\t\n \t\treturn $a;\n }", "function dbqueryGMS( $db_link, $query_str, $row_count, $av1)\n{\n\t#$result = $stmt->setFetchMode(PDO::FETCH_NUM); # will return results in array with integer index (not col name)\n\ttry {\n\t\t$result = $db_link->query( $query_str );\n\t\t$row_count = $result->rowCount();\n\t} catch (PDOException $e) {\nprint_r($db_link->errorInfo());\n\t\tgmsError( 'ECDBQUERY', $e->getMessage(), '', '', '' );\n\t\t$row_count = 0;\n\t\treturn null;\n\t}\t\t\n\treturn $result;\n}", "function fetch_row( $handle='', $return_as_array = FALSE, $close_on_finish = TRUE, )\n\t{\n\t\t$result = $this->get_handle($handle);\n\t\tif( !$result )\n\t\t\treturn FALSE;\n\t\t\n\t\t//get the row\n\t\t$row = mysql_fetch_assoc( $result );\n\t\t\n\t\t//if loop has finished, close the result\n\t\tif( $row === FALSE )\n\t\t{\n\t\t\tif( $close_on_finish )\n\t\t\t\tmysql_free_result( $result );\n\t\t\t\t\n\t\t\treturn FALSE;\t\n\t\t}\n\t\t\n\t\t//return an object by default, but also allow for arrays\n\t\tif( $return_as_array )\n\t\t\treturn $row;\n\n\t\treturn (object)$row;\n\t}", "function query($sql,$calculateRows=false,$fastHint=false);", "function freeResult() {\n\t mysqli_free_result($this->result); \n\t }", "function mysql() {\n return call_user_func_array('mysql_db_query', func_get_args());\n}", "protected function get_query($sql) {\n $this->open_link();\n $result = $this->conx->query($sql);\n while ($this->rows[] = $result->fetch_assoc());\n $result->free();\n $this->close_link();\n array_pop($this->rows);\n \n return $this->rows[0];\n }", "function one_query( $sql = \"\" )\n\t{\n\t\t$this->time_start();\n\t\t$sql = trim( $sql );\n\t\tif ( $this->checkup( \"\", $sql ) != true ) {\n\t\t\treturn $this->error( \"Queryfehler...\" );\n\t\t}\n\t\t$data = array();\n\t\t$count = 0;\n\t\t$conn = $this->CONN;\n\t\t$result = mysql_query( $sql, $conn );\n\t\tif ( !eregi( \"create|load|alter|outfile\", $sql ) ) {\n\t\t\twhile ( $row = @mysql_fetch_array( $result ) ) {\n\t\t\t\t$data[$count++] = $row;\n\t\t\t} //# while()\n\t\t} else {\n\t\t\t$data = $result;\n\t\t}\n\t\t@mysql_free_result( $result );\n\n\t\t$this->time_stop(\"query\");\n\n\t\tif($data==false) {\n\t\t\treturn $this->error($sql);\n\t\t}\n\n\t\treturn $data;\n\t}", "abstract protected function query_and_clear_cache($sql);", "private function query($query, $singleColumn=false, $singleRow=false)\n\t{\n\t\tdebug(\"SQL: query\", $query);\n\t\tif($this->debug)\n\t\t\t$this->sqlLog[] = $query;\n\n\t\tif($this->offline) return;\n\n\t $this->connect(); //if connection not already open \n\t $result = $this->mysqlConnection->query($query);\n\t $rows = SqlManager::getResultData($result, $singleColumn, $singleRow);\n\t return $rows;\n\t}", "public function sql_fetchrow($query_id = 0)\n{\nif( !$query_id )\n\t{\n\t$query_id = $this->query_result;\n\t}\n\nif( $query_id )\n\t{\n\t//05.15.2013 naj - added boolean check to stop the following php log.\n\t//mysql_fetch_array() expects parameter 1 to be resource, boolean given in /var/www/nizex.com/lizzy/db/mysql4.php on line 337\n\tif (is_bool($query_id))\n\t\treturn false;\n\n\treturn $query_id->fetch_assoc();\n\t}\nelse\n\t{\n\treturn false;\n\t}\n}", "public function disconnect()\n\t\t{\tif (isset($this->link))\n\t\t\t\t$mysql_close($this->link);\n\n\t\t\tunset($this->link);\n\t\t}", "function fvls_db_ExecuteQuery($sql){\n\t\tglobal $FLVS_db_link;\n\t\tif( !$FLVS_db_link instanceof MySQLi )\n\t\t\treturn false;\n\n\t\tif ( !($response = $FLVS_db_link->query( $sql ) ) ){\n\t\t\tif( defined('FVLS_DEVELOPER_MODE') && FVLS_DEVELOPER_MODE )\n\t\t\t echo \"FV Link Shortener Error: mySQL Query Error - $FLVS_db_link->error | $sql\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $response;\n\t}", "function runSql ( // r - null == no records found/updated, false == error, success 0,1,2,3....n\n $mysql,\n $abind_params,\n $close = false,\n &$ref_status_text = ''\n){\n\n $ref_status_text = '';\n $conn = '';\n $sth = '';\n $result = false;\n \n $msg = '';\n \n $driver = new mysqli_driver();\n $driver->report_mode = MYSQLI_REPORT_OFF;\n \n //ini_set('display_errors', '0');\n \n try {\n \n if (!$conn = db_connect()) {\n $error = '';\n if (isset($conn->error)) {\n $error = $conn->error;\n }\n formatSessionMessage(\"runSql() db_connect() error\", 'danger', $msg, $error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n return false;\n }\n \n if (@!$sth = $conn->prepare($mysql)) {\n formatSessionMessage(\"runSql() prepare() error\", 'danger', $msg, $conn->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n (!empty($sth) && @$sth->close());\n @$conn->close();\n return false;\n }\n \n if ($abind_params != '') {\n if (@!call_user_func_array(array($sth, 'bind_param'), refValues($abind_params))) {\n $error = '';\n if (isset($sth->error)) {\n $error = $sth->error;\n } else if (isset($conn->error)) {\n $error = $conn->error;\n }\n formatSessionMessage(\"runSql() bind_param() error\", 'danger', $msg, \"rs-3205 $error\");\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n (!empty($sth) && @$sth->close());\n @$conn->close();\n return false;\n }\n }\n \n if (@!$sth->execute()) {\n formatSessionMessage(\"runSql() execute() error: \", 'danger', $msg, $sth->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n \n // ... right from the manual\n // An integer greater than zero indicates the number of rows affected or retrieved. \n // Zero indicates that no records were updated for an UPDATE statement, no rows \n // matched the WHERE clause in the query or that no query has yet been executed.\n // -1 indicates that the query returned an error. \n \n if($close){ // update action\n $result = $sth->affected_rows;\n if ($result === -1) { // There was an error. It didn't execute.\n $ref_status_text = 'error';\n return false;\n } else if ($result === false) { // This isn't spec'd but test anyway.\n $ref_status_text = 'false';\n return false;\n } else if ($result === 0) { // No record was found. No error.\n $ref_status_text = 'zero';\n return null;\n } else {\n $ref_status_text = 'number'; // Record was updated\n return $result;\n }\n } else {\n $meta = $sth->result_metadata();\n \n // http://us2.php.net/manual/en/mysqli-result.fetch-field.php\n // Returns the definition of one column of a result set as an object. Call \n // this function repeatedly to retrieve information about all columns in the result set. \n while ( $field = $meta->fetch_field() ) {\n $parameters[] = &$row[$field->name];\n } \n \n if (!$rtn = call_user_func_array(array($sth, 'bind_result'), refValues($parameters))) {\n if (isset($sth->error)) {\n formatSessionMessage(\"runSql() call_user_func_array() bind_result error: \", 'danger', $msg, \"mpdb-3253 \" . $sth->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n } elseif ($rtn === false) {\n formatSessionMessage(\"runSql() call_user_func_array() false \", 'danger', $msg, \"mpdb-3260\");\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n formatSessionMessage(\"runSql() call_user_func_array() unknown error \", 'danger', $msg, 'mpdb-3267');\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n \n while ( $sth->fetch() ) { \n $x = array(); \n foreach( $row as $key => $val ) { \n $x[$key] = $val; \n } \n $results[] = $x; \n }\n $result = (isset($results)) ? $results : null; // Nothing? Returns null;\n }\n\n } catch (mysqli_sql_exception $e) {\n $ermsg = \"\n runSql() mysqli_sql_exception \\n\n sql: $mysql \\n\\n\n MYSQL ERROR TO STRING: \" . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n } catch (exception $e) {\n $ermsg = \"\n runSql() exception \\n\n sql: $mysql \\n\\n\n exception: \" . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n }\n \n @ $sth->close();\n @ $conn->close();\n \n return $result;\n\n}", "function query($query){\n\t\tif(!$this->ready){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$return_val = 0;\n\t\t$this->flush();\n\t\n\t\t// Log how the function was called\n\t\t$this->func_call = \"\\$db->query(\\\"$query\\\")\";\n\t\n\t\t// Keep track of the last query for debug..\n\t\t$this->last_query = $query;\n\t\n\t\tif(defined('SQ_DEBUG') && SQ_DEBUG){\n\t\t\t$this->timer_start();\n\t\t}\n\t\n\t\t$this->result = @mysql_query($query, $this->dbh);\n\t\t$this->num_queries++;\n\t\n\t\tif(defined('SQ_DEBUG') && SQ_DEBUG){\n\t\t\t$this->queries[] = array($query, $this->timer_stop(), $this->get_caller());\n\t\t}\n\t\n\t\t// If there is an error then take note of it..\n\t\tif($this->last_error = mysql_error( $this->dbh )){\n\t\t\tthrow(new SQ_Exception($this->last_error, SQ_MYSQL_ERROR_CODE));\n\t\t}\n\t\n\t\tif(preg_match( '/^\\s*(create|alter|truncate|drop) /i', $query)){\n\t\t\t$return_val = $this->result;\n\t\t}elseif(preg_match( '/^\\s*(insert|delete|update|replace) /i', $query)){\n\t\t\t$this->rows_affected = mysql_affected_rows( $this->dbh );\n\t\t\t// Take note of the insert_id\n\t\t\tif(preg_match('/^\\s*(insert|replace) /i', $query)){\n\t\t\t\t$this->insert_id = mysql_insert_id($this->dbh);\n\t\t\t}\n\t\t\t// Return number of rows affected\n\t\t\t$return_val = $this->rows_affected;\n\t\t}else{\n\t\t\t// Select...\n\t\t\t$i = 0;\n\t\t\twhile($i < @mysql_num_fields( $this->result )){\n\t\t\t\t$this->col_info[$i] = @mysql_fetch_field( $this->result );\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$num_rows = 0;\n\t\t\twhile($row = @mysql_fetch_object( $this->result)){\n\t\t\t\t$this->last_result[$num_rows] = $row;\n\t\t\t\t$num_rows++;\n\t\t\t}\n\t\n\t\t\t@mysql_free_result($this->result);\n\t\n\t\t\t// Log number of rows the query returned\n\t\t\t// and return number of rows selected\n\t\t\t$this->num_rows = $num_rows;\n\t\t\t$return_val = $num_rows;\n\t\t}\n\n\t\treturn $return_val;\n\t}", "function mysql_fetch_all($result) {\n\t\t$rows = array();\n\t\twhile( ($r = mysql_fetch_array($result)) != null ) {\n\t\t\t$rows[] = $r;\n\t\t}\n\t\treturn $rows;\n\t}", "function database_query($database_query)\n {\n // EXECUTE QUERY\n $query_timer_start = getmicrotime();\n $query_result = mysql_query($database_query, $this->database_connection);\n $query_timer_end = getmicrotime();\n $query_timer_total = round($query_timer_end-$query_timer_start, 7);\n \n // LAST QUERY INFO\n $this->_last_query = $database_query;\n $this->_last_resource = $query_result;\n\t \n // RETURN IF NOT LOGGING STATS\n switch( TRUE )\n {\n case (!$this->log_stats):\n case ( $query_result && (SE_DATABASE_LOG_SUCCESS & ~ $this->log_trigger)):\n case (!$query_result && (SE_DATABASE_LOG_FAIL & ~ $this->log_trigger)):\n case ($query_timer_total< $this->log_slow_threshold && (SE_DATABASE_LOG_FAST & ~ $this->log_trigger)):\n case ($query_timer_total>=$this->log_slow_threshold && (SE_DATABASE_LOG_SLOW & ~ $this->log_trigger)):\n return $query_result;\n break;\n }\n \n \n // STATS\n $log_data = array('index' => count($this->log_data));\n $this->log_data_totals['total']++;\n \n // QUERY\n if( $this->log_options & SE_DATABASE_LOGOPTS_QUERY )\n {\n // When making hash, remove timestamps\n $log_data['query_hash'] = md5(preg_replace('/\\d{10}/', '', $database_query));\n $log_data['query'] = $database_query;\n }\n \n // TIME\n if( $this->log_options & SE_DATABASE_LOGOPTS_TIME )\n {\n $log_data['time'] = $query_timer_total;\n $this->log_data_totals['time'] += $query_timer_total;\n }\n \n // BACKTRACE\n if( $this->log_options & SE_DATABASE_LOGOPTS_BACKTRACE )\n {\n $backtrace = debug_backtrace();\n foreach( $backtrace as $backtrace_index=>$single_backtrace )\n if( !empty($backtrace[$backtrace_index]['file']) )\n $backtrace[$backtrace_index]['file_short'] = str_replace($this->root_folder, '', $backtrace[$backtrace_index]['file']);\n \n $log_data['backtrace'] = &$backtrace;\n }\n \n // RESULT\n if( $this->log_options & SE_DATABASE_LOGOPTS_RESULT )\n {\n $log_data['result'] = ( $query_result ? TRUE : FALSE );\n \n if( $query_result )\n $this->log_data_totals['success']++;\n else\n $this->log_data_totals['failed']++;\n }\n \n // COUNT\n if( $this->log_options & SE_DATABASE_LOGOPTS_COUNT )\n {\n $result_count = 0;\n \n if( $query_result && !$result_count )\n $result_count = $this->database_affected_rows();\n \n if( $query_result && !$result_count )\n $result_count = $this->database_num_rows($query_result);\n \n $log_data['count'] = $result_count;\n }\n \n // GET ERROR\n if( $this->log_options & SE_DATABASE_LOGOPTS_ERROR )\n {\n $log_data['error'] = ( $query_result ? FALSE : $this->database_error() );\n }\n \n // GET THRESHOLD COLOR\n foreach( $this->query_thresholds as $threshold_time=>$threshold_color )\n {\n if( (float)$query_timer_total>(float)$threshold_time )\n continue;\n \n $log_data['color'] = $threshold_color;\n break;\n }\n \n // ADD TO LOG\n $this->log_data[] = $log_data;\n \n // RETURN\n\t return $query_result;\n\t}", "function eeps_MySQL_doQueryWithoutResult($db, $query, $params)\n{\n $out = null;\n\n try {\n $sth = $db->prepare($query); // $sth = statement handle\n $out = $sth->execute($params);\n } catch (PDOException $e) {\n error_log(\"--- eeps MySQL preparation or execution error \" . $e->getMessage());\n die();\n }\n return $out; // exit status of command\n}", "private function collectGarbage() {\n\t\t$query = 'DELETE FROM ' .//'DELETE LOW_PRIORITY FROM ' .\n\t\t\tShelveIt::$query_cache[ 'table' ] .\n\t\t\t' WHERE time < NOW() - ' . ShelveIt::$query_cache[ 'expire' ];\n \n\t\tif( !mysql_unbuffered_query( $query, $this->mysql ) ) {\n die( \"Garbage collect query: $query<br />\" .\n 'Invalid query: ' . mysql_error( $this->mysql ) );\n };\n\t}", "function execute($link, $sql)\n\t{\n\t\t// mo ket noi\n\t\t$link = connect_server();\n\t\t// xu ly\n\t\t$obj = mysqli_query($link, $sql);\n\t\t// dong ket noi\n\t\tclose_server($link);\n\t\treturn $obj;\n\t}", "function useDatabase($conn,$queryString)\r\n{\r\n// $result = mysql_query ($queryString);\r\n$result = mysqli_query($conn, $queryString);\r\n//Return result - needs to be processed using the\r\nreturn $result;\r\n}", "private function load_buffered()\n {\n }", "public function flushQuery()\n\t{\n\t\t$this->cur_query = \"\";\n\t}" ]
[ "0.7463709", "0.569709", "0.5610926", "0.5581945", "0.5332439", "0.52954394", "0.5255968", "0.5238933", "0.51850665", "0.5182216", "0.5169595", "0.5162802", "0.51199305", "0.5076579", "0.50459266", "0.5033574", "0.5032372", "0.5021453", "0.4992364", "0.4958785", "0.49527153", "0.49357042", "0.4931789", "0.49261132", "0.48959598", "0.48764908", "0.48753992", "0.48486227", "0.48331034", "0.481937", "0.47914985", "0.47914395", "0.47846937", "0.47439724", "0.47370714", "0.47185534", "0.47166473", "0.47161528", "0.47148904", "0.47141424", "0.47043896", "0.46998683", "0.46850175", "0.4683201", "0.46748313", "0.46747676", "0.46709868", "0.4661948", "0.46318883", "0.46270165", "0.46095657", "0.45945355", "0.4564286", "0.45578754", "0.45537895", "0.45473123", "0.4542928", "0.453234", "0.45309475", "0.4525995", "0.4523964", "0.4516892", "0.45065472", "0.45060426", "0.45032537", "0.448673", "0.44741356", "0.44712365", "0.44666284", "0.44580537", "0.44552332", "0.44365793", "0.44350842", "0.4426372", "0.44205856", "0.44127434", "0.43985298", "0.4395871", "0.43951252", "0.4391487", "0.4388251", "0.43873596", "0.43834627", "0.43774888", "0.43767715", "0.4374945", "0.43686417", "0.43652818", "0.43565983", "0.43542475", "0.43399465", "0.4334443", "0.43333107", "0.4327282", "0.43175203", "0.43157986", "0.43155807", "0.43106234", "0.430766", "0.43072465" ]
0.8133146
0
Create a new Script tag.
public function __construct($type = null, $src = null, $content = null) { parent::__construct('script'); $this->type($type); $this->src($src); $this->content($content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create($scriptName = null);", "function scripttag ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tscripttag');\n return $rc->newInstanceArgs( $arguments ); \n}", "function script($body, $attribute = array()){\r\n\t\t$attribute = $this->convertStringAtt($attribute);\r\n\t\t$attribute['type'] = \"text/javascript\";\r\n\t\t\r\n\t\t$head = false;\r\n\t\tif(isset($attribute['head'])){\r\n\t\t\t$head = true;\r\n\t\t\tunset($attribute['head']);\r\n\t\t}\r\n\t\tif(isset($attribute['src'])){\r\n $attribute['src'] = str_replace('{ROOT_VIRTUAL}', BASIC::init()->ini_get('root_virtual'), $attribute['src']);\r\n\t\t}\r\n\t\tif($head){\r\n\t\t\t$this->head(null, 'script', $attribute, $body); return '';\r\n\t\t}\r\n\t\t$tmp = '';\r\n\t\tif($body && $body != ' ' && isset($attribute['src'])){\r\n\t\t\t$att = $attribute; unset($att['src']);\r\n\t\t\t$tmp .= $this->createTag('script',$att,$body);\r\n\t\t\t$body = ' ';\r\n\t\t}\r\n\t\t$tmp .= $this->createTag('script', $attribute, $body);\r\n\t\t\r\n\t\treturn $tmp;\r\n\t}", "public function addScript(string $name, string $src, array $attributes = [], string $placement = Meta::PLACEMENT_FOOTER);", "function pushScript ($script) {\n\t\t$this->_roof[\"cuerpo\"][] = \"<script type=\\\"text/javascript\\\" src=\\\"\".$script.\"\\\"></script>\";\n\t}", "abstract public function register_script();", "abstract public function addScript($file = '', $options = array(), $attribs = array());", "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 static function customScript( $script ) {\n\t\t$tag = \"<script type=\\\"text/javascript\\\">\\n//<![CDATA[\\n\";\n\t\t$tag .= \"$script\\n\";\n\t\t$tag .= \"\\n//]]>\\n</script>\\n\";\n\t\treturn $tag;\n\t}", "function addScriptTags($text) {\n\t// local variables used to execute this task\n\t$tag_content_start = 0;\n\t$tag_end = 0;\n\t$strs_final = array(\"color_coded\" => \"\", \"script\" => \"\");\n\t$str_temp = \"\";\n\t$re_function_declaration = \"/(function[\\t ]+)(\\w+[\\t ]*)\\(([^\\)]*)\\)([\\t ]*{)/i\";\n\t$re_key_word = \"/([\\w])?(new|while|for|break|continue|try|catch|return|if|else|typeof)([^\\w])/i\";\n\t$re_math_operator = \"/([^<])(\\++|\\-+|\\*|\\/)/i\";\n\t$re_logic_operator = \"/(&&|\\|\\||!=|={1,3}|<|>)/i\";\n\t$re_object = \"/(Object|var|document)/i\";\n\t$re_value = \"/(\\d|true|false|null)/i\";\n\t$re_method = \"/\\.(\\w+)/i\";\n\t$re_js_string = \"/(\\\"[^\\\"]*\\\")/i\";\n\t$re_js_regexp = \"/([^<>])(\\/[^\\/]+\\/[gmi]*)/i\";\n\n\t// loop while there are script tags to process\n\twhile (preg_match(\"/\\<script[^\\<]*\\>/i\", $text, $regex_matches, PREG_OFFSET_CAPTURE) !== false && !empty($regex_matches)) {\n\t\t// get the index of the character after this opening tag\n\t\t$tag_content_start = $regex_matches[0][1] + strlen($regex_matches[0][0]);\n\n\t\t// add the text between the last processed tag and the start of this style tag\n\t\t$strs_final[\"color_coded\"] .= substr($text, 0, $regex_matches[0][1]);\n\n\t\t// find the index of the next closing script tag\n\t\t$tag_end = strpos($text, \"</script>\", $tag_content_start);\n\n\t\t// check if a closing script tag was found\n\t\tif ($tag_end === false) {\n\t\t\t// it wasn't\n\t\t\t// assume the tag goes to the end of the text\n\t\t\t$tag_end = strlen($text);\n\t\t}\n\n\t\t// get the text inside this script tag\n\t\t$str_temp = substr($text, $tag_content_start, $tag_end - $tag_content_start);\n\n\t\t// store this tag's content without the color coding tags\n\t\t// ony add function declarations --> no function calls\n\t\t$strs_final[\"script\"] .= processScriptText($re_function_declaration, $str_temp);\n\n\t\t// add the logic operator spans\n\t\t$str_temp = preg_replace($re_logic_operator, \"<span class='js_logicoperator'>$1</span>\", $str_temp);\n\n\t\t// add the math operator spans\n\t\t$str_temp = preg_replace($re_math_operator, \"$1<span class='js_mathoperator'>$2</span>\", $str_temp);\n\n\t\t// add the function declaration spans\n\t\t$str_temp = preg_replace($re_function_declaration, \"<span class='js_func_word'>$1</span><span class='js_func_name'>$2</span>(<span class='js_func_param'>$3</span>)$4\", $str_temp);\n\n\t\t// add the keyWord spans\n\t\t$str_temp = preg_replace($re_key_word, \"$1<span class='js_keyword'>$2</span>$3\", $str_temp);\n\n\t\t// add the object spans\n\t\t$str_temp = preg_replace($re_object, \"<span class='js_object'>$1</span>\", $str_temp);\n\n\t\t// add the value spans\n\t\t$str_temp = preg_replace($re_value, \"<span class='js_value'>$1</span>\", $str_temp);\n\n\t\t// add the method spans\n\t\t$str_temp = preg_replace($re_method, \".<span class='js_method'>$1</span>\", $str_temp);\n\n\t\t// remove the math operator span tag from the / with the meaning of start and end of a regexp\n\t\t$str_temp = preg_replace(\"/<span class='js_mathoperator'\\s*>\\/<\\/span>([^\\/]+)<span class='js_mathoperator'\\s*>\\/<\\/span>([gmi]*)/i\", \"/$1/$2\", $str_temp);\n\n\t\t// stores the tag identifiers that need to be processed with special treatment\n\t\t$regex_keys = [\"js_regexp\", \"js_string\"];\n\n\t\t// stores the replacement regex string for the values of regex_keys\n\t\t$regex_strings = [\n\t\t\t\"$1<span class='js_regexp'>$2</span>\",\n\t\t\t\"<span class='js_string'>$1</span>\"\n\t\t];\n\n\t\t// loop through the relevant tag identifiers in the stated order\n\t\tfor ($i = 0; $i < count($regex_keys); $i++) {\n\t\t\t// get this iteration's tag identifier\n\t\t\t$regex_key = $regex_keys[$i];\n\n\t\t\t// stores the processed chunk of text as its being cleaned up below\n\t\t\t$str_aux = \"\";\n\n\t\t\t// get the regex match object for the existance of this tag in the text\n\t\t\t$re_match = null;\n\n\t\t\t// loop while there are tags to process in the text\n\t\t\twhile (preg_match(${\"re_\".$regex_key}, $str_temp, $re_match, PREG_OFFSET_CAPTURE) !== false && !empty($re_match)) {\n\t\t\t\t$str_aux .= substr($str_temp, 0, $re_match[0][1]);\n\n\t\t\t\t// for the text inside this tag, remove any other color coding span tags from previous steps\n\t\t\t\t// and finaly add this tag's color coding spans\n\t\t\t\t$str_aux .= preg_replace(\n\t\t\t\t\t${\"re_\".$regex_key},\n\t\t\t\t\t$regex_strings[$i],\n\t\t\t\t\tpreg_replace_callback(\n\t\t\t\t\t\t${\"re_\".$regex_key},\n\t\t\t\t\t\tfunction($regex_matches) {\n\t\t\t\t\t\t\t// explicitely remove any js_mathoperator span tags that may have been placed around other html tags\n\t\t\t\t\t\t\treturn(preg_replace(\n\t\t\t\t\t\t\t\t\"/<span\\s+class='(css|js)_\\w+'\\s*>([^>]*)<\\/span>/i\",\n\t\t\t\t\t\t\t\t\"$2\",\n\t\t\t\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t\t\t\t\"/<span class='js_mathoperator'\\s*>([<>]+)<\\/span>/i\",\n\t\t\t\t\t\t\t\t\t\"$1\",\n\t\t\t\t\t\t\t\t\t$regex_matches[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\tsubstr($str_temp, $re_match[0][1], strlen($re_match[0][0]))\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t// remove the processed text from the non-processed text\n\t\t\t\t$str_temp = substr($str_temp, $re_match[0][1] + strlen($re_match[0][0]));\n\t\t\t}\n\n\t\t\t// add any final characters that didn't need to be processed\n\t\t\t$str_aux .= $str_temp;\n\n\t\t\t// store the processed text\n\t\t\t$str_temp = $str_aux;\n\t\t}\n\n\t\t// add the new script tag content\n\t\t$strs_final[\"color_coded\"] .= $str_temp;\n\n\t\t// remove this tag's content from the text to process\n\t\t$text = substr($text, $tag_end + 9);\n\t}\n\n\t// add any text after the last processed script tag to the final string\n\t$strs_final[\"color_coded\"] .= $text;\n\n\treturn($strs_final);\n}", "public static function script($url, $attributes = array()) {\n\t\t$url = URL::to_asset($url);\n\t\treturn '<script src=\"'.$url.'\"'.static::attributes($attributes).'></script>'.PHP_EOL;\n\t}", "function script()\n {\n }", "public function addScript($new)\n {\n $this->_scripts .= $new;\n }", "public function add_script($script)\n\t{\n if ( is_object($this->obj) ){\n if ( !isset($this->obj->script) ){\n $this->obj->script = '';\n }\n $this->obj->script .= $script;\n }\n\t\treturn $this;\n\t}", "public function store(ScriptCreateRequest $request)\n {\n try{\n $data = $request->validated();\n $name = $data['name'];\n $path = $data['path'] ?? null;\n $custom_script = $data['aws_custom_script'];\n $parameters = $data['parameters'] ?? null;\n\n $random = GeneratorID::generate();\n $folderName = \"scripts/{$random}\";\n\n if(!empty($custom_script)) {\n $parameters = S3BucketHelper::extractParamsFromScript($custom_script);\n }\n\n if(empty($path)) {\n $path = Str::slug($name, '_') . '.custom.js';\n }\n\n $script = Script::create([\n 'name' => $name,\n 'description' => $data['description'],\n 'parameters' => $parameters,\n 'path' => $path,\n 's3_path' => $folderName,\n 'type' => $data['type'],\n ]);\n\n if (empty($script)) {\n return $this->error(__('user.server_error'), __('user.scripts.error_create'));\n }\n\n S3BucketHelper::updateOrCreateFilesS3(\n $script,\n Storage::disk('s3'),\n $custom_script,\n $data['aws_custom_package_json'],\n );\n\n $this->addTagsToScript($script, $data['tags']);\n $this->addUsersToScript($script, $data['users']);\n\n return $this->success([\n 'id' => $script->id ?? null\n ], __('user.scripts.success_create'));\n\n } catch(Throwable $throwable) {\n return $this->error(__('user.server_error'), $throwable->getMessage());\n }\n }", "public function setScript($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(2, $var);\n\n return $this;\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}", "public function registerScript(/*string*/ $scriptSrc);", "function add_myscript(){\n}", "private function addScripts() {\n global $CFG; \n $script = \"<script type=\\\"text/javascript\\\">\n jQuery(document).ready(function() {\n codeActivity.initEdit(); \n codeActivity.ajaxURL = '\" . $CFG->wwwroot . \"/mod/codeactivity/ajax.php';\n codeActivity.lang = {\n empty_name: '\" . addslashes(get_string('js_empty_name', 'codeactivity')) . \"',\n empty_test_code: '\" . addslashes(get_string('js_empty_test_code', 'codeactivity')).\"',\n error_add: '\" . addslashes(get_string('js_error_add', 'codeactivity')).\"',\n error_delete: '\" . addslashes(get_string('js_error_delete', 'codeactivity')).\"',\n error_forbidden: '\" . addslashes(get_string('js_error_forbidden', 'codeactivity')).\"'\n }\n });\n </script>\";\n \n $this->_form->addElement('html', $script);\n }", "protected function makeScriptTag($url)\n {\n return sprintf('<script type=\"module\" src=\"%s\"></script>', $url);\n }", "public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }", "public function add_script($script)\n {\n $this->_scripts[] = $script;\n }", "public function createScript($script_body)\n {\n list($response) = $this->createScriptWithHttpInfo($script_body);\n return $response;\n }", "function Get_CreateScript()\r\n\t{\r\n\t\treturn $this->_createScript;\r\n\t}", "public function addScript($js) {\r\n $this->body[] = self::getScript($js);\r\n }", "private function javascript_tag($filename){\n $src = ($this->is_remote($filename)) ?\n $filename :\n $this->js_path() . '/' . self::extensionize($filename, 'js');\n \n return $this->wrap(\"<script src=\\\"$src\\\"></script>\");\n }", "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}", "public function withScript(ScriptElement $script, $scope = 'header');", "function script()\n {\n return '<script type=\"text/javascript\" src=\"' . $this->URL . '\"></script>';\n }", "function green_shortcodes_vc_add_init_script($output, $tag='', $atts=array(), $content='') {\n\t\tif ( (isset($_GET['vc_editable']) && $_GET['vc_editable']=='true') && (isset($_POST['action']) && $_POST['action']=='vc_load_shortcode')\n\t\t\t\t&& ( isset($_POST['shortcodes'][0]['tag']) && $_POST['shortcodes'][0]['tag']==$tag )\n\t\t) {\n\t\t\tif (green_strpos($output, 'green_vc_init_shortcodes')===false) {\n\t\t\t\t$id = \"green_vc_init_shortcodes_\".str_replace('.', '', mt_rand());\n\t\t\t\t$output .= '\n\t\t\t\t\t<script id=\"'.esc_attr($id).'\">\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tgreen_init_post_formats();\n\t\t\t\t\t\t\tgreen_init_shortcodes(jQuery(\"body\").eq(0));\n\t\t\t\t\t\t\tgreen_scroll_actions();\n\t\t\t\t\t\t} catch (e) { };\n\t\t\t\t\t</script>\n\t\t\t\t';\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "public function script($url, $attr = array())\n\t{\n\t\t$attr = array_merge(array('type' => 'text/javascript'), $attr);\n\t\t$attr['src'] = $url;\n\t\t\n\t\treturn $this->e('script', '', $attr).PHP_EOL;\n\t}", "public static function script( string $handle ): self {\n\t\treturn new self( $handle, 'script' );\n\t}", "public function addScript ($src, $attributes = array ())\n\t{\n\n\t\t$html = \"\\n<script src=\\\"$src\\\"\";\n\t\tif ($attributes) {\n\t\t\t$html .= $this -> addAttributes($attributes);\n\t\t}\n\t\t$html .= \"></script>\";\n\n\t\treturn $html;\n\n\t}", "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}", "public function endScript() {\r\n if (self::$lastId != null && self::$lastId == $this->id)\r\n {\r\n $this->script .= preg_replace('/\\s*<\\/?script(.*)>\\s*/i', '', ob_get_clean());\r\n } else\r\n {\r\n $this->script = preg_replace('/\\s*<\\/?script(.*)>\\s*/i', '', ob_get_clean());\r\n }\r\n \r\n Yii::$app->getView()->registerJs($this->script, $this->position, $this->id);\r\n self::$lastId = $this->id;\r\n }", "public static function script($url, $attributes = [ ], $secure = null)\n {\n $attributes[ 'src' ] = static::url()->asset($url, $secure);\n\n return '<script' . static::attributes($attributes) . '></script>' . PHP_EOL;\n }", "public function addScript($src)\n {\n $this->scriptElements .= \"<script src ='$src'></script>\";\n }", "protected function registerClientScript()\n\t{\n\t\t// Prepare script package.\n\t\t$this->package = array_merge(array(\n\t\t\t\t'baseUrl' => $this->getAssetsUrl(),\n\t\t\t\t'js' => array(\n\t\t\t\t\tYII_DEBUG ? 'jquery.textmistake.js' : 'jquery.textmistake.min.js',\n\t\t\t\t),\n\t\t\t\t'depends' => array(\n\t\t\t\t\t'jquery',\n\t\t\t\t),\n\t\t\t), $this->package);\n\n\t\t$clientScript = Yii::app()->getClientScript();\n\t\t$options = CJavaScript::encode($this->options);\n\n\t\t$clientScript\n\t\t\t->addPackage(self::PACKAGE_ID, $this->package)\n\t\t\t->registerPackage(self::PACKAGE_ID)\n\t\t\t->registerScript(\n\t\t\t\t$this->id,\n 'jQuery(document).textmistake('.$options.');',\n\t\t\t\tCClientScript::POS_READY\n\t\t\t);\n\t}", "function Set_CreateScript($createScript)\r\n\t{\r\n\t\t$this->_createScript = $createScript;\r\n\t}", "public function __construct(string $script)\n {\n $this->script = $script;\n }", "public function create()\n {\n $tag = new Tag();\n $this->vars['tag'] = $tag;\n $this->title = __('system.tag_add');\n $this->template = 'admin.tag';\n \n return $this->renderOutput();\n }", "public function getScript()\n {\n if ($this->script == null) {\n $this->script = new Script();\n }\n\n return $this->script;\n }", "function wp_add_inline_script($handle, $data, $position = 'after')\n {\n }", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[attributes]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "public function getScript()\n {\n if ($this->script == null) {\n $this->script = new Script($this->getScriptBuf());\n }\n\n return $this->script;\n }", "function addScript($node, $filenames) {\n\t$script = $node->addChild('script', '');\n\tforeach ($filenames as $filename) {\n\t\t$script->addChild('file', $filename);\n\t}\n}", "function addScript($script, $arg, $max_execution_time = 300)\n {\n $this->scripts[] = array(\"script_name\" => $script, \"arg\"=>$arg, \"max_execution_time\" => $max_execution_time);\n }", "public function generate_tag($contents)\n\t{\n\t\t$s = '';\n\t\t\n\t\tif ($contents)\n\t\t{\n\t\t\t$s = '<script type=\"text/javascript\">'\n\t\t\t\t\t.$contents\n\t\t\t\t.'</script>';\n\t\t}\n\t\t\n\t\treturn $s;\n\t}", "public function AddScript($scriptName) {\n \t\t$this->_headScript[] = $scriptName;\n \t}", "public static function get_script(){\r\n\t\t\treturn '<script src=\"https://www.google.com/jsapi\"></script>';\r\n\t\t}", "public function script($filename, $async = true)\n\t{\n\t\t$scriptTag = '<script ';\n\t\tif ($async) {\n\t\t\t$scriptTag .= 'async';\n\t\t}\n\t\t$scriptTag .= ' src=\"';\n\t\t$scriptTag .= $this->staticDomain.'/js/'.$filename;\n\t\t$scriptTag .= '\"></script>';\n\t\treturn $scriptTag;\n\t}", "public function addScript($script) {\n if (!in_array($script, (array)$this->scripts, true)) {\n $this->scripts[] = $script;\n }\n }", "private function _build_js_tag($data)\n\t{\n\t\treturn '<script ' . $this->_assets_attributes($data['attributes']) . '></script>';\n\t}", "function script_tag($src = '', bool $indexPage = false): string\n {\n $cspNonce = csp_script_nonce();\n $cspNonce = $cspNonce ? ' ' . $cspNonce : $cspNonce;\n $script = '<script' . $cspNonce . ' ';\n if (! is_array($src)) {\n $src = ['src' => $src];\n }\n\n foreach ($src as $k => $v) {\n if ($k === 'src' && ! preg_match('#^([a-z]+:)?//#i', $v)) {\n if ($indexPage === true) {\n $script .= 'src=\"' . site_url($v) . '\" ';\n } else {\n $script .= 'src=\"' . slash_item('baseURL') . $v . '\" ';\n }\n } else {\n // for attributes without values, like async or defer, use NULL.\n $script .= $k . (null === $v ? ' ' : '=\"' . $v . '\" ');\n }\n }\n\n return rtrim($script) . '></script>';\n }", "public function registerScript($source, $isHead=true)\n {\n $this->styleScripts[] = [\n 'isHead'=>$isHead,\n 'body'=>Html::script($source)\n ];\n }", "function js_tag($file, $dir = 'javascripts', $version = OMEKA_VERSION)\n{\n $href = src($file, $dir, 'js', $version);\n return '<script type=\"text/javascript\" src=\"' . html_escape($href) . '\" charset=\"utf-8\"></script>';\n}", "protected function addScript($scriptFile = false){\n\t\tif($scriptFile){\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'js' . DS . $scriptFile . '.js';\n\t\t\t$scriptFile = Safan::app()->resourceUrl . DS . 'js' . DS . $scriptFile . '.js';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->scripts[] = $scriptFile;\n\t\t}\n\t\telse{\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'js' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.script.js';\n\t\t\t$moduleScript = Safan::app()->resourceUrl . DS . 'js' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.script.js';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->scripts[] = $moduleScript;\n\t\t}\n\t}", "public static function create($name, $script)\n {\n $object = get_class(self::$driver);\n //\n return $object::create($name, $script);\n }", "function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {\r\n\tglobal $wp_scripts;\r\n\tif ( !is_a($wp_scripts, 'WP_Scripts') )\r\n\t\t$wp_scripts = new WP_Scripts();\r\n\r\n\t$wp_scripts->add( $handle, $src, $deps, $ver );\r\n\tif ( $in_footer )\r\n\t\t$wp_scripts->add_data( $handle, 'group', 1 );\r\n}", "public function addScript(Atomik_Db_Script_Interface $script)\n\t{\n\t\t$this->_scripts[] = $script;\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}", "protected function registerClientScript()\n {\n $id = $this->options['id'];\n $view = $this->getView();\n ChartJsAsset::register($view);\n\n $config = Json::encode(\n [\n 'type' => $this->type,\n 'data' => $this->data ?: new JsExpression('{}'),\n 'options' => $this->clientOptions ?: new JsExpression('{}'),\n 'plugins' => $this->plugins\n ]\n );\n\n $js = \";var chartJS_{$id} = new Chart($('#{$id}'),{$config});\";\n $view->registerJs($js);\n }", "public function createScriptAsync($script_body)\n {\n return $this->createScriptAsyncWithHttpInfo($script_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function wp_add_inline_script( $handle, $data, $position = 'after' ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );\n\n\tif ( false !== stripos( $data, '</script>' ) ) {\n\t\t_doing_it_wrong( __FUNCTION__, sprintf(\n\t\t\t/* translators: 1: <script>, 2: wp_add_inline_script() */\n\t\t\t__( 'Do not pass %1$s tags to %2$s.' ),\n\t\t\t'<code>&lt;script&gt;</code>',\n\t\t\t'<code>wp_add_inline_script()</code>'\n\t\t), '4.5.0' );\n\t\t$data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );\n\t}\n\n\treturn wp_scripts()->add_inline_script( $handle, $data, $position );\n}", "public static function add($name, $script)\n {\n return self::$driver->add($name, $script);\n }", "public static function script($script, $index = FALSE)\n\t{\n\t\t$compiled = '';\n\n\t\tif (is_array($script))\n\t\t{\n\t\t\tforeach($script as $name)\n\t\t\t{\n\t\t\t\t$compiled .= html::script($name, $index);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Add the suffix only when it's not already present\n\t\t\t$suffix = (strpos($script, '.js') === FALSE) ? '.js' : '';\n\t\t\t$compiled = '<script type=\"text/javascript\" src=\"'.url::base((bool) $index).$script.$suffix.'\"></script>';\n\t\t}\n\n\t\treturn $compiled.\"\\n\";\n\t}", "protected function generateJavascript() {}", "protected function generateJavascript() {}", "public function addScriptWrapper() {\n if ($this->doAddScript) {\n $this->addScript();\n }\n }", "public function addScriptDeclaration($content, $type = 'text/javascript')\n\t{\n\t\tif (!isset($this->_script[strtolower($type)]))\n\t\t{\n\t\t\t$this->_script[strtolower($type)] = array($content);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_script[strtolower($type)][] = chr(13) . $content;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function generatePage_whichScript() {}", "private function \t\t\t\tbuild_script_tags() {\n\t\t$load=array(\n\t\t\t\"assets/js/jquery/jquery-3.3.1.min.js\",\n\t\t\t\"assets/js/bootstrap/bootstrap.min.js\",\n\t\t\t// \"assets/js/fontawesome/all.min.js\",\n\t\t\t\"assets/js/app/fetch.js\",\n\t\t\t\"assets/js/app/modal.js\",\n\t\t\t\"assets/js/app/common.js\"\n\t\t);\n\n\t\treturn array_reduce(array_unique(array_merge($load, $this->section_js)), function($_acum, $_item) {\n\t\t\t$_acum.=<<<R\n\n\t\t<script type=\"text/javascript\" src=\"{$_item}\"></script>\nR;\n\t\t\treturn $_acum;\n\t\t}, '');\n\t}", "public static function createCalendarScript() {\r\n\t\t?>\r\n\t\t<script>\r\n\t\tjQuery(document).ready(function($) {\r\n\t\t\t\"use strict\";\r\n\r\n\t\t\tvar datepickerSettings = {\r\n\t\t\t\t\tdateFormat: 'yy-mm-dd',\r\n\r\n\t\t\t\t\tbeforeShow: function(input, inst) {\r\n\t\t\t\t\t\t$('#ui-datepicker-div').addClass('tf-date-datepicker');\r\n\r\n\t\t\t\t\t\t// Fix the button styles\r\n\t\t\t\t\t\tsetTimeout( function() {\r\n\t\t\t\t\t\t\tjQuery('#ui-datepicker-div')\r\n\t\t\t\t\t\t\t.find('[type=button]').addClass('button').end()\r\n\t\t\t\t\t\t\t.find('.ui-datepicker-close[type=button]').addClass('button-primary');\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t},\r\n\r\n\t\t\t\t\t// Fix the button styles\r\n\t\t\t\t\tonChangeMonthYear: function() {\r\n\t\t\t\t\t\tsetTimeout( function() {\r\n\t\t\t\t\t\t\tjQuery('#ui-datepicker-div')\r\n\t\t\t\t\t\t\t.find('[type=button]').addClass('button').end()\r\n\t\t\t\t\t\t\t.find('.ui-datepicker-close[type=button]').addClass('button-primary');\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t$('.tf-date input[type=text]').each(function() {\r\n\t\t\t\tvar $this = $(this);\r\n\t\t\t\tif ( $this.hasClass('date') && ! $this.hasClass('time') ) {\r\n\t\t\t\t\t$this.datepicker( datepickerSettings );\r\n\t\t\t\t} else if ( ! $this.hasClass('date') && $this.hasClass('time') ) {\r\n\t\t\t\t\t$this.timepicker( datepickerSettings );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this.datetimepicker( datepickerSettings );\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t</script>\r\n\t\t<?php\r\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 }", "public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyString('VariableList', '[]');\n\n //Scripts\n $this->RegisterScript('TurnOff', $this->Translate('Turn Off'), \"<?php\\n\\nAL_SwitchOff(IPS_GetParent(\\$_IPS['SELF']));\");\n }", "public function add_script ($url) {\r\n\t\treturn $this->set(self::SCRIPTS, $url);\r\n\t}", "public function addScript( $src ) {\n $script = html( \"script\" )->attr( \"src\", $src )->attr( \"type\", \"text/javascript\" );\n $this->scripts .= $script->asHTML();\n return $this;\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 AddHeadScript(Script $script){\r\n\t\t$this->head->AddScript($script);\r\n\t}", "public function getScript(): string\n {\n return view('scripts.server.user.create', [\n 'user' => $this->user,\n ]);\n }", "public function renderScript()\n {\n }", "protected function create_javascript_include($filepath, $attributes)\n\t{\n\t\t$tag = '<script src=\"' . $this->getUrlPath($filepath, 'javascripts') .'\"';\n\t\tforeach ($attributes as $attribute_key => $attribute_value) {\n\t\t\t$tag .= \" $attribute_key=\\\"$attribute_value\\\"\";\n\t\t}\n\t\t$tag .= '></script>';\n\n\t\treturn $tag;\n\t}", "public function add_inline_script($handle, $data, $position = 'after')\n {\n }", "protected function createScriptRequest($script_body)\n {\n // verify the required parameter 'script_body' is set\n if ($script_body === null || (is_array($script_body) && count($script_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $script_body when calling createScript'\n );\n }\n\n $resourcePath = '/content/scripts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($script_body)) {\n $_tempBody = $script_body;\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function registerClientScript()\n {\n $js = [];\n $view = $this->getView();\n\n MarkitupAsset::register($this->getView());\n\n $this->options = array_merge($this->_defaultOptions, $this->options);\n\n $id = $this->options['id'];\n\n $js[] = \"jQuery('#{$id}').markItUp(mySettings());\";\n\n $view->registerJs(implode(\"\\n\", $js));\n }", "private function _registerScripts()\n\t{ \n $owner = $this->owner;\n if($this->app_id===null || $this->res_id === null)return;\n $url = $owner->createUrl('/api/public/uploadcount',array('YII_CSRF_TOKEN'=>Yii::app()->request->getCsrfToken(),'t'=>$this->res_id,'app'=>$this->app_id));\n $js = Yii::app()->getClientScript();\n $assetsUrl = $this->_getAssetsUrl();\n $js->registerScriptFile($assetsUrl.'/countupload.js'); \n $js->registerScript(\"#{$this->id}\",\"\n var url = '{$url}';\n var set = new viewCount(url);\n set.push();\n \");\n\t}", "public function add_script_js($script_js){\r\n\t\t$this->scripts .= $script_js;\r\n\t\treturn $this;\r\n\t}", "public function javascript() {\r\n\t\tif ($this->scriptable === true || $this->scriptable === 'true') {\r\n\t\t\t\r\n\t\t\tif(@$this->scriptTo) {\r\n\t\t\t\t$element = pzk_element($this->scriptTo);\r\n\t\t\t\tif($element) {\r\n\t\t\t\t\t$element->append(pzk_parse('<html.js src=\"'.BASE_URL.'/js/'.implode('/', $this->fullNames).'.js\" />'));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$page =pzk_page();\r\n\t\t\t\tif ($page) {\r\n\t\t\t\t\t$page->addObjJs($this->tagName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->jsLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.js src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/js/'.$this->jsLink.'.js\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif ($this->jsExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.js src=\"'.$this->jsExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->jsExternalLink);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "public function add_script($slug = null, $src = null, $deps = null) {\n\t\t$script = [];\n\t\t\n\t\t$script['slug'] = $slug;\n\t\t$script['src'] = $src;\n\t\t$script['deps'] = $deps;\n\t\t\n\t\tarray_push($this->scripts, $script);\n\t}", "function setScript($value){\n $this->_options['script']=CHtml::normalizeUrl($value);\n }", "protected function registerScript()\n\t{\n\t $baseUrl = Yii::app()->getHomeUrl();\n\t $js_arr = array('triggmine-scripts.js');\n\t foreach($js_arr as $filename)\n\t {\n\t Yii::app()->getClientScript()->registerScriptFile('/js/vendor/'.$filename, CClientScript::POS_END);\n\t }\n\t}", "protected function addJavaScript() {\n\t\t$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['contagged']);\n\t\t$javaScriptPathAndFilename = $extensionConfiguration['javaScriptPathAndFilename'];\n\t\tif (is_string($javaScriptPathAndFilename) && $javaScriptPathAndFilename !== '') {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData['contagged'] .= '<script src=\"' . $javaScriptPathAndFilename . '\" type=\"text/javascript\"></script>';\n\t\t}\n\t}", "public function registerClientScript($id)\n\t{\n\t\t$js=\"\n\t\t\t$(function() {\n\t\t \tconsole.log('Hello world');\n\t\t\t});\n\t\t\";\n\t\t$assets=$this->getAssets();\n\t\t$cs=Yii::app()->getClientScript();\n\t\t// $cs->registerScriptFile(\"https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=drawing\",CClientScript::POS_HEAD);\n\t\t// $cs->registerScriptFile($assets.\"/googleMap.js\",CClientScript::POS_HEAD);\n\t\t$cs->registerScript('ext.GInput#'.$id,$js,CClientScript::POS_END);\n\t}", "public function registerClientScript($id)\n\t{\n\t\t$js=\"\n\t\t\t$(function() {\n\t\t \tconsole.log('Hello world');\n\t\t\t});\n\t\t\";\n\t\t$assets=$this->getAssets();\n\t\t$cs=Yii::app()->getClientScript();\n\t\t// $cs->registerScriptFile(\"https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=drawing\",CClientScript::POS_HEAD);\n\t\t// $cs->registerScriptFile($assets.\"/googleMap.js\",CClientScript::POS_HEAD);\n\t\t$cs->registerScript('ext.GInput#'.$id,$js,CClientScript::POS_END);\n\t}", "function javascript_include_tag() {\n $sources = func_get_args();\n\n $attributes = NULL;\n if (is_array($sources[count($sources) - 1])) {\n $attributes = array_pop($sources);\n }\n\n $tags = array();\n\n foreach ($sources as $source) {\n // only http[s] or // (leading double slash to inherit the protocol)\n // are treated as absolute url\n if (!is_absolute_url($source)) {\n $source = javascript_url($source);\n if (!preg_match(\"/\\.js$/\", $source)) $source .= \".js\";\n $source = $this->asset_version($source);\n }\n $options = array(\n \"src\" => $source,\n \"type\" => \"text/javascript\"\n );\n if(is_array($attributes)){\n $options = array_merge($options, $attributes);\n }\n $tags[] = content_tag(\"script\", \"\", $options);\n }\n\n return join(\"\\n\", $tags);\n }", "public function register_scripts()\n {\n }", "protected function postScriptsRequest($script_create_request)\n {\n // verify the required parameter 'script_create_request' is set\n if ($script_create_request === null || (is_array($script_create_request) && count($script_create_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $script_create_request when calling postScripts'\n );\n }\n\n $resourcePath = '/api/v2/scripts';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($script_create_request)) {\n $_tempBody = $script_create_request;\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 ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n }\n\n $headers = array_merge(\n $headerParams,\n $headers\n );\n\n return $this->defaultApi->createRequest('POST', $resourcePath, $httpBody, $headers, $queryParams);\n }", "function asc_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {\n\tglobal $asc_scripts;\n\tif ( ! is_a( $asc_scripts, 'ASC_Scripts' ) ) {\n\t\tif ( ! did_action( 'init' ) )\n\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),\n\t\t\t\t'<code>asc_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );\n\t\t$asc_scripts = new ASC_Scripts();\n\t}\n\n\t$asc_scripts->add( $handle, $src, $deps, $ver );\n\tif ( $in_footer )\n\t\t$asc_scripts->add_data( $handle, 'group', 1 );\n}" ]
[ "0.69164854", "0.65008605", "0.63135594", "0.6305407", "0.62546134", "0.6223007", "0.6187226", "0.6157513", "0.61254126", "0.6071738", "0.6023285", "0.5984085", "0.5918233", "0.5916552", "0.5903929", "0.58988446", "0.5835239", "0.5826294", "0.5816507", "0.5796502", "0.57926905", "0.5780163", "0.567608", "0.5648325", "0.5638791", "0.5630174", "0.56122965", "0.56088585", "0.55994374", "0.55955464", "0.5592749", "0.5560794", "0.5520175", "0.5489553", "0.54867053", "0.5472416", "0.54705393", "0.5456377", "0.54519826", "0.5450674", "0.543963", "0.54316133", "0.5399928", "0.53994846", "0.5398505", "0.5387548", "0.53620297", "0.5354", "0.5324595", "0.5323389", "0.5316801", "0.5310062", "0.5309855", "0.53082985", "0.53060037", "0.53054595", "0.52893376", "0.52851695", "0.5281038", "0.526389", "0.5244692", "0.5236765", "0.5231725", "0.5226", "0.51894665", "0.51877713", "0.51846224", "0.51840293", "0.5179242", "0.5178285", "0.5171488", "0.5166738", "0.5117382", "0.509892", "0.50931513", "0.5087572", "0.5087495", "0.50777054", "0.5067685", "0.5066878", "0.5065192", "0.5064219", "0.5062578", "0.50584894", "0.5057222", "0.5051172", "0.5050776", "0.50499773", "0.5049076", "0.5045401", "0.5026555", "0.50160986", "0.5009563", "0.5006425", "0.50039697", "0.50039697", "0.500225", "0.4994619", "0.49853387", "0.49825606" ]
0.5573864
31
Defines the type attribute.
public function type($value = null){ return $this->attr(ATTR_TYPE, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeAttribute();", "public abstract function getTypeAttribute();", "public function setTypeAttribute($type)\n {\n $this->attributes['type'] = str_replace(array(' '),'_',$type);\n }", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "public function setTypeAttribute($value)\n {\n $this->attributes['type'] = $value;\n }", "protected function _attr_type( &$attributes )\n\t{\n\t\tswitch ( strtoupper( $attributes[ 'TYPE' ] ) )\n\t\t{\n\t\t\tcase 'TINYINT':\n\t\t\t\t$attributes[ 'TYPE' ] = 'SMALLINT';\n\t\t\t\t$attributes[ 'UNSIGNED' ] = FALSE;\n\n\t\t\t\treturn;\n\t\t\tcase 'MEDIUMINT':\n\t\t\t\t$attributes[ 'TYPE' ] = 'INTEGER';\n\t\t\t\t$attributes[ 'UNSIGNED' ] = FALSE;\n\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\t}", "public function setTyp( $type );", "public function setTypeAttribute($value)\n {\n if(!intval($value)){\n $this->attributes['type'] = self::typeToValue($value);\n }else{\n $this->attributes['type'] = $value;\n }\n }", "function setType($value)\n {\n $this->setAttribute(\"type\", $value);\n return $this;\n }", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setType($type) {}", "public function setType(TM_Attribute_AttributeType $value)\n {\n $this->_type = $value;\n }", "public function setType(string $type);", "function setType($type) {\n $this->type = $type;\n }", "public function setAttribute($type, $value)\n {\n $this->attributes[$type] = $value;\n }", "public function setType( $type )\n {\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "final public function type($value = null)\n {\n if( null === $value ) {\n return isset($this->_attributes['type']) ? $this->_attributes['type'] : '';\n }\n \n $this->_attributes['type'] = $value;\n return $this;\n }", "protected function _attr_type(&$attributes)\n\t{\n\t\t// Reset field lenghts for data types that don't support it\n\t\tif (isset($attributes['CONSTRAINT']) && stripos($attributes['TYPE'], 'int') !== FALSE)\n\t\t{\n\t\t\t$attributes['CONSTRAINT'] = NULL;\n\t\t}\n\n\t\tswitch (strtoupper($attributes['TYPE']))\n\t\t{\n\t\t\tcase 'TINYINT':\n\t\t\t\t$attributes['TYPE'] = 'SMALLINT';\n\t\t\t\t$attributes['UNSIGNED'] = FALSE;\n\t\t\t\treturn;\n\t\t\tcase 'MEDIUMINT':\n\t\t\t\t$attributes['TYPE'] = 'INTEGER';\n\t\t\t\t$attributes['UNSIGNED'] = FALSE;\n\t\t\t\treturn;\n\t\t\tdefault: return;\n\t\t}\n\t}", "public function setType($type)\n {\n $this['type'] = $type;\n }", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function getTypeAttribute()\n\t{\n\t\t\n\t\treturn self::getTypes()[$this->type_id] ?? \"-\";\n\t\t\n\t}", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function getType() {\n return $this->attributes['type'];\n }", "public function setType($type){ }", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function type($type);", "public function type()\n\t{\n\t\treturn Ar::type($this->attributes);\n\t}", "public function setType(string $type) {\n $this->attributes()->set('type', $type);\n return $this;\n }", "public function setType(string $type)\n {\n $this->type = $type;\n }", "function setType($a_type)\n\t{\n\t\t$this->il_type = $a_type;\n\t}", "public function setType($t){\n $this->type = $t;\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }", "public static function register_type()\n {\n }" ]
[ "0.7988184", "0.795843", "0.76800597", "0.75914365", "0.75836676", "0.73078567", "0.7273175", "0.72692937", "0.7101457", "0.7083647", "0.7083647", "0.70556694", "0.70551574", "0.7029858", "0.7011736", "0.699648", "0.6968096", "0.6966349", "0.6966349", "0.6966349", "0.6940233", "0.6937407", "0.69279796", "0.6906726", "0.690416", "0.68936837", "0.68721646", "0.68718207", "0.6871679", "0.6868689", "0.6868689", "0.6868689", "0.6868689", "0.6868689", "0.6868689", "0.6868689", "0.6868689", "0.68682015", "0.68682015", "0.68643814", "0.686157", "0.6824514", "0.6821604", "0.68202996", "0.68202996", "0.68176126", "0.68176126", "0.6814232", "0.6814232", "0.6814232", "0.6814232", "0.6814232", "0.6814232", "0.6814232", "0.6814232", "0.6814232", "0.6807156", "0.67996866", "0.67536825", "0.674457", "0.6737817", "0.673064", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617", "0.6721617" ]
0.70778954
11
Defines the async attribute.
public function async($value = null){ return $this->attr(ATTR_ASYNC, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAsync(string $async): self;", "public function setAsync(bool $async = true) {\n $this->attributes()\n ->remove('defer')\n ->set('async', $async);\n return $this;\n }", "function setAsync($enabled) {\n $this->async = $enabled;\n }", "public function setIsAsync(bool $async): void\n {\n $this->async = $async;\n }", "public function add_async_attribute( $tag, $handle ) {\n if(is_admin() || is_customize_preview()) return $tag;\n\n do_action('before_add_async_attribute', $tag ,$handle);\n\n if(isset($_GET['action'])) return $tag;\n\n if('jquery' === $handle || 'jquery-core' === $handle){\n return $tag;\n }\n\n if(function_exists('wc') && (is_woocommerce())){return $tag;}\n\n if(function_exists('is_checkout') && is_checkout()){\n return $tag;\n }\n return str_replace( ' src', ' defer src', $tag );\n }", "public function setAsync($async)\n {\n if (!is_bool($async)) {\n throw MapException::invalidAsync();\n }\n\n $this->async = $async;\n }", "function add_asyncdefer_attribute($tag, $handle) {\n if (strpos($handle, 'async') !== false) {\n // return the tag with the async attribute\n return str_replace( '<script ', '<script async ', $tag );\n }\n // if the unique handle/name of the registered script has 'defer' in it\n else if (strpos($handle, 'defer') !== false) {\n // return the tag with the defer attribute\n return str_replace( '<script ', '<script defer ', $tag );\n }\n // otherwise skip\n else {\n return $tag;\n }\n }", "function async($is_async = null)\n {\n if (func_num_args() > 0) {\n if (is_bool($is_async) == false) {\n throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>async($is_async)</b>: Argument <b>$is_async</b> MUST BE of type Boolean - <b style=\"color:red\">' . (is_object($is_async) ? get_class($is_async) : gettype($is_async)) . '</b> given!');\n }\n $this->property(\"async\", $is_async);\n return $this;\n } else {\n return $this->property(\"async\");\n }\n }", "public function getAsync()\n {\n return $this->async;\n }", "public function isAsync($bool = null){\n if($bool === null)\n return $this->hasAttr(ATTR_ASYNC);\n else{\n if($bool)\n return $this->async('async');\n else\n return $this->rattr(ATTR_ASYNC);\n }\n }", "public function isAsync()\n {\n return $this->async;\n }", "public function setupAsyncInterface(CMS_Module &$oMod, $isProperty = TRUE){\n $isCoreV5 = $this->getAttr($oMod->GetName(), 'core_v5');\n if($isProperty){\n // setting 'admin_request_types' property\n $aTypes = array('ajax');\n if($isCoreV5){\n $aTypes[] = 'plain';\n }\n $oMod->SetProperty('admin_request_types', $aTypes);\n }else{\n // setting 'engine_version' option\n $oMod->SetOption('engine_version', $isCoreV5 ? '0303' : '0600');\n }\n }", "public function add_async( $tag, $handle ) {\n\n\t\t$to_match = array( 'cyprus' );\n\t\treturn in_array( $handle, $to_match ) ? str_replace( ' src', ' async src', $tag ) : $tag;\n\t}", "public function isAsync(): bool\n {\n return $this->async;\n }", "public function isAsynchronous(): bool\n {\n return true;\n }", "public function isAsync();", "public function async($on = true)\n {\n $this->requestAsync = $on;\n\n return $this;\n }", "public function attributes($attr){\n $this->httpRequest->attributes($attr);\n }", "public function getAsync(): string;", "public function initAttribute();", "public function setAwait($await)\n {\n $this->await = (bool) $await;\n return $this;\n }", "public function __construct(string $tmxAsyncDownloadId)\n {\n $this->tmx_async_download_id = $tmxAsyncDownloadId;\n }", "protected function completePending($async)\n {\n $async->setIsPending(false)->save();\n }", "public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }", "protected function sendAsyncRequest() {\n\t\treturn true;\n\t}", "public function getAwait()\n {\n return $this->await;\n }", "public function has_async_action() {\n\t\treturn false;\n\t}", "public function __construct(string $src = '', bool $async = false) {\n parent::__construct('script', true);\n $this->setSrc($src)->setAsync($async);\n }", "function setSyncUrl()\n {\n }", "public function asyncAddList(Classes\\AsyncAddListRequest $arg) {\n\t\treturn $this->makeSoapCall(\"asyncAddList\", $arg);\n\t}", "public function setAttributes();", "public function asyncInitializeList(Classes\\AsyncInitializeListRequest $arg) {\n\t\treturn $this->makeSoapCall(\"asyncInitializeList\", $arg);\n\t}", "public function async()\n {\n return $this->_get_token();\n }", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "public function setEnableAsyncRendering($enable) {\n $this->enableAsyncRendering = $enable;\n return $this;\n }", "protected function addTypo3ApiUrlAttribute()\n {\n /** @var \\Shopware\\Bundle\\AttributeBundle\\Service\\CrudService $service */\n $service = $this->container->get('shopware_attribute.crud_service');\n\n $service->update('s_core_auth_attributes', 'typo3_api_url', TypeMapping::TYPE_STRING, [\n 'label' => 'TYPO3 API-URL',\n 'supportText' => 'Enter the TYPO3 API-URL here to push notifications about changes of articles / categories to this endpoint.',\n 'helpText' => 'Enter the TYPO3 API-URL here',\n\n //user has the opportunity to translate the attribute field for each shop\n 'translatable' => true,\n\n //attribute will be displayed in the backend module\n 'displayInBackend' => true,\n\n //numeric position for the backend view, sorted ascending\n 'position' => 100,\n\n //user can modify the attribute in the free text field module\n 'custom' => false,\n\n ]);\n\n return true;\n }", "public static function callback( $attrs, $content = '' ) {\n\t\treturn '<script async src=\"https://genius.codes\"></script>';\n\t}", "public function cacheInit( \\FutoIn\\AsyncSteps $as );", "public function isAutomaticAsync()\n {\n return $this->isAutomaticAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function setAttribute($attribute, $value)\n {\n }", "public function __construct($name, $autounlock = true) {}", "public function set_attribute($name, $value)\n {\n }", "public function await(Listener $listener);", "public static function is_loading_fonts_async() {\n\t\treturn ! empty( get_option( static::ENABLE_ASYNC_FONTS_LOAD, 0 ) );\n\t}", "public function __sleep()\n {\n return ['attributes'];\n }", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"assignments\";\n\t}", "static public function async ($f, $lazy = false) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:131: lines 131-138\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:132: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:134: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:136: characters 7-33\n\t\t\tCallback_Impl_::invoke($f, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:137: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "public function setAttribute($attribute, $value)\r\n\t{\r\n\t\t\r\n\t}", "function Scripts()\n{\n $html = \"<script src='bundle/js/async.js' async></script>\";\n return $html;\n}", "public function setProgressCallback($callback)\n {\n# $this->progressCallback=$callback;\n }", "public function __set($attr, $value)\n\t{\n\t\t$this->$attr = $value;\n\t}", "protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}", "protected function supportsAsyncSignals()\n {\n return extension_loaded('pcntl');\n }", "public function setAutoComplete( $autoComplete )\n\t{\n\t\t$this->setAttribute( \"autocomplete\", $autoComplete );\n\t}", "private function setAutogradingCompleteInternal($complete) {\n $this->autograding_complete = $complete === 'true' || $complete === true;\n }", "abstract protected function mustApplyRuleOnAttribute(): bool;", "public function setAttribute(string $attribute, string $value);", "public function asyncGetList(Classes\\AsyncGetListRequest $arg) {\n\t\treturn $this->makeSoapCall(\"asyncGetList\", $arg);\n\t}", "function addAttribute($name, $value) {\n $this->_attributes[$name] = $value;\n }", "public function __set($attri, $value) {\n if (in_array($attri, self::DYN_ATTRIBUTES)) {\n $this->{$attri} = $value;\n }\n }", "protected function setUp()\n {\n $this->object = new AsyncTraitStub;\n }", "public function getAsyncPool(): AsyncRequestPool\n {\n return $this->pool;\n }", "public function add_script_tag_attributes($tag, $handle) {\n switch ($handle) {\n // adding async to main js bundle\n // for defer, replace async=\"async\" with defer=\"defer\"\n case ('pan_bootstrap_scripts'):\n return str_replace( ' src', ' async=\"async\" src', $tag );\n break;\n\n // example adding CDN integrity and crossorigin attributes\n // Note: popper.js is loaded into the main.bundle.js from npm\n // This is just an example\n case ('popper-js'):\n return str_replace( ' min.js', 'min.js\" integrity=\"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q\" crossorigin=\"anonymous\"', $tag );\n break;\n\n // example adding CDN integrity and crossorigin attributes\n // Note: bootstrap.js is loaded into the main.bundle.js from npm\n // This is just an example\n case ('bootstrap-js'):\n return str_replace( ' min.js', 'min.js\" integrity=\"sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4\" crossorigin=\"anonymous\"', $tag );\n break;\n\n default:\n return $tag;\n\n } // /switch\n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n\r\n $this->url = Configure::read('cdr_url') . \":\" . Configure::read('cdr_api.async_port');\r\n }", "public function setDefer(bool $defer = true) {\n $this->attributes()\n ->remove('async')\n ->set('defer', $defer);\n return $this;\n }", "public function initFromCache( \\FutoIn\\AsyncSteps $as );", "function defer_js_async($tag){\n\t\n\t// list of scripts to defer\n $scripts_to_defer = array('');\n\n\t// list of scripts to async\n\t$scripts_to_async = array('/src/js/nav.js', 'https://fonts.googleapis.com/css?family=Julius+Sans+One', 'https://fonts.googleapis.com/css?family=Raleway');\n\t \n\t// defer scripts\n\tforeach($scripts_to_defer as $defer_script){\n\t\tif(true == strpos($tag, $defer_script ) )\n\t\treturn str_replace( ' src', ' defer=\"defer\" src', $tag );\t\n\t}\n\n\t// async scripts\n\tforeach($scripts_to_async as $async_script){\n\t\tif(true == strpos($tag, $async_script ) )\n\t\treturn str_replace( ' src', ' async=\"async\" src', $tag );\t\n\t}\n\treturn $tag;\n\t}", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "public static function async ($f, $lazy = false) {\n\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:136: lines 136-143\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:137: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:139: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:140: characters 7-41\n\t\t\t$wrapped = $f;\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:141: characters 7-33\n\t\t\tCallback_Impl_::invoke($wrapped, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:142: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "public function getReservedForFutureUse1Attribute(){}", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"widget\";\n\t}", "public function __construct(array $attributes = []) {\n parent::__construct($attributes);\n\n if(isset($this->attributes['api_token']) === false || empty($this->attributes['api_token'])) {\n $this->attributes['api_token'] = str_random(60);\n }\n }", "function init()\n {\n $this->defineAttribute('label', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('routeUrl', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('add', false, 'Nuova scheda', COMPONENT_TYPE_STRING);\n $this->defineAttribute('cssClass', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('buttonId', false, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('noLink', false, false, COMPONENT_TYPE_STRING);\n $this->defineAttribute('iconClass', false, 'fa-plus', COMPONENT_TYPE_STRING);\n\n parent::init();\n }", "public function __set($attr_playlist_name, $attr_val) {\r\n if (property_exists(__CLASS__, $attr_playlist_name)) {\r\n $this->$attr_playlist_name = $attr_val;\r\n }\r\n }", "public function addAttribute($name, $value);", "public function getAllowEntityCancellationAttribute()\n {\n return true;\n }", "public function setCallback($callback);", "public function getCompletedAttribute(){\n if ($this->accepter->profile->progress >= 100){\n return 1;\n }\n else{\n return 0;\n } \n }", "protected function buildSetterCallback() {\n }", "public function send($data, $async = true);", "public function testComDayCqDamCoreImplJobsMetadataimportAsyncMetadataImportConfig()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.core.impl.jobs.metadataimport.AsyncMetadataImportConfigProviderService';\n\n $crawler = $client->request('POST', $path);\n }", "public function addAttribute(string $name, $value): self;", "public function __construct($name, $initialval = 1, $autounlock = true) {}", "public function getIsCompleteAttribute()\n {\n return $this->isComplete();\n }", "public function setQueuedAtAttribute($value)\n {\n $value = ($value) ? : Carbon::now('Europe/London');\n $this->attributes['queued_at'] = $value;\n }", "function script_loader_tag( $tag, $handle ) {\n\t$script_execution = wp_scripts()->get_data( $handle, 'script_execution' );\n\n\tif ( ! $script_execution ) {\n\t\treturn $tag;\n\t}\n\n\tif ( 'async' !== $script_execution && 'defer' !== $script_execution ) {\n\t\treturn $tag;\n\t}\n\n\t// Abort adding async/defer for scripts that have this script as a dependency. _doing_it_wrong()?\n\tforeach ( wp_scripts()->registered as $script ) {\n\t\tif ( in_array( $handle, $script->deps, true ) ) {\n\t\t\treturn $tag;\n\t\t}\n\t}\n\n\t// Add the attribute if it hasn't already been added.\n\tif ( ! preg_match( \":\\s$script_execution(=|>|\\s):\", $tag ) ) {\n\t\t$tag = preg_replace( ':(?=></script>):', \" $script_execution\", $tag, 1 );\n\t}\n\n\treturn $tag;\n}", "public function __set($attribute, $value) {\n $this->setAttribute($attribute, $value);\n }", "private function init($attr = null)\n {\n $this->model = Yii::app()->controller->loadModel(Yii::app()->request->getQuery('id'), Yii::app()->request->getQuery('model'));\n\n if( !($this->model instanceof CActiveRecord) || !in_array('uploadBehavior', array_keys($this->model->behaviors())) )\n throw new CHttpException(500, 'Model should be an instance of AR class with UploadBehavior behavior');\n\n $this->model->asa('uploadBehavior')->attribute = $attr ? $attr : Yii::app()->request->getQuery('attr');\n\n if( !isset($this->path) )\n {\n $this->path = Yii::app()->controller->module->getUploadPath();\n }\n\n if( !isset($this->publicPath) )\n {\n $this->publicPath = Yii::app()->controller->module->getUploadUrl();\n }\n\n if( $this->subfolderVar )\n {\n $this->_subfolder = Yii::app()->request->getQuery($this->subfolderVar, date(\"mdY\"));\n }\n else if( $this->subfolderVar !== false )\n {\n $this->_subfolder = date(\"mdY\");\n }\n\n $this->path = ($this->_subfolder != \"\") ? \"{$this->path}/{$this->_subfolder}\" : \"{$this->path}\";\n $this->publicPath = ($this->_subfolder != \"\") ? \"{$this->publicPath}/{$this->_subfolder}\" : \"{$this->publicPath}\";\n\n if( !is_dir($this->path) )\n {\n mkdir($this->path, $this->dirMode);\n chmod($this->path, $this->dirMode);\n }\n else if( !is_writable($this->path) )\n {\n chmod($this->path, $this->dirMode);\n }\n }", "public function init()\n {\n $this->_done = false;\n }", "public function setAttribute($name, $value);", "static private function setHTTPClient() {\n self::$handler = new \\GuzzleHttp\\Handler\\CurlMultiHandler();\n self::$http = new \\GuzzleHttp\\Client(array(\n 'handler' => \\GuzzleHttp\\HandlerStack::create(self::$handler)\n ));\n }", "public function testSetRemovalTimeAsyncHistoricBatch()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}", "public function process( \\FutoIn\\AsyncSteps $as );", "protected function configure($options = array(), $attributes = array())\n {\n \n }", "public function getQueuedAttribute(): bool\n {\n return $this->status_id === CampaignStatus::STATUS_QUEUED;\n }", "public function setup_sync()\n {\n }", "public function testComAdobeGraniteQueriesImplHcAsyncIndexHealthCheck()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.queries.impl.hc.AsyncIndexHealthCheck';\n\n $crawler = $client->request('POST', $path);\n }", "public function setCallbacks()\n {\n // __AUTH__ must return true or false\n $this->on('__AUTH__', function($auth, $request) {\n if (is_object($auth)) {\n if ($auth->type == 'Basic') {\n if ($auth->user == 'Andrew' && $auth->password == 'foo') {\n return true;\n }\n }\n }\n\n return false;\n });\n\n // dummy callback, just shows how to add return headers to be used\n $this->on('rate.limit.headers', function($remoteAddr) {\n // .. do something with the remoteAddr\n return ['X-RateLimit-Limit' => 5000, 'X-RateLimit-Remaining' => 4999];\n });\n }" ]
[ "0.772837", "0.67946464", "0.67727196", "0.6584188", "0.59980094", "0.5972648", "0.5934857", "0.58673567", "0.5864898", "0.5857339", "0.58356965", "0.5724968", "0.5681533", "0.5588469", "0.546811", "0.541726", "0.5155989", "0.5065227", "0.5060442", "0.5052683", "0.4943269", "0.48838505", "0.48117653", "0.4785999", "0.47454193", "0.46969292", "0.46783248", "0.46778584", "0.46247098", "0.45550367", "0.45146182", "0.45138577", "0.4507432", "0.44725204", "0.44454986", "0.44201052", "0.4402298", "0.43935004", "0.43932876", "0.43916366", "0.43581378", "0.43551838", "0.435086", "0.43232116", "0.43120873", "0.4280387", "0.42746812", "0.42636585", "0.4250568", "0.42482162", "0.42462072", "0.42411944", "0.42372316", "0.4228475", "0.4219963", "0.42189172", "0.42178264", "0.4205892", "0.42005187", "0.42003027", "0.4199531", "0.41947505", "0.41939044", "0.4193064", "0.4192184", "0.41849184", "0.4178649", "0.41763183", "0.41681638", "0.4162799", "0.41596767", "0.41565126", "0.41535994", "0.41526335", "0.41426113", "0.4139747", "0.41384804", "0.41354918", "0.41125232", "0.4107599", "0.41060424", "0.41015434", "0.41000456", "0.4087067", "0.40827084", "0.40807104", "0.40793812", "0.40793765", "0.4078207", "0.40727884", "0.40722644", "0.40706256", "0.406909", "0.40688956", "0.40686756", "0.4062967", "0.4054898", "0.40526438", "0.40500867", "0.40461788" ]
0.712083
1
Verify the async attribute, or add or remove it.
public function isAsync($bool = null){ if($bool === null) return $this->hasAttr(ATTR_ASYNC); else{ if($bool) return $this->async('async'); else return $this->rattr(ATTR_ASYNC); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function mustApplyRuleOnAttribute(): bool;", "public function setAsync(string $async): self;", "public function add_async_attribute( $tag, $handle ) {\n if(is_admin() || is_customize_preview()) return $tag;\n\n do_action('before_add_async_attribute', $tag ,$handle);\n\n if(isset($_GET['action'])) return $tag;\n\n if('jquery' === $handle || 'jquery-core' === $handle){\n return $tag;\n }\n\n if(function_exists('wc') && (is_woocommerce())){return $tag;}\n\n if(function_exists('is_checkout') && is_checkout()){\n return $tag;\n }\n return str_replace( ' src', ' defer src', $tag );\n }", "function add_asyncdefer_attribute($tag, $handle) {\n if (strpos($handle, 'async') !== false) {\n // return the tag with the async attribute\n return str_replace( '<script ', '<script async ', $tag );\n }\n // if the unique handle/name of the registered script has 'defer' in it\n else if (strpos($handle, 'defer') !== false) {\n // return the tag with the defer attribute\n return str_replace( '<script ', '<script defer ', $tag );\n }\n // otherwise skip\n else {\n return $tag;\n }\n }", "public function setIsAsync(bool $async): void\n {\n $this->async = $async;\n }", "public function isAsync()\n {\n return $this->async;\n }", "public function isAsync();", "public function add_async( $tag, $handle ) {\n\n\t\t$to_match = array( 'cyprus' );\n\t\treturn in_array( $handle, $to_match ) ? str_replace( ' src', ' async src', $tag ) : $tag;\n\t}", "function async($is_async = null)\n {\n if (func_num_args() > 0) {\n if (is_bool($is_async) == false) {\n throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>async($is_async)</b>: Argument <b>$is_async</b> MUST BE of type Boolean - <b style=\"color:red\">' . (is_object($is_async) ? get_class($is_async) : gettype($is_async)) . '</b> given!');\n }\n $this->property(\"async\", $is_async);\n return $this;\n } else {\n return $this->property(\"async\");\n }\n }", "public function async($value = null){\n return $this->attr(ATTR_ASYNC, $value);\n }", "public function isAsync(): bool\n {\n return $this->async;\n }", "public function has_async_action() {\n\t\treturn false;\n\t}", "protected function completePending($async)\n {\n $async->setIsPending(false)->save();\n }", "public function setAsync($async)\n {\n if (!is_bool($async)) {\n throw MapException::invalidAsync();\n }\n\n $this->async = $async;\n }", "public function setAsync(bool $async = true) {\n $this->attributes()\n ->remove('defer')\n ->set('async', $async);\n return $this;\n }", "public static function isInyectedAttribute( $attr )\n {\n return ( strcmp($attr, \"id\") == 0 || strcmp($attr, \"deleted\") == 0 || strcmp($attr, \"class\") == 0 );\n }", "function getAttribute($attr) {\n\n $attribute = getEmptyAttribute($attr);\n\n if (function_exists(\"http_status_code\") && $attribute == \"\") {\n http_status_code(409, \"Attribute cannot be empty\");\n } else {\n return $attribute;\n }\n }", "public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }", "protected abstract function supportsAttribute($attribute);", "protected function validateAttribute($object, $attribute)\n {\n return;\n }", "protected function _flagAttributeAsModified($attribute) {\n\t\tif (!in_array($attribute, $this->_modifiedAttributes)) {\n\t\t\t$this->_modifiedAttributes[] = $attribute;\n\t\t}\n\t}", "public function hasAttribute(string $name): bool;", "public function isAttributeSave(string $attribute): bool;", "public function hasSecretIfRequiredAndApproved($attribute)\n {\n if ($this->isApproved() && $this->requiresSignature() && empty($this->$attribute)) {\n $this->addError(\n $attribute,\n 'This new approved key (to an API that requires signatures) '\n . 'was not given a secret.'\n );\n }\n }", "private function checkAttribute($attr)\n {\n if (! in_array($attr, $this->attributeNames)) {\n throw new BadFunctionCallException(\"Attribute '$attr' doesn't exist for the entity type '$this->entityType'.\");\n }\n }", "protected function validateAttribute($object, $attribute) {\n \n }", "abstract protected function isSyncRequired($entity);", "public function set($attr, $value) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] = $value : false;\n }", "public function validateWhenSet()\n {\n $this->validateMethod = 'validate' . ucfirst($this->name);\n }", "public function hasDirtyValueOfAttribute($attributeName);", "public function supportsAttribute($attribute);", "public function testAssertElementAttributeExists(): void\n {\n $webAssert = $this->createMock(WebAssert::class);\n $webAssert->expects($this->once())->method('elementAttributeExists')->with($this->equalTo('css'), $this->equalTo('a.action_bar__next'));\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->once())->method('assertSession')->willReturn($webAssert);\n $trait->expects($this->once())->method('fixStepArgument')->with($this->equalTo('disabled'));\n\n $trait->assertElementAttributeExists('a.action_bar__next', 'disabled'); // @phpstan-ignore-line\n }", "public function isAsynchronous(): bool\n {\n return true;\n }", "public function hasAttr ($attr) { return $this->hasAttribute($attr); }", "function setAsync($enabled) {\n $this->async = $enabled;\n }", "public function getAdditionalRequiredAttribute(): ?string;", "public function visitAttribute($attr)\n {\n if (($this->cv != null)) {\n $this->cv->visitAttribute($attr);\n }\n }", "private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }", "public function hasAttr($attr);", "protected function resolveStatusAndSetCompletedFields()\n {\n if ($this->status != Task::STATUS_COMPLETED)\n {\n $this->completed = false;\n }\n else\n {\n $this->completed = true;\n }\n\n if ($this->completed == true)\n {\n if ($this->completedDateTime == null)\n {\n $this->completedDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time());\n }\n $this->unrestrictedSet('latestDateTime', $this->completedDateTime);\n }\n }", "public function testIsValidSuccessWithoutHasDataChanges()\n {\n $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(false));\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->setReadOnlyProperties(['attr1']);\n $this->assertTrue($validator->isValid($this->_object));\n }", "abstract public function getIsSerializedAttribute() : bool;", "final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}", "public function getAsync()\n {\n return (bool)Mage::getStoreConfig(self::CONFIG_ASYNC);\n }", "public function getReservedForFutureUse1Attribute(){}", "public function validate() {\n return v::same($this->value, get($this->attribute . '_confirmation')) or v::same($this->value, $this->data[$this->attribute . '_confirmation']);\n }", "public function attributes($attr){\n $this->httpRequest->attributes($attr);\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "abstract protected function doAttributeVote(TokenInterface $token, $object, $attribute);", "public function isSetValueActive() {}", "public function validateAttribute($object, $attribute)\n\t{\n if ($object->attributeHasChanged($attribute)) {\n $this->addError($object, $attribute, \\yii::t('app', '{attribute} has changed.'));\n }\n\t}", "public function getCompletedAttribute(){\n if ($this->accepter->profile->progress >= 100){\n return 1;\n }\n else{\n return 0;\n } \n }", "public function getIsRequired(): bool;", "public static function require_compare_attributes(){\n\t\treturn false;\n\t}", "public function hasAttributeGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasAttributeGetMutator($key);\n }", "protected function _setOperation() {\n $filter = '(&(objectclass='.$this->ldapObjectClass.')('.$this->ldapSforceIdAttr.'='.$this->sforceData['Id'].'))';\n $retAttrs = array_keys($this->syncMap);\n $userExistsCheck = $this->LdapObject->find('all', array( 'conditions' => $filter, 'fields' => $retAttrs ));\n if ($userExistsCheck) {\n if ($userExistsCheck[0][0]['count'] > 1) {\n $this->log('SYNC: Duplicate or corrupt data in the LDAP repository. Multiple entries found for the following Salesforce Id: ' . $this->sforceData['Id']);\n return false;\n } elseif (!is_array($userExistsCheck) || count($userExistsCheck) != 1) {\n $this->log('SYNC: Malformed response from LDAP repository. Salesforce Id: ' . $this->sforceData['Id']);\n return false;\n }\n if ($this->sforceData['IsDeleted'] == 'true') {\n $this->syncOperation = 'delete';\n } else {\n $this->syncOperation = 'update';\n $this->ldapData = $userExistsCheck[0]['LdapObject'];\n }\n $this->LdapObject->id = $userExistsCheck[0]['LdapObject']['dn'];\n $this->LdapObject->primaryKey = 'dn';\n } elseif ($this->sforceData['IsDeleted'] != 'true') {\n $this->syncOperation = 'create';\n } else {\n $this->syncOperation = 'nothing';\n }\n \n return true;\n }", "public function afterSetupAttributeData(\n EavModifier $subject,\n $result,\n ProductAttributeInterface $attribute\n ) {\n try {\n /** @var Product $product */\n $product = $this->locator->getProduct();\n } catch (NoSuchEntityException $e) {\n return $result;\n } catch (NotFoundException $e) {\n return $result;\n }\n\n if ($attribute->getAttributeCode() === ProductAttributeInterface::CODE_STATUS\n && !$this->observerData->isCanEditProductStatus()\n && $product->isObjectNew()\n ) {\n return ProductStatus::STATUS_DISABLED;\n }\n\n if ($this->isPrice($attribute)\n && !$this->observerData->isCanEditProductPrice()\n && $product->isObjectNew()\n && $product->getTypeId() !== ProductType::TYPE_BUNDLE\n ) {\n return $this->getDefaultPriceValue($attribute, $result);\n }\n\n return $result;\n }", "public function theElementShouldHaveTheAttribute($elem, $attr) {\n $this->returnValueOfAttribute($elem, $attr);\n }", "public function beforeSave()\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n foreach ($this->attributes as $attribute => $attributeConfig) {\n if ($this->hasScenario($attributeConfig)) {\n if (isset($this->files[$attribute]) && $this->validateFile($this->files[$attribute])) {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave') === true) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n } else {\n // Protect attribute\n $model->$attribute = $model->getOldAttribute($attribute);\n }\n } else {\n if (!$model->getIsNewRecord() && $model->isAttributeChanged($attribute)) {\n if ($this->getAttributeConfig($attributeConfig, 'unlinkOnSave')) {\n $this->deleteFileName[$attribute] = $this->resolveFileName($attribute, true);\n }\n }\n }\n }\n $this->fileSave();\n }", "public function passes($attribute, $value)\n {\n $parts = explode('.', $attribute);\n $resources = request()->get('resources');\n\n if ($resources[$parts[1]]['type'] !== 'File Download')\n {\n return true;\n }\n\n $fileUpload = request()->hasFile('resources.' . $parts[1] . '.download');\n $fileExists = isset($resources[$parts[1]]['download_file_name']) && ! empty($resources[$parts[1]]['download_file_name']) ? true : false;\n\n return $fileUpload || $fileExists;\n }", "public function testGetChangeAttributes()\n {\n }", "public function getRequired(): bool;", "public function hasAttribute($attr_name)\n {\n return isset($this->attributes[$attr_name]);\n }", "public function getValidAttribute()\n {\n if (!$this->active) {\n app()->make('error')->code(2016);\n }\n\n if (!$this->credentials OR !$this->credentials->count()) {\n app()->make('error')->code(2022);\n }\n\n return true;\n }", "public function getAsync()\n {\n return $this->async;\n }", "function IsAttributeRequired( $attribute )\r\n\t{\r\n\t\tswitch ( $attribute )\r\n\t\t{\r\n\t\t\tdefault:\r\n\t\t\t\treturn $this->object->isAttributeRequired( $attribute );\r\n\t\t}\r\n\t}", "protected function verifyAttributes()\n {\n $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']);\n $fixtureOptions = $this->prepareFixtureOptions();\n $errors = $this->verifyData($fixtureOptions, $formOptions, true, false);\n return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:');\n }", "public function testPending()\n {\n $this->assertTrue($this->kittyUser->isPending());\n $returnedKittyUser = $this->kittyUser->setPending(false);\n $this->assertSame($this->kittyUser, $returnedKittyUser);\n $this->assertFalse($this->kittyUser->isPending());\n }", "public function updateBoolean( Inx_Api_Recipient_Attribute $attr, $blValue );", "public function setupAsyncInterface(CMS_Module &$oMod, $isProperty = TRUE){\n $isCoreV5 = $this->getAttr($oMod->GetName(), 'core_v5');\n if($isProperty){\n // setting 'admin_request_types' property\n $aTypes = array('ajax');\n if($isCoreV5){\n $aTypes[] = 'plain';\n }\n $oMod->SetProperty('admin_request_types', $aTypes);\n }else{\n // setting 'engine_version' option\n $oMod->SetOption('engine_version', $isCoreV5 ? '0303' : '0600');\n }\n }", "public function testModelAttributeExists()\n {\n // exists mutator\n $this->assertFalse($this->post->hasGetMutator('id'));\n $this->assertArrayHasKey('id', $this->post->getAttributes());\n\n // exists native\n $this->assertTrue($this->post->hasGetMutator('exits'));\n $this->assertArrayNotHasKey('exits', $this->post->getAttributes());\n\n // not exists\n $this->assertFalse($this->post->hasGetMutator('notExits'));\n $this->assertArrayNotHasKey('notExits', $this->post->getAttributes());\n }", "public function checkAndSetAlias() {}", "abstract public function hasAttribute($name, $domain = '');", "public function hasAttribute(string $name): bool {\n return isset($this->attributes[$name]);\n }", "public function testAccessDeniedNoSupportAttribute()\n {\n $this->attributes = ['NOT_IMAGE_EDIT'];\n\n $this->assertVoter(VoterInterface::ACCESS_DENIED);\n }", "public function testImmutable(): void\n {\n //Value is empty\n $this->category->setCustomAttribute('custom_layout_update', false);\n $this->category->setOrigData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n\n //New value\n $this->category->setCustomAttribute('custom_layout_update', 'test');\n $this->category->setOrigData('custom_layout_update', null);\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n $this->category->setCustomAttribute('custom_layout_update', 'testNew');\n $this->category->setOrigData('custom_layout_update', 'test');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n\n //Removing a value\n $this->category->setCustomAttribute('custom_layout_update', '');\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n $this->assertNull($this->category->getCustomAttribute('custom_layout_update')->getValue());\n\n //Using old stored value\n //Saving old value 1st\n $this->recreateCategory();\n $this->category->setOrigData('custom_layout_update', 'test');\n $this->category->setData('custom_layout_update', 'test');\n $this->category->save();\n $this->recreateCategory();\n $this->category = $this->categoryFactory->create(['data' => $this->category->getData()]);\n\n //Trying the same value.\n $this->category->setData('custom_layout_update', 'test');\n $this->attribute->beforeSave($this->category);\n //Trying new value\n $this->category->setData('custom_layout_update', 'test2');\n $caughtException = false;\n try {\n $this->attribute->beforeSave($this->category);\n } catch (LocalizedException $exception) {\n $caughtException = true;\n }\n $this->assertTrue($caughtException);\n //Empty value\n $this->category->setData('custom_layout_update', null);\n $this->attribute->beforeSave($this->category);\n }", "public function validateAssignmentData(Collection $data, string $attribute): bool;", "public function beforeValidate()\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n foreach ($this->attributes as $attribute => $attributeConfig) {\n if ($this->hasScenario($attributeConfig)) {\n $file = $this->getAttributeValue($attribute);\n if (!$this->validateFile($file)) {\n $file = $this->getUploadInstance($attribute);\n }\n if (!isset($this->files[$attribute]) && $this->validateFile($file)) {\n $model->$attribute = $file;\n $this->files[$attribute] = $file;\n } else {\n if ($model->$attribute == null) {\n $nullValue = $this->getAttributeConfig($attribute, 'nullValue');\n $model->$attribute = $nullValue;\n }\n }\n }\n }\n }", "public function testQuarantinePrototypeUpdateAttributes()\n {\n\n }", "public function check_sync()\n {\n }", "public function hasAttribute($key);", "protected function supportsAsyncSignals()\n {\n return extension_loaded('pcntl');\n }", "public function hasAttribute ($attr) {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\tif (!$node->attributes->getNamedItem($attr)) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function sometimes($attribute, $rules, callable $callback);", "private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}", "public function getHasBeenRejectedBefore(): bool;", "public function afterValidate()\n {\n if ($this->owner->hasAttribute($this->attribute) && $this->files) {\n $this->owner->setAttribute($this->attribute, array_map(function($v){ return $v->name; }, $this->files));\n }\n if ($this->contentAttribute) {\n $this->owner->addErrors([$this->contentAttribute => $this->owner->getErrors($this->attribute)]);\n $this->owner->clearErrors($this->attribute);\n }\n if (!$this->files) {\n $this->owner->{$this->attribute} = $this->oldValue;\n }\n }", "protected function voteOnAttribute($attribute, $comment, TokenInterface $token)\n {\n $user = $token->getUser();\n\n if (!$user instanceof User) {\n return self::ACCESS_ABSTAIN;\n }\n\n switch ($attribute) {\n case self::DELETE:\n return $this->canDelete($comment, $user);\n }\n throw new \\LogicException('This code should not be reached!');\n }", "public function testIsValidSuccessWithInvokedSetter()\n {\n $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(true));\n $this->_object->expects($this->once())->method('getData')->with('attr1')->will($this->returnValue(1));\n $this->_object->expects($this->once())->method('getOrigData')->with('attr1')->will($this->returnValue(1));\n\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->setReadOnlyProperties(['attr1']);\n $this->assertTrue($validator->isValid($this->_object));\n }", "private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }", "abstract protected function setValidationCustomAttributes(): array;", "public function update(User $user, Attribute $attribute)\n {\n return false;\n }", "protected function canRemove() {}", "protected function isScriptAttributeAllowed($options)\n {\n $allowedTagOptions = ['defer', 'async'];\n return (bool) count(array_intersect($options, $allowedTagOptions));\n }", "public function hasAttributeSavedMethod($attribute)\n {\n return method_exists($this, 'saved'.Str::studly($attribute).'Attribute');\n }", "protected function validateAttribute($object,$attribute)\n\t{\n\t\t// be silent! validation handled by validate method as it validates the group of attributes\n\t}", "public function passes($attribute, $value)\n {\n return ! optional($this->user)->isVerified();\n }", "public function beforeValidate()\n {\n if ($this->filesToDelete()) {\n $this->deleteFiles(json_decode($this->owner->getOldAttribute($this->attribute)), null, false);\n }\n $this->owner->{$this->attribute} = $this->files = $this->contentAttribute\n ? $this->processContentFiles(false)['files']\n : UploadedFile::getInstances($this->owner, $this->attribute);\n }", "function can_be_manually_set() {\n return true;\n }", "public function isDynamicAttribute()\n {\n return in_array($this->arrConfig['attribute'], Attribute::getDynamicAttributeFields());\n }" ]
[ "0.5671015", "0.5669518", "0.55074257", "0.5242399", "0.5192626", "0.51396906", "0.5120021", "0.51017255", "0.50462025", "0.5025686", "0.4998938", "0.49739608", "0.49625346", "0.49203083", "0.48491317", "0.4816592", "0.4746386", "0.46703842", "0.466399", "0.46563366", "0.4655769", "0.46520683", "0.4646271", "0.46173498", "0.46037748", "0.45793664", "0.45663247", "0.45480624", "0.45444137", "0.45436504", "0.45325178", "0.4510119", "0.45061183", "0.44957823", "0.4484171", "0.44822508", "0.44686902", "0.44642", "0.44599804", "0.44438547", "0.4440792", "0.44368097", "0.442395", "0.4418127", "0.44056982", "0.43932566", "0.43891", "0.4385056", "0.4375856", "0.4373955", "0.43682218", "0.43520522", "0.43448156", "0.43444973", "0.43408585", "0.43404162", "0.43384457", "0.4310444", "0.4307777", "0.43059665", "0.4303816", "0.4301678", "0.42987508", "0.42962405", "0.42941487", "0.4288511", "0.4286897", "0.42853168", "0.42792532", "0.42789096", "0.4277526", "0.42754734", "0.4274732", "0.42734826", "0.4272446", "0.42530683", "0.424765", "0.4246857", "0.423801", "0.42371234", "0.42286587", "0.42283264", "0.42279664", "0.4223523", "0.42128628", "0.4205891", "0.42050147", "0.4198198", "0.41828734", "0.41793087", "0.4179136", "0.4178329", "0.41780788", "0.41770193", "0.4174417", "0.4168012", "0.4158423", "0.41558665", "0.4153418", "0.41524747" ]
0.5194514
4
Defines the defer attribute.
public function defer($value = null){ return $this->attr(ATTR_DEFER, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDefer(bool $defer = true) {\n $this->attributes()\n ->remove('async')\n ->set('defer', $defer);\n return $this;\n }", "public function defer() {\n return true;\n }", "public function defer(\n bool $deferring,\n ): void {\n }", "public function defer() {\n return false;\n }", "public static function add_defer_attribute($tag, $handle) {\n $scripts_to_defer = array( \n 'tether-js',\n //'vue-js',\n 'bootstrap-js',\n 'jquery-ui-js'\n );\n \n foreach($scripts_to_defer as $defer_script) {\n if ($defer_script === $handle) {\n return str_replace(' src', ' defer=\"defer\" src', $tag);\n }\n }\n return $tag;\n }", "public function defer(\n bool $deferring,\n ): void {\n $this->boot();\n $this->configuration->eventDispatcher()->dispatch(new Defer($this, $deferring));\n }", "function add_asyncdefer_attribute($tag, $handle) {\n if (strpos($handle, 'async') !== false) {\n // return the tag with the async attribute\n return str_replace( '<script ', '<script async ', $tag );\n }\n // if the unique handle/name of the registered script has 'defer' in it\n else if (strpos($handle, 'defer') !== false) {\n // return the tag with the defer attribute\n return str_replace( '<script ', '<script defer ', $tag );\n }\n // otherwise skip\n else {\n return $tag;\n }\n }", "function add_defer_attribute( $tag, $handle ) {\n\n if ( 'font-awesome' === $handle ) {\n $tag = str_replace( ' src', ' defer src', $tag );\n }\n\n return $tag;\n\n}", "protected function with_client_defer( $defer ) {\n\t\treturn $this->get_client()->withDefer( $defer );\n\t}", "public function isDeferred()\n\t{\n\t\treturn $this->defer;\n\t}", "public function isDeferred()\n\t{\n\t\treturn $this->defer;\n\t}", "private function isDeferEnabled(): bool\n {\n return $this->scopeConfig->isSetFlag(\n self::XML_PATH_DEV_MOVE_JS_TO_BOTTOM,\n ScopeInterface::SCOPE_STORE\n );\n }", "function defer_js_async($tag){\n\t\n\t// list of scripts to defer\n $scripts_to_defer = array('');\n\n\t// list of scripts to async\n\t$scripts_to_async = array('/src/js/nav.js', 'https://fonts.googleapis.com/css?family=Julius+Sans+One', 'https://fonts.googleapis.com/css?family=Raleway');\n\t \n\t// defer scripts\n\tforeach($scripts_to_defer as $defer_script){\n\t\tif(true == strpos($tag, $defer_script ) )\n\t\treturn str_replace( ' src', ' defer=\"defer\" src', $tag );\t\n\t}\n\n\t// async scripts\n\tforeach($scripts_to_async as $async_script){\n\t\tif(true == strpos($tag, $async_script ) )\n\t\treturn str_replace( ' src', ' async=\"async\" src', $tag );\t\n\t}\n\treturn $tag;\n\t}", "public function deferRender(bool $value = true): static\n {\n $this->attributes['deferRender'] = $value;\n\n return $this;\n }", "public static function defer(callable $callable): void;", "function wsds_defer_scripts( $tag, $handle, $src ) {\n $defer_scripts = array( \n 'autocompletejs',\n 'admin-bar',\n 'ala_custom_js',\n 'jquery-migrate',\n 'child-pages-shortcode',\n );\n\n if ( in_array( $handle, $defer_scripts ) ) {\n return '<script src=\"' . $src . '\" defer=\"defer\" type=\"text/javascript\"></script>' . \"\\n\";\n }\n \n return $tag;\n}", "public function isDeferred()\n {\n return $this->deferred;\n }", "public function deferedRender($dr)\n {\n if (is_bool($dr)) {\n $this->deferedRender = $dr;\n } else {\n throw $this->invalidConfigValue(\n __FUNCTION__,\n 'bool'\n );\n }\n\n return $this;\n }", "public function load_deferred($database_id)\n {\n }", "public function setAsync(bool $async = true) {\n $this->attributes()\n ->remove('defer')\n ->set('async', $async);\n return $this;\n }", "public function isDeferred()\n {\n return $this instanceof Deferrable;\n }", "function ic_add_scripts_attribute( $tag, $handle ) {\n\t$handles = array(\n\t\t'main_scripts',\n\t);\n\tforeach( $handles as $defer_script) :\n\t\tif ( $defer_script === $handle ) {\n\t\t\treturn str_replace( ' src', ' defer rel=\"preload\" as=\"script\" src', $tag );\n\t\t}\n\tendforeach;\n\treturn $tag;\n}", "function addJS($src, $async, $defer){\n echo '<script src=\"'. $src .'\"'. ($async? \" async\":\"\") . ($defer? \" defer\":\"\") .'> </script>';\n}", "final public function setRequired($required = true)\n {\n return $this->setOption('data-required', (bool)$required);\n }", "public function setLazy(bool $lazy = true);", "public function isDeferred();", "public function setLazy($lazy = true) {\n\t\t$this->lazy = (bool) $lazy;\n\t}", "public function setDerty(bool $derty): self;", "public function setIsDependant($isDependant) {\n $this->isDependant = $isDependant;\n }", "function init(){\n parent::init();\n \n if (!$this->skip_var) {\n $this->skip_var = $this->name . '_skip';\n }\n $this->skip_var = $this->_shorten($this->skip_var);\n }", "function &foo()\n{\n // variable $result must be passed to anonymous function by reference\n defer($_, function () use (&$result) {\n $result = 'Change World';\n });\n\n $result = 'Hello World';\n\n return $result;\n}", "public static function create(): Deferred {\n return new Deferred();\n }", "public function setRequired(bool $require) : OptionMetadataInterface;", "function wp_defer_comment_counting($defer = \\null)\n {\n }", "public function add_async_attribute( $tag, $handle ) {\n if(is_admin() || is_customize_preview()) return $tag;\n\n do_action('before_add_async_attribute', $tag ,$handle);\n\n if(isset($_GET['action'])) return $tag;\n\n if('jquery' === $handle || 'jquery-core' === $handle){\n return $tag;\n }\n\n if(function_exists('wc') && (is_woocommerce())){return $tag;}\n\n if(function_exists('is_checkout') && is_checkout()){\n return $tag;\n }\n return str_replace( ' src', ' defer src', $tag );\n }", "function configure($sName, $mValue)\r\n\t{\r\n\t\tif ( 'scriptDeferral' == $sName )\r\n\t\t{\r\n\t\t\tif ( true === $mValue || false === $mValue )\r\n\t\t\t{\r\n\t\t\t\tif ( $mValue )\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->sDefer = 'defer=\"defer\" ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif ( 'javascript URI' == $sName )\r\n\t\t{\r\n\t\t\t$this->sJavascriptURI = $mValue;\r\n\t\t}\r\n\t\telseif ( 'inlineScript' == $sName )\r\n\t\t{\r\n\t\t\tif ( true === $mValue || false === $mValue )\r\n\t\t\t{\r\n\t\t\t\t$this->bInlineScript = $mValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function setDI($di) {\n\t\t$this->di = $di;\n\t}", "public function setDeferredServices(array $services): void\n {\n $this->deferredServices = $services;\n }", "function add_lazyflag( $strings = array() ) {\n\n\t\t$strings[] = 'rev-slidebg';\n\n\t\treturn $strings;\n\t}", "public function setRequired(bool $required=true): self;", "public function setDependencies($logger, $date, $layoutFactory = null, $campaignFactory = null, $mediaFactory = null, $widgetFactory = null, $displayFactory = null);", "public function testAttributes() {\n $build['#attached']['library'][] = 'common_test/js-attributes';\n $assets = AttachedAssets::createFromRenderArray($build);\n\n $js = $this->assetResolver->getJsAssets($assets, FALSE)[1];\n $js_render_array = \\Drupal::service('asset.js.collection_renderer')->render($js);\n $rendered_js = $this->renderer->renderPlain($js_render_array);\n $expected_1 = '<script src=\"http://example.com/deferred-external.js\" foo=\"bar\" defer></script>';\n $expected_2 = '<script src=\"' . $this->fileUrlGenerator->generateString('core/modules/system/tests/modules/common_test/deferred-internal.js') . '?v=1\" defer bar=\"foo\"></script>';\n $this->assertStringContainsString($expected_1, $rendered_js, 'Rendered external JavaScript with correct defer and random attributes.');\n $this->assertStringContainsString($expected_2, $rendered_js, 'Rendered internal JavaScript with correct defer and random attributes.');\n }", "public function setRequired($required = true)\n\t\t{\n\t\t\t$this->required = $required;\n\t\t}", "public function setDDI(string $ddi)\n {\n $this->ddi = $ddi;\n }", "public function setRequired($flag = true)\n {\n if ((bool) $flag === true) {\n $this->addValidator('required');\n } else {\n $this->removeValidator('required');\n }\n }", "public function setDeferredServices(array $services)\n {\n $this->deferredServices = $services;\n }", "public function setDeferredServices(array $services)\n {\n $this->deferredServices = $services;\n }", "public function setDur($dur) {\n\t\t$this->attributes['dur'] = $dur;\n\t\t$this->dur = $dur;\n\t\treturn $this;\n\t}", "public function setDhRequest($value,$options=array('required'=>true)){ \n $this->_data['dh_request'] = new ZendT_Type_Date($value,'DateTime');\n if ($options['db'])\n $this->_data['dh_request']->setValueFromDb($value);\n \n if (!$options['db']){\n \n if ($options['required'])\n $this->isRequired($value,'dh_request');\n \n }\n return $this;\n }", "public function defer(&$Model, $method, $args = array(), $deferred_args = array())\n\t{\n\t\tif (!self::$beanstalk) {\n\t\t\tself::$beanstalk =& BeanStalkManager::getBeanStalk();\n\t\t}\n\n\t\tif (!is_array($args)) {\n\t\t\t$args = array($args);\n\t\t}\n\n\t\t$deferred_args = array_merge($this->deferred_args[$Model->alias], $deferred_args);\n\t\t$message = array(\n\t\t\t'type' => 'deferred',\n\t\t\t'Model' => $Model->name,\n\t\t\t'id' => $Model->id,\n\t\t\t'data' => $Model->data,\n\t\t\t'method' => $method,\n\t\t\t'args' => $args\n\t\t);\n\n\t\textract($deferred_args);\n\t\t$result = self::$beanstalk->put($priority, $delay, $ttr, serialize($message), $tube);\n\n\t\tif ($result != BeanQueue::OPERATION_OK) {\n\t\t\t$this->log('Deferring ' . $Model->name . '->' . $method . ' failed with error code ' . $result);\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->log('Deferred ' . $Model->name . \"->$method to tube '$tube' with ID \" . self::$beanstalk->last_insert_id(), LOG_DEBUG);\n\t\treturn true;\n\t}", "public function setRequired($required = true) {}", "function setDeclined($declined) {\n\t\t$this->setData('declined', $declined);\n\t}", "public function setRequired($required = true) {}", "public function setDefiner($definer);", "public function setRequired($required = true);", "public function setRequired(?bool $bool = null): void\n {\n $this->required = $bool ?? true;\n }", "public function setDiscountSequence()\n {\n $this->discountSequence = [\n (string)DiscountType::LIMITED_TIME(),\n (string)DiscountType::PERIOD(),\n (string)DiscountType::QUANTITY(),\n ];\n }", "public function setMtAutreDeduction(?float $mtAutreDeduction): DeclarationCafat {\n $this->mtAutreDeduction = $mtAutreDeduction;\n return $this;\n }", "public function required() {\n $this->is_required = true;\n return $this;\n }", "private function setupIfndef() {\n Blade::directive('ifndef', function($expression) {\n $all_params_st = $this->stringParamAsString($expression);\n $params = eval(\"return array(\".$all_params_st.\");\");\n $result = '<?php ';\n $result .= 'if (';\n \n for ($i=0;$i<count($params);$i++) {\n $result .= \"!isset($\".$params[$i].\")\";\n if ($i<count($params)-1) {\n $result .=\" && \";\n }\n }\n $result .= '): ?>';\n return $result;\n });\n }", "protected function booted(): void\n {\n $this->setAttribute('unit_of_measurement', new UnitOfMeasurement([\n 'code' => UnitOfMeasurement::LBS,\n ]));\n }", "public function addInlineJavascript($javascript, $defer = false)\n\t{\n\t\tif (!empty($javascript))\n\t\t{\n\t\t\t$this->js_inline[(!empty($defer) ? self::DEFERRED : self::STANDARD)][] = $javascript;\n\t\t}\n\t}", "public function set_dependencies( $deps ) {\n\t\t$this->items[ $this->id ]['deps'] = $deps;\n\t\treturn $this;\n\t}", "public function setRequired( $isReq=true )\n\t{\n\t\tif (!empty($isReq))\n\t\t\t$this->setAttr('required', 'required');\n\t\treturn $this;\n\t}", "public function __wakeup() {\n if (!$this->isDependant) {\n $this->isDependant = false;\n }\n }", "public function lazy();", "public function setRequired($required=true);", "public function __construct($di) {\n $this->di = $di;\n }", "public function setDeferredDeliveryWorkDays($deferredDeliveryWorkDays) {\n $this->_deferredDeliveryWorkDays = $deferredDeliveryWorkDays;\n }", "public function setAsync(string $async): self;", "public function setDTD($dtd)\n {\n $this->dtd = $dtd;\n return $this;\n }", "function filter_script_loader_tag( $tag, $handle ) {\n foreach ( [ 'async', 'defer' ] as $attr ) {\n if ( ! wp_scripts()->get_data( $handle, $attr ) ) {\n continue;\n }\n // Prevent adding attribute when already added in #12009.\n if ( ! preg_match( \":\\s$attr(=|>|\\s):\", $tag ) ) {\n $tag = preg_replace( ':(?=></script>):', \" $attr\", $tag, 1 );\n }\n // Only allow async or defer, not both.\n break;\n }\n return $tag;\n}", "public function setRequired(bool $required): self\n {\n\t\t$this->required = $required;\n\t\treturn $this;\n\t}", "public function defer()\n\t{\n\t\tif ( ! $this->isEmpty())\n\t\t{\n\t\t\t$this->collection->defer($this);\n\t\t}\n\t\treturn $this;\n\t}", "public function define(Container $di);", "function __construct($di)\n {\n $this->cont = $di;\n }", "function AddRelAttribute($tag, $handle) {\n \n\n if($handle == 'main-style-preload'){\n\n return str_replace(\"rel='stylesheet'\", \"rel='preload' as='style'\", $tag); \n\n }else{\n \n return str_replace('href', 'defer=\"defer\" href', $tag);\n }\n\n }", "protected function enqueueDeferredImport(string $uuid) {\n\n try {\n /** @var \\Drupal\\dkan_datastore\\Manager\\Helper $managerBuilderHelper */\n $managerBuilderHelper = \\Drupal::service('dkan_datastore.manager.datastore_manager_builder_helper');\n\n $resource = $managerBuilderHelper->newResourceFromEntity($uuid);\n\n /** @var \\Drupal\\dkan_datastore\\Manager\\DeferredImportQueuer $deferredImporter */\n $deferredImporter = \\Drupal::service('dkan_datastore.manager.deferred_import_queuer');\n\n return $deferredImporter->createDeferredResourceImport($uuid, $resource);\n }\n catch (\\Exception $e) {\n $logger = $this->getLogger('dkan_api');\n\n $logger->log(RfcLogLevel::ERROR, \"Failed to enqueue dataset import for {$uuid}. Reason: \" . $e->getMessage());\n $logger->log(RfcLogLevel::DEBUG, $e->getTraceAsString());\n }\n }", "function test_deferred_download() {\n\t\t$dowload = $this->api->deferred_download( 12345 );\n\t\t$this->assertContains( 'deferred_download=1', $dowload );\n\t\t$this->assertContains( 'item_id=12345', $dowload );\n\t}", "public function getReservedForFutureUse1Attribute(){}", "public function setIsDdl($var)\n {\n GPBUtil::checkBool($var);\n $this->writeOneof(10, $var);\n\n return $this;\n }", "function setId_dl($iid_dl = '')\n {\n $this->iid_dl = $iid_dl;\n }", "public function setDW($dw) {}", "abstract public function setAttribute($name, $value, $domain = '');", "public static function directive($name, callable $handler)\n {\n }", "function script_loader_tag( $tag, $handle ) {\n\t$script_execution = wp_scripts()->get_data( $handle, 'script_execution' );\n\n\tif ( ! $script_execution ) {\n\t\treturn $tag;\n\t}\n\n\tif ( 'async' !== $script_execution && 'defer' !== $script_execution ) {\n\t\treturn $tag;\n\t}\n\n\t// Abort adding async/defer for scripts that have this script as a dependency. _doing_it_wrong()?\n\tforeach ( wp_scripts()->registered as $script ) {\n\t\tif ( in_array( $handle, $script->deps, true ) ) {\n\t\t\treturn $tag;\n\t\t}\n\t}\n\n\t// Add the attribute if it hasn't already been added.\n\tif ( ! preg_match( \":\\s$script_execution(=|>|\\s):\", $tag ) ) {\n\t\t$tag = preg_replace( ':(?=></script>):', \" $script_execution\", $tag, 1 );\n\t}\n\n\treturn $tag;\n}", "public function setImmediate($immediate) {\r\n $this->immediate = $immediate;\r\n $this->handleAttribute(\"immediate\", $immediate);\r\n }", "public function withDynamicOptionAttribute($attributeName) {\n $eagerLoad = $this->parseWithRelations(func_get_args());\n $this->eagerLoad = array_merge($this->eagerLoad, $eagerLoad);\n $this->dyn_eagerLoad[$attributeName] = 2; //2 means options\n return $this;\n }", "public function setDie($die = true){\n\t\t$this->die = $die;\n\t\treturn $this;\n\t}", "function defer_parsing_of_js ( $url ) {\nif ( FALSE === strpos( $url, '.js' ) ) return $url;\nif ( strpos( $url, 'jquery.js' ) ) return $url;\nreturn \"$url' defer\";\n}", "public function setIsRequired($required);", "public function setEffect( $effect ) {\n $this->effect = $effect;\n }", "public function setFallback(mixed $closure): void\n {\n $this->fallback = $closure;\n }", "public function initAttribute();", "public function add_script_tag_attributes($tag, $handle) {\n switch ($handle) {\n // adding async to main js bundle\n // for defer, replace async=\"async\" with defer=\"defer\"\n case ('pan_bootstrap_scripts'):\n return str_replace( ' src', ' async=\"async\" src', $tag );\n break;\n\n // example adding CDN integrity and crossorigin attributes\n // Note: popper.js is loaded into the main.bundle.js from npm\n // This is just an example\n case ('popper-js'):\n return str_replace( ' min.js', 'min.js\" integrity=\"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q\" crossorigin=\"anonymous\"', $tag );\n break;\n\n // example adding CDN integrity and crossorigin attributes\n // Note: bootstrap.js is loaded into the main.bundle.js from npm\n // This is just an example\n case ('bootstrap-js'):\n return str_replace( ' min.js', 'min.js\" integrity=\"sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4\" crossorigin=\"anonymous\"', $tag );\n break;\n\n default:\n return $tag;\n\n } // /switch\n }", "private function initConfig($di, $config) {\n\t\t\t$di->set('config', function() use ($config){\n\t\t\t\n\t\t\t\treturn $config;\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}", "public function doSetFieldAsRequired($key, $is_required = true) {\n\t\ttrigger_error('Use not $this->doSetFieldAsRequired() but $this->setVarInfo() instead!', E_USER_DEPRECATED);\n\t\t$this->setVarInfo($key, 'required', $is_required);\n\t}", "public function registerAutoloaders( \\Phalcon\\DiInterface $di = null ) {\n\t}", "public function setDI($dependencyInjector){\n $this->di = $dependencyInjector;\n }", "public function setRequired($required);" ]
[ "0.74257594", "0.6482481", "0.6467706", "0.62544495", "0.61278075", "0.6060733", "0.6058474", "0.57002324", "0.55689037", "0.54639184", "0.54639184", "0.51971984", "0.5063643", "0.50470513", "0.49950242", "0.4991649", "0.4966507", "0.4917897", "0.49089915", "0.485775", "0.4831112", "0.47516403", "0.47273186", "0.47204494", "0.46769437", "0.46618176", "0.46138865", "0.45143855", "0.45018712", "0.44602734", "0.4450823", "0.444002", "0.44394356", "0.44040316", "0.4398209", "0.4380708", "0.4369086", "0.43583792", "0.43367597", "0.43344587", "0.43118894", "0.43093187", "0.42829332", "0.42786658", "0.4271538", "0.4269762", "0.4269762", "0.42561752", "0.4239988", "0.42386165", "0.4233114", "0.42328948", "0.4231443", "0.42295468", "0.4210785", "0.41926616", "0.41528577", "0.41526207", "0.41504472", "0.41497138", "0.4145993", "0.41445976", "0.41414607", "0.4136578", "0.41348666", "0.41194898", "0.4107599", "0.41001555", "0.40873557", "0.40871942", "0.4067752", "0.40644285", "0.40578377", "0.40488833", "0.40488717", "0.4047221", "0.4045275", "0.40452737", "0.4044893", "0.40396166", "0.4038058", "0.40359855", "0.4034545", "0.40304422", "0.40290728", "0.4017727", "0.4016635", "0.4012788", "0.40123063", "0.40121907", "0.4003039", "0.40023655", "0.3995374", "0.39937678", "0.3984146", "0.39825726", "0.39793646", "0.39669007", "0.39659575", "0.3963465" ]
0.69802904
1
Defines the src attribute.
public function src($value = null){ return $this->attr(ATTR_SRC, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSrc(string $src) {\n $this->attributes()->set('src', $src);\n return $this;\n }", "public function getSrc(): string {\n return $this->attributes()->getValue('src');\n }", "public function setSrc(URL $src)\n {\n $this->src = $src;\n list($this->width, $this->height) = getimagesize($src->getURL());\n $this->setAttributes(\"Src\");\n }", "public function src( string $src ): self {\n\t\t$this->src = $src;\n\t\treturn $this;\n\t}", "public function setSrc($value)\n {\n return $this->set(self::SRC, $value);\n }", "public function getSrc(): string {\n return (string) $this->getAttribute('src');\n }", "public function setDataSrc($src)\n {\n $this->_dataSrc = $src;\n }", "public function __construct($src = '#', $alt = null, $attributes = array())\n {\n if (static::$urlGenerator) {\n $src = static::$urlGenerator->asset($src);\n }\n if (!$alt) {\n $alt = basename($src);\n }\n\n $attributes['src'] = $src;\n $attributes['alt'] = $alt;\n\n $this->attributes = $attributes;\n }", "public function setSrc($src) {\n\t\t$this->src = $src;\n\n\t\treturn $this;\n\t}", "public function getSrc()\n {\n return $this->src;\n }", "public function getSrc()\n {\n return $this->src;\n }", "public function getSrc();", "public function src($source)\n {\n $this->attributes->establish(SrcAttribute::class)->setValue($source);\n return $this;\n }", "public function src($src)\n\t{\n\t\treturn $this->media($src);\n\t}", "protected function setSrcAttribute(DOMElement $node, SourceSet $sourceSet, string $srcAttr)\n {\n $node->setAttribute($srcAttr, $sourceSet->getSrcAttribute());\n }", "protected function getSrcAttributeNameForRegex(): string\n {\n if (count($this->settings->sourceAttribute) < 1) {\n return 'src';\n }\n\n return implode('|', $this->settings->sourceAttribute);\n }", "public function getSrcAttribute($node)\n {\n $src = $node->getAttribute('src');\n return trim($src, '/');\n }", "function source(string $src, string $type = 'unknown', string $attributes = '', bool $indexPage = false): string\n {\n if (! _has_protocol($src)) {\n $src = $indexPage === true ? site_url($src) : slash_item('baseURL') . $src;\n }\n\n $source = '<source src=\"' . $src\n . '\" type=\"' . $type . '\"';\n\n if (! empty($attributes)) {\n $source .= ' ' . $attributes;\n }\n\n return $source . _solidus() . '>';\n }", "public function getThumbSrcAttribute()\n {\n return $this->present()->thumbSrc(null, 22, [], 'name');\n }", "function ImageSRC()\n\t{\treturn $this->imagelocation . (int)$this->id . \".jpg\";\n\t}", "public function getSrc()\n {\n $value = $this->get(self::SRC);\n return $value === null ? (string)$value : $value;\n }", "public function setSource(string $src)\n {\n $this->source = $src;\n return $this;\n }", "public function __construct($src = \"\", $alt = \"\", $dimension = \"\", $event = \"\")\n {\n parent::__construct($alt);\n $src = ($src instanceof URL)?$src:new URL($src);\n $this->setSrc($src);\n if (!empty($alt)) {\n $this->setAlt($alt);\n }\n if (is_numeric($dimension)) {\n $this->setWidth($dimension);\n $this->setHeight($dimension);\n }\n if (!empty($event)) {\n $this->setEvent($event);\n }\n }", "public function getAbsoluteSrc();", "function img_tag($src, array $attributes = array())\r\n{\r\n $attributes['src'] = $src;\r\n\r\n return tag('img', $attributes);\r\n}", "public function img($src = \"\", $alt = \"\") {\n echo \"<img src=assets/img/'\" . $src . \"' alt='\" . $alt . \"'>\";\n }", "public function getImgMainSrcAttribute()\n {\n if (strpos($this->main_img, 'http') !== false) {\n return $this->main_img;\n } else if ($this->main_img) {\n return url(\"/api/images/catalogs/$this->id/main?ver=\" . rand(0, 1000000));\n }\n\n return null;\n }", "public function getImgSRC()\n {\n return $this->imgSRC;\n }", "public function addImg ($src, $attributes = array ())\n\t{\n\t\tif (!preg_match('#^(\\w+://)# i', $src)) {\n\n\t\t\t// Trim the trailing slash\n\t\t\t$src = ltrim($src, \"\\t\\n\\r\");\n\t\t}\n\t\t$attributes['src'] = $src;\n\t\t$attributes['alt'] = (isset($attributes['alt'])) ? $attributes['alt'] : pathinfo($src, PATHINFO_FILENAME);\n\n\t\treturn html_tag('img', $attributes);\n\t}", "public function getBaseImageSource()\n {\n return $this->getBaseImageAttribute('src');\n }", "public function getImageUrlAttribute()\n {\n if (!$this->image_extension) return null;\n return asset($this->imageDirectory . '/' . $this->imageFileName);\n }", "public function setSrcLang($srclang) {\n return $this->setAttribute('srclang', $srclang);\n }", "public function src(){\n return $this->imageFirstInContent;\n }", "function img($src = '', $attributes = '', $index_page = false)\n\t{\n\t\tif ( ! is_array($src) )\n\t\t{\n\t\t\t$src = array('src' => $src);\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset($src['alt']))\n\t\t{\n\t\t\t$src['alt'] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ($src as $k => $v)\n\t\t{\n\t\t\tif ($k === 'src' && ! preg_match('#^(data:[a-z,;])|(([a-z]+:)?(?<!data:)//)#i', $v))\n\t\t\t{\n\t\t\t\tif ($index_page === true)\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"'.get_instance()->config->site_url($v).'\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"'.get_instance()->config->slash_item('base_url').$v.'\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' '.$k.'=\"'.$v.'\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img._stringify_attributes($attributes).' />';\n\t}", "public function getImgSubSrcAttribute()\n {\n if (strpos($this->sub_img, 'http') !== false) {\n return $this->sub_img;\n } else if ($this->sub_img) {\n return url(\"/api/images/catalogs/$this->id/sub?ver=\" . rand(0, 1000000));\n }\n\n return null;\n }", "public function getSrcPath()\n {\n return $this->getSettingArray()[\"src_path\"];\n }", "public function getImageSrc()\n {\n return $this->imageSrc;\n }", "function img( $src = '', $index_page = FALSE, $attributes = '' )\n\t{\n\t\tif ( ! is_array( $src ) )\n\t\t{\n\t\t\t$src = [ 'src' => $src ];\n\t\t}\n\n\t\t// If there is no alt attribute defined, set it to an empty string\n\t\tif ( ! isset( $src[ 'alt' ] ) )\n\t\t{\n\t\t\t$src[ 'alt' ] = '';\n\t\t}\n\n\t\t$img = '<img';\n\n\t\tforeach ( $src as $k => $v )\n\t\t{\n\t\t\tif ( $k === 'src' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t{\n\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . get_instance()->config->site_url( $v ) . '\"';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$img .= ' src=\"' . \\O2System::$config->slash_item( 'base_url' ) . $v . '\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img .= ' ' . $k . '=\"' . $v . '\"';\n\t\t\t}\n\t\t}\n\n\t\treturn $img . _stringify_attributes( $attributes ) . ' />';\n\t}", "public function getImageUrlAttribute()\n {\n return self::IMAGE_PATH . $this->image;\n }", "public function getImageUrlAttribute()\n {\n return self::IMAGE_PATH . $this->image;\n }", "protected function setSource(Image $source){\n\t\t$this->source = $source;\n\t}", "function image (&$src) {\n\t // Check only if STS is enabled.\n if (MODULE_STS_DEFAULT_STATUS==\"true\" && $this->is_button ==false)\n if (file_exists(STS_TEMPLATE_DIR . $src)) $src = STS_TEMPLATE_DIR . $src;\n\t\t$this->is_button = false;\n\t}", "public function setSource( $url ) {\n\t\t$this->source = $url;\n\t}", "public function getImageAttribute($val){\n return ($val !== null) ? asset('assets/admin/images/'.$val) : \"\";\n }", "public function srcset($value = null)\n {\n if (!empty($value)) {\n $this->srcset = $value;\n return;\n }\n\n // If the full size was requested, render as is.\n if ($this->size && $this->size === 'full') {\n return $this->src;\n }\n\n $normal = $this->resize();\n $retina = $this->retina();\n\n $sources[] = $normal->src . ' ' . $normal->width . 'w';\n\n if ($retina->src && ($retina->src != $normal->src)) {\n $sources[] = $retina->src . ' 2x';\n $sources[] = $retina->src . ' ' . $retina->width .'w';\n }\n\n // If it's a larger image, provide a version in half it's size.\n if ($this->r_width > 400) {\n $half = $this->resize(round($this->r_width/2), round($this->r_height/2));\n\n if ($half->src != $normal->src) {\n $sources[] = $half->src . ' ' . $half->width .'w';\n }\n }\n\n return implode(', ', $sources);\n }", "public function getPhotoUrlAttribute()\n {\n return asset(env('FRONTEND_IMAGES_PATH') . $this->image);\n }", "public function src( $size = 'full' ) {\n\t\tif ( 'full' === $size ) {\n\t\t\tHelper::warn( 'Using an image without specifying size' );\n\t\t\treturn;\n\t\t}\n\t\treturn parent::src( $size );\n\t}", "function set_img_src($imgsrc, $width = null, $height = null, $returnindex = 0) {\n if (!empty($imgsrc)) {\n $arrsrc = explode(\",\", $imgsrc);\n $src = $arrsrc[$returnindex];\n $imgpath = \"helpers/timthumb.php?src=$src\";\n $imgpath .= ($height != null ? \"&h=$height\" : null);\n $imgpath .= ($width != null ? \"&w=$width\" : null);\n return $imgpath;\n }\n return null;\n}", "protected function getSrcAttribute($node): ImageSource\n {\n $sourceAttr = 'src';\n $targetAttr = 'srcset';\n\n // Use the src attribute by default.\n $src = $node->getAttribute($sourceAttr);\n\n // If alternative sources are available, check if the\n // $node has them defined and use the first one\n // that is available.\n $altSources = $this->settings->sourceAttribute;\n foreach ($altSources as $index => $altSrc) {\n if ($altSrc && $node->getAttribute($altSrc) !== '') {\n $src = $node->getAttribute($altSrc);\n $sourceAttr = $altSrc;\n $targetAttr = $this->getTargetAttrAtIndex($index);\n break;\n }\n }\n\n // If the protocol is missing from the URL prepend it.\n // It doesn't matter if it matches the actual protocol since it will\n // be striped out later anyway. We just need it to make sure the\n // parsing of the image path works as intended.\n if (starts_with($src, '//')) {\n $src = 'http:' . $src;\n }\n\n $src = trim($src, '/');\n\n return ImageSource::make($node, $src, $sourceAttr, $targetAttr);\n }", "public function getLinkAttribute ()\n {\n return asset($this->path.$this->image);\n }", "public function setImageSourcePath($strSource = NULL) {\r\n\t\t\t$this->objParent->source_path = __SITE_ROOT__ . str_replace(__SITE_ROOT__, \"\", $strSource);\t \r\n\t\t }", "public function src(string $path) : SourceParser\n\t{\n\t\t$this->srcPath = $path;\n\n\t\treturn $this;\n\t}", "static function img($source, $id = Null, $class = Null) \n {\n $file_name = array_pop(explode(\"/\", $source));\n $name = array_shift(explode(\".\", $file_name));\n return '<img' . self::_id($id) . self::_class($class) . ' src=\"'.$source.'\" title=\"'.$name.'\" alt=\"'.$name.'\" />'.self::$_nl;\n }", "public function html_attr_image_src( $image_src, $image_link = true ) \n\t\t{\n\t\t\tif( ! is_array( $image_src ) )\n\t\t\t{\n\t\t\t\treturn $image_link ? 'src=\"' . esc_attr( $image_src ) . '\"' : 'href=\"' . esc_attr( $image_src ) . '\"';\n\t\t\t}\n\t\t\t\n\t\t\t$atts = array();\n\t\t\t\n\t\t\tforeach( $image_src as $key => $value ) \n\t\t\t{\n\t\t\t\t//\tPHP fix < 8.0: case does not compare string and int -> force to string and compare strings !!!\n\t\t\t\t$key .= '';\n\t\t\t\t\n\t\t\t\tswitch( $key )\n\t\t\t\t{\n\t\t\t\t\tcase '0':\t\t\t\t//\t= url\n\t\t\t\t\t\t$a = $image_link ? 'src' : 'href';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'srcset':\n\t\t\t\t\tcase 'sizes':\n\t\t\t\t\t\t$a = $image_link ? $key : 'data-' . $key;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$a = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( is_null( $a ) || empty( $value ) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$atts[] = $a . '=\"' . esc_attr( $value ) . '\"';\n\t\t\t}\n\t\t\t\n\t\t\treturn implode( ' ', $atts );\n\t\t}", "function getImageSource() {return $this->_imagesource;}", "public function image($src,$alt = null)\r\n {\r\n $element = $this->element('img')->attribute('src',$src);\r\n\r\n if(!is_null($alt))\r\n {\r\n $element->attribute('alt',$alt);\r\n }\r\n\r\n return $element;\r\n }", "public static function img(string $src, array $attr = []): string\n {\n $attr = array_merge([\n 'src' => $src,\n 'alt' => ' '\n ], $attr);\n\n return static::tag('img', '', $attr);\n }", "public function getSource()\n {\n return 'image';\n }", "function img($src = '', bool $indexPage = false, $attributes = ''): string\n {\n if (! is_array($src)) {\n $src = ['src' => $src];\n }\n if (! isset($src['src'])) {\n $src['src'] = $attributes['src'] ?? '';\n }\n if (! isset($src['alt'])) {\n $src['alt'] = $attributes['alt'] ?? '';\n }\n\n $img = '<img';\n\n // Check for a relative URI\n if (! preg_match('#^([a-z]+:)?//#i', $src['src']) && strpos($src['src'], 'data:') !== 0) {\n if ($indexPage === true) {\n $img .= ' src=\"' . site_url($src['src']) . '\"';\n } else {\n $img .= ' src=\"' . slash_item('baseURL') . $src['src'] . '\"';\n }\n\n unset($src['src']);\n }\n\n // Append any other values\n foreach ($src as $key => $value) {\n $img .= ' ' . $key . '=\"' . $value . '\"';\n }\n\n // Prevent passing completed values to stringify_attributes\n if (is_array($attributes)) {\n unset($attributes['alt'], $attributes['src']);\n }\n\n return $img . stringify_attributes($attributes) . _solidus() . '>';\n }", "function initialize () {\n $this->set_openingtag ( \"<IMG alt=\\\"\" );\n\t $this->set_closingtag ( \"\\\"[attributes]/>\" );\n }", "public function setUrlAttribute($value)\n {\n \tif ( empty($value) ) {\n \t\t$this->attributes['url'] = NULL;\n \t} else {\n \t$this->attributes['url'] = $value;\n \t}\n }", "public function __construct($src, $width, $height){\r\r\n\t\t$this->src = $src;\r\r\n\t\t$this->width = $width;\r\r\n\t\t$this->height = $height;\r\r\n\t\t\r\r\n\t\t$this->SetType(\"application/x-shockwave-flash\");\r\r\n\t\t\r\r\n\t\t$this->attributes = array();\r\r\n\t}", "public function setSourceImage($value)\n {\n return $this->set('SourceImage', $value);\n }", "public function hasSrc()\n {\n return $this->get(self::SRC) !== null;\n }", "public function getUrlAttribute() {\n return '/images/uploads/'.$this->id.'/'.$this->filename;\n }", "public function src_sizes($value = null)\n {\n $this->src_sizes = $value;\n }", "public function setSourcePath(string $sourcePath): AssetInterface\n {\n }", "public function getUrlAttribute(){\n if(substr($this->image,0,4)=== \"http\"){\n return $this->image;\n }\n //o si viene de la carpeta public\n return '/images/products/' . $this->image;\n }", "public function getCoverUrlAttribute(){\n if( \\Str::startsWith($this->{'cover'} ,'http')){\n return $this->{'cover'};\n }\n return \\Storage::url($this->{'cover'});\n }", "function setHeadImage($var)\n\t{\n\t\t$this -> head_image = $var;\n\t}", "function ThumbSRC()\n\t{\treturn $this->imagelocation . \"thumbs/\" . (int)$this->id . \".jpg\";\n\t}", "public function getPhotoUrlAttribute()\n {\n return 'https://www.gravatar.com/avatar/' . md5(strtolower($this->email)) . '.jpg?s=200&d=mm';\n }", "public function getImageUrlAttribute()\n {\n return Storage::url($this->getImagePath());\n }", "public function getImageUrlAttribute($value){\n\t\t$imageUrl = \"\";\n\t\t\n\t\tif(!is_null($this->image)){\n\t\t\t$imagePath = public_path().\"/img/\".$this->image;\n\t\t\tif(file_exists($imagePath)) $imageUrl = asset('img/'.$this->image);\n\t\t}\n\t\treturn $imageUrl;\n\t}", "public function getBaseImageSource()\n {\n $baseImage = $this->_rootElement->find($this->baseImage);\n return $baseImage->isVisible() ? $baseImage->getAttribute('src') : '';\n }", "public function setImageUrl($value)\n\t{\n\t\t$this->setViewState('ImageUrl',$value,'');\n\t}", "public function setImgUrlAttribute($img_url)\n {\n /*\n * protección al actualizar un record\n * si no se quiere actualizar la imagen, no se requiere subir una imagen y guardarla en la carpeta images\n *\n * si creamos un nuevo record,\n * AdvertisemetRequest validará que se quiere subir una imagen para crear dicho record\n */\n if(!empty($img_url)) {\n /* concatena los segundos con el nombre del archivo que se subío para evitar overides */\n $name = Carbon::now()->second . $img_url->getClientOriginalName();\n /* renombra el archivo */\n $this->attributes['img_url'] = $name;\n /* almacena la imagen en nuestra caperta images */\n /* \\Storage::disk('local') = ruta de la carpeta images */\n \\Storage::disk('local')->put($name, \\File::get($img_url));\n }\n }", "public function getPictureAttribute($value)\n {\n return $this->timeline->avatar ? $this->timeline->avatar->source : url('group/avatar/default-group-avatar.png');\n }", "public function __construct()\r\r\n\t{\r\r\n\t\tparent::__construct();\r\r\n\t\t$this->strImage = preg_replace('@^/+@', '', str_replace('%20', ' ' , $this->Input->get('src')));\r\r\n\t}", "public function getThumbnailSrc($size) {\n if(!empty($this->thumbnail)) {\n return 'src=\"'.base64_decode($this->thumbnail).'\"';\n }\n return 'data-src=\"/holder.js/'.$size.'\"';\n }", "public function avatar(): Attribute\n {\n return new Attribute(\n get: fn ($value) => asset('/images/avatars/' . $value)\n );\n }", "function getUrlImg(){\n\t\treturn $this->url_img;\n\t}", "public function getSrcLang() {\n return $this->getAttribute('srclang');\n }", "public function getImageAttribute($value)\n {\n return str_replace(url('/'), '', $value);\n }", "public function getImageUrlAttribute($value) {\n $imageUrl = '';\n if(!is_null($this->image)) {\n $directory = config('cms.image.directory');\n $imagePath = public_path().\"/{$directory}/\".$this->image;\n if(file_exists($imagePath)) $imageUrl = asset('img/'.$this->image);\n }\n return $imageUrl;\n }", "public static function img($src = NULL, $alt = NULL) {\n\t\t// Create attribute list\n\t\t$attributes = is_array($src) ? $src : array('src' => $src);\n\n\t\tif (is_array($alt)) {\n\t\t\t$attributes += $alt;\n\t\t} elseif ( ! empty($alt)) {\n\t\t\t// Add alt to attributes\n\t\t\t$attributes['alt'] = $alt;\n\t\t}\n\t\tif(!isset($attributes['alt'])) $attributes['alt'] = '';\n\t\tif (strpos($attributes['src'], '://') === FALSE) {\n\t\t\t// Make the src attribute into an absolute URL\n\t\t\t$attributes['src'] = url::asset('img/'.$attributes['src']);\n\t\t}\n\n\t\treturn '<img'.html::attributes($attributes).'>';\n\t}", "public function __construct(string $src)\n {\n $this->loadSource($src);\n }", "function getSrcVarName() {\n return $this->srcVarName;\n }", "static function option_image_src( $option, $default = null ) {\n\t\tif ( isset( $_GET[ $option ] ) && ! empty( $option ) ) {\n\t\t\treturn $_GET[ $option ];\n\t\t} else {\n\t\t\t$image = self::options()->get( $option, $default );\n\n\t\t\tif ( isset( $image['url'] ) ) {\n\t\t\t\treturn $image['url'];\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public static function image($attr = NULL, $index = FALSE)\n\t{\n\t\tif ( ! is_array($attr))\n\t\t{\n\t\t\t$attr = array('src' => $attr);\n\t\t}\n\n\t\tif (strpos($attr['src'], '://') === FALSE)\n\t\t{\n\t\t\t// Make the src attribute into an absolute URL\n\t\t\t$attr['src'] = url::base($index).$attr['src'];\n\t\t}\n\n\t\treturn '<img'.html::attributes($attr).' />';\n\t}", "public function img($class = '', $src= '')\n\t{\n\t\treturn sprintf('<img src= html-2.png>',$src, $class);\n\t}", "public function getAvatarUrlAttribute()\n {\n if ( $this->avatar ) {\n $testimonial_avatar = $this->avatar;\n } else {\n $testimonial_avatar = 'testimonial-default.png';\n }\n return asset('storage/images/'.$testimonial_avatar);\n }", "public function poster(string $src): Video\n {\n $this->attrs()->set('poster', $src);\n }", "public function getStillUrlAttribute()\n {\n return $this->still_path ?\n asset(\n 'images/episodes'.$this->still_path.\n '?w='.config('airflix.tmdb.size.episodes', 480)\n ) : null;\n }", "public function setImageUrl(string $imageUrl);", "abstract public function get_thumbnail_source_path();", "function Image ($source, $title=\"\", $height, $hidth=\"\", $align=\"center\", $border=0, $valign=\"middle\", $class=\"\", \n\t\t\t$id=\"\", $name=\"\", $onAction1=\"\", $onType2=\"\", $onAction2 =\"\", $onAction3=\"\") {\n\t\t$this ->tag = '<img src=\" '.$source .' \" ';\n\t\tif ($name) $this->tag.='name=\" '.$name.' \" ';\n\t\tif ($height ==\"\") $height=16;\n\t\tif ($width ==\"\") $width=16;\n\t\t$this->tag .= 'height=\"' .$height. '\" width= \"'. $width.'\" ';\n\n\t\t$this->tag .='border=\"$border\" . ';\n\t\tif ($class) $this->tag .= 'border =\"'.$border.'\" ';\n\t\tif ($id)\t $this->tag .= 'class=\"'.class. '\" ';\n\t\tif ($title) $this ->tag .= 'title=\"' .$stitle.'\" alt=\"'.$title.'\" ';\n\t\tif ($align) $this ->tag .= 'align= 'align=\"'.$align. .'\" '';\n\t\t\n\n\n\n\t}", "public static function img($src, $alt = '', $attrs = '')\n {\n return '<img src=\"'.PUBLIC_PATH.\"img/$src\\\" alt=\\\"$alt\\\" \".Tag::getAttrs($attrs).'/>';\n }", "public function srcset( $srcs )\n\t{\n\t\tif ( $srcs ) {\n\t\t\tforeach ( $srcs as $w => $data ) {\n\t\t\t\tif( ! $url = $this->rewrite( $data[ 'url' ], LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_INC_IMG ) ) {\n\t\t\t\t\tcontinue ;\n\t\t\t\t}\n\t\t\t\t$srcs[ $w ][ 'url' ] = $url ;\n\t\t\t}\n\t\t}\n\t\treturn $srcs ;\n\t}", "public function testThemeImageWithSrc() {\n\n $image = [\n '#theme' => 'image',\n '#uri' => reset($this->testImages),\n '#width' => rand(0, 1000) . 'px',\n '#height' => rand(0, 500) . 'px',\n '#alt' => $this->randomMachineName(),\n '#title' => $this->randomMachineName(),\n ];\n $this->render($image);\n\n // Make sure the src attribute has the correct value.\n $this->assertRaw($this->fileUrlGenerator->generateString($image['#uri']), 'Correct output for an image with the src attribute.');\n }" ]
[ "0.7638734", "0.73143196", "0.7134267", "0.7128454", "0.69492644", "0.6890543", "0.6866824", "0.6854206", "0.6762052", "0.660532", "0.660532", "0.65324795", "0.648504", "0.64218956", "0.63965017", "0.62673825", "0.62655234", "0.62443805", "0.61780643", "0.6176568", "0.61533695", "0.6118078", "0.6113322", "0.6104705", "0.6084991", "0.6054272", "0.6000372", "0.5991413", "0.59722185", "0.59629434", "0.5947135", "0.59367317", "0.5933567", "0.59275985", "0.5922804", "0.5879199", "0.586698", "0.5856794", "0.58437526", "0.58437526", "0.5812256", "0.5764734", "0.57265913", "0.57084197", "0.5703344", "0.5702612", "0.569193", "0.5682583", "0.5673142", "0.5672711", "0.5669207", "0.56444865", "0.56383836", "0.56356275", "0.56324893", "0.56286854", "0.56269807", "0.5614847", "0.55975235", "0.55816466", "0.5570231", "0.55643994", "0.5560647", "0.5547251", "0.5547055", "0.55127424", "0.55083126", "0.54902273", "0.5479676", "0.5477628", "0.54652524", "0.5457248", "0.5451201", "0.54455787", "0.5426353", "0.5411405", "0.53919244", "0.53851527", "0.538177", "0.537349", "0.5350564", "0.533994", "0.53388363", "0.5338252", "0.5333716", "0.53275734", "0.5320235", "0.5314005", "0.531304", "0.5299436", "0.5292779", "0.52802414", "0.5274753", "0.52672845", "0.52622306", "0.5254552", "0.524455", "0.5234336", "0.5233076", "0.5232885" ]
0.7918457
0
This is for the typeahead lookups, restfull routes are configured in routes.php (/api/v1/)
public function index() { $datums = Company::selectRaw('name AS value') ->addSelect('id', 'address_id', 'type'); if (Input::get('q')) { $queryTokens = explode(' ', Input::get('q')); foreach ($queryTokens as $queryToken) { $datums = $datums->where(function($query) use ($queryToken) { $query->where('name', 'like', '%' . $queryToken . '%') ->orWhere('type', 'like', '%' . $queryToken . '%'); }); } } $datums = $datums->distinct()->take(50)->get(); foreach ($datums as $datum) { $datum->tokens = array_merge(explode(' ', $datum->value), [$datum->value]); $address = $datum->address()->first(); if ($address) { $datum->email = $address->email; $country = $address->country()->first(); $datum->country = $country->name; } } return Response::json($datums); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "function ap_register_search(){\n\t register_rest_route('americanpromise/v1','search', array(\n\t\t'methods' => \\WP_REST_SERVER::READABLE,\n\t\t'callback' => __NAMESPACE__ . '\\ap_search_results'\n\t));\n}", "public function suggest() {\n \n $query = ['query' => ['match_all' => []]];\n if (Request::has('q')) {\n $query = [\n 'query' => [\n 'nested' => [\n 'path' => 'prefLabels',\n 'query' => [\n 'bool' => [\n 'must' => [\n [ 'prefix' => [ 'prefLabels.label' => Request::get('q') ] ],\n [ 'match' => [ 'prefLabels.lang' => 'en' ] ]\n ]\n ]\n ]\n ]\n ]\n ];\n }\n \n $hits = Subject::suggest($query, 'resource');\n return response()\n ->json($hits)\n ->header(\"Vary\", \"Accept\");\n }", "public function handleAutocomplete(Request $request, $type) {\n $input = $request->query->get('q');\n $results = $this->solrRequest->autocomplete($type, $input);\n return new JsonResponse($results);\n }", "function suggest() {\n $suggestions = $this->tour->get_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function SearchByName(Request $request)\n\t{\n\t\t$searchString = trim(Input::get('searchString'));\n\t\t$negative = false;\n\t\t$primary = false;\n\t\t$secondary = false;\n\t\t$searchClassifier = null;\n\t\t\n\t\t//Pull the negative out\n\t\tif ($searchString[0] == \"-\")\n\t\t{\n\t\t\t$negative = true;\n\t\t\t$searchString = trim(substr($searchString, 1));\n\t\t}\n\t\t\n\t\t//Pull primary and secondary out\n\t\t$flag_marker = strpos($searchString, ':');\n\t\tif ($flag_marker !== false)\n\t\t{\n\t\t\t$flag = strtolower(substr($searchString, 0, $flag_marker));\n\t\t\t\n\t\t\tif ($flag == \"primary\")\n\t\t\t{\n\t\t\t\t$primary = true;\n\t\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t\t}\n\t\t\telse if ($flag == \"secondary\")\n\t\t\t{\n\t\t\t\t$secondary = true;\n\t\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//Pull targeting out\n\t\t$flag_marker = strpos($searchString, ':');\n\t\tif ($flag_marker !== false)\n\t\t{\n\t\t\t//Get the contents before the \":\" to check for search clarifiers\n\t\t\t$searchClassifier = strtolower(substr($searchString, 0, $flag_marker));\n\t\t\t$searchString = trim(substr($searchString, $flag_marker + 1));\n\t\t}\n\t\t\n\t\t$values = array();\n\t\tif ($searchClassifier == \"artist\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::ArtistLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"artist:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"character\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::CharacterLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"character:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"scanalator\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::ScanalatorLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"series\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::SeriesLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"series:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"tag\")\n\t\t{\n\t\t\t$values = SearchLookupHelper::TagLookupHelper($searchString);\n\t\t\tforeach ($values as $value)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($value['value'], \"tag:\", $primary, $secondary, $negative);\n\t\t\t\t\n\t\t\t\t$value['value'] = $returnString;\n\t\t\t\t$value['label'] = $returnString;\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"language\")\n\t\t{\n\t\t\t$languages = Language::where('languages.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'languages.id', '=', 'collections.language_id')->select('languages.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($languages as $language)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($language, \"language:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"rating\")\n\t\t{\n\t\t\t$ratings = Rating::where('ratings.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'ratings.id', '=', 'collections.rating_id')->select('ratings.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($ratings as $rating)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($rating, \"rating:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse if ($searchClassifier == \"status\")\n\t\t{\n\t\t\t$statuses = Status::where('statuses.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'statuses.id', '=', 'collections.status_id')->select('statuses.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->pluck('name');\n\t\t\t\n\t\t\tforeach ($statuses as $status)\n\t\t\t{\n\t\t\t\t$returnString = self::BuildTypeAheadString($status, \"status:\", false, false, $negative);\n\t\t\t\tarray_push($values, ['value' => $returnString, 'label' => $returnString]);\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\t\n\t\t\t//Get artists with total\n\t\t\t$artists = Artist::where('artists.name', 'like', '%' . $searchString . '%')->leftjoin('artist_collection', 'artists.id', '=', 'artist_collection.artist_id')->select('artists.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$artists = $artists->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"artist:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global artist aliases with total\n\t\t\t$global_artist_aliases = ArtistAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('artists', 'artists.id', '=', 'artist_alias.artist_id')->leftjoin('artist_collection', 'artists.id', '=', 'artist_collection.artist_id')->select('artist_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_artist_aliases = $global_artist_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"artist:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get characters with total\n\t\t\t$characters = Character::where('characters.name', 'like', '%' . $searchString . '%')->leftjoin('character_collection', 'characters.id', '=', 'character_collection.character_id')->select('characters.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$characters = $characters->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"character:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\n\t\t\t//Get global character aliases with total\n\t\t\t$global_character_aliases = CharacterAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('characters', 'characters.id', '=', 'character_alias.character_id')->leftjoin('character_collection', 'characters.id', '=', 'character_collection.character_id')->select('character_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$global_character_aliases = $global_character_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"character:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\n\t\t\t//Get scanalators with total\n\t\t\t$scanalators = Scanalator::where('scanalators.name', 'like', '%' . $searchString . '%')->leftjoin('chapter_scanalator', 'scanalators.id', '=', 'chapter_scanalator.scanalator_id')->select('scanalators.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$scanalators = $scanalators->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global scanalator aliases with total\n\t\t\t$global_scanalator_aliases = ScanalatorAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('scanalators', 'scanalators.id', '=', 'scanalator_alias.scanalator_id')->leftjoin('chapter_scanalator', 'scanalators.id', '=', 'chapter_scanalator.scanalator_id')->select('scanalator_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_scanalator_aliases = $global_scanalator_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"scanalator:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get series with total\n\t\t\t$series = Series::where('series.name', 'like', '%' . $searchString . '%')->leftjoin('collection_series', 'series.id', '=', 'collection_series.series_id')->select('series.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$series = $series->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"series:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global series aliases with total\n\t\t\t$global_series_aliases = SeriesAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('series', 'series.id', '=', 'series_alias.series_id')->leftjoin('collection_series', 'series.id', '=', 'collection_series.series_id')->select('series_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_series_aliases = $global_series_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"series:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\n\t\t\t//Get global tags with total\n\t\t\t$tags = Tag::where('tags.name', 'like', '%' . $searchString . '%')->leftjoin('collection_tag', 'tags.id', '=', 'collection_tag.tag_id')->select('tags.*', DB::raw('count(*) as total'))->groupBy('name')->orderBy('total', 'desc')->take(5)->get();\n\t\t\n\t\t\t$tags = $tags->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"tag:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t//Get global tag aliases with total\n\t\t\t$global_tag_aliases = TagAlias::where('user_id', '=', null)->where('alias', 'like', '%' . $searchString . '%')->leftjoin('tags', 'tags.id', '=', 'tag_alias.tag_id')->leftjoin('collection_tag', 'tags.id', '=', 'collection_tag.tag_id')->select('tag_alias.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$global_tag_aliases = $global_tag_aliases->map(function ($item) use ($primary, $secondary, $negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->alias, \"tag:\", $primary, $secondary, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$languages = Language::where('languages.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'languages.id', '=', 'collections.language_id')->select('languages.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$languages = $languages->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"language:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$ratings = Rating::where('ratings.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'ratings.id', '=', 'collections.rating_id')->select('ratings.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$ratings = $ratings->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"rating:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$statuses = Status::where('statuses.name', 'like', '%' . $searchString . '%')->leftjoin('collections', 'statuses.id', '=', 'collections.status_id')->select('statuses.*', DB::raw('count(*) as total'))->groupBy('id')->orderBy('total', 'desc')->take(5)->get();\n\t\t\t\n\t\t\t$statuses = $statuses->map(function ($item) use ($negative){\n\t\t\t\t$buildString = self::BuildTypeAheadString($item->name, \"status:\", false, false, $negative);\n\t\t\t\treturn ['name' => $buildString, 'total' => $item->total];\n\t\t\t});\n\t\t\t\n\t\t\t$matches = collect();\n\t\t\t$matches->push($artists);\n\t\t\t$matches->push($global_artist_aliases);\n\t\t\t$matches->push($characters);\n\t\t\t$matches->push($global_character_aliases);\n\t\t\t$matches->push($scanalators);\n\t\t\t$matches->push($global_scanalator_aliases);\n\t\t\t$matches->push($series);\n\t\t\t$matches->push($global_series_aliases);\n\t\t\t$matches->push($tags);\n\t\t\t$matches->push($global_tag_aliases);\n\t\t\t$matches->push($languages);\n\t\t\t$matches->push($ratings);\n\t\t\t$matches->push($statuses);\t\t\t\n\t\t\n\t\t\t$matches = $matches->flatten(1);\n\t\t\t$matches = $matches->sortByDesc('total');\n\t\t\t$typeAheadCollection = $matches->take(5)->pluck('name');\n\t\t\n\t\t\t$typeAheadCollection = $typeAheadCollection->sort();\n\t\t\t\n\t\t\tforeach ($typeAheadCollection as $typeAhead)\n\t\t\t{\n\t\t\t\tarray_push($values, ['value' => $typeAhead, 'label' => $typeAhead]);\n\t\t\t}\t \n\t\t}\n\t\t\n\t\treturn $values;\n\t}", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function autocompleteAction() {\n $suggestions = array(\n 'Application',\n 'Big',\n 'Computer',\n 'Development',\n 'Environment',\n 'Failure',\n 'Green',\n 'Hope',\n 'Injection',\n 'Java',\n 'Kilo'\n );\n\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n\n echo json_encode($suggestions);\n }", "public function getAutocomplete()\n {\n // get a suggester query instance\n $query = $this->client->createSuggester();\n $query->setQuery(strtolower(Input::get('term')));\n $query->setDictionary('suggest');\n $query->setOnlyMorePopular(true);\n $query->setCount(10);\n $query->setCollate(true);\n\n // this executes the query and returns the result\n $resultset = $this->client->suggester($query);\n\n $suggestions = array();\n\n foreach ($resultset as $term => $termResult) {\n foreach ($termResult as $result) {\n $suggestions[] = $result;\n }\n }\n\n return Response::json($suggestions);\n }", "function optimatRegisterSearch() {\n\t// new api search url: 1. name 2. route\n\tregister_rest_route('optimat/v1', 'search', array(\n\t\t'methods' => WP_REST_SERVER::READABLE, // like 'GET'\n\t\t'callback' => 'optimatSearchResults'\n\t)); \n}", "function suggest() {\n $suggestions = $this->ticket->get_search_suggestions($this->input->get('term'), 100);\n\n echo json_encode($suggestions);\n }", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function autocomplete() {\n $a_like = explode(' | ', $_GET['q']);\n $like_barang = isset($a_like[1]) ? $a_like[1] : (isset($a_like[0]) ? $a_like[0] : 'unknown');\n $list = Barang::select('id', 'nama')->where('nama', 'like', '%'. $like_barang .'%')->orderBy('nama')->get();\n \n $rows = array();\n foreach($list as $item) {\n //$rows[] = $item->nama;\n $rows[] = $item->id . ' | ' . $item->nama;\n }\n \n return response()->json($rows);\n }", "public function _replyToReturnAutoCompleteRequest() {\n\n if ( ! $this->_isLoggedIn() ) { exit; }\n if ( ! isset( $_GET['q'] ) ) { exit; }\n\n $_aGet = $_GET;\n unset( $_aGet['request'], $_aGet['page'], $_aGet['tab'], $_aGet['settings-updated'] );\n\n $_aData = array();\n $_sType = isset( $_GET['type'] ) ? $_GET['type'] : '';\n switch ( $_sType ) {\n default:\n case 'post':\n $_aData = $this->_searchPosts( $_aGet );\n break;\n case 'user':\n $_aData = $this->_searchUsers( $_aGet );\n break;\n }\n \n exit( json_encode( $_aData ) );\n \n }", "public function api()\n {\n $input = request('q');\n $tags = Tag::where('name', 'like', $input.'%')\n ->orWhere('name', 'like', '% '.$input.'%')->get(\n ['name AS text', 'id']\n )->toArray();\n\n if ($input != '')\n {\n return response()->json([\n 'results' => $tags\n ]);\n }\n else\n {\n return response()->json([\n 'results' => ''\n ]);\n }\n }", "private function rest_search() {\n\t\t// return json elements here\n\t}", "public function autocomplete()\n {\n $items = Category::orderBy('parent_id', 'ASC');\n\n $items->whereHas('translation', function ($query) {\n if (Request::filled('keyword')) {\n $query->where('title', 'LIKE', '%' . Request::input('keyword') . '%');\n } else {\n $query->where('parent_id', 0);\n }\n });\n\n\n /**\n * Content type filter\n */\n if (Request::filled('content_type_id')) {\n $items->where('content_type_id', (int) Request::input('content_type_id'));\n }\n\n\n /**\n * Query\n */\n $items = $items->paginate(5);\n\n\n /**\n * Response structure\n */\n return CategoryAutocompleteResource::collection($items);\n }", "public function index() {\n $this->response->type('application/json');\n // Search the places\n $result = $this->searchPlace();\n // Set the result to the view\n $this->set(\"result\", $result);\n // Finally return the default view\n return;\n }", "public function handleSearchRequest( $request )\n {\n\n\n }", "function customer_search() {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function register_routes() {\n\t\t$public_post_types = $this->post_type_helper->get_public_post_types();\n\n\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t\\register_rest_field( $post_type, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post' ] ] );\n\t\t}\n\n\t\t$public_taxonomies = $this->taxonomy_helper->get_public_taxonomies();\n\n\t\tforeach ( $public_taxonomies as $taxonomy ) {\n\t\t\tif ( $taxonomy === 'post_tag' ) {\n\t\t\t\t$taxonomy = 'tag';\n\t\t\t}\n\t\t\t\\register_rest_field( $taxonomy, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_term' ] ] );\n\t\t}\n\n\t\t\\register_rest_field( 'user', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_author' ] ] );\n\n\t\t\\register_rest_field( 'type', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post_type_archive' ] ] );\n\t}", "public function autocomplete()\n {\n\n $hotel_name = Input::get('name');\n\n $hotels = Hotel::select(array('id', 'name'))\n ->where('name', 'like', \"%$hotel_name%\")\n ->where('status', '=', 1)\n ->get();\n\n $hotels_array = array();\n\n foreach($hotels as $hotel) {\n $hotels_array[] = $hotel->toArray();\n }\n\n return Response::json( $hotels_array );\n }", "public function get_trainees_by_taxcode_autocomplete() {\n\n $query_string = htmlspecialchars($_GET['query'], ENT_QUOTES, 'UTF-8');\n $this->load->model('trainee_model', 'traineemodel');\n $result = $this->traineemodel->trainee_user_list_autocomplete($query_string);\n print json_encode($result);\n exit;\n }", "public function search() {\n\t\t$this->ApiClass = ClassRegistry::init('ApiGenerator.ApiClass');\n\t\t$conditions = array();\n\t\tif (isset($this->params['url']['query'])) {\n\t\t\t$query = $this->params['url']['query'];\n\t\t\t$conditions = array('ApiClass.search_index LIKE' => '%' . $query . '%');\n\t\t}\n\t\t$this->paginate['fields'] = array('DISTINCT ApiClass.name', 'ApiClass.search_index');\n\t\t$this->paginate['order'] = 'ApiClass.name ASC';\n\t\t$results = $this->paginate($this->ApiClass, $conditions);\n\t\t$classIndex = $this->ApiClass->getClassIndex();\n\t\t$this->helpers[] = 'Text';\n\t\t$this->set(compact('results', 'classIndex'));\n\t}", "function apsa_ajax_autocomplete() {\n global $apsa_plugin_data;\n global $apsa_admin_labels;\n\n if (isset($_GET[\"query\"])) {\n $search_query = $_GET[\"query\"];\n\n $all_taxonomies = get_taxonomies();\n unset($all_taxonomies[\"link_taxonomy\"]);\n unset($all_taxonomies[\"post_format\"]);\n\n $all_terms = get_terms($all_taxonomies, array(\n \"hide_empty\" => FALSE,\n \"name__like\" => $search_query,\n \"offset\" => 100\n ));\n\n $responce_array = array();\n\n // added all posts and all pages\n if (mb_strpos(mb_strtolower($apsa_admin_labels[\"apsa_all_pages\"]['loc']), mb_strtolower($search_query)) !== false) {\n array_push($responce_array, array(\n \"value\" => \"page%apsa_all_pages%\" . $apsa_admin_labels[\"apsa_all_pages\"]['not_loc'] . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => $apsa_admin_labels[\"apsa_all_pages\"]['loc'],\n \"type\" => 'page'\n ));\n }\n if (mb_strpos(mb_strtolower($apsa_admin_labels[\"apsa_all_posts\"]['loc']), mb_strtolower($search_query)) !== false) {\n array_push($responce_array, array(\n \"value\" => \"post%apsa_all_posts%\" . $apsa_admin_labels[\"apsa_all_posts\"]['not_loc'] . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => $apsa_admin_labels[\"apsa_all_posts\"]['loc'],\n \"type\" => 'post'\n ));\n }\n\n foreach ($all_terms as $key => $term) {\n if ($term->taxonomy == \"post_tag\") {\n array_push($responce_array, array(\n \"value\" => \"post_tag%\" . $term->term_id . \"%\" . $term->name . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => html_entity_decode($term->name),\n \"type\" => 'post_tag'\n ));\n } else {\n array_push($responce_array, array(\n \"value\" => \"category%\" . $term->term_id . \"%\" . $term->name . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => html_entity_decode($term->name),\n \"type\" => 'category'\n ));\n }\n }\n\n // The Query\n add_filter('posts_where', 'apsa_title_like_posts_where', 10, 2);\n\n function apsa_title_like_posts_where($where, &$wp_query) {\n global $wpdb;\n if ($post_title_like = $wp_query->get('post_title_like')) {\n $wp_version = get_bloginfo('version');\n\n if ($wp_version < 4) {\n $title_like = like_escape($post_title_like);\n if ($wp_version < 3.6) {\n $where .= \" AND \" . $wpdb->posts . \".post_title LIKE '%\" . $wpdb->escape($title_like) . \"%'\";\n } else {\n $where .= \" AND \" . $wpdb->posts . \".post_title LIKE '%\" . esc_sql($title_like) . \"%'\";\n }\n } else {\n $title_like = $wpdb->esc_like($post_title_like);\n $where .= \" AND \" . $wpdb->posts . \".post_title LIKE '%\" . esc_sql($title_like) . \"%'\";\n }\n }\n return $where;\n }\n\n $apsa_posts_query = new WP_Query(array(\n 'post_type' => 'any',\n 'post_title_like' => $search_query,\n 'posts_per_page' => 100\n ));\n\n // The Loop\n if ($apsa_posts_query->have_posts()) {\n\n while ($apsa_posts_query->have_posts()) {\n $apsa_posts_query->the_post();\n $title = apsa_qtranslateX_available()?qtranxf_use(qtranxf_getLanguage(), get_the_title()):get_the_title();\n if (get_post_type(get_the_ID()) == \"page\") {\n array_push($responce_array, array(\n \"value\" => \"page%\" . get_the_ID() . \"%\" . $title . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => html_entity_decode($title),\n \"type\" => 'page'\n ));\n } else {\n array_push($responce_array, array(\n \"value\" => \"post%\" . get_the_ID() . \"%\" . $title . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => html_entity_decode($title),\n \"type\" => 'post'\n ));\n }\n }\n }\n\n // language block\n $enabled_languages = apsa_get_enabled_languages();\n if ($enabled_languages !== false) {\n foreach ($enabled_languages as $code => $name) {\n $pos = mb_strpos(mb_strtolower($name . $apsa_admin_labels[\"tagsinput_language\"]), mb_strtolower($search_query));\n if ($pos !== FALSE) {\n array_push($responce_array, array(\n \"value\" => \"language%\" . $code . \"%\" . $name . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => html_entity_decode($name),\n \"type\" => 'language'\n ));\n }\n }\n }\n // end language block\n // device block\n $enabled_devices = apsa_get_enabled_devices();\n if ($enabled_devices !== false) {\n foreach ($enabled_devices as $device) {\n $pos = mb_strpos(mb_strtolower($device['name'] . $apsa_admin_labels[\"tagsinput_device\"]), mb_strtolower($search_query));\n if ($pos !== FALSE) {\n array_push($responce_array, array(\n \"value\" => \"device%\" . $device['code'] . \"%\" . $device['name'] . \"%\" . strtolower($apsa_plugin_data['plugin_data']['name']) . \"%\",\n \"text\" => html_entity_decode($device['name']),\n \"type\" => 'device'\n ));\n }\n }\n }\n // end device block\n\n /* Restore original Post Data */\n wp_reset_postdata();\n\n echo json_encode($responce_array);\n }\n\n wp_die();\n}", "public function search()\n {\n $account_types = $this->accountTypeRepository->all()->get();\n return response()->json($account_types);\n }", "function customer_search()\n {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'),100);\n echo json_encode($suggestions);\n }", "public function autocomplete(Request $request)\n {\n if ($request->has('q') && strlen($request->get('q'))) {\n $terms = Term::byVocabulary($request->vocabulary)\n ->select('name', 'id')->where('name', 'LIKE', \"%$request->q%\")->get();\n\n $result = $terms->map(function ($item) {\n return [\n 'text' => $item->name, // 'label' => $item->name,\n 'id' => $item->id, // 'value' => $item->id,\n ];\n })->toArray();\n\n return ['results' => $result];\n }\n\n return ['results' => []];\n }", "public function get_trainees_by_taxcode() {\n $query_string = htmlspecialchars($_GET['query'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->trainee_user_list_autocomplete($query_string);\n print json_encode($result);\n exit;\n }", "public function autocomplete(Request $request)\r\n {\r\n\r\n $data = User::select(\"name\", \"id\")->where(\"name\",\"LIKE\",\"%{$request->input('query')}%\")->take(10)->get();\r\n\r\n return response()->json($data);\r\n }", "public function autocomplete_callback();", "public function autoCompleteList(){\n $this->layout='ajax';\n $this->autoRender =false;\n if($this->request->is('ajax')){\n $result = $this->Technology->find('list');\n echo json_encode($result);\n }\n }", "public function search(Request $request){\n// $data->words = array();\n// $word = new \\stdClass();\n// $word->name = 'Test name';\n// $word->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->words, $word);\n\n// $data->suggests = new \\stdClass();\n// $data->suggests->headline_1 = array();\n//\n// $result = new \\stdClass();\n// $result->name = 'test name 1';\n// $result->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// $result->link = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->suggests->headline_1, $result);\n// $result = new \\stdClass();\n// $result->name = 'test name 2';\n// $result->image = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// $result->link = 'http://pbs.twimg.com/profile_images/558876536791523329/HkCFV9Q0_normal.jpeg';\n// array_push($data->suggests->headline_1, $result);\n //return response()->json($data);\n\n $search = trim($request->get('search'));\n $searchQuery = '%'.$search.'%';\n if($search && strlen($search) >= 3){\n $users = User::where('username','like',$searchQuery)->orWhere('first_name','like',$searchQuery)->orWhere('last_name','like',$searchQuery)->take(5)->get();\n $tasks = Hug::where('status','=','Active')->where('title','like',$searchQuery)->take(5)->get();\n $events = Event::where('status','=','Published')->where('title','like',$searchQuery)->take(5)->get();\n $blogs = BlogPost::where('status','=','Published')->where('title','like',$searchQuery)->take(5)->get();\n $cities = City::where('name','like',$searchQuery)->take(5)->get();\n $tools = ToolsPost::where('title','like',$searchQuery)->take(5)->get();\n }else{\n $users = array();\n $tasks = array();\n }\n\n\n $data = new \\stdClass();\n $data->words = array();\n $word = new \\stdClass();\n $word->name = '';\n array_push($data->words, $word);\n\n $data->suggests = new \\stdClass();\n\n // users\n $heading_1 = \"People\";\n $data->suggests->$heading_1 = array();\n foreach($users as $user){\n $userData = new \\stdClass();\n $status = StatusUpdate::where('user_id', '=', $user->id)->orderBy('created_at', 'desc')->first();\n $userData->name = $user->username;\n $userData->description = $user->first_name.' '.$user->last_name;\n if($status){\n $userData->status = $status->status;\n }\n $userData->image = $user->avatar;\n $userData->link = route('perk::public_profile', array('username' => $user->username));\n array_push($data->suggests->$heading_1, $userData);\n }\n\n // tasks\n $heading_2 = \"Tasks\";\n $data->suggests->$heading_2 = array();\n foreach($tasks as $task){\n $taskData = new \\stdClass();\n $taskData->name = $task->title;\n $taskData->description = substr(strip_tags($task->description), 0, 50);\n $taskData->image = $task->user->avatar;\n $taskData->link = route('hugs::show', array('id'=> $task->id));\n array_push($data->suggests->$heading_2, $taskData);\n }\n\n // tasks\n $heading_3 = \"Events\";\n $data->suggests->$heading_3 = array();\n foreach($events as $event){\n $taskData = new \\stdClass();\n $taskData->name = $event->title;\n $taskData->description = substr(strip_tags($event->description), 0, 50);\n $taskData->image = $event->logo;\n $taskData->link = route('event::show', array('id'=> $event->id));\n array_push($data->suggests->$heading_3, $taskData);\n }\n\n $heading_4 = \"Blogs\";\n $data->suggests->$heading_4 = array();\n foreach($blogs as $blog){\n $taskData = new \\stdClass();\n $taskData->name = $blog->title;\n $taskData->description = substr(strip_tags($blog->description), 0, 50);\n $taskData->image = $blog->cover_photo;\n $taskData->link = route('blog::show', array('id'=> $blog->id));\n array_push($data->suggests->$heading_4, $taskData);\n }\n\n $heading_5 = \"Cities\";\n $data->suggests->$heading_5 = array();\n foreach($cities as $city){\n $taskData = new \\stdClass();\n $taskData->name = $city->name;\n $taskData->description = substr(strip_tags($city->description), 0, 50);\n $taskData->image = $city->city_photo;\n $taskData->link = route('cities::city', array('id'=> $city->name));\n array_push($data->suggests->$heading_5, $taskData);\n }\n $heading_6 = \"Web Tools\";\n $data->suggests->$heading_6 = array();\n foreach($tools as $tool){\n $taskData = new \\stdClass();\n $taskData->name = $tool->title;\n $taskData->description = substr(strip_tags($tool->description), 0, 50);\n $taskData->image = $tool->cover_photo;\n $taskData->link = route('Tools::webpost', array('id'=> $tool->id));\n array_push($data->suggests->$heading_6, $taskData);\n }\n\n\n return response()->json(['results' => $data],200);\n\n }", "public function handleAutocomplete(Request $request) {\n $results = [];\n $input = $request->query->get('q');\n\n if (!$input) {\n return new JsonResponse($results);\n }\n\n $spotify = \\Drupal::service('spotify.api');\n $ouath = $spotify->spotifyApiToken();\n\n $input = Xss::filter($input);\n $response = $this->httpClient->get('https://api.spotify.com/v1/search?q=' . $input . '&type=artist&limit=10', $ouath);\n\n if ($response->getStatusCode() !== 200) {\n return new JsonResponse($results);\n }\n\n $response = json_decode($response->getBody()->getContents(), TRUE);\n\n foreach ($response['artists']['items'] as $artist) {\n if (!isset($artist['id'], $artist['name'])) {\n return;\n }\n\n $results[] = [\n 'value' => $artist['id'],\n 'label' => $artist['name'],\n ];\n }\n\n return new JsonResponse($results);\n }", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "public function autocomplete(Request $request) {\n $string = Xss::filter(Html::escape(mb_strtolower($request->query->get('q'))));\n /** @var \\Drupal\\Core\\Database\\Statement $aresults */\n $query_results = $this->database->select('hs_capx_organizations', 'c')\n ->fields('c', [\n 'alias',\n 'orgcodes',\n 'name',\n ])\n ->condition('name', \"%$string%\", 'LIKE')\n ->range(0, 10)\n ->execute()\n ->fetchAllAssoc('alias');\n\n $results = [];\n foreach ($query_results as $item) {\n $org_codes = unserialize($item->orgcodes);\n $results[] = ['value' => end($org_codes), 'label' => $item->name];\n }\n return new JsonResponse($results);\n }", "function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n $suggestions = $this->Item->get_manage_items_search_suggestions($this->input->get('term'), 100);\n echo json_encode($suggestions);\n }", "public function autocomplete(Request $request)\n {\n $search = $request->terms;\n if ($request->category == null) {\n $type = $request->type;\n $books = BookModel::select(\"name\")->where('name', 'LIKE', \"%$search%\")->where('typeId', $type)->get();\n } else {\n $category = $request->category;\n if ($category == \"All\") {\n $books = BookModel::select(\"name\")->where('name', 'LIKE', \"%$search%\")->get();\n } else {\n $books = BookModel::select(\"name\")->where('name', 'LIKE', \"%$search%\")->where('categoryId', $category)->get();\n }\n }\n return response()->json($books);\n }", "public function ajax_search() {\r\n\t\tif ( isset( $_REQUEST['fn'] ) && 'get_ajax_search' == $_REQUEST['fn'] ) {\r\n\t\t\t$search_query = new WP_Query( array(\r\n\t\t\t\t's' => $_REQUEST['terms'],\r\n\t\t\t\t'posts_per_page' => 10,\r\n\t\t\t\t'no_found_rows' => true,\r\n\t\t\t) );\r\n\r\n\t\t\t$results = array( );\r\n\t\t\tif ( $search_query->get_posts() ) {\r\n\t\t\t\tforeach ( $search_query->get_posts() as $the_post ) {\r\n\t\t\t\t\t$title = get_the_title( $the_post->ID );\r\n\t\t\t\t\t$results[] = array(\r\n\t\t\t\t\t\t'value' => $title,\r\n\t\t\t\t\t\t'url' => get_permalink( $the_post->ID ),\r\n\t\t\t\t\t\t'tokens' => explode( ' ', $title ),\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$results[] = __( 'Sorry. No results match your search.', 'wp-typeahead' );\r\n\t\t\t}\r\n\r\n\t\t\twp_reset_postdata();\r\n\t\t\techo json_encode( $results );\r\n\t\t}\r\n\t\tdie();\r\n\t}", "function wpdt_awesome_support_scripts()\n{\n wp_enqueue_script( 'wp_typeahead_js', plugins_url( '/', __FILE__ ) . '/typea/js/typeahead.min.js', array( 'jquery' ), '', true );\n wp_enqueue_script( 'wp_hogan_js' , plugins_url( '/', __FILE__ ) . '/typea/js/hogan.min.js', array( 'wp_typeahead_js' ), '', true );\n\n wp_enqueue_script( 'typeahead_wp_plugin' , plugins_url( '/', __FILE__ ) . '/typea/js/wp-typeahead.js', array( 'wp_typeahead_js', 'wp_hogan_js' ), '', true );\n $wp_typeahead_vars = array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) );\n wp_localize_script( 'typeahead_wp_plugin', 'wp_typeahead', $wp_typeahead_vars );\n\n wp_enqueue_style( 'wp_typeahead_css', plugins_url( '/', __FILE__ ) . '/typea/css/typeahead.css' );\n}", "public function testAutocompleteResponse()\n {\n }", "public function searchTenants($request)\n {\n return $this->start()->uri(\"/api/tenant/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function autocomplete(){\n $term = Input::get('term');\n $results = array();\n \n $queries = User::where('pseudo', 'LIKE', '%'.$term.'%')\n ->where(\"status\",'>=', 1)\n ->take(5)\n ->get();\n \n foreach ($queries as $query)\n $results[] = [ \n 'avatar' => asset('storage/'.$query->avatar),\n 'value' => $query->pseudo\n ];\n\n return Response::json($results);\n }", "public function ajaxToAutocomplete(Request $request)\n\t{\n\t\t$term = trim($request->input('term'));\n\t\t$result = [\n\t\t\t'results' => []\n\t\t];\n\t\t\n\t\tif(!strlen($term))\n\t\t{\n\t\t\treturn response($result);\n\t\t}\n\t\t\n\t\t$departments = [];\n\t\tforeach(Source::where('title', 'like', '%' . $term . '%')->orderBy('title')->get() as $source)\n\t\t{\n\t\t\t$departments[] = [\n\t\t\t\t'id' => 'dept:' . $source->id,\n\t\t\t\t'text' => $source->title\n\t\t\t];\n\t\t}\n\t\t\n\t\t$teams = [];\n\t\tforeach(Team::where('title', 'like', '%' . $term . '%')->orderBy('title')->get() as $team)\n\t\t{\n\t\t\t$teams[] = [\n\t\t\t\t'id' => 'team:' . $team->id,\n\t\t\t\t'text' => $team->title\n\t\t\t];\n\t\t}\n\t\t\n\t\t$employees = [];\n\t\tforeach(User::where('display_name', 'like', '%' . $term . '%')->orderBy('display_name')->get() as $employee)\n\t\t{\n\t\t\t$employees[] = [\n\t\t\t\t'id' => 'empl:' . $employee->id,\n\t\t\t\t'text' => $employee->display_name\n\t\t\t];\n\t\t}\n\t\t\n\t\t$allCompany = trans('mail.all_company');\n\t\t\n\t\tif(mb_stripos($allCompany, $term) !== false)\n\t\t{\n\t\t\t$result['results'][] = [\n\t\t\t\t'id' => '0:0',\n\t\t\t\t'text' => $allCompany\n\t\t\t];\n\t\t}\n\t\t\n\t\tif(!empty($departments))\n\t\t{\n\t\t\t$result['results'][] = [\n\t\t\t\t'text' => trans('mail.departments'),\n\t\t\t\t'children' => $departments\n\t\t\t];\n\t\t}\n\t\tif(!empty($teams))\n\t\t{\n\t\t\t$result['results'][] = [\n\t\t\t\t'text' => trans('mail.teams'),\n\t\t\t\t'children' => $teams\n\t\t\t];\n\t\t}\n\t\tif(!empty($employees))\n\t\t{\n\t\t\t$result['results'][] = [\n\t\t\t\t'text' => trans('mail.employees'),\n\t\t\t\t'children' => $employees\n\t\t\t];\n\t\t}\n\t\t\n\t\treturn response($result);\n\t}", "public function searchAction(){\n $string = filter_input(INPUT_GET, 'string', FILTER_SANITIZE_STRING);\n $word = new Word();\n if(!empty($string)){\n print json_encode($word->search($string));\n }else{\n print json_encode($word->limitWords(20));\n }\n }", "public function __construct(Dadata_Client $client)\n {\n $this->client = $client; \n $this->servicePath = '/suggestions/api/4_1/rs/';\n $this->serviceName = 'Rest';\n \n $this->geo = new Dadata_Service_Geo_Resource(\n $this,\n $this->serviceName,\n 'geo',\n array(\n 'methods' => array(\n 'location' => array(\n 'path' => 'detectAddressByIp',\n 'httpMethod' => 'GET',\n 'parameters' => array(\n 'ip' => array(\n 'location' => 'query',\n 'type' => 'string',\n )\n )\n )\n )\n )\n );\n \n $this->suggest = new Dadata_Service_Suggest_Resource(\n $this,\n $this->serviceName,\n 'suggest',\n array(\n 'methods' => array(\n 'party' => array(\n 'path' => 'suggest/party',\n 'httpMethod' => 'POST',\n 'parameters' => array(\n 'query' => array(\n 'location' => 'query',\n 'type' => 'string',\n )\n )\n ),\n 'address' => array(\n 'path' => 'suggest/address',\n 'httpMethod' => 'POST',\n 'parameters' => array(\n 'query' => array(\n 'location' => 'query',\n 'type' => 'string',\n ),\n 'count' => array(\n 'location' => 'query',\n 'type' => 'integer'\n )\n )\n ),\n 'bank' => array(\n 'path' => 'suggest/bank',\n 'httpMethod' => 'POST',\n 'parameters' => array(\n 'query' => array(\n 'location' => 'query',\n 'type' => 'string',\n )\n )\n ),\n 'country' => array(\n 'path' => 'suggest/country',\n 'httpMethod' => 'POST',\n 'parameters' => array(\n 'query' => array(\n 'location' => 'query',\n 'type' => 'string',\n )\n )\n )\n )\n )\n );\n }", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "public function index()\n {\n $items = SpecSuggestions::getSuggestions();\n return view('admin.suggestions.index', compact('items'));\n }", "function getsearch_get(){\n $keyword = $this->get('keyword');\n $result = $this->lecturers_model->getsearch_all($keyword);\n $this->response($result); \n\n }", "public function index(Request $request)\n {\n $types = types::all();\n if($request->has('search'))\n {\n $types = types::where('type_id','like',\"%{$request->search}%\")-> orWhere('type_name','like',\"%{ $request->search }%\")->get();\n }\n return view('types.index', compact('types'));\n }", "public function autocomplete(Request $request)\n {\n $term=$request->term;\n $data = User::where('name','LIKE','%'.$term.'%')->where('id','<>',1)\n ->take(15)\n ->get();\n $a1=array();\n $a2=array();\n foreach ($data as $key => $v){\n $a1[]=['value' =>$v->name];\n }\n\n return response()->json($a1);\n}", "function user_autocomplete() {\n\t\t$json = $this->user_model->get_users_autocomplete(str_replace('+', ' ', strtolower($_GET['term'])));\n\t\t\n\t\t$this->output->set_content_type('application/json')->set_output($json);\n\t}", "public function getSearchType() {}", "public function getSearchType() {}", "public function search()\n {\n $data = [];\n if ($this->request->is('ajax')) {\n $term = $this->request->getQuery('term');\n $this->loadModel('Airobjects');\n $data = $this->Airobjects\n ->find('all')\n ->where(\n [\n 'OR' => [ \n \"code LIKE\" => $term . '%', \n \"city_name LIKE\" => $term . '%', \n \"airport_name LIKE\" => $term . '%', \n ],\n 'AND' => [\n \"code <> \\\"\\\"\" \n ]\n ]\n )\n ->limit(10)\n ->order('code')\n ->toArray(); \n }\n\n $this->set(compact('data'));\n $this->set('_serialize', 'data');\n }", "public function lookups()\n {\n }", "public function index(Request $request)\n { \n // 1.All is bad\n // 2. No way to attach meta data\n // 3. Linking db structure \n // 4. No Way to signal header/response codes\n \n\n // $query = Input::get('search');\n $search_term = $request->input('search');\n // $limit = $request->input('limit')?$request->input('limit'):5;\n $limit = $request->input('limit', 500);\n\n\n //dd($query);\n if ($search_term)\n {\n $suburbs = PropertySuburb::orderBy('name', 'ASC')->where('name', 'LIKE', \"%$search_term%\")->with(\n array('City'=>function($query){\n $query->select('id','name');\n })\n )->select('id', 'name', 'city_id')->paginate($limit); \n\n $suburbs->appends(array(\n 'search' => $search_term,\n 'limit' => $limit\n ));\n //$posts = PropertySuburb::where('name', 'LIKE', \"%$query%\")->paginate(5);\n }\n else\n {\n $suburbs = PropertySuburb::orderBy('name', 'ASC')->with(\n array('City'=>function($query){\n $query->select('id','name');\n })\n )->select('id', 'name', 'city_id')->paginate($limit); \n\n $suburbs->appends(array( \n 'limit' => $limit\n )); \n //$posts = PropertySuburb::orderBy('id', 'DESC')->paginate(5);\n }\n\n\n // $suburbs = PropertySuburb::with(\n // array('City'=>function($query){\n // $query->select('id','name');\n // })\n // )->select('id', 'name', 'city_id')->paginate(5); \n //return $suburbs;\n \n // dd(get_class_methods($suburbs));\n\n //$suburbs = PropertySuburb::all();\n // return Response::json([\n // 'data' => $this->transformCollection($suburbs)\n // ], 200);\n return Response::json($this->transformCollection($suburbs), 200);\n }", "function search2(){\n\t\t$keyword = $this->uri->segment(5);\n\t\t$keyword2 = preg_replace('/%20/', '', $keyword);\n\t\t$kategori = \"A\";\n\t\t/*print_r($keyword);*/\n\t\t//api kategori bkd\n\t\t$api_url \t= URL_API_BKD.'bkd_beban_kerja/kategori_bkd_bebankerja';\n\t\t$parameter = array('api_search' => array($keyword2, $kategori));\n\t\t$data['data_bebankerja'] = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t//pengambilan data dan pengrimimannya ke view\n\t\t//print_r($data);\n\t\tforeach($data['data_bebankerja'] as $row)\n\t\t{\n\t\t\t$arr['query'] = $keyword;\n\t\t\t$arr['suggestions'][] = array(\n\t\t\t\t'value'\t=>$row->NM_KAT,\n\t\t\t\t'nilai'=>$row->KD_KAT,\n\t\t\t\t'satuan' =>$row->SATUAN,\n\t\t\t\t'nilai_kat' => $row->NILAI_KAT,\n\t\t\t\t'set_masa_tugas' =>1,\n\t\t\t\t'set_rincian_masa' =>'Semester',\n\t\t\t\t'set_tempat'=>''\n\t\t\t);\n\t\t}\n\t\t// minimal PHP 5.2\n\t\techo json_encode($arr);\n\t}", "public function search(){}", "public function autocomplete(Request $request)\n {\n $response = Movie::select('name')\n ->where('name', 'LIKE', \"%{$request->term}%\")\n ->get();\n\n return response()->json($response);\n }", "public function search()\n {\n $domains = Configure::read('AccessControlAllowOrigin');\n $this->response->cors($this->request)\n ->allowOrigin($domains)\n ->allowMethods(['GET'])\n ->allowHeaders(['X-CSRF-Token'])\n ->maxAge(300)\n ->build();\n\n $version = '2-2';\n if (!empty($this->request->query['version'])) {\n $version = $this->request->query['version'];\n }\n if (empty($this->request->query['lang'])) {\n throw new BadRequestException();\n }\n $lang = $this->request->query['lang'];\n\n $page = 1;\n if (!empty($this->request->query['page'])) {\n $page = $this->request->query['page'];\n }\n $page = max($page, 1);\n\n if (count(array_filter(explode(' ', $this->request->query['q']))) === 1) {\n $this->request->query['q'] .= '~';\n }\n\n $options = [\n 'query' => $this->request->query('q'),\n 'page' => $page,\n ];\n $this->loadModel('Search', 'Elastic');\n $results = $this->Search->search($lang, $version, $options);\n\n $this->viewBuilder()->className('Json');\n $this->set('results', $results);\n $this->set('_serialize', 'results');\n }", "public function getSearch();", "public function getAccountsBasedOnSearchTerm(Request $request)\n {\n $searchTerm = $request -> searchTerm;\n $options;\n if(!isset($request -> searchTerm))\n $options = ChartOfAccount::get();\n else\n {\n $options = ChartOfAccount :: where('description','like','%'.$searchTerm.'%')\n ->Orwhere('general_code','like','%'.$searchTerm.'%')\n ->Orwhere('name','like','%'.$searchTerm.'%')\n ->Orwhere('company_code','like','%'.$searchTerm.'%')\n ->get();\n }\n $data = array();\n foreach($options as $option)\n {\n $data[] = array('id' => $option -> id,'text' => $option -> name.'('.$option -> general_code.')');\n }\n return json_encode($data);\n }", "public function rest_callback_admin_search($request) {\n\t\t// get posts by request params\n\t\t$params = $request->get_params();\n\t\t$args = apply_filters( 'mio_omnisearch_query', array(\n\t\t\t\t'post_status' => 'any',\n\t\t\t\t'posts_per_page' => 20,\n\t\t\t\t'orderby' => array('title' => 'ASC', 'date' => 'DESC', 'type' => 'ASC'),\n\t\t\t));\n\t\t$args['s'] = $params['search'];\n\t\t$args['post_type'] = $params['type'];\n\t\t$query = new \\WP_Query($args);\n\n\t\t// bail if no posts are found\n\t\tif (!$query->have_posts()) {\n\t\t\treturn new \\WP_Error('nothing_found', __('Nothing found', 'mio-omnisearch'), array( 'status' => 200));\n\t\t}\n\n\t\t// create posts array\n\t\t$posts = array();\n\t\tforeach ($query->get_posts() as $post) {\n\t\t\t// show all not published states\n\t\t\t$status = (get_post_status($post->ID) !== 'publish') ? __(ucfirst(get_post_status($post->ID))) : '';\n\n\t\t\t// string for front page and posts page\n\t\t\tif ($post->ID === intval(get_option('page_on_front'))) {\n\t\t\t\t$status = __('Front Page');\n\t\t\t} else if ($post->ID === intval(get_option('page_for_posts'))) {\n\t\t\t\t$status = __('Posts Page');\n\t\t\t}\n\n\t\t\t// add to response array\n\t\t\t$posts[] = array(\n\t\t\t\t\t'id' => $post->ID,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'slug' => $post->post_name,\n\t\t\t\t\t'type' => __(get_post_type_object($post->post_type)->labels->singular_name),\n\t\t\t\t\t'status' => $status,\n\t\t\t\t\t'image' => ('attachment' === $post->post_type) ? wp_get_attachment_thumb_url($post->ID) : get_the_post_thumbnail_url($post->ID, 'thumbnail'),\n\t\t\t\t\t'link_view'=> get_permalink($post->ID),\n\t\t\t\t\t'link_edit' => get_admin_url() . 'post.php?post='.$post->ID.'&action=edit',\n\t\t\t\t);\n\t\t}\n\n\t\t// create response\n\t\treturn rest_ensure_response($posts);\n\t}", "function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}", "public function searchEntityTypes($request)\n {\n return $this->start()->uri(\"/api/entity/type/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function search()\n {\n $terms = \\Input::get('terms');\n\n if (Request::ajax()) {\n return Response::json($this->providerRepo->search($terms, 'ajax'));\n } else {\n $results = $this->providerRepo->search($terms);\n\n foreach ($results as $provider) {\n $this->providerFormat->formatData($provider);\n }\n\n return View::make('provider/search', compact('results', 'terms'));\n }\n }", "public function suggest() {\n\t\tif(isset($_POST['query'])) $this->query_str = $_POST['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t//check if jar exists\n\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar suggest ' . escapeshellarg($this->query_str));\n\t\telse return;\n\n\t\t$this->results = json_decode($raw);\n\t}", "public function testGetMatchingSuggestionsUsingPOST()\n {\n }", "public function defineTypo3RequestTypes() {}", "public function index()\n {\n $products = $this->getProducts();\n $categories = $this->getCategories();\n $users = $this->getUsers();\n\n return new SuggestionsResponse(\n request('query'),\n $categories,\n $products,\n $users\n );\n }", "public abstract function search_items(\\WP_REST_Request $request);", "public function findAutocompleteInfo(Request $request)\n {\n //dd($request->all());\n $name = $request->input('query');\n $output = \\Tmdb::getSearchApi()->searchMovies($name, array('language' => 'fr', 'search_type' => 'ngram', 'year' => $request->input('year')));\n //$output = \\Tmdb::getMoviesApi()->getImages($output['results'][0]['id']);\n\n foreach ($output['results'] as $value) {\n $image = \\Tmdb::getMoviesApi()->getImages($value['id']);\n if (isset($image['posters'][0])) {\n $image = $image['posters'][0]['file_path'];\n } else {\n $image = '';\n }\n\n $array = array('image' => $image,'value' => $value['title'].' ('.substr($value['release_date'], 0, 4).')', 'data' => $value['id']);\n $result[] = $array;\n }\n\n $result['suggestions'] = $result;\n echo json_encode($result);\n }", "public function suggestionsAction(Request $request) {\n $helpers = $this->get('app.helpers');\n $jwtAuth = $this->get(\"app.jwt_auth\");\n $suggestions = $this->get('app.suggestions');\n\n $authorization = $request->headers->get('X-API-KEY');\n $identity = $jwtAuth->checkToken($authorization, true);\n\n if (!$identity) {\n return $helpers->json(['status' => 'error', 'code' => $this::UNAUTHORIZED, 'message' => 'Unauthorized']);\n }\n\n return $helpers->json($suggestions->run($identity->teacher_id));\n }", "function rest_get_route_for_term($term)\n {\n }", "public function adminSearchAgenciesAction()\n {\n $request = Request::createFromGlobals();\n $term = strtolower($request->query->get('q', ''));\n $limit = 100;\n $data = $this->get('CorpoAgenciesServices')->getCorpoAdminLikeAgencies($term, $limit);\n\n $res = new Response(json_encode($data));\n $res->headers->set('Content-Type', 'application/json');\n\n return $res;\n }", "public function autocompleteTag(Request $request) {\n $matches = [];\n $string = $request->query->get('q');\n // Get matches from default views.\n $views = $this->entityTypeManager()->getStorage('view')->loadMultiple();\n // Keep track of previously processed tags so they can be skipped.\n $tags = [];\n foreach ($views as $view) {\n $view_tag = $view->get('tag');\n foreach (Tags::explode($view_tag) as $tag) {\n if ($tag && !in_array($tag, $tags, TRUE)) {\n $tags[] = $tag;\n if (mb_stripos($tag, $string) !== FALSE) {\n $matches[] = ['value' => $tag, 'label' => Html::escape($tag)];\n if (count($matches) >= 10) {\n break 2;\n }\n }\n }\n }\n }\n\n return new JsonResponse($matches);\n }", "public function index()\n {\n //\n $suggestions = Suggestion::all();\n\n return view('suggestions.index', compact('suggestions'));\n }", "public function search($request, $response)\n {\n }", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "public function register_routes() {\n $namespace = 'junglehunter/v1';\n register_rest_route(\n $namespace,\n '/all',\n array(\n 'methods' => 'GET',\n 'callback' => array($this, 'junglehunter_get_all')\n )\n );\n }", "public function testSearchUsingGET()\n {\n\n }", "public function index(Request $req)\n {\n $areas = Area::where('status', 'a');\n if($req->q){\n $param = $req->q; \n $areas = $areas->where('area_name','LIKE','%'.$param.'%');\n $areas = $areas->orwhere('description','LIKE','%'.$param.'%');\n }\n $areas = $areas->get();\n // $areas = $areas->paginate(5);\n \n return response()->json($areas, 200);\n }", "public function userSearch (Request $request)\n { $user = User::find(Auth::id());\n \n if($request->search != null){\n $search = family::ilike($request->search);\n \n return response()->json($search);\n }\n }", "public function findByName() { \n\n $term = Request::input('term');\n $cities = []; \n if (($term) && ($term !== '')) {\n $search_term = Helpers::accentToRegex($term);\n $query_term = '/.*' . $search_term . '*/i';\n $cities = Cities::where('properties.nome_municipio', 'regexp', $query_term)->\n orderBy('properties.nome_municipio')->\n get(array('properties.geo_codigo', 'properties.nome_municipio', 'properties.sigla')); \n }\n\n return Response::json($cities); \n }", "public function searches($method='GET')\n\t{\n $this->data['message'] = lang_check('Hello, API here!');\n\n echo json_encode($this->data);\n exit();\n\t}", "public function search(Request $request)\n {\n }", "protected function construct() {\n\n $_aGet = $_GET;\n unset( $_aGet['post_type'], $_aGet['request'], $_aGet['page'], $_aGet['tab'], $_aGet['settings-updated'] );\n $this->aDefaultKeys['settings'] = $this->getQueryAdminURL( array( 'request' => 'autocomplete', 'post_type' => 'post' ) + $_aGet );\n $this->aDefaultKeys['settings2'] = array(\n 'hintText' => __( 'Type the title of posts.', 'admin-page-framework-demo' ),\n );\n\n /*\n * If the request key is set in the url and it yields 'autocomplete', return a JSON output and exit.\n */ \n if ( isset( $_GET['request'] ) && 'autocomplete' === $_GET['request'] ) {\n if ( did_action( 'init' ) ) {\n $this->_replyToReturnAutoCompleteRequest();\n } else { \n add_action( 'init', array( $this, '_replyToReturnAutoCompleteRequest' ) );\n }\n }\n\n }", "public function getInterestSuggestions(Request $request)\n\t{\n\t\t$str = $request->search;\n\n\t\t$suggestions = $this->profileRepo->getSuggestions($str);\n\n\t\treturn response()->json( $suggestions );\n\t}", "public function loans(Request $request)\n {\n $searchTerm = $request -> searchTerm;\n $options;\n if(!isset($request -> searchTerm))\n $options = HouseBuildingLoan :: all();\n else\n {\n $options = HouseBuildingLoan :: where('loan_ref_no','like','%'.$searchTerm.'%')\n ->get();\n }\n $data = array();\n foreach($options as $option)\n {\n $data[] = array('id' => $option -> id,'text' => $option -> loan_ref_no);\n }\n return json_encode($data);\n }", "public function search(Request $request)\n {\n $this->validate($request, [\n 'search' => 'required'\n ]);\n\n $search = $request->search;\n $name = session('name');\n\n\n\n\n //$array = Twitter::getHomeTimeline(['count' => 10, 'format' => 'array']);\n $array = Twitter::getUserTimeline(['screen_name' => $name, 'count' => 20, 'format' => 'array']);\n\n\n function search_array($array, $val){\n $ArrIterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));\n foreach($ArrIterator as $id => $sub){\n $childArray = $ArrIterator->getSubIterator();\n if(strstr(strtolower($sub), strtolower($val))){\n $childArray = iterator_to_array($childArray);\n $result[] = $childArray;\n }\n }\n return $result;\n }\n\n $data = search_array($array, $search);\n\n\n return view('twitter',compact('data'));\n\n// return back();\n }", "function aecom_use_search_types( $query ) {\n\n // if this isn't one of our custom searches, then who cares?\n if ( ! $search_type = $query->get( 'search_type' ) ) return;\n\n switch ( $search_type ) {\n /* *********** DEACTIVATED WHILE IT IS COMPLETED: it is missing to format results in global search\n case 'offices':\n //search of offices are performed in the universal site only, so change blog temporally\n switch_to_blog(aecom_get_uni_blog_id());\n $query->set( 'post_type', 'office' );\n break;*/\n case 'markets':\n $query->set( 'post_type', 'market' );\n break;\n case 'solutions':\n $query->set( 'post_type', 'service' );\n break;\n case 'projects':\n $query->set( 'post_type', 'project' );\n break;\n case 'insights':\n if ( $documents_page = get_page_by_path( 'documents' ) )\n $query->set( 'post_parent', $documents_page->ID );\n break;\n case 'careers':\n // TODO\n break;\n case 'press-releases':\n $query->set( 'post_type', 'press-release' );\n break;\n }\n}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function searchDetails(Request $request) {\n\n try {\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'term' => 'required',\n 'type'=>'in:'.LIVE_VIDEOS.','.USERS.','.LIVE_TV,\n )\n );\n \n if ($validator->fails()) {\n\n $error = implode(',', $validator->messages()->all());\n\n throw new Exception($error, 101);\n \n } else {\n\n switch ($request->type) {\n \n case LIVE_VIDEOS:\n\n $lists = [];\n\n $live_videos = LiveVideo::videoResponse()\n ->leftJoin('users', 'users.id', '=', 'live_videos.user_id')\n ->where('title','like', '%'.$request->term.'%')\n ->skip($request->skip)\n ->take(Setting::get('admin_take_count'))\n ->where('live_videos.is_streaming', DEFAULT_TRUE)\n ->where('live_videos.status', DEFAULT_FALSE)\n ->get();\n\n foreach ($live_videos as $key => $live_video_details) {\n\n $is_blocked = check_blocked_status($request->id , $live_video_details->user_id);\n\n if($is_blocked == NO) {\n\n $live_video_details->share_link = Setting::get('ANGULAR_URL').'live-video/'.$live_video_details->video_id;\n\n $live_video_details->is_follow = check_follow_status($request->id, $live_video_details->user_id);\n\n $lists[] = $live_video_details;\n\n }\n\n }\n\n break;\n\n case USERS:\n\n $lists = [];\n\n $results = Helper::search_user($request->id, $request->term, $request->skip, Setting::get('admin_take_count'));\n\n if(count($results)) {\n \n foreach ($results as $key => $suggestion) {\n\n $is_blocked = check_blocked_status($request->id , $suggestion->id);\n\n if ($is_blocked == NO) {\n\n $is_follow = check_follow_status($request->id, $suggestion->id);\n\n $no_of_followers = Follower::where('user_id', $suggestion->id)->count();\n\n $lists[] = [\n 'id'=>$request->id, \n 'follower_id'=>$suggestion->id, \n 'name'=> $suggestion->name, \n 'description'=>$suggestion->description, \n 'picture'=> $suggestion->picture, \n 'is_follow'=>$is_follow,\n 'no_of_followers'=>$no_of_followers ? $no_of_followers : 0\n ];\n\n }\n\n }\n \n } \n\n break;\n\n case LIVE_TV:\n\n $lists = [];\n\n $custom_live_videos = CustomLiveVideo::liveVideoResponse()\n ->where('custom_live_videos.title','like', '%'.$request->term.'%')\n ->skip($request->skip)\n ->take(Setting::get('admin_take_count'))\n ->where('custom_live_videos.status', APPROVED)\n ->get();\n\n foreach ($custom_live_videos as $key => $custom_live_video_details) {\n\n $is_blocked = check_blocked_status($request->id , $custom_live_video_details->user_id);\n\n if ($is_blocked == NO) {\n\n $share_link = Setting::get('ANGULAR_URL').'live-tv/view?id='.$custom_live_video_details->custom_live_video_id;\n\n $custom_live_video_details->share_link = $share_link;\n\n $custom_live_video_details->is_follow = DEFAULT_TRUE;\n\n $custom_live_video_details->is_follow = check_follow_status($request->id, $custom_live_video_details->user_id);\n\n $lists[] = $custom_live_video_details;\n\n }\n\n }\n\n break;\n \n default:\n # code...\n\n $lists = [];\n\n break;\n }\n\n \n }\n\n return ['success'=>true, 'code'=>200, 'data'=>$lists];\n\n } catch(Exception $e) {\n\n $error = $e->getMessage();\n\n $error_code = $e->getCode();\n\n $response_array = ['success' => false , 'error' => $error , 'error_code' => $error_code];\n\n return response()->json($response_array , 200);\n }\n\n\n }", "function search(){\n if ( $this->RequestHandler->isAjax() ) {\n Configure::write ( 'debug', 0 );\n $this->autoRender=false;\n $users=$this->User->find('all',array('conditions'=>array('User.name LIKE'=>'%'.$_GET['term'].'%')));\n $i=0;\n foreach($users as $user){\n $response[$i]['value']=$user['User']['name'];\n $response[$i]['label']=$user['User']['name'];\n $i++;\n }\n echo json_encode($response);\n }else{\n if (!empty($this->data)) {\n $this->set('users',$this->paginate(array('User.name LIKE'=>'%'.$this->data['User']['name'].'%')));\n }\n }\n }", "public function search(Request $request)\n {\n $search = $request->input('search');\n\n if(!$search)\n return response()->json();\n\n $travels = Travel::with('tappe', 'user', 'scopo', 'keywords', 'consigliatoa')->where('title','like','%'.$search.'%')->get();\n\n return response()->json($travels);\n }", "public function search(Request $request){\n $constraints = [\n 'title' => $request['name']\n ];\n $types = $this->doSearchingQuery($constraints);\n\n return view('admin/type/index', ['type' => $types, 'searchingVals' => $constraints]);\n }", "public function adminsAutoComplete(Request $request)\n {\n $query = $request->get('query');\n $users = User::select([Constants::FLD_USERS_USERNAME . ' as name'])\n ->where(Constants::FLD_USERS_USERNAME, 'LIKE', \"%$query%\")\n ->where(Constants::FLD_USERS_USERNAME, '!=', Auth::user()[Constants::FLD_USERS_USERNAME])\n ->get();\n return response()->json($users);\n }", "public function get()\n {\n return \"/V1/search\";\n }", "public function getServiceByName() {\n $term = Request::input('term', '');\n\n $results = array();\n $queries = Service::where('name', 'LIKE', '%'.$term.'%')\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->name];\n return response()->json($results);\n }" ]
[ "0.69301254", "0.6395839", "0.6221404", "0.61489314", "0.6142607", "0.61189765", "0.61091363", "0.6055806", "0.604208", "0.6018469", "0.5986987", "0.5915756", "0.5905917", "0.5852985", "0.5808733", "0.58061504", "0.57819194", "0.57576466", "0.57209396", "0.5720176", "0.5705436", "0.57019216", "0.5672968", "0.5665365", "0.5630396", "0.5621271", "0.56053275", "0.5589247", "0.5576533", "0.55295706", "0.55263186", "0.5522291", "0.5502513", "0.55005616", "0.54942816", "0.5492307", "0.54777735", "0.5476566", "0.5450279", "0.5431195", "0.54238915", "0.5422382", "0.5412381", "0.54054534", "0.539804", "0.5392631", "0.53905004", "0.5382764", "0.53821826", "0.5372342", "0.5371443", "0.5370679", "0.53691065", "0.53691065", "0.53610307", "0.53585356", "0.53523344", "0.5343929", "0.5337153", "0.5334383", "0.5332928", "0.53146386", "0.5310016", "0.53072345", "0.5296097", "0.5295364", "0.5285113", "0.52648723", "0.52611065", "0.525839", "0.52565163", "0.5235023", "0.5209139", "0.52062327", "0.52047294", "0.5203785", "0.5201626", "0.5200452", "0.5199637", "0.5193762", "0.5181619", "0.5180556", "0.51782346", "0.51708436", "0.5168464", "0.5155658", "0.51518744", "0.5141239", "0.51322985", "0.5127635", "0.5126604", "0.5126386", "0.51261216", "0.51247984", "0.51176906", "0.5100987", "0.51000154", "0.5097934", "0.50977224", "0.5084667" ]
0.5207313
73
Save path last created crud file
public function saveToHistory($path) { return file_put_contents(static::FILE_HISTORY, $path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save($path);", "protected function _after_save(){\n if(file_exists($this->_path))\n $this->_path_infos = pathinfo($this->_path);\n }", "public function getSavePath(): string;", "public function saveTo(string $path);", "public function getSavePath(){\n\t\treturn $this->savePath;\n\t}", "private function getSessionSavePath() {}", "public function path(): string\n {\n return 'files/' . $this->model->filename();\n }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "protected function savePath()\n {\n if ($this->_savePath) {\n return $this->_savePath;\n }\n\n $this->_savePath = rtrim($this->savePath, '/').'/';\n if (substr($this->savePath, 0, 1) == '@') {\n $this->_savePath = Yii::getAlias($this->_savePath).'/';\n }\n\n if (!is_dir($this->_savePath)) {\n mkdir($this->_savePath);\n }\n return $this->_savePath;\n }", "public function saveFile()\n {\n $newFileName = $this->generateFilename();\n $this->getOwner()->setAttribute($this->attributeName, $newFileName);\n return $this->uploadManager->save($this->getUploadedFileInstance(), $this->getUploadPath(), $newFileName);\n }", "private function getSavePath()\n\t{\n\t\t$todoDir = $this->todoDir;\n\t\t$fileExtendedName = $this->addExtension();\n\t\treturn $todoDir . $fileExtendedName;\n\t}", "function save($filePath);", "public function save() {}", "public function save() {}", "public function save() {}", "public function getWritePath();", "public function save($file, $path);", "protected function generateFullPathToUploadFile()\n {\n // $this->fullPathToUploadFile = str_replace(\"/\", \"\\\\\", storage_path('app/' . $this->pathToFile));\n $this->fullPathToUploadFile = storage_path('app/' . $this->pathToFile);\n }", "public function getSavePath()\n {\n return $this->_savePath;\n }", "public function getSavePath()\n {\n return $this->_savePath;\n }", "public function save(){\n\n // Save the name of migration in prop (0000_00_00_000000_prefix.php)\n $this->migrationName = date('Y_m_d_'.Carbon::now()->format('His'),time()) . \"_\". $this->prefixFileName .\".php\";\n\n $this->document = $this->header;\n\n $this->document.= $this->up;\n $this->document.= $this->endUp;\n $this->document.= $this->down;\n $this->document.= $this->footer;\n\n return Storage::disk('migration')->put($this->migrationName, $this->document);\n\n }", "public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function setPathAttribute($path){ //modificaremos el atributo path, estamos recibiendo path de la BD\n\n if(! empty($path)){ //El campo path no debe estar vacio para que ejecute toda esa accion\n $name = Carbon::now()->second.$path->getClientOriginalName();//CON CARBON LE ESPECIFICAMOS LA FECHA DE HOY, TOMAMOS EL SEGUNDOEN QUE ES SUBIDO Y LO CONCATENAMOS AL NOMBRE ORIGINAL DEL ARCHIVO, creamos una variable que contatenara el nombre con los segundos\n $this->attributes['path'] = $name; //hacemos referencia a path y vamos a cambiarlo el nombre\n \\Storage::disk('local')->put($name, \\File::get($path)); //ACA SE HACE LA SUBIDA DEL ARCHIVO, especificamos el local y mediante el metodo put vamos a almacenar nuestro archivo, recibe el nombre y el archivo que vamos a subir que es el path\n }\n }", "public function save() {\n\t\t\t\n\t\t}", "public function saveDataFile(){\n /** Verifica exitência da pasta **/\n if ($this->verifyPatch()){\n $file = new File('json/dados.json', $this->dados);\n if($file->renderizar())\n $retorno = 'Arquivo criado com sucesso!';\n else\n $retorno = 'Houve um erro ao tentar criar o arquivo. Cheque suas permissões de pasta';\n }else\n $retorno = 'Houve um erro de permissão de acesso a pasta!';\n\n return $retorno;\n }", "public function save()\r\n {\r\n \r\n }", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "public function setSavePath(string $path);", "public function getSavePath(): string\n {\n return session_save_path();\n }", "protected function createFile() {}", "public final function save() {\n }", "function saveLinkToPhoto(){\n if(isset($_SESSION['temp_photo_loc'])){\n $randomString = $this->generateRandomString();\n $this->car_photo=$randomString;\n $new_file = \"C:/Apache24/htdocs/sola-avto-stran/yii-appli/frontend/web/assets/car_photos/\".$randomString.\".png\";\n rename(\"C:/Apache24/htdocs/sola-avto-stran/yii-appli/frontend/web/assets/temp/\".$_SESSION[\"temp_photo_loc\"].\".png\",$new_file);\n $this->save();\n //da deletamo sliko iz temporery loc\n $temporery = TempPhotos::findOne(([\"temp_photo\"=>$_SESSION['temp_photo_loc']]));\n $temporery->delete();\n //ko damo submit, sliko shranimo in jo potem lahko odstranimo iz session\n unset($_SESSION['temp_photo_loc']);\n }else{\n $this->car_photo=\"no_photo\";\n $this->save();\n }\n }", "public function getFilepath();", "public function save()\n {\n }", "public function save():void;", "public function saveDataToFile()\n {\n\n }", "public function save() {\r\n if(isset($this->id)) {\r\n // Really just to update the caption\r\n $this->update();\r\n } else {\r\n // Make sure there are no errors\r\n if(!empty($this->errors)) { return FALSE; }\r\n\r\n // Can't save without filename and temp location\r\n if(empty($this->passport_path) || empty($this->temp_path)) {\r\n $this->errors[] = \"The file location was not available.\";\r\n return FALSE;\r\n }\r\n\r\n // Determine the target_path\r\n $target_path = SITE_ROOT.DS.'public'.DS.$this->upload_dir.DS.$this->passport_path;\r\n\r\n // Make sure a file doesn't already exist in the target location\r\n if(file_exists($target_path)) {\r\n $this->errors[] = \"The file {$this->passport_path} already exists.\";\r\n return FALSE;\r\n }\r\n\r\n // Attempt to move the file\r\n if(move_uploaded_file($this->temp_path, $target_path)) {\r\n // Success\r\n // Save a corresponding entry to the database\r\n if($this->create()){\r\n // We are done with temp_path, the file isn't there anymore\r\n unset($this->temp_path);\r\n return TRUE;\r\n }\r\n } else {\r\n // File was not saved.\r\n $this->errors[] = \"The file upload failed, possible due to incorrect permissions on the upload folder.\";\r\n return FALSE;\r\n }\r\n\r\n }\r\n\r\n }", "public function saveAs(string $path): void;", "public final function save()\n {\n }", "function full_path_and_save_path($save_path){\n\n\t\t $name = $save_path.$_SESSION['getGUID'].'_'.$_SESSION['childernFrom'].'_'.$_SESSION['center'].'_'.$_SESSION['child_Name'].' '.$_SESSION['zipcode'].\"_Consent for Communication.pdf\";\n\n\t\t $_SESSION['pdf-2-path'] = $_SESSION['getGUID'].'_'.$_SESSION['childernFrom'].'_'.$_SESSION['center'].'_'.$_SESSION['child_Name'].' '.$_SESSION['zipcode'].\"_Consent for Communication.pdf\";\n\n\t\t return $name;\n\t}", "public function saveNewTxtFile()\r\n {\r\n\r\n $fileName = date(\"Y-m-d\") . '-' . rand(0, 512) . \"Question\";\r\n\r\n $file = new StorageFileSaver($fileName);\r\n\r\n foreach ($this->fileContent as $content) {\r\n $file->write($content);\r\n }\r\n\r\n $file->saveAndCloseFile();\r\n }", "public function createFolderPath()\n {\n return \"uploads/\".date('Y').\"/\".date('m').\"/\";\n }", "public function save() {\n }", "public function save() {\n }", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function save() {\n }", "public function save()\r\n {\r\n //\r\n }", "public function save()\r\n {\r\n $module = Yii::$app->controller->module;\r\n if ($this->operation === self::OP_OVERWRITE) {\r\n $dir = dirname($this->path);\r\n if (!is_dir($dir)) {\r\n $mask = @umask(0);\r\n $result = @mkdir($dir, $module->newDirMode, true);\r\n @umask($mask);\r\n if (!$result) {\r\n return \"Unable to create the directory '$dir'.\";\r\n }\r\n }\r\n }\r\n if (@file_put_contents($this->path, $this->content) === false) {\r\n return \"Unable to write the file '{$this->path}'.\";\r\n }\r\n\r\n return true;\r\n }", "public function getSavedFileName()\n {\n return $this->savedFileName;\n }", "public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }", "public function save()\n {\n // For V2.0\n }", "public function save(){\n }", "public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }", "public function path() {}", "public function path() {}", "public function save(){ \r\n return $this->xmlfile->save($this->absolutepath);\r\n }", "private function save_file_to_path($file){\n\t\tif(!is_dir($this->_mainFolder)){\n\t\t\tmkdir($this->_mainFolder);\n\t\t}\n\n\t\t//After making sure the main folder is created, another folder is created, with the idNews as name.\n\t\t//This just making sure no file is overwritten over time, also for making file order clear.\n\t\t$newFolder = $this->_mainFolder.'/'.$this->id;\n\t\tif(!is_dir($newFolder)){\n\t\t\tmkdir($newFolder);\n\t\t}\n\n\t\t//And now proceed to save the file to path.\n\t\t$f = $file['file'];\n\t\t$n = $file['name'];\n\n\n\t\tlist($type, $f) = explode(';', $f);\n\t\tlist(, $f) = explode(',', $f);\n\t\t$f = base64_decode($f);\n\t\tfile_put_contents($newFolder.'/'.$n, $f);\n\n\t\t//After saving the file, the name of the file is stored, just in case the path changes, we still have the name of the file.\n\t\t$query = \"INSERT INTO files (idNew, file) VALUES(\".$this->id.\", '\".$n.\"')\";\n\t\t$this->_db->query($query);\n\t}", "public function save($path) {\n return move_uploaded_file($_FILES['uploadfile']['tmp_name'], $path);\n }", "public function crear(){\n\t\t$this->archivo = fopen($this->nombre , \"w+\");\n\t}", "public function saveToFile($file)\n {\n \n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function getSavePath() {\n return $this->__imageSavePath;\n }", "public function save()\n {\n }", "public function save()\n {\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function path(): string;", "public function path(): string;", "public function getPathToFile(): string;", "private function tempFilePath()\n {\n $path = 'exports/'.Str::random();\n\n // Make sure the file exists\n Storage::put($path, null);\n\n return Storage::path($path);\n }", "public function setPathAttribute($path) {\n\n //$this->attributes[\"path\"] asemos referencia a el atributo path\n // Carbon::now()->second es para obtener los segundos actuales\n //concadenamos luego el nombre del archivo q estamos resiviendo con $path->getClientOriginalName()\n $this->attributes[\"path\"] = Carbon::now()->second . $path->getClientOriginalName();\n\n //nombre del archivo va a ser lo mismo\n $name = Carbon::now()->second . $path->getClientOriginalName();\n\n //para subir un archivo se hace con la clase \\Storage::disk(\"local\")\n //y con el metodo put almasenamos el archivo, resive el nombre y el archivo q vamos a subir\n //en este caso entramos a la clase \\File::get() y le accinamos la ruta de nuestro archivo\n \\Storage::disk(\"local\")->put($name, \\File::get($path));\n }", "function save();", "function save();", "public function save()\n\t{\n\n\t}", "function _getFilePath($key){\n return $this->savePath .'/'. $this->prefix . md5($key);\n }", "public function getNewFilePath()\r\n {\r\n return $this->_newFilePath;\r\n }", "function save()\n {\n }", "function save()\n {\n }", "public function uploadPath();", "public function path();", "public function storage_path();" ]
[ "0.67895794", "0.6587589", "0.64885914", "0.6481541", "0.64481974", "0.6411067", "0.6346895", "0.63311315", "0.6225337", "0.62210774", "0.61868453", "0.6166525", "0.6156211", "0.6156211", "0.6155167", "0.6144089", "0.6124582", "0.61030716", "0.60964924", "0.60964924", "0.60930806", "0.6054138", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60523427", "0.60070914", "0.5993777", "0.5992099", "0.598672", "0.5984475", "0.5983617", "0.5964829", "0.5962486", "0.5961047", "0.59331596", "0.59274673", "0.5884027", "0.5878734", "0.58634084", "0.5838399", "0.5828435", "0.5828354", "0.58227795", "0.5821675", "0.5820065", "0.5816638", "0.5816638", "0.5801037", "0.5801037", "0.5801037", "0.5801037", "0.58005005", "0.57923776", "0.57879573", "0.57873374", "0.57676965", "0.5766742", "0.57631737", "0.57621336", "0.57606685", "0.5759999", "0.5759333", "0.5758148", "0.57555646", "0.5733866", "0.5724439", "0.5709997", "0.57080233", "0.5698676", "0.5698676", "0.56955564", "0.56934184", "0.56934184", "0.5688909", "0.5687468", "0.56812537", "0.5680501", "0.5680501", "0.5673874", "0.5669799", "0.5660791", "0.56556815", "0.56556815", "0.56556606", "0.5655268", "0.5649551" ]
0.0
-1
Get path last created crud file
public function getHistory() { if ($this->history) { return $this->history; } if (file_exists(static::FILE_HISTORY)) { $history = file_get_contents(static::FILE_HISTORY); if (file_exists($history)) { return $history; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function path(): string\n {\n return 'files/' . $this->model->filename();\n }", "private function getFilePath() {\n\t\treturn $this->options['path'].'/'.md5($this->options['revision']).'/'.$this->path;\n\t}", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }", "public function getFilepath();", "public function getLastUpdatedFile(): string\n {\n $path = $this->getJsonTypeFolder();\n $this->lastUpdatedFile = $path . DIRECTORY_SEPARATOR . 'last-updated.php';\n return $this->lastUpdatedFile;\n }", "public function getNewFilePath()\r\n {\r\n return $this->_newFilePath;\r\n }", "public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }", "public function getFilePath(): string\n {\n return oas_path(\n $this->version . '/components/schemas/' . $this->getFileName() . '.json'\n );\n }", "public function getTemplateFilePath() {\n\t}", "public function getFilePath(): string;", "public function getFilePath(): string;", "public function path() {\n return $this->filepath();\n }", "protected function filename()\n {\n return 'permissions_datatable_' . time();\n }", "public function getScreenshotFilePath() {\n $uploadPath = $this->getScreenshotUploadPath();\n if (!is_dir($uploadPath)) {\n mkdir($uploadPath);\n }\n return $uploadPath . $this->id . \".\" . $this->screenshotFile->extension;\n }", "public function getFilePath()\n {\n return $this->file_path;\n }", "public function getFullPath(): string;", "protected function filename()\n {\n return 'history_' . time();\n }", "private function getFilePath() {\n return FileService::getInstance()->getTempDirPath() . DIRECTORY_SEPARATOR . $this->fileBaseName;\n }", "private function pathFilename() {\n return $this->directory . \"/\" . $this->formatFilename();\n }", "protected function filename()\n {\n return 'ciudaddatatables_' . time();\n }", "public function path(): string;", "public function path(): string;", "public function getFilePath() {\n return base_path() . '/lam.json';\n }", "public function getPath() {\n return FILES_LOCATION . DS . $this->getType() . DS . $this->getId();\n }", "public function getCurrentFile() {}", "private function getSavePath()\n\t{\n\t\t$todoDir = $this->todoDir;\n\t\t$fileExtendedName = $this->addExtension();\n\t\treturn $todoDir . $fileExtendedName;\n\t}", "public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}", "public function getFilepath()\n {\n return $this->filepath;\n }", "protected function filename()\n {\n return 'photos_datatable_' . time();\n }", "public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}", "public function getFilepath()\n {\n return $this->folder.'/'.$this->file.'.json';\n }", "public function getFilePath() {\n return $this->path;\n }", "protected function filename()\n {\n return 'User_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'User_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'User_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'User_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'User_' . date('YmdHis');\n }", "public function GetRealPath()\n {\n return PATH_CMS_CUSTOMER_DATA.'/'.$this->GetRealFileName();\n }", "protected function filename()\n {\n return 'administrator\\verificationsdatatables_'.time();\n }", "protected function filename() {\n return 'usersdatatable_' . time();\n }", "public function getPathToFile(): string;", "protected function getFileGenerationPath()\n {\n $path = $this->getPathByOptionOrConfig('path', 'migration_target_path');\n $fileName = $this->getDatePrefix() . '_' . $this->argument('migrationName') . '.php';\n\n return \"{$path}/{$fileName}\";\n }", "protected function filename()\n {\n return 'compras_' . time();\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;", "public function getFile_path() {\n return $this->_file_path ? $this->_file_path : null;\n }", "public function path(): string\n {\n return realpath($this->file);\n }", "public function getSavedFileName()\n {\n return $this->savedFileName;\n }", "public function fullPath(){\n if ( strpos( $this->template, DIRECTORY_SEPARATOR ) === 0 ) {\n return $this->template . '.php';\n } else {\n return $this->path . DIRECTORY_SEPARATOR . $this->template . '.php';\n }\n }", "protected function filename()\n {\n return 'UserRequest_' . date('YmdHis');\n }", "public function getFilename() {}", "public function path();", "public function get_path(): string\n {\n return $this->path;\n }", "protected function filename()\n {\n return 'projectsdatatables_' . time();\n }", "protected function filename()\n {\n return 'Egreso_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Users_' . date('YmdHis');\n }", "public function getFilename()\n {\n return __FILE__;\n }", "public function getFilePath(): string\n {\n return $this->targetDir . '/' . $this->getFileName();\n }", "protected function filename()\n {\n return 'ticket_' . time();\n }", "private function getThumbFilepath() {\n\t\t$filename = $this->getThumbFilename();\n\t\t$filepath = $this->pathCache . $filename;\n\t\treturn($filepath);\n\t}", "public function getUploadedFilePath()\n {\n return !empty($this->filepath) ? $this->filepath : \n (!empty($this->filename) ? (Yii::$app->params['uploadPath'] . $this->filename) : null);\n }", "public function getAbsolutePath()\n {\n return null === $this->photoId\n ? null\n : $this->getUploadRootDir().'/'.$this->photoId;\n }", "public function getFullPath();", "public function getFilename() {\n return $this->path;\n }", "public function getPath()\n {\n return 'bundles/jobhub/'.$this->getUploadDir().'/'.$this->path;\n }", "public function getPathAttribute() {\n return $this->base_path.$this->filename;\n }", "protected function filename()\n {\n return 'Company_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'Campeonato_' . date('YmdHis');\n }", "public function path() {}", "public function path() {}", "public function getTemplatePathAndFilename() {}", "protected function filename()\n {\n return 'userdatatables_' . time();\n }", "protected function filename()\n {\n return 'Contact_' . date('YmdHis');\n }", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "protected function filename()\n {\n return 'inventarisdatatable_' . time();\n }", "protected function filename()\n {\n return 'Admin_' . date('YmdHis');\n }", "private function tempFilePath()\n {\n $path = 'exports/'.Str::random();\n\n // Make sure the file exists\n Storage::put($path, null);\n\n return Storage::path($path);\n }", "protected function filename()\n {\n return 'ctcommunicationsocialmediadatatable_' . time();\n }", "function _getFilePath($key){\n return $this->savePath .'/'. $this->prefix . md5($key);\n }", "private function getFilePath()\n {\n return \\Application::dirLogs() . '/console.log';\n }", "protected function filename()\n {\n return 'account_list_' . date('Y_m_d_H_i_s');\n }", "protected function filename()\n {\n return 'wallet_' . date('YmdHis');\n }", "public function getFilename()\n {\n return static::filename($this->path);\n }", "protected function filename()\n {\n return 'Automobile_' . date('YmdHis');\n }", "protected function filename()\n {\n return 'users_' . date('YmdHis');\n }" ]
[ "0.70181626", "0.68198526", "0.66494465", "0.66494465", "0.66494465", "0.66494465", "0.6630069", "0.6589916", "0.65517956", "0.65308833", "0.65223867", "0.6509854", "0.6504796", "0.64440995", "0.64440995", "0.64365226", "0.64198184", "0.6398221", "0.6382711", "0.63640815", "0.6357885", "0.63335294", "0.6315135", "0.6310487", "0.63004684", "0.63004684", "0.6291245", "0.62867576", "0.62829155", "0.62802047", "0.6247408", "0.62430936", "0.6241393", "0.6240609", "0.6234098", "0.6212405", "0.62002903", "0.62002903", "0.62002903", "0.62002903", "0.62002903", "0.6198743", "0.61867565", "0.61842924", "0.61829966", "0.61727965", "0.617152", "0.61599386", "0.61599386", "0.61599386", "0.61599386", "0.61599386", "0.61599386", "0.61599386", "0.61599386", "0.61465603", "0.61433315", "0.6137176", "0.6134908", "0.61249053", "0.6121546", "0.611533", "0.61139935", "0.61097556", "0.6107081", "0.61029685", "0.61029685", "0.61029685", "0.61029685", "0.61029685", "0.61029685", "0.6096436", "0.609608", "0.60906005", "0.60903066", "0.6086969", "0.6084376", "0.60841256", "0.6079866", "0.607436", "0.60692817", "0.6069139", "0.6060577", "0.6057048", "0.60558206", "0.6054759", "0.60529286", "0.6049524", "0.6045921", "0.6045921", "0.6045414", "0.60448706", "0.6042078", "0.60381126", "0.6037711", "0.6037311", "0.6037146", "0.60291624", "0.60274625", "0.60210747", "0.60196954" ]
0.0
-1
retorna tabla con nombre de la pelicula y su genero
function GetPeliculasConGenero(){ //$sentencia = $this->db->prepare("SELECT * FROM peliculas INNER JOIN genero ON peliculas.titulo = genero.nombre"); $sentenciasad = $this->db->prepare("SELECT peliculas.titulo, genero.nombre FROM peliculas INNER JOIN genero ON peliculas.id_genero = genero.id_genero"); $sentencias->executing(); //print_r( $sentencia->fetchAll(PDO::FETCH_OBJ));// vemos que este cargado y con que return $sentencia->fetchAll(PDO::FETCH_OBJ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crear_tabla_horario()\n {\n //El funcionamiento es el mismo que en crear_tabla, excepto que aqui no le pasamos el profesor\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n\n $num1 = filter_input(INPUT_POST, 'num1');\n\n $profe=$this->model->get_profe($_SESSION['iduser']);\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n $mes = str_pad($mes, 2, \"0\", STR_PAD_LEFT);\n $h_profe=$this->model->get_h_profe($profe[0]['id_profesores'], $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n for($i=0;$i<5;$i++)\n {\n\n $numeros[$i+1] = $numeros[$i]+1;\n\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n for($i=8;$i<21;$i++)\n {\n if($i!=14 && $i!=15)\n {\n\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n $ano=str_pad($numeros[$k],2,\"0\",STR_PAD_LEFT);\n //Si el horario del profe esta vacio printamos boton en todos los td\n if(!empty($h_profe))\n {\n $cont = 0;\n foreach ($h_profe as $hora)\n {\n $mes_1 = $mes;\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $fecha = $año.\"-\".$mes_1.\"-\".$ano;\n\n //Comprobamos si la hora y la fecha coincide y sumamos 1 al contador\n if($hora['hora']==$i && $hora['fecha'] == $fecha)\n {\n $cont++;\n }\n }\n //Si el cantador sigue en 0 printamos boton ya que significa que no ha sido marcada\n if($cont ==0)\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n }\n else\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n }\n $total.=\"</tr>\";\n }\n }\n echo $total;\n }", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "function getNombreTablaTrazadora($nombre) {\r\n switch ($nombre) {\r\n case 'INMU':\r\n $tabla = \"inmunizacion.prestaciones_inmu\";\r\n break;\r\n case 'NINO':\r\n case 'NINO_PESO':\r\n $tabla = \"trazadoras.nino_new\";\r\n break;\r\n case 'ADOLESCENTE':\r\n $tabla = \"trazadoras.adolecentes\";\r\n break;\r\n case 'PARTO':\r\n $tabla = \"trazadoras.partos\";\r\n break;\r\n case 'EMB':\r\n $tabla = \"trazadoras.embarazadas\";\r\n break;\r\n case 'ADULTO':\r\n $tabla = \"trazadoras.adultos\";\r\n break;\r\n case 'SEGUIMIENTO':\r\n $tabla = \"trazadoras.seguimiento_remediar\";\r\n break;\r\n case 'CLASIFICACION':\r\n $tabla = \"trazadoras.clasificacion_remediar2\";\r\n break;\r\n case 'TAL':\r\n $tabla = \"trazadoras.tal\";\r\n break;\r\n }\r\n return $tabla;\r\n}", "function tabla_filas_proyecto($filas,$moneda,$cant,$tip,$barc,$artc,$desc,$prev,$mon,$mons,$monc,$tfdsc,$fdsc,$tdsc,$dsc,$IVA){\n\t\t$monchunk = explode(\"/\",$moneda); \n\t\t$Vmond = trim($monchunk[0]); // Nombre de Moneda\n\t\t$Vmons = trim($monchunk[1]); // Simbolo de Moneda\n\t\t$Vmonc = trim($monchunk[2]); // Tipo de Cambio\n\t\t$Vmonc = str_replace(\"(\",\"\",$Vmonc); //le quita el primer parentesis que rodea el tipo de cambio\n\t\t$Vmonc = str_replace(\" x 1)\",\"\",$Vmonc); //le quita el 2do. parentesis y el x 1\n\t\t\t$salida = '<br>';\n\t\t\t$salida.= '<table class = \"tablegrid\">';\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"30px\" height = \"30px\">No.</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">Cant.</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"300px\">Descipción</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">P. Unitario</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">Descuento</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"75px\">P. Total</td>';\n\t\t\t$salida.= '<th class = \"thgrid\" align = \"center\" width = \"30px\"></td>';\n\t\t\t$salida.= '</tr>';\n\t$STotal = 0;\n\t$Total = 0;\n\t$Rtotal = 0;\n\t$DescU = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//No.\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">'.$i.'.</td>';\n\t\t\t//Cantidad\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spancant'.$i.'\">'.$cant[$i].'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"cant'.$i.'\" id = \"cant'.$i.'\" value = \"'.$cant[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"tip'.$i.'\" id = \"tip'.$i.'\" value = \"'.$tip[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Descripcion o Articulo\n\t\t\t$desc[$i] = utf8_decode($desc[$i]);\n\t\t\t$desc[$i] = trim($desc[$i]);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"left\">'.$desc[$i];\n\t\t\t$salida.= '<input type = \"hidden\" name = \"barc'.$i.'\" id = \"barc'.$i.'\" value = \"'.$barc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"artc'.$i.'\" id = \"artc'.$i.'\" value = \"'.$artc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"desc'.$i.'\" id = \"desc'.$i.'\" value = \"'.$desc[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Precio U.\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">'.trim($mons[$i]).' '.$prev[$i];\n\t\t\t$salida.= '<input type = \"hidden\" name = \"prev'.$i.'\" id = \"prev'.$i.'\" value = \"'.$prev[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"mon'.$i.'\" id = \"mon'.$i.'\" value = \"'.trim($mon[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"mons'.$i.'\" id = \"mons'.$i.'\" value = \"'.trim($mons[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"monc'.$i.'\" id = \"monc'.$i.'\" value = \"'.trim($monc[$i]).'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//Descuento\n\t\t\t$dsign = ($tdsc[$i] == \"P\")?\"%\":trim($mons[$i]);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spandsc'.$i.'\">'.$dsign.' '.$dsc[$i].'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"tdsc'.$i.'\" id = \"tdsc'.$i.'\" value = \"'.$tdsc[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"dsc'.$i.'\" id = \"dsc'.$i.'\" value = \"'.$dsc[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//sub Total\n\t\t\t$rtot = ($prev[$i] * $cant[$i]);\n\t\t\tif($tdsc[$i] == \"P\"){\n\t\t\t\t$descuento = ($rtot *($dsc[$i])/100);\n\t\t\t}else if($tdsc[$i] == \"M\"){\n\t\t\t $descuento = $dsc[$i];\n\t\t\t}\n\t\t\t$Dcambiar = Cambio_Moneda($monc[$i],$Vmonc,$descuento);\n\t\t\t$DescU += $Dcambiar;\n\t\t\t$stot = $rtot - $descuento;\n\t\t\t$Dcambiar = Cambio_Moneda($monc[$i],$Vmonc,$stot);\n\t\t\t$STotal+= $Dcambiar;\n\t\t\t$Rcambiar = Cambio_Moneda($monc[$i],$Vmonc,$rtot);\n\t\t\t$Rtotal+= $Rcambiar;\n\t\t\t$stot = round($stot, 2);\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanstot'.$i.'\">'.trim($mons[$i]).' '.$stot.'</span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"stot'.$i.'\" id = \"stot'.$i.'\" value = \"'.$stot.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"rtot'.$i.'\" id = \"rtot'.$i.'\" value = \"'.$rtot.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t//---\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">';\n\t\t\t$salida.= '<a href = \"javascript:void(0);\" onclick = \"QuitarFilaVenta('.$i.')\" title = \"Quitar Fila\" style = \"border:none;\" ><img src = \"../../CONFIG/images/icons/delete.png\" style = \"vertical-align:middle;border:none;\"></a>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\tif($tfdsc == \"P\"){\n\t\t\t\t$descuento = ($STotal *($fdsc)/100);\n\t\t\t}else if($tfdsc == \"M\"){\n\t\t\t $descuento = $fdsc;\n\t\t\t}\n\t\t\t$Total = $STotal - $descuento;\n\t\t\t$STotal = round($STotal, 2); //total sin iva\n\t\t\t$Total = round($Total, 2); //total sin iva\n\t\t\t$DescU = round($DescU, 2); //promedio de descuento\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"3\" rowspan = \"4\">';\n\t\t\t$salida.= '<span id = \"spannota\">';\n\t\t\t$salida.= '<b>NOTA:</b> MONEDA PARA COTIZACI&Oacute;N: <b>'.$Vmond.'</b>. TIPO DE CAMBIO '.$Vmonc.' x 1';\n\t\t\t$salida.= '</span></td>';\n\t\t\t$salida.= '<td class = \"thgrid\">Desc/Unitarios</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanpromdesc\"><b>'.$Vmons.' '.$DescU.'</b></span>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"promdesc\" id = \"promdesc\" value = \"'.$DescU.'\" /></td>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">Subtotal</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanstotal\"><b>'.$Vmons.' '.$STotal.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"stotal\" id = \"stotal\" value = \"'.$STotal.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">Desc/General</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spandscgeneral\"><b>'.$Vmons.' '.$descuento.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"tdescuento\" value = \"'.$descuento.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"ttdescuento\" value = \"'.$tfdsc.'\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"thgrid\">TOTAL</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\">-</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" align = \"center\"><span id = \"spanttotal\"><b>'.$Vmons.' '.$Total.'</b></span>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"ttotal\" id = \"ttotal\" value = \"'.$Total.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Rtotal\" id = \"Rtotal\" value = \"'.$Rtotal.'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"filas\" id = \"filas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '<td class = \"tdgrid\" colspan = \"2\"></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\t\t$salida.= '</form>';\n\t\t\t$salida.= '<br>';\n\t\n\treturn $salida;\n}", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "function prikazi_sqltabelu($sql_tabela) {\n\n\tglobal $db;\n\n\techo \"<table class='dt-table'>\";\n\techo \"<h2>\" . $sql_tabela . \"</h2>\";\n\n\t// generisanje headera tabele (prikaz podataka)\n\n\t$komanda_head = \"SELECT * FROM $sql_tabela LIMIT 1\";\n\t$result_head = mysql_query($komanda_head, $db);\t\n\n\twhile ( $red = mysql_fetch_assoc($result_head) ) :\n\n\t\t$m = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_head, $m);\n \t\t\techo \"<td class='dt-table'>\" . $kolona . \"</td>\";\n \t\t\t//echo \"<td>\" . $item . \"</td>\";\n \t\t$m++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\t// generisanje tela tabele (prikaz podataka)\n\n\t$komanda_body = \"SELECT * FROM $sql_tabela\";\n\t$result_body = mysql_query($komanda_body, $db);\n\n\n\twhile ( $red = mysql_fetch_assoc($result_body) ) :\n\n\t\t$n = 0;\n\n\t\techo \"<tr class='dt-table'>\";\n\n\t\tforeach ($red as $item) {\n\t\n\t\t\t$kolona = mysql_field_name($result_body, $n);\n \t\t\techo \"<td class='dt-table'>\" . $item . \"</td>\";\n \t\t$n++;\n\n\t\t}\n\n\t\techo \"</tr>\";\n\n\tendwhile;\n\n\techo \"</table>\";\n\n}", "function tabla_filas_proyecto_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.$opera[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.$boucher[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.$observ[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "function generaTabla($idciudad, $tnegocio, $cantidad, $criterio, $pagina, $registro)\n {\n $array = tbOrganizacionData::getpaginartmp($idciudad, $tnegocio, (($pagina - 1) * $registro), $registro);\n $str = '';\n $imgs= \"\";\n $sihotel = 0;\n $i =0;\n foreach ($array as $rs) {\n $i++;\n $sihotel = 0;\n $dimgs = \"images/imgHoteles/dir\".$rs['idorg'].\"/imgHotel\";\n if (is_dir($dimgs)) {\n //Escaneamos el directorio\n $carpeta = @scandir($dimgs);\n $sihotel = count($carpeta);\n }\n $imgs = \"images/imgHoteles/\";\n $imgs .= ($sihotel > 2) ? \"dir\" . $rs['idorg'] . \"/imgHotel\" : \"imgdefault/hotel\" ;\n $str .= '\n <div class=\"row stylerow\">\n <div class=\"col-sm-3 col-md-3 col-lg-3 quitar\"> \n <img class=\"img-fluid img-thumbnail\" src=\"'.\n $imgs.'/img1.jpg\" alt=\"\" style=\"height: 100% !important;\"/>\n </div>\n <div class=\"col-sm-2 col-md-2 col-lg-2 quitar\"> \n <div class=\"dos\">\n <img class=\"img-fluid img-thumbnail\" src=\"'.$imgs . '/img2.jpg\" alt=\"\"/> \n <img class=\"img-fluid img-thumbnail\" src=\"'.$imgs . '/img3.jpg\" alt=\"\"/> \n </div>\n </div>\n <!-- <div class=\"clearfix\"></div> -->\n <div class=\"col-sm-7 col-md-7 col-lg-7 quitar\"> \n <div class=\"row\"> \n <div class=\"col-sm-12 col-md-12 col-lg-12 quitar\"> \n <a href=\"index.php?view=datosHotel.php&idh='. $rs['idorg'].'\" ><span class=\"namehotel\">'.$rs['nomborg']. '</span></a>\n </div>\n <div class=\"col-sm-12 col-md-12 col-lg-12 styledato\"> \n ' . $rs['desgeneral1'] . '<br> ' . $rs['desgeneral2']. '\n </div>\n </div> \n </div>\n </div>'; \n }\n $funcion = \"buscaRecord\";\n $str .= pagination($cantidad, $pagina, $funcion, $criterio, $registro, 6);\n // pagination($cantidad, $pagina, $funcion, $criterio, $registro, 5); \n return $str;\n }", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "function tabla($base, $limite){\n\n\t\t$array = range ($base, $limite); //al array le asigno el rango en el que se tiene que crear\n\n\t\t\treturn $array; // pido que me lo devuelva\n\t}", "function desplegarTabla($query,$anchtable=array(),$iconos=array(),$coLoTabla=\"table-primary\"){\n\n\tglobal $oBD;\n\n\t$registros = $oBD->consulta($query);\n\n\t$columnas = mysqli_num_fields($registros);\n\techo '<table class= \"table table-hover'.$coLoTabla.'\">';\n\t// creacion de la cabecera\n\techo '<tr class=\"table-dark\">';// hace el renglon\n\n\t// if (count($anchtable)){\n\t// \tforeach ($anchtable as $anch) {\n\t// \t\techo \"<td style=width:$anch.'%';></td>\";\n\t// \t\techo $anch;\n\t// \t}\n\t// }\n$k = 0;\n// si el count de iconos existe entonces me mandaron iconos \n\tif (count($iconos)){\n\t\tforeach ($iconos as $icono) {\n\t\t\techo $k;\n\t\t\t\t\t\n\t\t\tif (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>&nbsp;</td>\";\t\n\t\t\t}else{\n\t\t\t\techo \"<td>&nbsp;</td>\";\t\n\t\t\t}\n\n\t\t\t$k++;\n\t\t}\n\t}\n\t//echo $columnas;\n\techo $k;\n\t//$k=$k-1;\n\tfor ($c=0; $c < $columnas; $c++){\n\t\t// para traer los nombres de los campos\n\t\t$campo=mysqli_fetch_field_direct($registros,$c); // da la informacion de un campo en la base de datos\n\t\t \n\t\t if (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>$campo->name.$c</td>\";\t\n\t\t\t}else{\n\t\t\t\techo '<td style=\"width:(90/$columnas)%\">'.$campo->name.'</td>';\t\t\n\t\t\t}\n\t\t // echo $anchtable[$c];\n\t\t $k++;\n\t\t\n\t}\n\techo '</tr>';\n\t// fin cabecera\n\t// comienzo de registros\n\tfor ($r=0; $r < $oBD->numeRegistros; $r++) \n\t{ echo '<tr>';\n\t\t// agregando iconos\n\t\t// EN EL CASO DE QUE \"UPDATE EXISTA EN EL ARRGLO DE LOS ICONOS\"\n\t\tif (in_array(\"update\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/update.png\"></td>';\n\t\t}\n\n\t\tif (in_array(\"delete\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/delete.png\"></td>';\n\t\t}\n\n\n\t\t$campos = mysqli_fetch_array($registros);\n\t\t// despliega la informacion de un registro especifico\n\t\tfor ($c=0; $c < $columnas; $c++) \n\t\t\techo '<td>'.$campos[$c].'</td>';\n\t echo '</tr>';\n\t\t\n\t}\necho '</table>';\necho $k;\n}", "public function createTable($prenotazioni) {\r\n echo \"<table id='tblPrenotazioni' summary='Tabella che riporta le prenotazioni delle aule di interesse per gli studenti di Matematica e Informatica.' >\";\r\n echo \"<thead>\";\r\n echo \"<tr> <th> ORARIO: </th>\";\r\n // NUMERO DI AULE:\r\n $numAule = 0;\r\n foreach (self::$array_aule as $aula) {\r\n echo \"<th> $aula </th>\";\r\n $numAule++;\r\n }\r\n echo \"</tr>\";\r\n echo \"</thead>\";\r\n echo \"<tbody>\";\r\n for ($i = 0; $i <= 22; $i++) {\r\n echo \"<tr> <td class='indice_ora'> \".$this->convertiInOra($i).\" </td>\";\r\n if (isset($prenotazioni[$i])) {\r\n foreach (self::$array_aule as $aula) {\r\n if (isset($prenotazioni[$i][$aula])) {\r\n if ($prenotazioni[$i][$aula]==\"\\\"\")\r\n echo \"<td class='apici'> <span > \\\" </span> </td>\";\r\n else\r\n echo \"<td class='corso'> <span>\" . $prenotazioni[$i][$aula][4] . \"</span> </td>\";\r\n } else {\r\n echo \"<td> </td>\";\r\n $this->arrayAuleLibere[$i][$aula]=\"libera\";\r\n }\r\n }\r\n } else {\r\n for ($j = 0; $j < $numAule; $j++)\r\n echo \"<td> </td>\";\r\n $this->arrayAuleLibere[$i]=\"tutto libero\";\r\n }\r\n echo \"</tr>\";\r\n } \r\n echo \"</tbody>\";\r\n echo \"</table>\";\r\n //var_dump($this->arrayAuleLibere);\r\n }", "function crear_tabla()\n {\n //Array para saber cuantos dias tienen los meses\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n //Recogemos los datos\n $num1 = filter_input(INPUT_POST, 'num1');\n $profe = filter_input(INPUT_POST, 'profe');\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n //Recogemos los horarios del profesor y la zona seleccionados\n $h_profe=$this->model->get_h_profe($profe, $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n //Sacamos los cinco numeros de la semana\n for($i=0;$i<5;$i++)\n {\n $numeros[$i+1] = $numeros[$i]+1;\n //si el numero es superior al dia maximo del mes entonces le restamos el dia maximo y reseteamos los dias\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n //marcamos que cambiamos de mes\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n //bucle para crear los tr de las horas\n for($i=8;$i<21;$i++)\n {\n //Quitamos las horas de comer\n if($i!=14 && $i!=15)\n {\n //generamos el primer td con la hora\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n //bucle para sacar el resto de td\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n //foreach de horarios para comprobar si coincide con la fecha y tenemos que printar un boton\n foreach ($h_profe as $hora)\n {\n //creamos otra variable de mes para no modificar la global\n $mes_1 = $mes;\n //Preguntas para saber si hay que modificar el mes, ya sea sumar o cambiar a 1\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n //Añadimos un zero a la izquierda si es inferior a 10\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $dia = str_pad($numeros[$k], 2, \"0\", STR_PAD_LEFT);\n //Montamos la fecha\n $fecha = $año.\"-\".$mes_1.\"-\".$dia ;\n\n //Preguntamos si la hora del tr es la misma que la del horario y lo mismo con la fecha\n if($hora['hora']== $i && $hora['fecha'] == $fecha)\n {\n //Si coincide creamos el boton\n $total.= \"<button class='practica hvr-grow-shadow'>Marcar</button>\";\n }\n }\n //Le metemos un span oculto con los datos de dia y hora.\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n\n }\n $total.=\"</tr>\";\n }\n }\n //Enviamos la tabla\n echo $total;\n }", "public static function getTablename() { return \"Productos_01\"; }", "function tabla_filas_compra_pago($filas,$tpago,$monto,$moneda,$tcambio,$opera,$boucher,$observ,$empresa,$caja,$banco,$cuenta,$tcambiodia){\n\t\t$tpago = explode(\"|\", $tpago);\n\t\t$monto = explode(\"|\", $monto);\n\t\t$moneda = explode(\"|\", $moneda);\n\t\t$tcambio = explode(\"|\", $tcambio);\n\t\t$opera = explode(\"|\", $opera);\n\t\t$boucher = explode(\"|\", $boucher);\n\t\t$observ = explode(\"|\", $observ);\n\t\t$empresa = explode(\"|\", $empresa);\n\t\t$caja = explode(\"|\", $caja);\n\t\t$banco = explode(\"|\", $banco);\n\t\t$cuenta = explode(\"|\", $cuenta);\n\t\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\t$total = 0;\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t//acumulado\n\t\t\t$Dcambiar = 0;\n\t\t\t$Dcambiar = Cambio_Moneda($tcambio[$i],$tcambiodia,$monto[$i]);\n\t\t\t$total += $Dcambiar;\n\t\t\t//-\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttpag'.$i.'\" id = \"Ttpag'.$i.'\" value = \"'.$tpago[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmonto'.$i.'\" id = \"Tmonto'.$i.'\" value = \"'.$monto[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tmoneda'.$i.'\" id = \"Tmoneda'.$i.'\" value = \"'.$moneda[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Ttipcambio'.$i.'\" id = \"Ttipcambio'.$i.'\" value = \"'.$tcambio[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Toperador'.$i.'\" id = \"Toperador'.$i.'\" value = \"'.utf8_decode($opera[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tboucher'.$i.'\" id = \"Tboucher'.$i.'\" value = \"'.trim($boucher[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tobserva'.$i.'\" id = \"Tobserva'.$i.'\" value = \"'.utf8_decode($observ[$i]).'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tsucur'.$i.'\" id = \"Tsucur'.$i.'\" value = \"'.$empresa[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcaja'.$i.'\" id = \"Tcaja'.$i.'\" value = \"'.$caja[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tbanco'.$i.'\" id = \"Tbanco'.$i.'\" value = \"'.$banco[$i].'\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"Tcuenta'.$i.'\" id = \"Tcuenta'.$i.'\" value = \"'.$cuenta[$i].'\" />';\n\t\t\t$salida.= '</td>';\n\t\t}\n\t}\t\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagFilas\" id = \"PagFilas\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"PagTotal\" id = \"PagTotal\" value = \"'.$total.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "function nombreTabla($result,$indice){\n\t if (isset($result) and isset ($indice)){\n\t\treturn mysql_field_table($result, $indice);\n\t }\n\t}", "public function crearTablas(){\r\n\t\t\t$this->crearTablaUsuario();\r\n\t\t\t$this->crearTablaDeporte();\r\n\t\t\t$this->crearTablaUsuarioDeporte();\r\n\t\t\t$this->crearTablaPassw();\r\n\t\t}", "function tabla($numero){\n\t\t\n\t\techo \"<h3>Tabla de multiplicar del numero: $numero </h3>\";\n\t\tfor ($i=1; $i <=10 ; $i++) {\n\t\t\t$resultado = $numero*$i;\n\n\t\t\techo \"$numero x $i = $resultado <br>\"; \n\t\t\t\n\t\t}\n\t}", "public function rellenarTabla($cabecera,$cuerpo,$ini,$fin,$tipo){\n \n if($tipo == '1'){\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th class='text-center'>FAMILIAR</th>\";\n }else{\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th>NOMBRE</th>\";\n }\n \n //*********Se agregan las cabeceras a las tablas********\n \n $numRegistros = count($cabecera);\n \n for ($i=$ini; $i < $fin; $i++) {\n \n if($i < $numRegistros){\n $tablaHead = $tablaHead.\"<th class='text-center'>\".$cabecera[$i]->NOMBRE_ENFER.\"</th>\";\n }\n \n }\n\n $endThead = \"</tr></thead>\";\n $tablaBody = \"<tbody>\";\n $seEncontroRel = FALSE;\n\n //***********se agrega el body a las tablas************\n\n foreach ($cuerpo as $rel) {\n $enfermedad = explode(\",\", $rel->ENFERMEDAD);\n $numEnf = count($enfermedad);\n $rowTable = \"</tr><td>\".$rel->NOMBRE_PAR.\"</td>\";\n //se recorre las enfermedades en base a un inicio y un fin\n for ($i=$ini; $i < $fin; $i++) {\n //es te if es para que en caso de que el fin sea mayor al del arreglo no se rompa\n if($i < $numRegistros){\n //se recorren los enfermedades relacionadas\n for ($j=0; $j < $numEnf; $j++) {\n //se valisa si son iguales\n if($cabecera[$i]->ID_ENFER_PK == $enfermedad[$j]){\n //echo \"valor 1 \".$cabecera[$i]->ID_ENFER_PK.\"<br>\";\n //echo \"valor 2 \".$enfermedad[$j].\"<br>\";\n $seEncontroRel = TRUE;\n break;\n }else{\n $seEncontroRel = FALSE;\n }\n }\n //en base a la variable se agrega si o no\n if($seEncontroRel == FALSE){\n //se agrega un No si no corresponde\n $rowTable = $rowTable.\"<td>NO</td>\";\n }else{\n //se agrega un Si cuando sena iguales\n $rowTable = $rowTable.\"<td>SI</td>\";\n }\n }\n }\n //se agregan los valores a la tabla\n $tablaBody = $tablaBody.$rowTable.\"<tr>\";\n }\n //*****************************************************\n \n $endTBody = \"</tbody>\";\n $endTabla = \"</table>\";\n \n //se concatenan todos los valores para la creacion de la tabla\n $tablaFamily = $tabla.$tablaHead.$endThead.$tablaBody.$endTBody.$endTabla;\n\n //Se regresa la tabla\n return $tablaFamily;\n }", "function tabela($vetorComcadastros, $vetorComIndices){//Função que cria a tabela/lista recebe o vetor cos os cadsastros e outro com os indices\n retornaEscolhidos($vetorComcadastros, $vetorComIndices);//escreve a tabela\n }", "public function tablaProductos () \n\t\t{\t\t\n\t\t\t//Javascript !!!\n\t\t\taddJs('js/products_table.js');\n\t\t\thidden ('iter',0); \n\t\t\t\n\t\t\techo '<table id=\"tabla_productos\" bgColor=#333 cellspacing=1 cellpadding=2 width=700><tbody>';\n\t\t\techo '<tr>'.\n\t\t\t\t\t'<th>Cantidad</th><th>Producto</th><th>Precio<br>sin Iva</th>'.\n\t\t\t\t\t'<th>Precio<br>con Iva</th><th>Total Neto</th><th>Total</th><th></th></tr>';\n\n\t\t\techo '</tbody></table>';\n\n\t\t\techo '<table bgColor=#333 cellspacing=1 cellpadding=2 width=700>';\n\t\t\t$this->tablaSumatoria();\n\t\t\techo '</table>';\t\t\t\n\t\t}", "function mostrar_tabla()\n {\n return $this->mostrar_tabla_slickgrid();\n /*\n $sPrefs = '';\n $id_usuario= core\\ConfigGlobal::mi_id_usuario();\n $tipo = 'tabla_presentacion';\n $oPref = new usuarios\\Preferencia(array('id_usuario'=>$id_usuario,'tipo'=>$tipo));\n $sPrefs=$oPref->getPreferencia();\n if ($sPrefs == 'html') {\n return $this->mostrar_tabla_html();\n } else {\n return $this->mostrar_tabla_slickgrid();\n }\n */\n }", "function tabla_lotes_compra($filas,$lot='',$art='',$gru=''){\n\t$lot = explode(\"|\", $lot);\n\t$art = explode(\"|\", $art);\n\t$gru = explode(\"|\", $gru);\n\t//----\n\t\t\t$salida.= '<table>';\n\t$i = 1;\t\n\tif($filas>0){\n\t\tfor($i = 1; $i <= $filas; $i ++){\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td class = \"celda\">Lote #: </td>';\n\t\t\t//-\n\t\t\t$desc = Agrega_Ceros($lot[$i]).\"-\".Agrega_Ceros($art[$i]).\"-\".Agrega_Ceros($gru[$i]);\n\t\t\t$salida.= '<td class = \"busqueda\">'.$desc;\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLlot'.$i.'\" id = \"TLlot'.$i.'\" value = \"'.$lot[$i].'\"/>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLart'.$i.'\" id = \"TLart'.$i.'\" value = \"'.$art[$i].'\"/>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLgru'.$i.'\" id = \"TLgru'.$i.'\" value = \"'.$gru[$i].'\"/>';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t\t}\n\t}else{\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><span class = \"celda\">No hay Lotes Enlazados</span></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td>';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLlot0\" id = \"TLot0\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLart0\" id = \"TLart0\" />';\n\t\t\t$salida.= '<input type = \"hidden\" name = \"TLgru0\" id = \"TLgru0\" />';\n\t\t\t$salida.= '</td>';\n\t\t\t$salida.= '</tr>';\n\t}\t\n\t\t\t//----\n\t\t\t$salida.= '<tr>';\n\t\t\t$salida.= '<td><input type = \"hidden\" name = \"LotTotal\" id = \"LotTotal\" value = \"'.$filas.'\"/></td>';\n\t\t\t$salida.= '</tr>';\n\t\t\t//----\n\t\t\t$salida.= '</table>';\n\t\n\treturn $salida;\n}", "public function mostrarEspecialidad(){\n\t\t\t$sql = \"SELECT * FROM especialidades\";\n\t\t\t\t$result = mysqli_query(Conexion::conectar(), $sql);\n\n\n\n\t\t$tabla = \"<table class='table'> \\n\";\n\t\t\t$tabla.= \"<tr> \\n\";\n\t\t\t$tabla.= \"<td><b>ID</b></td>\\n\";\n\t\t\t$tabla.= \"<td><b>Nombre</b></td>\\n\";\n\n\n\t\t\t\twhile ($fila = mysqli_fetch_row($result)) {\n\n\t\t\t\t\t$tabla.= \"<tr> \\n\";\n\t\t\t\t\t$tabla.= \"<td>$fila[0]</td>\\n\";\n\t\t\t\t\t$tabla.= \"<td>$fila[1]</td>\\n\";\n\n\t\t\t\t\t$tabla.=\"</tr> \\n\";\n\t\t\t\t}\n\n\t\t\t\t$tabla.=\"</table> \\n\";\n\n\t\t\t\treturn $tabla;\n\n\t}", "function tabla($result) {\n $tabla = \"\";\n while ($registro = mysqli_fetch_assoc($result)) {\n $tabla = $tabla .\n \"<div class='panel panel-default'>\n <div class='panel-heading'>\n <h4 class='panel-title'><a href='#'>\" . $registro[\"CurNom\"] . \"</a></h4>\n </div>\n <DIV class='panel-body' hidden>\n <div class='table-responsive'>\n <table class='table table-hover'>\n <tr> \n <Th>Criterio</Th>\n <Th>Nota</Th> \n </tr>\n <tr>\n <td>Evaluación Continua</td>\n <td>\" . $registro['NotaFinal1'] . \"</td>\n </tr>\n <tr>\n <td>Tareas y Practicas</td> \n <td>\" . $registro['NotaFinal2'] . \"</td> \n </tr>\n <tr>\n <td>Examen</td> \n <td>\" . $registro['NotaFinal3'] . \"</td> \n </tr> \n <tr>\n <th>Nota FINAL</th> \n <th>15</th> \n </tr>\n </table>\n </div>\n </DIV>\n </div>\\n\";\n }\n return $tabla;\n }", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "public function list_ptto_poa_final($tp_id){\n $lista_aper_padres = $this->model_proyecto->list_prog();//lista de aperturas padres \n $tabla ='';\n foreach($lista_aper_padres as $rowa){\n $proyectos=$this->model_ptto_sigep->acciones_operativas($rowa['aper_programa'],$tp_id);\n if(count($proyectos)!=0){\n $tabla .='<tr bgcolor=\"#99DDF0\" height=\"30\">';\n $tabla .='<td></td>';\n if($this->tp_adm==1){\n $tabla .='<td></td>';\n }\n $tabla .='<td><center>'.$rowa['aper_programa'].''.$rowa['aper_proyecto'].''.$rowa['aper_actividad'].'</center></td>';\n $tabla .='<td>'.$rowa['aper_descripcion'].'</td>';\n $tabla .='<td>'.$rowa['aper_sisin'].'</td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='</tr>';\n $nro=0;\n foreach($proyectos as $row){\n $nro++;\n // $fase = $this->model_faseetapa->get_id_fase($row['proy_id']);\n $aper=$this->model_ptto_sigep->partidas_proyecto($row['aper_id']);\n $tabla .= '<tr height=\"50\">';\n $tabla .= '<td align=center><center><img id=\"loadd'.$row['proy_id'].'\" style=\"display: none\" src=\"'.base_url().'/assets/img/loading.gif\" width=\"25\" height=\"25\" title=\"ESPERE UN MOMENTO, LA PAGINA SE ESTA CARGANDO..\"></center></td>';\n if($this->tp_adm==1){\n if(count($aper)!=0){\n $tabla .='<td><center><a href=\"'.site_url(\"\").'/mnt/ver_ptto_asig_final/'.$row['proy_id'].'\" id=\"myBtnn'.$row['proy_id'].'\" title=\"VER PRESUPUESTO ASIGNADO INICIAL - PROGRAMADO - APROBADO\" iclass=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/faseetapa.png\" WIDTH=\"34\" HEIGHT=\"34\"/></a></center></td>';\n }\n else{\n $tabla .='<td></td>';\n }\n }\n $tabla .= '<td align=center>'.$row['aper_programa'].''.$row['aper_proyecto'].''.$row['aper_actividad'].'</td>';\n $tabla .= '<td>'.$row['proy_id'].' | '.$row['proy_nombre'].'</td>';\n $tabla .= '<td>'.$row['tp_tipo'].'</td>';\n $tabla .= '<td>'.$row['proy_sisin'].'</td>';\n $tabla .= '<td>'.$row['fun_nombre'].' '.$row['fun_paterno'].' '.$row['fun_materno'].'</td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .='<td></td>';\n $tabla .= '</tr>';\n \n\n }\n }\n }\n return $tabla;\n }", "function build_table($new,$array_cat){\n\t\t//de categorias de serviceo.\n\t\t//Hacemos las iniciaciones pertinentes para intentar\n\t\t//aclarar un poco el codigo\n\t\t$ini_fila=\"<tr>\";\n\t\t$fin_fila=\"</tr>\";\n\t\t$ini_col='<td valign=\"top\" nowrap>';\n\t\t$fin_col=\"</td>\";\n\t\t$NUM_MAX_COLS=1;\n\t\t//Por cada columna un padre y sus hijos.\n\t\t$cadena='<table border=\"0\">';\n\t\t$num_current_col=$NUM_MAX_COLS+1;\t\t\n\t\tfor ($i=0;$i<count($array_cat);$i++){\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$num_current_col=1;\n\t\t\t\t$cadena=$cadena.$ini_fila;\n\t\t\t}\n\t\t\t$cadena=$cadena.$ini_col;\n\t\t\t//Damos el padre para que empiece la recursividad\t\t\t\n\t\t\t\n\t\t\t$cadena=$cadena.$this->build_col($new,$array_cat[$i],0,\"services\");\t\t\n\t\t\t//0 es el numero de tabulaciones inicial.\n\t\t\t//\"services\" es el nombre que tendran los checkbox.\n\t\t\t$cadena=$cadena.$fin_col;\n\t\t\t$num_current_col++;\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$cadena=$cadena.$fin_fila;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Si el numero de la columna actual es menor\n\t\t//que el numero maximo de columnas +1 \n\t\t//restamos al maximo la actual para saber cuantas faltan. \n\t\tif ($num_current_col<$NUM_MAX_COLS+1){\t\t\t\n\t\t\t$cadena=$cadena.'<td colspan=\"'.($NUM_MAX_COLS+1-$num_current_col).'\">&nbsp;'.$fin_col.$fin_fila;\n\t\t}\n\t\t$cadena=$cadena.'</table>';\n\t\treturn $cadena;\n\t}", "function tablaRuta($Nombre){\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::tablaRegistro($Nombre, $query);\r\n\t\r\n }", "function ispis_tablice($ucenici)\n {\n echo '<table border=1>';\n foreach ($ucenici as $key => $ime) {\n echo '<tr><td>'\n .$key.'</td>;\n <td>'.$ime.'</td>;\n </tr>';\n }\n echo '</table>';\n }", "function titulopersonal(){\n print (\"\\n<tr>\");\n if($this->titulo !=\"\")\n foreach ($this->titulo as $titulo){\n print (\"\\n<th>$titulo</th>\");\n }\n print (\"\\n<tr>\"); \n }", "public function creaTablas($numTablas,$cabecera,$cuerpo,$numero,$tipo){\n //arreglo que contendra el numero de tablas\n $datos = array();\n\n if($cuerpo == NULL || $cuerpo == \"\"){\n $datos[0] = \"<table class='table font-10'><thead></thead><tbody><tr><td colspan='6' class='text-center'>Sin Antecedentes</td></tr></tbody></table>\";\n }else{\n //se le agregan los valores por posiciones al array\n for ($i=0; $i < $numTablas; $i++) {\n \n $inicia = $numero * $i;\n $termina = $numero + $inicia;\n $datos[$i] = $this->rellenarTabla($cabecera,$cuerpo,$inicia,$termina,$tipo);\n }\n }\n return $datos;\n }", "function getTablaInformeAjuntament($desde,$hasta){\n \n // $this->ponerHorasTaller();\n // $this->ponerNumRegistro();\n \n \n $letra=getLetraCasal();\n $numeroRegistroCasalIngresos=getNumeroRegistroCasalIngresos();\n $numeroRegistroCasalDevoluciones=getNumeroRegistroCasalDevoluciones();\n \n $sql=\"SELECT id FROM casal_recibos WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY id ASC LIMIT 1\";\n if($this->db->query($sql)->num_rows()==0){\n $primero=0;\n }\n else {\n $primero=$this->db->query($sql)->row()->id;\n }\n \n $sql=\"SELECT id FROM casal_recibos WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY id DESC LIMIT 1\";\n if($this->db->query($sql)->num_rows()==0){\n $ultimo=0;\n }\n else {\n $ultimo=$this->db->query($sql)->row()->id;\n }\n \n $sql=\"SELECT r.id as id, r.fecha as fecha , r.id_socio as id_socio , r.importe as importe , r.recibo as recibo, s.nombre as nombre,s.apellidos as apellidos \n FROM casal_recibos r\n LEFT JOIN casal_socios_nuevo s ON s.num_socio=r.id_socio\n WHERE fecha>='$desde' AND fecha<='$hasta' ORDER BY r.id\";\n \n $sql=\"SELECT r.fecha as fecha,\"\n . \" lr.id_recibo as recibo,\"\n . \" lr.importe as importe, \"\n . \" t.nombre_corto as nombre,\"\n . \" t.horas_taller_T1 as horas_taller_T1,\"\n . \" t.horas_taller_T2 as horas_taller_T2,\"\n . \" t.horas_taller_T3 as horas_taller_T3,\"\n . \" s.dni as dni,\"\n . \" lr.tarjeta as tarjeta,\"\n . \" lr.periodos as periodos,\"\n . \" lr.id_taller as id_taller,\"\n . \" lr.id_socio as id_socio,\"\n . \" lr.id as id,\"\n . \" lr.num_registro as num_registro,\"\n . \" lr.num_registro_posicion as num_registro_posicion,\"\n . \" s.num_socio as num_socio\"\n . \" FROM casal_lineas_recibos lr\"\n . \" LEFT JOIN casal_recibos r ON lr.id_recibo=r.id\"\n . \" LEFT JOIN casal_talleres t ON t.id=lr.id_taller\"\n . \" LEFT JOIN casal_socios_nuevo s ON s.num_socio=lr.id_socio\"\n . \" WHERE lr.importe>0 AND lr.id_recibo>='$primero' AND lr.id_recibo<='$ultimo' ORDER BY lr.num_registro_posicion\";\n \n //log_message('INFO',$sql);\n \n $recibos=array(); \n if($this->db->query($sql)->num_rows()>0) \n $recibos=$this->db->query($sql)->result();\n \n \n $cabeceraTabla='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\">Data</th>\n <th class=\"col-sm-1 text-center\">Num Registre</th>\n <th class=\"col-sm-1 text-center\">DNI Usuari</th>\n <th class=\"col-sm-1 text-center\">Nom Actividad</th>\n <th class=\"col-sm-1 text-center\">Num Registre Ingrés</th>\n <th class=\"col-sm-1 text-center\" >Preu/hora</th>\n <th class=\"col-sm-1 text-center\">Import Base</th>\n <th class=\"col-sm-1 text-center\">% IVA (exempt)</th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\">TIPOLOGIA INGRES</th>\n \n </tr>';\n \n \n \n $tabla=$cabeceraTabla;\n \n $importeTotal=0;\n foreach ($recibos as $k=>$v) {\n $fecha=$v->fecha;\n $fecha=substr($fecha,8,2).'/'.substr($fecha,5,2).'/'.substr($fecha,0,4);\n $tabla.='<tr>';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $fecha;\n $tabla.='</td>';\n \n $num=strval($v->num_registro_posicion);\n while(strlen($num)<5) {\n $num='0'.$num;\n }\n $tabla.='<td class=\"text-center\">';\n $tabla.= $v->num_registro.$num;\n $tabla.='</td>';\n \n \n $dni=$v->dni;\n if($this->socios_model->validar_dni($dni)){\n $tabla.='<td class=\"text-center\">';\n $tabla.= strtoupper($dni);\n $tabla.='</td>';\n }\n else{\n $tabla.='<td class=\"text-center\" style=\"color:red\">';\n $tabla.= strtoupper($dni).\"(\".$v->num_socio.\")\";\n $tabla.='</td>';\n }\n \n $nombre=$v->nombre;\n $tabla.='<td class=\"text-center\">';\n $tabla.= $nombre;\n $tabla.='</td>';\n \n $recibo=$letra.' '.$v->recibo; \n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n \n if($v->periodos==4) $horas=floatval($v->horas_taller_T1);\n if($v->periodos==2) $horas=floatval($v->horas_taller_T2);\n if($v->periodos==1) $horas=floatval($v->horas_taller_T3); \n //log_message('INFO', '===================='.$v->nombre.' '.$horas);\n \n if($horas>0)\n $preu_hora=number_format($v->importe/$horas*100,2); \n else \n $preu_hora=0;\n\n $tabla.='<td class=\"text-center\">';\n $tabla.= $preu_hora;\n $tabla.='</td>';\n \n \n \n $importe=$v->importe;\n $tabla.='<td class=\"text-center\" >';\n $tabla.= number_format($importe,2);\n $tabla.='</td>';\n \n $importe=$v->importe;\n $tabla.='<td class=\"text-center\">';\n $tabla.= '0.00';\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" style=\"border-right:2px solid black;border-left:2px solid black;\">';\n $tabla.= number_format($importe,2);\n $tabla.='</td>';\n $importeTotal+=number_format($importe,2);\n \n $tarjeta=number_format($v->tarjeta,2);\n if($tarjeta==0) $pago=\"Efectiu\"; else $pago=\"TPV fisic\";\n $tabla.='<td class=\"text-center\">';\n $tabla.= $pago;\n $tabla.='</td>';\n \n $tabla.='</tr>';\n }\n \n \n $pieTabla='</tr></thead><thead><tr>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:0px solid white;border-left:1px solid white;\"></th>';\n $pieTabla.='<th class=\"text-center\">T O T A L S</th>';\n $pieTabla.='<th class=\"text-center\" style=\"border-bottom:2px solid black;border-right:2px solid black;border-left:2px solid black;\">';\n $pieTabla.=number_format($importeTotal,2);\n $pieTabla.='</th>';\n $pieTabla.='</tr></thead></tody></table>';\n \n $tabla.=$pieTabla;\n \n \n $cabeceraTablaDevoluciones='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\">Data</th>\n <th class=\"col-sm-1 text-center\">Num Registre</th>\n <th class=\"col-sm-1 text-center\">DNI Usuari</th>\n <th class=\"col-sm-1 text-center\">Nom Actividad</th>\n <th class=\"col-sm-1 text-center\">Num Registre Devolució</th>\n <th class=\"col-sm-1 text-rigcenterht\" >Preu/hora</th>\n <th class=\"col-sm-1 text-center\">Import Base</th>\n <th class=\"col-sm-1 text-center\">% IVA (exempt)</th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\">TIPOLOGIA DEVOLUCIÓ</th>\n \n </tr>';\n \n $tituloCasal=strtoupper(getTituloCasal());\n $salida='<h4>INFORME DETALLAT INGRESSOS</h4>'\n . ''\n . 'EQUIPAMENT MUNICIPA: <STRONG>'.$tituloCasal.'</STRONG>'\n . '<BR>'\n . 'ADJUDICATARI: <STRONG>'.'SERVEIS A LES PERSONES INCOOP, SCCL</STRONG>'\n . '<BR>'\n . 'NIF ADJUDICATARI: <STRONG>F60137411</STRONG>'\n . '<BR>'\n . 'NÚM CONTRACTE: <STRONG>18001022</STRONG>'\n . '<BR>'\n . 'Periode: <STRONG>'.substr($desde,8,2).'/'.substr($desde,5,2).'/'.substr($desde,0,4).' - '.substr($hasta,8,2).'/'.substr($hasta,5,2).'/'.substr($hasta,0,4).'</STRONG>'\n . '<BR>'\n . '<BR>'\n \n .$tabla.'<br>';\n \n $sql=\"SELECT r.fecha as fecha,\"\n . \" lr.id_recibo as recibo,\"\n . \" lr.importe as importe, \"\n . \" t.nombre_corto as nombre,\"\n . \" t.horas_taller_T1 as horas_taller_T1,\"\n . \" t.horas_taller_T2 as horas_taller_T2,\"\n . \" t.horas_taller_T3 as horas_taller_T3,\"\n . \" s.dni as dni,\"\n . \" lr.tarjeta as tarjeta,\"\n . \" lr.periodos as periodos,\"\n . \" lr.id_taller as id_taller,\"\n . \" lr.id_socio as id_socio,\"\n . \" lr.id as id,\"\n . \" lr.num_registro as num_registro,\"\n . \" lr.num_registro_posicion as num_registro_posicion,\"\n . \" s.num_socio\"\n . \" FROM casal_lineas_recibos lr\"\n . \" LEFT JOIN casal_recibos r ON lr.id_recibo=r.id\"\n . \" LEFT JOIN casal_talleres t ON t.id=lr.id_taller\"\n . \" LEFT JOIN casal_socios_nuevo s ON s.num_socio=lr.id_socio\"\n . \" WHERE lr.importe<0 AND lr.id_recibo>='$primero' AND lr.id_recibo<='$ultimo' ORDER BY lr.num_registro_posicion\";\n \n \n \n $recibos=array(); \n if($this->db->query($sql)->num_rows()>0) \n $recibos=$this->db->query($sql)->result();\n \n $tabla=$cabeceraTablaDevoluciones;\n $importeTotalDevoluciones=0;\n foreach ($recibos as $k=>$v) {\n $fecha=$v->fecha;\n $fecha=substr($fecha,8,2).'/'.substr($fecha,5,2).'/'.substr($fecha,0,4);\n $tabla.='<tr>';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $fecha;\n $tabla.='</td>';\n \n $num=strval($v->num_registro_posicion);\n while(strlen($num)<5) {\n $num='0'.$num;\n } \n $tabla.='<td class=\"text-center\">';\n $tabla.= $v->num_registro.$num;;\n $tabla.='</td>';\n \n $dni=$v->dni;\n if($this->socios_model->validar_dni($dni)){\n $tabla.='<td class=\"text-center\">';\n $tabla.= strtoupper($dni);\n $tabla.='</td>';\n }\n else{\n $tabla.='<td class=\"text-center\" style=\"color:red\">';\n $tabla.= strtoupper($dni).\"(\".$v->num_socio.\")\";\n $tabla.='</td>';\n }\n \n $nombre=$v->nombre;\n $tabla.='<td class=\"text-center\">';\n $tabla.= $nombre;\n $tabla.='</td>';\n \n $recibo=$letra.' '.$v->recibo; \n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n \n \n \n /*\n $id_taller=$v->id_taller;\n $periodos=$v->periodos;\n $id_socio=$v->id_socio;\n $importe=-$v->importe;\n $id=$v->id;\n $sql=\"SELECT * FROM casal_lineas_recibos WHERE id<'$id' AND id_taller='$id_taller' AND id_socio='$id_socio' AND periodos='$periodos' AND importe='$importe' ORDER BY id DESC LIMIT 1\";\n //log_message('INFO',$sql);\n if($this->db->query($sql)->num_rows()==1) {\n $recibo=$letra.' '.$this->db->query($sql)->row()->id_recibo;\n }\n else $recibo='';\n $tabla.='<td class=\"text-center\">';\n $tabla.= $recibo;\n $tabla.='</td>';\n */\n \n \n if($v->periodos==4) $horas=$v->horas_taller_T1;\n if($v->periodos==2) $horas=$v->horas_taller_T2;\n if($v->periodos==1) $horas=$v->horas_taller_T3; \n \n //log_message('INFO', '++=================='.$v->nombre.' '.$horas);\n \n $preu_hora=number_format($v->importe/$horas*100,2); \n $tabla.='<td class=\"text-center\">';\n $tabla.= -$preu_hora;\n $tabla.='</td>';\n \n \n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" >';\n $tabla.= -$importe;\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\">';\n $tabla.= '0.00';\n $tabla.='</td>';\n \n $importe=number_format($v->importe,2);\n $tabla.='<td class=\"text-center\" style=\"border-right:2px solid black;border-left:2px solid black;\">';\n $tabla.= -$importe;\n $tabla.='</td>';\n $importeTotalDevoluciones+=$importe;\n \n $tarjeta=number_format($v->tarjeta,2);\n if($tarjeta==0) $pago=\"Efectiu\"; else $pago=\"TPV fisic\";\n $tabla.='<td class=\"text-center\">';\n $tabla.= $pago;\n $tabla.='</td>';\n \n $tabla.='</tr>';\n }\n \n \n \n \n $pieTablaDevoluciones='</tr></thead><thead><tr>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:1px solid white;border-right:0px solid white;border-left:1px solid white;\"></th>';\n $pieTablaDevoluciones.='<th class=\"text-center\">T O T A L S</th>';\n $pieTablaDevoluciones.='<th class=\"text-center\" style=\"border-bottom:2px solid black;border-right:2px solid black;border-left:2px solid black;\">';\n $pieTablaDevoluciones.=-number_format($importeTotalDevoluciones,2);\n $pieTablaDevoluciones.='</th>';\n $pieTablaDevoluciones.='</tr></thead></tody></table>';\n \n \n \n \n \n $salida.='<h4>INFORME DETALLAT DEVOLUCIONS</h4>'\n . ''\n . 'EQUIPAMENT MUNICIPA: <STRONG>'.$tituloCasal.'</STRONG>'\n . '<BR>'\n . 'ADJUDICATARI: <STRONG>'.'SERVEIS A LES PERSONES INCOOP, SCCL</STRONG>'\n . '<BR>'\n . 'NIF ADJUDICATARI: <STRONG>F60137411</STRONG>'\n . '<BR>'\n . 'NÚM CONTRACTE: <STRONG>18001022</STRONG>'\n . '<BR>'\n . 'Periode: <STRONG>'.substr($desde,8,2).'/'.substr($desde,5,2).'/'.substr($desde,0,4).' - '.substr($hasta,8,2).'/'.substr($hasta,5,2).'/'.substr($hasta,0,4).'</STRONG>'\n . '<BR>'\n . '<BR>';\n \n \n \n \n \n \n $salida.=$tabla;\n $salida.=$pieTablaDevoluciones;\n $salida.='<br><h4>RESUM TOTAL</h4>';\n \n $importeResumen=number_format($importeTotal,2)+number_format($importeTotalDevoluciones,2);\n $resumenTotal='<table class=\"table table-bordered table-hover\"><tbody>\n <thead>\n <tr >\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">IMPORT TOTAL</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n \n </tr>\n <tr >\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-left:1px solid white;\"></th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:2px solid #DDDDDD;border-top:2px solid #DDDDDD;border-left:1px solid #DDDDDD;\">T O T A L S</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:2px solid black;border-top:2px solid black;border-right:2px solid black;border-left:2px solid black;\">'.number_format($importeResumen,2).'</th>\n <th class=\"col-sm-1 text-center\" style=\"border-bottom:1px solid white;border-top:1px solid white;border-right:1px solid white;border-left:1px solid white;\"></th>\n \n </tr>\n\n\n\n </thead></tbody></table>';\n \n $salida.=$resumenTotal;\n \n \n \n \n return $salida;\n \n }", "private function tbl_guiones_registro_tipo_formulario() {\r\n\t\t\t$this->guiones_registro_tipo = $this->esquema->createTable('GUIONES_REGISTRO_TIPO');\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del tipo de Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_tipo->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "protected function fijarTabla(){\n \n return \"categorias\";\n \n }", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "function tabla1($base, $limite = null){\n\n\t\tglobal $numeroMagico;\n\n\t\t\tif ($limite === null) {\n\t\t\t\t$limite = $numeroMagico;\n\t\t\t}\n\n\t\t$array = range ($base, $limite); //al array le asigno el rango en el que se tiene que crear\n\n\t\t\treturn $array; // pido que me lo devuelva\n\t}", "function Escenario($lista){\r\necho \"<table class='tg' border='1' style='margin:auto;'>\";\r\n echo \"<tr>\";\r\n echo \"<th colspan='6'>ESCENARIO</th>\";\r\n echo \"<tr>\";\r\n echo \"<th></th>\r\n <th>1</th>\r\n <th>2</th>\r\n <th>3</th>\r\n <th>4</th> \r\n <th>5</th>\r\n </tr>\";\r\n \r\n$i=1;\r\n// Imprimimos el contenido de la tabla\r\nforeach ($lista as $fila) {\r\n echo \"<tr>\";\r\n echo \"<th>\";\r\n echo $i;\r\n echo \"</th>\";\r\n foreach ($fila as $silla) {\r\n echo \"<td>\";\r\n echo $silla;\r\n echo \"</td>\";\r\n }\r\n echo \"</tr>\";\r\n $i++;\r\n }\r\necho \"</table>\";\r\n}", "function ImprimeTablePO($idTabla, $data, $pactu, $peli, $crxpag=10, $paginap = 1, $cantlink = 5,$orderby = -1,$classCSS=\"\") { \n $tabla = '<table id=\"' . $idTabla . '\" class=\"'.$classCSS.'\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center\" >';\n try {\n // if (count($data) > 0) {\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n if ($pactu != \"\") {\n if ($conta == 0) {;\n $tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n //Nombres de las columnas\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t$ordenar = $x + 1;\t\t\t\t\t\n\t\t\t\t\t//$tabla.= '<th><a href=\"?pagina=' . $paginap . '&orden=' . $ordenar . '\" >' . utf8_encode($data[\"columnas\"][$x]) . '</a></th>';\n\t\t\t\t\t$tabla.= '<th><a href=\"#\" onClick=\"Paginar(\\'pagina=' . $paginap . '&orden=' . $ordenar . '\\'); return false\" >' . utf8_encode($data[\"columnas\"][$x]) . '</a></th>'.\"\\n\";\n\t\t\t\t \n }\n \t\t$tabla.= \"</tr>\";\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n $fin = $paginap * $crxpag;\n $ini = $fin - $crxpag;\n for ($i = $ini;$i < $fin;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= '<tr>';\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"' . $pactu . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Mactualizar\"><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n // $tabla.= '<td><a href=\"' . $peli . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Eliminar\"><img src=\"../imgcixphp/ico_eliminar.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . '</td> '.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n }\n\t\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n \t$tabla.= '</table><p style=\"clear:both;height:5px;\"></p>'; \n //===========PAGINADO======================================================================================================================\n $paginado = Paginar($cantele, $crxpag, $paginap, $cantlink,$orderby);\n $tabla.= $paginado;\n //===========FIN PAGINADO ==================================================================================================================\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t \t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot></table><br>';\n\t\t\t\t}\n\t\t\t\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "public function obtenerTabla() {\n $builder = $this->db->table($this->table);\n $data = $builder->get()->getResult();\n $tabla = '';\n foreach($data as $item):\n $accion = '<div class=\\\"custom-control custom-radio\\\">';\n $accion .= '<input type=\\\"radio\\\" id=\\\"row-'.$item->tipoTelefonoId.'\\\" name=\\\"id\\\" class=\\\"custom-control-input radio-edit\\\" value=\\\"'.$item->tipoTelefonoId.'\\\">';\n $accion .= '<label class=\\\"custom-control-label\\\" for=\\\"row-'.$item->tipoTelefonoId.'\\\"> </label> </div>';\n $tabla .= '{\n \"concepto\" : \"'.$item->tipoTelefonoTipo.'\",\n \"acciones\" : \"'.$accion.'\"\n },';\n endforeach;\n $tabla = substr($tabla, 0, strlen($tabla) - 1);\n $result = '{\"data\" : ['. $tabla .']}';\n return $this->response->setStatusCode(200)->setBody($result);\n }", "public function mostrar_tabla_anuncios(){\n\n\t\t$return = '';\n\t\t$mensaje = array('0' => 'Desactivado', '1' => 'Activo');\n\t\t$cols = array('id', 'clave_interna', 'provincia', 'municipio', 'tipo_venta', 'anuncio_promocionado',\n\t\t\t\t\t 'anuncio_e','paquete','activo','apto');\n\t\t$this->where('ussr',$this->user);\n\n\t\tif($salida = $this->get('anuncios', NULL, $cols)){\n\n\t\t\t$return .= '<table class=\"table table-bordered table-hover\">';\n\n\t\t\t$return .= '<tr>\n\t\t\t\t\t <th>Imagen</th>\n\t\t\t\t\t <th>Clave interna</th>\n\t\t\t\t\t <th>Paquete</th>\n\t\t\t\t\t <th>Provincia</th>\n\t\t\t\t\t <th>Operacion</th>\n\t\t\t\t\t <th>Nº imagenes</th>\n\t\t\t\t\t <th>Idiomas</th>\n\t\t\t\t\t <th>Contratado</th>\n\t\t\t\t\t <th>Anuncio apto</th>\n\t\t\t\t\t <th>Anuncio activo</th>\n\t\t\t\t\t <th>Opciones</th>\n\t\t\t\t\t </tr>';\n\t\t\t//por cada anuncio varias cosas habra que hacer\n\t\t\t$i=1;\t\t \n\t\t\tforeach ($salida as $key => $value) {\n\t\t\n\t\t\t\t$num = $i++;\n\t\t\t\t$id_arr = md5($value['id']);\n\t\t\t\t$imagen = $this->sacar_foto($id_arr, $this->user);\n\n\t\t\t\t$return .='<tr>\n\t\t\t\t\t \t<td>'.$imagen.'</td>\n\t\t\t\t\t <td>'.$value['clave_interna'].'</td>\n\t\t\t\t\t <td>'.$value['paquete'].'</td>\n\t\t\t\t\t <td>'.$value['provincia'].'<br />\n\t\t\t\t\t '.$this->show_municipio($value['municipio']).'</td>\n\t\t\t\t\t <td>'.$value['tipo_venta'].'</td>';\n\n\n\n\t\t\t\t//mostrara numero de imagenes en el anuncio\n\t\t\t\t$return .='<td>';\n\t\t\t\t$return .= $this->num_imagenes_anuncio($value['id']);\n\t\t\t\t$return .='</td>';\n\n\n\t\t\t\t//mostrando idiomas en los que esta el anuncio\n\t\t\t\t$return .='<td>';\n\t\t\t\t$return .= $this->idiomas_del_anuncio($value['id']);\n\t\t\t\t$return .='</td>';\n\n\t\t\t\t//estrella o promocionado\n\t\t\t\t$return .='<td>';\n\t\t\t\tif(!empty($value['anuncio_promocionado']) && ($value['anuncio_promocionado'] == 1)){\n\t\t\t\t\t$return .= 'Anuncio promocionado<br />';\t}\n\t\t\t\tif($value['anuncio_e'] == 1){\n\t\t\t\t\t$return .= 'Anuncio estrella';\t\t\t}\t\n\t\t\t\t\t\n\t\t\t $return .= '</td>';\n\t\t\t $return .= '<td>'.$value['apto'].'</td>';\n\t\t\t $return .= '<td id=\"act-'.$id_arr.'\">'.$mensaje[$value['activo']].'</td>';\n\t\t\t //dropdown de opciones\n\t\t\t $return .= '<td>'.$this->dropdown_tabla_anuncios($id_arr).'</td>';\n\t\t\n\t\t\t\t$return .= '</tr>';\n\n\t\t\t}//fin del foreach\n\n\t\t\t$return .= '</table>';\n\n\n\t\t}else{\n\t\t\t$return .= '<h5 id=\"sec1\">No hay anuncios 1 </h5>';\n\t\t}\n\n\t\treturn $return;\n\t}", "function LUPE_criar_tabela_tab($prefixo, $rs, $vetCampo, $vetHidTab, $exc_tabela = '', $exc_campo = '') {\r\n\r\n echo \"<table id='tab{$prefixo}_Tabela' width='100%' border='1' cellspacing='0' cellpadding='0' vspace='0' hspace='0' class='Generica'>\\n\";\r\n echo \"<tr class='Generica'>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' width='1%' nowrap>\";\r\n echo '<a href=\"\" onclick=\"return tab'.$prefixo.'_Incluir();\" class=\"Titulo\"><img src=\"imagens/Incluir.gif\" border=\"0\" alt=\"Incluir\"></a>';\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td class='Titulo'><b>\\n\";\r\n echo $Valor['nome'];\r\n echo \"</b></td>\\n\";\r\n }\r\n\r\n echo \"</tr>\\n\";\r\n\r\n if (mssql_num_rows($rs) != 0) {\r\n for ($i = 0; $i < mssql_num_rows($rs); $i++) {\r\n $row = mssql_fetch_array($rs);\r\n\r\n echo \"<tr id='tab{$prefixo}_linha{$i}' align=left>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' nowrap>\";\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Alterar('.$i.');\"><img src=\"imagens/Alterar.gif\" border=\"0\" alt=\"Alterar\"></a>';\r\n\r\n echo '&nbsp;';\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Excluir('.$i.');\"><img src=\"imagens/Excluir.gif\" border=\"0\" alt=\"Excluir\"></a>';\r\n\r\n if ($exc_campo == '' || $exc_tabela == '') {\r\n $exclui = 'N';\r\n } else {\r\n $sql = \"select $exc_campo from $exc_tabela where $exc_campo = \".$row[$exc_campo];\r\n if (mssql_num_rows(execsql($sql)) == 0)\r\n $exclui = 'N';\r\n else\r\n $exclui = 'E';\r\n }\r\n\r\n echo \"<input id='{$prefixo}_excluir$i' type='hidden' name='{$prefixo}_excluir[]' value='$exclui'>\\n\";\r\n\r\n ForEach($vetHidTab as $Valor)\r\n \t echo \"<input id='{$prefixo}_$Valor$i' type='hidden' name='{$prefixo}_{$Valor}[]' value='\".$row[$Valor].\"'>\\n\";\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td id='{$prefixo}_cel_{$Campo}_{$i}' class='Registro'>\\n\";\r\n\r\n switch ($Valor['tipo']) {\r\n \tcase 'descDominio':\r\n if ($Valor['vetDominio'][$row[$Campo]] == '')\r\n echo $row[$Campo];\r\n else\r\n echo $Valor['vetDominio'][$row[$Campo]];\r\n \t\tbreak;\r\n\r\n default:\r\n echo $row[$Campo];\r\n \t\tbreak;\r\n }\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n echo\"</tr>\\n\";\r\n }\r\n }\r\n\r\n echo \"</table>\\n\";\r\n echo \"<script type='text/javascript'>\r\n tab{$prefixo}_TotLin = \".mssql_num_rows($rs).\";\r\n tab{$prefixo}_AtuLin = -1;\r\n </script>\";\r\n\r\n return 0;\r\n}", "public function getTabla(){\n return $this->table;\n }", "function ImprimeTableP($idTabla, $data, $pactu, $peli, $crxpag, $paginap = 1, $cantlink = 5,$classCSS=\"\") {\n\t\t$tabla = '<table id=\"' . $idTabla . '\" class=\"'.$classCSS.'\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center;\" >';\n try {\n //if (count($data) > 0) {\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n $tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {\n $tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'.\"\\n\";\n //$tabla.= Columna_Cabezera(\"f1\", utf8_encode($data[\"columnas\"][$x]));\n \n }\n \t\t$tabla.= '</tr>';\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n\t\t\t\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n $fin = $paginap * $crxpag;\n $ini = $fin - $crxpag;\n for ($i = $ini;$i < $fin;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= '<tr>';\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"' . $pactu . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Mactualizar\"><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n // $tabla.= '<td><a href=\"' . $peli . 'id=' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&accion=Eliminar\"><img src=\"../imgcixphp/ico_eliminar.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . '</td> '.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n } \n\t\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n \t $tabla.= '</table><p style=\"clear:both;height:5px;\"></p>';\n\t\t\t \n\t\t\t //===========PAGINADO======================================================================================================================\n \t$paginado = Paginar($cantele, $crxpag, $paginap, $cantlink);\n $tabla.= $paginado;\n //===========FIN PAGINADO ==================================================================================================================\n \n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t \t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot></table><br/>';\n\t\t\t\t}\n\t\t\t\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "function write_table_head()//scrie capul de tabel pentru perioadele de vacanta\r\n{\r\n\t$output = \"\";\r\n\tadd($output,'<table width=\"500px\" cellpadding=\"1\" cellspacing=\"1\" class=\"special\">');\r\n\tadd($output,'<tr class=\"tr_head\"><td>Nr</td><td>Data inceput</td><td>Data sfarsit</td></tr>');\r\n\t\r\n\treturn $output;\r\n}", "function cl_tabrecregrasjm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tabrecregrasjm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function mostrarTabla(){\n\n $item = null;\n $valor = null;\n\n $cargo = GestorCargo::verCargoController($item, $valor);\n\tif(count($cargo)>0){\n\t\techo '{\n\t\t\t\t\"data\": [';\n\n\t\t\t\tfor($i = 0; $i < count($cargo)-1; $i++){\n\n\t\t\t\t\t$itemTipoper = \"id_tipoper\";\n\t\t\t\t\t$valorTipoper = $cargo[$i][\"tipo_per\"];\n\n\t\t\t\t\t$tipoper = GestorTipoper::verTipoperController($itemTipoper, $valorTipoper);\n\n\t\t\t\t\techo '[\n\t\t\t\t\t\t\"'.($i+1).'\",\n\t\t\t\t\t\t\"'.$tipoper[\"nombre_tipoper\"].'\",\n\t\t\t\t\t\t\"'.$cargo[$i][\"nombre_cargo\"].'\",\n\t\t\t\t\t\t\"'.$cargo[$i][\"id_cargo\"].'\"\n\t\t\t\t\t],';\n\n\t\t\t\t}\n\t\t\t\t\t$itemTipoper = \"id_tipoper\";\n\t\t\t\t\t$valorTipoper = $cargo[count($cargo)-1][\"tipo_per\"];\n\n\t\t\t\t\t$tipoper = GestorTipoper::verTipoperController($itemTipoper, $valorTipoper);\n\n\t\t\techo'[\n\t\t\t\t\t\"'.count($cargo).'\",\n\t\t\t\t\t\"'.$tipoper[\"nombre_tipoper\"].'\",\n\t\t\t\t\t\"'.$cargo[count($cargo)-1][\"nombre_cargo\"].'\",\n\t\t\t\t\t\"'.$cargo[count($cargo)-1][\"id_cargo\"].'\"\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t}';\n\t}else{\n\t\t\techo '{ \"data\": [] }';\n\t\t}\n\n }", "function ImprimeTableFunciones($idTabla, $data, $pactu = \"\", $peli = \"\",$classCSS=\"\") {\n // echo \"ImprimeTable:::::::::::::::\".count($data[\"cuerpo\"]).\" <br>\";\n\t\ttry {\n // if (count($data) > 0) {\n\t\t\t $tabla = '<table id=\"'.$idTabla.'\" class=\"' . $classCSS . '\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center;\" >';\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n\t\t\t\t\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n\t\t\t\t\t \n if ($pactu != \"\") {\n if ($conta == 0) {;\n\t\t\t\t\t\t $tabla.= '<th></th>';\n //$tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<th></th>';\n\t\t\t\t\t\t\t//$tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'; \n }\n\t\t\t\t$tabla.= '</tr>';\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n for ($i = 0;$i < $cantele;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= \"<tr>\";\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"javascript:'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .');\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"'.$pactu.'('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td><a href=\"#\" onClick=\"'.$peli.'('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>'.\"\\n\";\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>&nbsp;' . $data[\"cuerpo\"][$i][\"$columnas\"] . '&nbsp; </td>'.\"\\n\";\n }\n }\n $tabla.= '</tr>';\n }\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Datos Registrados\"; \n\t\t\t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot>';\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n $tabla.= '</table><br />';\n\t\t\t\t//}\n }catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "function make_table($table) {\n return print_table($table, true);\n}", "public function componente_operacion_pi_nuevo($com_id){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $mes = $this->mes_nombre();\n $tabla='';\n $tabla.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\" align=\"center\">\n <thead>\n <tr class=\"modo1\">\n <th style=\"width:1%;\" style=\"background-color: #1c7368; color: #FFFFFF\" style=\"height:12px;\">#</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACCI&Oacute;N ESTRATEGICA</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OPERACI&Oacute;N</th>\n <th style=\"width:9%;\" style=\"background-color: #1c7368; color: #FFFFFF\">RESULTADO</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACTIVIDAD</th>\n <th style=\"width:7%;\" style=\"background-color: #1c7368; color: #FFFFFF\">INDICADOR</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">LB.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">META</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ENE.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">FEB.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAR.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ABR.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAY.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUN.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUL.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">AGO.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">SEPT.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OCT.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">NOV.</th>\n <th style=\"width:2.5%;\" style=\"background-color: #1c7368; color: #FFFFFF\">DIC.</th>\n <th style=\"width:8%;\" style=\"background-color: #1c7368; color: #FFFFFF\">VERIFICACI&Oacute;N</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">PPTO.</th>\n </tr> \n \n </thead>\n <tbody>';\n $nro=0;\n if(count($obj_est)!=0){\n foreach($obj_est as $rowo){\n $tabla.='<tr class=\"modo1\" bgcolor=\"#9cdcd4\"><td colspan=\"22\" style=\"width: 100%; text-align: left\" style=\"height:13px;\">OBJ. EST. '.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td></tr>';\n $productos=$this->model_producto->list_producto_programado_oestrategico($com_id,$this->gestion,$rowo['obj_id'],$rowo['gi'],$rowo['gf']); /// Productos\n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $nro++;\n\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\">';\n $tabla.=' <td style=\"width: 1%; text-align: left;\" style=\"height:11px;\">'.$nro.'</td>\n <td style=\"width: 9%; text-align: left;\">'.$rowp['acc_codigo'].'.- '.$rowp['acc_descripcion'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_producto'].'</td>\n <td style=\"width: 9%; text-align: left;\">'.$rowp['prod_resultado'].'</td>\n <td style=\"width: 10%; text-align: left;\"></td>\n <td style=\"width: 7%; text-align: left;\">'.$rowp['prod_indicador'].'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['prod_meta'],2).'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['enero'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['febrero'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['marzo'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['abril'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['mayo'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['junio'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['julio'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['agosto'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['septiembre'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['octubre'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['noviembre'],2).''.$tp.'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.round($rowp['diciembre'],2).''.$tp.'</td>\n <td style=\"width: 8%; text-align: left;\">'.$rowp['prod_fuente_verificacion'].'</td>\n <td style=\"width: 5%; text-align: right;\"></td>'; \n $tabla.='</tr>';\n $tabla.=''.$this->actividades_2019($rowp['prod_id'],$nro).'';\n }\n }\n }\n else{\n $tabla.='<tr class=\"modo1\"><td colspan=\"22\" style=\"width: 100%; text-align: left;\">SIN OPERACIONES</td></tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n\n return $tabla;\n }", "function ImprimirCabeceraTabla($tabla){\n echo \"<table><tr>\";\n foreach ($tabla as $valor){\n\n echo \"<th>\".$valor.\"</th>\";\n \n }\n echo \"</tr>\";\n}", "function creaTablaPartidos(){\r\n // Create connection\r\n $conn = dameConexion();//new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Conexión fallida: \" . $conn->connect_error);\r\n }\r\n \r\n // sql to create table carta (Nombre, Coleccion, Imagen, fecha, entrada)\r\n $sql = \"CREATE TABLE partidos (\r\n id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n Local VARCHAR(15) NOT NULL,\r\n Visitante VARCHAR(15),\r\n Resultado VARCHAR(5),\r\n Entrada INT(6)\r\n )\";\r\n \r\n if ($conn->query($sql) === TRUE) {\r\n echo \"Tabla creada correctamente\";\r\n } else {\r\n \r\n //echo \"Error creando la tabla: \" . $conn->error;\r\n }\r\n \r\n $conn->close();\r\n}", "function createTableString($tablas){\n\t\tglobal $formatedTables;\n\n\t\tforeach ($tablas as $key => $value) {\n\t\t\tif(!@in_array($value, $formatedTables)){\n\t\t\t\t$formatedTables[] = $value;\n\t\t\t}\n\t\t}\n\t}", "function createTableString($tablas){\n\t\tglobal $formatedTables;\n\n\t\tforeach ($tablas as $key => $value) {\n\t\t\tif(!@in_array($value, $formatedTables)){\n\t\t\t\t$formatedTables[] = $value;\n\t\t\t}\n\t\t}\n\t}", "function miTabla($numero)\n\t{\n\t\tfor($multiplicador=0;$multiplicador<=10;$multiplicador++)\n\t\t{\n\t\t\techo $numero.\" x \".$multiplicador.\" = \".$numero*$multiplicador.\"<br>\";\n\t\t}\n\t}", "public function tabla()\n\t\t{\t//condicion para la proteccion de las vistas\n\t\t\t$id_empleado = $_SESSION['id_empleado'];\n\t\t\tif ($id_empleado == null)\n\t\t\t{\n\t\t\t\tredirect(base_url() . 'index.php/header/controller_inicio/login');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->load->view(\"header/Header_caja\");\n\t\t\t\t$this->load->view(\"ventas/Tabla_dinamica_producto\");\n\t\t\t}\n\t\t}", "public function componente_operacion_nuevo($com_id){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente = $this->model_componente->get_componente_pi($com_id); //// DATOS COMPONENTE\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']); /// DATOS FASE\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $mes = $this->mes_nombre();\n $tabla='';\n $tabla.='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\" align=\"center\">\n <thead>\n <tr class=\"modo1\">\n <th style=\"width:1%;\" style=\"background-color: #1c7368; color: #FFFFFF\" style=\"height:12px;\">#</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ACCI&Oacute;N ESTRATEGICA</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OPERACI&Oacute;N</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">RESULTADO</th>\n <th style=\"width:10%;\" style=\"background-color: #1c7368; color: #FFFFFF\">INDICADOR</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">LB.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">META</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ENE.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">FEB.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAR.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">ABR.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">MAY.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUN.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">JUL.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">AGO.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">SEPT.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">OCT.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">NOV.</th>\n <th style=\"width:3%;\" style=\"background-color: #1c7368; color: #FFFFFF\">DIC.</th>\n <th style=\"width:8%;\" style=\"background-color: #1c7368; color: #FFFFFF\">VERIFICACI&Oacute;N</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">PPTO.</th> \n <th style=\"width:4%;\" style=\"background-color: #1c7368; color: #FFFFFF\">COD. PPTO.</th> \n </tr> \n \n </thead>\n <tbody>';\n $nro=0;\n if(count($obj_est)!=0){\n foreach($obj_est as $rowo){\n $productos=$this->model_producto->list_producto_programado_oestrategico($com_id,$this->gestion,$rowo['obj_id'],$rowo['gi'],$rowo['gf']); /// Productos\n\n if(count($productos)!=0){\n $tabla.='<tr class=\"modo1\" bgcolor=\"#9cdcd4\"><td colspan=\"22\" style=\"width: 100%; text-align: left\" style=\"height:13px;\">OBJ. EST. '.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td></tr>';\n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $nro++;\n\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\">';\n $tabla.=' <td style=\"width: 1%; text-align: left;\" style=\"height:11px;\">'.$nro.'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['acc_codigo'].'.- '.$rowp['acc_descripcion'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_producto'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_resultado'].'</td>\n <td style=\"width: 10%; text-align: left;\">'.$rowp['prod_indicador'].'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_linea_base'],2).'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['prod_meta'],2).'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['enero'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['febrero'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['marzo'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['abril'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['mayo'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['junio'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['julio'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['agosto'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['septiembre'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['octubre'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['noviembre'],2).''.$tp.'</td>\n <td style=\"width: 3%; text-align: right;\">'.round($rowp['diciembre'],2).''.$tp.'</td>\n <td style=\"width: 8%; text-align: left;\">'.$rowp['prod_fuente_verificacion'].'</td>\n <td style=\"width: 4%; text-align: right;\">'.number_format($ptto, 2, ',', '.').'</td>\n <td style=\"width: 4%; text-align: center;\" bgcolor=\"#dedcdc\">'.$rowp['prod_cod'].'</td>'; \n $tabla.='</tr>';\n }\n }\n }\n }\n else{\n $tabla.='<tr class=\"modo1\"><td colspan=\"22\" style=\"width: 100%; text-align: left;\">SIN OPERACIONES</td></tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n\n return $tabla;\n }", "function tabla($lista, $totalColumnas) {\n $totalFilas = count($lista) / $totalColumnas;\n echo \"<table border='1'>\";\n for ($fila = 0; $fila < $totalFilas; $fila++) {\n echo \"<tr>\";\n for ($i=0;$i<$totalColumnas;$i++) {\n $posicion = $totalColumnas * $fila + $i;\n if ($posicion < count($lista)) {\n $contenido = $lista[$posicion];\n } else {\n $contenido = \"\";\n }\n echo \"<td>\".$contenido.\"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function ImprimeTable($idTabla, $data, $pactu = \"\", $peli = \"\",$classCSS=\"\") {\n // echo \"ImprimeTable:::::::::::::::\".count($data[\"cuerpo\"]).\" <br>\";\n\t\ttry {\n // if (count($data) > 0) {\n\t\t\t $tabla = '<table id=\"'.$idTabla.'\" class=\"' . $classCSS . '\" cellpadding=\"0\" cellspacing=\"1\" border=\"1\" align=\"center\" style=\"text-align:center\" >';\n\t\t\t if (count($data[\"columnas\"]) > 0) {\n\t\t\t\t$tabla.= '<thead>';\n $tabla .= '<tr>';\n $conta = 0;\n $conte = 0;\n\t\t\t\t\n for ($x = 0;$x < count($data[\"columnas\"]);$x++) {\n\t\t\t\t\t \n if ($pactu != \"\") {\n if ($conta == 0) {;\n\t\t\t\t\t\t $tabla.= '<th></th>';\n //$tabla.= '<td></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<th></th>';\n\t\t\t\t\t\t\t//$tabla.= '<td></td>';\n }\n }\n $conta++;\n $conte++;\n $tabla.= '<th>' . utf8_encode($data[\"columnas\"][$x]) . '</th>'; \n }\n\t\t\t\t$tabla.= \"</tr>\";\n\t\t\t\t$tabla.= '</thead>';\n\t\t\t }\n //===========CUERPO DE TABLA=================================================================================================\n $cantele = count($data[\"cuerpo\"]);\n if ($cantele > 0) {\n for ($i = 0;$i < $cantele;$i++) {\n $conta = 0;\n $conte = 0;\n $tabla.= \"<tr>\";\n for ($z = 0;$z < count($data[\"columnas\"]);$z++) {\n $columnas = $data[\"columnas\"][$z];\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n if ($pactu != \"\") {\n if ($conta == 0) {\n // $tabla.= '<td><a href=\"javascript:Modificar('. $data[\"cuerpo\"][$i][\"$columnas\"] .');\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n\t\t\t\t\t\t\t\t $tabla.= '<td><a href=\"#\" onClick=\"Modificar('. $data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" title=\"Actualizar\" ><img title=\"Actualizar\" src=\"../imgcixphp/ico_actualizar.gif\" title=\"Actualizar\" width=\"16\" height=\"16\"/></a></td>';\n }\n }\n if ($peli != \"\") {\n if ($conte == 0) {;\n $tabla.= '<td><a href=\"#\" onClick=\"Eliminar('.$data[\"cuerpo\"][$i][\"$columnas\"] .'); return false;\" ><img src=\"../imgcixphp/delete.gif\" width=\"16\" title=\"Eliminar\" height=\"16\"/></a></td>';\n }\n }\n }\n $conta++;\n $conte++;\n if (isset($data[\"cuerpo\"][$i][\"$columnas\"])) {\n $tabla.= '<td>' . $data[\"cuerpo\"][$i][\"$columnas\"] . ' </td>';\n }\n }\n $tabla.= \"</tr>\";\n }\n \n }else{//solo si es k no hay datos\n\t\t\t\t$mensaje= \"No se encuentran Ningun Dato Registrado\"; \n\t\t\t $tabla.='<tfoot><tr> <td >&nbsp; '.$mensaje.' </td></tr></tfoot>';\n\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t//===========FIN CUERPO DE TABLA===========================================================================================\n $tabla.= \"</table><br>\";\n\t\t\t\t//}\n }\n catch(exception $e) {\n return $e->getMessage();\n }\n return $tabla;\n }", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "static public function ctrAgregarTabla($datos){\n\n\t\t\n\t\techo '<table class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"width: 10px;\">#</th>\n <th style=\"width: 10px;\">Cantidad</th>\n <th style=\"width: 400px;\">Articulo</th>\n <th style=\"width: 70px;\">Precio</th>\n <th style=\"width: 70px;\">Total</th>\n <th style=\"width: 10px;\">Opciones</th> \n </tr>';\n\t\t\n\t\t\techo \"<tr>\n\t\t\t\t\t\n\t\t\t\t\t<td>1.</td>\n\t\t\t\t\t<td><span class='badge bg-red'>\".$datos['cantidadProducto'].\"</span></td>\n\t\t\t\t\t<td>\".$datos['productoNombre'].\"</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['cantidadProducto']*$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td><button class='btn btn-link btn-xs' data-toggle='modal' data-target='#myModalEliminarItemVenta'><span class='glyphicon glyphicon-trash'></span></button></td>\n\t\t\t\t\t\n\t\t\t\t </tr>\";\n\t\t\t\t\n\t\techo '</tbody></table>';\n\t\t\t\t\n\t\t\n\t}", "public function generateTable($type, $data){\n\t\t$db = new Database();\n\t\t$conn_result = $db->connect();\n\t\tif($conn_result[\"error\"] == TRUE){ \n\t\t\t\t\treturn $conn_result; \n\t\t\t\t}\n\t\t//fetch array\n\t\twhile($row = mysqli_fetch_array($data)){\n\t\t\t//FETCH DATA TO DISPLAY\n\t\t\t$array = $this->setTableData($row, $db);\n\t\t\t//grab first td entry depending on type\n\t\t\t$this->printTableData($array, $type);\n\t\t}//end while\n\t}", "public function list_unidades_es($estado_ppto){\n $unidades=$this->model_proyecto->list_gasto_corriente();\n $tabla='';\n \n $color=''; \n if($estado_ppto==1){\n $color='#e2f4f9';\n }\n\n $tabla.='\n <table id=\"dt_basic3\" class=\"table1 table-bordered\" style=\"width:100%;\">\n <thead>\n <tr style=\"height:50px;\">\n <th style=\"width:1%;\" bgcolor=\"#474544\" title=\"\">#</th>\n <th style=\"width:5%;\" bgcolor=\"#474544\" title=\"\"></th>\n <th style=\"width:5%;\" bgcolor=\"#474544\" title=\"VER PPTO\">VER PARTIDAS</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"APERTURA PROGRAM&Aacute;TICA\">CATEGORIA PROGRAM&Aacute;TICA '.$this->gestion.'</th>\n <th style=\"width:25%;\" bgcolor=\"#474544\" title=\"DESCRIPCI&Oacute;N\">DESCRIPCI&Oacute;N</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"NIVEL\">NIVEL</th>\n <th style=\"width:15%;\" bgcolor=\"#474544\" title=\"TIPO DE ADMINISTRACIÓN\">TIPO DE ADMINISTRACI&Oacute;N</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"UNIDAD ADMINISTRATIVA\">UNIDAD ADMINISTRATIVA</th>\n <th style=\"width:10%;\" bgcolor=\"#474544\" title=\"UNIDAD EJECUTORA\">UNIDAD EJECUTORA</th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($unidades as $row){\n $aper=$this->model_ptto_sigep->partidas_proyecto($row['aper_id']);\n $nro++;\n $tabla.='<tr bgcolor='.$color.'>';\n $tabla.='<td style=\"height:30px;\" align=center>'.$nro.'</td>';\n $tabla.='<td>';\n if($estado_ppto==0){\n if(count($aper)!=0){\n $tabla .='\n <center><a data-toggle=\"modal\" data-target=\"#'.$row['aper_id'].'\" title=\"PARTIDAS ASIGNADAS\" ><img src=\"'.base_url().'assets/img/select.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a></center>\n <div class=\"modal fade bs-example-modal-lg\" tabindex=\"-1\" id=\"'.$row['aper_id'].'\" role=\"dialog\" aria-labelledby=\"myLargeModalLabel\">\n <div class=\"modal-dialog modal-lg\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close text-danger\" data-dismiss=\"modal\" aria-hidden=\"true\">\n &times;\n </button>\n <h4 class=\"modal-title\">';\n if($this->gestion>2019){\n $tabla.=$row['tipo'].' '.$row['act_descripcion'].' '.$row['abrev'];\n }\n else{\n $tabla.=$row['proy_nombre'];\n }\n $tabla.='\n </h4>\n </div>\n <div class=\"modal-body no-padding\">\n <div class=\"well\">\n '.$this->partidas($row['aper_id'],1).' \n </div>\n </div>\n <div class=\"modal-footer\">\n <a href=\"javascript:abreVentana(\\''.site_url(\"\").'/mnt/rep_partidas/'.$row['aper_id'].'\\');\" class=\"btn btn-primary\" title=\"IMPRIMIR PARTIDAS\">IMPRIMIR PARTIDAS</a>\n </div>\n </div>\n </div>\n </div>';\n }\n }\n $tabla.='</td>';\n $tabla.='<td>';\n if($this->tp_adm==1){\n if($estado_ppto==0){\n if(count($aper)!=0){\n $tabla .='<center><a href=\"'.site_url(\"\").'/mnt/edit_ptto_asig/'.$row['proy_id'].'\" title=\"MODIFICAR PRESUPUESTO ASIGNADO\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/faseetapa.png\" WIDTH=\"34\" HEIGHT=\"34\"/></a></center>';\n }\n }\n else{\n $tabla.='<center><a href=\"'.site_url(\"\").'/mnt/ver_ptto_asig_final/'.$row['proy_id'].'\" id=\"myBtnn'.$row['proy_id'].'\" title=\"VER PRESUPUESTO ASIGNADO INICIAL - PROGRAMADO - APROBADO\" iclass=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/faseetapa.png\" WIDTH=\"34\" HEIGHT=\"34\"/></a></center>';\n }\n }\n $tabla.='</td>';\n $tabla.='<td><center>'.$row['aper_programa'].''.$row['aper_proyecto'].''.$row['aper_actividad'].'</center></td>';\n if($this->gestion>2019){\n $tabla.='<td style=\"font-size: 8pt;\"><b>'.$row['tipo'].' '.$row['act_descripcion'].' '.$row['abrev'].'</b></td>';\n }\n else{\n $tabla.='<td style=\"font-size: 8pt;\"><b>'.$row['proy_nombre'].'</b></td>';\n }\n $tabla.='<td>'.$row['nivel'].'</td>';\n $tabla.='<td>'.$row['tipo_adm'].'</td>';\n $tabla.='<td>'.strtoupper($row['dep_departamento']).'</td>';\n $tabla.='<td>'.strtoupper($row['dist_distrital']).'</td>';\n $tabla.='</tr>';\n }\n $tabla.='\n </tbody>\n </table>';\n\n return $tabla;\n }", "public function get_proceso_consolidado($proy_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); //// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS FASE ACTIVA\n $componentes=$this->model_componente->componentes_id($fase[0]['id'],$proyecto[0]['tp_id']); /// COMPONENTES/PROCESOS \n \n $tabla ='';\n if(count($componentes)!=0){\n foreach ($componentes as $rowc){\n $productos = $this->model_producto->list_prod($rowc['com_id']);\n if(count($productos)!=0){\n $tabla .='\n <table>\n <tr><td><font size=\"1\"> '.$rowc['serv_cod'].'.- '.$rowc['com_componente'].'</font></td></tr>\n </table>';\n $nro_p=0;\n $tabla .='<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\">';\n $tabla.='<thead>\n <tr class=\"modo1\" style=\"height:45px;\">\n <th style=\"width:1%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">#</font></th>';\n if($this->gestion==2018){\n $tabla.='<th style=\"width:7%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">PRODUCTO</font></th>';\n }\n else{\n $tabla.='\n <th style=\"width:9%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OBJETIVO ESTRATEGICO</font></th>\n <th style=\"width:9%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ACCI&Oacute;N ESTRATEGICA</font></th>\n <th style=\"width:9%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OPERACI&Oacute;N</font></th>\n <th style=\"width:9%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">RESULTADO</font></th>';\n }\n $tabla.='\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">TIP.</font></th>\n <th style=\"width:8%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">INDICADOR</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">LINEA BASE</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">META</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ENE.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">FEB.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAR.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ABR.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAY.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUN.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUL.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">AGO.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">SEP.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OCT.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">NOV.</font></th>\n <th style=\"width:3%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">DIC.</font></th>\n <th style=\"width:8%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">VERIFICACI&Oacute;N</font></th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $color='';\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n $nro++;\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\" style=\"height:45px;\">';\n $tabla.='<td style=\"width: 1%; text-align: center\" style=\"height:14px;\">'.$nro.'</td>';\n if($this->gestion==2018){\n $tabla.='<td style=\"width: 7%; text-align: left\">'.mb_convert_encoding(''.$rowp['prod_producto'].'', 'cp1252', 'UTF-8').'</td>'; \n }\n else{\n if($rowp['acc_id']!=null){\n $alineacion=$this->model_producto->operacion_accion($rowp['acc_id']);\n if(count($alineacion)!=0){\n $tabla.=' <td style=\"width: 9%; text-align: left\">'.$alineacion[0]['obj_codigo'].'-'.$alineacion[0]['obj_descripcion'].'</td>\n <td style=\"width: 9%; text-align: left\">'.$alineacion[0]['acc_codigo'].'-'.$alineacion[0]['acc_descripcion'].'</td>';\n }\n else{\n $tabla.=' <td style=\"width: 9%; text-align: left\"></td>\n <td style=\"width: 9%; text-align: left\"><font color=\"red\">'.$rowp['acc_id'].'</font></td>';\n }\n }\n else{\n $tabla.=' <td style=\"width: 9%; text-align: left\"></td>\n <td style=\"width: 9%; text-align: left\"><font color=\"red\"></font></td>';\n }\n $tabla.='<td style=\"width: 9%; text-align: left\">'.mb_convert_encoding(''.$rowp['prod_producto'].'', 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 9%; text-align: left\">'.mb_convert_encoding(''.$rowp['prod_resultado'].'', 'cp1252', 'UTF-8').'</td>';\n }\n \n \n $tabla.='\n <td style=\"width: 2%; text-align: left\">'.mb_convert_encoding(''.$rowp['indi_abreviacion'].'', 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 8%; text-align: left\">'.mb_convert_encoding(''.$rowp['prod_indicador'].'', 'cp1252', 'UTF-8').'</td>\n <td style=\"width: 3%; text-align: left\">'.$rowp['prod_linea_base'].'</td>\n <td style=\"width: 3%; text-align: left\">'.$rowp['prod_meta'].'</td>';\n $tabla.=''.$this->temporalizacion_prod($rowp['prod_id'],$this->gestion).'';\n $tabla .='<td style=\"width: 8%; text-align: left\">'.mb_convert_encoding(''.$rowp['prod_fuente_verificacion'].'', 'cp1252', 'UTF-8').'</td>'; \n $tabla.='</tr>';\n }\n $tabla.='\n </tbody>\n </table>'; \n }\n }\n }\n\n return $tabla;\n }", "private function generateGetFromTableFromPlayer() {\n\t\t$chaine = \"\\tpublic static function getFromTableFromPlayer(\\$idjoueur) {\\n\";\n\t\t$chaine .= $this->getGeneratedBy(__CLASS__.\"::\".__FUNCTION__.\"()\");\n\t\t$chaine .= \"\\t\\t\\$listeObjet = array();\\n\";\n\t\t\n\t\t$chaine .= \"\\t\\t// Lancement de la requete\\n\";\n\t\t$chaine .= \"\\t\\t\\$requete = 'SELECT * FROM `\".$this->getNomTableEnCoursDeTraitement().\"` WHERE joueur = :idjoueur ORDER BY id ASC';\\n\";\n\t\t\n\t\t//08/04/2016, passage avec BINDVALUE\n\t\t$chaine .= \"\\t\\tdatabase::getInstance() -> prepareRequete(\\$requete);\\n\";\n\t\t$chaine .= \"\\t\\tdatabase::getInstance() -> bind(array (\\$idjoueur));\\n\";\n\t\t\n\t\t$chaine .= \"\\t\\tif (! database::getInstance() -> executeRequete()) {\\n\";\n\t\t$chaine .= \"\\t\\t\\tthrow new Exception(__CLASS__.'::'.__FUNCTION__.'(): Impossible de lire la table \".$this->getNomTableEnCoursDeTraitement().\"');\\n\";\n\t\t$chaine .= \"\\t\\t}\\n\";\n\t\t\n\t\t$chaine .= \"\\t\\t// Recuperation des donnees\\n\";\n\t\t$chaine .= \"\\t\\t\\$datas = database::getInstance() -> getTableauResultat();\\n\";\n\t\t\n\t\t$chaine .= \"\\t\\t/* Traitement des donnees */\\n\";\n\t\t$chaine .= \"\\t\\tforeach (\\$datas AS \\$data) {\\n\";\n\t\t$chaine .= \"\\t\\t\\t\\$listeObjet[] = new \".ucfirst($this->getNomTableEnCoursDeTraitement()).\"(\";\n\t\t\n\t\t/* Liste des champs de la table */\n\t\tforeach ($this->getListeChampsEnCoursDeTraitement() AS $champ) {\n\t\t\t$chaine .= \"\\$data['\".$champ['Field'].\"'],\";\t\t\t\n\t\t}\n\t\t$chaine = substr($chaine,0,strlen($chaine)-1);\n\t\t$chaine .= \");\\n\";\n\t\t$chaine .= \"\\t\\t}\\n\";\n\t\t\n\t\t$chaine .= \"\\t\\treturn \\$listeObjet;\\n\";\n\t\t$chaine .= \"\\t}\\n\";\n \t\treturn $chaine;\n \t}", "public function crea_tabella_singola($valore_estrazione_univoca='',$campo_per_estrazione_univoca='',$testo_modifica='',$testo_cancella='',$url_modifica='',$url_cancella=''){\n\t\tif($campo_per_estrazione_univoca=='')$campo_per_estrazione_univoca='id';\n\n\t\t\n\t\t\t\n\t\t$dati_per_estrazione='&amp;'.$campo_per_estrazione_univoca.'='.($valore_estrazione_univoca!=''?$valore_estrazione_univoca:'SETTARE_VALORE_UNIVOCO');\n\n\t\tif($testo_modifica=='')$testo_modifica==NULL;\n\t\tif($testo_modifica=='default')$testo_modifica=(file_exists('img/modifica.gif')?'<img src=\"img/modifica.gif\" alt=\"\" border=\"none\" />':'file \"modifica.gif\" non presente');\n\t\t\t\n\t\tif($testo_cancella=='')$testo_cancella==NULL;\n\t\tif($testo_cancella=='default')$testo_cancella=(file_exists('img/cancella.gif')?'<img src=\"img/cancella.gif\" alt=\"\" border=\"none\" />':'file \"cancella.gif\" non presente');\n\t\tif($url_modifica=='')$url_modifica='modifica.php';\n\t\tif($url_cancella=='')$url_cancella='cancella.php';\n\t\t\t\n\t\tif($testo_modifica!=NULL)\n\t\techo '<a href=\"'.$url_modifica.'?nome_tabella='.$this->nome_tabella.$dati_per_estrazione.'\">'.$testo_modifica.'</a>&nbsp;&nbsp';\n\t\tif($testo_cancella!=NULL)\n\t\techo '<a href=\"'.$url_cancella.'?nome_tabella='.$this->nome_tabella.$dati_per_estrazione.'\">'.$testo_cancella.'</a>';\n\t\t\t\n\t\t\n\t\t//Creo la tabella\n\t\t$tabella='<table width=\"100%\" border=\"1\" cellspacing=\"3\" cellpadding=\"3\">';\t\t\n\t\t\n\t\tforeach($this->riga as $chiave=>$valore){\n\t\t\t$tabella.='<tr><th scope=\"row\">'.$chiave.'</th>\n\t\t\t';\n\t\t\t$tabella.='<td>'.$valore.'</td></tr>\n\t\t\t';\n\t\t}\n\n\t\t$tabella.='</table>';\n\t\treturn $tabella;\n\t}", "public static function getTitulos($parametros,$cantidadDePaginas){\n $html = \"\n <thead class='headerTabla'>\";\n $html .= self::getTableFooter($parametros,$cantidadDePaginas);\n $html .= \"\n <tr>\n\t\t\t\t\t\t<th scope='col' class='' > Nro. Movimiento </th>\n\t\t\t\t\t\t<th scope='col' class='' > Cliente </th>\n\t\t\t\t\t\t<th scope='col' class=''> Fecha </th>\n <th scope='col' class=''> Concepto </th>\n\t\t\t\t\t\t<th scope='col' class=''> Nro. de Venta </th>\n <th scope='col' class=''> Importe </th>\n <th scope='col' class=''> Observaciones</th>\n\t\t\t\t\t\t<th scope='col' class='colAngosta'> Acciones </th>\n\n </tr>\n </thead>\n \";\n return $html;\n }", "public function makeColumns(){\n $hijosDetalle=$this->\n getReportedetalle()->\n where(['and', \"esdetalle='1'\", \"visiblecampo='1'\"])->\n orderBy('orden')->all();\n //echo count( $hijosDetalle);die();\n $columns=[];\n foreach($hijosDetalle as $fila){\n $columns[]=[\n 'attribute'=>$fila->nombre_campo,\n 'label'=>$fila->aliascampo,\n 'format'=>'raw',\n 'options'=>['width'=>\n $this->sizePercentCampo($fila->nombre_campo).'%'],\n ];\n \n \n }\n return $columns;\n \n }", "function getTabla() {\r\n return $this->tabla;\r\n }", "function mysql04($tabla){\n $qColumnNames = mysql_query(\"SHOW COLUMNS FROM \".$tabla) or die(\"mysql error\");\n $numColumns = mysql_num_rows($qColumnNames);\n $i = 0;\n while ( $i < $numColumns ){\n $colname = mysql_fetch_row($qColumnNames);\n $col[$i] = \"<th>\".$colname[0].\"</th>\";\n $i++;\n }\n $h = 0;\n $resultado[0] = \"<tr>\";\n while ( $h < $numColumns ){\n $resultado[0] = $resultado[0] . $col[$h];\n $h++;\n }\n $resultado[0] = $resultado[0].\"</tr>\";\n $query01=\"SELECT * FROM \".$tabla;\n $query02=mysql_query($query01);\n $numLines = mysql_num_rows($query02);\n\n $j=0;\n while( $rec = mysql_fetch_row($query02) ){\n for( $k = 0; $k != $numColumns ; $k++){\n if ( $resultado[1 + $j] == \"\" ){\n $resultado[1 + $j] = \"<tr>\";\n }\n if ( $rec[$k] == \"\" ){\n $rec[$k] = \"-\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"<td>\".$rec[$k].\"</td>\";\n }\n $resultado[1 + $j] = $resultado[1 + $j].\"</tr>\";\n $j++;\n }\n return $resultado;\n/*\nCOMO USARLO\n$tabla = '';\n$resultado = mysql04($tabla);\necho \"<table>\";\n foreach( $resultado as $value ){\n\techo $value;\n}\necho \"</table>\";\n*/\n}", "public function table_name(){\n $q = \"SHOW FULL TABLES FROM \".DATABASE;\n $re = $this->Request_model->peticion($q);\n $tabla = array();\n for ($i=0; $i <count($re) ; $i++):\n $db = 'Tables_in_'.DATABASE;\n $value = $re[$i][$db];\n $tabla[] = $value;\n endfor; \n return $tabla;\n }", "private function ObtenerCamposTabla(string $nombteTabla){\n $campos =array(); \n $this->EjecutarSQL(\"DESCRIBE \".$nombteTabla);\n foreach ($this->GetResultados() as $dato) $campos[] = $dato->Field;\n return $campos;\n }", "public static function getTableName()\n {\n return 'b_sotbit_seometa_section_chpu';\n }", "function traiter_tableau($bloc) {\n\t// id \"unique\" pour les id du tableau\n\t$tabid = substr(md5($bloc), 0, 4);\n\n\t// Decouper le tableau en lignes\n\tpreg_match_all(',([|].*)[|]\\n,UmsS', $bloc, $regs, PREG_PATTERN_ORDER);\n\t$lignes = array();\n\t$debut_table = $summary = '';\n\t$l = 0;\n\n\t// Traiter chaque ligne\n\t$reg_line1 = ',^(\\|(' . _RACCOURCI_TH_SPAN . '))+$,sS';\n\t$reg_line_all = ',^(' . _RACCOURCI_TH_SPAN . ')$,sS';\n\t$hc = $hl = array();\n\tforeach ($regs[1] as $ligne) {\n\t\t$l++;\n\n\t\t// Gestion de la premiere ligne :\n\t\tif ($l == 1) {\n\t\t\t// - <caption> et summary dans la premiere ligne :\n\t\t\t// || caption | summary || (|summary est optionnel)\n\t\t\tif (preg_match(',^\\|\\|([^|]*)(\\|(.*))?$,sS', rtrim($ligne, '|'), $cap)) {\n\t\t\t\t$cap = array_pad($cap, 4, null);\n\t\t\t\t$l = 0;\n\t\t\t\tif ($caption = trim($cap[1])) {\n\t\t\t\t\t$debut_table .= \"<caption>\" . $caption . \"</caption>\\n\";\n\t\t\t\t}\n\t\t\t\t$summary = ' summary=\"' . entites_html(trim($cap[3])) . '\"';\n\t\t\t}\n\t\t\t// - <thead> sous la forme |{{titre}}|{{titre}}|\n\t\t\t// Attention thead oblige a avoir tbody\n\t\t\telse {\n\t\t\t\tif (preg_match($reg_line1, $ligne, $thead)) {\n\t\t\t\t\tpreg_match_all('/\\|([^|]*)/S', $ligne, $cols);\n\t\t\t\t\t$ligne = '';\n\t\t\t\t\t$cols = $cols[1];\n\t\t\t\t\t$colspan = 1;\n\t\t\t\t\tfor ($c = count($cols) - 1; $c >= 0; $c--) {\n\t\t\t\t\t\t$attr = '';\n\t\t\t\t\t\tif ($cols[$c] == '<') {\n\t\t\t\t\t\t\t$colspan++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($colspan > 1) {\n\t\t\t\t\t\t\t\t$attr = \" colspan='$colspan'\";\n\t\t\t\t\t\t\t\t$colspan = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// inutile de garder le strong qui n'a servi que de marqueur\n\t\t\t\t\t\t\t$cols[$c] = str_replace(array('{', '}'), '', $cols[$c]);\n\t\t\t\t\t\t\t$ligne = \"<th id='id{$tabid}_c$c'$attr>$cols[$c]</th>$ligne\";\n\t\t\t\t\t\t\t$hc[$c] = \"id{$tabid}_c$c\"; // pour mettre dans les headers des td\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$debut_table .= \"<thead><tr class='row_first'>\" .\n\t\t\t\t\t\t$ligne . \"</tr></thead>\\n\";\n\t\t\t\t\t$l = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Sinon ligne normale\n\t\tif ($l) {\n\t\t\t// Gerer les listes a puce dans les cellules\n\t\t\t// on declenche simplement sur \\n- car il y a les\n\t\t\t// -* -# -? -! (qui produisent des -&nbsp;!)\n\t\t\tif (strpos($ligne, \"\\n-\") !== false) {\n\t\t\t\t$ligne = traiter_listes($ligne);\n\t\t\t}\n\n\t\t\t// tout mettre dans un tableau 2d\n\t\t\tpreg_match_all('/\\|([^|]*)/S', $ligne, $cols);\n\n\t\t\t// Pas de paragraphes dans les cellules\n\t\t\tforeach ($cols[1] as &$col) {\n\t\t\t\tif (strlen($col = trim($col))) {\n\t\t\t\t\t$col = preg_replace(\"/\\n{2,}/S\", \"<br /> <br />\", $col);\n\t\t\t\t\tif (_AUTOBR) {\n\t\t\t\t\t\t$col = str_replace(\"\\n\", _AUTOBR . \"\\n\", $col);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// assembler le tableau\n\t\t\t$lignes[] = $cols[1];\n\t\t}\n\t}\n\n\t// maintenant qu'on a toutes les cellules\n\t// on prepare une liste de rowspan par defaut, a partir\n\t// du nombre de colonnes dans la premiere ligne.\n\t// Reperer egalement les colonnes numeriques pour les cadrer a droite\n\t$rowspans = $numeric = array();\n\t$n = $lignes ? count($lignes[0]) : 0;\n\t$k = count($lignes);\n\t// distinguer les colonnes numeriques a point ou a virgule,\n\t// pour les alignements eventuels sur \",\" ou \".\"\n\t$numeric_class = array(\n\t\t'.' => 'point',\n\t\t',' => 'virgule',\n\t\ttrue => ''\n\t);\n\tfor ($i = 0; $i < $n; $i++) {\n\t\t$align = true;\n\t\tfor ($j = 0; $j < $k; $j++) {\n\t\t\t$rowspans[$j][$i] = 1;\n\t\t\tif ($align and preg_match('/^[{+-]*(?:\\s|\\d)*([.,]?)\\d*[}]*$/', trim($lignes[$j][$i]), $r)) {\n\t\t\t\tif ($r[1]) {\n\t\t\t\t\t$align = $r[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$align = '';\n\t\t\t}\n\t\t}\n\t\t$numeric[$i] = $align ? (\" class='numeric \" . $numeric_class[$align] . \"'\") : '';\n\t}\n\tfor ($j = 0; $j < $k; $j++) {\n\t\tif (preg_match($reg_line_all, $lignes[$j][0])) {\n\t\t\t$hl[$j] = \"id{$tabid}_l$j\"; // pour mettre dans les headers des td\n\t\t} else {\n\t\t\tunset($hl[0]);\n\t\t}\n\t}\n\tif (!isset($hl[0])) {\n\t\t$hl = array();\n\t} // toute la colonne ou rien\n\n\t// et on parcourt le tableau a l'envers pour ramasser les\n\t// colspan et rowspan en passant\n\t$html = '';\n\n\tfor ($l = count($lignes) - 1; $l >= 0; $l--) {\n\t\t$cols = $lignes[$l];\n\t\t$colspan = 1;\n\t\t$ligne = '';\n\n\t\tfor ($c = count($cols) - 1; $c >= 0; $c--) {\n\t\t\t$attr = $numeric[$c];\n\t\t\t$cell = trim($cols[$c]);\n\t\t\tif ($cell == '<') {\n\t\t\t\t$colspan++;\n\n\t\t\t} elseif ($cell == '^') {\n\t\t\t\t$rowspans[$l - 1][$c] += $rowspans[$l][$c];\n\n\t\t\t} else {\n\t\t\t\tif ($colspan > 1) {\n\t\t\t\t\t$attr .= \" colspan='$colspan'\";\n\t\t\t\t\t$colspan = 1;\n\t\t\t\t}\n\t\t\t\tif (($x = $rowspans[$l][$c]) > 1) {\n\t\t\t\t\t$attr .= \" rowspan='$x'\";\n\t\t\t\t}\n\t\t\t\t$b = ($c == 0 and isset($hl[$l])) ? 'th' : 'td';\n\t\t\t\t$h = (isset($hc[$c]) ? $hc[$c] : '') . ' ' . (($b == 'td' and isset($hl[$l])) ? $hl[$l] : '');\n\t\t\t\tif ($h = trim($h)) {\n\t\t\t\t\t$attr .= \" headers='$h'\";\n\t\t\t\t}\n\t\t\t\t// inutile de garder le strong qui n'a servi que de marqueur\n\t\t\t\tif ($b == 'th') {\n\t\t\t\t\t$attr .= \" id='\" . $hl[$l] . \"'\";\n\t\t\t\t\t$cols[$c] = str_replace(array('{', '}'), '', $cols[$c]);\n\t\t\t\t}\n\t\t\t\t$ligne = \"\\n<$b\" . $attr . '>' . $cols[$c] . \"</$b>\" . $ligne;\n\t\t\t}\n\t\t}\n\n\t\t// ligne complete\n\t\t$class = alterner($l + 1, 'odd', 'even');\n\t\t$html = \"<tr class='row_$class $class'>$ligne</tr>\\n$html\";\n\t}\n\n\treturn \"\\n\\n<table\" . $GLOBALS['class_spip_plus'] . $summary . \">\\n\"\n\t. $debut_table\n\t. \"<tbody>\\n\"\n\t. $html\n\t. \"</tbody>\\n\"\n\t. \"</table>\\n\\n\";\n}", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "public function TableDrawFacturas($idCotizacion,$idFactura)\r\n {\r\n \r\n\r\n//$Columnas=mysql_query(\"describe $tabla\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n//$Columnas=mysql_fetch_array($Columnas);\t\r\nsession_start();\r\n\r\n\r\n$Columnas1=mysql_query(\"select * from cotizaciones where NumCotizacion = '$idCotizacion'\", $this->con) or die('no se pudo conectar: ' . mysql_error());\r\n$reg=mysql_fetch_array($Columnas1);\t\r\n$numCols=count($reg);\r\n\r\n//print_r($Columnas1);\r\n//print_r($Columnas);\r\n\r\nprint('\r\n\r\n\r\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" align=\"center\" style=\"width:100%;border-left: 1px solid #000000;\r\n\t\tborder-right: 1px solid #000000;\r\n\t\tborder-top: 1px solid #000000;\r\n\t\tborder-bottom: 1px solid #000000;\">\r\n \r\n\r\n <tr> \r\n <td width=\"200\" colspan=\"8\" align=\"center\" style= \"border: 1px solid #000099;color:'.$this->fontHeader.';font: oblique 100% sans-serif bold;background-color:'.$this->backHeader.'\">\r\n Seleccione un producto</td>\r\n </tr> <tr> ');\r\n\r\nfor ($i=0; $i<=$numCols; $i++){\r\n\t\r\n\t\t$NombreCol[$i]=mysql_field_name($Columnas1,$i);\t\r\n\t\tif ($NombreCol[$i]==\"\"){\r\n\t\t\tunset($NombreCol[$i]); \r\n\t\t\t$NombreCol = array_values($NombreCol);//quito el espacio que ha quedado despues de eliminarse \r\n\t\t}else{\r\n\t\t\tif($i<>1 and $i<7)\r\n\t\t\tprint('<td width=\"200\" align=\"center\" style= \"border: 0px solid #000099;color:'.$this->fontHeader.';font: oblique 100% sans-serif bold;background-color:'.$this->backHeader.'\"><h5>'.$NombreCol[$i].'</h5></td>');\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n}\r\n\r\n\r\nprint('<td width=\"200\" align=\"center\" style= \"border: 0px solid #000099;color:'.$this->fontHeader.';font: oblique 100% sans-serif bold;background-color:'.$this->backHeader.'\">Cantidad</td>');\r\n\r\n\r\n$this->ID=$NombreCol[0];\r\n\r\n$numCols=count($NombreCol);\r\n$this->NumCols=$numCols;\r\n\r\n\r\n\t\r\n\tprint('<tr>');\r\n\t\r\n\t$reg=mysql_query(\"select * from cotizaciones where NumCotizacion = '$idCotizacion' AND Devuelto=''\", $this->con) or die('no se pudo conectar a cotizaciones 2: ' . mysql_error());\r\n\t\t$i=0;\r\n\t\twhile($datos=mysql_fetch_array($reg)){\r\n\t\t$i++;\r\n\t\tif($i%2)\r\n\t\t\t\t\t\t$backgroundRow=$this->back1;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$backgroundRow=$this->back2;\r\n\t\t\t\t\t\t\r\n\t\t\tfor($z=0;$z<$this->NumCols;$z++){\r\n\t\t\t\t\t//$mod=\r\n\t\t\t\t\tif($z<>1 and $z<7)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tprint('<td width=\"200\" style= \"border: 0px solid #000000;color:'.$this->fontCeldas.';font: oblique 100% sans-serif bold;background-color:'.$backgroundRow.'\">'.$datos[$z].'</td>');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tprint('<td width=\"200\" style= \"border: 0px solid #000000;color:'.$this->fontCeldas.';font: oblique 100% sans-serif bold;background-color:'.$backgroundRow.'\">\r\n\t\t\t\t<form name=\"formAgregaItems'.$datos[0].'\" id=\"formAgregaItems'.$datos[0].'\" method=\"POST\" action=\"VerFacturas.php\" target=\"_self\" >\r\n\t\t\t\t<input type=\"hidden\" name=\"TxtBuscarFactura\" value=\"'.$idFactura.'\">\r\n\t\t\t\t\t\t<textarea type=\"text\" name=\"TxtObservaciones\" value=\"\" placeholder=\"Observaciones\"></textarea>\r\n\t\t\t\t\t\t<input type=\"number\" name=\"TxtCantidadDev\" value=\"'.$datos[7].'\" min=\"0\" max=\"'.$datos[7].'\" step=\"any\" readonly style=\"font-size:1em; color:#333; font-family:Arial, sans-serif;\">\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"ItemVenta\" value=\"'.$datos[0].'\">\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t<input type=\"submit\" name=\"BtnDevolver\" value=\"Devolver\"></form></td>');\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tprint(\"</tr><tr nobr=true >\");\r\n }\r\n \r\n\t\t\r\n\t\t\r\n\r\n$EspacioCol=$numCols+1;\t\r\nprint('</tr><tr>\r\n\r\n<td width=\"200\" colspan=\"8\" align=\"CENTER\" style= \"border: 1px solid #000099;color:'.$this->fontHeader.';font: oblique 100% sans-serif bold;background-color:'.$this->backHeader.'\">\r\nTechno Soluciones\r\n</td>\r\n');\r\n\r\nprint('</tr></table>');\r\n\r\n//print($this->NumCols);\r\n\r\n}", "public function obtenerNombreTabla() {\n return $this->nombre;\n }", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "function generarProblemasCompetencia2($id_competencia){\n\n \n include(\"../modelo/cnx.php\");\n $cnx = pg_connect($entrada) or die (\"Error de conexion. \". pg_last_error());\n // session_start();\n $seleccionar=\"SELECT problema.id_problema, id_usuario, nombre_problema\n FROM problema, competencia_problema\n where competencia_problema.id_problema=problema.id_problema\n and competencia_problema.id_competencia=\".$id_competencia;\n \n $result = pg_query($seleccionar) or die('ERROR AL INSERTAR DATOS: ' . pg_last_error());\n $columnas = pg_numrows($result);\n $this->formu.='<table>';\n $this->formu.='<tr><td>Identificador</td>';\n $this->formu.='<td>Nombre</td></tr>';\n for($i=0;$i<=$columnas-1; $i++){\n $line = pg_fetch_array($result, null, PGSQL_ASSOC);\n $this->formu.='<tr> \n <td>'.$line['id_problema'].'</td> \n <td>'.$line['nombre_problema'].'</td>\n <td><a href=\"../archivo_comite/'.$line['id_problema'].'/'.$line['id_problema'].'.pdf\">Descargar Enunciado</a></td>\n </tr>';\n } \n $this->formu.='</table>';\n return $this->formu; \n\n }", "public function operaciones($proy_id,$com_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// recupera datos de la tabla fase activa\n $productos = $this->model_producto->lista_operaciones($com_id,$this->gestion); // Lista de productos\n $tabla ='';\n $tabla .='<thead>\n <tr class=\"modo1\">\n <th style=\"width:1%; text-align=center\"><b>COD.</b></th>\n <th style=\"width:1%; text-align=center\"><b>E/B</b></th>\n <th style=\"width:2%;\"><b>COD. OR.</b></th>\n <th style=\"width:2%;\"><b>COD. ACT.</b></th>\n <th style=\"width:15%;\"><b>ACTIVIDAD</b></th>\n <th style=\"width:15%;\"><b>RESULTADO</b></th>\n <th style=\"width:10%;\"><b>TIP. IND.</b></th>\n <th style=\"width:10%;\"><b>INDICADOR</b></th>\n <th style=\"width:1%;\"><b>LINEA BASE '.($this->gestion-1).'</b></th>\n <th style=\"width:1%;\"><b>META</b></th>\n <th style=\"width:4%;\"><b>ENE.</b></th>\n <th style=\"width:4%;\"><b>FEB.</b></th>\n <th style=\"width:4%;\"><b>MAR.</b></th>\n <th style=\"width:4%;\"><b>ABR.</b></th>\n <th style=\"width:4%;\"><b>MAY.</b></th>\n <th style=\"width:4%;\"><b>JUN.</b></th>\n <th style=\"width:4%;\"><b>JUL.</b></th>\n <th style=\"width:4%;\"><b>AGO.</b></th>\n <th style=\"width:4%;\"><b>SEP.</b></th>\n <th style=\"width:4%;\"><b>OCT.</b></th>\n <th style=\"width:4%;\"><b>NOV.</b></th>\n <th style=\"width:4%;\"><b>DIC.</b></th>\n <th style=\"width:10%;\"><b>MEDIO DE VERIFICACI&Oacute;N</b></th>\n <th style=\"width:7%;\"><b>DELETE</b></th>\n <th style=\"width:7%;\"><b>PTTO..</b></th>\n <th style=\"width:7%;\"><b>NRO. REQ.</b></th>\n </tr>\n </thead>\n <tbody>';\n $cont = 0;\n foreach($productos as $rowp){\n $cont++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $programado=$this->model_producto->producto_programado($rowp['prod_id'],$this->gestion);\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $color=''; $titulo=''; $por='';\n if($rowp['indi_id']==2){ // Relativo\n $por='%';\n if($rowp['mt_id']==3){\n if($sum[0]['meta_gest']!=$rowp['prod_meta'] || $rowp['or_id']==0){\n $color='#fbd5d5';\n $titulo='ERROR EN LA DISTRIBUCION O FALTA DE ALINEACION';\n }\n }\n }\n else{ // Absoluto\n if($sum[0]['meta_gest']!=$rowp['prod_meta'] || $rowp['or_id']==0){\n $color='#fbd5d5';\n $titulo='ERROR EN LA DISTRIBUCION O FALTA DE ALINEACION';\n }\n }\n \n $tabla .='<tr bgcolor=\"'.$color.'\" class=\"modo1\" title='.$titulo.'>';\n $tabla.='<td align=\"center\"><font color=\"blue\" size=\"2\"><b>'.$rowp['prod_cod'].'</b></font></td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n /*if($this->tp_adm==1){\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n }*/\n if($rowp['prod_ppto']==1){\n $tabla.='<a href=\"'.site_url(\"\").'/prog/requerimiento/'.$proy_id.'/'.$rowp['prod_id'].'\" target=\"_blank\" title=\"REQUERIMIENTOS DE LA OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/insumo.png\" WIDTH=\"33\" HEIGHT=\"33\"/></a>';\n }\n $tabla.='</td>';\n $tabla.='<td style=\"width:2%;text-align=center\"><b><font size=5 color=blue>'.$rowp['or_codigo'].'</font></b></td>';\n $tabla.='<td style=\"width:2%;text-align=center\"><b><font size=5>'.$rowp['prod_cod'].'</font></b></td>';\n $tabla.='<td style=\"width:15%;\">'.$rowp['prod_producto'].'</td>';\n $tabla.='<td style=\"width:15%;\">'.$rowp['prod_resultado'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['indi_abreviacion'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_indicador'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.round($rowp['prod_linea_base'],2).'</td>';\n $tabla.='<td style=\"width:10%;\">'.round($rowp['prod_meta'],2).'</td>';\n if(count($programado)!=0){\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['enero'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['febrero'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['marzo'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['abril'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['mayo'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['junio'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['julio'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['agosto'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['septiembre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['octubre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['noviembre'],2).' '.$por.'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.round($programado[0]['diciembre'],2).' '.$por.'</td>';\n }\n else{\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>\n <td style=\"width:4%;\" bgcolor=\"#f1bac6\">0</td>';\n }\n $tabla.='<td style=\"width:10%;\" bgcolor=\"#e5fde5\">'.$rowp['prod_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width:7%;\">';\n if($this->tp_adm==1 || $this->fun_id==715 || $this->fun_id==690){\n $tabla.='<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-default del_ff\" title=\"ELIMINAR OPERACI&Oacute;N\" name=\"'.$rowp['prod_id'].'\" id=\"'.$proy_id.'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a><br><br>';\n $tabla.=' <center>\n <input type=\"checkbox\" name=\"req[]\" value=\"'.$rowp['prod_id'].'\" onclick=\"scheck'.$cont.'(this.checked);\"/>\n </center>';\n }\n $tabla.='</td>';\n $tabla.='<td>'.number_format($ptto, 2, ',', '.').'</td>';\n $tabla.='<td style=\"width:7%;\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.count($this->model_producto->insumo_producto($rowp['prod_id'])).'</b></font></td>';\n $tabla .='</tr>';\n ?>\n <script>\n function scheck<?php echo $cont;?>(estaChequeado) {\n val = parseInt($('[name=\"tot\"]').val());\n if (estaChequeado == true) {\n val = val + 1;\n } else {\n val = val - 1;\n }\n $('[name=\"tot\"]').val((val).toFixed(0));\n }\n </script>\n <?php\n }\n $tabla.='</tbody>';\n\n return $tabla;\n }", "public function rep_objetivos_estrategicos(){\n $tabla='';\n $objetivos = $this->model_mestrategico->list_objetivos_estrategicos(); /// OBJETIVOS ESTRATEGICOS\n $configuracion=$this->model_resultado->configuracion_session(); /// Configuracion\n\n $tabla .='<table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.2 style=\"width:100%;\" align=center>\n <thead>\n <tr style=\"font-size: 7px;\" bgcolor=#1c7368 align=center>\n <th style=\"width:1%;height:15px;color:#FFF;\">#</th>\n <th style=\"width:15%;color:#FFF;\">OBJETIVO ESTRATEGICO</th>\n <th style=\"width:84%;color:#FFF;\">ACCI&Oacute;N ESTRATEGICA</th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($objetivos as $rowo){\n $nro++;\n $acciones = $this->model_mestrategico->list_acciones_estrategicas($rowo['obj_id']); \n $tabla.='<tr>';\n $tabla.='<td style=\"width:1%;;height:12px;\" align=center>'.$nro.'</td>';\n $tabla.='<td style=\"width:15%;\">'.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td>';\n $tabla.='<td style=\"width:84%;\">';\n if(count($acciones)!=0){\n $tabla.='<table cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" border=0.1 style=\"width:100%;\" align=center>\n <thead>\n <tr style=\"font-size: 7px;\" bgcolor=#d9d7d7 align=center>\n <th style=\"width:1%;height:15px;\">#</th>\n <th style=\"width:37%;\">DESCRIPCI&Oacute;N</th>\n <th style=\"width:60%;\">VINCULACI&Oacute;N PDES</th>\n </tr>\n </thead>\n <tbody>';\n $nra=0;\n foreach($acciones as $rowa){\n $pdes=$this->model_proyecto->datos_pedes($rowa['pdes_id']);\n $nra++;\n $tabla.='<tr>';\n $tabla.='<td style=\"width:1%;\">'.$nra.'</td>';\n $tabla.='<td style=\"width:37%;\">'.$rowa['acc_codigo'].'.- '.$rowa['acc_descripcion'].'</td>';\n $tabla.='<td style=\"width:60%;\">';\n $tabla.='<ul>\n <li type=\"circle\"><b>PILAR : </b>'.$pdes[0]['pilar'].'</li>\n <li type=\"square\"><b>META : </b>'.$pdes[0]['meta'].'</li>\n <li type=\"disc\"><b>RESULTADO : </b>'.$pdes[0]['resultado'].'</li>\n <li type=\"disc\"><b>ACCI&Oacute;N : </b>'.$pdes[0]['accion'].'</li>\n </ul>';\n $tabla.='</td>';\n $tabla.='</tr>';\n }\n $tabla.=' </tbody>\n </table>';\n }\n $tabla.='</td>';\n $tabla.='</tr>';\n }\n $tabla .='</tbody>\n </table>';\n\n\n\n\n\n return $tabla;\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public function operaciones2019($proy_id,$com_id){\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); \n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// recupera datos de la tabla fase activa\n $productos = $this->model_producto->list_producto_programado($com_id,$this->gestion); // Lista de productos\n $tabla ='';\n $tabla .='<thead>\n <tr class=\"modo1\">\n <th style=\"width:1%; text-align=center\"><b>COD.</b></th>\n <th style=\"width:1%; text-align=center\"><b>E/B</b></th>\n <th style=\"width:20%;\"><b>OPERACI&Oacute;N</b></th>\n <th style=\"width:20%;\"><b>RESULTADO</b></th>\n <th style=\"width:10%;\"><b>TIP. IND.</b></th>\n <th style=\"width:10%;\"><b>INDICADOR</b></th>\n <th style=\"width:1%;\"><b>LINEA BASE</b></th>\n <th style=\"width:1%;\"><b>META</b></th>\n <th style=\"width:5%;\"><b>PONDERACI&Oacute;N</b></th>\n <th style=\"width:4%;\"><b>ENE.</b></th>\n <th style=\"width:4%;\"><b>FEB.</b></th>\n <th style=\"width:4%;\"><b>MAR.</b></th>\n <th style=\"width:4%;\"><b>ABR.</b></th>\n <th style=\"width:4%;\"><b>MAY.</b></th>\n <th style=\"width:4%;\"><b>JUN.</b></th>\n <th style=\"width:4%;\"><b>JUL.</b></th>\n <th style=\"width:4%;\"><b>AGO.</b></th>\n <th style=\"width:4%;\"><b>SEP.</b></th>\n <th style=\"width:4%;\"><b>OCT.</b></th>\n <th style=\"width:4%;\"><b>NOV.</b></th>\n <th style=\"width:4%;\"><b>DIC.</b></th>\n <th style=\"width:7%;\"><b>MEDIO DE VERIFICACI&Oacute;N</b></th>\n <th style=\"width:7%;\"><b>DELETE</b></th>\n <th style=\"width:7%;\"><b>NRO. REQ.</b></th>\n </tr>\n </thead>\n <tbody>';\n $cont = 0;\n foreach($productos as $rowp){\n $cont++;\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $color='';\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n $tabla .='<tr bgcolor=\"'.$color.'\" class=\"modo1\">';\n $tabla.='<td title=\"C&Oacute;DIGO OPERACI&Oacute;N : '.$rowp['prod_cod'].'\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.$rowp['prod_cod'].'</b></font></td>';\n $tabla.='<td align=\"center\">';\n $tabla.='<a href=\"'.site_url(\"admin\").'/prog/mod_prod/'.$rowp['prod_id'].'\" title=\"MODIFICAR OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/modificar.png\" WIDTH=\"33\" HEIGHT=\"34\"/></a>';\n $tabla.='<a href=\"'.site_url(\"\").'/prog/requerimiento/'.$proy_id.'/'.$rowp['prod_id'].'\" target=\"_blank\" title=\"REQUERIMIENTOS DE LA OPERACI&Oacute;N\" class=\"btn btn-default\"><img src=\"'.base_url().'assets/ifinal/insumo.png\" WIDTH=\"33\" HEIGHT=\"33\"/></a>';\n\n $tabla.='</td>';\n $tabla.='<td style=\"width:20%;\">'.$rowp['prod_producto'].'</td>';\n $tabla.='<td style=\"width:20%;\">'.$rowp['prod_resultado'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['indi_abreviacion'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_indicador'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_linea_base'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_meta'].'</td>';\n $tabla.='<td style=\"width:10%;\">'.$rowp['prod_ponderacion'].'%</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['enero'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['febrero'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['marzo'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['abril'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['mayo'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['junio'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['julio'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['agosto'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['septiembre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['octubre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['noviembre'].'</td>';\n $tabla.='<td style=\"width:4%;\" bgcolor=\"#e5fde5\">'.$rowp['diciembre'].'</td>';\n $tabla.='<td style=\"width:7%;\" bgcolor=\"#e5fde5\">'.$rowp['prod_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width:7%;\">';\n $tabla.='<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_del_ff\" class=\"btn btn-default del_ff\" title=\"ELIMINAR OPERACI&Oacute;N\" name=\"'.$rowp['prod_id'].'\" id=\"'.$proy_id.'\"><img src=\"' . base_url() . 'assets/ifinal/eliminar.png\" WIDTH=\"35\" HEIGHT=\"35\"/></a><br><br>';\n $tabla.='<center>\n <input type=\"checkbox\" name=\"req[]\" value=\"'.$rowp['prod_id'].'\" onclick=\"scheck'.$cont.'(this.checked);\"/>\n </center>';\n $tabla.='</td>';\n $tabla.='<td style=\"width:7%;\" align=\"center\"><font color=\"blue\" size=\"2\"><b>'.count($this->model_producto->insumo_producto($rowp['prod_id'])).'</b></font></td>';\n $tabla .='</tr>';\n ?>\n <script>\n function scheck<?php echo $cont;?>(estaChequeado) {\n val = parseInt($('[name=\"tot\"]').val());\n if (estaChequeado == true) {\n val = val + 1;\n } else {\n val = val - 1;\n }\n $('[name=\"tot\"]').val((val).toFixed(0));\n }\n </script>\n <?php\n }\n $tabla.='</tbody>';\n\n return $tabla;\n }", "public function mostrarTablas(){\t\r\n\r\n\t\t$item = null;\r\n \t\t$valor = null;\r\n\r\n \t\t$proveedores = ControladorProveedores::ctrMostrarProveedores($item, $valor);\r\n\r\n\r\n \t\t$datosJson = '{\r\n\t\t \r\n\t \t\"data\": [ ';\r\n\r\n\t \tfor($i = 0; $i < count($proveedores); $i++){\r\n\r\n\t \t\t/*=============================================\r\n\t\t\tDEVOLVER DATOS JSON\r\n\t\t\t=============================================*/\r\n\r\n\t\t\t$datosJson\t .= '[\r\n\t\t\t\t \"'.($i+1).'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"codigo\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"rfc\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"razonSocial\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"fechaAlta\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"limiteCredito\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"diasCredito\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"rfc2\"].'\",\r\n\t\t\t\t \"'.$proveedores[$i][\"curp\"].'\"\r\n\t\t\t\t ],';\r\n\r\n\t \t}\r\n\r\n\t \t$datosJson = substr($datosJson, 0, -1);\r\n\r\n\t\t$datosJson.= ']\r\n\t\t\t \r\n\t\t}'; \r\n\r\n\t\techo $datosJson;\r\n\r\n \t}", "public function Mostrar()\n\t{\n\t\t$data_table = $this->data_source->ejecutarConsulta(\"SELECT * FROM noticias order by 1 desc\");\n\n\t\treturn $data_table;\n\t}", "static public function mostrarTabla(){\n\n \t$item = null;\n $valor = null;\n\n \t$empresa = ControladorEmpresa::ctrMostrarEmpresa($item, $valor);\n\n \techo '{\n\t\t\t\"data\": [';\n\n\t\t\tfor($i = 0; $i < count($empresa)-1; $i++){\n\n\t\t\t\t\n\t\t\t\t echo '[\n\t\t\t \"'.($i+1).'\",\n\t\t\t \"'.$empresa[$i][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[$i][\"empresa\"].'\",\n\t\t\t \"'.$empresa[$i][\"direccion\"].'\",\n\t\t\t \"'.$empresa[$i][\"telefono\"].'\",\n\t\t\t \"'.$empresa[$i][\"celular\"].'\",\n\t\t\t \"'.$empresa[$i][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[$i][\"responsable\"].'\",\n\t\t\t \"'.$empresa[$i][\"email\"].'\"\n\n\t\t\t ],';\n\n\t\t\t}\n\n\t\t\t echo'[\n\t\t\t \"'.count($empresa).'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"empresa\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"direccion\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"telefono\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"celular\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"responsable\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"email\"].'\" \n\t\t\t ]\n\t\t\t]\n\t\t}';\n\n\n }", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function grafico_1( $desde, $hasta, $ua ){\n\t$query = \"select nested.id_cliente, noticiasactor.id_actor, nested.tema from \"\n\t. \"( select procesados.* from ( select noticiascliente.* from noticiascliente inner join proceso on noticiascliente.id_noticia = proceso.id_noticia where noticiascliente.id_cliente = \" . $ua . \" ) procesados \"\n\t. \"inner join noticia on noticia.id = procesados.id_noticia where noticia.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59') nested \"\n\t. \"inner join noticiasactor on nested.id_noticia = noticiasactor.id_noticia order by id_actor asc \";\n\t$main = R::getAll($query);\n\t// obtengo el nombre de la unidad de analisis\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\t// obtengo los nombres de todos los actores, para cruzar\n\t$actores_nombres = R::findOne(\"actor\",\"id LIKE ?\",[4]) ;\n\t//var_dump($actores_nombres['nombre'] . \" \" . $actores_nombres['apellido']);\n\n\t$tabla = [];\n\t$temas = [];\n\t$i = -1;\n\t// reemplazo actores por nombres y temas\n\tforeach($main as $k=>$v){\n\t\t$actores_nombres = R::findOne(\"actor\",\"id LIKE ?\",[ $v['id_actor'] ]);\n\t\t$main[$k]['id_cliente'] = $ua_nombre;\n\t\t// $main[$k]['id_actor'] = $actores_nombres['nombre'] . \" \" . $actores_nombres['apellido'];\n\t\t$main[$k]['id_actor'] = $v['id_actor'];\n\t\t$main[$k]['nombre'] = $actores_nombres['nombre'] . \" \" . $actores_nombres['apellido'];\n\t\t$id_tema = get_string_between($main[$k]['tema'],\"frm_tema_\",\"\\\"\");\n\t\t$tema = R::findOne(\"attr_temas\",\"id LIKE ?\",[$id_tema])['nombre'];\n\t\tif( is_null( $tema ) ) $tema = 'TEMA NO ASIGNADO';\n\t\t$main[$k]['tema'] = $tema;\n\t\t\n\t\t// if(array_search( [ $main[$k]['id_actor'],$tema], $tabla ) ) echo \"repetido\";\n\t\t// chequeo si ya existe alguno con este actor y tema, si es asi, sumo uno\n\t\t// TODO - FIXME : deberia ser mas eficiente, busqueda por dos valores\n\t\t$iter = true;\n\t\tforeach($tabla as $ka=>$va){\n\t\t\t// if($va['actor'] == $main[$k]['id_actor'] && $va['tema'] == $tema){\n\t\t\tif($va['actor'] == $main[$k]['nombre'] && $va['tema'] == $tema){\n\t\t\t\t$tabla[$ka]['cantidad'] += 1;\n\t\t\t\t$iter = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($iter){\n\t\t\t$tabla[ ++$i ] = [ \n\t\t\t\t'unidad_analisis' => $ua_nombre,\n\t\t\t\t'actor' => $main[$k]['nombre'],\n\t\t\t\t'id_actor' => $main[$k]['id_actor'],\n\t\t\t\t'tema' => $tema,\n\t\t\t\t'cantidad' => 1\n\t\t\t\t];\n\t\t\t}\n\t\t// agrego los temas que van apareciendo en la tabla temas\n\t\t// UTIL para poder hacer el CRC32 por la cantidad de colores\n\t\tif(!in_array($tema,$temas)) $temas[] = $tema;\n\t}\n\t// la agrupacion de repetidos es por aca, por que repite y cuenta temas de igual id\n\n\t// en el grafico, los hijos, son arreglos de objetos, hago una conversion tabla -> objeto\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Actores';\n\t$objeto->rank = 0;\n\t$objeto->weight = 1;\n\t$objeto->id = 1;\n\t$objeto->children = [];\n\tforeach($tabla as $k=>$v){\n\t\t// me fijo si el actor existe, ineficiente pero por ahora\n\t\t$NoExiste = true;\n\t\tforeach($objeto->children as $ka=>$va){\n\t\t\t// si existe actor, le inserto el tema\n\t\t\tif($va->name == $v['actor']){\n\t\t\t\t$in = new StdClass();\n\t\t\t\t// $in->name = $v['tema'] . \" (\" . $v['cantidad'] . \") \" ; // lo construye JS\n\t\t\t\t$in->name = \"\";\n\t\t\t\t$in->tema = array_search($v['tema'],$temas);\n\t\t\t\t$in->tema_cantidad = $v['cantidad'];\n\t\t\t\t$in->rank = intval($v['cantidad']); // el tamaño del objeto \n\t\t\t\t$in->weight = 0; // lo asigna JS\n\t\t\t\t$in->id = $k;\n\t\t\t\t$in->children = [];\n\t\t\t\t$objeto->children[$ka]->children[] = $in;\n\t\t\t\t$objeto->children[$ka]->cantidad_temas = count($objeto->children[$ka]->children);\t\n\t\t\t\t$objeto->children[$ka]->rank = count($objeto->children[$ka]->children);\n\t\t\t\t$NoExiste = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif($NoExiste){\n\t\t\t$in = new StdClass();\n\t\t\t$in->name = $v['actor'];\n\t\t\t$in->rank = 1;\n\t\t\t$in->weight = 0; // lo asigna JS\n\t\t\t$in->id = $k;\n\t\t\t//$in->id = $v['id_actor'];\n\t\t\t$in->id_actor = $v['id_actor'];\n\t\t\t\t$t_in = new StdClass();\n\t\t\t\t// $t_in->name = $v['tema'] . \" (\" . $v['cantidad'] . \") \" ; // lo construye JS\n\t\t\t\t$t_in-> name = \"\";\n\t\t\t\t$t_in->tema = array_search($v['tema'],$temas);\n\t\t\t\t$t_in->tema_cantidad = $v['cantidad'];\n\t\t\t\t$t_in->rank = intval($v['cantidad']); // el tamaño del objeto \n\t\t\t\t$t_in->weight = 0; // lo asigna JS\n\t\t\t\t$t_in->id = $k;\n\t\t\t\t$t_in->children = [];\n\t\t\t$in->children = [ $t_in ];\n\t\t\t$objeto->children[] = $in;\n\t\t}\n\t}\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto,\n\t\t'temas' => $temas\n\t\t];\n}", "public function rep_list_operaciones_pi_2019($com_id,$tp){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente=$this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $tabla='';\n\n if($tp==1){\n $tab='table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\"';\n }\n elseif($tp==2){\n $tabla .='<style>\n table{font-size: 9px;\n width: 100%;\n max-width:1550px;\n overflow-x: scroll;\n }\n th{\n padding: 1.4px;\n text-align: center;\n font-size: 9px;\n }\n </style>';\n $tab='table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\"';\n }\n \n $tabla.='<'.$tab.'>\n <thead>\n <tr class=\"modo1\" style=\"height:45px;\">\n <th style=\"width:1%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">#</font></th>\n <th style=\"width:6%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ACCI&Oacute;N ESTRATEGICA</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OPERACI&Oacute;N</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">RESULTADO</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ACTIVIDAD</font></th>\n <th style=\"width:4%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">INDICADOR</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">LINEA BASE</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">META</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ENE.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">FEB.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAR.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ABR.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAY.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUN.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUL.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">AGO.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">SEP.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OCT.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">NOV.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">DIC.</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">VERIFICACI&Oacute;N</font></th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n if(count($obj_est)!=0){\n foreach($obj_est as $rowo){\n $tabla.='<tr class=\"modo1\" bgcolor=\"#c3efea\">';\n $tabla.='<td colspan=\"21\" style=\"height:15px;\">OBJ. EST. '.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td>';\n $tabla.='</tr>';\n $productos=$this->model_producto->list_producto_programado_oestrategico($com_id,$this->gestion,$rowo['obj_id']); /// Productos\n \n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $nro++;\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\" style=\"height:40px;\">';\n $tabla.='<td style=\"height:30px;\">'.$nro.'</td>\n <td>'.$rowp['acc_codigo'].'.- '.$rowp['acc_descripcion'].'</td>\n <td>'.$rowp['prod_producto'].'</td>\n <td>'.$rowp['prod_resultado'].'</td>\n <td></td>\n <td>'.$rowp['prod_indicador'].'</td>\n <td align=\"right\">'.$rowp['prod_linea_base'].'</td>\n <td align=\"right\">'.$rowp['prod_meta'].'</td>\n <td align=\"right\">'.$rowp['enero'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['febrero'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['marzo'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['abril'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['mayo'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['junio'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['julio'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['agosto'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['septiembre'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['octubre'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['noviembre'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['diciembre'].''.$tp.'</td>\n <td>'.$rowp['prod_fuente_verificacion'].'</td>'; \n $tabla.='</tr>';\n $tabla.=''.$this->actividades_2019($rowp['prod_id'],$nro).'';\n }\n }\n }\n else{\n $tabla.='<tr><td colspan=\"22\">No existen operaciones alineadas, Verifique Operaciones</td></tr>';\n }\n \n $tabla .=\n '</tbody>\n </table>';\n\n return $tabla;\n }", "function tablaConversiones() {\n \n $array = array();\n $contador = 0;\n $output = \"\";\n $output2 = \"\";\n $heading = array('Numero ','Contenido de $var ', 'isset($var) ', 'empty($var) ', '(bool) $var ', 'is_null($var)');\n $var = array(null, 0, true, false, \"0\", \"\", \"foo\", $array, 2);\n $funciones = array('llamarIsset', 'llamarEmpty', 'llamarBool', 'llamarIsnull');\n \n $output .= \"<table class='table table-bordered'>\";\n $output .= \"<tr>\";\n // imprimimos cabecera\n foreach ($heading as $value) {\n $output .= \"<th>\" . $value . \" </th>\";\n }\n $output .= \"</tr>\";\n foreach ($var as $valor) {\n \n $contador++;\n $output .= \"<th> {$contador} </th>\";\n \n if ($valor === null) {\n $output2 = \"null\";\n } elseif($valor === true) {\n $output2 = \"true\";\n } elseif($valor === 2) {\n $output2 = \"unset(\\$var)\";\n } elseif($valor === \"\") {\n $output2 = \"\\\"\\\"\";\n } elseif($valor === false) {\n $output2 = \"false\";\n }else {\n $output2 = $valor;\n }\n \n $output .= \"<th> \\$var= \". $output2 .\" </th>\";\n \n foreach ($funciones as $funcion) {\n \n if ($valor == 2) {\n unset($valor);\n }\n if ($funcion($valor)) {\n $output .= \"<td class='true'> True </td>\";\n } else {\n $output .= \"<td class='false'> False </td>\";\n }\n }\n $output .= \"<tr>\";\n }\n \n $output .= \"</table>\";\n\n echo $output;\n }", "function setTabla($filas,$columnas){\r\n\t\t$this->setTitulo(\"Fotos\");\t\r\n\t\t$str=\"\";\r\n\t\t$contador=1;\r\n\t\t$str=\"<table>\";\r\n\t\tfor($i=0;$i<$filas;$i++){\r\n\t\t\t$str=$str.\"<tr>\";\r\n\t\t\tfor($j=0;$j<$columnas;$j++){\r\n\t\t\t\t$photo=\"photo_\".$contador++.\".png\";\r\n\t\t\t\t$str=$str.\"<td><img src='\".$photo.\"' width='150' height='150'></td>\";\r\n\t\t\t}\r\n\t\t\t$str=$str.\"</tr>\";\r\n\t\t}\r\n\t\t$str=$str.\"</table>\";\r\n\t\t$this->setContenido($str);\r\n\t}", "function tablaGruposTutorJuniorAsignadosTutor($idCursoAbierto,$idTutor)\n{\n \n if(!is_numeric($idCursoAbierto))\n return NULL;\n \n if(!is_numeric($idTutor))\n return NULL;\n \n \n $arrayGrupos = consultaGruposRelacionCursoAbierto($idCursoAbierto,$idTutor);\n if($arrayGrupos)\n {\n foreach ($arrayGrupos as $grupo) {\n $nombreInstitucion = html_entity_decode(getNombreInstitucion($grupo->idEscuela));\n $nombreEscuela = getNombreEscuela($grupo->idEscuela);\n $nombreEmpresa = html_entity_decode(getNombreEmpresa($grupo->idEmpresa));\n $nAlumnos = getCantidadAlumnosGrupo($grupo->id);\n \n if ($grupo->tipoGrupo == 0) {\n $tipoGrupo = \"Escuela\";\n } else {\n $tipoGrupo = \"Empresa\";\n }\n echo <<<HTML\n <tr>\n <td><a class=\"icon-user icon-black\" href=\"alumnosAsignadosGrupo.php?idGrupo=$grupo->id&idCursoAbierto=$idCursoAbierto\" role=\"button\" data-toggle=\"modal\" title=\"Ver Alumno\"></a>\n <a class=\"icon-book icon-black\" href=\"tutoresJrAsignadosGrupo.php?idGrupo=$grupo->id&idCursoAbierto=$idCursoAbierto\" role=\"button\" data-toggle=\"modal\" title=\"Ver Tutores Juniorr\"></a>\n \n </td>\n <td>$nAlumnos</td>\n <td>$grupo->nombre</td>\n <td>$grupo->clave</td>\n <td>$tipoGrupo</td>\n <td>$nombreInstitucion</td>\n <td>$nombreEscuela</td>\n <td>$nombreEmpresa</td> \n </tr>\nHTML;\n } \n \n }\n}", "function GenerarReporteOficinas(){\t//consultar estudiantes registrados por municipio\t\n\n\t\t\t$html=\"\";\n\t\t\t$strsql=\"SELECT pasantias.departamento.estado, pasantias.oficina.nombre_oficina, pasantias.departamento.descripcion FROM pasantias.oficina , pasantias.departamento WHERE\n\n \t\t\t\t\toficina.id_departamento = departamento.id_departamento\";\t \n\t\t\t\t \n\t\t\t$rs=pg_query($strsql);\n\t\t\t$num=0;\n\t\t\t$num=pg_num_rows($rs);\n\t\t\n\n\n\t\t\t$html=$html.'<div align=\"center\">\n\t\t\t<h2>Reporte De Especialidades</h2>\n\t\t\t<h3>Total de registros: &nbsp; <i>'.$num.'</i></h3>\n\t\t\t\n\t\t\t<br><br>\n\t\t\t';\n\t\t\t/*$html=$html.'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n\t\t\t<table style=\"border-spacing: 2px;\" align=\"center\" >\n\t\t\t<tr align=\"center\" bgcolor=\"#011137\" border=\"1\" style=\"color: #000000;\">\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Id</font></td>\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Nombre</font></td>\n\t\t\t\t\n\t\t\t\t</tr>';*/\n\n\n\t\t\t\t$html=$html.'<div align=\"center\">\t\t\t\n\t\t\t<table border=\"0\" bordercolor=\"#0000CC\" bordercolordark=\"#FF0000\">';\t\n\t\t\t$html=$html.'<tr bgcolor=\"#0B3861\">\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> N&oacute;mbre Oficina </b></font></td>\n\t\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Descripción </b></font></td>\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Estado </b></font></td>\n\t\t\t</tr>';\n\n\t\t\t\n\t\t\t\t\n\t\t\t\twhile ($row = pg_fetch_array($rs)){\n\n\t\t\t\t\n\t\t\t\tif($i%2==0){\n\t\t\t\t\t$html= $html.'<tr bgcolor=\"#58ACFA\">';\n\t\t\t\t}else{\n\t\t\t\t\t$html=$html.'<tr>';\n\t\t\t\t}\n\t\t\t\t$html = $html.'<td>';\n\t\t\t\t$html = $html. $row[\"nombre_oficina\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"descripcion\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"estado\"];\n\t\t\t\t$html = $html.'</td></tr>';\t\t\n\t\t\t\t$i++;\n\t\t\t}\t\t\t\n\t\t\t$html=$html.'</table></div>';\t\t\t\n \t\t return ($html);\n\t\t}", "function GenerarReporteOficinas(){\t//consultar estudiantes registrados por municipio\t\n\n\t\t\t$html=\"\";\n\t\t\t$strsql=\"SELECT pasantias.departamento.estado, pasantias.oficina.nombre_oficina, pasantias.departamento.descripcion FROM pasantias.oficina , pasantias.departamento WHERE\n\n \t\t\t\t\toficina.id_departamento = departamento.id_departamento\";\t \n\t\t\t\t \n\t\t\t$rs=pg_query($strsql);\n\t\t\t$num=0;\n\t\t\t$num=pg_num_rows($rs);\n\t\t\n\n\n\t\t\t$html=$html.'<div align=\"center\">\n\t\t\t<h2>Reporte De Especialidades</h2>\n\t\t\t<h3>Total de registros: &nbsp; <i>'.$num.'</i></h3>\n\t\t\t\n\t\t\t<br><br>\n\t\t\t';\n\t\t\t/*$html=$html.'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \n\t\t\t<table style=\"border-spacing: 2px;\" align=\"center\" >\n\t\t\t<tr align=\"center\" bgcolor=\"#011137\" border=\"1\" style=\"color: #000000;\">\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Id</font></td>\n\t\t\t\t<td width=\"100\"><font color=\"#FFFFFF\">Nombre</font></td>\n\t\t\t\t\n\t\t\t\t</tr>';*/\n\n\n\t\t\t\t$html=$html.'<div align=\"center\">\t\t\t\n\t\t\t<table border=\"0\" bordercolor=\"#0000CC\" bordercolordark=\"#FF0000\">';\t\n\t\t\t$html=$html.'<tr bgcolor=\"#0B3861\">\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> N&oacute;mbre Oficina </b></font></td>\n\t\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Descripción </b></font></td>\n\t\t\t<td><font color=\"#FFFFFF\" size=\"10\"><b> Estado </b></font></td>\n\t\t\t</tr>';\n\n\t\t\t\n\t\t\t\t\n\t\t\t\twhile ($row = pg_fetch_array($rs)){\n\n\t\t\t\t\n\t\t\t\tif($i%2==0){\n\t\t\t\t\t$html= $html.'<tr bgcolor=\"#58ACFA\">';\n\t\t\t\t}else{\n\t\t\t\t\t$html=$html.'<tr>';\n\t\t\t\t}\n\t\t\t\t$html = $html.'<td>';\n\t\t\t\t$html = $html. $row[\"nombre_oficina\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"descripcion\"];\n\t\t\t\t$html = $html.'</td><td>';\n\t\t\t\t$html = $html. $row[\"estado\"];\n\t\t\t\t$html = $html.'</td></tr>';\t\t\n\t\t\t\t$i++;\n\t\t\t}\t\t\t\n\t\t\t$html=$html.'</table></div>';\t\t\t\n \t\t return ($html);\n\t\t}", "public static function obtenerTablaHtml($clase, $rotulos = array(), $foraneos = array(), $ver = \"*\", $extra = \"\", $pagina = 0, $cantidad = self::REGISTROS_PAGINA, $clase2 = null){\n\t\t$pagina = ($pagina < 0 ? 0 : $pagina);\n\t\t$arrTb = self::obtenerListado( $clase, $ver, $extra, $pagina, $cantidad );\n\t\t$tabla = '<table>';\n\t\t$encabezados = '';\n\t\t$cuerpo = '';\n\t\tif( sizeof( $arrTb ) > 0 ){\n\t\t\t\n\t\t\t$encabezados .= '\t<thead>';\n\t\t\t$encabezados .= '\t\t<tr> ';\n\t\t\t$arrHd = array_keys($arrTb[0]);\n\t\t\t\n\t\t\tforeach ( $arrHd as $idH => $vlH ){\n\t\t\t\t$rt = $vlH;\n\t\t\t\tif( is_array( $rotulos ) ){\n\t\t\t\t\tif( isset( $rotulos[ $vlH ] ) ){\n\t\t\t\t\t\t$rt = $rotulos[ $vlH ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$encabezados .= '\t\t\t<th>' . $rt . '</th> ';\n\t\t\t}\n\t\t\t$encabezados .= '\t\t</tr> ';\n\t\t\t$encabezados .= '\t</thead> ';\n\t\t\t\n\t\t\t$cuerpo .= '<tbody>';\n\t\t\tforeach ($arrTb as $idB => $vlB) {\n\t\t\t\t$cuerpo .= '<tr>';\n\t\t\t\t\n\t\t\t\tforeach ($vlB as $idCuerpo => $vlCuerpo ) {\n\t\t\t\t\t$txtDef = $vlCuerpo;\n\t\t\t\t\tif( isset( $foraneos[ $idCuerpo ] ) ){\n\t\t\t\t\t\t$tmpField = $foraneos[ $idCuerpo ];\n\t\t\t\t\t\tif( isset( $tmpField[ $vlCuerpo ] ) ){\n\t\t\t\t\t\t\t$txtDef = $tmpField[ $vlCuerpo ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$strPrint = $txtDef;\n\t\t\t\t\t\n\t\t\t\t\tif( strtolower( $idCuerpo ) == \"id\" ){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$jsmenuid = (isset($_POST[ \"jsmenuid\" ]) ? $_POST[ \"jsmenuid\" ]: \"\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '<td >';\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t<table>';\n\t\t\t\t\t\t$cuerpo .= '\t\t<tbody>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t<tr>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t<td>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t<form action=\"./\" method=\"post\" id=\"dtView_' . $strPrint . '\" >';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( isset( $vlB[ \"estado_id\" ] ) ){\n\t\t\t\t\t\t\tif( $vlB[\"estado_id\"] == \"1\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 2 ) . '\" />';\n\t\t\t\t\t\t\t}else if( $vlB[\"estado_id\"] == \"2\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewInVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 1 ) . '\" />';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"estadoinactivo\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"' . $strPrint . '\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"&nbsp;\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"modificarfrm\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cs\" value=\"' . md5( ( $clase2 == null ? $clase : $clase2 ) ) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"obj\" value=\"' . md5($strPrint) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"pageid\" value=\"' . $_POST[\"pageid\"] . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"jsmenuid\" value=\"' . $jsmenuid . '\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t</form>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t</td>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t<td>';\n\t\t\t\t\t\t// Eliminar\n\t\t\t\t\t\t$cuerpo .= '\t<form action=\"./\" method=\"post\" id=\"dtDelView_' . $strPrint . '\" >';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewDel\" value=\"&nbsp;\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"eliminarfrm\") . '\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cs\" value=\"' . md5( ( $clase2 == null ? $clase : $clase2 ) ) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"obj\" value=\"' . md5($strPrint) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"pageid\" value=\"' . $_POST[\"pageid\"] . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"jsmenuid\" value=\"' . $jsmenuid . '\" />';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t</form>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t\t\t</td>';\n\t\t\t\t\t\t$cuerpo .= '\t\t\t</tr>';\n\t\t\t\t\t\t$cuerpo .= '\t\t</tbody>';\n\t\t\t\t\t\t$cuerpo .= '\t</table>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '</td>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*$cuerpo .= '\t<form action=\"./\" method=\"post\" id=\"dtView_' . $strPrint . '\" >';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( isset( $vlB[ \"estado_id\" ] ) ){\n\t\t\t\t\t\t\tif( $vlB[\"estado_id\"] == \"1\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 2 ) . '\" />';\n\t\t\t\t\t\t\t}else if( $vlB[\"estado_id\"] == \"2\"){\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" value=\"&nbsp;\" class=\"dtViewInVisible\" />';\n\t\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"ide\" value=\"' . md5( 1 ) . '\" />';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"estadoinactivo\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"' . $strPrint . '\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"submit\" class=\"dtViewEdit\" value=\"&nbsp;\" />';\n\t\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cmd\" value=\"' . md5(\"modificarfrm\") . '\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"cs\" value=\"' . md5( ( $clase2 == null ? $clase : $clase2 ) ) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"obj\" value=\"' . md5($strPrint) . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"pageid\" value=\"' . $_POST[\"pageid\"] . '\" />';\n\t\t\t\t\t\t$cuerpo .= '\t\t<input type=\"hidden\" name=\"jsmenuid\" value=\"' . $jsmenuid . '\" />';\n\n\t\t\t\t\t\t$cuerpo .= '\t</form>';\n\t\t\t\t\t\t$cuerpo .= '</td>';*/\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cuerpo .= '<td>' . $strPrint . '</td>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$cuerpo .= '</tr>';\n\t\t\t}\n\t\t\t$cuerpo .= '</tbody>';\n\t\t}\n\t\t$tabla .= $encabezados . $cuerpo . \"</table>\";\n\t\treturn $tabla;\n\t}", "public function actividades_2019($prod_id,$nro){\n $actividad=$this->model_actividad->list_act_anual($prod_id); /// Actividad\n $tabla='';\n $nro_a=0;\n if(count($actividad)!=0){\n foreach ($actividad as $row){\n $programado=$this->model_actividad->actividad_programado($row['act_id'],$this->gestion); /// Actividad Programado\n if(count($programado)!=0){\n $nro_a++;\n $monto=$this->model_actividad->monto_insumoactividad($row['act_id']);\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n $tabla.='<tr class=\"modo1\" bgcolor=\"#f5f5f5\">';\n $tabla.='<td style=\"width: 1%; text-align: left;\" style=\"height:11px;\">'.$nro.'.'.$nro_a.'</td>';\n $tabla.='<td style=\"width: 9%; text-align: left;\"></td>';\n $tabla.='<td style=\"width: 10%; text-align: left;\"></td>';\n $tabla.='<td style=\"width: 9%; text-align: left;\"></td>';\n $tabla.='<td style=\"width: 10%; text-align: left;\">'.$row['act_actividad'].'</td>';\n $tabla.='<td style=\"width: 7%; text-align: left;\">'.$row['act_indicador'].'</td>';\n $tabla.='<td style=\"width: 3%; text-align: right;\">'.$row['act_linea_base'].'</td>';\n $tabla.='<td style=\"width: 2.5%; text-align: right;\">'.$row['act_meta'].'</td>';\n $tabla.='<td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['enero'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['febrero'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['marzo'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['abril'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['mayo'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['junio'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['julio'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['agosto'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['septiembre'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['octubre'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['noviembre'].'</td>\n <td style=\"width: 2.5%; text-align: right;\">'.$programado[0]['diciembre'].'</td>';\n $tabla.='<td style=\"width: 8%; text-align: left;\">'.$row['act_fuente_verificacion'].'</td>';\n $tabla.='<td style=\"width: 5%; text-align: left;\">'.number_format($ptto, 2, ',', '.').'</td>';\n $tabla.='</tr>';\n }\n \n }\n }\n\n return $tabla;\n }", "function TablaServiciosDiariasVendedor()\n {\t\n\t\n\t//Logo\n $this->Image(\"./assets/img/logo.png\" , 20 ,12, 60 , 20 , \"PNG\");\n\t$this->SetXY(10, 15);\n\t$this->SetFont('courier','B',10);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(75,6,'',0,0,'');\n\t$this->Cell(120,6,'LISTADO DE SERVICIOS DEL DIA '.date(\"Y-m-d\"),0,1,'C');\n \n\t$this->Cell(75,6,'',0,0,'');\n $this->Cell(120,6,'DE CAJA N°.'.base64_decode($_GET['caja']),0,0,'C');\n //Salto de línea\n $this->Ln(15);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetFillColor(2,157,116);\n\t$this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'CÉDULA GERENTE: ',0,0,'');\n\t$this->Cell(44,5,$con[0]['cedresponsable'],0,0,'');\n\t$this->Cell(30,5,'NOMBRE GERENTE:',0,0,'');\n\t$this->Cell(83,5,$con[0]['nomresponsable'],0,1,'');\n \n $this->Cell(10,5,'',0,0,'');\n\t$this->Cell(35,5,'TELÉFONO GERENTE: ',0,0,'');\n $this->Cell(44,5,utf8_decode($con[0]['tlfresponsable']),0,0,'');\n $this->Cell(30,5,'CORREO GERENTE:',0,0,'');\n $this->Cell(83,5,utf8_decode($con[0]['correoresponsable']),0,0,'');\n $this->Ln(8);\n\t\n\t$this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->SetFillColor(249, 187, 31); // establece el color del fondo de la celda (en este caso es NARANJA)\n\t$this->CellFitSpace(10,8,'N°',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'CÓDIGO SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(32,8,'FECHA SERVICIO',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'SERVICIOS',1,0,'C', True);\n\t$this->CellFitSpace(25,8,'SUBTOTAL',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'IVA',1,0,'C', True);\n\t$this->CellFitSpace(22,8,'DESCUENTO',1,0,'C', True);\n\t$this->CellFitSpace(26,8,'TOTAL PAGO',1,1,'C', True);\n\t\n $tra = new Login();\n $reg = $tra->ListarServiciosDiarias();\n\t$serviciosTotal=0;\n\t$pagoSubtotal=0;\n\t$pagoIva=0;\n\t$pagoDescuento=0;\n\t$pagoTotal=0;\n\t$a=1;\n for($i=0;$i<sizeof($reg);$i++){\n $serviciosTotal+=$reg[$i]['cantidad'];\n\t$pagoSubtotal+=$reg[$i]['subtotal']; \n\t$pagoIva+=$reg[$i]['totaliva']; \n\t$pagoDescuento+=$reg[$i]['totaldescuento']; \n\t$pagoTotal+=$reg[$i]['totalpago'];\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(10,5,$a++,1,0,'C');\n\t$this->CellFitSpace(32,5,$reg[$i][\"codservicio\"],1,0,'C');\n\t$this->CellFitSpace(32,5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($reg[$i]['fechaservicio']))),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode($reg[$i][\"cantidad\"]),1,0,'C');\n\t$this->CellFitSpace(25,5,utf8_decode(number_format($reg[$i]['subtotal'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaliva'], 2, '.', ',')),1,0,'C');\n $this->CellFitSpace(22,5,utf8_decode(number_format($reg[$i]['totaldescuento'], 2, '.', ',')),1,0,'C');\n\t$this->CellFitSpace(26,5,utf8_decode(number_format($reg[$i]['totalpago'], 2, '.', ',')),1,0,'C');\n $this->Ln();\n\t\n } \n \n\t$this->Cell(10,5,'',1,0,'C');\n $this->Cell(32,5,'',1,0,'C');\t\n $this->SetFont('courier','B',9);\n\t$this->SetTextColor(255,255,255); // Establece el color del texto (en este caso es blanco)\n $this->Cell(32,5,'TOTAL GENERAL',1,0,'C', True);\n $this->SetFont('courier','B',8);\n $this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es blanco)\n $this->Cell(22,5,utf8_decode($serviciosTotal),1,0,'C');\n $this->Cell(25,5,utf8_decode(number_format($pagoSubtotal, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($pagoIva, 2, '.', ',')),1,0,'C');\n $this->Cell(22,5,utf8_decode(number_format($pagoDescuento, 2, '.', ',')),1,0,'C'); \n $this->CellFitSpace(26,5,utf8_decode(number_format($pagoTotal, 2, '.', ',')),1,0,'C');\n $this->Ln();\n\n \n $this->Ln(15); \n $this->SetFont('courier','B',9);\n $this->Cell(190,0,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]).' RECIBIDO POR:___________________________','',1,'C');\n $this->Ln(4);\n }", "public function actividades_2018($prod_id,$nro){\n $actividad=$this->model_actividad->list_act_anual($prod_id); /// Actividad\n $tabla='';\n $nro_a=0;\n if(count($actividad)!=0){\n foreach ($actividad as $row){\n $programado=$this->model_actividad->actividad_programado($row['act_id'],$this->gestion); /// Actividad Programado\n if(count($programado)!=0){\n $nro_a++;\n $tabla.='<tr class=\"modo1\" bgcolor=\"#e5f3f1\">';\n $tabla.='<td>'.$nro.'.'.$nro_a.'</td>';\n $tabla.='<td></td>';\n $tabla.='<td>'.$row['act_actividad'].'</td>';\n $tabla.='<td>'.$row['indi_abreviacion'].'</td>';\n $tabla.='<td>'.$row['act_indicador'].'</td>';\n $tabla.='<td align=\"right\">'.$row['act_linea_base'].'</td>';\n $tabla.='<td align=\"right\">'.$row['act_meta'].'</td>';\n $tabla.='<td align=\"right\">'.$programado[0]['enero'].'</td>\n <td align=\"right\">'.$programado[0]['febrero'].'</td>\n <td align=\"right\">'.$programado[0]['marzo'].'</td>\n <td align=\"right\">'.$programado[0]['abril'].'</td>\n <td align=\"right\">'.$programado[0]['mayo'].'</td>\n <td align=\"right\">'.$programado[0]['junio'].'</td>\n <td align=\"right\">'.$programado[0]['julio'].'</td>\n <td align=\"right\">'.$programado[0]['agosto'].'</td>\n <td align=\"right\">'.$programado[0]['septiembre'].'</td>\n <td align=\"right\">'.$programado[0]['octubre'].'</td>\n <td align=\"right\">'.$programado[0]['noviembre'].'</td>\n <td align=\"right\">'.$programado[0]['diciembre'].'</td>';\n \n $tabla.='<td>'.$row['act_fuente_verificacion'].'</td>';\n $tabla.='</tr>';\n }\n \n }\n }\n\n return $tabla;\n }", "private function create_table_people2(): ?string\n\t{\n\t\t$offset = ($this->xxl ? 50 : 30);\n\t\t$rows = ($this->xxl ? 30 : 15);\n\t\t$results = db::query('SELECT csnick, l_total FROM ruid_lines JOIN uid_details ON ruid_lines.ruid = uid_details.uid WHERE status NOT IN (3,4) AND l_total != 0 ORDER BY l_total DESC, ruid_lines.ruid ASC LIMIT '.$offset.','.($rows * 3));\n\t\t$col = 1;\n\t\t$row = 0;\n\n\t\twhile ($result = $results->fetchArray(SQLITE3_ASSOC)) {\n\t\t\tif (++$row > $rows) {\n\t\t\t\t++$col;\n\t\t\t\t$row = 1;\n\t\t\t}\n\n\t\t\t$columns[$col][$row] = [\n\t\t\t\t'csnick' => $result['csnick'],\n\t\t\t\t'l_total' => $result['l_total'],\n\t\t\t\t'pos' => $offset + (($col - 1) * $rows) + $row];\n\t\t}\n\n\t\t/**\n\t\t * Return if we don't have enough data to fill the table.\n\t\t */\n\t\tif (!isset($columns[3][$rows])) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$total = db::query_single_col('SELECT COUNT(*) FROM ruid_lines JOIN uid_details ON ruid_lines.ruid = uid_details.uid WHERE status NOT IN (3,4)') - ($offset + $rows * 3);\n\t\t$colgroup = '<colgroup>'.str_repeat('<col>', 13);\n\t\t$thead = '<thead><tr><th colspan=\"13\">'.($total !== 0 ? '<span class=\"title-left\">Less Talkative People &ndash; All-Time</span><span class=\"title-right\">'.number_format($total).($total !== 1 ? ' People' : ' Person').' had even less to say..</span>' : 'Less Talkative People &ndash; All-Time');\n\t\t$thead .= '<tr><td><td>Lines<td><td>User<td><td>Lines<td><td>User<td><td>Lines<td><td>User<td>';\n\t\t$tbody = '<tbody>';\n\n\t\tfor ($i = 1; $i <= $rows; ++$i) {\n\t\t\t$tbody .= '<tr><td>';\n\n\t\t\tfor ($j = 1; $j <= 3; ++$j) {\n\t\t\t\t$tbody .= '<td>'.number_format($columns[$j][$i]['l_total']).'<td>'.$columns[$j][$i]['pos'].'<td>'.($this->link_user_php ? '<a href=\"user.php?nick='.$this->htmlify(urlencode($columns[$j][$i]['csnick'])).'\">'.$this->htmlify($columns[$j][$i]['csnick']).'</a>' : $this->htmlify($columns[$j][$i]['csnick'])).'<td>';\n\t\t\t}\n\t\t}\n\n\t\treturn '<table class=\"ppl2\">'.$colgroup.$thead.$tbody.'</table>'.\"\\n\";\n\t}", "function getDescripcionHorario(){\n\t\tglobal $usr;\n\t\tglobal $dias_semana;\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'descripcion_horario.tpl');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_DIA', 'es_primer_dia');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_HORARIO', 'bloque_horario');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TODO_HORARIO', 'bloque_todo_horario');\n\n\t\t$T->setVar('bloque_horario', '');\n\t\t$T->setVar('bloque_todo_horario', '');\n\n\t\t$horario = $usr->getHorario($this->horario_id);\n\t\t$T->setVar('__item_orden', $this->extra[\"item_orden\"]);\n\t\t$T->setVar('__horario_orden', 1);\n\t\t$T->setVar('__horario_nombre',$horario->nombre);\n\t\t$tiene_horarios = false;\n\n\t\t$linea = 1;\n\t\tforeach ($dias_semana as $dia_id => $dia_nombre) {\n\t\t\t$items = $horario->getDiaSemanaItems($dia_id);\n\t\t\t$primero = true;\n\t\t\tforeach ($items as $id => $item) {\n\t\t\t\tif ($primero == true) {\n\t\t\t\t\t$T->setVar('__dia', $dia_nombre);\n\t\t\t\t\t$T->setVar('__dia_rowspan', count($items));\n\t\t\t\t\t$T->parse('es_primer_dia', 'ES_PRIMERO_DIA', false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$T->setVar('es_primer_dia', '');\n\t\t\t\t}\n\n\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\t\t\t\t$T->setVar('__horaInicio', $item->hora_inicio);\n\t\t\t\t$T->setVar('__horaTermino', $item->hora_termino);\n\t\t\t\t$T->parse('bloque_horario', 'BLOQUE_HORARIO', true);\n\t\t\t\t$primero = false;\n\t\t\t\t$tiene_horarios = true;\n\t\t\t\t$linea++;\n\t\t\t}\n\t\t}\n\t\tif ($tiene_horarios == false) {\n\t\t\t$T->parse('bloque_todo_horario', 'BLOQUE_TODO_HORARIO', false);\n\t\t}\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}" ]
[ "0.692378", "0.6913339", "0.685631", "0.68244594", "0.6767007", "0.6753633", "0.6722191", "0.6719918", "0.6717784", "0.6675399", "0.6661482", "0.66417783", "0.6636273", "0.6636022", "0.66222245", "0.6618414", "0.65944964", "0.6563797", "0.65533936", "0.65196204", "0.6517587", "0.6515718", "0.6504598", "0.6495019", "0.6494328", "0.6485323", "0.6483493", "0.64827645", "0.6460707", "0.6443679", "0.64179265", "0.6390586", "0.63873976", "0.63822263", "0.63643515", "0.6360169", "0.63200015", "0.6312876", "0.6309365", "0.6285702", "0.62762094", "0.6267576", "0.62277377", "0.6224197", "0.6222161", "0.62158686", "0.62025833", "0.6197112", "0.61710846", "0.61653566", "0.6160707", "0.6149272", "0.6145398", "0.6145398", "0.61436826", "0.6141055", "0.6125909", "0.61230415", "0.61182857", "0.6115828", "0.60963315", "0.609549", "0.6087333", "0.60794747", "0.60757107", "0.60724455", "0.6071152", "0.6066563", "0.60634613", "0.6061956", "0.6060603", "0.60589945", "0.60563356", "0.60468614", "0.6043127", "0.6041323", "0.60410273", "0.60378355", "0.6035628", "0.6031592", "0.60299695", "0.60268533", "0.60210866", "0.6008581", "0.6004712", "0.59992903", "0.5994137", "0.59910923", "0.59900147", "0.5975795", "0.5969634", "0.596844", "0.5966427", "0.59641385", "0.59641385", "0.5960821", "0.5955881", "0.59515876", "0.594697", "0.59462297", "0.59325033" ]
0.0
-1
le paso el nombre del genero que quiero
function GetPeliculasPorGenero($generoNombre){ $genero = $this->db->prepare("SELECT * FROM genero WHERE nombre=?");//todo de genero del nombre que quiero $genero->execute(array($generoNombre));//le asignamos ese nombre $arrGenero = $genero->fetchAll(PDO::FETCH_OBJ);//lo pedimos a la base de datos //print_r($id_generos[0]->id_genero);//lo imprimimos para ver que tal $sentencia = $this->db->prepare("SELECT * FROM peliculas WHERE id_genero=?");//todo de pelicuas de un id_genero que quiero $sentencia->execute(array($arrGenero[0]->id_genero));//lo ejecuto y le paso el id que busco // print_r($sentencia->fetchAll(PDO::FETCH_OBJ)); return $sentencia->fetchAll(PDO::FETCH_OBJ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generujKod(){\n\t\t//\n\t}", "public function getGen() {}", "public function getGen() {}", "public function getGen();", "function generate() ;", "function cl_bensetiquetaimpressa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bensetiquetaimpressa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }", "abstract public function generate();", "public function getName()\n {\n return 'createrecipe';\n }", "abstract protected function generateName();", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function generate();", "public function getGenero()\n {\n return $this->genero;\n }", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function Generar( ){\r\n\t\t$this->Output();\r\n\t}", "public function generer($donnees){\n $contenu=\"\";\n foreach($donnees as $value){\n $fichier = \"src/View/\".$value['dir'].\"/\".$value['file'].\"View.php\";\n \n $contenu .= $this->genererFichier($fichier, array($value['nameValue']=>$value['datas']));\n }\n\n $vue = $this->genererFichier('src/View/layout/layout.php',array('content'=>$contenu));\n \n return $vue;\n\n }", "function Generate()\n \t{\n \t\t\n \t}", "public function form_gen($id){\n\t\t\t\n\t\t$data['form_type'] = 'gen' ;\n\t\t\t\n\t\t// fetch data if form is filed for generation form\n\t\t$data['gn_a'] = $this->WM->get_generation_a();\n\t\t$data['gn_b'] = $this->WM->get_generation_b();\n\t\t$data['gn_b1'] = $this->WM->get_generation_b1();\n\t\t$data['gn_c'] = $this->WM->get_generation_c();\n\t\t$data['gn_3'] = $this->WM->get_generation_3();\n\t\t\n\t\t$this->load->view('wp-admin/users/form_gen', $data);\n\t}", "public function generate()\n\t{\n\t\treturn parent::generate();\n\t}", "private function auto_name(){\n\n // the name starts from the class name Tbutton1 etc\n // toString inherits method from Tcontrol\n // which inherits from Object\n \n $prefix=toString($this);\n // get current count\n $counter=count($this->names);\n // create name\n $name=$prefix.'_'.$counter;\n \n return $name;\n }", "function generate( $name ) \n {\n $this->render( 'xhprof.php' , $name . '.php' , array( \n 'name' => $name,\n ));\n }", "public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$objTemplate = new \\BackendTemplate('be_wildcard');\n\n\t\t\t$objTemplate->wildcard = '### PAGE PEEL ###';\n\t\t\t$objTemplate->title = $this->name;\n\t\t\t\n\t\t\t// TODO: Vorschaubild der Kampagne einbinden\n\t\t\t\n\t\t\t$objTemplate->id = $this->id;\n\t\t\t$objTemplate->link = $this->title;\n\t\t\t$objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;\n\n\t\t\treturn $objTemplate->parse();\n\t\t}\n\n\t\t$objFile = \\FilesModel::findByPk($this->cp_pagepeel_imgsmall); \n\t\t$this->cp_pagepeel_imgsmall = $objFile->path; \n\n\t\t$objFile = \\FilesModel::findByPk($this->cp_pagepeel_imgbig); \n\t\t$this->cp_pagepeel_imgbig = $objFile->path; \n\t\t\n\t\treturn parent::generate();\n\t}", "public function getCrearFoto(){\n\t\treturn 'formulario de de crear Albumes';\n\t}", "private function generar($nombre, $seccion, $valores){\n\n\t\t$valor = $this->obtener_valor($nombre, $seccion, $valores);\n\n\t\t// Construyo la meta a partir de la plantilla y el valor definido para esa sección\n\t\t$valor = str_replace('{valor}', $valor, $this->config->plantilla[ $nombre ]);\n\n\t\treturn $this->limpiar($valor);\n\t}", "public function genFilename()\n {\n $filename = $this->getAssetableType().$this->assetable_id.'_';\n $filename .= uniqid();\n if(!empty($this->getThumbnailType())) $filename .= '_'.$this->getThumbnailType();\n $filename .= '.'.$this->uploadedFile->extension;\n $this->filename = $filename;\n }", "function compilar_metadatos_generales()\n\t{\n\t\t$this->manejador_interface->titulo(\"Compilando datos generales\");\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\t$path = $this->get_dir_generales_compilados();\n\t\ttoba_manejador_archivos::crear_arbol_directorios( $path );\n\t\t$this->compilar_metadatos_generales_basicos();\n\t\t$this->compilar_metadatos_generales_grupos_acceso();\n\t\t$this->compilar_metadatos_generales_puntos_control();\n\t\t$this->compilar_metadatos_generales_mensajes();\n\t\t$this->compilar_metadatos_generales_dimensiones();\n\t\t$this->compilar_metadatos_generales_consultas_php();\n\t\t$this->compilar_metadatos_generales_servicios_web();\n\t\t$this->compilar_metadatos_generales_pms();\n\n\t}", "protected function filename()\n {\n return 'pagamentos';\n }", "public function actionGenerar() {\r\n // using the default layout 'protected/views/layouts/main.php'\r\n //$this->render('index');\r\n\r\n $this->generarTesis();\r\n $this->generarAdscripcion();\r\n $this->generarDirigido();\r\n $this->comprimir();\r\n $this->iniciarDescaga();\r\n }", "public function get_template_name(){\n\n return str_replace(\"_\",\"\",str_replace(\"_page\", \"\", get_class($this))) . \".tpl\";\n }", "function cl_tabrecregrasjm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tabrecregrasjm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "abstract public function getTemplateName();", "function crearPlantilla($datos);", "public function generate()\n {\n return parent::generate();\n }", "function gen_name($arg, $in){\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $name = '';\n for ($i = 0; $i < CONFIG_RANDOM_LENGTH; $i++) {\n $name .= $chars[mt_rand(0, 60)];\n }\n switch($arg){\n case 'random':\n return $name.'.'.$in;\n break;\n case 'custom_original':\n return $name.'_'.$in;\n break;\n }\n}", "function construir_id_def_base($nombre_fuente)\n\t{\n\t\treturn $this->get_instancia()->get_id().' '.$this->get_id().' '.$nombre_fuente;\n\t}", "function filets_creer_icone_barre($file, $num=-1) {\n\tstatic $icones_barre;\n\trep_icones_barre($icones_barre);\n\tdefine_IMG_GD_MAX_PIXELS();\n\t// la config \"Methode de fabrication des vignettes\" doit etre renseignee pour 'image_reduire'\n\tif($num<0) {\n\t\tlist($w) = @getimagesize($file);\n\t\t$file = filtrer('image_recadre', $file, floor($w/4), 40, '');\n\t\t$file = filtrer('image_reduire', $file, 19, 19);\n\t\t$file = filtrer('image_recadre', $file, 16, 16, 'left');\n\t} else {\n\t\t$file = image_typo(\"_{$num}_\", 'couleur=00BFFF', 'taille=9', 'police=dustismo.ttf');\n\t\t$file = filtrer('image_recadre', $file, 16, 10, 'bottom');\n\t}\n\t$nom = basename($src = extraire_attribut($file, 'src'));\n\t@copy($src, $icones_barre.$nom);\n\treturn $nom;\n}", "function d3jspie_generateur_autoriser(){}", "public function run() {\n $a = [\n 'Arquitectura',\n 'Historia',\n 'Moda y Diseño',\n 'Arte',\n 'Humor',\n 'Música',\n 'Cine',\n 'Ingeniería',\n 'Política',\n 'Investigación',\n 'Pueblos Originarios',\n 'Cocina',\n 'Deportes',\n 'Jardinería',\n 'Religión',\n 'Educación',\n 'Juegos y Entretenimientos',\n 'Sociología',\n 'Ensayos',\n 'Superación personal',\n 'Filosofía',\n 'Manualidades',\n 'Viajes',\n 'Fotografía',\n 'Mascotas',\n 'Guías de turismo',\n 'Maternidad',\n 'Literatura Infantil-juvenil',\n 'Literatura Internacional',\n 'Literatura Latinoamericana',\n 'Literatura Policial',\n 'Literatura de Suspenso',\n 'Literatura Ciencia Ficción',\n 'Poesía',\n 'Teatro',\n 'Comic',\n ];\n foreach ($a as $key => $item) {\n \\App\\Genero::create([\n 'idGenero' => $key + 1,\n 'descripcion' => $item,\n ]);\n }\n\n }", "function cl_tfd_bpamagnetico() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_bpamagnetico\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "abstract public function generate() : string;", "public function generate()\n{\n$user_code=\"{% extends 'resource.twig.c' %}\\n\".$this->user_code;\n\n$buf=$this->gen->renderer->render_string($this->filename,$user_code\n\t,array('resource' =>$this, 'global' => $this->gen));\n$this->gen->file_write($this->dest_filename,$buf);\n}", "public abstract function getCreator();", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "public function generate($name, array $parameters = array(), $absolute = false);", "function xh_templateMapping($name)\r\n\t{\r\n\t}", "public function generatorNameProvider()\n {\n return [[\"a string\"]];\n }", "public function crear()\n {\n //\n }", "public function get_name() {\n\t\treturn 'gastenboek';\n\t}", "function getName() \t\t { return 'NP_ImageCreateThumbnail'; }", "public function get_name() {\n\t\treturn 'MV Create';\n\t}", "public function gen_thumbnail()\n {\n }", "public function gen_thumbnail()\n {\n }", "private function nameReportFile(){\n $name= str_replace(' ','_',$this->nombrereporte).'_'.\n $this->id.'_'.h::userId().'_'.uniqid().'.'.$this->type;\n }", "public function getCreator();", "public function getCreator();", "function getTemplate();", "function getName() ;", "function getName() ;", "function getName() ;", "function getName() ;", "public function getTemplateName()\n {\n }", "function getNombreGenericoPrestacion($nombre) {\r\n switch ($nombre) {\r\n case 'INMU':\r\n $descr = \"INMUNIZACION\";\r\n break;\r\n case 'NINO':\r\n case 'NINO_PESO':\r\n $descr = \"CONTROL PEDIATRICO\";\r\n break;\r\n case 'ADOLESCENTE':\r\n $descr = \"CONTROL ADOLESCENTE\";\r\n break;\r\n case 'PARTO':\r\n $descr = \"CONTROL DEL PARTO\";\r\n break;\r\n case 'EMB':\r\n $descr = \"CONTROL DE EMBARAZO\";\r\n break;\r\n case 'ADULTO':\r\n $descr = \"CONTROL DE ADULTO\";\r\n break;\r\n case 'SEGUIMIENTO':\r\n $descr = \"SEGUIMIENTO\";\r\n break;\r\n case 'TAL':\r\n $descr = \"TAL\";\r\n break;\r\n }\r\n return $descr;\r\n}", "public function getCreator() {}", "public function specialization() {\n }", "function base_no_generator() { return ''; }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "function generate($name, $value, $attributes = array()){\r\n \t\t$this->init($name, $value, $attributes);\r\n\r\n \t\tif(!isset($this->attributes['class'])){\r\n\t\t\t$this->attributes['class'] = 'file_upload '.$name;\r\n\t\t}else{\r\n\t\t\t$this->attributes['class'] .= ' file_upload '.$name;\r\n\t\t}\r\n\t\t$perm = '';\r\n\t\tif(isset($this->attributes['perm'])){\r\n\t\t\t$perm = $this->attributes['perm']; unset($this->attributes['perm']);\r\n\t\t}\r\n\t\t$max = '';\r\n\t\tif(isset($this->attributes['max'])){\r\n\t\t\t$max = $this->attributes['max']; unset($this->attributes['max']);\r\n\t\t}\r\n\t\t$dir = '';\r\n\t\tif(isset($this->attributes['dir'])){\r\n\t\t\t$dir = $this->attributes['dir']; unset($this->attributes['dir']);\r\n \t\t}\r\n\t\t$tpl = BASIC::init()->ini_get('root_virtual').BASIC::init()->ini_get('basic_path').'scripts/svincs/controls/upload/skin.css';\r\n\t\tif(isset($this->attributes['template'])){\r\n\t\t\t$tpl = $this->attributes['template'];\r\n\t\t\tunset($this->attributes['template']);\r\n\t\t}\r\n\t\t$size = '';\r\n\t\tif(isset($this->attributes['size'])){\r\n\t\t\t$size = $this->attributes['size'];\r\n\t\t\tunset($this->attributes['size']);\r\n\t\t}\r\n \t\t$disabled = false;\r\n\t\tif(isset($this->attributes['disabled'])){\r\n\t\t\t$disabled = $this->attributes['disabled'];\r\n\t\t\tunset($this->attributes['disabled']);\r\n\t\t}\r\n\t\tBASIC_GENERATOR::init()->head('file_control','link','href='.$tpl);\r\n\r\n\t\tif(isset($this->attributes['rand'])) unset($this->attributes['rand']);\r\n\t\tif(isset($this->attributes['as'])) unset($this->attributes['as']);\r\n\r\n\t\tif(isset($this->attributes['onComplete'])) unset($this->attributes['onComplete']);\r\n\t\tif(isset($this->attributes['onDelete'])) unset($this->attributes['onDelete']);\r\n\t\tif(isset($this->attributes['onError'])) unset($this->attributes['onError']);\r\n\r\n \t\t$tmp = BASIC_GENERATOR::init()->createCloseTag('input', 'type=file|class=control|name='.$name.'|id='.$name.'|'.($disabled ? 'disabled=disabled|' : '').'title=types:'.$perm.' max:'.$max.($size ? '|size='.$size : ''));\r\n\t\t\r\n\t\tif(isset($this->attributes['delete_btn']) && isset($this->attributes['delete_btn']['text']) && $value){\r\n\t\t $delete_btn = BASIC_GENERATOR::init()->convertStringAtt($this->attributes['delete_btn']);\r\n\t\t $text = $delete_btn['text']; \r\n\t\t \r\n\t\t unset($delete_btn['text']);\r\n\t\t unset($this->attributes['delete_btn']);\r\n\t\t \r\n\t\t\tif($disabled){\r\n\t\t \t$delete_btn['disabled'] = 'disabled';\r\n\t\t \t$delete_btn['href'] = '#';\r\n\t\t }\r\n\t\t $tmp .= BASIC_GENERATOR::init()->createTag('a', $delete_btn, $text);\r\n\t\t}\r\n \t \tif(isset($this->attributes['upload_btn']) && $value){\r\n\t\t $btn = BASIC_GENERATOR::init()->convertStringAtt($this->attributes['upload_btn']);\r\n\t\t $text = $btn['text']; \r\n\t\t \r\n\t\t unset($btn['text']);\r\n\t\t unset($this->attributes['upload_btn']);\r\n\t\t \r\n\t\t if($disabled){\r\n\t\t \t$btn['disabled'] = 'disabled';\r\n\t\t \t$btn['href'] = '#';\r\n\t\t }else{\r\n\t\t \t$btn['href'] = BASIC::init()->ini_get('root_virtual').$dir.$value;\r\n\t\t }\r\n\t\t \r\n\t\t $tmp .= BASIC_GENERATOR::init()->createTag('a', $btn, $text);\r\n\t\t}\r\n\t\tif(isset($this->attributes['preview']) && $this->attributes['preview'] && $value){\r\n\t\t\t$ex = explode(\",\",$this->attributes['preview']);\r\n\t\t\t$t = BASIC_GENERATOR::init()->image($value, ($dir ? '|folder='.$dir : '').\r\n\t\t\t\t(isset($ex[0]) ? '|width='.$ex[0] : '').\r\n\t\t\t\t(isset($ex[1]) ? '|height='.$ex[1] : ''));\r\n\t\t\t\t\r\n\t\t\tif($t) $tmp .= BASIC_GENERATOR::init()->create('div', 'class=window', $t);\r\n\t\t\tunset($this->attributes['preview']);\r\n\t\t}\r\n\t\t//$tmp .= $GLOBALS['BASIC_PAGE']->input(\"hidden\",$name.\"_old\",$value,'id='.$name.'_old');\r\n\r\n\t\treturn BASIC_GENERATOR::init()->create('div', $this->attributes, $tmp);\r\n \t}", "function hl_create_batch( ) { \r\n \r\n include( plugin_dir_path( __FILE__ ) . 'metabox-template.php');\r\n}", "function getNameHelper(){\n\treturn 'Ejercicio de aprendizaje';\n}", "function onGenerate()\n {\n try\n {\n TTransaction::open('permission');\n \n $object = $this->form->getData();\n \n $repository = new TRepository('Hardware');\n\n $criteria = new TCriteria;\n if ($object->secao)\n {\n $criteria->add(new TFilter('secao', 'like', \"%{$object->secao}%\"));\n }\n if ($object->descricao)\n {\n $criteria->add(new TFilter('descricao', 'like', \"%{$object->descricao}%\"));\n }\n\n if ($object->om)\n {\n $criteria->add(new TFilter('om', '=', \"{$object->om}\"));\n }\n \n \n $order = isset($param['order']) ? $param['order'] : 'id'; \n $criteria ->setProperty('order', $order); \n \n $hard = $repository->load($criteria);\n \n $format = $object->output_type;\n // print_r($militar);\n if ($hard)\n { \n $widths = array(25,30,30,40,40,40,30,60,60,60,70,80,150,50);\n \n switch ($format)\n {\n case 'html':\n $tr = new TTableWriterHTML($widths);\n break;\n case 'pdf':\n //alterei o parametro da classe para L paisagem\n $tr = new TTableWriterPDF($widths,'L');\n break;\n case 'rtf':\n if (!class_exists('PHPRtfLite_Autoloader'))\n {\n PHPRtfLite::registerAutoloader();\n }\n $tr = new TTableWriterRTF($widths);\n break;\n }\n \n if (!empty($tr))\n {\n // create the document styles\n $tr->addStyle('title', 'Arial', '6', '', '#d3d3d3', '#407B49');\n $tr->addStyle('datap', 'Arial', '6', '', '#000000', '#869FBB');\n $tr->addStyle('datai', 'Arial', '6', '', '#000000', '#ffffff');\n $tr->addStyle('header', 'Times', '12', '', '#000000', '#B5FFB4');\n $tr->addStyle('footer', 'Times', '6', '', '#2B2B2B', '#B5FFB4');\n \n // add a header row\n $tr->addRow();\n $tr->addCell('Relatório Materiais DTI 2017', 'center', 'header', 40);\n \n // add titles row\n $tr->addRow();\n $tr->addCell('OR', 'center', 'title');\n $tr->addCell('ID', 'center', 'title');\n $tr->addCell('DTI', 'center', 'title');\n $tr->addCell('PATR.', 'center', 'title');\n $tr->addCell('FICHA', 'center', 'title');\n $tr->addCell('Nr.Série.', 'center', 'title');\n $tr->addCell('DIEx', 'center', 'title');\n $tr->addCell('TREM', 'center', 'title');\n $tr->addCell('BOL', 'center', 'title');\n $tr->addCell('OM', 'center', 'title');\n $tr->addCell('SEÇÃO', 'center', 'title');\n $tr->addCell('MARCA', 'center', 'title');\n //$tr->addCell('MODELO', 'center', 'title');\n $tr->addCell('DESCRIÇÃO', 'center', 'title');\n $tr->addCell('DATA', 'center', 'title');\n\n $colour= FALSE;\n $i=0;\n foreach ($hard as $fer)\n {\n $i++;\n // $style = $colour ? 'datap' : 'datai';\n $style = 'datai';\n $tr->addRow();\n $tr->addCell($i, 'center', $style);\n $tr->addCell($fer->id, 'center', $style);\n $tr->addCell($fer->dti, 'center', $style);\n $tr->addCell($fer->patrimonio, 'center', $style);\n $tr->addCell($fer->ficha, 'center', $style);\n $tr->addCell($fer->nrSerie, 'center', $style);\n $tr->addCell($fer->diex, 'center', $style);\n $tr->addCell($fer->trem, 'center', $style);\n $tr->addCell($fer->boletim, 'center', $style);\n $tr->addCell($fer->om, 'center', $style);\n $tr->addCell($fer->secao, 'center', $style);\n $tr->addCell($fer->marca, 'center', $style);\n // $tr->addCell($fer->modelo, 'center', $style);\n $tr->addCell($fer->descricao, 'center', $style);\n $tr->addCell($fer->dataHard, 'center', $style);\n\n $colour = !$colour;\n }\n \n $tr->addRow();\n $tr->addCell(date('Y-m-d h:i:s'), 'center', 'footer', 15);\n if (!file_exists(\"app/output/dispositivo.{$format}\") OR is_writable(\"app/output/dispositivo.{$format}\"))\n {\n $tr->save(\"app/output/dispositivo.{$format}\");\n }\n else\n {\n throw new Exception(_t('Permission denied') . ': ' . \"app/output/dispositivo.{$format}\");\n }\n \n parent::openFile(\"app/output/dispositivo.{$format}\");\n \n new TMessage('info', 'Relatório gerado. Habilite o popup no seu navegador.');\n }\n }\n else\n {\n new TMessage('error', 'Dispositivo não encontrado');\n }\n \n $this->form->setData($object);\n \n TTransaction::close();\n }\n catch (Exception $e) \n {\n new TMessage('error', '<b>Error</b> ' . $e->getMessage());\n \n TTransaction::rollback();\n }\n }", "abstract public function getTypeName(): string;", "public function create($name){\n $query = $this->getDb()->prepare('INSERT INTO genero (name) VALUES (?)');\n $result= $query->execute([$name]);\n return $result;\n }", "public function getTemplateName(): string;", "abstract public function getTemplate();", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "abstract public function getTypeName();", "public function isGenerate();", "public function generos(){\n\t\t$gen = $this->request->getPost();\n\t\t$genero = strtoupper($gen['genero']);\n\t\t//dd($genero);\n\n\t\t//Construção da consulta por genero\n\t\t$db = \\Config\\Database::connect();\n\t\t$builder = $db->table('livros');\n\n\t\t$builder->select('livros.id,livros.imagem\"imagem\", livros.titulo\"titulo\", autores.nome\"autor\", livros.descricao\"descricao\"', FALSE);\n\t\t$builder->join('genero_livro', 'genero_livro.id_livro = livros.id')\n\t\t\t\t->join('generos', 'generos.id = genero_livro.id_genero')\n\t\t\t\t->join('autores_livros', 'autores_livros.id_livro = livros.id')\n\t\t\t\t->join('autores', 'autores.id = autores_livros.id_autor');\n\n\t\t$builder->where('generos.nome',$genero);\n\t\t$query = $builder->get();\n\t\t$resultado = $query->getResultArray();\n\t\t//dd($resultado);\n\t\t\n\t\t//Autores mostrados por padrão\n\t\t$autoresmodel = model('AutorModel');\n\t\t$autores = $autoresmodel->findAll();\n\n\t\t//Variaveis setadas para compatibilidade no reaproveitamento de Home\n\t\t$livros = $resultado;\n\t\t$session = session();\n\t\t$dados = [\n\t\t\t'autores' => $autores,\n\t\t\t'livros' => $livros,\n\t\t\t'session' => $session\n\t\t];\n\n\t\techo view('home',$dados);\n\t}", "public function getName()\n {\n return 'HiQDev General Use Yii 2 Extension Generator';\n }", "public static function pgenerate($system, $parts) {\n\t\t\t// Create a Builder object.\n \t\t$generator = new Generator();\n \t\n \t\t// Get the class name (singular) and function name (plural) from \n\t \t\t// the object map.\n\t \t\t$object_map = Parsel::get_object_map();\n\t\t\tif (array_key_exists($parts['object'], $object_map)) {\n\t\t\t\t$notes['function_obj'] = $object_map[$parts['object']];\n\t\t\t\t$notes['class_name'] = ucwords($parts['object']);\n\t\t\t} else if (in_array($parts['object'], $object_map)) {\n\t\t\t\t$notes['function_obj'] = $parts['object'];\n\t\t\t\t$notes['class_name'] = ucwords(array_search($parts['object'], $object_map));\n\t\t\t}\n\t\t\t\n\t\t\t// Make the function call name.\n\t\t\t$function = \"generate_\" . $parts['object'];\n \t\n \t\t$contents = $generator->{$function}($parts, $system);\n \t\t\n \t\treturn $contents;\n \t}", "private function cargarGuion() {\n\t\t\t$pl = $this->Modelo->consultaPlantilla('MATRIZ', 'TRIPLEPLAY', 'PRIORIDAD '.$this->peticion->post->obtener('PRIORIDAD'));\n\t\t\t\n\t\t\t$plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t$plantilla->Parametro('Datos', $this->peticion->post->obtener());\n\t\t\t$plantilla->Parametro('plantilla', $pl['PLANTILLA']);\n\t\t\t\n\t\t\t$this->peticion->post->crear('GUION', $plantilla->MostrarPlantilla('TriplePlay', 'ajaxProcesoPlantilla.html'));\n\t\t\t$fecha = explode('/', $this->peticion->post->obtener('HORAFIN'));\n\t\t\t$this->peticion->post->reemplazar('HORAFIN', trim($fecha[0]));\n\t\t\t\n\t\t\t$this->procesar();\n\t\t}", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "function cl_inicialnumpre() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"inicialnumpre\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function generar(){\n if (!$this->ordenante instanceof bancfiles_n34_ordenante) {\n\n throw new Bancfiles_Exception('Ordenante no existente');\n }\n \n // si no hi ha beneficiaris llancem una excepcio\n if ( ($this->linies_diez = count($this->beneficiarios)) ==0) {\n\n throw new Bancfiles_Exception('Beneficiarios == 0');\n }\n \n $this->buffer = $this->ordenante->generar_cap()\n .$this->ordenante->generar_nombre()\n .$this->ordenante->generar_domicilio()\n .$this->ordenante->generar_plaza();\n \n foreach ($this->beneficiarios as $beneficiario){\n \n $this->buffer = $this->buffer\n .$beneficiario->generar_registre10($this->ordenante->nif)\n .$beneficiario->generar_registre11($this->ordenante->nif);\n \n \n } \n \n // 4 del ordenant\n // 1 totals\n // 2 per cada beneficiari\n $this->linies = 5+(count($this->beneficiarios)<<1);\n\n $this->buffer .= $this->generar_totals();\n \n return $this;\n }", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "private function generate()\n\t{\n//\t\t$arrContrato = $contrato->getContratoPorTipoDeObjeto(true, 'P');\n\n\t\t$unidade = new Unidade();\n\t\t$arrUnidade = $unidade->getUnidade(true);\n\t\t\n\t\t$this->setName('projeto_previsto');\n\t\t$this->addDecorator('HtmlTag', array('tag'=>'div', 'class'=>'span-14'));\n\n\t\t$cd_contrato = new Base_Form_Element_Select('cd_contrato_projeto_previsto', array('class'=>'span-5 float-l'));\n\t\t$cd_contrato->setLabel(Base_Util::getTranslator('L_VIEW_CONTRATO').':')\n\t\t->addDecorator('Label', array('class'=>'float-l span-3 right'))\n\t\t->setRegisterInArrayValidator(false)\n\t\t->setRequired(true);\n//\t\t$cd_contrato->addMultiOptions($arrContrato);\n\n\t\t$cd_unidade = new Base_Form_Element_Select('cd_unidade_projeto_previsto', array('class'=>'span-5 float-l'));\n\t\t$cd_unidade->setLabel(Base_Util::getTranslator('L_VIEW_UNIDADE').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRegisterInArrayValidator(false)\n\t\t->setRequired(true);\n\t\t$cd_unidade->addMultiOptions($arrUnidade);\n\t\t\n\t\t$cd_projeto_previsto = new Base_Form_Element_Hidden('cd_projeto_previsto');\n\t\t$tx_projeto_previsto = new Base_Form_Element_Text('tx_projeto_previsto', array('class'=>'span-10 float-l'));\n\t\t$tx_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_PROJETO_PREVISTO').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRequired(true)\n\t\t->addFilter('StripTags')\n\t\t->addFilter('StringTrim')\n\t\t->addValidator('NotEmpty');\n\n\t\t$ni_horas_projeto_previsto = new Base_Form_Element_SoNumero('ni_horas_projeto_previsto', array('class'=>'span-2 float-l'));\n\t\t$ni_horas_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_UNID_METRICA_PREVISTA').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRequired(true)\n\t\t->addFilter('StripTags')\n\t\t->addFilter('StringTrim')\n\t\t->addValidator('NotEmpty');\n\n\t\t$objDefinicaoMetrica = new DefinicaoMetrica();\n\t\t$arrSiglaMetrica\t = $objDefinicaoMetrica->getComboSiglaDefinicaoMetrica(true);\n\n\t\t$cd_metrica_unidade_prevista_projeto_previsto = new Base_Form_Element_Select('cd_metrica_unidade_prevista_projeto_previsto', array('class'=>'float-l span-3'));\n\t\t$cd_metrica_unidade_prevista_projeto_previsto->addMultiOptions($arrSiglaMetrica)\n\t\t->setLabel('&nbsp;')\n\t\t->addDecorator('Label', array('class'=>'float-l right lb_combo_sigla_metrica_unidade_prevista_projeto_previsto', 'style'=>'margin-left: 5px;'))\n\t\t->addDecorator('HtmlTag', array('tag'=>'div', 'class'=>'float-l', 'style'=>'height:27px;'))\n\t\t->setRequired(true)\n ->setRegisterInArrayValidator(false);\n\n\t\t$arrProjetoPrevisto = array();\n\t\t$arrProjetoPrevisto['0'] = Base_Util::getTranslator('L_VIEW_COMBO_SELECIONE');\n\t\t$arrProjetoPrevisto['E'] = Base_Util::getTranslator('L_VIEW_COMBO_EVOLUTIVO');\n\t\t$arrProjetoPrevisto['N'] = Base_Util::getTranslator('L_VIEW_COMBO_NOVO');\n\t\t\n\t\t$st_projeto_previsto = new Base_Form_Element_Select('st_projeto_previsto', array('class'=>'span-5 float-l'));\n\t\t$st_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_TIPO_PROJETO').':')\n\t\t->addDecorator('Label', array('class'=>'span-3 float-l clear-l right'))\n\t\t->setRegisterInArrayValidator(false)\n\t\t->setRequired(true);\n\t\t$st_projeto_previsto->addMultiOptions($arrProjetoPrevisto);\n\t\t\n\t\t$tx_descricao_projeto_previsto = new Base_Form_Element_Textarea('tx_descricao_projeto_previsto', array('class'=>'span-14 height-4 float-l'));\n\t\t$tx_descricao_projeto_previsto->setLabel(Base_Util::getTranslator('L_VIEW_DESCRICAO').':')\n\t\t->addDecorator('Label', array('class'=>'float-l span-3 right'))\n\t\t->addDecorator('HtmlTag', array('tag'=>'div', 'class'=>'span-22 float-l clear gap-1'))\n\t\t->addFilter('StripTags')\n\t\t->addFilter('StringTrim')\n\t\t->addValidator('NotEmpty');\t\t\t\t\t\t\n\t\t\n\t\t$this->addElements(array(\n\t\t\t\t\t\t\t\t$cd_projeto_previsto, \n\t\t\t\t\t\t\t\t$cd_contrato, \n\t\t\t\t\t\t\t\t$cd_unidade, \n\t\t\t\t\t\t\t\t$st_projeto_previsto,\n\t\t\t\t\t\t\t\t$tx_projeto_previsto, \n\t\t\t\t\t\t\t\t$ni_horas_projeto_previsto,\n\t\t\t\t\t\t\t\t$cd_metrica_unidade_prevista_projeto_previsto,\n\t\t\t\t\t\t\t\t$tx_descricao_projeto_previsto));\n\t}", "public function name() {\n\t}", "function cl_iptuconstr() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"iptuconstr\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function getGenerator();" ]
[ "0.68896645", "0.63604033", "0.63604033", "0.6288497", "0.61351603", "0.60931784", "0.6079481", "0.6051827", "0.6017751", "0.6016149", "0.599975", "0.599975", "0.599975", "0.599975", "0.599975", "0.5987284", "0.59772784", "0.59772784", "0.5977267", "0.5977267", "0.5977267", "0.5977267", "0.5977267", "0.59210575", "0.58180195", "0.5808568", "0.5782323", "0.57218194", "0.5713859", "0.56839764", "0.565172", "0.56409127", "0.5639136", "0.56288725", "0.560273", "0.5601874", "0.5593111", "0.5590349", "0.5584669", "0.5553559", "0.5548725", "0.5534213", "0.5530527", "0.5524868", "0.5515209", "0.55092496", "0.5507509", "0.549052", "0.54899955", "0.5489977", "0.54865825", "0.54710317", "0.5466022", "0.5460846", "0.5452505", "0.5445723", "0.544563", "0.5442496", "0.54325145", "0.5430941", "0.5430941", "0.5427869", "0.5409556", "0.5409556", "0.54048586", "0.540345", "0.540345", "0.540345", "0.540345", "0.5400154", "0.5396248", "0.53920865", "0.5391148", "0.53899205", "0.5382291", "0.53788877", "0.53786623", "0.537453", "0.53712046", "0.5371167", "0.5367252", "0.5365023", "0.5359989", "0.5348914", "0.5348914", "0.5348914", "0.5348914", "0.53366816", "0.53294945", "0.5326781", "0.53267074", "0.53215486", "0.5320241", "0.53117865", "0.5305408", "0.53006077", "0.5300206", "0.5295293", "0.5287463", "0.52857864", "0.5285748" ]
0.0
-1
A plugin's visitors should not override visit() unless they need to.
public function visitBinaryOp(Node $node): Context { // get the types of left and right values $left_node = $node->children['left']; $left_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $left_node); $right_node = $node->children['right']; $right_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $right_node); // non numerical values are not allowed in the operator equal(==, !=) if (in_array($node->flags, self::BINARY_EQUAL_OPERATORS, true)) { if (!$left_type->isNonNullNumberType() && !$right_type->isNonNullNumberType()) { $this->emit( 'PhanPluginNumericalComparison', "non numerical values compared by the operators '==' or '!='", [] ); } // numerical values are not allowed in the operator identical('===', '!==') } elseif (in_array($node->flags, self::BINARY_IDENTICAL_OPERATORS, true)) { if ($left_type->isNonNullNumberType() || $right_type->isNonNullNumberType()) { // TODO: different name for this issue type? $this->emit( 'PhanPluginNumericalComparison', "numerical values compared by the operators '===' or '!=='", [] ); } } return $this->context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acceptVisitor(Visitee $visitee_in, Visitor $visitor_in) {\n $visitee_in->accept($visitor_in);\n}", "public function visit(Node $n) {\n parent::visit($n);\n }", "public function visit(NodeInterface $node);", "public function accept($visitor){\n\n if( $this->features ){\n $this->features = $visitor->visitObj($this->features);\n }\n $this->path = $visitor->visitObj($this->path);\n\n if( !$this->options['inline'] && $this->root ){\n $this->root = $visitor->visit($this->root);\n }\n }", "function Visit(IVisitorAcceptor $acceptor);", "public function visit($v);", "public function getNodeVisitors();", "public function visit(Book $book);", "public function AcceptVisitor($visitor)\n\t {\n\t $visitor->VisitFunction($this);\n\t }", "public function isVisitante(){ return false; }", "public function setVisitor($value) {\n\t\t$this->visitor = $value;\n\t}", "public function accept(/*mixed*/ $visitor) /*: mixed*/ {\n if (method_exists($visitor, \"visitFunctionData\")) {\n // UNSAFE\n return $visitor->visitFunctionData($this);\n }\n if ($this->getContainingNamespace() !== null) {\n if (method_exists($visitor, \"visitINamespaceMember\")) {\n // UNSAFE\n return $visitor->visitINamespaceMember($this);\n }\n }\n if ($this->getContainingType() !== null) {\n if (method_exists($visitor, \"visitITypeMember\")) {\n // UNSAFE\n return $visitor->visitITypeMember($this);\n }\n }\n if (method_exists($visitor, \"visitINamedNode\")) {\n // UNSAFE\n return $visitor->visitINamedNode($this);\n }\n // UNSAFE\n return $visitor->visitNode($this);\n }", "function Plugin()\n\t{\n\t\t$this->Plugin_Base();\n\t}", "public function postConnect()\n {\n $this->Lexer->addExitPattern('</' . self::getElementName() . '>', 'plugin_' . webcomponent::PLUGIN_NAME . '_' . $this->getPluginComponent());\n\n }", "public function testVisitorAccept()\n {\n $class = new PHP_Depend_Code_Class('clazz', 0);\n $visitor = new PHP_Depend_Visitor_TestNodeVisitor();\n\n $class->accept($visitor);\n $this->assertSame($class, $visitor->class);\n \n }", "function plugin_sandbox_scrape($plugin)\n {\n }", "public function visit(ItemInterface $item);", "abstract public function pluginDetails();", "protected function initializePlugin(): void {\n throw new \\Exception(\"Derivatives need to implement ::initializePlugin().\");\n }", "abstract function is_plugin();", "public function getNodeVisitors()\n {\n return array(new Twig_NodeVisitor_Escaper());\n }", "function plugin_action_handler( $plugin='' ) {\n\t\t$this->add_ping( 'plugins', array( 'name' => $plugin ) );\n\t}", "function get_plugin_page_hook($plugin_page, $parent_page)\n {\n }", "public function baseVisitorProvider()\n {\n return [\n 'guest' => ['guest', false],\n 'user' => ['user', true],\n ];\n }", "abstract public function register_plugin();", "public function mustVisit(ItemInterface $item);", "public function AcceptVisitor($visitor)\n\t\t{\n\t\t\t$visitor->VisitBinary($this);\n\t\t}", "function defaultHandler($parser, $data) {\n // virtual\n }", "public function accept(/*mixed*/ $visitor) /*: mixed*/ {\n if (method_exists($visitor, \"visitSourceRevision\")) {\n // UNSAFE\n return $visitor->visitSourceRevision($this);\n } else {\n return null;\n }\n }", "function og_views_extra_views_plugins() {\n return array(\n 'access' => array(\n 'group_member' => array(\n 'title' => t('Group Membership'),\n 'help' => t('Member of the current organic group'),\n 'handler' => 'og_views_extra_plugin_access_group_member',\n 'help topic' => 'access-none',\n 'uses options' => TRUE,\n ),\n )\n );\n}", "public function accept(){\n \n }", "abstract protected function before();", "public function __invoke() {\n\t\t// Register hooks for the group if part of group\n\t\tif ( null !== $this->group ) {\n\t\t\t$this->group->load( $this->group, $this->page );\n\t\t}\n\n\t\t$this->page->load( $this->page );\n\t}", "abstract protected function yieldWhitelistAccess(): Generator;", "public function show(Visitor $visitor)\n {\n //\n }", "public function visitorProvider()\n {\n return [\n 'guest' => ['guest', collect()],\n 'user' => ['user', collect(['auth'])],\n 'author' => ['author', collect(['auth', 'author', 'stuff'])],\n 'admin' => ['admin', collect(['auth', 'admin', 'stuff'])],\n ];\n }", "public function accept();", "protected function sayHello()\n {\n // Plugin functionality\n }", "abstract protected function activate_plugin();", "function Doku_Event_Handler() {\n\n // load action plugins\n $plugin = NULL;\n $pluginlist = plugin_list('action');\n\n foreach ($pluginlist as $plugin_name) {\n $plugin =& plugin_load('action',$plugin_name);\n\n if ($plugin !== NULL) $plugin->register($this);\n }\n }", "protected abstract function before();", "public function getNodeVisitors()\n {\n return array();\n }", "public function getNodeVisitors()\n {\n return array();\n }", "public function plugin_construction() {\t\r\n\t\r\n\t}", "public function testPlugin(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->plugin('DebugKit', function (RouteBuilder $routes): void {\n $this->assertSame('/debug-kit', $routes->path());\n $this->assertEquals(['plugin' => 'DebugKit'], $routes->params());\n });\n }", "public function isVisitor()\n {\n return $this->isVisitor;\n }", "public function hasVisit(){\n return $this->_has(2);\n }", "private function public_hooks()\n\t{\n\t}", "public function visitEnter(NodeInterface $node);", "public function addVisitor(\\PHPParser_NodeVisitor $visitor)\n {\n $this->parentVisitors[] = $visitor;\n }", "function yy_accept()\n {\n if (self::$yyTraceFILE) {\n fprintf(self::$yyTraceFILE, \"%sAccept!\\n\", self::$yyTracePrompt);\n }\n while ($this->yyidx >= 0) {\n $stack = $this->yy_pop_parser_stack();\n }\n /* Here code is inserted which will be executed whenever the\n ** parser accepts */\n }", "public function onConvertedVisit(Request $request, Visitor $visitor, $action)\n {\n return false;\n }", "public function discover () {\n\t\techo \"They can only discover\";\n\t}", "function Plugin_Base()\n\t{\n\t\t// $web may actually be null if this is a page plugin loaded from\n\t\t// the commandline execution profile.\n\t\t$this->web =& Registry::get('pronto:web');\n\t\t$this->depends = new stdClass;\n\n\t\tif(method_exists($this, '__init__')) {\n\t\t\t$this->__init__();\n\t\t}\n\t}", "public function init_plugin()\n {\n }", "abstract function is_live();", "public function visit ( \\r8\\iface\\Form\\Visitor $visitor )\n {\n $visitor->file( $this );\n }", "public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)\n {\n if ($this->extensionInitialized) {\n throw new LogicException('Unable to add a node visitor as extensions have already been initialized.', $extension->getName());\n }\n $this->staging->addNodeVisitor($visitor);\n }", "abstract function before();", "public function accept($item);", "function test_plugin_hooks_into_wordpress()\n {\n $events = array(\n 'wp_title',\n 'the_title',\n 'the_title_rss',\n 'the_excerpt',\n 'the_excerpt_rss',\n 'the_content'\n );\n $enzymes = EnzymesPlugin::engine();\n foreach ($events as $event) {\n $this->assertEquals(10, has_filter($event, array($enzymes, 'metabolize')),\n \"Enzymes didn't attach to '$event'.\");\n }\n }", "public function _post_filter()\n {\n }", "protected function init() {\n // Provides info to parent class, so do it early.\n if (is_admin() ) {\n $this->pluginAdmin = new Yfp_Ganalytics_Basic_Admin(__FILE__);\n }\n else {\n $this->pluginCommon = new Yfp_Ganalytics_Basic_Common();\n\n // Don't track if we aren't enabled.\n if ($this->pluginCommon->optIsEnabled()) {\n // The location of the code depends on the inHead option.\n add_action(\n $this->pluginCommon->optInHead() ? self::TOP_HOOK : self::BOTTOM_HOOK,\n array($this, 'insert_js_code')\n );\n }\n else {\n // Add a comment so we can tell the plugin is functioning, but disabled.\n add_action(\n $this->pluginCommon->optInHead() ? self::TOP_HOOK : self::BOTTOM_HOOK,\n array($this, 'disabled_message')\n );\n }\n }\n }", "public function plugin_info()\n {\n }", "public function testClientsPageAsVisitor() {\n\n $this->visit('/clients')\n ->seePageIs('/login');\n\n }", "public function onExistingVisit(Request $request, Visitor $visitor, $action)\n {\n return false;\n }", "public function isVisited($v);", "protected function registered()\n {\n //\n }", "public function plugin(){\r\n\t$args=func_get_args();\r\n\t$plugin_name=$args[0];\r\n\t$plugin_method=$args[1];\r\n\t$plugin_method_args = array_slice($args, 2);\r\n\tPlugins::instance()->Base=$this;\r\n\t$response=Plugins::instance()->call_method($plugin_name, $plugin_method, $plugin_method_args);\r\n\t$this->response($response);\r\n }", "function stanford_subsites_views_plugins() {\n $plugins = array();\n $plugins['argument validator'] = array(\n 'subsite' => array(\n 'title' => t('Active Subsite'),\n 'handler' => 'views_plugin_argument_validate_subsite',\n ),\n );\n\n $plugins['argument default'] = array(\n 'subsite' => array(\n 'title' => t('Active Subsite'),\n 'handler' => 'views_plugin_argument_default_subsite',\n ),\n );\n\n return $plugins;\n}", "function wp_dashboard_plugins()\n {\n }", "function piHandler($parser, $target, $data) {\n // virtual\n }", "public function visitor()\n {\n $this->template = 'display';\n $menu = [];\n $this->set('menu', $menu);\n }", "function CheckVisitor(){\r\n\t\t// check banned IP addresses before serving webpage of any type\r\n\t\tif (BAN_IP_ADDRESSES == \"on\"){\r\n\t\t\t$this->check_IP_ban_list();\r\n\t\t}\r\n\r\n\t\t// maintenance mode detection\r\n\t\t$this_page_name = $_SERVER['PHP_SELF'];\r\n\t\tif (MAINTENANCE_MODE == \"on\" && $this_page_name != MAINTENANCE_MODE_PAGE)\r\n\t\t{\r\n\t\t\t$found = 0;\r\n\t\t\twhile (list ($key, $val) = each ($this->_maintenance_allow_ip)) {\r\n\t\t\t\tif ($this->checkIPorRange($val)) {\r\n\t\t\t\t\t$found = 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!$found){\r\n\t\t\t\tinclude(DIR_SERVER_ROOT.\"htdocs/\".MAINTENANCE_MODE_PAGE);\r\n\t\t\t\texit();\r\n\t\t \t}\r\n\t\t}\r\n\t}", "abstract public function handler() : void;", "public function should_allow_adding_a_visitor(): void\n {\n $hash = md5(microtime());\n $dir = codecept_output_dir('dir_' . $hash);\n mkdir($dir);\n $fileOne = $dir . '/fileOne';\n $fileTwo = $dir . '/fileTwo';\n $fileThree = $dir . '/fileThree';\n $fileOneContents = 'I am file one';\n file_put_contents($fileOne, $fileOneContents);\n $fileTwoContents = <<< TXT\nI am file two.\nA multiline file.\nWith a generated, time-dependant hash.\n// [HASH] $hash\nTXT;\n file_put_contents($fileTwo, $fileTwoContents);\n file_put_contents($fileThree, 'Just a normal file.');\n $dataVisitor = static function ($expected, $current, $pathName): array {\n if (strpos($pathName, 'fileOne')) {\n // Empty file one.\n return [[], []];\n }\n\n if (strpos($pathName, 'fileTwo')) { // Remove the hash line in file two.\n $removeHashLine = static function ($line): bool {\n return !preg_match('/\\\\/\\\\/\\\\s*\\\\[HASH].*$/uim', $line);\n };\n return [\n array_filter($expected, $removeHashLine),\n array_filter($current, $removeHashLine)\n ];\n }\n\n return [$expected, $current];\n };\n\n $firstSnapshot = new DirectorySnapshot($dir);\n $firstSnapshot->setDataVisitor($dataVisitor);\n $snapshotFileName = $firstSnapshot->snapshotFileName();\n $this->unlinkAfter[] = $snapshotFileName;\n $firstSnapshot->assert();\n\n // Now update the hash in file two.\n $newHash = md5(microtime());\n $this->assertNotEquals($hash, $newHash);\n $fileTwoContents = <<< TXT\nI am file two.\nA multiline file.\nWith a generated, time-dependant hash.\n// [HASH] $newHash\nTXT;\n file_put_contents($fileTwo, $fileTwoContents);\n\n $secondSnapshot = new DirectorySnapshot($dir);\n $secondSnapshot->setSnapshotFileName($snapshotFileName);\n $secondSnapshot->setDataVisitor($dataVisitor);\n $secondSnapshot->assert();\n\n // Expect the test to fail when the data visitor is not used.\n $this->expectException(AssertionFailedError::class);\n\n $failingSnapshot = new DirectorySnapshot($dir);\n $failingSnapshot->setSnapshotFileName($snapshotFileName);\n $failingSnapshot->assert();\n }", "function tb_onPluginActivate() {\r\n add_option('tagBeep_redirect_to_plugin', 'true');\r\n}", "protected function _post_render() {\n\t\n\t\t// Silence is golden\n\t\n\t}", "public function recognize()\n {\n $this->setIsVisitorKnown(false);\n\n $configId = $this->configId;\n\n $idVisitor = $this->request->getVisitorId();\n $isVisitorIdToLookup = !empty($idVisitor);\n\n if ($isVisitorIdToLookup) {\n $this->visitorInfo['idvisitor'] = $idVisitor;\n Common::printDebug(\"Matching visitors with: visitorId=\" . bin2hex($this->visitorInfo['idvisitor']) . \" OR configId=\" . bin2hex($configId));\n } else {\n Common::printDebug(\"Visitor doesn't have the piwik cookie...\");\n }\n\n $selectCustomVariables = '';\n // No custom var were found in the request, so let's copy the previous one in a potential conversion later\n if (!$this->customVariables) {\n $maxCustomVariables = CustomVariables::getMaxCustomVariables();\n\n for ($index = 1; $index <= $maxCustomVariables; $index++) {\n $selectCustomVariables .= ', custom_var_k' . $index . ', custom_var_v' . $index;\n }\n }\n\n $persistedVisitAttributes = self::getVisitFieldsPersist();\n array_unshift($persistedVisitAttributes, 'visit_first_action_time');\n array_unshift($persistedVisitAttributes, 'visit_last_action_time');\n $persistedVisitAttributes = array_unique($persistedVisitAttributes);\n\n $selectFields = implode(\", \", $persistedVisitAttributes);\n\n $select = \"SELECT\n $selectFields\n $selectCustomVariables\n \";\n $from = \"FROM \" . Common::prefixTable('log_visit');\n\n list($timeLookBack, $timeLookAhead) = $this->getWindowLookupThisVisit();\n\n $shouldMatchOneFieldOnly = $this->shouldLookupOneVisitorFieldOnly($isVisitorIdToLookup);\n\n // Two use cases:\n // 1) there is no visitor ID so we try to match only on config_id (heuristics)\n // \t\tPossible causes of no visitor ID: no browser cookie support, direct Tracking API request without visitor ID passed,\n // importing server access logs with import_logs.py, etc.\n // \t\tIn this case we use config_id heuristics to try find the visitor in tahhhe past. There is a risk to assign\n // \t\tthis page view to the wrong visitor, but this is better than creating artificial visits.\n // 2) there is a visitor ID and we trust it (config setting trust_visitors_cookies, OR it was set using &cid= in tracking API),\n // and in these cases, we force to look up this visitor id\n $whereCommon = \"visit_last_action_time >= ? AND visit_last_action_time <= ? AND idsite = ?\";\n $bindSql = array(\n $timeLookBack,\n $timeLookAhead,\n $this->request->getIdSite()\n );\n\n if ($shouldMatchOneFieldOnly) {\n if ($isVisitorIdToLookup) {\n $whereCommon .= ' AND idvisitor = ?';\n $bindSql[] = $this->visitorInfo['idvisitor'];\n } else {\n $whereCommon .= ' AND config_id = ?';\n $bindSql[] = $configId;\n }\n\n $sql = \"$select\n $from\n WHERE \" . $whereCommon . \"\n ORDER BY visit_last_action_time DESC\n LIMIT 1\";\n } // We have a config_id AND a visitor_id. We match on either of these.\n // \t\tWhy do we also match on config_id?\n //\t\twe do not trust the visitor ID only. Indeed, some browsers, or browser addons,\n // \t\tcause the visitor id from the 1st party cookie to be different on each page view!\n // \t\tIt is not acceptable to create a new visit every time such browser does a page view,\n // \t\tso we also backup by searching for matching config_id.\n // We use a UNION here so that each sql query uses its own INDEX\n else {\n // will use INDEX index_idsite_config_datetime (idsite, config_id, visit_last_action_time)\n $where = ' AND config_id = ?\n AND user_id IS NULL ';\n $bindSql[] = $configId;\n $sqlConfigId = \"$select ,\n 0 as priority\n $from\n WHERE $whereCommon $where\n ORDER BY visit_last_action_time DESC\n LIMIT 1\n \";\n // will use INDEX index_idsite_idvisitor (idsite, idvisitor)\n $bindSql[] = $timeLookBack;\n $bindSql[] = $timeLookAhead;\n $bindSql[] = $this->request->getIdSite();\n $where = ' AND idvisitor = ?';\n $bindSql[] = $this->visitorInfo['idvisitor'];\n $sqlVisitorId = \"$select ,\n 1 as priority\n $from\n WHERE $whereCommon $where\n ORDER BY visit_last_action_time DESC\n LIMIT 1\n \";\n\n // We join both queries and favor the one matching the visitor_id if it did match\n $sql = \" ( $sqlConfigId )\n UNION\n ( $sqlVisitorId )\n ORDER BY priority DESC\n LIMIT 1\";\n }\n\n $visitRow = Tracker::getDatabase()->fetch($sql, $bindSql);\n\n $isNewVisitForced = $this->request->getParam('new_visit');\n $isNewVisitForced = !empty($isNewVisitForced);\n $enforceNewVisit = $isNewVisitForced || Config::getInstance()->Debug['tracker_always_new_visitor'];\n\n if (!$enforceNewVisit\n && $visitRow\n && count($visitRow) > 0\n ) {\n\n // These values will be used throughout the request\n foreach($persistedVisitAttributes as $field) {\n $this->visitorInfo[$field] = $visitRow[$field];\n }\n\n $this->visitorInfo['visit_last_action_time'] = strtotime($visitRow['visit_last_action_time']);\n $this->visitorInfo['visit_first_action_time'] = strtotime($visitRow['visit_first_action_time']);\n\n // Custom Variables copied from Visit in potential later conversion\n if (!empty($selectCustomVariables)) {\n $maxCustomVariables = CustomVariables::getMaxCustomVariables();\n for ($i = 1; $i <= $maxCustomVariables; $i++) {\n if (isset($visitRow['custom_var_k' . $i])\n && strlen($visitRow['custom_var_k' . $i])\n ) {\n $this->visitorInfo['custom_var_k' . $i] = $visitRow['custom_var_k' . $i];\n }\n if (isset($visitRow['custom_var_v' . $i])\n && strlen($visitRow['custom_var_v' . $i])\n ) {\n $this->visitorInfo['custom_var_v' . $i] = $visitRow['custom_var_v' . $i];\n }\n }\n }\n\n $this->setIsVisitorKnown(true);\n Common::printDebug(\"The visitor is known (idvisitor = \" . bin2hex($this->visitorInfo['idvisitor']) . \",\n config_id = \" . bin2hex($configId) . \",\n idvisit = {$this->visitorInfo['idvisit']},\n last action = \" . date(\"r\", $this->visitorInfo['visit_last_action_time']) . \",\n first action = \" . date(\"r\", $this->visitorInfo['visit_first_action_time']) . \",\n visit_goal_buyer' = \" . $this->visitorInfo['visit_goal_buyer'] . \")\");\n //Common::printDebug($this->visitorInfo);\n } else {\n Common::printDebug(\"The visitor was not matched with an existing visitor...\");\n }\n }", "public function isVisitable(Context $context)\n\t{\n\t\treturn true;\n\t}", "function okcdesign_preprocess_page(&$variables) {\n theme_plugins_invoke(__FUNCTION__, $variables);\n}", "public function initializePlugin();", "public function isResponsibleFor(Visitor $visitor);", "public function isResponsibleFor(Visitor $visitor);", "public function onNewVisit(Request $request, Visitor $visitor, $action)\n {\n return false;\n }", "public static function node_interface()\n {\n }", "function recursiveVisit($target)\n {\n if (is_array($target)) {\n foreach ($target as $t) {\n $this->recursiveVisit($t);\n }\n } else {\n if ($target && ($target instanceof T_Visitorable)) $target->accept($this);\n }\n }", "public function getNodeVisitors()\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n return $this->visitors;\n }", "public function getVisitor() {\n\t\tif ($this->scenario == 'search') {\n\t\t\treturn $this->visitor;\n\t\t}\n\t}", "public function accept(ShoppingCartVisitor $visitor);", "abstract protected function registerHandlers();", "public function plugin_activate(){\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "public function onPluginsInitialized()\n {\n // if this value isset\n if (isset($_GET['return-as']) && in_array($_GET['return-as'], array('json', 'xml', 'yaml'))) {\n $this->enable([\n 'onPageInitialized' => ['deliverFormatAs', 0]\n ]);\n }\n }", "public function plugin_activate(){\n\t\t\n\t\t//call our custom content type function\n\t \t$this->register_location_content_type();\n\t\t//flush permalinks\n\t\tflush_rewrite_rules();\n\t}", "function BugzillaParserInit( Parser &$parser ) {\n global $wgBugzillaTagName;\n\n // Register the desired tag\n $parser->setHook( $wgBugzillaTagName, 'BugzillaRender' );\n\n // Let the other hooks keep processing\n return TRUE;\n}", "private static function plugins()\n {\n $files = ['Plugins'];\n $folder = static::$root.'Plugins'.'/';\n\n self::call($files, $folder);\n\n $files = ['AutoloadFileNotFoundException', 'InfoStructureException'];\n $folder = static::$root.'Plugins/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function skip() {\n # This method is meant to sidestep any expensive processing\n # a subclass might perform as part of next().\n $this->next();\n }", "public function postConnect()\n {\n\n /**\n * Capture all code block\n * See {@link Doku_Parser_Mode_code}\n */\n $this->Lexer->addPattern('<code.*?</code>', $this->getPluginMode());\n\n /**\n * End\n */\n $this->Lexer->addExitPattern('</webcode>', $this->getPluginMode());\n\n }", "protected static function register() {}", "public function visit(SubjectInterface $subject);", "public function visitNodes(\\Solr\\Domain\\Result\\Explanation\\Visitors\\ExplainNodeVisitorInterface $visitor) {\n\t\t$visitor->visit($this);\n\t\tforeach($this->getChildren() as $child) {\n\t\t\t$child->visitNodes($visitor);\n\t\t}\n\t}" ]
[ "0.61344534", "0.6008536", "0.5778622", "0.57599217", "0.56200475", "0.55324346", "0.53005695", "0.5289359", "0.5273746", "0.52649283", "0.5160474", "0.5062906", "0.5046105", "0.5038918", "0.50331914", "0.49820018", "0.49449936", "0.49389276", "0.49242753", "0.49081823", "0.4901569", "0.4893157", "0.48887768", "0.48788008", "0.48665437", "0.48206842", "0.4811174", "0.47957277", "0.4789086", "0.47868314", "0.47819972", "0.47809112", "0.47567675", "0.47555983", "0.47510806", "0.4743522", "0.47231394", "0.4720724", "0.47170466", "0.4701816", "0.4694501", "0.46922472", "0.46922472", "0.466988", "0.4669625", "0.4630209", "0.46197373", "0.46196285", "0.46188065", "0.46046638", "0.46003187", "0.4598499", "0.45946038", "0.45841125", "0.4578387", "0.45769948", "0.45707205", "0.45700166", "0.45583612", "0.45405272", "0.45328838", "0.45307392", "0.4530504", "0.45280966", "0.4522707", "0.45215037", "0.4521156", "0.45180386", "0.4514163", "0.4509242", "0.44953883", "0.44905266", "0.448001", "0.44761738", "0.4471441", "0.44673008", "0.44619307", "0.44485685", "0.44457307", "0.44454816", "0.44335645", "0.44243112", "0.44227812", "0.44227812", "0.44172677", "0.4415657", "0.4413775", "0.44121745", "0.44015288", "0.4398758", "0.439858", "0.43911904", "0.43908352", "0.43904847", "0.43814182", "0.43777275", "0.43677044", "0.43671486", "0.43651426", "0.43553916", "0.43548638" ]
0.0
-1
/ if( $this>_iProdTypeId === null ) return null; return $this>_oGame>getProdType($this>_iProdTypeId);
public function getProductionType() { return $this->_oProdType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductType()\n {\n }", "public function getProductType();", "public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}", "public function getProductType() {\n return $this->item->getProductType();\n }", "protected function _getShopSystemType()\n {\n switch ($this->_getEdition()) {\n case self::TYPE_COMMUNITY:\n $type = 76;\n break;\n case self::TYPE_ENTERPRISE:\n $type = 228;\n break;\n case self::TYPE_GO:\n $type = 229;\n break;\n default:\n $type = null;\n }\n\n return $type;\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function getProductType()\n {\n return Zend_Json::encode($this->escapeHtml($this->getProduct()->getTypeId()));\n }", "public function getConflictingProductTypeId()\n {\n return $this->conflictingProductTypeId;\n }", "public function getType()\n {\n \n $tipos = \n\n $TypeOfProduct = TypeOfProduct::find($this->type_id); \n\n return $TypeOfProduct->description;\n }", "public static function getProductTypeId()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\n\t\tswitch ($input->getCmd('view'))\n\t\t{\n\t\t\tcase 'product':\n\t\t\t\t$model = new GazebosModelProduct;\n\t\t\t\t$id = $model->getItem()->type_id;\n\t\t\t\tbreak;\n\t\t\tcase 'producttype':\n\t\t\t\t$id = $input->getInt('id');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $id;\n\t}", "private function getType($product)\n { \n $productTypes = $product->types;\n\n if(!$productTypes->isEmpty())\n {\n $typeName=NULL;\n\n foreach ($productTypes as $productType) {\n\n $typeName .= $productType->type_name . \"+\";\n }\n\n return trim($typeName,\"+\");\n\n }\n else\n {\n return NULL;\n }\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "public function getProdId()\n {\n return $this->prod_id;\n }", "public static function getProductTypeForProduct(int $productId): int\n {\n if ($productId === 0) {\n return 0;\n }\n\n if (isset(self::$productTypeForProduct[$productId])) {\n return self::$productTypeForProduct[$productId];\n }\n\n self::$productTypeForProduct[$productId] = (int)BackendUtility::getRecord(\n ProductRepository::TABLE_NAME,\n $productId,\n 'product_type'\n )['product_type'] ?? 0;\n\n return self::$productTypeForProduct[$productId];\n }", "public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}", "public function setProductionType( ProductionType $oProdType = null ) {\n\t\t$this->_oProdType = $oProdType;\n\t\treturn $this;\n\t}", "public function getProdGeneral()\n {\n return $this->prod_general;\n }", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "public function productType()\n {\n return $this->belongsTo(\\App\\Models\\ProductType::class, \"product_type_id\", \"id\");\n }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "function productCode($prod)\n\t{\n\t\t$product = $this->Product->findByCode($prod);\n\t\t$parent = !empty($product['Product']['parent_product_type_id']) ? $this->Product->read(null, $product['Product']['parent_product_type_id']) : null;\n\t\t$parentProd = !empty($parent) ? $parent['Product']['code'] : null;\n\n\t\tif(!empty($parentProd) && !file_exists(APP.\"/webroot/images/designs/products/$prod.svg\") && file_exists(APP.\"/webroot/images/designs/products/$parentProd.svg\"))\n\t\t{\n\t\t\t$prod = $parentProd;\n\t\t}\n\t\treturn $prod;\n\t}", "public function getPriceType(): ?string\n {\n return $this->priceType;\n }", "public static function GetDressTypeByID($productID = null) {\n\n $category_dress_type_id = Db_Actions::DbSelectRow(\"SELECT category_dress_type_id FROM cscart_products WHERE product_id=$productID\");\n if (!isset($category_dress_type_id->empty_result)) {\n return $category_dress_type_id->category_dress_type_id;\n }\n return 0;\n }", "function getProductType($cat_id,$subcat_id){\n $productType_info= ProductType::find()\n ->where(['cat_id' => $cat_id,'subcat_id'=>$subcat_id])\n ->asArray()\n ->one();\n unset($productType_info['id']); unset( $productType_info['cat_id']); unset( $productType_info['subcat_id']); unset( $productType_info['site_id']);\n if($productType_info['special_upc']){\n $productType_info['special_upc']=explode(',', $productType_info['special_upc']);\n }\n if($productType_info['product_type']){\n $productType_info['product_type']=explode(',', $productType_info['product_type']);\n }\n return $productType_info;\n\n }", "public function get_equipment_type();", "function getId_Producto(){\r\n\t\treturn $this->nId_Producto;\r\n\t}", "public function getTargetType($type) {\n $retObj = array();\n switch ($type) {\n case 'Brand':\n $retObj[] = new ProductBrand($this->targetData);\n $retObj[] = new ProductBrand();\n \n return $retObj;\n break;\n case 'Condition':\n $retObj[] = new ProductCanonicalCondition($this->targetData);\n $retObj[] = new ProductCanonicalCondition();\n \n return $retObj;\n break;\n case 'Category':\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1', $this->targetData);\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1');\n \n return $retObj;\n break;\n case 'Channel':\n $retObj[] = new ProductChannel($this->targetData);\n $retObj[] = new ProductChannel();\n \n return $retObj;\n break;\n case 'Item ID':\n $retObj[] = new ProductOfferId($this->targetData);\n $retObj[] = new ProductOfferId();\n \n return $retObj;\n break;\n case 'Product type':\n $retObj[] = new ProductType('PRODUCT_TYPE_L1', $this->targetData);\n $retObj[] = new ProductType('PRODUCT_TYPE_L1');\n \n return $retObj;\n break;\n case 'Channel exclusivity':\n $retObj[] = new ProductChannelExclusivity($this->targetData);\n $retObj[] = new ProductChannelExclusivity();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_0':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_1':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_2':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_3':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_4':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n \n default:\n break;\n }\n }", "private function get_type(){\n\t\treturn $this->_type;\n\t}", "public function menuType()\n {\n return ProductType::all();\n }", "public function retrieveProductTypeByName($name)\n {\n if (isset($this->_productTypeModels[$name])) {\n return $this->_productTypeModels[$name];\n }\n return null;\n }", "private function get_type() {\n\n\t}", "protected function _getProduto(){\n if (!is_object($this->_produto)){\n $this->_produto = new Vendas_Model_Produto_Mapper();\n }\n return $this->_produto;\n }", "public function getProductCode(): ?string\n {\n return $this->productCode;\n }", "public function getProductPriceType()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/base_price', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "protected function _getProductTypeModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_Store_Model_ProductType');\n\t}", "public function getProduct();", "public function isProductTypeWithQty(): ?bool;", "public function getProductTypeById($productTypeId)\n {\n if (!$this->_fetchedAllProductTypes &&\n (!isset($this->_productTypesById) || !array_key_exists($productTypeId, $this->_productTypesById))\n ) {\n $result = DigitalProducts_ProductTypeRecord::model()->findById($productTypeId);\n\n if ($result) {\n $productType = DigitalProducts_ProductTypeModel::populateModel($result);\n } else {\n $productType = null;\n }\n\n $this->_productTypesById[$productTypeId] = $productType;\n }\n\n if (isset($this->_productTypesById[$productTypeId])) {\n return $this->_productTypesById[$productTypeId];\n }\n\n return null;\n }", "public function getProductID()\n {\n }", "public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }", "function getType()\t { return $this->type;\t }", "public function getProdCategory()\n {\n return $this->prod_category;\n }", "public function getTypeOrga(): ?string {\n return $this->typeOrga;\n }", "public function get_type()\n {\n return self::$_id;\n }", "public function getEntityTypeCode()\n {\n return 'catalog_product';\n }", "public function getProdName() {\n return $this->ProductName;\n}", "public function getProductPriceType()\n {\n return Mage::getStoreConfig('splitprice/split_price_config/base_price');\n }", "public function getProdRelated2()\n {\n return $this->prod_related2;\n }", "public function getType()\n {\n return isset($this->Type) ? $this->Type : null;\n }", "public function get_type(){ return $this->_type;}", "public function getConflictingProductTypeName()\n {\n return $this->conflictingProductTypeName;\n }", "public function getProdRelated()\n {\n return $this->prod_related;\n }", "public function GetGeneralType() {\n\t\tif (in_array($this->GetType(),array(PROFILE_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_SUMMERCAMP, \n\t\t\t\t\t\t\t\t\t\t\tPROFILE_VOLUNTEER_PROJECT, \n\t\t\t\t\t\t\t\t\t\t\tPROFILE_SEASONALJOBS, \n\t\t\t\t\t\t\t\t\t\t\tPROFILE_TEACHING))) {\n\t\t\treturn PROFILE_COMPANY;\n\t\t}\n\t\tif (in_array($this->GetType(),array(PROFILE_PLACEMENT,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_VOLUNTEER,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_TOUR,\n\t\t\t\t\t\t\t\t\t\t\tPROFILE_JOB))) {\r\n\t\t\treturn PROFILE_PLACEMENT;\r\n\t\t}\r\n\t\t\n\t}", "public function prod($prod);", "abstract protected function getTradeType();", "static function GetItemType() { return \"\"; }", "public function get_type(): string;", "function IsProduct() {\r\n\t\treturn true;\r\n\t}", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "public function get_type()\n {\n }", "function getType() { \n\t\treturn $this->_type; \n\t}", "function project_type($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='$id'\"));\n\treturn $name['type_name'];\n\t}", "protected function getProductName(): ?string\n\t{\n\t\tstatic $cache = [];\n\n\t\t$productId = $this->getProductId();\n\t\tif (!$productId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!array_key_exists($productId, $cache))\n\t\t{\n\t\t\tLoader::includeModule('iblock');\n\n\t\t\t$row = ElementTable::getRow([\n\t\t\t\t'select' => [\n\t\t\t\t\t'NAME',\n\t\t\t\t],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=ID' => $productId,\n\t\t\t\t],\n\t\t\t]);\n\t\t\t$cache[$productId] = $row ? (string)$row['NAME'] : null;\n\t\t}\n\n\t\treturn $cache[$productId];\n\t}", "public function getProdName()\n {\n return $this->prod_name;\n }", "public function getPartnerType()\n {\n return isset($this->PartnerType) ? $this->PartnerType : null;\n }", "public function release_type()\n {\n return $this->hasOne(ReleaseType::class);\n }", "function getCodigoProducto()\n {\n return $this->CodigoProducto;\n }", "public function findProductById(int $idProduct): ?object {\n\t\t// crete Default Var\n\t\t$objProduct = null;\n\t\ttry {\n\t\t\t// create Query Builder \n\t \t$qb = $this->em->createQueryBuilder();\n\t \t// create Query\n\t \t$objProduct = $qb->select('p')\n\t\t\t ->from(Product::class, 'p')\n\t\t\t ->where('p.id = :id')\n\t\t\t ->andWhere('p.status = :status')\n\t\t\t ->setParameter('id', $idProduct\t)\n\t\t\t ->setParameter('status', 1)\n\t\t\t ->getQuery()\n\t\t\t ->getOneOrNullResult();\n \t\t} catch (\\Exception $ex) {\n \t\t\t//dd($ex);\n \t\t}\n \t\t// default Return\n \t\treturn $objProduct;\n\t}", "public function getByPosition($pos)\n {\n switch ($pos) {\n case 0:\n return $this->getProdId();\n break;\n case 1:\n return $this->getProdPriceId();\n break;\n case 2:\n return $this->getProdName();\n break;\n case 3:\n return $this->getProdAlt1();\n break;\n case 4:\n return $this->getProdAlt2();\n break;\n case 5:\n return $this->getProdAlt3();\n break;\n case 6:\n return $this->getProdAlt4();\n break;\n case 7:\n return $this->getProdCode();\n break;\n case 8:\n return $this->getProdCategory();\n break;\n case 9:\n return $this->getProdCategoryShipping();\n break;\n case 10:\n return $this->getProdWriteup();\n break;\n case 11:\n return $this->getProdLength();\n break;\n case 12:\n return $this->getProdWingspan();\n break;\n case 13:\n return $this->getProdHeight();\n break;\n case 14:\n return $this->getProdScale();\n break;\n case 15:\n return $this->getProdLinks();\n break;\n case 16:\n return $this->getProdLinkdescription();\n break;\n case 17:\n return $this->getProdFront();\n break;\n case 18:\n return $this->getProdKeywords();\n break;\n case 19:\n return $this->getProdKeywordsWriteup();\n break;\n case 20:\n return $this->getProdTitle();\n break;\n case 21:\n return $this->getProdDescription();\n break;\n case 22:\n return $this->getProdGeneral();\n break;\n case 23:\n return $this->getProdEra();\n break;\n case 24:\n return $this->getProdCompany();\n break;\n case 25:\n return $this->getProdRelated();\n break;\n case 26:\n return $this->getProdRelatedPa();\n break;\n case 27:\n return $this->getProdRelatedM3();\n break;\n case 28:\n return $this->getProdRelated2();\n break;\n case 29:\n return $this->getProdSaveas();\n break;\n case 30:\n return $this->getProdAircraftreg();\n break;\n case 31:\n return $this->getMb();\n break;\n case 32:\n return $this->getPa();\n break;\n case 33:\n return $this->getM3();\n break;\n default:\n return null;\n break;\n } // switch()\n }", "public function product_type()\n {\n return $this->belongsTo('App\\ProductType');\n }", "public function get_type();", "public function getProductOption();", "public function getType()\n {\n return isset($this->type) ? $this->type : null;\n }", "public function getTipoProducto(){\n $items = TcTipoProducto::where('id_estado','=',1)->get();\n return $items;\n }", "public function getPlanItemType();", "public function getPriceType()\n {\n return $this->priceType;\n }", "public function getPriceType()\n {\n return $this->priceType;\n }", "public function getPriceType()\n {\n if (array_key_exists(\"priceType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"priceType\"], \"\\Beta\\Microsoft\\Graph\\Model\\BookingPriceType\") || is_null($this->_propDict[\"priceType\"])) {\n return $this->_propDict[\"priceType\"];\n } else {\n $this->_propDict[\"priceType\"] = new BookingPriceType($this->_propDict[\"priceType\"]);\n return $this->_propDict[\"priceType\"];\n }\n }\n return null;\n }", "public function get_productId(): int\n {\n // $res is a int;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductId();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTID_INVALID;\n }\n }\n $res = $this->_productId;\n return $res;\n }", "function getProductNameProductType($parent_admin_id,$DbConnection)\n {\n\t$final_product_type_list=array();\n\t$query_product_type = \"SELECT name FROM product_type USE INDEX(pte_aid_status) WHERE account_id='$parent_admin_id' AND status=1\";\n\t$result_query = mysql_query($query_product_type,$DbConnection);\n\twhile($row=mysql_fetch_object($result_query))\n\t{\t\t\n\t\t$final_product_type_list[]=$row->name;\n\t\t\n\t}\n\treturn $final_product_type_list;\n }", "public function get_type(){\n\t\treturn $this->_type;\n\t}", "public function getProductKey()\n {\n if (array_key_exists(\"productKey\", $this->_propDict)) {\n return $this->_propDict[\"productKey\"];\n } else {\n return null;\n }\n }", "public function getProductKey()\n {\n if (array_key_exists(\"productKey\", $this->_propDict)) {\n return $this->_propDict[\"productKey\"];\n } else {\n return null;\n }\n }", "public function getType_id()\n {\n return $this->type_id;\n }", "public function getPriceType()\n {\n return (int) $this->getConfig('extrafee/general/pricetype');\n }", "public function product()\n {\n return $this->m_product;\n }", "public function get_pricing_type(): string {\n\t\t\t/**\n\t\t\t * Filters product pricing type.\n\t\t\t *\n\t\t\t * @since 4.5.0\n\t\t\t *\n\t\t\t * @param string $pricing_type Product pricing type.\n\t\t\t * @param Learndash_Product_Model $product Product model.\n\t\t\t *\n\t\t\t * @return string Product pricing type.\n\t\t\t */\n\t\t\treturn apply_filters(\n\t\t\t\t'learndash_model_product_pricing_type',\n\t\t\t\t$this->get_pricing_settings()['type'] ?? '',\n\t\t\t\t$this\n\t\t\t);\n\t\t}", "function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}", "private function getProductByReference($prodRef) {\n $entityManager = $this->getDoctrine()->getManager();\n $product = null;\n $productList = $entityManager->getRepository('DppCustomersBundle:Product')->findBy(array('urlRef' => $prodRef));\n if (!$productList == null) {\n $product = $productList[0];\n }\n return $product;\n }", "final protected function get_type() {\n return $this->type;\n }", "private function getShipmentTypeValue($type)\n {\n return $this->shipmentTypeMapping[$type] ?? null;\n }", "private function getProductObject(?string $productId): ?array\n {\n $productObject = $this->entityManager->getRepository('App:ObjectEntity')->find($productId);\n if ($productObject instanceof ObjectEntity === false) {\n return null;\n }//end if\n\n return $productObject->toArray();\n\n }", "function tipoVendaProduto($tpVenda)\n {\n switch ($tpVenda) {\n case 1:\n $tipo_venda = 'Kg';\n break;\n case 2:\n $tipo_venda = 'Caixa';\n break;\n case 3:\n $tipo_venda = 'Litro';\n break;\n case 4:\n $tipo_venda = 'Dúzia';\n break;\n case 5:\n $tipo_venda = 'Unidade';\n break;\n }\n return $tipo_venda;\n }", "public function get_product() {\n $product = wc_get_product( $this->get_product_id() );\n\n return $product && $product->is_type( YITH_WCBK_Product_Post_Type_Admin::$prod_type ) ? $product : false;\n }", "public function getType()\n {\n return isset($this->type) ? $this->type : 0;\n }", "public function getProductId(): string;" ]
[ "0.7064127", "0.700422", "0.65298223", "0.5966501", "0.59530514", "0.5922963", "0.59205246", "0.5899329", "0.5853311", "0.5831971", "0.58224094", "0.58196247", "0.5783436", "0.5713531", "0.56566674", "0.5654483", "0.562257", "0.5615929", "0.56095195", "0.56005365", "0.55944055", "0.5535591", "0.54961133", "0.54892164", "0.54858917", "0.5459571", "0.5450373", "0.54463875", "0.54447144", "0.54274035", "0.5415373", "0.5410438", "0.5396817", "0.53870887", "0.53870475", "0.5386913", "0.5383637", "0.53831196", "0.53763187", "0.53715706", "0.5364837", "0.53472894", "0.5345308", "0.531708", "0.53072804", "0.5298843", "0.52857584", "0.5277526", "0.5277113", "0.5276899", "0.5270187", "0.5268425", "0.526602", "0.5259257", "0.5257723", "0.5257433", "0.52520823", "0.524444", "0.52390456", "0.52325785", "0.52319926", "0.5231777", "0.5231777", "0.5231669", "0.5231608", "0.5225031", "0.5224878", "0.52223396", "0.5217926", "0.5217395", "0.52164125", "0.52161604", "0.52043164", "0.5200486", "0.51867604", "0.51839256", "0.5175909", "0.5165861", "0.51590675", "0.5149241", "0.5149241", "0.5148184", "0.5147641", "0.5146458", "0.514508", "0.51444376", "0.51444376", "0.5136664", "0.5135668", "0.5131257", "0.51273406", "0.5122247", "0.5114577", "0.511026", "0.51100725", "0.51088005", "0.5107214", "0.51015586", "0.5093363", "0.5092285" ]
0.71238446
0
/ if( $oProdType === null ) $this>_iProdTypeId = null; else $this>_iProdTypeId = $oProdType>getId();
public function setProductionType( ProductionType $oProdType = null ) { $this->_oProdType = $oProdType; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setProduct_id($value)\n\t{\n\t\tif (isInt($value) || is_null($value)) { $this->product_id = $value; }\n\t}", "function getId_Producto(){\r\n\t\treturn $this->nId_Producto;\r\n\t}", "public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}", "public function getProdId()\n {\n return $this->prod_id;\n }", "function product_id($product_id=null)\n {\n if (isset($product_id)) $this->product_id = $product_id;\n return $this->product_id;\n }", "function getID(){ return (int)$this->productInfo['products_id']; }", "public function setProdId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_id !== $v) {\n $this->prod_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ID] = true;\n }\n\n if ($this->aTblProdPhotos !== null && $this->aTblProdPhotos->getProdId() !== $v) {\n $this->aTblProdPhotos = null;\n }\n\n if ($this->aTblProdPrices !== null && $this->aTblProdPrices->getProdId() !== $v) {\n $this->aTblProdPrices = null;\n }\n\n if ($this->aTblProdSmaller !== null && $this->aTblProdSmaller->getProdId() !== $v) {\n $this->aTblProdSmaller = null;\n }\n\n return $this;\n }", "protected function _initProduct($id=0)\n {\n if($id==0){\n $productId = (int) $this->getRequest()->getParam('product');\n }else{\n $productId = $id;\n }\n if ($productId) {\n $product = Mage::getModel('catalog/product')\n ->setStoreId(Mage::app()->getStore()->getId())\n ->load($productId);\n if ($product->getId()) {\n return $product;\n }\n }\n return false;\n }", "public function setProdID($prodID){\r\n\t\t$this->prodID= $prodID;\r\n\t}", "public function catalogProductSaveBefore($productType,$product){\n /**\n * Check $productType has been set to 'property'\n */\n if ($productType == 'property') {\n /**\n * Getting Product's user Id\n */\n $customerId = $product->getUserid ();\n /**\n * Loading customer Details\n */\n $customer = Mage::getModel ( 'customer/customer' )->load ( $customerId );\n /**\n * checking empty or not\n */\n if ($customer->getId () == '') {\n $product->setCanSaveCustomOptions ( true );\n Mage::throwException ( Mage::helper ( 'adminhtml' )->__ ( 'User id was invalid' ) );\n }\n }\n }", "public function getProductID()\n {\n }", "public function getProduct_Id() {\n return $this->product_Id;\n }", "public function setIdProducto($idProducto)\n {\n return $this->idProducto=$idProducto;\n }", "public function getProductType()\n {\n }", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "private function setProductObjectId(object $object): void\n {\n //====================================================================//\n // Identify Product Id\n if ($object instanceof Product) {\n $this->objectId = (string) $object->id;\n } elseif ($object instanceof MouvementStock) {\n $this->objectId = (string) $object->product_id;\n }\n }", "public function getProductionType() {\n\t\treturn $this->_oProdType;\n\t}", "protected function _beforeSave()\r\n {\r\n \t// invoke the parent method\r\n \tparent::_beforeSave();\r\n // check the product type (has to be a package product)\r\n $typeInstance = $this->getTypeInstance(true);\r\n // check if a ID is available, if not the package is new\r\n if ($this->getId() == 0 &&\r\n $typeInstance instanceof Faett_Package_Model_Product_Type) {\r\n $this->_isNew = true;\r\n $this->setHasOptions(1);\r\n }\r\n }", "public function getIdProducto()\n {\n return $this->idProducto;\n }", "public function clear()\n {\n if (null !== $this->aTblEra) {\n $this->aTblEra->removeTblProdInfo($this);\n }\n if (null !== $this->aTblGeneral) {\n $this->aTblGeneral->removeTblProdInfo($this);\n }\n if (null !== $this->aTblMenus) {\n $this->aTblMenus->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPhotos) {\n $this->aTblProdPhotos->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPrices) {\n $this->aTblProdPrices->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPricing) {\n $this->aTblProdPricing->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdSmaller) {\n $this->aTblProdSmaller->removeTblProdInfo($this);\n }\n if (null !== $this->aTblShippingCategories) {\n $this->aTblShippingCategories->removeTblProdInfo($this);\n }\n $this->prod_id = null;\n $this->prod_price_id = null;\n $this->prod_name = null;\n $this->prod_alt1 = null;\n $this->prod_alt2 = null;\n $this->prod_alt3 = null;\n $this->prod_alt4 = null;\n $this->prod_code = null;\n $this->prod_category = null;\n $this->prod_category_shipping = null;\n $this->prod_writeup = null;\n $this->prod_length = null;\n $this->prod_wingspan = null;\n $this->prod_height = null;\n $this->prod_scale = null;\n $this->prod_links = null;\n $this->prod_linkdescription = null;\n $this->prod_front = null;\n $this->prod_keywords = null;\n $this->prod_keywords_writeup = null;\n $this->prod_title = null;\n $this->prod_description = null;\n $this->prod_general = null;\n $this->prod_era = null;\n $this->prod_company = null;\n $this->prod_related = null;\n $this->prod_related_pa = null;\n $this->prod_related_m3 = null;\n $this->prod_related2 = null;\n $this->prod_saveas = null;\n $this->prod_aircraftreg = null;\n $this->mb = null;\n $this->pa = null;\n $this->m3 = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function getId()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getIdProduct()\n {\n return $this->idProduct;\n }", "public function getId_product()\n {\n return $this->id_product;\n }", "public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}", "public function getProductId(){\n return $this->product_id;\n }", "public function setProductId($product_id){\n $this->product_id = $product_id;\n }", "public function setIdProducto($idProducto)\n {\n $this->idProducto = $idProducto;\n\n return $this;\n }", "public function getId0()\n {\n return $this->hasOne(Product::className(), ['category_id' => 'id']);\n }", "public function edit(ProductProductType $productProductType)\n {\n //\n }", "public function show($productType_id, $id)\n {\n //\n }", "public function getDefaultProductID() {\n return self::$defaultProductID;\n }", "public function getConflictingProductTypeId()\n {\n return $this->conflictingProductTypeId;\n }", "public function setProducto($pro){ $this->producto = $pro;}", "public static function getProductTypeId()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\n\t\tswitch ($input->getCmd('view'))\n\t\t{\n\t\t\tcase 'product':\n\t\t\t\t$model = new GazebosModelProduct;\n\t\t\t\t$id = $model->getItem()->type_id;\n\t\t\t\tbreak;\n\t\t\tcase 'producttype':\n\t\t\t\t$id = $input->getInt('id');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $id;\n\t}", "function __construct( $odataEntity ) {\r\n\t\tparent::__construct( $odataEntity );\r\n\t\tforeach ($odataEntity->getProperties() as $property) {\r\n\t\t\tif ($property->getName() == 'TypeId') {\r\n\t\t\t\t$this->type_id = $property->getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function productCode($prod)\n\t{\n\t\t$product = $this->Product->findByCode($prod);\n\t\t$parent = !empty($product['Product']['parent_product_type_id']) ? $this->Product->read(null, $product['Product']['parent_product_type_id']) : null;\n\t\t$parentProd = !empty($parent) ? $parent['Product']['code'] : null;\n\n\t\tif(!empty($parentProd) && !file_exists(APP.\"/webroot/images/designs/products/$prod.svg\") && file_exists(APP.\"/webroot/images/designs/products/$parentProd.svg\"))\n\t\t{\n\t\t\t$prod = $parentProd;\n\t\t}\n\t\treturn $prod;\n\t}", "public function get_id_poblacion(){ \n return (isset($this->_id_poblacion)) ? $this->_id_poblacion: null;\n}", "public function getProductType();", "public function getId_produto()\n {\n return $this->id_produto;\n }", "function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}", "public function getIdProduto()\n\t\t{\n\t\t\treturn $this -> idproduto;\n\t\t}", "public function setProductId($id);", "public function getDefaultValue()\n {\n if (empty($this->argList)) {\n $products = self::executeMethod('productsList')->getResponse();\n $this->argList = isset($products[0]) ? [$products[0]['id']] : [];\n }\n \n if (empty($this->defaultId)) {\n $categories = self::executeMethod('categoriesList')->getResponse();\n $delivery = self::executeMethod('deliveryVariantsList')->getResponse();\n $payment = self::executeMethod('paymentGatewaysList')->getResponse();\n $collection = self::executeMethod('collectionsList')->getResponse();\n $collect = self::executeMethod('collectsList')->getResponse();\n $statuses = self::executeMethod('customStatusesList')->getResponse();\n\n $this->defaultId = [\n 'product_id' => isset($products[0]) ? $products[0]['id'] : null,\n 'category_id' => isset($categories[0]) ? $categories[0]['id'] : null,\n 'delivery_variant_id' => isset($delivery[0]) ? $delivery[0]['id'] : null,\n 'payment_gateway_id' => isset($payment[0]) ? $payment[0]['id'] : null,\n 'parent_id' => isset($collection[0]) ? $collection[0]['id'] : null,\n 'collection_id' => isset($collect[0]) ? $collect[0]['id'] : null,\n 'permalink' => isset($statuses[0]) ? $statuses[0]['permalink'] : null,\n ];\n }\n }", "function setProduct( $product )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $product ) == \"ezproduct\" )\n {\n $this->ProductID = $product->id();\n }\n }", "public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }", "function getCodigoProducto()\n {\n return $this->CodigoProducto;\n }", "public function get_id_product()\n\t{\n\t\treturn $this->id_product;\n\t}", "public function getId_producto()\n {\n return $this->id_producto;\n }", "protected function _initProduct()\n {\n $this->_title($this->__('Catalog'))\n ->_title($this->__('Manage Products'));\n\n $productId = (int) $this->getRequest()->getParam('id');\n $product = Mage::getModel('catalog/product')\n ->setStoreId($this->getRequest()->getParam('store', 0));\n\n // Hack\n\n $this->getRequest()->setParam('set',4);\n $this->getRequest()->setParam('type','simple');\n if (!$productId) {\n if ($setId = (int) $this->getRequest()->getParam('set')) {\n $product->setAttributeSetId($setId);\n }\n\n if ($typeId = $this->getRequest()->getParam('type')) {\n $product->setTypeId($typeId);\n }\n }\n\n $product->setData('_edit_mode', true);\n if ($productId) {\n try {\n $product->load($productId);\n\n } catch (Exception $e) {\n $product->setTypeId(Mage_Catalog_Model_Product_Type::DEFAULT_TYPE);\n Mage::logException($e);\n }\n }\n\n $attributes = $this->getRequest()->getParam('attributes');\n if ($attributes && $product->isConfigurable() &&\n (!$productId || !$product->getTypeInstance()->getUsedProductAttributeIds())) {\n $product->getTypeInstance()->setUsedProductAttributeIds(\n explode(\",\", base64_decode(urldecode($attributes)))\n );\n }\n\n // Required attributes of simple product for configurable creation\n if ($this->getRequest()->getParam('popup')\n && $requiredAttributes = $this->getRequest()->getParam('required')) {\n $requiredAttributes = explode(\",\", $requiredAttributes);\n foreach ($product->getAttributes() as $attribute) {\n if (in_array($attribute->getId(), $requiredAttributes)) {\n $attribute->setIsRequired(1);\n }\n }\n }\n\n if ($this->getRequest()->getParam('popup')\n && $this->getRequest()->getParam('product')\n && !is_array($this->getRequest()->getParam('product'))\n && $this->getRequest()->getParam('id', false) === false) {\n\n $configProduct = Mage::getModel('catalog/product')\n ->setStoreId(0)\n ->load($this->getRequest()->getParam('product'))\n ->setTypeId($this->getRequest()->getParam('type'));\n\n /* @var $configProduct Mage_Catalog_Model_Product */\n $data = array();\n foreach ($configProduct->getTypeInstance()->getEditableAttributes() as $attribute) {\n\n /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */\n if(!$attribute->getIsUnique()\n && $attribute->getFrontend()->getInputType()!='gallery'\n && $attribute->getAttributeCode() != 'required_options'\n && $attribute->getAttributeCode() != 'has_options'\n && $attribute->getAttributeCode() != $configProduct->getIdFieldName()) {\n $data[$attribute->getAttributeCode()] = $configProduct->getData($attribute->getAttributeCode());\n }\n }\n\n $product->addData($data)\n ->setWebsiteIds($configProduct->getWebsiteIds());\n }\n\n Mage::register('product', $product);\n Mage::register('current_product', $product);\n Mage::getSingleton('cms/wysiwyg_config')->setStoreId($this->getRequest()->getParam('store'));\n return $product;\n }", "function apptivo_ecommerce_product( $id) {\n\t\t\n\t\t$this->id = (int)$id;\t\t\n\t\t$app_item_id = get_post_meta($this->id,'_apptivo_item_id',true); \n\t\t$app_item_uom_id = get_post_meta($this->id,'_apptivo_item_uom_id',true);\n\t\t$app_item_manufactured_id = get_post_meta($this->id,'_apptivo_item_manufactured_id',true); \n\t\t$this->product_custom_fields = get_post_custom( $this->id );\t\t\n\t\t$this->exists = (sizeof($this->product_custom_fields)>0) ? true : false;\n\t\t// Define the data we're going to load: Key => Default value\n\t\t$load_data = array(\n\t\t\t'_apptivo_item_code'\t\t\t=> $this->id,\n\t\t '_apptivo_track_color' => '',\n\t\t '_apptivo_track_size' => '',\t\n\t\t\t'_apptivo_sale_price'\t=> '',\n\t\t\t'_apptivo_regular_price' => '',\t\t\t\n\t\t '_apptivo_item_id' => $awpItemId,//$app_item_id,\n\t\t '_apptivo_item_uom_id' => $awpItem_UOMId,//$_apptivo_item_uom_id\n\t\t\t'_apptivo_item_manufactured_id' => $app_item_manufactured_id\t \n\t\t);\n\t\t\n\t\t// Load the data from the custom fields\n\t\tforeach ($load_data as $key => $default) :\n\t\t\t$this->$key = (isset($this->product_custom_fields[$key][0]) && $this->product_custom_fields[$key][0]!=='') ? $this->product_custom_fields[$key][0] : $default;\n\t\tendforeach;\n\t\t\n\t\t// Load serialised data, unserialise twice to fix WP bug\n\t\tif (isset($this->product_custom_fields['product_attributes'][0])) $this->attributes = maybe_unserialize( maybe_unserialize( $this->product_custom_fields['product_attributes'][0] )); else $this->attributes = array();\t\t\n\t\t\t\t\t\t\n\t\t\n\t}", "function editar_pr_factura(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "function createProductType($productType_data)\n {\n \n $producttype_model = new ProductType();\n //var_dump($productType_data);die;\n $producttype_model->cat_id = $productType_data['cat_id'];\n $producttype_model->subcat_id = $productType_data['subcat_id'];\n $producttype_model->store_id = $productType_data['store_id'];\n $producttype_model->site_id = $productType_data['site_id'];\n $producttype_model->product_type = isset($productType_data['product_type']) ? $productType_data['product_type']: '';\n $producttype_model->special_upc = isset($productType_data['special_upc']) ? $productType_data['special_upc'] : '';\n $producttype_model->other_value = isset($productType_data['other_value']) ? $productType_data['other_value'] : '';\n $producttype_model->item_type = isset($productType_data['item_type']) ? $productType_data['item_type'] : '';\n $producttype_model->save();\n }", "public function getProductTypeById($productTypeId)\n {\n if (!$this->_fetchedAllProductTypes &&\n (!isset($this->_productTypesById) || !array_key_exists($productTypeId, $this->_productTypesById))\n ) {\n $result = DigitalProducts_ProductTypeRecord::model()->findById($productTypeId);\n\n if ($result) {\n $productType = DigitalProducts_ProductTypeModel::populateModel($result);\n } else {\n $productType = null;\n }\n\n $this->_productTypesById[$productTypeId] = $productType;\n }\n\n if (isset($this->_productTypesById[$productTypeId])) {\n return $this->_productTypesById[$productTypeId];\n }\n\n return null;\n }", "function ciniki_products_typeObjectDefUpdate($ciniki, $object_def, $args) {\n\n if( $object_def == NULL ) {\n $object_def = array(\n 'name'=>array('name_s'=>'', 'name_p'=>''),\n );\n }\n if( !isset($object['parent']) ) {\n $object['parent'] = array('products'=>array());\n }\n if( !isset($object['parent']['products']) ) {\n $object['parent']['products'] = array();\n }\n\n $product_fields = array(\n 'name',\n 'code',\n 'sequence',\n 'category',\n 'source',\n 'flags',\n 'status',\n 'barcode',\n 'supplier_tnid',\n 'supplier_product_id',\n 'price',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'cost',\n 'msrp',\n 'sell_unit',\n 'supplier_id',\n 'supplier_item_number',\n 'supplier_minimum_order',\n 'supplier_order_multiple',\n 'manufacture_min_time',\n 'manufacture_max_time',\n 'inventory_flags',\n 'inventory_current_num',\n 'inventory_reorder_num',\n 'inventory_reorder_quantity',\n 'shipping_flags',\n 'shipping_weight',\n 'shipping_weight_units',\n 'shipping_length',\n 'shipping_width',\n 'shipping_height',\n 'shipping_size_units',\n 'primary_image_id',\n 'short_description',\n 'long_description',\n 'description',\n 'start_date',\n 'end_date',\n 'webflags',\n 'detail01',\n 'detail02',\n 'detail03',\n 'detail04',\n 'detail05',\n 'detail06',\n 'detail07',\n 'detail08',\n 'detail09',\n );\n foreach($product_fields as $field) {\n if( isset($args['parent_product_' . $field]) ) {\n if( $args['parent_product_' . $field] == 'on' ) {\n $object_def['parent']['products'][$field] = array();\n } elseif( $args['parent_product_' . $field] == 'off' \n && isset($object_def['parent']['products'][$field]) ) {\n unset($object_def['parent']['products'][$field]);\n }\n }\n if( (!isset($args['parent_product_' . $field . '-name']) || $args['parent_product_' . $field . '-name'])\n && isset($args['parent_product_' . $field . '-name']) ) {\n if( isset($object_def['parent']['products']) ) {\n $object_def['parent']['products'][$field]['name'] = $args['parent_product_' . $field . '-name'];\n }\n }\n if( isset($args['child_product_' . $field]) ) {\n if( $args['child_product_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) {\n $object_def['child'] = array('products'=>array());\n }\n $object_def['child']['products'][$field] = array();\n } elseif( $args['child_product_' . $field] == 'off' \n && isset($object_def['child']['products'][$field]) ) {\n unset($object_def['child']['products'][$field]);\n }\n }\n if( (!isset($args['child_product_' . $field . '-name']) || $args['child_product_' . $field . '-name'])\n && isset($args['child_product_' . $field . '-name']) ) {\n if( isset($object_def['child']['products']) ) {\n $object_def['child']['products'][$field]['name'] = $args['child_product_' . $field . '-name'];\n }\n }\n }\n\n $price_fields = array(\n 'name',\n 'pricepoint_id',\n 'available_to',\n 'min_quantity',\n 'unit_amount',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'start_date',\n 'end_date',\n 'webflags',\n );\n\n foreach($price_fields as $field) {\n if( isset($args['parent_price_' . $field]) ) {\n if( $args['parent_price_' . $field] == 'on' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array();\n } elseif( $args['parent_price_' . $field] == 'hidden' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array('ui-hide'=>'yes');\n } elseif( $args['parent_price_' . $field] == 'off' \n && isset($object_def['parent']['prices'][$field]) ) {\n unset($object_def['parent']['prices'][$field]);\n }\n if( $args['parent_price_' . $field] != 'off' ) {\n if( isset($args['parent_price_' . $field . '-default']) \n && $args['parent_price_' . $field . '-default'] != '' ) {\n $object_def['parent']['prices'][$field]['default'] = $args['parent_price_' . $field . '-default'];\n }\n }\n }\n if( isset($args['child_price_' . $field]) ) {\n if( $args['child_price_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) { $object_def['child'] = array('products'=>array()); }\n if( !isset($object_def['child']['prices']) ) { $object_def['child']['prices'] = array(); }\n $object_def['child']['prices'][$field] = array();\n } elseif( $args['child_price_' . $field] == 'off' \n && isset($object_def['child']['prices'][$field]) ) {\n unset($object_def['child']['prices'][$field]);\n }\n }\n }\n\n //\n // Remove old ones\n //\n if( isset($object_def['parent']['subcategories']) ) { unset($object_def['parent']['subcategories']); }\n\n// $args['object_def'] = serialize($object_def);\n\n //\n // Check for subcategories\n //\n for($i=11;$i<30;$i++) {\n $field = 'parent_subcategories-' . $i;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent']['subcategories-' . $i] = array();\n if( isset($args[$field . '-sname']) ) {\n $object_def['parent']['subcategories-' . $i]['sname'] = $args[$field . '-sname'];\n }\n if( isset($args[$field . '-pname']) ) {\n $object_def['parent']['subcategories-' . $i]['pname'] = $args[$field . '-pname'];\n }\n } elseif( $args[$field] == 'off' && isset($object_def['parent']['subcategories-' . $i]) ) {\n unset($object_def['parent']['subcategories-' . $i]);\n }\n }\n }\n\n $extras = array('categories', \n// 'subcategories-11', 'subcategories-12', 'subcategories-13', 'subcategories-14', 'subcategories-15', \n 'tags', 'images', 'audio', 'files', 'similar', 'recipes');\n foreach($extras as $extra) {\n $field = 'parent_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['parent'][$extra]) ) {\n unset($object_def['parent'][$extra]);\n }\n }\n $field = 'child_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['child'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['child'][$extra]) ) {\n unset($object_def['child'][$extra]);\n }\n }\n }\n\n return array('stat'=>'ok', 'object_def'=>$object_def);\n}", "public static function getProductTypeForProduct(int $productId): int\n {\n if ($productId === 0) {\n return 0;\n }\n\n if (isset(self::$productTypeForProduct[$productId])) {\n return self::$productTypeForProduct[$productId];\n }\n\n self::$productTypeForProduct[$productId] = (int)BackendUtility::getRecord(\n ProductRepository::TABLE_NAME,\n $productId,\n 'product_type'\n )['product_type'] ?? 0;\n\n return self::$productTypeForProduct[$productId];\n }", "public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)\n {\n $keys = TblProdInfoTableMap::getFieldNames($keyType);\n\n if (array_key_exists($keys[0], $arr)) {\n $this->setProdId($arr[$keys[0]]);\n }\n if (array_key_exists($keys[1], $arr)) {\n $this->setProdPriceId($arr[$keys[1]]);\n }\n if (array_key_exists($keys[2], $arr)) {\n $this->setProdName($arr[$keys[2]]);\n }\n if (array_key_exists($keys[3], $arr)) {\n $this->setProdAlt1($arr[$keys[3]]);\n }\n if (array_key_exists($keys[4], $arr)) {\n $this->setProdAlt2($arr[$keys[4]]);\n }\n if (array_key_exists($keys[5], $arr)) {\n $this->setProdAlt3($arr[$keys[5]]);\n }\n if (array_key_exists($keys[6], $arr)) {\n $this->setProdAlt4($arr[$keys[6]]);\n }\n if (array_key_exists($keys[7], $arr)) {\n $this->setProdCode($arr[$keys[7]]);\n }\n if (array_key_exists($keys[8], $arr)) {\n $this->setProdCategory($arr[$keys[8]]);\n }\n if (array_key_exists($keys[9], $arr)) {\n $this->setProdCategoryShipping($arr[$keys[9]]);\n }\n if (array_key_exists($keys[10], $arr)) {\n $this->setProdWriteup($arr[$keys[10]]);\n }\n if (array_key_exists($keys[11], $arr)) {\n $this->setProdLength($arr[$keys[11]]);\n }\n if (array_key_exists($keys[12], $arr)) {\n $this->setProdWingspan($arr[$keys[12]]);\n }\n if (array_key_exists($keys[13], $arr)) {\n $this->setProdHeight($arr[$keys[13]]);\n }\n if (array_key_exists($keys[14], $arr)) {\n $this->setProdScale($arr[$keys[14]]);\n }\n if (array_key_exists($keys[15], $arr)) {\n $this->setProdLinks($arr[$keys[15]]);\n }\n if (array_key_exists($keys[16], $arr)) {\n $this->setProdLinkdescription($arr[$keys[16]]);\n }\n if (array_key_exists($keys[17], $arr)) {\n $this->setProdFront($arr[$keys[17]]);\n }\n if (array_key_exists($keys[18], $arr)) {\n $this->setProdKeywords($arr[$keys[18]]);\n }\n if (array_key_exists($keys[19], $arr)) {\n $this->setProdKeywordsWriteup($arr[$keys[19]]);\n }\n if (array_key_exists($keys[20], $arr)) {\n $this->setProdTitle($arr[$keys[20]]);\n }\n if (array_key_exists($keys[21], $arr)) {\n $this->setProdDescription($arr[$keys[21]]);\n }\n if (array_key_exists($keys[22], $arr)) {\n $this->setProdGeneral($arr[$keys[22]]);\n }\n if (array_key_exists($keys[23], $arr)) {\n $this->setProdEra($arr[$keys[23]]);\n }\n if (array_key_exists($keys[24], $arr)) {\n $this->setProdCompany($arr[$keys[24]]);\n }\n if (array_key_exists($keys[25], $arr)) {\n $this->setProdRelated($arr[$keys[25]]);\n }\n if (array_key_exists($keys[26], $arr)) {\n $this->setProdRelatedPa($arr[$keys[26]]);\n }\n if (array_key_exists($keys[27], $arr)) {\n $this->setProdRelatedM3($arr[$keys[27]]);\n }\n if (array_key_exists($keys[28], $arr)) {\n $this->setProdRelated2($arr[$keys[28]]);\n }\n if (array_key_exists($keys[29], $arr)) {\n $this->setProdSaveas($arr[$keys[29]]);\n }\n if (array_key_exists($keys[30], $arr)) {\n $this->setProdAircraftreg($arr[$keys[30]]);\n }\n if (array_key_exists($keys[31], $arr)) {\n $this->setMb($arr[$keys[31]]);\n }\n if (array_key_exists($keys[32], $arr)) {\n $this->setPa($arr[$keys[32]]);\n }\n if (array_key_exists($keys[33], $arr)) {\n $this->setM3($arr[$keys[33]]);\n }\n }", "function woocommerce_product( $id ) {\n\t\t\n\t\t$this->id = $id;\n\n\t\t$product_custom_fields = get_post_custom( $this->id );\n\n\t\tif (isset($product_custom_fields['SKU'][0]) && !empty($product_custom_fields['SKU'][0])) $this->sku = $product_custom_fields['SKU'][0]; else $this->sku = $this->id;\n\t\t\n\t\tif (isset($product_custom_fields['product_data'][0])) $this->data = maybe_unserialize( $product_custom_fields['product_data'][0] ); else $this->data = '';\n\t\t\n\t\tif (isset($product_custom_fields['product_attributes'][0])) $this->attributes = maybe_unserialize( $product_custom_fields['product_attributes'][0] ); else $this->attributes = array();\t\t\n\t\t\n\t\tif (isset($product_custom_fields['price'][0])) $this->price = $product_custom_fields['price'][0]; else $this->price = 0;\n\n\t\tif (isset($product_custom_fields['visibility'][0])) $this->visibility = $product_custom_fields['visibility'][0]; else $this->visibility = 'hidden';\n\t\t\n\t\tif (isset($product_custom_fields['stock'][0])) $this->stock = $product_custom_fields['stock'][0]; else $this->stock = 0;\n\t\t\n\t\t// Again just in case, to fix WP bug\n\t\t$this->data = maybe_unserialize( $this->data );\n\t\t$this->attributes = maybe_unserialize( $this->attributes );\n\t\t\n\t\t$terms = wp_get_object_terms( $id, 'product_type' );\n\t\tif (!is_wp_error($terms) && $terms) :\n\t\t\t$term = current($terms);\n\t\t\t$this->product_type = $term->slug; \n\t\telse :\n\t\t\t$this->product_type = 'simple';\n\t\tendif;\n\t\t\n\t\t$this->get_children();\n\t\t\n\t\tif ($this->data) :\n\t\t\t$this->exists = true;\t\t\n\t\telse :\n\t\t\t$this->exists = false;\t\n\t\tendif;\n\t}", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function getProductID()\n {\n return $this->productID;\n }", "public function setProductIdAttribute($input)\n {\n $this->attributes['product_id'] = $input ? $input : null;\n }", "public function findProductById(int $idProduct): ?object {\n\t\t// crete Default Var\n\t\t$objProduct = null;\n\t\ttry {\n\t\t\t// create Query Builder \n\t \t$qb = $this->em->createQueryBuilder();\n\t \t// create Query\n\t \t$objProduct = $qb->select('p')\n\t\t\t ->from(Product::class, 'p')\n\t\t\t ->where('p.id = :id')\n\t\t\t ->andWhere('p.status = :status')\n\t\t\t ->setParameter('id', $idProduct\t)\n\t\t\t ->setParameter('status', 1)\n\t\t\t ->getQuery()\n\t\t\t ->getOneOrNullResult();\n \t\t} catch (\\Exception $ex) {\n \t\t\t//dd($ex);\n \t\t}\n \t\t// default Return\n \t\treturn $objProduct;\n\t}", "public function issetProductType(): bool\n {\n return isset($this->productType);\n }", "public function nullId()\n {\n $this->id = null;\n }", "public function getProdCode()\n {\n return $this->prod_code;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function __construct(Product $product = null)\n {\n $this->locale = Locale::workingLocale();\n $this->productEntity = $product;\n $this->specification_values = new ArrayCollection();\n $this->remove_specification_values = new ArrayCollection();\n $this->specials = new ArrayCollection();\n $this->remove_specials = new ArrayCollection();\n $this->dimensions = new ArrayCollection();\n $this->remove_dimensions = new ArrayCollection();\n $this->dimension_notifications = new ArrayCollection();\n $this->remove_dimension_notifications = new ArrayCollection();\n $this->related_products = new ArrayCollection();\n $this->up_sell_products = new ArrayCollection();\n $this->remove_up_sell_products = new ArrayCollection();\n $this->remove_related_products = new ArrayCollection();\n $this->images = MediaGroup::create(MediaGroupType::fromString(Type::IMAGE));\n $this->downloads = MediaGroup::create(MediaGroupType::fromString(Type::FILE));\n $this->weight = (float)0.00;\n $this->sequence = $this->getProductRepository()->getNextSequence($this->locale, $this->category);\n\n if (!$this->hasExistingProduct()) {\n return;\n }\n\n $this->id = $product->getId();\n $this->meta = $product->getMeta();\n $this->category = $product->getCategory();\n $this->brand = $product->getBrand();\n $this->vat = $product->getVat();\n $this->stock_status = $product->getStockStatus();\n $this->hidden = $product->isHidden();\n $this->type = $product->getType();\n $this->min_width = $product->getMinWidth();\n $this->min_height = $product->getMinHeight();\n $this->max_width = $product->getMaxWidth();\n $this->max_height = $product->getMaxHeight();\n $this->extra_production_width = $product->getExtraProductionWidth();\n $this->extra_production_height = $product->getExtraProductionHeight();\n $this->title = $product->getTitle();\n $this->summary = $product->getSummary();\n $this->text = $product->getText();\n $this->dimension_instructions = $product->getDimensionInstructions();\n $this->locale = $product->getLocale();\n $this->weight = $product->getWeight();\n $this->price = $product->getPrice();\n $this->stock = $product->getStock();\n $this->order_quantity = $product->getOrderQuantity();\n $this->from_stock = $product->isFromStock();\n $this->sku = $product->getSku();\n $this->ean13 = $product->getEan13();\n $this->isbn = $product->getIsbn();\n $this->sequence = $product->getSequence();\n $this->specification_values = $product->getSpecificationValues();\n $this->specials = $product->getSpecials();\n $this->dimensions = $product->getDimensions();\n $this->dimension_notifications = $product->getDimensionNotifications();\n $this->images = $product->getImages();\n $this->downloads = $product->getDownloads();\n $this->related_products = $product->getRelatedProducts();\n $this->up_sell_products = $product->getUpSellProducts();\n\n // just a fallback\n if (!$this->images instanceof MediaGroup) {\n $this->images = MediaGroup::create(MediaGroupType::fromString(Type::IMAGE));\n }\n\n // just a fallback\n if (!$this->downloads instanceof MediaGroup) {\n $this->downloads = MediaGroup::create(MediaGroupType::fromString(Type::FILE));\n }\n }", "public function getProductid() {\n\t\treturn $this->productid;\n\t}", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "function eZCompanyType( $id = -1 )\r\n {\r\n if ( $id != -1 )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }", "function getProductType($cat_id,$subcat_id){\n $productType_info= ProductType::find()\n ->where(['cat_id' => $cat_id,'subcat_id'=>$subcat_id])\n ->asArray()\n ->one();\n unset($productType_info['id']); unset( $productType_info['cat_id']); unset( $productType_info['subcat_id']); unset( $productType_info['site_id']);\n if($productType_info['special_upc']){\n $productType_info['special_upc']=explode(',', $productType_info['special_upc']);\n }\n if($productType_info['product_type']){\n $productType_info['product_type']=explode(',', $productType_info['product_type']);\n }\n return $productType_info;\n\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function productType()\n {\n return $this->belongsTo(\\App\\Models\\ProductType::class, \"product_type_id\", \"id\");\n }", "protected function _initProduct()\n {\n Mage::dispatchEvent('review_controller_product_init_before', array('controller_action' => $this));\n\n $productId = (int) $this->getRequest()->getParam('id');\n $product = $this->_loadProduct($productId);\n\n try {\n Mage::dispatchEvent('review_controller_product_init', array('product' => $product));\n Mage::dispatchEvent('review_controller_product_init_after', array(\n 'product' => $product,\n 'controller_action' => $this\n ));\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n return false;\n }\n\n return $product;\n }", "function getProductCode()\n {\n return $this->productCode;\n }", "protected function _getProduto(){\n if (!is_object($this->_produto)){\n $this->_produto = new Vendas_Model_Produto_Mapper();\n }\n return $this->_produto;\n }", "public function getProductId($item, $product) \n {\n\t$productId = null;\n\tif ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) {\n\t //try getting from selected simple product first\n\t $simpleProduct = Mage::helper('temando/v2')->getSelectedSimpleFromConfigurable($product, $item);\n\t $productId = $simpleProduct->getEntityId();\n\t}\n\t\n\tif(!$productId) {\n\t $productId = $item->getProductId();\n\t}\n\t\n\treturn $productId;\n }", "public function getEntityTypeCode()\n {\n return 'catalog_product';\n }", "public function getProductId() : int\n {\n return (int)$this->getProduct()->getId();\n }", "public function getCodigoProducto()\n {\n return $this->codigoProducto;\n }", "function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}", "public function getIdCategoriaProducto()\n {\n return $this->id_categoria_producto;\n }", "public function _getProduct() {\n \n // get website id from request\n $websiteId = ( int ) $this->getRequest ()->getParam ( static::WEBSITE_ID );\n if ($websiteId <= 0) {\n $websiteId = Mage::app ()->getWebsite ( 'base' )->getId ();\n }\n \n // get store id from request\n $storeId = ( int ) $this->getRequest ()->getParam ( static::STORE_ID );\n if ($storeId <= 0) {\n $storeId = Mage::app ()->getWebsite ( $websiteId )->getDefaultGroup ()->getDefaultStoreId ();\n }\n if (is_null ( $this->_product )) {\n $productId = $this->getRequest ()->getParam ( 'id' );\n /**\n *\n * @var $productHelper Mage_Catalog_Helper_Product\n */\n $productHelper = Mage::helper ( 'catalog/product' );\n $product = $productHelper->getProduct ( $productId, $storeId );\n if (! ($product->getId ())) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n // check if product belongs to website current\n if ($this->_getStore ()->getId ()) {\n $isValidWebsite = in_array ( $websiteId, $product->getWebsiteIds () );\n if (! $isValidWebsite) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n }\n // Check display settings for customers & guests\n if ($this->getApiUser ()->getType () != Mage_Api2_Model_Auth_User_Admin::USER_TYPE) {\n // check if product assigned to any website and can be shown\n if ((! Mage::app ()->isSingleStoreMode () && ! count ( $product->getWebsiteIds () )) || ! $productHelper->canShow ( $product )) {\n $this->_critical ( static::RESOURCE_NOT_FOUND );\n }\n }\n $this->_product = $product;\n }\n return $this->_product;\n }", "public function getProductIdFieldName() {\n return 'products_id';\n }", "public function getId(){\n return $this->__get('catalog_id');\n }", "function clearProduct($id = null) {\n $keys = array(\n \"PRODUCT_BASE_{$id}\",\n \"PRODUCT_IS_FEATURED_{$id}\",\n \"PRODUCT_PRICE_{$id}\",\n \"PRODUCT_RATING_COUNTSUM_{$id}\",\n \"PRODUCT_CP_ID_{$id}\",\n \"PRODUCT_AVG_RATING_{$id}\",\n \"PRODUCT_TOTAL_RATING_{$id}\",\n \"EAV_FULL_Model_ProductMeta_{$id}\"\n );\n $this->clear($keys);\n $this->clearType('device'); //because device types are stored by hash. need to clear all\n $this->clearType('category'); //ditto for category\n }", "public function testIfStockManagementHasProductId()\n {\n $this->assertNotNull($this->stock->getProductId());\n }", "function setSyncItemsCodeProduct()\n {\n }", "public function getProductOptionId();", "public function getProductDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $productId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `productId`\n FROM `product`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [productId],\n FROM [product]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT PRODUCTID AS \\\"productId\\\",\n FROM PRODUCT\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n }\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $productId = $row['productId'];\n }\n return $productId;\n }", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public static function loadProductByProId($p_proId)\n {\n $sql = \"select * from products where ProID = $p_proId\";\n $list = DataProviderMain::execQuery($sql);\n if ($row = mysqli_fetch_array($list)) {\n\n //$proId = $row[\"ProID\"];\n //$proId = $p_proId;\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($p_proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n return $p;\n }\n\n return NULL;\n }", "function initialiserId()\n {\n if(empty($this->m_idOption))\n {\n $requete = 'SELECT idOption FROM optionHotel WHERE libelleOption=? AND prixOption=?';\n $tabParametres = array($this->m_libelleOption, $this->m_prixOption);\n $tabResultat = $this->m_bdd->selection($requete, $tabParametres);\n $this->m_idOption = $tabResultat[0]['idOption']; \n }\n }", "public function getPrimaryKey()\n {\n return $this->getProdId();\n }", "public function setProduct_type ($product_type) {\n\t$this->product_type = $product_type;\n\treturn $this;\n}", "public function getProductsId()\n {\n return $this->productsId;\n }" ]
[ "0.62798285", "0.6253638", "0.62344986", "0.61911905", "0.61019564", "0.5761952", "0.57483435", "0.57340246", "0.5716952", "0.5711977", "0.5705271", "0.570139", "0.5630219", "0.56240016", "0.5599791", "0.55913496", "0.55913496", "0.55482346", "0.5516705", "0.54830414", "0.54423463", "0.5441157", "0.5433421", "0.5431293", "0.5431293", "0.5431293", "0.5422724", "0.53990614", "0.5383596", "0.5382405", "0.5379384", "0.53616583", "0.53560895", "0.5350448", "0.5347196", "0.5342827", "0.53426814", "0.53397715", "0.532813", "0.5322277", "0.53182256", "0.53120106", "0.5309324", "0.53003514", "0.5271386", "0.52583486", "0.5254193", "0.52372444", "0.52356255", "0.5224497", "0.5219829", "0.52108383", "0.5209446", "0.52008146", "0.51990193", "0.51736474", "0.5167439", "0.5161891", "0.51609635", "0.51595086", "0.51588416", "0.5155242", "0.5155242", "0.5155242", "0.5150037", "0.5130243", "0.51226264", "0.5115082", "0.5111166", "0.50993454", "0.5096286", "0.50944275", "0.50918615", "0.5089864", "0.5089082", "0.50820196", "0.5079073", "0.50788295", "0.5060306", "0.5048289", "0.50457114", "0.5039544", "0.5039361", "0.50363576", "0.5036144", "0.5026175", "0.5021753", "0.5021358", "0.5016268", "0.50143117", "0.5008057", "0.49912968", "0.49907672", "0.4985324", "0.4982824", "0.49761534", "0.4961154", "0.49560365", "0.49546614", "0.49484164" ]
0.5834502
5
Returns user status record
public function getRecordById($id) { if ($id) { return $this->getRecord($id); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUser_status_id()\n {\n return $this->user_status_id;\n }", "public function getStatus()\n {\n $userid = $this->user_id;\n $user = User::findIdentity($userid);\n if($user):\n $status = User::STATUS_ACTIVE;\n else:\n $status = User::STATUS_DELETED;\n endif;\n return $status;\n }", "public function status()\n {\n return $this->UserAPI->request_status_check();\n }", "public function getStatus() \n {\n if ($this->status) \n {\n \techo 'user status : присутствует<br><br><br>';\n }\n else\n {\n \techo 'user status : отсутствует<br><br><br>';\t\n }\n }", "public function getStatus()\n {\n \n return $this->_em->createQuery('SELECT s,u FROM TechCorpFrontBundle:Status s \n JOIN s.user u ORDER BY s.createdAt DESC');\n }", "function getUserStatus(){\n\t\t//$org_id=$this->session->userdata('organisation_id');\n\t\t//$qry=$this->db->where( 'organisation_id', $org_id );\n\t\t//---\n\t\t$qry=$this->db->get('user_statuses');\n\t\t$count=$qry->num_rows();\n\t\t\t$s= $qry->result_array();\n\t\t\n\t\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\n\t\t\t$status[$s[$i]['id']]=$s[$i]['name'];\n\t\t\t}\n\t\t\treturn $status;\n\t}", "protected function getStatus($userId){\n try{\n $query = \"SELECT status FROM users WHERE id = ?\";\n $stmt = $this->getConnection($query);\n $stmt->bind_param('i', $userId);\n $stmt->execute();\n $stmt->bind_result($status);\n $stmt->fetch();\n $aggStatus[] = array(\n 'status' => $status\n );\n $stmt->close();\n\n return $aggStatus;\n }catch(Exception $e){\n die('Error - Cannot get the aggregator status');\n }\n }", "function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}", "public function getUserStatusId($user_id)\n\t{\n\t\treturn DB::table($this->table)->where('id', '=', $user_id)->pluck('user_status');\n\t}", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "public function getStatusAttribute()\n {\n return $this->attributes['status'] = Cache::get('User::'.$this->id.'::status', false);\n }", "public function show(User_status $userstatus)\n {\n //\n }", "public function getUserData()\n\t{\n\t\t$fbuid = $this->getFBUID();\n\t\t$rs = $this->db->query(\"SELECT * from selective_status_users where fbuid = \" . $this->db->quote($fbuid) . \" limit 1\");\n\t\tif ($rs && $row = $rs->fetch()) {\n\t\t\treturn $row;\n\t\t}\n\t}", "function showUsersStatus($user){\n\t if (sizeof($this->members) == 1){\n\t $table = '<h4 class=\"text-warning\">\n No other members here...</h4>';\n\t } else {\n\t $table = '<table class=\"table table-striped table-hover\">\n\t\t\t\t<tHead>\n\t\t\t\t<tr>\n\t\t\t\t<th>Name</th><th>Status</th><th>Level</th>\n\t\t\t\t</tr>\n\t\t\t\t</tHead>\n\t\t\t\t<tBody>';\n\t foreach ($this->members as $member){\n\t if($member->getUserID() != $user->getUserID()){\n\t $table .= $member->getUserStatusAsRow();\n\t }\n\t }\n\t $table .= '\n\t\t\t\t</tBody></table>';\n\t }\n\t\t\n\t\treturn $table;\n\t}", "public function display_user_status($status){\n\t\tif($status == '0'){\n\t\t\t$st = 'Active';\n\t\t}elseif($status == '1'){\t\n\t \t\t$st = 'Inactive';\n\t\t}\n\t\treturn $st;\n\t}", "public function status()\n {\n //retorna un solo objeto, ya que el usuario solo tiene un status\n return $this->belongsTo('Vest\\Tables\\Status');\n }", "function getDetailedStatus() ;", "public function getStatus()\n {\n //return the status quote for the user based on their level\n return $this->getStatusQuote();\n }", "function checkUserstat($user) {\r\n\t\tglobal $con;\r\n\t$stmtc = $con->prepare(\"SELECT \r\n\t\t\t\t\t\t\t\t\t username, RegStatus \r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\tusers \r\n\t\t\t\t\t\t\t\tWHERE \t\r\n\r\n\t\t\t\t\t\t\t\t\tRegStatus = 0 \r\n\t\t\t\t\t\t\t\t\" );\r\n\t\t$stmtc->execute(array($user));\r\n\t\t$status = $stmtc->rowCount();\r\n\t\treturn $status;\r\n\t\t}", "function get_status() {\n return $this->status;\n }", "public function get_status(){\n return $this->status;\n }", "public function getLPStatusForUser($a_user_id);", "function checkUserStatus($user){\n \n global $con;\n $stmt = $con->prepare(\"SELECT Username , RegStatus FROM users WHERE Username = ? AND RegStatus = 0 \");\n $stmt->execute(array($user));\n \n $status = $stmt->rowCount();\n return $status;\n}", "public static function checkUserStatus(){\n\n if (auth()->user()->is_status == '3') {\n $rul = 'profile/create';\n }elseif (auth()->user()->is_status=='2'){\n $service = self::checkService();\n if ($service==false){\n $rul = \"choose-service\";\n }else{\n $rul = self::dashboard($service);\n }\n }elseif (auth()->user()->is_status=='1'){\n $rul = 'profile done!';\n }elseif (auth()->user()->is_status==0){\n $rul = 'profile inactive!';\n }else{\n $rul = '/home';\n }\n return $rul;\n }", "public function update_user_status(){\n\tif($this->session->userdata('logged_in')){\n\t\t//cleanup old logins\n\t\t$this->um_users_model->cleanup_expired_logins();\n\t\t//report the current status\n\t\t$session_data= $this->session->userdata('logged_in');\n\t\t$dbdata=array(\n\t\t\t'loggedusername'=>$session_data['username'],\n\t\t\t'ip'=>$this->session->userdata('ip_address'),\n\t\t\t'lastactivity'=>time(),\n\t\t\t'useragent'=>$this->session->userdata('user_agent'),\n\t\t\t'online'=>$this->um_users_model->get_user_online_setting($session_data['username'])\n\t\t);\n\t\t\n\t\tif($this->um_users_model->is_user_logged_in($session_data['username'])){\n\t\t\t$this->um_users_model->update_user_logged_in($session_data['username'],$dbdata);\n\t\t}else{\n\t\t\t$this->um_users_model->register_user_as_logged_in($dbdata);\n\t\t}\n\t\n\t}\n\t}", "public function checkUserStatus($userId)\n {\n return User::where('id',$userId)->first();\n }", "public function getAuditionStatus(){\n if(isset($_GET['user_id'])){\n $user_id = $_GET['user_id'];\n \n $audition = Audition::where('user_id',$user_id)->first();\n if($audition == null){\n $responseData = Helper::setResponse('fail','User Has Not Submit Form','','');\n }\n else{\n if($app_status=\\App\\App::where('name','Registration')->first())\n {\n $audition->setAttribute('registration_open',$app_status->status==1?true:false);\n }\n $responseData = Helper::setResponse('success','Payment Information Listing Successfull',$audition,'');\n }\n\n return response()->json($responseData);\n\n }\n else{\n $responseData = Helper::setResponse('fail','Parameter Missing','','');\n return response()->json($responseData);\n }\n\n\n }", "function getAppStatus($userid) {\n $sql = \"SELECT * FROM `appstatus` WHERE userid = '$userid'\";\n return $this->query($sql);\n }", "public function status()\n {\n return $this->status->get($this->entity->status);\n }", "function _lookupStatus($a_obj_id, $a_user_id)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\t$set = $ilDB->queryF(\"SELECT status FROM il_wiki_contributor \".\r\n\t\t\t\"WHERE wiki_id = %s and user_id = %s\",\r\n\t\t\tarray(\"integer\", \"integer\"),\r\n\t\t\tarray($a_obj_id, $a_user_id));\r\n\t\tif($row = $ilDB->fetchAssoc($set))\r\n\t\t{\r\n\t\t\treturn $row[\"status\"];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function getStatus(){\r\n $data_status = $this->db->get('status')->result(); \r\n return $data_status;\r\n }", "public function getDetailedStatus() {}", "function get_status()\n {\n foreach ($this->data as $row => $value)\n {\n $data['completed'][$value] = $this->recruitment_model->check_filled($this->user_id,$value);\n }\n return $data['completed'];\n }", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getUserStatusInQuests($user);", "public function status() {\n $status = $this->statuses()->orderBy('created_at','desc')->first();\n\n if(is_null($status)) {\n return new Status;\n }\n else return $status;\n }", "function getStatus() {\n\t\treturn $this->getData('status');\n\t}", "public function index()\n\t{\n $models = User::with('status')->get();\n return $this->getCollectionResponse($models);\n\t}", "public function get_status() \n {\n $sess_stat= Session::instance()->get(\"hana_status\", array());\n if(!empty($sess_stat)) $this->status=$sess_stat;\n return $this->status;\n }", "function checkUserStatus($user){\n global $con;\n $stmtx = $con->prepare(\"SELECT \n UserName, RegStatus \n FROM \n users \n WHERE \n UserName = ? \n AND \n RegStatus = 0 \n \");\n \n \n $stmtx->execute(array($user));\n $status = $stmtx->rowCount();\n return $status;\n}", "abstract public function GetStatus();", "public function _checkAndGetUserActive()\n {\n return $this->find('id_user,name,lastname,email,salt,password', [\n 'username' => $this->username,\n 'sw_active' => 1\n ]);\n }", "public function user_status_cls($status){\n\t\tif($status == '0'){\n\t\t $stat = 'success';\n\t\t}elseif($status == '1'){\n\t\t $stat = 'important';\t\n\t\t}\n\t\treturn $stat;\n\t}", "public function index()\n\t{\n\t\t$operation = \"get\";\n\t\t$success = true;\n\t\t$errors = [];\n\n\t\t$user = Auth::user();\n\n\t\t$data = Status::findByUserId($user->id);\n\n\t\treturn compact('operation', 'success', 'data', 'errors');\n\t}", "public function UserDetails($user_id=\"\"){\n\t\t\t$broker_userdet = $this->db->prepare(\"SELECT * FROM users WHERE status = :status AND id =:id \");\n\t\t\t$broker_userdet->execute(array(\"status\"=>1,\"id\"=>$user_id));\n\t\t\t$row = $broker_userdet->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "public function getUserDefaultStatus();", "public function get_status() {\n return $this->status;\n }", "public function getUserStatusMessage()\n {\n return $this->user_status_message;\n }", "function people_getUploadStatus () {\n $response = $this->execute(array('method' => 'flickr.people.getUploadStatus'));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getUser_status_role()\n {\n return $this->user_status_role;\n }", "public function statuses()\n\t{\n\t\treturn $this->hasMany('Afreshysoc\\Models\\Status',\n\t\t\t'user_id');\n\t}", "public function index($status)\n {\n $userCollection = $this->userEngine->prepareUsersList($status);\n\n $requireColumns = [\n 'creation_date' => function ($key) use ($status) {\n if ((int) $status === 5) {\n return formatStoreDateTime($key['updated_at']);\n } else {\n return formatStoreDateTime($key['created_at']);\n }\n },\n 'last_login' => function ($key) {\n if (!__isEmpty($key['last_login'])) {\n return formatStoreDateTime($key['last_login']);\n }\n },\n 'id',\n 'status',\n 'role',\n 'name',\n 'email',\n ];\n\n return __dataTable($userCollection, $requireColumns);\n }", "public function status()\n\t{\n\t\treturn $this->hasOne(Status::class,'id','status_id');\t\t\t\t\n\t}", "public static function getUserStatus($status_id)\n\t{\n\t\treturn DB::table('user_status')->where('id', '=', $status_id)->pluck('status');\n\t}", "public function getStatus()\n {\n return $this->getData('status');\n }", "private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }", "function phb_is_get_user_status($event_id,$user_id)\r\n\t{\r\n global $SITE_URL;\r\n\t\t hb_set_then_go(\"change_invitation_status_then_go\",$SITE_URL.\"future_event.php\");\r\n\t\t if($event_id!=\"\" && $user_id!=\"\")\r\n\t\t {\r\n\t\t $select_status=\"select * from tbl_invitation_responce where user_id='$user_id' and event_id='$event_id'\";\r\n\t\t $status_result=hb_mysql_query($select_status);\r\n\t\t $row_status=hb_mysql_num_rows($status_result);\r\n\t\t\t if($row_status > 0)\r\n\t\t\t {\r\n\t\t\t\t $status_data=hb_mysql_fetch_array($status_result);\r\n\t\t\t\t$rid=$status_data['id'];\r\n\t\t\t\t$uid=$status_data['user_id'];\r\n\t\t\t\t if($status_data['status']==\"1\")\r\n\t\t\t\t {\r\n\t\t\t\t\t return \"<span class='green'>Joining</span> <br> <span class='white'>Change :</span> <a href='join_event.php?event_id=$event_id&status=maybe&type=direct&rid=$rid&u=$uid'>May Be</a> | <a href='join_event.php?event_id=$event_id&status=declined&type=direct&rid=$rid&u=$uid'>Not Joining</a>\" ;\r\n\t\t\t\t }else if($status_data['status']==\"2\")\r\n\t\t\t\t {\r\n\t\t\t\t\t return \"<span class='green'>Maybe</span><br> <span class='white'>Change :</span><a href='join_event.php?event_id=$event_id&status=active&type=direct&rid=$rid&u=$uid'>Join</a>\" ;\r\n\t\t\t\t }else{\r\n\t\t\t\t\t return \"<span class='green'>Not Joining</span> <Br><span class='white'> Change :</span> <a href='join_event.php?event_id=$event_id&status=maybe&type=direct&rid=$rid&u=$uid'>Join</a> | <a href='join_event.php?event_id=$event_id&status=maybe&type=direct&rid=$rid&u=$uid'>May Be</a> \";\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t \r\n\t\t }\r\n\t\r\n\t}", "protected function getRecordRegistrationStatus() {}", "public function get_status() {\n return $this->_status;\n }", "public function status();", "public function status();", "public function testUpdateStatusByUserId()\n {\n $session = $this->objectManager->create(\\Magento\\Security\\Model\\AdminSessionInfo::class);\n /** @var $session \\Magento\\Security\\Model\\AdminSessionInfo */\n $session->getResource()->updateStatusByUserId(\n \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN,\n 1,\n [1],\n [1],\n '2016-01-19 12:00:00'\n );\n $collection = $session->getResourceCollection()\n ->addFieldToFilter('main_table.user_id', 1)\n ->addFieldToFilter('main_table.status', \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN)\n ->load();\n $count = $collection->count();\n $this->assertGreaterThanOrEqual(1, $count);\n }", "public function statuses() {\n return $this->hasMany('App\\Models\\Status', 'user_id'); // user_id coming from statues table\n }", "function getuser()\n\t {\n\t \t//$this->db->where('as', null);\n\t \t\n\t \t$where = '(status=\"aktif\" or status is null)';\n \t$this->db->where($where);\n \t\t\n\t \t$query = $this->db->get('user');\n\t \tif ($query -> num_rows() > 0)\n\t\t{\n\t \t\treturn $query->result();\n\t \t}else{\n\t \t\treturn false;\n\t \t}\n\t }", "function getActiveUserCount(){\n $dbobj = DB::connect();\n $sql = \"SELECT count(usr_status) FROM tbl_users WHERE usr_status=1\";\n $result = $dbobj->query($sql);\n if($dbobj->errno){\n echo(\"SQL Error : \" .$dbobj->error);\n exit;\n }\n $rec = $result->fetch_array();\n echo ($rec[0]);\n\n $dbobj->close();\n}", "public function show($id)\n {\n $statusObj = QueryStatus::where('userID', $id)->get();\n return $statusObj;\n }", "public function getStatus()\n {\n return $this->data['status'];\n }", "function get_status($udid = '', $txid = '', $added = 0, $start = 0, $limit = 10) {\n $query['mode'] = 'status';\n if ($udid) {\n $query['udid'] = $udid;\n }\n\n if ($txid) {\n $query['transaction_id'] = $txid;\n }\n if ($added) {\n $query['added'] = $added;\n }\n\n\n $query['start'] = $start;\n $query['limit'] = $limit;\n $response = $this->api_query($query);\n\n //var_dump($query);\n\n if ($response['error']) {\n return false;\n }\n return ($response['data']);\n }", "function getStatus() {\n return $this->status;\n }", "protected static function status(): mixed\n\t{\n\t\treturn self::$query->status;\n\t}", "public function status()\r\n {\r\n return $this->status;\r\n }", "public function getStatus(){\n\t\treturn $this->status;\n\t}", "function getStatus()\n {\n return $this->status;\n }", "function status_user($pseudo){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT status_utilisateur FROM utilisateur WHERE pseudo = :pseudo\");\n\t\t$req->execute(array(\"pseudo\"=>$pseudo));\n\n\t\twhile($results = $req->fetch()){\n\t\t\t$result = $results[\"status_utilisateur\"];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function status()\n {\n $response = $this->call(Request::METHOD_GET, '/api/v1/status');\n return $response->getApiData();\n }", "public function status()\n {\n if (auth::check()) {\n if (auth::user()->auth == 1) {\n $status = status::all();\n return view('backend.pengaturan.status', compact('status'));\n }\n }\n }", "public function status()\n {\n return $this->hasOne(StatusRequest::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::STATUS_FOREIGN_KEY);\n }", "function checkUserStatus($user){\n global $con;\n\n $userStatus = $con->prepare(\"SELECT User_Name, Reg_Status FROM users WHERE User_Name=? AND Reg_Status=0\");\n\n $userStatus->execute(array($user));\n\n $userNum=$userStatus->rowCount();\n\n return $userNum;\n}", "public function active_userstatus($id)\n {\n \n $query = new Query;\n\n $result = $query->createCommand()->update('core_users', ['user_status' => '2'], 'user_id = \"'.$id.'\"')->execute();\n\n if ($result == 1){\n return \"SUCCESS\";\n }else{\n return \"FAILED\";\n }\n }", "function _lookupStatusTime($a_obj_id, $a_user_id)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\t$set = $ilDB->queryF(\"SELECT status_time FROM il_wiki_contributor \".\r\n\t\t\t\"WHERE wiki_id = %s and user_id = %s\",\r\n\t\t\tarray(\"integer\", \"integer\"),\r\n\t\t\tarray($a_obj_id, $a_user_id));\r\n\t\tif($row = $ilDB->fetchAssoc($set))\r\n\t\t{\r\n\t\t\treturn $row[\"status_time\"];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function user_statuses()\n {\n return $this->belongsTo('App\\UserStatus', 'status_id');\n }", "public function getStatus()\n {\n return $this->hasOne(Status::className(), ['id' => 'status_id']);\n }", "public function status() {\n return $this->hasOne(Status::class, 'id', 'status_id');\n }", "public function status()\n\t{\n\t\treturn $this->hasOne('Quill\\Status\\Models\\Status', 'id', 'status');\n\t}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}" ]
[ "0.73937666", "0.71770835", "0.71592504", "0.71305656", "0.71050054", "0.6863735", "0.6697532", "0.668123", "0.6619078", "0.66138196", "0.66138196", "0.656511", "0.65524304", "0.65452385", "0.65437883", "0.65426856", "0.65288866", "0.65258485", "0.6513734", "0.6504238", "0.6486338", "0.6463998", "0.6444399", "0.6410538", "0.6409705", "0.6406582", "0.640536", "0.64020663", "0.6401003", "0.63861704", "0.6384259", "0.6378834", "0.62993425", "0.62899256", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.62714785", "0.626407", "0.6258619", "0.6254741", "0.62430334", "0.6237824", "0.6232564", "0.62230897", "0.62182873", "0.6216292", "0.62114185", "0.6209977", "0.6208686", "0.6203134", "0.6202334", "0.6195515", "0.61944145", "0.61928105", "0.61885554", "0.61874264", "0.6170725", "0.61696917", "0.6158667", "0.61459124", "0.61397654", "0.61355454", "0.6127991", "0.6127991", "0.61116135", "0.6094284", "0.60932183", "0.60887295", "0.607702", "0.60755724", "0.6071997", "0.606855", "0.60628825", "0.606112", "0.6040718", "0.60337317", "0.6032111", "0.6025294", "0.60175794", "0.6012514", "0.60121924", "0.60029244", "0.6001618", "0.59988654", "0.5998298", "0.5990097", "0.5989736", "0.5983062", "0.5983062", "0.5983062", "0.5983062", "0.5983062", "0.5983062", "0.5983062" ]
0.0
-1
Returns last statuses for each school of the appropriate card types
public function findLastRecordsByUserCardType($userId, $cardTypeId) { $userStatusTypes = IsicDB::factory('UserStatusTypes'); $table = $this->getTableQuoted(); $ustTable = $userStatusTypes->getTableQuoted(); $ustPrimary = $userStatusTypes->getPrimaryKeyQuoted(); $r = $this->db->query( " SELECT $table.* FROM $table, $ustTable WHERE $table.`status_id` = $ustTable.$ustPrimary AND $table.`user_id` = ! AND FIND_IN_SET(!, $ustTable.`card_types`) ORDER BY $table.`school_id`, $table.`active` DESC, $table.`addtime` DESC ", (int)$userId, (int)$cardTypeId ); self::assertResult($r); $prevSchoolId = 0; $statusList = array(); foreach ($r->fetch_all() as $data) { if ($prevSchoolId != $data['school_id']) { $prevSchoolId = $data['school_id']; $statusList[] = $data; } } return $statusList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public static function getStatuses();", "public function get_school_list()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('cms_schools');\n\t\t$this->db->where('schl_status','0');\n\t\t$query = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $query->result();\n\t}", "abstract protected function getStatusesInfos();", "function flashcard_get_completion_state($course, $cm, $userid, $type) {\n global $DB;\n\n // Get flashcard details.\n if (!($flashcard = $DB->get_record('flashcard', array('id' => $cm->instance)))) {\n throw new Exception(\"Can't find flashcard {$cm->instance}\");\n }\n\n $result = $type; // Default return value.\n\n // Completion condition 1 is have no cards in deck.\n\n // Count all cards.\n $allcards = $DB->count_records('flashcard_deckdata', array('flashcardid' => $flashcard->id));\n\n if ($flashcard->completionallgood) {\n\n // Match any card that are NOT in last deck.\n $sql = \"\n SELECT\n COUNT(DISTINCT c.id)\n FROM\n {flashcard_card} c\n WHERE\n c.userid = ? AND\n c.flashcardid = ? AND\n c.deck = ?\n \";\n $good = $DB->count_records_sql($sql, array($userid, $flashcard->id, $flashcard->decks));\n if ($type == COMPLETION_AND) {\n $result = $result && ($good == $allcards);\n } else {\n $result = $result || ($good == $allcards);\n }\n } else if ($flashcard->completionallviewed) {\n // Allgood superseedes allviewed.\n\n // Match distinct viewed cards.\n $sql = \"\n SELECT\n COUNT(DISTINCT c.entryid)\n FROM\n {flashcard_card} c\n WHERE\n c.userid = ? AND\n c.flashcardid = ?\n \";\n $viewed = $DB->count_records_sql($sql, array($userid, $flashcard->id));\n\n if ($type == COMPLETION_AND) {\n $result = $result && ($viewed >= min($allcards, $flashcard->completionallviewed));\n } else {\n $result = $result || ($viewed >= min($allcards, $flashcard->completionallviewed));\n }\n }\n\n // Completion condition 2 is : all cards in last deck (easiest).\n\n return $result;\n}", "public function getBySchool (){\n\t\t\n\t\t$schools = array();\n\t\t\n\t\t$tmp = Util::groupMultiArray($this->data, 'school_id');\n\t\t\n\t\tforeach ($tmp as $school_id => $choicedata){\n $open_email_count = '0';\n $link_visit_open = '0';\n\t\t\tforeach ($choicedata as $choiceid => $choices){\n if(($choices['email_open'] == '1')) {\n $open_email_count++;\n }\n if(($choices['link_visit_open'] == '1')) {\n $link_visit_open++;\n }\n }\n $schools[$school_id][4] = $open_email_count;\n $schools[$school_id][5] = $link_visit_open;\n\t\t\t$activities = Util::groupMultiArray( $choicedata, 'type');\n\t\t\t\n\t\t\t$schools[$school_id][0] = count($choicedata);\n\t\t\t\t\t\t\n\t\t\tforeach ($activities as $typeid => $typedata){\n\t\t\t\t$schools[$school_id]['id'] = $school_id;\n\t\t\t\t$schools[$school_id][$typeid] = count($typedata);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tuasort($schools,'sortByActivity');\n\t\treturn $schools;\n\t}", "protected function _get_card_types()\n\t{\n\t\treturn mod('card_type')->get_list(array('status' => 1));\n\t}", "public function getbal_sy(){\n\t\t$FN = $this->session->userdata('RF');\n\t\t$sql = \"SELECT * from get_Enrolled_CollegeFees WHERE Reference_Number = '$FN' GROUP BY schoolyear DESC\";\n\t\t$result = $this->db->query($sql);\n\n\t\treturn $result;\n\t}", "function get_all_card_types()\n {\n $this->db->order_by('CardTypeID', 'desc');\n return $this->db->get('card_types')->result_array();\n }", "function get_uc_groups_by_school( $school_id = '', $activity_id = '', $check_ell = false, $check_at_risk = false, $grade = 'all', $post_status = 'publish', $school_year = false ) {\n\n\t$classes = get_uc_classes_by_school( $school_id, $check_ell, $check_at_risk, $grade, $post_status ) ;\n\n\tif ( count($classes) ) {\n\n\t\t$args = array(\n\t\t\t'post_type' => 'uc_group',\n\t\t\t'post_status' => $post_status,\n\t\t\t'posts_per_page' => -1,\n\t\t\t'meta_query' => array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t),\n\t\t);\n\n\t\tif ( $school_year ) {\n\t\t\t$school_year_array = get_school_year( $school_year );\n\t\t\t$args['date_query'] = array(\n\t\t\t\tarray(\n\t\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t\t'inclusive' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tforeach ( $classes as $class ) {\n\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'class',\n\t\t\t\t\t'value' => $class['value'],\n\t\t\t);\n\t\t}\n\n\t\t$wp_posts = get_posts( $args );\n\n\t\t$result = array();\n\t\tforeach ($wp_posts as $post) {\n\t\t\t$signup_id = get_post_meta( $post->ID, 'signup', true );\n\t\t\t$group_activity_id = get_post_meta( $signup_id, 'activity', true );\n\t\t\tif ( $group_activity_id == $activity_id )\n\t\t\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t\t}\n\t\treturn $result;\n\t} else\n\t\treturn false;\n}", "public function findAllWithStatusFromLastHour()\n {\n $time = new \\DateTime();\n $time->sub(new \\DateInterval('PT1H'));\n\n return $this->createQueryBuilder('t')\n ->innerJoin('t.statuses', 's')\n ->addSelect('s')\n ->where('s.measuredAt > :time')\n ->setParameter('time', $time)\n ->getQuery()\n ->getResult();\n }", "function get_standard_list($status = 'all')\n\t{\n\t\tif($status != 'all') $this->db->where(\"std_active\",$status);\n\t\t\n\t\t$query = $this->db->get('standards');\n\t\t//echo $this->db->last_query();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result_array();\n\t\t\treturn $result;\n\t\t}\n\t}", "public function get_school($sch_type_id)\n {\n\t$this->db->where('school_type_id', $sch_type_id);\n\t$this->db->where('active', 1);\n\t//$cont_query = $this->db->get_where('school_tb',$cont_array,\"\",\"\");\n\t$cont_query = $this->db->get('school_tb');\n\t//var_dump($cont_query);\n\t//print_r($cont_query->result_array());\n return $cont_query->result_array();\t\t\t\n \n }", "function monitor_list_statuses() {\n $query = \"select distinct(`wf_status`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_status'];\n }\n return $ret;\n }", "function attendance_session_get_highest_status(mod_attendance_structure $att, $attforsession, $scantime = null) {\n // Find the status to set here.\n $statuses = $att->get_statuses();\n $highestavailablegrade = 0;\n $highestavailablestatus = new stdClass();\n // Override time used in status recording.\n $scantime = empty($scantime) ? time() : $scantime;\n foreach ($statuses as $status) {\n if ($status->studentavailability === '0') {\n // This status is never available to students.\n continue;\n }\n if (!empty($status->studentavailability)) {\n $toolateforstatus = (($attforsession->sessdate + ($status->studentavailability * 60)) < $scantime);\n if ($toolateforstatus) {\n continue;\n }\n }\n // This status is available to the student.\n if ($status->grade >= $highestavailablegrade) {\n // This is the most favourable grade so far; save it.\n $highestavailablegrade = $status->grade;\n $highestavailablestatus = $status;\n }\n }\n if (empty($highestavailablestatus)) {\n return false;\n }\n return $highestavailablestatus->id;\n}", "public function getCasesByType($type_cases) {\n if($type_cases == 1)\n {\n $sql = \"SELECT `pk_cases`, `id_cases`, `sub_type_cases`, `comment_cases`, `date_cases`, `config_json_cases`, `fk_users`, `symbol_users` FROM `cases`, `users` WHERE `type_cases` = :type_cases AND `fk_users` = `pk_users`\";\n $query = $this->db->prepare($sql);\n $query->execute(array(':type_cases' => $type_cases));\n }\n\n if($type_cases == 4)\n {\n $sql = \"SELECT `pk_cases`, `id_cases`, `sub_type_cases`, `comment_cases`, `date_cases`, `config_json_cases`, `fk_users`, `symbol_users` FROM `cases`, `users` WHERE `type_cases` = :type_cases AND `fk_users` = `pk_users`\";\n $query = $this->db->prepare($sql);\n $query->execute(array(':type_cases' => $type_cases));\n }\n\n if($type_cases == 2)\n {\n $sql = \"SELECT `pk_cases`, `id_cases`, `sub_type_cases`, `comment_cases`, `date_cases`, `config_json_cases`, `fk_users`, `symbol_users`, `latest_research`, `time_score`, `calculated_score` FROM `cases`, `users` WHERE `type_cases` = :type_cases AND `fk_users` = `pk_users`\";\n $query = $this->db->prepare($sql);\n $query->execute(array(':type_cases' => $type_cases));\n }\n\n return $query->fetchAll();\n }", "function get_uc_groups( $post_status = 'publish', $school_year = false ) {\n\t$args = array(\n\t\t'post_type' => 'uc_group',\n\t\t'post_status' => $post_status,\n\t\t'posts_per_page' => -1,\n\t);\n\n\tif ( $school_year ) {\n\t\t$school_year_array = get_school_year( $school_year );\n\t\t$args['date_query'] = array(\n\t\t\tarray(\n\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t'inclusive' => true,\n\t\t\t)\n\t\t);\n\t}\n\n\t$wp_posts = get_posts( $args );\n\t$result = array();\n\tforeach ($wp_posts as $post) {\n\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t}\n\treturn $result;\n}", "public function statuses() {\n return $this->hasMany('Larabook\\Statuses\\Status')->latest();\n }", "public static function getCurrentInternships($student_id){\n #1:\n $results = DB::table(\"internships\")\n ->join(\"users\",\"users.id\",\"=\",\"internships.framer\")\n ->join(\"managers\",\"managers.id\",\"=\",\"internships.company_framer\")\n ->join(\"companies\",\"managers.company\",\"=\",\"companies.id\")\n ->join(\"registrations\",\"registrations.id\",\"=\",\"internships.student\")\n ->join(\"users as students\",\"students.id\",\"=\",\"registrations.student\")\n ->where(\"students.id\",\"=\",$student_id)\n ->orderBy(\"id\", \"desc\")\n ->select(\"users.firstname\",\"users.lastname\",\"internships.start_date\",\"end_date\",\"managers.name\",\"internships.state\",\"internships.type\",\"companies.name as company_name\",\"internships.id\")\n ->get()->first();\n\n\n // $Intern = array();\n // foreach($results as $res){\n // $startYearIntern = explode(\"-\",$res->start_date)[0];\n // if($startYearIntern == Carbon::now()->year)\n // array_push($Intern,$res);\n // }\n // return $Intern;\n if($results != null) {\n $startYearIntern = explode(\"-\",$results->start_date)[0];\n if($startYearIntern == Carbon::now()->year){\n return array($results);\n }\n }\n return [];\n\n\n }", "public function getLastStatus()\n {\n }", "private function fetchStatuses()\n {\n // if the tag indicates that we should archive the statuses, it's a waste of an SQL\n // call otherwise.\n if ($this->archive) {\n $limit_clause = \" LIMIT \";\n if($this->paging) {\n $limit_clause .= ($this->page * $this->limit).\",\";\n }\n $limit_clause .= $this->limit;\n\n $query = sprintf(\"SELECT * FROM `%s` WHERE id IN (SELECT status_id FROM `%s` WHERE search_id = %s)%s\",\n TasForWp::$StatusByIdTableName,\n TasForWp::$StatusSearchTableName,\n $this->_id,\n $limit_clause\n );\n $rows = $this->_wpdb->get_results($query);\n $this->_nextPage = (count($rows) < $this->limit) ? null : true;\n foreach ($rows as $row) {\n $status_obj = new TwitterStatus($row->id);\n $status_obj->load_json($row->status_json);\n #$status_obj->process_entities();\n $this->_statuses[] = $status_obj;\n }\n } else {\n try {\n $params = array('q' => $this->term, 'include_entities' => 1);\n if($this->limit > 0) {\n $params['rpp'] = $this->limit;\n }\n if(isset($this->page)) {\n $params['page'] = $this->page;\n }\n if(isset($this->max_status_id)) {\n $params['max_id'] = $this->max_status_id;\n }\n $response = $this->tapi->search($params);\n\n $this->_nextPage = $response->next_page;\n $this->_refresh_url = $response->refresh_url; \n\n foreach($response->results as $result)\n {\n $status_obj = new TwitterStatus($this->_wpdb, $this->tapi);\n $status_obj->load_json($result);\n #$status_obj->process_entities();\n $this->_statuses[] = $status_obj;\n }\n } catch (Exception $e) {\n // TODO: Should elegantly inform the user\n }\n }\n }", "protected function getSchoolClass() {\n return Schoolclass::orderBy('class_name')->lists('class_name', 'id')->all();\n }", "public function _get_closed_statuses(){\r\n $inbounds = $this->query(\"SELECT * FROM lead_statuses WHERE header in ( 'Dead Lead (Closed)', 'Sold FollowUp In (Closed)','Sold FollowUp Out (Closed)','Sold Pick-Up (Closed)' ) \");\r\n $statuses = array();\r\n foreach($inbounds as $inbound){\r\n if($inbound['lead_statuses']['name'] == 'Duplicate-Closed'){\r\n continue;\r\n }\r\n $statuses[] = $inbound['lead_statuses']['name'];\r\n }\r\n return $statuses;\r\n }", "function getStandings($allSchools){\n \n $all_records = [];\n $all_leagues = [];\n $brk = [];\n $ccc = [];\n $cra = [];\n $csc = [];\n $ecc = [];\n $fciac = [];\n $nvl = [];\n $nccc = [];\n $scc = [];\n $shr = [];\n $swc = [];\n \n $db_standings = new Database();\n //\n foreach($allSchools as $team){\n $getTeamRecord = \"CALL getRecord('$team[0]')\";\n $record = $db_standings->getData($getTeamRecord);\n $record = getRecords($record, $team);\n\n if($record['league'] == 'Berkshire'){ array_push($brk, $record); }\n elseif($record['league']=='Central Connecticut'){ array_push($ccc, $record); }\n elseif($record['league']=='Capital Region Athletic'){ array_push($cra,$record); }\n elseif($record['league']=='Constitution State'){ array_push($csc, $record); }\n elseif($record['league']=='Eastern Connecticut'){ array_push($ecc, $record); }\n elseif($record['league']=='Fairfield County Interscholastic Athletic'){ array_push($fciac, $record); }\n elseif($record['league']=='Naugatuck Valley'){ array_push($nvl, $record); }\n elseif($record['league']=='North Central Connecticut'){ array_push($nccc, $record); }\n elseif($record['league']=='Southern Connecticut'){ array_push($scc, $record); }\n elseif($record['league']=='Shoreline'){ array_push($shr, $record); }\n elseif($record['league']=='South West'){ array_push($swc, $record); }\n else{ array_push($all_records, $record); }\n\n // Sort brk arrays by overall w,l\n usort($brk,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ccc arrays by overall w,l\n usort($ccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort cra arrays by overall w,l\n usort($cra,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort csc arrays by overall w,l\n usort($csc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort ecc arrays by overall w,l\n usort($ecc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort fcica arrays by overall w,l\n usort($fciac,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nccc arrays by overall w,l\n usort($nccc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort nvl arrays by overall w,l\n usort($nvl,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort scc arrays by overall w,l\n usort($scc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort shr arrays by overall w,l\n usort($shr,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n // Sort swc arrays by overall w,l\n usort($swc,make_comparer(['points',SORT_DESC],['lwin',SORT_DESC],['lloss',SORT_ASC],['lgf',SORT_DESC],['owin',SORT_DESC],['oloss',SORT_ASC],['ogf',SORT_DESC],['team',SORT_ASC]));\n \n // Combine sorted divisions into all leagues array\n $all_leagues = [\n 'berkshire'=>$brk,\n 'capital region athletic'=>$cra,\n 'central connecticut'=>$ccc,\n 'constitution state'=>$csc,\n 'eastern connecticut'=>$ecc,\n 'fairfield county interscholastic athletic'=>$fciac,\n 'north central connecticut'=>$nccc,\n 'naugatuck valley'=>$nvl,\n 'shoreline'=>$shr,\n 'southern connecticut'=>$scc,\n 'south west'=>$swc\n ];\n }\n \n return $all_leagues;\n}", "public function getCurrentlyEnrolledSubjects($studentNumber) {\r\n \r\n $result = array();\r\n\r\n $queryresult = $this->db->query(\"SELECT c.`ID`, c.`STUDENT_NO`, CONCAT(sy.`SY_START`, ' - ', sy.`SY_END`) `SY`, \r\n ss.`SEMESTER`, \r\n CONCAT(UPPER(sub.`SUBJECT_CODE`), ' - ', UPPER(sub.`DESCRIPTION`), ' (', sub.`UNITS`, ' Units) / ', sy.`SY_ABBR`, ' - ', ss.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f.`LAST_NAME`), ' ', UPPER(f.`FIRST_NAME`), ' ', UPPER(IFNULL(f.`MIDDLE_NAME`, ''))), ' / ',\r\n sc.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc.`END_TIME`, '%h:%i%p')) SUBJECT, \r\n sub.`ID` subjectID, c.`SUBJECT_CODE`, sub.`DESCRIPTION` subjectTitle, sub.`UNITS` units\r\n FROM r_student_class_list c\r\n INNER JOIN r_sy sy\r\n ON sy.`ID` = c.`SY`\r\n INNER JOIN r_subject sub\r\n ON sub.`SUBJECT_CODE` = c.`SUBJECT_CODE`\r\n INNER JOIN r_semester ss\r\n ON ss.`ID` = c.`SEM`\r\n INNER JOIN r_schedule sc ON sc.`SECTION_CODE` = c.`SECTION_CODE` AND sc.`SY` = c.`SY` AND sc.`SEM` = c.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f ON f.`FACULTY_CODE` = sc.`FACULTY_CODE`\r\n WHERE c.`STUDENT_NO` = ? AND\r\n sy.`STATUS` = 'Active' AND ss.`STATUS` = 'Active'\", array($studentNumber));\r\n\r\n if($queryresult->num_rows() > 0) {\r\n foreach($queryresult->result() as $rows) {\r\n $result[] = array(\r\n 'SUBJECT_ID' => $rows->ID,\r\n 'SUBJECT' => $rows->SUBJECT,\r\n 'SUBJECT_CODE' => $rows->SUBJECT_CODE,\r\n 'subjectTitle' => $rows->subjectTitle,\r\n 'units' => $rows->units,\r\n 'SY' => $rows->SY,\r\n 'SEMESTER' => $rows->SEMESTER\r\n );\r\n }\r\n }\r\n\r\n return $result;\r\n }", "function getStatus() {\n \t\n \t$status = array();\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_contacter'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"to_contact\"] = $result['num_contact'];\n\n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'contacte'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"contacted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_rappeler'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"call_back\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'termine'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"deleted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_motif FROM mp_activation_motifs\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n\n $status[\"number_motif\"] = $result['num_motif'];\n \n \n return $status;\n }", "protected function _getStatuses()\n\t{\n\t\t$statuses\t= array();\n\t\t$count\t\t= 0;\n\t\t\n\t\tif ( !\\IPS\\Settings::i()->profile_comments OR !\\IPS\\Member::loggedIn()->canAccessModule( \\IPS\\Application\\Module::get( 'core', 'status' ) ) )\n\t\t{\n\t\t\treturn array( 'statuses' => $statuses, 'form' => '', 'count' => $count );\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->status )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$statuses\t= array( \\IPS\\core\\Statuses\\Status::loadAndCheckPerms( \\IPS\\Request::i()->status ) );\n\t\t\t\t$count\t\t= 1;\n\t\t\t}\n\t\t\tcatch ( \\OutOfRangeException $e ) { }\n\t\t}\n\t\t\n\t\tif ( !count( $statuses ) )\n\t\t{\n\t\t\t$_where\t= !\\IPS\\core\\Statuses\\Status::modPermission( 'unhide' ) ? \"status_approved=1 AND \" : '';\n\t\t\t$count = \\IPS\\Db::i()->select( 'count(*)', 'core_member_status_updates', array( \"{$_where} (status_member_id=? or status_author_id=?)\", $this->member->member_id, $this->member->member_id ) )->first();\n\n\t\t\t$statuses = new \\IPS\\Patterns\\ActiveRecordIterator(\n\t\t\t\t\\IPS\\Db::i()->select(\n\t\t\t\t\t\t'*',\n\t\t\t\t\t\t'core_member_status_updates',\n\t\t\t\t\t\tarray( \"{$_where} (status_member_id=? or status_author_id=?)\", $this->member->member_id, $this->member->member_id ),\n\t\t\t\t\t\t'status_date DESC',\n\t\t\t\t\t\tarray( ( intval( \\IPS\\Request::i()->statusPage ?: 1 ) - 1 ) * 25, 25 )\n\t\t\t\t),\n\t\t\t\t'\\IPS\\core\\Statuses\\Status'\n\t\t\t);\n\t\t}\n\t\t\n\t\tif ( \\IPS\\core\\Statuses\\Status::canCreate( \\IPS\\Member::loggedIn() ) AND !isset( \\IPS\\Request::i()->status ) )\n\t\t{\n\t\t\tif ( isset( \\IPS\\Request::i()->status_content_ajax ) )\n\t\t\t{\n\t\t\t\t\\IPS\\Request::i()->status_content = \\IPS\\Request::i()->status_content_ajax;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$form = new \\IPS\\Helpers\\Form( 'new_status', 'status_new' );\n\t\t\tforeach( \\IPS\\core\\Statuses\\Status::formElements() AS $k => $element )\n\t\t\t{\n\t\t\t\t$form->add( $element );\n\t\t\t}\n\t\t\t\n\t\t\tif ( $values = $form->values() )\n\t\t\t{\t\t\t\t\n\t\t\t\t$status = \\IPS\\core\\Statuses\\Status::createFromForm( $values );\n\t\t\t\t\n\t\t\t\tif ( \\IPS\\Request::i()->isAjax() )\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'profile', 'core', 'front' )->statusContainer( $status ) );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\Output::i()->redirect( $status->url() );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$formTpl = $form->customTemplate( array( \\IPS\\Theme::i()->getTemplate( 'forms', 'core' ), 'statusTemplate' ) );\n\t\t\t\n\t\t\tif ( \\IPS\\core\\Statuses\\Status::moderateNewItems( \\IPS\\Member::loggedIn() ) )\n\t\t\t{\n\t\t\t\t$formTpl = \\IPS\\Theme::i()->getTemplate( 'forms', 'core' )->modQueueMessage( \\IPS\\Member::loggedIn()->warnings( 5, NULL, 'mq' ), \\IPS\\Member::loggedIn()->mod_posts ) . $formTpl;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$formTpl = NULL;\n\t\t}\n\n\t\treturn array( 'statuses' => $statuses, 'form' => $formTpl, 'count' => $count );\n\t}", "public function getStatusesList(){\n return $this->_get(1);\n }", "function adleex_resource_filter_status($statuses){\n\t$new_statuses = array(\n 'draft' => $statuses['draft'],\n 'pending' => $statuses['pending'],\n 'publish' => $statuses['publish'],\n 'closed' => $statuses['closed'],\n );\n\t\n\treturn $new_statuses;\n}", "function olc_get_customers_statuses() {\n\n\t$customers_statuses_array = array(array());\n\t$customers_statuses_query = olc_db_query(SELECT.\"customers_status_id, customers_status_name, customers_status_image, customers_status_discount, customers_status_ot_discount_flag, customers_status_ot_discount\".SQL_FROM . TABLE_CUSTOMERS_STATUS . SQL_WHERE.\"language_id = '\" . SESSION_LANGUAGE_ID . \"' order by customers_status_id\");\n\t$i=1; // this is changed from 0 to 1 in cs v1.2\n\twhile ($customers_statuses = olc_db_fetch_array($customers_statuses_query)) {\n\t\t$i=$customers_statuses['customers_status_id'];\n\t\t$customers_statuses_array[$i] = array('id' => $customers_statuses['customers_status_id'],\n\t\t'text' => $customers_statuses['customers_status_name'],\n\t\t'csa_public' => $customers_statuses['customers_status_public'],\n\t\t'csa_image' => $customers_statuses['customers_status_image'],\n\t\t'csa_discount' => $customers_statuses['customers_status_discount'],\n\t\t'csa_ot_discount_flag' => $customers_statuses['customers_status_ot_discount_flag'],\n\t\t'csa_ot_discount' => $customers_statuses['customers_status_ot_discount'],\n\t\t'csa_graduated_prices' => $customers_statuses['customers_status_graduated_prices']\n\t\t);\n\t}\n\treturn $customers_statuses_array;\n}", "public function index()\n {\n $schools = schoolDetail::find('1')->toArray();\n return array_reverse($schools);\n }", "function last_stage($type)\n\t {\n\t\t $this->db->select('*');\n\t\t $this->db->from(DB_PREFIX.'setup');\n\t\t $this->db->where('ico_type',$type);\n\t\t $this->db->order_by('id','desc');\n\t\t $data = $this->db->get()->row_array();\n\t\treturn $data;\n\t }", "public static function statuses()\n {\n return Lastus::statuses(static::class);\n }", "public function get_valid_statuses() {\n\t\treturn array_keys( _wc_cs_get_credits_statuses() ) ;\n\t}", "public function oldStud() {\n\t\t$query = $this->conn->prepare(\"SELECT *, CONCAT(first_name,' ',middle_name,' ',last_name) as 'Name', CONCAT(guar_fname,' ', guar_midname,' ', guar_lname) as 'guar_name', guar_mobno FROM student st JOIN guardian gr ON st.guar_id = gr.guar_id WHERE curr_stat = 'Old' AND stud_status = 'Not Enrolled' AND stud_status <> 'Graduated' AND stud_status <> 'Transferred' ORDER BY year_level;\");\n\t\t$query->execute();\n\t\t$result = $query->fetchAll();\n\t\tforeach($result as $row) {\n\t\t\t$options = $this->createOption(array('Officially Enrolled', 'Temporarily Enrolled', 'Transfer'), $row['stud_status']);\n\t\t\techo '<tr>';\n\t\t\techo '<td>'.$row['stud_lrno'].'</td>';\n\t\t\techo '<td>'.$row['Name'].'</td>';\n\t\t\techo '<td>'.$row['stud_status'].'</td>';\n\t\t\techo '<td><div class=\"btn-grp\">';\n\t\t\techo $this->editStatusMessage($row['Name'], $options, $row['stud_lrno']);\n\t\t\techo $this->editDetailsMessage($row);\t\t\n\t\t\techo '</td></div>';\n\t\t\techo '<td>'.$row['year_level'].'</td>';\n\t\t\techo '</tr>';\n\t\t}\n\t}", "public static function getStatuses(): array;", "function get_available_post_statuses($type = 'post')\n {\n }", "public function getLastStatistics() \n { \n $m = MinerStatistics::where('user_id', auth()->user()->id)\n ->where('created_at','>=', Carbon::now()->subSeconds(90))\n ->get()\n ->groupBy('rigname');\n\n $response = [];\n foreach($m as $miner) {\n $miner = $miner->first();\n $miner->data = json_decode($miner->data);\n $response[] = $miner;\n }\n \n return $response;\n }", "function attendance_get_statusset_maxpoints($statuses) {\n $statussetmaxpoints = array();\n foreach ($statuses as $st) {\n if (!isset($statussetmaxpoints[$st->setnumber])) {\n $statussetmaxpoints[$st->setnumber] = $st->grade;\n }\n }\n return $statussetmaxpoints;\n}", "public function getStatuses() {\n\t}", "function get_all_types()\n {\n return $this->db->get('card_types')->result();\n }", "public function status()\n {\n $statuses = collect([\n \"1\" => \"secondary\",\n \"2\" => \"success\",\n \"3\" => \"info\",\n \"4\" => \"warning\",\n \"5\" => \"danger\",\n ]);\n\n $group = substr($this->code, 0, 1);\n\n return $statuses->get($group, \"warning\");\n }", "public function getStatus()\n {\n \n return $this->_em->createQuery('SELECT s,u FROM TechCorpFrontBundle:Status s \n JOIN s.user u ORDER BY s.createdAt DESC');\n }", "public function run()\n {\n \n $statuses = [\n 'afwezig' => [\n 'student_selectable' => 1, \n 'coach_selectable' => 1, \n 'text' => 'Afmelden', \n 'color' => '#bb3d49',\n 'reason_requierd'=> 0,\n ],\n 'aanwezig' => [\n 'student_selectable' => 0, \n 'coach_selectable' => 1, \n 'text' => 'Aanmelden',\n 'color' => '#61e786',\n 'reason_requierd'=> 0,\n ],\n 'tussendoor uit' => [\n 'student_selectable' => 1,\n 'coach_selectable' => 0, \n 'text' => 'Tussendoor uit',\n 'color' =>'#db4547',\n 'reason_requierd'=> 1,\n ],\n 'activiteit' => [\n 'student_selectable' => 0,\n 'coach_selectable' => 1, \n 'text' => 'Activiteit, buiten school',\n 'color' => '#982395',\n 'reason_requierd'=> 0,\n ],\n 'bso' => [\n 'student_selectable' => 1, \n 'coach_selectable' => 0, \n 'text' => 'BSO',\n 'color' => '#61c0bf',\n 'reason_requierd'=> 0,\n ],\n 'ziek' => [\n 'student_selectable' => 0,\n 'coach_selectable' => 1, \n 'text' => 'Ziek',\n 'color' => '#9B539C',\n 'reason_requierd'=> 0,\n ],\n 'ziek naar huis' => [\n 'student_selectable' => 1,\n 'coach_selectable' => 1, \n 'text' => 'Ziek naar huis',\n 'color' => '#da507a',\n 'reason_requierd'=> 1,\n ],\n 'bijzonder verlof' => [\n 'student_selectable' => 0, \n 'coach_selectable' => 0, \n 'text' => 'Bijzonder verlof',\n 'color' => '#354458',\n 'reason_requierd'=> 0,\n ],\n ];\n\n foreach ($statuses as $key => $value) {\n DB::Table('statuses')->insert([\n 'status' => $key,\n 'text' => $value['text'],\n 'color' => $value['color'],\n 'student_selectable' => $value['student_selectable'],\n 'coach_selectable' => $value['coach_selectable'],\n 'reason_requierd'=> $value['reason_requierd'],\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n }\n \n }", "public static function getClasses()\n {\n $classes = SchoolClass::all();\n $classes_array = [];\n foreach ($classes as $class) {\n $classes_array[$class->name] = [\n \"name\" => $class->name,\n \"year\" => $class->year,\n \"holder\" => $class->holder,\n \"delegate\" => $class->delegate,\n \"status\" => $class->status,\n ];\n }\n return $classes_array;\n }", "function getAllCommissionTypes() {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_COMMISSION_TYPE . \" WHERE status='1' ORDER BY name\");\n\n return $data;\n }", "function statuses() {\n //return parent::statusesWithCount( self::tableName(), self::arrayStatuses() );\n\n global $wpdb;\n\n $table_name = self::tableName();\n $statuses = self::arrayStatuses();\n $field_name = 'status';\n /*\n * @ToDo Decommentare qui se non vogliamo i conteggi dinamici in base al filtro\n * @ToDo La query è molto onerosa\n *\n *\n */\n $table_orders = BNMExtendsOrders::tableName();\n $sql = <<< SQL\n SELECT DISTINCT( {$table_orders}.{$field_name} ),\n COUNT(*) AS count\n FROM `{$table_name}`\n LEFT JOIN `{$table_orders}`\n ON {$table_orders}.id = {$table_name}.id_order\n GROUP BY {$table_orders}.{$field_name}\nSQL;\n\n\n\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public function getEveryStatus()\n {\n static $status;\n\n if ($status) {\n return $status;\n }\n\n $status = array(\n 'U' => $this->_('Valid from date unknown'),\n 'W' => $this->_('Valid from date in the future'),\n 'O' => $this->_('Open - can be answered now'),\n 'A' => $this->_('Answered'),\n 'M' => $this->_('Missed deadline'),\n 'D' => $this->_('Token does not exist'),\n );\n\n return $status;\n }", "public function getStatuses(){\n \t$statuses = Status::all();\n \tif (count($statuses)==0) {\n \t\treturn response()->json(['data' => '' , 'message' => 'No Statuses'], 400);\n \t}\n \treturn response()->json(['data' => $statuses , 'message' => 'ok'], 200);\n }", "private function get_successful_updates( $type ) {\n\t\t$successful_updates = array();\n\n\t\tif ( ! isset( $this->results[ $type ] ) ) {\n\t\t\treturn $successful_updates;\n\t\t}\n\n\t\tforeach ( $this->results[ $type ] as $result ) {\n\t\t\tif ( $result->result ) {\n\t\t\t\tswitch ( $type ) {\n\t\t\t\t\tcase 'theme':\n\t\t\t\t\t\t$successful_updates[] = $result->item->theme;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'translation':\n\t\t\t\t\t\t$successful_updates[] = $result->item->type . ':' . $result->item->slug;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $successful_updates;\n\t}", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "function get_default_uc_groups_by_class( $class_id = '', $post_status = 'publish', $school_year = false ) {\n\t$args = array(\n\t\t'post_type' => 'uc_group',\n\t\t'post_status' => $post_status,\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\t'relation' => 'AND',\n\t\t\tarray(\n\t\t\t\t'key' => 'default_group',\n\t\t\t\t'value' => '1',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'class',\n\t\t\t\t'value' => $class_id,\n\t\t\t),\n\t\t),\n\t);\n\n\tif ( $school_year ) {\n\t\t$school_year_array = get_school_year( $school_year );\n\t\t$args['date_query'] = array(\n\t\t\tarray(\n\t\t\t\t'after' => $school_year_array['start'],\n\t\t\t\t'before' => $school_year_array['end'],\n\t\t\t\t'inclusive' => true,\n\t\t\t)\n\t\t);\n\t}\n\t\n\t$wp_posts = get_posts( $args );\n\t$result = array();\n\tforeach ($wp_posts as $post) {\n\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t}\n\treturn $result;\n}", "public function buildSyllabusDetails()\n {\n $em = $this->getDoctrine()->getManager();\n $lessonTypes = $em->getRepository(LessonType::class)->findAll();\n\n $syllabusArray = [];\n /** @var LessonType $thisLessonType */\n foreach ($lessonTypes as $thisLessonType) {\n $lessonsArray['title'] = $thisLessonType->getName();\n $lessonsArray['url'] = $thisLessonType->getUrl();\n $lessonsArray['lessons'] = $this->buildLessonDetails($thisLessonType);\n $syllabusArray[] = $lessonsArray;\n }\n\n return $syllabusArray;\n }", "public function getStatus()\n {\n// $data['school'] = ResumeschoolModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['company'] = ResumecompanyModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['project'] = ResumeprojectModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['train'] = ResumetrainModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['language'] = ResumelanguageModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['honor'] = ResumehonorModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['certificate'] = ResumecertificateModel::find($this->user_user_id) ? 1 : 0 ;\n// $data['wxb_job_resume_practice'] = ResumepracticeModel::find($this->user_user_id) ? 1 : 0 ;\n }", "function getUserStatus(){\n\t\t//$org_id=$this->session->userdata('organisation_id');\n\t\t//$qry=$this->db->where( 'organisation_id', $org_id );\n\t\t//---\n\t\t$qry=$this->db->get('user_statuses');\n\t\t$count=$qry->num_rows();\n\t\t\t$s= $qry->result_array();\n\t\t\n\t\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\n\t\t\t$status[$s[$i]['id']]=$s[$i]['name'];\n\t\t\t}\n\t\t\treturn $status;\n\t}", "function saveAllSchools($formvalues, $type){\n\t$idarray = array();\n\t\n\t// Using the longest posible array\n\tfor($i=0; $i<count($formvalues[$type.\"schname\"]); $i++){\n\t\tif($formvalues[$type.'schname'][$i] != \"\"){\n\t\t\t\n\t\t\tif(isset($formvalues[$type.\"schupdateid\"][$i])){\n\t\t\t\t$query = \"UPDATE schools SET schoolname = '\".$formvalues[$type.'schname'][$i].\"', type = '\".$type.\"', yearjoined = '\".$formvalues[$type.'schstart'][$i].\"', yearleft = '\".$formvalues[$type.'schend'][$i].\"', lastupdatedby = \".$_SESSION['userid'].\", lastupdatedate = now() WHERE id = '\".$formvalues[$type.\"schupdateid\"][$i].\"'\";\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$query = \"INSERT INTO schools (schoolname, type, yearjoined, yearleft, createdby, date_of_entry) VALUES ('\".$formvalues[$type.'schname'][$i].\"', '\".$type.\"', '\".$formvalues[$type.'schstart'][$i].\"', '\".$formvalues[$type.'schend'][$i].\"', \".$_SESSION['userid'].\", NOW())\";\n\t\t\t}\n\t\t\t\n\t\t\t$result = mysql_query($query);\n\t\t\t$schoolid = \"\";\n\t\t\t# check if any errors have occured during the saving the activities to the database\n\t\t\tif (mysql_error() == \"\") {\n\t\t\t\t# no errors occured, so return the last inserted id\n\t\t\t\t$schoolid = mysql_insert_id();\n\t\t\t\t\n\t\t\t\tif(isset($formvalues[$type.\"schupdateid\"][$i])){\n\t\t\t\t\t$schoolid = $formvalues[$type.\"schupdateid\"][$i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t# add the error message to the string\n\t\t\t\t$_SESSION['error'] = \"ERROR: Couldnot insert the details for \".$type.\". Please try again. DETAILS: \".\tmysql_error();\n\t\t\t}\n\t \t$idarray[$i] = $schoolid;\n\t\t}\n\t}\n\t\n\treturn $idarray;\n}", "public function summarizeApprovalStages($appID) {\n\t\t\t$statuses['Sponsor'] = $this->CI->db->query(\"\n\t\t\t\tSELECT * FROM Approval appr\n\t\t\t\t\tJOIN VenueUserRole vur ON vur.VenueUserRoleID = appr.VenueUserRoleID\n\t\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\t\tJOIN Application a ON a.ApplicationID = v.ApplicationID\n\t\t\t\t\tJOIN UserRole ur ON ur.UserRoleID = vur.UserRoleID\n\t\t\t\tWHERE a.ApplicationID = {$appID}\n\t\t\t\t\tAND ApprovalType = 'Sponsor'\n\t\t\t\")->result_array();\n\t\t\t$statuses['Venue'] = $this->CI->db->query(\"\n\t\t\tSELECT * FROM Approval appr\n\t\t\t\tJOIN VenueUserRole vur ON vur.VenueUserRoleID = appr.VenueUserRoleID\n\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\tJOIN Application a ON a.ApplicationID = v.ApplicationID\n\t\t\t\tJOIN UserRole ur ON ur.UserRoleID = vur.UserRoleID\n\t\t\tWHERE a.ApplicationID = {$appID}\n\t\t\t\tAND ApprovalType = 'VenueOperator'\n\t\t\t\")->result_array();\n\t\t\t$statuses['Committee'] = $this->CI->db->query(\"\n\t\t\t\tSELECT * FROM Approval appr\n\t\t\t\t\tJOIN VenueUserRole vur ON vur.VenueUserRoleID = appr.VenueUserRoleID\n\t\t\t\t\tJOIN Venue v ON v.VenueID = vur.VenueID\n\t\t\t\t\tJOIN Application a ON a.ApplicationID = v.ApplicationID\n\t\t\t\t\tJOIN UserRole ur ON ur.UserRoleID = vur.UserRoleID\n\t\t\t\tWHERE a.ApplicationID = {$appID}\n\t\t\t\t\tAND ApprovalType = 'Committee'\n\t\t\t\")->result_array();\n\n\t\t\tforeach($statuses as $key => $status) {\n\t\t\t\t//echo 'status: ';\n\t\t\t\t//var_dump($status);\n\t\t\t\t# For all stages there can be a mix of approvals and denials\n\t\t\t\t# Search for both and summarize the status accordingly\n\t\t\t\t$column = array_column($status, 'Descision');\n\t\t\t\t$approved = array_search('approved', $column);\n\t\t\t\t$denied = array_search('denied', $column);\n\n\t\t\t\t# If we see at least one approval, assume the status is approved\n\t\t\t\t# Else if we see no approvals and at least one denial, status is denied\n\t\t\t\t# Pending otherwise\n\t\t\t\tif($approved !== false) {\n\t\t\t\t\t$statuses[$key] = array(\n\t\t\t\t\t\t\t\t\t\t$key . \"Decision\" => $status[$approved]['Descision'], \n\t\t\t\t\t\t\t\t\t\t$key . \"DecisionRemark\" => $status[$approved]['DescisionRemark'],\n\t\t\t\t\t\t\t\t\t\t$key . \"ApprovalDate\" => $status[$approved]['ApprovalEndDate']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else if ($denied !== false) {\n\t\t\t\t\t$statuses[$key] = array(\n\t\t\t\t\t\t\t\t\t\t$key . \"Decision\" => $status[$denied]['Descision'], \n\t\t\t\t\t\t\t\t\t\t$key . \"DecisionRemark\" => $status[$denied]['DescisionRemark'],\n\t\t\t\t\t\t\t\t\t\t$key . \"ApprovalDate\" => $status[$denied]['ApprovalEndDate']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$statuses[$key] = array(\n\t\t\t\t\t\t\t\t\t\t$key . \"Decision\" => 'Pending', \n\t\t\t\t\t\t\t\t\t\t$key . \"DecisionRemark\" => null,\n\t\t\t\t\t\t\t\t\t\t$key . \"ApprovalDate\" => 'Pending'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//var_dump($status);\n\t\t\t}\n\t\t\t# var_dump($statuses);\n\t\t\treturn $statuses;\n\t\t}", "public function recent()\n {\n\t\t$payments = array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '1',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 5.40,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '2',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 100.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'pending',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '3',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'failed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '4',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'refunded',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '5',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '6',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'verified',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '7',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'mastercard',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1123.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '8',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'pending',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '9',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'jcb',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1123.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'failed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '10',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '11',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 122.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'refunded',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '12',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'paypal',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 5444.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '13',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 8.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'failed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '14',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '15',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'verified',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '16',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '17',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '18',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'refunded',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\n return $payments; \n }", "public function schoolPaymentStatus(Request $request)\n { \n \t$paymentData = Payment::capture(); \n if($paymentData->status == \"Completed\"){\n \t// if(\"Completed\" == \"Completed\"){\n\t \t$secureInputData = $request->session()->get('secureInputData'); \n \t\tif($secureInputData){\n\t\t $schoolPaymentHistory = new SchoolPaymentHistory();\n\t\t // payment history\n $schoolPaymentHistory->user_id = Auth::user()->id;\n\t\t $schoolPaymentHistory->txnid = $paymentData->txnid;\n\t\t $schoolPaymentHistory->school_id = $secureInputData['school_id'];\n\t\t $schoolPaymentHistory->payment_id = $secureInputData['payment_id'];\n\t\t $schoolPaymentHistory->payment_mode = $secureInputData['payment_mode'];\n $schoolPaymentHistory->pay_id = $paymentData->id;\n // $schoolPaymentHistory->pay_id = 1;\n $schoolPaymentHistory->paid_installation_amount = $secureInputData['blc_install_amount'];\n $schoolPaymentHistory->paid_monthly_fees_amount = $secureInputData['blc_monthly_fee_amount'];\n $schoolPaymentHistory->other_charges_amount = $secureInputData['other_chargers_amount'];\n $schoolPaymentHistory->gst_amount = $secureInputData['gst_amount'];\n $schoolPaymentHistory->paid_month = $secureInputData[\"selected_months\"];\n $schoolPaymentHistory->total_paid_amount = $secureInputData['total_entered_amount'];\n\t\t $schoolPaymentHistory->payment_date = Carbon::now();\n\t\t $schoolPaymentHistory->status = 1;\n\t\t $schoolPaymentHistory->is_deleted = 0;\n\t\t $schoolPaymentHistory->save();\n\n\t\t $schoolPayment = SchoolPayment::find($secureInputData['payment_id']);\n\n\t\t // update amount to payment table\n\t\t $balance_installation_amount = $schoolPayment->balance_installation_amount - $secureInputData['blc_install_amount'];\n\t\t $balance_monthly_fees_amount = $schoolPayment->balance_monthly_fees_amount - $secureInputData['blc_monthly_fee_amount'];\n\t\t $other_charges = 0;\n\t\t $gst_amount = 0;\n\t\t $paid_months = $schoolPayment->paid_months.','.$secureInputData['selected_months'];\n $pendingMonthExplodeArray = explode(\",\", $schoolPayment->pending_months);\n $inputSelectedMonthsArray = explode(\",\", $secureInputData['selected_months']);\n $pending_months = [];\n foreach ($pendingMonthExplodeArray as $key => $value) {\n if(!in_array($value, $inputSelectedMonthsArray)){\n $pending_months[] = $value;\n }\n }\n $implodePendingMonths = implode(\",\", $pending_months);\n\n\t\t $schoolPayment->balance_installation_amount = $balance_installation_amount;\n\t\t // $schoolPayment->balance_monthly_fees_amount = $balance_monthly_fees_amount;\n\t\t $schoolPayment->other_charges = $other_charges;\n\t\t $schoolPayment->gst_amount = $gst_amount;\n\t\t $schoolPayment->paid_months = $paid_months;\n\t\t $schoolPayment->pending_months = $implodePendingMonths;\n\t\t $schoolPayment->status = 1;\n\t\t $schoolPayment->is_deleted = 0;\n\t\t $schoolPayment->update();\n \t\t} \n \t} \n \t// forgot session\n $request->session()->forget('secureInputData'); \n \treturn view('school.payment.transaction',compact('paymentData'));\n }", "function getCardList()\n {\n $txt = new Text($this->language, $this->translation_module_default);\n\n // sorting order of the query\n if (!$this->vars[\"sort\"]) {\n $sort_order = 'person_name';\n } else {\n $sort_order = $this->vars[\"sort\"];\n }\n\n if (!$this->vars[\"dir\"]) {\n $sort_dir = \"ASC\";\n } else {\n $sort_dir = $this->vars[\"dir\"];\n }\n\n // amount of records to query at once\n if (!$this->vars[\"start\"]) {\n $start_row = 0;\n } else {\n $start_row = $this->vars[\"start\"];\n }\n\n if (!$this->vars[\"limit\"]) {\n $max_rows = $this->maxresults;\n } else {\n $max_rows = $this->vars[\"limit\"];\n }\n\n $condition = array();\n if ($this->card_type_current) {\n $condition[] = \"`module_isic_card`.`type_id` = \" . $this->card_type_current;\n }\n // filter conditions\n foreach ($this->fieldData['filterview'] as $filter_data) {\n if ($this->vars[$filter_data['field']]) {\n switch ($filter_data['type']) {\n case 1: // textfield\n $condition[] = $filter_data['field'] . \" LIKE '%\" . mysql_escape_string($this->vars[$filter_data['field']]) . \"%'\";\n break;\n case 2: // combobox\n $condition[] = $filter_data['field'] . \" = \" . mysql_escape_string($this->vars[$filter_data['field']]);\n break;\n default :\n break;\n }\n }\n }\n\n $sql_condition = implode(\" AND \", $condition);\n if ($sql_condition) {\n $sql_condition = \"AND \" . $sql_condition;\n }\n\n $res =& $this->db->query(\"\n SELECT\n `module_isic_card`.*,\n IF(`module_isic_school`.`id`, `module_isic_school`.`name`, '') AS school_name,\n IF(`module_isic_card_kind`.`id`, `module_isic_card_kind`.`name`, '') AS card_kind_name,\n IF(`module_isic_bank`.`id`, `module_isic_bank`.`name`, '') AS bank_name,\n IF(`module_isic_card_type`.`id`, `module_isic_card_type`.`name`, '') AS card_type_name\n FROM\n `module_isic_card`\n LEFT JOIN\n `module_isic_school` ON `module_isic_card`.`school_id` = `module_isic_school`.`id`\n LEFT JOIN\n `module_isic_card_kind` ON `module_isic_card`.`kind_id` = `module_isic_card_kind`.`id`\n LEFT JOIN\n `module_isic_bank` ON `module_isic_card`.`bank_id` = `module_isic_bank`.`id`\n LEFT JOIN\n `module_isic_card_type` ON `module_isic_card`.`type_id` = `module_isic_card_type`.`id`\n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n ORDER BY ! ! \n LIMIT !, !\", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition, \n $sort_order, \n $sort_dir, \n $start_row, \n $max_rows\n );\n//echo($this->db->show_query());\n $result = array();\n while ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\".jpg\", \"_thumb.jpg\", $data[\"pic\"]);\n if ($t_pic && file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = \"<img src=\\\"\" . $t_pic . \"\\\">\";\n }\n $data[\"pic\"] .= \"<img src=\\\"img/tyhi.gif\\\" height=\\\"100\\\" width=\\\"1\\\">\";\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"m/y\", strtotime($data[\"expiration_date\"]));\n $data[\"active\"] = $txt->display(\"active\" . $data[\"active\"]);\n $data[\"confirm_payment_collateral\"] = $this->isic_payment->getCardCollateralRequired($data[\"school_id\"], $data[\"type_id\"]) ? $txt->display(\"active\" . $data[\"confirm_payment_collateral\"]) : \"-\";\n $data[\"confirm_payment_cost\"] = $this->isic_payment->getCardCostRequired($data[\"school_id\"], $this->isic_common->getCardStatus($data[\"prev_card_id\"]), $data[\"type_id\"], $is_card_first) ? $txt->display(\"active\" . $data[\"confirm_payment_cost\"]) : \"-\";\n $result[] = $data;\n }\n\n $res =& $this->db->query(\"\n SELECT COUNT(*) AS total \n FROM \n `module_isic_card` \n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n \", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition);\n if ($data = $res->fetch_assoc()) {\n $total = $data[\"total\"];\n }\n \n echo JsonEncoder::encode(array('total' => $total, 'rows' => $result));\n exit();\n }", "public function loadAllApplications($studentNumber, $campusId, $programType, $status) {\r\n \r\n $applications = \"\";\r\n \r\n if ($status == \"\") {\r\n $statusQuery = \"\";\r\n } else if ($status == \"Approved\") {\r\n $statusQuery = \"AND (sr.STATUS = 'Approved' OR sr.STATUS = 'Declined')\";\r\n } else {\r\n $statusQuery = \"AND sr.STATUS = '\" . $status . \"'\";\r\n }\r\n \r\n $queryresult = $this->db->query(\"SELECT LPAD(sr.ID, 5, '0') `ID`, sr.`STATUS`, DATE_FORMAT(sr.`DATE_REQUEST`, '%b %d, %Y') DATE_REQUEST, sr.`REASON`, \r\n GROUP_CONCAT(CONCAT(UPPER(sub.`SUBJECT_CODE`), ' - ', UPPER(sub.`DESCRIPTION`), ' (', sub.`UNITS`, ' Units) / ', sy.`SY_ABBR`, ' - ', sem.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f.`LAST_NAME`), ', ', UPPER(f.`FIRST_NAME`), ' ', UPPER(IFNULL(f.`MIDDLE_NAME`, ''))), ' / ',\r\n sc.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc.`END_TIME`, '%h:%i%p')) SEPARATOR '\\r\\n') \r\n SUBJECTS, \r\n GROUP_CONCAT(CONCAT(UPPER(sub2.`SUBJECT_CODE`), ' - ', UPPER(sub2.`DESCRIPTION`), ' (', sub2.`UNITS`, ' Units) / ', sy2.`SY_ABBR`, ' - ', ss.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f2.`LAST_NAME`), ', ', UPPER(f2.`FIRST_NAME`), ' ', UPPER(IFNULL(f2.`MIDDLE_NAME`, ''))), ' / ',\r\n sc2.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc2.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc2.`END_TIME`, '%h:%i%p')) SEPARATOR '\\r\\n') `CHANGE`,\r\n s.CAMPUS_ID, s.PROGRAM_TYPE\r\n FROM t_sr_subject sr\r\n INNER JOIN t_student s ON sr.STUDENT_NO = s.STUDENT_NO\r\n LEFT OUTER JOIN t_sr_subject_line sl ON sl.`SR` = sr.`ID` AND sr.`TYPE` = sl.`TYPE`\r\n LEFT OUTER JOIN r_schedule sc ON sc.`ID` = sl.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_subject sub ON sub.`SUBJECT_CODE` = sc.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy ON sy.`ID` = sc.`SY`\r\n LEFT OUTER JOIN r_semester sem ON sem.`ID` = sc.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f ON f.`FACULTY_CODE` = sc.`FACULTY_CODE`\r\n LEFT OUTER JOIN r_student_class_list cl ON cl.`ID` = sl.`SUBJECT_CODE_CHANGE`\r\n LEFT OUTER JOIN r_subject sub2 ON cl.`SUBJECT_CODE` = sub2.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy2 ON sy2.`ID` = cl.`SY`\r\n LEFT OUTER JOIN r_semester ss ON ss.`ID` = cl.`SEM`\r\n LEFT OUTER JOIN r_schedule sc2 ON sc2.`SECTION_CODE` = cl.`SECTION_CODE` AND sc2.`SY` = cl.`SY` AND sc2.`SEM` = cl.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f2 ON f2.`FACULTY_CODE` = sc2.`FACULTY_CODE`\r\n WHERE sr.`TYPE` = 'CHANGESUB' AND sr.`STUDENT_NO` = ? \" . $statusQuery .\r\n \" GROUP BY sr.`ID`\r\n ORDER BY DATE_REQUEST DESC\", \r\n array($studentNumber));\r\n \r\n if ( $queryresult->num_rows() > 0 ) { \r\n \r\n\t\t\tforeach ( $queryresult->result() as $row ) {\r\n \r\n $applications[] = array(\r\n 'id' => $row->ID,\r\n 'status' => $row->STATUS,\r\n 'type' => /*$row->TYPE*/ \"Change Subject\",\r\n 'subjects' => $row->SUBJECTS,\r\n 'toSubjects' => $row->CHANGE,\r\n 'approvalLevel' => $this->getCurrentLevel($row->ID),\r\n 'numberOfApprovers' => $this->getNumberOfApprovers($row->CAMPUS_ID, $row->PROGRAM_TYPE),\r\n 'reason' => $row->REASON,\r\n 'dateRequested' => $row->DATE_REQUEST,\r\n );\r\n }\r\n }\r\n \r\n\t\treturn $applications;\r\n }", "protected static function getClassSubjects($studentCheck){\n $classSubject = DB::table('class_subject as cs')\n ->join('subjects as sj', 'cs.subject_id', '=', 'sj.id')\n ->join('class as c', 'cs.class_id', '=', 'c.id')\n ->where('cs.class_id', $studentCheck->class_id)\n ->where('cs.datetime_end', '>', Carbon::now())\n ->where('cs.soft_deleted', Core::false())\n ->select(\n 'cs.id as class_subject_id',\n 'c.name as class_name',\n 'sj.name as subject_name',\n 'sj.days_fail as subject_days_fail',\n 'cs.datetime_start',\n 'cs.datetime_end'\n )\n ->get();\n $arraySubjectStudent = [];\n foreach($classSubject as $detailCS){\n $infoSubject = (object) [];\n $daysStudy = DB::table('days_class_subject as dcs')\n ->join('attendance as at', 'dcs.id', '=', 'at.days_class_subject_id')\n ->where('dcs.class_subject_id', $detailCS->class_subject_id)\n ->where('at.student_id', $studentCheck->id)\n ->where('at.checked', Core::false())\n ->count();\n $infoSubject->class_subject_id = $detailCS->class_subject_id;\n $infoSubject->class_name = $detailCS->class_name;\n $infoSubject->subject_name = $detailCS->subject_name;\n $infoSubject->subject_days_fail = $detailCS->subject_days_fail;\n $infoSubject->date_start = Carbon::parse($detailCS->datetime_start)->toDateString();\n $infoSubject->date_end = Carbon::parse($detailCS->datetime_end)->toDateString();\n $infoSubject->count_days_fail_now = $daysStudy;\n $arraySubjectStudent[] = $infoSubject;\n }\n return $arraySubjectStudent;\n }", "public function index()\n {\n \n\n //get current date\n $today = Carbon::today();\n\n //get Authenticated user\n $user = Auth::user();\n\n //all_users\n $all_users = User::get();\n\n //get user reg code\n $reg_code = $user->registration_code;\n\n\n $student = Student::where('registration_code', '=', $reg_code)->first();\n\n $student_group = Group::where('id','=', $student->group_id)->first();\n\n $class_members = Student::where('group_id', '=', $student_group->id)->get();\n $class_members_count = Student::where('group_id', '=', $student_group->id)->count();\n\n //Attendance\n $attendance_today = Attendance::join('attendance_codes', 'attendances.attendance_code_id', '=', 'attendance_codes.id')\n ->where('student_id', '=', $student->id)\n ->where('day', '=', $today)\n ->first();\n \n\n $att_code = AttendanceCode::get();\n\n //get events\n $events = Event::where('group_id', '=', $student->group_id)->orderBy('start_date', 'desc')->paginate(3);\n\n $upcomming_events = Event::where('group_id', '=', $student->group_id)->whereDate('start_date', '>', $today)->count();\n\n $active_events = Event::where('group_id', '=', $student->group_id)->where('start_date', '<=', $today)\n ->Where('end_date', '>=', $today)->count();\n\n $expired_events = Event::where('group_id', '=', $student->group_id)->whereDate('end_date', '<', $today )->count();\n\n //Start of School statistics - school year\n //school max, min, total, count, school average\n $school_max = Grade::max('total');\n $school_min = Grade::min('total');\n $school_total = Grade::sum('total');\n $school_count = Grade::count('total');\n $school_avg = Grade::avg('total');\n\n \n //student stats - school year\n $student_max = Grade::where('student_id', '=', $student->id)->max('total');\n $student_min = Grade::where('student_id', '=', $student->id)->min('total');\n $student_total = Grade::where('student_id', '=', $student->id)->sum('total');\n $student_count = Grade::where('student_id', '=', $student->id)->count('total');\n $student_avg = Grade::where('student_id', '=', $student->id)->avg('total');\n\n //class statistics - school year\n $student_class_max = Course::join('grades', 'courses.id', '=', 'grades.course_id')\n ->where('courses.group_id', '=', $student->group_id)\n ->max('total');\n\n $student_class_min = Course::join('grades', 'courses.id', '=', 'grades.course_id')\n ->where('courses.group_id', '=', $student->group_id)\n ->min('total'); \n\n $student_class_avg = Course::join('grades', 'courses.id', '=', 'grades.course_id')\n ->where('courses.group_id', '=', $student->group_id)\n ->avg('total'); \n \n\n //School-Student-Class Statistics- school year\n $school_class_student_chart = Charts::multi('bar', 'material')\n // Setup the chart settings\n ->title(\"School-Student-Class Year Statistics\")\n // A dimension of 0 means it will take 100% of the space\n ->dimensions(0, 230) // Width x Height\n // This defines a preset of colors already done:)\n ->template(\"material\")\n ->responsive(true)\n // You could always set them manually\n // ->colors(['#2196F3', '#F44336', '#FFC107'])\n // Setup the diferent datasets (this is a multi chart)\n ->dataset('School', [$school_min,$school_max,$school_avg])\n ->dataset('Student', [$student_min,$student_max,$student_avg])\n ->dataset('Class', [$student_class_min,$student_class_max,$student_class_avg])\n // Setup what the values mean\n ->labels(['Minimum', 'Maximum', 'Average']); \n\n \n return view('/home', compact('events', 'class_members', 'all_users' , 'class_members_count','attendance_today', 'att_code',\n 'upcomming_events', 'active_events', 'expired_events', 'school_max', 'school_min', 'school_avg', 'school_class_student_chart'\n\n\n ));\n }", "public function report2(){\n $query = $this->db->query(\"SELECT COUNT(`risk_status`) AS numcount, risk_status,\nCASE WHEN `risk_status` = 2 THEN 'User'\n ELSE 'User'\n END AS riskstatus\n FROM t_risk\nWHERE periode_id= (SELECT MAX(periode_id) FROM t_risk)\nAND risk_existing_control IS NULL AND risk_status='2'\n\n\n \");\n \n if($query->num_rows() > 0){\n foreach($query->result() as $data){\n $hasil[] = $data;\n }\n return $hasil;\n }\n }", "function getSiteRoomData($bossId, $type = '')\n {\n if ($bossId == 0) return array();\n $this->db->select(\"*\");\n $this->db->from('room');\n $this->db->where('boss_id', $bossId);\n $this->db->where('submit_time < ', date(\"Y-m-d H:i:s\"));\n $this->db->order_by('submit_time', 'desc');\n $query = $this->db->get();\n $result = $query->row();\n if (count($result) <= 0 || $type == 'admin') {\n $this->db->select(\"*\");\n $this->db->from('room');\n $this->db->where('boss_id', $bossId);\n $this->db->order_by('submit_time', 'desc');\n $query = $this->db->get();\n $result = $query->row();\n }\n $this->db->select(\"*\");\n $this->db->from('room');\n $this->db->where('boss_id', $bossId);\n if (count($result) > 0)\n $this->db->where('submit_time', $result->submit_time);\n\n $query = $this->db->get();\n\n return $query->result();\n }", "function get_payment_for_school($payment_request_id){\n //each scholarhsip payment linked to the school the student is in\n //group the payment by school and return school name, total amount, number of scholarship paymennt in the given request\n //you have to cont the sponsred sudent that belong to this payment request and school\n /*\n $str_query=\"select sp.`schools_school_id`,s.`school_name`,sum(sp.`amount`) as total_amount,count(sp.`scholarship_payment_id`) as payment_number from schools s, \n scholarship_payment sp where (sp.`payment_request_payment_request_id`=$payment_request_id)\n group by sp.schools_school_id,s.`school_name`\";*/\n\n $str_query=\"select sp.`schools_school_id`,s.`school_id`,s.`school_name`,sum(sp.`amount`) as total_amount,count(sp.`scholarship_payment_id`) as payment_number from schools s, \n scholarship_payment sp where (sp.schools_school_id=s.school_id) and (sp.`payment_request_payment_request_id`=$payment_request_id)\n group by sp.schools_school_id,s.`school_name`\";\n\n if (!$this->sql_query($str_query)){\n return false;\n }\n else{\n return true;\n }\n \n }", "public function get_class_list()\n\t{\n\t\t$schl_id = $this->input->post('schl_id');\n\t\t//print_r($schl_id);\n\t\t$result['cls_info'] = $this->tmtl->get_class_by_school_id($schl_id);\n\t\techo json_encode($result); \n\t}", "function statuses_getData() {\n\n\t// Get saved options from database\n\t$m = new Modules;\n\t$options = $m->getOptions('statuses');\n\t$opt = json_decode($options);\n\n\t// Throw exception if no data in database\n\tif($opt[0] == NULL) throw new Exception('Module credentials missing.');\n\n\t// Connect to Twitter through third party library\n\trequire('TwitterAPIExchange.php');\n\n\t// Access token, Access token secret, API key, API secret\n\t$settings = array(\n\t 'oauth_access_token' => $opt[2],\n\t 'oauth_access_token_secret' => $opt[3],\n\t 'consumer_key' => $opt[0],\n\t 'consumer_secret' => $opt[1]\n\t);\n\t$username = $opt[4];\n\t$replies = 'false'; // Exclude @Replies?\n\t$retweets = 'true'; // Include Retweets?\n\n\t// Query\n\t$url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';\n\t$getfield = '?screen_name=' . $username . '&count=50&exclude_replies=' . $replies . '&include_rts=' . $retweets;\n\t$requestMethod = 'GET';\n\n\t$twitter = new TwitterAPIExchange($settings);\n\t$response = $twitter->setGetfield($getfield)\n\t ->buildOauth($url, $requestMethod)\n\t ->performRequest();\n\n\t// Parse JSON data\n\t$content = json_decode($response);\n\n\tforeach($content as $tweet) {\n\t\t$date = date('Y-m-d H:i:s', strtotime($tweet->created_at)); // convert to YYYY-MM-DD HH:MM:SS\n\t\t$text = $tweet->text;\n\t\t$id = $tweet->id_str;\n\t\t\n\t\t$fields[] = array(\n\t\t\t'date' => $date,\n\t\t\t'status' => $text, \n\t\t\t'org_service' => 'Twitter',\n\t\t\t'org_id' => $id\n\t\t);\n\t}\n\n\treturn array_reverse($fields);\n \n}", "function getLastActiveSurfers($decay, $limit, $offset = 0) {\n $this->lastActiveSurfers = array();\n $sql = \"SELECT surfer_id, surfer_handle, surfer_givenname, surfer_surname,\n surfer_email, surfer_lastlogin, surfer_lastaction,\n surfer_gender, surfer_status FROM %s\n WHERE surfer_lastaction >= '%d'\";\n $currTime = time();\n $params = array($this->tableSurfer, $currTime - $decay);\n\n if ($res = $this->databaseQueryFmt($sql, $params, $limit, $offset)) {\n // get datarecord\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n // store to array\n $this->lastActiveSurfers[$row['surfer_id']] = $row;\n }\n return array($this->lastActiveSurfers, $res->absCount());\n }\n return array(NULL, 0);\n }", "public function status() {\n $status = $this->statuses()->orderBy('created_at','desc')->first();\n\n if(is_null($status)) {\n return new Status;\n }\n else return $status;\n }", "public function loadAllApplicationsApprover($facultyId, $status) {\r\n \r\n $ids = array(\"0\");\r\n\r\n\t\t$q1 = $this->db->query(\"SELECT DISTINCT wf.ID, wf.CAMPUS_ID FROM r_sr_wf wf\r\n INNER JOIN r_sr_wf_line wfl ON wf.ID = wfl.WORKFLOW AND\r\n wfl.FACULTY = ? AND wf.TYPE = ? \", array($facultyId, \"CHANGESUB\"));\r\n \r\n\t\tif($q1->num_rows() > 0) {\r\n \r\n\t\t\tforeach($q1->result() as $rows) {\r\n\t\t\t\t\r\n $q2 = $this->db->query(\"SELECT sr.`ID` FROM t_sr_subject sr \r\n INNER JOIN t_student s ON sr.`STUDENT_NO` = s.`STUDENT_NO`\r\n WHERE s.`CAMPUS_ID` = ? AND (sr.TYPE = ?) AND sr.STATUS = ?\",\r\n array($rows->CAMPUS_ID, 'CHANGESUB', $status));\r\n\t\t\t\t\r\n foreach($q2->result() as $row) {\r\n\t\t\t\t\t$ids[] = $row->ID;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n \r\n $ids = ($ids == \"\") ? \"0\" : $ids;\r\n\t\t$result = array();\r\n \r\n\t\t$queryresult = $this->db->query(\"SELECT LPAD(sr.ID, 5, '0') `ID`, sr.`STATUS`, DATE_FORMAT(sr.`DATE_REQUEST`, '%b %d, %Y') DATE_REQUEST, sr.`REASON`, \r\n GROUP_CONCAT(CONCAT(UPPER(sub.`SUBJECT_CODE`), ' - ', UPPER(sub.`DESCRIPTION`), ' (', sub.`UNITS`, ' Units) / ', sy.`SY_ABBR`, ' - ', sem.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f.`LAST_NAME`), ', ', UPPER(f.`FIRST_NAME`), ' ', UPPER(IFNULL(f.`MIDDLE_NAME`, ''))), ' / ',\r\n sc.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc.`END_TIME`, '%h:%i%p')) SEPARATOR ',<br>') \r\n SUBJECTS, COUNT(*) SUBJECT_COUNT,\r\n GROUP_CONCAT(CONCAT(UPPER(sub2.`SUBJECT_CODE`), ' - ', UPPER(sub2.`DESCRIPTION`), ' (', sub2.`UNITS`, ' Units) / ', sy2.`SY_ABBR`, ' - ', ss.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f2.`LAST_NAME`), ', ', UPPER(f2.`FIRST_NAME`), ' ', UPPER(IFNULL(f2.`MIDDLE_NAME`, ''))), ' / ',\r\n sc2.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc2.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc2.`END_TIME`, '%h:%i%p')) SEPARATOR ',<br>') `CHANGE`,\r\n CONCAT(pd.`LAST_NAME`, ', ', pd.`FIRST_NAME`, ' ', IFNULL(pd.`MIDDLE_NAME`, '')) STUDENT, sr.`TYPE`\r\n s.CAMPUS_ID, s.PROGRAM_TYPE\r\n FROM t_sr_subject sr\r\n INNER JOIN t_student s ON sr.STUDENT_NO = s.STUDENT_NO\r\n INNER JOIN r_student_personal_data pd ON pd.`STUDENT_NO` = s.`STUDENT_NO`\r\n LEFT OUTER JOIN t_sr_subject_line sl ON sl.`SR` = sr.`ID` AND sr.`TYPE` = sl.`TYPE`\r\n LEFT OUTER JOIN r_schedule sc ON sc.`ID` = sl.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_subject sub ON sub.`SUBJECT_CODE` = sc.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy ON sy.`ID` = sc.`SY`\r\n LEFT OUTER JOIN r_semester sem ON sem.`ID` = sc.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f ON f.`FACULTY_CODE` = sc.`FACULTY_CODE`\r\n LEFT OUTER JOIN r_student_class_list cl ON cl.`ID` = sl.`SUBJECT_CODE_CHANGE`\r\n LEFT OUTER JOIN r_subject sub2 ON cl.`SUBJECT_CODE` = sub2.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy2 ON sy2.`ID` = cl.`SY`\r\n LEFT OUTER JOIN r_semester ss ON ss.`ID` = cl.`SEM`\r\n LEFT OUTER JOIN r_schedule sc2 ON sc2.`SECTION_CODE` = cl.`SECTION_CODE` AND sc2.`SY` = cl.`SY` AND sc2.`SEM` = cl.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f2 ON f2.`FACULTY_CODE` = sc2.`FACULTY_CODE`\r\n WHERE sr.ID IN (\".$ids.\")\r\n GROUP BY sr.`ID`\r\n ORDER BY sr.status DESC\"\r\n\t\t);\r\n\r\n\t\tif($queryresult->num_rows() > 0)\r\n\t\t{\r\n\t\t\tforeach($queryresult->result() as $rows)\r\n\t\t\t{\r\n $result[] = array(\r\n 'id' => $row->ID,\r\n 'status' => $row->STATUS,\r\n 'type' => \"Add Subject\",\r\n 'subjectCount' => $row->SUBJECT_COUNT,\r\n 'subjects' => $row->SUBJECTS,\r\n 'approvalLevel' => $this->getCurrentLevel($row->ID),\r\n 'numberOfApprovers' => $this->getNumberOfApprovers($row->CAMPUS_ID, $row->PROGRAM_TYPE),\r\n 'reason' => $row->REASON,\r\n 'dateRequested' => $row->DATE_REQUEST,\r\n );\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn $result;\r\n \r\n }", "public function getCrucialStatus()\n {\n $states = array();\n foreach ($this->performances as $performance) {\n $status = $performance->getStatus();\n if ($status) {\n array_push($states,\n array(\n 'title' => $status->getTitle(),\n 'priority' => $status->getPriority(),\n 'cssClass' => $status->getCssClass()\n )\n );\n }\n }\n if (count($states)) {\n usort($states, function ($a, $b) {\n return $a['priority'] - $b['priority'];\n });\n\n return $states[0];\n } else {\n return '';\n }\n }", "function getDetailedStatus() ;", "public function getSubjectsOfferedButNotTakenOrEnrolled($studentNumber) {\r\n \r\n $q1 = $this->db->query(\"SELECT sched.ID SCHEDULE_ID, sub.ID,\r\n sub.SUBJECT_CODE, sub.DESCRIPTION, sub.UNITS, sy.SY_ABBR, sem.SEMESTER, UPPER(CONCAT(f.LAST_NAME, ', ', f.FIRST_NAME, ' ', COALESCE(f.MIDDLE_NAME, ''))) FACULTY,\r\n\t\t\t\t sched.DAY_OF_WEEK, TIME_FORMAT(sched.START_TIME, '%h:%i%p') START_TIME, TIME_FORMAT(sched.END_TIME, '%h:%i%p') END_TIME\r\n\t\t\t\t\tFROM r_schedule sched\r\n\t\t\t\t\tINNER JOIN r_subject sub ON sub.SUBJECT_CODE = sched.SUBJECT_CODE\r\n\t\t\t\t\tINNER JOIN r_sy sy ON sy.ID = sched.SY\r\n\t\t\t\t\tINNER JOIN r_semester sem ON sem.ID = sched.SEM\r\n\t\t\t\t\tLEFT OUTER JOIN r_faculty_profile f ON f.FACULTY_CODE = sched.FACULTY_CODE\r\n\t\t\t\t\tINNER JOIN r_room room ON room.ROOM_NO = sched.ROOM_NO\r\n\t\t\t\t\tINNER JOIN r_campus campus ON campus.CODE = room.CAMPUS_CODE\r\n\t\t\t\t\tINNER JOIN t_student st ON st.CAMPUS_ID = campus.ID AND st.STUDENT_NO = ?\r\n\t\t\t\t\tWHERE sub.SUBJECT_CODE NOT IN (SELECT subject_code FROM r_student_class_list \r\n\t\t\t\t\tWHERE student_no = ?)\r\n\t\t\t\t\tAND sub.SUBJECT_CODE IN (SELECT ss.subject_code FROM r_curriculum_line cl\r\n\t\t\t\t\tINNER JOIN r_curriculum c ON c.ID = cl.CURRICULUM_ID\r\n\t\t\t\t\tINNER JOIN t_student s ON s.STUDENT_NO = ? AND cl.CURRICULUM_ID = s.CURRICULUM_ID\r\n\t\t\t\t\tINNER JOIN r_subject ss ON ss.ID = cl.SUBJECT_ID)\r\n\t\t\t\t\tAND sy.STATUS = 'active' AND sem.STATUS = 'active'\", array($studentNumber, $studentNumber, $studentNumber));\r\n\r\n\t\tif($q1->num_rows() > 0) {\r\n\t\t\tforeach($q1->result() as $row) {\r\n\t\t\t\t$result[] = array(\r\n\t\t\t\t\t'scheduleId' => $row->SCHEDULE_ID,\r\n 'subjectId' => $row->ID,\r\n 'subjectCode' => $row->SUBJECT_CODE,\r\n 'subjectDesc' => $row->DESCRIPTION,\r\n 'units' => $row->UNITS,\r\n 'sy' => $row->SY_ABBR,\r\n 'sem' => $row->SEMESTER,\r\n 'faculty' => $row->FACULTY,\r\n 'dayofWeek' => $row->DAY_OF_WEEK,\r\n 'startTime' => $row->START_TIME,\r\n 'endTime' => $row->END_TIME,\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\t\r\n \r\n\t\treturn $result;\r\n }", "public function getbal_sem(){\n\t\t$FN = $this->session->userdata('RF');\n\t\t$q = $_REQUEST['q'];\n\t\t$sql = \"SELECT * from get_Enrolled_CollegeFees WHERE Reference_Number = '$FN' AND schoolyear = '$q' GROUP BY schoolyear DESC\";\n\t\t$result = $this->db->query($sql);\n\n\n\t}", "public function status()\n {\n $jm = new JsonMapper();\n $jm->classMap[__items::class] = ChainStatus::class;\n $jm->classMap[__data::class] = Data::class;\n $result = $jm->map(json_decode(Request::get(Endpoint::CHAIN_STATUS)), new Response());\n\n if(is_null($this->network)){\n return $result;\n }else{\n $match_network = function($value) {\n return $value->chain_id == $this->network;\n };\n return array_values(array_filter($result->data->items,$match_network))[0];\n }\n }", "public function run()\n {\n DB::statement('SET foreign_key_checks=0');\n Status::truncate();\n DB::statement('SET foreign_key_checks=1');\n\n $statuses = [\n // ['id' => 1, 'active' => true, 'category' => 'regular', 'name' => '[ปฏิบัติงาน] ตำแหน่งใหม่'],\n // ['id' => 2, 'active' => true, 'category' => 'assistant', 'name' => 'ยืมตัวสังกัดการพยาบาล'],\n // ['id' => 3, 'active' => true, 'category' => 'assistant', 'name' => 'ยืมตัวสังกัดงานวิจัย'],\n // ['id' => 4, 'active' => true, 'category' => 'assistant', 'name' => 'ยืมตัวสังกัดงานผู้อำนวยการ'],\n // ['id' => 5, 'active' => true, 'category' => 'regular', 'name' => 'ผู้มีความรู้ความสามารถพิเศษ'],\n // ['id' => 6, 'active' => true, 'category' => 'consultant', 'name' => 'ที่ปรึกษาคณะฯ ด้านบริหารและกิจการพิเศษ'],\n // ['id' => 7, 'active' => true, 'category' => 'consultant', 'name' => 'ที่ปรึกษาคณะฯ ด้านวิชาการ'],\n // ['id' => 8, 'active' => true, 'category' => 'consultant', 'name' => 'ที่ปรึกษาคณะฯ ด้านผู้ถ่ายทอดงานและผู้สืบทอดงาน'],\n // ['id' => 9, 'active' => true, 'category' => 'consultant', 'name' => 'ที่ปรึกษาคณะฯ ด้านจิตอาสา'],\n // ['id' => 10, 'active' => true, 'category' => 'consultant', 'name' => 'ที่ปรึกษาภาควิชาฯ'],\n // ['id' => 11, 'active' => true, 'category' => 'regular', 'name' => 'บุคลากรภายนอกภาคฯ'],\n // ['id' => 12, 'active' => false, 'category' => 'regular', 'name' => 'เกษียณอายุราชการ'],\n // ['id' => 13, 'active' => false, 'category' => 'regular', 'name' => 'ไม่ประสงค์ต่อสัญญาจ้าง'],\n // ['id' => 14, 'active' => false, 'category' => 'regular', 'name' => 'ไม่เสนอต่อสัญญาจ้าง'],\n // ['id' => 15, 'active' => false, 'category' => 'regular', 'name' => 'ลาออก'],\n // ['id' => 16, 'active' => false, 'category' => 'regular', 'name' => 'ถูกให้ออก'],\n // ['id' => 17, 'active' => false, 'category' => 'regular', 'name' => 'ถึงแก่กรรม'],\n // ['id' => 18, 'active' => false, 'category' => 'assistant', 'name' => 'กลับต้นสังกัด (ยืมตัว)'],\n // ['id' => 19, 'active' => false, 'category' => 'regular', 'name' => 'โอนย้ายออก'],\n\n ['id' => 1, 'active' => true, 'category' => 'ตำแหน่งใหม่', 'name' => '[ปฏิบัติงาน] ตำแหน่งใหม่'],\n ['id' => 2, 'active' => true, 'category' => 'ตำแหน่งทดแทน', 'name' => '[ปฏิบัติงาน] ตำแหน่งทดแทนผู้พ้นสภาพ'],\n ['id' => 3, 'active' => true, 'category' => 'ตำแหน่งทดแทน', 'name' => '[ปฏิบัติงาน] ตำแหน่งทดแทนผู้พ้นสภาพล่วงหน้า'],\n ['id' => 4, 'active' => true, 'category' => 'ตำแหน่งทดแทน', 'name' => '[ปฏิบัติงาน] ตำแหน่งทดแทนผู้บริหาร'],\n ['id' => 5, 'active' => true, 'category' => 'ยืมตัว', 'name' => '[ปฏิบัติงาน] ยืมตัว'],\n ['id' => 6, 'active' => true, 'category' => 'ผู้มีความรู้ความสามารถพิเศษ', 'name' => '[ปฏิบัติงาน] ผู้มีความรู้ความสามารถพิเศษ'],\n ['id' => 7, 'active' => true, 'category' => 'ที่ปรึกษาคณะ', 'name' => '[ปฏิบัติงาน] ที่ปรึกษาคณะประเภทที่ 1 ด้านบริหารและกิจการพิเศษ (ไม่รับค่าตอบแทน)'],\n ['id' => 8, 'active' => true, 'category' => 'ที่ปรึกษาคณะ', 'name' => '[ปฏิบัติงาน] ที่ปรึกษาคณะประเภทที่ 2 ด้านวิชาการ (รับค่าตอบแทน)'],\n ['id' => 9, 'active' => true, 'category' => 'ที่ปรึกษาคณะ', 'name' => '[ปฏิบัติงาน] ที่ปรึกษาคณะประเภทที่ 3 ด้านผู้ถ่ายทอดงาน และผู้สืบทอดงาน (รับค่าตอบแทน)'],\n ['id' => 10, 'active' => true, 'category' => 'ที่ปรึกษาคณะ', 'name' => '[ปฏิบัติงาน] ที่ปรึกษาคณะประเภทที่ 4 ด้านจิตอาสา (ไม่รับค่าตอบแทน)'],\n ['id' => 11, 'active' => true, 'category' => 'ที่ปรึกษาภาควิชาฯ', 'name' => '[ปฏิบัติงาน] ที่ปรึกษาภาควิชาฯ'],\n ['id' => 12, 'active' => true, 'category' => 'บุคลากรภายนอกภาควิชาฯ', 'name' => '[ปฏิบัติงาน] บุคลากรภายนอกภาควิชาฯ'],\n ['id' => 13, 'active' => false, 'category' => 'เกษียณอายุราชการ', 'name' => '[พ้นสภาพ] เกษียณอายุราชการ'],\n ['id' => 14, 'active' => false, 'category' => 'ไม่ต่อสัญญาจ้าง', 'name' => '[พ้นสภาพ] ไม่ต่อสัญญาจ้าง'],\n ['id' => 15, 'active' => false, 'category' => 'ลาออก', 'name' => '[พ้นสภาพ] ลาออก'],\n ['id' => 16, 'active' => false, 'category' => 'ถูกให้ออก', 'name' => '[พ้นสภาพ] ถูกให้ออก'],\n ['id' => 17, 'active' => false, 'category' => 'ถึงแก่กรรม', 'name' => '[พ้นสภาพ] ถึงแก่กรรม'],\n ['id' => 18, 'active' => false, 'category' => 'กลับต้นสังกัด (ยืมตัว)', 'name' => '[พ้นสภาพ] กลับต้นสังกัด (ยืมตัว)'],\n ];\n\n foreach ($statuses as $status) {\n Status::create($status);\n }\n }", "public function create_contracts_with_all_statuses()\n {\n factory(Contract::class, 'unsigned_legal', 3)->create();\n factory(Contract::class, 'in_progress_legal', 3)->create();\n factory(Contract::class, 'finished_legal', 3)->create();\n factory(Contract::class, 'broken_legal', 3)->create();\n }", "function get_list_schedules() {\n $this->db->select('hadir.*,\n t_profil.uprof_full_name as tentor,\n m_profil.uprof_full_name as mahasiswa\n ');\n $this->db->from('fis_dservice_consult_attendances hadir');\n $this->db->join('fis_dservice_consult_classes t_kelas','t_kelas.scclass_id = hadir.scattd_scclass_fk');\n $this->db->join('fis_duser_accounts t_akun','t_akun.uacc_id = t_kelas.scclass_mentor_fk'); \n $this->db->join('fis_duser_profiles t_profil','t_profil.uprof_uacc_fk = t_akun.uacc_id');\n\n $this->db->join('fis_dservice_consult_classes m_kelas','m_kelas.scclass_id = hadir.scattd_scclass_fk'); \n $this->db->join('fis_dservice_consult_contracts m_kontrak','m_kontrak.sccontr_id = m_kelas.scclass_sccontr_fk');\n $this->db->join('fis_dservice_consultations m_konsul','m_konsul.scons_id = m_kontrak.sccontr_sconcs_fk'); \n $this->db->join('fis_duser_accounts m_akun','m_akun.uacc_id = m_konsul.scons_uacc_fk');\n $this->db->join('fis_duser_profiles m_profil','m_profil.uprof_uacc_fk = m_akun.uacc_id');\n $this->db->order_by('hadir.scattd_date', 'asc');\n $this->db->order_by('hadir.scattd_time_start', 'asc');\n\n \n $query = $this->db->get()->result();\n return $query;\n }", "public function run()\n {\n\n\n//profiles\n App\\Status::create ([\n 'statusable_id' => 1,\n 'statusable_type' => 'profiles',\n 'status' => 'active',\n ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'profiles',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'profiles',\n// 'status' => 'active',\n// ]); \n\n \n// //categories\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'categories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'categories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'categories',\n// 'status' => 'active',\n// ]); \n\n// //Subcategories\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 8,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 9,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 10,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 11,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 12,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 13,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 14,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 15,\n// 'statusable_type' => 'subcategories',\n// 'status' => 'inactive',\n// ]); \n\n// //channelss\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'channels',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'channels',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'channels',\n// 'status' => 'inactive',\n// ]); \n\n// //discussionss\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'discussions',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'discussions',\n// 'status' => 'inactive',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'discussions',\n// 'status' => 'active',\n// ]); \n// //pages\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'pages',\n// 'status' => 'active',\n// ]); \n\n// //postcategories\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'postcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'postcategories',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'postcategories',\n// 'status' => 'active',\n// ]); \n\n// //posts\n\n// App\\Status::create ([\n// 'statusable_id' => 1,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 2,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 3,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 4,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 5,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 6,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 7,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 8,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 9,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 10,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n\n// App\\Status::create ([\n// 'statusable_id' => 11,\n// 'statusable_type' => 'posts',\n// 'status' => 'active',\n// ]); \n \n\n }", "function wcs_get_subscription_ended_statuses() {\n\treturn apply_filters( 'wcs_subscription_ended_statuses', array( 'cancelled', 'trash', 'expired', 'switched', 'pending-cancel' ) );\n}", "public function getAllStudentsByProfileItemType($type, $organizationId, $profileIsps)\n {\n $yearId = $this->getOrgCurrentacademicYear($organizationId);\n $personOrgMetadata = $this->repositoryResolver->getRepository('SynapseCoreBundle:PersonOrgMetadata');\n if ($type == 'org') {\n $sql = \"select distinct md.person_id FROM person_org_metadata md \n JOIN person p ON p.id=md.person_id\n left join org_metadata as om\n on om.id = md.org_metadata_id \n where p.organization_id = $organizationId AND \";\n } else {\n $sql = \"select distinct md.person_id FROM person_ebi_metadata md\n JOIN person p ON p.id=md.person_id\n left join ebi_metadata as em\n ON em.id = md.ebi_metadata_id where p.organization_id = $organizationId AND \";\n }\n\n $tableAlias = \"md\";\n\n foreach ($profileIsps as $profileIsp) {\n\n if ($type == \"org\") {\n $typeFieldName = $type . AcademicUpdateConstant::LBL_METADATA_ID_QUERY;\n $termFieldName = \"org_academic_periods_id\";\n\n $orgMetaRepo = $this->repositoryResolver->getRepository(\"SynapseCoreBundle:OrgMetadata\");\n $orgMetadata = $orgMetaRepo->findOneBy(array(\n 'id' => $profileIsp['id']\n ));\n $profileMetaData = $orgMetadata;\n } else {\n $typeFieldName = $type . AcademicUpdateConstant::LBL_METADATA_ID_QUERY;\n $termFieldName = \"org_academic_terms_id\";\n\n $ebiMetataRepo = $this->repositoryResolver->getRepository(\"SynapseCoreBundle:EbiMetadata\");\n $ebiMetadata = $ebiMetataRepo->findOneBy(array(\n 'id' => $profileIsp['id'],\n 'definitionType' => 'E'\n ));\n $profileMetaData = $ebiMetadata;\n }\n\n if ($profileMetaData) {\n\n $scope = $profileMetaData->getScope();\n if ($scope == \"Y\") {\n $profileItemCond = \"AND \" . $tableAlias . \".org_academic_year_id = \" . $yearId;\n $this->getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName);\n } elseif ($scope == \"T\") {\n if (isset($profileIsp['terms']) && count($profileIsp['terms']) > 0) {\n $termIds = [];\n foreach ($profileIsp['terms'] as $term) {\n\n $termIds[] = $term['term_id'];\n }\n\n $profileItemCond = \"AND \" . $tableAlias . \".\" . $termFieldName . \" IN (\" . implode(\",\", $termIds) . \" )\";\n $this->getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName);\n\n } else {\n\n $profileItemCond = \"AND \" . $tableAlias . \".\" . $termFieldName . \" = -1\";\n $this->getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName);\n }\n } else {\n $profileItemCond = '';\n $this->getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName);\n }\n }\n }\n foreach ($this->query as $queryPart) {\n $inArr[] = \" person.id IN ($queryPart)\";\n }\n $criteria = implode(\" AND \", $inArr);\n $orgAcademicYearId = $this->academicYearService->getCurrentOrgAcademicYearId($organizationId);\n $finalQuery = \"SELECT\n person.id AS person_id\n FROM\n person\n JOIN\n org_person_student_year opsy\n ON opsy.organization_id = person.organization_id\n AND opsy.person_id = person.id\n AND opsy.org_academic_year_id = $orgAcademicYearId\n WHERE\n person.deleted_at IS NULL\n AND opsy.deleted_at IS NULL\n AND $criteria\";\n \n $students = $personOrgMetadata->getResultset($finalQuery);\n return $students;\n }", "public function getStatus() {\n\t\t$code = $this->status['code'];\n\t\tif ($code === '0'){\n\t\t\treturn 'Closed';\n\t\t}else if($code === '1'){\n\t\t\treturn 'On Hold';\n\t\t}else if($code === '2'){\n\t\t\treturn 'Open';\n\t\t}else if($code === '3'){\n\t\t\t$openingDate = ($this->status['openingdate'] === '') ? 'soon' : date(\"j M\", strtotime($this->status['openingdate']));\n\t\t\treturn 'Opening '.$openingDate; \n\t\t}else if($code === '4'){\n\t\t\treturn 'Closed For Season'; \n\t\t}else if($code === '5'){ \n\t\t\t$updateTime = ($this->status['updatetime'] === '') ? 'No Estimate' : 'Estimated: '.date(\"g:ia\", strtotime($this->status['updatetime']));\n\t\t\treturn 'Delayed '.$updateTime; \n\t\t}\n\t}", "public function getLastTeamCheck($tid) {\n\t\t$sql = \"SELECT\n\t\t\t\tchecks.service_id,\n\t\t\t\tchecks.status,\n\t\t\t\tchecks.time,\n\t\t\t\tservices.name\n\t\t\tFROM\n\t\t\t\tchecks\n\t\t\tLEFT JOIN\n\t\t\t\tservices ON (checks.service_id = services.id)\n\t\t\tWHERE\n\t\t\t\tchecks.team_id = 1\n\t\t\tORDER BY\n\t\t\t\tchecks.time DESC\";\n\n\t\t$result = $this->query($sql);\n\t\t$data = array();\n\n\t\tforeach ( $result AS $res ) {\n\t\t\tif ( !isset($data[$res['services']['name']]) ) {\n\t\t\t\t$data[$res['services']['name']] = $res['checks'];\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getStatusDescriptions()\n {\n $statuses = $this->getSortedStatuses();\n // concatenate the descriptions\n $reasons = [];\n foreach($statuses as $s) {\n $reason = $s->getReason();\n if ($reason) {\n $reasons[] = $reason;\n }\n }\n if (!empty($reasons)) {\n return $reasons;\n }\n return null;\n }", "public function action_list()\n {\n if(($data = $this->check_student($this->request->param('id'))))\n {\n $data['year'] = isset($data['year']) ? $data['year'] : \n $data['student']->end_year;\n $data['current_class'] = $data['student']->class_id; \n \n if(is_null($data['current_class']) || \n $data['year'] != $data['student']->end_year)\n {\n $data['subjects_records'] = Model::factory('year_subject')->get_subject_records($data);\n $data['class'] = count($data['subjects_records']) > 0 ? \n $data['subjects_records'][0]->class : '';\n }\n else\n {\n $data['subjects_records'] = Model::factory('year_subject')\n ->get_subject_records_by_classname($data);\n $data['subjects'] = Model::factory('class_subject')\n ->get_subjects_by_class_id($data['student']->class->id);\n $data['class'] = $data['student']->class->level->name . $data['student']->class->name;\n $data['table_class'] = View::factory('academicrecords/tables/class', $data);\n }\n $data['period'] = Model::factory('setting')->get_value('academic_year');\n \n $data['table'] = $this->set_table($data);\n $this->setTitle('Academic Records')\n ->view('academicrecords/list', $data)\n ->render();\n }\n// else\n// throw new HTTP_Exception_404;\n }", "function listSchedule($scoreType)\r\n\t{\r\n\t\tglobal $debug;\r\n\t\tglobal $msg;\r\n\t\t\r\n\t\t$dbh = getOpenedConnection();\r\n\t\t$list = array();\r\n\t\t\r\n\t\tif ($dbh == null) {\r\n\t\t\t$dbh = openDB();\r\n\t\t\tif ($dbh == null)\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t\t\t\r\n\t\t$sql = \"\r\n\t\t\tselect c.Id, \r\n\t\t\t\tc.Station,\r\n\t\t\t\ttime_format(time(c.StartTime), '%H:%i') as StartTime,\r\n\t\t\t\tp.SortOrder as Patrol\r\n\t\t\tfrom tbl_Pistol_Schedule c\r\n\t\t\tjoin tbl_Pistol_Patrol p on (p.Id = c.PatrolId)\r\n\t\t\twhere c.CompetitionDayId = 0$this->id\r\n\t\t\";\r\n\t\tif(isPrecision($scoreType)){\r\n\t\t\t$sql.=\"\torder by Patrol, c.Id;\";\r\n\t\t}else{\r\n\t\t\t$sql.=\"\torder by c.Id;\";\t\r\n\t\t}\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r($sql . \"<br><br>\");\r\n\t\t\r\n\t\t\r\n\t\t$result = mysqli_query($dbh,$sql);\r\n\t\t$rc = mysqli_affected_rows($dbh);\r\n\t\t\r\n\t\tif ($rc < 0)\r\n\t\t{\r\n\t\t\t$msg = mysqli_error($dbh);\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\twhile ($obj = mysqli_fetch_object($result))\r\n\t\t{\r\n\t\t\tunset($row);\r\n\t\t\t$row[\"Id\"] = $obj->Id;\r\n\t\t\t$row[\"Station\"] = $obj->Station;\r\n\t\t\t$row[\"Patrol\"] = $obj->Patrol;\r\n\t\t\t$row[\"StartTime\"] = $obj->StartTime;\r\n\t\t\t\r\n\t\t\t$list[] = $row;\r\n\t\t}\r\n\r\n\t\tmysqli_free_result($result);\r\n\r\n\t\treturn $list;\r\n\t}", "public function lastSpoolAction()\n {\n $arraySpool = array();\n\n try {\n\n // last spool SF3\n $lquery = new Query($this->container->getParameter(\"lavoisier01\"), 'OPSCORE_portal_spoolMail', 'lavoisier');\n $xml = simplexml_load_string($lquery->execute(), 'SimpleXMLElement', LIBXML_NOCDATA);\n\n $tabSpoolSF3 = json_decode(json_encode($xml), TRUE);\n\n\n $arraySpool[\"sf3 lavoisier01\"] = array(\n \"GenerationDate\" => trim(str_replace(\"[\", \"\", explode(\"]\", $tabSpoolSF3[\"entry\"])[0])),\n \"Sent\" => trim(explode(\"...\", $tabSpoolSF3[\"entry\"])[1])\n );\n\n $lquery = new Query($this->container->getParameter(\"lavoisierfr\"), 'OPSCORE_portal_spoolMail', 'lavoisier');\n $xml = simplexml_load_string($lquery->execute(), 'SimpleXMLElement', LIBXML_NOCDATA);\n\n $tabSpoolSF3 = json_decode(json_encode($xml), TRUE);\n\n\n $arraySpool[\"sf3 lavoisierfr\"] = array(\n \"GenerationDate\" => trim(str_replace(\"[\", \"\", explode(\"]\", $tabSpoolSF3[\"entry\"])[0])),\n \"Sent\" => trim(explode(\"...\", $tabSpoolSF3[\"entry\"])[1])\n );\n\n\n //last spool SF1\n $lquery = new Query($this->container->getParameter(\"lavoisier01\"), 'OPSCORE_portal_cron_sendMail', 'lavoisier');\n $xml = simplexml_load_string($lquery->execute(), 'SimpleXMLElement', LIBXML_NOCDATA);\n\n $tabSpoolSF1 = json_decode(json_encode($xml), TRUE);\n\n $arraySpool[\"sf1 lavoisier01\"] = array(\n \"GenerationDate\" => $tabSpoolSF1[\"GenerationDate\"],\n \"Sent\" => $tabSpoolSF1[\"Sent\"] . \" emails sent\"\n );\n\n $lquery = new Query($this->container->getParameter(\"lavoisierfr\"), 'OPSCORE_portal_cron_sendMail', 'lavoisier');\n $xml = simplexml_load_string($lquery->execute(), 'SimpleXMLElement', LIBXML_NOCDATA);\n\n $tabSpoolSF1 = json_decode(json_encode($xml), TRUE);\n\n $arraySpool[\"sf1 lavoisierfr\"] = array(\n \"GenerationDate\" => $tabSpoolSF1[\"GenerationDate\"],\n \"Sent\" => $tabSpoolSF1[\"Sent\"] . \" emails sent\"\n );\n\n\n return $this->render(\":backend/Home:lastSpool.html.twig\", array(\"tabSpool\" => $arraySpool));\n\n } catch (\\Exception $e) {\n return $this->render(\":backend/Home:lastSpool.html.twig\", array(\"error\" => $e->getMessage()));\n }\n\n }", "public function reportPeriodicClassWiseTopAbsentList()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportPeriodicClassWiseTopAbsentList')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function getStatus()\n {\n foreach($this->data as $domain => $rang)\n {\n //init work with curl\n $ch = curl_init($domain);\n\n //return answer in string unless showing in brows \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //for redirects\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n //take a headers in answer (status coming)\n curl_setopt($ch, CURLOPT_HEADER, false);\n\n //make request to curk\n curl_exec($ch);\n\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $time = round(curl_getinfo($ch, CURLINFO_CONNECT_TIME), 2);\n\n curl_close($ch);\n\n //complited array with result\n $this->result[] = [\n 'domain' => $domain,\n 'rang' => $rang,\n 'http_code' => $http_code,\n 'time' => $time\n ];\n\n }\n\n return $this->result; \n }", "function getOffStudyStatuses() {\n return array(self::ON_STUDY => self::ON_STUDY,\n self::COMPLETED => self::COMPLETED,\n self::OSINELIGIBLE => self::OSINELIGIBLE,\n self::WITHDRAWN => self::WITHDRAWN,\n self::LOST => self::LOST,\n self::ADVERSE_EVENTS => self::ADVERSE_EVENTS,\n self::OTHER => self::OTHER);\n }", "public function issues() {\n $station = auth()->user()->station_id;\n\n $trans = DB::select('select * from trans_info where isu_stn_id = ? order by id desc', [$station]);\n\n return $trans;\n }", "function get_board_list($status = 'all')\n {\n if($status != 'all') $this->db->where(\"board_active\",$status);\n\n $query = $this->db->get('board');\n //echo $this->db->last_query();\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n return $result;\n }\n }", "function getStudentIssues( $studentid ) {\r\n\t\tif( $this->userCanGetStudentIssues( $studentid ) ) {\r\n\t\t\t$query = \"select distinct i.ID from issues i, contacts c, `contacts-students` cs\r\n\t\t\t\t where cs.studentid = '$studentid'\r\n\t\t\t\t and cs.contactid = c.id\r\n\t\t\t\t and c.issue = i.id\r\n order by i.DateCreated desc\";\r\n\r\n\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t$return = array();\r\n\t\t\twhile( $row = mysql_fetch_assoc($result) ) {\r\n\t\t\t\tif( $this->userCanViewIssue('',$row['ID']) ) {\r\n\t\t\t\t\tarray_push( $return, $this->viewIssue('',$row['ID']) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t\t}\r\n\t}", "function citrixonline_get_list_of_webinars($type = 0) \n {\n\t\tif(!$this->organizer_key or !$this->access_token)\n\t\t\treturn 0;\n\t\t\t\n\t\t$return_array = array();\n\t\t\n\t\t$reponse = json_decode($this->make_request(\"https://api.citrixonline.com/G2W/rest/organizers/\".$this->organizer_key.\"/upcomingWebinars?oauth_token=\".$this->access_token), true);\n\t\t\n\t\tif(isset($reponse['int_err_code']) and $reponse['int_err_code'] != '')\n\t\t{\n\t\t\t$this->set_access_token('');\n\t\t\t$this->set_organizer_key('');\t\t\t\t\n\t\t\tthrow new Exception($reponse['int_err_code']);\n\t\t}\n\t\t\n\t\t$return_array['upcoming']['webinars'] = $reponse;\n $return_array['upcoming']['status'] = true;\n\t\t\n\t\tif($type>0)\n\t\t{\n\t\t\t$reponse = json_decode($this->make_request(\"https://api.citrixonline.com/G2W/rest/organizers/\".$this->organizer_key.\"/historicalWebinars?oauth_token=\".$this->access_token), true);\n\t\t\t\t\t\t\n\t\t\tif(isset($reponse['int_err_code']) and $reponse['int_err_code'] != '')\n\t\t\t{\n\t\t\t\t$this->set_access_token('');\n\t\t\t\t$this->set_organizer_key('');\t\t\t\t\n\t\t\t\tthrow new Exception($reponse['int_err_code']);\n\t\t\t}\n\t\t\t\n\t\t\t$return_array['historical']['webinars'] = $reponse;\n\t\t\t$return_array['historical']['status'] = true;\n\t\t}\n\t\t\t\n return $return_array;\n\t}", "public function getSchool();", "function getTotalLaboursByStatus($statusType, $statusID, $returnType){\n\t\t\t$sqlQuery = \"SELECT wkr_id, wkr_passno, wkr_name, emp_status_desc, wkr_country, wkr_race, wkr_permitexp, cty_desc, race_desc FROM workers \";\n\t\t\t$sqlQuery .= \" LEFT JOIN mst_emp_status ON workers.wkr_status = mst_emp_status.emp_statusid\n\t\t\t\t\t\t \tLEFT JOIN mst_countries ON mst_countries.cty_id = workers.wkr_country\n\t\t\t\t\t\t \tLEFT JOIN mst_race ON mst_race.race_id = workers.wkr_race\";\n\t\t\t\n\t\t\tif(strlen($statusType) > 0){\n\t\t\t\t$sqlQuery .= \" WHERE $statusType = '$statusID' \";\n\t\t\t}\n\t\t\t$labourRecord = $this->db->query($sqlQuery);\n\t\t\t\n\t\t\tif($returnType == 'total'){\n\t\t\t\treturn $labourRecord->num_rows();\n\t\t\t}\n\t\t\telse return $labourRecord;\n\t\t}", "public static function get_statuses() {\n return array(\n self::GUEST,\n self::REGISTERED\n );\n }", "private function getStatusInfo(array $aggregations): array\n {\n $datasetCount = function ($status) use ($aggregations) {\n if (array_key_exists($status, $aggregations)) {\n return $aggregations[$status];\n } else {\n return 0;\n }\n };\n\n $statusInfo = [\n [\n 'id' => 1,\n 'name' => 'Identified',\n 'count' => $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_NOT_AVAILABLE),\n ],\n [\n 'id' => 2,\n 'name' => 'Submitted',\n 'count' => (\n $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PENDING_METADATA_SUBMISSION)\n + $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PENDING_METADATA_APPROVAL)\n ),\n ],\n [\n 'id' => 3,\n 'name' => 'Restricted',\n 'count' => (\n $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_RESTRICTED_REMOTELY_HOSTED)\n + $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_RESTRICTED)\n ),\n ],\n [\n 'id' => 4,\n 'name' => 'Available',\n 'count' => (\n $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PUBLICLY_AVAILABLE_REMOTELY_HOSTED)\n + $datasetCount(DatasetSubmission::AVAILABILITY_STATUS_PUBLICLY_AVAILABLE)\n ),\n ],\n ];\n\n // Remove any element with a count of 0.\n foreach ($statusInfo as $key => $value) {\n if (0 === $value['count']) {\n unset($statusInfo[$key]);\n }\n }\n\n // Sorting based on highest count\n $array_column = array_column($statusInfo, 'count');\n array_multisort($array_column, SORT_DESC, $statusInfo);\n\n return $statusInfo;\n }", "function getStatusList() {\n $statusList = array();\n foreach (Constants::$statusNames as $id => $name) {\n $statusList[$id] = \"$id - $name\";\n }\n return $statusList;\n}", "public function get_staff_for_payroll() {\n\t\t$staffing_types = [];\n\n\t\t$query = $this->CI->db->select()->from('staffing_types')\n\t\t\t->where([\n\t\t\t\t'accountID' => $this->CI->auth->user->accountID,\n\t\t\t])->get();\n\n\t\tforeach ($query->result() as $row) {\n\t\t\t$staffing_types[$row->type] = $row;\n\t\t}\n\n\t\t$staff_to_display = $this->staffing_types_required_for_sessions;\n\n\n\t\tforeach ($staffing_types as $type => $staffing_type) {\n\t\t\tif ($staffing_type->display_on_payroll) {\n\t\t\t\tif (!isset($staff_to_display[$type]) || (array_key_exists($staffing_type->type, $staff_to_display))) {\n\t\t\t\t\t$staff_to_display[$type] = $staffing_type->name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (array_key_exists($staffing_type->type, $staff_to_display) && !$staffing_type->display_on_payroll) {\n\t\t\t\tunset($staff_to_display[$type]);\n\t\t\t}\n\t\t}\n\n\t\treturn $staff_to_display;\n\t}" ]
[ "0.5351013", "0.5217151", "0.5212155", "0.5133655", "0.5129097", "0.5098706", "0.50931007", "0.50842947", "0.5082696", "0.50766546", "0.5053775", "0.49801633", "0.4973518", "0.4954132", "0.49187094", "0.49115124", "0.4907121", "0.49054185", "0.48848382", "0.48784333", "0.487798", "0.48443967", "0.48407236", "0.4836838", "0.479637", "0.47875497", "0.47822487", "0.4781875", "0.4771923", "0.47601363", "0.4747861", "0.4725588", "0.46937746", "0.46930456", "0.46746263", "0.4664579", "0.46509275", "0.46493363", "0.46491638", "0.4632696", "0.46287206", "0.46280444", "0.4625165", "0.4624774", "0.4624753", "0.46145374", "0.4594233", "0.45902976", "0.4587374", "0.458543", "0.458237", "0.4579861", "0.45717153", "0.45540217", "0.45430803", "0.45361236", "0.45225114", "0.45065007", "0.44964203", "0.4483575", "0.44823715", "0.44799617", "0.4474753", "0.44717768", "0.44536316", "0.44513988", "0.44474518", "0.4446112", "0.4434608", "0.44320714", "0.44236052", "0.44193837", "0.44179362", "0.44016665", "0.43935207", "0.43906492", "0.43906206", "0.438798", "0.43807942", "0.4380068", "0.4370419", "0.43559086", "0.43556282", "0.43547598", "0.4352222", "0.43458802", "0.43403932", "0.4337074", "0.43364355", "0.43348312", "0.43332493", "0.4325794", "0.43243906", "0.43240863", "0.43153715", "0.43120933", "0.43116155", "0.43096438", "0.4309634", "0.43084785" ]
0.58596003
0
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Get a list of Settings for the PBX
public function all(string $pbx) { return $this->send("pbx/{$pbx}/settings")->settings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAllSettings() {\n $db = Database::instance();\n $rows = $db->select()\n ->from('settings')\n ->query()\n ->fetchAll();\n\n $data = array();\n foreach($rows as $row) {\n $data[$row['param_name']] = $row['param_value'];\n }\n \n return $data;\n }", "function getSettingsList(){\n\t\treturn array(\n\t\t'institute_name',\n\t\t'institute_phone',\n\t\t'institute_address',\n\t\t'email',\n\t\t'notifications',\n\t\t'facebook_url',\n\t\t'linkedin_url',\n\t\t'twitter_url',\n\t\t'youtube_url',\n\t\t'copyright',\n\t\t'metatags'\n\t\t);\n\t}", "public function getSettings();", "public function getAllSettings()\n {\n return $this->settings;\n }", "public function getSettings(): array\n {\n $cmd = new ListSettings($this->repo->getRoot());\n $res = $this->runner->run($cmd, new ListSettings\\MapSettings());\n\n return $res->getFormattedOutput();\n }", "public function getAll() {\n $data=[];\n\n foreach($this->settings AS $name=>$value) {\n $data[$name]=$this->get($name);\n }\n\n return $data;\n }", "public function getSiteSettings() {\n $query = $this->db->prepare(\"SELECT * FROM `settings`\");\n $query->execute();\n $result = $query->get_result();\n $query->close();\n\n $data = [];\n\n while($row = $result->fetch_assoc()) {\n $data[$row['name']] = $row['value'];\n }\n\n return $data;\n }", "public function get_settings() {\n $this->create_object_settings();\n return array($this->settings);\n }", "public function getList()\n {\n $this->data['setting_list'] = $this->setting->mainSettings();\n }", "function getSettings()\r\n {\r\n global $objDatabase;\r\n $query = \"SELECT name, value FROM \".DBPREFIX.\"module_banner_settings\";\r\n $objResult = $objDatabase->Execute($query);\r\n while (!$objResult->EOF) {\r\n $this->arrSettings[$objResult->fields['name']] = $objResult->fields['value'];\r\n $objResult->MoveNext();\r\n }\r\n }", "public function getSettingsAll ()\n {\n \tglobal $debug;\n \t\n \t$settings = array();\n \t$select_string = \"select settings_key,settings_value from \".$this->table_prefix.$this->quiz_tables['settings'];\n \t$settings = $this->db_object->getKeyValue ($select_string, \"settings_key\", \"settings_value\");\n \treturn $settings;\n }", "public function settings_list()\n {\n return [\n 'anonymous_urls' => 1,\n 'registration' => 1,\n 'private_site' => 0,\n 'show_guests_latests_urls' => 1,\n 'hash_ip' => 1,\n 'website_name' => 'UrlHum',\n 'anonymize_ip' => 1,\n 'reservedShortUrls' => '',\n 'deleted_urls_can_be_recreated' => 1,\n 'privacy_policy' => '',\n 'enable_privacy_policy' => 0,\n 'terms_of_use' => '',\n 'enable_terms_of_use' => 0,\n 'custom_html' => '',\n ];\n }", "public function getSettings() : array\n {\n return $this->settings;\n }", "public function getSettings() : array;", "public function getSettings() {\n\t\tif ($blogSettings = Cache::read($this->_cacheKey)) {\n\t\t\treturn $blogSettings;\n\t\t}\n\t\t$blogSettings = $this->find('list', array(\n\t\t\t'fields' => array('setting', 'value')\n\t\t));\n\t\tCache::write($this->_cacheKey, $blogSettings);\n\t\treturn $blogSettings;\n\t}", "public function getAllSettings()\n {\n return $this->settingsByLocale;\n }", "function get_registered_settings()\n {\n }", "function getAllSettings()\n\t\t{\n\t\t\t\n\t\t\ttry{\n\n\t\t\t\t$query = $this->_db->prepare( \"SELECT * FROM settings\" );\n\n\t\t\t\t$query->execute();\n\n\t\t\t\t$data = $query->fetchAll();\n\t\t\t\t\n\t\t\t\tforeach( $data as $setting )\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t$settings[ $setting[ \"settings_key\" ] ] = $setting[ \"settings_value\" ];\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $settings;\n\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\t\t\t\n\t\t}", "private function getSettings() {\n\t\t$code = (version_compare(VERSION, '3.0', '<') ? '' : $this->type . '_') . $this->name;\n\t\t\n\t\t$settings = array();\n\t\t$settings_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"setting WHERE `code` = '\" . $this->db->escape($code) . \"' ORDER BY `key` ASC\");\n\t\t\n\t\tforeach ($settings_query->rows as $setting) {\n\t\t\t$value = $setting['value'];\n\t\t\tif ($setting['serialized']) {\n\t\t\t\t$value = (version_compare(VERSION, '2.1', '<')) ? unserialize($setting['value']) : json_decode($setting['value'], true);\n\t\t\t}\n\t\t\t$split_key = preg_split('/_(\\d+)_?/', str_replace($code . '_', '', $setting['key']), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t\t\n\t\t\t\tif (count($split_key) == 1)\t$settings[$split_key[0]] = $value;\n\t\t\telseif (count($split_key) == 2)\t$settings[$split_key[0]][$split_key[1]] = $value;\n\t\t\telseif (count($split_key) == 3)\t$settings[$split_key[0]][$split_key[1]][$split_key[2]] = $value;\n\t\t\telseif (count($split_key) == 4)\t$settings[$split_key[0]][$split_key[1]][$split_key[2]][$split_key[3]] = $value;\n\t\t\telse \t\t\t\t\t\t\t$settings[$split_key[0]][$split_key[1]][$split_key[2]][$split_key[3]][$split_key[4]] = $value;\n\t\t}\n\t\t\n\t\treturn $settings;\n\t}", "public function getSettings(): array\n {\n return [];\n }", "public function getSettings()\n {\n $this->db->query(\"SELECT setting_key,setting_value FROM settings\");\n\n if ($this->db->execute()) {\n $settings = $this->db->resultset();\n $settings_array = array();\n foreach ($settings as $setting) {\n $settings_array[$setting->setting_key] = $setting->setting_value;\n }\n return $settings_array;\n }\n }", "public function getSettings()\n {\n $aValidSettings = $this->getValidSettings();\n $aSettings = array();\n\n foreach ( $aValidSettings as $sSettingName ) {\n $aSettings[$sSettingName] = $this->getSetting( $sSettingName );\n }\n\n return $aSettings;\n }", "function GetListSettings()\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idSettings, NameSettings, ValueInt, ValueDate, ValueChar, DescriptionSettings FROM fishermenland.settings\");\n\n return $req;\n}", "public function getSettings()\n\t{\n\t\t// Create an empty array\n\t\t$settings = array();\n\n\t\t// Get the Twilio settings\n\t\t$settings['twilio_account_sid'] = Mage::getStoreConfig('smsnotifications/twilio_api_credentials/account_sid');\n\t\t$settings['twilio_auth_token'] = Mage::getStoreConfig('smsnotifications/twilio_api_credentials/auth_token');\n\t\t$settings['twilio_sender_number'] = Mage::getStoreConfig('smsnotifications/twilio_api_credentials/sender_number');\n\n\t\t// Get the general settings\n\t\t$settings['country_code_filter'] = Mage::getStoreConfig('smsnotifications/general/country_code_filter');\n\n\t\t// Get the order notification settings\n\t\t$settings['order_noficication_recipients'] = Mage::getStoreConfig('smsnotifications/order_notification/recipients');\n\t\t$settings['order_noficication_recipients'] = explode(';', $settings['order_noficication_recipients']);\n\t\t$settings['order_notification_status'] = Mage::getStoreConfig('smsnotifications/order_notification/order_status');\n\n\t\t// Get the shipment notification settings\n\t\t$settings['shipment_notification_message'] = Mage::getStoreConfig('smsnotifications/shipment_notification/message');\n\n\t\t// Return the settings\n\t\treturn $settings;\n\t}", "function get_all_user_settings()\n {\n }", "public function getSettings()\n {\n return collect($this->settings())->mapWithKeys(function ($settings, $key) {\n return [$key => PaymentGatewaySettings::get($key)];\n });\n }", "function get_settings()\n {\n #global $pdo, $db_settings;\n #$database = Database::getInstance();\n $result = Database::$content->query(\"SELECT name, value FROM \".Database::$db_settings['settings_table']);\n while($line = $result->fetch())\n {\n $settings[$line['name']] = $line['value'];\n }\n return $settings;\n }", "public function get_settings() {\n\n\t\tif($this->settings) {\n\t\t\treturn $this->settings;\n\t\t}\n\n\t\t$query = $this->db->get('shortee_settings');\n\t\t$this->settings = $query->row_array();\n\t\t$this->domain_list = explode(',',$this->settings['short_domain']);\n\n\t\treturn $this->settings;\n\t}", "public function getSettings() {\n return $this->settings == null ? array() : json_decode($this->settings, true);\n }", "protected static function getSettings()\r\n {\r\n if(!self::$avail_settings)\r\n {\r\n $data = self::db()->query(\r\n 'SELECT * FROM `:prefix:rbac_user_settings` AS `t1` '\r\n . 'JOIN `:prefix:forms_fieldtypes` AS `t2` '\r\n . 'ON `t1`.`fieldtype`=`t2`.`type_id` '\r\n . 'WHERE `is_editable`=? '\r\n . 'ORDER BY `fieldset` ASC, `position` ASC',\r\n array('Y')\r\n );\r\n if($data)\r\n {\r\n self::$avail_settings = $data->fetchAll();\r\n }\r\n }\r\n return self::$avail_settings;\r\n }", "public static function get_settings()\n\t{\n\t\tif (! isset(self::$_settings) || self::$_settings == null)\n\t\t{\n\t\t\t$settings = array();\n\t\t\t//Get the actual saved settings\n\t\t\t$query = ee()->db->get(self::$_settings_table_name);\n\t\t\tforeach ($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$settings[$row[\"setting_name\"]] = $row[\"setting_value\"];\n\t\t\t}\n\t\t\tself::$_settings = array_merge(self::_get_default_settings(), $settings);\n\t\t}\n\t\treturn self::$_settings;\n\t}", "public function accountSettings()\n {\n\t// make the call\n\treturn (array) $this->doCall(\n\t 'account/settings.json', null, true\n\t);\n }", "public function all()\n {\n $this->loadSettingsIfNotLoaded();\n\n return $this->settings;\n }", "public function getSettings()\n\t{\n try {\n $code = 200;\n\n $app_settings = $this->appSettings();\n $projects = $this->projectsData();\n $api_token_data = $this->apiTokenData();\n\n $response = compact('app_settings', 'projects', 'api_token_data');\n } catch (\\Exception $e) {\n $response = [\n 'message' => $e->getMessage(),\n ];\n $code = $e->getCode();\n }finally {\n $this->printJSON($response, $code);\n }\n }", "public static function getAll(){\n\t\t\treturn Setting::find()->asArray()->all();\n\t\t}", "public static function getSettings()\n {\n return Settings::getSettings();\n }", "public function getSettings()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$settings = KiminoConfig::all()->sortBy('setting');\n\t\t}\n\t\t\n\t\tcatch(\\Exception $exception)\n\t\t{\n\t\t\tabort(500, \"Ooops-a-bobbles. Something goofed.\n\t\t\t\tI probably couldn't find the kimino_configs database table.\n\t\t\t\tDid you run the migration file supplied in the kimino-config package?\n\t\t\t\t(php artisan migrate --path=vendor/danielrhodeswarp/kimino-config/src/database/migrations)\");\n\t\t}\n\t\t\n\t\t//group settings by prefix\n\t\t$groupedSettings = [];\n\t\t\n\t\tforeach($settings as $setting)\n\t\t{\n\t\t\t$prefix = explode('_', $setting->setting)[0];\n\t\t\t\n\t\t\t$groupedSettings[$prefix][] = $setting;\n\t\t}\n\t\t\n\t\t//return appropriate \"kimino config\" page\n\t\t$viewName = config('kimino.frontend') . '.get-settings';\n\t\treturn view(\"kimino-config::{$viewName}\", ['groupedSettings' => $groupedSettings]);\n\t}", "public function getSettings(): array\n {\n $settings = static::find()->where(['status' => true])->asArray()->all();\n return array_merge_recursive(\n ArrayHelper::map($settings, 'key', 'value', 'category'),\n ArrayHelper::map($settings, 'key', 'type', 'category')\n );\n }", "abstract public function getSettings();", "static public function get_registered_settings() {\n\t\treturn self::$registered_settings;\n\t}", "public function getSettings()\n {\n // \"static\" to compute only once and return cached value later.\n static $data = null;\n if ($data === null) {\n // Settings\n $data = array(\n 'api' => $this->getApi(),\n 'enabled' => $this->enabled(),\n 'test' => $this->test(),\n 'test_server_url_start' => $this->getTestServerUrlStart(),\n 'use_raw_test_url_for_biz_api' =>\n $this->getUseRawTestUrlForBizApi(),\n 'send_key' => $this->getSendKey(),\n 'sender_controller_url' => $this->getSenderControllerUrl(),\n 'transport_method' => $this->getTransportMethod()\n );\n }\n return $data;\n }", "public static function get_settings() {\n\t\treturn array_merge( SpamLyticsHelper::default_settings(), get_option( 'spamlytics', array() ) );\n\t}", "public function getSettings()\n {\n $data = $this->_plugin->getSettings();\n\n return Frenet_SettingsModel::populateModel($data);\n }", "public function getSettings(): array {\n\t\treturn [\n\t\t\t// Enable debug mode (to print errors).\n\t\t\t'debug' => !empty(elgg_get_config('debug')),\n\t\t\t'security' => [\n\t\t\t\t'requestedAuthnContext' => false,\n\t\t\t],\n\t\t\t// Service Provider Data that we are deploying.\n\t\t\t'sp' => $this->getSPSettings(),\n\t\t\t\n\t\t\t// Identity Provider Data that we want connected with our SP.\n\t\t\t'idp' => $this->getIDPSettings(),\n\t\t];\n\t}", "public function index()\n {\n $userSettings = UserSettings::all();\n return $userSettings;\n }", "function getSettings() {\n\t\t$current_opts = get_option('wassup_settings');\n\t\t$default_opts = $this->defaultSettings();\n\t\t$settings = array();\n\t\tif (!empty($current_opts) && is_array($current_opts)) {\n\t\t\tforeach ($default_opts as $skey => $defaultvalue) {\n\t\t\t if (array_key_exists($skey,$current_opts)) {\n\t\t\t \t$settings[$skey] = $current_opts[$skey];\n\t\t\t } else {\n\t\t\t \t$settings[$skey] = $defaultvalue;\n\t\t\t }\n\t\t\t} //end foreach\n\t\t} else {\n\t\t\t$settings = $default_opts;\n\t\t}\n\t\treturn $settings;\n\t}", "protected function getSettings() {\n\t\treturn $this->configuration->getSettings();\n\t}", "public static function getSettings() {\n\n\t\tglobal $lumi_aiowps_tweaks;\n\t\tif( isset( $lumi_aiowps_tweaks['Settings'] ) ) {\n\t\t\treturn $lumi_aiowps_tweaks['Settings'];\n\t\t} else {\n\t\t\tinclude_once( __DIR__ . '/SettingsAPI.class.php' );\n\t\t\t$lumi_aiowps_tweaks['Settings'] = new SettingsAPI();\n\t\t\treturn $lumi_aiowps_tweaks['Settings'];\n\t\t}\n\n\t}", "public function getSettings()\n {\n if (!$this->guestId) {\n return [];\n }\n\n if (is_null($this->settings)) {\n $this->settings = $this->guest->getSettings($this->guestId);\n }\n\n return $this->settings;\n }", "public function getSettings()\n {\n $response = $this->get('settings');\n $data = $response->json();\n return new Settings($data);\n }", "public function getSettings()\n\t{\n\t\treturn $this->settings;\n\t}", "protected function getSettings(): array\n {\n static $settings = null;\n\n if ($settings === null) {\n $settings = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extKey);\n }\n\n return $settings ?? [];\n }", "public function getValues(){\n\t\treturn $this->_settings;\n\t}", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return Initiatives::getInstance()->getSettings();\n }", "protected function getSettingArray()\n {\n return $this->container->get($this->getSettingKey());\n }", "public function _getSettings()\n {\n $this->loadModel('Setting');\n $this->Setting->cacheQueries = true;\n\n $settings = $this->Setting->find('list', array('fields' => array('field', 'value')));\n\n return $settings;\n }", "public function getSettings() {\n return $this->settings;\n }", "public function get_settings()\n {\n }", "public function getSettings() {\n\t\treturn $this -> settings;\n\t}", "public function getSettings()\n {\n $data = [];\n $settings = Setting::where('section', 'seo')->get();\n foreach ($settings as $setting) {\n $data[$setting->settingkey] = ($setting->val != '') ? unserialize($setting->val) : [];\n }\n\n return $data;\n }", "public function getSettings() {\n $file = SETTINGS_PATH.'/'.$this->domain.'.json';\n $siteSettings = file_get_contents($file);\n return json_decode($siteSettings);\n }", "public function getSettings()\n {\n return $this->_settings;\n }", "public function index() {\n\t\tif(($setting = Setting::getAllSettings()) == null) {\n\t\t\treturn false;\n\t\t\t// return responseFromCode(92000);\n\t\t}\n\t\treturn $setting;\n\t\t// return responseFromCode(91000, $setting);\n\t}", "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 }", "public function getSettings()\n {\n return self::$settings;\n }", "public function settings(): array\n {\n return [];\n }", "public static function getSettings()\n {\n $types = self::availableParams('type');\n\n foreach($types as $type) {\n $settings[$type] = self::availableParams('reason_' . $type, __('report.reason_' . $type));\n }\n\n return $settings ?? [];\n }", "function get_settings() {\n\t\treturn $this->settings;\n\t}", "function get_setlist() {\n $query = $this->db->get('settings');\n return $query->result_array();\n }", "function get_settings()\n {\n $data = [];\n try {\n $sql = \"SELECT param, val FROM settings\";\n\n $db = Database::getInstance();\n $_dbh = $db->getConnection();\n $_dbh->exec('SET NAMES utf8');\n\n $query = $_dbh->query($sql);\n\n while ($result = $query->fetch(PDO::FETCH_OBJ)) {\n $data[$result->param] = $result->val;\n }\n $_dbh = null;\n } catch (PDOException $e) {\n throw new CustomException(\"Query error\");\n }\n return $data;\n }", "public function get_settings_sections() {\n\t\treturn tml_redirection_admin_get_settings_sections();\n\t}", "public static function getSettings()\n\t\t{\n\t\t\treturn self::$ettings;\n\t\t}", "public function fetchSettings()\n {\n return $this->store->fetch();\n }", "public function get_settings( ) {\n\n $settingsArray = $this->mockinvoice_model->get_settings_array( $this->input->post( 'mockInvoiceId' ) );\n\n // Send back the timesheet settings as JSON.\n $this->json_library->print_array_json( $settingsArray );\n }", "function retrieveSettings()\n\t\t{\t\n\t\t\t$this->settings = array();\n\t\t\t// first retrieve the \"external\" settings\n\t\t\t$this->retrieveExternalSettings();\n\t\t\t// read the settings property\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS);\n\t\t\tif ($stream == false) {\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\t$stat = mapi_stream_stat($stream);\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\t$settings_string = '';\n\t\t\tfor($i=0;$i<$stat['cb'];$i+=1024){\n\t\t\t\t$settings_string .= mapi_stream_read($stream, 1024);\n\t\t\t}\n\t\t\t\n\t\t\t// suppress php notice in case unserializing fails\n\t\t\t$settings = @unserialize($settings_string);\n\n\t\t\tif (!$settings){ // backwards compatible with old saving method using XML\n\t\t\t\t$xml = new XMLParser();\n\t\t\t\t$settings = $xml->getData($settings_string);\n\t\t\t}\n\n\t\t\tif (is_array($settings) && isset($settings['settings']) && is_array($settings['settings'])){\n\t\t\t\t$this->settings = array_merge_recursive_overwrite($settings['settings'],$this->settings);\n\t\t\t}\n\t\t}", "function bdpp_get_settings() {\n\t\n\t$options = get_option('bdpp_opts');\n\t\n\t$settings = (is_array($options)) ? $options : array();\n\t\n\treturn $settings;\n}", "public static function get_settings_pages() {\n\t\tif ( empty( self::$settings ) ) {\n\t\t\t$settings = array();\n\n\t\t\tinclude_once( 'settings/class-kopa-settings-page.php' );\n\n\t\t\t$settings[] = include( 'settings/class-kopa-settings-theme-options.php' );\n\t\t\t$settings[] = include( 'settings/class-kopa-settings-sidebar-manager.php' );\n\t\t\t$settings[] = include( 'settings/class-kopa-settings-layout-manager.php' );\n\t\t\t$settings[] = include( 'settings/class-kopa-settings-backup-manager.php' );\n\n\t\t\tself::$settings = apply_filters( 'kopa_get_settings_pages', $settings );\n\n\t\t\t// merge all settings arguments to an array\n\t\t\tforeach ( $settings as $setting_obj ) {\n\t\t\t\t$options_settings = $setting_obj->get_page_settings();\n\t\t\t\tself::$settings_arguments = wp_parse_args( self::$settings_arguments, $options_settings );\n\t\t\t} // end outer foreach\n\t\t}\n\t\treturn self::$settings;\n\t}", "public function getAccountSettings() {\n\t\t\n\t\treturn $this->_getResponse(self::URL_USERS_SETTING);\n\t}", "public function registerSettings()\n {\n return [];\n }", "abstract public function get_settings();", "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 getSettingLinks()\n {\n $currentUserModel = Users_Record_Model::getCurrentUserModel();\n if ($currentUserModel->isAdminUser()) {\n $settingsLinks[] = array(\"linktype\" => \"LISTVIEWSETTING\", \"linklabel\" => \"Settings\", \"linkurl\" => \"index.php?module=VDXMLExport&view=Settings&parent=Settings\", \"linkicon\" => \"\");\n $settingsLinks[] = array(\"linktype\" => \"LISTVIEWSETTING\", \"linklabel\" => \"Uninstall\", \"linkurl\" => \"index.php?module=VDXMLExport&view=Uninstall&parent=Settings\", \"linkicon\" => \"\");\n }\n return $settingsLinks;\n }", "public function get_settings() {\n return self::$settings;\n }", "public function getSettings(){\r\n\t\treturn $this->initSettings;\r\n\t}", "public function listAll() : array\n {\n return \\Cache::remember('query_list_all_config', 60 * 60, function () {\n return $this->config->all()->pluck('value', 'name')->all();\n });\n }", "public static function get_site_setting()\n {\n return Setting::pluck('value','slug')->toArray();\n }", "function load_settings(){\n $ret = array();\n $c = $this->_files->readfile($this->_settings_file);\n if( $c !== false ){\n $c = explode( \"\\n\", eol($c));\n foreach( $c as $line ){\n //ignore a lot of stuff - quick hack for now\n if(substr($line, 0, 1) != '#'\n && trim($line) != ''\n && substr($line, 0, 4) != 'LANG'\n && substr($line, 0, 1) != '#'\n && substr($line, 0, 11) != 'export LANG'\n && substr($line, 0, 4) != 'bold'\n && substr($line, 0, 6) != 'normal' ){\n $set = explode('=', $line);\n $ret[$set[0]] = trim($set[1], '\"\\''); //this should now be one setting per key with setting name as key\n }\n }\n\n if( count($ret) > 0 ){\n $_SESSION['settings.conf'] = $ret;\n return $_SESSION['settings.conf'];\n }\n }else{\n unset($_SESSION['settings.conf']);\n return false;\n }\n }", "public function settings()\n\t{\n\t\t$settings = array(\n\t\t\t'user_id' \t=> '',\n\t\t\t'private_key' \t=> '',\n\t\t\t'debug'\t=> array('r',\n\t\t\t\tarray(\n\t\t\t\t\t'y' => lang('yes'),\n\t\t\t\t\t'n' => lang('no')\n\t\t\t\t),\n\t\t\t\t'n'\n\t\t\t)\n\t\t);\n\n\t\treturn $settings;\n\t}", "public function get()\n {\n $query = $this->m_setting->get();\n \n // Return the result\n return $query;\n }", "public function index()\n {\n $describes = Describe::OfType(config(\"constants.describe.type.setting\"))->select('title', 'description', 'id')->get();\n return SettingResource::collection($describes);\n }", "public function getUserSettings()\n {\n return $this->postRequest('GetUserSettings', null, '5.3.1.68');\n }", "public function applicationSettings(): array\n {\n if ($this->getUser() !== NULL) {\n $this->getUser()->locale = request()->header('locale', 'en');\n $this->getUser()->save();\n }\n if ($this->getDriver() !== NULL) {\n $this->getDriver()->locale = request()->header('locale', 'en');\n $this->getDriver()->save();\n }\n\n return [\n 'status' => 1,\n 'settings' => [\n 'minimum_order_weight' => Setting::get('minimum_order_weight', 1.0),\n 'cash_out_threshold' => Setting::get('cash_out_threshold', 1.0),\n 'support_email' => Setting::get('support_email'),\n 'mobile_phone' => Setting::get('mobile_phone'),\n 'land_line' => Setting::get('land_line'),\n 'twitter_account' => Setting::get('twitter_account'),\n 'facebook_account' => Setting::get('facebook_account'),\n 'instagram_account' => Setting::get('instagram_account'),\n 'privacy_policy' => Storage::url(Setting::get('privacy_policy')),\n 'terms_conditions' => Storage::url(Setting::get('terms_conditions')),\n 'address' => Setting::get('address', ''),\n 'brief' => Setting::get('brief', ''),\n 'faq' => Setting::get('faq', ''),\n ],\n ];\n }", "public function getSettings()\n\t{\n\t\treturn $this->algoliaIndex->getSettings();\n\t}", "function pajaxReadSettings(){\r\r\n\r\r\n\tif(file_exists(PAJAXSETTINGFILE)){\r\r\n\r\r\n\t\t$settings = file_get_contents(PAJAXSETTINGFILE);\r\r\n\r\r\n\t\treturn explode(\"||\", $settings);\r\r\n\r\r\n\t}\r\r\n\r\r\n\treturn $settings = array();\r\r\n\r\r\n\r\r\n\r\r\n}", "public function get_settings() {\n $data = array(\n 'settings' => $this->js_settings\n );\n \n return $data;\n }", "public function getAllFull() {\n $data=[];\n\n foreach($this->settings AS $name=>$value) {\n $data[$name]=$this->getFull($name);\n }\n\n return $data;\n }" ]
[ "0.76096797", "0.7603008", "0.75902694", "0.7566543", "0.7413488", "0.7404834", "0.7403537", "0.7390406", "0.7383597", "0.7373986", "0.737078", "0.73640704", "0.73292905", "0.7298531", "0.7242651", "0.72414005", "0.72226715", "0.7211781", "0.72097874", "0.7205076", "0.72028244", "0.71905696", "0.7150396", "0.7146883", "0.71403533", "0.70267594", "0.7016637", "0.70165426", "0.70031023", "0.69979334", "0.6981442", "0.69800496", "0.69497544", "0.6946632", "0.6928345", "0.6884894", "0.6872121", "0.68717736", "0.6865563", "0.6862579", "0.68356645", "0.68011796", "0.6793772", "0.6789886", "0.67872524", "0.677092", "0.6767055", "0.67625374", "0.6752773", "0.6749571", "0.6741228", "0.67385787", "0.6728969", "0.6725797", "0.6725797", "0.6725797", "0.6725797", "0.67136055", "0.6702567", "0.67015904", "0.6698947", "0.6686981", "0.66842663", "0.66795063", "0.6666691", "0.666343", "0.66415274", "0.6613891", "0.65905714", "0.65785444", "0.65736985", "0.6566564", "0.6566166", "0.6562438", "0.65538985", "0.655194", "0.654065", "0.65246934", "0.65229356", "0.6521597", "0.6493585", "0.6479151", "0.64777994", "0.6476853", "0.6476248", "0.6473141", "0.64513505", "0.64338803", "0.6426779", "0.6422601", "0.6405539", "0.63975435", "0.6393338", "0.6387725", "0.63705623", "0.6356628", "0.63507175", "0.6344076", "0.6335356", "0.6333105" ]
0.7216409
17
Create a new job instance.
public function __construct($file) { $this->file = $file; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920272", "0.6905722", "0.6905722", "0.6869542", "0.6808916", "0.65271425", "0.65184414", "0.64918077", "0.6489135", "0.6468623", "0.6425879", "0.64058304", "0.63938236", "0.63899404", "0.63753885", "0.6304669", "0.6256802", "0.6241474", "0.620155", "0.61789167", "0.60741454", "0.60695714", "0.6047274", "0.60462874", "0.6028435", "0.6027225", "0.6021894", "0.60214204", "0.59231514", "0.58802027", "0.5874528", "0.58576655", "0.58098435", "0.5805053", "0.58005697", "0.5789109", "0.57851434", "0.57767034", "0.5775661", "0.5755982", "0.5702295", "0.5683395", "0.5683395", "0.5683395", "0.5683376", "0.5679739", "0.5678496", "0.5659406", "0.56529284", "0.56470996", "0.5634536", "0.5632702", "0.5632702", "0.5628215", "0.5625956", "0.5621957", "0.56141514", "0.56048644", "0.5604791", "0.5601149", "0.5601067", "0.5599652", "0.5595376", "0.55932534", "0.55932534", "0.55932015", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55362236", "0.5534658", "0.5531583", "0.55224913", "0.5522197", "0.5517534", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.5514842", "0.549955", "0.5497938", "0.54876786", "0.54876786", "0.54876786" ]
0.0
-1
Run the database seeds.
public function run() { // Uncomment the below to wipe the table clean before populating DB::table('Articulos')->delete(); $articulos = array( //GORROS ['id' => 1, 'nombre' => 'Knox - aero', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 2, 'nombre' => 'Knox - terra', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 3, 'nombre' => 'Knox - fire', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 4, 'nombre' => 'Knox - water', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 5, 'nombre' => 'Performed - aero', 'precio' => 20.00, 'stock' => 10, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 6, 'nombre' => 'Performed - terra', 'precio' => 20.00, 'stock' => 10, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 7, 'nombre' => 'Performed - fire', 'precio' => 20.00, 'stock' => 20, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 8, 'nombre' => 'Performed - water', 'precio' => 20.00, 'stock' => 20, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime], //GORRAS ['id' => 9, 'nombre' => 'Barrow - model 1', 'precio' => 30.00, 'stock' => 10, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 10, 'nombre' => 'Barrow - model 2', 'precio' => 30.00, 'stock' => 10, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 11, 'nombre' => 'Barrow - model 3', 'precio' => 30.00, 'stock' => 10, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime], ['id' => 12, 'nombre' => 'BUY IT - test model 1', 'precio' => 0.10, 'stock' => 100, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime], ); // Uncomment the below to run the seeder DB::table('Articulos')->insert($articulos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
same thing as create_function, but returns a closure..( 5.4)
function create_closure($args, $body){ return eval("return function($args){ {$body} };"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function fn(): callable {\n\t\treturn function (mixed $expression): string { return $expression; };\n\t}", "public function makeCallableMethod()\n {\n return function(){\n // N/A;\n $x = mt_rand(1, 10);\n return $x;\n };\n }", "public function closure()\n {\n return $this->closure;\n }", "public function transform(Closure $func): static;", "function sqlite_create_function($function_name, $callback, $num_args = -1)\n{\n}", "function constant($return) : \\Closure\n{\n return function() use ($return) {\n return $return;\n };\n}", "public function getClosure()\n {\n }", "public function getCreateCallable(): callable;", "function sqlite_create_function($dbhandle, $function_name, $callback, $num_args = -1)\n{\n}", "public static function make(\\Closure $callback = null);", "public function to_fn() {\n $self = $this;\n return static function ($values) use ($self) {\n return $self->apply($values);\n };\n }", "public function getCallable()\n {\n return function () {\n return $this->value;\n };\n }", "public function closure($name, $function, array $tags = [], $sampleRate = 1.0);", "function lamba($args, $code)\n{\n static $cache = array();\n $hash = $args . $code;\n if (!isset($cache[$hash])) {\n $lambda = create_function($args, $code . ';');\n if (!$lambda) {\n throw new Exception('Error defining lambda function: ' . $code);\n }\n $cache[$hash] = $lambda;\n }\n return $cache[$hash];\n}", "public function create_function($name, $callback, $arguments = -1)\n\t{\n\t\t$this->_connection or $this->connect();\n\n\t\treturn $this->_connection->sqliteCreateFunction(\n\t\t\t$name, $callback, $arguments\n\t\t);\n\t}", "function always($value): \\Closure\n{\n return function () use ($value) {\n return $value;\n };\n}", "function zzz(callable $goal) {\n return function (State $state) use ($goal) {\n return new CallableStream(function () use ($goal, $state) {\n return $goal($state);\n });\n };\n}", "protected function get_identity_function( $value ) {\n\t\treturn static function() use ( $value ) {\n\t\t\treturn $value;\n\t\t};\n\t}", "public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "abstract protected function create($funcName);", "public static function make($closure)\n {\n if (\\PHP_VERSION_ID < 70400) {\n return new OpisSerializableClosure($closure);\n }\n\n return new SerializableClosure($closure);\n }", "function hold(callable $function): Closure\n{\n return function () use ($function) {\n return call_user_func_array($function, func_get_args());\n };\n}", "private function createCoreFunction(Closure $core)\n {\n return function($object) use($core) {\n return $core($object);\n };\n }", "public static function create($code) {\n\t\treturn new JsFunction($code);\n\t}", "function &func(callable $value, string $namespace = 'default'): callable\n{\n $var = new Variable\\CallableVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public static function callable()\n {\n return new self;\n }", "public function get_function() {\n\t\tif ( ! $this->is_function_set ) {\n\t\t\t$this->set_function( $this->derive_function() );\n\t\t}\n\t\treturn $this->function;\n\t}", "function always($x): callable\n{\n return function () use ($x) {\n return $x;\n };\n}", "public function maker()\n {\n $name = $this->_name;\n return function ($class) use ($name) {\n $table = TableRegistry::get($name);\n return $table->newEntity();\n };\n }", "public static function create(callable $factory)\n {\n return function (RequestInterface $request, ResponseInterface $response, callable $next) use ($factory) {\n $middleware = $factory($request, $response);\n\n if ($middleware === false) {\n return $next($request, $response);\n }\n\n if (!is_callable($middleware)) {\n throw new RuntimeException(sprintf('Factory returned \"%s\" instead of a callable or FALSE.', gettype($middleware)));\n }\n\n return $middleware($request, $response, $next);\n };\n }", "function create_function(string $args, string $code): string\n{\n error_clear_last();\n $safeResult = \\create_function($args, $code);\n if ($safeResult === false) {\n throw FunchandException::createFromPhpError();\n }\n return $safeResult;\n}", "function executar2($a, $b, $op, Closure $funcao){\n $resultado = $funcao($a, $b);\n echo \"$a $op $b = $resultado <br>\";\n}", "public function getCustomConstructor(): callable;", "function same($value) : \\Closure\n{\n return function ($argument) use ($value) {\n return $argument === $value;\n };\n}", "function memoize(callable $f) :callable\n{\n return function () use ($f) {\n static $result;\n if (null === $result) {\n if ( $f instanceof \\Closure && isset($this) ) {\n $f = \\Closure::bind($f, $this);\n }\n $result = $f();\n }\n return $result;\n };\n}", "public static function factory($value, $parameters = array())\n\t{\n\t\treturn new PheryFunction($value, $parameters);\n\t}", "protected function createFunctionInstance($name)\n {\n return new RemoteFunction($this->connection, $name);\n }", "public function getClosure(string $serviceId, array $arguments = []): mixed;", "public function test_add_action_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_action( $hook ) );\n yourls_add_action( $hook, function() {\n $var_name = $GLOBALS[\"test_var\"]; $GLOBALS[ $var_name ] = rand_str();\n } );\n $this->assertTrue( yourls_has_action( $hook ) );\n\n return $hook;\n\t}", "protected function derive_function() {\n\t\t$callable_reference = $this->get_callable_reference();\n\t\treturn is_string( $callable_reference ) && function_exists( $callable_reference ) ? $callable_reference : null;\n\t}", "function always($value): Closure\n{\n return function () use ($value) {\n return $value;\n };\n}", "function value($value)\n {\n\t\treturn $value instanceof Closure ? $value() : $value;\n }", "public static function fromFunction(callable $function): static\n {\n return new self(Iterators::generate($function));\n }", "function value($value) {\n return $value instanceof Closure ? $value() : $value;\n }", "function runkit_function_add(string $funcname, Closure $closure, string $doc_comment = null, bool $is_strict = null) : bool {\n}", "function create_math_function($arg_array, $expression){\r\n //Returns EvalMath object, $math\r\n \r\n $arg_str = arg_array_to_str($arg_array);\r\n $numArg = count($arg_array);\r\n \r\n require_once 'EvalMath/evalmath.class.php'; \r\n \r\n $math = new EvalMath;\r\n\t$math->suppress_errors = false;\r\n $input = \"f($arg_str) = $expression\";\r\n\tif ($math->evaluate($input)) { //eg 'f(x, y, z) = x^2 + y^2 + 2*z^2'\r\n\t} else {\r\n\t\tprint \"\\t<p>Could not create function: \" . $math->last_error . \"</p>\\n\";\r\n\t}\r\n \r\n return $math;\r\n }", "function curry(callable $f): Closure\n{\n $innerCurry =\n /**\n * @return Closure\n *\n * @psalm-return Closure(): callable\n */\n static function (\n callable $f,\n ?int $numberOfParameters = null,\n array $parameters = []\n ) use (&$innerCurry): Closure {\n if (null === $numberOfParameters) {\n // retrieve number of parameters from reflection\n $fClosure = Closure::fromCallable($f);\n $fRef = new ReflectionFunction($fClosure);\n $numberOfParameters = $fRef->getNumberOfParameters();\n }\n\n /** @psalm-suppress MissingClosureReturnType */\n return static function () use ($f, $numberOfParameters, $parameters, $innerCurry) {\n /** @var array<int, mixed> $newParameters */\n $newParameters = array_merge($parameters, func_get_args());\n\n if (count($newParameters) >= $numberOfParameters) {\n return call_user_func_array($f, $newParameters);\n }\n\n return $innerCurry($f, $numberOfParameters, $newParameters);\n };\n };\n\n return $innerCurry($f);\n}", "function bool(): Closure\n{\n return function ($value): bool {\n return (bool)$value;\n };\n}", "public static function make(Closure $callback)\n\t{\n\t\treturn new static($callback);\n\t}", "public function getClosure()\n\t{\n\t\tthrow new Exception\\RuntimeException('Cannot invoke invalid functions', Exception\\RuntimeException::UNSUPPORTED, $this);\n\t}", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "function value($value)\n {\n return $value instanceof Closure ? $value() : $value;\n }", "public function createCallable()\n {\n $mock = $this->getMockBuilder('MyCallable')\n ->setMethods(['__invoke'])\n ->getMock();\n\n return $mock;\n }", "public function __construct(callable $value);", "function createFunction(/* resource */ $handle, array $data, ?TraceNode $parent = null): TraceNode\n{\n return new TraceNode(\n (string)$data[5], // Name\n (float) $data[3] * COST_FACTOR, // CPU start\n (int) $data[4], // Memory start\n $parent ? $parent->getAbsoluteName() : null\n );\n}", "public static function protect($callable): callable\n {\n if (! is_object($callable) || ! method_exists($callable, '__invoke')) {\n throw new InvalidArgumentException(\n 'Callable is not a Closure or invokable object.'\n );\n }\n\n return function () use ($callable) {\n return $callable;\n };\n }", "function equals($value) : \\Closure\n{\n return function ($argument) use ($value) {\n return $argument == $value;\n };\n}", "function car(callable $pair)\n{\n $res = function ($x, $y) {\n return $x;\n };\n return $pair($res);\n // END\n}", "function uopz_function($function, $handler, $modifiers = NULL)\n{\n}", "public function __invoke()\n {\n $closure = $this->closure;\n return $closure();\n }", "protected function makeCallableMethod($method)\n\t{\n\t\treturn function () use ($method) {\n\t\t\treturn $this->$method();\n\t\t};\n\t}", "function enclose(mixed $value): Closure\n {\n if ($value instanceof Closure) {\n return $value;\n }\n\n if (is_callable($value)) {\n return Closure::fromCallable($value);\n }\n\n return static function (mixed ...$params) use ($value) {\n return value($value, ...$params);\n };\n }", "function\n_ats2phppre_arrayref_patsfun_8__closurerize($env0)\n{\n return array(function($cenv, $arg0) { return _ats2phppre_arrayref_patsfun_8($cenv[1], $arg0); }, $env0);\n}", "function fresh(callable $f) {\n $argCount = (new \\ReflectionFunction($f))->getNumberOfParameters();\n if ($argCount === 0) {\n return delay($f);\n }\n return call_fresh(function ($x) use ($f, $argCount) {\n return collect_args($f, $argCount, [$x]);\n });\n}", "public function getClosure()\n\t{\n\t\treturn $this->closure;\n\t}", "public function addClosure(string $id, Closure $closure, array $arguments = []) {\n\t\treturn $this->setEntry($id, $this->createObject(\n\t\t\tEntry\\ClosureEntry::class,\n\t\t\t$closure,\n\t\t\t$arguments\n\t\t));\n\t}", "public static function newFromName( $name ) {\n\t\treturn new static( new Token( Token::T_FUNCTION, $name ) );\n\t}", "public static function getClosureValidation(): Closure;", "protected function derive_function_reflector() {\n\t\ttry {\n\t\t\t$function_reflector = $this->is_function_reference() ? new ReflectionFunction( $this->get_function() ) : null;\n\t\t} catch ( ReflectionException $exception ) {\n\t\t\t$function_reflector = null;\n\t\t}\n\t\treturn $function_reflector;\n\t}", "protected static function _closureDef($frame, $function) {\n\t\t$reference = '::';\n\t\t$frame += ['file' => '??', 'line' => '??'];\n\t\t$cacheKey = \"{$frame['file']}@{$frame['line']}\";\n\n\t\tif (isset(static::$_closureCache[$cacheKey])) {\n\t\t\treturn static::$_closureCache[$cacheKey];\n\t\t}\n\n\t\tif ($class = Inspector::classes(['file' => $frame['file']])) {\n\t\t\tforeach (Inspector::methods(key($class), 'extents') as $method => $extents) {\n\t\t\t\t$line = $frame['line'];\n\n\t\t\t\tif (!($extents[0] <= $line && $line <= $extents[1])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$class = key($class);\n\t\t\t\t$reference = \"{$class}::{$method}\";\n\t\t\t\t$function = \"{$reference}()::{closure}\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t$reference = $frame['file'];\n\t\t\t$function = \"{$reference}::{closure}\";\n\t\t}\n\t\t$line = static::_definition($reference, $frame['line']) ?: '?';\n\t\t$function .= \" @ {$line}\";\n\t\treturn static::$_closureCache[$cacheKey] = $function;\n\t}", "function foo() {\n\n function bar() {\n echo 'Hola ya existo';\n }\n\n}", "public static function curry(callable $callback)\n {\n return new Functools\\CurriedCallable($callback, self::arity($callback), []);\n }", "public function getFunction(): string;", "public function value($value){\n return $value instanceof Closure ? $value() : $value;\n }", "public function add($name, \\Closure $code);", "public static function make($callFunctionName): self;", "public function synchronized(\\Closure $function, mixed ...$args) : mixed{}", "public static function create(callable $cb)\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return false;\n }\n\n $tid = self::tid();\n\n return SwCoroutine::create(function() use($cb, $tid) {\n $id = SwCoroutine::getuid();\n self::$idMap[$id] = $tid;\n\n PhpHelper::call($cb);\n });\n }", "public function pretend(Closure $callback);", "public function __invoke(): callable\n {\n /**\n * Trim and remove doubled-up whitespace.\n *\n * @param string $string The string to process.\n * @param string $chars The characters to process/trim.\n * @param string $replacement The string to replace instances with.\n * @return string\n */\n return function (string $string, string $chars = '', string $replacement = ''): string {\n return call_user_func_array([StringHelpers::class, 'unspace'], func_get_args());\n };\n }", "private function onWrapper()\n {\n return function ($parameter) {\n if ($parameter instanceof FragmentInterface) {\n return $parameter;\n }\n\n return new Expression($parameter);\n };\n }", "function call_fresh(callable $f) {\n return function (State $state) use ($f) {\n $goal = $f(variable($state->count));\n return $goal($state->next());\n };\n}", "private function isClosure($function) {\n\t\treturn is_object($function) && ($function instanceof \\Closure);\n\t}", "protected function newLog() : \\Closure {\n return function(string $action, string $level = 'warning') : logging\\LogInterface {\n $log = new logging\\ApiLog($action, $level);\n $log->addHandler('stream', 'json', $this->getStreamConfig($action));\n return $log;\n };\n }", "public function create(string $name, callable $callback);", "static function lazy($f) {\n $isSet = $value = false;\n return function() use(&$isSet, &$value, $f) {\n if (!$isSet) {\n $value = $f();\n $isSet = true;\n }\n return $value;\n };\n }", "public function closureToPHP(): string\n {\n // and store the result of a conversion in a $return variable\n return '$return = (function($value) {\n if ($value instanceof \\MongoDB\\BSON\\UTCDateTime) {\n return new \\AndyDune\\DateTime\\DateTime($value->toDateTime());\n }\n if ($value instanceof \\MongoDate) {\n return new \\AndyDune\\DateTime\\DateTime($value->toDateTime());\n }\n \n return new \\AndyDune\\DateTime\\DateTime((int)$value);\n })($value);';\n }", "private function buildFunction($funcName, $namespace)\n {\n $myReference = get_class();\n\n $myNamespace = $this->getClassNameSpace($myReference);\n $function = new \\ReflectionFunction('\\\\' . $funcName);\n if ($this->isVariadicFunction($function)) {\n return;\n }\n\n $functionDefName = self::getFunctionDefinitionName($funcName);\n\n $argList = $this->getFunctionArgumentList($function);\n $callList = $this->getFunctionCallList($function->getParameters());\n\n $separatedArgList = $argList === '' ? '' : ', ' . $argList;\n $separatedCallList = $callList === '' ? '' : ', ' . $callList;\n\n $invocationCode = $this->getInvocationCode($function);\n $handlerClass = \"PhpFunctionMocker_{$functionDefName}\";\n $sourceCode = <<<MAGIC\n<?php\n\nnamespace {$myNamespace} {\n class {$handlerClass} extends PhpFunctionMocker\n {\n public static function invokeMethod(\\$callable, \\$argCount {$separatedArgList})\n {\n if (\\$callable instanceof \\\\Closure || \\method_exists(\\$callable, '__invoke')) {\n return \\$callable({$callList});\n }\n\n if (is_array(\\$callable)) {\n if (count(\\$callable) == 2) {\n \\$obj = reset(\\$callable);\n \\$fn = end(\\$callable);\n if (is_object(\\$obj) && \\method_exists(\\$obj, \\$fn)) {\n return \\$obj->\\$fn({$callList});\n } elseif (is_string(\\$obj)) {\n return \\$obj::\\$fn({$callList});\n }\n }\n\n throw new \\InvalidArgumentException('Wrong parameters were passed to {$funcName}');\n }\n\n {$invocationCode}\n }\n\n public function __invoke({$argList})\n {\n \\$callable = \\$this->getTargetCallable();\n return self::invokeMethod(\\$callable, \\\\func_num_args() {$separatedCallList});\n }\n }\n}\nMAGIC;\n\n $this->handlerCode[$handlerClass] = $sourceCode;\n\n $getMockerFunction = 'getMocker' . md5($myReference);\n $this->interceptorCode[$this->phpNamespace][$getMockerFunction] = <<<MAGIC\n function {$getMockerFunction}(\\$function)\n {\n static \\$ref;\n if (!\\$ref) {\n \\$ref = new \\ReflectionProperty(\"\\\\\\\\Tests\\\\\\\\Application\\\\\\\\Mock\\\\\\\\PhpFunctionMocker\", 'mocks');\n \\$ref->setAccessible(true);\n }\n\n \\$value = \\$ref->getValue();\n return isset(\\$value[\\$function]) ? \\$value[\\$function] : null;\n }\nMAGIC;\n\n $handlerArgs = $argList ? '$argCount, ' . $argList : '$argCount';\n $this->interceptorCode[$this->phpNamespace][$functionDefName] = <<<MAGIC\n\nfunction {$functionDefName} ({$handlerArgs})\n{\n \\$mocker = {$getMockerFunction}('{$functionDefName}');\n return \\$mocker !== null ?\n \\$mocker({$callList}) :\n \\\\{$myNamespace}\\\\PhpFunctionMocker_{$functionDefName}::invokeMethod(\n '\\\\{$funcName}',\n \\$argCount\n {$separatedCallList}\n );\n}\nMAGIC;\n\n $sourceFnNameSpace = $this->getClassNameSpace($funcName);\n $sourceFnNameSpace = $sourceFnNameSpace ? '\\\\' . $sourceFnNameSpace : '';\n if ($sourceFnNameSpace) {\n $funcName = substr($funcName, strlen($sourceFnNameSpace));\n }\n\n $this->interceptorCode[$namespace . $sourceFnNameSpace][$funcName] = <<<MAGIC\nnamespace {$namespace}{$sourceFnNameSpace} {\n function {$funcName} ({$argList})\n {\n return \\\\{$this->phpNamespace}\\\\{$functionDefName}(\\\\func_num_args() {$separatedCallList});\n }\n}\nMAGIC;\n }", "function value(mixed $value, ...$args)\n{\n return $value instanceof Closure ? $value(...$args) : $value;\n}", "static public function castClosure ($value) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:273: characters 3-15\n\t\treturn $value;\n\t}", "public static function factory($name, \\Closure $closure)\n {\n $container = static::getInstance();\n $container->offsetSet($name, $closure);\n $container->factories[$name] = true;\n }" ]
[ "0.7109254", "0.6607174", "0.64506763", "0.64178693", "0.6403631", "0.6360299", "0.6341978", "0.6305332", "0.6296128", "0.62786645", "0.6274795", "0.6111894", "0.6102424", "0.61017376", "0.6021802", "0.6021311", "0.599656", "0.59667253", "0.5919778", "0.59193414", "0.5919022", "0.59049666", "0.5889042", "0.587815", "0.58737427", "0.5850314", "0.5840188", "0.5835015", "0.58263654", "0.580894", "0.5808276", "0.58056927", "0.5785422", "0.5779874", "0.57586277", "0.5752249", "0.5734316", "0.57324433", "0.5727344", "0.57227546", "0.57104665", "0.5667202", "0.5662272", "0.56389946", "0.56090367", "0.56034994", "0.5597662", "0.5587013", "0.55869", "0.55731094", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55722696", "0.55429584", "0.5533387", "0.550841", "0.5503224", "0.54966575", "0.5494115", "0.54928344", "0.5491271", "0.5480534", "0.54577875", "0.54567593", "0.5437828", "0.54352564", "0.5433398", "0.54220146", "0.54200876", "0.5416216", "0.5415736", "0.54151434", "0.54118544", "0.54103523", "0.5392033", "0.5391666", "0.5386421", "0.53790545", "0.53707016", "0.5358118", "0.53490764", "0.53476393", "0.5334812", "0.531441", "0.5305301", "0.5299114", "0.5298928", "0.52947056", "0.52923363", "0.5282925", "0.52602726", "0.52446747" ]
0.7470875
0
return the first non empty value, or the last one
function pick(){ $args = func_get_args(); $val = first(array_filter($args)); return $val ? $val : end($args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function last() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\t$length = $this->length();\n\t\t\t$counter = 1;\n\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\tif ($counter === $length) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\t++$counter;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getFirst()\n {\n $this->update();\n if (isset($this->data[0])) {\n return $this->updateValueIfNeeded($this->data, 0);\n }\n return null;\n }", "public function first()\n {\n return $this->values()->shift();\n }", "public function first()\n {\n try {\n return Optional::ofNullable($this->get(0));\n } catch (OutOfBoundsException $e) {\n return Optional::absent();\n }\n }", "function first(array $array): mixed\n{\n return $array ? reset($array) : null; // No falses.\n}", "public function getFirst(): ?string;", "public function getFirst ()\n {\n return end ( $this->_list ) ;\n }", "public function first(): mixed\n {\n return array_first($this->data);\n }", "public static function firstValue($array){\n\t\tforeach($array as $elt) return $elt;\n\t\treturn false;\n\t}", "public function firstValue()\n\t{\n\t\treturn $this->first()->value;\n\t}", "public function first(): string;", "public function first() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_shift( $result );\n\t}", "public static function coalesce_empty()\n\t{\n\t\tforeach ( func_get_args() as $arg )\n\t\t{\n\t\t\tif ( ! empty($arg) )\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\t}", "function _first($ar){\n\treturn array_shift(array_values($ar));\t\n}", "function getFirst() ;", "public function first()\n {\n return \\count($this->data) > 0 ? $this->data[0] : null;\n }", "public function getFirstItemValue()\n {\n $slab = $this->getFirstSlab();\n\n if (empty($slab)) {\n return false;\n }\n\n return $this->getFirstItemValueInSlab($slab);\n }", "public static function coalesce()\n {\n $args = func_get_args();\n $last = null;\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n $last = $arg;\n }\n return $last;\n }", "function first_value(): mixed\n {\n $args = func_get_args();\n\n return \\Midnite81\\Core\\Functions\\first_value(...$args);\n }", "function first()\n\t{\n\t\treturn array_values($this->_data)[0];\n\t}", "public function getFirst()\n\t{\t\treturn $this->first;\n\t}", "protected function first()\n {\n foreach ($this->sortable as $key => $value) {\n if (is_numeric($key)) {\n return $value;\n }\n\n return $key;\n }\n\n return null;\n }", "final public function getFirst() {\n\t\treturn null;\n\t}", "public function getFirstItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->rewind()->current();\n }", "public function first() {\n\t\treturn $this->valueForKey($this->firstKey());\n\t}", "public function first() {\n if (sizeof($this) < 1) return null;\n $keys = array_keys($this);\n return $this[$keys[0]];\n }", "function first($target)\n {\n // target must be an array\n if (!is_array($target)) {\n $target = (array)$target;\n }\n // target is required to have a value.\n if (count($target)) {\n return array_values($target)[0];\n } else {\n return false;\n }\n }", "public function getFirst();", "public function first(): OptionalInterface;", "public function first() {\n return $this->nth( 0 );\n }", "public function getFirst()\n\t{\n\t\treturn $this->first;\n\t}", "function last(array $array): mixed\n{\n return $array ? end($array) : null; // No falses.\n}", "public function getFirst()\n {\n return $this->first;\n }", "public function getFirst()\n {\n return $this->first;\n }", "function first ()\n {\n return $this->A ? $this->A[0] : null;\n }", "public function first()\n {\n return (count($this->list) > 0 ?\n $this->list[0] : null\n );\n }", "public function firstOr($default = null);", "protected function realiseFirstElement(): ?string\n {\n $safeKey = null;\n\n if (count($this->array) == 0) {\n if ($this->lazyTail->valid()) {\n $safeKey = $this->realiseCurrentPair();\n } else {\n $this->clearIndexIfAllKeysValid();\n }\n } elseif ($this->lazyTail->valid()) {\n $safeKey = array_keys($this->array)[0];\n }\n\n return $safeKey;\n }", "final public function first()\n {\n $items = $this->all();\n if (count($items) === 0) {\n return null;\n }\n return reset($items);\n }", "public function first()\n {\n return $this->getData(0);\n }", "public function first() {\n\n\t\treturn $this->search[0];\n\n\t}", "public function first(): mixed;", "public function first(): mixed;", "public function first()\n {\n return current($this->_data);\n }", "public function first(){\n $this->execute();\n if(count($this->results) > 0){\n return current($this->results);\n } else {\n return null;\n }\n }", "public function getFirst()\n {\n if (is_array($this->rows)) {\n $rows = &$this->rows;\n } else {\n $query = clone $this->query;\n $query->setLimit(1);\n $rows = $query->getResult();\n }\n\n return (isset($rows[0])) ? $rows[0] : null;\n }", "private function getR1($value)\n {\n $i = 0;\n $j = 0;\n\n // be-safe !!!\n if ($value === null) {\n return null;\n }\n\n // find 1st vowel\n $i = strlen($value) - 1;\n for ($j = 0; $j < $i; $j++) {\n if ($this->isVowel($value[$j])) {\n break;\n }\n }\n\n if (!($j < $i)) {\n return null;\n }\n\n // find 1st non-vowel\n for (; $j < $i; $j++) {\n if (!($this->isVowel($value[$j]))) {\n break;\n }\n }\n\n if (!($j < $i)) {\n return null;\n }\n\n return substr($value, $j + 1);\n }", "function array_first($array)\n{\n if( is_array($array) )\n {\n $keys = array_keys($array);\n if( isset($keys[0]) )\n return $array[$keys[0]];\n }\n return null;\n}", "public function lastOrDefault($default=null)\n {\n if($this->length()>0)\n {\n return $this->getAt(($this->length()-1));\n }\n return $default;\n }", "public function first()\n {\n return reset($this->_elements);\n }", "public function first() {\n return reset($this->list);\n }", "public function lastElement(): Option;", "public function first()\n {\n $result = $this->limit(1)->get();\n\n return $result[0] ?? null;\n }", "function first()\n{\n\t$this->rewind();\n\treturn $this->current();\n}", "public function first()\n {\n return count($this->items) > 0 ? reset($this->items) : null;\n }", "public function firstOrDefault($default=null)\n {\n if($this->length()>0)\n {\n return $this->getAt(0);\n }\n return $default;\n }", "public function first() {\n if (count($this->items) > 0) {\n return $this->items[0];\n }\n else\n return null;\n }", "public function first() { \t\n \ttry{\n if (!is_array($this->Items)) return $this->Items ; \t\t\n if (!count($this->Items)) return null; \t\n \treset($this->Items); \t\t\n return $this->Items[key($this->Items)]; \n }catch(Exception $e){\n throw $e;\n } \t\n }", "function last ()\n {\n return $this->A ? array_slice ($this->A, -1)[0] : null;\n }", "function getFirstElementValue( &$elem, $tagname = '', $prefix = '') {\n\t\t$nextElem = $elem->getFirstChild();\n\t\t$node = NULL;\n\n\t\tif( $GLOBALS['xmlv'] != XMLV4 && $prefix != '' )\n\t\t\t$tagname = $prefix.':'.$tagname;\n\t\t\t\n\t\twhile( $nextElem ) {\n\t\t\tif( ($nextElem->getNodeType() == XML_ELEMENT_NODE) ) { // only node elements\n\t\t\t\tif( $tagname != '' ) {\n\t\t\t\t\tif(strtolower($nextElem->getNodeName()) == $tagname) {\n\t\t\t\t\t\t$node = $nextElem;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n $node = $nextElem;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$nextElem = $nextElem->getNextSibling();\n\t\t}\n\t\tif( $node != NULL ) {\n\t\t\t$elemValue = $node->getFirstChild();\n\t\t\tif( $elemValue != NULL )\n\t\t\t\treturn $elemValue->getContent();\n\t\t}\n\t return NULL;\n\t}", "function coalesce() {\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n }\n return $args[0];\n}", "function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}", "function first($limit = 1){\n\t\treturn $this->substr(0,$limit);\n\t}", "public function getFirstItem();", "function tf_first_set()\r\n {\r\n $args = func_get_args();\r\n foreach ($args as $v) {\r\n if (isset($v)) {\r\n return $v;\r\n }\r\n }\r\n return null;\r\n }", "public function first()\n {\n $copy = $this->array;\n return reset($copy);\n }", "public function singleOrDefault($default=null)\n {\n if($this->length()==1)\n {\n return $this->getAt(0);\n }\n return $default;\n }", "public function first()\n {\n $this->rewind();\n return $this->current();\n }", "public function first()\n {\n return reset($this->rules);\n }", "public function getFirst() {}", "protected function get_first_array_item( $val ) {\n\t\tif ( $val && is_array( $val ) ) {\n\t\t\treturn $val[0];\n\t\t}\n\t\treturn $val;\n\t}", "public function getFirstNames() {\n\t\treturn empty( $this->container['first_names'] ) ? null : $this->container['first_names'];\n\t}", "public function findFirst() {\r\n\t\t$aux = $this->fetchAllPg(1);\r\n\t\tif($aux == null)\r\n\t\t\treturn null;\r\n\t\treturn $aux[0];\r\n\t}", "function GetFirstValue( $spr, $lang_id = NULL )\n {\n if (!$lang_id) $lang_id = $this->lang_id;\n $DB_tmp = DBs::getInstance();\n\n $q = \"SELECT * FROM `\".$spr.\"` WHERE `lang_id`='\".$lang_id.\"' ORDER BY `move` asc LIMIT 1\";\n $res = $DB_tmp->db_Query($q);\n //echo '<br>$q='.$q.' $res='.$res.' $DB_tmp->result='.$DB_tmp->result;\n if ( !$res OR !$DB_tmp->result ) return false;\n //$rows = $DB_tmp->db_GetNumRows();\n $row = $DB_tmp->db_FetchAssoc();\n return $row;\n }", "public function lastValue()\n\t{\n\t\treturn $this->last()->value;\n\t}", "public function first(){\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function getLast()\n {\n $this->update();\n $count = sizeof($this->data);\n if (isset($this->data[$count - 1])) {\n return $this->updateValueIfNeeded($this->data, $count - 1);\n }\n return null;\n }", "function get_first_gap()\n\t{\n\t\t$ret = $this->find_gaps();\n\t\treturn $ret === false ? false : $ret[0];\n\t}", "public function first()\n {\n $collection = $this->get();\n return count($collection) ? $collection[0] : null;\n }", "public abstract function findLast(): Optional;", "public function first()\n {\n return reset($this->items);\n }", "public function first()\n {\n return count($this->nodes)?$this->nodes[0]:null;\n }", "public function first()\n {\n foreach ($this->lists as $list) {\n foreach ($list as $record) {\n return $record;\n }\n }\n return null;\n }", "public function first()\r\n\t{\r\n\t\treturn reset($this->_items);\r\n\t}", "function getLastValue();", "public abstract function findFirst(): Optional;", "public function first(): mixed\n {\n return Iterators::first($this->iterator);\n }", "function getFirstItem() { return $this->m_firstItem; }", "public function firstOrFail();", "public function First()\n {\n return $this->Results()[0];\n }", "public function getFirst()\n {\n return 1;\n }", "private static function getFirst ($val) {\n\t\treturn (substr ($val, 0, strlen (self::$sSearch)) === self::$sSearch);\n\t}", "public function first() {\n\t\treturn $this->items[0];\n\t}", "public function firstOr(mixed $default): mixed\n {\n return Iterators::firstOr($this->iterator, $default);\n }", "public function first(){\n return (!empty($this->_result)) ? $this->_result[0] : [];\n }", "function titik($array ,$value)\n{\n $last = end(array_keys($array));\n return $last[0];\n}", "public function first()\n {\n if(isset($this->list[0]))\n {\n return $this->list[0];\n }\n else\n {\n throw new NoSuchElementException(\"no element found in the first position of the sequence\");\n }\n }", "public function getFirstValidationError()\n {\n $oErr = null;\n $aErr = reset($this->_aInputValidationErrors);\n if (is_array($aErr)) {\n $oErr = reset($aErr);\n }\n\n return $oErr;\n }", "public function getNonNull($content) {\n\t\tif (!is_array(current($content))) {\n\t\t\tthrow new Exception('Please use a multi-dimensional array'.\n\t\t\t\t'from '.$this->className.'->'.__FUNCTION__.'() line '.\n\t\t\t\t__LINE__\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\t\t\t\n\t\t\t\t// loop through each array\n\t\t\t\t$count = count($content);\n\t\t\t\t\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\t$lastkey = array_pop(array_keys($content[$i]));\n\n\t\t\t\t\tforeach ($content[$i] as $subKey => $subValue) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_null($subValue)) {\n\t\t\t\t\t\t\tcontinue 2; // go to next array\n\t\t\t\t\t\t} \n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($subKey == $lastkey) {\n\t\t\t\t\t\t\treturn $content[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t} //<-- end foreach -->\n\t\t\t\t\t\n\t\t\t\t\treturn $content[0];\n\t\t\t\t} //<-- end foreach -->\n\t\t\t\t \n\t\t\t} catch (Exception $e) { \n\t\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t\t);\n\t\t\t} //<-- end try -->\n\t\t} //<-- end if -->\n\t}" ]
[ "0.7055316", "0.6459195", "0.6412395", "0.63640255", "0.6331416", "0.6290071", "0.62797976", "0.62052333", "0.6147414", "0.6104187", "0.6096195", "0.60842997", "0.60505307", "0.60403854", "0.5994166", "0.59816426", "0.59464884", "0.5938981", "0.59098154", "0.58977044", "0.5891166", "0.5867174", "0.5862725", "0.5859202", "0.5847776", "0.5841095", "0.5827092", "0.5823355", "0.5808072", "0.58037466", "0.5781038", "0.57758474", "0.57678956", "0.5767037", "0.5767037", "0.5740222", "0.57198703", "0.5703921", "0.5692413", "0.5686508", "0.5682689", "0.5650047", "0.5646544", "0.5646544", "0.5638765", "0.56387013", "0.5619246", "0.5612708", "0.55975556", "0.55852675", "0.5573389", "0.55613595", "0.55397034", "0.5535512", "0.5533614", "0.553134", "0.5522759", "0.551718", "0.55098736", "0.55068207", "0.5499118", "0.54965234", "0.5495491", "0.5493979", "0.5483418", "0.5475253", "0.5468321", "0.54628086", "0.5461467", "0.5437026", "0.5430977", "0.5428341", "0.542814", "0.5425751", "0.54232955", "0.5422763", "0.54204196", "0.5404161", "0.53860885", "0.53826475", "0.5375618", "0.5370478", "0.5369562", "0.53612435", "0.53591317", "0.53538465", "0.53508556", "0.53472733", "0.5327576", "0.5324384", "0.5321409", "0.5320246", "0.53177", "0.531398", "0.5308108", "0.53031343", "0.5295254", "0.52922356", "0.5283878", "0.5282443" ]
0.55922997
49
exclude an element from an array
function array_remove($array, $val){ $vals = func_get_args(); $vals = array_shift($vals); return array_diff($array, array($val)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExcludeListArray() {}", "public function exclude($arrayofuserids) {\n $this->exclude = array_unique(array_merge($this->exclude, $arrayofuserids));\n }", "public function testExclude() {\n $this->assertEquals(array('foo' => 123), Hash::exclude(array('foo' => 123, 'bar' => 456, 'baz' => 789), array('bar', 'baz')));\n }", "function without(array $items, ...$value)\n{\n $filtered = array_filter($items, function ($item) use ($value) {\n return !in_array($item, $value);\n });\n // Сбрасываем ключи\n return array_values($filtered);\n}", "public function exclude() {\n\t\t// If there is no arguments, return $this\n\t\t$numArgs = func_num_args();\n\t\tif($numArgs == 0){ return $this; }\n\t\t\n\t\t// If only a lone array is passed use it as parameters\n\t\t$firstArgument = func_get_arg(0);\n\t\tif ($numArgs == 1 and isset($firstArgument[0]) and is_array($firstArgument[0])) {\n\t\t\treturn $this->_f(false, $firstArgument);\n\t\t}\n\n\t\t// General case of filtering: arguments are conditions\n\t\treturn $this->_f(false, func_get_args());\n\t}", "public function except($values);", "public function getIgnoreItems(): array;", "function destroyer($arr, $valsToRemove) {\n\n $ret = array();\n foreach($arr as $v) {\n if(array_search($v, $valsToRemove) === false)\n $ret[] = $v;\n }\n return $ret;\n}", "function array_remove($element, $array) {\n $index = array_search($element, $array);\n array_splice($array, $index, 1);\n return $array;\n }", "public function notIn(array $values);", "function applyIgnore( array $ignore );", "protected function getExcluded()\n\t{\n\t\tif (isset($this->element['exclude']))\n\t\t{\n\t\t\treturn explode(',', $this->element['exclude']);\n\t\t}\n\n\t\treturn;\n\t}", "function input_except(array $exclude){ \n return array_except(Input::all(), (array) $exclude);\n}", "public function testOmit() {\n\t\t$array = array('one' => 1, 'two' => 2, 'three' => 3);\n\t\t$expected = array('three' => 3);\n\t\t$result = _::omit($array, 'one', 'two');\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// test picking properties off an object\n\t\t$object = (object)$array;\n\t\t$expected = (object)$expected;\n\t\t$result = _::omit($object, 'one', 'two');\n\t\t$this->assertEquals($expected, $result);\n\t}", "private function filterNotItems(array $output): array\n {\n foreach ($this->not as $exclude) {\n $translator = new PathTranslator($output);\n $paths = $translator->path($exclude);\n\n if (0 === $paths->count()) {\n continue;\n }\n\n foreach ($paths as $keys) {\n if (null !== $keys) {\n $this->removeFromArray($output, $keys->getPath());\n }\n }\n }\n\n return $output;\n }", "public function getExclude() {\n \treturn array_keys($this->exclude);\n }", "public function testNotInArray() {\n\t\t$array = array(\"a\", \"b\", \"c\");\n\t\t$this->assertFalse(permissionInPermissions($array, \"d\"));\n\t}", "public function testWithout() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::without($array, 6);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(5, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(3, $result[2]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing a single element\n\t\t$result = _::without($array, 3);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(4, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(2, $result[1]);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing multiple elements\n\t\t$result = _::without($array, 1, 2, 3);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(4, $result[3]);\n\t\t$this->assertEquals(5, $result[4]);\n\n\t\t// test removing all elements\n\t\t$result = _::without($array, 1, 2, 3, 4, 5);\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertCount(0, $result);\n\t}", "public function getExcludes()\n {\n // code...\n return $this->__EXCLUDES__ ?? [];\n }", "protected function except(array $array, $except)\n {\n unset($array[$except]);\n return $array;\n }", "public function getExcludedIds();", "public static function except($array, $keys)\n {\n static::forget($array, $keys);\n\n return $array;\n }", "static public function arrRmByVal($arr,$value=''){\n $arr = is_array($arr)?$arr:array();\n foreach ($arr as $k=>$v)\n {\n if ($v == $value)\n unset($arr[$k]);\n }\n return $arr;\n }", "public static function except( $array, array $keys ): array {\n\t\t\treturn static::forget( $array, $keys );\n\t\t}", "function array_blacklist(array $array, array $blacklist = array()) {\n\treturn array_diff_key($array, array_flip($blacklist));\n}", "public function get_exclusions() {\n return clone($this->exclude);\n }", "public function getExclude()\n {\n return $this->exclude;\n }", "public static function except( $array, $keys )\n {\n static::forget( $array, $keys );\n\n return $array;\n }", "function array_delete($array, $element) {\n return array_diff($array, [$element]);\n}", "function array_except($array, $keys)\n {\n return Arr::except($array, $keys);\n }", "function array_except($array, $keys)\n {\n return Arr::except($array, $keys);\n }", "static function remove(&$array,$value = false,$strict = false){\n\t\tif(!is_array($array)){\n\t\t\tthrow new \\Exception('Parameter must be an array');\n\t\t}\n\t\t$existingKey = array_search($value,$array);\n\t\twhile($existingKey !== false){\n\t\t\tunset($array[$existingKey]);\n\t\t\t$existingKey = array_search($value,$array,$strict);\n\t\t}\n\t\treturn $array;\n\t}", "public function getUnless(): array;", "static public function filterHasNotValue(&$arr, $value)\n {\n $results = array();\n\n //test what type the value is\n $type = gettype($value);\n foreach ($arr as $key => $val) {\n //we can only compare if the types match\n if (gettype($val) === $type) {\n if ($val !== $value) {\n $results[$key] = $val;\n }\n }\n }\n\n return $results;\n }", "function array_forget(&$array, $keys)\n {\n Arr::forget($array, $keys);\n }", "function array_forget(&$array, $keys)\n {\n Arr::forget($array, $keys);\n }", "protected function array_remove($arr, $value) {\n\t\treturn array_values(array_diff($arr, array($value)));\n\t}", "function array_except($array, $keys)\n\t{\n\t\treturn array_diff_key($array, array_flip((array) $keys));\n\t}", "static function except(array $array, $keys) {\n return array_diff_key($array, array_flip((array) $keys));\n }", "public function testRemoveElementWillReturnTrueIfTheElementIsInArray()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertTrue($Collection->removeElement($element2));\n }", "public function notIn( array $array )\n {\n if ( empty( $array ) ) {\n return $this;\n }\n \n return $this->not()->in( $array );\n }", "public function except($keys)\n\t{\n\t\treturn array_filter($this->toArray(), function ($value, $key) use ($keys) {\n\t\t\treturn ! in_array($key, $keys);\n\t\t}, ARRAY_FILTER_USE_BOTH);\n\t}", "public function exclude ($fieldNames) {\n if (!is_array($fieldNames)) $fieldNames = array ($fieldNames);\n $this->__Exclude = array_unique(array_merge ($this->__Exclude, $fieldNames));\n }", "public function setIgnore($array)\n {\n $this->Ignore = $array;\n }", "public abstract function retain_array(Array $array);", "public function whereNotContainedIn($field, $array) {\n\t$this->parseQuery->whereNotContainedIn($field, $array);\n }", "public function keepItemsInArrayWorksWithOneArgumentDataProvider() {}", "function array_forget(&$array, $keys)\n {\n return Arr::forget($array, $keys);\n }", "function filterOutArrayIndexed($array)\r\n{\r\n $filtered_array = array();\r\n if (is_array($array)) {\r\n foreach ($array as $arr => $value) {\r\n if (!is_int($arr)) {\r\n $filtered_array[$arr] = $value;\r\n }\r\n }\r\n return $filtered_array;\r\n } else {\r\n return false;\r\n }\r\n\r\n}", "public function assertNotInArray($arg, array $arr, $message = '')\n {\n return $this->recordTest(!in_array($arg, $arr), $message);\n }", "public static function arrayRemoveElements($arr, $attr, $val) {\n $new_array = array();\n foreach ($arr as $e) {\n if ($e->$attr != $val) {\n array_push($new_array, $e);\n }\n }\n return $new_array;\n }", "function array_remove(array &$array, callable $pred)\n{\n $i = array_index_of($array, $pred);\n if (null === $i) {\n return null;\n }\n\n $v = $array[$i];\n if (is_numeric_array($array)) {\n array_splice($array, $i, 1);\n } else {\n unset($array[$i]);\n }\n\n return $v;\n}", "function removeItemsByValue(&$array,$itemsToRemove) {\r\n\t\tforeach($array as $key => $value) {\r\n\t\t\tif(in_array($value,$itemsToRemove)) unset($array[$key]);\r\n\t\t}\r\n\t}", "function elimina($array,$valore){\n\t\t// verifico che il valore sia compreso nell'array\n\t\tif(in_array($valore,$array)){\n\t\t\t$chiave=array_search($valore,$array);\n\t\t\t// rimuovo il valore passando ad unset la chiave recuperata usando array_search\n\t\t\tunset($array[$chiave]); \n\t\t\t\n\t\t\t// restituisco l'array dopo averlo re-indicizzato\n\t\t\treturn array_values($array);\n\t\t}else{\n\t\t\t// se non trovo corrispondenze restituisco l'array così com'è\n\t\t\treturn $array;\n\t }\n\t}", "public static function except($array, $keys)\n {\n return array_diff_key($array, array_flip((array) $keys));\n }", "public function setExclude(array $exclude) {\n $this->exclude = array();\n\n foreach ($exclude as $name) {\n $this->exclude[$name] = null;\n }\n }", "public function notWhereArray(array $where)\n\t{\n\t\treturn $this->whereArray($where, 'not');\n\t}", "function nonBlacklistedDistunguishednameArray($array,$refused=\"\"){\n $cleanArray = array();\n foreach ($array as $dn) {\n if(blacklistedDistinguishedname($dn,$refused)==FALSE){\n array_push($cleanArray,$dn);\n }\n }\n return $cleanArray;\n}", "function remove_values(array $hand, string $val):array {\n return array_values(array_filter($hand, function ($el) use ($val) {return $el[0] !== $val;}));\n}", "public function negate()\n\t{\n\t\t$this->not_in = !$this->not_in;\n\t}", "protected function getExtensionsToExclude() {}", "public static function exclusive()\n {\n // Change setting\n self::$settings['exclude'] = true;\n\n // Return exclusion list\n return self::$exclude;\n }", "public static function removeIgnoredProperties(array $element) {\n foreach ($element as $key => $value) {\n if (Element::property($key) && self::isIgnoredProperty($key)) {\n unset($element[$key]);\n }\n }\n return $element;\n }", "private function removeElementsFromArray($array, $remove){\n $result = array();\n for($i=0; $i < count($array); $i++){\n for($j=0; $j < count($remove); $j++ ){ \n if($array[$i] == $remove[$j]){ \n $array[$i] = false;\n }\n }\n }\n \n for($i=0; $i < count($array); $i++){\n if($array[$i] != false){\n array_push($result, $array[$i]);\n }\n }\n \n return $result;\n }", "public function removed() {\n return array_diff($this->in, $this->out);\n }", "public function get_all_exclude_id(){\n $data = get_object_vars($this);\n unset($data[\"id\"]);\n return $data;\n }", "function reject($iterable, $lambda) {\n $out = array();\n foreach ($iterable as $v) if (!$lambda($v)) $out[] = $v;\n return $out;\n}", "function stray($arr)\n{\n if ($arr[0] == $arr[1]) {\n $delete = $arr[0];\n\n foreach ($arr as $key => $item){\n if ($item == $delete){\n unset($arr[$key]);\n }\n }\n } else if ($arr[0] == $arr[2]) {\n $delete = $arr[0];\n\n foreach ($arr as $key => $item){\n if ($item == $delete){\n unset($arr[$key]);\n }\n }\n }\n\n return current($arr);\n}", "function purge($arr){\n\treturn array_map(function($r){ return array_map(function($c){ return is_array($c)?false:$c;}, $r);}, $arr);\n}", "public function removeAll(array $elements);", "public function getItemsThatExcludedFromTimelineRelationEventsRegistration(): array\n\t{\n\t\treturn $this->itemsThatExcludedFromTimelineRelationEventsRegistration;\n\t}", "public function getDoktypeExcludeWhere() {}", "public function removeFalse(array &$array)\n {\n $array = array_filter($array,\n function ($value) {\n return $value !== false;\n });\n }", "function array_whitelist(array $array, array $whitelist = array()) {\n\treturn array_intersect_key($array, array_flip($whitelist));\n}", "public function array_remove(&$array, $value)\n {\n return array_filter($array, function($a) use($value) {\n return $a !== $value;\n });\n }", "public function array_forget()\n {\n throw new Exception('Not implemented');\n }", "public function getExcluded(): array\n {\n $arr = [];\n foreach ($this->columns as $name => $column) {\n if ($column->isExcluded()) {\n $arr[] = $name;\n }\n }\n\n return $arr;\n }", "protected function getExcludeFields() {}", "public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}", "private function get_excluded_tags($exclude)\r\n\t{\r\n\t\t$ret = array();\r\n\r\n\t\tforeach($this->bbcodes as $bbcode)\r\n\t\t\tif($bbcode->auto_detect_exclude() & $exclude)\r\n\t\t\t\t$ret[] = $bbcode->tag();\r\n\r\n\t\treturn $ret;\r\n\t}", "public function setExcludeList(?array $value): void {\n $this->getBackingStore()->set('excludeList', $value);\n }", "function GetExcludedEvents();", "private static function removeFromArray($value, array $array): array {\n\t\t$tmpNew = [];\n\t\t$i = 0;\n\n\t\t// Process for each array item. Construct new array without the searched value\n\t\tforeach($array as $itemValue) {\n\t\t\tif($value != $itemValue) {\n\t\t\t\t$tmpNew[$i] = $itemValue;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $tmpNew;\n\t}", "public function withoutValue();", "public function exclusion($name, $array, $displayName = null)\n {\n if (in_array($this->data[$name], $array)) {\n $this->errors->add(\n '<b>' .\n $this->displayName($name, $displayName) .\n '</b> contains a disallowed value.'\n );\n return false;\n }\n return true;\n }", "public function andNotWhereArray(array $where)\n\t{\n\t\treturn $this->whereArray($where, 'not');\n\t}", "public function scrubArray(array $data) : array;", "static public function filterKeyNotContains(&$arr, $contains)\n {\n $results = array();\n foreach ($arr as $key => $value) {\n if (($pos = strpos($key, $contains)) === false) {\n $results[$key] = $value;\n }\n }\n\n return $results;\n }", "function skudo_remove_item_by_value($array, $val = '') {\n\tif (empty($array) || !is_array($array)) return false;\n\tif (!in_array($val, $array)) return $array;\n\n\tforeach($array as $key => $value) {\n\t\tif ($value == $val) unset($array[$key]);\n\t}\n\n\treturn array_values($array);\n}", "protected function _remove()\n {\n $_tagsArray = array();\n foreach ($this->_tagsArray as $key => $value) {\n if (!in_array($value['tag'], $this->getRemoveTags())) {\n $_tagsArray[$value['tag']] = $value;\n }\n }\n $this->_tagsArray = array();\n $this->_tagsArray = $_tagsArray;\n return $this->_tagsArray;\n }", "public function without($key);", "public function excludeFromSource($field);", "public function exclude_offered() {\n\t\treturn new PSU_Student_Finaid_Awards_ExcludeOfferedFilterIterator( $this->getIterator() );\n\t}", "abstract protected function getDataTypesToExclude();", "public static function filterNotIn(\n array $array,\n string $column,\n array $values\n ): array\n {\n return self::filter(\n $array,\n fn ($item) => !in_array(\n self::getProperty($item, $column),\n $values\n )\n );\n }", "public function retainAll(array $elements);", "public function removeValuesFromOutputArray(){\n\t\ttry{\n\t\t\t$this->filteredOutput = array();\n\t\t} catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}", "public function nonArray()\n {\n $inCriterion = new stubInCriterion('foo', 'bar');\n }", "static function reject($collection, $function)\n {\n $result = array();\n foreach($collection as $item) {\n if(!$function($item)) {\n $result[] = $item;\n }\n }\n return Ruby::wrap($result);\n }", "public static function skip(array $array, int $offset): array\n {\n return array_slice($array, $offset);\n }" ]
[ "0.660745", "0.6573212", "0.64303076", "0.63738453", "0.636636", "0.6303039", "0.6278033", "0.6189174", "0.6167354", "0.6158655", "0.6156539", "0.61408633", "0.6123326", "0.60984355", "0.6095371", "0.6067769", "0.60234696", "0.6008807", "0.60059416", "0.5995945", "0.5989565", "0.5966511", "0.5959648", "0.5951175", "0.594353", "0.5932838", "0.59298444", "0.59176284", "0.5913614", "0.5912807", "0.5912807", "0.5911612", "0.5906235", "0.58800197", "0.5866848", "0.5866848", "0.5828232", "0.5825304", "0.581703", "0.57967633", "0.57833266", "0.57734776", "0.5746108", "0.5741348", "0.5739632", "0.5735221", "0.5721952", "0.5719181", "0.57129765", "0.57028335", "0.56956625", "0.56906587", "0.56811374", "0.5665672", "0.56520367", "0.5613728", "0.5612864", "0.55989057", "0.55938005", "0.55785906", "0.55732495", "0.55702573", "0.554899", "0.55408806", "0.5539905", "0.55357426", "0.5530903", "0.5520268", "0.55178076", "0.55082196", "0.5499955", "0.54983854", "0.54964167", "0.5481256", "0.54757214", "0.5468565", "0.54677135", "0.54648143", "0.5464244", "0.54531497", "0.5453097", "0.54510534", "0.5448344", "0.54434", "0.543976", "0.5435247", "0.54291177", "0.54225624", "0.54216087", "0.54147196", "0.5411519", "0.5403328", "0.53928375", "0.53891605", "0.53841096", "0.53783137", "0.5374176", "0.5372623", "0.53720886", "0.53719455" ]
0.65586
2
return the first non empty valid value (last arg is a list of possibles values)
function pick_in(){ $args = func_get_args(); $possibles = array_pop($args); $value = first(array_filter($args)); return in_array($value, $possibles) ? $value : first($possibles); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function first_value(): mixed\n {\n $args = func_get_args();\n\n return \\Midnite81\\Core\\Functions\\first_value(...$args);\n }", "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function first($target)\n {\n // target must be an array\n if (!is_array($target)) {\n $target = (array)$target;\n }\n // target is required to have a value.\n if (count($target)) {\n return array_values($target)[0];\n } else {\n return false;\n }\n }", "public static function coalesce_empty()\n\t{\n\t\tforeach ( func_get_args() as $arg )\n\t\t{\n\t\t\tif ( ! empty($arg) )\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\t}", "function tf_first_set()\r\n {\r\n $args = func_get_args();\r\n foreach ($args as $v) {\r\n if (isset($v)) {\r\n return $v;\r\n }\r\n }\r\n return null;\r\n }", "function pick(){\n $args = func_get_args();\n $val = first(array_filter($args));\n return $val ? $val : end($args);\n}", "public static function firstValue($array){\n\t\tforeach($array as $elt) return $elt;\n\t\treturn false;\n\t}", "function check_value($value) {\n\tif((@count($value)>0 and !@empty($value) and @isset($value)) || $value=='0') {\n\t\treturn true;\n\t}\n}", "function first(array $array): mixed\n{\n return $array ? reset($array) : null; // No falses.\n}", "public function getInvalidValue();", "function SEEDStd_SmartVal( $v, $raAllowed )\r\n/******************************************\r\n Return $v if it is in $raAllowed. Else return $raAllowed[0]\r\n */\r\n{\r\n return( in_array( $v, $raAllowed, true ) ? $v : $raAllowed[0] );\r\n}", "public function getFirstValidationError()\n {\n $oErr = null;\n $aErr = reset($this->_aInputValidationErrors);\n if (is_array($aErr)) {\n $oErr = reset($aErr);\n }\n\n return $oErr;\n }", "function getValueOrNull($value) {\n global $db;\n if(strlen($value) == 0) return \"NULL\";\n else return \"'\".$db->validate($value).\"'\";\n}", "public function getValidDefaultValue(): mixed;", "function min_value($array){\n\t$message = [];\n\tforeach($array as $field){\n\t\t$value = (int)trim($_POST[$field]);\n\t\tif($value <= 0){\n\t\t\t$message[$field] = readable_name($field).\" must have a value of at least 1. \";\n\t\t}\n\t}\n\treturn $message;\n}", "function min_not_null(Array $values) {\n\treturn min(array_diff(array_map('intval', $values), array(0)));\n}", "public static function value()\n {\n $args = func_get_args();\n $output = array_pop( $args );\n\n foreach( $args as $value )\n {\n if( $value || $value === false || $value === 0 )\n {\n return $value;\n }\n }\n return $output;\n }", "abstract public function getIsValidValue($value);", "function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}", "public function getFirstItemValue()\n {\n $slab = $this->getFirstSlab();\n\n if (empty($slab)) {\n return false;\n }\n\n return $this->getFirstItemValueInSlab($slab);\n }", "public static function coalesce()\n {\n $args = func_get_args();\n $last = null;\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n $last = $arg;\n }\n return $last;\n }", "function coalesce() {\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n }\n return $args[0];\n}", "public function first($key = null)\n {\n return $this->errors[$key][0];\n }", "function coalescenull($value, $default1) {\n if (is_null($value)) {\n return $default1;\n } else {\n return $value;\n }\n }", "public function getEmptyValues();", "public function firstValue()\n\t{\n\t\treturn $this->first()->value;\n\t}", "function tf_array_first_set()\r\n {\r\n $key_list = func_get_args();\r\n $array = array_shift($key_list);\r\n $default = array_pop($key_list);\r\n \r\n foreach ($key_list as $key)\r\n if (isset($array[$key]))\r\n return $array[$key];\r\n\r\n return $default;\r\n }", "public function first()\n {\n try {\n return Optional::ofNullable($this->get(0));\n } catch (OutOfBoundsException $e) {\n return Optional::absent();\n }\n }", "function _first($ar){\n\treturn array_shift(array_values($ar));\t\n}", "function valorCampo($nombreCampo){\n\t if($this->val!=\"\")\n\t\tforeach($this->val as $indice => $valor){\n\t\t\tif($nombreCampo==$indice){\n\t\t\t\treturn $valor;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected function obtainValue($value) {\n return (strlen($value) > 0) ? $value : null; // if it is empty\n }", "public function getNonNull($content) {\n\t\tif (!is_array(current($content))) {\n\t\t\tthrow new Exception('Please use a multi-dimensional array'.\n\t\t\t\t'from '.$this->className.'->'.__FUNCTION__.'() line '.\n\t\t\t\t__LINE__\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\t\t\t\n\t\t\t\t// loop through each array\n\t\t\t\t$count = count($content);\n\t\t\t\t\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\t$lastkey = array_pop(array_keys($content[$i]));\n\n\t\t\t\t\tforeach ($content[$i] as $subKey => $subValue) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_null($subValue)) {\n\t\t\t\t\t\t\tcontinue 2; // go to next array\n\t\t\t\t\t\t} \n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($subKey == $lastkey) {\n\t\t\t\t\t\t\treturn $content[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t} //<-- end foreach -->\n\t\t\t\t\t\n\t\t\t\t\treturn $content[0];\n\t\t\t\t} //<-- end foreach -->\n\t\t\t\t \n\t\t\t} catch (Exception $e) { \n\t\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t\t);\n\t\t\t} //<-- end try -->\n\t\t} //<-- end if -->\n\t}", "function testMinvalRunsOnlyIfNotEmpty(){\n\t\t#mdx:minval2\n\t\tParam::get('age')->filters()->minval(1, \"Age cannot be less than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>null])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}", "protected function get_first_array_item( $val ) {\n\t\tif ( $val && is_array( $val ) ) {\n\t\t\treturn $val[0];\n\t\t}\n\t\treturn $val;\n\t}", "public function getFirst(): ?string;", "public static function val($value1, $_ = null)\n {\n $ret = [];\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!static::is($arg)) {\n throw new \\InvalidArgumentException(\"All parameters must be of type bool.\");\n }\n\n $ret[] = !$arg;\n }\n\n return (count($ret) > 1) ? $ret : $ret[0];\n }", "protected function realiseFirstElement(): ?string\n {\n $safeKey = null;\n\n if (count($this->array) == 0) {\n if ($this->lazyTail->valid()) {\n $safeKey = $this->realiseCurrentPair();\n } else {\n $this->clearIndexIfAllKeysValid();\n }\n } elseif ($this->lazyTail->valid()) {\n $safeKey = array_keys($this->array)[0];\n }\n\n return $safeKey;\n }", "public function getFirstArgument()\n {\n $tokens = $this->getTokens();\n \n foreach ($tokens as $token) {\n if ($token && '-' === $token[0]) {\n continue;\n }\n \n return $token;\n }\n }", "function value(array $array, int|string $key = null, mixed $default = null): mixed\n{\n if (func_num_args() > 1) {\n return $array[$key] ?? $default;\n }\n return $array ? current($array) : null; // No falses.\n}", "function get_first_missing_number($list, $field) {\n\t$item_array = [];\n\tforeach ($list as $item) {\n\t\t$item_array[] = $item->$field;\n\t}\n\t$full_array = [\n\t\t1,\n\t];\n\t$output = 1;\n\tif (!empty($item_array)) {\n\t\t$full_array = range(1, max($item_array));\n\t}\n\n\n\tforeach ($item_array as $key => $value) {\n\t\tif ($key != ($value - 1)) {\n\t\t\t$output = $full_array[$key];\n\t\t}\n\t\telse {\n\t\t\t$output = max($item_array) + 1;\n\t\t}\n\t}\n\n\treturn $output;\n}", "function array_val_required($array, $key) {\n\t\n\t// safely take the value out of the array\n\t$return = array_val($array, $key);\n\t\n\t// we are satisfied by any value other than NULL\n\tif( $return === NULL ){\n\t\tthrow new exception(\"$key is a required param\");\n\t}\n\treturn $return;\n}", "function first_value_from_array(array $array, mixed $default = null): mixed\n {\n return \\Midnite81\\Core\\Functions\\first_value_from_array($array);\n }", "function array_first($array)\n{\n if( is_array($array) )\n {\n $keys = array_keys($array);\n if( isset($keys[0]) )\n return $array[$keys[0]];\n }\n return null;\n}", "function getValue($value) {\n\treturn (!empty($value)) ? sanitize($value) : false;\n}", "function recursive_array_check_blank($element_value)\n{\n\n global $set;\n\n if (!is_array($element_value)) {\n if (!empty($element_value)) {\n $set = 1;\n }\n } else {\n\n foreach ($element_value as $value) {\n if ($set) {\n break;\n }\n recursive_array_check_blank($value);\n }\n\n }\n\n}", "function recursive_array_check_blank($element_value)\n{\n\n global $set;\n\n if (!is_array($element_value)) {\n if (!empty($element_value)) {\n $set = 1;\n }\n } else {\n\n foreach ($element_value as $value) {\n if ($set) {\n break;\n }\n recursive_array_check_blank($value);\n }\n\n }\n\n}", "public function first(): mixed\n {\n return array_first($this->data);\n }", "function getValue($key, $undefined)\n{\n $val = get($key);\n if (is_null($val) || $val === \"\") {\n return $undefined;\n }\n return $val;\n}", "public function getFirst()\n {\n $this->update();\n if (isset($this->data[0])) {\n return $this->updateValueIfNeeded($this->data, 0);\n }\n return null;\n }", "public function getNonEmptyValue($failValue = '') {\n\t\t\n\t\t$value = (string) $this;\n\t\tif(strlen($value)) return $value; \n\t\t\n\t\t$value = (string) $this->getDefaultValue();\n\t\tif(strlen($value)) return $value;\n\t\t\n\t\tforeach($this->wire('languages') as $language) {\n\t\t\t$value = $this->getLanguageValue($language->id);\n\t\t\tif(strlen($value)) break;\n\t\t}\n\t\t\n\t\tif(!strlen($value)) $value = $failValue;\n\t\t\n\t\treturn $value;\n\t}", "public static function coalesce()\n\t{\n\t\tforeach ( func_get_args() as $arg )\n\t\t{\n\t\t\tif ( ! is_null($arg) )\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\t}", "function paramsValidateOne($instruction, $first_arg)\n{\n if ((strcmp(\"DEFVAR\", $instruction[0]) == 0) || (strcmp(\"POPS\", $instruction[0]) == 0))\n {\n if ($first_arg != \"var\")\n {\n Err();\n }\n }\n else if ((strcmp(\"CALL\", $instruction[0]) == 0) || (strcmp(\"LABEL\", $instruction[0]) == 0) || (strcmp(\"JUMP\", $instruction[0]) == 0))\n {\n if ($first_arg != \"label\")\n {\n Err();\n }\n }\n else if ((strcmp(\"PUSHS\", $instruction[0]) == 0) || (strcmp(\"WRITE\", $instruction[0]) == 0) || (strcmp(\"EXIT\", $instruction[0]) == 0) || (strcmp(\"DPRINT\", $instruction[0]) == 0))\n {\n if (($first_arg == \"type\") || ($first_arg == \"label\"))\n {\n Err();\n }\n }\n}", "public function getFirstArgument();", "public function validate($value): ?array;", "protected function first()\n {\n foreach ($this->sortable as $key => $value) {\n if (is_numeric($key)) {\n return $value;\n }\n\n return $key;\n }\n\n return null;\n }", "private function getR1($value)\n {\n $i = 0;\n $j = 0;\n\n // be-safe !!!\n if ($value === null) {\n return null;\n }\n\n // find 1st vowel\n $i = strlen($value) - 1;\n for ($j = 0; $j < $i; $j++) {\n if ($this->isVowel($value[$j])) {\n break;\n }\n }\n\n if (!($j < $i)) {\n return null;\n }\n\n // find 1st non-vowel\n for (; $j < $i; $j++) {\n if (!($this->isVowel($value[$j]))) {\n break;\n }\n }\n\n if (!($j < $i)) {\n return null;\n }\n\n return substr($value, $j + 1);\n }", "function getValue( $val, $default ) {\n\n $result = trim( $val );\n\n if ( is_bool( $val ) ) {\n\n if ( !isset( $val ) ) {\n\n $result = $default;\n\n } else {\n\n $result = $val;\n\n }\n\n } else {\n\n if ( strlen( $result ) <= 0 ) {\n\n $result = $default;\n\n }\n\n }\n\n return $result;\n\n }", "public function getValueAfterExpectedNumberOfFailedAttemptsWithEmptyReturnValuesReturned(): string\n {\n if (!$this->reachExpectedAttempts()) {\n return '';\n };\n\n return $this->getValue();\n }", "function isEmpty($value) {\n return !isset($value) || strlen($value) < 1;\n}", "public function checkRequired($value,$messages) {\r\n if($value==\"\")\r\n return $messages;\r\n }", "public function first()\n {\n return $this->values()->shift();\n }", "function getFilledVal($grab_from=FALSE, $dropdown_val=false) {\n\n\t\tif ($grab_from === FALSE)\n\t\t\t$grab_from=$_POST;\n\n\t\tif(isset($grab_from['field_'.$this->getFieldType()][$this->id_common]))\n\t\t\treturn $grab_from['field_'.$this->getFieldType()][$this->id_common];\n\t\telse\n\t\t\treturn NULL;\n\t}", "function getFirst() ;", "protected function getValidInputValue(WireInputData $input, $key, $valid, $fallback) {\n\n\t\tif(!strlen($key)) return $input; // return all\n\t\t\n\t\tif(strpos($key, '[]')) {\n\t\t\t$key = trim($key, '[]');\n\t\t\t$forceArray = true;\n\t\t} else {\n\t\t\t$forceArray = false;\n\t\t}\n\n\t\t$value = $input->__get($key);\n\t\t$cleanValue = null;\n\n\t\tif($value === null && $fallback !== null) {\n\t\t\t// no value present, use fallback\n\t\t\t$cleanValue = $fallback;\n\t\t\t\n\t\t} else if($value === null && $valid === null && $fallback === null) {\n\t\t\t// everything null\n\t\t\t$cleanValue = null;\n\t\t\t\n\t\t} else if($valid === null) {\n\t\t\t// no sanitization/validation requested\n\t\t\t$cleanValue = $value === null ? $fallback : $value;\n\n\t\t} else if(is_string($valid)) {\n\t\t\t// sanitizer \"name\" or multiple \"name1,name2,name3\" specified for $valid argument\n\t\t\t$cleanValue = $this->sanitizeValue($valid, $value, ($forceArray || is_array($fallback)));\n\n\t\t} else if(is_array($valid)) {\n\t\t\t// whitelist provided for $valid argument\n\t\t\t$cleanValue = $this->filterValue($value, $valid, ($forceArray || is_array($fallback))); \n\n\t\t} else if(is_callable($valid)) {\n\t\t\t// callable function provided for sanitization and validation\n\t\t\t$cleanValue = call_user_func($valid, $value);\n\n\t\t} else if(is_int($valid)) {\n\t\t\t// single integer provided as only allowed value\n\t\t\tif(ctype_digit(\"$value\")) {\n\t\t\t\t$value = (int) $value;\n\t\t\t\tif($valid === $value) $cleanValue = $valid;\n\t\t\t}\n\t\t}\n\n\t\tif(($cleanValue === null || ($forceArray && empty($cleanValue))) && $fallback !== null) {\n\t\t\t$cleanValue = $fallback;\n\t\t}\n\t\tif($forceArray && !is_array($cleanValue)) {\n\t\t\t$cleanValue = ($cleanValue === null ? array() : array($cleanValue));\n\t\t}\n\n\t\treturn $cleanValue;\n\t}", "function readValue( $key ) {\n $key = array_merge(\n array(\n 'type' => 's',\n 'values' => array(),\n 'default' => '',\n 'value' => '',\n 'required' => 0,\n 'help' => ''\n ),\n $key\n );\n\n if ($key['value'] == '') $key['value'] = $key['default'];\n\n // Handle boolean data via valid values array\n if ($key['type'] == 'b') $key['values'] = array('y', 'n');\n\n $err = FALSE;\n do {\n e();\n $msg = $key['description'];\n if ($key['required']) $msg .= ' (required)';\n e('- ', $msg);\n if ($key['help']) e('- '.$key['help']);\n if ($err) e('! '.$err);\n if (!empty($key['values'])) echo '('.implode('|', $key['values']).') ';\n if (!empty($key['value'])) echo '['.$key['value'].'] ';\n echo ': ';\n\n $err = FALSE;\n $v = trim(fgets(STDIN)) ?: $key['default'];\n\n if ($v) {\n $key['value'] = $v;\n\n switch ($key['type']) {\n case 'i':\n if ($key['value'] != '' && !is_int($key['value'])) {\n $err = 'Integer value required';\n $key['value'] = NULL;\n }\n break;\n case 'n':\n if (!is_numeric($key['value'])) {\n $err = 'Numeric value required';\n $key['value'] = NULL;\n }\n break;\n default:\n if (!empty($key['values']) AND !in_array($key['value'], $key['values'])) {\n $err = 'Invalid value: ' . $key['value'];\n $key['value'] = $key['default'];\n }\n }\n } elseif ($key['required']) {\n $err = 'Value is required';\n }\n\n } while ($err);\n return $key;\n}", "public function firstError($default=null) {\n if (isset($this->errorMsg[0])) {\n return $this->errorMsg[0];\n }\n return $default;\n }", "function coalesce() {\n\tforeach (func_get_args() as $arg) {\n\t\tif (!is_null($arg)) {\n\t\t\treturn $arg;\n\t\t}\n\t}\n\treturn null;\n}", "public function first(): OptionalInterface;", "function check_empty(){\n foreach(func_get_args() as $arg){\n if(empty($arg))\n return 1;\n else\n return false;\n }\n}", "public function getFirstRequired($key)\n {\n $value = $this->getFirst($key);\n if (null !== $value) {\n return $value;\n }\n throw new KeyException(\"Required first value not found: $key\");\n }", "function good_query_value($sql, $debug=0)\n{\n $lst = good_query_list($sql, $debug);\n return is_array($lst)?$lst[0]:false;\n}", "function driven_diff_values_non_array($element, $form_values) {\n $default = driven_elem_default_value($element);\n // $value will be normized if needed (per case basis)\n // to match #default_value format instead of $form_state['values']\n $value = driven_elem_state_value($element, $form_values);\n \n if (_driven_equal_non_array($default, $value)) {\n return FALSE;\n }\n return array($default, $value);\n}", "function value($value,$key=0,$default=false) {\n if((is_string($key) OR is_int($key)) AND is_array($value)) {\n if(array_key_exists($key,$value)) {\n return $value[$key];\n }\n }\n return $default;\n}", "protected function skipEmptyValue($value)\n {\n if ('-' === $value) {\n return null;\n }\n if (is_array($value)) {\n $result = [];\n foreach ($value as $key => $subValue) {\n $data = $this->skipEmptyValue($subValue);\n if ($data !== null) {\n $result[$key] = $data;\n }\n }\n return empty($result) ? null : $result;\n }\n return $value;\n }", "public function stdWrap_ifEmptyDeterminesEmptyValuesDataProvider() {}", "function get_form_val($key, $default='', $getfirst=TRUE)\r\n{\r\n if ($getfirst)\r\n {\r\n return (empty($_GET[$key]) ? (empty($_POST[$key]) ? $default : $_POST[$key]) : $_GET[$key]);\r\n }\r\n else\r\n {\r\n return (empty($_POST[$key]) ? (empty($_GET[$key]) ? $default : $_GET[$key]) : $_POST[$key]);\r\n }\r\n}", "public function first()\n {\n return reset($this->rules);\n }", "function value_check($value, $check){\r\n\tif(is_string($value) && ((is_array($check) && in_array($value, $check)) || (is_string($check) && $value == $check))){\r\n\t\treturn $value;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}", "private static function getFirst ($val) {\n\t\treturn (substr ($val, 0, strlen (self::$sSearch)) === self::$sSearch);\n\t}", "public function getFirst ()\n {\n return end ( $this->_list ) ;\n }", "public function getNextValue()\n {\n return $this->nextValue instanceof ValidFromAndUntilValueBuilder ? $this->nextValue->build() : $this->nextValue;\n }", "public function sentinelVal() {\n return $this->_sentinel->val();\n }", "function absolute_min(...$numbers)\n{\n if (empty($numbers)) {\n throw new \\Exception('Please pass values to find absolute min value');\n }\n\n $absoluteMin = $numbers[0];\n for ($loopIndex = 0; $loopIndex < count($numbers); $loopIndex++) {\n if ($numbers[$loopIndex] < $absoluteMin) {\n $absoluteMin = $numbers[$loopIndex];\n }\n }\n\n return $absoluteMin;\n}", "private function val_or_blank( $data, $key ) {\n\t\t\treturn isset( $data[ $key ] ) ? $data[ $key ] : '';\n\t\t}", "function not_null($value) {\n if (is_array($value)) {\n if (sizeof($value) > 0)\n return true;\n else\n return false;\n } else {\n if ((is_string($value) || is_int($value)) && ($value != '') && (strlen(trim($value)) > 0))\n return true;\n else\n return false;\n }\n}", "function check_value($input) { \n\t\tif (is_array($input)) {\n\t\t\t$retval=$this->flatten($input);\n\t\t} else {\n\t\t\t$retval=$input;\n\t\t\t$this->output[]=$retval;\n\t\t}\n\t}", "function atkNvl()\n{\n\tfor ($i = 0; $i < func_num_args(); $i++)\n\t{\n\t\t$arg = func_get_arg($i);\n\t\tif (!is_null($arg))\n\t\t{\n\t\t\treturn $arg;\n\t\t}\n\t}\n\n\treturn null;\n}", "public function errorValue(): Option\n {\n return $this->mapOrElse(\n static fn () => Option::none(),\n static fn ($value) => Option::some($value),\n );\n }", "function est_vide($val){\r\n return empty($val);\r\n }", "private function process_required($value)\n {\n return (bool) ($value != \"\" || $value === 0);\n }", "public function getError( string $key, $first = false ) {\n\t\t$found = array_filter( $this->getErrors(), function ( $error ) use ( $key ) {\n\t\t\treturn $error[ 'key' ] === $key;\n\t\t} );\n\n\t\t$found = array_values( $found );\n\n\t\tif ( $first ) {\n\t\t\treturn array_shift( $found );\n\t\t}\n\n\t\treturn $found;\n\t}", "public static function getValue()\n {\n $args = func_get_args();\n if (count($args) == 1) {\n return isset(self::$SEO[$args[0]]) ? self::$SEO[$args[0]] : null;\n } else if (count($args) == 2) {\n return isset(self::$SEO[$args[0]][$args[1]]) ? self::$SEO[$args[0]][$args[1]] : null;\n } else {\n trigger_error(\"SEOError:getValue: Número de argumentos inválidos.\", E_USER_NOTICE);\n }\n }", "public function last() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\t$length = $this->length();\n\t\t\t$counter = 1;\n\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\tif ($counter === $length) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\t++$counter;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getVal($key = '', $default = null) {\n $array = $this->array;\n if($key == '') {\n return $array;\n }\n $keys = explode('/', $key);\n $count = count($keys);\n $i = 0;\n foreach($keys as $k => $val) {\n $i++;\n if($val == '') {\n continue;\n }\n if(isset($array[$val]) && !is_array($array[$val])) {\n if($array[$val] !== null && $i == $count) {\n return $array[$val];\n }\n return $default;\n }\n if(isset($array[$val])) {\n $array = $array[$val];\n } else {\n return $default;\n }\n if(is_array($array) && key($array) == '0') {\n $array = current($array);\n }\n }\n return $array;\n }", "public function getEmptyValue()\n {\n return new Value();\n }", "public function cases_first()\n\t{\n\t\treturn array(\n\t\t\tarray(2, 7, true, false, 2, false),\n\t\t\tarray(2, 7, false, false, 3, false),\n\t\t\tarray(null, 7, null, false, 0, false),\n\t\t\tarray(9, -1, true, false, null, true),\n\t\t\tarray(9, -1, true, true, null, true),\n\t\t);\n\t}", "public function complete(&$prefix)\n {\n $matches = $this->getMatchesForPrefix($this->issue, $prefix);\n $autocompletedValues = $this->getAutocompletedValues($matches);\n if (count($autocompletedValues) == 1) {\n return end($autocompletedValues);\n } elseif (count($autocompletedValues) > 1) {\n return $autocompletedValues;\n }\n return null;\n }", "static function validate($val) {\n\t\t$res = false;\n\t\tif (isset($val) && ($val != \"\")){\n\t\t\t$res = true;\n\t\t}\n\t\treturn ($res);\n\t}", "public function first(): string;", "function first()\n\t{\n\t\treturn array_values($this->_data)[0];\n\t}" ]
[ "0.65952116", "0.61829567", "0.61491215", "0.60160756", "0.6015522", "0.59811115", "0.59479535", "0.5844083", "0.58196014", "0.5733671", "0.56905496", "0.56466717", "0.5624628", "0.5619322", "0.561703", "0.5596925", "0.55947566", "0.55848855", "0.55357355", "0.5509557", "0.5508259", "0.5496161", "0.5402313", "0.54011387", "0.5392077", "0.538961", "0.53778017", "0.5366257", "0.5356792", "0.5354771", "0.5320025", "0.5315188", "0.5292579", "0.52846074", "0.5276791", "0.5268677", "0.52579063", "0.5255342", "0.52509636", "0.52470535", "0.5238994", "0.5227729", "0.5223658", "0.5221075", "0.52169573", "0.52169573", "0.5203028", "0.5202869", "0.51859957", "0.51848096", "0.51736546", "0.51716965", "0.5166822", "0.51622236", "0.51521724", "0.515179", "0.51277906", "0.51265466", "0.5123383", "0.51138103", "0.51004606", "0.509603", "0.5081153", "0.5070945", "0.50705487", "0.50636834", "0.50556254", "0.5049592", "0.5038784", "0.5038337", "0.50368875", "0.5025249", "0.501666", "0.50113606", "0.5009631", "0.50061727", "0.5001752", "0.49950558", "0.49944732", "0.49873033", "0.49778336", "0.4971771", "0.49528036", "0.4951393", "0.49492076", "0.4946978", "0.49459788", "0.49418995", "0.4936908", "0.4900696", "0.48980916", "0.48880476", "0.48800364", "0.48701844", "0.4869663", "0.4867523", "0.48659965", "0.4860008", "0.48548183", "0.4853608" ]
0.5632906
12
function return a array from func_get_args / object a,b,c; f(a,b,c); => [a,b,c] f([a,b,c]); => [a,b,c] f(a) => [a]
function aargs($args){ if(!$args || count($args)>1 ) return array($args, true); $arg = $args[0]; if(is_array($arg)) return array($arg, true); $key = is_object($arg)?$arg->hash_key:0; return array(array($key=>$arg), false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function a(){ \n return $arg_list = func_get_args(); \n \n }", "function a() {\n\t\t$args = func_get_args();\n\t\treturn $args;\n\t}", "function am() {\n\t\t$r = array();\n\t\tforeach(func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "public function getArguments(): array;", "public function getArguments(): array;", "public function getArguments(): array;", "public static function getArguments()\n {\n return func_get_args();\n }", "public static function am() {\n\t\t$r = array();\n\t\tforeach (func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "function qa(...$args): array\n{\n // When arguments are named.\n if (!is_list($args)) {\n return $args;\n }\n\n $ret = [];\n if ($argc = count($args)) {\n for ($i = 1; $i < $argc + 1; $i += 2) {\n $ret[$args[$i - 1]] = $args[$i];\n }\n }\n return $ret;\n}", "abstract public function getArguments(): array;", "function getArguments() ;", "private static function getFunctionArgsArray( $args ) {\n\t\t# Populate $argv with both named and numeric parameters\n\t\t$argv = [];\n\t\t$numargs = 0;\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tif ( !is_object( $arg ) ) {\n\t\t\t\tif ( preg_match(\n\t\t\t\t\t'/^([^\\\\n\\\\r]+?)\\\\s*=\\\\s*(.*)$/s', // s - include newline. Parameter name is not supposed to have linebreaks\n\t\t\t\t\t$arg,\n\t\t\t\t\t$match\n\t\t\t\t) ) {\n\t\t\t\t\t$argv[ trim( $match[1] ) ] = trim( $match[2] );\n\t\t\t\t} else {\n\t\t\t\t\t$numargs++;\n\t\t\t\t\t$argv[ $numargs ] = trim( $arg );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $argv;\n\t}", "public function getArgs();", "public function getArgs();", "function C() {\n $arr = func_get_args();\n return Carr($arr);\n }", "public function arguments(): array;", "public function getArguments();", "public function getArguments();", "public function getArguments();", "public function getArguments();", "abstract protected function get_args();", "public function get_args() {\n\t\t// body of member function of anonymous class\n\t\treturn []; // after return in member function of anonymous class\n\t}", "function ola(){\n\n$argumentos = func_get_args();// recupera todos os argumentos da variavel que é um array \nreturn $argumentos;\n}", "public function getArgsArray(){\n\t\t$this->prepareArgs();\n\t\treturn $this->argsArray;\n\t}", "abstract protected function arguments(): array;", "private function _paramArrGenerator( $funcParam, $args )\n\t{\n\t\t$paramArray = array();\n\n\t\tforeach ($funcParam as $key => $value) \n\t\t{\n\t\t\tif( isset( $args[ $value ] ) )\n\t\t\t\t$paramArray[] = $args[ $value ];\n\t\t}\n\n\t\treturn $paramArray;\n\t}", "public function getArgs() : array\n {\n }", "protected function getArguments( $args )\n {\n $arguments = [];\n foreach ($args as $key) {\n array_push($arguments, $this->$key);\n }\n return $arguments;\n }", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function get_arguments(): array {\n\t\treturn [];\n\t}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t];\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "abstract public static function args();", "protected function getArguments()\n\t{\n\t\treturn [\n\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\n\t\t];\n\t}", "public function getArrayParameters(): array;", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "public function getArguments() : array\n {\n return $this->args;\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "public function getArgs() : array\n {\n return $this->args;\n }", "private function argsToArray($args)\n\t{\n\t\tif(!count($args)) throw new Exception(\"Er moet minstends één argument gegeven zijn.\");\n\t\t\n\t\t$fill = array_pop($args);\n\t\t\n\t\twhile($key = array_pop($args))\n\t\t{\n\t\t\tif(!is_string($key)) throw new Exception(\"De key is geen string\");\n\t\t\t$fill = array($key => $fill);\n\t\t}\n\t\t\n\t\tif(!is_array($fill)) throw new Exception(\"Wanneer één argument gegeven moet dit een array zijn\");\n\t\t\n\t\treturn $fill;\n\t}", "private static function listArgs($_args) {\n\t\tif (!is_array($_args))\n\t\t\t$_args=array($_args);\n\t\t$_str='';\n\t\tforeach ($_args as $_key=>$_val)\n\t\t\tif ($_key!=='GLOBALS')\n\t\t\t\t$_str.=($_str?',':'').\n\t\t\t\t\t(is_array($_val) && is_int(key($_val))?\n\t\t\t\t\t\t// Numeric-indexed array\n\t\t\t\t\t\t('array('.self::listArgs($_val).')'):\n\t\t\t\t\t\t(is_object($_val)?\n\t\t\t\t\t\t\t// Convert closure/object to string\n\t\t\t\t\t\t\t(get_class($_val).'()'):\n\t\t\t\t\t\t\t// Remove whitespaces\n\t\t\t\t\t\t\tpreg_replace(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'/,\\s+(.+?=>)/','/\\s=>\\s/',\n\t\t\t\t\t\t\t\t\t'/\\s*\\(\\s+/','/,*\\s+\\)/','/\\s+/'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(',$1','=>','(',')',' '),\n\t\t\t\t\t\t\t\t\tstripslashes(var_export($_val,TRUE))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\treturn self::resolve($_str);\n\t}", "protected function getArguments()\n {\n return array(\n );\n }", "public function getArgs()\n {\n if ($this['args']) {\n return $this['args'];\n }\n\n return [];\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments() : array\n {\n return [];\n }", "protected static function extractArgs($args) {\n if (count($args) === 1 && is_array($args[0])) {\n return $args[0];\n }\n\n return $args;\n }", "protected function getArguments() {\n\t\treturn array();\n\t}", "protected function getArguments() {\n\t\treturn array(\n\t\t);\n\t}", "public function getArgs(): array\n {\n return $this->args;\n }", "protected function getArguments(): array\n {\n return [];\n }", "function flatten($args){\n $res = array();\n foreach($args as $a) {\n if(is_array($a)) $res = array_merge($res, flatten($a));\n else $res[] = $a;\n }\n return $res;\n}", "public function getArgsValues() : array {\n $retVal = [];\n\n foreach ($this->customAttrs as $attrObj) {\n $retVal[$attrObj->getName()] = $this->getArgValue($attrObj->getName());\n }\n\n return $retVal;\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn isset($this->arguments) ? $this->arguments : array();\r\n\t}", "protected function getArguments() { return isset($this->_arguments) ? $this->_arguments : array();\n }", "public function getArguments(): array\n {\n return $this->_arguments;\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }" ]
[ "0.7549458", "0.7390013", "0.7203737", "0.70081156", "0.70081156", "0.70081156", "0.69760436", "0.6966617", "0.6936605", "0.6915499", "0.6892853", "0.6882558", "0.6745733", "0.6745733", "0.6684785", "0.66638047", "0.66068274", "0.66068274", "0.66068274", "0.66068274", "0.65148365", "0.6500622", "0.6460672", "0.64236414", "0.64171934", "0.64069563", "0.6343657", "0.6271161", "0.6264482", "0.6264482", "0.6264482", "0.6264482", "0.6264482", "0.6264482", "0.6264482", "0.6264482", "0.62555796", "0.6254932", "0.6254932", "0.6254932", "0.6254932", "0.6229144", "0.618399", "0.618399", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.6143907", "0.61377686", "0.6132824", "0.6132824", "0.6122029", "0.6105094", "0.6105094", "0.6105094", "0.6105094", "0.6105094", "0.6105094", "0.6105094", "0.60967404", "0.608328", "0.608328", "0.608328", "0.608328", "0.6065758", "0.60645175", "0.6054942", "0.60425526", "0.6033465", "0.6030104", "0.6030104", "0.6030104", "0.6030104", "0.6030104", "0.6030104", "0.60273504", "0.6022555", "0.6018588", "0.6015471", "0.5997024", "0.5937002", "0.59241205", "0.5913022", "0.59117734", "0.5877338", "0.58763987", "0.58760595", "0.58760595", "0.58760595", "0.58760595", "0.58760595", "0.58760595" ]
0.6529034
20
pad a list with empty array();
function alist($args){ return array_fill_keys(array_keys($args), array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(array $list): array\n{\n return array_slice($list, 0, -1);\n}", "public function xml2ArrayConvertsEmptyArraysToElementWithoutContent() {}", "function uncons(array $list): array\n{\n return [$list[0], array_slice($list, 1)];\n}", "private static function _blankWeightArray($len) {\n\t\t$out = array();\n\t\tfor($i = 0; $i < $len; $i++)\n\t\t\t$out[] = 50;\n\t\treturn $out;\n\t}", "public function compactList(){\n $output = array();\n $members = $this->members;\n foreach ($members as $value) {\n $member = array(\n 'id' => $value['id'],\n 'name' => $value['firstName'] . \" \" . $value['lastName'],\n 'num_boats' => count($value['boats'])\n );\n array_push($output, $member);\n }\n return $output;\n }", "private static function fixNulls( array $array, $count ) {\n\t\tif ( count( $array ) === $count ) {\n\t\t\treturn $array;\n\t\t} else {\n\t\t\treturn array_replace( array_fill( 1, $count, null ), $array );\n\t\t}\n\t}", "private function _fillUpArrayWithZeroes(array $array, $supposedLength, $type): array {\n if(count($array) !== $supposedLength) {\n switch($type) {\n case 'warehouse':\n $arrayPusher = ['level' => 0, 'fillAmount' => 0];\n break;\n case 'mineSummary':\n $arrayPusher = ['perHour' => 0, 'amountOfMines' => 0];\n break;\n default:\n $arrayPusher = 0;\n break;\n }\n\n for($i = 0; $i < $supposedLength; ++$i) {\n if(!$array[$i]) {\n $array[$i] = $arrayPusher;\n }\n }\n }\n\n return $array;\n }", "function init(array $list)\n{\n return take(\\count($list) - 1)($list);\n}", "public static function setEmpty()\n {\n $empty = [0 => static::class];\n foreach (static::$structure as $i => $element) {\n $empty[$i] = $element['class']::setEmpty($i);\n }\n return [$empty];\n }", "public static function getEmpty()\n {\n return array();\n }", "public function generateList() {}", "public function generateList() {}", "public function generateList() {}", "function prune_empty ()\n {\n $this->A = array_prune_empty ($this->A);\n return $this;\n }", "public function testEmptyArray(): void\n {\n $functionName = 'serialize_Tests_Liip_Serializer_Fixtures_ListModel';\n self::generateSerializers(self::$metadataBuilder, ListModel::class, [$functionName]);\n\n $list = new ListModel();\n $list->array = [];\n $list->hashmap = [];\n $list->listNested = [];\n $data = $functionName($list);\n\n self::assertIsArray($data);\n self::assertArrayHasKey('array', $data);\n self::assertSame([], $data['array']);\n self::assertArrayHasKey('list_nested', $data);\n self::assertSame([], $data['list_nested']);\n self::assertArrayHasKey('hashmap', $data);\n self::assertInstanceOf(\\stdClass::class, $data['hashmap']);\n self::assertCount(0, get_object_vars($data['hashmap']));\n }", "public function emptyItems()\r\n\t{\r\n\t\t$this->_items = array();\r\n\t}", "public static function emptyArray()\n {\n $isEmpty = self::arrayWithSize(0);\n return Hamcrest_Core_DescribedAs::describedAs('an empty array', $isEmpty);\n }", "public static function createEmpty(): self\n {\n return new static([]);\n }", "function pad(array|string $input, int $length, mixed $pad = null): array|string\n{\n return is_array($input) ? array_pad($input, $length, $pad)\n : str_pad($input, $length, strval($pad ?? ' '));\n}", "public static function cleanAllLists() {\r\n \tself::$list=array();\r\n }", "function createNulls(&$array)\n{\n foreach ($array as &$element) {\n if (is_array($element)) {\n createNulls($element);\n } //is_array($element)\n if (empty($element) || ($element == ' ')) {\n $element = NULL;\n } //empty($element)\n } //$array as &$element\n unset($element);\n}", "public function testNewArrayIsEmpty()\n {\n $fixture = array();\n \n // Assert that the size of the Array fixture is 0.\n $this->assertEquals(0, sizeof($fixture));\n }", "function make()\n{\n return [];\n}", "public function reset()\n {\n $this->values[self::_RANK_LIST] = array();\n }", "function __return_empty_array()\n {\n }", "function array_suck($array){\n\treturn array_map(\"reset\", $array);\n}", "public function generateEmptyObjectArray($num = 1)\n {\n $item = ObjectUtil::createEmptyObject ($this->_objType);\n if ($item) {\n $data = array();\n for ($i = 0; $i < $num; $i++) {\n $data[] = $item;\n }\n $this->_objData = $data;\n } \n\n return $this->_objData;\n }", "function restore_empty($data, $filed)\n {\n return array_merge(array_fill_keys($filed, ''), $data);\n }", "function buildArray(&$A) {\n\t\t\t$cant = count($A);\n\t\t\t$B = [];\n\t\t\t\n\t\t\t$B[] = $A;\n\t\n\t\t\treturn $B;\n\t\t}", "public function getEmptyListType()\n {\n return $this->readOneof(203);\n }", "public function reset()\n {\n $this->values[self::_SYS_MAIL_LIST] = array();\n }", "private function formatIpArray($list)\n {\n return array_map(function ($ip) {\n return ['ip_address' => $ip];\n }, $this->makeArrayOfIps($list));\n }", "public function setArray(array $list);", "protected function fillEmptyPercents()\n {\n for ($percent = 1; $percent <= 100; $percent++) {\n if (isset ($this->list[$percent])) {\n continue;\n }\n $this->list[$percent] = $this->list[($percent - 1)] ?? 0;\n }\n }", "public function toNonEmptyArray(): array;", "public function testCreatePaginatedListEmptyList(): void\n {\n // given\n $page = 1;\n $expectedResultSize = 0;\n\n // when\n $result = $this->categoryService->createPaginatedList($page);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "function non_empty(array $list): array\n{\n return array_values(\n array_filter($list, function ($item) {\n return !empty($item);\n })\n );\n}", "static function compact($collection)\n {\n $result = array();\n foreach($collection as $item) {\n if($item != NULL) {\n $result[] = $item;\n }\n }\n return Ruby::wrap($result);\n }", "public function clear() {\n\t\t$this->array = array();\n\t}", "function xthreads_eval_flipfields($a) {\r\n\treturn array_combine($a, array_fill(0, count($a), null));\r\n}", "public function createArrayFromAnotherArrayWhileOmittingEmptyValues($array = array()){\n\n $new_array = array();\n if(count($array) > 0){\n\n foreach($array as $key => $value){\n if(!empty($value)){\n $new_array[] = $value;\n }\n }\n\n }\n\n return $new_array;\n\n }", "function mdl_array_wrap($value)\n{\n return is_array($value) ? $value : [$value];\n}", "public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }", "public function testCreatePaginatedListEmptyList(): void\n {\n // given\n $page = 1;\n $expectedResultSize = 0;\n\n $user = $this->simpleUser();\n\n // when\n $result = $this->eventService->createPaginatedList($page, $user);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function resetList()\n {\n $this->_currentPage = null;\n $this->_listSize = null;\n $this->_asAssoc = false;\n $this->_assocKey = null;\n $this->_assocValue = null;\n $this->_excludeIds = null;\n $this->_includeIds = null;\n $this->_listSize = null;\n $this->_membersRole = null;\n $this->_membersStatus = null;\n $this->_order = null;\n $this->clearWhere();\n return $this;\n }", "function InicializaArray($Limite){\n\t\tfor($i = 1; $i <= $Limite; $i++) \n\t\t{ \n\t\t ${'array'}[$i] = 0; \n\t\t} \n\treturn $array;\n}", "public function zeroize()\n {\n for ($i = $this->count() - 1; $i >= 0; --$i) {\n $this->offsetSet($i, 0);\n }\n }", "public function fill(array $data = []);", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "private function createArrayable()\n {\n $this->data = $this->data->toArray();\n\n $this->createArray();\n }", "function __construct(){\r\n\t\t$this->listLength = 0;\r\n\t\t$this->head = null;\r\n\t\t$this->tail = null;\r\n\t}", "function clear()\n {\n $this->p_size = '';\n $this->p_bidList = array();\n\n }", "public function testEmptyList()\n {\n $connection = $this->getQueryBuilderConnection();\n\n $results = $connection\n ->select('id')\n ->from('querybuilder_tests')\n ->whereIn('id', [])\n ->getList();\n\n $this->assertEquals([], $results);\n }", "protected function getArrayableAppends()\n {\n $defaults = ['settings'];\n\n if (!count($this->appends)) {\n return $defaults;\n }\n\n return array_merge($defaults, $this->appends);\n }", "public function fill(array $items): self;", "public function lengthenArray(&$content) {\n\t\tif (!is_array(current($content))) {\n\t\t\tthrow new Exception('Please use a multi-dimensional array'.\n\t\t\t\t'from '.$this->className.'->'.__FUNCTION__.'() line '.\n\t\t\t\t__LINE__\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\t\t\t\t\n\t\t\t\t$count = count(current($content));\n\t\t\t\t\n\t\t\t\t// loop through each array\n\t\t\t\tforeach ($content as $key => $values) {\t\t\t\t\n\t\t\t\t\t$num = $count - count($values);\n\t\t\t\t\t\n\t\t\t\t\tif ($num > 0) { // check that arrays are same size\n\t\t\t\t\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t\t\t\t\tarray_push($content[$key], '');\n\t\t\t\t\t\t} //<-- end for -->\n\t\t\t\t\t} //<-- end if -->\n\t\t\t\t} //<-- end foreach -->\n\t\t\t} catch (Exception $e) { \n\t\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t\t);\n\t\t\t} //<-- end try -->\n\t\t} //<-- end if -->\n\t}", "function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}", "function maxListLen() {\n\t\treturn 0;\n\t}", "public function reset()\n {\n $this->values[self::_MEMBERS] = array();\n $this->values[self::_ITEMS] = array();\n }", "public function init()\n {\n $ar = array();\n for ($i = 0; $i < 20; $i++)\n {\n $ar[] = $i;\n }\n }", "public function list(): array\n {\n \n }", "public function clear() {\n $this->elements = array();\n }", "function implode_padded($array, $delimiter = ',', $padding = '`') {\n $str = '';\n foreach ($array as $v) $str .= $padding . $v . $padding . $delimiter;\n $str = rtrim($str, $delimiter);\n return $str;\n}", "private function makeArrayOfIps($list)\n {\n $list = (array) $list ?: [];\n\n $ips = [];\n\n foreach ($list as $item) {\n $ips = array_merge($ips, $this->getIpsFromAnything($item));\n }\n\n return $ips;\n }", "function remove_empty_items($old_array, $mantain_keys=FALSE)\n{\n\t$new_array = array();\n\tforeach($old_array AS $key=>$value)\n\t{\n\t\tif(trim($value) != ''){\n\t\t\tif($mantain_keys)\n\t\t\t{\n\t\t\t\t$new_array[$key] = $value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($new_array, $value);\n\t\t\t}\n\t\t}\n\t}\n\treturn $new_array;\n}", "function __constructor() {\n $arr = array();\n }", "public function __construct(array $list = array())\n {\n $this->list = array_values($list);\n }", "public function testDecorateWithEmptyArray()\n {\n $decorator = new ChainDecorator();\n $decorator->decorate($context = new Context());\n\n static::assertEquals([], $context->all());\n }", "public function clear() {\n $this->list = [];\n\n return $this;\n }", "public function testAppendToOverMaxSizeWithoutAccess()\n {\n $array = new \\ComplexPie\\CacheArray();\n $max = \\ComplexPie\\CacheArray::MAX_CACHE_SIZE + 1;\n for ($i = 0; $i < $max; $i++)\n {\n $array[] = $i;\n }\n $this->assertSame(1, count($array));\n }", "private function initialize_another_structure() {\n return array(\n array('#', '#', '#', '#', '#', '#', '#', '#'),\n array('#', '.', '.', '.', '.', '.', '.', '#'),\n array('#', '.', '#', '#', '#', '.', '.', '#'),\n array('#', '.', '.', '.', '#', '.', '#', '#'),\n array('#', '.', '#', '.', '.', '.', '.', '#'),\n array('#', '.', '.', '.', '.', '.', '.', '#'),\n array('#', '.', '#', '.', '#', '#', '.', '#'),\n array('#', 'X', '#', '.', '.', '.', '.', '#'),\n array('#', '#', '#', '#', '#', '#', '#', '#'),\n );\n }", "function listZeroAdd($networkList){\n\t#Checks for all the .0s in the network address and omits the zero\n\n\t\t$zeroList = [];\n\n\t\tforeach ($networkList as $m){\n\t\t\t$zeroadd = explode(\".\", $m);\n\t\t\tfor($k = 3; $k > -1; $k--){\n\t\t\t\tif ($zeroadd[$k] == \"0\"){\n\t\t\t\t\tif ($k == 3){\n\t\t\t\t\t\tarray_splice($zeroadd, $k, $k);\n\t\t\t\t\t}\n\t\t\t\t\telse if ($zeroadd[sizeof($zeroadd)-1] == \"0\"){\n\t\t\t\t\t\tarray_splice($zeroadd, sizeof($zeroadd)-1,sizeof($zeroadd)-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$zeroList[] = implode(\".\", $zeroadd);\n\n\t\t}\n\n\t\treturn $zeroList;\n\n\t}", "private function getEmptyData() {\n if (!$this -> empty_data) {\n $this -> empty_data = array();\n foreach ($this -> types as $key) {\n $this -> empty_data[$key] = \"\";\n }\n unset($this -> empty_data['user_type']); // the default value should never be set to \"\"\n unset($this -> empty_data['password']); // the default value should never be set to \"\"\n }\n return $this -> empty_data;\n }", "protected function _createStandardList($items)\n {\n $result = array();\n $i = 1;\n foreach ($items as $item) {\n $result[] = array('id' => $i++);\n }\n \n return $result;\n }", "public static function empty(): CollectionInterface\n {\n /** @var array<NewTKey, NewT> $emptyArray */\n $emptyArray = [];\n\n return self::fromIterable($emptyArray);\n }", "public function padList($lines): array\n {\n $maxLength = 0;\n foreach (array_keys($lines) as $key) {\n $maxLength = max($maxLength, mb_strlen($key));\n }\n\n $newLines = [];\n foreach ($lines as $key => $line) {\n $line = str_replace([\"\\r\\n\", \"\\r\", \"\\n\"], \"\\n\", $line);\n $partialLines = explode(\"\\n\", $line);\n $count = 0;\n foreach ($partialLines as $partialLine) {\n $tempKey = $count++ == 0 ? $key : '';\n $newLines[] = str_pad($tempKey, $maxLength + 1, ' ', STR_PAD_RIGHT) . $partialLine;\n }\n }\n\n return $newLines;\n }", "function clear()\r\n {\r\n $this->items=array();\r\n }", "protected function getArrayableAppends()\n {\n if (!count($this->appends))\n return [];\n\n return $this->getArrayableItems(\n array_combine($this->appends, $this->appends)\n );\n }", "private function newSortVectorForUnowned() {\n return array(\n 0,\n );\n }", "public function reset() {\n\t\t\t$this->arList = NULL; \t\n\t\t}", "protected function getArrayableAppends()\n\t{\n\t\tif(self::$withoutAppends){\n\t\t\treturn [];\n\t\t}\n\t\treturn parent::getArrayableAppends();\n\t}", "private function createArray()\n {\n $this->makeGroupBy()->makeSearch()->normalize();\n }", "public function nullifyEmpty(array &$array)\n {\n $array = array_map(function ($value) {\n if (!is_array($value) && !is_object($value) && $value === '') {\n $value = null;\n }\n\n return $value;\n }, $array);\n }", "public function clear()\n {\n $this->fromArray(array());\n }", "public function __construct() {\n $this->item = array_fill(0, count($this->getMachinNames()) - 1, '');\n }", "public function makeFieldList() {}", "private function init()\n\t{\n\t\tfor ($i = 0 ; $i < $this->row ; $i++) {\n\t\t\tfor($j = 0 ; $j < $this->col ; $j++) {\n\t\t\t\t$this->arr[$i][$j] = \" \";\n\t\t\t}\n\t\t}\n\t}", "public function clear(): void {\n\t\t$this->m_elements = [];\n\t}", "function clear() {\n\t\t\t$this->items = [];\n\t\t}", "protected function getArrayableAppends()\n {\n $this->appends = array_unique(array_merge($this->appends, [\n 'total_visits_count',\n 'last_24h_visits_count',\n 'last_7d_visits_count',\n ]));\n return parent::getArrayableAppends();\n }", "public function aArray() {}", "public function getEmptyKeyArray(){\n\t$emptyKeyArray = array();\n\t$emptyKeyArray[\"id\"] = \"\";\n\t$emptyKeyArray[\"codice_categoria\"] = \"\";\n\t$emptyKeyArray[\"codice\"] = \"\";\n\t$emptyKeyArray[\"descrizione\"] = \"\";\n\treturn $emptyKeyArray;\n}", "function delist(array $items, int $offset = 0): array\n {\n return array_slice(array_values($items), $offset);\n }", "protected function emptyPayload()\n {\n return ['data' => null, 'time' => null];\n }", "public function testImplodeEmptyArray()\n {\n $this->assertEquals(StringUtils::EMPTY_STR, StringUtils::implodeRecursively(array()));\n }", "public function getArrayNullEmpty () {\n\n $values = array();\n\n foreach ($this->values as $key => $value) {\n\n if ($value !== null && is_string($value) && strlen($value) == 0) {\n\n $value = null;\n\n }\n\n $values[$key] = $value;\n\n }\n\n return $values;\n\n }", "public function arrayFillMissing(&$content) {\t\n\t\ttry {\n\t\t\t$count = count($content);\n\t\t\t$keys = array_keys($content);\n\t\t\t\n\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t$currkey = $keys[$i];\n\t\t\t\t\n\t\t\t\t// If it's not an array, continue checking\t\n\t\t\t\tif (!is_array($content[$currkey])) {\n\t\t\t\t\tif (is_null($content[$currkey])) {\n\t\t\t\t\t\tif ($i != 0 && $i != $count - 1) {\n\t\t\t\t\t\t\t$prevkey = $keys[$i - 1];\n\t\t\t\t\t\t\t$nextkey = $keys[$i + 1];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!is_null($content[$nextkey])) {\n\t\t\t\t\t\t\t\t$content[$currkey] = 0;\n\t\t\t\t\t\t\t} //<-- end if -->\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!is_null($content[$prevkey])) {\n\t\t\t\t\t\t\t\t$pass = FALSE;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor ($j = $i; $j < $count; $j++) {\n\t\t\t\t\t\t\t\t\t// check to see if there is at least one\n\t\t\t\t\t\t\t\t\t// additional non-null value following\n\t\t\t\t\t\t\t\t\tif (!is_null($content[$keys[$j]])) {\n\t\t\t\t\t\t\t\t\t\t$pass = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t} //<-- end if -->\n\t\t\t\t\t\t\t\t} //<-- end for -->\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($pass) {\n\t\t\t\t\t\t\t\t\t$content[$currkey] = 0;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// no more non-null values so exit loop\n\t\t\t\t\t\t\t\t\tbreak; \n\t\t\t\t\t\t\t\t} //<-- end if -->\n\t\t\t\t\t\t\t} //<-- end if -->\n\t\t\t\t\t\t} //<-- end if -->\n\t\t\t\t\t} //<-- end if -->\n\t\t\t\t} else { // it IS an array, so recurse\n\t\t\t\t\tself::arrayFillMissing($content[$currkey]);\n\t\t\t\t} //<-- end if -->\n\t\t\t} //<-- end foreach -->\t\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className.'->'.\n\t\t\t\t__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\n\t}", "public function reset()\n {\n $this->values[self::sku_arr] = array();\n $this->values[self::pagination] = null;\n }", "private function build_full_array_expansion()\n\t\t{\n\t\t\tif(is_array($this->listexpand) )\n\t\t\t{\n\t\t\t\t// Build expansion list to root for all item in listexpand array\n\t\t\t\twhile(list($key, $val) = each($this->listexpand))\n\t\t\t\t{\n\t\t\t\t\t$this->get_all_parent_to_root($key);\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// At last, remove all duplicate entries\n\t\t\t\t$this->fulllistexpand = array_unique($this->fulllistexpand);\n\t\t\t}\n\t\t\t// Add focused item to expand list\n\t\t\tif($this->myfocus != null)\n\t\t\t{\n\t\t\t\t$this->get_all_parent_to_root($this->myfocus);\n\t\t\t}\n\t\t}", "public function pad($size, $value)\n {\n return new static(array_pad($this->elements, $size, $value));\n }" ]
[ "0.65083164", "0.58881843", "0.5651473", "0.5597747", "0.5458116", "0.5407527", "0.53927046", "0.5383934", "0.53808284", "0.53136367", "0.53025866", "0.53017396", "0.53017396", "0.5276301", "0.526103", "0.52307755", "0.52134246", "0.5212829", "0.5203458", "0.5192728", "0.51785195", "0.5176868", "0.5175554", "0.5152569", "0.5120004", "0.51061743", "0.50929993", "0.5089501", "0.5077273", "0.50567484", "0.5047147", "0.5045744", "0.50424963", "0.50407505", "0.5040074", "0.5022033", "0.5009485", "0.5000681", "0.49977627", "0.49957573", "0.49932262", "0.4972459", "0.49697086", "0.4965968", "0.49499232", "0.49485523", "0.4948413", "0.4944244", "0.4937469", "0.4937469", "0.49366996", "0.4918518", "0.4916323", "0.48786545", "0.48753104", "0.48688737", "0.48607954", "0.48553792", "0.48449773", "0.48198438", "0.481332", "0.48130158", "0.48062894", "0.47920695", "0.47844198", "0.47815585", "0.47792652", "0.47742763", "0.47671664", "0.47635767", "0.4756156", "0.47462285", "0.47358844", "0.4735082", "0.47301075", "0.47282138", "0.4728063", "0.47252706", "0.47244373", "0.4718787", "0.47094002", "0.47060645", "0.4696176", "0.4680291", "0.4678292", "0.46758938", "0.46732494", "0.4671805", "0.4670725", "0.4668171", "0.46610758", "0.4660424", "0.46603322", "0.4655121", "0.46498877", "0.46498528", "0.46470976", "0.4641136", "0.46344003", "0.46311522", "0.4628339" ]
0.0
-1
return boolean state of a variable ( in string mode if asked )
function bool($val,$str=false){ if(is_string($val)) { $val=strtolower($val); $val=$val && $val!="false" && $val !="no" && $val !="n" && $val !="f" && $val !="off"; }else $val=(bool)$val; return $str?($val?"true":"false"):$val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readBoolean();", "function toBool($var) {\n\tif (true === $var || 1 === $var) {\n\t\treturn true;\n\t}\n\tswitch (strtolower($var)) {\n\t\tcase \"yes\":\n\t\tcase \"on\":\n\t\tcase \"1\":\n\t\tcase \"y\":\n\t\tcase \"true\":\n\t\tcase \"t\":\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}", "function ToBool($var) \n{\n if (!is_string($var)) \n return (bool) $var;\n \n switch (strtolower($var)) \n { \n case '1':\n case 'true':\n case 'on':\n case 'yes':\n case 'y':\n return true;\n default:\n return false;\n }\n}", "function serendipity_ini_bool($var) {\n return ($var === 'on' || $var == '1');\n}", "public function toBoolean()\n {\n $key = $this->toLowerCase()->str;\n $map = array(\n 'true' => true,\n '1' => true,\n 'on' => true,\n 'yes' => true,\n 'false' => false,\n '0' => false,\n 'off' => false,\n 'no' => false,\n );\n\n if (array_key_exists($key, $map)) {\n return $map[$key];\n } elseif (is_numeric($this->str)) {\n return ((int) $this->str > 0);\n } else {\n return (bool) $this->regexReplace('[[:space:]]', '')->str;\n }\n }", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "public static function boolean() {}", "function get_boolean($str)\n{\n $str = strtolower($str);\n if (in_array($str, array('false', '0', 'no', 'nein', ''), TRUE))\n return FALSE;\n else\n return TRUE;\n}", "public function booleanString($var)\n {\n return is_bool($var)\n ? ($var ? 'True' : 'False')\n : $var;\n }", "function str_bool($string) {\n if (strtolower($string) === 'true') {\n return true;\n } elseif (strtolower($string) === 'false') {\n return false;\n }\n\n return $string;\n}", "public function getBooleanString($tf);", "function stage_string_to_bool($string)\n{\n return is_bool($string) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string );\n}", "public function getBool(): bool;", "public function isVar(){\n return $this->var;\n }", "function boolval($var) {\r\n if (is_bool($var)) { return $var; }\r\n switch ($var) {\r\n case 'true': return true;\r\n case 'false': return false;\r\n default: throw new InvalidArgumentException('Cannot parse value '.$var);\r\n }\r\n}", "function read_logical($x){\n\t$x=strtolower(trim($x));\n\tif(!is_logical($x))return NULL;\n\t$r=(in_array($x,array(/*true: */'y','yes','1','true','t'))?true:false);\n\treturn $r;\n}", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "public static function boolean()\n {\n return self::builtinType('bool');\n }", "function is_true(mixed $var): bool\n{\n return ($var === true);\n}", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}", "function to_boolean($val);", "function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}", "static public function Boolean( $var ) {\r\n\r\n\t\t$options = array('flags' => FILTER_NULL_ON_FAILURE);\r\n\t\t$result = filter_var( $var, FILTER_VALIDATE_BOOLEAN, $options);\r\n\r\n\t}", "function booleanValuefromString($s) {\r\n\t\treturn ((strcmp($s, '0') != 0) && (strcasecmp($s, 'false') != 0));\r\n\t}", "function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}", "function bool_from_yn($yn)\n {\n }", "private function strToBoolean($value) {\r\n\t\tif ($value && strtolower($value) === \"true\") {\r\n\t\t return true;\r\n\t\t} else {\r\n\t\t return false;\r\n\t\t}\r\n\t}", "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 parseBoolean($str)\n {\n return $str == \"true\" ? true : false;\n }", "public function bool()\n {\n return filter_var($this->value, FILTER_VALIDATE_BOOLEAN);\n }", "function convert_string_to_boolean($string)\n{\n return filter_var($string, FILTER_VALIDATE_BOOLEAN);\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}", "static function toBoolean($data)\r\n {\r\n if(!is_string($data))\r\n return (bool) $data;\r\n switch(strtolower($data)) {\r\n case '1':\r\n case 'TRUE':\r\n case 'on':\r\n case 'yes':\r\n case 'y':\r\n return TRUE;\r\n default:\r\n return FALSE;\r\n }\r\n }", "function getBoolean($key, $defvalue = '') {\n\t\treturn strcasecmp('true', $this->get($key, $defvalue).'') === 0;\n\t}", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "public function isBoolean();", "public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }", "function bool($value)\n{\n return ! in_array(strtolower($value), ['no', 'false', '0', '', '-1']);\n}", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "function isBoolType($a = 0)\n{\n $b = (boolean)$a;\n\n echo \"число $a при переводе в булев тип изменится на '$b ' <br/>\n так как при переводе значение boolean будет = false(по правилам приведения типов)\";\n echo \"<br>\";\n var_dump($a, $b);\n}", "public function getBoolean($key)\n {\n \n if (!isset($this->data[$key])) {\n return false;\n }\n \n if (is_bool($this->data[$key])) {\n return $this->data[$key];\n }\n\n if (('f' !== $this->data[$key] && 'FALSE' !== $this->data[$key] && '0' != $this->data[$key]))\n return true;\n else\n return false;\n\n }", "function isBool ($value)\r\n{\r\n\treturn is_bool ($value);\r\n}", "public function isTrue();", "function stateVar($varName, $varValue = NULL) {\n\t\tif (!empty($varValue)) {\n\t\t\t$this->_state[$varName] = dbSanitize($varValue);\n\t\t}\n\t\treturn (isset($this->_state[$varName])) ? $this->_state[$varName] : false;\n\t}", "function b2s($b) {\n return ($b) ? 'TRUE' : 'FALSE';\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}", "function boolval($in, $strict = false) {\n\t\tif (is_bool($in)){\n\t\t\treturn $in;\n\t\t}\n\t\t$in = strtolower($in);\n\t\t$out = null;\n\t\tif (in_array($in, array('false', 'no', 'n', 'off', '0', 0, null), true)) {\n\t\t\t$out = false;\n\t\t} else if ($strict) {\n\t\t\tif (in_array($in, array('true', 'yes', 'y', 'on', '1', 1), true)) {\n\t\t\t\t$out = true;\n\t\t\t}\n\t\t} else {\n\t\t\t$out = ($in ? true : false);\n\t\t}\n\t\treturn $out;\n\t}", "public static function get_boolean_from_string($str, $default = false){\n\t \n\t\tif ($default !== false or $default !== true){\n\t\t\t$default = false;\n\t\t}\n\t\t\n\t\tif (strcasecmp(trim($str),\"true\") == 0){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (strcasecmp(trim($str),\"false\") == 0){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $default;\n\t}", "public function isTrue()\n {\n \n return !!$this->value;\n \n }", "function boolean(bool|int|string|null $var): bool\n {\n if (is_bool($var)) {\n return ($var == true);\n }\n\n if (is_string($var)) {\n $var = strtolower($var);\n\n return match ($var) {\n 'true', 'on', 'yes', 'y', '1' => true,\n default => false,\n };\n }\n\n if (is_numeric($var)) {\n return ($var == 1);\n }\n\n return boolval($var);\n }", "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 static function boolean()\n {\n return Type::boolean();\n }", "function stage_bool_to_string($bool)\n{\n if (! is_bool($bool)) {\n $bool = wc_string_to_bool($bool);\n }\n return true === $bool ? 'yes' : 'no';\n}", "function post_bool($boolean_name) {\n\t$boolean = $_POST[$boolean_name];\n\tif ($boolean == \"true\")\n\t\treturn true;\n\n\treturn false;\n}", "function is_logical($x){\n\t//note blank is interpreted as false\n\tif(in_array(strtolower(trim($x)),array(/*true: */'y','yes','1','true','t', /*false: */'n','no','0','false','f','')))return true;\n}", "function bool ($value)\r\n{\r\n\tif ($value === true || $value === false)\r\n\t\treturn $value;\r\n\r\n\treturn $value === 'true' || ($value !== 'false' && !!$value);\r\n}", "public static function getBoolean(string $key): bool {\n\t\t$v = self::$sessionInstance->get ( $key, false );\n\t\treturn UString::isBooleanTrue ( $v );\n\t}", "public function value(): bool\n {\n if (($val = $this->raw()) === null) {\n return false;\n }\n\n return (new Boolean)->decode($val);\n }", "public function boolean() {\n //dd($this->lookahead->type);\n if ($this->lookahead->type !== ControlFunctionLexer::BOOLEAN) {\n return null;\n }\n $bool_node = new ControlFunctionParseTree($this->lookahead->type, $this->lookahead->text);\n //dd($bool_node);\n $this->match(ControlFunctionLexer::BOOLEAN);\n return $bool_node;\n }", "public function boolValue()\n {\n return $this->value;\n }", "function read_boolean(&$payload) {\n return (bool) read_byte($payload);\n}", "function ini_get_bool($ini_get_arg) {\n\t$temp = ini_get($ini_get_arg);\n\n\tif ($temp == '1' or strtolower($temp) == 'on') {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function getIsOn(){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT isOn FROM bot_on_off LIMIT 1');\n\t\t$statement->execute();\n\t\treturn $statement->fetch()['isOn'] == true;\n\t}", "public function isVariable() {\n\t\treturn ($this->parsedVarName !== false);\n\t}", "function sqlBool($b, $db){\n\t$b = $db->real_escape_string($b);\n\tif ($b) return '1';\n\telse return '0';\n}", "private function toBoolean($string)\n\t{\n\t\tif ($string === 'true') {\n\t\t\treturn true;\n\t\t}\n\t\tif ($string === 'false') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn null;\n\t}", "function boolval( $val ) {\r\n\t\treturn (bool) $val;\r\n\t}", "public static function bool(string $variable): bool\n {\n $yesList = ['ok', 'y', 'yes', 'true', 't', 'on', '1', '+'];\n $noList = ['no', 'false', 'f', 'off', '0', 'null', 'undefined','-','n'];\n\n $variable = str::_strtolower($variable);\n\n if (arr::in($variable, $yesList) || cast::_float($variable) !== 0.0)\n return true;\n\n\n if (arr::in($variable, $noList))\n return false;\n\n return filter_var($variable, FILTER_VALIDATE_BOOLEAN);\n }", "function ForBlogs_toggle_check( $var ) {\n\tif ( ! isset( $var ) || '' === $var || '0' === $var || 'no' === $var ) {\n\t\treturn false;\n\t}\n\tif ( ( false === $var || true === $var ) || '1' === $var || 'yes' === $var ) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function getBoolean($i);", "public static function toBool($string)\n\t{\n\t\t$string = trim((string)$string);\n\t\t$string = strtolower($string);\n\n\t\tif (in_array($string, array(1, 'true', 'yes', 'on', 'enabled'), true))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (in_array($string, array(0, 'false', 'no', 'off', 'disabled'), true))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (bool)$string;\n\t}", "private function bool($value)\n\t{\n\t\t// We do *not* follow the string 0 php casting rule.\n\t\t// {if field} should be true if the user entered\n\t\t// something. Doesn't matter what it is.\n\t\tif ($value === '0')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn (bool) $value;\n\t}", "function is_active($a, $b) {\n if ($a===$b) return \"active\";\n}", "function isValidBoolean($var) {\n //Returns blank error message for a false character string, such as \"0\", \"false\", \"off\" and \"no\"\n //Otherwise returns an error message\n\n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n\n $msg = filter_var($var, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);\n if ($msg === true || $msg === false) {\n return \"\";\n } else {\n return \"Invalid Boolean\";\n }\n}", "public function getBool($prop) {\n\n\t\t\t// Get property\n\t\t\t$val = $this->get($prop);\n\n\t\t\t// String/numeric bool?\n\t\t\tif ($val === 'false') { \n\t\t\t\t$val = false; \n\t\t\t} elseif ($val === 'true') {\n\t\t\t\t$val = true;\n\t\t\t} elseif ($val === 1 || $val === '1') {\n\t\t\t\t$val = true;\n\t\t\t} elseif ($val === 0 || $val === '0') {\n\t\t\t\t$val = false;\n\t\t\t}\n\n\n\n\n\t\t\t// Boolean?\n\t\t\tif (is_bool($val)) {\n\t\t\t\treturn $val;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t}", "function to_boolean ($value) {\n\tif (\n\n\t\t// Falsy\n\t\t!$value or\n\n\t\t// Empty\n\t\tempty($value) or\n\n\t\t// Zero or less\n\t\t(is_numeric($value) and strval($value) <= 0) or\n\n\t\t// Keyword\n\t\t(is_string($value) and in_array(trim(strtolower($value)), array('null', 'nul', 'nil', 'false')))\n\n\t) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function dosomething()\n{\n $val = true;\n return $val;\n}", "function bool2str($bool) {\n\tif($bool ===false)\n\t\treturn 'false';\n\telse\n\t\treturn 'true';\n}", "private static function getBool($param)\n {\n if ('true' == $param) {\n return true;\n }\n\n if ('false' == $param) {\n return false;\n }\n\n return (bool) $param;\n }", "public function booleanLiteral(){\n try {\n // Sparql11query.g:578:3: ( TRUE | FALSE ) \n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('TRUE') && $this->input->LA(1)<=$this->getToken('FALSE')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "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 getIsTest()\n {\n $value = $this->get(self::ISTEST);\n return $value === null ? (boolean)$value : $value;\n }", "public function stringToBoolean($val) {\n return ($val === \"true\");\n }", "public function hasBoolValue(){\n return $this->_has(4);\n }", "public function hasBoolValue(){\n return $this->_has(3);\n }", "protected function get_type() {\n\t\treturn 'boolean';\n\t}", "protected function get_type() {\n\t\treturn 'boolean';\n\t}", "function pdo_bool($value) {\n\tif (is_bool($value)) {\n\t\t$value = (int)$value;\n\t}\n\treturn $value;\n}", "function bool_to_string($value) {\n return $value ? 'true' : 'false';\n }", "function _parseBooleanEnv($s) {\n return strtoupper(getenv($s)) == 'TRUE';\n}", "public function getFlag();", "function is($prop){\n \treturn $this->get_property($prop)==1?true:false;\n }", "abstract public function getFlag();", "static function ParserGetVariable( &$parser, &$varCache, &$index, &$ret ){\n\t\tif( $index == 'onlinestatus_word' ){\n\t\t\t$status = self::GetUserStatus( $parser->getTitle() );\n\t\t\tif( $status === null )\n\t\t\t\treturn true;\n\t\t\t$ret = wfMsgNoTrans( 'onlinestatus-toggle-' . $status );\n\t\t\t$varCache['onlinestatus'] = $ret;\n\t\t} elseif( $index == 'onlinestatus_word_raw' ){\n\t\t\t$status = self::GetUserStatus( $parser->getTitle() );\n\t\t\tif( $status === null )\n\t\t\t\treturn true;\n\t\t\t$ret = $status;\n\t\t\t$varCache['onlinestatus'] = $ret;\n\t\t}\n\t\treturn true;\n\t}", "public function getCompound(): bool;", "public function isOpenParameter()\n\t{\n\t\treturn $this->_value == '...';\n\t}", "public static function tryParseBoolean(&$fld)\n\t{\n\t\t$fld = $fld == 'Y';\n\t\treturn $fld;\n\t}", "public function toBool() : bool\n {\n return boolval($this->value);\n }", "public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }" ]
[ "0.6850832", "0.685036", "0.68498546", "0.68156743", "0.6801195", "0.67051446", "0.66555125", "0.6653949", "0.6615005", "0.6586789", "0.65661925", "0.65627134", "0.6539536", "0.6539414", "0.6525496", "0.65242773", "0.6523142", "0.6460294", "0.6395821", "0.6372564", "0.6352952", "0.63405526", "0.6298336", "0.62769765", "0.6271425", "0.624181", "0.6231689", "0.6228638", "0.6202004", "0.61961687", "0.61810154", "0.61644197", "0.61598814", "0.614898", "0.61263484", "0.61107", "0.60999966", "0.60941625", "0.60844487", "0.60786134", "0.6073632", "0.60732985", "0.6070732", "0.60670555", "0.60648865", "0.6059637", "0.6050359", "0.6049957", "0.60465854", "0.6030671", "0.6027646", "0.60263646", "0.60245436", "0.6006862", "0.5999073", "0.59877694", "0.59626305", "0.59494275", "0.59405726", "0.5936057", "0.59331924", "0.5923919", "0.5904376", "0.5894166", "0.5894076", "0.5885196", "0.5883977", "0.5875042", "0.587453", "0.587428", "0.5872362", "0.58599275", "0.5851145", "0.58464867", "0.58441025", "0.5835036", "0.5832969", "0.5829966", "0.5819182", "0.5810475", "0.580783", "0.5806655", "0.5802162", "0.5788677", "0.5778915", "0.5775858", "0.57746345", "0.57746345", "0.57724845", "0.5771557", "0.5760465", "0.5758944", "0.57565844", "0.57419324", "0.5738499", "0.5735866", "0.572837", "0.57107425", "0.57094216", "0.5701371" ]
0.6870995
0
/ Like sprintf but all parameters go through escapeshellarg.
function sprintfshell($mask){ $args = func_get_args(); $args = array_map('escapeshellarg', array_slice($args, 1)); return call_user_func('vsprintf', $mask, $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepare() {\n\t\t$args = func_get_args();\n\t\tfor ($i = 1; $i < func_num_args(); ++$i) {\n\t\t\t$args[$i] = $this->escape($args[$i]);\n\t\t}\n\t\t\n\t\treturn call_user_func_array('sprintf', $args);\n\t}", "function wp_sprintf($pattern, ...$args)\n {\n }", "function mb_vsprintf($format, $argv, $encoding=null) {\n\t\tif (is_null($encoding))\n\t\t$encoding = mb_internal_encoding();\n\n\t\t// Use UTF-8 in the format so we can use the u flag in preg_split\n\t\t$format = mb_convert_encoding($format, 'UTF-8', $encoding);\n\n\t\t$newformat = \"\"; // build a new format in UTF-8\n\t\t$newargv = array(); // unhandled args in unchanged encoding\n\n\t\twhile ($format !== \"\") {\n\t\t\t\n\t\t\t// Split the format in two parts: $pre and $post by the first %-directive\n\t\t\t// We get also the matched groups\n\t\t\tlist ($pre, $sign, $filler, $align, $size, $precision, $type, $post) =\n\t\t\tpreg_split(\"!\\%(\\+?)('.|[0 ]|)(-?)([1-9][0-9]*|)(\\.[1-9][0-9]*|)([%a-zA-Z])!u\",\n\t\t\t$format, 2, PREG_SPLIT_DELIM_CAPTURE) ;\n\n\t\t\t$newformat .= mb_convert_encoding($pre, $encoding, 'UTF-8');\n\t\t\t\n\t\t\tif ($type == '') {\n\t\t\t\t// didn't match. do nothing. this is the last iteration.\n\t\t\t}\n\t\t\telseif ($type == '%') {\n\t\t\t\t// an escaped %\n\t\t\t\t$newformat .= '%%';\n\t\t\t}\n\t\t\telseif ($type == 's') {\n\t\t\t\t$arg = array_shift($argv);\n\t\t\t\t$arg = mb_convert_encoding($arg, 'UTF-8', $encoding);\n\t\t\t\t$padding_pre = '';\n\t\t\t\t$padding_post = '';\n\t\t\t\t\n\t\t\t\t// truncate $arg\n\t\t\t\tif ($precision !== '') {\n\t\t\t\t\t$precision = intval(substr($precision,1));\n\t\t\t\t\tif ($precision > 0 && mb_strlen($arg,$encoding) > $precision)\n\t\t\t\t\t$arg = mb_substr($precision,0,$precision,$encoding);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// define padding\n\t\t\t\tif ($size > 0) {\n\t\t\t\t\t$arglen = mb_strlen($arg, $encoding);\n\t\t\t\t\tif ($arglen < $size) {\n\t\t\t\t\t\tif($filler==='')\n\t\t\t\t\t\t$filler = ' ';\n\t\t\t\t\t\tif ($align == '-')\n\t\t\t\t\t\t$padding_post = str_repeat($filler, $size - $arglen);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t$padding_pre = str_repeat($filler, $size - $arglen);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// escape % and pass it forward\n\t\t\t\t$newformat .= $padding_pre . str_replace('%', '%%', $arg) . $padding_post;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// another type, pass forward\n\t\t\t\t$newformat .= \"%$sign$filler$align$size$precision$type\";\n\t\t\t\t$newargv[] = array_shift($argv);\n\t\t\t}\n\t\t\t$format = strval($post);\n\t\t}\n\t\t// Convert new format back from UTF-8 to the original encoding\n\t\t$newformat = mb_convert_encoding($newformat, $encoding, 'UTF-8');\n\t\treturn vsprintf($newformat, $newargv);\n\t}", "function sprintf($string)\n\t{\n\t\t$lang =& JFactory::getLanguage();\n\t\t$args = func_get_args();\n\t\tif (count($args) > 0) {\n\t\t\t$args[0] = $lang->_($args[0]);\n\t\t\treturn call_user_func_array('sprintf', $args);\n\t\t}\n\t\treturn '';\n\t}", "function _params($format, array $arguments) {\n\treturn vsprintf($format, $arguments);\n}", "public function vsprintf($message, $args = null, $translateArgs = false);", "function h($str) {\n\tif (func_num_args()>1) {\n\t\t$str = call_user_func_array('sprintf', func_get_args());\n\t}\n\tprint htmlspecialchars($str);\n}", "public static function dbsprintf($format, $args = null, $_ = null)\r\n {\r\n $varArray = func_get_args();\r\n $count = count($varArray);\r\n if ($count > 1) {\r\n $v = $varArray[$count - 1];\r\n if ($v === true) {\r\n $varArray = array_slice($varArray, 0, $count - 1);\r\n return call_user_func_array('sprintf', $varArray);\r\n } else if ($v === false) {\r\n $varArray = array_slice($varArray, 0, $count - 1);\r\n $count--;\r\n }\r\n for ($index = 1; $index < $count; $index++) {\r\n $patterns = array('/\\r/', '/\\n/', '/\\x00/', '/\\x1a/');\r\n $var = preg_replace($patterns, '', $varArray[$index]);\r\n if ($var === false)\r\n $var = 0;\r\n $varArray[$index] = dbencode($var);\r\n }\r\n return call_user_func_array('sprintf', $varArray);\r\n } else {\r\n return $format;\r\n }\r\n }", "function format_params($params){\n $ret=\"\";\n foreach($params as $k => $v){\n if($k=='nome')\n $ret.='-D \\''.escapeshellcmd($k).'=\"'.escapeshellcmd($v).'\"\\' ';\n else\n $ret.='-D \\''.escapeshellcmd($k).'='.escapeshellcmd($v).'\\' ';\n }\n return $ret;\n}", "public static function escapeShellArg(string $argument): string\n\t{\n\t\t// Fix for PHP bug #43784 escapeshellarg removes % from given string\n\t\t// Fix for PHP bug #49446 escapeshellarg doesn't work on Windows\n\t\t// @see https://bugs.php.net/bug.php?id=43784\n\t\t// @see https://bugs.php.net/bug.php?id=49446\n\t\tif (static::isSystemWindows()) {\n\t\t\tif ($argument === '') {\n\t\t\t\treturn '\"\"';\n\t\t\t}\n\n\t\t\t$escapedArgument = '';\n\t\t\t$addQuote = false;\n\n\t\t\tforeach (preg_split('/(\")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) {\n\t\t\t\tif ($part === '\"') {\n\t\t\t\t\t$escapedArgument .= '\\\\\"';\n\t\t\t\t} elseif (static::isSurroundedBy($part, '%')) {\n\t\t\t\t\t// environment variables\n\t\t\t\t\t$escapedArgument .= '^%\"' . substr($part, 1, -1) . '\"^%';\n\t\t\t\t} else {\n\t\t\t\t\t// escape trailing backslash\n\t\t\t\t\tif (str_ends_with($part, '\\\\')) {\n\t\t\t\t\t\t$part .= '\\\\';\n\t\t\t\t\t}\n\t\t\t\t\t$addQuote = true;\n\t\t\t\t\t$escapedArgument .= $part;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($addQuote) {\n\t\t\t\t$escapedArgument = '\"' . $escapedArgument . '\"';\n\t\t\t}\n\n\t\t\treturn $escapedArgument;\n\t\t}\n\n\t\treturn \"'\" . str_replace(\"'\", \"'\\\\''\", $argument) . \"'\";\n\t}", "static public function addSingleQuotes($arg) \n { \n /* single quote and escape single quotes and backslashes */ \n return \"'\" . addcslashes($arg, \"'\\\\\") . \"'\"; \n }", "function ss_addslashes($args) {\n\tif( !defined('MAGIC_QUOTES_GPC') ) define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());\n\tif( !MAGIC_QUOTES_GPC ) { \n\t\tif( is_array($args) ) {\n\t\t\tforeach($args as $key => $val) {\n\t\t\t\t$args[$key] = ss_addslashes($val);\n\t\t\t}\t\t\n\t\t} else {\n\t\t\t$args = addslashes($args);\n\t\t}\n\t}\n\treturn $args;\n}", "private function escape($arg, $meta = true)\n {\n if (!defined('PHP_WINDOWS_VERSION_BUILD')) {\n return escapeshellarg($arg);\n }\n\n $quote = strpbrk($arg, \" \\t\") !== false || $arg === '';\n $arg = preg_replace('/(\\\\\\\\*)\"/', '$1$1\\\\\"', $arg, -1, $dquotes);\n\n if ($meta) {\n $meta = $dquotes || preg_match('/%[^%]+%/', $arg);\n\n if (!$meta && !$quote) {\n $quote = strpbrk($arg, '^&|<>()') !== false;\n }\n }\n\n if ($quote) {\n $arg = preg_replace('/(\\\\\\\\*)$/', '$1$1', $arg);\n $arg = '\"'.$arg.'\"';\n }\n\n if ($meta) {\n $arg = preg_replace('/([\"^&|<>()%])/', '^$1', $arg);\n }\n\n return $arg;\n }", "function formatAndQuery() {\n\tglobal $DB;\n\t$args = func_get_args();\n\t$query = array_shift($args); #remove the first element of the array as its own variable\n\t$query = str_replace(\"%sv\",\"'%s'\",$query);\n\tforeach ($args as $key => $val)\n\t {\n\t $args[$key] = $DB->real_escape_string($val);\n\t\t\t$args[$key] = htmlspecialchars($val);\n\t }\n\t$query = vsprintf($query, $args);\n\t$result = $DB->query($query);\n\tif (!$result)\n\t{\n\tthrow new Exception($DB->error.\" [$query]\");\n\t}\n\treturn $result;\n}", "function urisprintf($pattern /* , ... */) {\n $args = func_get_args();\n return xsprintf('xsprintf_uri', null, $args);\n}", "function wp_sprintf_l($pattern, $args)\n {\n }", "protected function escapeArg($string)\n {\n // http://stackoverflow.com/a/1250279/871861\n return str_replace(\"'\", \"'\\\"'\\\"'\", $string);\n }", "function bank_shell_args($params){\n\t$res = \"\";\n\tif ($params AND is_array($params)){\n\t\tforeach ($params as $k => $v){\n\t\t\t$res .= \" \" . escapeshellcmd($k) . \"=\" . escapeshellcmd($v);\n\t\t}\n\t}\n\treturn $res;\n}", "function prepare( $query = null ) {\n\t\tif ( is_null( $query ) )\n\t\t\treturn;\n\n\t\t$args = func_get_args();\n\t\tarray_shift( $args );\n\t\t// If args were passed as an array (as in vsprintf), move them up\n\t\tif ( isset( $args[0] ) && is_array($args[0]) )\n\t\t\t$args = $args[0];\n\t\t$query = str_replace( \"'%s'\", '%s', $query ); // in case someone mistakenly already singlequoted it\n\t\t$query = str_replace( '\"%s\"', '%s', $query ); // doublequote unquoting\n\t\t$query = preg_replace( '|(?<!%)%s|', \"'%s'\", $query ); // quote the strings, avoiding escaped strings like %%s\n\t\tarray_walk( $args, array( &$this, 'escape_by_ref' ) );\n\t\treturn @vsprintf( $query, $args );\n\t}", "function db_build_query($args) {\n if (count($args) < 2) return $args[0];\n $query = array_shift($args);\n $args = array_map('db_mysqli_real_escape_string', $args); \n array_unshift($args, $query);\n $query = call_user_func_array('sprintf', $args);\n return $query;\n}", "function test_func1($arg1, $arg2)\n{\n return sprintf(\"this is test_func1: arg1=%s, arg2=%s\", (string)$arg1, (string)$arg2);\n}", "function prepare( $query = null ) {\n if ( is_null( $query ) )\n return;\n\n $args = func_get_args();\n array_shift( $args );\n // If args were passed as an array (as in vsprintf), move them up\n if ( isset( $args[0] ) && is_array($args[0]) )\n $args = $args[0];\n $query = str_replace( \"'%s'\", '%s', $query ); // in case someone mistakenly already singlequoted it\n $query = str_replace( '\"%s\"', '%s', $query ); // doublequote unquoting\n $query = preg_replace( '|(?<!%)%s|', \"'%s'\", $query ); // quote the strings, avoiding escaped strings like %%s\n array_walk( $args, array( &$this, 'escape_by_ref' ) );\n return @vsprintf( $query, $args );\n }", "function if_printf( $sprintf, ...$item ) {\n\techo if_sprintf( $sprintf, ...$item );\n}", "function q() {\n\t$args = func_get_args();\n\tif(func_num_args()===1) return $args[0];\n\treturn vsprintf(array_shift($args), array_map('mysql_real_escape_string',$args));\n}", "function sprintf_array($format, $arr)\n{\n return call_user_func_array('sprintf', array_merge((array)$format, $arr));\n}", "public static function escape($s) {}", "public function escape()\n {\n $this->args = array_map(function ($arg) {\n return escapeshellarg($arg);\n }, $this->args);\n }", "private function escape_args(array $args) {\n $query = \"\";\n foreach($args as $i => $arg) {\n if($i % 2) {\n $query .= $this->sqlesc($arg);\n } else {\n $query .= $arg;\n }\n }\n return $query;\n }", "public static function escape($arg, $meta = true, $module = false)\n {\n if (!defined('PHP_WINDOWS_VERSION_BUILD')) {\n // Escape single-quotes and enclose in single-quotes\n return \"'\".str_replace(\"'\", \"'\\\\''\", $arg).\"'\";\n }\n\n // Check for whitespace or an empty value\n $quote = strpbrk($arg, \" \\t\") !== false || (string) $arg === '';\n\n // Escape double-quotes and double-up preceding backslashes\n $arg = preg_replace('/(\\\\\\\\*)\"/', '$1$1\\\\\"', $arg, -1, $dquotes);\n\n if ($meta) {\n // Check for expansion %..% sequences\n $meta = $dquotes || preg_match('/%[^%]+%/', $arg);\n\n if (!$meta) {\n // Check for characters that can be escaped in double-quotes\n $quote = $quote || strpbrk($arg, '^&|<>()') !== false;\n\n } elseif ($module && !$dquotes && $quote) {\n // Caret-escaping a module name with whitespace will split the\n // argument, so just quote it and hope there is no expansion\n $meta = false;\n }\n }\n\n if ($quote) {\n // Double-up trailing backslashes and enclose in double-quotes\n $arg = '\"'.preg_replace('/(\\\\\\\\*)$/', '$1$1', $arg).'\"';\n }\n\n if ($meta) {\n // Caret-escape all meta characters\n $arg = preg_replace('/([\"^&|<>()%])/', '^$1', $arg);\n }\n\n return $arg;\n }", "abstract public function escapeString($value);", "function packstr( &$out )\n{\n $args = func_num_args();\n for ( $i = 1; $i < $args; $i++ )\n {\n $str = func_get_arg( $i ); \n $out .= pack( 'Ca*', strlen( $str ), $str );\n }\n}", "function putline($line) {\n $args = func_get_args();\n $args[0] = $line;\n fwrite(STDOUT, call_user_func_array('sprintf', $args)); \n}", "function ps_escape_string($str, $as_token = false, $esc_quotes = false) {\n $s = '';\n foreach (str_split($str) as $c) {\n if (($i = strpos(\"\\n\\r\\t\\10\\f\\\\()\", $c)) !== false)\n $c = '\\\\' . 'nrtbf\\\\()'[$i]; // postscript escapes, see PLRM 3.2.2 Literals\n elseif (($o = ord($c)) < 0x20 || $o >= 0x7F)\n $c = sprintf('\\\\%03o', $o); // control & non-ASCII\n elseif ($esc_quotes && $c == '\"')\n $c = '\\\\042'; // octal escape \" (for gs v9 parameters)\n $s .= $c;\n }\n return $as_token ? \"($s)\" : $s;\n}", "public function escapeTextArguments($argument) {\n $argument = str_replace('\\\\\"', '\"', $argument);\n $argument = str_replace('\\n', \"\\n\", $argument);\n return $argument;\n }", "function add_quotes($str) {\n if (is_string($str)) {\n return sprintf(\"'%s'\", $str);\n } elseif (is_null($str)) {\n return sprintf(\"%s\", \"null\");\n } else {\n return sprintf(\"%s\", $str);\n }\n}", "abstract public function escape_string( $str );", "function tf($string){\n\t$args=func_get_args();\n\t$r=CLang::translate(array_shift($args),'a');\n\treturn vsprintf($r!==false ? $r : $string,$args);\n}", "function dbprep() {\n global $kProtectFunction, $kFormatOptions, $kDebugQueries;\n\n\t$args = func_get_args();\n\t$format = array_shift($args);\n\n\t// generate final query\n\tif (empty($args)) {\n\t\t$format = str_replace(\"%%\", \"%\", $format);\n\t\t$query = $format;\n } else if (empty($kFormatOptions)) {\n $asargs = array_map($kProtectFunction, $args); // protect arguments\n $query = vsprintf($format, $asargs);\n\t} else {\n $format = str_replace(\"%%\", PERCENT_PLACEHOLDER, $format);\n if ($kDebugQueries) {\n $format = dbtestquery($format, $args);\n }\n\n $specs = preg_match_all(\"/%[${kFormatOptions}]/\", $format, $matches);\n $asargs = array_map($kProtectFunction, $matches[0], $args); // protect arguments\n\t\t$allspecs = array_map('prefixPercent', str_split($kFormatOptions));\n\t\t$format = vsprintf(str_replace($allspecs, \"%s\", $format), $asargs);\n\t\t$query = str_replace(PERCENT_PLACEHOLDER, \"%\", $format);\n }\n \n\treturn $query;\n}", "private function arg($arg, $quote = \"'\")\n {\n return $quote . addcslashes($arg, $quote) . $quote;\n }", "private function quoteVar($in)\n\t{\n\t\treturn sprintf('\"%s\"', $in);\n\t}", "function console_text() {\n\t\t$args = func_get_args();\n\t\t$message = call_user_func_array('formatText', $args) . CRLF;\n\t\techo $message;\n\t\t//doLog($message);\n\t\tflush();\n\t}", "public abstract function escapeString($value);", "function assocArgsToStr($assoc_args) {\n $return = '';\n\n foreach ($assoc_args as $key => $value) {\n if ($value === true) {\n $return .= \" --$key\";\n } else {\n $return .= \" --$key=\" . escapeshellarg($value);\n }\n }\n\n return $return;\n}", "function console_text() {\n\n\t\t$args = func_get_args();\n\t\t$message = call_user_func_array('formatText', $args) . CRLF;\n\t\techo $message;\n\t\tdoLog($message);\n\t\tflush();\n\t}", "static public function Out(){\r\n\t\tif(func_num_args() == 1) return func_get_arg(0);\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\t$str = array_shift($args);\r\n\t\treturn vsprintf($str, $args);\r\n\t}", "static public function real_escape_string($s) { return self::escape($s); }", "protected function printf() {\n $args= func_get_args(); // PHP 5.2 workaround\n call_user_func_array('printf', $args ) ;\n printf(PHP_EOL);\n }", "abstract protected function _escape($s);", "function joinStr($str, $args){\n\t//$str = '將在%{level}級時解鎖%{name}';\n\tif(preg_match_all(\"/\\%{([\\d\\w\\_]+)}/\", $str, $match)){\n\t\t$r = [];\n\t\t$_args = [];\n\t\tforeach($match[1] as $_m){\n\t\t\t//$r[] = '\".@$args[\"'.$_m.'\"].\"';\n\t\t\t$r[] = \"%s\";\n\t\t\t$_args[] = $args[$_m];\n\t\t}\n\t\t$s = str_replace($match[0], $r, $str);\n\t\t$str = vsprintf($s, $_args);\n\t\t//var_dump(eval('$str = '.$s.';'));\n\t\t//var_dump($str);\n\t\treturn $str;\n\t}else{\n\t\treturn $str;\n\t}\n}", "public static function strarg($str) {\n $tr = array();\n $p = 0;\n \n for ($i=1; $i < func_num_args(); $i++) {\n $arg = func_get_arg($i);\n \n if (is_array($arg)) {\n foreach ($arg as $aarg) {\n $tr['%'.++$p] = $aarg;\n }\n } else {\n $tr['%'.++$p] = $arg;\n }\n }\n \n return strtr($str, $tr);\n }", "abstract public function escapeString($string);", "function _escape($s)\n\t\t{\n\t\t\treturn str_replace(')','\\\\)',str_replace('(','\\\\(',str_replace('\\\\','\\\\\\\\',$s)));\n\t\t}", "function wrapper_escape($string) {\n\t\treturn str_replace(\"'\", \"''\", $string);\n\t}", "public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true);", "function escape_query_arg($argument,$db_conn)\r\n{\r\n \t//If magic quotes is on, strip the slashes first \r\n\tif(get_magic_quotes_gpc())\r\n\t\t$query = stripslashes($argument);\r\n\r\n\tif(function_exists('mysql_real_escape_string'))\r\n\t\treturn mysql_real_escape_string($argument,$db_conn);\r\n\telse\r\n\t\treturn mysql_escape_string($argument);\t\r\n}", "public function EscapeString($argString, $argEscapeUnderscorePercentCharacters = false)\r\n {\r\n $this->checkDatabaseManager();\r\n $escapedString = $this->_DatabaseHandler->real_escape_string($argString);\r\n if($argEscapeUnderscorePercentCharacters)\r\n {\r\n $escapedString = addcslashes($escapedString, '%_');\r\n }\r\n return $escapedString;\r\n }", "public function escapeString($stringToEscape);", "private function buildPhpArg($arg): string\n {\n if (is_null($arg)) {\n return 'NULL';\n }\n\n if (is_string($arg)) {\n $s = $arg;\n if (strlen($s) > 15) {\n $s = substr($s, 0, 15) . '...';\n }\n return \"'\" . $s . \"'\";\n }\n\n if (is_bool($arg)) {\n return ($arg) ? 'true' : 'false';\n }\n\n if (is_resource($arg)) {\n return 'Resource id #' . ((string) $arg);\n }\n\n if (is_array($arg)) {\n return 'Array';\n }\n\n if (is_object($arg)) {\n return 'Object(' . get_class($arg) . ')';\n }\n\n return (string) $arg;\n }", "public function __construct(PhutilQsprintfInterface $escaper, array $argv) {\n\n // This makes sure we throw immediately if there are errors in the\n // parameters, which is much better than throwing later on.\n\n // This also makes sure that later mutations to objects passed as\n // parameters won't affect the outcome. Consider:\n //\n // $object->setTableName('X');\n // $query = qsprintf($conn, '%R', $object);\n // $object->setTableName('Y');\n //\n // We'd like \"$query\" to reference \"X\", reflecting the object as it\n // existed when it was passed to \"qsprintf(...)\". It's surprising if the\n // modification to the object after \"qsprintf(...)\" can affect \"$query\".\n\n $masked_string = xsprintf(\n 'xsprintf_query',\n array(\n 'escaper' => $escaper,\n 'unmasked' => false,\n ),\n $argv);\n\n $unmasked_string = xsprintf(\n 'xsprintf_query',\n array(\n 'escaper' => $escaper,\n 'unmasked' => true,\n ),\n $argv);\n\n $this->maskedString = $masked_string;\n $this->unmaskedString = $unmasked_string;\n }", "function PrepText(&$str,$blnNullable = true,$blnEscapeSQL = true) {\n if($blnEscapeSQL) {\n if (get_magic_quotes_gpc()) $str = stripslashes($str);\n // The characters _ and % are escaped \n // to prevent DOS attacks by users\n // injecting them into your LIKE operands.\n // The ; characters is escaped to prevent \n // query stacking.\n // The - character is escaped to prevent \n // parts of your SQL code being commented\n // out by someone trying to inject\n // replacement code.\n // $str = addcslashes($str,\"_%;-\"); // can't escape stuff twice\n switch($this->strDriverType) {\n case XAO_DRIVER_RDBMS_TYPE_POSTGRES:\n $str = pg_escape_string($str);\n break;\n case XAO_DRIVER_RDBMS_TYPE_ORACLE:\n $str = str_replace(\"'\",\"''\",$str);\n break;\n case XAO_DRIVER_RDBMS_TYPE_MSSQL:\n $str = str_replace(\"'\",\"''\",$str);\n break;\n case XAO_DRIVER_RDBMS_TYPE_ACCESS:\n $str = str_replace(\"'\",\"''\",$str);\n break;\n case XAO_DRIVER_RDBMS_TYPE_MYSQL4:\n $str = mysql_escape_string($str);\n break;\n case XAO_DRIVER_RDBMS_TYPE_SQLITE:\n $str = sqlite_escape_string($str);\n break;\n default:\n $str = str_replace(\"'\",\"''\",$str);\n }\n }\n if($str) {\n $str = \"'$str'\";\n }\n else {\n if(!$blnNullable) {\n $this->XaoThrow(\n \"XaoDb::PrepText() Unhandled NOT NULL Exception. \" .\n \"See stack trace for details.\",\n debug_backtrace()\n );\n }\n $str = \"NULL\";\n }\n }", "function _T(/*$arg1, $arg2...$argN*/) {\n\tglobal $language,$langloaded;\n\tif (!$langloaded){ // language file is not loaded\n\t\tLoadLanguage(PIXMICAT_LANGUAGE); $langloaded = true;\n\t}\n\tif (!func_num_args()) // called with no arg\n\t\treturn '';\n\t$arg_list = func_get_args();\n\t$arg_list[0] = isset($language[$arg_list[0]]) ? $language[$arg_list[0]] : $arg_list[0];\n\treturn call_user_func_array('sprintf',$arg_list);\n}", "public function testCanOutputArgumentWithValue()\n {\n $mainCommand = 'ls';\n $argument = '--human-readable yes';\n $command = $this->createInstance($mainCommand);\n $command->addArgument($argument);\n $this->assertEquals(sprintf('%1$s %2$s', $mainCommand, $argument), (string) $command, 'Must be able to output the command and argument string correctly');\n }", "public static function escape($som) {}", "function if_sprintf( $sprintf, ...$items ) {\n\t// get the first value and continue if it exists\n\t$first = array_shift( $items );\n\tif ( aquamin_is_truty_or_zero( $first ) ) {\n\t\t// simply return it if that's all we've got (90% of the time it's just one argument)\n\t\tif ( ! $items ) {\n\t\t\treturn sprintf( $sprintf, $first );\n\t\t} else {\n\t\t\t// if any remaining items don't exist then return an empty string\n\t\t\tforeach ( $items as $item ) {\n\t\t\t\tif ( ! aquamin_is_truty_or_zero( $item ) ) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// return the sprintf result if all items exist\n\t\t\treturn call_user_func_array( 'sprintf', array_merge( (array) $sprintf, (array) $first, $items ) );\n\t\t}\n\t}\n}", "public function escape($stringValue);", "function escape($data) {\n\t\tif ( !isset($data) ) return '';\n if ( is_numeric($data) ) return $data;\n\n $non_displayables = array(\n '/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15\n '/%1[0-9a-f]/', // url encoded 16-31\n '/[\\x00-\\x08]/', // 00-08\n '/\\x0b/', // 11\n '/\\x0c/', // 12\n '/[\\x0e-\\x1f]/' // 14-31\n );\n \n foreach ( $non_displayables as $regex )\n $data = preg_replace( $regex, '', $data );\n $search = array(\"\\\\\", \"\\x00\", \"\\n\", \"\\r\", \"'\", '\"', \"\\x1a\");\n $replace = array(\"\\\\\\\\\",\"\\\\0\",\"\\\\n\", \"\\\\r\", \"\\'\", '\\\"', \"\\\\Z\");\n\n return str_replace($search, $replace, $data);\n\t}", "function printf($string)\n\t{\n\t\t$lang =& JFactory::getLanguage();\n\t\t$args = func_get_args();\n\t\tif (count($args) > 0) {\n\t\t\t$args[0] = $lang->_($args[0]);\n\t\t\treturn call_user_func_array('printf', $args);\n\t\t}\n\t\treturn '';\n\t}", "public static function escape($value) {}", "public static function escapeCommand(array $args, $meta = true)\n {\n $cmd = self::escape(array_shift($args), $meta, true);\n foreach ($args as $arg) {\n $cmd .= ' '.self::escape($arg, $meta);\n }\n\n return $cmd;\n }", "public static function format($message, $args) {\n\t\t# Format message\n\t\t# Only neccessary if additional arguments were passed.\n\t\t# To allow NULL-arguments also, the usage of sizeof()\n\t\t# over iset() is favored:\n\t\t$formated_message = (sizeof($args))\n\t\t\t? vsprintf($message, $args)\n\t\t\t: $message;\n\n\t\treturn $formated_message;\n\t}", "function add()\n{\n\t$args = func_get_args();\n\t$string = array_shift($args);\n\tSystem::InterfaceHandler()->content(vsprintf($string, $args));\n}", "public function escape($string);", "public function escape($string);", "public function escapeString($string);", "function escapeString( $value )\r\n\t{\r\n die(\"method \" . __METHOD__ . \" is not implemented\" . Diagnostics::trace());\r\n\t}", "function pdo_escape_string($str, $link=NULL) {\r\n return pdo_real_escape_string($str, $link);\r\n }", "function sysEncode( $str ){\n\treturn( addslashes( htmlspecialchars( $str ) ) );\n}", "public function __toString()\n {\n $name = ($this->isShort() ? '-' : '--').$this->name;\n\n $value = is_null($this->value) ? '' : escapeshellarg($this->value);\n\n return trim(sprintf('%s %s', $name, $value));\n }", "public abstract function escape($string);", "function yourls_s( $pattern ) {\n\t// Get pattern and pattern arguments\n\t$args = func_get_args();\n\t// If yourls_s() called by yourls_se(), all arguments are wrapped in the same array key\n\tif( count( $args ) == 1 && is_array( $args[0] ) ) {\n\t\t$args = $args[0];\n\t}\n\t$pattern = $args[0];\n\n\t// get list of sprintf tokens (%s and such)\n\t$num_of_tokens = substr_count( $pattern, '%' ) - 2 * substr_count( $pattern, '%%' );\n\n\t$domain = 'default';\n\t// More arguments passed than needed for the sprintf? The last one will be the domain\n\tif( $num_of_tokens < ( count( $args ) - 1 ) ) {\n\t\t$domain = array_pop( $args );\n\t}\n\n\t// Translate text\n\t$args[0] = yourls__( $pattern, $domain );\n\n\treturn call_user_func_array( 'sprintf', $args );\n}", "public function wrapUriName($inputName)\n {\n return escapeshellarg($inputName);\n }", "protected static function placeholderFormat($string, array $args) {\n // Transform arguments before inserting them.\n foreach ($args as $key => $value) {\n switch ($key[0]) {\n case '@':\n // Escape if the value is not an object from a class that implements\n // \\Drupal\\Component\\Render\\MarkupInterface, for example strings will\n // be escaped.\n // Strings that are safe within HTML fragments, but not within other\n // contexts, may still be an instance of\n // \\Drupal\\Component\\Render\\MarkupInterface, so this placeholder type\n // must not be used within HTML attributes, JavaScript, or CSS.\n $args[$key] = static::placeholderEscape($value);\n break;\n\n case ':':\n // Strip URL protocols that can be XSS vectors.\n $value = UrlHelper::stripDangerousProtocols($value);\n // Escape unconditionally, without checking whether the value is an\n // instance of \\Drupal\\Component\\Render\\MarkupInterface. This forces\n // characters that are unsafe for use in an \"href\" HTML attribute to\n // be encoded. If a caller wants to pass a value that is extracted\n // from HTML and therefore is already HTML encoded, it must invoke\n // \\Drupal\\Component\\Render\\OutputStrategyInterface::renderFromHtml()\n // on it prior to passing it in as a placeholder value of this type.\n // @todo Add some advice and stronger warnings.\n // https://www.drupal.org/node/2569041.\n $args[$key] = Html::escape($value);\n break;\n\n case '%':\n // Similarly to @, escape non-safe values. Also, add wrapping markup\n // in order to render as a placeholder. Not for use within attributes,\n // per the warning above about\n // \\Drupal\\Component\\Render\\MarkupInterface and also due to the\n // wrapping markup.\n $args[$key] = '<em class=\"placeholder\">' . static::placeholderEscape($value) . '</em>';\n break;\n\n default:\n // Deprecate support for random variables that won't be replaced.\n if (ctype_alpha($key[0]) && strpos($string, $key) === FALSE) {\n @trigger_error(sprintf('Support for keys without a placeholder prefix is deprecated in Drupal 9.1.0 and will be removed in Drupal 10.0.0. Invalid placeholder (%s) with string: \"%s\"', $key, $string), E_USER_DEPRECATED);\n }\n else {\n trigger_error(sprintf('Invalid placeholder (%s) with string: \"%s\"', $key, $string), E_USER_WARNING);\n }\n // No replacement possible therefore we can discard the argument.\n unset($args[$key]);\n break;\n }\n }\n\n return strtr($string, $args);\n }", "protected static function makeArgStr($num_args) {\n $m_args = array();\n for ($i = 0; $i < $num_args; $i++) {\n $m_args[] = \"\\$args[$i]\";\n }\n return implode(', ', $m_args);\n }", "public static function format(string $format, string ...$arguments) : string\n {\n foreach ($arguments as $key => $value) {\n $format = str_replace(\"{{$key}}\", (string)$value, $format);\n }\n\n return $format;\n }", "public function testEscapeArgument($argument, string $win, string $unix): void\n {\n $expected = defined('PHP_WINDOWS_VERSION_BUILD') ? $win : $unix;\n $this->assertSame($expected, ProcessExecutor::escape($argument));\n }", "public function testCanOutputArgumentsWithValues()\n {\n $mainCommand = 'ls';\n $arguments = ['--human-readable yes', '--all ofcourse'];\n $command = $this->createInstance($mainCommand);\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertEquals(sprintf('%1$s %2$s', $mainCommand, implode(' ', $arguments)), (string) $command, 'Must be able to output the command and argument string correctly');\n }", "function esc_like($text)\n{\n return addcslashes($text, '_%\\\\');\n}", "function console() {\n\t\t$args = func_get_args();\n\t\t$message = '['.date('m/d,H:i:s').'] '.call_user_func_array('formatText', $args) . CRLF;\n\t\techo $message;\n\t\t//doLog($message);\n\t\tflush();\n\t}", "function Dwoo_Plugin_escape(Dwoo_Core $dwoo, $value='', $format='html', $charset=null)\n{\n\tif ($charset === null) {\n\t\t$charset = $dwoo->getCharset();\n\t}\n\n\tswitch($format)\n\t{\n\n\tcase 'html':\n\t\treturn htmlspecialchars((string) $value, ENT_QUOTES, $charset);\n\tcase 'htmlall':\n\t\treturn htmlentities((string) $value, ENT_QUOTES, $charset);\n\tcase 'url':\n\t\treturn rawurlencode((string) $value);\n\tcase 'urlpathinfo':\n\t\treturn str_replace('%2F', '/', rawurlencode((string) $value));\n\tcase 'quotes':\n\t\treturn preg_replace(\"#(?<!\\\\\\\\)'#\", \"\\\\'\", (string) $value);\n\tcase 'hex':\n\t\t$out = '';\n\t\t$cnt = strlen((string) $value);\n\t\tfor ($i=0; $i < $cnt; $i++) {\n\t\t\t$out .= '%' . bin2hex((string) $value[$i]);\n\t\t}\n\t\treturn $out;\n\tcase 'hexentity':\n\t\t$out = '';\n\t\t$cnt = strlen((string) $value);\n\t\tfor ($i=0; $i < $cnt; $i++)\n\t\t\t$out .= '&#x' . bin2hex((string) $value[$i]) . ';';\n\t\treturn $out;\n\tcase 'javascript':\n\t\treturn strtr((string) $value, array('\\\\'=>'\\\\\\\\',\"'\"=>\"\\\\'\",'\"'=>'\\\\\"',\"\\r\"=>'\\\\r',\"\\n\"=>'\\\\n','</'=>'<\\/'));\n\tcase 'mail':\n\t\treturn str_replace(array('@', '.'), array('&nbsp;(AT)&nbsp;', '&nbsp;(DOT)&nbsp;'), (string) $value);\n\tdefault:\n\t\treturn $dwoo->triggerError('Escape\\'s format argument must be one of : html, htmlall, url, urlpathinfo, hex, hexentity, javascript or mail, \"'.$format.'\" given.', E_USER_WARNING);\n\n\t}\n}", "public function _($string /* ... */) {\r\n $args = func_get_args();\r\n array_shift($args);\r\n if (!empty($args) && count($args) == 1 && is_array($args[0])) {\r\n $args = $args[0];\r\n }\r\n return vsprintf(gettext($string), $args);\r\n }", "function qescape($str)\n{\n $str = str_replace('\\\\', '\\\\\\\\', $str);\n return str_replace('\"', '\\\\\"', $str);\n}", "protected abstract function escape($string);", "public function testOoCanOutputArgumentsWithValues()\n {\n $mainCommand = 'ls';\n $arguments = [new Command\\Argument('all', 'yes'), new Command\\Argument('list', 'of course')];\n $command = $this->createInstance($mainCommand);\n foreach ($arguments as $_argument) {\n $command->addArgument($_argument);\n }\n $this->assertEquals(sprintf('%1$s --all %2$s --list %3$s', $mainCommand, escapeshellarg('yes'), escapeshellarg('of course')), (string) $command, 'Must be able to output the command and argument string correctly');\n }", "public static function format($f) {\n\n\t\t$arguments = func_get_args();\n\t\t$formatRegExp = '/%[sdj%]/';\n\n\t\tif (!is_string($f)) {\n\t\t\t$objects = array();\n\t\t\tfor ($i = 0; $i < count($arguments); $i++) {\n\t\t\t\t$objects[] = self::inspect($arguments[$i]);\n\t\t\t}\n\t\t\treturn implode(' ', $arguments);\n\t\t}\n\t\t\n\t\t$i = 1;\n\t\t$args = $arguments;\n\t\t$len = count($args);\n\t\t\n\t\t$str = preg_replace_callback($formatRegExp, function($x) use (&$i, $len, $args) {\n\n\t\t\t$x = $x[0];\n\t\t\n\t\t\tif ($x == '%%') {\n\t\t\t\treturn '%';\n\t\t\t}\n\t\t\tif ($i >= $len) {\n\t\t\t\treturn $x;\n\t\t\t}\n\t\t\tswitch ($x) {\n\t\t\t\tcase '%s':\n\t\t\t\t\treturn (string)$args[$i++];\n\t\t\t\tcase '%d':\n\t\t\t\t\treturn (float)$args[$i++];\n\t\t\t\tcase '%j':\n\t\t\t\t\ttry {\n\t\t\t\t\t\tjson_encode($args[$i++]);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\treturn '[Circular]';\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn $x;\n\t\t\t}\t\t\n\t\t}, $f);\n\t\t\n\t\tif ($i < $len) {\n\t\t\tfor ($x = $args[$i]; $i < $len; $x = $args[++$i]) {\n\t\t\t\tif ($x === null || !(is_object($x) || is_array($x))) {\n\t\t\t\t\t$str += ' ' . $x;\n\t\t\t\t} else {\n\t\t\t\t\t$str += ' ' + self::inspect($x);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}", "public function escape($text);", "function mkSQL() {\n $n = func_num_args();\n if ($n < 1) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $i = 1;\n $SQL = \"\";\n $fmt = func_get_arg(0);\n while (strlen($fmt)) {\n $p = strpos($fmt, \"%\");\n if ($p === false) {\n $SQL .= $fmt;\n break;\n }\n $SQL .= substr($fmt, 0, $p);\n if (strlen($fmt) < $p+2) {\n Fatal::internalError('Bad mkSQL() format string.');\n }\n if ($fmt{$p+1} == '%') {\n $SQL .= \"%\";\n } else {\n if ($i >= $n) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $arg = func_get_arg($i++);\n switch ($fmt{$p+1}) {\n case '!':\n /* very dangerous, but sometimes very useful -- be careful */\n $SQL .= $arg;\n break;\n case 'B':\n if ($arg) {\n $SQL .= \"'Y'\";\n } else {\n $SQL .= \"'N'\";\n }\n break;\n case 'C':\n $a = array();\n foreach (explode('.', $arg) as $ident) {\n array_push($a, '`'.$this->_ident($ident).'`');\n }\n $SQL .= implode('.', $a);\n break;\n case 'I':\n $SQL .= '`'.$this->_ident($arg).'`';\n break;\n case 'i':\n $SQL .= $this->_ident($arg);\n break;\n case 'N':\n $SQL .= $this->_numstr($arg);\n break;\n case 'Q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n case 'q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n default:\n Fatal::internalError('Bad mkSQL() format string.');\n }\n }\n $fmt = substr($fmt, $p+2);\n }\n if ($i != $n) {\n Fatal::internalError('Too many arguments to mkSQL().');\n }\n return $SQL;\n }", "public function escape($value);", "public function escape($value);", "public static function create(...$args): self\n {\n $ex = end($args) instanceof \\Throwable ? array_pop($args) : null;\n $message = sprintf(...$args);\n\n return new static($message, 0, $ex);\n }", "abstract public function escapeStr($str, $like = false);" ]
[ "0.69525474", "0.6265933", "0.62277406", "0.61897767", "0.60796016", "0.6033726", "0.59889394", "0.5986172", "0.5861745", "0.58269733", "0.5815989", "0.57730657", "0.5749108", "0.5721538", "0.5695257", "0.56944364", "0.56687766", "0.5609906", "0.5562797", "0.5544724", "0.5526663", "0.54977554", "0.54478323", "0.54095924", "0.5390419", "0.5368608", "0.5354112", "0.53112704", "0.529241", "0.5270153", "0.5231756", "0.5227345", "0.5224803", "0.5221594", "0.5183619", "0.51818293", "0.5173669", "0.5133328", "0.5118562", "0.5115328", "0.5107931", "0.50994045", "0.5095866", "0.5095395", "0.50924975", "0.50810504", "0.50666046", "0.50556093", "0.505077", "0.5031978", "0.50271326", "0.5025007", "0.50214654", "0.50186443", "0.50083923", "0.49756217", "0.4963851", "0.49598458", "0.49448124", "0.49376088", "0.49174485", "0.49149624", "0.49079305", "0.49034202", "0.4894993", "0.48835763", "0.48832256", "0.48718414", "0.48708892", "0.48672462", "0.4863537", "0.48606294", "0.48606294", "0.48537973", "0.48373047", "0.48362315", "0.48335114", "0.48306003", "0.482658", "0.48208284", "0.4786932", "0.47836766", "0.47727224", "0.47722867", "0.47708946", "0.4770197", "0.4769712", "0.47498697", "0.47490042", "0.4740556", "0.4739961", "0.47394985", "0.47381395", "0.47183713", "0.47162247", "0.46926135", "0.46870416", "0.46870416", "0.46737355", "0.46715873" ]
0.64738345
1
Run the database seeds.
public function run() { // DB::table('members')->truncate(); factory(\App\Association\Member::class, 100)->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Lists all studentFormTwo entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $studentFormTwos = $em->getRepository('AppBundle:StudentFormTwo')->findAll(); return $this->render('studentformtwo/index.html.twig', array( 'studentFormTwos' => $studentFormTwos, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function semesterTwoPage() {\n return \\view('admin.students.two-results', [\n 'twos' => SemesterTwo::query()->whereIn('user_id', User::query()->where('program_verified', true)->get())->paginate(config('mv-notification.paginate')),\n ]);\n }", "private function createDeleteForm(StudentFormTwo $studentFormTwo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('studentformtwo_delete', array('id' => $studentFormTwo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function index2Action()\n {\n $em = $this->getDoctrine()->getManager();\n\n $livres = $em->getRepository('BibliothequeBundle:livre')->findAll();\n $emprunt = $em->getRepository('BibliothequeBundle:emprunt')->findAll();\n\n return $this->render('livre/index2.html.twig', array(\n 'livres' => $livres,\n 'emprunt' => $emprunt\n\n ));\n }", "public function showstudentsAction() { \r\n $students = $this->getDoctrine()\r\n ->getRepository(Student::class)\r\n ->findAll();\r\n\r\n foreach ($students as $student) {\r\n $student->getClassroom();\r\n }\r\n\r\n return $this->render('admin/admin-student/adminStudentDashboard.html.twig', [\r\n 'students' => $students,\r\n ]);\r\n }", "public function show2Action()\n { $em = $this->getDoctrine()->getManager();\n $user = $this->container->get('security.token_storage')->getToken()->getUser();\n $clubs = $em->getRepository('EvenementBundle:Club')->findBy(array('idresponsable'=>$user));\n $aa=array();\n for($i=0;$i<count($clubs);$i++)\n {\n $demandeevenement = $em->getRepository('EvenementBundle:Demandeevenement')->findBy(array('idclub'=>$clubs[$i]->getIdclub()));\n foreach ($demandeevenement as $r){\n\n array_push($aa,$r);\n }\n }\n\n return $this->render('demandeevenement/show2.html.twig', array(\n 'demandeevenements' => $aa,\n\n ));\n }", "public function getSemester2Students()\n {\n return $this->hasMany(Semester2Students::className(), ['semester' => 'semester_id']);\n }", "public function indexSpForm()\n {\n $spformsPending = DB::table('spforms')\n ->join('students', 'students.ic', '=', 'spforms.studentIC')\n ->join('teachers', 'teachers.ic', '=', 'spforms.teacherIC')\n ->select('teachers.name as teacherName', 'students.name as studentName', 'spforms.*')\n ->where('spforms.status', 0)\n ->get();\n\n $spforms = DB::table('spforms')\n ->join('students', 'students.ic', '=', 'spforms.studentIC')\n ->join('teachers', 'teachers.ic', '=', 'spforms.teacherIC')\n ->select('teachers.name as teacherName', 'students.name as studentName', 'spforms.*')\n ->where('spforms.status', '<>', 0)\n ->get();\n\n return view('Spform.spFormIndex', compact('spforms', 'spformsPending'));\n }", "public function index()\n {\n return Student::all();\n }", "public function index()\n {\n return Student::all();\n }", "public function indexAction()\n {\n\t\t$student = $this->getConnectedStudent();\n\t\t$this->removeSession();\n $em = $this->getDoctrine()->getManager();\n\t\t$this->setActivity(\"Access to absences section\");\t\n $absences = $em->getRepository('BoAdminBundle:Absences')->findBy(array('students'=>$student));\n $absence_form = $this->createForm('Bo\\AdminBundle\\Form\\AbsencesType5', new Absences());\n return $this->render('BoStudentBundle:Absences:index.html.twig', array(\n 'absences' => $absences,\n\t\t\t'user'=>$this->getTokenUser(),\n\t\t\t'student'=>$student,\n\t\t\t'contract'=>$this->getCurrentStudentContract($student),\n\t\t\t'absence_form' => $absence_form->createView(),\n\t\t\t'pm'=>\"request\",\n\t\t\t'sm'=>\"absences\",\n ));\n }", "public function index()\n {\n $customer2s = Customer2::orderBy('id','desc')->get();\n return $customer2s;\n }", "public function getAllStudents() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) { \n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $students = $student->getAllStudents();\n \n $model = array(\n 'user_data' => $user_data,\n 'students' => $students\n );\n BaseController::display(self::$controller . '/students.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "public function getList()\n\t{\n\t\t$queryBuilder = $this\n\t\t\t->createQueryBuilder('student')\n\t\t\t->select('student, professor, tutor, contract_type')\n\t\t\t->leftJoin('student.professor', 'professor')\n\t\t\t->leftJoin('student.tutor', 'tutor')\n\t\t\t->leftJoin('student.contractType', 'contract_type');\n\t\treturn $queryBuilder->getQuery()->getResult();\n\t}", "public function enrollMoreThanTwo(Student $student)\n {\n return view('other.index', [ 'students' => $student->has('payment')->get() ]);\n }", "public function getListforBehaivour(){\n\t\t$this->verify();\n\t\t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('term', 'Term', 'trim|numeric|required');\n\t\t$this->form_validation->set_rules('session', 'Session', 'trim|required');\n\t\t$this->form_validation->set_rules('class', 'Class', 'trim|required');\n\t\t\n\t\tif($this->form_validation->run()){\n\t\t\t$list_data=array(\n\t\t\t\t'TERM'=>$this->input->post('term'),\n\t\t\t\t'CLASS'=>$this->input->post('class'),\n\t\t\t\t'SESSION'=>$this->input->post('session')\n\t\t\t);\n\t\t\t$data['students']=$this->admin_model->getStudentlist_for_behaivour($list_data);\n\t\t\t$this->load->view('scores/studentlist2', $data);\t\n\t\t}\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n\n $evenements = $em->getRepository('evenementBundle:evenement')->findAll();\n\n\n return $this->render('evenement/index.html.twig', array(\n 'evenements' => $evenements,\n ));\n }", "public function index()\n\t{\n\t\t$prueba2s = $this->prueba2Repository->all();\n\n\t\treturn $this->sendResponse($prueba2s->toArray(), \"Prueba2s retrieved successfully\");\n\t}", "public function indexAction()\n {\n $entityManager = $this->getDoctrine()->getManager();\n\n $form = $this->createForm(new FindType($entityManager))->createView();\n $upload = $this->createForm(new UploadType())->createView();\n $download = $this->createForm(new DownloadType($entityManager))->createView();\n\n return $this->render('books/index.html.twig', [\n 'form' => $form, 'upload' => $upload, 'download' => $download\n ]);\n }", "public function actionStudents()\n\t{\n\t\t//$this->model = User::loadModel();\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '//drcUser/_list',\n\t\t\t'dataProvider' => $this->model->students(),\n\t\t\t'contentTitle' => 'DRC Students',\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'menuView' => 'base.views.layouts._termMenu',\n\t\t));\n\t}", "public function index(FormBuilder $formBuilder)\n {\n $form = $formBuilder->create(StudentForm::class, [\n 'method' => 'POST',\n 'url' => route($this->module_name . '.store'),\n 'data' => [\n 'departments' =>\n $this->ams->departments()->getRecordsArray(['id', 'name'])->data,\n 'courses' =>\n $this->ams->courses()->getRecordsArray(['id', 'title'],\n ['key' => 'id', 'value' => 'title'])->data\n ]\n ]);\n $all_students = $this->ams->students()->getRecords()->data->count();\n return view($this->module_name . '.index', compact('form', 'all_students'));\n }", "public function getStudent(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}", "public function __add_onetoone($form){\n\n if(!isset($form)){\n throw new Exception('__add_onetoone : param[form] not set!');\n }\n\n foreach ($this->onetoone as $filed => $model) {\n // 一对一 名称\n $filed_name = $this->model[$filed][0];\n\n // 一对一 表单字段\n $_model = new $model[0];\n\n foreach ($_model->get_field() as $value){\n if(array_key_exists($value, $_model->get_model())){\n // 是否需要校验\n $validate = in_array($value, $_model->get_front_validate());\n\n $type = $_model->get_model()[$value][1];\n\n $name = $_model->get_model()[$value][0];\n\n $join_key = array($filed, $value);\n $body_arr = array(join('_',$join_key), $name, $validate, false);\n\n if($type == 'select'){\n $relation = array();\n\n foreach ($_model->get_relations() as $o_key => $o_model_arrays){\n foreach ($o_model_arrays as $o_model_field => $o_model_array){\n\n // 数组的方式获取数据\n $method = '_rget_'.$o_model_array;\n\n foreach ($_model->$method() as $key => $value){\n $tmp['name'] = $value;\n $tmp['value'] = $key;\n\n array_push($relation, $tmp);\n }\n }\n }\n }\n $relation = isset($relation) ? $relation : '';\n\n $form->add_block($type, $filed_name, $body_arr, $relation);\n\n unset($relation);\n\n }\n }\n }\n }", "public function retrieveAllStudent(){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM student ORDER BY id DESC\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function listforms()\n {\n\t\t\n }", "public function formationsAction()\n {\n $em = $this->getDoctrine()->getManager();\n $id= $this->getUser()->getProfil();\n $formations = $em->getRepository('ExiaCoreBundle:Formation')->findByProfil($id);\n return $this->render('ExiaCoreBundle:Core:liste-formation.html.twig', array('formations' => $formations));\n }", "public function studentList()\n {\n return output($this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()])->read(),'success','SM001');\n }", "public function index()\n {\n //\n $forms = Form1::all()->toArray();\n return array_reverse($forms);\n }", "public function allStudents()\n {\n\n $students = Student::all();\n return $students;\n\n\n\n }", "public function newSearchAction()\n {\n\n $em = $this->getDoctrine()->getManager();\n $gradeRepo = $em->getRepository('CompeteComBundle:Grades');\n $subjectsRepo = $em->getRepository('CompeteComBundle:Subjects');\n $grades=$gradeRepo->findAll();\n $subjects=$gradeRepo->findAll();\n return $this->render('CompeteComBundle:StudyQuestions:search.html.twig',\n array('grades'=>$grades,'subjects'=>$subjects));\n\n // $entity = new StudyQuestions();\n //$form = $this->createForm(new SearchQuestionsType(), $entity);\n// $grade=$em->getRepository('CompeteComBundle:Grades')->findOneById(3);\n// $entity->setGrade($grade);\n// return $this->render('CompeteComBundle:StudyQuestions:search.html.twig', array(\n// 'entity' => $entity,\n// 'form' => $form->createView(),\n \n }", "public function actionIndex()\n {\n $session = \\yii::$app->session;\n $user_type = $session->get('type',-1);\n\n $searchModel = new StudentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function students()\r\n {\r\n $students = $this->student->GetAllStudents();\r\n $view = new view(\"Students\");\r\n $view->generate(array('students' => $students));\r\n\r\n }", "public function show(StudentToCourse $studentToCourse)\n {\n //\n }", "public function action_list()\n {\n if(($data = $this->check_student($this->request->param('id'))))\n {\n $data['year'] = isset($data['year']) ? $data['year'] : \n $data['student']->end_year;\n $data['current_class'] = $data['student']->class_id; \n \n if(is_null($data['current_class']) || \n $data['year'] != $data['student']->end_year)\n {\n $data['subjects_records'] = Model::factory('year_subject')->get_subject_records($data);\n $data['class'] = count($data['subjects_records']) > 0 ? \n $data['subjects_records'][0]->class : '';\n }\n else\n {\n $data['subjects_records'] = Model::factory('year_subject')\n ->get_subject_records_by_classname($data);\n $data['subjects'] = Model::factory('class_subject')\n ->get_subjects_by_class_id($data['student']->class->id);\n $data['class'] = $data['student']->class->level->name . $data['student']->class->name;\n $data['table_class'] = View::factory('academicrecords/tables/class', $data);\n }\n $data['period'] = Model::factory('setting')->get_value('academic_year');\n \n $data['table'] = $this->set_table($data);\n $this->setTitle('Academic Records')\n ->view('academicrecords/list', $data)\n ->render();\n }\n// else\n// throw new HTTP_Exception_404;\n }", "public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = new Consulta();\r\n $this->tipo=1;\r\n $form = $this->createCreateForm($entity,$this->tipo,0);\r\n $entities = $em->getRepository('DGPlusbelleBundle:Consulta')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'tipo' => 1,\r\n );\r\n }", "public function allstudent()\n {\n $students = Student::get();\n\n return view('admin.pages.all_student',compact('students'));\n }", "public function show(students $students)\n {\n //\n }", "public function get_students_list(){\n return $this->n->get_list_from_db();\n }", "function student_list() {\n $query = db_select('student', 'st');\n $query\n ->fields('st', array('st_id', 'st_fnm', 'st_lnm', 'st_email'))\n ->range(0, 50)\n ->orderby('st.st_id');\n $results = $query\n ->execute();\n $header = array(t('ID'),\n t('First Name'),\n t('Last Name'),\n t('E-mail'),\n t('Delete'),\n t('Edit'),\n );\n $rows = array(); /*values pulling database*/\n foreach ($results as $result) {\n $rows[] = array(\n check_plain($result->st_id),\n check_plain($result->st_fnm),\n check_plain($result->st_lnm),\n check_plain($result->st_email),\n l(t('Delete'), 'formlist/' . $result->st_id . '/delete'),\n l(t('Edit'), 'formlist/' . $result->st_id . '/edit'),\n );\n }\n return theme('table', array('header' => $header, 'rows' => $rows));\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $orderforms = $em->getRepository('BoAdminBundle:Orderform')->findAll();\n\n return $this->render('orderform/index.html.twig', array(\n 'orderforms' => $orderforms,\n ));\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $detailsMissions = $em->getRepository('AppBundle:DetailsMission')->findAll();\n\n return $this->render('detailsmission/index.html.twig', array(\n 'detailsMissions' => $detailsMissions,\n ));\n }", "public function index()\n {\n $student = Student::all();\n return $student;\n }", "public function index()\n {\n// $users = $this->modelRepo->showAll();\n\n $users = $this->modelRepo->getModel()->whereHas('student')->with('student.grade.fees', 'student.payment')->get();\n return $users;\n }", "public function index()\n {\n $students = HocSinh::orderBy('ten', 'ASC')->get();\n $loaikhoahoc = LoaiKhoaHoc::all();\n return view(\n 'backend.contact.hocsinh.listStudent',\n compact('students','loaikhoahoc')\n )->with(['jsValidator' => $this->jsValidator]);\n }", "public function listForms();", "public function index()\r\n {\r\n $this->page_ = get_page_in_url();\r\n\r\n //list students\r\n $student_obj = $this->Student_model->\r\n limit($this->limit, $this->limit * $this->page_ - $this->limit)->\r\n order_by('created_at', 'DESC')->\r\n order_by('updated_at', 'DESC')->\r\n set_cache('students_page_' . $this->page_)->\r\n get_all();\r\n\r\n\r\n $table_data = array();\r\n\r\n if ($student_obj)\r\n {\r\n\r\n foreach ($student_obj as $student)\r\n {\r\n $view_ = anchor(site_url('students/view?student-id=' . $student->student_id), 'View');\r\n $edit_ = anchor(site_url('edit-student?student-id=' . $student->student_id), 'Edit');\r\n\r\n array_push($table_data, array(\r\n my_htmlspecialchars($student->student_school_id),\r\n my_htmlspecialchars($student->student_lastname),\r\n my_htmlspecialchars($student->student_firstname),\r\n my_htmlspecialchars($student->student_middlename),\r\n $view_ . ' | ' . $edit_\r\n ));\r\n }\r\n }\r\n\r\n\r\n /*\r\n * Table headers\r\n */\r\n $header = array(\r\n lang('index_student_school_id_th'),\r\n lang('index_student_lastname_th'),\r\n lang('index_student_firstname_th'),\r\n lang('index_student_middlename_th'),\r\n 'Options'\r\n );\r\n\r\n /**\r\n * table values\r\n */\r\n $this->data['table_data'] = $this->my_table_view($header, $table_data, 'table_open_bordered');\r\n\r\n /**\r\n * pagination\r\n */\r\n $this->data['pagination'] = $this->pagination->generate_link('students/index', $this->Student_model->count_rows() / $this->limit);\r\n\r\n /**\r\n * caption of table\r\n */\r\n $this->data['caption'] = lang('index_student_heading');\r\n\r\n\r\n /**\r\n * table of users ready,\r\n * \r\n */\r\n /**\r\n * templates for group controller\r\n */\r\n $this->template['table_data_groups'] = MY_Controller::_render('admin/_templates/table', $this->data, TRUE);\r\n $this->template['controller'] = 'table';\r\n\r\n $this->template['bootstrap'] = $this->bootstrap();\r\n /**\r\n * rendering users view\r\n */\r\n $this->_render('admin/students', $this->template);\r\n }", "public function validateStudentFormAction()\n {\n $formValues = $this->getAllParams();\n\n $form = new Account_Form_Student($formValues['studentId'], $formValues['snId']);\n $form->isValid($formValues);\n\n $this->_helper->json($form->getMessages());\n }", "public function actionIndex() {\n $searchModel = new WorkloadEvent2Search();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(student $student)\n {\n //\n }", "public function getAllStudent(){\n\n\t\treturn array(\n\t\t\t\"1\"=> new Entity_Student(1,\"pham van thao\",23,\"tlu\"),\n\t\t\t\"2\"=> new Entity_Student(2,\"pham van phen\",24,\"tlu\"),\n\t\t\t\"3\"=> new Entity_Student(3,\"pham van to\",25\"tlu\"),\n\t\t\t\"4\"=> new Entity_Student(4,\"pham van\",26,\"tlu\"),\n\n\t\t);\n\t}", "public function index()\n {\n return StudentResource::collection(Student::with(['managePassword'])->get());\n }", "public function index()\n {\n $students = User::where('type','2')->get();\n return view('admin.student.index',compact('students'));\n }", "public function massCriteriaTwoAction()\n {\n $ifeedbackIds = $this->getRequest()->getParam('ifeedback');\n if (!is_array($ifeedbackIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('Please select instructor feedbacks.')\n );\n } else {\n try {\n foreach ($ifeedbackIds as $ifeedbackId) {\n $ifeedback = Mage::getSingleton('bs_kst/ifeedback')->load($ifeedbackId)\n ->setCriteriaTwo($this->getRequest()->getParam('flag_criteria_two'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d instructor feedbacks were successfully updated.', count($ifeedbackIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('There was an error updating instructor feedbacks.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function index()\n {\n return view('backend.pages.mystudent.myStudentList');\n }", "public function actionStudentJobsToSchools()\n {\n $searchModel = new JobPostingSearch();\n $dataProvider = $searchModel->searchStudentJobsToSchools(Yii::$app->request->queryParams);\n\n return $this->render('student-jobs-to-schools', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n\n }", "public function actionIndexByWr2(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByWr2',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return view('Teacher.SPForm.spformindex');\n }", "protected function form()\n {\n $form = new Form(new StudentsBooksRent);\n\n $form->number('private_book_id', __('Private book id'));\n $form->text('renter_name', __('Renter name'));\n $form->text('lender_name', __('Lender name'));\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('shared_book_cover', __('Shared book cover'));\n $form->switch('statement', __('Statement'))->default(1);\n $form->datetime('rend_applied_at', __('Rend applied at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('rend_allowed_at', __('Rend allowed at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('rend_rejected_at', __('Rend rejected at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('return_applied_at', __('Return applied at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('return_confirm_at', __('Return confirm at'))->default(date('Y-m-d H:i:s'));\n $form->number('cast_beans', __('Cast beans'));\n $form->number('over_limit_days', __('Over limit days'));\n\n return $form;\n }", "public function index()\n {\n $students = User::with('student')->whereRole_id(5)->get();\n return view('superadmin.student.index', compact(['students']));\n }", "public function indexAction() {\n $searchForm = new Forms\\commercialDocumentSearchForm();\n $searchForm->initFromGet();\n\n $this->context->render(\"Commercial/pages/sellingDocumentsList.twig\", array(\n \"searchForm\" => $searchForm,\n \"data_table\" => $this->_em->getRepository(\"CommercialCommercialDocument\")->findBySearchForm($searchForm),\n ));\n }", "public function saveStepTwoAction(Request $request)\n {\n $userFormResult = $this->get('megogo_core.form')->handleStepTwoForm($request);\n\n return new JsonResponse($userFormResult);\n }", "public function indexAction() {\r\n\t$monumentName = $this->_getParam('monumentName');\r\n\t$county =$this->_getParam('county');\r\n\t$district = $this->_getParam('district');\r\n\t$parish = $this->_getParam('parish');\r\n\t$page = $this->_getParam('page');\r\n\t$smrs = new Osdata();\r\n\t$this->view->osdata = $smrs->getSmrs($page,$county,$district,$parish,$monumentName);\r\n\t$form = new SAMFilterForm();\r\n\t$this->view->form = $form;\r\n\tif(!is_null($county)) {\r\n\t$districts = new Places();\r\n\t$district_list = $districts->getDistrictList($county);\r\n\t$form->district->addMultiOptions(array(NULL => NULL,'Choose district' => $district_list));\r\n\tif(!is_null($district)) {\r\n\t$parish_list = $districts->getParishList($district);\r\n\t$form->parish->addMultiOptions(array(NULL => NULL,'Choose parish' => $parish_list));\r\n\t}\r\n\t}\r\n\t\r\n\t$form->monumentName->setValue($monumentName);\r\n\t$form->district->setValue($district);\r\n\t$form->parish->setValue($parish);\r\n\t$form->county->setValue($county);\r\n\tif ($this->_request->isPost() && !is_null($this->_getParam('submit'))) {\r\n\t$formData = $this->_request->getPost();\r\n\tif ($form->isValid($formData)) {\r\n\t\t$params = array_filter($formData);\r\n\t\tunset($params['submit']);\r\n\t\tunset($params['action']);\r\n\t\tunset($params['controller']);\r\n\t\tunset($params['module']);\r\n\t\tunset($params['page']);\r\n\t\tunset($params['csrf']);\r\n\r\n\t\t$where = array();\r\n foreach($params as $key => $value)\r\n {\r\n\t\t\tif($value){\r\n $where[] = $key . '/' . urlencode(strip_tags($value));\r\n\t\t\t}\r\n }\r\n\t$whereString = implode('/', $where);\r\n\t$query = $whereString;\r\n\t$this->_redirect(self::REDIRECT . 'index/' . $query.'/');\r\n\t} else {\r\n\t$form->populate($formData);\r\n\t}\r\n\t}\r\n\t}", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $categorieEntites = $em->getRepository('DciBundle:CategorieEntite')->findAll();\n $sousCategorieEntites = $em->getRepository('DciBundle:SousCategorieEntite')->findAll();\n $marchandises = $em->getRepository('DciBundle:Marchandise')->findAll();\n $operatSousCateg = $em->getRepository('DciBundle:OperatSousCateg')->findAll();\n $consommateurs = $em->getRepository('DciBundle:Consommateur')->findAll();\n return $this->render('form_dci/arborescence/index.html.twig', array(\n 'categorieEntites' => $categorieEntites,\n 'sousCategorieEntites' => $sousCategorieEntites,\n 'marchandises' => $marchandises,\n 'operatSousCategs' => $operatSousCateg,\n 'consommateurs' => $consommateurs,\n ));\n }", "public function getStudentInformationDetailList($student_id){\n\t\t\t\n\t\t\t\t\t$sql=\"SELECT student.student_id,\n\t\t\t\t\t\t\t\tstudent.student_name,\n\t\t\t\t\t\t\t\tstudent.student_rollNo,\n\t\t\t\t\t\t\t\tsitexam_detail.total_mark,\n\t\t\t\t\t\t\t\tsitexam_detail.exam_status\n\t\t\t\t\t\tFROM sitexam_detail,student\n\t\t\t\t\t\tWHERE \tstudent.student_id=sitexam_detail.student_student_id AND\n\t\t\t\t\t\t\t\tstudent.student_id=:student_id \";\n\t\t\t\t\t\n\t\t\t\t\t$this->openDB();\n\t\t\t\t\t$this->prepareQuery($sql);\n\t\t\t\t\t$this->bindQueryParam(':student_id', $student_id);\n\t\t\t\t\t$result=$this->executeQuery();\n\t\t\t\t\treturn $result;\n\t\t\t\t}", "public function index()\n {\n //return view('students.index');\n $student = Student::with('carrera','telefonos','seguimiento')->get();\n\n return view(\"students.index\", compact('student'));\n }", "public function actionListSecondNavByTime()\n\t{\n\t\t$criteria = new CDbCriteria(array(\n\t\t\t'condition'=>'post_type=:post_type',\n\t\t\t'params'=>array('post_type'=>Post::POST_TYPE_NEWS),\n\t\t\t'with'=>array('commentCount', 'author', 'replyCount', 'fbLikeCount'),\n\t\t\t'order'=>'timestamp DESC',\n\t\t\t'limit'=>20,\n\t\t)); \n\t\n\t\t$dataProvider=new CActiveDataProvider('Post', array(\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>20,\n\t\t\t), \n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t\n\t\t$this->renderPartial(\"listSecondNav\", array(\"posts\"=>$dataProvider->getData()), false, true);\n\t}", "public function students()\n {\n return $this->hasMany('App\\Models\\Student');\n }", "public function index()\n {\n $student = DB::table('students')\n ->join('teachers', 'students.teacher_id', '=', 'teachers.id')\n ->select('students.*', 'teachers.teacher_name')\n ->orderBy('students.id', 'ASC')\n ->get();\n \n return view('admin.student_list',compact('student'));\n }", "public function index()\n {\n $forms = TransactionForm::orderBy('created_at', 'desc')->get();\n return view('student.home')->with('forms',$forms);\n }", "public function indexAction()\n {\n // (first) sub form\n\t\tZend_Session::namespaceUnset($this->_namespace);\t\t// Delete all former forms datas\n\t\t\n if (!$form = $this->getCurrentSubForm()) {\n $form = $this->getNextSubForm();\n }\n $this->view->form = $this->getForm()->prepareSubForm($form);\n }", "public function configureServicesFormStep2()\n {\n echo Twig::getTemplateContent(\n 'install/configureServicesFormStep2.twig',\n array(\n 'services' => $this->_servicesConfig,\n 'servicesNbFilesConfig' => $this->_servicesNbFilesConfig\n )\n );\n }", "public function listAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id);\n $form->get(\"numero\")->setAttribute(\"value\",0);\n $form->get(\"check2\")->setAttribute(\"value\",1);\n if($this->getRequest()->isPost()) \n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('numero'); // ------------------------------------- 2 CAMPOS A VALDIAR DEL FORMULARIO (C) \n // Fin validacion de formulario ---------------------------\n if ($form->isValid()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = new Retefuente($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $id = $u->actRegistro($data,$id); // Trae el ultimo id de insercion en nuevo registro \n // Agregar a los tipos de conceptos que afecta\n $f = new Retefuenten($this->dbAdapter);\n foreach ($data->idTnomm as $dato){\n $idTnom = $dato[0]; \n $f->actRegistro($idTnom,$id); \n } \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$data->id);\n // \n } \n }\n } \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter'); \n $d = New AlbumTable($this->dbAdapter); \n \n $datos = $d->getConnom();// Listado de conceptos\n $arreglo = '';\n foreach ($datos as $dat){\n if ($dat['valor']==1)\n $valor='HORAS'; else $valor='PESOS'; \n $idc=$dat['id'];$nom=$dat['nombre'].' ('.$valor.')';\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n \n $datos = $d->getEmp(\"\");// Listado de empleados\n $arreglo = '';\n foreach ($datos as $dat){\n $idc=$dat['id'] ; $nom = $dat['CedEmp'].' - '.$dat['nombre'].' '.$dat['apellido'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"idEmp\")->setValueOptions($arreglo); \n \n $form->get(\"tipo\")->setValueOptions(array( \"1\"=>\"Mensual (Procedimiento 1)\", \"2\"=>\"Anual (Procedimiento 2)\" )); \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\t\t\t\t\n $d->modGeneral(\"insert into a_empleados_rete (idEmp, tipo) values(\".$data->idEmp.\",\".$data->tipo.\" )\"); \n\n \n } \n } \n\n $valores=array\n (\n \"titulo\" => 'Empleados con retención en la fuente ',\n \"datos\" => $d->getGeneral(\"select a.id, a.porcentaje, case when a.tipo=2 \n then 'Anual (Procedimiento 2)' else 'Mensual (Procedimiento 1)' end as tipo,\n b.CedEmp, b.nombre, b.apellido, sum( c.id ) as numItem \n from a_empleados_rete a \n inner join a_empleados b on b.id = a.idEmp\n left join a_empleados_rete_d c on c.idEret = a.id \n group by a.id\"),// Listado de formularios \n \"ttablas\" => $this->ttab,\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form,\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "public function listStudents($db)\r\n {\r\n $sql = \"SELECT * FROM students\";\r\n\t\t$pst = $db->prepare($sql);\r\n\t\t$pst->execute();\r\n\t\t$s = $pst->fetchAll(PDO::FETCH_OBJ);\r\n return $s;\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $formations = $em->getRepository('AppBundle:Formation')->findAll();\n\n return $this->render('formation/index.html.twig', array(\n 'formations' => $formations,\n ));\n }", "public function getAllStudentsResults() {\n try {\n if(BaseController::isLoggedIn() && BaseController::isTeacher()) {\n $user = new UserModel();\n $user->id = BaseController::getUserId();\n $user_data = $user->getUserDataById();\n \n $student = new StudentModel();\n $results = $student->getAllStudentsResults();\n \n $model = array(\n 'user_data' => $user_data,\n 'results' => $results\n );\n BaseController::display(self::$controller . '/student-results.php', $model);\n } else {\n BaseController::load('user/login.php', array('error_description' => 'Изисква се регистрация.'));\n }\n } catch (Exception $e) {\n BaseController::load('error.php');\n }\n }", "public function actionIndex()\n {\n\n if (Yii::$app->user->can('permision_admin')) {\n # code...\n \n\n $searchModel = new AdminSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $staffSearchModel = new StaffDetailsSearch();\n $staff_dataProvider = $staffSearchModel->search(Yii::$app->request->queryParams);\n\n $studentSearchModel = new StudentAttachmentDetailsSearch();\n $student_dataProvider = $studentSearchModel->search(Yii::$app->request->queryParams);\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'staffSearchModel' => $staffSearchModel,\n 'staff_dataProvider'=> $staff_dataProvider,\n 'studentSearchModel'=> $studentSearchModel,\n 'student_dataProvider'=> $student_dataProvider,\n ]);\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager('db2');\n\n $outlets = $em->getRepository('BaseSynchronizeBundle:Outlet')->findAll();\n\n return $this->render('BaseSynchronizeBundle:Db2:Outlet/index.html.twig', array(\n 'outlets' => $outlets,\n ));\n }", "public function index()\n {\n $students = Student::all();\n return view('admin.student.index', compact('students'));\n }", "public function indexDiariaAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = new Consulta();\r\n $this->tipo=2;\r\n $form = $this->createCreateForm($entity,$this->tipo,0);\r\n //$entities = $em->getRepository('DGPlusbelleBundle:Consulta')->findAll();\r\n $dql = \"SELECT c FROM DGPlusbelleBundle:Consulta c WHERE c.tipoConsulta= :tipo\";\r\n $entities = $em->createQuery($dql)\r\n ->setParameter('tipo',1)\r\n ->getResult();\r\n //var_dump($entities);\r\n return array(\r\n 'entities' => $entities,\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'tipo' => 2,\r\n );\r\n }", "public function listobjetuserAction()\n {\n $user = $this->getUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $objets = $em->getRepository('AppBundle:Objet')->findBy(['user'=>$user], array('date' => 'desc'));\n $contacdejaenvoyer=$this->getDoctrine()->getManager()->getRepository('AppBundle:Contact')->findAll();\n\n\n return $this->render(':objet:listobjetutilisateur.html.twig', array(\n 'objets' => $objets,\n 'contactdejaenvoyer'=>$contacdejaenvoyer,\n 'user'=>$user,\n ));\n }", "public function index()\n { \n $model = new StudentModel();\n \n $data['students'] = $model->orderBy('id', 'DESC')->findAll();\n \n return $this->respond($data);\n }", "public function actionIndex($studentId)\n {\n $student = Student::findOne($studentId);\n if (!Yii::$app->user->can('viewStudent', ['student' => $student]))\n {\n Yii::$app->session->setFlash('error', 'Access denied.');\n return $this->redirect(['/student/index'], 403);\n }\n $searchModel = new StudentAddressSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n $dataProvider->query->where(['student_id' => $studentId]);\n $dataProvider->query->orderBy(['ord' => SORT_DESC]);\n return $this->render('index', [\n 'student' => $student,\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "public function manageStudents()\n {\n $studentArr = Student::all();\n return view('admin.manage.students', ['students' => $studentArr, 'count' => 0]);\n }", "public function index()\n {\n $students = Student::all();\n return view('backend.student.index',compact('students'));\n }", "public function showattendantAction() { \r\n \r\n $attendants = $this->getDoctrine()\r\n ->getRepository(Attendant::class)\r\n ->findAll();\r\n\r\n foreach ($attendants as $attendant) {\r\n $attendant->getStudent();\r\n }\r\n\r\n return $this->render('admin/admin-attendant/adminAttendantDashboard.html.twig', [\r\n 'attendants' => $attendants,\r\n ]);\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $rhEstructuraSalarios = $em->getRepository('ERPAdminBundle:RhEstructuraSalarios')->findAll();\n/*\n return $this->render('rhestructurasalarios/index.html.twig', array(\n 'rhEstructuraSalarios' => $rhEstructuraSalarios,\n ));*/\n \n $sql = \"SELECT p.id AS id, p.nombres AS nombre FROM rh_persona p\";\n $stm = $this->container->get('database_connection')->prepare($sql);\n $stm->execute();\n $ArrayPersona = $stm->fetchAll();\n \n return $this->render('ERPRrhhBundle:RrhhNominas:indexEstructuraSalario.html.twig', array(\n 'ArrayPersona' => $ArrayPersona,\n \n // 'form' => $form->createView(),\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $user = $this->container->get('security.token_storage')->getToken()->getUser();\n\n\n\n\n $reservationbooks = $em->getRepository('BooksBundle:Reservationbook')->findBy(array(\"idetd\"=>$user->getId()));\n\n return $this->render('reservationbook/index.html.twig', array(\n 'reservationbooks' => $reservationbooks,\n ));\n }" ]
[ "0.5846583", "0.5715635", "0.5564574", "0.54846174", "0.548438", "0.54769146", "0.5194779", "0.502834", "0.502834", "0.4999748", "0.4993989", "0.498639", "0.4930454", "0.4916865", "0.48926157", "0.48736125", "0.48377833", "0.48259372", "0.48016468", "0.48008186", "0.478684", "0.4760195", "0.47584903", "0.47554183", "0.47435415", "0.4738163", "0.47362354", "0.4729491", "0.47218508", "0.47137353", "0.4713732", "0.47009256", "0.46907365", "0.46851796", "0.46835697", "0.46792847", "0.46700093", "0.46675304", "0.4665329", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46542144", "0.46404427", "0.46286404", "0.4627515", "0.46270946", "0.46206093", "0.46198994", "0.46189296", "0.45972642", "0.4593855", "0.4577237", "0.45582438", "0.45548356", "0.45460182", "0.45381263", "0.4532145", "0.45291874", "0.45244017", "0.45241964", "0.45217672", "0.45062476", "0.45044833", "0.45037064", "0.44859907", "0.4483478", "0.44832394", "0.44824666", "0.44819328", "0.44799128", "0.44771954", "0.44770753", "0.44651052", "0.44602615", "0.4457423", "0.44571987", "0.4453097", "0.44496426", "0.44467863", "0.44434357", "0.44411445", "0.44397324", "0.44390085", "0.44384125", "0.44376856", "0.4427668", "0.4425259", "0.44148445", "0.441339" ]
0.7794391
0
Creates a form to delete a studentFormTwo entity.
private function createDeleteForm(StudentFormTwo $studentFormTwo) { return $this->createFormBuilder() ->setAction($this->generateUrl('studentformtwo_delete', array('id' => $studentFormTwo->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm(Home2 $home2)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('home2_delete', array('id' => $home2->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Evennements $evennement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('evennements_delete', array('id' => $evennement->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Superficie $superficie)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('superficie_delete', array('id' => $superficie->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(evenement $evenement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('evenement_delete', array('id_evenement' => $evenement->getId_evenement())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(SvCfgDisenio $SvCfgDisenio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('Svcfgdisenio_delete', array('id' => $SvCfgDisenio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Evenement $evenement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('evenement_delete', array('idevenement' => $evenement->getIdevenement())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Evenement $evenement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_evenement_delete', array('id' => $evenement->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(FormulaireSecours $formulaireSecour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('formulairesecours_delete', array('id' => $formulaireSecour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Scenaristes $scenariste)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('scenaristes_delete', array('id' => $scenariste->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Demandeevenement $demandeevenement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('demandeevenement_delete', array('iddemandeevenement' => $demandeevenement->getIddemandeevenement())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Solicitud $solicitud)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tienda_solicitud_delete', array('id' => $solicitud->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(CvCdoComparendo $cvCdoComparendo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cvcdocomparendo_delete', array('id' => $cvCdoComparendo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Workout1 $workout1)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('workout1_delete', array('id' => $workout1->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Stammdaten $stammdaten)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('stammdaten_delete', array('id' => $stammdaten->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(WebSearch $webSearch, $forceDeleteForm=false) {\n $id = $webSearch->getId();\n $isMailEnabled = $webSearch->getUserSearch()->isMailEnabled();\n $method = ($isMailEnabled && !$forceDeleteForm) ? 'GET' : 'DELETE';\n $action = ($isMailEnabled && !$forceDeleteForm) ? 'viteloge_frontend_websearch_remove' : 'viteloge_frontend_websearch_delete';\n return $this->createFormBuilder()\n ->setAction($this->generateUrl($action, array('id' => $id)))\n ->setMethod($method)\n ->add('submit', 'submit', array('label' => 'websearch.action.delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Babysitter $babysitter)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('babysitter_delete', array('idbabysitter' => $babysitter->getIdbabysitter())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function deleteForm()\n\t{\n\t\t$form = new \\IPS\\Helpers\\Form( 'form', 'delete' );\n\t\t$form->addMessage( 'node_delete_blurb_no_content' );\n\t\t\n\t\treturn $form;\n\t}", "private function createDeleteForm(Bien $bien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('backend_bien_delete', array('id' => $bien->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(districts $district)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('districts_delete', array('id' => $district->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Site $site)\n {\n return $this->createFormBuilder(['id' => $site->getId()])\n ->add('id', 'hidden')\n ->getForm();\n }", "private function createDeleteForm(SysEduc $sysEduc)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('syseduc_delete', array('id' => $sysEduc->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RelationUserEntite $relationUserEntite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('relationuserentite_delete', array('id' => $relationUserEntite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function student_form_delete() {\n $id = arg(1);\n $num_deleted = db_delete('student')\n ->condition('st_id', $id)\n ->execute();\n if ($num_deleted) {\n drupal_set_message(t('entry has been deleted.'));\n drupal_goto(\"formlist\");\n }\n else {\n drupal_set_message(t('error in query'));\n }\n}", "private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Paragenese $paragenese)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('paragenese_delete', array('id' => $paragenese->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(JobDetails $jobDetail)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('jobpost_delete', array('id' => $jobDetail->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Estadosciviles $estadoscivile)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('estadosciviles_delete', array('idEstadocivil' => $estadoscivile->getIdestadocivil())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Proeflessen $proeflessen)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_proeflessen_delete', array('id' => $proeflessen->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Actualites $actualite)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('actualites_delete', array('id' => $actualite->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }", "private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Plateformes $plateforme)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administration_plateformes_delete', array('id' => $plateforme->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $studentFormTwos = $em->getRepository('AppBundle:StudentFormTwo')->findAll();\n\n return $this->render('studentformtwo/index.html.twig', array(\n 'studentFormTwos' => $studentFormTwos,\n ));\n }", "private function createDeleteForm(BulletinSoin $bulletinSoin)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bs_delete', array('id' => $bulletinSoin->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}", "private function createDeleteForm(Eventos $evento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eventos_delete', array('id' => $evento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm( $entityName, $instance)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entity_delete',\n [\n 'entityName' => $entityName,\n 'id' => $instance->getId()\n ]))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Socialnetwork $socialnetwork)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_socialnetwork_delete', array('id' => $socialnetwork->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Survey $survey) {\n return $this->createFormBuilder(array(), array('csrf_token_id' => 'authenticate'))\n ->setAction($this->generateUrl('survey_delete', array('id' => $survey->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(GrupoDiagnostico $grupoDiagnostico)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('grupodiagnostico_delete', array('id' => $grupoDiagnostico->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }", "private function createDeleteForm(CmsStzefBanners $cmsStzefBanner)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admstzef_banners_delete', array('id' => $cmsStzefBanner->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}", "private function createDeleteForm(SvCfgSenialTipo $svCfgSenialTipo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('svcfgsenialtipo_delete', array('id' => $svCfgSenialTipo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(Indicateur $indicateur) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('indicateur_delete', array('id' => $indicateur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsproduits_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm1($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('calendarcategories_delete', array('id' => $id)))\n ->setMethod('DELETE')\n /* ->add('submit', 'submit', array('label' => 'Delete')) */\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }", "private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(TblCursosDocentes $tblCursosDocente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tblcursosdocentes_delete', array('id' => $tblCursosDocente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(DetailsMission $detailsMission)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsmission_delete', array('id' => $detailsMission->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Tipocaso $tipocaso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipocaso_delete', array('idTipo' => $tipocaso->getIdtipo())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Cancion $cancion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cancion_delete', array('id' => $cancion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Entrepot $entrepot)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entrepot_delete', array('idEntrepot' => $entrepot->getIdentrepot())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(NatureOp $priorite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_natureop_delete', array('id' => $priorite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Mensajes $mensaje)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mensajes_delete', array('id' => $mensaje->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(form $form)\n {\n //\n }", "private function createDeleteForm(News $news) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('news_delete', array('id' => $news->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }", "private function createDeleteForm(Site $site)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_report_site_delete', array('id' => $site->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Caso $caso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caso_delete', array('id' => $caso->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ProduitStocke $produitStocke)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('business_produitstocke_delete', array('id' => $produitStocke->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Musicien $musicien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('musicien_delete', array('codeMusicien' => $musicien->getCodemusicien())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($lessonId) {\n return $this->createFormBuilder(array('$lessonId' => $lessonId))\n ->add('lessonId', 'hidden')\n ->getForm()\n ;\n }", "private function createDeleteForm(DatParteDesvio $datParteDesvio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partedesvio_delete', array('id' => $datParteDesvio->getIdparte())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Entreprise $entreprise)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('entreprise_delete', array('id' => $entreprise->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(TSchool $tSchool)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('kuakao_admin_school_delete', array('id' => $tSchool->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(news $news) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('news_delete', array('idNews' => $news->getIdnews())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(SettingsLlojiMbulesesBimore $settingsLlojiMbulesesBimore)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('settingsllojimbulesesbimore_delete', array('id' => $settingsLlojiMbulesesBimore->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "protected function createDeleteForm($stock): Form\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl($this->getEntityCRUDRoute('delete'), array('id' => $stock->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Torniquete $torniquete)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('torniquete_delete', array('id' => $torniquete->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(ManejoReproductivo $manejoReproductivo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('manejoreproductivo_delete', array('id' => $manejoReproductivo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('social_admin_resource_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => '删除','attr'=>[\n 'class'=>'btn btn-danger'\n ]))\n ->getForm()\n ;\n }", "private function createDeleteForm(Demandados $demandado)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('demandados_delete', array('id' => $demandado->getIdDemandado())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Registro $registro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('registro_delete', array('id' => $registro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Extra $extra)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('extra_delete', array('id' => $extra->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Stable $stable)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('stable_delete', array('id' => $stable->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function testDeleteForm() {\n $document = $this->createDocument();\n\n $document_name = $document->id();\n\n // Log in and check for existence of the created document.\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/structure/legal');\n $this->assertRaw($document_name, 'Document found in overview list');\n\n // Delete the document.\n $this->drupalPostForm('admin/structure/legal/manage/' . $document_name . '/delete', [], 'Delete');\n\n // Ensure document no longer exists on the overview page.\n $this->assertUrl('admin/structure/legal', [], 'Returned to overview page after deletion');\n $this->assertNoText($document_name, 'Document not found in overview list');\n }", "private function createDeleteForm(frontend_about $frontend_about)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('frontend_about_delete', array('id' => $frontend_about->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Wino $wino)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('wino_delete', array('id' => $wino->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(MsvTalonario $msvTalonario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('msvtalonario_delete', array('id' => $msvTalonario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(RhEstructuraSalarios $rhEstructuraSalario)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rhestructurasalarios_delete', array('id' => $rhEstructuraSalario->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Record $record)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eval_record_delete', array('id' => $record->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "function print_delete_form($stu) {\n $url = 'index.php';\n $message = get_string('student_deleteconfirm', 'block_curr_admin', cm_fullname($stu->user));\n $optionsyes = array('s' => 'stu', 'section' => 'curr', 'id' => $stu->classid,\n 'action' => 'confirm', 'association_id' => $stu->id, 'confirm' => md5($stu->id));\n $optionsno = array('s' => 'stu', 'section' => 'curr', 'id' => $stu->classid);\n\n echo cm_delete_form($url, $message, $optionsyes, $optionsno);\n }", "private function createDeleteForm(Projecte $projecte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('projecte_delete', array('id' => $projecte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "public function destroy(Form $form)\n {\n //\n }", "public function destroy(Form $form)\n {\n //\n }", "private function createDeleteForm(Nomenclature $nomenclature)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_delete', array('id' => $nomenclature->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(news $news)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('news_delete', array('id' => $news->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Recette $recette)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recette_delete', array('id' => $recette->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Barbeiro $barbeiro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('barbeiro_delete', array('id' => $barbeiro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(News $news)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('news_delete', array(\n 'id' => $news->getId(),\n )))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(Souscripteur $souscripteur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('souscripteur_delete', array('id' => $souscripteur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm(User $user)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('seniorManager_user_delete', array('id' => $user->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "private function createDeleteForm(Personnage $personnage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnage_delete', array('id' => $personnage->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('behalf_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }", "private function createDeleteForm(ClasseMatiere $classeMatiere)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('class_mat_delete', array('id' => $classeMatiere->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }", "private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('com_incident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;')))\n ->getForm()\n ;\n }", "private function createDeleteForm(SettingsVjeljaDestinacioni $settingsVjeljaDestinacioni)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('settingsvjeljadestinacioni_delete', array('id' => $settingsVjeljaDestinacioni->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }" ]
[ "0.6539146", "0.64388645", "0.61114585", "0.6051461", "0.604617", "0.6043469", "0.60358983", "0.5972294", "0.5925419", "0.59220535", "0.58371", "0.57747704", "0.5770898", "0.57689077", "0.5756471", "0.57539374", "0.57328975", "0.56994873", "0.569418", "0.56732374", "0.56580347", "0.56577885", "0.5656994", "0.5653705", "0.5647265", "0.56406176", "0.56347865", "0.5624804", "0.56194454", "0.56186557", "0.56174976", "0.5617423", "0.5615437", "0.5610903", "0.5609206", "0.56020373", "0.55997974", "0.55966", "0.5592324", "0.5590234", "0.5576751", "0.55687934", "0.5566595", "0.5556996", "0.55562717", "0.55494875", "0.5543674", "0.5542221", "0.5534719", "0.5532832", "0.552672", "0.5524212", "0.5521033", "0.551292", "0.5502922", "0.550214", "0.5486971", "0.54858476", "0.54795486", "0.54774064", "0.54761666", "0.54703486", "0.5458546", "0.5454143", "0.54535013", "0.5448386", "0.5445904", "0.5438036", "0.5437209", "0.54261047", "0.54160315", "0.5413773", "0.54123324", "0.540554", "0.5399763", "0.53970265", "0.5387815", "0.5383212", "0.5379796", "0.53773606", "0.53706497", "0.53698814", "0.53684294", "0.53683573", "0.536817", "0.53675526", "0.5357516", "0.5357516", "0.53557235", "0.5354713", "0.5350789", "0.5347308", "0.534555", "0.53450066", "0.5344782", "0.5344301", "0.533667", "0.53361887", "0.5334789", "0.53320605" ]
0.8766193
0
Fetches the given message from the storage. It returns null if no message is found.
public function get($messageId) { if (!isset($this->messages[$messageId])) { return null; } return new OutboxMessage($messageId, $this->messages[$messageId]->getTransportOperations()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function fetchMessage(): ?Envelope\n {\n $deliveryId = $this->codec->encodeBinary(Uuid::uuid4());\n $result = $this->select\n ->setParameter('delayedUntil', new DateTimeImmutable(), Types::DATETIMETZ_IMMUTABLE)\n ->executeQuery()\n ->fetchAssociative();\n\n if (! $result) {\n return null;\n }\n\n $id = $result['id'];\n if (is_resource($id)) {\n $id = stream_get_contents($id);\n }\n\n $this->update\n ->setParameter('deliveryId', $deliveryId, ParameterType::BINARY)\n ->setParameter('redeliverAfter', new DateTimeImmutable('+5 minutes'), Types::DATETIMETZ_IMMUTABLE)\n ->setParameter('messageId', $id, ParameterType::BINARY);\n\n if ($this->update->executeStatement()) {\n /** @phpstan-var array{body: string, headers: string, id: string|resource, time_to_live: string}|false $deliveredMessage */\n $deliveredMessage = $this->connection->createQueryBuilder()\n ->select('body', 'headers', 'id', 'time_to_live')\n ->from($this->tableName)\n ->andWhere('delivery_id = :deliveryId')\n ->setParameter('deliveryId', $deliveryId, ParameterType::BINARY)\n ->setMaxResults(1)\n ->executeQuery()\n ->fetchAssociative();\n\n // the message has been removed by a 3rd party, such as truncate operation.\n if ($deliveredMessage === false) {\n return null;\n }\n\n if (\n empty($deliveredMessage['time_to_live']) ||\n new DateTimeImmutable($deliveredMessage['time_to_live']) > new DateTimeImmutable()\n ) {\n return $this->hydrate($deliveredMessage);\n }\n }\n\n return null;\n }", "public function fetchMessageFromQueue()\n {\n $whereParams = [\n 'status' => 'PENDING',\n ];\n $orderBy = 'attempts';\n return $this->db->first($this->table, $whereParams, $orderBy);\n\n }", "public function find(string $event, string $id): ?Message\n {\n return $this->items[$event][$id] ?? null;\n }", "private function retrieveMessage() : ?string {\n $message = [];\n\n // The regex to find the head of the message wrapper (message lies between head and foot wrapper)\n $messageHeadWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD ,\n self::REGEX_MESSAGE_WRAPPER_BODY,\n \"(\\s{2})\"\n ], \"\", \"\");\n\n // The regex to find the foot of the message wrapper (message lies between head and foot wrapper)\n $messageFootWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD,\n self::REGEX_MESSAGE_WRAPPER_BODY\n ], \"\", \"\");\n\n // The regex for querying the message, including its queried wrapper\n $messageRegex = $this->buildRegex([\n $messageHeadWrapperRegex,\n self::REGEX_ALL,\n $messageFootWrapperRegex\n ]);\n\n // Querying the message\n preg_match($messageRegex, $this->currentEmail, $message);\n\n // If the message not found, there is most likely no message, so return null\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n if (!isset($message[4]))\n return null;\n\n // Return the quoted-printable decoded and trimmed message\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n $message = quoted_printable_decode($message[4]);\n return trim($message);\n }", "public function readone() {\n\t\t$msg = Core_Ipc_Messages::find(['stream' => md5($this->stream)], ['limit' => 1, 'order' => 'msgid']);\n\t\tif(empty($msg)) {\n\t\t\treturn false;\n\t\t}\n\t\t$msg->delete();\n\t\treturn $msg->instance;\n\t}", "public function find(string $id) : ?Message\n {\n $resp = DB::table($this->TABLE)->where(self::ID, $id)->orderBy(self::DATE, self::ASC)->first();\n return $this->load($resp);\n }", "public function getmessage()\n {\n return array_shift($this->storage);\n }", "public function get($messageType = false) {\n if ( empty($this->_queue) ) {\n return false;\n }\n\t\t\n\t\tif(false === $messageType)\n\t\t{\n\t\t\t$crcMessageType = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crcMessageType = sprintf(\"%u\", crc32($messageType));\n\t\t}\n\n\n $stat = $this->getStats();\n if ( $stat['msg_qnum'] > 0 ) {\n if ( true !== msg_receive($this->_queue, $crcMessageType , $msgtype_real, $this->_maxSize, $message, $this->_serialize, $this->_receiveOpt, $err) ) {\n $this->_lastError = $err;\n return false;\n }\n return $message;\n }\n return false;\n }", "function get_message($id_message)\n\t{\n\t\t$this->ci->db->select('*');\n\t\t$this->ci->db->where('am_id', $id_message);\n\t\t$query = $this->ci->db->get('auth_message');\n\t\tif($query->num_rows() != 0)\n\t\t{\n\t\t\t$data = $query->row()->am_message;\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function findMessage($criteria = null)\n {\n if (!($criteria instanceof MessageCriteria)) {\n $criteria = new MessageCriteria($criteria);\n }\n\n $criteria->limit = 1;\n $messages = $this->findMessages($criteria);\n\n if (is_array($messages) && !empty($messages)) {\n return array_pop($messages);\n }\n\n return null;\n }", "public function update(?Message $message): ?Message;", "public function fetch() {\r\n $atomic = !$this->in_transaction();\r\n if ($atomic) {\r\n $this->transaction_start();\r\n }\r\n $shm_id = $this->_open_existing();\r\n $result = '';\r\n if ($shm_id) {\r\n $result = shmop_read($shm_id, 0, shmop_size($shm_id));\r\n shmop_close($shm_id);\r\n }\r\n if ($atomic) {\r\n $this->transaction_finish();\r\n }\r\n return $result;\r\n }", "public function getByID($messageID)\n {\n return $this->dao->select('*')->from(TABLE_MESSAGE)->findByID($messageID)->fetch();\n }", "public function getFirstMessage(): ?MessageInterface;", "public function read(): ?object\n {\n if ($identity = $this->storage->read()) {\n return $this->objectRepository->find($identity);\n }\n return null;\n }", "public static function get($message){\n\n $messageArray = self::formatMessage($message);\n $retrieved = self::retrieveLang($messageArray);\n return $retrieved;\n }", "public function receiveNoWait()\n {\n if ($this->currentEnvelope) {\n throw new \\RuntimeException(\n 'AmqpQueueDriver: This driver has a message that was not acknowledged yet. A message must be processed and acknowledged before receiving new messages.'\n );\n }\n\n $this->dequeueingTimeMs = 0;\n\n $this->currentEnvelope = $this->queue->get();\n\n $msg = null;\n\n if (!$this->currentEnvelope) {\n return null;\n }\n\n $start = microtime(true);\n $deserializationContext = new DeserializationContext();\n\n try{\n /** @var QueueMessageInterface $msg */\n $msg = $this->getSerializer()->deserialize($this->currentEnvelope->getBody(), SerializableInterface::class, $this->format, $deserializationContext);\n } catch (\\Exception $exception) {\n $this->getExceptionHandler()($exception, ['headers' => $this->currentEnvelope->getHeaders(), 'body' => $this->currentEnvelope->getBody()]);\n $this->ack();\n return null;\n }\n foreach ($this->currentEnvelope->getHeaders() as $header => $value) {\n $msg->setHeader($header, $value);\n }\n\n // Calculate how long it took to deserilize the message\n $this->dequeueingTimeMs = (int) ((microtime(true) - $start) * 1000);\n\n return $msg;\n }", "abstract public function get_message();", "public function retrieve()\r\n {\r\n if ($this->storage) {\r\n $this->storage->retrieve($this->messages);\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public function getMessage(): ?string\n {\n return $this->message;\n }", "protected function _load(object $dump) : ?Message\n {\n if (!$dump){\n return null;\n }\n\n return new Message(\n $dump->text,\n $dump->date,\n $dump->senderID,\n $dump->recipientID,\n $dump->id\n );\n }", "public function retrieve($key) {\n if ($this->memcache !== NULL) {\n $value = $this->memcache->get($key);\n if ($value !== false) {\n return $value;\n }\n } \n return null;\n }", "public function get($parameter) {\n $parameter = trim(strtoupper($parameter));\n\n if (array_key_exists($parameter, $this->message)) {\n return $this->message[$parameter];\n }\n else {\n return NULL;\n }\n }", "public function getMessage($key = null)\n {\n $messageList = self::$messages;\n\n if (null === $key) {\n return $messageList;\n }\n\n return isset($messageList[$key]) ? $messageList[$key] : null;\n }", "public function getMessage():? string\n {\n return $this->message;\n }", "private function retrieve_message($message_idnr, $folder, $message_data = FALSE, $getBody = TRUE) {\n\n /*\n * Get cached contents\n */\n $rcmh_cached_key = \"MSG_\" . $message_idnr;\n $rcmh_cached = $this->get_cache($rcmh_cached_key); //= null;\n\n /*\n * Checklist:\n * - Is the object in cache a valid object?\n * - Do we need (and do we have) the message body?\n */\n if (is_object($rcmh_cached) &&\n (!$getBody || isset($rcmh_cached->structure))) {\n\n /*\n * If we're in the message list we certainly have an up-to-date message listing\n */\n if (is_array($message_data)) {\n\n $rcmh_cached->folder = $message_data['folder_record']['name'];\n $rcmh_cached->flags[\"SEEN\"] = ($message_data['seen_flag'] == 1 ? TRUE : FALSE);\n $rcmh_cached->flags[\"ANSWERED\"] = ($message_data['answered_flag'] == 1 ? TRUE : FALSE);\n $rcmh_cached->flags[\"DELETED\"] = ($message_data['deleted_flag'] == 1 ? TRUE : FALSE);\n $rcmh_cached->flags[\"FLAGGED\"] = ($message_data['flagged_flag'] == 1 ? TRUE : FALSE);\n $rcmh_cached->flags[\"FORWARDED\"] = $this->get_keyword($message_idnr, self::KEYWORD_FORWARDED);\n $rcmh_cached->flags[\"SKIP_MBOX_CHECK\"] = TRUE;\n }\n\n return $rcmh_cached;\n }\n\n /*\n * Get message data (if not supplied)\n */\n if (!$message_data) {\n\n /*\n * Get message properties\n */\n $message_record = $this->get_message_record($message_idnr);\n if (!$message_record) {\n // Not found!\n return FALSE;\n }\n\n /*\n * Ok - prepare message data array\n */\n $message_data = array(\n 'message_idnr' => $message_record[\"message_idnr\"],\n 'unique_id' => $message_record[\"unique_id\"],\n 'physmessage_id' => $message_record['physmessage_id'],\n 'message_size' => $message_record[\"messagesize\"],\n 'seen_flag' => $message_record[\"seen_flag\"],\n 'answered_flag' => $message_record[\"answered_flag\"],\n 'deleted_flag' => $message_record[\"deleted_flag\"],\n 'flagged_flag' => $message_record[\"flagged_flag\"],\n 'folder_record' => array(\n 'name' => $folder\n ),\n 'mailbox_idnr' => $message_record['mailbox_idnr']\n );\n }\n\n // extract mime parts\n $mime = $this->fetch_part_lists($message_data['physmessage_id']);\n\n // prepare response\n $rcmh = new rcube_message_header();\n $rcmh->id = $message_idnr;\n $rcmh->uid = $message_idnr;\n $rcmh->folder = $message_data['folder_record']['name'];\n $rcmh->subject = $this->get_header_value($mime->header, 'Subject');\n $rcmh->from = $this->get_header_value($mime->header, 'From');\n $rcmh->to = $this->get_header_value($mime->header, 'To');\n $rcmh->cc = $this->get_header_value($mime->header, 'Cc');\n $rcmh->bcc = $this->get_header_value($mime->header, 'Bcc');\n $rcmh->replyto = $this->get_header_value($mime->header, 'Reply-To');\n $rcmh->in_reply_to = $this->get_header_value($mime->header, 'In-Reply-To');\n $rcmh->ctype = $this->get_header_value($mime->header, 'Content-Type');\n $rcmh->references = $this->get_header_value($mime->header, 'References');\n $rcmh->mdn_to = $this->get_header_value($mime->header, 'Return-Receipt-To');\n $rcmh->priority = $this->get_header_value($mime->header, 'X-Priority');\n $rcmh->date = $this->get_header_value($mime->header, 'Date');\n $rcmh->internaldate = $this->get_header_value($mime->header, 'Date');\n $rcmh->messageID = $this->get_header_value($mime->header, 'Message-ID');\n $rcmh->size = $message_data[\"message_size\"];\n $rcmh->timestamp = time();\n $rcmh->flags[\"SEEN\"] = ($message_data['seen_flag'] == 1 ? TRUE : FALSE);\n $rcmh->flags[\"ANSWERED\"] = ($message_data['answered_flag'] == 1 ? TRUE : FALSE);\n $rcmh->flags[\"DELETED\"] = ($message_data['deleted_flag'] == 1 ? TRUE : FALSE);\n $rcmh->flags[\"FLAGGED\"] = ($message_data['flagged_flag'] == 1 ? TRUE : FALSE);\n $rcmh->flags[\"SKIP_MBOX_CHECK\"] = TRUE;\n\n if ($getBody) {\n\n $mime_decoded = $this->decode_raw_message($mime->header . $mime->body);\n if (!$mime_decoded) {\n return FALSE;\n }\n\n $rcmh->structure = $this->get_structure($mime_decoded);\n }\n\n // update cached contents\n $this->update_cache($rcmh_cached_key, $rcmh);\n\n return $rcmh;\n }", "public function get($message, $params = null, $class = null)\n {\n // TODO: Remove..\n if (is_array($message)) {\n Resource::getLogger()->warning('Method get not be array', __FILE__, __LINE__);\n }\n\n /** @var string $message */\n /** @var Core $class */\n $resource = isset($class)\n ? $class::getResource()->_resource\n : $this->_resource;\n\n if (!isset($class)) {\n $class = $this->_class;\n }\n\n if (empty($resource[$message])) {\n $resource = self::update($message, $class);\n }\n\n $locale = Request::locale();\n\n if (isset($resource[$message][$locale])) {\n $message = $resource[$message][$locale];\n }\n\n return Replace::getInstance()->fetch($message, (array)$params, View_Render::TEMPLATE_TYPE_STRING);\n }", "public function retrieve($key) {\n $value = $this->_memcache->get($key);\n if ($value === false) $value = null;\n return $value;\n }", "public function getMessage( $id )\n\t{\n\t\t$message = Message::where( 'id', $id )->value('message');\n\t\treturn $message;\n\t}", "public function getById($id)\n\t{\n\t\treturn Message::findOne(\"user_id=? AND id=?\", [$this->user_id, $id]);\n\t}", "public function getMessage($id) {\n\t\tif (!array_key_exists($id, $this -> messages)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> messages[$id];\n\t}", "function getMessage($msg_id) {\n\t\tif (!$msg_id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn db_query_params ('SELECT * FROM artifact_message_user_vw WHERE id=$1',\n\t\t\tarray($msg_id));\n\t}", "static function getById($messageId)\n {\n $query = Message::where('id', $messageId);\n $query = MessageRepository::addRoleCheckToQuery($query);\n\n return $query->first();\n }", "public function getLastMessage(): ?MessageInterface;", "public function readMessage($id) {\n\t\t$response = null;\n\t\tif ($id) {\n\t\t\t$urlMessage = \"{$this->apiHost}/read_message\";\n\t\t\t$postData = sprintf ( \"id=%s&uh=%s\", $id, $this->modHash );\n\t\t\t$response = $this->runCurl ( $urlMessage, $postData );\n\t\t}\n\t\treturn $response;\n\t}", "public function getMessage() {\n if ($this->message instanceof MessageInterface) {\n return $this->message;\n }\n return $this->mesage = new SmsMessageModel();\n }", "function get($msg_index) {\n if (isset($this->inbox[$msg_index])) \n {\n return $this->inbox[$msg_index];\n }else\n {\n return false;\n }\n }", "public function getMediaByMessage(array $data = []): string\n {\n return $this->sendCurl('get', __FUNCTION__, $data, 'messageId');\n }", "public function getMessage( $key, $code ) {\n\t\t$title = Title::makeTitle( $this->getNamespace(), $key );\n\t\t$handle = new MessageHandle( $title );\n\t\t$groupId = MessageIndex::getPrimaryGroupId( $handle );\n\t\tif ( $groupId === $this->getId() ) {\n\t\t\t// Message key owned by aggregate group.\n\t\t\t// Should not ever happen, but it does.\n\t\t\terror_log( \"AggregateMessageGroup $groupId cannot be primary owner of key $key\" );\n\n\t\t\treturn null;\n\t\t}\n\n\t\t$group = MessageGroups::getGroup( $groupId );\n\t\tif ( $group ) {\n\t\t\treturn $group->getMessage( $key, $code );\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function read(): object|null\n {\n $identity = $this->options->getStorage()->read();\n if ($identity) {\n return $this->options->getObjectRepository()->find($identity);\n }\n\n return null;\n }", "static function getSingleMessage($key = 'id', $value = 0)\r\n {\r\n if ($value === '')\r\n {\r\n return null;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n\r\n $query = \"SELECT $tableMessage.*\r\n FROM $tableMessage \r\n WHERE $tableMessage.$key = '$value'\";\r\n\r\n if ($value2 !== '')\r\n {\r\n $query = $query . \" AND $tableMessage.$key2 = '$value2'\";\r\n }\r\n\r\n $myMessage = DatabaseManager::singleFetchAssoc($query);\r\n $myMessage = self::ArrayToMessage($myMessage);\r\n\r\n return $myMessage;\r\n }", "public function latestMessage()\n {\n return $this->hasOne('App\\Message', 'conversation_id')->latest();\n }", "public function receiveNoWait(): ?Message;", "public function checkMessage(){\r\n \t\t// checking message\r\n \t\t$message_id = $this->_request->getParam(\"message_id\");\r\n \t\t// check id param for project\r\n \t\tif(!is_numeric($message_id)){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => 'This FloBox message is not found, are you trying to hack us? :D '));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t\t \r\n \t\ttry{\r\n \t\t\treturn $this->facadeFlobox->findOneMessage($this->_member_id,$message_id);\r\n \t\t}catch(\\Exception $e){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => $e->getMessage()));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t}", "public function getMessage(): ?string;", "public function getMessage(): ?string;", "public function getMessage()\n {\n if (is_null($this->message)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_MESSAGE);\n if (is_null($data)) {\n return null;\n }\n $this->message = (string) $data;\n }\n\n return $this->message;\n }", "public function fetch() {\r\n $h = null;\r\n if (isset($this->handle)) {\r\n $h = $this->handle;\r\n }\r\n else {\r\n $h = $this->_open();\r\n flock($h, LOCK_SH); // shared lock for reading\r\n }\r\n fseek($h,0);\r\n $result = '';\r\n while (!feof($h)) {\r\n $result .= fread($h, 8192);\r\n }\r\n if (is_null($this->handle)) {\r\n flock($h, LOCK_UN);\r\n fclose($h);\r\n }\r\n return $result;\r\n }", "public function getMessage()\n {\n if (array_key_exists(\"message\", $this->_propDict)) {\n if (is_a($this->_propDict[\"message\"], \"\\Beta\\Microsoft\\Graph\\Model\\ItemBody\") || is_null($this->_propDict[\"message\"])) {\n return $this->_propDict[\"message\"];\n } else {\n $this->_propDict[\"message\"] = new ItemBody($this->_propDict[\"message\"]);\n return $this->_propDict[\"message\"];\n }\n }\n return null;\n }", "public function fetchOne() {\r\n\t\t$data = $this->fetch();\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $data ? current($data) : null;\r\n\t}", "public function getLatestMessageOfType($type)\n {\n if (!$this->isInDB()) {\n return null;\n }\n return $this->Messages()\n ->filter('ClassName', $type)\n ->first();\n }", "public function receive(int $timeout = 0): ?Message;", "public function getMessagePart(): ?MessagePart\n {\n return $this->messagePart;\n }", "public function pullTransientMessage(): object|array;", "public function get($identifier) {\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = (array) $GLOBALS['TSFE']->fe_user->getKey('ses', $this->namespace);\n\t\t}\n\t\tif (isset($this->data[$identifier])) {\n\t\t\treturn $this->data[$identifier];\n\t\t}\n\n\t\treturn NULL;\n\t}", "public static function findById(int $id): Message {\n $db = Database::getPDOConnection();\n $stmt = $db->prepare('SELECT * FROM `messages` WHERE `id` = :id');\n $stmt->execute(['id' => $id]);\n $row = $stmt->fetch();\n if (!$row) {\n throw new MessageNotFoundException(sprintf('no message with id \\'%d\\' exists', $id));\n }\n $message = Message::fromDBRecord($row, $db);\n return $message;\n }", "function getInboxMessage() {\n $sql = \"SELECT * FROM `mail` WHERE receiver_id = ?\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function current()\n {\n // if the iterator is no longer valid, return null\n if (!$this->valid()) {\n return null;\n }\n if (!isset($this->payloads[$this->currentKey])) {\n $this->payloads[$this->currentKey] = $this->processMessage($this->messages[$this->currentKey]);\n }\n return $this->payloads[$this->currentKey];\n }", "public function actionFetchMessages() {\n\t\ttry {\n\t\t\treturn $this->getService('SupportMessage')->fetchMessages();\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->sendError('You have reached error');\n\t\t}\n\t}", "function messageInfo(){\n\t\tinclude 'config/dbconfig.php';\n\t\t\n\t\t// query to Get Message details\n\t\t$mquery = \"SELECT *\n\t\t\t\t FROM cse_messages \";\n\n\t\t// prepare the query\n\t\t$mstmt = $conn->prepare($mquery);\n\t\t$mstmt->execute();\n\t\t// get number of rows\n\t\t$mnum = $mstmt->rowCount();\n\t\t// if Message exists,\n\t\tif($mnum>0){\n\t\t\t\t// get record details / values\n\t\t\t\t$mrow = $mstmt->fetchAll(PDO::FETCH_CLASS, 'Message');\n\t\t\t\t// return object\n\t\t\t\treturn $mrow;\n\t\t}\n\t}", "public function getMessage() : ?string\n {\n $rtn = $this->data['message'];\n\n return $rtn;\n }", "public function getMessage( $data ) \n {\n return $data->message;\n }", "public static function findByOfflineMsg($offlineMsg)\n {\n $db = Zend_Registry::get('dbAdapter');\n\n $query = $db->select()\n ->from( array(\"m\" => \"main\") ) \n ->where( \"m.offlineMsg = \" . $offlineMsg );\n\n return $db->fetchRow($query); \n }", "protected function getMsg( $msgId )\n\t{\n\t\t$msgText = wfMsgExt( $msgId );\n\t\t\n\t\tif ( wfEmptyMsg( $msgId, $msgText ))\n\t\t\treturn null;\n\t\t\t\n\t\treturn $msgText;\t\t\t\n\t}", "public function getMessage()\n {\n if ($this->message) {\n return $this->message;\n }\n\n return $this->newMessage();\n }", "function get($msg_index=NULL) {\n\n if (count($this->inbox) <= 0) {\n\n\treturn array();\n\n }\n\n elseif ( ! is_null($msg_index) && isset($this->inbox[$msg_index])) {\n\n\treturn $this->inbox[$msg_index];\n\n }\n\n return $this->inbox[0];\n}", "public function execute(): ?Message;", "public function getLastMessageAttribute(): ?string\n {\n $message = $this->messages()->orderByDesc('created_at')->first();\n return $message ? $message->text : null;\n }", "public function getMessage(int $number, string $mailbox): Message;", "public function get(string $key)\n {\n return $this->has($key) ? $this->storage[$key] : null;\n }", "public function getMessage(): ReceivedMessage\n {\n return new FacebookReceivedMessage($this->request->getParameter('entry.0.messaging.0.message'));\n }", "public function fetch() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn @mysql_fetch_assoc($this->result);\r\n\t}", "public function get($endpointId, $messageId)\n {\n try {\n $result = $this->connection->executeQuery(\n \"SELECT * FROM {$this->messagesTableName} WHERE endpoint_id = ? AND message_id = ?\",\n [$endpointId, $this->stripDashes($messageId)]\n )->fetch(\\PDO::FETCH_ASSOC);\n } catch (\\Exception $e) {\n throw $this->connection->reconnectIfNeeded($e);\n }\n\n if (!$result) {\n return null;\n }\n\n unset($result['id']);\n unset($result['dispatched_at']);\n unset($result['endpoint_id']);\n\n return $result;\n }", "public function get()\n {\n if (!$this->storage->has(self::STORAGE_KEY)) {\n $this->update();\n }\n return $this->storage->get(self::STORAGE_KEY);\n }", "public function fetch()\n {\n $path = $this->getPath();\n $string = \"\";\n if (is_file($path)) {\n $string = \\file_get_contents($path);\n } elseif (preg_match('/^string:/', $path)) {\n $string = preg_replace('/^string:/', '', $path);\n }\n return $string;\n }", "public function fetchMessage()\n {\n if ($this->socket === null) {\n $this->socket = stream_socket_server(static::buildFullAddress($this->address));\n }\n return @stream_socket_accept($this->socket);\n }", "public function read( string $id = null )\n {\n try\n {\n if ( isset( $id ) )\n { \n $this->instance = $this->fetch( $id );\n $this->readIdAfter();\n $this->message = null !== $this->instance ? [ 'success' => $this->instance ] : [ 'warning' => __( 'messages.object_not_found' ) ];\n }\n else\n {\n $this->instance = $this->fetch();\n $this->readAfter();\n $this->message = null !== $this->instance ? [ 'success' => $this->instance ] : [ 'warning' => __( 'messages.objects_not_found' ) ];\n return $this->instance;\n }\n }\n catch( \\Exception $e )\n {\n report( $e );\n $this->message = ['error' => __( 'messages.unexpected_error_msg' )];\n return;\n }\n }", "public function get_message( $key = null ) {\n // Gets the message for the given key from the message_values property.\n if ( $key === null ) return $this->message_values;\n else if ( isset($this->message_values[$key] ) ) return $this->message_values[$key];\n else return false;\n }", "public static function get()\n\t{\n\t\tif ($stmt = self::db()->prepare(\"SELECT message FROM tips WHERE status = 'APPROVED' ORDER BY RAND() LIMIT 1;\"))\n\t\t{\n\t\t\t$stmt->execute();\n\t\t\t$stmt->bind_result($message);\n\t\t\t$stmt->fetch();\n\t\t\t$stmt->close();\n\n\t\t\treturn $message;\n\t\t}\n\n\t\treturn false;\n\t}", "public function load() {\n if (($content = $this->getContents()) !== false)\n return unserialize($content);\n else\n return null;\n }", "public function fetch( $key ) {\n return isset($this->data[$key]) ? $this->data[$key] : NULL;\n }", "function ppmess_get_single_commun($message_id, $post_id, $user_logged){\n\t\n\tglobal $wpdb;\n\t\n\t$query = \"SELECT * FROM {$wpdb->prefix}private_messages WHERE message_id = $message_id AND post_id = $post_id AND message_parent = 0 AND ( receiver_id = $user_logged OR sender_id = $user_logged )\";\n\t\n\t$result = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif( $wpdb->num_rows > 0 )\n\t\treturn $result;\n\telse\n\t\treturn FALSE;\n}", "public function get(string $path): ?string\n {\n return $this->filesystem->read($this->relativeToRoot($path));\n }", "public function get()\n\t{\n\t\t$output = null;\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_fetch($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->get($this->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($this->key);\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storageException();\n\t\t}\n\n\n\n\t\treturn $output;\n\t}", "public function testDefaultFromGetFirstMessageFromKeyIfKeyDoesntExist()\n {\n $storage = ['slimFlash' => []];\n $flash = new Messages($storage);\n\n $this->assertEquals('This', $flash->getFirstMessage('Test', 'This'));\n }", "abstract public function getMessage(): ReceivedMessage;", "abstract public function getMessage(): ReceivedMessage;", "public static function find($id) {\n\t\tassert(self::isValidID($id));\n\n\t\t$serializedData = SimpleSAML_Memcache::get($id);\n\t\tif($serializedData === NULL) {\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$data = unserialize($serializedData);\n\n\t\tif(!($data instanceof self)) {\n\t\t\tSimpleSAML_Logger::warning('Retrieved key from memcache did not contain a MemcacheStore object.');\n\t\t\treturn NULL;\n\t\t}\n\n\t\treturn $data;\n\t}", "public static function findByPublicId(string $id): Message {\n $db = Database::getPDOConnection();\n $stmt = $db->prepare('SELECT * FROM `messages` WHERE `public_id` = :id');\n $stmt->execute(['id' => $id]);\n $row = $stmt->fetch();\n if (!$row) {\n throw new MessageNotFoundException(sprintf('no message with id \\'%s\\' exists', $id));\n }\n $message = Message::fromDBRecord($row, $db);\n return $message;\n }", "public function get_message(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::MESSAGE_INVALID;\n }\n }\n $res = $this->_message;\n return $res;\n }", "protected static function findMessage($id)\n {\n return self::findInMailBox()->andWhere(['id' => $id])->one();\n }", "public function fetch($position = null){\n\t\treturn $this->instance->fetch($position);\n\t}", "protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }", "public static function getActionMessage($empty = true){\n if (isset($_SESSION['system_message'])){\n $messages = $_SESSION['system_message'];\n $ret = '';\n if (is_array($messages)) {\n foreach ($messages as $message) {\n $ret.= $message;\n }\n }\n if ($empty) {\n unset($_SESSION['system_message']);\n }\n return $ret;\n }\n return null;\n }", "public function lastMessage()\n {\n return $this->messages()\n ->take(1);\n }", "public function grabMessageFromQueue($queue)\n {\n $message = $this->getChannel()->basic_get($queue);\n return $message;\n }", "private function fetch() {\n\t\treturn $this->storage = $this->connection->fetch($this->request);\n\t}", "public function fetchOrException()\n {\n $record = $this->fetch();\n if ($record === null) {\n throw new NoRecordException;\n }\n return $record;\n }", "function getMessage($tag_id) {\n\tif (isset($_SESSION['message'])) {\n\t\tif ($_SESSION['message']['id'] == $tag_id) {\n\t\t\t$message = $_SESSION['message']['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t\treturn $message;\n\t\t}\n\t}\n\telse return '';\n}", "function openMessage()\r\n{\r\n\tglobal $dbConnection;\r\n\t\r\n\t$sql = \"SELECT * FROM mailmessages WHERE id=\" . $_GET['id'];\r\n\t$result = mysqli_query($dbConnection, $sql)\r\n\t\tor die($sql);\r\n\t$record = mysqli_fetch_array($result);\r\n\tmysqli_free_result($result);\r\n\r\n\treturn $record;\r\n}" ]
[ "0.63591427", "0.6330829", "0.6268203", "0.6097112", "0.6070843", "0.5976792", "0.59063065", "0.585382", "0.58370006", "0.57924974", "0.57439685", "0.5721973", "0.56725633", "0.56451577", "0.5639237", "0.55832297", "0.55621725", "0.55102074", "0.5509564", "0.5501105", "0.55000955", "0.5476072", "0.54240084", "0.53941065", "0.53863853", "0.5379269", "0.5362951", "0.5350648", "0.5349484", "0.5345764", "0.5345036", "0.53252155", "0.53247935", "0.53185236", "0.53037435", "0.5295227", "0.5286922", "0.5286209", "0.52545005", "0.5254233", "0.5248168", "0.52375025", "0.5235986", "0.5229006", "0.52065706", "0.52065706", "0.52021146", "0.51943886", "0.51922184", "0.5182111", "0.5181293", "0.5176297", "0.514473", "0.5143814", "0.513849", "0.51318866", "0.51300764", "0.5126663", "0.5117321", "0.5110301", "0.51034236", "0.5100398", "0.5099596", "0.50935924", "0.5088273", "0.50876546", "0.50807554", "0.5064345", "0.5058325", "0.50539064", "0.504994", "0.504549", "0.504264", "0.5042362", "0.50417507", "0.5030807", "0.501077", "0.50038934", "0.5003445", "0.50028116", "0.49974066", "0.49947295", "0.4990263", "0.49886167", "0.49878928", "0.4986675", "0.4986675", "0.4985374", "0.49801165", "0.49663454", "0.49639496", "0.49617618", "0.4960493", "0.4958499", "0.49515554", "0.494367", "0.49421215", "0.49366766", "0.4927668", "0.4927392" ]
0.5101499
61
Stores the message to enable deduplication and redispatching of transport operations. Throws an exception if a message with the same ID already exists.
public function store(OutboxMessage $message) { $messageId = $message->getMessageId(); if (isset($this->messages[$messageId])) { throw new InvalidArgumentException("Outbox message with ID '$messageId' already exists in storage."); } $this->messages[$messageId] = new InMemoryStoredMessage($messageId, $message->getTransportOperations()); $this->lastMessageId = $messageId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addMessage($message)\n {\n $this->storage[] = $message;\n }", "public function save()\n {\n\n // Doesn't exist yet -- Insert it\n if( $this->id == -1 )\n {\n $sql = 'INSERT INTO messages (recipient, sender, annotation)\n VALUES (?, ?, ?);';\n $params = array( $this->recipient, $this->sender, $this->annotation );\n $query = $this->db->query( $sql, $params );\n }\n\n // Already exists -- Update it\n else \n {\n $sql = 'UPDATE messages\n SET recipient = ?, sender = ?, annotation = ?\n WHERE id = ?';\n $params = array( $this->id, $this->recipient->id, $this->sender->id, $this->annotation->id );\n $query = $this->db->query( $sql, $params );\n }\n }", "function storeMessage($details) {\n\t\tif(is_null($this->message_storage_path)) {\n\t\t\t$this->message_storage_path = TMP;\n\t\t}\n\n\t\t$message_id = $this->generateMessageId();\n\n\t\tif(@file_put_contents($this->message_storage_path.\"dlr\".$message_id, serialize($details))) {\n\t\t\treturn $message_id;\n\t\t}\n\n\t\treturn false;\n\t}", "public function store()\n {\n $message = new Message(Request::all());\n\n $message->creator_id = user()->id;\n $message->updater_id = user()->id;\n $message->createSlug();\n $message->setReceiverByName(Request::get('receiver_name'));\n\n $okay = $message->save();\n\n if ($okay) {\n // Reset the message counter cache of the receiving user:\n Cache::forget(User::CACHE_KEY_MESSAGES.$message->receiver_id);\n\n $this->alertFlash(trans('messages::message_sent'));\n return Redirect::to('messages/outbox');\n } else {\n return Redirect::to('messages/create')->withInput()->withErrors($message->getErrors());\n }\n }", "private function handleMessage($message) {\n\t\tif ($message instanceof Message) {\n\t\t\t$this->getGroup()->addMessage($message);\n\t\t}\n\t\tif ($message instanceof Acknowledge) {\n\t\t\t$this->getGroup()->addMessage($message);\n\t\t}\n\t\tif ($message instanceof Cancel) {\n\t\t\t$this->getGroup()->removeMessage($message->getReference());\n\t\t}\n\t\t// Damit enforcen wir, dass die Daten in den Cache geschrieben werden und beim naechsten\n\t\t// update auch gepusht werden (s. postMessageCache())\n\t\t$this->setGroupHash(__CLASS__ . '$' . md5(microtime(true) . rand(100,999)));\n\t}", "private function saveSourceMessage()\n\t{\n\t\t$sourceMessage = new SourceMessage();\n\t\t$sourceMessage->category = $this->category;\n\t\t$sourceMessage->message = $this->message;\n\t\t\n\t\tif ($sourceMessage->save()){\n\t\t\t$this->id = $sourceMessage->id;\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "protected function saveMessage($message) {\n $path = Yii::getAlias($this->fileTransportPath);\n\n\n $dir = Yii::getAlias('@app/runtime/smser');\n\n try {\n if (!FileHelper::createDirectory($dir)) {\n throw new \\Exception('无法创建目录:' . $dir);\n }\n\n $filename = $dir . DIRECTORY_SEPARATOR . time() . mt_rand(1000, 9999) . '.msg';\n if (!touch($filename)) {\n throw new \\Exception('无法创建文件:' . $filename);\n }\n\n if (!file_put_contents($filename, \"TO - $mobile\" . PHP_EOL . \"CONTENT - $content\")) {\n throw new \\Exception('短信发送失败!');\n }\n\n return true;\n } catch (\\Exception $e) {\n $this->message = $e->getMessage();\n return false;\n }\n\n\n if (!is_dir($path)) {\n mkdir($path, 0777, true);\n }\n if ($this->fileTransportCallback !== null) {\n $file = $path . '/' . call_user_func($this->fileTransportCallback, $this, $message);\n } else {\n $file = $path . '/' . $this->generateMessageFileName();\n }\n file_put_contents($file, $message->toString());\n\n return true;\n }", "public function store(Request $request)\n {\n $request->validate([\n 'message' => 'required',\n 'message_id' => 'required'\n ]);\n\n // Temporary logic\n $user = Auth::user();\n $message = new Message;\n \n $message->message = $request->message;\n $message->user_id = Auth::user()->id;\n if($user->hasRole('admin') || $user->hasRole('user') || $user->hasRole('ap')){\n $message->reply_to = $request->message_id;\n }\n \n $last_message = Message::where('last_message_for', $request->message_id)->first();\n if($last_message){\n $last_message->last_message_for = null;\n $last_message->save();\n }\n\n if($message->save()){\n if(!$last_message){\n Message::where('id', $message->id)->update(['last_message_for' => $request->message_id]);\n }\n\n Message::where('id', $message->id)->update(['last_message_for' => $request->message_id]);\n $new_message = Message::with('user', 'recipient')->where('id', $message->id)->get();\n broadcast(new MessageSent($user, $new_message))->toOthers();\n return $new_message;\n }\n }", "public function create(Message $message): void\n {\n $this->items[$message->getEventName()][$message->getId()] = $message;\n }", "public function store($args)\n {\n // Security check\n if (!SecurityUtil::checkPermission('InterCom::', '::', ACCESS_COMMENT)) {\n return LogUtil::registerPermissionError();;\n }\n\n // Extract expected variables\n $msg_id = $args['msg_id'];\n\n // Argument check - make sure that all required arguments are present, if\n // not then set an appropriate error message and return\n if (!isset($msg_id) || !is_numeric($msg_id)) {\n return LogUtil::registerArgsError;\n }\n\n $obj['msg_id'] = $msg_id;\n $obj['msg_stored'] = 1;\n $obj['msg_inbox'] = 0;\n\n $pntable = DBUtil::getTables();\n $msgcolumn = $pntable['intercom_column'];\n $where = 'WHERE ' . $msgcolumn['msg_id'] .'=' . $msg_id .\n ' AND ' . $msgcolumn['to_userid'] .'=' . UserUtil::getVar('uid');\n\n $res = DBUtil::updateObject($obj, 'intercom', $where, 'msg_id');\n if ($res === false) {\n return LogUtil::registerError($this->__('Error! Could not save message.'), null, ModUtil::url('InterCom', 'user', 'inbox'));\n }\n\n return true;\n }", "public static function store(Request $request)\n { \n $message = new Message ();\n $message->from_users_id = Auth::user()->id;\n $message->to_users_id = $request->get('user-id');\n $message->message = $request->get('message');\n $message->offer_id = $request->get('offer-id');\n $message->is_read = 0;\n $message->save();\n \n\t\t\n\t\tif(!empty($request->get('parent_msg'))){\n\t\t\t$child_id = $message->id;\n \t$reply = MessageReplyController::store ($request, $child_id);\n Message::find($request->get('parent_msg'))\n ->touch();\n\t\t}\n \n if(is_null($request->get('offer')))\n return redirect('/message');\n \n return redirect('/offer');\n }", "private function storeErrorMessage($message)\n\t{\n\t\t$this->_errorMessage .= $message;\n\t}", "public function store()\r\n {\r\n if ($this->storage) {\r\n $this->storage->store($this->messages);\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "private function check_message(){\t\t\tif(isset($_SESSION['message'])){\r\n\t\t\t\t// Add it as an attribute and erase the stored version\r\n\t\t\t\t\r\n\t\t\t\t$this->message = $_SESSION['message'];\r\n\t\t\t\tunset($_SESSION['message']);\r\n\t\t\t}else{\r\n\t\t\t\t$this->message=\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public function store()\n\t{\n\t\tif (!$this->validate()) {\n\t\t\treturn $this->getRedirect()\n\t\t\t->withErrors($this->validator)\n\t\t\t->withInput();\n\t\t} else {\n\t\t\t// store\n\t\t\t$message = new Message;\n\t\t\t$message->name = \\Input::get('name');\n\t\t\t$message->project_id = \\Input::get('project_id');\n\t\t\t$message->user_id = \\Input::get('user_id');\n\t\t\t$message->save();\n\n\t\t\t// redirect\n\t\t\t\\Flash::push('success', 'Successfully created message!');\n\n\t\t\treturn $this->getRedirect();\n\t\t}\n\t}", "public function save(Message $message) : bool\n {\n return DB::table($this->TABLE)->insert(\n $this->dump($message)\n );\n }", "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "public function addMessage($message);", "public function store()\n\t{\n\t\t$rules = array(\n\t\t 'message_id' => '', \n\t\t 'message' \t\t=> 'alpha_dash',\n\t\t);\n\n\t\t$messageId = Input::get('message_id');\n\t\t$message_text = Input::get('message');\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\t\n\t\tif ($validator->fails()) {\n\n\t\t return Redirect::to('message')\n\t\t ->withErrors($validator) \n\t\t ->withInput(); \n\t\t} else {\n\n\t\t\t$message = new Messagedetail;\n\t\t\t$message->message_text = $message_text;\n\t\t\t$message->message_id = $messageId;\n\t\t\t$message->user_id = Auth::user()->id;\n\t\t\t\n\n\t\t\t$result = $message->save();\n\n\t\t\tif ($result) {\n\t\t\t\treturn Redirect::to('message')->with('result', array('status' => 'alert-success', 'message' => 'Input success' ));\n\t\t\t} else {\n\t\t\t\treturn Redirect::to('message')->withInput(); \n\t\t\t}\n\t\t}\n\t}", "public function store(storeMessageRequest $request)\n {\n $message = new Message();\n $message->body = $request->body;\n $message->read = false;\n $message->user_id = auth()->user()->id;\n $message->conversation_id = $request->conversation_id;\n\n $message->save();\n\n return new MessagesResource($message);\n }", "function saveMessage($data) {\n \n if ($this->save($data)) {\n return true;\n } else {\n return false;\n }\n \n }", "public function setMessageAttribute(Message $message)\n {\n $this->setAttribute('message_id', $message->id);\n }", "public function save()\n {\n if (empty($this->userId) || ! $this->createdAt instanceof \\DateTime) {\n throw new \\Exception('Message cannot be saved, parameters missing');\n }\n\n $params = [\n ':message' => $this->message,\n ':createdAt' => $this->createdAt->format('Y-m-d H:i:s'),\n ':userId' => $this->userId\n ];\n\n if (empty($this->id)) {\n $sql = 'INSERT INTO messages (message, createdAt, userId) VALUES (:message, :createdAt, :userId)';\n } else {\n $sql = 'UPDATE messages set message = :message, createdAt = :createdAt, userId = :userId WHERE id = :id';\n $params[':id'] = $this->id;\n }\n $this->saveModel($sql, $params);\n return $this;\n }", "public function set_message($message)\n {\n $this->messages[] = $message;\n\n return $message;\n }", "public function store()\n {\n $validator = \\Validator::make(\\Input::all(), [\n 'to_user_id' => 'required|exists:users,id',\n 'subject' => 'required',\n 'message' => 'required'\n ]);\n\n if ($validator->fails()) {\n return \\Redirect::back()->withInput()->withErrors($validator);\n }\n\n $message = Message::create([\n \"to_user_id\" => \\Input::get('to_user_id'),\n \"from_user_id\" => \\Auth::id(),\n \"subject\" => \\Input::get('subject'),\n \"message\" => \\Input::get('message'),\n \"created_at\" => date('Y-m-d G:i:s')\n ]);\n\n return \\Redirect::route('message.index');\n }", "public function store(MessageRequest $request, Message $message)\n\t{\n\t\t//\n\t\t$message->create($request->all());\n\n \\Alert::success('Data berhasil ditambah!', 'Berhasil!');\n\n return redirect('/en'); \n\t}", "function StoreMessage($To, $CC, $Subject, $message, $MFrom, $wid) {\n\n $midq = \"SELECT mid FROM Messages ORDER BY mid\";\n\t\t$wfhist = $this->query($midq);\n\t\tforeach($wfhist as $row){\n $mid = $row['mid'] + 1;\n }\n\n $rid = $_SESSION['rid'];\n\t\t$dateSent = date('F j, Y');\n\t\t$timeSent = date('Hi');\n\t\t$timeZone = date('e');\n\t\t$MStatus = \"Unread\";\n\t\t$OpenLinkSrc = \"https://\".$_SESSION['domain'].\"/showMessage.php?mid=\".$mid.\"\";\n\n $newmessage = htmlentities($message);\n $newsubject = htmlentities($Subject);\n\t\t//echo \"New Message: \".$newmessage.\"\";\n\t\t//Insert into Messages\n $messageq = \"INSERT INTO Messages (mid,MTo,CC,Subject,Message,MFrom,rid,wid,dateSent,timeSent,timeZone,MStatus,OpenLink) VALUES ($mid,'$To','$CC','$newsubject','$newmessage','$MFrom','$rid','$wid','$dateSent','$timeSent','$timeZone','$MStatus','$OpenLinkSrc')\";\n\t\t//$messageq = \"INSERT INTO Messages (mid,MTo,CC,Subject,Message,MFrom,rid,wid) VALUES ($mid,'$To','$CC','$newsubject','$newmessage','$MFrom','$rid','$wid')\";\n $InsertMessageHistory = $this->query($messageq);\n\t\t//$InsertMessageHistory = sqlsrv_query($conn, $messageq);\n }", "public function addMessageAction(){\n if (!$this->_validateFormKey()) return $this->_redirect('inchoo/tickets');\n\n if ($this->getRequest()->isPost()) {\n $ticketId = $this->getRequest()->getPost('ticket_id');\n $message = Mage::getModel('inchoo_tickets/message');\n\n $message->setTicket_id($ticketId)\n ->setMessage($this->getRequest()->getPost('message'))\n ->setAuthor(true); // true=customer\n\n if ($message->validateMessage()) $message->save();\n }\n\n $this->_redirect(\"inchoo/tickets/view/ticket/$ticketId\");\n }", "function createMessage( $message=null ){\n global $mysqli;\n $msg = (object) $message;\n $command = $mysqli->real_escape_string($msg->command);\n $category = $mysqli->real_escape_string($msg->category);\n $bindings = $mysqli->real_escape_string($msg->bindings);\n $block_index = $mysqli->real_escape_string($msg->block_index);\n $message_index = $mysqli->real_escape_string($msg->message_index);\n $timestamp = $mysqli->real_escape_string($msg->timestamp);\n $results = $mysqli->query(\"SELECT message_index FROM messages WHERE `message_index`='{$message_index}' LIMIT 1\");\n if($results){\n if($results->num_rows==0){\n $sql = \"INSERT INTO messages (message_index, block_index, command, category, bindings, timestamp) values ('{$message_index}','{$block_index}','{$command}','{$category}','{$bindings}','{$timestamp}')\";\n } else {\n $sql = \"UPDATE messages SET block_index='{$block_index}', command='{$command}', category='{$category}', bindings='{$bindings}', timestamp='{$timestamp}' WHERE message_index='{$message_index}'\";\n }\n $results = $mysqli->query($sql);\n if(!$results){\n byeLog('Error while trying to create or update record in messages table');\n }\n } else {\n byeLog('Error while trying to lookup record in messages table');\n }\n}", "public function offsetSet($index, $message)\n\t{\n\t\tif ( ! is_object($message))\n\t\t{\n\t\t\tthrow new Exception(\"The message must be an object\");\n\t\t}\n\t\t$this->_messages[$index] = $message;\n\t}", "public function save ()\n {\n if ( $this->mess_uid === \"\" )\n {\n $id = $this->objMysql->_insert (\"task_manager.email_server\", [\n \"MESS_ENGINE\" => $this->mess_engine,\n \"MESS_SERVER\" => $this->mess_server,\n \"MESS_PORT\" => $this->mess_port,\n \"MESS_RAUTH\" => $this->mess_rauth,\n \"MESS_ACCOUNT\" => $this->mess_account,\n \"MESS_PASSWORD\" => $this->mess_password,\n \"MESS_FROM_MAIL\" => $this->mess_from_mail,\n \"MESS_FROM_NAME\" => $this->mess_from_name,\n \"SMTPSECURE\" => $this->smtpsecure,\n \"MESS_DEFAULT\" => $this->mess_default\n ]\n );\n\n return $id;\n }\n else\n {\n $this->objMysql->_update (\"task_manager.email_server\", [\n \"MESS_ENGINE\" => $this->mess_engine,\n \"MESS_SERVER\" => $this->mess_server,\n \"MESS_PORT\" => $this->mess_port,\n \"MESS_RAUTH\" => $this->mess_rauth,\n \"MESS_ACCOUNT\" => $this->mess_account,\n \"MESS_PASSWORD\" => $this->mess_password,\n \"MESS_FROM_MAIL\" => $this->mess_from_mail,\n \"MESS_FROM_NAME\" => $this->mess_from_name,\n \"SMTPSECURE\" => $this->smtpsecure,\n \"MESS_DEFAULT\" => $this->mess_default\n ], [\"MESS_UID\" => $this->mess_uid]\n );\n }\n }", "public function store(Message $message, Request $request)\n {\n $request->validate([\n 'email' => 'required|email',\n 'subject' => 'required|min:5',\n 'message' => 'required|min:5'\n ]);\n\n $randomStr = str_random(40);\n\n $message->code = $randomStr;\n $message->email = $request->email;\n $message->subject = $request->subject;\n $message->message = $request->message;\n $message->save();\n\n $mail = new MailController($request->email, $request->subject, $request->message, $randomStr);\n $result = $mail->send();\n return redirect()->back()->with('result', $result);\n }", "public function saving(MessageSetting $message)\n {\n if (company()) {\n $message->company_id = company()->id;\n }\n }", "public function store(StoreMessage $request)\n {\n if( !$request->errors) {\n Message::create([\n 'text' => $request->input('text'),\n 'user_id' => Auth::user()->id,\n ]);\n return redirect('/')->with('success', 'Сообщение добавлено');\n }\n\n return back()->withInput()->withErrors($request->errors);\n }", "function add($message) { return; }", "protected function _write($message)\n {\n $data = array();\n foreach ($this->_columnMap as $messageField => $modelField) {\n $data[$modelField] = $message[$messageField];\n }\n $model = new $this->_modelName();\n $model->fromArray($data);\n $model->save();\n }", "public function saveMessages($message_ids)\n\t\t\t{\n\t\t\t\t$message_ids_arr = explode(',', $message_ids);\n\t\t\t\tforeach($message_ids_arr as $combined_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$id_arr = explode('_', $combined_id);\n\t\t\t\t\t\t$from_id = $id_arr[0];\n\t\t\t\t\t\t$to_id = $id_arr[1];\n\t\t\t\t\t\t$message_id = $id_arr[2];\n\t\t\t\t\t\tif ($to_id == $this->CFG['user']['user_id'])\n \t\t\t\t\t\t\t$this->updateMessageStatusSave('to_stored', 'to_delete', $message_id);\n\t\t\t\t\t\tif ($from_id == $this->CFG['user']['user_id'])\n\t\t\t\t\t\t\t$this->updateMessageStatusSave('from_stored', 'from_delete', $message_id);\n\t\t\t\t\t}\n\t\t\t\tif (in_array($this->fields_arr['folder'], $this->updateNewMailInFolder))\n\t\t\t\t\t\t$this->updateNewMailCount();\n\t\t\t}", "public static function addMessage($message) {\n $messages = self::popMessage();\n if (is_array($messages)) {\n $messages[] = $message;\n } else {\n $messages = array();\n $messages[] = $message;\n }\n\n setcookie(self::$_name, serialize($messages), time() + self::$_time, self::$_path);\n }", "private function _set_message($message)\n {\n // set message in $_message property\n $this->_message = $message;\n\n return;\n }", "function save() {\n\n\t\tif ( $this->exists ) {\n\t\t\t// update changed fields\n\t\t\t$changed_data = array_intersect_key( $this->data, array_flip( $this->changed_fields ) );\n\n\t\t\t// serialize\n\t\t\t$changed_data = array_map( 'maybe_serialize', $changed_data );\n\n\t\t\tif ( empty( $changed_data ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$queue_id = $this->get_id();\n\n\t\t\t$updated = $this->update( $queue_id, $changed_data );\n\n\t\t\tif ( false === $updated ) {\n\t\t\t\t// Return here to prevent cache updates on error\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tdo_action( 'ig_es_object_update', $this ); // cleans object cache\n\t\t} else {\n\t\t\t$this->set_created_at( new DateTime() );\n\t\t\t$this->data = array_map( 'maybe_serialize', $this->data );\n\t\t\t\n\t\t\t// insert row\n\t\t\t$queue_id = $this->insert( $this->data );\n\n\t\t\tif ( $queue_id ) {\n\t\t\t\t$this->exists = true;\n\t\t\t\t$this->id = $queue_id;\n\t\t\t} else {\n\n\t\t\t\tES()->logger->error( sprintf( __( 'Could not insert into \\'%1$s\\' table. \\'%1$s\\' may not be present in the database.', 'email-subscribers' ), $this->table_name ), $this->logger_context );\n\n\t\t\t\t// Return here to prevent cache updates on error\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// reset changed data\n\t\t// important to reset after cache hooks\n\t\t$this->changed_fields = [];\n\t\t$this->original_data = $this->data;\n\n\t\treturn true;\n\t}", "public function save() {\r\n if (!isset($this->id)) {\r\n global $db;\r\n \r\n $query = \"INSERT INTO `notification` (Message, ObjectReference, ObjectId, TimeStamp) VALUES (?, ?, ?, ?)\";\r\n \r\n $statement = $db->prepare($query);\r\n \r\n if ($statement == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $statement->bind_param(\"ssis\", $this->message, $this->objectReference, $this->objectId, $this->timeStamp);\r\n \r\n $success = $statement->execute();\r\n \r\n if ($success) {\r\n $notificationId = $db->insert_id;\r\n $statement->close();\r\n return $notificationId;\r\n } else {\r\n display_db_error($db->error);\r\n }\r\n } else {\r\n global $db;\r\n \r\n $query = \"UPDATE `notification` SET Message = ?, ObjectReference = ?, ObjectId = ?, TimeStamp = ? WHERE Notification_id = ?\";\r\n \r\n $statement = $db->prepare($query);\r\n \r\n if ($statement == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $statement->bind_param(\"ssisi\", $this->message, $this->objectReference, $this->objectId, $this->timeStamp, $this->id);\r\n \r\n $success = $statement->execute();\r\n \r\n if ($success) {\r\n $statement->close();\r\n } else {\r\n display_db_error($db->error);\r\n }\r\n }\r\n }", "public function add_message($message){\n $this->messages[] = $message;\n }", "public function withMessage(Message $message): void;", "public function store(StoreMessageRequest $request)\n {\n varDump($request, 'request');\n $user = Auth::user();\n $message = new Message(['body' => $request->body]);\n $user->messages()->save($message);\n\n $messages = Message::orderByDesc('created_at')->paginate(6);\n return MessageResource::collection($messages);\n }", "public static function partage($idMessage)\n\t{\n\t\t$em = dbconnection::getInstance()->getEntityManager() ;\n\n\t\t$messageRepository = $em->getRepository('message');\n\t\t$utilisateurRepository = $em->getRepository('utilisateur');\n\n\t\t$message = $messageRepository->findOneById($idMessage);\n\t\t$emetteur = $utilisateurRepository->findOneById(context::getSessionAttribute('id'));\n\n\t\t$newMessage = new message;\n\t\t$newMessage->post = $message->post;\n\t\t$newMessage->parent = $message->parent;\n\t\t$newMessage->destinataire = $message->destinataire;\n\t\t$newMessage->aime = 0;\n\t\t$newMessage->emetteur = $emetteur;\n\n\t\t$em->persist($newMessage);\n\t\t$em->flush();\n\n\t\treturn $newMessage;\n\t}", "public function store(CreateMessage $request)\n {\n $user = Auth::User()->id;\n\n if (Auth::user()->hasRole('owner')) {\n $to = $this->users->getAdmin()->id;\n } else {\n $to = $request->user_to;\n }\n\n $data = [\n 'user_to' => $to,\n 'user_from' => $user,\n 'subject' => $request->subject,\n 'description' => $request->description\n ];\n\n $message = $this->messages->create($data);\n\n if($message) {\n\n if (Auth::user()->hasRole('owner')) {\n $message = 'Se ha enviado su mensaje al supervisor del sistema';\n } else {\n $message = 'Se ha enviado su mensaje al destinatario';\n }\n\n $request->session()->flash('success', $message);\n\n if ( $request->ajax() ) {\n\n return response()->json([\n 'success' => true,\n 'message' => $message,\n 'url_return' => route('messages-panel.index')\n ]);\n }\n\n return back()->withSuccess($message);\n }\n\n $message = trans('app.error_again');\n\n if ( $request->ajax() ) {\n\n return response()->json([\n 'success' => false,\n 'message' => $message\n ]);\n }\n\n return back()->withErrors($message);\n }", "public function store(): JsonResponse\n {\n $this->authorize('store', [PersonMessage::class]);\n\n $person_message = new PersonMessage;\n $this->fromRest($person_message);\n\n // Message created by logged in user\n $person_message->creator_person_id = $this->user->id;\n\n if ($person_message->save()) {\n $person = $person_message->person;\n RBS::clubhouseMessageNotify($person, $this->user->id,\n $person_message->message_from, $person_message->subject, $person_message->body);\n return $this->success($person_message);\n }\n\n return $this->restError($person_message);\n }", "public function save($message = null)\n {\n return $this->message($message ?: $this->getMessage('success'));\n }", "public function setMessage($message);", "public function setMessage($message);", "public function setMessage($message);", "public function message($message): void\n {\n $this->messages[] = $message;\n }", "public function setMessage( $message );", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store() {\n\t\t// test the DB-Connection\n\t\ttry {\n\t $pdo = DB::connection('mysql')->getPdo();\n\t }\n\t catch(PDOException $exception) {\n\t return Response::make('Database error! ' . $exception->getCode() . ' - ' . $exception->getMessage());\n\t }\n\n\t\t$message = Message::firstOrCreate(array(\n\t\t\t'fb_id' => Input::get('message.fb_id'),\n\t\t\t'message_type' => Input::get('message.message_type'),\n\t\t\t'to_user_id' => Input::get('message.to_user_id')\n\t\t));\n\n\t\t$message->from_user_id = Input::get('message.from_user_id');\n\t\t$message->subject = Input::get('message.subject');\n\t\t$message->text = Input::get('message.text');\n\n\t\t$message->save();\n\n\t return '{ \"message\":'.$message.' }';\n\t}", "public function addMessage()\n {\n if(null === $this->obj_message) {\n $this->obj_message = new Message();\n }\n return $this->obj_message;\n }", "public function setMessage($message)\n {\n return $this->mergeData([static::messageKey() => (string) $message]);\n }", "public function mailPut($message)\n {\n $stat = $this->pathStat();\n $opts = array();\n if($message->getSeen())\n $opts[] = '\\Seen';\n if($message->getAnswered())\n $opts[] = '\\Answered';\n if($message->getFlagged())\n $opts[] = '\\Flagged';\n if($message->getDeleted())\n $opts[] = '\\Deleted';\n if($message->getDraft())\n $opts[] = '\\Draft';\n //if($message->getRecent()) // Recent is a read-only property\n // $opts[] = '\\Recent';\n $body = $message->getBody();\n if(strlen($body) > 0) {\n $ret = imap_append($this->_c, $stat['path'], $body, implode(' ',$opts), $message->getDate());\n }\n $errors = imap_errors();\n if(is_array($errors) && count($errors)) {\n print_r($errors);\n }\n return $ret;\n\n }", "public function putInSession()\n {\n if (!$this->flashNotifications) {\n return;\n }\n if ($this->plural) {\n $this->session->flash(\n \"notifications.$this->plural\", $this->flashNotifications\n );\n } else {\n if (count($this->flashNotifications) === 1) {\n $this->session->flash(\n \"notifications.$this->name\", $this->flashNotifications[0]\n );\n } else {\n throw new Exception(\n \"Could not flash multiple notifications without '\n .'a plural version of the name of the bag.\"\n );\n }\n }\n }", "public function save()\n {\n // Session should be started\n if ($this->_pStorage->status() === PHP_SESSION_ACTIVE) {\n // Get and save current UID\n $this->_pStorage->setOffset(self::UID, $this->_iCRC, APPLICATION_NAME);\n } else {\n throw new \\Foundation\\Exception\\BadMethodCallException('The session was not successfully started.');\n }\n }", "function saveMsgForLater()\n{\n global $db, $errors, $successes;\n $query = $db->prepare(\"INSERT INTO messages(type, text, session_id) VALUES(:type, :text, :session_id)\");\n $params = [\n \"type\" => \"error\",\n \"text\" => \"\",\n \"session_id\" => session_id()\n ];\n\n if (count($errors) > 0) {\n foreach ($errors as $msg) {\n $params[\"text\"] = $msg;\n $query->execute($params);\n }\n }\n\n $params[\"type\"] = \"success\";\n if (count($successes) > 0) {\n foreach ($successes as $msg) {\n $params[\"text\"] = $msg;\n $query->execute($params);\n }\n }\n}", "protected static function addMessage(stdClass $message) {\n $i = PitSession::get('PitFlash', 'i', 1);\n $msgs = PitSession::get('PitFlash', 'messages', array());\n $msgs[$i] = $message;\n PitSession::set('PitFlash', 'i', $i + 1);\n PitSession::set('PitFlash', 'messages', $msgs);\n }", "public function addMessage($message) {\n $this->messages[] = $message;\n }", "public function setMessage($message, $reassign = false);", "public function save($card, $message){\n $this->entityManager->persist($card);\n $this->entityManager->flush();\n if($message){\n $this->session->getFlashBag()->add('success', 'The card has been updated');\n }\n }", "public function store()\n { \n if(Session::has('prac_id'))\n {\n $viewer = Practitioner::find(Session::get('prac_id'));\n }\n elseif(Auth::check())\n {\n $viewer = User::find(Auth::user()->id);\n }\n\n $first = Conversation::GetFirstParty($viewer->email)->GetSecondParty(Input::get('receiver_email'))->first();\n $second = Conversation::GetFirstParty(Input::get('receiver_email'))->GetSecondParty($viewer->email)->first();\n\n if(($first !== null) OR ($second !== null))\n { \n if($first !== null)\n {\n $conversation_id = $first->id;\n }\n elseif($second !== null)\n {\n $conversation_id = $second->id;\n }\n }\n elseif(($first === null) AND ($second === null))\n {\n $newConversation = new Conversation;\n $newConversation->firstuser_email = $viewer->email;\n $newConversation->seconduser_email = Input::get('receiver_email');\n $newConversation->save();\n $conversation_id = $newConversation->id;\n\n }\n\n if($conversation_id !== null)\n {\n $newMessage = new Message;\n $newMessage->conv_id = $conversation_id;\n $newMessage->receiver_email = Input::get('receiver_email');\n $newMessage->sender_email = $viewer->email;\n $newMessage->title = Input::get('title');\n $newMessage->content = Input::get('content');\n $newMessage->status = Input::get('status');\n $newMessage->save();\n }\n \n }", "static function addMessage($Message = null)\r\n {\r\n if ($Message === null)\r\n {\r\n return false;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n\r\n $contest = $Message->getContest();\r\n $idUserFrom = $Message->getIdUserFrom();\r\n $idUserTo = $Message->getIdUserTo();\r\n $time = $Message->getTime();\r\n\r\n $query = \"INSERT INTO $tableMessage\r\n (contest, idUserFrom, idUserTo, seen, received, time)\r\n VALUES \r\n ('$contest', '$idUserFrom', '$idUserTo', 0, 1, $time)\";\r\n \r\n return DatabaseManager::singleAffectedRow($query);\r\n }", "public function store(CreateMessageRequest $request)\n {\n //Guardar el mensaje con la clase DB\n\n /* DB::table('messages')->insert([\n \"nombre\" => $request->input('nombre'),\n \"email\" => $request->input('email'),\n \"mensaje\" => $request->input('mensaje'),\n \"created_at\" => Carbon::now(),\n \"updated_at\" => Carbon::now(),\n\n ]); */ \n\n // Guardar mensajes en la base de datos con Eloquent\n\n /* $message = new Message;\n $message->nombre = $request->input('nombre');\n $message->email = $request->input('email');\n $message->mensaje = $request->input('mensaje');\n $message->save(); */\n\n // Utilizando el metodo create directamente en el modelo, le puede pasar por parametro un array como el del DB::table o asi-: (investigar sobre esto porque puede ser inseguro, asignacion masiva de datos)\n\n //dd(\"si\");\n $message = Message::create($request->all());\n\n if(auth()->check()){\n\n auth()->user()->messages()->save($message);\n }\n\n // Redireccionar\n\n return view('messages.create', compact('message'))->with(['info' => 'Hemos recibido tu mensaje yeeei', 'message' => $message, 'user' => auth()->user()]);\n\n\n\n // return back()->with('info', 'Tu mensaje se ha enviado correctamente');\n }", "public function addMessage($message)\n {\n $this->messages[] = $message;\n }", "public function add(Message $flash);", "public function store_message($args)\n {\n // Security check\n if (!SecurityUtil::checkPermission('InterCom::', '::', ACCESS_COMMENT)) {\n return LogUtil::registerPermissionError();;\n }\n\n\t$res = DBUtil::insertObject($args, 'intercom', 'msg_id');\n if ($res == false) {\n return LogUtil::registerError($this->__('Error! Could not send message.'), null, ModUtil::url('InterCom', 'user', 'inbox'));\n }\n ModUtil::apiFunc('InterCom', 'user', 'emailnotification',array('to_uid' => $args['to_userid'], 'from_uid' => $args['from_userid'], 'subject' => $args['msg_subject']));\n return true;\n }", "public function addMessage($message, $type) {\n\t\t$messages = $_SESSION[$this->sessionKey];\n\t\t\n\t\t$messages[] = [\n\t\t\t'message' => $message,\n\t\t\t'type' => $type,\n\t\t];\n\t\t\n\t\t$_SESSION[$this->sessionKey] = $messages;\n\t}", "static public function set( $message, $class = 'msg_ok', $persistence = self::VOLATILE )\n\t{\n\t\t$existing_messages = self::_getMsgs();\n\n\t\t$existing_messages[] = array(\n\t\t\t'message' => $message,\n\t\t\t'class' => $class,\n\t\t\t'persistence' => $persistence\n\t\t);\n\n\t\tself::_setMsgs( $existing_messages );\n\t}", "public function add() {\n\n $this->db->query(\"INSERT INTO `message` \n (`message_creator`, `message`, `create_date`, `is_reply`, `reply_to`) \n VALUES (?, ?, ?, ?, ?)\", array(\n $this->message_sender,\n $this->message,\n $this->message_date,\n $this->is_reply,\n $this->reply_to,\n ));\n\n $message_row_inserted = $this->db->error();\n\n // GET LAST MESSAGE ID TO GIVE IT TO RECIPIENT TABLE\n $last_inserted_message_id = $this->db->pdo()->lastInsertId();\n\n /* \n Here notice that we need to check if the receiver user is subscribed to the channel, and If so then we pass the message\n to the channel, otherwise we normally store it in the database.\n */\n $this->db->query(\"INSERT INTO `channel` \n (`sender`, `receiver`, `group_recipient_id`, `message_id`) \n VALUES (?, ?, ?, ?)\", array(\n $this->message_sender,\n $this->message_receiver,\n null,\n $last_inserted_message_id\n ));\n\n $channel_row_inserted = $this->db->error();\n\n $this->db->query(\"INSERT INTO `message_recipient` \n (`receiver_id`, `message_id`, `is_read`) \n VALUES (?, ?, ?)\", array(\n $this->message_receiver,\n $last_inserted_message_id,\n $this->is_read\n ));\n\n $message_recipient_row_inserted = $this->db->error();\n\n return $this->db->error() == false ? $last_inserted_message_id : false;\n }", "public function set_message($message);", "public static function storageMessage($messages)\n {\n foreach ($messages as $item ) {\n UserNotificationMessage::create($item);\n }\n\n }", "public function addMessage($message)\n\t{\n\t\t$this->messages[] = $message;\n\t}", "public function saveMessage($user, $recepient, $message) {\n\t\t# Assume User is Logged in, $user -> User Object\n\t\t$this->_sql->raw_query('INSERT INTO epi_messages VALUES (NULL, '. $user->_id .', '. $recepient .', \"'. htmlentities($message) .'\") ');\n\t}", "public function addStructure(Message $message)\n {\n $this->_messages[] = $message;\n\n }", "function record_message($message) {\n global $messages;\n array_push($messages, $message);\n}", "public function add($key, $message)\n {\n $this->messages[$key][] = $message;\n }", "public function actionWriteMessage() {\n\t\ttry {\n\t\t\treturn $this->getService('SupportMessage')->add();\n\t\t} catch (Exception $e) {\n\t\t\treturn $this->sendError('You reached some error');\n\t\t}\n\t}", "public function writeMessage($message);", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "static function updateMessage($Message = null)\r\n {\r\n if ($Message === null)\r\n {\r\n return false;\r\n }\r\n\r\n $tableMessage = DatabaseManager::getNameTable('TABLE_MESSAGE');\r\n\r\n $id = $Message->getId();\r\n $seen = $Message->getSeen();\r\n\r\n $query = \"UPDATE $tableMessage\r\n SET seen = $seen\r\n WHERE $tableMessage.id = $id\";\r\n\r\n return DatabaseManager::singleAffectedRow($query);\r\n }", "public function record($msg) {\r\n \r\n // Busca a sessão portoweb existente\r\n $sessao = new Zend_Session_Namespace('portoweb');\r\n \r\n // Grava a mensagem na sessao\r\n $sessao->mensagemSistema = $msg;\r\n \r\n }", "public static function logMessage(LoggerMessage $message)\n\t{\n\t\tif (!isset($_SESSION[__CLASS__]))\n\t\t\t$_SESSION[__CLASS__] = array();\n\n\t\t// Add the message to the session, to be show in the future\n\t\tarray_push($_SESSION[__CLASS__], serialize($message));\n\t}", "public function store()\n {\n throw new \\Exception(\"Not implemented\");\n }", "function storeAndNew() {\n $this->store();\n }", "function SendMessage($message, $object, $id, $from_public = false);", "function set_message_key($key, $val)\n{\n if(!isset($_SESSION[$key]))\n {\n $_SESSION[$key] = $val;\n }\n}", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function attach(Message $message): void;", "public function moveToProcessed(Message $message): void;", "function setSessionMessage($tag_id, $message) {\n\t$_SESSION['message'] = array('id' => $tag_id, 'message' => $message);\n}", "private function storeErrorMessage($message, $value) {\n\t\t$this->errorMessages[] = sprintf(\n\t\t\t$GLOBALS['LANG']->getLL('error_message_' . $message),\n\t\t\t$value\n\t\t);\n\t}", "public function push($message);", "public function add($message, $messageType = false) {\n if ( empty($this->_queue) ) {\n return false;\n }\n\n\t\tif(false === $messageType)\n\t\t{\n\t\t\t$crcMessageType = $this->_msgType;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crcMessageType = sprintf(\"%u\", crc32($messageType));\n\t\t}\n\n\t\tif ( false === msg_send($this->_queue, $crcMessageType , $message, $this->_serialize, $this->_blockSend, $err) ) {\n $this->_lastError = $err;\n return false;\n }\n return true;\n }", "public function store()\n\t{\n $response['success']=true;\n $message= New Message;\n $message->text= Input::get('text');\n $message->ticket_id= Input::get('ticket_id');\n $message->user_id= 15;\n $message->save();\n $response['message']=array('text'=>$message->text,'name'=>$message->user->profile->name,'created'=>$message->created_at);\n return $response;\n\t}", "function saveMsgReceived($profile_id, $msg, $conv, $msg_id, $date, $template=0, $watson_context=null, $account){\n\t\tglobal $db;\n\t\t$date = gettype($date)=='string'?$date:date('Y-m-d G:i:s', $date);\n\t\t$statement = $db->prepare('INSERT INTO msg_conversation (by_bot, profile_id, conv_id, msg_id, template_msg, msg, watson_context, date, accountID) VALUES (0, :profile_id, :conv, :msg_id, :template, :msg, :watson_context, :date, :account)');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':conv' => $conv, ':msg_id' => $msg_id, ':template'=>$template, ':msg' => $msg, ':watson_context'=>$watson_context, ':date'=>$date, ':account'=>$account));\n\t}" ]
[ "0.581121", "0.58035845", "0.5795817", "0.57065046", "0.56416565", "0.5441535", "0.541736", "0.5416096", "0.5385876", "0.53514814", "0.5246344", "0.52259123", "0.5213701", "0.5178758", "0.5154997", "0.5116386", "0.51123923", "0.50981927", "0.5087579", "0.5066191", "0.50596017", "0.500789", "0.4991104", "0.49867752", "0.49690822", "0.4965014", "0.4959377", "0.49567115", "0.49341843", "0.4886142", "0.48765814", "0.4869246", "0.4868265", "0.48656046", "0.48501483", "0.484502", "0.48423406", "0.48218885", "0.48182118", "0.48123074", "0.47958824", "0.47892544", "0.4786032", "0.47768074", "0.47755235", "0.47754875", "0.4773409", "0.47702283", "0.47567907", "0.47567907", "0.47567907", "0.47470415", "0.47442445", "0.4718852", "0.47158587", "0.4710527", "0.4708895", "0.47023818", "0.47002086", "0.46995112", "0.46994704", "0.4694161", "0.468535", "0.4678526", "0.46693727", "0.46671975", "0.46658942", "0.46642914", "0.4643939", "0.464", "0.4627116", "0.46164837", "0.46136072", "0.46116868", "0.4610849", "0.46106988", "0.459848", "0.45982128", "0.4596473", "0.45890918", "0.45880425", "0.45793724", "0.45791307", "0.45749903", "0.45697117", "0.4553809", "0.45480916", "0.45451075", "0.45418027", "0.45388183", "0.45358747", "0.45356292", "0.45283353", "0.45131692", "0.45077124", "0.44982004", "0.44981915", "0.44938463", "0.44922552", "0.44906604" ]
0.63536835
0
Rolls back the transaction
public function rollBack() { unset($this->messages[$this->lastMessageId]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rollBackTransaction()\r\n\t{\r\n\t\t$this->query(\"ROLLBACK TRANSACTION\");\r\n\t}", "public static function RollBackTrans() {\n try {\n if(DB::transactionLevel() > 0) {\n DB::rollBack();\n }\n }\n catch(Exception $e) {\n }\n }", "public function rollBack()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"ROLLBACK;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}", "public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}", "public function rollback()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->rollBack();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }", "function RollBackTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->rollBack();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public function rollBack()\n {\n if ($this->store->transactions == 1) {\n $this->store->transactions = 0;\n\n $this->store->rollBack();\n } else {\n --$this->transactions;\n }\n }", "public function rollBack()\n {\n if ($this->transactions == 1) {\n $this->transactions = 0;\n\n $this->getPdo()->rollBack();\n } else {\n $this->transactions--;\n }\n }", "function RollbackTrans() {}", "protected function rollBackTransaction()\n {\n $this->container->make('db')->rollBack();\n }", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "protected function rollback() {\n $this->objDbConn->rollBack();\n }", "public function rollbackTransaction();", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "public function rollBack()\r\n {\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->rollBack();\r\n $this->_txns = 0;\r\n } else {\r\n --$this->_txns;\r\n }\r\n }", "public function rollbackTransaction()\n {\n mysqli_query($this->databaseLink,\"ROLLBACK;\");\n }", "function rollback(){\n\t\ttry {\n\t\t\t$this->dbconn->rollBack();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function rollBack()\n\t{\n\t\t$this->c->rollBack();\n\t}", "public function rollback() {\n parent::rollback();\n $this->activeTransaction = false;\n }", "public function rollback() {\n\t\t$this->execute(\"ROLLBACK; SET autocommit = 1;\");\n\t}", "public function rollBack()\n {\n if ($this->hasActiveTransaction) {\n parent::rollback();\n $this->hasActiveTransaction = false;\n }\n }", "public function rollBack() {\r\n\r\n mysql_query(\"ROLLBACK\");\r\n mysql_query(\"SET AUTOCOMMIT=1\");\r\n\r\n }", "public function transactionRollback()\n\t{\n\t\treturn;\n\t}", "public function rollback()\n\t{\n\t}", "public function rollback()\n\t{\n\t}", "public function rollBack(){\r\n $this->db->rollBack();\r\n }", "function rollback() {\n\t\t\tself::$db->rollback();\n\t\t}", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "public static function rollbackTransaction()\n\t{\n\t\tif (self::$currentTransaction !== null)\n\t\t{\n\t\t\tself::$currentTransaction->rollback();\n\t\t\tself::$currentTransaction = null;\n\t\t}\n\t}", "public function rollbackTransaction() {\n\t\t//noop\n\t}", "public function rollback(){\n $this->db->exec('ROLLBACK TO xyz;');\n }", "public abstract function rollback();", "protected function rollback()\n\t{\n\t\t$this->db->rollback();\n\t}", "public function transactionRollback()\n {\n self::$_transactionActive = false;\n return $this->_db->rollBack();\n }", "public function rollBack()\n {\n if ($this->transactionLevel === 0)\n {\n throw new DatabaseException('transaction-nothing-to-roll-back');\n }\n \n --$this->transactionLevel;\n \n if ($this->transactionLevel === 0)\n {\n if (!$this->pdo->rollBack())\n {\n throw new DatabaseException('transaction-rollback');\n }\n }\n else\n {\n // Rollback to savepoint.\n $this->pdo->exec('ROLLBACK TO SAVEPOINT LEVEL' . $this->transactionLevel);\n }\n }", "public function rollBack()\n {\n $this->getActivePdo()->rollBack();\n }", "function rollback();", "function rollback(): void;", "public function rollbackTransaction(): void;", "function roll_back()\n\t{\n\t\t//return $this->db->rollBack();\n\t}", "public function rollBack();", "public function rollback() {\r\n\t\t\tif($this->mysqli) {\r\n\t\t\t\treturn $this->db->rollback();\r\n\t\t\t} else {\r\n\t\t\t\t//no transaction support in mysql module...\n\t\t\t\tmysql_query('ROLLBACK;', $db);\r\n\t\t\t}\n\t\t\t$this->stopTransaction(); \r\n\t\t}", "public function rolltrans(){\n\t\t$this->query(\"ROLLBACK\");\n\t\treturn $this->transaction;\n\t}", "protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}", "abstract protected function doRollback();", "public function rollBack() {\n\t\ttry {\n\t\t\treturn $this->getPdo()->rollBack();\n\t\t} catch (\\PDOException $e) {\n\t\t\t$this->logError($e->getMessage());\n\t\t\tthrow new TransactionException($e->getMessage());\n\t\t}\n\t}", "public function rollback()\n {\n // my code\n $by = 'id';\n $order = 'desc';\n $eventMessages = CEventMessage::GetList($by, $order, ['TYPE' => self::EVENT_TYPE]);\n $eventMessage = new CEventMessage;\n while ($template = $eventMessages->Fetch()) {\n $eventMessage->Delete((int)$template['ID']);\n }\n CEventType::Delete(self::EVENT_TYPE);\n }", "function trans_rollback()\r\n\t{\r\n\t\treturn $this->db->trans_rollback();\r\n\t}", "public function testTransactionRollback()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function rollback() {\n if ($this->tx_active) {\n $this->x('ROLLBACK');\n $this->tx_active = false;\n } else {\n throw new GDBException(\"can't commit, no active transaction\");\n }\n }", "public static function rollback($savepoint = NULL)\n\t{\n\t\tself::getConnection()->rollback($savepoint);\n\t}", "public function rollback() {\n //rolling back and storing the response\n $rollback = $this->mysqli->rollback();\n\n //setting autocommit to on again\n $this->mysqli->autocommit(true);\n\n //now returning the rollback result\n return $rollback;\n }", "public static function rollBackTransaction($stmt){\n self::getPdoCon()->rollBack();\n }", "protected function _rollback() {\n $this->dataSource->rollback($this);\n }", "public function rollback() {\n if (!$this->changed())\n return;\n\n $this->tags = array('new' => array(), 'del' => array());\n $this->inited = false;\n }", "public function rollback($id);", "public function rollback() {\n\t\tif ($this->transaction_counter == 0) {\n\t\t\t// transaction has not begun\n\t\t\t$this->error('Rollback called without active transaction.');\n\t\t}\n\n\t\tif ($this->debug_enabled) {\n\t\t\t$this->debug_log['transactions']['rollback'] = array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),0,4);\n\t\t}\n\n\t\t// clear counter and make rollback, any error in embedded transaction must cancel operation\n\t\t$this->transaction_counter = 0;\n\n\t\tif ($this->adapter) {\n\t\t\tif (!$this->adapter->rollBack()) {\n\t\t\t\t$this->error('Failed to rollback a transaction');\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function rollBack() {\n\t\treturn self::getConexao()->rollBack();\n\t}", "public function rollBack() {\r\n $this->checkConn();\r\n return $this->conn->rollBack();\r\n }", "public function transactionRollback($toSavepoint = false)\n\t{\n\t\t$this->connect();\n\n\t\tif (!$toSavepoint || $this->transactionDepth <= 1)\n\t\t{\n\t\t\tparent::transactionRollback($toSavepoint);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$savepoint = 'SP_' . ($this->transactionDepth - 1);\n\t\t\t$this->setQuery('ROLLBACK TO ' . $this->quoteName($savepoint));\n\n\t\t\tif ($this->execute())\n\t\t\t{\n\t\t\t\t$this->transactionDepth--;\n\t\t\t}\n\t\t}\n\t}", "public function transactionRollback($toSavepoint = false)\n {\n $this->connect();\n\n if (!$toSavepoint || $this->transactionDepth == 1) {\n $this->connection->rollBack();\n }\n\n $this->transactionDepth--;\n }", "function db_rollback($dbh) {\ndb_query(\"ROLLBACK;\",$dbh,\"\",\"\",\"\",\"Rolling back transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\n}", "public function cancelTransaction() {\n return $this->conn->rollBack();\n }", "public function rollBack(): void\n {\n try {\n $this->getConnection()->rollBack();\n } catch (DbalConnectionException $e) {\n throw new Exception('Rollback failed', 0, $e);\n }\n }", "public function handleTransactionRollback(TransactionRolledBack $event)\n {\n Log::debug('rollback');\n }", "public function rollBack()\n {\n return $this->connection->rollBack();\n }", "public function rollBack()\n {\n return $this->conn->rollBack();\n }", "public function rollBack() {\n return self::$PDOInstance->rollBack();\n }", "public function rollback(): void\n {\n $ret = $this->mysqli->rollback();\n if (!$ret) $this->mySqlError('mysqli::rollback');\n }", "public function rollback()\n\t{\n\t\tforeach($this->subformArr as $key => $sf) $sf->rollback();\n\t}", "public function rollBack()\n {\n return $this->pdo->rollBack();\n }", "public function rollBack($toLevel = null)\n {\n if ($this->transactions == 1) {\n $this->transactions = 0;\n\n $this->transaction->rollBack();\n } else {\n $this->transactions--;\n }\n\n $this->fireConnectionEvent('rollingBack');\n }", "protected function rollbackToSavePoint(): void\n {\n foreach ($this->getActiveConnections() as $connection) {\n try {\n while ($connection->isTransactionActive()) {\n $connection->rollBack();\n }\n } catch (\\Exception $e) {\n }\n }\n }", "public function rollBack()\n{\n\treturn db2_rollback($this->dbh) && (($this->transaction = FALSE) || TRUE);\n}", "public function RollbackTransaction()\r\n\t{\r\n\t\tif ($this->IsConnected())\r\n\t\t{\r\n\t\t\tif (!$this->_db->real_query(\"ROLLBACK\"))\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(\"There was an error rolling back the database transaction<p>: \" . $this->GetLastError() . \"</p>\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new Exception(\"There was an error rolling back the database transaction: Database not connected\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function rollback()\n\t{\n\t\t$this->commit_stack = 0;\n\t\t$this->query('ROLLBACK');\n\t\treturn true;\n\t}", "public function rollBack(): bool\n {\n --$this->currentTransactionLevel;\n if ($this->currentTransactionLevel == 0) {\n return parent::rollBack();\n }\n $this->exec(\"ROLLBACK TO SAVEPOINT LEVEL\" . $this->currentTransactionLevel);\n return true;\n }", "public function TransactionRollback()\r\n\t{\r\n\t\t$this->ResetError();\r\n\t\tif( !$this->IsConnected() )\r\n\t\t{\r\n\t\t\t$this->SetError( 'No connection' );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif( !mysql_query( 'ROLLBACK', $this->db_link ) )\r\n\t\t\t{\r\n\t\t\t\t$this->SetError( 'Could not rollback transaction' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$this->in_transaction = false;\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "abstract protected function doRollback($savepoint = null);", "private function rollback() {\n\t\tEE::warning( 'Exiting gracefully after rolling back. This may take some time.' );\n\t\tif ( $this->level > 0 ) {\n\t\t\t$this->delete_site();\n\t\t}\n\t\tEE::success( 'Rollback complete. Exiting now.' );\n\t\texit;\n\t}", "public function refundTransaction() {\n //not implemented\n }", "public function rollback()\n\t{\n\t\tif ( $this->active_transactions == 0 ) {\n\t\t\tthrow new \\RuntimeException('Rollback failed, no active transaction.');\n\t\t}\n\n\t\t$this->active_transactions -= 1;\n\n\t\tif ( $this->active_transactions == 0 ) {\n\t\t\treturn $this->pdo->rollback();\n\t\t}\n\t\telse {\n\t\t\t$this->pdo->exec(sprintf('ROLLBACK TO SAVEPOINT T%d', $this->active_transactions));\n\t\t\treturn true;\n\t\t}\n\t}", "public function rollback(){\n return $this->forge->table('users')->ifExists()->drop();\n }", "public function rollback()\n\t{\n\t\t// Make sure the database is connected\n\t\t$this->_connection or $this->connect();\n\n\t\treturn (bool) $this->_connection->query('ROLLBACK');\n\t}", "public function rollBack()\n {\n if ($this->transactionNestingLevel === 0) {\n throw ConnectionException::noActiveTransaction();\n }\n\n $connection = $this->getWrappedConnection();\n\n $logger = $this->_config->getSQLLogger();\n\n if ($this->transactionNestingLevel === 1) {\n if ($logger !== null) {\n $logger->startQuery('\"ROLLBACK\"');\n }\n\n $this->transactionNestingLevel = 0;\n $connection->rollBack();\n $this->isRollbackOnly = false;\n if ($logger !== null) {\n $logger->stopQuery();\n }\n\n if ($this->autoCommit === false) {\n $this->beginTransaction();\n }\n } elseif ($this->nestTransactionsWithSavepoints) {\n if ($logger !== null) {\n $logger->startQuery('\"ROLLBACK TO SAVEPOINT\"');\n }\n\n $this->rollbackSavepoint($this->_getNestedTransactionSavePointName());\n --$this->transactionNestingLevel;\n if ($logger !== null) {\n $logger->stopQuery();\n }\n } else {\n $this->isRollbackOnly = true;\n --$this->transactionNestingLevel;\n }\n\n $eventManager = $this->getEventManager();\n\n if ($eventManager->hasListeners(Events::onTransactionRollBack)) {\n Deprecation::trigger(\n 'doctrine/dbal',\n 'https://github.com/doctrine/dbal/issues/5784',\n 'Subscribing to %s events is deprecated.',\n Events::onTransactionRollBack,\n );\n\n $eventManager->dispatchEvent(Events::onTransactionRollBack, new TransactionRollBackEventArgs($this));\n }\n\n return true;\n }", "#[ReturnTypeWillChange]\n\tpublic function rollBack ()\n\t{\n\t\t$this->exec('ROLLBACK TRANSACTION');\n\t\treturn true;\n\t}", "function cancel_transaction()\n{\n\tglobal $transaction_level;\n\n\tif ($transaction_level) {\n\t\tdb_query(\"ROLLBACK\", \"could not cancel a transaction\");\t\n\t}\n}", "public function rollBack()\n {\n try {\n $this->connection->rollBack();;\n } catch (\\Exception $e) {\n throw $this->connection->reconnectIfNeeded($e);\n }\n }", "function endTransaction()\r\n\t\t{\r\n\t\tif($this->transaction)\r\n\t\t\t{\r\n\t\t\t$this->transaction=FALSE;\r\n\t\t\t$this->query=\"COMMIT TRANSACTION\";\r\n\t\t\t$this->runQuery();\r\n\t\t\t}\r\n\t\t}", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Transaction $transaction)\n {\n //\n }", "function rollback($savepoint=\"\")\n\t{\n\t\tif ($this->m_link_id)\n\t\t{\n\t\t\tif (!empty($savepoint))\n\t\t\t{\n\t\t\t\tatkdebug(get_class($this).\"::rollback (rollback to savepoint $savepoint)\");\n\t\t\t\t$this->query('ROLLBACK TO SAVEPOINT '.$savepoint);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tatkdebug(\"Rollback\");\n\t\t\t\tmysqli_rollback($this->m_link_id);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public static function rollBack() {\n\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->rollBack();\n\t\t}\n\t}" ]
[ "0.8505196", "0.8397888", "0.83902436", "0.8364831", "0.836372", "0.83202916", "0.83053213", "0.8296394", "0.8218154", "0.8203334", "0.8187922", "0.8171846", "0.8171846", "0.8171846", "0.8171846", "0.8157634", "0.8143213", "0.8095483", "0.80727744", "0.8045811", "0.8042371", "0.80317754", "0.7975463", "0.7975055", "0.79468924", "0.7937318", "0.7890859", "0.78904855", "0.78904855", "0.78738654", "0.7863519", "0.7809018", "0.7809018", "0.7780537", "0.7776494", "0.7753457", "0.77455366", "0.7743354", "0.7721877", "0.7693212", "0.7677879", "0.76768386", "0.7623106", "0.761696", "0.76158816", "0.7606079", "0.7592047", "0.7546426", "0.7471369", "0.72190565", "0.7196668", "0.71621084", "0.7144176", "0.7132907", "0.7079916", "0.70790184", "0.706094", "0.70572", "0.70551604", "0.7043085", "0.7035189", "0.7020342", "0.7009501", "0.6972567", "0.69541675", "0.6939888", "0.6930687", "0.69299567", "0.6928674", "0.6915926", "0.6909112", "0.69089675", "0.69023675", "0.688536", "0.68814063", "0.6881137", "0.68493277", "0.6840114", "0.6838869", "0.68369335", "0.6815383", "0.6810054", "0.6806191", "0.6803208", "0.67939013", "0.6760785", "0.6735423", "0.66968554", "0.6600684", "0.6598608", "0.6593614", "0.6576968", "0.6554256", "0.654795", "0.65396243", "0.65396243", "0.65396243", "0.65396243", "0.6477102", "0.6475123" ]
0.7321646
49
Renders all data models.
public function renderItems() { $list = []; if (($before = $this->renderBeforeItemList()) !== null) { $list[] = $before; } $list[] = parent::renderItems(); if (($after = $this->renderAfterItemList()) !== null) { $list[] = $after; } return implode('', $list); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all(){\r\n $data = $this -> model -> getXML();\r\n render('index',$data);\r\n }", "public function renderAll() {\n return $this->render($this->getElements());\n }", "public function models()\n {\n $this->_display('models');\n }", "protected function all()\n {\n $viewmodel = new TodoModel();\n $this->returnView($viewmodel->all(),true);\n }", "function index(){\r\n \r\n $all = $this->model->selectAll();\r\n $this->data('all', $all);\r\n $this->loadView();\r\n }", "public function beforeRender() {\n\t$this->set('allModels', App::objects('model'));\n }", "function Render() {\n $this->RenderChildren();\n }", "public function all()\n {\n $item = new Item;\n $items = $item->all();\n View::renderJson($items);\n }", "function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }", "public function index() {\r\r\n $this->render('index', array('model' => $this->model));\r\r\n }", "public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}", "public function renderAll($dataProvider, $searchModel, $params)\n {\n\n return $this->renderPartial('/journal/all/index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n 'params' => $params\n ]);\n }", "public function actionAll()\n {\n $model = new Masters();\n\n $comments = $model->getCommentsAll();\n $services = $model->getServices();\n $foto = $model->getFoto();\n $pagination = $model->getPagination(Yii::$app->params['mastersOnPage']);\n $masters = $model->getMastersPagination();\n\n return $this->render('index', [\n 'model' => $model,\n 'masters' => $masters,\n 'comments' => $comments,\n 'services' => $services,\n 'foto' => $foto,\n 'pagination' => $pagination,\n 'mastersOnPage' => Yii::$app->params['mastersOnPage'],\n 'pathToRoot' => Yii::$app->params->pathToRoot\n ]);\n }", "public function actionIndex()\n {\n $main = new ActiveDataProvider([\n 'query' => Services::find()->where(['id' => 2])\n ]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => StandartOne::find(),\n ]);\n\n $dataProvider2 = new ActiveDataProvider([\n 'query' => StandartTwo::find(),\n ]);\n\n $dataProvider3 = new ActiveDataProvider([\n 'query' => StandartThree::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'data2' => $dataProvider2,\n 'data3' => $dataProvider3,\n 'main' => $main,\n ]);\n }", "protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $limit = $this->property('limit') ?: 0;\n $this->vars['rows'] = $limit > 0\n ? array_slice($rows, 0, $limit)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotals();\n }", "public function render()\n {\n $tempData = $this->getData();\n $this->listData = $tempData;\n\n $data = get_object_vars($this);\n $this->appData = $data;\n\n //report via ray() if turned on\n if ($this->debugWithRay) {\n $this->showDebugOutput();\n }\n\n //make list view up internally\n return view('lwcrud::layouts.lw-base', ['listData' => $this->listData, 'appData' => $this->appData]);\n }", "protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $number = $this->property('number') ?: 0;\n $this->vars['rows'] = $number > 0\n ? array_slice($rows, 0, $number)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotalsForAllResults()[$this->property('metric')];\n }", "public function render()\n {\n $sondages = $this->model->getSondages();\n $questions = $this->model->getQuestions();\n $reponses = $this->model->getReponses();\n\n require ROOT . \"/App/view/admin/admin.php\";\n }", "public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }", "public function index() {\n\t\t\t$this->render();\n\t\t}", "public function renderData();", "public function run() {\n $this->render('dataSaved', array());\n }", "public function Index() {\n $this->Render();\n }", "public function actionIndex() {\n $chart_data = new \\app\\modules\\contract\\models\\AllClientsSummReport();\n if ($chart_data->load(Yii::$app->request->post()) && $chart_data->validate()) {\n $data = $chart_data->getData();\n } else {\n $data = [];\n }\n\n $dataProvider = new \\yii\\data\\ArrayDataProvider([\n 'allModels' => $data]);\n return $this->render('index', [\n 'chart_data' => json_encode($data),\n 'model' => $chart_data,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function display() {\n $data = $this->container->get('data');\n $people = $data->load('people');\n $this->render('people', ['people' => $people]);\n }", "public function index()\n {\n $this->context['data'] = $this->usersRepo->getAll();\n $this->render($this->context);\n }", "public function render(): void\n {\n $this->prepare_items();\n $this->handleFormAction();\n $this->loadAssets();\n\n $action = $_REQUEST['action'] ?? null;\n $primaryKey = $this->model->getPrimaryColumn();\n $resourceId = $_REQUEST[$this->singular]\n ?? $this->model->{$primaryKey}\n ?? null;\n\n echo $action && in_array($action, ['edit', 'create'])\n ? $this->getFormView($resourceId)\n : $this->getDefaultView();\n\n do_action('print_resource_page_assets');\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index() {\n $data['manufacturers'] = Manufacturer::getManufacturers();\n return view('models.models')->with($data);\n }", "public function all()\n {\n /**\n * TODO: Load the data from the database.\n */\n\n $this->load->model('prize_package');\n $this->load->model('prize');\n\n\n /**\n * Generate the views.\n */\n\n $this->load->view('global/header');\n\n if ($this->session->has_userdata('user')) {\n /**\n * TODO: Check permissions and show organizer options if appropriate.\n */\n $this->load->view('menu/user_menu');\n }\n else\n {\n $this->load->view('menu/default_menu');\n }\n\n $this->load->view('global/footer');\n\n// $this->prize_package->get_packages_and_prizes();\n }", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function actionAll()\n {\n $searchModel = new ResearchAllSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('all', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n\t{\n\t\t$model = new Catagories();\n\t\t$this->render('main', array(\n\t\t\t\t'data' => $model,\n\t\t));\n\t\t\n\t}", "protected function render(){\n //render view\n \n }", "public function index()\n {\n return $this->model->all();\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora aterizare</th>\";\n\t\techo \"<th>De la</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_aterizare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"de_la\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function index()\n {\n return $this->render('index', [\n 'model' => $this->model,\n ]);\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora decolare</th>\";\n\t\techo \"<th>Destinatia</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_decolare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"destinatia\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function index(){\n return $this->model->all();\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function all()\n\t{\n\t\treturn $this->model->all();\n\t}", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "public function all()\n {\n return $this->model->all();\n }", "protected function render()\n {\n $this->renderer->exec();\n }", "public function index()\n\t{\n\t\t$data = array();\n\t\t$model_data\t\t\t=\tarray();\n\t\t\n\t\t$model_data['model_list']\t=\t$this->model_model->get_all_models();\n\n $data['navigation'] = $this->load->view('template/navigation','',TRUE);\n $data['content'] = $this->load->view('pages/model/model',$model_data,TRUE);\n $data['footer'] = $this->load->view('template/footer','',TRUE);\n\t\t$this->load->view('template/main_template',$data);\n\t}", "public function index()\n\t{\n\t\treturn View::make('objects.index', array('objects' => Object::all()));\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function render()\n\t{\n\t\techo $this->export();\n\t}", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "public function afficheAll(){\r\n\r\n\t\t$categorys = $this -> getModel() -> getAllCategorys();\r\n\r\n\t\t$params = array(\r\n\t\t\t'categories' => $categories\r\n\t\t\t\r\n\t\t\t);\r\n\t\treturn $this -> render('layout.html','articles_view.php',$params);\r\n\t\t// 2 : Afficher la vue\r\n\r\n\t\t// require __DIR__.'/../View/articles_view.php';\r\n\r\n\t}", "public function showAll()\n {\n\t\t$allCars = Car::all();\n\t\t$allImages = Image::all();\n\t\t\n\t\treturn view('car.showAll')->with(\"allCars\", $allCars)\n\t\t\t\t\t\t\t\t ->with(\"allImages\", $allImages);\n }", "public function all()\n {\n return $this->model->get();\n }", "public function render()\n {\n return view('components.data-table');\n }", "public function actionIndex()\n {\n\t\t\n\t\tif(Yii::$app->getRequest()->getPathInfo() == 'product')\n\t\t{\n\t\t\t$models = Product::find()->where(['=', 'cut_price', 0])->all();\t\t\n\t\t\t$soodus = false;\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\t$models = Product::find()->where(['>', 'cut_price', 0])->all();\n\t\t\t$soodus = true;\n\t\t}\n\t\tforeach($models as $model)\n\t\t{\n\t\t\t$model->product_field = ProductField::find()->where(['product_id' => $model->getAttribute('id')])->all();\t\t\t\n\t\t\t$model->field_type[] = FieldType::find()->orderBy('order_by')->all();\n\t\t\tforeach ($model->product_field as $pf) {\n\t\t\t\t$field = Field::find()->where(['id' => $pf->getAttribute('field_id')])->all();\n\t\t\t\t$model->field[] = $field;\n\t\t\t}\n\t\t}\n\n return $this->render('index', [\n 'models' => $models,\n\t\t\t'soodus' => $soodus,\n ]);\n }", "public function actionIndex()\n {\n\n $model = $this->findModel();\n $dataProvider = new ActiveDataProvider([\n 'query' => $model,\n 'pagination' => [\n 'pageSize' => 4\n ]\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "function index(){\n $alumnos=$this->model->get();\n $this->view->alumnos=$alumnos;\n $this->view->render('alumno/index');\n }", "public function all()\n {\n return $this->getModel()->all();\n }", "public function viewall() {\n $kidphysical_view = NidaraKidPhysicalInfo::find();\n if ($kidphysical_view):\n \n\n\t\treturn $this->response->setJsonContent ([ \n\t\t\t\t\t'status' => true,\n\t\t\t\t\t'data' =>$kidphysical_view\n\t\t\t]);\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'Faield']);\n endif;\n }", "public function all()\n {\n return $this->model->get();\n }", "public function index()\n {\n $models = Collection::make($this->repository->getAll([], true));\n\n $this->layout->content = View::make('translations.admin.index')\n ->withModels($models);\n }", "protected function RenderComponents() {\n \t foreach($this->_components as $compontent) {\n \t \tif($compontent instanceof Writable) {\n \t \t\t$compontent->Render();\n \t \t}\n \t }\t\n \t}", "function index() {\n \n $this->view->set('textData', $this->model->textData());\n\t\t$this->view->render('index/index');\n\t}", "public function index()\n {\n return $this->model->getAll();\n }", "function RenderChildren() {\n if ($this->HasControls()) {\n foreach($this->Controls as $control) {\n $control->Render();\n }\n }\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function allData()\n {\n call_user_func($this->callback, new ChartWidget($this->name, $this->label, $this->authSystem, $this->requiredPermissions, $this->chart));\n }", "public function index()\n {\n View::renderTemplate('header', $data);\n View::render('admin/index', $data);\n View::renderTemplate('footer', $data);\n }", "function index() {\n\n $this->view->render();\n\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function index()\n {\n $this->load->model('Crud_model');\n $records = $this->Crud_model->getRecords();\n $this->load->view('Crud_view', ['records' => $records]);\n }", "public function all()\n {\n if (!$this->isLogged())\n {\n header('Location: ' . ROOT_URL);\n exit; \n }\n else{\n\n $this->oUtil->oAdd_Admins = $this->oModel->getAll();\n\n $this->oUtil->getView('admin');\n }\n }", "public function actionIndex()\n {\n $models = Params::find()->indexBy('id')->all();\n// echo \"<h3><pre>\";var_dump($models);die;\n if(Params::loadMultiple($models,Yii::$app->request->post()) && Params::validateMultiple($models)){\n foreach ($models as $model)\n $model->save(false);\n\n return $this->refresh();\n }\n// else{\n// echo \"<h3><pre>\";var_dump(Yii::$app->request->post());die;\n// }\n\n $bs = $this->module->bs;\n// var_dump($bs);die;\n\n return $this->render('index', [\n 'models' => $models,\n 'bs' => $bs,\n ]);\n }", "public function getAll()\n {\n $this->authorizeUserAction('viewAll');\n\n $model = new static::$model;\n\n // If we are caching the endpont, do a simple get all resources\n if (static::$cacheAll) {\n return $this->response->collection(Cache::remember(static::getCacheKey(), static::$cacheExpiresIn, function () use ($model) {\n return $model::with($model::getCollectionWith())->get();\n }), $this->getTransformer());\n }\n\n $query = $model::with($model::getCollectionWith());\n $this->qualifyCollectionQuery($query);\n\n // Handle pagination, if applicable\n $perPage = $model->getPerPage();\n if ($perPage) {\n // If specified, use per_page of the request\n if (request()->has('per_page')) {\n $perPage = intval(request()->input('per_page'));\n }\n\n $paginator = $query->paginate($perPage);\n\n return $this->response->paginator($paginator, $this->getTransformer());\n } else {\n $resources = $query->get();\n\n return $this->response->collection($resources, $this->getTransformer());\n }\n }", "public function render_content_items() {\n\t\tforeach ( (array) $this->get_content_items() as $content_item ) {\n\t\t\t$content_item->render();\n\t\t}\n\t}", "function render()\n {\n return $this->viewModel->render();\n }", "public function index()\n\t{\n $this->view->render();\n\t}", "public static function getAll() {\r\r $cafeterias = Cafeteria::getAll();\r\r\r\r $salida = [\r 'status' => 1,\r 'data' => $cafeterias\r ];\r\r\r\r View::render($cafeterias);\r }", "public function draw() {\n\n $templates = $this->templateDao->get_all_templates();\n if ($templates === null) {\n $templates = [];\n echo \"</br><b>ERROR: get_all_templates did not return a valid result.</b>\";\n }\n\n include_once Config::VIEW_PATH.\"admin-main-page.php\";\n }", "private function _display_all_records_full_view(){\n\t\t\t/*------------------------------*/\n\t\t\t\n\t\t\t$this->class_settings[ 'html' ] = array( 'html-files/templates-1/'.$this->table_name.'/display-all-records-full-view' );\n\t\t\t\n\t\t\t$datatable = $this->_display_data_table();\n\t\t\t$form = $this->_generate_new_data_capture_form();\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['data_entry_form'] = $form['html'];\n\t\t\t$this->class_settings[ 'data' ]['html'] = $datatable['html'];\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['title'] = \"Manage Countries\";\n\t\t\t$this->class_settings[ 'data' ]['hide_main_title'] = 1;\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['hide_clear_tab'] = 1;\n\t\t\t$this->class_settings[ 'data' ]['hide_details_tab'] = 1;\n\t\t\t$this->class_settings[ 'data' ]['hide_reports_tab'] = 1;\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['col_1'] = 3;\n\t\t\t$this->class_settings[ 'data' ]['col_2'] = 9;\n\t\t\t\n\t\t\t$returning_html_data = $this->_get_html_view();\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'new-status',\n\t\t\t\t'javascript_functions' => array( 'recreateDataTables', 'set_function_click_event', 'update_column_view_state', 'prepare_new_record_form_new' ) \n\t\t\t);\n\t\t}", "public function render()\n {\n // $datas=tapel::all();\n // dd($datas);\n return view('components.table-tapel');\n }", "public function all()\n {\n // TODO: Implement all() method.\n }", "public function all()\n {\n // TODO: Implement all() method.\n }", "public function index(){\n\t\t$this->view->render($this,'index');\n\t}", "public function actionIndex()\n {\n $searchModel = new DataSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Oadode::find(),\n ]);\n\n $dataProviderDescription = new ActiveDataProvider([\n 'query' => DescriptionOfGoods::find(),\n ]);\n \n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'dataProviderDescription' => $dataProviderDescription\n ]);\n }", "private function _display_all_records_full_view(){\n\t\t\t/*------------------------------*/\n\t\t\t//$this->class_settings[ 'html' ] = array( 'html-files/templates-1/'.$this->table_name.'/custom-buttons.php' );\n\t\t\t//$this->datatable_settings['custom_edit_button'] = $this->_get_html_view();\n\t\t\t\n\t\t\t$this->class_settings[ 'html' ] = array( 'html-files/templates-1/'.$this->table_name.'/display-all-records-full-view' );\n\t\t\t\n\t\t\t$datatable = $this->_display_data_table();\n\t\t\t$form = $this->_generate_new_data_capture_form();\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['data_entry_form'] = $form['html'];\n\t\t\t$this->class_settings[ 'data' ]['html'] = $datatable['html'];\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['title'] = \"Manage Discounts\";\n\t\t\t$this->class_settings[ 'data' ]['hide_main_title'] = 1;\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['hide_clear_tab'] = 1;\n\t\t\t//$this->class_settings[ 'data' ]['hide_details_tab'] = 1;\n\t\t\t$this->class_settings[ 'data' ]['hide_reports_tab'] = 1;\n\t\t\t\n\t\t\t$this->class_settings[ 'data' ]['col_1'] = 3;\n\t\t\t$this->class_settings[ 'data' ]['col_2'] = 9;\n\t\t\t\n\t\t\t$returning_html_data = $this->_get_html_view();\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'new-status',\n\t\t\t\t'javascript_functions' => array( 'recreateDataTables', 'set_function_click_event', 'update_column_view_state', 'prepare_new_record_form_new' ) \n\t\t\t);\n\t\t}", "public function showAll()\n {\n $objects = $this->repo->showAll();\n return view('admin.showAll', compact('objects') );\n }", "public function render()\n {\n return $this->renderChildren();\n }", "public function showAll()\n {\n }", "public function getAll()\n {\n return $this->prepareData($this->model->all());\n }", "public function actionIndex()\n {\n //debug(Yii::$aliases);\n $searchModel = new DataSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }" ]
[ "0.6733265", "0.6728003", "0.6491793", "0.6404467", "0.6394224", "0.6354269", "0.6277181", "0.6165837", "0.616017", "0.61310226", "0.6122586", "0.6006232", "0.60050344", "0.59575677", "0.5944481", "0.594103", "0.5926553", "0.58819544", "0.5866511", "0.5861125", "0.5849183", "0.5839678", "0.58079314", "0.57987773", "0.57934535", "0.57711345", "0.5763208", "0.5762659", "0.575927", "0.5750211", "0.5745999", "0.57252437", "0.57206357", "0.5718044", "0.5695692", "0.56950706", "0.56912374", "0.568986", "0.5684804", "0.56637037", "0.56561494", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56421775", "0.56413", "0.56396335", "0.56385124", "0.5631983", "0.5626161", "0.5623014", "0.56207347", "0.5620063", "0.5615308", "0.5609333", "0.55997", "0.55769736", "0.5576499", "0.55741024", "0.55728245", "0.5571368", "0.5558736", "0.5557114", "0.5552804", "0.554699", "0.5533712", "0.55315804", "0.5530176", "0.5523426", "0.5515278", "0.5499912", "0.5499912", "0.5499912", "0.54943764", "0.5493556", "0.54882056", "0.5485313", "0.54737645", "0.54720014", "0.54690033", "0.5455498", "0.54492", "0.5447638", "0.5439723", "0.54384106", "0.54384106", "0.5434272", "0.54277194", "0.5419629", "0.5418383", "0.5418154", "0.54015565", "0.5396768", "0.5396065", "0.5387118" ]
0.0
-1
Calls [[beforeItemList]] closure, returns execution result. If [[beforeItemList]] is not a closure, `null` will be returned.
public function renderBeforeItemList() { if ($this->beforeItemList instanceof Closure) { return call_user_func($this->beforeItemList, $this); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function beforeStandard( array $item);", "public function renderAfterItemList()\n {\n if ($this->afterItemList instanceof Closure) {\n return call_user_func($this->afterItemList, $this);\n }\n return null;\n }", "public function before(\\Closure $before);", "public function testItemsProcFunc()\n {\n }", "abstract protected function onBeforeAdd($oItem);", "function before(\\Closure $closure)\n{\n pho\\before($closure);\n}", "public function beforeListModel(){\n\n }", "protected abstract function before();", "public static function mustRunBefore(): iterable;", "public function processProductBefore(&$product, &$parent, &$item)\n {\n return $this;\n }", "abstract function before();", "public function getItemsBeforePageBreak()\r\n {\r\n return $this->templateConfiguration['itemsBeforePageBreak'];\r\n }", "abstract protected function before();", "public function beforePrepare($itemArray, Cond $cond = null)\n {\n return $itemArray;\n }", "public function keepItemsInArrayCanUseClosure() {}", "protected function getAddBeforeFunction()\n {\n \n }", "function newItemBefore()\r\n\t{\r\n\t\t$this->content_obj->newItemBefore();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function testBeforeToHtml()\n {\n $subject = $this->createMock(\n \\Magento\\Sales\\Block\\Adminhtml\\Order\\Creditmemo\\Create\\Items::class\n );\n $refundBtn = $this->createPartialMock(\n \\Magento\\Framework\\View\\Element\\AbstractBlock::class,\n ['setLabel']\n );\n $order = $this->createMock(\\Magento\\Sales\\Api\\Data\\OrderInterface::class);\n $orderPayment = $this->createMock(\\Magento\\Sales\\Api\\Data\\OrderPaymentInterface::class);\n $subject->expects($this->once())->method('getOrder')->willReturn($order);\n $order->expects($this->once())->method('getPayment')->willReturn($orderPayment);\n $orderPayment->expects($this->once())\n ->method('getMethod')\n ->willReturn(\\Magento\\CompanyCredit\\Model\\CompanyCreditPaymentConfigProvider::METHOD_NAME);\n $subject->expects($this->once())->method('getChildBlock')->with('submit_offline')->willReturn($refundBtn);\n $refundBtn->expects($this->once())->method('setLabel')->with(__('Refund to Company Credit'))->willReturnSelf();\n $this->itemsPlugin->beforeToHtml($subject);\n }", "protected function get__futureItems()\n\t{\n\t\treturn NULL;\n\t}", "private function get_filterItemsDefault()\n {\n $arr_return = array();\n\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n // Default return value\n $items = null;\n $arr_return[ 'data' ][ 'items' ] = $items;\n\n // Add the first item to the rows\n $this->set_firstItem();\n\n // LOOP rows\n $this->row_number = 0;\n\n//var_dump( __METHOD__, __LINE__, 'Sieht so aus, wie wenn $uid von $this->rows nicht multiple ist. Wo wird $uid gesetzt?' . PHP_EOL, $this->rows );\n foreach ( ( array ) $this->rows as $uid => $row )\n {\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $value = $row[ $key ];\n\n // #56339, dwildt, +\n list( $table ) = explode( '.', $this->curr_tableField );\n switch ( true )\n {\n case( $this->pObj->localTable == $table ):\n $items = $this->get_filterItemLocaltable( $uid, $value, $items );\n break;\n default:\n $items = $this->get_filterItemForeigntable( $uid, $value, $items );\n//var_dump( __METHOD__, __LINE__, $uid, $value, $items );\n break;\n }\n $this->row_number++;\n }\n // LOOP rows\n $items = $this->get_maxItemsWrapBeginEnd( $items );\n\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n\n $trimItems = trim( $items );\n if ( !empty( $trimItems ) )\n {\n $arr_return[ 'data' ][ 'items' ] = $items;\n }\n else\n {\n unset( $arr_return );\n }\n return $arr_return;\n }", "public function runBeforeRender(): self\n {\n foreach ($this->beforeRender as $before) {\n $before->call($this);\n }\n\n return $this;\n }", "public function unshift() {\n return function (...$value) {\n array_unshift($this->items, ...$value);\n };\n }", "function cm_tools_item_list_pre_render($elements) {\n\n // Need to replace the #type since theme('item_list')\n // expects to find 'ul' or 'ol' there, not 'cm_item_list'!\n $elements['#type'] = $elements['#list_type'];\n\n // Sadly a bit of magic is necessary here since '#items'\n // can legitimately be an array.\n foreach ($elements['#items'] as &$item) {\n\n // An item can be it's contents directly, or the\n // contents can be found in the 'data' property.\n if (is_array($item) && isset($item['data'])) {\n $item = &$item['data'];\n }\n\n if (is_array($item) && !isset($item['children'])) {\n $item = drupal_render($item);\n }\n }\n\n return $elements;\n}", "public static function _before() : void {\n\t}", "public function test_prepare_item() {}", "function OnBeforeDeleteItem(){\n }", "public function beforeExecute($inventoryObserver, Observer $observer)\n {\n $this->execute($observer);\n return [$observer];\n }", "public function before(\\Closure $callback)\n {\n $this->affirmCallable($callback, \"before\");\n $this->before = $callback;\n }", "public function getItemsBeforeFirstPageBreak()\r\n {\r\n return $this->templateConfiguration['itemsBeforeFirstPageBreak'];\r\n }", "protected function get__items()\n\t{\n\t\treturn NULL;\n\t}", "protected function before(){}", "function prepend($item) {\r\n return Match::on($item)\r\n ->ListM(function($list) {\r\n return new self(array_merge($list->value(), $this->list));\r\n })\r\n ->any(function($item) {\r\n return new self(array_merge([$item], $this->list));\r\n })\r\n ->value(); \r\n }", "public function run_before_each($context, $global=true) {\n if ($global) {\n if (Preview::$config->before_each_hook instanceof \\Closure) {\n $this->invoke_closure_with_context(\n Preview::$config->before_each_hook, $context);\n }\n }\n\n if ($this->parent) {\n $this->parent->run_before_each($context, false);\n }\n\n foreach ($this->before_each_hooks as $before) {\n $this->invoke_closure_with_context($before, $context);\n }\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "function get_previous_item($item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n return $item->previous();\n}", "protected function getUpdateBeforeFunction()\n {\n \n }", "abstract protected function _getItems();", "public function beforeCreate(&$lstNewRecords){\n }", "public function prepend(...$items): self;", "protected function processBeforeHooks()\n {\n foreach ($this->beforeHooks as $hook) {\n if (is_callable($hook)) {\n $this->documents = call_user_func($hook);\n }\n\n if (is_string($hook)) {\n $this->documents = $this->app->call($hook, [$this->documents]);\n }\n }\n }", "public function listItems()\n {\n return null;\n }", "protected function computeItems() {\n $items = [];\n $callback = $this->getSetting('compute_callback');\n if (is_callable($callback)) {\n $items = $callback($this);\n }\n return $items;\n }", "public static function action_before_process_item() {\n\t\t\tPT_CV_Functions::disable_view_shortcode();\n\t\t}", "public function executeBefore()\r\n {\r\n $this->please->setStorage([\r\n '___ACFCollection' => [ 'content' => function(){ return $this->bloggyRepo->findBy(['type' => 'acf']); } ],\r\n '___PagesCollection' => [ 'content' => function(){ return $this->bloggyRepo->findBy(['type' => 'page']); } ],\r\n '___ACFChildrenCollection' => [ 'content' => function(){\r\n return $this->please->findLike($this->bloggyRepo, $this->bloggiesTable, [\r\n 'info[acf]' => null // null means we dont have the exact value\r\n ])['get']('rows');\r\n } ],\r\n '___ACFChildren2Collection' => [ 'content' => function(){\r\n return $this->please->findLike($this->bloggyRepo, $this->bloggiesTable, [\r\n 'info[_acf]' => null // null means we dont have the exact value\r\n ])['get']('rows');\r\n } ],\r\n '___UsersCollection' => [ 'content' => function(){ return $this->userRepo->findBy([], ['lastname' => 'asc']); } ],\r\n ], true);\r\n\r\n $this->setVisitsCount();\r\n }", "function event_PreItem($data) {\n global $item;\n $item = &$data[\"item\"];\n $this->authorid = $item->authorid;\n if (strstr($item->body . \" \" . $item->more, \"<%Podcast(\")) {\n $item->body = preg_replace_callback(\"#<\\%Podcast\\((.*?)\\|(.*?)\\)%\\>#\", array(&$this, 'replaceCallback'), $item->body);\n $item->mmore = preg_replace_callback(\"#<\\%Podcast\\((.*?)\\|(.*?)\\)%\\>#\", array(&$this, 'replaceCallback'), $item->more);\n }\n }", "public function getBeforeMatch()\n {\n return $this->beforeMatchCallback;\n }", "function culturefeed_agenda_preprocess_culturefeed_agenda_nearby_activities_list_item(&$variables) {\n\n _culturefeed_agenda_preprocess_agenda($variables);\n _culturefeed_agenda_preprocess_event($variables);\n\n}", "protected function _beforeSave() {\n\t\tif(version_compare(Mage::getVersion(),'1.4.0.0') >= 0) {\n\t\t\tparent::_beforeSave();\n\t\t\tMage::dispatchEvent('cataloginventory_stock_item_save_before', array('item' => $this));\n \treturn $this;\n\t\t} else {\n\t\t\treturn parent::_beforeSave();\n\t\t}\n\t}", "function onBeforeAdd() {\n\t\treturn true;\n\t}", "abstract protected function prepareContextItem();", "protected function _before()\n\t{\n\t\t\n\t}", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function remove() \n {\n return function ($value, bool $removeFirstOnly = false) {\n $this->items = Arr::remove($value, $this->items, $removeFirstOnly);\n };\n }", "public function do_head_items()\n {\n }", "public function firstItem();", "abstract protected function beforeRun($data);", "public function inListForItemContainedReturnsTrueDataProvider() {}", "public function testGetRequisitionListItems()\n {\n $requisitionListId = 1;\n $websiteId = 1;\n\n $this->request->expects($this->once())\n ->method('getParam')->with('requisition_id')->willReturn($requisitionListId);\n $requisitionListItem = $this\n ->getMockBuilder(\\Magento\\RequisitionList\\Api\\Data\\RequisitionListItemInterface::class)\n ->disableOriginalConstructor()->getMock();\n $websiteMock = $this->getMockBuilder(\\Magento\\Store\\Api\\Data\\WebsiteInterface::class)\n ->disableOriginalConstructor()->setMethods(['getId'])->getMockForAbstractClass();\n $this->storeManager->expects($this->atLeastOnce())->method('getWebsite')->willReturn($websiteMock);\n $websiteMock->expects($this->atLeastOnce())->method('getId')->willReturn($websiteId);\n $this->itemSelector->expects($this->atLeastOnce())->method('selectAllItemsFromRequisitionList')\n ->with($requisitionListId, $websiteId)->willReturn([$requisitionListItem]);\n $this->validation->expects($this->once())->method('validate')->with($requisitionListItem)->willReturn([]);\n $this->assertEquals([$requisitionListItem], $this->grid->getRequisitionListItems());\n $this->assertEquals(0, $this->grid->getItemErrorCount());\n }", "public static function before() {\n\t\t// Return true for the actions below to execute\n\t\treturn true;\n\t}", "public function filterBefore($criteria, $filter);", "public function before($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function before($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function register_block_core_page_list_item()\n {\n }", "function custom() {\n\n $menu_id = Sanitize::getInt($this->params,'Itemid');\n\n $params = $this->Menu->getMenuParams($menu_id);\n\n $custom_where = Sanitize::getString($params,'custom_where');\n\n $custom_order = Sanitize::getString($params,'custom_order');\n\n if($custom_where !='') {\n\n $custom_where = str_replace(\n array('{user_id}'),\n array($this->_user->id),\n $custom_where);\n\n $this->Listing->conditions[] = $custom_where;\n }\n\n $custom_order !='' and $this->Listing->order[] = $custom_order;\n\n return $this->listings();\n }", "function getItems();", "function getItems();", "protected function _beforeToHtml()\n {\n $toolbar_top = $this->getToolbarBlock();\n $toolbar_bottom = $this->getBottomToolbarBlock();\n\n // called prepare sortable parameters\n $collection = $this->_getProductCollection();\n\n // use sortable parameters\n if ($orders = $this->getAvailableOrders()) {\n $toolbar_top->setAvailableOrders($orders);\n $toolbar_bottom->setAvailableOrders($orders);\n }\n if ($sort = $this->getSortBy()) {\n $toolbar_top->setDefaultOrder($sort);\n }\n if ($dir = $this->getDefaultDirection()) {\n $toolbar_top->setDefaultDirection($dir);\n }\n if ($modes = $this->getModes()) {\n $toolbar_top->setModes($modes);\n $toolbar_bottom->setModes($modes);\n }\n\n // set collection to toolbars and apply sort\n $toolbar_top->setCollection($collection);\n $toolbar_bottom->setCollection($collection);\n\n $toolbar_top->setTemplate('catalog/product/list/toolbar_top.phtml');\n $this->setChild('toolbar_top', $toolbar_top);\n\n $toolbar_bottom->setTemplate('catalog/product/list/toolbar_bottom.phtml');\n $this->setChild('toolbar_bottom', $toolbar_bottom);\n\n Mage::dispatchEvent('catalog_block_product_list_collection', array(\n 'collection' => $this->_getProductCollection()\n ));\n\n $this->_getProductCollection()->load();\n\n return parent::_beforeToHtml();\n }", "public function _before()\n {\n }", "public function onBeforeRun()\n\t{\n\t\t$this->raiseEvent('onBeforeRun', new TestRunnerEvent($this, $this->collection));\n\t}", "function calculateLeftPosition(array $prevItem, $margin = 0)\n{\n $left = $prevItem['left'] + $prevItem['width'] + $margin;\n return $left + 1;\n}", "public function before()\n\t{\n\t}", "function before_block( $instance ) {\n\t\t}", "public function ItemParams2( $observer )\n {\n $items=$observer->getItems();\n foreach($items as $item){\n ////Mage::log($item->getId());\n $quoteItems = $item->getQuote()->getAllVisibleItems();\n foreach ($quoteItems as $quoteItem) {\n ////Mage::log($quoteItem->getItemId());\n //Mage::log($quoteItem->getItemId());\n}\n}\n\n }", "public function getItemsCriteria() {}", "function before() {\n\t\tparent::before();\n\t\t$this->_activity_result[] = $this->request->param(\"id\");\n\t}", "public function getItemsCriteria() {}", "public function testAddItemUsingStubIsValid()\n\t{\n\t\t$stub = \\Orchestra\\Widget::make('stub');\n\t\t$expected = array(\n\t\t\t'foo' => new \\Orchestra\\Support\\Fluent(array(\n\t\t\t\t'id' => 'foo',\n\t\t\t\t'title' => 'foobar',\n\t\t\t\t'foobar' => false,\n\t\t\t\t'childs' => array(),\n\t\t\t)),\n\t\t\t'foobar' => new \\Orchestra\\Support\\Fluent(array(\n\t\t\t\t'id' => 'foobar',\n\t\t\t\t'title' => 'hello world',\n\t\t\t\t'foobar' => true,\n\t\t\t\t'childs' => array(),\n\t\t\t)),\n\t\t);\n\n\t\t$stub->add('foobar', 'parent', function ($item)\n\t\t{\n\t\t\t$item->title = 'hello world';\n\t\t});\n\n\t\t$stub->add('foo', 'before:foobar', function ($item)\n\t\t{\n\t\t\t$item->foobar = false;\n\t\t})->title('foobar');\n\n\t\t$this->assertEquals($expected, $stub->get());\n\t\t$this->assertEquals($expected, $stub->items);\n\t}", "function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}", "public function before_run(){}", "protected function _before()\n {\n }", "public function getFirstItem() {}", "public function getFirstItem() {}", "public function getItemsLeft()\n {\n return $this->itemsLeft;\n }", "public function before(callable $delegate) {\n\t\t\t$this->before = $delegate;\n\t\t\treturn $this;\n\t\t}", "public function PreviousOf($item)\n {\n return $item->GetPrevious();\n }", "public function addItemPreperationCallback($callback) {\n if (!is_callable($callback)) {\n throw new \\Exception(\"The callback argument must be callable.\");\n }\n $this->callbacks['ItemPreperation'][] = $callback;\n\n return $this;\n }", "public function getBefore():? string;", "protected function filterItems()\n\t{\n\t\t// must be in this order\n\t\t$this->applyDefaultFiltering();\n\t\t$this->applyDefaultSorting();\n\t\t$this->applyItems();\n\t\t$this->applyFiltering();\n\t\t$this->applySorting();\n\t\t$this->applyPaging();\n\t}", "public function __parentBeforeRender() {\r\n\t\treturn parent::beforeRender();\t\t\r\n\t}", "public function before() {}", "public function before() {}", "public function afterPrepare($itemArray, Cond $cond = null)\n {\n return $itemArray;\n }", "abstract protected function _preProcess();", "public function onApplySetup()\n {\n $this->prepareComponent();\n if (($visibleColumns = post('visible_columns')) && is_array($visibleColumns)) {\n $this->listWidget->columnOverride = $visibleColumns;\n $this->putSession('visible', $this->listWidget->columnOverride);\n }\n\n $this->listWidget->recordsPerPage = post('records_per_page', $this->listWidget->recordsPerPage);\n $this->putSession('order', post('column_order'));\n $this->putSession('per_page', $this->listWidget->recordsPerPage);\n return $this->refreshListTable();\n }", "public function run($item);", "private function before_execute()\n {\n }" ]
[ "0.60648245", "0.5954297", "0.5634001", "0.54083633", "0.5383641", "0.51356035", "0.50665325", "0.5065888", "0.5008768", "0.49959952", "0.49618578", "0.49402088", "0.49342456", "0.49299675", "0.48847884", "0.4844508", "0.48094004", "0.4794304", "0.4782849", "0.47761506", "0.475778", "0.46706006", "0.46467918", "0.46415734", "0.46291658", "0.46201333", "0.46060243", "0.45931056", "0.45485675", "0.4548192", "0.45450047", "0.45265052", "0.45164752", "0.4500097", "0.4500097", "0.4500097", "0.4499019", "0.44989827", "0.44906715", "0.4478926", "0.44658452", "0.44569325", "0.44505632", "0.4447754", "0.44407898", "0.44362625", "0.44328624", "0.4420289", "0.44164512", "0.44037837", "0.44035345", "0.4395491", "0.43903178", "0.43867874", "0.43732962", "0.43565547", "0.4350818", "0.43416405", "0.43347752", "0.43281722", "0.43190658", "0.43155614", "0.43151212", "0.42923716", "0.42914695", "0.42914695", "0.4278739", "0.42763305", "0.42755973", "0.42755973", "0.4275183", "0.4271567", "0.42690995", "0.42684853", "0.4264643", "0.4263256", "0.4254466", "0.42540574", "0.42537394", "0.4253128", "0.4251281", "0.42479968", "0.42469794", "0.42376405", "0.4236365", "0.4236006", "0.42341244", "0.42320323", "0.42202163", "0.42101693", "0.42099577", "0.4204981", "0.4204222", "0.41997963", "0.41997963", "0.41976166", "0.41944692", "0.41917786", "0.41821063", "0.41747713" ]
0.7880634
0
Calls [[afterItemList]] closure, returns execution result. If [[afterItemList]] is not a closure, `null` will be returned.
public function renderAfterItemList() { if ($this->afterItemList instanceof Closure) { return call_user_func($this->afterItemList, $this); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function after(\\Closure $after);", "public function renderBeforeItemList()\n {\n if ($this->beforeItemList instanceof Closure) {\n return call_user_func($this->beforeItemList, $this);\n }\n return null;\n }", "public function testAfter() {\n\t\t$function = function() {\n\t\t\tstatic $n = null;\n\t\t\tif (is_null($n)) {\n\t\t\t\t$n = 1;\n\t\t\t} else {\n\t\t\t\t++$n;\n\t\t\t}\n\t\t\treturn $n;\n\t\t};\n\t\t$afterFunction = _::after(3, $function);\n\t\t$result1 = $afterFunction();\n\t\t$this->assertNull($result1);\n\t\t$result2 = $afterFunction();\n\t\t$this->assertNull($result2);\n\t\t$result3 = $afterFunction();\n\t\t$this->assertEquals(1, $result3);\n\t\t$result4 = $afterFunction();\n\t\t$this->assertEquals(2, $result4);\n\t}", "function after(\\Closure $closure)\n{\n pho\\after($closure);\n}", "abstract function after();", "abstract protected function after();", "protected function after(){}", "protected function after(){}", "protected function after(){}", "public function item($item, $transformer, $parameters = [], Closure $after = null)\n {\n return $this->factory->item($item, $transformer, $parameters, $after);\n }", "public function after($callback);", "public function afterBatch();", "function newItemAfter()\r\n\t{\r\n\t\t$this->content_obj->newItemAfter();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "protected function getAddAfterFunction()\n {\n \n }", "public function after() {}", "public static function _after() : void {\n\t}", "function PostProcess($item)\n {\n $this->Sql_Select_Hash_Datas_Read($item,array(\"Friend\",\"Name\"));\n\n $name=$this->FriendsObj()->Friend_Name_Text($item[ \"Friend\" ]);\n \n \n $updatedatas=array();\n if (empty($item[ \"Name\" ]) || $item[ \"Name\" ]!=$name)\n {\n $item[ \"Name\" ]=$name;\n array_push($updatedatas,\"Name\");\n }\n\n $this->Sql_Select_Hash_Datas_Read\n (\n $item,\n array_merge\n (\n $this->MyMod_Item_Groups_Compulsory_Data($this->InscriptionSGroups(0),True),\n array(\"Status\",\"Completed\")\n )\n );\n \n if ($item[ \"Status\" ]==1 || !$this->Inscription_Complete($item))\n {\n if (empty($item[ \"Complete\" ]) || $item[ \"Complete\" ]!=1)\n {\n $item[ \"Complete\" ]=1;\n array_push($updatedatas,\"Complete\");\n }\n }\n else\n {\n if (empty($item[ \"Complete\" ]) || $item[ \"Complete\" ]!=2)\n {\n $item[ \"Complete\" ]=2;\n array_push($updatedatas,\"Complete\");\n }\n }\n\n if (count($updatedatas)>0)\n {\n $this->Sql_Update_Item_Values_Set($updatedatas,$item);\n }\n \n return $item;\n }", "protected function callAfterDispatchCallbacks()\r\n {\r\n try {\r\n foreach ($this->after_filter_callbacks as $callback) {\r\n if (is_callable($callback)) {\r\n if (is_string($callback)) {\r\n $callback($this);\r\n\r\n } else {\r\n call_user_func($callback, $this);\r\n\r\n }\r\n }\r\n }\r\n } catch (Exception $e) {\r\n $this->error($e);\r\n }\r\n }", "public function after(\\Closure $callback)\n {\n $this->affirmCallable($callback, \"after\");\n $this->after = $callback;\n }", "function OnAfterDeleteItem(){\n }", "function afterAction()\n {\n }", "public function lastItem();", "public function getLastItem() {}", "public function getLastItem() {}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function after_foo()\n {\n }", "abstract protected function onBeforeAdd($oItem);", "protected function after_execute() {\n // Add iadlearning related files, no need to match by itemname (just internally handled context).\n $this->add_related_files('mod_iadlearning', 'intro', null);\n }", "protected function get__futureItems()\n\t{\n\t\treturn NULL;\n\t}", "public function run(\\Traversable $items, callable $itemCallback)\n {\n $this->start();\n foreach ($items as $item) {\n call_user_func($itemCallback, $this, $item);\n }\n return $this->finish();\n }", "protected function getUpdateAfterFunction()\n {\n \n }", "protected function callAfterCallbacks(Application $app)\n {\n foreach ($this->_afterCallbacks as $callback) {\n call_user_func($callback, $app);\n }\n }", "public function afterPrepare($itemArray, Cond $cond = null)\n {\n return $itemArray;\n }", "public function after()\n\t{\n\t}", "public function onAfterDelete() {\n parent::onAfterDelete();\n\n foreach ($this->Items() as $item) {\n $item->delete();\n }\n }", "public function _after($I)\n {\n }", "public function afterHook()\n\t{\n\t\t$session = JFactory::getSession();\n\n\t\t$arrMenuSwapped = $session->get('arrMenuSwapped', null, 'jtransport');\n\n\t\tforeach ($arrMenuSwapped as $item)\n\t\t{\n\t\t\t$objTable = JTable::getInstance('menu', 'JTable', array('dbo' => $this->_db));\n\n\t\t\t$objTable->load($item['new_id']);\n\n\t\t\t$objTable->parent_id = JTransportHelper::lookupNewId('arrMenu', $item['old_parent_id']);\n\n\t\t\t$objTable->setLocation($objTable->parent_id, 'last-child');\n\n\t\t\tif (!$objTable->store())\n\t\t\t{\n\t\t\t\techo JError::raiseError(500, $objTable->getError());\n\t\t\t}\n\t\t}\n\n\t\treturn parent::afterHook();\n\t}", "public function hook_after($postdata,&$result) {\n\n\t\t }", "public function hook_after($postdata,&$result) {\n\n\t\t }", "public function after_run(){}", "function PostProcessItemData()\n {\n $this->AddEventQuestDatas();\n $this->ItemDataGroups();\n }", "public function hookAfterSaveItem($args) {\n $item = $args['record'];\n if ($item->item_type_id != get_option('iiifitems_annotation_item_type')) {\n $json = IiifItems_Util_Canvas::buildCanvas($item);\n IiifApiBridge_Util_JsonTransform::transformCanvas($json, $item);\n if ($args['insert']) {\n IiifApiBridge_Queue_Canvas::create($item, $json);\n } else {\n IiifApiBridge_Queue_Canvas::update($item, $json);\n }\n if (!empty($item->collection_id)) {\n $this->hookAfterSaveCollection(array(\n 'record' => get_record_by_id('Collection', $item->collection_id),\n 'insert' => false,\n ));\n }\n } else {\n $annotatedItem = IiifItems_Util_Annotation::findAnnotatedItemFor($item);\n $json = IiifItems_Util_Annotation::buildAnnotation($item);\n IiifApiBridge_Util_JsonTransform::transformAnnotation($json, $item, $annotatedItem);\n if ($args['insert']) {\n IiifApiBridge_Queue_Annotation::create($item, $json);\n } else {\n IiifApiBridge_Queue_Annotation::update($item, $json);\n }\n if (!empty($annotatedItem->collection_id)) {\n $this->hookAfterSaveCollection(array(\n 'record' => get_record_by_id('Collection', $annotatedItem->collection_id),\n 'insert' => false,\n ));\n }\n }\n }", "public function hook_after($postdata,&$result) {\n\t\t\t\n\t\t }", "public function afterUpdate(&$lstNewRecords){\n }", "public static function after() {\n\n\t}", "function OnAfterApply(){\n }", "public function after($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function after($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function afterAction() {\n }", "protected function callAfterLoad($namespace, $group, $items)\n {\n $callback = $this->afterLoad[$namespace];\n\n return call_user_func($callback, $this, $group, $items);\n }", "protected function _after()\n {\n }", "function after_block( $instance ) {\n\t\t}", "function udesign_single_portfolio_entry_after() {\r\n do_action('udesign_single_portfolio_entry_after');\r\n}", "protected function afterAdd() {\n\t}", "public function hook_after($postdata, &$result)\n {\n \n }", "public function hook_after($postdata, &$result)\n {\n \n }", "public function processProductAfter(&$product, &$parent, &$item)\n {\n return $this;\n }", "public function run_after_each($context, $global=true) {\n if ($global) {\n if (Preview::$config->after_each_hook instanceof \\Closure) {\n $this->invoke_closure_with_context(\n Preview::$config->after_each_hook, $context);\n }\n }\n\n if ($this->parent) {\n $this->parent->run_after_each($context, false);\n }\n\n foreach ($this->after_each_hooks as $after) {\n $this->invoke_closure_with_context($after, $context);\n }\n }", "protected function afterIndex(array &$items)\n {\n return true;\n }", "public function after($callback)\n {\n $this->app['events']->listen('custom.queue.after', $callback);\n }", "protected function callAfterCallbacks(array $afterCallbacks, $model, $state)\n {\n if (! isset($afterCallbacks[$this->class][$state])) {\n return;\n }\n\n foreach ($afterCallbacks[$this->class][$state] as $callback) {\n $callback($model, $this->faker);\n }\n }", "public function after(callable $delegate) {\n\t\t\t$this->after = $delegate;\n\t\t\treturn $this;\n\t\t}", "public function run($item);", "function udesign_entry_after() {\r\n do_action('udesign_entry_after');\r\n}", "public function after_insert() {}", "public function testItemsProcFunc()\n {\n }", "function teardown($fn) {\n Preview::$world->current()->add_after_each_hook($fn);\n}", "protected function _after()\n {\n }", "public function after_run() {}", "function listitem_close() {\n $this->doc .= '</li>'.DOKU_LF;\n }", "private function executeAfterSave()\n {\n Logger::getInstance()->po_log(\"Excecute after save \". get_class($this));\n\n foreach ( $this->afterSave as $cb ) $cb->execute();\n\n // Una vez que termino de ejecutar, reseteo los cb's registrados.\n $this->afterSave = array();\n }", "public function remove() \n {\n return function ($value, bool $removeFirstOnly = false) {\n $this->items = Arr::remove($value, $this->items, $removeFirstOnly);\n };\n }", "public function afterGetItemData(\n \\Magento\\Checkout\\CustomerData\\DefaultItem $subject,\n array $result\n ) {\n $result['remove_url'] = $this->_cartHelper->getDeletePostJson(\n $this->_objectFactory->create(['id' => $result['item_id']])\n );\n return $result;\n }", "public function zipWith($items, $callable);", "public function last(callable $callback = null, $default = null)\n {\n return Arr::last($this->items, $callback, $default);\n }", "public function afterEach(\\Closure $callback)\n {\n $this->affirmCallable($callback, \"afterEach\");\n $this->afterEach = $callback;\n }", "public function salesQuoteProductAddAfter($observer)\r\n\t{\r\n\t\t$items = $observer['items'];\t\t\r\n\t\tif(Mage::getModel('checkout/session')->getData('shoppingcart_gift_item')\r\n\t\t ||Mage::getModel('checkout/session')->getData('free_gift_item') \r\n\t\t || Mage::getModel('checkout/session')->getData('promotionalgift_bundle')){\r\n\t\t\tforeach($items as $item){\r\n\t\t\t\t$item->setCustomPrice(0);\r\n\t\t\t\t$item->setOriginalCustomPrice(0);\r\n\t\t\t\t$item->getProduct()->setIsSuperMode(true);\t\r\n\t\t\t}\r\n\t\t\treturn $this;\r\n\t\t}\t\t\t\r\n\t}", "public static function after($name, $callback) {\n self::$filters['after'][$name][] = $callback;\n }", "protected function after(): void\n {\n }", "public function after(Closure $callback)\n\t{\n\t\t$this->globalMiddlewares['after'][] = $callback;\n\t}", "public function after($params = '')\n {\n \t//\n }", "function afterEach(\\Closure $closure)\n{\n pho\\afterEach($closure);\n}", "public function getAndRemoveLastItem();", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\n\t}", "public function onAfterRun()\n\t{\n\t\t$this->raiseEvent('onAfterRun', new TestRunnerEvent($this, $this->collection));\n\t}", "public function after()\n {\n parent::after();\n }", "function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\r\n\t}", "public static function do_over(array $items, \\Closure $lambda, $message = null, array &$extra = array(), $silent = false)\n\t\t{\n\t\t\t$total = count($items);\n\t\t\t$x = 0;\n\t\t\t$msglen = 35;\n\n\t\t\tif (!$silent && is_null($message)) {\n\t\t\t\tforeach ($items as $msg=>$item) {\n\t\t\t\t\tif (($m = strlen($msg)) > $msglen) {\n\t\t\t\t\t\t$msglen = $m;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (($m = strlen($message)) > $msglen) {\n\t\t\t\t\t$msglen = strlen($message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Right margin\n\t\t\t$msglen += 2;\n\n\t\t\tforeach ($items as $msg=>$item) {\n\t\t\t\t$msg = is_null($message) ? $msg:$message;\n\n\t\t\t\tif (!$silent) self::progress($x++, $total, $msg, $msglen);\n\t\t\t\t$lambda($msg, $item, $extra);\n\t\t\t\tif (!$silent) self::progress($x, $total, $msg, $msglen);\n\t\t\t}\n\t\t}", "protected function after() {\n\t\t// Empty default implementation. Should be implemented by descendant classes if needed\n\t}", "public function __after()\t{\n\t}", "public function afterTest(TestCase $t);", "protected function after()\n {\n }", "protected function after()\n {\n }", "protected function afterAction () {\n\t}", "protected function _afterLoad()\n {\n parent::_afterLoad();\n if ($this->getFlag('add_stores_to_result') && $this->_items) {\n /** @var Mage_Rule_Model_Abstract $item */\n foreach ($this->_items as $item) {\n $item->afterLoad();\n }\n }\n\n return $this;\n }", "public function after($callback)\r\n {\r\n // TODO: Implement after() method.\r\n }", "public function unshift() {\n return function (...$value) {\n array_unshift($this->items, ...$value);\n };\n }", "public function afterFind(&$result){\n\t}" ]
[ "0.59151894", "0.5805892", "0.57120335", "0.5468613", "0.5417712", "0.5413289", "0.52891636", "0.52891636", "0.52891636", "0.5236279", "0.5149597", "0.5058522", "0.50542617", "0.50096", "0.4949237", "0.49358782", "0.49172887", "0.48831832", "0.48669282", "0.48277023", "0.4824738", "0.4801473", "0.4796902", "0.4796902", "0.47764108", "0.47764108", "0.47618133", "0.47548392", "0.475436", "0.47543114", "0.4752853", "0.47522804", "0.4748456", "0.4724075", "0.4709221", "0.4700688", "0.46967041", "0.4682315", "0.468136", "0.468136", "0.46739224", "0.46681896", "0.46662962", "0.46662065", "0.46558785", "0.4647189", "0.4617121", "0.461367", "0.461367", "0.46083844", "0.46039698", "0.4600903", "0.45958722", "0.4584628", "0.4576577", "0.45629987", "0.45629987", "0.45612037", "0.45550933", "0.45371187", "0.4524275", "0.45168877", "0.45161304", "0.44953367", "0.44907838", "0.44690925", "0.44659066", "0.44384444", "0.4425226", "0.44167894", "0.4392578", "0.43870023", "0.4382401", "0.43756035", "0.43720952", "0.4354806", "0.43517768", "0.43431973", "0.43425003", "0.43382633", "0.43378535", "0.43179074", "0.43080255", "0.43067932", "0.43004665", "0.42958924", "0.42895636", "0.42859104", "0.42833805", "0.42721125", "0.4270044", "0.42687923", "0.4266967", "0.42661244", "0.42661244", "0.4261664", "0.42562944", "0.42536274", "0.42522514", "0.4246002" ]
0.7876142
0
Register and add settings
public function page_init() { add_settings_section( 'setting_section_id', // ID 'My Custom Settings', // Title array( $this, 'print_section_info' ), // Callback 'my-setting-admin' // Page ); add_settings_field( 'id_number', // ID 'ID Number', // Title array( $this, 'id_number_callback' ), // Callback 'my-setting-admin', // Page 'setting_section_id' // Section ); add_settings_field( 'title', 'Title', array( $this, 'title_callback' ), 'my-setting-admin', 'setting_section_id' ); add_settings_field( 'checkbox', 'Checkbox', array( $this, 'checkbox_callback' ), 'my-setting-admin', 'setting_section_id' ); add_settings_field( 'radio', 'Radio', array( $this, 'radio_callback' ), 'my-setting-admin', 'setting_section_id' ); add_settings_field( 'textarea', 'Textarea', array( $this, 'textarea_callback' ), 'my-setting-admin', 'setting_section_id' ); add_settings_field( 'select', 'Select', array( $this, 'select_callback' ), 'my-setting-admin', 'setting_section_id' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_settings()\n {\n }", "public function register_settings()\n {\n }", "function register_settings() {\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'endpoint'); // Sanitize\n\t\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'check_interval'); // Sanitize\n\t\n\tregister_setting('StandardsReader_settings_group', 'mapPage');\n\tregister_setting('StandardsReader_settings_group', 'mapListing');\n\t\t \n}", "public static function register_settings() {\n\t\t// Settings\n\t\t$settings = array(\n\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t'weight' => 124,\n\t\t\t\t'settings' => array(\n\t\t\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t\t\t'label' => self::__( 'Merchant Edit Profile Path' ),\n\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t'label' => trailingslashit( get_home_url() ),\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => self::$edit_path\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\tdo_action( 'gb_settings', $settings, Group_Buying_UI::SETTINGS_PAGE );\n\t}", "public function register_settings() {\n\t\tregister_setting('eaboot_options', 'eaboot_options', array(&$this, 'validate_settings'));\n\n\t\tforeach ($this->sections as $slug => $title) {\n\t\t\tif ($slug == 'about')\n\t\t\t\tadd_settings_section($slug, $title, array(&$this, 'display_about_section'), 'eaboot_options');\n\t\t\telse\n\t\t\t\tadd_settings_section($slug, $title, array(&$this, 'display_section'), 'eaboot_options');\n\t\t}\n\n\t\t$this->get_settings();\n\n\t\tforeach ($this->settings as $id => $setting) {\n\t\t\t$setting['id'] = $id;\n\t\t\t$this->create_setting($setting);\n\t\t}\n\t}", "public function initSettings()\n {\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_key');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_secret');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_path');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_expires');\n }", "public function register_settings()\n\t{\n\t\t$this->register_setting( NHS_SECTIONS );\n\t}", "public function add_settings() {\n if (self::$settings !== null) {\n $this->print_settings(self::$settings);\n }\n }", "function wcusp_register_settings() {\n\tregister_setting('wcusp_settings_group', 'wcusp_settings');\n}", "public function registerSettings()\n\t\t{\n\t\t\tforeach($this->options as $id => $options) {\n\t\t\t\tregister_setting('thingdom-options', $this->tag.$id);\n\t\t\t}\n\t\t}", "function mpc_register_settings() {\n\tregister_setting('mpc_settings_group', 'mpc_settings');\n}", "public function register_settings() {\n\n\t\tadd_settings_section(\n\t \t'thaim_utilities_section',\n\t \t__( 'Thaim Utilities Settings', 'thaim-utilities' ),\n\t \tarray( $this, 'settings_callback_section' ),\n\t \t'buddypress'\n\t );\n\n\t $settings = apply_filters( 'thaim_utilities_settings_fields', array( \n\t \tarray(\n\t \t\t'name' => 'thaim_link_wordpress_org',\n\t \t\t'title' => __( 'WordPress.org account', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'link_wp_org_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_perpage_wordpress_org',\n\t \t\t'title' => __( 'Number of WordPress plugins to display', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'perpage_wp_org_callback' ),\n\t \t\t'sanitize' => 'absint',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_list_github_repos',\n\t \t\t'title' => __( 'List your github repos', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'list_github_repos_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t ) );\n\n\t\tforeach( $settings as $setting ) {\n\t\t\tadd_settings_field(\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['title'],\n\t\t\t\t$setting['display'],\n\t\t\t\t'buddypress',\n\t\t\t\t'thaim_utilities_section'\n\t\t\t);\n\n\t\t\tregister_setting(\n\t\t\t\t'buddypress',\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['sanitize']\n\t\t\t);\n\t\t}\n\t}", "function hb_register_settings() {\r\n\tregister_setting('hb_settings_group', 'hb_settings');\r\n\r\n}", "public function register_settings() {\n\n\t\t// This include creates a variable called $settings.\n\t\t// TODO: Load this from a file instead ...\n\t\t$settings = array(\n\t\t\tarray(\n\t\t\t\t/*Sections*/\n\t\t\t\t'name'\t\t=> 'default',\n\t\t\t\t'title'\t\t=> __('General Settings','wpchaosclient'),\n\t\t\t\t'fields'\t=> array(\n\t\t\t\t\t/*Section fields*/\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-servicepath',\n\t\t\t\t\t\t'title' => __('Service Path','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-clientguid',\n\t\t\t\t\t\t'title' => __('Client GUID','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-accesspoint-guid',\n\t\t\t\t\t\t'title' => __('Access Point GUID','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-email',\n\t\t\t\t\t\t'title' => __('E-mail used for authentication','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-password',\n\t\t\t\t\t\t'title' => __('Password','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'password'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$this->settings = apply_filters('wpchaos-config', $settings);\n\n\t\tforeach($this->settings as $section) {\n\n\t\t\t//Validate\n\t\t\tif(!isset($section['name'],$section['title'],$section['fields']))\n\t\t\t\tcontinue;\n\n\t\t\t//Add section to WordPress\n\t\t\tadd_settings_section(\n\t\t\t\t$section['name'],\n\t\t\t\t$section['title'],\n\t\t\t\tnull,\n\t\t\t\t$this->menu_page\n\t\t\t);\n\n\t\t\tforeach($section['fields'] as $setting) {\n\t\t\t\t//Validate\n\t\t \t\tif(!isset($setting['title'],$setting['name'],$setting['type']))\n\t\t \t\t\tcontinue;\n\n\t\t \t\t//Are there any preconditions for this field to work properly?\n\t\t \t\tif(isset($setting['precond'])) {\n\t\t \t\t\tforeach($setting['precond'] as $precondition) {\n\t\t \t\t\t\tif(!$precondition['cond'])\n\t\t \t\t\t\t\tadd_action( 'admin_notices', function() use(&$precondition) { echo '<div class=\"error\"><p>'.$precondition['message'].'</p></div>'; },10);\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t\t// Add field to section\n\t\t \t\tadd_settings_field($setting['name'],\n\t\t\t\t\t$setting['title'],\n\t\t\t\t\tarray(&$this,'create_setting_field'),\n\t\t\t\t\t$this->menu_page,\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$setting);\n\n\t\t \t\t// Register field to be manipulated with\n\t\t \t\tregister_setting($this->menu_page,$setting['name']);\n\t\t\t}\n\n\t\t}\n\n\t }", "function bdpp_register_settings() {\n\tregister_setting( 'bdpp_settings', 'bdpp_opts', 'bdpp_validate_settings' );\n}", "function register_settings() {\n add_settings_section(\n 'main-settings-section',\n 'Main Settings',\n array($this, 'print_main_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'app_id',\n 'App ID', \n array($this, 'create_input_app_id'), \n 'share-fb-sections-plugin', \n 'main-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_main_settings', array($this, 'plugin_main_settings_validate') );\n \n // add_settings_section( $id, $title, $callback, $page )\n add_settings_section(\n 'additional-settings-section',\n 'Additional Settings & Default Value',\n array($this, 'print_additional_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'render_meta_tag',\n 'Render Meta Tag',\n array($this, 'create_input_render_meta_tag'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'title', \n 'Default Title', \n array($this, 'create_input_title'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'description', \n 'Default Description', \n array($this, 'create_input_description'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'image_url', \n 'Default Image URL', \n array($this, 'create_input_image_url'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_additonal_settings', array($this, 'plugin_additional_settings_validate') );\n }", "function jpst_register_settings() {\n\tregister_setting( 'jpst-settings-group', 'jpst_oauth','saveOptionCallback' );\n}", "public function registerSettings()\n {\n register_setting(self::SETTING_GROUPNAME, self::SETTING_BASENAME);\n \n // Section: API Keys\n // -----------------------------------------------------------------\n\n add_settings_section(\n 'wistia_section-api_keys',\n __('API Settings'),\n [$this->renderer, 'renderAPISettingsSection'],\n self::ADMIN_PAGE_ID\n );\n\n add_settings_field(\n 'url_prefix',\n __('URL Prefix'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'url_prefix',\n null,\n [\n 'before' => '<code>http://</code>',\n 'after' => '<code>.wistia.com</code>',\n ]\n )\n );\n add_settings_field(\n 'project_key',\n __('Project Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'project_key',\n __('Enter the ID of the project that the Upload API should send videos to.'),\n [\n 'classes' => 'regular-text'\n ]\n )\n );\n add_settings_field(\n 'upload_key',\n __('Upload Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'upload_key',\n __('This API key should have <strong>upload permissions only</strong>. It will be '\n .'visible in the source of any front-end pages that use the JavaScript uploader.'),\n [\n 'classes' => 'regular-text',\n ]\n )\n );\n add_settings_field(\n 'data_key',\n __('Data API Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'data_key',\n __('This API key should have <strong>read and write</strong> permissions.'),\n [\n 'classes' => 'regular-text',\n ]\n )\n );\n }", "public function register_settings() {\n\n\t\tadd_settings_section(\n\t\t\t'schedule_a_visit_to_sherpa_settings_section',\n\t\t\t__( 'Schedule a Visit Leads to Sherpa', 'schedule-a-visit-to-sherpa' ),\n\t\t\t__return_false(),\n\t\t\t'schedule-a-visit-to-sherpa'\n\t\t);\n\n\t\t$fields = $this->get_settings_fields();\n\n\t\tforeach ( $fields as $field ) {\n\n\t\t\t$field = wp_parse_args( $field, array(\n\t\t\t\t'settings_label' => '',\n\t\t\t) );\n\n\t\t\t$callback = 'rbm_fh_do_field_' . $field['type'];\n\n\t\t\tadd_settings_field(\n\t\t\t\t$field['name'],\n\t\t\t\t$field['settings_label'],\n\t\t\t\t( is_callable( $callback ) ) ? 'rbm_fh_do_field_' . $field['type'] : 'rbm_fh_missing_callback',\n\t\t\t\t'schedule-a-visit-to-sherpa',\n\t\t\t\t'schedule_a_visit_to_sherpa_settings_section',\n\t\t\t\t$field\n\t\t\t);\n\n\t\t\tregister_setting( 'schedule_a_visit_to_sherpa_settings_section', $field['name'] );\n\n\t\t}\n\n\t}", "public function register_settings(){\n // Default API KEY Google Maps\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_api_key', array($this,'maps_api_validation') );\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_enable_geocode', array('type'=>'boolean') );\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_enable_places', array('type'=>'boolean') );\n }", "function register() {\n $this->settings = new SettingApi();\n\n $this->setPages();\n $this->setSubpages();\n\n $this->setCustomPostTypes();\n $this->setTaxonomies();\n $this->setMetaboxes();\n $this->setFrontEndPages();\n\n $this->settings->loadPages($this->pages)->withSubPage('Action control')->loadSubPages($this->subpages)->register();\n }", "function register_settings() {\n\t\t\tif( get_option( $this->func . '_settings' ) == false ) {\n\t\t\t\tadd_option( $this->func . '_settings' );\n\t\t\t}\n\n\t\t\tforeach( $this->get_registered_settings() as $tab => $sections ) {\n\t\t\t\tforeach( $sections as $section => $settings ) {\n\t\t\t\t\t// Check for backwards compatibility\n\t\t\t\t\t$section_tabs = $this->get_settings_tab_sections( $tab );\n\n\t\t\t\t\tif( ! is_array( $section_tabs ) || ! array_key_exists( $section, $section_tabs ) ) {\n\t\t\t\t\t\t$section = 'main';\n\t\t\t\t\t\t$settings = $sections;\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_settings_section(\n\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t__return_null(),\n\t\t\t\t\t\t'__return_false',\n\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach( $settings as $option ) {\n\t\t\t\t\t\t// For backwards compatibility\n\t\t\t\t\t\tif( empty( $option['id'] ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$name = isset( $option['name'] ) ? $option['name'] : '';\n\n\t\t\t\t\t\tadd_settings_field(\n\t\t\t\t\t\t\t$this->func . '_settings[' . $option['id'] . ']',\n\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\tfunction_exists( $this->func . '_' . $option['type'] . '_callback' ) ? $this->func . '_' . $option['type'] . '_callback' : ( method_exists( $this, $option['type'] . '_callback' ) ? array( $this, $option['type'] . '_callback' ) : array( $this, 'missing_callback' ) ),\n\t\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'section' => $section,\n\t\t\t\t\t\t\t\t'id' => isset( $option['id'] ) ? $option['id'] : null,\n\t\t\t\t\t\t\t\t'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',\n\t\t\t\t\t\t\t\t'name' => isset( $option['name'] ) ? $option['name'] : null,\n\t\t\t\t\t\t\t\t'size' => isset( $option['size'] ) ? $option['size'] : null,\n\t\t\t\t\t\t\t\t'options' => isset( $option['options'] ) ? $option['options'] : '',\n\t\t\t\t\t\t\t\t'std' => isset( $option['std'] ) ? $option['std'] : '',\n\t\t\t\t\t\t\t\t'min' => isset( $option['min'] ) ? $option['min'] : null,\n\t\t\t\t\t\t\t\t'max' => isset( $option['max'] ) ? $option['max'] : null,\n\t\t\t\t\t\t\t\t'step' => isset( $option['step'] ) ? $option['step'] : null,\n\t\t\t\t\t\t\t\t'select2' => isset( $option['select2'] ) ? $option['select2'] : null,\n\t\t\t\t\t\t\t\t'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,\n\t\t\t\t\t\t\t\t'multiple' => isset( $option['multiple'] ) ? $option['multiple'] : null,\n\t\t\t\t\t\t\t\t'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,\n\t\t\t\t\t\t\t\t'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,\n\t\t\t\t\t\t\t\t'buttons' => isset( $option['buttons'] ) ? $option['buttons'] : null,\n\t\t\t\t\t\t\t\t'wpautop' => isset( $option['wpautop'] ) ? $option['wpautop'] : null,\n\t\t\t\t\t\t\t\t'teeny' => isset( $option['teeny'] ) ? $option['teeny'] : null,\n\t\t\t\t\t\t\t\t'tab' => isset( $option['tab'] ) ? $option['tab'] : null,\n\t\t\t\t\t\t\t\t'tooltip_title' => isset( $option['tooltip_title'] ) ? $option['tooltip_title'] : false,\n\t\t\t\t\t\t\t\t'tooltip_desc' => isset( $option['tooltip_desc'] ) ? $option['tooltip_desc'] : false,\n\n\t\t\t\t\t\t\t\t'available_header'\t=> isset( $option['available_header'] ) ? $option['available_header'] : null,\n\t\t\t\t\t\t\t\t'selected_header'\t=> isset( $option['selected_header'] ) ? $option['selected_header'] : null,\n\n\t\t\t\t\t\t\t\t'class' => isset( $option['class'] ) ? $option['class'] : '',\n\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tregister_setting( $this->func . '_settings', $this->func . '_settings', array( $this, 'settings_sanitize' ) );\n\t\t}", "public function register_settings(){\n\n\t\t// Register our option\n\t\tregister_setting( 'slack-post-types', 'slack-post-types', array( $this, 'sanitize' ) );\n\n\t\t// Add post post-type as default\n\t\tadd_option( 'slack-post-types', array( 'post' => 1 ) );\n\t}", "public function register_settings()\r\n\t{\t\r\n\t\t//options group declaration\r\n\t register_setting('bookingSearch_settings', 'dbs_client_id');\r\n\t register_setting('bookingSearch_settings', 'dbs_client_secret');\r\n\t register_setting('bookingSearch_settings', 'dbs_authorization');\r\n\r\n\t //sections\r\n\t add_settings_section('bookingSearch_section', __('Customer parameter','Booking-search'), array($this, 'section_html'), 'bookingSearch_settings');\r\n\r\n\t //fields\r\n\t add_settings_field('dbs_client_id', __('Client ID','Booking-search'), array($this, 'dbs_client_id_html'), 'bookingSearch_settings', 'bookingSearch_section');\r\n\t add_settings_field('dbs_client_secret', __('Client secret','Booking-search'), array($this, 'dbs_client_secret_html'), 'bookingSearch_settings', 'bookingSearch_section');\r\n\t add_settings_field('dbs_authorization', __('Authorization','Booking-search'), array($this, 'dbs_authorization_html'), 'bookingSearch_settings', 'bookingSearch_section');\r\n\r\n\t}", "public function register_settings() {\n\t\t$section = 'janrain-capture';\n\n\t\tregister_setting( $this->option_group, 'pn_theme_janrain_enable', array( $this, 'sanitize_input_checkbox' ) );\n\t\tregister_setting( $this->option_group, 'pn_theme_janrain_debug', array( $this, 'sanitize_input_checkbox' ) );\n\n\t\tadd_settings_section( $section, 'Janrain Capture', '__return_false', $this->option_group );\n\t\tadd_settings_field( 'pn_theme_janrain_enable', 'Enable Janrain Capture', array( $this, 'render_input_checkbox' ), $this->option_group, $section, array( 'key' => 'pn_theme_janrain_enable', 'help' => 'Used by theme to register proper click events. eg. Janrain vs. Press+' ) );\n\t\tadd_settings_field( 'pn_theme_janrain_debug', 'Enable Janrain Debug', array( $this, 'render_input_checkbox' ), $this->option_group, $section, array( 'key' => 'pn_theme_janrain_debug', 'help' => 'Turns on Janrain event logging' ) );\n\t}", "function sa_register_settings() {\n\t// Register settings and call sanitation functions\n\tregister_setting( 'tsc_theme_options', 'sa_options', 'sa_validate_options' );\n}", "function register_initial_settings()\n {\n }", "function jm_register_settings(){\n\tregister_setting('jm_social_group', 'jm_facebook');\n\tregister_setting('jm_social_group', 'jm_twitter');\n\tregister_setting('jm_social_group', 'jm_gplus');\n\tregister_setting('jm_social_group', 'jm_linkedin');\n\t\n\tregister_setting('jm_main_group', 'jm_logo');\n\tregister_setting('jm_main_group', 'jm_colorOne');\n\tregister_setting('jm_main_group', 'jm_colorTwo');\n\tregister_setting('jm_main_group', 'jm_analytics');\n}", "function wshop_settings_init(){\n register_setting('wshop_settings', 'wshop_api_key');\n register_setting('wshop_settings', 'wshop_domain', 'remove_protocol');\n // register_setting('wshop_settings', 'wshop_app_id');\n register_setting('wshop_settings', 'wshop_rewrite_slug');\n register_setting('wshop_settings', 'wshop_collections_slug');\n }", "function myprefix_init_settings() {\t\n\t\n\t// Settings section:\n\t// Multiple settings can go into this section after we set it up.\n\t// We are going to add three settings into this one section.\n\t\tadd_settings_section(settingsSectionOneSlug, settingsSectionOneTitle, \n\t\t\tsettingsSectionOneCallbackFunction, settingsPageID);\n\t\n\t// Settings field:\n\t// We add settings fields to our settings section:\n\t\tadd_settings_field(settingOneSlug, settingOneTitle, settingOneCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingOneSlug ));\n\t\tadd_settings_field(settingTwoSlug, settingTwoTitle, settingTwoCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingTwoSlug ));\n\t\tadd_settings_field(settingThreeSlug, settingThreeTitle, settingThreeCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingThreeSlug ));\n\t\n\t// Setting:\n\t// Now we register our settings:\n\t\tregister_setting(settingsPageID, settingOneSlug, settingOneValidationFunction);\n\t\tregister_setting(settingsPageID, settingTwoSlug, settingTwoValidationFunction);\n\t\tregister_setting(settingsPageID, settingThreeSlug, settingThreeValidationFunction);\n}", "public function register_settings()\n\t\t{\n\t\t\tregister_setting('mailgun', 'mailgun', array(&$this, 'validation'));\n\t\t}", "function jb_register_settings() {\n\tregister_setting( JB_SETTINGS_FIELD, JB_SETTINGS_FIELD );\n\tadd_option( JB_SETTINGS_FIELD , jb_option_defaults() );\n\tadd_settings_section('jb_main','Main Settings', 'jb_main_section_text', JB_SETTINGS_FIELD );\n\tadd_settings_field('jb_featured_cat', 'Featured Category', 'jb_featured_cat_slug_setting', JB_SETTINGS_FIELD , 'jb_main');\n\tadd_settings_field('jb_featured_content_limit', 'Homepage Featured Post Word Count Limit', 'jb_featured_content_limit_setting', JB_SETTINGS_FIELD , 'jb_main');\n\tadd_settings_field('jb_post_content_limit', 'Post Word Count Limit', 'jb_post_content_limit_setting', JB_SETTINGS_FIELD , 'jb_main');\n}", "function register_my_settings() {\n\t// First say,\n\t// \"Here's a hunk of stuff that\n\t// will be saved in the database.\"\n\tregister_setting(\n\t\t'my-options',\n\t\t'my-options-data',\n\t\t'washing_machine'\n\t);\n\n\t// Next say,\n\t// \"Here are the sections I want\n\t// to present my settings in\n\t// on the page I told you about earlier.\"\n\tadd_settings_section(\n\t\t'section-1',\n\t\t'Header Stuff',\n\t\t'section_ringy_dingy',\n\t\t'my-page-id'\n\t);\n\tadd_settings_section(\n\t\t'section-2',\n\t\t'Footer Stuff',\n\t\t'section_ringy_dingy',\n\t\t'my-page-id'\n\t);\n\n\t// Third, gather the information\n\t// you'll need to display your fields\n\t// into HTML\n\t$extra_tagline_args = array(\n\t\t'id'\t\t=> 'extra_tagline',\n\t\t'desc'\t\t=> 'Enter Your Extra Tagline Here',\n\t\t'label_for'\t=> 'extra_tagline'\n\t);\n\n\t$footer_text_args = array(\n\t\t'id'\t\t=> 'footer_text',\n\t\t'desc'\t\t=> 'Enter Your Footer Text Here',\n\t\t'label_for'\t=> 'footer_text'\n\t);\n\n\t// Finally say,\n\t// \"These are the fields we want\n\t// users to fill in.\"\n\tadd_settings_field(\n\t\t'extra-tagline',\n\t\t'Text for Extra Tagline',\n\t\t'render_text_field',\n\t\t'my-page-id',\n\t\t'section-1',\n\t\t$extra_tagline_args\n\t);\n\tadd_settings_field(\n\t\t'footer-text',\n\t\t'Text for Footer',\n\t\t'render_text_field',\n\t\t'my-page-id',\n\t\t'section-2',\n\t\t$footer_text_args\n\t);\n\n}", "public static function register_settings() {\n\t\t\tregister_setting( 'ELMT_theme_options', 'ELMT_theme_options', array( 'ELMT_theme_options', 'sanitize' ) );\n\t\t}", "function register_settings() {\n register_setting( 'athen_tweaks', 'athen_tweaks', array( $this, 'admin_sanitize' ) ); \n }", "public function register_main_setting() {\n register_setting( 'lp_rating_settings', 'lp_rating_types');\n register_setting( 'lp_rating_settings', 'lp_rating_text');\n register_setting( 'lp_rating_settings', 'lp_rating_text_font_size');\n register_setting( 'lp_rating_settings', 'lp_rating_image_size');\n register_setting( 'lp_rating_settings', 'lp_rating_change_image');\n }", "public function add()\n\t{\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_enable'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_icon_display'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_display_empty'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_select_menu'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_text'\n\t\t);\n\t\t\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_hsc_icon'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_ccm_enable'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_ccm_text'\n\t\t);\n\t\tregister_setting(\n\t\t\tSettingsSection::SETTINGS_OPTION,\n\t\t\t'jigoshop_chronous_dc_enable'\n\t\t);\n\t}", "function achilles_settings_init() {\n\t\n\t//create one option to store all of our values. \n register_setting( 'achilles-settings-group', 'achilles-settings' );\n add_settings_section( 'achilles-general-settings', 'General Settings', 'achilles_general_settings_callback', 'achilles' );\n add_settings_field('resident-portal', 'Resident Portal URL', 'resident_portal_url_callback', 'achilles', 'achilles-general-settings');\n add_settings_field('facebook-url', 'Facebook URL', 'facebook_url_callback', 'achilles', 'achilles-general-settings' );\n add_settings_field('google-analytics-id', 'Google Analytics ID', 'google_analytics_id_callback', 'achilles', 'achilles-general-settings');\n\t\n}", "public static function register_settings() {\n\t\t\tregister_setting( 'theme_options', 'theme_options', array( 'IODD_Theme_Options', 'sanitize' ) );\n\t\t}", "function tsuiseki_tracking_admin_init() {\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_key');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_css_class');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_excluded_uris');\n}", "function register_mysettings() {\n\tregister_setting( 'myoption-group', 'adsense_id' );\n\tregister_setting( 'myoption-group', 'site_url_one' );\n register_setting( 'myoption-group', 'site_url_two' );\n register_setting( 'myoption-group', 'site_url_three' );\n register_setting( 'myoption-group', 'site_url_four' );\n register_setting( 'myoption-group', 'site_url_five' );\n register_setting( 'myoption-group', 'site_font' );\n register_setting( 'myoption-group', 'site_total_posts' );\n register_setting( 'myoption-group', 'site_randomise_posts' );\n register_setting( 'myoption-group', 'site_show_curator_posts' );\n }", "function register_mysettings()\n{\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_shop_id' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_api_key' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_api_secret' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_product_detail_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_product_list_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_designer_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_article_list_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_article_detail_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_items_per_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_language' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_locale' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_domain' );\n}", "public function plugin_settings_init() {\n\t\tregister_setting( 'plugin-boilerplate', 'plugin_settings' );\n\n\t\t//create a settings section - there can be multiple settings sections, just make sure you attribute\n\t\t//the settings fields to the sections you want\n\t\tadd_settings_section( \n\t\t\t'settings-section-id', \n\t\t\t__( 'Plugin Settings Section Title', 'plugin-text-domain' ), \n\t\t\tarray( $this, 'settings_section_callback' ), \n\t\t\t'plugin-boilerplate' );\n\n\t\t//create the settings fields, associate them with the required settings sections\n\t\tadd_settings_field( \n\t\t\t'settings-fields-id', \n\t\t\t__('Settings Fields Title', 'plugin-text-domain' ), \n\t\t\tarray( $this, 'settings_field_callback' ), \n\t\t\t'plugin-boilerplate', \n\t\t\t'settings-section-id' );\n\t\t\n\t}", "function project_register_settings() {\n\tregister_setting(\n\t\t'project_options',\t\t\t\t\t\t// option group\n\t\t'project_options',\t\t\t\t\t\t// option name\n\t\t'project_callback_validate_options'\t\t// callable sanitize callback\n\t);\n\n\tadd_settings_section(\n\t\t'project_section_login',\t\t\t\t// section id\n\t\t'Customize Login Page',\t\t\t\t\t// section title\n\t\t'project_callback_section_login',\t\t// callable \n\t\t'project'\t\t\t\t\t\t\t\t// page on which section to be displayed\n\t);\n\n\tadd_settings_section(\n\t\t'project_section_admin',\n\t\t'Customize Admin Area',\n\t\t'project_callback_section_admin',\n\t\t'project'\n\t);\n\n\tadd_settings_field(\n\t\t'custom_url',\t\t\t\t\t\t\t// id\n\t\t'Custom URL',\t\t\t\t\t\t\t// title\n\t\t'project_callback_field_text',\t\t\t// callback\n\t\t'project',\t\t\t\t\t\t\t\t// page\n\t\t'project_section_login',\t\t\t\t// section\n\t\t['id' => 'custom_url', 'label' => 'Custom URL for the login logo link']\t// args\n\t);\n\n\tadd_settings_field(\n\t\t'custom_title',\t\t\t\t\t\t\n\t\t'Custom Title',\t\t\t\t\t\t\t\n\t\t'project_callback_field_text',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_login',\t\t\t\t\n\t\t['id' => 'custom_title', 'label' => 'Custom Title attribute for logo link']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_style',\t\t\t\t\t\t\n\t\t'Custom Style',\t\t\t\t\t\t\t\n\t\t'project_callback_field_radio',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_login',\t\t\t\t\n\t\t['id' => 'custom_style', 'label' => 'Custom CSS for the Login screen']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_message',\t\t\t\t\t\t\n\t\t'Custom Message',\t\t\t\t\t\t\t\n\t\t'project_callback_field_textarea',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_login',\t\t\t\t\n\t\t['id' => 'custom_message', 'label' => 'Custom text and/or markup']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_footer',\t\t\t\t\t\t\n\t\t'Custom Footer',\t\t\t\t\t\t\t\n\t\t'project_callback_field_text',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_admin',\t\t\t\t\n\t\t['id' => 'custom_footer', 'label' => 'Custom footer text']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_toolbar',\t\t\t\t\t\t\n\t\t'Custom Toolbar',\t\t\t\t\t\t\t\n\t\t'project_callback_field_checkbox',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_admin',\t\t\t\t\n\t\t['id' => 'custom_toolbar', 'label' => 'Remove new post and comment links from the Toolbar']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_scheme',\t\t\t\t\t\t\n\t\t'Custom Scheme',\t\t\t\t\t\t\t\n\t\t'project_callback_field_select',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_admin',\t\t\t\t\n\t\t['id' => 'custom_scheme', 'label' => 'Default color scheme for new users']\t\n\t);\n}", "function addSettings ($name, $value, $type, $protected)\n{\n\tglobal $conn;\n\tglobal $database_table_prefix;\n\t$sql = \"SELECT id FROM \".$database_table_prefix.\"settings WHERE name = '$name' LIMIT 1\";\n\t$rs = $conn->query($sql);\n\tif($conn->query($sql) === false) {\n\t\ttrigger_error('Error: '.$conn->error, E_USER_ERROR);\n\t}\n\n\t$exist = $rs->num_rows;\n\tif($exist==0)\n\t{\n\t\t// insert\n\t\t$query = \"INSERT INTO \".$database_table_prefix.\"settings (id, name, value, type, protected) VALUES (NULL, '$name', '$value', '$type', '$protected')\";\n\t\t$rs = $conn->query($query);\n\t\t$last_inserted_id = $conn->insert_id;\n\t\t$affected_rows = $conn->affected_rows;\n\t}\n\telse\n\t{\n\t\t// update\n\t\t$query = \"UPDATE \".$database_table_prefix.\"settings SET value = '$value' WHERE name = '$name' LIMIT 1\";\n\t\t$rs = $conn->query($query);\n\t\t$affected_rows = $conn->affected_rows;\n\t}\n}", "private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }", "public function registerSettings()\n {\n // Register setting\n register_setting('wpae_crsch_settings', 'wpae_cron_scheduler_exports');\n\n // Settings section\n add_settings_section(\n 'wpae_crsch_section',\n __('Exports list', WPAE_CRSCH_TD),\n [$this, 'registerSettingsCallback'],\n 'wpae_crsch_settings'\n );\n }", "public function register_dynamic_settings()\n {\n }", "public static function register_settings() {\n\t\tregister_setting( 'omnimailer', 'omnimailer', array( get_called_class(), 'validate_options' ) );\n\t}", "public function register() {\n\n\t\tregister_setting(\n\t\t\t'emcl_settings',\t\t\t// Group of options\n\t\t\t'emcl_settings', \t // Name of options\n\t\t\tarray( $this, 'sanitize' )\t// Sanitization function\n\t\t);\n\n\t\tadd_settings_section(\n\t\t\t'emcl-server',\t\t\t// ID of the settings section\n\t\t\t'Server Settings',\t\t// Title of the section\n\t\t\t'',\n\t\t\t'emcl-section'\t\t\t// ID of the page\n\t\t);\n\n\t\tforeach( $this->server_fields as $key => $name) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key, \t\t\t// The ID of the settings field\n\t\t\t\t$name, \t// The name of the field of setting(s)\n\t\t\t\tarray( $this, 'display_'.$key ),\n\t\t\t\t'emcl-section', \t// ID of the page on which to display these fields\n\t\t\t\t'emcl-server' // The ID of the setting section\n\t\t\t);\n\t\t}\n\n\t\tadd_settings_section(\n\t\t\t'emcl-app',\t\t\t // ID of the settings section\n\t\t\t'App Settings',\t\t\t// Title of the section\n\t\t\t'',\n\t\t\t'emcl-section'\t\t\t// ID of the page\n\t\t);\n\n\t\tforeach( $this->app_fields as $key => $name) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key, \t\t\t// The ID of the settings field\n\t\t\t\t$name, \t// The name of the field of setting(s)\n\t\t\t\tarray( $this, 'display_'.$key ),\n\t\t\t\t'emcl-section', \t// ID of the page on which to display these fields\n\t\t\t\t'emcl-app' \t// The ID of the setting section\n\t\t\t);\n\t\t}\n\t}", "public function admin_init() {\n\t\tregister_setting( $this->options_key, $this->options_key, array( $this, 'save_settings' ) );\n\t}", "public function init() {\n register_setting( $this->key, $this->key );\n }", "function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}", "protected function registerSettingsService()\n {\n $this->app->singleton(\n 'streams.settings',\n function () {\n\n return new SettingService(new SettingModel());\n\n }\n );\n }", "function cxense_register_settings() {\n\n // Setup section on our options page\n add_settings_section('cxense-settings-section', 'cXense Settings', '__return_empty_string', 'cxense-settings');\n\n // Register our settings and create\n foreach(cxense_get_settings() as $setting) {\n\n // Register setting\n register_setting('cxense-settings', $setting['name']);\n\n // Add settings field if add_field isn't false\n if( !isset($setting['add_field']) || $setting['add_field'] !== false) {\n add_settings_field(\n $setting['name'],\n $setting['title'],\n function($args) {\n $value = cxense_get_opt($args['name']);\n if( !empty($args['select']) ) {\n echo '<select name=\"'.$args['name'].'\">';\n foreach($args['select'] as $opt_val => $opt_name) {\n echo '<option value=\"'.$opt_val.'\"'.($opt_val == $value ? ' selected=\"selected\"':'').'>'.$opt_name.'</option>';\n }\n echo '</select>';\n } else {\n echo '<input type=\"text\" name=\"'.$args['name'].'\" value=\"'.$value.'\" />';\n }\n },\n 'cxense-settings',\n 'cxense-settings-section',\n $setting\n );\n }\n }\n}", "function setup_settings() {\n\t\t\t$page = is_network_admin() ? 'settings.php' : 'writing';\n\t\t\t$section = 'post_revision_workflow';\n\t\t\t\n\t\t\tif( is_network_admin() ) {\n\t\t\t\tadd_action( 'wpmu_options', array( &$this, 'ms_settings_section' ) );\n\t\t\t\tadd_action( 'update_wpmu_options', array( &$this, 'update_ms_settings' ) );\n\t\t\t} else {\n\t\t\t\tregister_setting( $page, 'dpn_reviewers', array( &$this, 'sanitize_settings' ) );\n\t\t\t\tadd_settings_section( $section, __( 'Post Revision Workflow', $this->text_domain ), array( &$this, 'settings_section' ), $page );\n\t\t\t\tadd_settings_field( 'dpn_reviewers', __( 'Default email address for post revision workflow notification:', $this->text_domain ), array( &$this, 'settings_field' ), $page, $section, array( 'label_for' => 'dpn_reviewers' ) );\n\t\t\t}\n\t\t}", "public function register()\n {\n register_setting(\n $this->page,\n self::SETTING,\n array($this, 'clean_settings')\n );\n\n add_settings_section(\n self::SECTION,\n __('Simple Login Lockdown', 'simple-login-lockdown'),\n array($this, 'section_cb'),\n $this->page\n );\n\n add_settings_field(\n self::SETTING . '[limit]',\n __('Login Attempt Limit', 'simple-login-lockdown'),\n array($this, 'attempts_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[limit]', 'key' => 'limit')\n );\n\n add_settings_field(\n self::SETTING . '[time]',\n __('Login Lockdown Time', 'simple-login-lockdown'),\n array($this, 'time_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[time]', 'key' => 'time')\n );\n\n add_settings_field(\n self::SETTING . '[trust_proxy]',\n __('Trust Proxy Data', 'simple-login-lockdown'),\n array($this, 'trust_proxy_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[trust_proxy]', 'key' => 'trust_proxy')\n );\n }", "public function init()\n {\n register_setting($this->key, $this->key);\n }", "abstract protected function define_my_settings();", "public function settings()\n\t\t{\n\t\t\t$section = 'reading';\n\t\t\tadd_settings_section(\n\t\t\t\t$this->tag . '_settings_section',\n\t\t\t\t$this->name . ' Settings',\n\t\t\t\tfunction () {\n\t\t\t\t\techo '<p>Configuration options for the ' . esc_html( $this->name ) .' plugin.</p>';\n\t\t\t\t},\n\t\t\t\t$section\n\t\t\t);\n\t\t\tforeach ( $this->settings AS $id => $options ) {\n\t\t\t\t$options['id'] = $id;\n\t\t\t\tadd_settings_field(\n\t\t\t\t\t$this->tag . '_' . $id . '_settings',\n\t\t\t\t\t$id,\n\t\t\t\t\tarray( &$this, 'settings_field' ),\n\t\t\t\t\t$section,\n\t\t\t\t\t$this->tag . '_settings_section',\n\t\t\t\t\t$options\n\t\t\t\t);\n\t\t\t}\n\t\t\tregister_setting(\n\t\t\t\t$section,\n\t\t\t\t$this->tag,\n\t\t\t\tarray( &$this, 'settings_validate' )\n\t\t\t);\n\t\t}", "public function init() {\n register_setting( self::$key, self::$key );\n }", "function saju_jukebox_settings_register() {\n\n\t// 1: the unique id for the section\n\t// 2: the title or name of the section\n\t// 3: callback to display the section\n\t// 4: the page name: wordlift_settings_section_page\n\tadd_settings_section( SAJU_JUKEBOX_SETTINGS_GENERAL, __( 'General Settings', SAJU_LANGUAGE_DOMAIN ), 'saju_jukebox_echo_section_top', SAJU_JUKEBOX_SETTINGS_GENERAL_PAGE );\n\n\t// Add the setting field for the display as default.\n\tadd_settings_field(\n\t\tSAJU_JUKEBOX_SETTINGS_FIELD_EVENT_URL,\n\t\t__( 'Event URL:', SAJU_LANGUAGE_DOMAIN ),\n\t\t'saju_jukebox_echo_input',\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL_PAGE,\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL,\n\t\tarray(\n\t\t\t'id' => SAJU_JUKEBOX_SETTINGS_FIELD_EVENT_URL,\n\t\t\t'size' => 100\n\t\t)\n\t);\n\n\t// Add the setting field for the color coding of entities.\n\tadd_settings_field(\n\t\tSAJU_JUKEBOX_SETTINGS_FIELD_DATASET_URL,\n\t\t__( 'Dataset URL:', SAJU_LANGUAGE_DOMAIN ),\n\t\t'saju_jukebox_echo_input',\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL_PAGE,\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL,\n\t\tarray(\n\t\t\t'id' => SAJU_JUKEBOX_SETTINGS_FIELD_DATASET_URL,\n\t\t\t'size' => 100\n\t\t)\n\t);\n\n\t// Register the settings.\n\tregister_setting( SAJU_JUKEBOX_SETTINGS_GENERAL, SAJU_JUKEBOX_SETTINGS_FIELD_EVENT_URL );\n\tregister_setting( SAJU_JUKEBOX_SETTINGS_GENERAL, SAJU_JUKEBOX_SETTINGS_FIELD_DATASET_URL );\n\n}", "public function init_settings()\n\t{\n\t\tregister_setting('jststm_testimonials_group', 'jststm_testimonials', function($input)\n\t\t{\n\t\t\tforeach($input as $i => $data)\n\t\t\t{\n\t\t\t\t$input[$i]['message'] = sanitize_text_field($data['message']);\n\t\t\t\t$input[$i]['author'] = sanitize_text_field($data['author']);\n\t\t\t}\n\n\t\t\treturn $input;\n\t\t});\n\t}", "public function register()\n {\n $this->settings = new SettingsApi();\n\n $this->callbacks = new AdminCallbacks(); //call admin callback using callback variable\n\n\n $this->callbacks_mngr = new ManagerCallbacks(); //call admin callback using callback variable\n\n\n $this->setPages();\n\n// $this->setSubpages();\n\n\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n $this->settings->addPages( $this->pages )->withSubPage( 'Settings' )->register();\n //$this->settings->addPages( $this->pages )->withSubPage( 'Dashboard' )->addSubPages( $this->subpages )->register();\n }", "function register_clix_uppe_admin_settings() {\r\n\t//register our settings\r\n\tregister_setting( 'clix_uppe_settings', 'clix_content_fail' );\r\n\tregister_setting( 'clix_uppe_settings', 'clix_rss_fail' );\r\n}", "public function register_settings() {\n\t\t\tregister_setting( 'wpex_skins_options', 'theme_skin', array( $this, 'sanitize' ) );\n\t\t}", "public function settings_api_init() {\n\t\t// Register sections and settings.\n\t\tadd_settings_section(\n\t\t\t$this->menu_slug,\n\t\t\t__( 'Top Story', 'top-story' ),\n\t\t\tnull,\n\t\t\t$this->menu_slug\n\t\t);\n\n\t\t// Register settings and add fields.\n\t\tregister_setting( $this->menu_slug, 'current-top-story' );\n\n\t\t// Add field.\n\t\tadd_settings_field(\n\t\t\t$this->menu_slug,\n\t\t\t__( 'Search for post by title to replace current top story. (Leave blank to disable.)', 'top-story' ),\n\t\t\tarray( $this, 'option_display' ),\n\t\t\t$this->menu_slug,\n\t\t\t$this->menu_slug\n\t\t);\n\t}", "public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}", "public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}", "function set_settings( $settings ) {\n\t\t$this->settings = $settings;\n\t}", "public function setup_settings() {\n\t\t$this->init_sections();\n\t\t$this->init_fields();\n\t\t$this->settings_fields();\n\t}", "public function init() {\r\n\t\tregister_setting( $this->key, $this->key );\r\n\t}", "function add_settings() {\n\t\t//Default settings\n\t\t$this->set_defaults();\n\t\t\n\t\t//Add settings section\n\t\tadd_settings_section('tw-sliders',__('Sliders','tw-sliders'),'','media');\n\t\t\n\t\t//Add settings fields\n\t\tadd_settings_field('tw-sliders-image-width',__('Image width','tw-sliders'),array($this,'show_text_field'),'media','tw-sliders',array('label_for' => 'tw-sliders-image-width', 'class' => 'small-text'));\n\t\tregister_setting('media','tw-sliders-image-width');\n\t\t\n\t\tadd_settings_field('tw-sliders-image-height',__('Image height','tw-sliders'),array($this,'show_text_field'),'media','tw-sliders',array('label_for' => 'tw-sliders-image-height', 'class' => 'small-text'));\n\t\tregister_setting('media','tw-sliders-image-height');\n\t\t\n\t\tadd_settings_field('tw-sliders-transition',__('Transition','tw-sliders'),array($this,'show_transitions'),'media','tw-sliders',array('label_for' => 'tw-sliders-transition'));\n\t\tregister_setting('media','tw-sliders-transition');\n\t\t\n\t\tadd_settings_field('tw-sliders-speed',__('Speed (ms)','tw-sliders'),array($this,'show_text_field'),'media','tw-sliders',array('label_for' => 'tw-sliders-speed', 'class' => 'small-text'));\n\t\tregister_setting('media','tw-sliders-speed');\n\t\t\n\t\tadd_settings_field('tw-sliders-timeout',__('Timeout (ms)','tw-sliders'),array($this,'show_text_field'),'media','tw-sliders',array('label_for' => 'tw-sliders-timeout', 'class' => 'small-text'));\n\t\tregister_setting('media','tw-sliders-timeout');\n\t\t\n\t\tadd_settings_field('tw-sliders-navigation',__('Navigation','tw-sliders'),array($this,'show_navigation'),'media','tw-sliders',array('label_for' => 'tw-sliders-navigation'));\n\t\tregister_setting('media','tw-sliders-navigation');\n\t}", "function register_setting() \n\t{\n\t\tregister_setting('_user_rank_comments', '_user_rank_comments_fields', array(&$this, 'validate_settings'));\n\t\tregister_setting('_user_rank_comments', '_user_rank_comments_filter');\t\n\t}", "public function setSettings() {\n $this->setName(lang('Add New Task'));\n $this->setDescription(lang('Add new task to specific project.'));\n $this->setTemplateName('incoming_mail_add_task_action');\n $this->setCanUse(true);\n $this->setModuleName(TASKS_MODULE);\n $this->setPreSelected(true);\n }", "public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}", "public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}", "public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}", "function bg_AddAdminSettings(){\n global $bg_optionGroup, $bg_optionName, $bg_page, $bg_sectionId, $bg_opts_apiKey;\n \n register_setting( $bg_optionGroup, $bg_optionName, 'bg_ValidateOptions' );\n add_settings_section($bg_sectionId, 'License Settings', 'bg_AddSettingsSectionHtml', $bg_page);\t\n add_settings_field($bg_opts_apiKey, 'Api Key', 'bg_AddApiKeySettingsFieldHtml', $bg_page, $bg_sectionId);\n}", "function dblions_settings() {\n\tregister_setting( 'dblions-settings-group', 'footer_text' );\n\tregister_setting( 'dblions-settings-group', 'desc_img' );\n\n\tregister_setting( 'dblions-sidebar-group', 'sidebar_embed' );\n\n\tregister_setting( 'dblions-social-group', 'facebook_link' );\n\tregister_setting( 'dblions-social-group', 'twitter_link' );\n\tregister_setting( 'dblions-social-group', 'instagram_link' );\n\tregister_setting( 'dblions-social-group', 'tumblr_link' );\n\tregister_setting( 'dblions-social-group', 'gplus_link' );\n\n\tadd_settings_section( 'dblions-general-options', 'General Options', \n\t\t'dblions_general_options', 'dblions' );\n\tadd_settings_section( 'dblions-img-options', 'Image Options', \n\t\t'dblions_img_options', 'dblions' );\n\tadd_settings_section( 'dblions-sidebar-options', 'Sidebar Options', \n\t\t'dblions_sidebar_options', 'dblions_sidebar' );\n\tadd_settings_section( 'dblions-social-options', 'Social Media Options', \n\t\t'dblions_social_options', 'dblions_social' );\n\n\tadd_settings_field( 'footer-text', 'Footer Text', 'dblions_footer_text', 'dblions', 'dblions-general-options' );\n\tadd_settings_field( 'desc-img', 'Description Background Image', 'dblions_desc_img', 'dblions', 'dblions-img-options' );\n\n\tadd_settings_field( 'sidebar-embed', 'Sidebar Embed', 'dblions_sidebar_embed', 'dblions_sidebar', 'dblions-sidebar-options' );\n\n\tadd_settings_field( 'facebook-link', 'Facebook Link', 'dblions_fb_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'twitter-link', 'Twitter Link', 'dblions_tw_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'instagram-link', 'Instagram Link', 'dblions_ig_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'tumblr-link', 'Tumblr Link', 'dblions_tumblr_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'gplus-link', 'Google+ Link', 'dblions_gplus_link', 'dblions_social', 'dblions-social-options' );\n}", "public function KemiSitemap_settings()\n {\n\n // Register new settings for \"KemiSitemap_options\" page\n register_setting('KemiSitemap_group', 'KemiSitemap_options');\n\n // Register a new section in the \"KemiSitemap_options\" page\n add_settings_section(\n 'KemiSitemap_options',\n __('Kemi Sitemap', 'KemiSitemap'),\n array( $this, 'KemiSitemap_description' ),\n 'KemiSitemap_group'\n );\n }", "public function register_settings_sections() {\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_google_verify', array( $this, 'sanitize_google_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_bing_verify', array( $this, 'sanitize_bing_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_facebook_verify', array( $this, 'sanitize_facebook_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_ga_id', array( $this, 'sanitize_ga_id' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_ga4_id', 'sanitize_text_field' );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_analytics_option_map', array( $this, 'sanitize_wsuwp_analytics_option_map' ) );\n\t}", "private function load_settings() {\n\t\t\n\t}", "private function add_page_settings_controls() {\n\t\trequire_once( __DIR__ . '/page-settings/manager.php' );\n\t\tnew Page_Settings();\n\t}", "private function add_page_settings_controls() {\n\t\trequire_once( __DIR__ . '/page-settings/manager.php' );\n\t\tnew Page_Settings();\n\t}", "function pu_register_settings()\n{\n // Register the settings with Validation callback\n register_setting( 'pu_theme_options', 'pu_theme_options' );\n\n\t// Add settings section\n add_settings_section( 'pu_text_section2', 'Treść sekcji \"Polecam\"', '', 'pu_theme_options.php' );\n\t\n\t $field_args = array(\n 'type' => 'text',\n 'id' => 'blockquote_paragraph',\n 'name' => 'blockquote_paragraph',\n 'std' => '',\n 'label_for' => 'blockquote_paragraph',\n 'class' => 'css_class'\n );\n\n add_settings_field( 'blockquote_paragraph', 'Swój tekst', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section2', $field_args );\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'blockquote_link',\n 'name' => 'blockquote_link',\n 'desc' => 'Na przykład: http://www.complex.com',\n 'std' => '',\n 'label_for' => 'blockquote_link',\n 'class' => 'css_class'\n );\n\n add_settings_field( 'blockquote_link', 'Link', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section2', $field_args ); \n\t\n $field_args = array(\n 'type' => 'text',\n 'id' => 'blockquote_link_text',\n 'name' => 'blockquote_link_text',\n 'std' => '',\n 'label_for' => 'blockquote_link_text',\n 'class' => 'css_class'\n );\n\n add_settings_field( 'blockquote_link_text', 'Wyświetlany tekst linku', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section2', $field_args );\n\t\n // Add settings section two\n add_settings_section( 'pu_text_section', 'Linki do Social Media', '', 'pu_theme_options.php' );\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'facebook_link',\n 'name' => 'facebook_link',\n 'desc' => 'Facebook Link - Na przykład: http://facebook.com/username',\n 'std' => '',\n 'label_for' => 'facebook_link',\n 'class' => 'css_class'\n );\n\n // Add facebook field\n add_settings_field( 'facebook_link', 'Facebook', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args );\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'twitter_link',\n 'name' => 'twitter_link',\n 'desc' => 'Twitter Link - Na przykład: http://twitter.com/username',\n 'std' => '',\n 'label_for' => 'twitter_link',\n 'class' => 'css_class'\n );\n\n // Add twitter field\n add_settings_field( 'twitter_link', 'Twitter', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args ); \n\t\n $field_args = array(\n 'type' => 'text',\n 'id' => 'instagram_link',\n 'name' => 'instagram_link',\n 'desc' => 'Instagram Link - Na przykład: http://instagram.com/username',\n 'std' => '',\n 'label_for' => 'instagram_link',\n 'class' => 'css_class'\n );\n\n // Add Instagram field\n add_settings_field( 'instagram_link', 'Instagram', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args );\n\t\n\t// Add settings section three\n add_settings_section( 'pu_text_section3', 'Zdjęcie i opis autorki w sidebarze', '', 'pu_theme_options.php' );\n\t\n\t $field_args = array(\n 'type' => 'text',\n 'id' => 'author_photo_link',\n 'name' => 'author_photo_link',\n\t 'desc' => 'Do znalezienia w Media --> Biblioteka i kliknięciu na dane zdjęcie. Na przykład: http://michaldevelopwp.azurewebsites.net/wp-content/uploads/2016/06/autorka-profilowe.png',\n 'std' => '',\n 'label_for' => 'author_photo_link',\n 'class' => 'css_class'\n );\n\n add_settings_field( 'author_photo_link', 'Link do zdjęcia', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section3', $field_args );\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'author_description',\n 'name' => 'author_description',\n 'std' => '',\n 'label_for' => 'author_description',\n 'class' => 'css_class'\n );\n\n add_settings_field( 'author_description', 'Opis autorki', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section3', $field_args );\n\t\n\t// Add settings section four\n add_settings_section( 'pu_text_section4', 'Inne', '', 'pu_theme_options.php' );\n\t\n\t $field_args = array(\n 'type' => 'text',\n 'id' => 'post_display_length',\n 'name' => 'post_display_length',\n\t 'desc' => 'Wyświetlana ilość znaków przy każdym poście na stronie głównej i w menu kategorii. Wpisujemy na przykład: 35',\n 'std' => '',\n 'label_for' => 'post_display_length',\n 'class' => 'css_class'\n );\n\n add_settings_field( 'post_display_length', 'Ilość znaków postów w formie skróconej', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section4', $field_args ); \n}", "public function admin_init()\n\t{\n\t\tforeach( (array) $this->InstanceRegistred as $id => $args ) :\n\t\t\t\\register_setting( $this->page, $args['name'] );\n\t\tendforeach;\n\t}", "public static function storeSettings($settings)\n\t{\n\t\t$registry = Registry::singleton();\n\t\t\n\t\tforeach ($settings as $key => $value) {\n\t\t\t$registry->_settings [ $key ] = $value;\n\t\t}\n\t}", "public function registerSettings()\n {\n return [];\n }", "function register_settings() {\n\n\t\tregister_setting('wa_wcc_settings', 'wa_wcc_settings', array(&$this, 'validate_options'));\n\t\t//general settings\n\t\tadd_settings_section('wa_wcc_settings', __('', 'wa_wcc_txt'), '', 'wa_wcc_settings');\n\n\t\tadd_settings_field('wa_wcc_posts_orderby', __('Category orderby', 'wa_wcc_txt'), array(&$this, 'wa_wcc_posts_orderby'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_posts_order', __('Category order', 'wa_wcc_txt'), array(&$this, 'wa_wcc_posts_order'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_posts_category', __('Exclude categories', 'wa_wcc_txt'), array(&$this, 'wa_wcc_posts_category'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_hide_if_empty', __('Hide if empty', 'wa_wcc_txt'), array(&$this, 'wa_wcc_hide_if_empty'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_show_count', __('Show post count', 'wa_wcc_txt'), array(&$this, 'wa_wcc_show_count'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_duration', __('Easing duration', 'wa_wcc_txt'), array(&$this, 'wa_wcc_duration'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_level', __('Level', 'wa_wcc_txt'), array(&$this, 'wa_wcc_level'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\tadd_settings_field('wa_wcc_custom_css', __('Custom styles', 'wa_wcc_txt'), array(&$this, 'wa_wcc_custom_css'), 'wa_wcc_settings', 'wa_wcc_settings');\n\t\n\t\t//advance settings\n\t\tregister_setting('wa_wcc_configuration', 'wa_wcc_configuration', array(&$this, 'validate_options'));\n\t\t\n\t\tadd_settings_section('wa_wcc_configuration', __('', 'wa_wcc_txt'), '', 'wa_wcc_configuration');\n\t\tadd_settings_field('wa_wcc_load_mtree', __('Load mTree', 'wa_wcc_txt'), array(&$this, 'wa_wcc_load_mtree'), 'wa_wcc_configuration', 'wa_wcc_configuration');\n\t\tadd_settings_field('wa_wcc_load_velocity', __('Load Velocity', 'wa_wcc_txt'), array(&$this, 'wa_wcc_load_velocity'), 'wa_wcc_configuration', 'wa_wcc_configuration');\n\t\tadd_settings_field('wa_wcc_loading_place', __('Loading place', 'wa_wcc_txt'), array(&$this, 'wa_wcc_loading_place'), 'wa_wcc_configuration', 'wa_wcc_configuration');\t\n\t\tadd_settings_field('wa_wcc_deactivation_delete', __('Deactivation', 'wa_wcc_txt'), array(&$this, 'wa_wcc_deactivation_delete'), 'wa_wcc_configuration', 'wa_wcc_configuration');\n\t\n\t}", "function get_registered_settings()\n {\n }", "function vfcf7_register_settings() {\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name1', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name2', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name3', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name4', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name5', 'vfcf7_callback' );\n}", "public function load_settings() {\n\t\tadd_action( 'admin_init', [ $this, 'register_option' ] );\n\t\tadd_action( 'admin_init', [ $this, 'license_action' ] );\n\t\tadd_action( 'admin_notices', [ $this, 'show_error' ] );\n\t\tadd_action( 'admin_init', [ $this, 'update_settings' ] );\n\t\tadd_filter( 'http_request_args', [ $this, 'disable_wporg_request' ], 5, 2 );\n\t\tadd_filter( 'edd_sl_updater_add_admin_page', [ $this, 'license_page' ] );\n\t}", "function pu_register_settings() {\n // Register the settings with Validation callback\n register_setting('pu_theme_options', 'pu_theme_options');\n\n // Add settings section\n add_settings_section('pu_text_section', 'Social Links', 'pu_display_section', 'pu_theme_options.php');\n\n // Create textbox field\n $field_args = array(\n 'type' => 'text',\n 'id' => 'twitter_link',\n 'name' => 'twitter_link',\n 'desc' => 'Twitter Link - Example: http://twitter.com/username',\n 'std' => '',\n 'label_for' => 'twitter_link',\n 'class' => 'css_class'\n );\n\n // Add twitter field\n add_settings_field('twitter_link', 'Twitter', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'facebook_link',\n 'name' => 'facebook_link',\n 'desc' => 'Facebook Link - Example: http://facebook.com/username',\n 'std' => '',\n 'label_for' => 'facebook_link',\n 'class' => 'css_class'\n );\n\n // Add facebook field\n add_settings_field('facebook_link', 'Facebook', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'gplus_link',\n 'name' => 'gplus_link',\n 'desc' => 'Google+ Link - Example: http://plus.google.com/user_id',\n 'std' => '',\n 'label_for' => 'gplus_link',\n 'class' => 'css_class'\n );\n\n // Add Google+ field\n add_settings_field('gplus_link', 'Google+', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'youtube_link',\n 'name' => 'youtube_link',\n 'desc' => 'Youtube Link - Example: https://www.youtube.com/channel/channel_id',\n 'std' => '',\n 'label_for' => 'youtube_link',\n 'class' => 'css_class'\n );\n\n // Add youtube field\n add_settings_field('youtube_ink', 'Youtube', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'linkedin-square_link',\n 'name' => 'linkedin-square_link',\n 'desc' => 'LinkedIn Link - Example: http://linkedin-square.com/in/username',\n 'std' => '',\n 'label_for' => 'linkedin-square_link',\n 'class' => 'css_class'\n );\n\n // Add LinkedIn field\n add_settings_field('linkedin-square_link', 'LinkedIn', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'instagram_link',\n 'name' => 'instagram_link',\n 'desc' => 'Instagram Link - Example: http://instagram.com/username',\n 'std' => '',\n 'label_for' => 'instagram_link',\n 'class' => 'css_class'\n );\n\n // Add Instagram field\n add_settings_field('instagram_link', 'Instagram', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n // Add settings section title here\n add_settings_section('section_name_here', 'Section Title Here', 'pu_display_section', 'pu_theme_options.php');\n\n // Create textarea field\n $field_args = array(\n 'type' => 'textarea',\n 'id' => 'settings_field_1',\n 'name' => 'settings_field_1',\n 'desc' => 'Setting Description Here',\n 'std' => '',\n 'label_for' => 'settings_field_1'\n );\n\n // section_name should be same as section_name above (line 116)\n add_settings_field('settings_field_1', 'Setting Title Here', 'pu_display_setting', 'pu_theme_options.php', 'section_name_here', $field_args);\n\n\n // Copy lines 118 through 129 to create additional field within that section\n // Copy line 116 for a new section and then 118-129 to create a field in that section\n}", "function sh_custom_settings_callback() {\n //register the user picture field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_picture');\n //register the user name field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_name' );\n //register the user description field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_description' );\n //add settings section\n add_settings_section( 'sh-custom-settings-options', 'Custom Options', 'sh_custom_settings_options_callback', 'custom_settings');\n //add the user name field to the hooked group of custom settings\n add_settings_field( 'sh-user-name', 'User Name', 'sh_custom_user_name_callback', 'custom_settings', 'sh-custom-settings-options');\n //add the user description field to the hooked group of custom settings\n add_settings_field( 'sh-user-description', 'User Description', 'sh_custom_user_description_callback', 'custom_settings', 'sh-custom-settings-options');\n //add the user picture field to the hooked group of custom settings\n add_settings_field( 'sh-user-picture', 'User Picture', 'sh_custom_user_picture_callback', 'custom_settings', 'sh-custom-settings-options');\n}", "public static function init() {\n static::registerSettings();\n }", "private function registerSetting()\n {\n $this->app->bind('setting', function ($app) {\n return new Setting($app);\n });\n\n $this->app->alias('setting', 'Setting\\Setting');\n }", "function janrain_capture_widget_add_settings($settings = array()) {\n // Widget settings\n $janrain_capture_main = variable_get('janrain_capture_main2', array());\n $janrain_capture_main = array_merge($janrain_capture_main, variable_get('janrain_capture_ui2', array()));\n $janrain_capture_optional = variable_get('janrain_capture_federate2', array());\n $janrain_capture_optional = array_merge($janrain_capture_optional, variable_get('janrain_capture_backplane2', array()));\n\n if (!empty($janrain_capture_optional['capture_sso_address'])) {\n $settings['janrainCapture']['sso_address'] = $janrain_capture_optional['capture_sso_address'];\n }\n\n if (isset($janrain_capture_optional['backplane_enabled'])\n && !empty($janrain_capture_optional['backplane_bus_name'])) {\n $settings['janrainCapture']['backplane_enabled'] = $janrain_capture_optional['backplane_enabled'];\n $settings['janrainCapture']['backplane_bus_name'] = $janrain_capture_optional['backplane_bus_name'];\n }\n\n // Add settings array into a JS variable\n drupal_add_js($settings, array('type' => 'setting', 'every_page' => TRUE, 'preprocess' => FALSE, 'weight' => 0, 'scope' => 'header',));\n}", "public function page_init()\n { \n register_setting(\n 'firebird_grupo',\n 'firebird_name',\n array( $this, 'sanitize' )\n );\n\n add_settings_section(\n 'setting_section_id',\n 'Configurações',\n array( $this, 'print_section_info' ),\n 'integracao-firebird-admin'\n ); \n\n add_settings_field(\n 'chave_token_api',\n 'Chave a ser utilizada no acesso a API de Importação',\n array( $this, 'chave_token_api_callback' ),\n 'integracao-firebird-admin',\n 'setting_section_id'\n );\n }", "public function page_init()\n {\n register_setting(\n 'sepw_option_group', // Option group\n 'sepw_settings', // Option name\n array($this, 'sanitize') // Sanitize\n );\n\n add_settings_section(\n 'info_section_id',\n __('Guide', 'sepw'),\n array($this, 'print_info_section_info'),\n 'sepw-setting-admin'\n );\n\n add_settings_section(\n 'setting_section_id', // ID\n __('Settings', 'sepw'), // Title\n array($this, 'print_settings_section_info'), // Callback\n 'sepw-setting-admin' // Page\n );\n\n add_settings_section(\n 'generate_section_id',\n __('Create Pricelist', 'sepw'),\n array($this, 'print_generate_section_info'),\n 'sepw-setting-admin'\n );\n\n add_settings_field(\n 'product_fields',\n __('Filters', 'sepw'),\n array($this, 'product_fields_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'images_size',\n __('Thumbnail size', 'sepw'),\n array($this, 'images_size_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n\n add_settings_field(\n 'cache_lifetime',\n __('Update Frequency', 'sepw'),\n array($this, 'cache_lifetime_callback'),\n 'sepw-setting-admin',\n 'setting_section_id'\n );\n }", "protected function load_settings() {\n\t\t$this->settings = WP_United_Settings::Create();\n\t\t$this->init_style_keys();\n\t}" ]
[ "0.8434883", "0.8434127", "0.7823006", "0.77566963", "0.7676519", "0.76414496", "0.7601713", "0.75783163", "0.7563666", "0.7508365", "0.74951875", "0.74676687", "0.7427431", "0.7415036", "0.74048483", "0.73567194", "0.7328357", "0.73214245", "0.7308981", "0.7278752", "0.72731507", "0.726551", "0.72504026", "0.72419554", "0.72349083", "0.7232012", "0.7229125", "0.7219259", "0.7210554", "0.72026247", "0.7170041", "0.7161978", "0.7152007", "0.7151163", "0.7147346", "0.7135289", "0.7107888", "0.70917964", "0.7068353", "0.7023794", "0.7010797", "0.6991335", "0.6968582", "0.69664663", "0.6953065", "0.6921729", "0.69148743", "0.6910218", "0.6902554", "0.6900112", "0.6892137", "0.6891823", "0.6885607", "0.6874309", "0.68605095", "0.6847121", "0.6829808", "0.68228793", "0.6822392", "0.68031955", "0.67960954", "0.6791643", "0.6782581", "0.67788655", "0.6773528", "0.6772195", "0.67543536", "0.6751755", "0.6751755", "0.6751545", "0.6722987", "0.66944724", "0.66868466", "0.66642827", "0.66638845", "0.6662713", "0.6662713", "0.6662713", "0.66540724", "0.6647757", "0.6639083", "0.66375893", "0.6636741", "0.66270363", "0.66270363", "0.66168135", "0.66081756", "0.66035455", "0.65833163", "0.65766066", "0.6573505", "0.65717745", "0.656934", "0.6559559", "0.65505254", "0.6533727", "0.6517645", "0.65082717", "0.650556", "0.6503529", "0.64939994" ]
0.0
-1
Print the Section text
public function print_section_info() { print 'Enter your settings below:'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function print_section_info() {\n // print 'Enter your settings below:';\n }", "public static function print_section_info()\n {\n print 'Enter your settings below:';\n }", "public function print_section_info()\n {\n print \"Don't use long sentences below!\";\n }", "public function print_section_info()\n {\n print '<p> Configurações para a consulta de dados a partir do sistema <strong>TSD</strong>. </p>';\n print '<p> Atenção: Sempre que a chave for modificada, é necessário, modificar o arquivo .env com a nova chave. </p>';\n }", "public function display_section() {\n\t\t// do nothing - @todo Possibly add description here later if we have more options to add.\n\t}", "public function print_elements_section_info()\n {\n }", "public function print_section_info()\r\n {\r\n print 'Additional options of your sites are available in Tapatalk Admin CP.';\r\n }", "public function print_section_info()\n {\n print '<strong>Requirements for Setup:</strong><br>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Log into Google Analytics.<br> \n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. Go your site\\'s profile (go to the admin dashboard).<br> \n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. Your URL should look like: https://www.google.com/analytics/web/#report/visitors-overview/a1234b23478970<b>p</b><strong><font color=\"#2EA2CC\">987654</font></strong>/<br>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. The last part after the <b>\"p\"</b> is your Google Analytics Profile ID, in this case it is <strong>\"<font color=\"#2EA2CC\">987654</font>\"</strong><br><br>\n <em><strong>NOTE:</strong> Your GA Profile ID is <strong>NOT</strong> your \"UA-xxxxxx-xx\" number. It is a 9 digit number unique to your site profile.</em>';\n }", "public function print_settings_section_info()\n {\n }", "public function print_section_info()\n\t{\n\t\tprint '<p>内部アクセスを許可するIP一覧を入力してください。<br />\n\t\t\t\t<span style=\"color:red;\">IPリストが空の場合は全てのIPに対し、外部公開の投稿/固定ページしか表示されません。</span></p>';\n\t}", "public function render_section() {\n \n }", "public function printText() {\n\t\tfor ($i = 0; $i < count($this->textToPrint); $i++) {\n\t\t echo $this->textToPrint[$i].\"\\n\";\n\t\t}\n\t}", "function showContent($section){\n echo $this->getContent($section);\n }", "public function print_general_section_info()\n {\n _e('This is the general settings for the site.', 'bk-fonts');\n }", "public function print_section_html($args)\r\n {\r\n var_dump($args);\r\n print 'Enter your settings below:';\r\n }", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function settings_section_text() {\r\n\t\t\t\t// Think of this as help text for the section.\r\n\t\t\t\techo '<h1>';\r\n\t\t\t\techo esc_html( 'These settings are for configuring Sift Ninja' );\r\n\t\t\t\techo '</h1>';\r\n\r\n\t\t\t\techo 'If you do not have a Sift ninja account, you can visit <a href=\"http://www.siftninja.com?platform=WordPressPlatform\" target=\"_blank\">Sift Ninja</a> to create your free account.';\r\n\t\t}", "public function print () : void {\r\n echo $this->getTitle(), PHP_EOL, PHP_EOL;\r\n echo $this->getInfo(), PHP_EOL, PHP_EOL;\r\n\r\n foreach ($this->items as $index => $value) {\r\n echo ($index + 1) . '. ' . $value->getText(), PHP_EOL;\r\n }\r\n\r\n echo PHP_EOL;\r\n }", "public function display()\n\t{\n\t\t$url = $this->get_page_url( array( 'tab' => 'list' ) );\n\t\t?>\n\t\t<a href=\"<?php echo $url; ?>\"><< Return to Section List</a>\n\t\t<?php\n\t\t\n\t\tif( !isset($_GET['key']) && !is_numeric($_GET['key']) )\n\t\t{\n\t\t\techo 'The section key is not specified.';\n\t\t\treturn;\n\t\t}\n\n\t\t$this->section = $this->model->get_section_by_key( $_GET['key'] );\n\n\t\tif( $this->section === NULL )\n\t\t{\n\t\t\techo 'The section key is not valid.';\n\t\t\treturn;\n\t\t}\n\n\t\t$this->section = $this->model->filter_section( $this->section );\n\t\t\n\t\t$this->print_settings();\n\t}", "function display_header_text()\n {\n }", "function RenderSectionTitle($section) {\r\n $this->SetSectionFont();\r\n $this->Cell($this->sectionTitleWidth, 0, $section);\r\n }", "public function getSection() : string{\n return $this->section;\n }", "function dumpContents()\r\n {\r\n\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n //TODO [Perez][JLeon] Do we leave this method?\r\n // call the OnShow event if assigned so the Text property can be changed\r\n if ($this->_onshow != null)\r\n {\r\n $this->callEvent('onshow', array());\r\n }\r\n\r\n $avalue = $this->_text;\r\n $avalue=str_replace('\"','&quot;',$avalue);\r\n $type = \"progress\";\r\n if ($this->_type == pbsMeterBar)\r\n $type = \"meter\";\r\n echo \"<$type id=\\\"$this->_name\\\" value=\\\"$avalue\\\" $attributes>$this->_text</$type>\";\r\n\r\n }", "private function _subheader($text){\n echo '[-] ' . $text . PHP_EOL;\n }", "public function print_advanced_css_section_info()\n {\n _e('This is the advanced css settings for the plugin.', 'bk-fonts');\n }", "public function yieldSection(): string\n {\n if (empty($this->sectionStack)) {\n return '';\n }\n\n return $this->yieldContent($this->stopSection());\n }", "public function renderHeadSection()\n\t{\n\t\treturn \"\";\n\t}", "private function renderSections() {\n\t\t$result = '';\n\n\t\tforeach ($this->sections as $key => $section) {\n\t\t\t$columns = $this->retrieveColumns($section['uid']);\n\n\t\t\tswitch (count($columns)) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$renderedColumns = '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$renderedColumns = $this->renderOneColumn($columns[0]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$renderedColumns = $this->renderTwoColumns($columns);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$class = ($key == 0) ? 'tx-explanationbox-pi1-active' : 'tx-explanationbox-pi1-inactive';\n\n\t\t\t$this->setMarker('class_section', $class);\n\t\t\t$this->setMarker('section_number', $key);\n\t\t\t$this->setMarker('section_columns', $renderedColumns);\n\n\t\t\t$result .= $this->getSubpart('SECTION_BODY');\n\t\t}\n\n\t\t$this->setSubpart('SECTION_BODY', $result);\n\t}", "public function section_header() {\r\n\t\techo '<p>Other menu options will only show when there is a connection to the API.</p>';\r\n\t}", "public function render_settings_section() {\n\t\tprintf( __( 'Insert your %s license information to enable future updates (including bug fixes and new features) and gain access to support.', $this->text_domain ), $this->product_name );\n\t}", "private function printHeader()\n {\n $this->printer->println('Test-Flight %s', Constants::VERSION);\n }", "function printContent()\t{\n\n\t\t\t\t\t$this->content.=$this->doc->endPage();\n\t\t\t\t\techo $this->content;\n\t\t\t\t}", "function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "public function printContent() {\r\n $this->content .= $this->doc->endPage();\r\n echo $this->content;\r\n }", "function printContent()\t{\n\t\t$this->content.= $this->doc->endPage();\n\t\techo $this->content;\n\t}", "public function renderContent()\n {\n // Isn't a legale section\n if(!$this->processor->section) return;\n\n $method = 'gen'.ucfirst($this->processor->section);\n if(method_exists($this, $method)) {\n $section = $this->$method();\n return $this->tplp->render($section, $this->processor->data,\n true, array(), true\n );\n }\n }", "public function printContent()\n {\n echo $this->content;\n }", "function printContent()\t{\n\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->content;\n\t}", "function main_section() {\n\t\t\t\t// GNDN\n\t\t}", "function printContent()\t{\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}", "function myprefix_settings_section_content() {\n\techo '<p>';\n\t_e('Settings section description.');\n\techo '</p>';\n}", "function sectionDisplay($optionArray) {\n\n\textract($optionArray);\n\n\t//set some defaults for our header\n\tif ($leftHeader) $header = $leftHeader;\n\tif ($hideHeader) $header = null;\n\n\tif ($header) $header = \"<div class=\\\"sectionHeader\\\">\n\t\t\t\t\".$header.\"\n\t\t\t\t</div>\\n\";\n\t\n\t$string = \"\n\t<div class=\\\"sectionContainer\\\">\n\t\t\".$header.\"\n\t\t<div class=\\\"sectionContent\\\">\n\t\t\".$content.\"\n\t\t</div>\n\t</div>\n\t\";\n\t\n\treturn $string;\n\n}", "function show() {\n // Abort if empty file\n if($this->oParser->oManager->tsCurDate < 1) {\n return;\n }\n \n // We want to process the output later\n ob_start();\n\n $this->printHeading();\n $this->printDailyMessages();\n $this->printAbsentTeachers();\n $this->printStandInTable();\n $this->printStandInTableFooter();\n\n $str = ob_get_clean();\n #debugPrint($str);\n echo vpBeautifyString($str);\n }", "public function displayComponent() {\n\t\t\n\t\t\t$this->outputLine($this->_content);\n\t\t\t\n\t\t}", "function printContent()\t{\n\t\techo $this->content;\n\t}", "function printContent()\t{\n\t\techo $this->content;\n\t}", "function pqrc_section_title_cal()\n {\n echo \"<h2>\" . __('Post QRC Settings Section', 'post-qurcode') . \"</h2>\";\n }", "public function sectionBegin() {}", "public function sectionBegin() {}", "function title(Printer $printer, $text)\n\t{\n\t $printer -> selectPrintMode(Printer::MODE_EMPHASIZED);\n\t $printer -> text(\"\\n-------- \" . $text.\" --------\\n\");\n\t $printer -> selectPrintMode(); // Reset\n\t}", "public function show(section $section)\n {\n //\n }", "function printHTML() \n {\n $this->openBlockHeader(\"CASPSR Help &amp; Support\");\n?>\n <table>\n <tr>\n <td>\n <a href=\"https://docs.google.com/document/d/1TqPdFopf5TkQ4uFGPWRfsaxd9zsex4YbDtzDr0NO7bI/edit?hl=en&authkey=CJuapdQO\">CASPSR Observer's Guide</a>\n </td>\n <td>Basic information on the use of CASPSR</td>\n </tr>\n <tr>\n <td>\n <a href=\"http://psrdada.sf.net/support.shtml\" style=\"text-decoration: none\"> <font color=green>PSR</font>DADA Support</a>\n </td>\n <td>To report bugs and/or request features</td>\n </tr>\n </table>\n\n<?\n $this->closeBlock();\n }", "public function getSection(): string\n {\n return $this->section;\n }", "private static function _printSectionsContent(array $settings)\n {\n $sections = Util::getArrayIndex($settings, 'sections', array());\n $class = $settings['widget']['type'];\n\n foreach ($sections as $section) {\n // Title of the section.\n echo '<div class=\"'.$class.'-section-title\">';\n echo $section['label'];\n echo '</div>';\n\n // Items for this section.\n $items = Util::getArrayIndex($section, 'items', array());\n GUIScreenSettings::printItems($items, $settings);\n }\n\n }", "function dumpInfo() {\n $op = '';\n foreach ($this->sectionList as $sectionName=>$sec) {\n $op .= $sec->dumpInfo();\n }\n return $op;\n }", "function display_section_content( $retval, $section ) {\n\t$layout = get_field( 'section_layout', $section );\n\tswitch ( $layout ) {\n\t\tcase 'courses':\n\t\t\t$retval = display_course( $section );\n\t\t\tbreak;\n\t\tcase 'timeline':\n\t\t\t$retval = display_timeline_items( $section );\n\t\t\tbreak;\n\t\tcase 'default':\n\t\tdefault:\n\t\t\t$retval = \\UCF_Section_Common::ucf_section_display( $section );\n\t\t\tbreak;\n\t}\n\n\treturn $retval;\n}", "function display_analytics_section_html()\n\t\t{\n\t\t\techo '<p>';\n\t\t\techo 'Enter code block used for site analytics';\n\t\t\techo '</p>';\n\t\t}", "public function reports_output() {\n\n\t\t\t// CHANGE THIS\n\t\t\techo 'This is where your new content section\\'s content goes.';\n\t\t}", "protected function outputSection($section_name, $message)\n {\n $formattedLine = $this->formatter->formatSection(\n $section_name,\n $message\n );\n if ($this->is_verbose) {\n $this->output->writeln($formattedLine);\n }\n $this->syslog($message, 'info');\n }", "function print_additional_settings_section_info() {\n }", "public function printAlignmentPage ()\r\n {\r\n $row_count = $this->number_of_rows;\r\n $col_count = $this->number_of_columns;\r\n $return = '';\r\n $test_block = '\r\n <div class=\"testpage\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas diam purus, fermentum vitae, tempus id, placerat at, dui. Ut vel orci et enim pellentesque pretium. Duis aliquam nulla vel orci. Sed sit amet ante a sem sodales bibendum. Curabitur faucibus bibendum erat. Suspendisse dolor est, mollis sit amet, lobortis in, blandit ultricies, urna. Nulla mollis nunc ac quam. Duis id orci non turpis elementum iaculis. Sed porttitor tincidunt pede. Nulla non justo id augue pretium porttitor. Suspendisse potenti. Suspendisse blandit, elit sit amet consectetuer accumsan, turpis ante facilisis enim, nec pellentesque magna purus id orci.<br>\r\n Praesent tortor mauris, mollis non, tempor vitae, aliquet vitae, augue. Nullam diam. Vestibulum et urna. Nunc in sapien. In elementum est et diam. Vivamus nulla tellus, porta eget, tempus eget, fringilla sed, lacus. Suspendisse purus libero, consequat eu, lobortis non, luctus in, sapien. Aenean quam eros, rhoncus vel, iaculis et, scelerisque in, magna. Aenean hendrerit, odio id mollis varius, urna pede vulputate massa, ac blandit arcu justo laoreet purus. Integer et felis at lectus commodo consequat. Vestibulum a arcu. Donec est ligula, viverra ac, tempor sit amet, ultrices quis, pede.</div>';\r\n $return .= '<style>'.$this->getLabelCSS().'\r\n </style>';\r\n $return .= $this->beginLabelSheet();\r\n while (--$row_count > 0)\r\n {\r\n $return .= $test_block;\r\n $return .= $this->advanceLabelRow();\r\n }\r\n while (--$col_count > 0)\r\n {\r\n $return .= $test_block;\r\n $return .= $this->advanceLabel();\r\n }\r\n $return .= $test_block;\r\n $return .= $this->finishLabelSheet();\r\n return $return;\r\n }", "function getContent() {\t \r\n\t \t$content = '';\r\n\t \t\t \t\r\n\t \tif (empty($this->first)) {\t\r\n\t\t\t$content .= '\\sect \\sectd ';\r\n\t\t}\t\t\r\n\t\t\t\t\r\n\t\t//headers\r\n\t\tif (!empty($this->headers)) {\r\n\t\t\tforeach ($this->headers as $value) {\t\t \r\n\t\t\t \t$content .= $value->getContent();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t \tforeach ($this->rtf->headers as $value) {\t\t \r\n\t\t\t \t$content .= $value->getContent();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//footers\r\n\t\tif (!empty($this->footers)) {\r\n\t\t\tforeach ($this->footers as $value) {\t\t \r\n\t\t\t \t$content .= $value->getContent();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t \tforeach ($this->rtf->footers as $value) {\t\t \r\n\t\t\t \t$content .= $value->getContent();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//borders\r\n\t\tif (!empty($this->bordered)) {\r\n\t\t\t$content .= $this->bordered->getContent($this->rtf, '\\pg');\r\n\t\t} else if (!empty($this->rtf->bordered)) {\t\r\n\t\t\t$content .= $this->rtf->bordered->getContent($this->rtf, '\\pg');\r\n\t\t}\t\t\r\n\t \t\r\n\t \t//section properties\r\n\t \tif (!empty($this->noBreak)) {\t\t\r\n\t\t\t$content .= '\\sbknone '; \t\r\n\t\t}\r\n\t \t\r\n\t \tif (!empty($this->columnsCount)) {\t\t \r\n\t\t \t$content .= '\\cols'.$this->columnsCount.' '; \r\n\t\t}\r\n\t\t\r\n\t\tif (empty($this->columnsWidths)) {\t\t\t\t\r\n\t\t\tif (!empty($this->spaceBetweenColumns)) {\t\t\t \r\n\t\t\t \t$content .= '\\colsx'.round($this->spaceBetweenColumns * TWIPS_IN_CM).' ';\r\n\t\t\t}\t\t\t\r\n\t\t} else {\t\t \r\n\t\t \t$width = 0;\r\n\t\t \tforeach ($this->columnsWidths as $value) {\t\t \t \r\n\t\t \t \t$width += $value * TWIPS_IN_CM;\r\n\t\t \t}\r\n\t\t \t\r\n\t\t \t$printableWidth = ($this->rtf->paperWidth - $this->rtf->marginLeft - $this->rtf->marginRight);\t\t \t\r\n\t\t \t$space = round(($printableWidth * TWIPS_IN_CM - $width) / (count($this->columnsWidths) - 1));\r\n\t\t \t\t\t \t\r\n\t\t\t$i = 1;\r\n\t\t \tforeach ($this->columnsWidths as $key => $value) {\r\n\t\t\t\t$content .= '\\colno'.$i.'\\colw'.($value * TWIPS_IN_CM);\t\t\t\t\r\n\t\t\t\tif (!empty($this->columnsWidths[$key])) {\t\t\t\t \r\n\t\t\t\t \t$content .= '\\colsr'.$space;\r\n\t\t\t\t}\r\n\t\t\t \t$i ++;\r\n\t\t\t}\t\t \r\n\t\t\t$content .= ' ';\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif (!empty($this->lineBetweenColumns)) {\t\t \r\n\t\t \t$content .= '\\linebetcol ';\r\n\t\t}\r\n\t\t\t\t\r\n\t\t/*---Page part---*/\t\t\t\t\r\n\t\tif (isSet($this->paperWidth)) {\t\t \r\n\t\t \t$content .= '\\pgwsxn'.round($this->paperWidth * TWIPS_IN_CM).' ';\r\n\t\t}\r\n\t\t\r\n\t\tif (isSet($this->paperHeight)) {\t\t \r\n\t\t \t$content .= '\\pghsxn'.round($this->paperHeight * TWIPS_IN_CM).' ';\r\n\t\t} \r\n\t\t\r\n\t\tif (isSet($this->marginLeft)) {\t\t \r\n\t\t \t$content .= '\\marglsxn'.round($this->marginLeft * TWIPS_IN_CM).' ';\r\n\t\t} \r\n\t\t\r\n\t\tif (isSet($this->marginRight)) {\t\t \r\n\t\t \t$content .= '\\margrsxn'.round($this->marginRight * TWIPS_IN_CM).' ';\r\n\t\t}\r\n\t\t\r\n\t\tif (isSet($this->marginTop)) {\t\t \r\n\t\t \t$content .= '\\margtsxn'.round($this->marginTop * TWIPS_IN_CM).' ';\r\n\t\t}\r\n\t\t\r\n\t\tif (isSet($this->marginBottom)) {\t\t \r\n\t\t \t$content .= '\\margbsxn'.round($this->marginBottom * TWIPS_IN_CM ).' ';\r\n\t\t}\r\n\t\t\r\n\t\tif (isSet($this->gutter)) {\t\t \t\r\n\t\t\t$content .= '\\guttersxn'.round($this->gutter * TWIPS_IN_CM).' '; \r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($this->mirrorMargins)) {\t\t \t\r\n\t\t\t$content .= '\\margmirsxn '; \r\n\t\t}\t\t\t\t\r\n\t\t\r\n\t\t//vertical alignment\t\t\t\t\r\n\t\tif (!empty($this->alignment)) {\t\t \r\n\t\t \t$content .= $this->alignment;\t \r\n\t\t}\t\t\t\r\n\t\t\r\n\t \t$content .= \"\\r\\n\".parent::getContent().\"\\r\\n\";\t \t\r\n\t \t\r\n\t \treturn $content;\r\n\t}", "protected function getSubtitle($section) {\n return 'WSAT - RND 4KiB 100% W';\n }", "protected function getSection() {\n\t\treturn 'poker';\n }", "public function show(Section $section)\n {\n //\n }", "public function show(Section $section)\n {\n //\n }", "public function show(Section $section)\n {\n //\n }", "public function formatting()\n\t{\n\t\tmd('sketchpad::help/output/formatting');\n\t}", "function dumpInfo() {\n global $_dOp;\n $op = \"SECTION: $this->sectionName<br />\";\n $_dOp = '';\n foreach ($this->varList as $secID => $vars) {\n $op .= \" -- section ID: $secID<br />\";\n foreach ($vars as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varObj->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varObj->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n \n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n else {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varTag->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varTag->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n }\n return $op;\n }", "public function section_description ( $section ) {\n\t\tif ( isset( $this->sections[$section['id']]['description'] ) ) {\n\t\t\techo wpautop( esc_html( $this->sections[$section['id']]['description'] ) );\n\t\t}\n\t}", "function printHeader($text) {\n \treturn \"<h2>\".$text.\"</h2>\";\n }", "public static function printText($text)\n {\n $text = self::removeDivs($text);\n echo '<p class=\"text-content\">' . $text .'<p>';\n }", "function SetSectionFont() {\r\n $this->SetFont(\"Arial\", \"B\", 16);\r\n $this->SetTextColor(0, 0, 0);\r\n }", "private function _header($text){\n echo '[*] ' . $text . PHP_EOL;\n }", "function myText(){\n\t\n\n\techo '<h1>before subForums</h1>';\n\t\n\n}", "public function printContent() {\n\t\t//$this->doc->addStyleSheet();\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->doc->insertStylesAndJS($this->content);\n\t}" ]
[ "0.7569277", "0.74426144", "0.73395956", "0.7320328", "0.7144404", "0.7112716", "0.69916064", "0.6867665", "0.68493974", "0.67556393", "0.66533613", "0.66291517", "0.65949726", "0.65654373", "0.6496098", "0.63539654", "0.63539654", "0.63539654", "0.63529944", "0.63529944", "0.63529944", "0.63529944", "0.63529944", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.6352923", "0.63352084", "0.6321994", "0.62971675", "0.6248812", "0.6242993", "0.62357336", "0.62347734", "0.62147003", "0.61068314", "0.60907733", "0.6082715", "0.6067926", "0.6040768", "0.6036348", "0.6034707", "0.6029822", "0.6026261", "0.6026261", "0.6026261", "0.6025138", "0.6016816", "0.6011632", "0.60072917", "0.6006723", "0.6006649", "0.5996311", "0.5995916", "0.59952956", "0.5989464", "0.598779", "0.59690714", "0.59690714", "0.59685546", "0.5908947", "0.5908947", "0.5902695", "0.5902317", "0.5901095", "0.5896338", "0.58939904", "0.5885105", "0.58802897", "0.5861534", "0.5828714", "0.5817644", "0.58113533", "0.58006716", "0.57989144", "0.57800096", "0.577268", "0.57663083", "0.57663083", "0.57663083", "0.5760206", "0.5755498", "0.57470167", "0.57440835", "0.5733046", "0.57244676", "0.5716142", "0.57132614", "0.570872" ]
0.74607974
3
Get the settings option array and print one of its values
public function id_number_callback() { printf( '<input type="text" id="my_id_number" name="my_id_number" value="%s" />', isset( $this->options['my_id_number'] ) ? esc_attr( $this->options['my_id_number']) : '' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_settings($option)\n {\n }", "function bdpp_get_settings() {\n\t\n\t$options = get_option('bdpp_opts');\n\t\n\t$settings = (is_array($options)) ? $options : array();\n\t\n\treturn $settings;\n}", "public function viewSettings(array $settings = array());", "function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}", "function display_var_settings($settings)\n {\n return $this->_settings_ui($settings);\n }", "public static function get_option_setting()\n\t\t{ \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\t$opt_list = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.self::$table_name_settings);\n\t\t\t\t\n\t\t\t\t$option =array();\n\t\t\t\t\n\t\t\t\tif(!empty($opt_list)){\n\t\t\t\t\t\n\t\t\t\t\tforeach($opt_list as $key => $val){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$option[] = $val->rs_lang;\n\t\t\t\t\t\t\t$option[] = $val->rs_type;\t\t\t\t\t\n\t\t\t\t\t\t\t$option[] = $val->rs_postid;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $option;\n\t\t\t\t\n\t\t}", "public function getOptions() {\n\t\tif ($this->row->options != '') {\n\t\t\t$options = explode(\";\", $this->row->options);\n\t\t}\n\t\tif ($this->row->intoptions != '') {\n\t\t\t$intoptions = explode(\";\", $this->row->intoptions);\n\t\t\t$options_map = array_combine($intoptions, $options);\n\t\t}\n\t\tif ($options) {\n\t\t\t$msg = \"Predefined Options:\\n\";\n\t\t\tif ($intoptions) {\n\t\t\t\tforeach ($options_map as $key => $label) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$key}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$label}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($options as $char) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$char}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$char}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}", "function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }", "function getOptions() ;", "public function showOptions()\n {\n\treturn $this->getConfigData('checkout/delivery_options');\n }", "public function printOptValue($array){\n if(empty($array)){\n print \"<h1>Array is empty!</h1>\";\n return false;\n }\n foreach($array as $key => $value){\n print(\"<option value='$value'>$value</option>\");\n }\n\n }", "public static function get_current_options(){\n\t\t\t\n\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\n\t\t\t$settings = $wpdb->get_results(\"SELECT * FROM \".$wpdb->prefix.self::$table_name_settings); \n\t\t\t\n\t\t\t$arr_opt = array();\n\t\t\tif(!empty($settings)){\n\t\t\t\t\tforeach($settings as $key => $val){\n\t\t\t\t\t\t$arr_opt[] = $val->rs_postid;\n\t\t\t\t\t\t$arr_opt[] = $val->rs_lang;\n\t\t\t\t\t\t$arr_opt[] = $val->rs_posttype;\n\t\t\t\t\t\t$arr_opt[] = $val->rs_type;\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t\t\t\t$arr_opt[] = null;\n\t\t\t}\n\t\t\t\n\t\t\treturn $arr_opt;\n\t\n\t\t}", "function bb_print_mystique_option( $option ) {\r\n\techo bb_get_mystique_option( $option );\r\n}", "public function get_setting() {\n // $this->db->where('option_name', $opname);\n \n $query = $this->db->get('t_pref');\n return $query->row();\n }", "public function showSettings()\n\t{\n\n\t\treturn $this->showDefaultSettings();\n\t}", "function blog_analytics() { \n$options = get_option('blog_theme_options');\necho $options['analytics']; \n}", "public function getOpt($option) {}", "function __get_option($setting)\n {\n }", "private function getSettings()\n\t\t{\n\t\t\tforeach($this->settings as $key => $val) {\n\t\t\t\t$this->settings[$key] = !empty(get_option($this->tag.$key)) ? get_option($this->tag.$key) : '';\n\t\t\t}\n\t\t}", "public function getSettings();", "public function getSettings() : array;", "static function getGeneralSettingsValues(){\r\n\t\t\r\n\t\t$arrValues = get_option('revslider-global-settings', '');\r\n\t\t\r\n\t\t$arrValues = maybe_unserialize($arrValues);\r\n\r\n\t\treturn($arrValues);\r\n\t}", "abstract public function get_settings();", "public function get_settings() {\r\n\t\t\t$my_option = get_option( '_wpeo_log_settings', array() );\r\n\t\t\t$this->wpeologs_settings = array_merge( $this->wpeologs_settings, (array)$my_option );\r\n\t\t}", "public function get_settings( ) {\n\n $settingsArray = $this->mockinvoice_model->get_settings_array( $this->input->post( 'mockInvoiceId' ) );\n\n // Send back the timesheet settings as JSON.\n $this->json_library->print_array_json( $settingsArray );\n }", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public function getOptions(): array;", "public static function get_settings() {\n\t\treturn array_merge( SpamLyticsHelper::default_settings(), get_option( 'spamlytics', array() ) );\n\t}", "function getSettings() {\n\t\t$current_opts = get_option('wassup_settings');\n\t\t$default_opts = $this->defaultSettings();\n\t\t$settings = array();\n\t\tif (!empty($current_opts) && is_array($current_opts)) {\n\t\t\tforeach ($default_opts as $skey => $defaultvalue) {\n\t\t\t if (array_key_exists($skey,$current_opts)) {\n\t\t\t \t$settings[$skey] = $current_opts[$skey];\n\t\t\t } else {\n\t\t\t \t$settings[$skey] = $defaultvalue;\n\t\t\t }\n\t\t\t} //end foreach\n\t\t} else {\n\t\t\t$settings = $default_opts;\n\t\t}\n\t\treturn $settings;\n\t}", "public function get() {\n\t\treturn $this->options->get( self::OPTION );\n\t}", "abstract public function settings(): array;", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getValues(){\n\t\treturn $this->_settings;\n\t}", "public function print_settings_section_info()\n {\n }", "public function settings_get()\n \t{\n \t\tlog_message('debug', 'Score/setting_get');\n\n\t\t$result = $this->_score->get_settings(\n\t\t\t$this->get('type'),\n\t\t\t$this->get('use'),\n\t\t\textract_id($this->get('storeId'))\n\t\t);\n\n\t\tlog_message('debug', 'Score/setting_get:: [1] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "function cpo_get_option( $option_name = '', $option_array = 'ctct_settings' ) {\n\t//Determines whether to grab current language, or original language's option\n\t$option_list_name = $option_array;\n\t$option_list = get_option( $option_list_name, false );\n\tif ( $option_list && isset( $option_list[ $option_name ] ) ) {\n\t\t$option_value = $option_list[ $option_name ];\n\t} else {\n\t\t$option_value = false;\n\t}\n\n\treturn $option_value;\n}", "function getOptions();", "public function get_settings() {\n\t\tif ( ! is_array( $this->_settings ) ) {\n\t\t\t$this->_settings = get_option( $this->token, array() );\n\t\t}\n\t\t\n\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\tif ( ! isset( $this->_settings[$k] ) && isset( $v['default'] ) ) {\n\t\t\t\t$this->_settings[$k] = $v['default'];\n\t\t\t}\n\t\t\tif ( $v['type'] == 'checkbox' && $this->_settings[$k] != true ) {\n\t\t\t\t$this->_settings[$k] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->_settings;\n\t}", "function get_options(){\n\t\treturn $this->options;\n\t}", "public function get_settings()\n {\n }", "function get_the_option( $key ) {\n return genesis_get_option( $key, GENESIS_SIMPLE_SETTINGS_FIELD );\n }", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function value()\n {\n return $this->app->input->get('option');\n }", "public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}", "function bdpp_settings_tab() {\n\t\n\t$result_arr = array();\n\n\t$settings_arr = apply_filters('bdpp_settings_tab', array(\n\t\t\t\t\t\t\t'general'\t=> __('General', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'trending'\t=> __('Trending Post', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'taxonomy'\t=> __('Taxonomy', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'sharing'\t=> __('Sharing', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'css'\t\t=> __('CSS', 'blog-designer-pack'),\n\t\t\t\t\t\t\t'misc'\t\t=> __('Misc', 'blog-designer-pack'),\n\t\t\t\t\t\t));\n\n\tforeach ($settings_arr as $sett_key => $sett_val) {\n\t\tif( !empty($sett_key) && !empty($sett_val) ) {\n\t\t\t$result_arr[trim($sett_key)] = trim($sett_val);\n\t\t}\n\t}\n\n\treturn $result_arr;\n}", "public function show_options( array $opts ) : void {\t\n\t\t$i = -1;\n\t\twhile( ($i++) < sizeof( $opts ) - 1 ){\n\t\t\tif( $i == 1 )\n\t\t\t\techo \"<br><br>\";\n\t\t\tforeach( $opts[ $i ] as $optn => $optv ){\n\t\t\t\techo \"<span style='position: absolute;'>\".$optn.\" -> \".$optv.\"</span><br>\";\n\t\t\t}\n\t\t}\n\t}", "function the_option( $key ) {\n\n if ( ! $this->get_the_option( $key ) )\n return false;\n\n echo $this->get_the_option( $key );\n }", "public function getOptions(){ return $this->option_map; }", "public function ovpnDisplayConfig()\n {\n $readArr = unserialize(file_get_contents(\"./vpn/ovpn.array.config\"));\n foreach ($readArr as $key=>$value) {\n echo \"$key = $value<br />\\n\";\n }\n }", "public function run()\n {\n// Options are settings\n\n if ($this->command) $this->command->info('Creating Option Settings');\n\n\n $options_array = array(\n [\n 'key' => 'Landing Title',\n 'default' => \"What is trending in Kenya.\",\n 'value_type' =>Option::TYPE_STR\n ],\n [\n 'key' => 'Landing Description',\n 'default' => \"Getting all the news that are trending in Kenya.\",\n 'value_type' =>Option::TYPE_STR\n ],\n\n [\n 'key' => 'Contact Title',\n 'default' => \"Talk to us.\",\n 'value_type' =>Option::TYPE_STR\n ],\n [\n 'key' => 'Contact Description',\n 'default' => \"Find our contact information and contact form.\",\n 'value_type' =>Option::TYPE_STR\n ],\n\n [\n 'key' => 'Footer Title',\n 'default' => \"Welcome to Inatrend Kenya\",\n 'value_type' =>Option::TYPE_STR\n ],\n\n [\n 'key' => 'Footer Description',\n 'default' => \"\n <p>\n <small>We are here to get you the latest that is trending in Kenya.</small>\n </p>\n <div class=\\\"social-list\\\">\n <a class=\\\"social-list-item\\\" href=\\\"http://twitter.com\\\">\n <span class=\\\"icon icon-twitter\\\"></span>\n </a>\n <a class=\\\"social-list-item\\\" href=\\\"http://facebook.com\\\">\n <span class=\\\"icon icon-facebook\\\"></span>\n </a>\n <a class=\\\"social-list-item\\\" href=\\\"http://linkedin.com\\\">\n <span class=\\\"icon icon-linkedin\\\"></span>\n </a>\n </div>\n \",\n 'value_type' =>Option::TYPE_LON\n ],\n\n [\n 'key' => 'Latest Post Count',\n 'default' => 4,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Trending Post Count',\n 'default' => 4,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Trending Days Limit',\n 'default' => 30,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Limit Latest Post Per Category',\n 'default' => 6,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Primary Color',\n 'default' => '#56c8f3',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Primary Text Color',\n 'default' => '#111111',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Secondary Color',\n 'default' => '#0D325B',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Secondary Text Color',\n 'default' => '#EEEEEE',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Primary Button Color',\n 'default' => '#029ACF',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Secondary Button Color',\n 'default' => '#0D325B',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Danger Button Color',\n 'default' => '#ff0000',\n 'value_type' =>Option::TYPE_COL\n ],\n\n [\n 'key' => 'Maximum Rating',\n 'default' => 10,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n [\n 'key' => 'Default Font Size',\n 'default' => 16,\n 'value_type' =>Option::TYPE_NUM\n ],\n\n );\n\n foreach ($options_array as $option) {\n Option::create([\n 'key' => $option['key'],\n 'default' => $option['default'],\n 'value_type' =>$option['value_type']\n ]);\n }\n }", "public function option()\n\t{\n\t\treturn [];\n\t}", "public function get_settings() {\n\n\t\tif($this->settings) {\n\t\t\treturn $this->settings;\n\t\t}\n\n\t\t$query = $this->db->get('shortee_settings');\n\t\t$this->settings = $query->row_array();\n\t\t$this->domain_list = explode(',',$this->settings['short_domain']);\n\n\t\treturn $this->settings;\n\t}", "private static function getOption()\n {\n return array_merge(\n array_flip(['application_id', 'api_key', 'index_name']),\n array_filter((array) get_option('algolia_index'))\n );\n }", "public function actionMyOptions()\n {\n echo \"option1 - $this->option1\\n\\roption2 - $this->option2\\n\\rcolor - $this->color\\n\\r\";\n }", "public function get_settings() {\n\n\t\t$settings = get_option($this->option_name);\n\n\t\tif ( false === $settings && isset($this->alt_option_name) )\n\t\t\t$settings = get_option($this->alt_option_name);\n\n\t\tif ( !is_array($settings) )\n\t\t\t$settings = array();\n\n\t\tif ( !empty($settings) && !array_key_exists('_multiwidget', $settings) ) {\n\t\t\t// old format, convert if single widget\n\t\t\t$settings = wp_convert_widget_settings($this->id_base, $this->option_name, $settings);\n\t\t}\n\n\t\tunset($settings['_multiwidget'], $settings['__i__']);\n\t\treturn $settings;\n\t}", "public function getSetting() {}", "public function getSetting() {}", "public function general_settings_inputs() {\n\t\t$option_object = $this->get_analytics_options();\n\n\t\t$campus = array(\n\t\t\t'pullman' => 'Pullman',\n\t\t\t'spokane' => 'Spokane',\n\t\t\t'vancouver' => 'Vancouver',\n\t\t\t'tri-cities' => 'Tri-Cities',\n\t\t\t'globalcampus' => 'Global Campus',\n\t\t\t'everett' => 'Everett',\n\t\t);\n\n\t\t$college = array(\n\t\t\t'arts-and-sciences' => 'Arts & Sciences',\n\t\t\t'cahnrs' => 'CAHNRS & Extension',\n\t\t\t'carson' => 'Carson',\n\t\t\t'education' => 'Education',\n\t\t\t'honors' => 'Honors',\n\t\t\t'medicine' => 'Medicine',\n\t\t\t'murrow' => 'Murrow',\n\t\t\t'nursing' => 'Nursing',\n\t\t\t'pharmacy' => 'Pharmacy',\n\t\t\t'vetmed' => 'VetMed',\n\t\t\t'voiland' => 'Voiland',\n\t\t);\n\n\t\t$unit_type = array(\n\t\t\t'center' => 'Center',\n\t\t\t'department' => 'Department',\n\t\t\t'laboratory' => 'Laboratory',\n\t\t\t'office' => 'Office',\n\t\t\t'program' => 'Program',\n\t\t\t'school' => 'School',\n\t\t\t'unit' => 'Unit',\n\t\t);\n\n\t\t// @todo complete units taxonomy.\n\t\t$units = array();\n\n\t\t?>\n\t\t<!-- campus -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-campus\">Campus:</label>\n\t\t<select id=\"wsu-analytics-campus\" name=\"wsuwp_analytics_option_map[campus]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['campus'] ); ?>>None</option>\n\t\t\t<option value=\"all\" <?php selected( 'all', $option_object['campus'] ); ?>>All</option>\n\t\t\t<?php foreach ( $campus as $key => $name ) : ?>\n\t\t\t\t<option value=\"<?php echo $key; ?>\" <?php selected( $key, $option_object['campus'] ); ?>><?php echo $name; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent a campus in location or association?</p><br/>\n\n\t\t<!-- college -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-college\">College:</label>\n\t\t<select id=\"wsu-analytics-college\" name=\"wsuwp_analytics_option_map[college]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['college'] ); ?>>None</option>\n\t\t\t<option value=\"all\" <?php selected( 'all', $option_object['college'] ); ?>>All</option>\n\t\t\t<?php foreach ( $college as $key => $name ) : ?>\n\t\t\t\t<option value=\"<?php echo $key; ?>\" <?php selected( $key, $option_object['college'] ); ?>><?php echo $name; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent a college as a whole or by association?</p><br/>\n\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-unit-type\">Unit Type:</label>\n\t\t<select id=\"wsu-analytics-unit-type\" name=\"wsuwp_analytics_option_map[unit_type]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['unit_type'] ); ?>>None</option>\n\t\t\t<?php foreach ( $unit_type as $k => $v ) : ?>\n\t\t\t\t<option value=\"<?php echo $k; ?>\" <?php selected( $k, $option_object['unit_type'] ); ?>><?php echo $v; ?></option>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">What type of unit does this site represent?</p><br/>\n\n\t\t<!-- units -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-parent-unit\">Parent Unit:</label>\n\t\t<select id=\"wsu-analytics-parent-unit\" name=\"wsuwp_analytics_option_map[unit]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['unit'] ); ?>>None</option>\n\t\t\t<?php foreach ( $units as $key => $group ) : ?>\n\t\t\t\t<optgroup label=\"<?php echo $key; ?>\">\n\t\t\t\t<?php foreach ( $group as $item_key => $name ) : ?>\n\t\t\t\t\t<option value=\"<?php echo $item_key; ?>\" <?php selected( $item_key, $option_object['unit'] ); ?>><?php echo $name; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent an entity that has a parent unit? (e.g department, office, school)</p><br/>\n\n\t\t<!-- units -->\n\t\t<p><label class=\"wsu-analytics-label\" for=\"wsu-analytics-unit\">Unit:</label>\n\t\t<select id=\"wsu-analytics-unit\" name=\"wsuwp_analytics_option_map[subunit]\">\n\t\t\t<option value=\"none\" <?php selected( 'none', $option_object['subunit'] ); ?>>None</option>\n\t\t\t<?php foreach ( $units as $key => $group ) : ?>\n\t\t\t\t<optgroup label=\"<?php echo $key; ?>\">\n\t\t\t\t<?php foreach ( $group as $item_key => $name ) : ?>\n\t\t\t\t\t<option value=\"<?php echo $item_key; ?>\" <?php selected( $item_key, $option_object['subunit'] ); ?>><?php echo $name; ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t\t</optgroup>\n\t\t\t<?php endforeach; ?>\n\t\t</select></p>\n\t\t<p class=\"description\">Does this site represent an entity that is a unit? (e.g. department, office, school)</p><br/>\n\n\t\t<?php if ( ( function_exists( 'wsuwp_is_global_admin' ) && wsuwp_is_global_admin( wp_get_current_user()->ID ) ) || is_super_admin() ) : ?>\n\t\t<p><span class=\"wsu-analytics-label\">Track Global Analytics</span></p>\n\t\t<label>Yes <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_global]\" value=\"true\" <?php checked( 'true', $option_object['track_global'] ); ?> /></label>\n\t\t<label>No <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_global]\" value=\"false\" <?php checked( 'false', $option_object['track_global'] ); ?> /></label>\n\t\t<p class=\"description\">Should global WSU analytics be tracked on this site? This should normally be on and only disabled for debugging.</p><br/>\n\n\t\t<p><span class=\"wsu-analytics-label\">Track App Analytics</span></p>\n\t\t<label>Yes <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_app]\" value=\"true\" <?php checked( 'true', $option_object['track_app'] ); ?> /></label>\n\t\t<label>No <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_app]\" value=\"false\" <?php checked( 'false', $option_object['track_app'] ); ?> /></label>\n\t\t<p class=\"description\">Should WSUWP Platform analytics be tracked on this site? This should normally be on and only disabled for debugging.</p><br/>\n\n\t\t<p><span class=\"wsu-analytics-label\">Track Site Analytics</span></p>\n\t\t<label>Yes <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_site]\" value=\"true\" <?php checked( 'true', $option_object['track_site'] ); ?> /></label>\n\t\t<label>No <input type=\"radio\" class=\"regular-radio\" name=\"wsuwp_analytics_option_map[track_site]\" value=\"false\" <?php checked( 'false', $option_object['track_site'] ); ?> /></label>\n\t\t<p class=\"description\">Should analytics be tracked on this site? A Google Analytics ID is still required if this is enabled.</p><br/>\n\t\t<?php endif; ?>\n\n\t\t<hr/>\n\t\t<p class=\"description\">Instructions on how to set up your Google analytics to best use this plugin can be <a href=\"https://web.wsu.edu/wordpress/plugins/wsu-analytics/\">found here</a>.</p>\n\n\t\t<style>\n\t\t\t.wsu-analytics-label {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 185px;\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t\t.form-table td p.description {\n\t\t\t\tfont-size: 13px;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "function get_array_option($option, $subarray='') {\r\n\r\n $options = get_option('foliamaptool');\r\n\r\n\r\n\r\n if (empty($options))\r\n\t\t\treturn false;\r\n\r\n\t\tif ($subarray) {\r\n\t\t\tif (isset($options[$subarray][$option]))\r\n\t\t\t\treturn $options[$subarray][$option];\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// No subarray\r\n\t\tif (isset($options[$option]))\r\n\t\t\treturn $options[$option];\r\n\t\telse\r\n\t\t\treturn false;\r\n\r\n\t\t// If we get here it's an error\r\n\t\treturn false;\r\n\t}", "function get_option() {\n\t\t\tcheck_ajax_referer('ajax-nonce', 'nonce');\n\t\t\tif (!empty($_POST['option'])) {\n\t\t\t\tswitch ($_POST['option']) {\n\t\t\t\t\tcase 'blogname':\n\t\t\t\t\t\techo preg_replace_callback(\"/(&#[0-9]+;)/\", array($this, 'decode_entities'), html_entity_decode(get_bloginfo('name')));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'blogdescription':\n\t\t\t\t\t\techo preg_replace_callback(\"/(&#[0-9]+;)/\", array($this, 'decode_entities'), html_entity_decode(get_bloginfo('description')));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\techo get_option($_POST['option']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo 'notfound';\n\t\t\t}\n\t\t\tdie;\n\t\t}", "function print_additional_settings_section_info() {\n }", "function get_settings() {\n\t\treturn $this->settings;\n\t}", "function getValue($setting)\n\t\t{\n\t\t\t// lookup the value in the array \n\t\t\tif (isset($this->options[$setting]))\n\t\t\t{\n\t\t\t\t// return its value, if set\n\t\t\t\treturn $this->options[$setting];\n\t\t\t}\n\t\t\t\n\t\t\t// default to NULL\n\t\t\treturn NULL;\n\t\t}", "abstract public function getSettings();", "function settings_html() {\n $this->render_setting( 'label_any' );\n $this->render_setting( 'modifiers' );\n $this->render_setting( 'orderby' );\n $this->render_setting( 'count' );\n }", "public function pluginReadSettingsPage()\n {\n $this->getOptions();\n global $rundizable_wp_features_optname;\n\n $output['rundizable_wp_features_optname'] = $rundizable_wp_features_optname;\n\n $Loader = new \\RundizableWpFeatures\\App\\Libraries\\Loader();\n $Loader->loadView('admin/readsettings_v', $output);\n unset($Loader, $output);\n }", "function get_option($name) {\n $setting = Setting::where('name', $name)->first();\n if(!$setting) {\n return \"\";\n }\n return $setting->value;\n}", "protected function getOptions() {}", "protected function getOptions() {}", "public function wp_get_info(string $option = 'siteurl'){\n\n\t $bdd = Bdd::getInstance();\n\n\t\t$req = $bdd->dbh->prepare('SELECT option_value FROM '.$this->_table_prefix.'options WHERE option_name = \"' . $option . '\";');\n\t\t$req->execute();\n\n\t\treturn $req->fetch();\n\t}", "protected function getOptions() {}", "function getSettings($settings) {\r\n $this->reduceSettings();\r\n return array_merge($settings, $this->settings_array);\r\n }", "function get_settings()\n {\n #global $pdo, $db_settings;\n #$database = Database::getInstance();\n $result = Database::$content->query(\"SELECT name, value FROM \".Database::$db_settings['settings_table']);\n while($line = $result->fetch())\n {\n $settings[$line['name']] = $line['value'];\n }\n return $settings;\n }", "abstract public function getOptions();", "static public function get_settings() {\n\n\t\t$settings[] = array();\n\n\t\t$settings = array(\n\t\t\t'default_tab' => array(\n\t\t\t\t'default_tab_settings' => array(\n\t\t\t\t\t'name' => '<strong>' . __( 'Header', self::$plugin_name ) . '</strong>',\n\t\t\t\t\t'type' => 'header'\n\t\t\t\t),\n\t\t\t\t'missing_callback' => array(\n\t\t\t\t\t'name' => '<strong>' . __( 'Missing Callback', self::$plugin_name ) . '</strong>',\n\t\t\t\t\t'type' => 'non-exisit'\n\t\t\t\t),\n\t\t\t\t'checkbox' => array(\n\t\t\t\t\t'name' => __( 'Checkbox', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Checkbox', self::$plugin_name ),\n\t\t\t\t\t'type' => 'checkbox'\n\t\t\t\t),\n\t\t\t\t'multicheck' => array(\n\t\t\t\t\t'name' => __( 'Multicheck', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Multicheck with 3 options', self::$plugin_name ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'wp-human' => __( \"I read the <a href='https://wphuman.com/blog/'>WP Human Blog</a>\", self::$plugin_name ),\n\t\t\t\t\t\t'tang-rufus' => __( \"<a href='http://tangrufus.com/'>Tang Rufus' Blog</a> looks great\", self::$plugin_name ),\n\t\t\t\t\t\t'Filter' => __( 'You can apply filters on this option!', self::$plugin_name )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'multicheck'\n\t\t\t\t),\n\t\t\t\t'multicheck_without_options' => array(\n\t\t\t\t\t'name' => __( 'Multicheck', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Multicheck without options', self::$plugin_name ),\n\t\t\t\t\t'type' => 'multicheck'\n\t\t\t\t),\n\t\t\t\t'radio' => array(\n\t\t\t\t\t'name' => __( 'Radio', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Radio with 3 options', self::$plugin_name ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'wp-human' => __( \"I read the <a href='https://wphuman.com/blog/'>WP Human Blog</a>\", self::$plugin_name ),\n\t\t\t\t\t\t'tang-rufus' => __( \"<a href='http://tangrufus.com/'>Tang Rufus' Blog</a> looks great\", self::$plugin_name ),\n\t\t\t\t\t\t'Filter' => __( 'You can apply filters on this option!', self::$plugin_name )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'radio'\n\t\t\t\t),\n\t\t\t\t'radio_without_options' => array(\n\t\t\t\t\t'name' => __( 'Radio', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Radio without options', self::$plugin_name ),\n\t\t\t\t\t'type' => 'radio'\n\t\t\t\t),\n\t\t\t\t'text' => array(\n\t\t\t\t\t'name' => __( 'Text', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Text', self::$plugin_name ),\n\t\t\t\t\t'type' => 'text'\n\t\t\t\t),\n\t\t\t\t'text_with_std' => array(\n\t\t\t\t\t'name' => __( 'Text with std', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Text with std', self::$plugin_name ),\n\t\t\t\t\t'std' => __( 'std will be saved!', self::$plugin_name ),\n\t\t\t\t\t'type' => 'text'\n\t\t\t\t),\n\t\t\t\t'email' => array(\n\t\t\t\t\t'name' => __( 'Email', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Email', self::$plugin_name ),\n\t\t\t\t\t'type' => 'email'\n\t\t\t\t),\n\t\t\t\t'url' => array(\n\t\t\t\t\t'name' => __( 'URL', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'By default, only http & https are allowed', self::$plugin_name ),\n\t\t\t\t\t'type' => 'url'\n\t\t\t\t),\n\t\t\t\t'password' => array(\n\t\t\t\t\t'name' => __( 'Password', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Password', self::$plugin_name ),\n\t\t\t\t\t'type' => 'password'\n\t\t\t\t),\n\t\t\t\t'number' => array(\n\t\t\t\t\t'name' => __( 'Number', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Number', self::$plugin_name ),\n\t\t\t\t\t'type' => 'number'\n\t\t\t\t),\n\t\t\t\t'number_with_attributes' => array(\n\t\t\t\t\t'name' => __( 'Number', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Max: 1000, Min: 20, Step: 30', self::$plugin_name ),\n\t\t\t\t\t'max' => 1000,\n\t\t\t\t\t'min' => 20,\n\t\t\t\t\t'step' => 30,\n\t\t\t\t\t'type' => 'number'\n\t\t\t\t),\n\t\t\t\t'textarea' => array(\n\t\t\t\t\t'name' => __( 'Textarea', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Textarea', self::$plugin_name ),\n\t\t\t\t\t'type' => 'textarea'\n\t\t\t\t),\n\t\t\t\t'textarea_with_std' => array(\n\t\t\t\t\t'name' => __( 'Textarea with std', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Textarea with std', self::$plugin_name ),\n\t\t\t\t\t'std' => __( 'std will be saved!', self::$plugin_name ),\n\t\t\t\t\t'type' => 'textarea'\n\t\t\t\t),\n\t\t\t\t'select' => array(\n\t\t\t\t\t'name' => __( 'Select', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Select with 3 options', self::$plugin_name ),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'wp-human' => __( \"I read the <a href='https://wphuman.com/blog/'>WP Human Blog</a>\", self::$plugin_name ),\n\t\t\t\t\t\t'tang-rufus' => __( \"<a href='http://tangrufus.com/'>Tang Rufus' Blog</a> looks great\", self::$plugin_name ),\n\t\t\t\t\t\t'Filter' => __( 'You can apply filters on this option!', self::$plugin_name )\n\t\t\t\t\t),\n\t\t\t\t\t'type' => 'select'\n\t\t\t\t),\n\t\t\t\t'rich_editor' => array(\n\t\t\t\t\t'name' => __( 'Rich Editor', self::$plugin_name ),\n\t\t\t\t\t'desc' => __( 'Rich Editor save as HTML markups', self::$plugin_name ),\n\t\t\t\t\t'type' => 'rich_editor'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'second_tab' => array(\n\t\t\t\t'extend_me' => array(\n\t\t\t\t\t'name' => 'Extend me',\n\t\t\t\t\t'desc' => __( 'You can extend me via hooks and filters.', self::$plugin_name ),\n\t\t\t\t\t'type' => 'text'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\treturn self::apply_tab_slug_filters( $settings );\n\t}", "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 }", "protected function get()\n {\n return get_option($this->hash);\n }", "function section_optionator( $settings ){\n\t\t$settings = wp_parse_args($settings, $this->optionator_default);\n\t\t$opt_array = array(\n\t\t\t'tm_candy_open' => array(\n\t\t\t\t'title'\t\t\t=> 'Show at the start',\n\t\t\t\t'type' \t=> 'check',\n\t\t\t\t'inputlabel' \t=> __( 'Show at the start', $this->domain ),\n\t\t\t\t'shortexp' \t\t=> 'Default: Hidden',\n\t\t\t\t'exp' \t\t=> 'Check if you want to show the notification when the page is loaded, by default the notification area is hidden and it show the ribbon to open it.'\n\t\t\t),\n\t\t\t'tm_candys_set' \t=> array(\n\t\t\t\t'type' \t\t\t=> 'select_taxonomy',\n\t\t\t\t'taxonomy_id'\t=> $this->tax_id,\n\t\t\t\t'title' \t\t=> __('Select notiofication set to show', $this->domain),\n\t\t\t\t'shortexp'\t\t=> __('The set to show', $this->domain),\n\t\t\t\t'inputlabel'\t=> __('Select a set', $this->domain),\n\t\t\t\t'exp' \t\t\t=> __('if don\\'t select a set it will show all notification entries', $this->domain)\n\t\t\t),\n\t\t\t'tm_candys_items' => array(\n\t\t\t\t'type' \t\t\t=> 'count_select',\n\t\t\t\t'inputlabel'\t=> __('Number of notifications to show', $this->domain),\n\t\t\t\t'title' \t\t=> __('Number of notifications', $this->domain),\n\t\t\t\t'shortexp'\t\t=> __('Default value is 1', $this->domain),\n\t\t\t\t'count_start'\t=> 1, \n \t\t\t\t'count_number'\t=> 5,\n\t\t\t),\n\t\t\t'tm_candys_pause_on_hover' => array(\n\t\t\t\t'type'\t\t\t=> 'check',\n\t\t\t\t'title'\t\t\t=> __('Pause on hover', $this->domain),\n\t\t\t\t'inputlabel'\t=> __('Pause on hover', $this->domain),\n\t\t\t\t'shortexp'\t\t=> __('', $this->domain),\n\t\t\t\t'exp'\t\t\t=> __('Determines whether the timeout between transitions should be paused \"onMouseOver\"', $this->domain)\n\t\t\t),\n\t\t\t'tm_candys_duration_pause' \t=> array(\n\t\t\t\t'type'\t\t\t=> 'text',\n\t\t\t\t'inputlabel'\t=> __('Pause Duration', $this->domain),\n\t\t\t\t'title' \t\t=> __('Pause Duration', $this->domain),\n\t\t\t\t'shortexp'\t\t=> '',\n\t\t\t\t'exp'\t\t\t=> __('The amount of milliseconds the carousel will pause. 1000 = 1 second', $this->domain),\n\t\t\t),\n\n\t\t\t\t\n\t\t);\n\n\t\t$settings = array(\n\t\t\t'id' \t\t=> $this->id.'_meta',\n\t\t\t'name' \t\t=> $this->name,\n\t\t\t'icon' \t\t=> $this->icon, \n\t\t\t'clone_id'\t=> $settings['clone_id'], \n\t\t\t'active'\t=> $settings['active']\n\t\t);\n\n\t\tregister_metatab($settings, $opt_array);\n\t\t\n\t}", "public function getOptions() : array;" ]
[ "0.6824561", "0.671921", "0.6705289", "0.67030084", "0.66402143", "0.6639999", "0.6455486", "0.6395388", "0.63846093", "0.63763034", "0.62828046", "0.62750417", "0.623459", "0.6221672", "0.61626196", "0.61619353", "0.6152463", "0.61518425", "0.61435235", "0.61194867", "0.6114976", "0.6109243", "0.61084056", "0.60828537", "0.60793424", "0.60753995", "0.60753995", "0.60753995", "0.60753995", "0.60753995", "0.60753995", "0.60753995", "0.60721755", "0.6063073", "0.6035946", "0.6030223", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60286856", "0.60281086", "0.6006877", "0.6002907", "0.6002428", "0.5996894", "0.59931254", "0.59865403", "0.59827006", "0.5975807", "0.5965986", "0.5965986", "0.596598", "0.5962266", "0.5952332", "0.5942179", "0.5937633", "0.59243923", "0.5920928", "0.59136075", "0.5911844", "0.59069145", "0.5906076", "0.5899176", "0.58831733", "0.5879437", "0.58776903", "0.58776903", "0.58756375", "0.5871966", "0.5845849", "0.58318025", "0.5827284", "0.58266526", "0.5822805", "0.58177775", "0.5802163", "0.57976335", "0.57967883", "0.57967883", "0.57960933", "0.5793842", "0.5783255", "0.5782464", "0.57789594", "0.5777345", "0.57765716", "0.57702476", "0.576829", "0.5766706" ]
0.0
-1