query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
METHODS FOR LAYOUT Returns a light service container instance. If no container is set, a dummy container is created on the fly and returned on subsequent calls.
public function getContainer(): LightServiceContainerInterface { if (null === $this->container) { $this->container = new LightDummyServiceContainer(); } return $this->container; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContainer()\n {\n return $this->container = SMRESTBundle::getContainer();\n\n }", "public function get_container(): ServiceContainer {\n\t\treturn $this->service_container;\n\t}", "function container(): Container\n\t{\n\t\tstatic $container;\n\n\t\tif($container === null)\n\t\t{\n\t\t\t$container = Application::instance()->getContainer();\n\t\t}\n\n\t\treturn $container;\n\t}", "public function getContainer()\n\t{\n\t\tif (!$this->container) {\n\t\t\t$this->createContainer();\n\t\t}\n\t\treturn $this->container;\n\t}", "public static function getContainer() : ContainerInterface\n {\n if (!self::$container) {\n self::$container = new SimpleContainer(); \n }\n \n return self::$container;\n }", "public static function getContainer()\n {\n return static::$container ?? (static::$container = new Container(false));\n }", "public function getContainer() {}", "protected function getContainer()\n {\n return $this->serviceContainer;\n }", "public function getContainer();", "public function getContainer();", "public function getContainer();", "public function getContainer();", "public function getContainer();", "public static function container()\n {\n $containerOutput = '[ServiceContainer]' . PHP_EOL;\n ServiceContainer::init();\n $services = ServiceContainer::getServiceCollection();\n $serviceDebug = [];\n foreach ($services as $name => $service) {\n $serviceDebug[] = [\n 'name' => $name,\n 'class' => get_class($service),\n ];\n }\n $containerOutput .= CLITableBuilder::init(\n $serviceDebug,\n ['Name', 'Class'],\n false,\n 10\n );\n CLIShellColor::commandOutput($containerOutput.PHP_EOL, 'white', 'green');\n }", "public static function container() {\n\t\tif (is_null(static::$container)) {\n\t\t\tstatic::$container = new Container();\n\t\t}\n\n\t\treturn static::$container;\n\t}", "public function get_container() { return $this->container; }", "public static function getContainer()\n {\n return static::$sharedContainer ?: static::$sharedContainer = static::createContainer();\n }", "public function getContainer() {\n\t\t$stashClass = $this->stashClass;\n\t\t$containerClass = $this->containerClass;\n\n\t\t$stash = $this->createObject($stashClass);\n\t\t$container = $this->createObject($containerClass, $stash);\n\n\t\t$stash->setContainer($container);\n\t\t$stash->setStash($this->stash);\n\n\t\t$this->reset();\n\n\t\treturn $container;\n\t}", "public static function getContainer()\n {\n return self::$kernel->getContainer();\n }", "public function getContainer(): Container {\n return $this->container;\n }", "public function getContainer(): Container\n {\n $container = new Container();\n $this->register($container);\n return $container;\n }", "function get_container()\n{\n static $container = null;\n if (!$container) {\n $builder = new \\DI\\ContainerBuilder();\n $builder->addDefinitions(get_config()['di']);\n \n $container = $builder->build();\n }\n \n return $container;\n}", "protected function getContainer()\n {\n if (!empty($this->kernelDir)) {\n $tmpKernelDir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : null;\n $_SERVER['KERNEL_DIR'] = getcwd().$this->kernelDir;\n }\n\n $cacheKey = $this->kernelDir.'|'.$this->environment;\n if (empty($this->containers[$cacheKey])) {\n $options = array(\n 'environment' => $this->environment,\n );\n $kernel = $this->createKernel($options);\n $kernel->boot();\n\n $this->containers[$cacheKey] = $kernel->getContainer();\n }\n\n if (isset($tmpKernelDir)) {\n $_SERVER['KERNEL_DIR'] = $tmpKernelDir;\n }\n\n return $this->containers[$cacheKey];\n }", "public function getContainer(): Container\n {\n return $this->container;\n }", "public function getContainer(): ContainerInterface\n {\n return parent::getContainer();\n }", "public function getContainer()\n {\n if ($this->container) {\n return $this->container;\n }\n\n $this->container = $this->getKernel($this->getKernelConfiguration())->getContainer();\n\n return $this->container;\n }", "public function getContainer(string $name = null): Container\n {\n return $this->model(Container::class, ['name' => $name]);\n }", "protected function getContainer()\n {\n return $this->kernel->getContainer();\n }", "protected function getServiceContainer()\n {\n $serviceContainer = ServiceContainer::getInstance();\n\n $serviceContainer->set('engine', $this->getEngine());\n\n return $serviceContainer;\n }", "abstract protected function getContainer(): ContainerInterface;", "public function container( MyMetaContainer $container = null ) {\n\t\tif( $container !== null ) {\n\t\t\t$this->container = $container;\n\t\t}\n\n\t\treturn $this->container;\n\t}", "public static function getInstance()\n {\n if (is_null(self::$container)) {\n self::$container = new Container();\n }\n\n return self::$container;\n }", "public static function getContainer($name = \"default\") {\n if (empty($name)) {\n $name = \"default\";\n }\n if (!isset(self::$containers[$name])) {\n self::$containers[$name] = new static();\n }\n return self::$containers[$name];\n }", "private function createContainer(): Container\n {\n if (!$this->container) {\n $containerBuilder = new ContainerBuilder();\n $containerBuilder->useAnnotations(true);\n\n $containerBuilder->addDefinitions(__DIR__ . '/ContainerConfig.php');\n $containerBuilder->addDefinitions(__DIR__ . '/../App/AppContainerConfig.php');\n\n $this->container = $containerBuilder->build();\n }\n\n return $this->container;\n }", "public function getFlexiContainer()\n {\n return isset($this->flexiContainer) ? $this->flexiContainer : null;\n }", "public function container() : ?Container;", "public function getContainer()\r\n {\r\n return $this->container;\r\n }", "public static function container(){\n\n $container = 'container';\n\n return $container;\n\n }", "public static function getDefaultContainer() {\n if (self::$default === null) {\n self::$default = new self();\n }\n return self::$default;\n }", "public function getContainer()\n {\n if ($this->_container === null) {\n $this->_container = new CContainer();\n }\n return $this->_container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getContainer()\n {\n return $this->container;\n }", "public function getDefaultContainer()\n {\n return $this->defaultContainer;\n }", "protected function getContainer()\n {\n if (!isset($this->container)) {\n self::bootKernel();\n $this->container = new TestingContainer(self::$kernel->getContainer());\n }\n return $this->container;\n }", "public function getContainer()\n {\n return $this->getModule()->getContainer();\n }", "public function getContainer(): ContainerInterface\n {\n return $this->container;\n }", "public function container();", "public function getDiContainer(): Container\n {\n return self::diContainer();\n }", "public function getContainer()\n {\n return $this->Container;\n }", "public function getContainer(): ContainerInterface {\n return $this->container;\n }", "protected function getContainer():ContainerInterface {\n return $this->container;\n }", "public static function container($container = 'default')\n {\n if ( ! isset(static::$containers[$container]))\n {\n static::$containers[$container] = new Asset_Container($container);\n }\n\n return static::$containers[$container];\n }", "public static function getContainer()\n {\n return static::$container;\n }", "protected function getServiceContainerService()\n {\n throw new RuntimeException('You have requested a synthetic service (\"service_container\"). The DIC does not know how to construct this service.');\n }", "protected function _getContainer()\n {\n if ($this->_oContainer === null) {\n $this->_oContainer = oxNew('bestitAmazonPay4OxidContainer');\n }\n\n return $this->_oContainer;\n }", "public function container(string $name);", "public function setContainer($var)\n {\n GPBUtil::checkString($var, True);\n $this->container = $var;\n\n return $this;\n }", "public function getContainer($name=NULL)\r\n\t{\r\n\t\tif ($this->_container != NULL)\r\n\t\t\treturn $this->_container;\r\n\r\n\t\tif ($name == NULL)\r\n\t\t\treturn $this->_container = false;\r\n\r\n $this->_container = $this->getService()->getContainer($name);\r\n\r\n // Enforce the quote if one is defined in our override control\r\n if (($container_max_size = Cii::get($this->_overrideControl, 'max_container_size', 0)) != 0)\r\n \t$this->_container->setBytesQuota($container_max_size);\r\n\r\n return $this->_container;\r\n\t}", "protected function getContainer()\r\n {\r\n if (!$this->container) {\r\n throw new RuntimeException('A container instance has not been passed to the Pipeline.');\r\n }\r\n\r\n return $this->container;\r\n }", "public static function service() {\n return self::$app->serviceContainer;\n }", "protected function _Get_Container_Instance($_el) {\r\n\t\t$form_instance = $this->form_instance;\r\n // Retrieve the container name\r\n\t\t$type = $_el['type'];\r\n // Retrieve the global vcff forms class\r\n $vcff_containers = vcff_get_library('vcff_containers');\r\n // If the context does not exist\r\n if (!isset($vcff_containers->contexts[$type])) { return; }\r\n // Retrieve the context\r\n $_context = $vcff_containers->contexts[$type]; \r\n // Retrieve the container name\r\n\t\t$machine_code = $_el['name'];\r\n // If no form instance was found\r\n\t\tif (!$machine_code) { return; }\r\n\t\t// Create the field item classname\r\n\t\t$container_classname = $_context['class'];\r\n\t\t// If no form instance was found\r\n\t\tif (!$container_classname) { return; } \r\n\t\t// Create a new item instance for this field\r\n\t\t$container_instance = new $container_classname();\r\n\t\t// Populate the container form\r\n\t\t$container_instance->form_instance = $this->form_instance;\r\n\t\t$container_instance->machine_code = $machine_code;\r\n\t\t$container_instance->container_type = $_context['type'];\r\n\t\t$container_instance->context = $_context;\r\n\t\t$container_instance->attributes = $_el['attributes'];\r\n // Populate the handler object\r\n\t\t$container_instance->el = $_el['el'];\r\n\t\t$container_instance->el_children = $_el['children'];\r\n // Add any child fields\r\n $this->_Add_Child_Fields($container_instance);\r\n $this->_Add_Child_Supports($container_instance);\r\n // If the field has a sanitize method\r\n if (method_exists($container_instance,'On_Create')) { $container_instance->On_Create(); }\r\n // Do any create actions\r\n $container_instance->Do_Action('create');\r\n // Do a wordpress hook\r\n do_action('vcff_container_create',$container_instance);\r\n\t\t// Return the generated field instance\r\n\t\treturn $container_instance;\r\n\t}", "private function setContainer()\n {\n \t$builder = new ContainerBuilder();\n \t$locator = new FileLocator(RES_DIR);\n \t$loader = new YamlFileLoader($builder, $locator);\n \t$loader->load(\"services.yml\");\n $this->container = $builder;\n\n return $this;\n }", "public function create(IDIContainer $container);", "public static function container()\n {\n if (is_null(self::$instance)) {\n self::$instance = new DI();\n }\n\n return self::$instance;\n }", "public function setContainer($var)\n {\n GPBUtil::checkString($var, True);\n $this->Container = $var;\n\n return $this;\n }", "function di($id = null)\n {\n $container = ApplicationContext::getContainer();\n if ($id) {\n return $container->get($id);\n }\n return $container;\n }", "public function getContainer() : ?ContainerInterface\n {\n return $this->referenceResolver->getContainer();\n }", "public function getContainer()\n {\n if ($this->_container != null) {\n return $this->_container;\n }\n\n if ($this->space_id != null) {\n $container = $this->space;\n } elseif ($this->user_id != null) {\n $container = $this->user;\n } else {\n throw new Exception(\"Could not determine container type!\");\n }\n\n $this->_container = $container;\n\n return $this->_container;\n }", "public function getContainer(): IDIContainer\n {\n return $this;\n }", "public static function getDefaultContainer() {\n\t\t_deprecated_function( __FUNCTION__, '4.0', 'Windows_Azure_Helper::get_default_container()' );\n\n\t\treturn Windows_Azure_Helper::get_default_container();\n\t}", "protected function getContainer(): ContainerInterface\n {\n if (! $this->container) {\n throw new LogicException('Container is not set up.');\n }\n\n return $this->container;\n }", "public function instance(): Container\n {\n return ($this->resolver)();\n }", "public function get(ContainerInterface $container);", "public function getRoot(): IDIContainer\n {\n return $this->parent === null\n ? $this\n : $this->parent->getRoot();\n }", "private function getContainerBuilder(): ContainerBuilder\n {\n if (null !== self::$containerBuilder) {\n return self::$containerBuilder;\n }\n\n $kernel = $this->getApplication()->getKernel();\n\n $buildContainer = \\Closure::bind(function () {\n return $this->buildContainer();\n }, $kernel, \\get_class($kernel));\n $container = $buildContainer();\n $container->getCompilerPassConfig()->setRemovingPasses([]);\n $container->compile();\n self::$containerBuilder = $container;\n\n return self::$containerBuilder;\n }", "public function get_container()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$container_filename = $this->get_container_filename();\n\t\t\t$config_cache = new ConfigCache($container_filename, defined('DEBUG'));\n\t\t\tif ($this->use_cache && $config_cache->isFresh())\n\t\t\t{\n\t\t\t\tif ($this->use_extensions)\n\t\t\t\t{\n\t\t\t\t\trequire($this->get_autoload_filename());\n\t\t\t\t}\n\n\t\t\t\trequire($config_cache->getPath());\n\t\t\t\t$this->container = new \\phpbb_cache_container();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->container_extensions = array(new extension\\core($this->get_config_path()));\n\n\t\t\t\tif ($this->use_extensions)\n\t\t\t\t{\n\t\t\t\t\t$this->load_extensions();\n\t\t\t\t}\n\n\t\t\t\t// Inject the config\n\t\t\t\tif ($this->config_php_file)\n\t\t\t\t{\n\t\t\t\t\t$this->container_extensions[] = new extension\\config($this->config_php_file);\n\t\t\t\t}\n\n\t\t\t\t$this->container = $this->create_container($this->container_extensions);\n\n\t\t\t\t// Easy collections through tags\n\t\t\t\t$this->container->addCompilerPass(new pass\\collection_pass());\n\n\t\t\t\t// Event listeners \"phpBB style\"\n\t\t\t\t$this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener'));\n\n\t\t\t\t// Event listeners \"Symfony style\"\n\t\t\t\t$this->container->addCompilerPass(new RegisterListenersPass('dispatcher'));\n\n\t\t\t\tif ($this->use_extensions)\n\t\t\t\t{\n\t\t\t\t\t$this->register_ext_compiler_pass();\n\t\t\t\t}\n\n\t\t\t\t$filesystem = new filesystem();\n\t\t\t\t$loader = new YamlFileLoader($this->container, new FileLocator($filesystem->realpath($this->get_config_path())));\n\t\t\t\t$loader->load($this->container->getParameter('core.environment') . '/config.yml');\n\n\t\t\t\t$this->inject_custom_parameters();\n\n\t\t\t\tif ($this->compile_container)\n\t\t\t\t{\n\t\t\t\t\t$this->container->compile();\n\n\t\t\t\t\tif ($this->use_cache)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->dump_container($config_cache);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->compile_container && $this->config_php_file)\n\t\t\t{\n\t\t\t\t$this->container->set('config.php', $this->config_php_file);\n\t\t\t}\n\n\t\t\t$this->inject_dbal_driver();\n\n\t\t\treturn $this->container;\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t// Don't try to recover if we are in the development environment\n\t\t\tif ($this->get_environment() === 'development')\n\t\t\t{\n\t\t\t\tthrow $e;\n\t\t\t}\n\n\t\t\tif ($this->build_exception === null)\n\t\t\t{\n\t\t\t\t$this->build_exception = $e;\n\n\t\t\t\treturn $this\n\t\t\t\t\t->without_extensions()\n\t\t\t\t\t->without_cache()\n\t\t\t\t\t->with_custom_parameters(array_merge($this->custom_parameters, [\n\t\t\t\t\t\t'container_exception' => $e,\n\t\t\t\t\t]))\n\t\t\t\t\t->get_container();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Rethrow the original exception if it's still failing\n\t\t\t\tthrow $this->build_exception;\n\t\t\t}\n\t\t}\n\t}", "public function getContainer()\n {\n //Return container\n return $this->contentListContainer;\n }", "protected function registerContainer()\n {\n app()->singleton(\n 'Container',\n Container::class\n );\n }", "function app() {\n return Container::getInstance();\n}", "function app(string $concrete = null): object {\n static $container = null;\n\n if ($container === null) {\n $container = new Container();\n }\n\n return $concrete === null ? $container : $container->get($concrete);\n}", "protected function createContainer()\n {\n $container = new ContainerBuilder();\n // Load the services that are provided by the bundle.\n $extension = new WebfactoryIcuTranslationExtension();\n $extension->load([], $container);\n\n return $container;\n }", "public function addContainer($data) {\n try {\n $client = new Zend_Soap_Client($this->CONTAINER_WSDL_URI);\n $options = array('soap_version' => SOAP_1_1,\n 'encoding' => 'ISO-8859-1',\n );\n $client->setOptions($options);\n $client->action = 'createContainer';\n $result = $client->createContainer(\n $this->toXml(\n array(\n 'backgroundColor' => $data['backgroundColor'],\n 'borderBottom' => $data['borderBottom'],\n 'borderBottomColor' => $data['borderBottomColor'],\n 'borderBottomStyle' => $data['borderBottomStyle'],\n 'borderBottomUnit ' => $data['borderBottomUnit'],\n 'borderLeft' => $data['borderLeft'],\n 'borderLeftColor' => $data['borderLeftColor'],\n 'borderLeftStyle' => $data['borderLeftStyle'],\n 'borderLeftUnit' => $data['borderLeftUnit'],\n 'borderRight' => $data['borderRight'],\n 'borderRightColor' => $data['borderRightColor'],\n 'borderRightStyle' => $data['borderRightStyle'],\n 'borderRightUnit' => $data['borderRightUnit'],\n 'borderTop' => $data['borderTop'],\n 'borderTopColor' => $data['borderTopColor'],\n 'borderTopStyle' => $data['borderTopStyle'],\n 'borderTopUnit' => $data['borderTopUnit'],\n 'bottomMargin' => $data['bottomMargin'],\n 'bottomMarginUnit' => $data['bottomMarginUnit'],\n 'bottomPadding' => $data['bottomPadding'],\n 'bottomPaddingUnit' => $data['bottomPaddingUnit'],\n 'containerHeight' => $data['containerHeight'],\n 'containerId' => $data['containerId'],\n 'containerName' => $data['containerName'],\n 'containerWidth' => $data['containerWidth'],\n 'containerXaxis' => $data['containerXaxis'],\n 'containerYaxis' => $data['containerYaxis'],\n 'css' => $data['css'],\n 'font' => $data['font'],\n 'fontAlignment' => $data['fontAlignment'],\n 'fontColor' => $data['fontColor'],\n 'fontSize' => $data['fontSize'],\n 'isActive' => true,\n 'isBold' => $data['isBold'],\n 'isBorderColorSameForAll' => $data['isBorderColorSameForAll'],\n 'isBorderStyleSameForAll' => $data['isBorderStyleSameForAll'],\n 'isBorderWidthSameForAll' => $data['isBorderWidthSameForAll'],\n 'isItalic' => $data['isItalic'],\n 'isMargineSameForAll' => $data['isMargineSameForAll'],\n 'isPaddingSameForAll' => $data['isPaddingSameForAll'],\n 'leftMargin' => $data['leftMargin'],\n 'leftMarginUnit' => $data['leftMarginUnit'],\n 'leftPadding' => $data['leftPadding'],\n 'leftPaddingUnit' => $data['leftPaddingUnit'],\n 'letterSpacing' => $data['letterSpacing'],\n 'lineHeight' => $data['lineHeight'],\n 'primaryKey' => 0,\n 'rightMargin' => $data['rightMargin'],\n 'rightMarginUnit' => $data['rightMarginUnit'],\n 'rightPadding' => $data['rightPadding'],\n 'rightPaddingUnit' => $data['rightPaddingUnit'],\n 'textDecoration' => $data['textDecoration'],\n 'topMargin' => $data['topMargin'],\n 'topMarginUnit' => $data['topMarginUnit'],\n 'topPadding' => $data['topPadding'],\n 'topPaddingUnit' => $data['topPaddingUnit'],\n 'updatedby' => $_SESSION['Username'],\n 'updatedt' => date('Y-m-d') . 'T' . date('H:i:s') . 'Z',\n 'wordSpacing' => $data['wordSpacing'],\n )\n ,$rootNodeName = 'AddContainer')\n );\n return $result;\n } catch (Exception $e) {\n // print_r($e);\n }\n }", "public function processContainer()\n {\n $class = \"container\";\n if ($this->hasFluid()) $class .= \"-fluid\";\n $this->add($this->createWrapper('div', ['class' => $class], $this->stringifyHeader() . $this->stringifyCollapse()));\n }", "function di(?string $id = null)\n {\n $container = ApplicationContext::getContainer();\n if ($id) {\n return $container->get($id);\n }\n\n return $container;\n }", "public function isolate(): IDIContainer\n {\n return new DIContainer($this);\n }", "protected function getVictoireWidget_WidgetManagerService()\n {\n return $this->services['victoire_widget.widget_manager'] = new \\Victoire\\Bundle\\WidgetBundle\\Model\\WidgetManager($this->get('victoire_widget.widget_helper'), $this->get('victoire_widget.widget_form_builder'), $this->get('victoire_widget.widget_content_resolver'), $this->get('victoire_widget.widget_renderer'), $this->get('event_dispatcher'), $this->get('doctrine.orm.default_entity_manager'), $this->get('victoire_form.error_helper'), $this->get('request_stack'), $this->get('victoire_widget_map.manager'), $this->get('victoire_widget_map.builder'), $this->get('victoire_business_entity.cache_reader'), $this->get('templating'), $this->get('victoire_page.page_helper'), array('default_menu_bar' => array('max' => 1, 'widgets' => array('menu' => NULL)), 'default_mini_sidebar' => array('widgets' => array('filter' => NULL, 'text' => NULL)), 'default_full' => array('max' => 10, 'widgets' => array('text' => NULL, 'label' => NULL, 'image' => NULL, 'list' => NULL, 'archive' => NULL, 'file' => NULL)), 'default_social_sidebar' => array('widgets' => array('text' => NULL, 'redactor' => NULL, 'label' => NULL, 'image' => NULL, 'list' => NULL, 'archive' => NULL))), $this->get('victoire_business_page.transformer.virtual_to_business_page_transformer'));\n }", "public function getService($key = null)\n {\n if (null === $key) {\n return $this->kernel->container;\n } else {\n return $this->kernel->container[$key];\n }\n }", "protected function initializeContainer()\n {\n $class = $this->getContainerClass();\n $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);\n $container = $this->buildContainer();\n $container->compile();\n $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());\n\n require_once $cache->getPath();\n\n $this->container = new $class();\n $this->container->set('kernel', $this);\n\n if ($this->container->has('cache_warmer')) {\n $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));\n }\n }" ]
[ "0.65188587", "0.6499059", "0.6476403", "0.64306533", "0.6385601", "0.6375408", "0.62777156", "0.6276674", "0.6275658", "0.6275658", "0.6275658", "0.6275658", "0.6275658", "0.62527686", "0.6248985", "0.62382776", "0.61901045", "0.61899245", "0.6170215", "0.616803", "0.6154221", "0.6115558", "0.61074126", "0.6100277", "0.610008", "0.6087838", "0.60821986", "0.60352784", "0.60305864", "0.60235643", "0.602285", "0.60028094", "0.5998712", "0.5979148", "0.59473556", "0.594248", "0.5936734", "0.59358877", "0.5911788", "0.59012014", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.58968186", "0.589043", "0.587719", "0.5851014", "0.5836829", "0.58345836", "0.58245426", "0.5816736", "0.57962775", "0.5791495", "0.57899266", "0.5757451", "0.57339543", "0.57320774", "0.57050693", "0.56919605", "0.5642834", "0.5621404", "0.56188005", "0.5607018", "0.55873233", "0.5572024", "0.55180603", "0.551755", "0.55103695", "0.54948634", "0.5471115", "0.5409542", "0.5387081", "0.53100836", "0.5309394", "0.5306658", "0.5297882", "0.52834743", "0.5275922", "0.5270846", "0.5259368", "0.5246228", "0.5229895", "0.5226747", "0.52176136", "0.5195911", "0.5176579", "0.51765674", "0.51627153", "0.5143669", "0.513239" ]
0.7529291
0
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/
public function index() { $uuid = $this->get_uuid(); $peers = $this->get_peers(); $next_msg = 0; if (isset($peers[site_url('lab5/receive_message')])) { $next_msg = $peers[site_url('lab5/receive_message')]["WeHave"] + 1; } $this->load->view("header"); $this->load->view("view_messages", array("messages" => $this->get_ordered_messages(), "peers" => $peers, "uuid" => $uuid, "next_msg" => $next_msg)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }", "public function index()\n\t{\n\t\t//Default view\n\t\t$this->load->view('index.html');\n\t}", "function index() {\n\n // This page cannot be accessed without providing a page\n // the routes.php file will not allow the page to be accessed\n // $route['pages/(:any)'] = 'pages/view/$';\n redirect('/', 'refresh');\n\n }", "public function Index()\n\t{\n\t\t$this->views->SetTitle('Index Controller');\n\t\t$this->views->AddView('index/index.tpl.php', array(),'primary');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('default/index');\n\t}", "public function index() {\n\t\t$this->display('index');\n\t}", "public function index()\n\t{\t\n\n\t\t$this->load->view('welcome_message');\n\t}", "public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n }", "public function show_index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function Index()\n {\n $this->standardView('Index');\n }", "public function index()\n {\n return view('main.welcome');\n }", "public function index()\n {\n // return view('welcome');\n }", "public function index()\n {\n $this->load->view('index');\n }", "public function index()\n {\n // return view('welcome');\n \n }", "public function index()\n\t{\n\t\t$this->load->view('home');\n\t}", "public function index()\n\t{\n\t\techo \"Nothing !\";\n\t}", "public function index() {\n \n return view('welcome');\n }", "public function index()\n {\n return view('pages.welcome');\n }", "public function Index()\n {\n \treturn view(\"index\");\n\t}", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n\t\t/*$this->layout->setTitle('Welcome to our Blog');\n\t\t$this->layout->showView('welcome/about.php');*/\n\t\techo 'hello I\\'m using codeigniter';\n }", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\treturn view('pages/home');\n\t}", "public function index()\n {\n return \"INDEX PAGE\";\n }", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "public function index()\n {\n SEOMeta::setTitle('Trusted Mortgage & Remortgage Solutions In UK - SmartMortgages UK');\n SEOMeta::setDescription('Home Page Description: For competitive mortgage and remortgage quotes around the UK at affordable rates, speak to one of our expert credit consultants and get a mortgage. For more visit us today.');\n\n return view('welcome');\n }", "function index() {\n \n parent::index();\n\n\t\t$data['user_id'] = $this->tank_auth->get_user_id();\n\t\t$data['username'] = $this->tank_auth->get_username();\n\t\t$data['main_content_view'] = $this->load->view('welcome', $data, true);\n $this->render_template($data);\n\t}", "public function index()\n\t{\n\t\t$this->title = 'My Index Action';\n\n\t\treturn new View('basic/index');\n\t}", "public function index()\n\t{\n\t\t$data['title'] = 'Home | Welcome to AEY';\n\t\t$data ['view_page'] = 'homepage';\n\n\t\t$this->load->view('site', $data);\n\t}", "public function index()\n {\n\n return view('welcome');\n\n }", "public function actionIndex(){ \n $this->view(\"index.php\");\n }", "public function index() {\n $this->registry->template->module = 'welcome';\n \n /*** load the index template ***/\n $this->registry->template->show('index');\n }", "public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}", "public function index()\n {\n return view('front.welcome');\n }", "public function index()\n\t{\n\t\treturn $this->traces();\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\t$this->loadViews(\"index\");\n\t}", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function index()\r\n\t{\r\n\t\techo \"index\";\r\n\t}", "public function index()\n\t{\n\t\t$this->twig->display('welcome/index.html', []);\n\t}", "public function Index() {\n $this->Display();\n }", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function index()\n {\n $title = 'Welcome Page';\n return view($this->view . '.home', compact('title'));\n }", "public function index()\n\t{\n\t\t//\n\t\techo'index';\n\t}", "public function index() {\n $this->getView('navigation', array('pagename' => 'Welcome'));\n $this->getView('welcome');\n $this->getView('footer');\n }", "public function index()\n {\n return view(\"home\");\n }", "public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}", "function index() {\n $this->renderView(\"index\");\n }", "public function index()\n\t{\n\t\treturn view('index');\n\t}", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n\n\n\n return view('welcome');\n }", "public function index() {\n\t\t$page = Page::getInstance();\n\t\t$session = Session::getInstance();\n\t\t$page->setPageTitle('Method index notfound');\n\t\t$session->setFlash('Chaque controller doit avoir une méthode index', 'error');\n\t}", "public function index()\r\n\t{\r\n\t\t//\r\n\t}", "public function index() {\n\t\t// render the view (/view/main/index.php)\n\t\t$this->view->render(\"main\", \"index\");\n\t}", "public function index()\n {\n return View(\"pages.home\");\n }", "public function index()\n {\n // Nothing to do\n }", "public function index(){\n return view('welcome');\n }", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}" ]
[ "0.7655508", "0.74145436", "0.7396173", "0.7317418", "0.72283363", "0.72283363", "0.71903646", "0.7166857", "0.7151917", "0.7145717", "0.7108151", "0.70780236", "0.70754886", "0.70406276", "0.70306057", "0.70306057", "0.70306057", "0.70306057", "0.70306057", "0.69742966", "0.6968103", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69316655", "0.6926416", "0.6911975", "0.6901835", "0.6894632", "0.6876047", "0.6858327", "0.68569815", "0.68399274", "0.6803998", "0.6802956", "0.6802956", "0.6796031", "0.6790225", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6766831", "0.6764303", "0.6761992", "0.6761992", "0.67514986", "0.675126", "0.67485875", "0.67429", "0.67388356", "0.6729889", "0.6717446", "0.67143476", "0.6711851", "0.6704955", "0.6700333", "0.6693287", "0.66756153", "0.666292", "0.6661336", "0.6650874", "0.66305923", "0.6622069", "0.661396", "0.66047865", "0.6598352", "0.6595009", "0.65937525", "0.65860605", "0.65768355", "0.6576564", "0.657412", "0.65545326", "0.6547276", "0.6545392", "0.6544484", "0.65438914", "0.654184", "0.6517758", "0.65157586", "0.65157586", "0.65157586", "0.65157586" ]
0.0
-1
Display a listing of Invoice.
public function index() { if (! Gate::allows('invoice_access')) { return abort(401); } if (request('show_deleted') == 1) { if (! Gate::allows('invoice_delete')) { return abort(401); } $invoices = Invoice::onlyTrashed()->get(); } else { $invoices = Invoice::all(); } return view('admin.invoices.index', compact('invoices')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invoice_list()\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $branchID = $this->application_model->get_branch_id();\n if ($this->input->post('search')) {\n $this->data['class_id'] = $this->input->post('class_id');\n $this->data['section_id'] = $this->input->post('section_id');\n $this->data['invoicelist'] = $this->fees_model->getInvoiceList($this->data['class_id'], $this->data['section_id'], $branchID);\n }\n $this->data['branch_id'] = $branchID;\n $this->data['title'] = translate('payments_history');\n $this->data['sub_page'] = 'fees/invoice_list';\n $this->data['main_menu'] = 'fees';\n $this->load->view('layout/index', $this->data);\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 index()\n {\n return view('admin::sales.invoices.list', ['invoices' => Invoice::getAllByBusiness() ]);\n }", "public function index()\n\t{\n\t\t$invoices = Invoice::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('invoices.index', compact('invoices'));\n\t}", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoices $invoices)\n {\n //\n }", "public function index()\n { \n $invoices = $this->invoiceRepository->get();\n\n return view('chuckcms-module-booker::backend.invoices.index', compact('invoices'));\n }", "public function index()\n {\n if (! Gate::allows('invoice_access')) {\n return abort(401);\n }\n $invoices = Invoice::get();\n\n return view('invoices.index', compact('invoices'));\n }", "public function index()\n {\n\n $invoices = Invoice::orderBy('id', 'desc')->get();\n\n return view('admin.invoices.index', compact('invoices'));\n }", "public function actionIndex()\n {\n $searchModel = new InvoiceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $invoices=InvoiceItem::with(\"item\")->paginate(15);\n\n return view(\"invoiceitem.index\",compact(\"invoices\"));\n }", "public function actionIndex()\n {\n $searchModel = new InvoiceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$dataProvider->pagination->pageSize=15;\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n { \n return view('admin.invoice.list');\n }", "public function show(Invoices $invoice)\n {\n return $invoice;\n }", "public function index()\n {\n return View::make('crm.invoices.index')->with($this->getDataAndPagination());\n }", "public function index($id = false)\r\n {\r\n $this->list_invoices($id);\r\n }", "public function index()\n\t{\n\t\t// Database Queries\n\t\t$invoices = Invoice::with(['contract', 'contract.tenant', 'contract.asset'])->get();\n\t\treturn view('invoices.index', compact('invoices'));\n\t}", "public function show(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function index()\n {\n $invoice = Invoice::all();\n $data['invoice'] = $invoice;\n return view('invoice.index', $data);\n }", "public function show(ImportInvoice $importInvoice)\n {\n //\n }", "public function index()\n\t{\n\t\t$invoices = $this->invoices->all();\n return View::make('invoices.index', compact('invoices'));\n\t}", "public function index()\n {\n $total = Invoice::count();\n $invoices = Invoice::searchRecords('');\n\n return view('invoice.index', compact('invoices', 'total'));\n }", "function m_displayInvoiceList()\n\t{\n\t\t#QUERY ORDER TABLE\n\t\t$this->obDb->query = \"SELECT iOrderid_PK,iInvoice,tmOrderDate,iOrderStatus FROM \".ORDERS.\" WHERE\t iCustomerid_FK= '\".$_SESSION['userid'].\"' ORDER BY tmOrderDate DESC\";\n\t\t$rsOrders = $this->obDb->fetchQuery();\n\t\tif($this->obDb->record_count>0)\n\t\t{\n\t\t\tfor($i=0;$i<$this->obDb->record_count;$i++)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Incomplete\");\n\t\t\t\tif($rsOrders[$i]->iOrderStatus==1){\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_STATUS\",\"Complete\");\n\t\t\t\t}\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ORDERDATE\", $this->libFunc->dateFormat2($rsOrders[$i]->tmOrderDate));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_INVOICE\", $this->libFunc->m_displayContent($rsOrders[$i]->iInvoice));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_DETAILS_LINK\", $this->libFunc->m_safeUrl(SITE_SAFEURL.\"ecom/index.php?action=checkout.receipt&mode=\".$rsOrders[$i]->iOrderid_PK));\n\n\t\t\t\t$this->ObTpl->parse(\"orderlist_blk\",\"TPL_ORDERLIST_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->parse(\"orderlistmain_blk\",\"TPL_ORDERLISTMAIN_BLK\");\n\t\t}\n\t}", "public function invoice()\n\t{\n\t\t$tableName = 'master_invoice';\n\t\t$condition = array('send_status' => SENT);\n\t\t$result['invoice'] = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t$result['count'] = ($result['invoice'] != 0) ? count($result['invoice']) : 0;\n\n\t\t$this->load->view('london/layout/header');\n\t\t$this->load->view('london/layout/sidenavbar', $result);\n\t\t$this->load->view('london/pages/invoice', $result);\n\t\t$this->load->view('london/layout/footer');\n\t}", "public function show(invoices_details $invoices_details)\n {\n //\n }", "public function index()\n {\n return view('admin.invoices.index')->with('page_title', \"Admin Dashboard Invoices\");\n }", "public function index()\n {\n //\n $request = request();\n $inputs = $request->all();\n $invoices = $this->searchrequest($request)->paginate(15);\n\n return view('finance.invoice.index', compact('invoices', 'inputs'));\n }", "public function index()\n {\n $invoice=Invoice::all()->toArray();\n\t\treturn view('invoice.index',compact('invoice'));\n }", "public function index() {\n\n\t\t$invoices = \\Auth::user()\n\t\t\t->invoices()\n\t\t\t->get();\n\n\t\t$transactions = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->get();\n\n\t\tforeach ($invoices as $invoice) {\n\n\t\t\t$invoice->name_date = date('Y-m', strtotime($invoice->name));\n\t\t\t$invoice->sum_of_transactions = count($invoice->transactions);\n\n\t\t\t$income = $transactions\n\t\t\t\t->where('invoice_id', $invoice->id)\n\t\t\t\t->where('type', 'income')\n\t\t\t\t->sum('amount');\n\t\t\t$expense = $transactions\n\t\t\t\t->where('invoice_id', $invoice->id)\n\t\t\t\t->where('type', 'expense')\n\t\t\t\t->sum('amount');\n\n\t\t\t$invoice->change = $income - $expense;\n\t\t}\n\n\t\t$invoices = $invoices->sortBy('name_date');\n\t\t$return['invoices'] = $invoices;\n\n\t\treturn view('/invoices/invoicesOverview', $return);\n\t}", "public function index()\n {\n $productinvoices = ProductInvoice::orderBy('created_at', 'desc')->paginate(10);\n $invoices = Invoice::orderBy('created_at', 'desc')->paginate(10);\n return view('invoices.index', compact(['invoices','productinvoices']));\n }", "public function indexAction() {\n\t\t$this->_helper->redirector ( 'list', 'invoices', 'admin' );\n\t}", "public function invoices()\n {\n //\n $invoices = Invoice::orderBy('updated_at','DESC')->get();\n return view('reports.invoice',['invoices'=>$invoices]);\n }", "public function index()\n {\n\t$impinv=ImportInvoice::all();\n\treturn view('importinvoice.index',compact('impinv'));\n }", "public function index(SearchInvoice $request): ResourceCollection\n {\n return $this->doList($request);\n }", "public function index(Request $request)\n {\n $perPage = request('perPage', 250);\n return view('invoices.index')->with('invoices', Invoice::orderBy('id', 'DESC')->paginate($perPage))\n ->with('trashed', false)\n ->with('selected', $perPage)\n ->with('invoicestatuses', InvoiceStatus::all(['id', 'status']));\n }", "public function index()\n {\n $all_new_invoice=Sale::all();\n return view('pos.new_invoices.index',compact('all_new_invoice'));\n }", "public function list_invoices($id = false, $clientid = false)\r\n {\r\n\r\n if (!has_permission('invoices', '', 'view') && !has_permission('invoices', '', 'view_own')) {\r\n access_denied('invoices');\r\n }\r\n $this->load->model('payment_modes_model');\r\n $data['payment_modes'] = $this->payment_modes_model->get('', array(), true);\r\n if ($this->input->is_ajax_request()) {\r\n $this->perfex_base->get_table_data('invoices', array(\r\n 'id' => $id,\r\n 'clientid' => $clientid,\r\n 'data' => $data\r\n ));\r\n }\r\n $data['invoiceid'] = '';\r\n if (is_numeric($id)) {\r\n $data['invoiceid'] = $id;\r\n }\r\n $data['title'] = _l('invoices');\r\n $data['invoices_years'] = $this->invoices_model->get_invoices_years();\r\n $data['invoices_sale_agents'] = $this->invoices_model->get_sale_agents();\r\n $data['invoices_statuses'] = $this->invoices_model->get_statuses();\r\n $data['bodyclass'] = 'invoices_total_manual';\r\n $this->load->view('admin/invoices/manage', $data);\r\n }", "public function invoices()\n {\n $user = auth()->user();\n $facturas = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n DB::raw(\"upper(quotes.quote_number) AS quote_number\"),\n 'quotes.invoice_date','quotes.stage_id',\n 'accounts.name as accountName','users.name as userName','stages.name as stageName',\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('stages', 'stages.id', '=', 'quotes.stage_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->whereIn('quotes.stage_id', array(3,4))\n ->where('users.organization_id', $user->organization_id)\n ->orderByRaw('quotes.updated_at DESC')\n ->paginate(10);\n return view('quote.invoices',compact('facturas'));\n }", "public function index(Request $request)\n {\n $search_command = $request->get('search');\n $page_title = 'Invoice';\n $page_description = 'Invoice listing';\n $customers = Customer::all();\n $cust = $request->has('search_by_customer') ? $request->input('search_by_customer') : null;\n $status = $request->has('search_by_status') ? $request->input('search_by_status') : null;\n $date_s = $request->has('search_by_start_date') ? $request->input('search_by_start_date') : null;\n $date_e = $request->has('search_by_end_date') ? $request->input('search_by_end_date') : null;\n $lookupcustomers = array();\n foreach ($customers as $k => $v) {\n $lookupcustomers[$v->customer_number] = $v->customer_name;\n }\n\n $invoice_number = Invoice::max('invoice_number');\n $custom_invoice_number = CustomInvoice::max('custom_invoice_number');\n if($invoice_number == null){\n $invoice_number = \"INV101\";\n \n }else{\n $invoice_number = (int)(substr($invoice_number,3));\n $invoice_number = $invoice_number + 1;\n $invoice_number = \"INV\".$invoice_number;\n }\n if($custom_invoice_number == null){\n $custom_invoice_number = \"CINV1001\";\n \n }else{\n $custom_invoice_number = (int)(substr($custom_invoice_number, 4));\n $custom_invoice_number = $custom_invoice_number + 1;\n $custom_invoice_number = \"CINV\".$custom_invoice_number;\n }\n if($search_command == 'command_search') {\n $prepareSearch = new SearchParamInvoice;\n $prepareSearch->fill($request->all());\n\n $qry = $this->invoiceManager::getBaseQuery();\n $preparedSearch = SearchParamInvoice::prepareSearch($qry, $prepareSearch->toArray());\n $invoices = $preparedSearch->get();\n } else {\n $invoices = DB::table('invoices')\n ->leftJoin('customers', 'customers.customer_number', '=', 'invoices.customer_id')\n ->leftJoin('projects', 'projects.project_number', '=', 'invoices.project_id')\n ->where('invoice_status', '=', 'Open')\n ->get();\n }\n\n return view('invoice.index', compact('invoices', 'page_title', 'page_description', 'invoice_number', 'custom_invoice_number', 'lookupcustomers','cust','date_s','date_e','status'));\n }", "public function get_invoice_list()\n {\n return $this->db->select('sr_no, invoice_no, round_off_total, invoice_date, bakery_name,bakery_address, bakery_area, bakery_city')->order_by('sr_no','desc')\n ->from('insider_bill')->join('customers', 'customers.id = insider_bill.customer_id')->get();\n }", "public function index()\n {\n return view('reports.invoice');\n }", "public function index(){\r\n $invoices=DB::table('invoices')\r\n ->join('users','invoices.user_id','=','users.id')\r\n ->select('invoices.created_at as created_at','invoices.numfac as numfac','users.name as name','invoices.mode as mode','invoices.total_amount as total_amount','invoices.id as id')\r\n ->get();\r\n //dd($invoices);\r\n return view('intranet.invoice.list', compact('invoices'));\r\n }", "public function index()\n\t{\t\n\t\t$this->db->join('tbl_invoice_products', 'tbl_invoice_products.invoice_number = tbl_invoice.invoice_number');\n\t\t$this->db->join('tbl_customer', 'tbl_customer.serial = tbl_invoice.customer_id');\n\t\t$this->db->group_by('tbl_invoice.invoice_number');\n\t\t$this->db->order_by('tbl_invoice.invoice_number','desc');\n\t\t$data['invoices'] = $this->db->get('tbl_invoice')->result_object();\n\t\n\t\t$this->load->view('lib/header',$data);\n\t\t$this->load->view('sale/index');\n\t\t$this->load->view('lib/footer');\n\t}", "public function show(Request $request)\n {\n $invoices=InvoiceItem::where(\"invoice_number\",\"=\",\"%\".$request->number.\"%\")->get();\n\n return view(\"invoiceitem.index\",compact(\"invoices\"));\n }", "public function index()\r\n {\r\n if (!has_permission('items', '', 'view')) {\r\n access_denied('Invoice Items');\r\n }\r\n if ($this->input->is_ajax_request()) {\r\n $this->perfex_base->get_table_data('invoice_items');\r\n }\r\n $this->load->model('taxes_model');\r\n $data['taxes'] = $this->taxes_model->get();\r\n $data['items_groups'] = $this->invoice_items_model->get_groups();\r\n\r\n $data['title'] = _l('invoice_items');\r\n $this->load->view('admin/invoice_items/manage', $data);\r\n }", "public function listAction($invoice_id)\n {\n $request = $this->get('request');\n $manager = $this->get(\"gfire_invoice.manager.invoice_account_entry\");\n $invoice = $this->getInvoice($invoice_id);\n\n $pager = $manager->findAllByInvoicePager($invoice_id,$request->get('page'));\n\n return $this->render('GFireInvoiceBundle:InvoiceAccountEntry/Renderer:accountEntries.html.twig', array(\n 'pager' => $pager,\n 'total' => $invoice->getTotalAccountDebitCredit(),\n 'invoice' => $invoice,\n ));\n }", "public function index() {\n\t\t$title = trans( 'invoice.invoice' );\n\t\t$fullPayment = $this->invoiceRepository->getAllFullPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->count();\n\t\t$partPayment = $this->invoiceRepository->getAllPartPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->count();\n\t\t$noPayment = $this->invoiceRepository->getAllNoPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->count();\n\t\t$fullPaymentSum = $this->invoiceRepository->getAllFullPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->sum( 'paid_amount' );\n\t\t$partPaymentSum = $this->invoiceRepository->getAllPartPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->sum( 'paid_amount' );\n\t\t$noPaymentSum = $this->invoiceRepository->getAllNoPaymentForSchoolAndSchoolYear( session( 'current_school' ), session( 'current_school_year' ) )->sum( 'amount' );\n\n\t\treturn view( 'invoice.index', compact( 'title',\n\t\t\t'fullPayment', 'partPayment', 'noPayment',\n\t\t\t'fullPaymentSum', 'partPaymentSum', 'noPaymentSum' ) );\n\t}", "public function index()\n {\n return view('partnerviews.inscriptions.list-inscriptions');\n }", "public function viewDetails($invoice_id) {\n\t\t$results = DB::select(\n\t\t\t\"SELECT *\n\t\t\tFROM invoice_item \n\t\t\tJOIN item ON (invoice_item.item_id = item.id)\n\t\t\tWHERE invoice_item.invoice_id = :invoice_id\",\n\t\t\tarray(\n\t\t\t\t\":invoice_id\" => $invoice_id\n\t\t\t\t)\n\t\t\t);\n\t\t$list = DB::select(\"SELECT * FROM item\");\n\n\t\treturn view('invoiceDetails', ['results' => $results, 'invoice_id' => $invoice_id, 'list'=>$list]);\n\t}", "public function show(Invoice $invoice)\n {\n return $invoice;\n }", "public function index()\n {\n \t$scheme = Scheme::find(Auth::user()->scheme_id);\n \t$title = \"Invoice page\";\n \treturn view(\"invoice.index\",compact(\"scheme\",\"title\"));\n }", "public function index()\n {\n $returnData = Invoice::orderBy('id','DESC')->get();\n return $returnData;\n }", "public function index()\n { \n $this->isNotCashier();\n return view('invoice.invoice');\n }", "public function index(Request $request): View\n {\n $query = $request->get('q');\n\n $baseQuery = $request->user()->invoices();\n\n $invoices = Invoice::listing($baseQuery);\n\n if ($query !== null) {\n $searchFields = $this->parseSearchQuery(\n $query,\n Invoice::$searchables\n );\n\n $invoices = Invoice::search($invoices, $searchFields);\n }\n\n $invoices = $invoices->simplePaginate(15);\n\n $viewVars = [\n 'collection' => $invoices,\n 'collectionOf' => 'invoices',\n 'pageTitle' => 'Invoices',\n 'query' => $query,\n 'searchFields' => array_keys(Invoice::$searchables),\n ];\n\n return view('list', $viewVars);\n }", "public function all()\n\t{\n\t\t$results = DB::select(\n\t\t\t\"SELECT \n\t\t\t\tcustomer.first_name, \n\t\t\t\tcustomer.last_name,\n\t\t\t\tinvoice.id AS invoice_id,\n\t\t\t\tinvoice_item.item_id,\n\t\t\t\tSUM(invoice_item.quantity * item.price) AS total\n\t\t\tFROM invoice_item \n\t\t\tJOIN item ON (invoice_item.item_id = item.id)\n\t\t\tJOIN invoice ON (invoice_item.invoice_id = invoice.id)\n\t\t\tJOIN customer ON (customer.id = invoice.customer_id)\n\t\t\tGROUP BY invoice_id\"\n\t\t\t);\n\n\t\treturn view('allInvoices', ['results' => $results]);\n\t}", "public function getAllInvoicesList(InvoiceListingFilter $filter): Builder;", "public function invoice_list( $customer_id = NULL, $count = 10, $offset = 0 ) {\r\n\t\t$params['count'] = $count;\r\n\t\t$params['offset'] = $offset;\r\n\t\tif( $customer_id )\r\n\t\t\t$params['customer'] = $customer_id;\r\n\t\t$vars = http_build_query( $params, NULL, '&' );\r\n\t\t\r\n\t\treturn $this->_send_request( 'invoices?'.$vars );\r\n\t}", "function invoices_view_all(){\n\t\t$user_transactions=array();\n\t\t$user_transactions=$this->UserModel->get_user_transactions(array('user_id'=>$this->session->userdata('member_id'),'gateway !='=>'ADMIN','t.is_deleted'=>0),0,0,'like');\n\t\tif($_SERVER['HTTP_REFERER']!=base_url().\"account/invoices_view_all\"){\n\t\t\t$this->session->set_userdata('HTTP_REFERER', $_SERVER['HTTP_REFERER']);\n\t\t\t$previous_page_url=$_SERVER['HTTP_REFERER'];\n\t\t}else{\n\t\t\t$previous_page_url=$this->session->userdata('HTTP_REFERER');\n\t\t}\n\t\t//Loads header, Invoices list and footer view.\n\t\t$this->load->view('header',array('title'=>'My Invoices','previous_page_url'=>$previous_page_url));\n\t\t$this->load->view('user/invoices_list',array('user_transactions'=>$user_transactions));\n\t\t$this->load->view('footer-inner-red');\n\t}", "public function actionPreviewInvoice() {\n // Get assets path\n $assetsPath = $this->getAssetsPath();\n // Attach script files\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/billing_dashboard.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/event_handlers.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/checkbox_column_helper.js');\n Yii::app()->clientScript->registerScriptFile($assetsPath . '/js/billingDashboard/invoice.js');\n // Set javascript data\n $this->setJavascriptData();\n \n // Page size modifier\n if(isset($_GET['pageSize'])) {\n Yii::app()->user->setState('pageSize', (int)$_GET['pageSize']);\n unset($_GET['pageSize']);\n }\n \n // Get data provider\n $data = $this->getData();\n if($data === false || empty($data)) {\n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array('no-selection' => 1,)));\n }\n \n // Make data provider\n $dataProvider = new CArrayDataProvider($data, array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n ));\n \n // Render preview page\n $this->render('invoice_grid', array(\n // Send general data\n 'pageTitle' => 'Invoice Preview',\n 'clientName' => $data[0]->project->getClientName(),\n // Data providers\n 'dataProvider' => $dataProvider,\n ));\n }", "public function show(Invoice $invoice){\n return view('admin.orders.show')->with('invoice', $invoice);\n }", "public function show(APInvoiceAlls $aPInvoiceAlls)\n {\n //\n }", "public function index()\n{\n$allInvoice = invoice::all();\n\nreturn view('invoice.invoices')->with('allInvoice', $allInvoice);\n}", "public function index()\n {\n $invoices = Invoice::with('details', 'details.item', 'client')->get();\n $closure = [\n 'count' => count($invoices),\n 'data' => $invoices\n ];\n return response()->json($closure, 200);\n }", "public function index(){\n $invitations = Invitations::paginate(10);\n return view('admin.invitations.index',compact(\"invitations\"));\n }", "public function invoice($param1 = \"\", $param2 = \"\") {\n\t\t// showing the list of invoices\n\t\tif ($param1 == 'invoice') {\n\t\t\t$page_data['invoice_id'] = $param2;\n\t\t\t$page_data['folder_name'] = 'invoice';\n\t\t\t$page_data['page_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = 'invoice';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\n\t\t// showing the index file\n\t\tif(empty($param1)){\n\t\t\t$page_data['folder_name'] = 'invoice';\n\t\t\t$page_data['page_title'] = 'invoice';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\t}", "public function index()\n {\n //\n\t\t$Invoices=Invoice::all()->sortByDesc('invoice_startmonth');//最新的在最上方\n\t\treturn view('invoice.index',compact('Invoices'));\n }", "public function invoice($id = '')\n {\n if (!get_permission('invoice', 'is_view')) {\n access_denied();\n }\n\n $this->data['student_id'] = $id;\n $this->data['invoice'] = $this->fees_model->getInvoiceStatus($id);\n $this->data['basic'] = $this->fees_model->getInvoiceBasic($id);\n $this->data['title'] = translate('invoice_history');\n $this->data['main_menu'] = 'fees';\n $this->data['sub_page'] = 'fees/collect';\n $this->load->view('layout/index', $this->data);\n }", "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 actionInvoice($id){\n $invoice = Yii::$app->user->identity->getInvoices()\n ->where(['invoice_id' => (int) $id])->one();\n\n if(!$invoice) die(\"Invoice not found\");\n\n return $this->renderPartial('invoice', [\n 'invoice' => $invoice\n ]);\n }", "public function index()\n {\n $allInvoiceCount = InvoiceLists::count();\n $newInvoiceCount = InvoiceLists::whereDate('created_at', '=', Carbon::now()->format('Y-m-d'))->count();\n return view('admin.invoice.index', compact('allInvoiceCount', 'newInvoiceCount'));\n }", "public function index()\n\t{\n\t\t$customerinvoicelines = Customerinvoiceline::all();\n\n\t\treturn View::make('customerinvoicelines.index', compact('customerinvoicelines'));\n\t}", "public function index()\n {\n $invoice = Invoice::all();\n return response()->json($invoice);\n }", "public function getIndex(ReceivableInvoice $invoice){\n //$invoices = ReceivableInvoice::pluck('number_id', 'number_id');\n $sale = Sale::get()->where('invoice_id', '=', $invoice->number_id)->first();\n return view('cashReceipts.create', compact('invoice', 'sale'));\n }", "public function index()\n {\n //\n $purchaseInvoices = PurchaseInvoice::all();\n return view('hutang', compact('purchaseInvoices'));\n }", "public function show($id)\n {\n return view('admin::sales.invoices.view', ['invoice' => Invoice::find($id)]);\n }", "function index() {\n \t\n \t// API call\n if($this->request->isApiCall()) {\n $this->response->respondWithData(Invoices::findForApi($this->logged_user), array(\n 'as' => 'invoices',\n ));\n\n // Regular request made by web browser\n } elseif($this->request->isWebBrowser()) {\n \t$this->wireframe->list_mode->enable();\n\n $invoices = Invoices::findForObjectsList($this->logged_user, null, STATE_VISIBLE);\n\n $invoice_dates_map = Invoices::getIssuedAndDueDatesMap($invoices);\n\n $this->response->assign(array(\n 'invoices' => $invoices,\n 'companies_map' => Companies::getIdNameMap($this->logged_user->visibleCompanyIds()),\n 'invoice_states_map' => $this->status_map,\n 'invoice_dates_map' => $invoice_dates_map,\n 'in_archive' => false,\n 'print_url' => Router::assemble('invoices', array('print' => 1))\n ));\n \n // Phone request\n } elseif($this->request->isPhone()) {\n \t$this->wireframe->actions->add('quotes', lang('Quotes'), Router::assemble('quotes'), array(\n 'icon' => AngieApplication::getImageUrl('icons/navbar/quotes.png', INVOICING_MODULE, AngieApplication::getPreferedInterface())\n ));\n $this->wireframe->actions->add('recurring_profiles', lang('Recurring Profiles'), Router::assemble('recurring_profiles'), array(\n 'icon' => AngieApplication::getImageUrl('icons/navbar/recurring.png', INVOICING_MODULE, AngieApplication::getPreferedInterface())\n ));\n \n $this->response->assign('formatted_invoices', Invoices::findForPhoneList($this->logged_user));\n \t\n // Tablet device\n \t} elseif($this->request->isTablet()) {\n \t\tthrow new NotImplementedError(__METHOD__);\n \n } elseif($this->request->isPrintCall()) {\n $group_by = strtolower($this->request->get('group_by', null));\n $filter_by = $this->request->get('filter_by', null);\n \n // page title\n $filter_by_completion = array_var($filter_by, 'status', null); \n if ($filter_by_completion === '0') {\n \t$page_title = lang('Drafts Invoices');\n } else if ($filter_by_completion === '1') {\n\t\t\t\t\t$page_title = lang('Issued Invoices');\n } else if ($filter_by_completion === '2') {\n\t\t\t\t\t$page_title = lang('Paid Invoices');\n } else if ($filter_by_completion === '3') {\n\t\t\t\t\t$page_title = lang('Canceled Invoices');\n } else {\n \t$page_title = lang('All Invoices');\n } // if\n\n // maps\n $map = array();\n \n switch ($group_by) {\n case 'client_id':\n $map = Companies::getIdNameMap();\n $map[0] = lang('Unknown Client');\n \n \t$getter = 'getCompanyId';\n \t$page_title.= ' ' . lang('Grouped by Client'); \n break;\n case 'status':\n $map = $this->status_map;\n $map[0] = lang('Draft');\n \n \t$getter = 'getStatus';\n \t$page_title.= ' ' . lang('Grouped by Status');\n break;\n case 'issued_on_month':\n $map = Invoices::mapIssuedOnMonth();\n $map[0] = lang('Draft');\n \n $getter = 'getIssuedOnMonth';\n \t$page_title.= ' ' . lang('Grouped by Issued On Month');\n break;\n case 'due_on_month':\n $map = Invoices::mapDueOnMonth();\n $map[0] = lang('Draft');\n \n $getter = 'getDueOnMonth';\n \t$page_title.= ' ' . lang('Grouped by Due On Month');\n break;\n } //switch\n \n // find invoices\n $invoices = Invoices::findForPrint($this->logged_user, null, $group_by, $filter_by);\n\n //use thisa to sort objects by map array\n $print_list = group_by_mapped($map,$invoices,$getter);\n \n $this->smarty->assignByRef('invoices', $print_list);\n $this->smarty->assignByRef('map', $map);\n $this->response->assign(array(\n 'group_by' => $group_by,\n 'page_title' => $page_title,\n ));\n }//if\n }", "public function actionIndex()\n {\n $availablePriceOptions = \\common\\models\\Pricing::find()->orderBy('pricing_price')->all();\n\n $isTrialActive = Yii::$app->user->identity->hasActiveTrial();\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n\n $invoices = Yii::$app->user->identity->getInvoices()->orderBy('invoice_created_at DESC')->all();\n\n return $this->render('index', [\n 'availablePriceOptions' => $availablePriceOptions,\n 'isTrial' => $isTrialActive,\n 'isBillingActive' => $isBillingActive,\n 'invoices' => $invoices\n ]);\n }", "public function action_index()\n\t{\n\t\t$data = array(); // Model_Pos_Profile::get_current_user()\n\n\t\t$this->template->title = \"Cashier\";\n\t\t$this->template->content = View::forge('pos/invoice/index', $data);\n\t}", "public function invoices($id = null)\n {\n $project = $this->project->findOrFail($id);\n $this->authorize('invoices', $project);\n $invoices = new InvoicesResource($project->invoices()->orderBy('id', 'desc')->paginate(20));\n if ($this->request->has('json')) {\n $data['invoices'] = $invoices;\n return view('projects::_ajax._invoices')->with($data);\n }\n return response($invoices, Response::HTTP_OK);\n }", "public function index()\n {\n // return abort('500');\n return view('invoice.index');\n }", "public function show(Invoice $invoice) {\n\n\t\t$mydate = $invoice->name . \"-00 23:59:59\";\n\t\t$date = date_create_from_format(\"Y-F-d H:i:s\", $mydate);\n\t\t$income = 0;\n\t\t$expense = 0;\n\n\t\t$income = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->where('date', '<', $date)\n\t\t\t->where('type', \"income\")\n\t\t\t->sum('amount');\n\n\t\t$expense = \\Auth::user()\n\t\t\t->transactions()\n\t\t\t->where('date', '<', $date)\n\t\t\t->where('type', \"expense\")\n\t\t\t->sum('amount');\n\n\t\t$balance = $income - $expense;\n\t\t$return['balance'] = $balance;\n\t\t$transactions = \\App\\Invoice::find($invoice->id)->transactions;\n\n\t\t$return['transactions'] = $transactions->sortBy('date');\n\t\t$return['user'] = \\Auth::user();\n\t\t$return['downloadType'] = $invoice->name;\n\n\t\treturn view('/transactions/transactionOverview', $return);\n\t}", "public function invoice($id)\n {\n $orders = Order::with('customer', 'payment', 'shipping', 'order_items')->findOrFail($id);\n $order_info = OrderInfo::with('product')->select('id', 'order_id', 'product_id', 'product_name', 'product_price', 'product_qty')->where('order_id', $id)->get();\n\n return view('backend.order.invoice', compact('orders', 'order_info'));\n }", "public function actionManageInvoice()\n {\n $invoice = new Invoice('search');\n if (isset($_GET['student_id'])) {\n $dataProvider = $invoice->search($_GET['student_id']);\n } else {\n $dataProvider = $invoice->search();\n }\n $student_id = $_GET['student_id'];\n\n $model = new Invoice('search');\n $model->unsetAttributes(); // clear any default values\n if (isset($_GET['Invoice']))\n $model->attributes = $_GET['Invoice'];\n\n $this->render('manageInvoice', array(\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ));\n }", "public function index(Request $request)\n {\n $filters = $request->all() ?: $this->service->defaultFilters();\n\n return view('invoice::index', $this->service->index($filters));\n }", "public function retrieveallinvoices(Request $request)\n {\n $invoices = Invoice::latest()->get();\n\n return InvoicesResource::collection($invoices);\n }", "public function testList()\n {\n //Tests all invoices\n $this->clientAuthenticated->request('GET', '/invoice/list');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('invoiceId', $first);\n }", "public function browse()\n {\n require_code('templates_donext');\n return do_next_manager(get_screen_title('INVOICES'), comcode_lang_string('DOC_ECOMMERCE'),\n array(\n array('menu/_generic_admin/add_one', array('_SELF', array('type' => 'add'), '_SELF'), do_lang('CREATE_INVOICE')),\n array('menu/adminzone/audit/ecommerce/outstanding_invoices', array('_SELF', array('type' => 'outstanding'), '_SELF'), do_lang('OUTSTANDING_INVOICES')),\n array('menu/adminzone/audit/ecommerce/undelivered_invoices', array('_SELF', array('type' => 'undelivered'), '_SELF'), do_lang('UNDELIVERED_INVOICES')),\n ),\n do_lang('INVOICES')\n );\n }", "public function invoicesList(RouteMatchInterface $route_match) {\n $entity_type_id = $this->config('recurly.settings')->get('recurly_entity_type');\n $entity = $route_match->getParameter($entity_type_id);\n\n $entity_type = $entity->getEntityType()->getLowercaseLabel();\n $account = recurly_account_load(['entity_type' => $entity_type, 'entity_id' => $entity->id()]);\n\n $per_page = 20;\n $invoice_list = \\Recurly_InvoiceList::getForAccount($account->account_code, ['per_page' => $per_page]);\n $invoices = $this->recurlyPageManager->pagerResults($invoice_list, $per_page);\n\n return [\n '#theme' => 'recurly_invoice_list',\n '#attached' => [\n 'library' => [\n 'recurly/recurly.invoice',\n ],\n ],\n '#invoices' => $invoices,\n '#entity_type' => $entity_type,\n '#entity' => $entity,\n '#per_page' => $per_page,\n '#total' => $invoice_list->count(),\n ];\n }", "public function show($invoice)\n {\n $order = Order::withTrashed()->whereInvoice($invoice)->first();\n return view('admin.orders.show', compact('order'));\n }", "public function getDraftInvoicesList(InvoiceListingFilter $filter): Collection;", "function index()\n {\n //$data['invoice'] = $this->Invoice_model->get_all_invoice();\n\t\t$data['invoice']=$this->GenricModel->query('select distinct i.InvoiceId,i.BillNo,i.SupplierName,i.SupplierNumber,i.PurchaseDate,id.TAmount from invoice i join invoicedetail id on id.InvoiceId=i.InvoiceId');\n\t\t$userid = $this->session->userdata('userid');\n $data['users'] = $this->User_model->get_user($userid);\n $data['title']= 'e-Invoice';\n\t\t$data['_view'] = 'invoice/index';\n $this->load->view('layouts/main1',$data);\n }", "public function show($id)\n {\n $productinvoices = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n return view('invoices.show', compact(['invoices','productinvoices']));\n }", "public function index()\n {\n $products = Product::orderBy('name','ASC')\n ->get()\n ->pluck('name','id');\n\n $customers = Customer::orderBy('name','ASC')\n ->get()\n ->pluck('name','id');\n\n $invoice_data = Product_Out::all();\n return view('sales.index', compact('products','customers', 'invoice_data'));\n }", "public function index()\n {\n $Invoice = new Invoice;\n $invoices = $Invoice->select();\n\n // 向V层传数据\n $this->assign('invoices', $invoices);\n\n // 取回打包后的数据\n $htmls = $this->fetch();\n\n // 将数据返回给用户\n return $htmls;\n\n }", "public function show($id)\n {\n\t\treturn PaymentLineItems::where('invoice_id', $id)->get()->toArray();\n\t}", "public function index()\n {\n $total_invoices = Invoice::count();\n $total_cost = Invoice::sum('cost');\n $total_weight = Invoice::sum('weight');\n $total_cost_per_unit = round($total_cost / $total_weight, 2);\n\n $stats = [\n 'total_invoices' => $total_invoices,\n 'total_cost' => '$' . $total_cost,\n 'total_weight' => $total_weight . 'LB',\n 'total_cost_per_unit' => '$' . $total_cost_per_unit,\n ];\n\n return view('invoices', compact(['stats']));\n }", "public function viewOrderInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n $html = $this->renderView('easy_admin/Order/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n\n return new Response(\n $this->get('knp_snappy.pdf')->getOutputFromHtml($html),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'attachment; filename=\"' . $entity->getClient()->getFirstname() . '.pdf\"'\n )\n );\n }", "public function detail(Invoice $invoice)\n {\n return view('chuckcms-module-booker::backend.invoices.detail', compact('invoice'));\n }" ]
[ "0.796662", "0.79611987", "0.768277", "0.7675702", "0.75753236", "0.75753236", "0.75753236", "0.7568505", "0.75015444", "0.7501085", "0.74898994", "0.7484018", "0.7468989", "0.74678105", "0.7462065", "0.74219877", "0.7410549", "0.740538", "0.74039686", "0.73628396", "0.73414713", "0.7301158", "0.72993714", "0.72966784", "0.7285942", "0.72857255", "0.72461796", "0.72279084", "0.718167", "0.71335894", "0.7096355", "0.7082586", "0.70814925", "0.70619506", "0.7005454", "0.6993888", "0.69628793", "0.6942026", "0.69021946", "0.68827254", "0.6861563", "0.6858383", "0.68524504", "0.68245035", "0.6820114", "0.68156135", "0.68083745", "0.68046135", "0.67878616", "0.67621833", "0.6752322", "0.6748625", "0.6730104", "0.6728829", "0.6726233", "0.6710918", "0.6710033", "0.66922504", "0.6692205", "0.66879547", "0.6686309", "0.6673871", "0.6660095", "0.66501486", "0.6623748", "0.66180384", "0.6617577", "0.6610412", "0.6609192", "0.6602149", "0.6601851", "0.659779", "0.6579148", "0.65705824", "0.65659434", "0.65451384", "0.65329117", "0.6516241", "0.6513762", "0.6507998", "0.65024036", "0.6498946", "0.6496542", "0.64938015", "0.64790225", "0.6472386", "0.6463073", "0.64598376", "0.6457445", "0.6448708", "0.64435", "0.6433752", "0.64225143", "0.6421631", "0.6417688", "0.6415837", "0.6407626", "0.6392081", "0.63893145", "0.6388545" ]
0.75533116
8
Show the form for creating new Invoice.
public function create() { if (! Gate::allows('invoice_create')) { return abort(401); } $users = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $projects = \App\Project::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $expense_types = \App\ExpenseType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $meetings = \App\Meeting::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $contingencies = \App\Contingency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $providers = \App\Provider::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $service_types = \App\ServiceType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $pms = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $finances = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); return view('admin.invoices.create', compact('users', 'projects', 'expense_types', 'meetings', 'contingencies', 'providers', 'service_types', 'pms', 'finances')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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'] = 'invoice.store';\n return view('invoice.form', $data);\n }", "public function create()\n {\n $page_title = 'Invoice';\n $page_description = 'Make Invoice';\n return view('invoice.create', compact('page_title', 'page_description'));\n }", "public function create()\n {\n return view('chuckcms-module-booker::backend.invoices.create');\n }", "public function newAction()\n {\n $entity = new Invoice();\n $form = $this->createCreateForm($entity);\n\n $invoiceLine = new InvoiceLine();\n $invoiceLineForm = $this->createForm(\n new InvoiceLineType($this->get('security.context')),\n $invoiceLine,\n array(\n 'action' => 'javascript:void(0);',\n 'method' => 'POST',\n )\n );\n $this->viewData['form'] = $form->createView();\n $this->viewData['entities'] = $entity;\n\n return $this->render('AcmeInvoiceBundle:Invoice:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'line_form' => $invoiceLineForm->createView(),\n ));\n }", "public function create()\n {\n //\n\t\treturn view('invoice.create');\n }", "public function create()\n {\n return view('invoice.create');\n }", "public function create()\n\t{\n\t\treturn view('invoices.create');\n\t}", "public function create()\n {\n //\n return view('finance.invoice.create');\n }", "public function create() {\n\t\t$title = trans( 'invoice.new' );\n\t\t$this->generateParams();\n\n\t\treturn view( 'layouts.create', compact( 'title' ) );\n\t}", "public function create()\n {\n\n return view('invoices.create')\n ->with('couriers', Courier::all())\n ->with('invoiceid', false);\n // return view('invoices.create');\n }", "public function create() {\n\n\t\t// $product = new \\App\\Product;\n\t\t// $product->name = 'Ettiene';\n\t\t// $product->save();\n\t\treturn view('/invoices/createform');\n\t}", "public function actionCreate()\n {\n $model = new Invoice();\n $model->loadDefaultValues();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } elseif (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public function create()\n {\n return view('admin::sales.invoices.add', [\n 'data' => Invoice::factory()->make(),\n 'customers' => Contact::asCustomers()\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model = new AccountInvoice();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function create()\n {\n return view('dashboard.invoices.create-sale-inv');\n }", "public function create()\n {\n $companies = Company::all();//->pluck('name', 'id');\n $lastNumber = Invoice::getLastNumber();\n $authorizations = Authorization::openForInvoices();\n\n return view('invoice.create', compact('companies', 'lastNumber', 'authorizations'));\n }", "public function create()\n {\n return view('dashboard.invoices.create-purchase-inv');\n }", "public function create()\n {\n\n\n \n return view('invoices.create');\n }", "public function create()\n {\n return view('invoice::create', $this->service->create());\n }", "public function create()\n {\n JavaScript::put('invoice_id',(int)$this->service->getLastInsertId()+1);\n return view('admin.invoice.add',[\n 'invoice_id'=>((int)$this->service->getLastInsertId()+1),\n 'taxes' => Tax::all(),\n ]);\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return abort(401);\n }\n $relations = [\n 'users' => User::ofType('employee')->get()->pluck('name', 'id')->prepend('Please select', ''),\n ];\n\n return view('invoices.create', $relations);\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return prepareBlockUserMessage();\n }\n \n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CUSTOMERS_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $sales_agent = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_SALE_AGENT);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $currencies = \\App\\Currency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $taxes = \\App\\Tax::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $discounts = \\App\\Discount::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $enum_status = Invoice::$enum_status;\n $enum_discounts_format = Invoice::$enum_discounts_format;\n $enum_tax_format = Invoice::$enum_tax_format;\n \n return view('admin.invoices.create', compact('enum_status', 'customers', 'sales_agent','currencies', 'taxes', 'discounts', 'enum_discounts_format', 'enum_tax_format'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new ClientInvoice;\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['ClientInvoice']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ClientInvoice'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n $clients = Client::all();\n return view('importinvoice.create', compact('clients'));\n }", "public function create(Request $request): View\n {\n $clientId = $request->input('client', null);\n $projectId = $request->input('project', null);\n\n $project = null;\n $client = null;\n $projects = $request->user()->projectsForMenu();\n\n if ($projectId) {\n $project = $request->user()->project($projectId)->with('client')->firstOrFail();\n $client = $project->client;\n $projects = $request->user()->projectsForMenu($client->getKey());\n }\n\n if ($clientId) {\n $project = null;\n $client = $request->user()->client($clientId)->firstOrFail();\n $projects = $request->user()->projectsForMenu($client->getKey());\n }\n\n $invoice = new Invoice();\n $invoice->project_id = $projectId;\n\n $viewVars = [\n 'pageTitle' => 'New Invoice',\n 'projects' => $projects,\n 'client' => $client,\n 'model' => $invoice,\n 'submission_route' => 'invoice.store',\n 'submission_method' => 'POST',\n ];\n\n return view('invoice.form', $viewVars);\n }", "public function create()\n\t{\n $customers = $this->customers->all();\n\t\treturn View::make('invoices.create', compact('customers'));\n\t}", "public function create()\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $purchaseorderlists = PurchaseOrderLists::pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }else {\n $purchaseorderlists = PurchaseOrderLists::where('quote_sales_person_id', Auth::user()->id)\n ->pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }\n return view('admin.invoice.create', compact('invoice', 'purchaseorderlists'));\n }else{\n Alert::info('No Access !', 'Attention !');\n return redirect('admin/invoice-list');\n }\n }", "public function newAction()\n {\n $document = new Document();\n $type = $this->getDoctrine()->getManager()->getRepository('FlowerFinancesBundle:DocumentType')->findOneBy(array(\n 'name' => \\Flower\\FinancesBundle\\Entity\\DocumentType::TYPE_CUSTOMER_INVOICE\n ));\n $document->setType($type);\n\n $form = $this->createForm($this->get('finances.form.type.customer_invoice'), $document);\n\n return array(\n 'document' => $document,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view('forms.payments');\n }", "public function createinvoiceAction() {\n\t\t$request = Zend_Controller_Front::getInstance ()->getRequest ();\n\t\tif (is_numeric ( $request->id )) {\n\t\t\t$invoiceID = Invoices::Create ( $request->id );\n\t\t\tif (is_numeric ( $invoiceID )) {\n\t\t\t\tInvoices::setInvoice ( $request->id, $invoiceID );\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'An invoice already exists for this order.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn View::make('customerinvoicelines.create');\n\t}", "public function create()\n\t{\n\t\t// Database Queries\n\t\t$contracts = Contract::with(['asset', 'tenant'])->notEnded()->get();\n\n\t\t// Config/Constants.php 'Queries'\n\t\t// Changes need to be made in the constants.php file AND on the DB\n\t\t$statuses = Config::get('constants.statuses');\n\t\t$priorities = Config::get('constants.priorities');\n\n\t\treturn view('invoices.create', compact('contracts', 'priorities', 'statuses'));\n\t}", "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 return view('admin.insurance.create');\n }", "public function create()\n {\n $items=Item::latest()->get();\n return view(\"invoiceitem.create\",compact(\"items\"));\n }", "public function create()\n {\n return view('po.form', [\n 'po' => new PurchaseOrder(),\n 'action' => route('po.store'),\n 'method' => 'POST',\n 'title' => 'Create'\n ]);\n }", "public function show($id)\n {\n return view('invoices.create')\n ->with('invoiceid', $id);\n }", "public function create()\n\t{\n\t\t$branches = DB::table('fiametta_warehouse.tbl_branch')\n\t\t\t->where('branch_type_id',4)\n\t\t\t->where('active',1)\n\t\t\t->get();\n\t\t$contacts = Contact::where('active',1)->get();\n\t\t$items = Item::AvailableItemKiosk()->get();\n\t\treturn View::make('invoice.create')\n\t\t->with('items',$items)\n\t\t->with('branches',$branches)\n\t\t->with('contacts',$contacts);\n\t}", "public function add_invoice()\n\t{\n\t\t$this->load->view('london/layout/header');\n\t\t$this->load->view('london/layout/sidenavbar');\n\t\t$this->load->view('london/pages/add-invoice');\n\t\t$this->load->view('london/layout/footer');\n\t}", "public function newAction(Request $request)\n {\n $invoiceAction = new InvoiceAction();\n $newForm = $this->createNewForm($invoiceAction);\n $newForm->handleRequest($request);\n\n if ($newForm->isSubmitted()) {\n if($newForm->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($invoiceAction);\n $em->flush();\n $request->getSession()->getFlashBag()->add( 'success', 'invoiceAction.new.flash' );\n return $this->redirect($this->generateUrl('admin_invoiceaction_index'));\n }\n }\n\n return $this->render('UniAdminBundle:InvoiceAction:new.html.twig', array(\n 'newForm' => $newForm->createView(),\n ));\n }", "public function createInvoice()\r\n {\r\n }", "public function create()\n {\n if(!in_array(Auth::user()->role,['Admin']))\n return view('home')->with('message','You are not authorized for the page you tried to visit');\n $customers = Customer::all();\n return view('invoice.create',compact('customers'));\n //\n }", "public function create()\n {\n return view('documento_institucionals.create');\n }", "public function create()\n {\n return view('orders.purchases.form', [\n 'create' => true,\n 'compra' => new Purchase(),\n 'choferes' => Driver::get()->sortByDesc('id'),\n 'proveedores' => Provider::get()->sortByDesc('id'),\n ]);\n }", "public function create()\n {\n $dataOfCompanies = CompaniesModel::pluck('name', 'id');\n $dataOfClient = ClientsModel::pluck('full_name', 'id');\n $dataOfProducts = ProductsModel::pluck('name', 'id');\n\n return View::make('crm.invoices.create')->with(\n [\n 'dataOfCompanies' => $dataOfCompanies,\n 'dataOfClient' => $dataOfClient,\n 'dataOfProducts' => $dataOfProducts\n ]);\n }", "public function create()\n {\n $title = 'الفاتورة';\n $sections = Section::all()->pluck('section_name', 'id');\n\n return view('admin.invoices.create', compact('title', 'sections'));\n }", "public function create()\n {\n return view('orders._form');\n }", "public function create()\n {\n return view('notafiscal.create');\n }", "public function create()\n {\n return view('panel.payment-management.payment.form-create');\n }", "public function create()\n {\n $dataMasters = DataMaster::all();\n return view('invoices-create',compact('dataMasters'));\n }", "public function create()\n {\n return view('lineaInvestigacion.create');\n }", "public function actionCreate()\n {\n $model = new Invoice();\n $selection = Yii::$app->request->post('selection');\n if(empty($selection)) {\n Yii::$app->session->setFlash('error', 'Products not selected');\n return $this->redirect(Yii::$app->request->referrer);\n }\n $searchModel = new ProductSearch();\n $dataProvider = $searchModel->search([]);\n $dataProvider->query->where('id in ('.implode(',',$selection).')');\n $model->product_ids=$selection;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \n return $this->render('create', [\n 'model' => $model,\n 'productsDataProvider' => $dataProvider,\n ]);\n }\n }", "public function create()\r\n {\r\n $form=[\r\n \"value\" => \"add\",\r\n \"name\" => \"Add Payment\",\r\n \"submit\" => \"Save\"\r\n ];\r\n\r\n $clients_list = Client::all(); \r\n\r\n return view('payment/form',compact('form','clients_list'));\r\n }", "public function create()\n {\n $contracts = Contract::all();\n $customers = Customer::all();\n return view('OrderForm')->with('customers', $customers)->with('contracts', $contracts);\n }", "public function pos_invoice(){\n\t\t\n\t\tredirect('dashboard_pharmacist/invoice/Cinvoice');\n\t\t\n\t\t$CI =& get_instance();\n\t\t$CI->load->library('linvoice');\n\t\t$content = $CI->linvoice->pos_invoice_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function create()\n {\n return view('administrativo.contractual.create');\n ;}", "public function create()\n {\n return view('inventario.ingreso.create.create');\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('admin.provinsi.create');\n }", "public function create()\n {\n return view('contracts.create');\n }", "public function create()\n {\n $contract = new Contract;\n foreach ($this->contractForm->defaults as $field => $default)\n {\n $contract->$field = $default;\n }\n\n return View::make('contracts.create', compact('contract'));\n }", "public function create()\n {\n return view('pages.checkout.formcheckout');\n }", "public function create()\n {\n return view('admin.intros.create');\n }", "public function showForm(){\n return view('marketItem.itemCreateForm');\n }", "public function create()\n {\n return view('beneficios.create');\n }", "public function create()\n {\n // load the create form (app/views/nerds/create.blade.php)\n return view('incomes.create');\n }", "public function create()\n {\n return view('form_cliente');\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function create() // formulario registro\n {\n return view(products.create);\n }", "public function create()\n {\n $days = [\n '0' => '--Select Day--', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' =>'16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28'\n ];\n return view('invoices.create', compact('days'));\n }", "public function create()\n {\n return view('payments.create');\n }", "public function create()\n {\n return view('inventory::finance.create');\n }", "public function create()\n {\n return view('saldo.form');\n }", "protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }", "public function show($id)\n {\n return view('examples.vueinvoices.create');\n }", "public function create()\n {\n return view('interes.interes.create');\n }", "public function create()\n {\n $invoices = Invoice::all();\n $posts = Post::all();\n\n \treturn view('payment.create')\n ->with('invoices', $invoices)\n ->with('posts', $posts);\n }", "public function create()\n {\n return view('xyk_intros.create');\n }", "public function create()\n\t{\n\t\treturn view('paymentby_cashiers.create');\n\t}", "public function create()\n {\n return view('billing::create');\n }", "public function create()\n {\n return view('billing::create');\n }", "public function create()\n {\n $account = new AccountClient;\n return view('modules.organization.AccountClient.form', compact('account'));\n }", "public function create()\n {\n return view('console.cashier.create');\n }", "public function create()\n {\n return view('bankpayment::create');\n }", "public function create()\n {\n return view('pages.incomes.create');\n }", "public function create()\n {\n return view('cartas.cartaForm');\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 getCreate()\n\t{\n\t\treturn view('beneficios.create');\n\t}", "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 \"Formulário para cadastrar um novo cliente.\";\n }", "public function create()\n {\n return view('admin.beneficiary.create');\n\n }", "public function create()\n {\n return view('admin.enquiry.source.form');\n }", "public function create()\n {\n return view('admin.purchase.create');\n }", "public function create()\n {\n return view('encargo.create');\n }", "public function create() {\n\n return view('administrator.setting.contracts.add_contracts', compact(''));\n }", "public function create()\n {\n return view('backend.admin.medicine.create');\n }", "public function create()\n {\n return view('agreement.create');\n }", "public function create()\n {\n /* Bank CREATE page */\n return view('admin.bank.create');\n }", "public function create()\n {\n //\n return view('admin.incoterm.create');\n }" ]
[ "0.8165494", "0.78975517", "0.7853099", "0.78125614", "0.77934295", "0.7786572", "0.77713716", "0.7745887", "0.76940596", "0.76680434", "0.7588988", "0.7588815", "0.7548474", "0.75450647", "0.7509913", "0.7480226", "0.74457926", "0.7410227", "0.7383299", "0.73440427", "0.7305142", "0.7281267", "0.72611284", "0.7211181", "0.71883374", "0.71720934", "0.71366376", "0.7116148", "0.70445067", "0.7001982", "0.6995703", "0.6990902", "0.6918246", "0.6909272", "0.690705", "0.6890323", "0.68697906", "0.6869022", "0.68611854", "0.68519074", "0.68479085", "0.6829125", "0.68282366", "0.6827482", "0.6805044", "0.680405", "0.6795808", "0.6795494", "0.6751391", "0.6751024", "0.67490476", "0.670788", "0.66935426", "0.6691948", "0.6689183", "0.6688494", "0.66842794", "0.6680331", "0.66762847", "0.66611594", "0.6658987", "0.6650286", "0.66463464", "0.66343224", "0.66187096", "0.65999204", "0.6590842", "0.65853083", "0.6585164", "0.65836996", "0.6572694", "0.65688187", "0.6565824", "0.6561104", "0.6557793", "0.655646", "0.6552071", "0.65507466", "0.6544437", "0.65432096", "0.6542094", "0.6542094", "0.65361863", "0.6532733", "0.653025", "0.6521619", "0.6518891", "0.65165806", "0.6514501", "0.651302", "0.65128237", "0.6506721", "0.6504431", "0.64989656", "0.64930344", "0.6486761", "0.64803994", "0.64798474", "0.64751625", "0.64721376" ]
0.75119627
14
Store a newly created Invoice in storage.
public function store(StoreInvoicesRequest $request) { if (! Gate::allows('invoice_create')) { return abort(401); } $request = $this->saveFiles($request); $invoice = Invoice::create($request->all()); foreach ($request->input('files_id', []) as $index => $id) { $model = config('medialibrary.media_model'); $file = $model::find($id); $file->model_id = $invoice->id; $file->save(); } return redirect()->route('admin.invoices.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n {\n $allInputs = Input::all();\n\n $validator = Validator::make($allInputs, $this->invoicesModel->getRules('STORE'));\n\n if ($validator->fails()) {\n return Redirect::to('invoices/create')->with('message_danger', $validator->errors());\n } else {\n if ($invoice = $this->invoicesModel->insertRow($allInputs)) {\n $this->systemLogs->insertSystemLogs('Invoice has been add with id: '. $invoice, 200);\n return Redirect::to('invoices')->with('message_success', $this->language->getMessage('messages.SuccessInvoicesStore'));\n } else {\n return Redirect::back()->with('message_success', $this->language->getMessage('messages.ErrorInvoicesStore'));\n }\n }\n }", "public function store()\n\t{\n\t\t$invoice = $this->invoices->store();\n\n $inv_items = Input::get('invoice_items');\n foreach($inv_items as $item) {\n $prop = [\n 'invoice_id' => $invoice->id,\n 'description' => $item['description'],\n 'product_id' => $item['product']['id'],\n 'vat' => $item['vat'],\n 'quantity' => $item['quantity'],\n 'unit_price' => $item['product']['price']\n ];\n $this->invoice_items->store($prop);\n }\n return $invoice;\n\t}", "public function store(InvoiceRequest $request)\n\t{\n\t\t// Validate Form Data\n\t\t$validData = $request->validated();\n\n\t\t// Create Invoice\n\t\t$invoice = Invoice::create($validData);\n\n\t\t// Save the Invoice\n\t\t$invoice->save();\n\n\t\t// Set Notifications\n\t\tif (!$invoice->save()) {\n\t\t\ttoastr()->error('An error has occured please try again.', 'Abigail Says...');\n\t\t} else {\n\t\t\ttoastr()->success('The invoice was saved successfully!', 'Abigail Says...');\n\t\t}\n\n\t\t// Redirect\n\t\treturn redirect()->route('invoices.show', $invoice);\n\t}", "public function store(Request $request, Invoice $invoice)\n {\n }", "public function store(StoreInvoiceRequest $request)\n {\n $this->invoiceRepository->createOrUpdate($request);\n\n return redirect()->route('dashboard.module.booker.invoices.index');\n }", "public function store(StoreInvoicesRequest $request)\n {\n if (! Gate::allows('invoice_create')) {\n return abort(401);\n }\n $invoice = Invoice::create($request->all());\n\n return redirect()->route('invoices.index');\n }", "public function store(Request $request)\n {\n $invoice = new Invoice;\n $invoice->cust_id = isset($request->cust_id) && $request->cust_id ? $request->cust_id : null;\n $invoice->user_id = isset($request->user_id) && $request->user_id ? $request->user_id : null;\n $invoice->product_id = isset($request->product_id) && $request->product_id ? $request->product_id : null;\n $invoice->quantity = isset($request->quantity) && $request->quantity ? $request->quantity : null;\n $invoice->discount_percentage = isset($request->discount_percentage) && $request->discount_percentage ? $request->discount_percentage : null;\n $invoice->tax_percentage = isset($request->tax_percentage) && $request->tax_percentage ? $request->tax_percentage : null;\n $invoice->remarks = isset($request->remarks) && $request->remarks ? $request->remarks : null;\n $invoice->time = isset($request->time) && $request->time ? $request->time : null;\n $invoice->place = isset($request->place) && $request->place ? $request->place : null;\n $invoice->status = isset($request->status) && $request->status ? $request->status : null;\n $invoice->save();\n\n if($invoice){\n echo 'success';\n }else{\n echo 'error';\n }\n }", "public function store(InvoiceRequest $request): RedirectResponse\n {\n $invoice = new Invoice();\n\n $projectId = $request->input('project_id');\n\n $project = $request->user()->projects()->findOrFail($projectId);\n\n $storedPath = $this->storeReceipt($request);\n\n if ($storedPath) {\n $invoice->receipt = $storedPath;\n }\n\n $invoice->fill($request->all());\n $invoice->project()->associate($project);\n $invoice->save();\n\n MessagingHelper::flashCreated(\"invoice #{$invoice->number}\");\n\n return redirect()->route(\n 'project.show',\n [$projectId]\n );\n }", "public function createInvoice()\r\n {\r\n }", "public function store(Request $request)\n {\n //\n\n $this->validate($request, [\n 'invno' => 'required',\n ]);\n\n $input = $request->all();\n Invoice::create($input);\n return redirect('finance/invoice');\n }", "public function createInvoice(Invoice $invoice): Invoice;", "public function store(Request $request)\n {\n // dd($request->all());\n $invoice = new Invoice();\n $invoice->name = $request->title;\n $invoice->currency = $request->currency;\n $invoice->price = $request->price;\n $invoice->qty=$request->quantity;\n $invoice->email = $request->email;\n $invoice->name = $request->name;\n $invoice->country = $request->country;\n $invoice->city = $request->city;\n $invoice->state = $request->state;\n $invoice->zip = $request->zip;\n $invoice->address = $request->address;\n\n $isSave = $invoice->save();\n\n if($isSave){\n return redirect('custom-order/'.encrypt($invoice->id));\n }\n }", "public function store(StoreInvoiceRequest $storeInvoiceRequest): JsonResponse {\n $invoiceService = new InvoiceService();\n\n return $invoiceService->createInvoice($storeInvoiceRequest);\n }", "public function store(StoreInvoiceRequest $request)\n {\n foreach ($request->get('multiple_codes') as $key => $value) {\n if ($request->get('multiple_days')[$key] == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de días por llenar');\n return redirect()->back()->withInput();\n }\n if ($request->get('multiple_totals')[$key] == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de total por llenar');\n return redirect()->back()->withInput();\n }\n if ($value == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de autorización por llenar');\n return redirect()->back()->withInput();\n }\n }\n // dd($request->all());\n $invoice = Invoice::storeRecord($request);\n\n Session::flash('message', 'Factura '.$invoice->format_number.' guardada exitosamente');\n return redirect()->route('invoice.index');\n }", "public function store(Request $request)\n\t{\n $validator = Validator::make($request->all(), [\n 'valor' => 'required',\n 'data' => 'required',\n 'descricao' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n\n\t\t$invoice = new Invoice();\n\n\t\t$invoice->valor = $request->input(\"valor\");\n $invoice->data = Carbon::createFromFormat('d/m/Y', $request->input(\"data\"));\n $invoice->codigo = $request->input(\"codigo\");\n $invoice->descricao = $request->input(\"descricao\");\n\n\t\t$invoice->save();\n\n\t\treturn redirect()->route('invoices.index')->with('message', 'Item created successfully.');\n\t}", "public function store(Request $request)\n {\n $invoice = new Invoice();\n $invoice->invoiceno = request('invoiceno');\n $invoice->invoicedate = request('invoicedate');\n $invoice->customer = request('customer');\n $invoice->address = request('address');\n $invoice->description = request('description');\n $invoice->qty = request('qty');\n $invoice->amountjob = request('amountjob');\n $invoice->save();\n return response()->json($invoice);\n }", "public function store(Request $request)\n {\n \n $user = Auth::user();\n $business = $user->business;\n\n // $validator = Validator::make($request->all(), [\n // 'invoice_number' => 'required|numeric|integer',\n // 'invoice_date' => 'required|date',\n // 'due_date' => 'required|date|after:invoice_date',\n // 'currency' => 'in:eur,gbp,usd',\n // 'note' => 'nullable|string|max:1000',\n // ]);\n // if ($validator->fails()) {\n // return response()->json(['error' => 'Unauthorised - Validation failed', 'messages' => $validator->errors()], 422);\n // }\n\n //Create an Invoice\n $invoice = new Invoice;\n $latestInvoice = $business->outgoingInvoices()->orderBy('invoice_number', 'desc')->first();\n if (isset($latestInvoice)) {\n $invoice->invoice_number= $latestInvoice->invoice_number + 1;\n } else {\n $invoice->invoice_number=0;\n }\n $invoice->invoice_date = date('Y-m-d');\n $invoice->due_date = date('Y-m-d', strtotime(\"+1 day\"));\n $invoice->currency = 'eur';\n $invoice->status = 'draft';\n $invoice->draft_email = $request->user_email;\n $invoice->user_id = null;\n $invoice->business_id = $business->id;\n\n //Calculate total cost + adjust for stripe\n $invoice->total_cost = 0;\n foreach ($request->invoiceLines as $line) {\n $invoice->total_cost += $line['cost'] * ceil($line['sec'] / 60) * 100;\n }\n $invoice->save();\n\n //Attach each product as invoice item\n foreach ($request->invoiceLines as $line) {\n $invoiceItem = new InvoiceItems([\n 'name' => $line['name'],\n 'description' => $line['description'],\n 'cost' => $line['cost'] * 100,\n 'quantity' => ceil($line['sec'] / 60),\n 'sub_total' => $line['cost'] * ceil($line['sec'] / 60) * 100\n ]);\n if (isset($line['rate_unit'])) {\n $invoiceItem->rate_unit = $line['rate_unit'];\n }\n $invoice->invoiceItems()->save($invoiceItem);\n }\n return response()->json(200);\n }", "public function store(Request $request)\n {\n $invoice = $this->service->store($request->all());\n\n return redirect(route('invoice.index'))->with('success', 'Invoice created successfully!');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n\t\t'invoice_number'=>'required',\n\t\t'service_code'=>'required',\n\t\t'car_number'=>'required',\n\t\t'mobile'=>'required',\n\t\t'price'=>'required'\n\t\t]);\n\t\t$invoice=new invoice([\n\t\t'invoice_number'=>$request->get('invoice_number'),\n\t\t'service_code'=>$request->get('service_code'),\n\t\t'car_number'=>$request->get('car_number'),\n\t\t'mobile'=>$request->get('mobile'),\n\t\t'price'=>$request->get('price')\n\t\t]);\n\t\t$invoice->save();\n\t\treturn redirect()->route('invoice.create')->with('success','Data Added');\n }", "public function store(Request $request)\n {\n $invoice = new Invoice;\n $invoice->nama_invoice =$request->nama_invoice;\n $invoice->tgl_invoice =$request->tgl_invoice;\n $invoice->jenis_pembayaran =$request->jenis_pembayaran;\n $invoice->status =$request->status;\n $invoice->save();\n return redirect('/invoice');\n }", "public function store(Request $request)\n {\n //\n\n \n $s_invoice = request()->validate([\n \n 'name' => ['required'],\n 'amount' => ['required'],\n 'mobile_num' => ['required'],\n 'products' => ['required'],\n 'quantity' => ['required'],\n 'type' => ['required'],\n \n ]);\n \n \n auth()->user()->salesInvoice()->create($s_invoice);\n\n $pdf = PDF::loadView('dashboard.invoices.print-sale' , $s_invoice);\n return $pdf->stream();\n \n // SalesInvoice::create($s_invoice);\n \n return redirect('/dashboard/invoices/index');\n }", "public function store(Request $request)\n {\n //\n $this->validate($request, [\n 'kes_id' => 'required',\n 'user_id' => 'required',\n ]);\n // Create a Case\n $invoice = new Invoice;\n $invoice->kes_id = $request->input('kes_id');\n $invoice->user_id = $request->input('user_id');\n $invoice->save();\n return redirect('/invoices')->with('success', 'Invoice generated');\n }", "public function store(StoreInvoicesRequest $request)\n {\n\n \n if (! Gate::allows('invoice_create')) {\n return prepareBlockUserMessage();\n }\n\n $products_details = getProductDetails( $request );\n\n $tax_format = $request->tax_format;\n $discount_format = $request->discount_format;\n\n $products_details['discount_format'] = $discount_format;\n $products_details['tax_format'] = $tax_format;\n \n // These are product values.\n $grand_total = ! empty( $products_details['grand_total'] ) ? $products_details['grand_total'] : 0;\n $products_amount = ! empty( $products_details['products_amount'] ) ? $products_details['products_amount'] : 0;\n $total_tax = ! empty( $products_details['total_tax'] ) ? $products_details['total_tax'] : 0;\n $total_discount = ! empty( $products_details['total_discount'] ) ? $products_details['total_discount'] : 0;\n\n // Calculation of Cart Tax.\n $tax_id = $request->tax_id;\n $cart_tax = 0; \n if ( $tax_id > 0 ) {\n $invoice = new Invoice();\n $invoice->setTaxIdAttribute( $tax_id );\n $tax = $invoice->tax()->first();\n \n $rate = 0;\n $rate_type = 'percent';\n if ( $tax ) {\n $rate = $tax->rate;\n $rate_type = $tax->rate_type;\n }\n\n if ( $rate > 0 ) {\n if ( 'before_tax' === $tax_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $products_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $new_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n }\n }\n } \n }\n\n // Let us calculate Cart Discount\n $cart_discount = 0;\n $discount_id = $request->discount_id;\n if ( $discount_id > 0 ) {\n $invoice = new Invoice();\n $invoice->setDiscountIdAttribute( $discount_id );\n $discount = $invoice->discount()->first();\n \n $rate = 0;\n $rate_type = 'percent';\n if ( $discount ) {\n $rate = $discount->discount;\n $rate_type = $discount->discount_type;\n }\n if ( $rate > 0 ) {\n if ( 'before_tax' === $discount_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $products_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $new_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n }\n }\n } \n }\n $products_details['cart_tax'] = $cart_tax;\n $products_details['cart_discount'] = $cart_discount;\n $amount_payable = $grand_total + $cart_tax - $cart_discount;\n $products_details['amount_payable'] = $amount_payable;\n\n // if there are transactions for this customer. Currency selection may disable, so we need to get it from customer profile.\n $currency_id = $request->currency_id;\n if ( empty( $currency_id ) ) {\n $currency_id = getDefaultCurrency( 'id', $request->customer_id );\n }\n // If products module disabled! lets take amount from user input!!\n if ( empty( $amount_payable ) && $request->has('amount') ) {\n $amount_payable = $request->amount;\n }\n $addtional = array(\n 'products' => json_encode( $products_details ),\n 'amount' => $amount_payable,\n 'currency_id' => $currency_id,\n );\n\n $invoice_no = $request->invoice_no;\n if ( empty( $invoice_no ) ) {\n $invoice_no = getNextNumber();\n }\n \n $addtional['invoice_no'] = $invoice_no;\n\n $addtional['slug'] = md5(microtime() . rand());\n\n $addtional['created_by_id'] = Auth::User()->id;\n\n $request->request->add( $addtional ); //add additonal / Changed values to the request object.\n\n $date_set = getCurrentDateFormat();\n\n $additional = array( \n 'invoice_date' => ! empty( $request->invoice_date ) ? Carbon::createFromFormat($date_set, $request->invoice_date)->format('Y-m-d') : NULL,\n 'invoice_due_date' => ! empty( $request->invoice_due_date ) ? Carbon::createFromFormat($date_set, $request->invoice_due_date)->format('Y-m-d') : NULL,\n );\n $additional['invoice_number_format'] = getSetting( 'invoice-number-format', 'invoice-settings', 'numberbased' );\n $additional['invoice_number_separator'] = getSetting( 'invoice-number-separator', 'invoice-settings', '-' );\n $additional['invoice_number_length'] = getSetting( 'invoice-number-length', 'invoice-settings', '0' );\n $request->request->add( $additional );\n\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n }\n\n $invoice = Invoice::create($request->all());\n\n $products_sync = ! empty( $products_details['products_sync'] ) ? $products_details['products_sync'] : array();\n $invoice->invoice_products()->sync( $products_sync );\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-created', 'operation_type' => 'crud' ) );\n\n $invoice->allowed_paymodes()->sync(array_filter((array)$request->input('allowed_paymodes')));\n\n $customer = $invoice->customer()->first();\n if ( ! empty( $request->btnsavesend ) && $customer && 'Published' === $invoice->status ) {\n // Notification to user\n $logo = getSetting( 'site_logo', 'site_settings' );\n\n $templatedata = array(\n 'client_name' => $customer->name,\n 'content' => 'Invoice has been created',\n 'invoice_url' => route( 'admin.invoices.preview', [ 'slug' => $invoice->slug ] ),\n 'invoice_no' => $invoice->invoicenumberdisplay,\n 'invoice_amount' => digiCurrency($invoice->amount,$invoice->currency_id),\n 'invoice_date' => digiDate( $invoice->invoice_date ),\n 'invoice_due_date' => digiDate( $invoice->invoice_due_date ),\n 'title' => $invoice->title,\n 'address' => $invoice->address,\n 'reference' => $invoice->reference,\n 'invoice_notes' => $invoice->invoice_notes,\n 'customer_id' => $invoice->customer_id,\n 'currency_id' => $invoice->currency_id,\n 'tax_id' => $invoice->tax_id,\n 'discount_id' => $invoice->discount_id,\n 'paymentstatus' => $invoice->paymentstatus,\n 'created_by_id' => $invoice->created_by_id,\n\n\n 'site_address' => getSetting( 'site_address', 'site_settings'),\n 'site_phone' => getSetting( 'site_phone', 'site_settings'),\n 'site_email' => getSetting( 'contact_email', 'site_settings'), \n 'site_title' => getSetting( 'site_title', 'site_settings'),\n 'logo' => asset( 'uploads/settings/' . $logo ),\n 'date' => digiTodayDate(),\n 'site_url' => env('APP_URL'),\n );\n\n if ( $invoice->customer->name ) {\n $templatedata['customer_id'] = $invoice->customer->name;\n }\n \n if ( $invoice->currency->name ) {\n $templatedata['currency_id'] = $invoice->currency->name;\n }\n \n if ( $invoice->tax->name ) {\n $templatedata['tax_id'] = $invoice->tax->name;\n }\n \n if ( $invoice->discount->name ) {\n $data['discount_id'] = $invoice->discount->name;\n }\n\n $total_paid = \\Modules\\InvoicePayments\\Entities\\InvoicePayment::where('invoice_id', '=', $invoice->id)->where('payment_status', 'Success')->sum('amount');\n $amount_due = $invoice->amount - $total_paid; \n\n if( $amount_due ){\n $data['amount_due'] = $amount_due;\n } \n \n $createduser = \\App\\User::find( $invoice->created_by_id );\n if ( $createduser ) {\n $data['created_by_id'] = $createduser->name;\n }\n\n $data = [\n \"action\" => \"Created\",\n \"crud_name\" => \"User\",\n 'template' => 'invoice-created',\n 'model' => 'App\\Invoices',\n 'data' => $templatedata,\n ];\n $customer->notify(new QA_EmailNotification($data));\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-created', 'operation_type' => 'email' ) );\n }\n\n flashMessage( 'success', 'create');\n\n if ( ! empty( $request->btnsavemanage ) ) {\n return redirect( 'admin/invoices/' . $invoice->id );\n } else {\n return redirect()->route('admin.invoices.index');\n }\n }", "public function store(Request $req)\n {\n // return $req->input();\n\n $inv = new Invoice();\n $inv->business_id = \\business()->id;\n\n $contact = Contact::find($req->contact_id);\n\n $inv->contact_id = $contact->id;\n $inv->contact_name = $contact->name; //Contact::find($req->customer_id)->name;\n $inv->contact_email = $contact->email;\n $inv->contact_tax_number = $contact->tax_number;\n $inv->contact_phone = $contact->phone;\n $inv->contact_address = $contact->address;\n\n $inv->currency_code = $req->currency_code;\n $inv->currency_rate = 78;\n\n $inv->invoice_number = $req->invoice_number;\n $inv->order_number = $req->order_number;\n $inv->status = 'pending';\n $inv->invoiced_at = $req->invoice_date;\n $inv->due_at = $req->due_date;\n\n $inv->subtotal_amount = $req->subtotal_amount;\n $inv->discount_percent = $req->discount_percent;\n $inv->discount_amount = $req->discount_amount;\n $inv->total_tax_amt = $req->total_tax_amt;\n $inv->round_up = $req->round_up;\n $inv->total_amount = $req->total_amount;\n\n\n $inv->notes = $req->notes;\n $inv->footer = $req->footer;\n\n $inv->category_id = $req->category_id;\n $inv->save();\n\n // Invoice Items\n foreach($req->items as $item){\n $invItem = new InvoiceItem();\n $invItem->business_id = business()->id;\n $invItem->invoice_id = $inv->id;\n $invItem->item_id = $item['id'];\n $invItem->name = $item['name'];\n $invItem->quantity = $item['quantity'];\n $invItem->price = $item['price'];\n $invItem->taxprcnt = $item['taxprcnt'];\n $invItem->taxamt = $item['taxamt'];\n $invItem->total = $item['total'];\n $invItem->save();\n }\n // Invoice History\n $invHis = new InvoiceHistory();\n $invHis->business_id = business()->id;\n $invHis->invoice_id = $inv->id;\n $invHis->status_code = 'pending';\n $invHis->notify = 0;\n $invHis->description = 'Invoice No:'.$req->invoice_number.' is created...';\n $invHis->save();\n\n $req->session()->flash('status', 'Invoice Created..');\n\n return redirect()->route('admin.invoices.show', $inv->id);\n }", "public function store(Request $request)\n {\n\t\t$request->validate([\n\t\t\t'amount' => 'required',\n\t\t\t'invoice_id' => 'required',\n\t\t\t'payment_type' => 'required|max:255',\n\t\t]);\n\t\t\n\t\t$id=$request['edit_id'];\n\t\tunset($request['edit_id']);\n\t\t\n\t\t$invoice=PaymentLineItems::updateOrCreate(\n ['id' => $id],\n \t $request->all()\n\t\t);\n\t\treturn $invoice->id;\n }", "public function store(Request $request)\n {\n DB::beginTransaction();\n try {\n $request->validate([\n \"invoice_number\"=>\"required\",\n \"item_id\"=>\"required\",\n \"quantity\"=>\"required\"\n ]);\n\n $invoice_item=new InvoiceItem();\n $invoice=Invoice::where(\"invoice_number\",$request->invoice_number)->first();\n if(!$invoice){\n return back()->with(\"success\",\"This invoice number does not exits\");\n }\n $invoice_item->invoice_id=$invoice->id;\n $invoice_item->item_id=$request->item_id;\n $invoice_item->quantity=$request->quantity;\n $item=Item::find($request->item_id)->first();\n $invoice_item->price=$item->sale_price;\n $invoice_item->total=($invoice_item->price)*($invoice_item->quantity);\n $invoice_item->save();\n $amount=InvoiceItem::where(\"invoice_id\",$invoice_item->invoice_id)->count();\n $invoice=Invoice::find($invoice_item->invoice_id);\n $invoice->amount=$amount;\n $total=InvoiceItem::where(\"invoice_id\",$invoice_item->invoice_id)->sum(\"total\");\n $invoice->total=$total;\n $invoice->save();\n DB::commit();\n return back()->with(\"success\",\"The data has been inserted\");\n }catch (\\Exception $e){\n report($e);\n DB::rollback();\n return back()->with(\"success\",\"The data cannot insert\");\n }\n }", "public function store(Request $request)\n {\n $invoice = new Invoice();\n $invoice->user_id = $request->user()->id;\n $invoice->address = $request->address;\n $invoice->total = $request->total;\n $invoice->save();\n\n foreach($request->products as $product){\n $invoiceDetail = new InvodeDetail();\n $invoiceDetail->invoice_id = $invoice->id;\n $invoiceDetail->product_id = $product['id'];\n $invoiceDetail->qty = $product['qty'];\n $invoiceDetail->amount = $product['amount'];\n $invoiceDetail->save();\n }\n return response()->json(['message' => 'Order Sent','code' => 200]);\n }", "public function insert($shoppingcartInvoice);", "public function store(CreateinvoiceRequest $request)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n $input = $request->all();\n //return $input['helpmember'];\n //create invoice\n $invoice = $this->invoiceRepository->create($input);\n //get provinces\n $provinces = $this->invoiceRepository->provinces();\n\n if($input['account_type']==\"HELP\"){\n //store the members that needs help\n $this->insertHelpMembers($invoice->id, $input['helpmember']);\n }\n //send invoice to provinces\n $this->insertInvoiceProvince($invoice->id);\n \n Flash::success('Invoices sent to provinces successfully.');\n\n return redirect(route('invoices.index'));\n }", "public function store(StoreInvoice $request): ?JsonResponse\n {\n return $this->doStore($request);\n }", "public function store(Request $request)\n {\n \n $p_invoice = request()->validate([\n \n 'name' => ['required'],\n 'amount' => ['required'],\n 'mobile_num' => ['required'],\n 'products' => ['required'],\n 'quantity' => ['required'],\n 'type' => ['required'],\n \n ]);\n \n \n auth()->user()->purchasesInvoice()->create($p_invoice);\n\n $pdf = PDF::loadView('dashboard.invoices.print-purchase' , $p_invoice);\n return $pdf->stream();\n \n // PurchasesInvoice::create($p_invoice);\n \n return redirect('/dashboard/invoices/index');\n }", "public function store( InvoiceRequest $request ) {\n $currency = Option::where('title',Settings::get( 'currency' ))->where('category', 'currency')->first();\n\n foreach ( $request->get( 'user_id' ) as $user_id ) {\n\n\t\t\t$student = Student::where( 'user_id', $user_id )\n\t\t\t ->where( 'school_year_id', session( 'current_school_year' ) )\n\t\t\t ->where( 'school_id', '=', session( 'current_school' ) )\n\t\t\t ->first();\n\n\t\t\t$semester = $this->semesterRepository->getActiveForSchoolAndSchoolYear(session( 'current_school' ),\n session( 'current_school-year' ));\n\n if ( isset( $student->id ) && intval($request->get( 'amount' )) > 0) {\n $invoice = new Invoice($request->except('user_id', 'section_id', 'option_id', 'quantity'));\n $invoice->user_id = $user_id;\n $invoice->school_id = session('current_school');\n $invoice->school_year_id = session('current_school_year');\n $invoice->currency_id = $currency->id;\n $invoice->semester_id = isset($semester->id) ? $semester->id : 0;\n $invoice->total_fees = $request->get('amount');\n $invoice->fee_category_id = $request->get('fee_category_id');\n $invoice->save();\n\n\n if (!empty($request->get('option_id'))) {\n foreach ($request->get('option_id') as $key => $option_id) {\n InvoiceItem::create([\n 'option_id' => $option_id,\n 'invoice_id' => $invoice->id,\n 'quantity' => $request->get('quantity')[$key]\n ]);\n }\n }\n }\n\t\t}\n\n\t\treturn redirect( '/invoice' )->with( 'status', 'Invoice Applied Successfully!' );\n\t}", "public function store(Request $request)\n {\n if(!in_array(Auth::user()->role,['Admin']))\n return view('home')->with('message','You are not authorized for the page you tried to visit');\n // dd($request);\n DB::beginTransaction();\n $invoice = Validator::make($request->only(['customer_id','taxtype','invoice_no','pono','taxrate','remarks','user_id']),[\n 'invoice_no' => 'required',\n 'customer_id' => 'required',\n 'taxtype' => 'required',\n 'pono' => 'required',\n 'taxrate' => '',\n 'remarks' => '',\n 'user_id' => 'required'\n ]);\n\n if ($invoice->fails()) \n {\n DB::rollBack();\n return redirect('invoice/create')\n ->withErrors($invoice)\n ->withInput();\n }\n\n $invoicearray = $invoice->validate();\n $invno = Invoice::create($invoicearray);\n\n $invoicedetail = Validator::make($request->except(['customer_id','taxtype','invoice_no','pono','taxrate','remarks','user_id']), [\n 'product_id.*' => 'required',\n 'quantity.*' => 'required',\n 'unit_price.*' => 'required',\n 'remarks2.*' => ''\n ]);\n\n if ($invoicedetail->fails()) \n {\n DB::rollBack();\n return redirect('invoice/create')\n ->withErrors($invoicedetail)\n ->withInput();\n }\n $i = 0;\n while($v = array_column($invoicedetail->validate(), $i++))\n {\n // dd($v);\n $invd = [\n 'invoice_id'=>$invno->id,\n 'product_id'=>$v[0],\n 'quantity'=>$v[1],\n 'unit_price'=>$v[2],\n 'remarks' =>$v[3]\n ];\n \n InvoiceDetail::create($invd);\n }\n DB::commit();\n return redirect('invoice');\n //\n }", "public function store(Request $request)\n\t{\n\t\t$input = $request->all();\n\n\t\t$line = new InvoiceTemplate($input);\n\n\t\ttry{\n\t\t$line->save();\n\t\t}\n\t\tcatch(\\Exception $e){\n\t\t\treturn redirect()->back();\n\t\t}\n\t}", "public function store(Request $request)\n {\n $invoice = $this->service->save($request->all());\n\n $status = Response::HTTP_INTERNAL_SERVER_ERROR;\n $message = 'Invoice store failed';\n $recipient = $invoice->recipient()->first();\n \n if($invoice){\n $status = Response::HTTP_OK;\n $message = 'Invoice stored successfully';\n }\n\n return response()->json(compact('message','invoice','recipient'),$status);\n }", "public function store(Request $request)\n {\n \\Validator::make($request->all(), [\n 'kode_invoice' => 'required',\n ])->validate();\n\n $new_transaction = new \\App\\Transaction;\n $new_transaction->kode_invoice = $request->get('kode_invoice');\n $new_transaction->invoice_created = Carbon::now();\n $new_transaction->invoice_expire = Carbon::now()->addDays(5);\n $new_transaction->user_id = \\Auth::user()->id;\n $new_transaction->packet_id = $request->get('packet_id');\n $new_transaction->member_id = $request->get('member_id');\n $new_transaction->outlet_id = $request->get('outlet_id');\n\n\n $new_transaction->save();\n return redirect()->route('transactions.index')->with('success', 'Data invoice baru berhasil di tambahkan');\n }", "public function store(Request $request) {\n // Store method goes here\n\n return response()->json([\n \"message\" => \"Invoice has created successfully!\",\n \"status\" => \"success\",\n ], 200);\n }", "public function store(Request $request)\n {\n try {\n //\n $invoice = new invoice();\n $invoice->invoice_no = $request->invoice_no;\n $invoice->shop_id = $request->shop_id;\n $invoice->date = date('Y-m-d', strtotime($request->date));\n $invoice->status = '0';\n if ($invoice->save()) {\n\n for ($i = 0; $i < count($request->product_id); $i++) {\n $invoice_details = new Invoicedetail();\n $invoice_details->date = $request->date;\n $invoice_details->invoice_no = $invoice->id;\n $invoice_details->shop_id = $request->shop_id;\n $invoice_details->product_id = $request->product_id[$i];\n $invoice_details->selling_qty = $request->quantity[$i];\n $invoice_details->unit_price = $request->price[$i];\n $invoice_details->selling_price = $request->quantity[$i] * $request->price[$i];\n $invoice_details->status = '0';\n $invoice_details->save();\n\n\n }\n } else {\n\n }\n \n // Notification\n $notification = array(\n 'message' => 'Sell Added Successfully',\n 'alert-type' => 'success',\n );\n return redirect()->back()->with($notification);\n } catch (\\Exception $e) {\n // Notification\n $notification = array(\n 'message' => 'Try again',\n 'alert-type' => 'success',\n );\n return redirect()->back()->with($notification);\n }\n \n }", "public function store(Request $request)\n {\n $prod = Products::findOrFail($request->product_id);\n $validator = Validator::make($request->all(), [\n 'sub_total' => 'required|numeric',\n 'total' => 'required|numeric',\n 'product_id' => 'required|numeric',\n 'quantity_product_sold' => 'required|numeric|between:0,'.$prod->quantity,\n 'IVA' => 'required|numeric',\n ]);\n if($validator->fails()){\n return response()->json($validator->errors()->toJson(), 400);\n }\n $invoices = Invoices::create($validator->validated());\n \n\t\t$prod->quantity = ($prod->quantity - $request->quantity_product_sold);\n\t\t$prod->save();\n\t\t$total = Products_Invoices::create([\n\t\t\t'product_id' => $prod->id,\n\t\t\t'invoice_id' => $invoices->id,\n\t\t]);\n return response()->json([\n 'message' => 'Invoice successfully registered',\n 'producto' => $total\n ], 201);\n }", "public function store(Request $request)\n {\n\n $invoice = Invoice::create($request->invoice);\n for ($i = 0; $i < count($request->product); $i++) {\n if (isset($request->qty[$i]) && isset($request->price[$i])) {\n InvoiceItem::create([\n 'invoice_id' => $invoice->id,\n 'product_id' => $request->product[$i],\n 'quantity' => $request->qty[$i],\n 'price' => $request->price[$i]\n ]);\n }\n }\n\n return 'to be continued';\n }", "function create_invoice ($invoice) {\n global $sql;\n return $sql->sql_insert('invoice', $invoice);\n }", "public function store(Request $request)\n {\n\n //$data = $request;\n // save the invoicerecords temoporirily in $records array\n //$records = array();\n // if its a new invoice then we dont need to calculatie privious quantity\n\n $data = $request->only([\n 'customer_id', 'invoicestatus_id',\n 'amount', 'courier_id', 'subtotal', 'date',\n 'payment', 'discount', 'notes'\n ]);\n $invoice = Invoice::create($data);\n //array_push($records,);\n for ($i = 0; $i < sizeof($request->rows); $i++) {\n //return $request->rows[$i];\n // updating the product\n\n $product = Product::find($request->rows[$i]['id']);\n\n // subtracting the quantity from the products table\n $product->update([\"quantity\" => $product->quantity - $request->rows[$i][\"quantity\"]]);\n\n\n InvoiceRecord::create([\n \"products_id\" => $request->rows[$i][\"id\"],\n \"invoice_id\" => $invoice->id,\n \"quantity\" => $request->rows[$i][\"quantity\"],\n \"name\" => $request->rows[$i][\"name\"],\n \"price\" => $request->rows[$i]['price'],\n \"selling_price\" => $request->rows[$i][\"selling_price\"],\n ]);\n // array_push($records, [\n // \"products_id\" => $request->rows[$i][\"id\"],\n // \"invoice_id\" => $invoice->id,\n // \"quantity\" => $request->rows[$i][\"quantity\"],\n // \"name\" => $request->rows[$i][\"name\"],\n // \"price\" => $request->rows[$i]['price'],\n // \"selling_price\" => $request->rows[$i][\"selling_price\"],\n // ]);\n }\n\n // for updating invoice. we needto calculate previous quantity\n\n\n\n // creating new invoicerecords\n // //dd($records);\n // for ($i = 0; $i < sizeof($request->rows); $i++) {\n // InvoiceRecord::create($records[$i]);\n // }\n\n return route('invoices.edit', $invoice->id);\n }", "public function store(Request $request) {\n\n $this->validate($request, [\n 'estimate_id' => 'required|numeric'\n ]);\n\n $estimate = Estimate::find($request->estimate_id);\n\n $pre_invoice = Invoice::where('estimate_id', $request->estimate_id)->first();\n\n if (is_object($pre_invoice)) {\n $pre_invoice->update(['amount' => $estimate->estimate]);\n $invoice = $pre_invoice;\n }else{\n\n $createinvoice = Invoice::create(['user_id' => Auth::user()->id, 'issue_date' => $estimate->start, 'due_date' => $estimate->end, 'estimate_id' => $estimate->id, 'amount' => $estimate->estimate, 'currency_id' => $estimate->currency_id]);\n\n $invoice = $createinvoice;\n\n // $estimate->update(['invoice_id' => $createinvoice->id]);\n $estimate->project->update(['invoice_id' => $createinvoice->id]);\n }\n $createinvoice = Invoice::create(['user_id' => Auth::user()->id, 'issue_date' => $estimate->start, 'due_date' => $estimate->end, 'estimate_id' => $estimate->id, 'amount' => $estimate->estimate, 'currency_id' => $estimate->currency_id]);\n $invoice = Invoice::whereId($createinvoice->id)->with('estimate')->first();\n\n\n\n $invoice->estimate;\n // return $invoice;\n\n return view('invoices.reviewinvoice')->with('invoice', $invoice);\n }", "public function store(Request $request)\n {\n $requestData = $request->all();\n $billItems = $requestData['billItems'];\n $invoice = new Invoice;\n $invoice->products_count = count($billItems);\n $invoice->total = $requestData['billTotal'];\n $invoice->grand_total = $requestData['grandTotal'];\n $invoice->discount = $requestData['discAmt'];\n $invoice->discount_percent = $requestData['discPercent'];\n $invoice->type = $requestData['type'];\n $invoice->payment_mode = $requestData['paymentMode'];\n $invoice->recharge_amount = $requestData['rechargeAmt'];\n $invoice->save();\n\n $totalCost = 0;\n foreach ($billItems as $id => $item) {\n $product = Product::find($item['product_id']);\n $batch = Batch::find($item['batch_id']);\n $invoiceItem = new InvoiceItem;\n $invoiceItem->invoice_id = $invoice->id;\n $invoiceItem->product_id = $product->id;\n $invoiceItem->batch_id = $batch->id;\n $invoiceItem->name = $product->name;\n $invoiceItem->tax = $product->tax;\n $invoiceItem->mrp = $batch->mrp;\n $invoiceItem->avg_cost = $batch->avg_cost;\n $invoiceItem->qty = $item['qty'];\n $invoiceItem->row_total = $item['qty'] * $batch->mrp;\n $invoiceItem->type = 'sale';\n $invoiceItem->save();\n\n if ($batch->qty > $item['qty']) {\n $batch->qty -= $item['qty'];\n } else {\n $batch->qty = 0;\n }\n $batch->save();\n \n $totalCost += $item['qty'] * $batch->avg_cost;\n }\n $invoice->total_cost = $totalCost;\n $invoice->profit = $requestData['grandTotal'] - $totalCost;\n $invoice->save();\n $invoiceItems = [];\n $invoice->invoiceItems;\n $returnData = [\n 'invoice' => $invoice,\n ];\n\n return $returnData;\n }", "public function store(Request $request)\n {\n $sum_amount = 0;\n foreach ($request->amount as $key => $value) {\n $sum_amount += $value;\n }\n\n\n if($request->is_save_and_email == '1'){\n $last_email_date = Carbon::today()->format('Y-m-d');\n }else{\n $last_email_date = null;\n }\n\n if($request->is_paid == '1'){\n $is_paid = 1;\n }else{\n $is_paid = 0;\n }\n\n if (isset($request->is_autometic)) {\n $is_autometic = 1;\n }else{\n $is_autometic = 0;\n }\n\n $invoice = new Invoice;\n $invoice->user_id = $request->customer_id;\n $invoice->is_autometic = $is_autometic;\n $invoice->autometic_email_day = $request->autometic_email_day;\n $invoice->invoice_email = $request->invoice_email;\n $invoice->total_amount = $sum_amount;\n $invoice->is_paid = $is_paid;\n $invoice->last_email_date = $last_email_date;\n $invoice->save();\n\n foreach ($request->product_name as $key => $value) {\n $product = new Product;\n $product->invoice_id = $invoice->id;\n $product->user_id = $request->customer_id;\n $product->product_name = $value;\n $product->description = $request->description[$key];\n $product->amount = $request->amount[$key];\n $product->save();\n\n }\n\n $ref = date('y-m-d').'-'.mt_rand(1,1000);\n $billing_date = Carbon::today()->format('d/m/Y');\n $due_date = Carbon::today()->format('d/m/Y');\n\n if($request->is_save_and_email == '1'){\n $this->invoiceEmail($invoice->id);\n }\n\n return redirect('/home')->with('success', 'Sent Email Successfully!');\n }", "public function store(Request $request)\n {\n //\n\t\t$validated=$request->validate([\n\t\t\t'invoice_startmonth'=>'required|min:5',\n\t\t\t'invoice_endmonth'=>'required|min:5',\n\t\t\t'invoice_wordtrack'=>'required|min:2|regex:/(^([A-Z]+)(\\d+)?$)/u',\n\t\t\t'invoice_startnumber'=>'required|min:8',\n\t\t\t'invoice_endnumber'=>'required|min:8',\n\t\t\t'invoice_currentnumber'=>'required|min:8',\n\t\t]);\n\t\t\n\t\tInvoice::create($validated);\n\t\t\n\t\treturn redirect('invoice');\n }", "public function store($id,$tim)\n {\n $orderparticulars =[];\n $order=MainOrder::find($id);\n $orderparticulars = OrderParticular::where('orders_id',$id)->get();\n $amount_paid = 0.00;\n $co_ordinated_with = \"dummy\";\n $balance= $order->grand_total - $amount_paid;\n $invoice = new Invoice;\n $invoice->orderID = $order->id;\n $invoice->organizationID = $order->org_id;\n $invoice->organization_name = $order->organization_name;\n $invoice->enquiryID = $order->enqid_hidden;\n $invoice->propasalID = $order->proposalIDHidden;\n $invoice->entryLevel = $order->entryLevelHidden;\n $invoice->subtotal = $order->subtotal;\n \n $invoice->discount_amount = $order->discount_amount;\n $invoice->grand_total = $order->grand_total;\n $invoice->amount_paid = $amount_paid;\n $invoice->balance = $balance;\n $invoice->exp_date = $order->exp_date;\n $invoice->path =$tim;\n if($invoice->save()){\n foreach($orderparticulars as $value){\n $data = array(\n 'Product' => $value->products,\n 'qty' => $value->qty,\n 'price' => $value->price,\n 'igst' => $value->igst,\n 'cgst' => $value->cgst,\n 'sgst' => $value->sgst,\n 'discount' => $value->discount,\n 'product_total' =>$value->total,\n 'Co_ordinated_with' => $co_ordinated_with,\n 'invoice_id' => $invoice->id\n );\n \n InvoiceParticular::insert($data); \n }\n }\n \n \n return response()->json([\"success\"=>\"Invoice Created\"]);\n }", "public function store(Request $request)\n {\n $rcv = Rcv::where('kode_rcv',$request->kode_rcv)->first();\n $id_rcv = $rcv->id_rcv;\n $id_supplier = $rcv->id_supplier;\n $id_po = $rcv->id_po;\n\n $rcv->status_invoice = 'Sudah dibuat';\n $rcv->save();\n\n $invoice = InvoicePayable::create([\n 'id_rcv'=>$id_rcv,\n 'id_supplier'=>$id_supplier,\n 'id_jenis_transaksi'=>$request->id_jenis_transaksi,\n 'id_po' => $id_po,\n 'id_bengkel' => $request['id_bengkel'] = Auth::user()->id_bengkel\n\n \n ]);\n \n return $invoice;\n }", "public function store(Request $request)\n{\n$request->validate([\n'invoice_number' => ['required', 'unique:invoices'],\n'invoice_Date' => ['required'],\n'Due_date' => ['required'],\n'product' => ['required'],\n'section' => ['required'],\n'amount_collection' => ['required'],\n'discount' => ['required'],\n'value_vat' => ['required'],\n'Rate_VAT' => ['required'],\n]);\ninvoice::create([\n'invoice_number' => $request->invoice_number,\n'invoice_Date' => $request->invoice_Date,\n'Due_date' => $request->Due_date,\n'product' => $request->product,\n'section_id' => $request->section,\n'amount_collection' => $request->amount_collection,\n'amount_commission' => $request->amount_commission,\n'Discount' => $request->discount,\n'Value_VAT' => $request->value_vat,\n'Rate_VAT' => $request->Rate_VAT,\n'Total' => $request->total,\n'Status' => 'غير مدفوع',\n'Value_Status' => '2',\n'note' => $request->note,\n]);\n$invoiceId = invoice::latest()->first()->id;\ninvoice_details::create([\n'id_invoice' => $invoiceId,\n'invoice_number' => $request->invoice_number,\n'product' => $request->product,\n'section' => $request->section,\n'Status' => 'غير مدفوع',\n'Value_Status' => '2',\n'note' => $request->note,\n'user' => Auth::user()->name,\n]);\nif ($request->hasFile('pic')) {\n$invoiceId = invoice::latest()->first()->id;\n$file_name = $request->file('pic')->getClientOriginalName();\n\n$invoice_number = $request->invoice_number;\ninvoice_attachment::create([\n'invoice_number' => $invoice_number,\n'created_by' => Auth::user()->name,\n'invoice_id' => $invoiceId,\n'file_name' => $file_name,\n]);\n$request->pic->move(public_path('attachment/' . $invoice_number), $file_name);\n}\n\nsession()->flash('add', 'لقد تم تسجيل الفاتورة');\n\nreturn \\redirect('invoices');\n}", "public function store(Request $request)\n {\n $rules = [\n 'customer_name' => 'required',\n 'customer_phone' => 'required',\n 'customer_address' => 'required',\n 'delivery_date' => 'required',\n ];\n $this->validate($request, $rules);\n if(Cart::count() == 0)\n {\n return redirect()->back()->with('error', 'No product')->withInput($request->input());\n }\n\n $user = Auth::user();\n $shop_id = 1;\n $shop = $user->shop;\n if ($shop)\n $shop_id = $shop->id;\n\n //Generate invoice random id\n $invoice_id = str_random(12);\n // get unique REF ID id\n while ((Repair_invoice::where('invoice_id', $invoice_id)->count()) > 0) {\n $invoice_id = str_random(6);\n }\n $invoice_id = strtoupper($invoice_id);\n\n $total_price = Cart::total();\n\n $customer_name = $request->input('customer_name');\n $customer_email = $request->input('customer_email');\n $customer_phone = $request->input('customer_phone');\n $customer_address = $request->input('customer_address');\n $delivery_date = $request->input('delivery_date');\n $special_note = $request->input('special_note');\n\n\n $invoice_data = [\n 'shop_id' => $shop_id,\n 'user_id' => $user->id,\n 'invoice_id' => $invoice_id,\n 'total_price' => $total_price,\n 'customer_name' => $customer_name,\n 'customer_email' => $customer_email,\n 'customer_phone' => $customer_phone,\n 'customer_address' => $customer_address,\n 'delivery_date' => $delivery_date,\n 'special_note' => $special_note,\n 'status' => 'waiting'\n ];\n\n $invoice_create = Repair_invoice::create($invoice_data);\n\n //If invoice create success, then insert product items\n if($invoice_create)\n {\n foreach(Cart::content() as $row)\n {\n $invoice_item = [\n 'invoice_id' => $invoice_create->id,\n 'product_id' => $row->id,\n 'qty' => $row->qty,\n 'unit_price' => $row->price,\n 'unit_price_total' => $row->subtotal,\n 'status' => 'waiting'\n ];\n Repair_invoice_item::create($invoice_item);\n }\n //Now clear cart\n Cart::destroy();\n return redirect()->back()->with('success', 'Repair product added Success');\n }\n\n return redirect()->back()->with('error', 'Something went wrong, please try again');\n }", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public static function createNew(): Invoice {\n return new Invoice();\n }", "public function store(StoreInvoicesRequest $request, Jobcard $jobcard)\n {\n\n $data = $request->all();\n \n $data['rows'] = json_encode($request->rows);\n foreach($request->rows as $quotes) {\n if(isset($quotes['quotation_id'])){\n $jobcard::where('quote_id', $quotes['quotation_id'])\n ->update(['status' => 'Invoiced']);\n }\n }\n\n $invoice = $this->invoice->make($data);\n\n $data_saved = $this->invoice->save($invoice, $data);\n if($data_saved) {\n /*************** UPDATE JOBCARD ***************/\n\n \n }\n\n return $this->redirectResponse($request, __('alerts.backend.invoices.created'));\n }", "public function create()\n {\n JavaScript::put('invoice_id',(int)$this->service->getLastInsertId()+1);\n return view('admin.invoice.add',[\n 'invoice_id'=>((int)$this->service->getLastInsertId()+1),\n 'taxes' => Tax::all(),\n ]);\n }", "public function store()\n {\n $this->validate();\n\n $cliente = Cliente::create([\n 'sexo_id' => $this->sexo_id,\n 'cedula' => $this->cedula,\n 'nombre_primero' => $this->nombre_primero,\n 'nombre_segundo' => $this->nombre_segundo,\n 'apellido_paterno' => $this->apellido_paterno,\n 'apellido_materno' => $this->apellido_materno,\n 'direccion' => $this->direccion,\n 'correo' => $this->correo,\n 'telefono' => $this->telefono,\n 'fecha_nacimiento' => $this->fecha_nacimiento,\n 'deuda' => $this->deuda,\n ]);\n\n $this->resetInput();\n $this->accion = 1;\n }", "public function store(Request $request, $banyak)\n {\n //\n $request->validate([\n 'kode'=>'required',\n 'harga'=> 'required|integer',\n ]);\n $purchaseInvoice = new PurchaseInvoice([\n 'kode' => $request->get('kode'),\n 'harga'=> $request->get('harga'),\n ]);\n $purchaseInvoice->save();\n $counter = $banyak;\n $totalHarga = 0 ;\n for($i = 1;$i<= $counter; $i++){\n $boolean = isset($request['nama'.$i]) && $request['nama'.$i] != null\n && isset($request['harga'.$i]) && $request['harga'.$i] != null\n && isset($request['jumlah'.$i]) && $request['jumlah'.$i] != null; \n if(!$boolean) continue;\n $diskon = 0 ;\n $harga = (int)$request['harga'.$i];\n $jumlah = (int)$request['jumlah'.$i];\n if(!$request['diskon'.$i]){\n $diskon = 0 ;\n }else{\n \n $diskon = (int)$request['diskon'.$i];\n\n }\n $total = ($harga*$jumlah)-$diskon;\n $data1 = [\n \"nama\" => $request['nama'.$i],\n \"harga\" => $request['harga'.$i],\n \"jumlah\" => $request['jumlah'.$i],\n \"diskon\" => $diskon,\n \"purchase_invoices_id\" => $purchaseInvoice->id,\n \"totalHarga\"=>$total,\n ];\n $totalHarga += $total;\n $purchaseInvoiceItems = PurchaseInvoiceItems::create($data1); \n }\n $purchaseInvoice->harga = $totalHarga ;\n $purchaseInvoice->save();\n return redirect('/invoices')->with('success', 'Invoice has been added');\n }", "public function store(Request $request)\n {\n try {\n DB::beginTransaction();\n\n $salesInvoice = SalesInvoice::create(array(\n 'deci_amount_paid' => $request->deci_amount_paid,\n 'int_user_id_fk' => Auth::user()->id,\n 'str_remarks' => $request->str_remarks\n ));\n\n foreach($request->products as $product) {\n SalesInvoiceDetail::create(array(\n 'int_sales_invoice_id_fk' => $salesInvoice->int_sales_invoice_id,\n 'int_product_id_fk' => $product['int_product_id'],\n 'int_price_id_fk' => $product['int_price_id'],\n 'int_quantity' => $product['int_quantity']\n ));\n\n // Update stock (decrease)\n $inventory = Inventory::where('int_product_id_fk', '=', (int) $product['int_product_id'])\n ->orderBy('created_at', 'desc')\n ->first();\n\n Inventory::create(array(\n 'int_branch_id_fk' => $inventory->int_branch_id_fk,\n 'int_product_id_fk' => $inventory->int_product_id_fk,\n 'int_prev_value' => $inventory->int_current_value,\n 'int_current_value' => $inventory->int_current_value - (int) $product['int_quantity'],\n 'bool_is_consigned' => $inventory->bool_is_consigned,\n 'int_user_id_fk' => $inventory->int_user_id_fk,\n 'int_sales_invoice_id_fk' => $inventory->int_sales_invoice_id_fk\n ));\n }\n\n DB::commit();\n return response()\n ->json(\n array(\n 'message' => 'Transaction successful.'\n ),\n 201\n );\n\n } catch(Exception $ex) {\n DB::rollBack();\n }\n }", "public function store(Request $request)\n {\n request()->validate([\n 'totalinvoiceamount' => 'required',\n 'invoice_no' => 'required',\n 'invoice_date' => 'required',\n ]);\n $rec = $request->all();\n $date=date_create($rec['invoice_date']);\n $format = date_format($date,\"Y-m-d\");\n $rec['invoice_date'] = strtotime($format);\n $date2=date_create($rec['receiptdt']);\n $format2 = date_format($date2,\"Y-m-d\");\n $rec['receiptdt'] = strtotime($format2);\n\t\t\n ImportInvoice::create($rec);\n return redirect()->route('importinvoice.index')\n ->with('success','importinvoice added successfully.');\n }", "protected function saveInvoice()\n {\n $this->logging->addDebug(__METHOD__ . '|1|');\n if (!$this->forceInvoice) {\n if (!$this->order->canInvoice() || $this->order->hasInvoices()) {\n $this->logging->addDebug('Order can not be invoiced');\n //throw new \\Buckaroo\\Magento2\\Exception(__('Order can not be invoiced'));\n return false;\n }\n }\n\n $this->logging->addDebug(__METHOD__ . '|5|');\n\n /**\n * Only when the order can be invoiced and has not been invoiced before.\n */\n\n if (!$this->isGroupTransactionInfoType()) {\n $this->addTransactionData();\n }\n\n /**\n * @var \\Magento\\Sales\\Model\\Order\\Payment $payment\n */\n $payment = $this->order->getPayment();\n\n $invoiceAmount = 0;\n if (!empty($this->postData['brq_amount'])) {\n $invoiceAmount = floatval($this->postData['brq_amount']);\n }\n if (($payment->getMethod() == Giftcards::PAYMENT_METHOD_CODE)\n && $invoiceAmount != $this->order->getGrandTotal()\n ) {\n $this->setReceivedPaymentFromBuckaroo();\n\n $payment->registerCaptureNotification($invoiceAmount, true);\n $payment->save();\n\n $receivedPaymentsArray = $payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS);\n\n if (!is_array($receivedPaymentsArray)) {\n return;\n }\n\n $payment->capture(); //creates invoice\n $payment->save();\n } elseif ($this->isPayPerEmailB2BModePushInitial) {\n $this->logging->addDebug(__METHOD__ . '|10|');\n $invoice = $this->order->prepareInvoice()->register();\n $invoice->setOrder($this->order);\n $this->order->addRelatedObject($invoice);\n $payment->setCreatedInvoice($invoice);\n $payment->setShouldCloseParentTransaction(true);\n } else {\n $this->logging->addDebug(__METHOD__ . '|15|');\n //Fix for suspected fraud when the order currency does not match with the payment's currency\n $amount = ($payment->isSameCurrency()\n && $payment->isCaptureFinal($this->order->getGrandTotal())) ?\n $this->order->getGrandTotal() : $this->order->getBaseTotalDue();\n $payment->registerCaptureNotification($amount);\n $payment->save();\n }\n\n $this->logging->addDebug(__METHOD__ . '|20|');\n\n $transactionKey = $this->getTransactionKey();\n\n if (strlen($transactionKey) <= 0) {\n return true;\n }\n\n $this->logging->addDebug(__METHOD__ . '|25|');\n\n /** @var \\Magento\\Sales\\Model\\Order\\Invoice $invoice */\n foreach ($this->order->getInvoiceCollection() as $invoice) {\n $invoice->setTransactionId($transactionKey)->save();\n\n if (!empty($this->postData['brq_invoicenumber'])) {\n if ($this->groupTransaction->isGroupTransaction($this->postData['brq_invoicenumber'])) {\n $this->logging->addDebug(__METHOD__ . '|27|');\n $invoice->setState(2);\n }\n }\n\n if (!$invoice->getEmailSent() && $this->configAccount->getInvoiceEmail($this->order->getStore())) {\n $this->logging->addDebug(__METHOD__ . '|30|sendinvoiceemail');\n $this->invoiceSender->send($invoice, true);\n }\n }\n\n $this->logging->addDebug(__METHOD__ . '|35|');\n\n $this->order->setIsInProcess(true);\n $this->order->save();\n\n $this->dontSaveOrderUponSuccessPush = true;\n\n return true;\n }", "public function store(Request $request) {\n\n $user = Auth::user();\n $contasController = new ContasController();\n $investimento = new Investment;\n\n $lucro = $request->input('lucro');\n $valor = $request->input('valor');\n $tipo_investimento = $request->input('tipo');\n $conta_id = $request->input('conta_id');\n\n $novoRequest = $request;\n\n if($lucro > 0)\n $novoRequest->replace(['tipo' => 'E', 'valor' => $lucro, 'conta_id' => $conta_id]);\n else\n $novoRequest->replace(['tipo' => 'S', 'valor' => $lucro*-1, 'conta_id' => $conta_id]);\n\n $investimento_id = $this->gerarInvestimentoId($user);\n $transacao = $contasController->storeTransacao($request);\n\n $investimento->user_id = $user->user_id;\n $investimento->trans_id = $transacao->trans_id;\n $investimento->investimento_id = $investimento_id;\n $investimento->tipo_investimento = $tipo_investimento;\n $investimento->valor = $valor;\n $investimento->lucro = $lucro;\n\n $investimento->save();\n }", "public function store(Request $request)\n {\n DB::beginTransaction();\n\n try {\n \n $invoice = IdGenerator::generate([\n 'table' => 'transactions',\n 'length' => 10,\n 'prefix' => 'INV-',\n 'field' => 'invoice'\n ]);\n\n Transaction::create([\n 'id' => Request()->id,\n 'invoice' => $invoice,\n 'user_id' => Auth()->id(),\n 'jumlah_tiket' => Request()->jumlah_tiket\n ]);\n\n TransactionDetail::create([\n 'id' => Request()->id,\n 'invoice' => $invoice,\n 'film_id' => Request()->film_id\n ]);\n\n DB::commit();\n } catch (\\Throwable $th) {\n DB::rollBack();\n return redirect()->back()->with('error', 'Terdapat kesalahan, data telah di Rollback!');\n }\n return redirect('order');\n }", "public function _add()\n {\n $type_code = post_param_string('type_code');\n $object = find_product($type_code);\n\n $amount = post_param_string('amount', '');\n if ($amount == '') {\n $products = $object->get_products(false, $type_code);\n $amount = $products[$type_code][1];\n if ($amount == '?') {\n warn_exit(do_lang_tempcode('INVOICE_REQUIRED_AMOUNT'));\n }\n }\n\n $to = post_param_string('to');\n $member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($to);\n if (is_null($member_id)) {\n warn_exit(do_lang_tempcode('_MEMBER_NO_EXIST', escape_html($to)));\n }\n\n $id = $GLOBALS['SITE_DB']->query_insert('invoices', array(\n 'i_type_code' => $type_code,\n 'i_member_id' => $member_id,\n 'i_state' => 'new',\n 'i_amount' => $amount,\n 'i_special' => post_param_string('special'),\n 'i_time' => time(),\n 'i_note' => post_param_string('note')\n ), true);\n\n log_it('CREATE_INVOICE', strval($id), $type_code);\n\n send_invoice_notification($member_id, $id);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'outstanding'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function handle(InvoiceCreated $event)\r\n {\r\n $this->invoiceCalculate->calculate($event->invoice);\r\n\r\n // Increment the next id.\r\n Group::incrementNextId($event->invoice);\r\n\r\n // Create the custom invoice record.\r\n $event->invoice->custom()->save(new InvoiceCustom());\r\n }", "public function store()\n {\n $v = Validator::make(Input::all(),\n [\n 'finalproductname' => 'required',\n 'finalproductdescription' => 'required',\n 'finalpriceperperson' => 'required',\n 'finalselectedmembers' => 'min:1'\n\n ]\n );\n\n if (!$v->passes()) {\n return Response::json(['errors' => $v->errors()]);\n } else {\n $currentmonth = InvoiceGroup::getCurrentMonth()->id;\n $invoiceproduct = new InvoiceProduct();\n $invoiceproduct->name = Input::get('finalproductname');\n $invoiceproduct->invoice_group_id = $currentmonth;\n $invoiceproduct->save();\n\n $invoiceproductprice = new InvoiceProductPrice();\n $invoiceproductprice->invoice_product_id = $invoiceproduct->id;\n $invoiceproductprice->price = Input::get('finalpriceperperson');\n $invoiceproductprice->description = Input::get('finalproductdescription');\n $invoiceproductprice->save();\n\n $i = 0;\n foreach (Input::get('member') as $m) {\n $invoiceline = new InvoiceLine();\n $invoiceline->invoice_product_price_id = $invoiceproductprice->id;\n $invoiceline->member_id = $m;\n $invoiceline->save();\n if ($invoiceline->exists) {\n $i++;\n }\n }\n\n return Response::json(['success' => true, 'message' => $invoiceproduct->name . ' Successfully added, '\n . $invoiceproductprice->price . ' per person.'\n . $i . ' Total persons' ]);\n }\n }", "public function create(Request $request) {\n $data = $request->all();\n $invoice = $this->service\n ->store($data);\n return response()->json($invoice);\n }", "public function store(PurchaseFormRequest $request)\n {\n try{\n\n DB::beginTransaction();\n\n $purchase=new Purchase;\n $purchase->provider_id = $request->get('provider_id');\n $purchase->document_type = $request->get('document_type');\n $purchase->document_serie = $request->get('document_serie');\n $purchase->document_no = $request->get('document_no');\n \n $mytime = Carbon::now('America/Guatemala');\n $purchase->date = $mytime->toDateTimeString();\n $purchase->isActive = '1';\n $purchase->save();\n\n $product_id = $request->get('product_id');\n $quantity = $request->get('quantity');\n $purchase_price = $request->get('purchase_price');\n $sale_price = $request->get('sale_price');\n\n $cont = 0;\n\n while($cont < count($product_id)){\n $detalle = new PurchaseDetail();\n $detalle->purchase_id = $purchase->id; \n $detalle->product_id = $product_id[$cont];\n $detalle->quantity = $quantity[$cont];\n $detalle->purchase_price = $purchase_price[$cont];\n $detalle->sale_price = $sale_price[$cont];\n $detalle->save();\n $cont = $cont + 1; \n }\n\n DB::commit();\n\n }catch(\\Exception $e)\n {\n DB::rollback();\n }\n\n return redirect('/compras')->with('status', 'Compra registrada de forma correcta!');\n }", "public function createinvoiceAction() {\n\t\t$request = Zend_Controller_Front::getInstance ()->getRequest ();\n\t\tif (is_numeric ( $request->id )) {\n\t\t\t$invoiceID = Invoices::Create ( $request->id );\n\t\t\tif (is_numeric ( $invoiceID )) {\n\t\t\t\tInvoices::setInvoice ( $request->id, $invoiceID );\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'The task requested has been executed successfully.' ), 'status' => 'success' ) );\n\t\t\t} else {\n\t\t\t\t$this->_helper->redirector ( 'edit', 'invoices', 'admin', array ('id' => $request->id, 'mex' => $this->translator->translate ( 'An invoice already exists for this order.' ), 'status' => 'danger' ) );\n\t\t\t}\n\t\t}\n\t}", "public function store(Request $request)\n {\n //validation\n $messages = array(\n 'purchase_date.required' => 'Date is Required.',\n 'quantity.required' => 'Quantity is Required.',\n 'product_id.required' => 'Product Name is Required.',\n );\n $this->validate($request, array(\n 'purchase_date' => 'required',\n 'quantity' => 'required|numeric',\n 'product_id' => 'required', \n ),$messages);\n\n // store in the database\n $purchase = new Purchase;\n\n $purchase->purchase_date = $request->purchase_date;\n $purchase->product_id = $request->product_id;\n $purchase->quantity = $request->quantity;\n $purchase->invoice_no = $request->invoice_no;\n\n $purchase->save();\n\n //save the purchase as store\n $store = new Store;\n\n $store->purchase_date = $request->purchase_date;\n $store->product_id = $request->product_id;\n $store->quantity = $request->quantity;\n\n $store->save();\n\n $product = Product::find($request->product_id);\n $product->product_stock = $product->product_stock + $request->quantity;\n $product->save();\n\n return redirect('/purchase')->with('status', 'New Purchase Has Been Added !');\n }", "public function store(Request $request,CustomerInvoiceEmail $customerInvoiceEmail)\n {\n $returnID=0;\n $ex=$customerInvoiceEmail::where('email',$request->email)\n ->where('invoice_id',$request->invoiceID)\n ->count();\n if($ex==0)\n {\n $tab=new CustomerInvoiceEmail;\n $tab->name=$request->name;\n $tab->email=$request->email;\n $tab->invoice_id=$request->invoiceID;\n $tab->store_id=$this->sdc->storeID();\n $tab->created_by=$this->sdc->UserID();\n $tab->save();\n $returnID=$tab->id;\n }\n\n $this->sdc->log(\"customer\",\"Customer invoice account created.\");\n\n return $returnID;\n \n }", "public function insertOrder(Request $request){\n\n $invoice = new tblInvoices;\n\n $invoice->cust_id = $request->input('cust_id');\n $invoice->amount = $request->input('amount');\n $invoice->discount = $request->input('discount');\n $invoice->final_amount = $request->input('final_amount');\n $invoice->branch_id = $request->input('branch_id');\n $invoice->offer_id - $request->input('offer_id');\n\n\n $invoice->save();\n $invoice->id;\n\n $insertedId = $invoice->id;\n\n $order = new tblOrder;\n $order->all->branch_id = $request->input('branch_id');\n $order->all->cust_id = $request->input('cust_id');\n $order->all->invoice_id = $insertedId;\n $order->item_name = $request->\n $order -> save();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'total' => 'required|min:0',\n 'id_discount' => 'numeric'\n ]);\n $id_order = 'Orders-00001';\n $cek_order = Order::find($id_order);\n if($cek_order){\n $cek_order = Order::select('id')->orderBy('created_at','desc')->first();\n $id_order = $cek_order->id;\n $id_order++;\n }\n\n $order = new Order([\n 'id' => $id_order,\n 'total' => $request->get('total'),\n 'id_discount' => $request->get('id_discount'),\n ]);\n $order->save();\n return new OrderInsertResource($order);\n\n\n }", "public function store(Request $request)\n\t{\n\t\t$this->validate($request, [\n\t\t\t\t'item_id' => 'required', \n\t\t\t\t'unit_count'=>'required|numeric|max:5000|min:1', \n\t\t\t\t'selling_price'=>'required|numeric',\n\t\t\t\t'payable'=>'required|numeric',\n\t\t\t\t'unit_price'=>'required|numeric',\n\t\t\t\t'unit_price_with_tax'=>'numeric',\n\t\t\t\t'selling_price'=>'required|numeric',\n\t\t\t\t'paid_price'=>'numeric',\n\t\t\t\t'invoice_ref'=>'required|max:32',\n\t\t\t\t'remarks'=>'max:255',\n\t\t\t\t\n\t\t],\n\t\t\t\t['unit_count.required'=>'Quantity Is Required',\n\t\t\t\t\t\t'unit_count.numeric'=>'Quantity should only be in numbers',\n\t\t\t\t\t\t'unit_count.max'=>'Quantity cannot be grater than 5000',\n\t\t\t\t\t\t'unit_count.min'=>'Quantity cannot be less than 1',\n\t\t\t\t\t\t'item_id.required'=>'Please select item first',\n\t\t\t\t]);\n\t\t\n\t\t$item_id = $request->item_id;\n\t\t$selling_price = $request->selling_price;\n\t\t$supplier_id = $request->supplier_id;\n\t\t$unit_count = $request->unit_count;\n\n\t\t$purchases = Purchases::create($request->all());\n\t\t$purchase_id = $purchases->id;\n\n\t\t$this->setInventory($item_id, $selling_price, $supplier_id, $unit_count, $purchase_id);\n\t\t\n\t\tInventories::insert($this->inventory);\n\t\t\n\t\t//payment voucher insert\n\t\t\t$pv_count = Paymentvouchers::where('invoice_ref',$request->invoice_ref)->count();\n\t\t\tif($pv_count==0){\n\t\t\t\tPaymentvouchers::create(['invoice_ref'=>$request->invoice_ref,\n\t\t\t\t\t\t'payment'=>$request->paid_price, 'type'=>0, 'bank_name'=>'', \n\t\t\t\t\t\t'cheque_no'=>'', 'payment_date'=>$request->purchase_date]);\n\t\t\t}elseif($request->paid_price>0){\n\t\t\t\tPaymentvouchers::create(['invoice_ref'=>$request->invoice_ref,\n\t\t\t\t\t\t'payment'=>$request->paid_price, 'type'=>0, 'bank_name'=>'', \n\t\t\t\t\t\t'cheque_no'=>'', 'payment_date'=>$request->purchase_date]);\n\t\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$queryTransact = new QueryTransact();\n\t\t$queryTransact->stockAdded($item_id, $unit_count);\n\t\treturn redirect('purchase');\n\t}", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function addNewQuotation(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editQuotationInvoiceWlg', ['id'=>$id]);\n\n }", "public function persistir(ProductoInventario $productoInventario);", "public function store(Request $request)\n {\n \n /* Note: please try improving the code below if possible for production */\n //------------------------------------------------------------------------//\n\n\n //Finding the requested item for the order \n $item = Item::findOrFail( request('item_id') );\n \n //Getting the Quanitiy & customer's name\n $qty = request('qty');\n $customer_name = request('customer_name');\n $total = $item->price * $qty; //Calculating the total\n \n // Checks if the order is already paid for or not\n if(request('paid') == null) $paid=0;\n else $paid = 1;\n\n //getting the first Order line object (if any)\n $first = Order_line::orderBy('id', 'desc')->first();\n \n //Checking whether our table is empty or has record \n if($first == null) $order_line = 1;\n else $order_line = $first->id + 1 ; \n\n //Inserting the new order to the database\n Order::create([\n \"customer_name\" => $customer_name,\n \"price\" => $item->price,\n \"order_lines_id\" => $order_line,\n \"paid\" => $paid\n ]);\n\n //Retrevieng the last order for the order ID\n $order_id = Order::orderBy('id', 'desc')->first()->id;\n\n //Inserting the orderLine\n Order_line::create([\n 'id' => $order_line,\n 'order_id' => $order_id,\n 'item_id' => $item->id,\n 'price' => $total,\n 'qty' => $qty\n ]);\n\n // Returning back to the index page\n return redirect('orders');\n }", "public function store(Request $request)\n {\n //invoice handling\n $invoice = new Invoice();\n $invoice->customer_id = $request->input('customer_id');\n $invoice->customer_name = $request->input('customer_name');\n $invoice->save();\n\n //invoice items (tool handling)\n $invoiceitems = $request->input(['invoiceitems']);\n $itemsToReturn = [];//this will be used simply to return all items to the frontend, as part of the OK response\n foreach ($invoiceitems as $tool) {\n $invoiceitem = new Invoiceitem();\n $invoiceitem->invoice_id = $invoice->id;\n $invoiceitem->customer_name = $request->input('customer_name');\n $invoiceitem->model = $tool['model'];\n $invoiceitem->tool_id = $tool['id'];\n $invoiceitem->price = $tool['price'];//because $item is an associative array now... 'price' is the key, and example 2200 is the value\n $invoiceitem->taken = Carbon::now();\n $invoiceitem->save();\n $itemsToReturn[] = $invoiceitem;\n //setting tools onStock to false\n $tool = Tool::find($invoiceitem->tool_id);\n $tool->onStock = false;\n $tool->save();\n $tools[] = $tool;\n }\n return response()->json([\n 0 => $invoice, \n 1 => $itemsToReturn,\n 2 => $tools\n ]);\n }", "public function add_to_invoice() {\n $mockInvoiceId = $this->input->post( 'mockInvoiceId' );\n // Array storing entry id's to do a bulk update with the mock invoice details\n $entryArray = [];\n\n\n // If there is no invoice id then a new invoice needs to be created.\n if ( $mockInvoiceId == '' ) {\n // Store the jobId as an array to pass to the save function\n $data = array(\n 'jobId' => $this->input->post( 'jobId' )\n );\n // Create the new invoice\n $mockInvoiceId = $this->mockinvoice_model->save( $data );\n\n // Store the mockInvoiceId as an array to pass to the save function\n $data = array(\n 'mockInvoiceId' => $mockInvoiceId\n );\n // Create a blank invoice row ready for initial input\n $this->mockinvoice_row_model->save( $data );\n }\n\n // Update all the entries with the mock invoice details\n $this->timesheet_entry_model->set_mock_invoice_details( $mockInvoiceId, array( $this->input->post( 'entries' ) ) );\n\n\n // Return the data that was passed via $_POST, but with the invoice number if a new one was created\n $invoiceArray[] = array( 'mockInvoiceId' => $mockInvoiceId, 'entries' => $this->input->post( 'entries' ), 'jobId' => $this->input->post( 'jobId' ) );\n\n // Send back the POST details as JSON\n $this->json_library->print_array_json_unless_empty( $invoiceArray );\n\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'customer' => 'required',\n 'total' => 'required',\n 'itemdetail.*' => 'required',\n 'qty.*' => 'required',\n ]);\n\n $order = $this->model->create([\n 'user_id' => auth()->user()->id,\n 'customer' => $request->customer,\n 'total' => $request->total,\n ]);\n\n for ($i = 0; $i < count($request->itemdetail); $i++) {\n $order->orderDetails()->create([\n 'item_detail_id' => $request->itemdetail[$i],\n 'qty' => $request->qty[$i],\n 'sub_total' => $request->subtotal[$i],\n ]);\n $detail = ItemDetail::with('ingredients')->find($request->itemdetail[$i]);\n foreach ($detail->ingredients as $key => $ingredient) {\n $usedIngredient = Ingredient::find($ingredient->id);\n $stock = $ingredient->stock;\n $used = $ingredient->pivot->amount_ingredient * $request->qty[$i];\n $nowStock = $stock - $used;\n $usedIngredient->update(['stock' => $nowStock]);\n // dd($ingredient->stock);\n };\n // dd($detail->ingredients->first()->id);\n };\n\n return redirect($this->redirect);\n }", "public function store(Request $request)\n {\n $enquiry_no = Enquiry::count()+1;\n $request['item_stock'] = json_encode($request->get('item_stock'));\n $request['item_asset'] = json_encode($request->get('item_asset'));\n $request['supplier_id'] = json_encode($request->get('supplier_id'));\n $request['item_service'] = json_encode($request->get('item_service'));\n $request['enquiry_no'] = 'RFQ00'.$enquiry_no;\n $enquiry = Enquiry::create($request->all());\n return response()->json(new EnquiryResource($enquiry));\n }", "public function createProfessionalInvoice(Request $request)\n { \n $user = User::where('email', $request->input('email'))->first();\n if(!$user){\n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'phone'=>'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users'\n ]);\n\n if ($validator->fails()){\n return redirect()->back()->withErrors($validator)->withInput();\n } \n\n $user = User::create([\n 'firstname' => $request->input('firstname'),\n 'lastname' => $request->input('lastname'),\n 'phone' => $request->input('phone'),\n 'email' => $request->input('email'),\n 'password' => bcrypt('123456'),\n 'user_type' => 'personal',\n 'account_balance' => 0.00, \n ]);\n }\n\n $invoice = new Invoice();\n $invoice->sender_id = Auth::user()->id;\n $invoice->recipient_id = $user->id;\n $invoice->invoice_no = Keygen::numeric(6)->generate();\n $invoice->note = $request->input('note');\n $invoice->secret_key = str_random(8);//md5(microtime())\n $invoice->amount = $request->input('amount');\n $invoice->invoice_type = 'one-off';\n $invoice->offline_ref_code = Keygen::numeric(15)->generate();\n\n if ($request->hasFile('photo')) {\n $randomKey = sha1(time() . microtime());\n $extension = $request->file('photo')->getClientOriginalExtension();\n $fileName = $randomKey . '.' . $extension;\n\n $destinationPath = public_path() . '/images/uploads/invoices/';\n // Check if the folder exists on upload, create it if it doesn't\n if (!is_dir(public_path('/images/uploads/invoices/'))) {\n $this->fs->makeDirectory(public_path('/images/uploads/invoices/'), 0777, true);\n }\n //Move the photo to a temporary path\n $upload_success = $request->file('photo')->move($destinationPath, $fileName);\n \n if ($upload_success) {\n $invoice->photo = $fileName;\n }\n }\n $invoice->save();\n \n return redirect()->route('invoice.show.single', ['invoice'=>$invoice->uuid]);\n }", "public function addNewInvoice(Request $request, $id){\n $ids = Auth::user()->id;\n $user = User::find($ids);\n\n $firstName = $user->first_name;\n $lastName = $user->last_name;\n\n $name = $firstName.\" \".$lastName;\n\n $addNewInvoice = new WlgCorporationInvoice([\n 'user_id'=>$user->id,\n 'if_id'=>$id,\n 'number_of_goods'=>$request->get('no'),\n 'description_of_goods'=>$request->get('descGoods'),\n 'qty'=>$request->get('qty'),\n 'unit_price'=>$request->get('unitPrice'),\n 'total_amount'=>$request->get('totalAmount'),\n 'created_by'=>$name,\n ]);\n\n $addNewInvoice->save();\n Session::flash('successAdd', 'Successfully added');\n\n return redirect()->route('editInvoiceWlg', ['id'=>$id]);\n\n }", "protected function save(): void\n {\n if ($this->connection == 'database') {\n $this->cart->each(\n function ($item) {\n if ($cart = $this->storage->has($item['id'])) {\n $cart->update(\n [\n 'rowId' => $item['id'],\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n } else {\n $this->storage->create(\n [\n 'rowId' => $item['id'],\n 'user_id' => $this->user->id,\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n }\n }\n );\n } elseif ($this->sessionStatus) {\n $this->storage->put([$this->instanceName => $this->cart]);\n }\n }", "public function store(Request $request)\n {\n $ingredientsupplyorder = new IngredientSupplyOrder;\n $ingredientsupplyorder->supplyorder_id = $request->supplyorder_id;\n $ingredientsupplyorder->ingredient_id = $request->Ingredient;\n $ingredientsupplyorder->quantity = $request->Quantity;\n $ingredientsupplyorder->save();\n\n $ingredient = Ingredient::find($ingredientsupplyorder->ingredient_id);\n\n Activity::log('Added ' . $ingredient->name . ' to the supply order.');\n\n return Redirect::back()->with('status','Supply order updated!');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'description' => 'required|string',\n 'quantity' => 'required|numeric',\n ]);\n\n $data = $request->all();\n\n $item = new Item;\n $item->name = $data['name'];\n $item->description = $data['description'];\n $item->quantity = $data['quantity'];\n $item->save();\n\n $inventory = new Inventory;\n $inventory->item_id = $item->id;\n $inventory->shelf = $data['shelf'];\n $inventory->level = $data['level'];\n $inventory->user_id = $data['user_id'];\n $inventory->date_in = $data['date_in'];\n $inventory->date_out = $data['date_out'];\n $inventory->save();\n\n return redirect('/transpage');\n }", "public function create()\n {\n $data = [];\n $data['menu'] = 'sales';\n if (isset($_GET['type']) && $_GET['type'] == 'project') {\n if (!(Project::where('id', $_GET['project_id'])->exists())) {\n abort(404);\n }\n if (!empty($_GET['customer_id'])) {\n if (!(Customer::where('id', $_GET['customer_id'])->exists()) || (!(Project::where('id', $_GET['project_id'])->exists()) && !(Customer::where('id', $_GET['customer_id'])->exists()))) {\n abort(404);\n }\n }\n $data['menu'] = 'project';\n $data['project_id'] = $_GET['project_id'];\n $data['customer_id'] = $_GET['customer_id'];\n $data['projects'] = Project::all();\n }\n $data['sub_menu'] = 'sales/direct-invoice';\n $data['page_title'] = __('Create Invoice');\n $data['url'] = 'invoice/list';\n\n $data['customerData'] = Customer::with(['currency:id,name,symbol'])->where(['is_active' => 1])->get();\n\n $data['countries'] = Country::getAll();\n $data['currencies'] = Currency::getAll();\n $data['paymentTerms'] = PaymentTerm::getAll();\n $data['locations'] = Location::getAll()->where('is_active', 1);\n $data['salesType'] = SaleType::select('sale_type', 'id')->get();\n\n $invoice_count = SaleOrder::where('transaction_type', 'SALESINVOICE')->count();\n\n if ($invoice_count > 0) {\n $invoiceReference = SaleOrder::where('transaction_type', 'SALESINVOICE')\n ->latest('id')\n ->first(['reference']);\n $ref = explode(\"-\", $invoiceReference->reference);\n $data['invoice_count'] = (int)$ref[1];\n } else {\n $data['invoice_count'] = 0;\n }\n\n $taxTypeList = TaxType::getAll();\n $data['taxes'] = json_encode($taxTypeList);\n $taxOptions = '';\n $selectStart = \"<select name='item_tax[]' class='inputTax form-control bootstrap-select selectpicker' multiple>\";\n $selectEnd = \"</select>\";\n\n $selectStartCustom = \"<select class='inputTax form-control bootstrap-select selectpicker' multiple name='custom_item_tax[1][]'>\";\n $selectEndCustom = \"</select>\";\n $taxHiddenField = \"\";\n\n foreach ($taxTypeList as $key => $value) {\n $taxHiddenField.=\"<input type='hidden' class='itemTaxAmount itemTaxAmount-\".$value->id.\"'>\";\n $taxOptions .= \"<option title='\" . $value->tax_rate . \"%' value='\" . $value->id . \"' taxrate='\" . $value->tax_rate . \"'>\" . $value->name . '(' . $value->tax_rate . ')' . \"</option>\";\n }\n $data['tax_type'] = $selectStart . $taxOptions . $selectEnd;\n $data['custom_tax_type'] = $selectStartCustom . $taxOptions . $selectEndCustom . $taxHiddenField;\n $data['projects'] = Project::where('customer_id', '!=', 0)->get();\n $preference = Preference::getAll()->pluck('value', 'field')->toArray();\n $data['exchange_rate_decimal_digits'] = $preference['exchange_rate_decimal_digits'];\n\n return view('admin.invoice.add', $data);\n }", "public function store(Request $request)\n {\n if($request->tipo==null){\n return back()->with('error','Debe ingresar un tipo de incidente');; \n }\n $incidente = new Incidente;\n $incidente->nombre=$request->get('nombre');\n $incidente->detalle=$request->get('detalle');\n $incidente->estado= 'Pendiente'; //pendiente enproceso finalizado\n $incidente->caracter=$request->get('caracter');\n $incidente->reporter_id=Auth::user()->id;\n $incidente->tipo_id=$request->get('tipo');\n\n \n\n if($request->file('file')){\n $imagenOriginal = $request->file('file');\n $nombre = $imagenOriginal->getClientOriginalName();\n $path = Storage::putFileAs('Imagenes', $imagenOriginal, $nombre);\n \n\n $incidente->imagen= 'app/'.$path ;\n }\n\n $incidente->save();\n\n $detalleInci = new DetalleDeIncidente;\n $detalleInci->incidente_id = $incidente->id;\n $detalleInci->send_id = Auth::user()->id;\n $detalleInci->sector_id = $request->get('sector');\n $detalleInci->estado = 'Enviado';\n $detalleInci->observaciones = 'Incidente reportado';\n $detalleInci->save();\n return redirect()->route('incidente.index')->with('success','incidente creado correctamente');\n }", "public function create()\n {\n if (! Gate::allows('invoice_create')) {\n return abort(401);\n }\n \n $users = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $projects = \\App\\Project::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $expense_types = \\App\\ExpenseType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $meetings = \\App\\Meeting::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $contingencies = \\App\\Contingency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $providers = \\App\\Provider::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $service_types = \\App\\ServiceType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $pms = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $finances = \\App\\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n return view('admin.invoices.create', compact('users', 'projects', 'expense_types', 'meetings', 'contingencies', 'providers', 'service_types', 'pms', 'finances'));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'nombre' => 'required|string',\n 'apellido' => 'required|string',\n 'fecha' => 'required',\n 'user_id' => 'required|integer'\n ]);\n\n try {\n DB::beginTransaction();\n\n $venta = new Venta();\n $venta->nombre = $request->nombre;\n $venta->apellido = $request->apellido;\n $venta->fecha = Carbon::parse($request->fecha)->format('Y-m-d');\n $venta->decuento = $request->descuento;\n $venta->total = $request->total;\n $venta->user_id = $request->user_id;\n $venta->operador_id = $request->operador_id;\n\n $venta->save();\n\n $productos = $request->productos ? $request->productos : [];\n // $venta->productos()->sync($productos);\n foreach($productos as $p){\n $venta->productos()->attach(1,['producto_id'=>$p[0], 'cantidad' =>$p[1], 'sub_total' =>$p[2]]);\n $this->descontarStock($p[0],$p[1]);\n }\n DB::commit();\n\n return response()->json([\n 'mensaje' => 'La venta se guardo exitosamente',\n 'categoria' => new VentaResource($venta)\n ], Response::HTTP_CREATED);\n\n } catch (\\Illuminate\\Database\\QueryException $e) {\n DB::rollBack();\n\n response()->json([\n 'mensaje' => 'Error al guardar, consulte al Administrador' . $e,\n ], Response::HTTP_FORBIDDEN);\n }\n }", "public function actionCreateInvoice() {\n // Create Record with Pending status, the status will turn to Ready as\n // soon as all jobs are retrieved, marked as send, and the invoice\n // is uploaded to S3. The record is being auto created if an instance \n // oh InvoiceHistoryB is not provided to method getInstance()\n $invoiceComponent = InvoiceComponent::getInstance();\n \n // Get data provider\n $data = $this->getData();\n if($data === false || empty($data)) {\n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array('no-selection' => 1,)));\n }\n \n // Make data provider\n $dataProvider = new CArrayDataProvider($data, array(\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']),\n ),\n ));\n // Update file name to include client name\n $invoiceComponent->setClientData($data[0]->project->client);\n \n // Export to xlsx document.\n $gridViewExcelWriter = $this->widget('GridViewExcelWriter', array(\n 'dataProvider' => $dataProvider,\n 'clearDollarSign' => false,\n 'title' => 'EExcelWriter',\n 'stream' => false,\n 'fileName' => 'invoice-exported-at.' . date('d.m.Y', time()) . '.xlsx',\n 'columns' => require(YiiBase::getPathOfAlias('billing.views.invoice._invoice_grid_columns').'.php'),\n ));\n // Upload the file to S3\n if($invoiceComponent->save($gridViewExcelWriter->getTempFileContent())) {\n // Mark invoice as ready\n $invoiceComponent->markInvoiceAsReady();\n \n // Contains all project ids\n $projectIds = array();\n // Mark project children items as sent\n foreach($data as $item) {\n // Collect project ids\n $projectIds[$item->project_id] = $item->project_id;\n // Item is either ProjectJobB or ProjectExtraServiceB\n $item->markAsSent();\n }\n // Mark all those projects as sent\n ProjectB::model()->manageInvoiceStatus($projectIds);\n \n // Redirect back to dashboard page with flag of no selection\n $this->redirect($this->createUrl('billingDashboard/index', array(\n 'activeTab' => 'Invoice_History',\n )));\n }\n }", "public function createBasicInvoice(Request $request)\n { \n $user = User::where('email', $request->input('email'))->first();\n \n if(!$user){ \n\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'phone'=>'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users'\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n } \n\n $user = User::create([\n 'firstname' => $request->input('firstname'),\n 'lastname' => $request->input('lastname'),\n 'phone' => $request->input('phone'),\n 'email' => $request->input('email'),\n 'password' => bcrypt('123456'),\n 'user_type' => 'personal',\n 'account_balance' => 0.00, \n ]);\n }\n\n $invoice = new Invoice();\n $invoice->sender_id = Auth::user()->id;\n $invoice->invoice_no = Keygen::numeric(6)->generate();\n $invoice->note = $request->input('note');\n $invoice->secret_key = str_random(8);//md5(microtime())\n $invoice->recipient_id = $user->id;\n $invoice->amount = $request->input('amount');\n $invoice->invoice_type = 'basic';\n $invoice->offline_ref_code = Keygen::numeric(15)->generate();\n\n if ($request->hasFile('photo')) {\n $randomKey = sha1(time() . microtime());\n $extension = $request->file('photo')->getClientOriginalExtension();\n $fileName = $randomKey . '.' . $extension;\n\n $destinationPath = public_path() . '/images/uploads/invoices/';\n // Check if the folder exists on upload, create it if it doesn't\n if (!is_dir(public_path('/images/uploads/invoices/'))) {\n $this->fs->makeDirectory(public_path('/images/uploads/invoices/'), 0777, true);\n }\n //Move the photo to a temporary path\n $upload_success = $request->file('photo')->move($destinationPath, $fileName);\n \n if ($upload_success) {\n $invoice->photo = $fileName;\n }\n }\n\n $invoice->save();\n \n return redirect()->route('invoice.show.preview', ['invoice'=>$invoice->uuid]);\n }", "public function createMilestoneInvoice(Request $request)\n { \n $user = User::where('email', $request->input('email'))->first();\n if(!$user){\n $validator = Validator::make($request->all(), [\n 'firstname' => 'required|string|max:255',\n 'lastname' => 'required|string|max:255',\n 'phone'=>'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users'\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();\n } \n $user = User::create([\n 'firstname' => $request->input('firstname'),\n 'lastname' => $request->input('lastname'),\n 'phone' => $request->input('phone'),\n 'email' => $request->input('email'),\n 'password' => bcrypt('123456'),\n 'user_type' => 'personal',\n 'account_balance' => 0.00, \n ]);\n }\n\n $invoice = new Invoice();\n $invoice->sender_id = Auth::user()->id;\n $invoice->recipient_id = $user->id;\n $invoice->invoice_no = Keygen::numeric(6)->generate();\n $invoice->note = $request->input('note');\n $invoice->secret_key = str_random(8);//md5(microtime())\n $invoice->amount = $request->input('amount');\n $invoice->invoice_type = 'milestone';\n $invoice->offline_ref_code = Keygen::numeric(15)->generate();\n\n if ($request->hasFile('photo')) {\n $randomKey = sha1(time() . microtime());\n $extension = $request->file('photo')->getClientOriginalExtension();\n $fileName = $randomKey . '.' . $extension;\n\n $destinationPath = public_path() . '/images/uploads/invoices/';\n // Check if the folder exists on upload, create it if it doesn't\n if (!is_dir(public_path('/images/uploads/invoices/'))) {\n $this->fs->makeDirectory(public_path('/images/uploads/invoices/'), 0777, true);\n }\n //Move the photo to a temporary path\n $upload_success = $request->file('photo')->move($destinationPath, $fileName);\n \n if ($upload_success) {\n $invoice->photo = $fileName;\n }\n }\n $invoice->save();\n \n // Session::flash('flash_message', 'Invoice successfully created!');\n return redirect()->route('invoice.show.set-milestones', ['invoice'=>$invoice->uuid]);\n }", "public function store(Request $request)\n {\n if (Auth::user()->canCadastrarInventario()) {\n $this->validate($request, [\n 'estoque_id' => ['required', new ValidInventario, new ValidInventarioItem]\n ]);\n\n try {\n DB::beginTransaction();\n $inventario = new Inventario($request->all());\n \n if ($inventario->save()) {\n $estoque = Estoque::find($inventario->estoque_id);\n \n if ($request->produto_id) {\n $produtos = $estoque->produtos()->where('produtos.id', $request->produto_id)->get();\n } elseif ($request->grupo_produto_id) {\n $produtos = $estoque->produtos()->where('produtos.grupo_produto_id', $request->grupo_produto_id)->get();\n } else {\n $produtos = $estoque->produtos()->get();\n }\n\n foreach ($produtos as $produto) {\n $items[] = [\n 'produto_id' => $produto->id,\n 'qtd_estoque' => $estoque->saldo_produto($produto)\n ]; \n }\n\n $inventario->inventario_items()->createMany($items);\n\n DB::commit();\n\n Session::flash('success', __('messages.create_success', [\n 'model' => 'inventario',\n 'name' => $inventario->id\n ]));\n\n return redirect()->action('InventarioController@index');\n } else {\n throw new \\Exception(__('messages.create_error', [\n 'model' => 'inventario',\n 'name' => $inventario->id\n ]));\n } \n } catch (\\Exception $e) {\n DB::rollback();\n Session::flash('error', __('messages.exception', [\n 'exception' => $e->getMessage()\n ]));\n return redirect()->back()->withInput();\n }\n } else {\n Session::flash('error', __('messages.access_denied'));\n return redirect()->back();\n }\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'product_id' => 'required',\n 'invoice_id' => 'required',\n 'qty' => 'required',\n 'price' => 'required',\n 'discount' => 'required',\n 'total' => 'required',\n ]);\n if ($validator->fails()) {\n return redirect('payment/create')\n ->withInput()\n ->withErrors($validator);\n }\n\n $payment = new Payment();\n $payment->product_id = $request->product_id;\n $payment->invoice_id = $request->invoice_id;\n $payment->qty = $request->qty;\n $payment->price = $request->price;\n $payment->discount = $request->discount;\n $payment->total = $request->total;\n $payment->save();\n\n Session::flash('payment_create','New Payment is Created');\n return redirect('payment/create');\n }", "public function store(Request $request)\n {\n try {\n $otra_provision = new DocumentToPay();\n $otra_provision->periodo_id = Session::get('period_id');\n $otra_provision->unegocio_id = 1;\n $otra_provision->fechaproceso = $request->processdate;\n $otra_provision->sucursal_id = $request->subsidiary;\n $otra_provision->origen = $request->type;\n $otra_provision->tercero_id = $request->customer;\n $otra_provision->tipotransaccion_id = $request->transactiontype;\n $otra_provision->moneda_id = $request->currency;\n $moneda = Currency::findOrfail($request->currency);\n if ($moneda->tipo == 'O') {\n $otra_provision->tcmoneda = $request->txt_tc;\n } else {\n $otra_provision->tcmoneda = 0;\n }\n $otra_provision->documento_id = $request->documenttype;\n $otra_provision->seriedoc = $request->series;\n $otra_provision->numerodoc = $request->number;\n $otra_provision->fechadoc = $request->date;\n $otra_provision->tcambio = $request->changerate;\n $otra_provision->condicionpago_id = $request->paymentcondition;\n $otra_provision->vencimiento = $request->expdatea;\n $otra_provision->glosa = $request->comment;\n $otra_provision->total = $request->total;\n $otra_provision->ventana = $this->ventana;\n $tercero = Customer::findOrfail($request->customer);\n $otra_provision->razonsocial = $tercero->descripcion;\n $otra_provision->ruc = $tercero->codigo;\n $otra_provision->direccion = $request->address;\n $otra_provision->usuario = Auth::id();\n $otra_provision->estado = 1;\n\n DB::transaction(function () use ($otra_provision, $request) {\n $otra_provision->save();\n if ($request->paymentway != null) {\n $this->insertar_docbanco($otra_provision->id, $request);\n }\n });\n\n $r[\"estado\"] = \"ok\";\n $r[\"mensaje\"] = \"Grabado Correctamente\";\n\n } catch (PDOException $e) {\n $r[\"estado\"] = \"error\";\n $r[\"mensaje\"] = \"Error al Grabar!\";\n $r[\"bd\"] = $e->getMessage();\n }\n\n $r[\"proceso\"] = $request->proceso;\n\n return $r;\n }", "public function store(InterestStoreRequest $request)\n {\n $attributes = array_merge(\n $request->all(), [\n 'user_id' => auth()->id(),\n ]);\n\n if (Interest::create($attributes)) {\n return redirect()\n ->route('admin.interest.index')\n ->with('status', \"New Interest '{$request->title}' has been created successfully!\");\n }\n\n return back()\n ->withInput();\n }", "public function store(Request $request)\n {\n if (Auth::user()->can('add-invoice')) {\n // New Invoice\n $invoice = new Invoice();\n $data = $request->only(['photographer_id', 'start', 'end', 'note']);\n $data['user_id'] = Auth::id();\n $invoice->fill($data);\n $option_id = $request->input('options');\n $photographer = User::find($request->input('photographer_id'));\n // check if photographer exists\n if ($photographer && $photographer->can('be-hired')) {\n // Check working time conflict\n $tmp_1 = $photographer->toInvoices()->whereDate('start', '<=' , $invoice->start)->whereDate('end', '>=', $invoice->start)->get()->toArray();\n $tmp_2 = $photographer->toInvoices()->whereDate('start', '<=', $invoice->end)->whereDate('end', '>=', $invoice->end)->get()->toArray();\n $tmp = array_merge($tmp_1, $tmp_2);\n if ($tmp) {\n $message = 'Photographer has been hired from '.$tmp[1]['start'].' to '.$tmp[1]['end'];\n return Response::json(['message' => $message], 422);\n }\n } else {\n return Response::json(['message' => 'This is not a photographer account'], 422);\n }\n // Check option belongs to photographer\n $subtotal = 0;\n $option_info = Array();\n foreach($option_id as $key) {\n $option = Option::find($key);\n if ($photographer->options->contains('id', $key)) {\n $subtotal += $option->price;\n $option_info[$key] = ['option_name' => $option->name, 'price' => $option->price];\n continue;\n }\n return Response::json(['message' => 'Option does not exist'], 404);\n }\n $invoice->fill(['subtotal' => $subtotal]);\n $total = $subtotal;\n // Check coupon\n if ($request->has('coupon_code')) {\n // Check if coupon is valid (not expired)\n $coupon = Coupon::whereCode($request->input('coupon_code'))->whereDate('start_date', '<=', Carbon::now())->whereDate('end_date', '>=', Carbon::now())->first();\n if ($coupon) {\n $invoice->fill(['coupon_id' => $coupon->id]);\n $total -= $subtotal*$coupon->offer;\n } else {\n return Response::json(['message' => 'Coupon has been expired or invalid'], 404);\n }\n }\n $invoice->fill(['total' => $total]);\n if ($invoice->save()) {\n $invoice->options()->sync($option_info);\n return Response::json(['message' => 'Your invoice has been created']);\n }\n return Response::json(['message' => 'Something went wrong'], 422);\n }\n return Response::json(['message' => 'Permission denied'], 401);\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Customerinvoiceline::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCustomerinvoiceline::create($data);\n\n\t\treturn Redirect::route('customerinvoicelines.index');\n\t}", "public function store()\n\t{\n\t\t//receipt\n\t\t$number = $this->sanitizeString(Input::get('number'));\n\t\t$ponumber = $this->sanitizeString(Input::get('ponumber'));\n\t\t$podate = $this->sanitizeString(Input::get('podate'));\n\t\t$invoicedate = $this->sanitizeString(Input::get('invoicedate'));\n\t\t$invoicenumber = $this->sanitizeString(Input::get('invoicenumber'));\n\t\t$fundcode = $this->sanitizeString(Input::get('fundcode'));\n\n\t\t$validator = Validator::make([\n\t\t\t\t'Property Acknowledgement Receipt' => $number,\n\t\t\t\t'Purchase Order Number' => $ponumber,\n\t\t\t\t'Purchase Order Date' => $podate,\n\t\t\t\t'Invoice Number' => $invoicenumber,\n\t\t\t\t'Invoice Date' => $invoicedate,\n\t\t\t\t'Fund Code' => $fundcode\n\t\t\t],Receipt::$rules);\n\n\t\tif($validator->fails())\n\t\t{\n\t\t\treturn redirect('inventory/item/create')\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validator);\n\t\t}\n\n\t\t//inventory\n\t\t$brand = $this->sanitizeString(Input::get('brand'));\n\t\t$itemtype = $this->sanitizeString(Input::get('itemtype'));\n\t\t$model = $this->sanitizeString(Input::get('model'));\n\t\t$quantity = $this->sanitizeString(Input::get('quantity'));\n\t\t$unit = $this->sanitizeString(Input::get('unit'));\n\t\t$warranty = $this->sanitizeString(Input::get('warranty'));\n\t\t$details = $this->sanitizeString(Input::get('details'));\n\n\t\t//validator\n\t\t$validator = Validator::make([\n\t\t\t\t'Item Type' => $itemtype,\n\t\t\t\t'Brand' => $brand,\n\t\t\t\t'Model' => $model,\n\t\t\t\t'Details' => $details,\n\t\t\t\t'Warranty' => $warranty,\n\t\t\t\t'Unit' => $unit,\n\t\t\t\t'Quantity' => $quantity,\n\t\t\t\t'Profiled Items' => 0\n\t\t\t],Inventory::$rules);\n\n\t\tif($validator->fails())\n\t\t{\n\t\t\treturn redirect('inventory/item/create')\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validator);\n\t\t}\n\n\t\t$inventory = Inventory::createRecord([\n\t\t\t'brand' => $brand,\n\t\t\t'itemtype' => $itemtype,\n\t\t\t'model' => $model,\n\t\t\t'quantity' => $quantity,\n\t\t\t'unit' => $unit,\n\t\t\t'warranty' => $warranty,\n\t\t\t'details' => $details\n\t\t],[\n\t\t\t'number' => $number,\n\t\t\t'ponumber' => $ponumber,\n\t\t\t'podate' => $podate,\n\t\t\t'invoicenumber' => $invoicenumber,\n\t\t\t'invoicedate' => $invoicedate,\n\t\t\t'fundcode' => $fundcode\n\t\t]);\n\n\t\tif(Input::has('redirect-profiling'))\n\t\t{\n\t\t\treturn redirect(\"item/profile/create?id=$inventory->id\");\n\t\t}\n\n\t\tSession::flash('success-message','Items added to Inventory');\n\t\treturn redirect('inventory/item');\n\t}", "public function store(Request $request)\n {\n\n $cliente = Cliente::find($request->input('id_cliente'));\n $iniciales = Auth::user()->initials;\n $asesor = Auth::user()->name;\n $id_user =Auth::user()->id;\n $fecha = Carbon::today()->toDateString();\n $correlativo = Cotizacion::count() + 1;\n\n $inicialesCliente = CotizacionController::getInitials($cliente->nombres);\n \n $codigo = $iniciales.$correlativo.$fecha.$inicialesCliente;\n\n \n\n $cotizacion = new Cotizacion();\n \n $cotizacion->codigo = $codigo;\n $cotizacion->fecha = $fecha;\n $cotizacion->asesor = $asesor;\n $cotizacion->id_user = $id_user ;\n $cotizacion->id_cliente = $request->input('id_cliente');\n $cotizacion->proveedor = $request->input('proveedor');\n $cotizacion->medio = $request->input('medio');\n $cotizacion->status = $request->input('status');\n $cotizacion->save();\n\n return redirect()->route('cotizaciones.show', [$cotizacion->id]);\n }" ]
[ "0.7485594", "0.7411482", "0.7317804", "0.7246234", "0.70895976", "0.7025952", "0.6965492", "0.69299304", "0.6845012", "0.6835949", "0.6829867", "0.68153447", "0.67941684", "0.67539126", "0.67361355", "0.6731961", "0.67254275", "0.66990185", "0.6635984", "0.66303545", "0.66233706", "0.6613402", "0.66132456", "0.66105145", "0.65915835", "0.658588", "0.6548018", "0.65247893", "0.65131444", "0.64570135", "0.6454634", "0.6446281", "0.64355475", "0.6432103", "0.6429443", "0.64119595", "0.63806945", "0.6350906", "0.63446796", "0.63250345", "0.6322228", "0.6289928", "0.6289052", "0.62885535", "0.6285378", "0.6284068", "0.6276215", "0.627118", "0.6201567", "0.6143404", "0.61367667", "0.61364716", "0.61329067", "0.6096275", "0.60837704", "0.60610366", "0.60576254", "0.6043691", "0.6021146", "0.60062784", "0.59993833", "0.5994022", "0.5992117", "0.59872854", "0.59723437", "0.597154", "0.5957273", "0.5953952", "0.59389067", "0.5924268", "0.5893695", "0.5891668", "0.58886504", "0.5882868", "0.58782935", "0.58734816", "0.5861592", "0.586125", "0.5851466", "0.5849187", "0.5842019", "0.5836982", "0.58168775", "0.5813749", "0.5813546", "0.5812797", "0.58107936", "0.5807541", "0.5795993", "0.5793252", "0.57867205", "0.5783788", "0.578117", "0.5778286", "0.57768565", "0.57748884", "0.5773025", "0.57692504", "0.57688546", "0.57683474" ]
0.69811624
6
Show the form for editing Invoice.
public function edit($id) { if (! Gate::allows('invoice_edit')) { return abort(401); } $users = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $projects = \App\Project::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $expense_types = \App\ExpenseType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $meetings = \App\Meeting::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $contingencies = \App\Contingency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $providers = \App\Provider::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $service_types = \App\ServiceType::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $pms = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $finances = \App\User::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), ''); $invoice = Invoice::findOrFail($id); return view('admin.invoices.edit', compact('invoice', 'users', 'projects', 'expense_types', 'meetings', 'contingencies', 'providers', 'service_types', 'pms', 'finances')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Invoice $invoice) {\n\n\t\t// $return['invoices'] = \\App\\Invoice::all();\n\t\t// return view('/invoices/editform', $return);\n\t}", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function editAction() {\n\t\t$form = $this->getForm ( '/admin/invoices/process' );\n\t\t\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t\n\t\tif (! empty ( $id ) && is_numeric ( $id )) {\n\t\t\t$rs = $this->invoices->find ( $id )->toArray ();\n\t\t\tif (! empty ( $rs )) {\n\t\t\t\t$rs ['invoice_date'] = Shineisp_Commons_Utilities::formatDateOut ( $rs ['invoice_date'] );\n\t\t\t\t\n\t\t\t\t$parent = Customers::find ( $rs ['customer_id'] );\n\t\t\t\t\n\t\t\t\t//if customer comes from reseller\n\t\t\t\tif ($parent ['parent_id']) {\n\t\t\t\t\t$rs ['customer_parent_id'] = $parent ['parent_id'];\n\t\t\t\t} else {\n\t\t\t\t\t$rs ['customer_parent_id'] = $rs ['customer_id'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Create the buttons in the edit form\r\n\t\t\t\t$this->view->buttons = array(\r\n\t\t\t\t\t\tarray(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/confirm/id/$id\", \"label\" => $this->translator->translate('Delete'), \"params\" => array('css' => null)),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\tarray(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)),\r\n\t\t\t\t);\r\n\t\t\t\t\r\n\t\t\t\t// Check if the order has been invoiced\r\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/orders/sendinvoice/id/$id\", \"label\" => $this->translator->translate('Email invoice'), \"params\" => array('css' => null));\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/invoices/print/id/$id\", \"label\" => $this->translator->translate('Print invoice'), \"params\" => array('css' => null));\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/invoices/confirmoverwrite/id/$id\", \"label\" => $this->translator->translate('Overwrite invoice'), \"params\" => array('css' => null));\r\n\t\t\t\t$this->view->buttons[] = array(\"url\" => \"/admin/orders/edit/id/\".$rs ['order_id'], \"label\" => $this->translator->translate('Order'), \"params\" => array('css' => null));\r\n\t\t\t\t\n\t\t\t\t$form->populate ( $rs );\n\t\t\t}\n\t\t}\n\t\t$this->view->title = $this->translator->translate(\"Invoice Edit\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can edit the selected order.\");\n\t\t\n\t\t$this->view->mex = urldecode ( $this->getRequest ()->getParam ( 'mex' ) );\n\t\t$this->view->mexstatus = $this->getRequest ()->getParam ( 'status' );\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->render ( 'applicantform' );\n\t}", "public function edit(Invoice $invoice)\n\t{\n\t\t// Database Queries\n\t\t$contracts = Contract::with(['tenant', 'asset'])->notEnded()->get();\n\n\t\t// Config/Constants.php 'Queries'\n\t\t// Changes need to be made in the constants.php file AND on the DB\n\t\t$statuses = Config::get('constants.statuses');\n\t\t$priorities = Config::get('constants.priorities');\n\n\t\treturn view('invoices.edit', compact('invoice', 'contracts', 'statuses', 'priorities'));\n\t}", "public function editInvoice($id){ \n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit(Invoices $invoice)\n {\n //\n }", "public function edit( Invoice $invoice ) {\n\t\t$title = trans( 'invoice.edit' );\n\t\t$this->generateParams();\n\n\t\treturn view( 'layouts.edit', compact( 'title', 'invoice' ) );\n\t}", "public function edit(Invoice $invoice)\n {\n $invoice = Invoice::find($invoice->id);\n $data['invoice'] = $invoice;\n $data['action'] = 'invoice/update/';\n return view('invoice.form', $data);\n }", "public function edit($id)\n {\n return view('invoices.create')\n ->with('invoiceid', $id);\n }", "function edit() {\n $this->wireframe->hidePrintButton();\n \n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'number' => $this->active_invoice->getNumber(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'currency_id' => $this->active_invoice->getCurrencyId(),\n 'purchase_order_number' => $this->active_invoice->getPurchaseOrderNumber(),\n 'private_note' => $this->active_invoice->getPrivateNote(),\n 'company_id' => $this->active_invoice->getCompanyId(),\n 'company_address' => $this->active_invoice->getCompanyAddress(),\n 'project_id' => $this->active_invoice->getProjectId(),\n 'note' => $this->active_invoice->getNote(),\n 'language_id' => $this->active_invoice->getLanguageId(),\n 'payment_type' => $this->active_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n if(is_foreachable($this->active_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($this->active_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'id'\t\t\t\t\t => $item->getId(),\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n 'time_record_ids' => $item->getTimeRecordIds(),\n );\n } // foreach\n } // if\n } // if\n \n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if ($this->request->isSubmitted()) {\n \tif (!$this->request->isAsyncCall()) {\n \t\t$this->response->badRequest();\n \t} // if\n \t\n \ttry {\n if (!is_foreachable($invoice_data['items'])) {\n throw new ValidationErrors(lang('At least one invoice item is required'));\n } // if\n\n \t\tDB::beginWork('Editing Invoice');\n\n \t\t$this->active_invoice->setAttributes($invoice_data);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n \t\t\n \t\tif ($this->active_invoice->isIssued()) {\n \t\t $issued_on = isset($invoice_data['issued_on']) ? new DateValue($invoice_data['issued_on']) : new DateValue();\n \t\t $this->active_invoice->setIssuedOn($issued_on);\n \t\t} //if\n\n \t\t\n \t\t$this->active_invoice->save();\n \n// TODO: resolve the issue when dialog has to be redirected to the notification page\n// $this->flash->success('\":number\" has been updated', array('number' => $this->active_invoice->getName()));\n// if ($this->active_invoice->isIssued()) {\n// $this->response->redirectTo('invoice_notify', array('invoice_id' => $this->active_invoice->getId()));\n// } else {\n// $this->response->redirectToUrl($this->active_invoice->getViewUrl()); \n// } // if\n\n \t\tDB::commit('Invoice Edited');\n\n\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \n \t} catch (Exception $e) {\n \t\tDB::rollback('Invoice Editing Failed');\n \t\t$this->response->exception($e);\n \t} // try\n \t\n } // if\n }", "public function edit()\n {\n return view('panel.order-management.payment.form-edit');\n }", "public function edit(Invoice $invoice)\n {\n return view('chuckcms-module-booker::backend.invoices.edit', compact('invoice'));\n }", "public function edit(Invoice $invoice)\n {\n $editMode = \"yes\";\n $sections = Section::all()->pluck('section_name', 'id');\n $products = Product::where(\"section_id\", $invoice->section_id)->get()->pluck('product_name');\n\n return view('admin.invoices.edit', compact('sections', \"products\", 'invoice', \"editMode\"));\n }", "public function edit($id)\n {\n $page_title = 'Invoice';\n $page_description = 'Edit invoice';\n $invoice = Invoice::find($id);\n $project = Project::where('project_number', '=', $invoice->project_id);\n $customer = Customer::where('customer_number', '=', $invoice->customer_id);\n $customer_invoice = DB::table('invoices')\n ->leftJoin('projects', 'projects.project_number', '=', 'invoices.project_id')\n ->leftJoin('customers', 'customers.customer_number', '=', 'invoices.customer_id')\n ->where('invoice_id', '=', $id)\n ->first();\n return view('invoice.edit', compact('customer_invoice', 'invoice', 'page_title', 'page_description'));\n }", "public function edit($id)\n {\n //\n $invoice = Invoice::findOrFail($id);\n return view('finance.invoice.edit', compact('invoice'));\n }", "public function editInvoiceProForma($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit($id)\n {\n //\n\t\t$Invoice=Invoice::find($id);\n\t\treturn view('invoice.edit',compact('Invoice'));\n }", "public function edit($id)\n {\n return view('invoice::edit', $this->service->edit($id));\n }", "public function editQuotationInvoice($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit($id)\n {\n $invoice=Invoice::find($id);\n\t\treturn view('invoice.edit',compact('invoice','id'));\n }", "public function editCommercialInvoice($id){\n $invoice = WlgCorporationInvoice::find($id);\n\n $invoiceForms = WlgCorporationInvoice::where('if_id', $id)->get()->toArray();\n return view('edit-wlg-corportaion-invoice', compact('invoice', 'invoiceForms'));\n }", "public function edit($id)\n\t{\n\t\t$invoice = Invoice::findOrFail($id);\n\n\t\treturn view('invoices.edit', compact('invoice'));\n\t}", "public function edit(Request $request, int $id): View\n {\n $invoice = $request->user()->invoice($id);\n\n $viewVars = [\n 'projects' => $request->user()->projectsForMenu(null, $invoice->project_id),\n 'model' => $invoice,\n 'pageTitle' => \"Edit Invoice {$invoice->number}\",\n 'submission_method' => 'PUT',\n 'submission_route' => [\n 'invoice.update',\n $invoice->id,\n ],\n ];\n\n return view('invoice.form', $viewVars);\n }", "public function edit($id)\n {\n return view('admin::sales.invoices.edit', [\n 'invoice' => Invoice::find($id),\n 'customers' => Contact::asCustomers()\n ]);\n }", "public function edit(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function edit()\n {\n return view('billing::edit');\n }", "public function edit()\n {\n return view('billing::edit');\n }", "public function edit( $id)\n {\n $invoice=$this->invoice->getDetail($id);\n $data=compact('invoice');\n return view('invoice.edit',$data);\n\n }", "public function edit($id)\n {\n $items=Item::latest()->get();\n $invoiceItem=InvoiceItem::find($id);\n return view(\"invoiceitem.edit\",compact(\"items\",\"invoiceItem\"));\n }", "public function edit(ImportInvoice $importInvoice)\n {\n //\n }", "public function edit(Invoices $invoices)\n {\n //\n }", "public function edit($id)\n {\n $invoice = $this->getInvoice($id);\n\n// return $invoice;\n\n return view('examples.vueinvoices.edit', compact('invoice'));\n }", "public function edit($id)\n {\n $companies = Company::all();//->pluck('name', 'id');\n $invoice = Invoice::find($id);\n\n if (!$invoice) {\n Session::flash('message_danger', 'Factura no encontrada');\n return redirect()->back()->withInput();\n }\n\n $lastNumber = $invoice->number;\n $authorizations = Authorization::openForInvoices();\n\n $extra = Authorization::checkIfExists($invoice->authorization_code);\n if ($extra) {\n $authorizations->push($extra);\n }\n\n return view('invoice.edit', compact('companies', 'lastNumber', 'authorizations', 'invoice'));\n }", "public function edit($id)\n {\n if (! Gate::allows('invoice_edit')) {\n return abort(401);\n }\n $relations = [\n 'users' => User::get()->pluck('name', 'id')->prepend('Please select', ''),\n ];\n\n $invoice = Invoice::findOrFail($id);\n\n return view('invoices.edit', compact('invoice') + $relations);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AcmeInvoiceBundle:Invoice')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Invoice entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AcmeInvoiceBundle:Invoice: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 if (! Gate::allows('invoice_edit')) {\n return prepareBlockUserMessage();\n }\n \n $invoice = Invoice::findOrFail($id);\n\n if ( ! empty( $invoice->project_id ) ) {\n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_CLIENT_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n } else {\n $customers = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CUSTOMERS_TYPE);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n }\n $sales_agent = \\App\\Contact::whereHas(\"contact_type\",\n function ($query) {\n $query->where('id', CONTACT_SALE_AGENT);\n })->get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n\n $currencies = \\App\\Currency::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $taxes = \\App\\Tax::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $discounts = \\App\\Discount::get()->pluck('name', 'id')->prepend(trans('global.app_please_select'), '');\n $enum_status = Invoice::$enum_status;\n $enum_discounts_format = Invoice::$enum_discounts_format;\n $enum_tax_format = Invoice::$enum_tax_format;\n \n \n\n return view('admin.invoices.edit', compact('invoice', 'enum_status','sales_agent', 'customers', 'currencies', 'taxes', 'discounts', 'enum_discounts_format', 'enum_tax_format'));\n }", "public function edit($id)\n {\n $productinvoices = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n return view('invoices.edit', compact(['invoices','productinvoices']));\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit($id)\n {\n $invoicesDetails = InvoicesModel::find($id);\n\n return View::make('crm.invoices.edit')\n ->with('invoices', $invoicesDetails);\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 edit($id)\n {\n if(!in_array(Auth::user()->role,['Admin']))\n return view('home')->with('message','You are not authorized for the page you tried to visit');\n $customers = Customer::all();\n $invoice = Invoice::find($id);\n return view('invoice.edit', compact('customers','invoice'));\n //\n }", "public function edit()\n {\n // $setting = Setting::findOrFail($id);\n\n // return view('invoice.edit');\n }", "public function edit($id)\n {\n return view('payment::edit');\n }", "public function getEdit()\n {\n $members= Member::all();\n $invoiceproducts = InvoiceProduct::where('invoice_group_id', '=', InvoiceGroup::getCurrentMonth()->id)->get();\n return view('fiscus.edit')->with('members', $members)\n ->with('products', $invoiceproducts);\n }", "public function edit(AdminInvoiceModel $admin_invoice_show)\n {\n $pat_data=PatientProfileModel::all();\n if(Auth::user()->admin==\"accountant\"){\n return view('accountant.edit_invoice',compact('admin_invoice_show','pat_data'));\n }\n return view('admin.edit_invoice',compact('admin_invoice_show','pat_data'));\n }", "public function edit($id)\n {\n $invoice = InvoicePayable::with([\n 'Rcv.Detailrcv','Rcv','Jenistransaksi','Detailinvoice'\n ])->find($id);\n\n $jenis_transaksi = Jenistransaksi::all();\n $pegawai = Pegawai::all();\n $rcv = Rcv::all();\n\n $id = InvoicePayable::getId();\n foreach($id as $value);\n $idlama = $value->id_payable_invoice;\n $idbaru = $idlama + 1;\n $blt = date('y-m');\n\n $kode_invoice = 'INVC-'.$blt.'/'.$idbaru;\n\n return view('pages.accounting.payable.invoice.create', compact('invoice','jenis_transaksi','pegawai','kode_invoice','rcv'));\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit(enquiryForm $enquiryForm)\n {\n //\n }", "public function edit($id)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n\n $members = $this->invoiceRepository->membersNames();\n $invoice = $this->invoiceRepository->findWithoutFail($id);\n\n if (empty($invoice)) {\n Flash::error('invoice not found');\n\n return redirect(route('invoices.index'));\n }\n\n return view('invoices.edit')->with('invoice', $invoice)->with(['members' => $members]);\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit(PurchasesInvoice $purchasesInv)\n {\n \n return view('dashboard.invoices.purchaseEdit' , compact(\"purchasesInv\"));\n }", "public function edit($id)\n {\n\n $invoices = invoices::where('id', $id)->first();\n $details = invoices_details::where('id_Invoice', $id)->get();\n $attachments = invoice_attachments::where('invoice_id', $id)->get();\n return view('invoices.invoices_details', ['invoices' => $invoices, 'details' => $details, 'attachments' => $attachments]);\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editInvoice($order_id)\n {\n $submitted = Request::get('submitted');\n if ($submitted) {\n } else {\n $order = Invoice::where('id', '=', $order_id)->get();\n $order_details =[];\n \n return view('common.edit_invoice')\n ->with('order', $order[0])\n ->with('order_details', $order_details);\n\n // return view('common.edit_invoice')->with('order', $order)->with('order_details', $order_details)->with('before_image',$before_image);\n }\n }", "public function edit($id)\n {\n $po = PurchaseOrder::findOrFail($id);\n return view('po.form', [\n 'po' => $po,\n 'action' => route('po.update', $id),\n 'method' => 'PUT',\n 'title' => 'Edit'\n ]);\n }", "public function edit($id)\n {\n\n $invObj = Invoice::where('id', $id)->first();\n\n $invItems = Invoice_item::where('invoice_id', $id)->get();\n $branch = Branch::where('id', $invObj->branch_id)->first();\n $stocks = Stock::where('branch_id', $invObj->branch_id)->get();\n $persons = Person::where('person_type_id', 101)->get();\n $currencies = Currency::get();\n $paytypes = Sales_invoice_pay_type::get();\n $orders = Order::where('id', $invObj->order_id)->first();\n $saleCodes = Representative::where('rep_type_id', 100)->where('branch_id', $invObj->branch_id)->get();\n $MarktCodes = Representative::where('rep_type_id', 101)->where('branch_id', $invObj->branch_id)->get();\n $currencyRate = Currency::where('id', $invObj->currency_id)->first();\n $saleName = Representative::where('id', $invObj->sales_rep_id)->first();\n $marketName = Representative::where('id', $invObj->marketing_rep_id)->first();\n $stockName = Stock::where('id', $invObj->stock_id)->first();\n $orderItems = [];\n\n return view($this->viewName . 'edit', compact('invObj', 'invItems', 'currencyRate', 'saleName', 'marketName', 'stockName', 'stocks', 'persons', 'orders', 'branch', 'orderItems', 'saleCodes', 'MarktCodes', 'paytypes', 'currencies'));\n }", "public function edit($id)\r\n {\r\n return view('checkout::edit');\r\n }", "public function edit($id)\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $invoicelist = InvoiceLists::findOrFail($id);\n if (Auth::user()->role == User::ROLE_SUPERADMIN || Auth::user()->role == User::ROLE_ADMIN) {\n $purchaseorderlists = PurchaseOrderLists::pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }else{\n $purchaseorderlists = PurchaseOrderLists::where('quote_sales_person_id', Auth::user()->id)\n ->pluck('purchase_order_list_code', 'id')\n ->prepend('Choose Purchase Order', '');\n }\n return view('admin.invoice.edit', compact('invoicelist', 'purchaseorderlists'));\n }else{\n Alert::info('No Access !', 'Attention !');\n return redirect('admin/invoice-list');\n }\n }", "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// 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()\n {\n return view('admincp::edit');\n }", "public function edit(Request $request, $id)\n {\n //\n $purchaseInvoices = PurchaseInvoice::with('items')->find($id);\n return view('invoices-edit', compact('purchaseInvoices'));\n }", "function edit($InvoiceId)\n { \n // check if the invoice exists before trying to edit it\n $data['invoice'] = $this->Invoice_model->get_invoice($InvoiceId);\n \n if(isset($data['invoice']['InvoiceId']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'BillNo' => $this->input->post('BillNo'),\n\t\t\t\t'PurchaseDate' => $this->input->post('PurchaseDate'),\n\t\t\t\t'PurchaseDateBS' => $this->input->post('PurchaseDateBS'),\n\t\t\t\t'SupplierName' => $this->input->post('SupplierName'),\n\t\t\t\t'SupplierNumber' => $this->input->post('SupplierNumber'),\n\t\t\t\t'SupplierAddress' => $this->input->post('SupplierAddress'),\n\t\t\t\t'Description' => $this->input->post('Description'),\n\t\t\t\t\n );\n $this->Invoice_model->update_invoice($InvoiceId,$params); \n redirect('invoice/index');\n }\n else\n {\n\t\t\t\t $userid = $this->session->userdata('userid');\n\t\t\t\t$data['users'] = $this->User_model->get_user($userid);\n $data['_view'] = 'invoice/edit';\n $this->load->view('layouts/main1',$data);\n }\n }\n else\n show_error('The invoice you are trying to edit does not exist.');\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function edit(Incidencia $incidencia)\n {\n //\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n\t{\t\n\t\t\n\t\t$customer = Customer::where('user_id',Auth::user()->id)->findOrFail($id);// -------------------------------------------------only logged in user\t\t\t\n\n\t\t$invoices = DB::table('invoices')->where('customer_id', $id)->orderBy('id','desc')->get();\n\n\t\t// return var_dump($customer);\n\n\t\treturn View::make('customers.edit')->withCustomer($customer)->withInvoices($invoices);\n\t}", "public function edit_invoice($invoice_id = \"\") {\n $data = [];\n $this->db->where('id', $invoice_id);\n $this->db->update('invoice', $data);\n $this->session->set_flashdata('flash_message', get_phrase('invoice_update_successfully'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function show(Invoice $invoice)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n\t{\n\t\t$customerinvoiceline = Customerinvoiceline::find($id);\n\n\t\treturn View::make('customerinvoicelines.edit', compact('customerinvoiceline'));\n\t}", "public function edit( $id ) {\n // return \"Mostrar aqui formulario para formapago con id $id\";\n $formaPagos = FormaPago::find( $id );\n return view('admin.formapago.edit')->with(compact('formaPagos')); //formulario de registro\n }", "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($idReino)\n {\n $dominios = Dominio::all();\n $reinos = Reino::find($idReino);\n return view('reino.edit',compact('reinos','dominios'));\n }", "public function edit($id)\n {\n //\n return view('users.accounting.transaction.edit');\n }", "public function edit($id)\n\t{\n\n return View::make('payslips.edit');\n\t}", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n $regimenes = DB::table('regimen_fiscal')->where('estado','=','Activo')->get();\n return view(\"clientes.edit\",[\"clientes\"=>Cliente::findOrFail($id), 'regimenes'=>$regimenes]);\n //\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 editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit()\n {\n return view('commonmodule::edit');\n }" ]
[ "0.8203381", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.79665446", "0.7914345", "0.7796685", "0.77634907", "0.77582556", "0.7740793", "0.77022177", "0.7609886", "0.7603594", "0.7560291", "0.75541985", "0.7553459", "0.7521952", "0.7512372", "0.7489811", "0.7473087", "0.74441916", "0.7441003", "0.74117106", "0.7408636", "0.74082285", "0.739976", "0.73821485", "0.73696667", "0.7305398", "0.7305398", "0.72625023", "0.72619146", "0.7252707", "0.721879", "0.721", "0.7195369", "0.718129", "0.7151892", "0.71404934", "0.7139288", "0.70723534", "0.70723534", "0.7069576", "0.7045754", "0.69994503", "0.6995832", "0.6972006", "0.6953958", "0.69438726", "0.69373995", "0.69051623", "0.6902669", "0.69011956", "0.6896876", "0.68618286", "0.6861699", "0.68475974", "0.6840386", "0.6824944", "0.68187803", "0.68143445", "0.6813384", "0.6808077", "0.6804966", "0.67813826", "0.6776148", "0.6771095", "0.67659104", "0.6762108", "0.6762108", "0.6761171", "0.6758059", "0.67497617", "0.6730098", "0.6730006", "0.6729826", "0.6718142", "0.6718142", "0.6715212", "0.6715212", "0.6715212", "0.6707454", "0.67041194", "0.6699558", "0.6692802", "0.66856927", "0.66822004", "0.6678908", "0.66756254", "0.6671922", "0.6651669", "0.6651669", "0.6645204", "0.6645085" ]
0.73934865
32
Update Invoice in storage.
public function update(UpdateInvoicesRequest $request, $id) { if (! Gate::allows('invoice_edit')) { return abort(401); } $request = $this->saveFiles($request); $invoice = Invoice::findOrFail($id); $invoice->update($request->all()); $media = []; foreach ($request->input('files_id', []) as $index => $id) { $model = config('medialibrary.media_model'); $file = $model::find($id); $file->model_id = $invoice->id; $file->save(); $media[] = $file->toArray(); } $invoice->updateMedia($media, 'files'); return redirect()->route('admin.invoices.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($shoppingcartInvoice);", "public function update(Request $request, Invoice $invoice)\n {\n // return \"in update\";\n $previous_status = $invoice->invoicestatus->status;\n\n // updating the invoice\n $data = $request->only([\n 'customer_id', 'invoicestatus_id',\n 'amount', 'courier_id', 'subtotal', 'date',\n 'payment', 'discount', 'notes'\n ]);\n $invoice->update($data);\n\n // store temp invoice record data\n $records = array();\n foreach ($invoice->rows as $row) {\n // products quantity are back at database\n\n $product = Product::find($row['products_id']);\n $product->update([\"quantity\" => $product->quantity + $row->quantity]);\n }\n foreach ($request->rows as $row) {\n // updating the product\n\n $product = Product::find($row['id']);\n\n //return ($request->rows[$i][\"id\"]);\n // $priv_quantity = InvoiceRecord::where([\n // \"invoice_id\" => $invoice->id,\n // \"products_id\" => $product->id,\n // ])->select('quantity')->first();\n // adding privious quantity with product quantity and subtracting\n // requested invoice quantity\n\n // decresing the product quanityt from the product inventory\n $product->update([\"quantity\" => $product->quantity - $row[\"quantity\"]]);\n\n array_push($records, [\n \"products_id\" => $row[\"id\"],\n \"invoice_id\" => $invoice->id,\n \"quantity\" => $row[\"quantity\"],\n \"name\" => $row[\"name\"],\n \"price\" => $row['price'],\n \"selling_price\" => $row[\"selling_price\"],\n ]);\n }\n\n // if status changed then do necessary steps\n $status = InvoiceStatus::find($data['invoicestatus_id'])->first()->status;\n $this->status_handler($status, $invoice->id, $previous_status);\n\n // deleting all the previous invoice records\n InvoiceRecord::where(\"invoice_id\", $invoice->id)->delete();\n\n // creating the new records\n foreach ($records as $record) {\n InvoiceRecord::create($record);\n }\n }", "public function update(Request $request, $id)\n {\n $business = Auth::user()->business;\n\n // $validator = Validator::make($request->all(), [\n // 'invoice_number' => 'required|numeric|integer',\n // 'invoice_date' => 'required|date',\n // 'due_date' => 'required|date|after:invoice_date',\n // 'currency' => 'in:eur,gbp,usd',\n // 'note' => 'nullable|string|max:1000',\n // ]);\n // if ($validator->fails()) {\n // return response()->json(['error' => 'Unauthorised - Validation failed', 'messages' => $validator->errors()], 422);\n // }\n\n //Update an invoice\n $invoice = Invoice::findOrFail($id);\n $invoice->draft_email = $request->user_email;\n $invoice->total_cost = 0;\n foreach ($request->invoiceLines as $line) {\n $invoice->total_cost += $line['cost'] * ceil($line['sec'] / 60) * 100;\n }\n $invoice->save(); // save it to the database.\n //PROBABLY NOT WORKING\n //Attach each product as invoice item\n foreach ($request->invoiceLines as $line) {\n $invoiceItem = new InvoiceItems([\n 'name' => $line['name'],\n 'description' => $line['description'],\n 'cost' => $line['cost'] * 100,\n 'quantity' => ceil($line['sec'] / 60),\n 'sub_total' => $line['cost'] * ceil($line['sec'] / 60) * 100\n ]);\n if (isset($line['rate_unit'])) {\n $invoiceItem->rate_unit = $line['rate_unit'];\n }\n $invoice->invoiceItems()->save($invoiceItem);\n }\n //Redirect to a specified route with flash message.\n return response(200);\n }", "public function update(Request $request, Invoice $invoice) {\n\t\t//\n\t}", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, Invoice $invoice)\n {\n //\n }", "public function update(Request $request, $id)\n {\n \n //INVOICE\n $invoice = Invoice::find($id);\n $invoice->customer_name = $request->customer_name;\n $invoice->sum_for_paying = $request->sum_for_paying;\n $invoice->invoice_closed = true;\n $invoice->closing_date = $request->closing_date;\n $invoice->save();\n\n //INVOICE ITEM(s)\n $invoiceitems = $request->input(['invoiceitems']);\n $invoiceitems = $request->invoiceitems;\n foreach ($invoiceitems as $invoiceitemx) {\n $invoiceitem = Invoiceitem::find($invoiceitemx['id']);//this gives the id, it works\n $invoiceitem->returned = $invoiceitemx['returned'];\n $invoiceitem->time_on_field = $invoiceitemx['time_on_field'];\n $invoiceitem->to_pay = $invoiceitemx['to_pay'];\n $invoiceitem->invoice_line_closed = true;\n $invoiceitem->save();\n }\n\n //SET TOOLS TO ONSTOCK AGAIN\n\n\n return $invoice;\n }", "public function update(Request $req, $id)\n {\n $inv = Invoice::find($id);\n $inv->business_id = \\business()->id;\n\n $contact = Contact::find($req->contact_id);\n\n $inv->contact_id = $contact->id;\n $inv->contact_name = $contact->name; //Contact::find($req->customer_id)->name;\n $inv->contact_email = $contact->email;\n $inv->contact_tax_number = $contact->tax_number;\n $inv->contact_phone = $contact->phone;\n $inv->contact_address = $contact->address;\n\n $inv->currency_code = $req->currency_code;\n $inv->currency_rate = 78;\n\n // Invoice\n $inv->invoice_number = $req->invoice_number;\n $inv->order_number = $req->order_number;\n $inv->status = 'pending';\n $inv->invoiced_at = $req->invoice_date;\n $inv->due_at = $req->due_date;\n\n $inv->subtotal_amount = $req->subtotal_amount;\n $inv->discount_percent = $req->discount_percent;\n $inv->discount_amount = $req->discount_amount;\n $inv->total_tax_amt = $req->total_tax_amt;\n $inv->round_up = $req->round_up;\n $inv->total_amount = $req->total_amount;\n\n\n $inv->notes = $req->notes;\n $inv->footer = $req->footer;\n\n $inv->category_id = $req->category_id;\n $inv->save();\n\n // Invoice Items\n // foreach($req->items as $item){\n // $invItem = new InvoiceItem();\n // $invItem->business_id = business()->id;\n // $invItem->invoice_id = $inv->id;\n // $invItem->item_id = $item['id'];\n // $invItem->name = $item['name'];\n // $invItem->quantity = $item['quantity'];\n // $invItem->price = $item['price'];\n // $invItem->taxprcnt = $item['taxprcnt'];\n // $invItem->taxamt = $item['taxamt'];\n // $invItem->total = $item['total'];\n // $invItem->save();\n // }\n // Invoice History\n $invHis = new InvoiceHistory();\n $invHis->business_id = business()->id;\n $invHis->invoice_id = $inv->id;\n $invHis->status_code = 'pending';\n $invHis->notify = 0;\n $invHis->description = 'Invoice No:'.$req->invoice_number.' is created...';\n $invHis->save();\n\n $req->session()->flash('status', 'Invoice Created..');\n\n return redirect()->route('admin.invoices.show', $inv->id);\n }", "public function update(Request $request, $id)\n {\n DB::beginTransaction();\n try {\n $request->validate([\n \"invoice_number\"=>\"required\",\n \"item_id\"=>\"required\",\n \"quantity\"=>\"required\"\n ]);\n\n $invoice_item=InvoiceItem::find($id);\n $invoice=Invoice::where(\"invoice_number\",$request->invoice_number)->first();\n if(!$invoice){\n return back()->with(\"success\",\"This invoice number does not exits\");\n }\n $invoice_item->invoice_id=$invoice->id;\n $invoice_item->item_id=$request->item_id;\n $invoice_item->quantity=$request->quantity;\n $item=Item::find($request->item_id)->first();\n $invoice_item->price=$item->sale_price;\n $invoice_item->total=($invoice_item->price)*($invoice_item->quantity);\n $invoice_item->save();\n $amount=InvoiceItem::where(\"invoice_id\",$invoice_item->invoice_id)->count();\n $invoice=Invoice::find($invoice_item->invoice_id);\n $invoice->amount=$amount;\n $total=InvoiceItem::where(\"invoice_id\",$invoice_item->invoice_id)->sum(\"total\");\n if($invoice->currency==\"riel\"){\n $total=$total*4100;\n }\n $invoice->total=$total;\n $invoice->save();\n DB::commit();\n return back()->with(\"success\",\"The data has been updated\");\n }catch (\\Exception $e){\n report($e);\n DB::rollback();\n return back()->with(\"success\",\"The data cannot insert\");\n }\n }", "public function update(Request $request, ImportInvoice $importInvoice)\n {\n //\n }", "public function update(Request $request, Invoices $invoices)\n {\n //\n }", "public function update(Request $request, invoices_details $invoices_details)\n {\n //\n }", "public function updateInvoice($data) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n if ($data->id) {\r\n $invoice = Invoice::find_by_id($data->id);\r\n } else {\r\n throw new RestException(400, \"id not received\");\r\n }\r\n if (!$invoice) {\r\n throw new RestException(400, \"no such invoice\");\r\n }\r\n if (isset($data->invoicedate) && $this->validMySQLDate($data->invoicedate)) {\r\n $invoice->invoicedate = $data->invoicedate;\r\n }\r\n if (isset($data->amount)) {\r\n $invoice->amount = $data->amount;\r\n }\r\n if (isset($data->vatamount)) {\r\n $invoice->vatamount = $data->vatamount;\r\n }\r\n if (isset($data->paymenttype)) {\r\n $invoice->paymenttype = $data->paymenttype;\r\n }\r\n if (isset($data->chequenumber)) {\r\n $invoice->chequenumber = $data->chequenumber;\r\n }\r\n// if (isset($data->clientid)) {\r\n// $invoice->clientid = $data->clientid;\r\n// }\r\n// if (isset($data->productid)) {\r\n// $invoice->productid = $data->productid;\r\n// }\r\n// if (isset($data->traderid)) {\r\n// $invoice->traderid = $data->traderid;\r\n// }\r\n\r\n $invoice->save();\r\n return $invoice;\r\n }", "public function update(Invoices $invoice, UpdateInvoicesRequest $request)\n {\n $data = $request->all();\n $data['rows'] = json_encode($request->rows);\n $invoice->fill($data);\n\n $this->invoice->save($invoice, $data);\n\n return $this->redirectResponse($request, __('alerts.backend.invoices.updated'));\n }", "public function update(Request $request, InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function update(Request $request, $id)\n {\n Product::where('invoice_id', $id)->delete();\n\n $sum_amount = 0;\n foreach ($request->amount as $key => $value) {\n $sum_amount += $value;\n }\n \n\n if($request->is_paid == '1'){\n $is_paid = 1;\n }else{\n $is_paid = 0;\n }\n\n\n $invoice = Invoice::findOrFail($id);\n $invoice->total_amount = $sum_amount;\n if(!isset($request->autometic_email_day)){\n $invoice->autometic_email_day = $invoice->autometic_email_day;\n }else{\n $invoice->autometic_email_day = $request->autometic_email_day;\n }\n \n $invoice->invoice_email = $request->invoice_email;\n $invoice->is_paid = $is_paid;\n $invoice->save();\n\n $customer = Customer::where('id', $invoice->user_id)->first();\n $customer->days = $request->autometic_email_day;\n $customer->invoice_email = $request->invoice_email;\n $customer->save();\n\n foreach ($request->product_name as $key => $value) {\n $product = new Product;\n $product->invoice_id = $invoice->id;\n $product->user_id = $invoice->user_id;\n $product->product_name = $value;\n $product->description = $request->description[$key];\n $product->amount = $request->amount[$key];\n $product->save();\n\n }\n\n return redirect('home')->with('success', 'Product Updated!');\n }", "public function update(UpdateInvoicesRequest $request, $id)\n {\n if (! Gate::allows('invoice_edit')) {\n return prepareBlockUserMessage();\n }\n $invoice = Invoice::findOrFail($id);\n // dd( $request->all() );\n $products_details = getProductDetails( $request );\n\n $tax_format = $request->tax_format;\n $discount_format = $request->discount_format;\n\n $products_details['discount_format'] = $discount_format;\n $products_details['tax_format'] = $tax_format;\n \n // These are product values.\n $grand_total = ! empty( $products_details['grand_total'] ) ? $products_details['grand_total'] : 0;\n $products_amount = ! empty( $products_details['products_amount'] ) ? $products_details['products_amount'] : 0;\n $total_tax = ! empty( $products_details['total_tax'] ) ? $products_details['total_tax'] : 0;\n $total_discount = ! empty( $products_details['total_discount'] ) ? $products_details['total_discount'] : 0;\n\n // Calculation of Cart Tax.\n $tax_id = $request->tax_id;\n $cart_tax = 0; \n if ( $tax_id > 0 ) { \n $invoice->setTaxIdAttribute( $tax_id );\n $tax = $invoice->tax()->first();\n $rate = 0;\n $rate_type = 'percent';\n if ( $tax ) {\n $rate = $tax->rate;\n $rate_type = $tax->rate_type;\n }\n $products_details['cart_tax_rate'] = $rate;\n $products_details['cart_tax_rate_type'] = $rate_type;\n\n if ( $rate > 0 ) {\n if ( 'before_tax' === $tax_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $products_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_tax = ( $new_amount * $rate) / 100;\n } else {\n $cart_tax = $rate;\n }\n }\n } \n }\n\n // Let us calculate Cart Discount\n $cart_discount = 0;\n $discount_id = $request->discount_id;\n if ( $discount_id > 0 ) {\n $invoice->setDiscountIdAttribute( $discount_id );\n $discount = $invoice->discount()->first();\n\n $rate = 0;\n $rate_type = 'percent';\n if ( $discount ) {\n $rate = $discount->discount;\n $rate_type = $discount->discount_type;\n }\n $products_details['cart_discount_rate'] = $rate;\n $products_details['cart_discount_rate_type'] = $rate_type;\n if ( $rate > 0 ) {\n if ( 'before_tax' === $tax_format ) {\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $products_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n } \n } else {\n $new_amount = $products_amount + $total_tax;\n if ( 'percent' === $rate_type ) {\n $cart_discount = ( $new_amount * $rate) / 100;\n } else {\n $cart_discount = $rate;\n }\n }\n } \n }\n\n $products_details['cart_tax'] = $cart_tax;\n $products_details['cart_discount'] = $cart_discount;\n $amount_payable = $grand_total + $cart_tax - $cart_discount;\n $products_details['amount_payable'] = $amount_payable;\n\n // if there are transactions for this customer. Currency selection may disable, so we need to get it from customer profile.\n $currency_id = $request->currency_id;\n if ( empty( $currency_id ) ) {\n $currency_id = getDefaultCurrency( 'id', $request->customer_id );\n }\n\n // If products module disabled! lets take amount from user input!!\n if ( empty( $amount_payable ) && $request->has('amount') ) {\n $amount_payable = $request->amount;\n }\n\n $addtional = array(\n 'products' => json_encode( $products_details ),\n 'amount' => $amount_payable,\n 'currency_id' => $currency_id,\n );\n\n $invoice_no = $request->invoice_no;\n if ( empty( $invoice_no ) ) {\n $invoice_no = getNextNumber();\n }\n \n $addtional['invoice_no'] = $invoice_no;\n\n $request->request->add( $addtional ); //add additonal / Changed values to the request object.\n\n $date_set = getCurrentDateFormat();\n\n $additional = array( \n 'invoice_date' => ! empty( $request->invoice_date ) ? Carbon::createFromFormat($date_set, $request->invoice_date)->format('Y-m-d') : NULL,\n 'invoice_due_date' => ! empty( $request->invoice_due_date ) ? Carbon::createFromFormat($date_set, $request->invoice_due_date)->format('Y-m-d') : NULL,\n ); \n $request->request->add( $additional ); \n\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n } \n\n\n $invoice->update($request->all());\n\n \n\n $products_sync = ! empty( $products_details['products_sync'] ) ? $products_details['products_sync'] : array();\n $invoice->invoice_products()->sync( $products_sync );\n\n $products_sync = ! empty( $products_details['products_sync_tasks'] ) ? $products_details['products_sync_tasks'] : array();\n $invoice->invoice_products_tasks()->sync( $products_sync );\n\n $products_sync = ! empty( $products_details['products_sync_expenses'] ) ? $products_details['products_sync_expenses'] : array();\n $invoice->invoice_products_expenses()->sync( $products_sync );\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-updated', 'operation_type' => 'crud' ) );\n\n $invoice->allowed_paymodes()->sync(array_filter((array)$request->input('allowed_paymodes')));\n\n $invoice->update_invoice_status( $invoice->id );\n\n $customer = $invoice->customer()->first();\n if ( ! empty( $request->btnsavesend ) && $customer && 'Published' === $invoice->status ) {\n // Notification to user\n $logo = getSetting( 'site_logo', 'site_settings' );\n $templatedata = array(\n 'client_name' => $customer->name,\n 'content' => 'Invoice has been created',\n 'invoice_url' => route( 'admin.invoices.preview', [ 'slug' => $invoice->slug ] ),\n 'invoice_no' => $invoice->invoice_no,\n 'invoice_date' => digiDate( $invoice->invoice_date ),\n 'invoice_amount' => digiCurrency($invoice->amount,$invoice->currency_id),\n 'invoice_due_date' => digiDate( $invoice->invoice_due_date ),\n 'title' => $invoice->title,\n 'address' => $invoice->address,\n 'reference' => $invoice->reference,\n 'invoice_notes' => $invoice->invoice_notes,\n 'customer_id' => $invoice->customer_id,\n 'currency_id' => $invoice->currency_id,\n 'tax_id' => $invoice->tax_id,\n 'discount_id' => $invoice->discount_id,\n 'paymentstatus' => $invoice->paymentstatus,\n 'created_by_id' => $invoice->created_by_id,\n 'products' => productshtml( $invoice->id ),\n\n 'site_address' => getSetting( 'site_address', 'site_settings'),\n 'site_phone' => getSetting( 'site_phone', 'site_settings'),\n 'site_email' => getSetting( 'contact_email', 'site_settings'), \n 'site_title' => getSetting( 'site_title', 'site_settings'),\n 'logo' => asset( 'uploads/settings/' . $logo ),\n 'date' => digiTodayDate(),\n 'site_url' => env('APP_URL'),\n );\n\n if ( $invoice->customer->name ) {\n $templatedata['customer_id'] = $invoice->customer->name;\n }\n \n if ( $invoice->currency->name ) {\n $templatedata['currency_id'] = $invoice->currency->name;\n }\n \n if ( $invoice->tax->name ) {\n $templatedata['tax_id'] = $invoice->tax->name;\n }\n \n if ( $invoice->discount->name ) {\n $data['discount_id'] = $invoice->discount->name;\n }\n \n $createduser = \\App\\User::find( $invoice->created_by_id );\n if ( $createduser ) {\n $data['created_by_id'] = $createduser->name;\n }\n\n $data = [\n \"action\" => \"Created\",\n \"crud_name\" => \"User\",\n 'template' => 'invoice-created',\n 'model' => 'App\\Invoices',\n 'data' => $templatedata,\n ];\n $customer->notify(new QA_EmailNotification($data));\n\n $this->insertHistory( array('id' => $invoice->id, 'comments' => 'invoice-updated', 'operation_type' => 'email' ) );\n }\n\n flashMessage( 'success', 'update');\n\n if ( ! empty( $request->btnsavemanage ) ) {\n return redirect( 'admin/invoices/' . $invoice->id );\n } else {\n return redirect()->route('admin.invoices.index');\n }\n }", "public function update( InvoiceRequest $request, Invoice $invoice ) {\n\t\t$invoice->update( $request->except( 'option_id', 'section_id', 'quantity', 'remove' ) );\n\n\t\tInvoiceItem::where( 'invoice_id', $invoice->id )->delete();\n\t\tif ( !empty( $request->get( 'option_id' ) ) ) {\n\t\t\tforeach ( $request->get( 'option_id' ) as $key => $option_id ) {\n\t\t\t\tInvoiceItem::create( [\n\t\t\t\t\t'option_id' => $option_id,\n\t\t\t\t\t'invoice_id' => $invoice->id,\n\t\t\t\t\t'quantity' => $request->get( 'quantity' )[ $key ]\n\t\t\t\t] );\n\t\t\t}\n\t\t}\n\n\t\treturn redirect( '/invoice' );\n\t}", "public function edit_invoice($invoice_id = \"\") {\n $data = [];\n $this->db->where('id', $invoice_id);\n $this->db->update('invoice', $data);\n $this->session->set_flashdata('flash_message', get_phrase('invoice_update_successfully'));\n }", "public function updateItems()\n {\n if (count($this->items)) {\n foreach ($this->items as $item) {\n $item->setInvoice($this);\n }\n }\n }", "public function update(Request $request, $id)\n {\n $invoice = Invoice::find($id);\n $invoice->invoice_gst_rate = $request->invoice_gst_rate;\n $invoice->invoice_reference = $request->invoice_reference;\n $invoice->invoice_comments = $request->invoice_comments;\n $invoice->invoice_date = $request->invoice_date;\n $invoice->invoice_billing_address = $request->invoice_billing_address;\n $invoice->invoice_copy_type = $request->invoice_copy_type;\n $invoice->invoice_final_cost = $request->project_estimate_cost;\n $invoice->invoice_grand_total = $request->invoice_grand_total;\n $invoice->save();\n\n Session::flash('updated', 'Invoice updated successfully');\n return redirect()->route('invoice.index');\n\n }", "public function update(Update $request ,$payableinvoice_id)\n {\n $input_data = $request->only('id','date','invoice_number','vendor_id',\n 'notes', 'subtotal', 'pst', 'gst', 'total', 'override_gst',\n 'override_pst', 'posted','posted_date');\n \n $input_data['posted_date']=$request->posted == '1' ? date('Y-m-d H:i:s') : NULL;\n PayableInvoice::where('id',$request->id)->update($input_data);\n $this->payableInvoiceRepository->updatePayableItem($request->all());\n $this->payableInvoiceRepository->deletePayableItem($request->all());\n return $this->response->array([STATUS => 200, MESSAGE => 'Details has been saved.']);\n }", "public function update($id, UpdateinvoiceRequest $request)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n $invoice = $this->invoiceRepository->findWithoutFail($id);\n if (empty($invoice)) {\n Flash::error('invoice not found');\n\n return redirect(route('invoices.index'));\n }\n\n $invoice = $this->invoiceRepository->update($request->all(), $id);\n\n Flash::success('invoice updated successfully.');\n\n return redirect(route('invoices.index'));\n }", "public function update(Request $request)\n {\n $invoice = Invoice::find($request->id);\n $invoice->nama_invoice =$request->nama_invoice;\n $invoice->tgl_invoice =$request->tgl_invoice;\n $invoice->jenis_pembayaran =$request->jenis_pembayaran;\n $invoice->status =$request->status;\n $invoice->save();\n return redirect('/invoice');\n }", "public function edit(Invoices $invoice)\n {\n //\n }", "public static function updateInventory($form, $purchaseInvoice)\n {\n foreach ($purchaseInvoice->items as $item) {\n if ($item->quantity > 0) {\n $options = [];\n if ($item->item->require_expiry_date) {\n $options['expiry_date'] = $item->purchaseReceiveItem->expiry_date;\n }\n if ($item->item->require_production_number) {\n $options['production_number'] = $item->purchaseReceiveItem->production_number;\n }\n\n $options['quantity_reference'] = $item->quantity;\n $options['unit_reference'] = $item->unit;\n $options['converter_reference'] = $item->converter;\n InventoryHelper::increase($form, $item->purchaseReceive->warehouse, $item->item, $item->quantity, $item->unit, $item->converter, $options);\n }\n }\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public function edit(Invoice $invoice)\n {\n //\n }", "public static function updateInvoiceById($id, $status, $rsa){\n $model = self::model()->findByPk($id);\n $model->reader_status = $status;\n $model->reader_supposed_amount = $rsa;\n $model->save();\n }", "private function syncInvoiceItems($invoice, $request)\n {\n if ($request->filled('invoice_items')) {\n\n $invoice_items = $request->get('invoice_items');\n\n foreach ($invoice_items as $item) {\n\n $item_id = $item['id'];\n\n if (!empty($item_id)) {\n // update existing invoice item\n\n $invoice_item = $this->invoiceItem->find($item_id);\n\n if ($invoice_item) {\n\n $item_data = collect($item)->except('id', 'invoice_id')->all();\n\n $invoice_item->update($item_data);\n }\n\n }\n else {\n // new invoice item\n\n $item_data = ['invoice_id' => $invoice->id] + collect($item)->except('id')->all();\n\n $this->invoiceItem->create($item_data);\n }\n }\n }\n }", "public function update(Request $request, $id)\n {\n //\n $invoice = Invoice::findOrFail($id);\n $invoice->update($request->all());\n return redirect('finance/invoice');\n }", "public function update(InvoiceRequest $request, Invoice $invoice)\n\t{\n\t\t// Validate Data from Form\n\t\t$validData = $request->validated();\n\n\t\t// Fill Data and Save Invoice\n\t\t$invoice->fill($validData);\n\t\t$invoice->save();\n\n\t\t// Set Notifications\n\t\tif (!$invoice->save()) {\n\t\t\t// if not saved\n\t\t\ttoastr()->error('An error has occurred. If it persists, contact the manager.');\n\t\t} else {\n\t\t\t// if edited\n\t\t\ttoastr()->success('The invoice was edited successfully!', 'Abigail Says...');\n\t\t}\n\n\t\t// Redirect\n\t\treturn redirect()->route('invoices.show', $invoice);\n\t}", "public function update(Invoices $model, UpdateInvoice $request): JsonResponse\n {\n return $this->doUpdate($model, $request);\n }", "public function update(InvoiceRequest $request, int $id): RedirectResponse\n {\n $invoice = $request->user()->invoice($id);\n\n $storedPath = $this->storeReceipt($request);\n\n if ($storedPath) {\n if ($invoice->receipt) {\n $invoice->trashReceipt();\n }\n $invoice->receipt = $storedPath;\n }\n\n $invoice->update($request->all());\n\n MessagingHelper::flashUpdated(\"invoice #{$invoice->number}\");\n\n return redirect()->intended();\n }", "public function update(Request $request, $id)\n {\n //\n $request->validate([\n 'kode'=>'required',\n 'harga'=> 'required|integer',\n ]);\n $purchaseInvoices = PurchaseInvoice::find($id);\n $purchaseInvoices->kode = $request->get('kode');\n $purchaseInvoices->harga = $request->get('harga');\n $purchaseInvoices->save();\n return redirect('/invoices')->with('success', 'Invoice has been updated');\n }", "public function update(Request $request, $id) {\n // Update method goes here\n $item = Multitenant::getModel('Invoice')::where('id', $id)->first();\n $item->id = $request->id;\n\n $item->save();\n\n return response()->json([\n \"message\" => \"Invoice has successfully redirected!\",\n \"status\" => \"success\",\n ], 200);\n }", "public function store()\n\t{\n\t\t$invoice = $this->invoices->store();\n\n $inv_items = Input::get('invoice_items');\n foreach($inv_items as $item) {\n $prop = [\n 'invoice_id' => $invoice->id,\n 'description' => $item['description'],\n 'product_id' => $item['product']['id'],\n 'vat' => $item['vat'],\n 'quantity' => $item['quantity'],\n 'unit_price' => $item['product']['price']\n ];\n $this->invoice_items->store($prop);\n }\n return $invoice;\n\t}", "public function update(Request $request, $id)\n {\n $ProductInvoice = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n $invoices->update($request->all());\n\n return back();\n }", "public function store(Request $request)\n {\n\n //$data = $request;\n // save the invoicerecords temoporirily in $records array\n //$records = array();\n // if its a new invoice then we dont need to calculatie privious quantity\n\n $data = $request->only([\n 'customer_id', 'invoicestatus_id',\n 'amount', 'courier_id', 'subtotal', 'date',\n 'payment', 'discount', 'notes'\n ]);\n $invoice = Invoice::create($data);\n //array_push($records,);\n for ($i = 0; $i < sizeof($request->rows); $i++) {\n //return $request->rows[$i];\n // updating the product\n\n $product = Product::find($request->rows[$i]['id']);\n\n // subtracting the quantity from the products table\n $product->update([\"quantity\" => $product->quantity - $request->rows[$i][\"quantity\"]]);\n\n\n InvoiceRecord::create([\n \"products_id\" => $request->rows[$i][\"id\"],\n \"invoice_id\" => $invoice->id,\n \"quantity\" => $request->rows[$i][\"quantity\"],\n \"name\" => $request->rows[$i][\"name\"],\n \"price\" => $request->rows[$i]['price'],\n \"selling_price\" => $request->rows[$i][\"selling_price\"],\n ]);\n // array_push($records, [\n // \"products_id\" => $request->rows[$i][\"id\"],\n // \"invoice_id\" => $invoice->id,\n // \"quantity\" => $request->rows[$i][\"quantity\"],\n // \"name\" => $request->rows[$i][\"name\"],\n // \"price\" => $request->rows[$i]['price'],\n // \"selling_price\" => $request->rows[$i][\"selling_price\"],\n // ]);\n }\n\n // for updating invoice. we needto calculate previous quantity\n\n\n\n // creating new invoicerecords\n // //dd($records);\n // for ($i = 0; $i < sizeof($request->rows); $i++) {\n // InvoiceRecord::create($records[$i]);\n // }\n\n return route('invoices.edit', $invoice->id);\n }", "public function update(Request $request, Company $company, InvoiceItem $invoiceItem)\n {\n //\n }", "public function update(Request $request, $id_payable_invoice)\n {\n $invoice = InvoicePayable::findOrFail($id_payable_invoice);\n $invoice->kode_invoice = $request->kode_invoice;\n $invoice->id_pegawai = $request['id_pegawai'] = Auth::user()->pegawai->id_pegawai;\n $invoice->tanggal_invoice = $request->tanggal_invoice;\n $invoice->tenggat_invoice = $request->tenggat_invoice;\n $invoice->deskripsi_invoice = $request->deskripsi_invoice;\n $invoice->total_pembayaran = $request->total_pembayaran;\n\n $invoice->status_prf ='Belum diBuat';\n $invoice->status_jurnal ='Belum diPosting'; \n $invoice->save();\n \n $invoice->Detailinvoice()->sync($request->sparepart);\n return $request;\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n\t\t'invoice_number'=>'required',\n\t\t'service_code'=>'required',\n\t\t'car_number'=>'required',\n\t\t'mobile'=>'required',\n\t\t'price'=>'required'\n\t\t]);\n\t\t$invoice=Invoice::find($id);\n\t\t$invoice->invoice_number=$request->get('invoice_number');\n\t\t$invoice->service_code=$request->get('service_code');\n\t\t$invoice->car_number=$request->get('car_number');\n\t\t$invoice->mobile=$request->get('mobile');\n\t\t$invoice->price=$request->get('price');\n\t\t$invoice->save();\n\t\treturn redirect()->route('invoice.index')->with('success','Data Updated');\n }", "function edit() {\n $this->wireframe->hidePrintButton();\n \n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'number' => $this->active_invoice->getNumber(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'currency_id' => $this->active_invoice->getCurrencyId(),\n 'purchase_order_number' => $this->active_invoice->getPurchaseOrderNumber(),\n 'private_note' => $this->active_invoice->getPrivateNote(),\n 'company_id' => $this->active_invoice->getCompanyId(),\n 'company_address' => $this->active_invoice->getCompanyAddress(),\n 'project_id' => $this->active_invoice->getProjectId(),\n 'note' => $this->active_invoice->getNote(),\n 'language_id' => $this->active_invoice->getLanguageId(),\n 'payment_type' => $this->active_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n if(is_foreachable($this->active_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($this->active_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'id'\t\t\t\t\t => $item->getId(),\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n 'time_record_ids' => $item->getTimeRecordIds(),\n );\n } // foreach\n } // if\n } // if\n \n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if ($this->request->isSubmitted()) {\n \tif (!$this->request->isAsyncCall()) {\n \t\t$this->response->badRequest();\n \t} // if\n \t\n \ttry {\n if (!is_foreachable($invoice_data['items'])) {\n throw new ValidationErrors(lang('At least one invoice item is required'));\n } // if\n\n \t\tDB::beginWork('Editing Invoice');\n\n \t\t$this->active_invoice->setAttributes($invoice_data);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n \t\t\n \t\tif ($this->active_invoice->isIssued()) {\n \t\t $issued_on = isset($invoice_data['issued_on']) ? new DateValue($invoice_data['issued_on']) : new DateValue();\n \t\t $this->active_invoice->setIssuedOn($issued_on);\n \t\t} //if\n\n \t\t\n \t\t$this->active_invoice->save();\n \n// TODO: resolve the issue when dialog has to be redirected to the notification page\n// $this->flash->success('\":number\" has been updated', array('number' => $this->active_invoice->getName()));\n// if ($this->active_invoice->isIssued()) {\n// $this->response->redirectTo('invoice_notify', array('invoice_id' => $this->active_invoice->getId()));\n// } else {\n// $this->response->redirectToUrl($this->active_invoice->getViewUrl()); \n// } // if\n\n \t\tDB::commit('Invoice Edited');\n\n\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \n \t} catch (Exception $e) {\n \t\tDB::rollback('Invoice Editing Failed');\n \t\t$this->response->exception($e);\n \t} // try\n \t\n } // if\n }", "public function update(Request $request, $id)\n\t{\n $validator = Validator::make($request->all(), [\n 'valor' => 'required',\n 'data' => 'required',\n 'descricao' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n\n\t\t$invoice = Invoice::findOrFail($id);\n\n\t\t$invoice->valor = $request->input(\"valor\");\n $invoice->data = Carbon::createFromFormat('d/m/Y', $request->input(\"data\"));\n $invoice->descricao = $request->input(\"descricao\");\n\n\t\t$invoice->save();\n\n\t\treturn redirect()->route('invoices.index')->with('message', 'Item updated successfully.');\n\t}", "public function update(Request $request, Company $company, OldInvoiceItem $oldInvoiceItem)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $po = Purchaseorder::findOrFail($id);\n $po->isDelivery = Input::get('isDelivery');\n $po->save();\n return redirect()->route('stocks.index')->with('message','This invoice has been updated successfully!');\n }", "function update_invoices($id,$params)\n {\n $this->company_db->where('id',$id);\n $this->company_db->update('tbl_invoice_header',$params);\n }", "public function edit(Invoices $invoices)\n {\n //\n }", "private function _updateInvoices($order, $message)\n {\n $invoices = $order->getInvoiceCollection();\n $state = Mage_Sales_Model_Order::STATE_PROCESSING;\n $payment = $order->getPayment();\n $transaction;\n $session = Mage::getSingleton('checkout/session');\n $szNewCrossReference;\n\n $transactionId = $payment->getLastTransId();\n $transaction = $payment->getTransaction($transactionId);\n $transactionType = $transaction->getTxnType();\n \n if($session->getNewCrossReference())\n {\n $szNewCrossReference = $session->getNewCrossReference();\n $value = $transaction->setTxnId($szNewCrossReference);\n $transaction->save();\n $payment->setLastTransId($szNewCrossReference);\n \n $session->setNewCrossReference(null);\n }\n \n foreach ($invoices as $invoice)\n {\n // set the invoice state to be \"Paid\"\n $invoice->pay()->save();\n }\n // add a comment to the order comments\n if($transactionType == 'authorization')\n {\n $order->setState($state, 'pys_preauth', $message, true);\n }\n else if($transactionType == 'capture')\n {\n $order->setState($state, 'pys_paid', $message, true);\n }\n else \n {\n Mage::throwException('invalid transaction type [' . $transactionType . '] for invoice updating');\n }\n $order->save();\n }", "public function update(UpdateInvoicesRequest $request, $id)\n {\n if (! Gate::allows('invoice_edit')) {\n return abort(401);\n }\n $invoice = Invoice::findOrFail($id);\n $invoice->update($request->all());\n\n return redirect()->route('invoices.index');\n }", "public function whmcs_update_invoice($params = array()) {\n\t\t$params['action'] = 'UpdateInvoice';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function update(): int {\n $this->updateTime = new DateTime();\n $vals = [$this->appt->appId, $this->createTime->format(Settings::$MYSQL_DATETIME_FORMAT),\n $this->updateTime->format(Settings::$MYSQL_DATETIME_FORMAT), $this->state, $this->taxRate,\n $this->amtDue, $this->amtPayed, $this->discRate];\n if ($this->invoiceId === -1) {\n return $this->insert($vals);\n }\n $vals[] = $this->invoiceId;\n $where = 'invoice_id = ?';\n return $this->updateTable($where, $vals);\n }", "public function update(Request $request, Invoice $invoice)\n {\n // dd($request->all());\n\n $rules = [\n 'invoice_number' => 'nullable',\n 'invoice_date' => 'required|string',\n 'due_date' => 'required|string',\n 'section_id' => 'required|integer',\n 'product' => 'required|string',\n 'amount_collection' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'amount_commission' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'discount' => 'nullable|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'rat_vat' => 'required|integer',\n 'value_vat' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n 'total' => 'required|regex:/^\\d+(\\.\\d{1,2})?$/',\n \"payment_date\" => 'nullable|string',\n 'note' => 'nullable|string|max:500',\n ];\n\n $niceNames = [\n 'invoice_number' => 'رقم الفاتورة',\n 'invoice_date' => 'تاريخ الفاتورة',\n 'due_date' => 'تاريخ الاستحقاق',\n 'section_id' => 'القسم',\n 'product' => 'المنتج',\n 'amount_collection' => 'مبلغ التحصيل',\n 'amount_commission' => 'مبلغ العمولة',\n 'discount' => 'الخصم',\n 'rat_vat' => 'نسبة ضريبة القيمة المضافة',\n 'value_vat' => 'قيمة ضريبة القيمة المضافة',\n 'total' => 'الاجمالي شامل الضريبة',\n 'payment_date' => 'تاريخ الدفع',\n 'note' => 'الملاحظات',\n ];\n\n $data = $this->validate($request, $rules, [], $niceNames);\n\n // Exception of the invoice number because I created a file with that number in the attachments Storage\n // not change the number\n Arr::except($data, ['invoice_number']);\n\n // invoice_status() return status from helper file\n $stats = $request->value_status;\n $data[\"status\"] = invoice_status()[$stats];\n $data[\"value_status\"] = $stats;\n\n // update invoice\n $invoice->fill($data)->save();\n\n // update invoice details table\n // history invoice details table (invoices_details)\n $details = new InvoiceDetails();\n $details->id_invoice = $invoice->id;\n $details->invoice_number = $invoice->invoice_number;\n $details->product = $invoice->product;\n $details->section_id = $invoice->section_id;\n $details->status = $data['status'];\n $details->value_status = $data['value_status'];\n $details->note = $invoice->note;\n $details->user = auth()->user()->name;\n $details->payment_date = $invoice->payment_date;\n $details->save();\n\n // add notification in the dashboard\n // show notification for all users has permission to show notifications\n // not show notification for user added update invoice\n\n $users = User::where('id', \"!=\", auth()->user()->id)->get();\n $details = [\n \"invoice_id\" => $invoice->id,\n \"archive_url\"=>null,\n \"added_by\" => auth()->user()->name,\n \"msg\" => 'قام <span class=\"badge badge-pill badge-info\">' . auth()->user()->name . '</span> بتعديل فاتورة',\n ];\n Notification::send($users, new add_invoice_notification($details));\n\n $request->session()->flash('msgSuccess', \"تم تعديل الفاتورة بنجاح\");\n return redirect(adminUrl(\"invoices/\" . $invoice->id));\n\n }", "public function update_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (!empty($_POST)) {\n\t\t\t\t$invoiceNumber = $this->input->post('invoiceNumber');\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$condition = array('invoice_number' => validateInput($invoiceNumber));\n\t\t\t\t$result = $this->CustomModel->getWhere($tableName, $condition);\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\n\t\t\t\tif ($result > 0) {\n\t\t\t\t\tjson_encode(array('messages' => 'Invoice already exist', 'type' => 'worning'));\n\t\t\t\t} else {\n\t\t\t\t\tif (!empty($_POST)) {\n\t\t\t\t\t\t$productlist = $this->input->post('products');\n\t\t\t\t\t\t$doi = $this->input->post('dateOfinvoice');\n\t\t\t\t\t\t$date = yymmdd($doi);\n\t\t\t\t\t\t$rows = array();\n\t\t\t\t\t\tfor ($i = 0; $i < count($productlist); $i++) {\n\n\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t'invoice_number' => validateInput($this->input->post('invoiceNumber')),\n\t\t\t\t\t\t\t\t'invoice_date' => $date,\n\t\t\t\t\t\t\t\t'item_code' => validateInput($productlist[$i]['producCode']),\n\t\t\t\t\t\t\t\t'item_description' => validateInput($productlist[$i]['producDetails']),\n\t\t\t\t\t\t\t\t'closing_stock' => $productlist[$i]['productQuantity'],\n\t\t\t\t\t\t\t\t'qty' => $productlist[$i]['productQuantity'],\n\t\t\t\t\t\t\t\t'rate' => $productlist[$i]['productRate'],\n\t\t\t\t\t\t\t\t'amount' => $productlist[$i]['productAmount'],\n\t\t\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tarray_push($rows, $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// print_r($rows);\n\n\t\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t\t$result = $this->CustomModel->insertBatch($tablename, $rows);\n\t\t\t\t\t\t// print_r($result);\n\t\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t\techo json_encode(array('messages' => 'Invoice submited successfully', 'type' => 'success'));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo json_encode(array('messages' => 'Something went worng please contact IT', 'type' => 'error'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function update(PurchasesInvoice $purchasesInv , Request $request)\n {\n \n $purchasesInv->update(\n request()->validate([\n 'name' => ['required'],\n 'amount' => ['required'],\n 'mobile_num' => ['required'], \n 'products' => ['required'],\n 'quantity' => ['required'],\n 'type' => ['required'],\n ])\n );\n\n // return (request()->all());\n\n return redirect('/dashboard/invoices/purchasesInvoice/show');\n }", "public function _update_invoice($invoice_id)\n\t{\n\t\t$invoice_number = $this->create_invoice_number();\n\t\t\n\t\t$data = array(\n\t\t\t\t'user_id'=>$this->input->post('user_id'),\n\t\t\t\t'payment_method'=>$this->input->post('payment_method'),\n\t\t\t\t'invoice_status'=>1,\n\t\t\t\t'invoice_instructions'=>$this->input->post('invoice_instructions'),\n\t\t\t\t'modified_by'=>$this->session->userdata('user_id')\n\t\t\t);\n\t\t\n\t\t$this->db->where('invoice_id', $invoice_id);\n\t\tif($this->db->update('invoice', $data))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function editInvoice($id)\n {\n $user = auth()->user();\n $datosFactura = DB::table('quotes')\n ->select('quotes.account_id', 'quotes.created_by_id', 'quotes.id as quoteId', 'quotes.quote_date',\n 'accounts.name as accountName','users.name as userName','quotes.stage_id',\n 'quotes.invoice_date',\n 'accounts.document_number','document_types.name as documenttype')\n ->join('accounts', 'accounts.id', '=', 'quotes.account_id')\n ->join('document_types', 'document_types.id', '=', 'accounts.document_type_id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->where('users.organization_id', $user->organization_id)\n ->where('quotes.id', $id)->first();\n $files = DB::table('quotes')\n ->select('quote_files.name', 'quote_files.id')\n ->join('quote_files', 'quote_files.quote_id', '=', 'quotes.id')\n ->join('users', 'users.id', '=', 'quotes.created_by_id')\n ->where('quotes.id', $id)\n ->where('users.organization_id', $user->organization_id)->get();\n $invoice_date = $datosFactura->invoice_date !== null ? $datosFactura->invoice_date : date(\"Y-m-d\");\n return view('quote.editInvoice',compact('datosFactura','id','invoice_date','files'));\n }", "public function InvoiceUpdate(Request $request) {\n try\n {\n $InvoiceSelections = DB::table('hdpos_invoice')\n ->leftJoin('items', DB::raw('hdpos_invoice.itemid::integer'), '=', 'items.id' )\n ->where('invoicenumber', (string)$request->invoiceNumber)\n ->select('items.id','items.bnumber','hdpos_invoice.spotdiscountchkbox','hdpos_invoice.discountchkbox','items.itemname','items.openstock','items.minstock','items.isactive','items.notforsale','items.ispurchased','items.online','items.categoryname','items.subcategoryname','items.desc','items.featured_image','items.mrp','items.disc1','items.disc2','items.discvalue','items.finalprice','items.createdby','items.modifiedby','items.created_at','items.updated_at','hdpos_invoice.id','hdpos_invoice.invoicenumber','hdpos_invoice.itemid','hdpos_invoice.amount','hdpos_invoice.quantity','hdpos_invoice.discount','hdpos_invoice.spotdiscountpercent','hdpos_invoice.spotdiscountamount','hdpos_invoice.status','hdpos_invoice.createdby','hdpos_invoice.modifiedby','hdpos_invoice.created_at','hdpos_invoice.updated_at','hdpos_invoice.invoicedate')\n ->orderBy('items.id', 'DESC')\n ->get();\n\n return response()->json($InvoiceSelections);\n }\n catch(\\Exception $Exe)\n {\n return $Exe-> getMessage();\n }\n }", "public function update($id)\n {\n $update = 'added new price';\n $v = Validator::make(Input::all(),\n [\n 'finalproductdescription' => 'required',\n 'finalpriceperperson' => 'required',\n 'member' => 'min:1'\n\n ]\n );\n\n if (!$v->passes()) {\n return Response::json(['errors' => $v->errors()]);\n } else {\n $invoiceproduct = InvoiceProduct::find($id);\n\n if (Input::has('isupdate')) {\n $update = 'updated';\n $invoiceproductprice = InvoiceProductPrice::find(Input::get('isupdate'));\n if ($invoiceproductprice->exists) {\n $invoiceproductprice->price = Input::get('finalpriceperperson');\n $invoiceproductprice->description = Input::get('finalproductdescription');\n $invoiceproductprice->save();\n\n DB::table('invoice_lines')->where('invoice_product_price_id', '=', $invoiceproductprice->id)->delete();\n } else {\n return Response::json(['errors' => 'Could not find Product price']);\n }\n } else {\n $invoiceproductprice = new InvoiceProductPrice();\n $invoiceproductprice->invoice_product_id = $invoiceproduct->id;\n $invoiceproductprice->price = Input::get('finalpriceperperson');\n $invoiceproductprice->description = Input::get('finalproductdescription');\n $invoiceproductprice->save();\n }\n\n if (Input::has('member')) {\n $i = 0;\n foreach (Input::get('member') as $m) {\n $invoiceline = new InvoiceLine();\n $invoiceline->invoice_product_price_id = $invoiceproductprice->id;\n $invoiceline->member_id = $m;\n $invoiceline->save();\n if ($invoiceline->exists) {\n $i++;\n }\n }\n }\n\n return Response::json(['success' => true, 'message' => $invoiceproduct->name . ' Successfully ' . $update . ', '\n . $invoiceproductprice->price . ' per person.'\n . $i . ' Total persons' ]);\n }\n }", "public function update(Request $request, $id)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'invoices_no' => 'required',\n /*'dot' => 'required|before_or_equal:'.date('Y-m-d')],[\n 'dot.before_or_equal' => 'Please set the date to today or before'*/\n ]);\n\n if ($validator->fails())\n { //dd($validator);\n return redirect('bpenb/'.$id.'/edit')->withInput()->withErrors($validator); }\n else\n {\n $inv = Bpenb::findOrFail($id);\n $inv->invoices_no = $input['invoices_no'];\n $inv->bank = $input['bank'];\n $inv->pay_from = $input['pay_from'];\n $inv->given_by = $input['given_by'];\n $inv->dot = $input['dot'];\n $inv->nominal = $input['nominals'];\n $inv->user_id = $input['user_id'];\n $inv->aiw = $input['aiw'];\n $inv->memo = $input['memo'];\n $inv->save();\n\n if($input['iddet'] != 0 && $input['iddet'] != \"\") {\n $iddet = explode(\"|\", $input['iddet'], -1);\n foreach ($iddet as $i) {\n BpenbDetail::where('id',$i)->update(['id_bpenb' => $inv->id]);\n }\n }\n\n if($request->submitbutton == 'saveprint') {\n //DB::table('invoices')->where('invoices_no',$input['invoices_no'])->update(['status' => 'p']);\n $invid = Bpenb::where('id',$inv->id)->value('id');\n return view('bpenb.print',compact('invid'));\n }\n\n Session::flash('flash_message','Bank In Transaction updated');\n return redirect('bpenb');\n }\n }", "public function edit($id)\n {\n $po = Purchaseorder::findOrFail($id);\n $po->isDelivery = 1;\n $po->save();\n return redirect()->route('stocks.index')->with('message','This invoice has been updated successfully!');\n }", "public function update(Request $request, $id)\n {\n try {\n $otra_provision = DocumentToPay::findOrfail($id);\n $otra_provision->periodo_id = Session::get('period_id');\n $otra_provision->unegocio_id = 1;\n $otra_provision->fechaproceso = $request->processdate;\n $otra_provision->sucursal_id = $request->subsidiary;\n $otra_provision->origen = $request->type;\n $otra_provision->tercero_id = $request->customer;\n $otra_provision->tipotransaccion_id = $request->transactiontype;\n $id_moneda = $request->currency;\n $otra_provision->moneda_id = $id_moneda;\n $moneda = Currency::findOrfail($id_moneda);\n if ($moneda->tipo == 'O') {\n $otra_provision->tcmoneda = $request->txt_tc;\n } else {\n $otra_provision->tcmoneda = 0;\n }\n $otra_provision->documento_id = $request->documenttype;\n $otra_provision->seriedoc = $request->series;\n $otra_provision->numerodoc = $request->number;\n $otra_provision->fechadoc = $request->date;\n $otra_provision->tcambio = $request->changerate;\n $otra_provision->condicionpago_id = $request->paymentcondition;\n $otra_provision->vencimiento = $request->expdatea;\n $otra_provision->glosa = $request->comment;\n $otra_provision->total = $request->total;\n $otra_provision->ventana = $this->ventana;\n $tercero = Customer::findOrfail($request->customer);\n $otra_provision->razonsocial = $tercero->descripcion;\n $otra_provision->ruc = $tercero->codigo;\n $otra_provision->direccion = $request->address;\n $otra_provision->usuario = Auth::id();\n\n DB::transaction(function () use ($otra_provision, $request) {\n $otra_provision->save();\n if ($request->paymentway != null) {\n $this->insertar_docbanco($otra_provision->id, $request);\n }\n });\n\n $r[\"estado\"] = \"ok\";\n $r[\"mensaje\"] = \"Grabado Correctamente\";\n\n } catch (PDOException $e) {\n $r[\"estado\"] = \"error\";\n $r[\"mensaje\"] = \"Error al Grabar!\";\n $r[\"bd\"] = $e->getMessage();\n }\n\n $r[\"proceso\"] = $request->proceso;\n\n return $r;\n }", "public function updateInvoiceDetail($pid, $iid, $qty, $selling_price, $total)\n {\n }", "public function update(Request $request, $id)\n {\n $data = MsSales::find($id);\n\n\n if ($data) {\n $data->update($request->all());\n\n $alsal = $data->no_invoice;\n\n return redirect(route('sales.index'))->with('toast_info', \"Data With Invoice Number $alsal, Successfully Updated\");\n\n } else {\n # code...\n }\n \n }", "public function edit(ImportInvoice $importInvoice)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $po = Purchaseorder::findOrFail($id);\n if(Input::get(\"vat\")==1){\n $vat = SetValue::where('id','=',11)->where('status','=',1)->value('value');\n $po->vat = $vat;\n }else{\n $po->vat =0;\n }\n if(Input::get(\"diposit\")!=''){\n $po->diposit = Input::get(\"diposit\");\n }else{\n $po->diposit =0;\n }\n if(Input::get(\"rate\")!=''){\n $po->rate= Input::get(\"rate\");\n }else{\n $po->rate=0;\n }\n $po->printedBy = Auth::user()->id; \n $po->save();\n return redirect()->route('invoicePO.index');\n }", "public function update(UpdateInvoiceRequest $request, $id)\n {\n if ($request->get('multiple_codes') == null) {\n Session::flash('message_danger', 'Falta al menos un código de autorización por llenar');\n return redirect()->back()->withInput();\n }\n\n foreach ($request->get('multiple_codes') as $key => $value) {\n if ($request->get('multiple_days')[$key] == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de días por llenar');\n return redirect()->back()->withInput();\n }\n if ($request->get('multiple_totals')[$key] == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de total por llenar');\n return redirect()->back()->withInput();\n }\n if ($value == \"\") {\n Session::flash('message_danger', 'Falta al menos un campo de autorización por llenar');\n return redirect()->back()->withInput();\n }\n }\n Invoice::updateRecord($request, $id);\n\n Session::flash('message', 'Factura actualizada exitosamente');\n return redirect()->route('invoice.index');\n }", "function ciniki_sapos_invoiceUpdatePrices($ciniki, $tnid, $invoice_id, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'itemCalcAmount');\n\n //\n // Get the items from the invoice that have an object defined\n //\n $strsql = \"SELECT id, object, object_id, price_id, quantity, \"\n . \"unit_amount, unit_discount_amount, unit_discount_percentage, unit_preorder_amount \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['rows']) ) {\n // No items to update\n return array('stat'=>'ok');\n }\n $items = $rc['rows'];\n\n //\n // Update the item prices\n //\n foreach($items as $item) {\n //\n // Get the new price for the object\n //\n if( $item['object'] != '' && $item['object_id'] != '' ) {\n list($pkg,$mod,$obj) = explode('.', $item['object']);\n $rc = ciniki_core_loadMethod($ciniki, $pkg, $mod, 'sapos', 'itemLookup');\n if( $rc['stat'] == 'ok' ) {\n $fn = $rc['function_call'];\n $rc = $fn($ciniki, $tnid, array(\n 'object'=>$item['object'],\n 'object_id'=>$item['object_id'],\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['item']) ) {\n if( $rc['item']['price_id'] != $item['price_id'] ) {\n $update_args['price_id'] = $rc['item']['price_id'];\n }\n if( $rc['item']['unit_amount'] != $item['unit_amount'] ) {\n $update_args['unit_amount'] = $rc['item']['unit_amount'];\n }\n if( $rc['item']['unit_discount_amount'] > 0\n && $rc['item']['unit_discount_amount'] != $item['unit_discount_amount'] ) {\n $update_args['unit_discount_amount'] = $rc['item']['unit_discount_amount'];\n }\n if( $rc['item']['unit_discount_percentage'] > 0 \n && $rc['item']['unit_discount_percentage'] != $item['unit_discount_percentage'] ) {\n $update_args['unit_discount_percentage'] = $rc['item']['unit_discount_percentage'];\n }\n if( $rc['item']['unit_preorder_amount'] > 0 \n && $rc['item']['unit_preorder_amount'] != $item['unit_preorder_amount'] ) {\n $update_args['unit_preorder_amount'] = $rc['item']['unit_preorder_amount'];\n }\n }\n }\n }\n\n //\n // Calculate new item totals\n //\n $rc = ciniki_sapos_itemCalcAmount($ciniki, array(\n 'quantity'=>$item['quantity'],\n 'unit_amount'=>(isset($update_args['unit_amount'])?$update_args['unit_amount']:$item['unit_amount']),\n 'unit_discount_amount'=>(isset($update_args['unit_discount_amount'])?$update_args['unit_discount_amount']:$item['unit_discount_amount']),\n 'unit_discount_percentage'=>(isset($update_args['unit_discount_percentage'])?$update_args['unit_discount_percentage']:$item['unit_discount_percentage']),\n 'unit_preorder_amount'=>(isset($update_args['unit_preorder_amount'])?$update_args['unit_preorder_amount']:$item['unit_preorder_amount']),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $update_args['subtotal_amount'] = $rc['subtotal'];\n $update_args['discount_amount'] = $rc['discount'];\n $update_args['total_amount'] = $rc['total'];\n\n //\n // Update the item \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.sapos.invoice_item', \n $item['id'], $update_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n }\n\n\n\n return array('stat'=>'ok');\n}", "public function store(Request $request) {\n\n $this->validate($request, [\n 'estimate_id' => 'required|numeric'\n ]);\n\n $estimate = Estimate::find($request->estimate_id);\n\n $pre_invoice = Invoice::where('estimate_id', $request->estimate_id)->first();\n\n if (is_object($pre_invoice)) {\n $pre_invoice->update(['amount' => $estimate->estimate]);\n $invoice = $pre_invoice;\n }else{\n\n $createinvoice = Invoice::create(['user_id' => Auth::user()->id, 'issue_date' => $estimate->start, 'due_date' => $estimate->end, 'estimate_id' => $estimate->id, 'amount' => $estimate->estimate, 'currency_id' => $estimate->currency_id]);\n\n $invoice = $createinvoice;\n\n // $estimate->update(['invoice_id' => $createinvoice->id]);\n $estimate->project->update(['invoice_id' => $createinvoice->id]);\n }\n $createinvoice = Invoice::create(['user_id' => Auth::user()->id, 'issue_date' => $estimate->start, 'due_date' => $estimate->end, 'estimate_id' => $estimate->id, 'amount' => $estimate->estimate, 'currency_id' => $estimate->currency_id]);\n $invoice = Invoice::whereId($createinvoice->id)->with('estimate')->first();\n\n\n\n $invoice->estimate;\n // return $invoice;\n\n return view('invoices.reviewinvoice')->with('invoice', $invoice);\n }", "public function edit(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function update(Request $request, $id)\n {\n if(!in_array(Auth::user()->role,['Admin']))\n return view('home')->with('message','You are not authorized for the page you tried to visit');\n $data = $request->validate([\n 'pono' => 'required',\n 'customer_id' => 'required',\n 'remarks' => ''\n ]);\n $invoice = Invoice::find($id);\n if($invoice->update($data)){\n $request->session()->flash('success','Update succesfully'); \n return redirect('invoice');\n }\n\n //\n }", "public function update(Request $request, CustomerInvoiceEmail $customerInvoiceEmail)\n {\n //\n }", "public function update(ItemRequest $request, $id)\n\t{\n $batch_arr = Input::get('batch_arr');\n\t\t\t$count = count($batch_arr['batch_no']);\n\t // process inventory\n\t\t\t$tempTotalQuantity=0;\n\t if($count != 0)\n\t\t\t{\n\t\t\t\tfor ($i=0; $i < $count ; $i++) {\n \t\t\tif ($batch_arr['batch_no'][$i] != '') {\n \t\t\t\t$inventories = Inventory::where('item_id', $id)->where('batch_no',$batch_arr['batch_no'][$i])->get();\n\t\t\t\t\t\tif($inventories->isEmpty()){\n\n\t\t \t\t\t$newInventory = new Inventory;\n\t\t \t\t\t$newInventory->batch_no = $batch_arr['batch_no'][$i];\n\t\t\t\t\t\t\t$newInventory->item_id = $id;\n\t\t\t\t\t\t\t$newInventory->user_id = Auth::user()->id;\n\t\t\t\t\t\t\t$newInventory->in_out_qty = $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t$tempTotalQuantity += $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t$newInventory->expiry_date = $batch_arr['expiry'][$i];\n\t\t\t\t\t\t\t$newInventory->remarks = 'Manual Edit of Quantity';\n\t\t\t\t\t\t\t$newInventory->save();\n\n\t\t \t\t}\n\t\t \t\telse\n\t\t \t\t{\n\t\t\t\t\t\t\tforeach ($inventories as $index => $inventory) {\n\t\t\t\t\t\t\t\t$inventory->batch_no = $batch_arr['batch_no'][$i];\n\t\t\t\t\t\t\t\t$inventory->item_id = $id;\n\t\t\t\t\t\t\t\t$inventory->user_id = Auth::user()->id;\n\t\t\t\t\t\t\t\t$inventory->in_out_qty = $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t\t$tempTotalQuantity += $batch_arr['quantity'][$i];\n\t\t\t\t\t\t\t\t$inventory->expiry_date = $batch_arr['expiry'][$i];\n\t\t\t\t\t\t\t\t$inventory->remarks = 'Manual Edit of Quantity';\n\t\t\t\t\t\t\t\t$inventory->save();\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}\n $items = Item::find($id);\n $items->item_code = Input::get('item_code');\n $items->item_name = Input::get('item_name');\n $items->size = Input::get('size');\n $items->description = Input::get('description');\n $items->cost_price = Input::get('cost_price');\n $items->selling_price = Input::get('selling_price');\n $items->quantity = $tempTotalQuantity;\n $items->save();\n // process avatar\n $image = $request->file('avatar');\n\t\t\tif(!empty($image)) {\n\t\t\t\t$avatarName = 'item' . $id . '.' . \n\t\t\t\t$request->file('avatar')->getClientOriginalExtension();\n\n\t\t\t\t$request->file('avatar')->move(\n\t\t\t\tbase_path() . '/public/images/items/', $avatarName\n\t\t\t\t);\n\t\t\t\t$img = Image::make(base_path() . '/public/images/items/' . $avatarName);\n\t\t\t\t$img->resize(100, null, function ($constraint) {\n\t\t\t\t\t$constraint->aspectRatio();\n\t\t\t\t});\n\t\t\t\t$img->save();\n\t\t\t\t$itemAvatar = Item::find($id);\n\t\t\t\t$itemAvatar->avatar = $avatarName;\n\t $itemAvatar->save();\n \t}\n Session::flash('message', 'You have successfully updated item');\n return Redirect::to('items');\n\t}", "public function setInvoice(Invoice $invoice)\n {\n $this->invoice = $invoice;\n }", "public function repaymentUpdate(Request $request)\n {\n try{\n $repaymentInvoice = PurchaseInvoiceRepayment::find($request->get('id'));\n $purchaseInvoice = PurchaseInvoiceHeader::find($repaymentInvoice->purchase_invoice_header_id);\n\n // Validate payment value\n $oldRepayment = $repaymentInvoice->repayment_amount;\n $temp = Utilities::toFloat($request->input('payment_edit'));\n $leftPayment = $purchaseInvoice->total_payment - $oldRepayment;\n\n if(($temp + $leftPayment) > $purchaseInvoice->total_payment){\n Session::flash('message', 'Pelunasan melebihi total Invoice!');\n return Response::json(array('success' => 'INVALID'));\n }\n\n $user = \\Auth::user();\n $date = $request->get('date');\n $tempDate = strtotime($date);\n $now = date('Y-m-d', $tempDate);\n $repaymentInvoice->repayment_amount = $temp;\n $repaymentInvoice->date = $now;\n $repaymentInvoice->updated_by = $user->id;\n $repaymentInvoice->save();\n\n //Get all Repayment Amount\n $tempTotal = 0;\n $allRepayment = PurchaseInvoiceRepayment::where('purchase_invoice_header_id', $purchaseInvoice->id)->get();\n foreach ($allRepayment as $data){\n $tempTotal += $data->repayment_amount;\n }\n $purchaseInvoice->repayment_amount = $tempTotal;\n $purchaseInvoice->save();\n\n Session::flash('message', 'Berhasil mengubah pelunasan');\n return Response::json(array('success' => 'VALID'));\n }\n catch(\\Exception $ex){\n return Response::json(array('errors' => 'INVALID'));\n }\n\n }", "public function update(AdminInvoiceRequest $request, AdminInvoiceModel $admin_invoice_show)\n {\n $admin_invoice_show->update($request->all());\n if(strtoupper($admin_invoice_show->confirmation)==\"PAID\"){\n AdminPaymentModel::create([\n 'patient_name' => $admin_invoice_show['patient_name'],\n 'invoice' => \"3-2-\".$admin_invoice_show['id'],\n 'amount' => $admin_invoice_show['grand_total'],\n ]);\n }\n return redirect()->route('admin_invoice_show.index')->with(\"message\",\"Updated Successfully!\");\n }", "public function update($id)\n {\n $allInputs = Input::all();\n\n $validator = Validator::make($allInputs, $this->invoicesModel->getRules('STORE'));\n\n if ($validator->fails()) {\n return Redirect::back()->with('message_danger', $validator);\n } else {\n if ($this->invoicesModel->updateRow($id, $allInputs)) {\n return Redirect::to('invoices')->with('message_success', $this->language->getMessage('messages.SuccessInvoicesStore'));\n } else {\n return Redirect::back()->with('message_danger', $this->language->getMessage('messages.ErrorInvoicesStore'));\n }\n }\n }", "public function actionUpdateInvoice($id)\n {\n $this->checkPrivilege();\n $model = $this->findModel($id);\n $invoice = Invoice::findOne(['id_peneliti' => $model->id]);\n $modelsBahan = $model->rekapitulasiBahan;\n\n if ($invoice->load(Yii::$app->request->post())) {\n\n $oldIDs = ArrayHelper::map($modelsBahan, 'id', 'id');\n $modelsBahan = Model::createMultiple(RekapitulasiBahan::classname(), $modelsBahan);\n Model::loadMultiple($modelsBahan, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelsBahan, 'id', 'id')));\n $invoice->total_biaya=0;\n $invoice->save();\n // validate all models\n $valid = $invoice->validate();\n $valid = Model::validateMultiple($modelsBahan) && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $invoice->save(false)) {\n if (!empty($deletedIDs)) {\n RekapitulasiBahan::deleteAll(['id' => $deletedIDs]);\n }\n foreach ($modelsBahan as $modelBahan) {\n $modelBahan->id_peneliti = $model->id;\n $invoice->total_biaya += $modelBahan->harga;\n if (! ($flag = $modelBahan->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $invoice->save();\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('updateInvoice', [\n 'model' => $model,\n 'invoice' => $invoice,\n 'modelsBahan' => (empty($modelsBahan)) ? [new RekapitulasiBahan] : $modelsBahan,\n ]);\n }", "public function update(Request $request, $id)\n {\n $this->service->update($request->all(), $id);\n\n return redirect(route('invoice.index'))->with('success', 'Invoice updated successfully!');\n }", "public function updateInvoice($id, $invoiceArray)\n {\n $responseString = $this->apiCall('PUT', 'invoices/'.$id, json_encode($invoiceArray));\n try\n {\n $responseObject = $this->parseResponse($responseString);\n return $responseObject->Invoice;\n }\n catch(Exception $e)\n {\n echo 'Can`t parse API response: '.$e->getMessage;\n return false;\n }\n }", "public function updated(CustomerInquiry $customerInquiry)\n {\n\n }", "public function update(Request $request, $id)\n {\n $purchases = Purchase::findOrFail($id);\n $this->validate($request, [\n 'supplier_name' => 'required',\n 'payment_status' => 'required',\n 'net_loading_in_litres' => 'required',\n 'total_cost' => 'required|numeric',\n 'amount_paid' => 'required|numeric',\n 'balance' => 'required|numeric',\n 'payment_mode' => 'required',\n 'transaction_code' => 'required',\n 'transaction_date' => 'required'\n ]);\n $input=$request->all();\n \n $supplierName = Inventory::where(\"supplier_number\", \"=\", $request->supplier_name_from_inventory)->get();\n\n $supplierName=\"\";\n $transRefNo = \"SupplierPayment-\" . $id;\n $transaction = \\App\\Transaction::where('trn_ref_no', '=', $transRefNo)\n ->get();\n $trans= $transaction->toArray();\n $transaction = Transaction::findOrFail($trans[0]['id']);\n $transaction->delete();\n\n $transRefNo = \"SupplierPayment-(\" . $id.\")\";\n $transaction = \\App\\Transaction::where('trn_ref_no', '=', $transRefNo)\n ->get();\n $trans = $transaction->toArray();\n $transaction = Transaction::findOrFail($trans[0]['id']);\n $transaction->delete();\n\n\n $transaction = new Transaction();\n $transaction->trn_ref_no = \"SupplierPayment\" . \"-\" . $id;\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = $request->product_type;\n $transaction->liters = 0;\n $transaction->total_cost = 0;\n $transaction->amount_paid = $request->amount_paid;\n $transaction->balance = $request->balance;\n $transaction->narration = \"Payment to supplier\";\n\n $transaction->transaction_code = $request->transaction_code;\n $transaction->customer_name = \"\";\n $transaction->payment_status = $request->payment_status;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->unit_price = $request->price_per_litre;\n $transaction->posted_from = \"SupplierPayment\";\n $supplier = \"\";\n $transaction->supplier_name = $supplierName;\n $transaction->payment_mode = $request->payment_mode;\n $transaction->bank_name = $request->bank_name;\n $transaction->cheque_number = $request->cheque_number;\n $transaction->payment_status = $request->payment_status;\n $transaction->account_number = $request->account_number;\n $transaction->save();\n\n\n $transaction = new Transaction();\n $transaction->trn_ref_no = \"SupplierPayment\" . \"-(\" . $id . \")\";\n $transaction->transaction_date = $request->transaction_date;\n $transaction->product_type = $request->product_type;\n $transaction->liters = 0;\n $transaction->total_cost = 0;\n $transaction->amount_paid = $request->total_shortage;\n $transaction->balance = 0;\n $transaction->narration = \"shortage\";\n $transaction->supplier_rate = $request->unit_price;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->transaction_code = $request->transaction_code;\n $transaction->customer_name = \"\";\n $transaction->payment_status = $request->payment_status;\n $transaction->shortages = $request->shortages_in_litres;\n $transaction->unit_price = $request->price_per_litre;\n $transaction->posted_from = \"SupplierPayment\";\n $supplier = \"\";\n $transaction->supplier_name = $supplierName;\n $transaction->payment_mode = $request->payment_mode;\n $transaction->bank_name = $request->bank_name;\n $transaction->cheque_number = $request->cheque_number;\n $transaction->payment_status = $request->payment_status;\n $transaction->account_number = $request->account_number;\n $transaction->save();\n\n\n \n $purchases->update($input);\n\n\n \n Session::flash('flash_message', 'Record successfully Updated!');\n\n return redirect()->back();\n }", "public function store(Request $request, Invoice $invoice)\n {\n }", "public function update(Request $request, $id)\n {\n //\n\t\t$Invoice=Invoice::find($id);\n\t\t$validated=$request->validate([\n\t\t\t'invoice_startmonth'=>'required|min:5',\n\t\t\t'invoice_endmonth'=>'required|min:5',\n\t\t\t'invoice_wordtrack'=>'required|min:2|regex:/(^([A-Z]+)(\\d+)?$)/u',\n\t\t\t'invoice_startnumber'=>'required|min:8',\n\t\t\t'invoice_endnumber'=>'required|min:8',\n\t\t\t'invoice_currentnumber'=>'required|min:8',\n\t\t]);\n\t\t$Invoice->update($validated);\n\t\t\n\t\treturn redirect('invoice');\n }", "public function updateInvoiceAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CoreShopBundle:Order')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Order entity.');\n }\n\n $editForm = $this->createForm(new OrderInvoiceType(), $entity);\n $request = $this->getRequest();\n $editForm->bind($request);\n\n if ($editForm->isValid()) {\n $entity->setInvoicedAt(new \\DateTime());\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('order'));\n }\n\n return $this->render('CoreShopBundle:Order:editinvoice.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n ));\n }", "public function update(UpdateInvoiceRequest $request, $id)\n {\n $invoice = $this->invoice\n ->with('invoiceItems')\n ->findOrFail($id);\n\n $invoice->update($request->get('invoice'));\n\n // set invoice items\n\n $this->syncInvoiceItems($invoice, $request);\n\n // sync deleted items\n\n $this->syncDeletedItems($invoice, $request);\n\n // set status\n\n $this->setInvoiceStatus($invoice, $request);\n\n // do something if form is SUBMITTED instead of SAVE\n\n $this->doSomethingIfSubmit($invoice, $request);\n\n $invoice->refresh();\n\n return new InvoiceResource($invoice);\n }" ]
[ "0.75351256", "0.71876425", "0.7075396", "0.7017034", "0.7010891", "0.7010891", "0.7010891", "0.7010891", "0.7010891", "0.7010891", "0.7010891", "0.7010891", "0.69407964", "0.6807994", "0.67528534", "0.6695256", "0.66895884", "0.6656223", "0.66317105", "0.6580968", "0.65245825", "0.6524169", "0.6495143", "0.64851606", "0.6435309", "0.6402822", "0.6341924", "0.63278216", "0.6318008", "0.6316286", "0.63064617", "0.6302367", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.62915134", "0.6274688", "0.62739944", "0.62646884", "0.6257353", "0.6238838", "0.6227238", "0.6214094", "0.6196212", "0.6177515", "0.6175404", "0.61660564", "0.61575496", "0.61344117", "0.6102711", "0.6101557", "0.6097448", "0.60819167", "0.60628927", "0.60553914", "0.60376555", "0.6029093", "0.6010422", "0.6007696", "0.59975314", "0.5995483", "0.5991632", "0.5980268", "0.5979561", "0.5969521", "0.596097", "0.59559345", "0.5954608", "0.59538317", "0.59506017", "0.59486353", "0.5948293", "0.59444934", "0.59277016", "0.58863056", "0.5855407", "0.58427674", "0.583726", "0.5836096", "0.58360773", "0.5834785", "0.58320415", "0.58274746", "0.5822666", "0.58197945", "0.580599", "0.57939065", "0.5785558", "0.5759778", "0.57520545", "0.5751624", "0.57473665", "0.5746999", "0.57327294" ]
0.61821693
50
Remove Invoice from storage.
public function destroy($id) { if (! Gate::allows('invoice_delete')) { return abort(401); } $invoice = Invoice::findOrFail($id); $invoice->deletePreservingMedia(); return redirect()->route('admin.invoices.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove(): int {\n $where = 'invoice_id = ?';\n $values = [$this->invoiceId];\n return $this->delete($where, $values);\n }", "public function destroy(Invoice $invoice)\n {\n\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice) {\n\t\t//\n\t}", "public function destroy(PurchaseInvoice $purchaseInvoice)\n {\n //\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function destroy(Request $request)\n{\n$id = $request->id;\n$invoice = invoice::find($id)\n->get()\n->first();\n$invoice->delete();\nsession()->flash('delete', 'deletet successfully');\nreturn back();\n}", "function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }", "public function destroy(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function destroy( Invoice $invoice ) {\n\t\t$invoice->delete();\n\n\t\treturn redirect( '/invoice' );\n\t}", "public function destroy($invoice_id,$file_id)\n {\n $Attachment = Attachment::findOrFail($file_id);\n\n $file = $Attachment->invoice_number.'/'.$Attachment->file_name;\n\n // file system storage public_upload\n if(Storage::disk(\"public_uploads\")->exists($file)){\n Storage::disk('public_uploads')->delete($file);\n }\n\n $Attachment->delete();\n\n request()->session()->flash('msgSuccess', 'تم حذف المرفق بنجاح');\n return back();\n }", "public function destroy($id)\n {\n RetailSaleModel::where('invoice_id',$id)->delete();\n RetailSaleChildModel::where('invoice_id',$id)->delete();\n Session::flash('success','Invoice Deleted Successfully');\n return back();\n }", "public function delete_invoice() {\n\n // Make sure we were sent a mock invoice id\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n\n // Get all entry ids that were part of the invoice so we can pass them back\n $entryArray = $this->mockinvoice_model->get_entry_ids( $_POST[ 'mockInvoiceId' ] );\n // Remove all entries from the invoice\n $this->mockinvoice_model->remove_all_entries( $_POST[ 'mockInvoiceId' ] );\n // Delete all mock invoice rows\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceId', $_POST[ 'mockInvoiceId' ] );\n // Delete the mock invoice\n $this->mockinvoice_model->delete( $_POST[ 'mockInvoiceId' ] );\n\n }\n // Error handling - return some JSON if delete was processed\n if ( !empty( $entryArray ) ) {\n // Send back the timesheet entry ids as JSON\n $this->json_library->print_array_json_unless_empty( $entryArray );\n }\n }", "public function delete($invoice_id, $id) {\n\t\tDB::select(\n\t\t\t\"DELETE FROM invoice_item\n\t\t\tWHERE invoice_item.item_id = :id\",\n\t\t\tarray(\":id\" => $id));\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "function discard( $invoiceID ) {\n \n $this->company_db->trans_start(); \n \n $q = 'DELETE FROM invoices_details WHERE fk_invoice_id = '.$invoiceID; \n $this->company_db->query($q);\n \n $q = 'DELETE FROM hiring_invoices_control WHERE fk_invoice_id = '.$invoiceID; \n $this->company_db->query($q);\n \n $q = 'UPDATE invoices \n SET creation_date = null, \n fk_contract_id = null, \n subtotal = null, \n vat = null,\n total = null,\n accepted = null\n WHERE pk_id = '.$invoiceID;\n $this->company_db->query($q);\n \n $this->company_db->trans_complete();\n return $this->company_db->trans_status();\n }", "public function purchase_unsaved_delete()\n {\n $purchase_no = $this->input->post('purchase_no');\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_details->delete_by_purchase_no($purchase_no);\n $this->MPurchase_master->delete_by_purchase_no($purchase_no);\n }", "function delete_invoice_items($id){\n $this->company_db->delete('tbl_invoice_item', array(\"header_id\"=>$id));\n }", "public function destroy($incidencia)\n {\n //\n Incidencies::find($incidencia)->delete();\n }", "public function destroy($id)\n {\n $row = Invoice::where('id', $id)->first();\n // Delete File ..\n\n\n try {\n $row->item()->delete();\n $row->delete();\n } catch (QueryException $q) {\n\n return redirect()->back()->with('flash_danger', $q->getMessage());\n }\n return redirect()->route($this->routeName . 'index')->with('flash_success', 'تم الحذف بنجاح !');\n }", "public function destroy($invoiceid) \n {\n\n \n Invoice::destroy($invoiceid);\n\n Session::flash('flash_message', 'Invoice deleted!');\n\n return redirect('invoice/index');\n }", "public function destroy($id)\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN) {\n $invoice = InvoiceLists::findOrFail($id);\n\n $POLists = PurchaseOrderLists::findOrFail($invoice->purchase_order_list_code_id);\n $POData['fix_data'] = 0;\n $POLists->update($POData);\n\n InvoiceLists::destroy($id);\n InvoiceListsDetail::where('invoice_list_id', $id)->delete();\n\n $old_data_payment = InvoiceListsPayment::where('invoice_list_id', $id)->get();\n if (count($old_data_payment) > 0) {\n foreach ($old_data_payment as $payment) {\n InvoiceListsPayment::where('invoice_list_id', $id)->delete();\n $image_payment_path = app_path(\"../../files/invoice-payment/\" . $payment->file_payment . \"\");\n unlink($image_payment_path);\n }\n }\n if ($invoice->file != '') {\n $image_path = app_path(\"../../files/invoice/\" . $invoice->file . \"\");\n unlink($image_path);\n }\n\n\n Alert::success('Your data already deleted !', 'Success !');\n }\n return redirect('admin/invoice-list');\n }", "public function delete_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get invoice details\n $invoice = $this->invoice->delete_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n echo json_encode(1);\n \n }\n \n }", "public function destroy(Invoice $invoice)\n {\n // DB::beginTransaction();\n // $invoice->is_active = 0;\n // $invoice->save();\n // DB::commit();\n\n // return Response::json(['message' => 'Data berhasil dinon-aktifkan'], 200);\n }", "public function destroy($id_payable_invoice)\n {\n $invoice = InvoicePayable::findOrFail($id_payable_invoice);\n InvoicePayabledetail::where('id_payable_invoice', $id_payable_invoice)->delete();\n $invoice->delete();\n\n return redirect()->back()->with('messagehapus','Data Invoice Berhasil dihapus');\n }", "public function destroy(Invoice $transaction)\n {\n // dd($transaction);\n $transaction->update(['ti_is_delete' => true]);\n $transaction->delete();\n return redirect()->back()->with('message', 'Success Delete Transaksi!');\n }", "public function destroy($id)\n {\n $ProductInvoice = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n $invoices->delete();\n\n return back();\n }", "public function destroy($id)\n {\n $invoice=invoice::find($id);\n\t\t$invoice->delete();\n\t\treturn redirect()->route('invoice.index')->with('success','Data Deleted');\n }", "public function destroy($id)\n {\n // remove invoice from archive list and from normal list of invoices\n $invoice = Invoice::withTrashed()->where('id', $id)->first();\n\n // Method one -------------------------------------\n // delete invoice with attachment no restore\n\n // check if has minimal one file to delete the folder parent in the attachments storage directory\n $attachment = Attachment::where('invoice_id', $invoice->id)->first();\n\n if (!empty($attachment->invoice_id)) {\n Storage::disk('public_uploads')->deleteDirectory($invoice->invoice_number);\n }\n $invoice->forceDelete();\n\n // ------------------------------------------------\n\n request()->session()->flash('msgSuccess', \"تم حذف الفاتورة بنجاح\");\n return back();\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function destroy($id)\n {\n $invoice = Invoice::withTrashed()->where('id', $id)->firstOrFail();\n if ($invoice->trashed()) {\n # deleting permanently\n $invoice->forceDelete();\n InvoiceRecord::where(\"invoice_id\", $invoice->id)->delete();\n session()->flash('success', 'Invoice deleted successfuly');\n return redirect(route('invoices.trashed'));\n } else {\n // if not trashed befored then trashing\n $invoice->delete();\n session()->flash('success', 'Invoice has been trashed successfuly');\n return redirect(route('invoices.index'));\n }\n session()->flash(\"success\", \"Invoice deleted successfully\");\n }", "public function destroy($id)\n {\n $invoice = Invoice::findOrFail($id);\n Product::where('invoice_id', $id)->delete();\n Invoice::destroy($id);\n return redirect('/customers/'.$invoice->user_id)->with('success', 'Invoice Updated!');\n }", "public function removePurhaseOrderById(Request $request)\n { \n $poId = $request->input('id');\n if (!empty($poId)) {\n\n $getTicketAttachmentData = DB::table('purchase_order_image')\n ->select('*')\n ->where('po_id', $poId)\n ->where('is_deleted_status', 'N')\n ->get()\n ->toArray(); \n if (!empty($getTicketAttachmentData)) {\n foreach ($getTicketAttachmentData as $attachment) {\n $unlinkPath = $_SERVER['DOCUMENT_ROOT'].'/fintech/laravel/public/po_image/';\n unlink($unlinkPath.$attachment->image);\n }\n }\n\n $purhaseOrderModel = new PurhaseOrderModel();\n $result = $purhaseOrderModel->deletePurhaseOrder($poId);\n \n return ['success'=> true, 'message' => 'Purhase Order has been deleted.'];\n \n }\n }", "public function testDeleteInvoice() {\n\t\t$randomInvoice = rand();\n\n\t\t$tokenizer = new Token($_SESSION['accessToken']);\n\n\t\t$tokenizer->ip('173.49.87.94')\n\t\t\t\t->expirationMonth(12)\n\t\t\t\t->expirationYear(30)\n\t\t\t\t->cardNumber('4321000000001119')\n\t\t\t\t->cvv('333')\n\t\t\t\t->cardType('VS')\n\t\t\t\t->name('John Smith')\n\t\t\t\t->zip('65000')\n\t\t\t\t->address('65 Main Street')\n\t\t\t\t->post();\n\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->total(100)\n\t\t\t\t->clerk('1')\n\t\t\t\t->invoiceNumber($randomInvoice)\n\t\t\t\t->tokenValue($tokenizer->getToken())\n\t\t\t\t->purchaseCard(array(\n\t\t\t\t\t'customerReference' => 412348,\n\t\t\t\t\t'destinationPostalCode' => 19134,\n\t\t\t\t\t'productDescriptors' => array('rent')\n\t\t\t\t))\n\t\t\t\t->sale();\n\n\t\t$output = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ': CARD AND TRANSACTION CREATION');\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $output\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Deleting an invoice requires the transaction be sent in the header\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->deleteInvoice($randomInvoice);\n\n\t\t$result = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__);\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ' INVOICE: ' . $_SESSION['invoiceForTest5']);\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $result\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\n\t\t$this->assertNotNull($result);\n\n\t}", "public function destroy(ImportInvoice $importInvoice)\n {\n $importInvoice->delete();\n return redirect()->route('importinvoice.index')\n ->with('success','Import Invoice deleted successfully');\n }", "function delItem( $rowID ) {\n \n $query = 'SELECT item_type, fk_contract_item, qty, fk_invoice_id FROM invoices_details WHERE pk_id = '.$rowID;\n $contractItem = $this->company_db->query($query)->row();\n $this->company_db->trans_start();\n if ( $contractItem->item_type == 1) {\n \n $q = 'UPDATE collections_items SET qty_sold_items_invoiced = ifnull(qty_sold_items_invoiced,0) -'.$contractItem->qty.' WHERE fk_contract_item_id = '.$contractItem->fk_contract_item;\n $this->company_db->query($q);\n }\n \n $q = 'DELETE FROM invoices_details WHERE pk_id = '.$rowID;\n $this->company_db->query($q);\n \n $q = 'UPDATE collections_items \n SET last_invoiced_date = (SELECT max(creation_date) FROM invoices WHERE pk_id = '.$contractItem->fk_invoice_id.' AND creation_date != last_invoiced_date )\n WHERE fk_contract_item_id = '.$contractItem->fk_contract_item;\n $this->company_db->query($q);\n \n $this->company_db->trans_start();\n return $this->company_db->trans_complete();\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "function deleteReceipt()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'DELETE FROM '.receipt_table.' WHERE receipt_id = '.$this->receipt_id;\n\t\t$db->query($query);\n\t}", "public function destroy($id)\n {\n if (auth()->user()->hasRole('admin')) {\n $invoice = Invoice::find($id);\n\n if ($invoice->multiple) {\n foreach (json_decode($invoice->multiple_codes, true) as $code) {\n $authorization = Authorization::findByCode($code);\n if ($authorization) {\n $authorization->update([\n 'invoice_id' => 0\n ]);\n }\n }\n } else {\n $authorization = Authorization::findByCode($invoice->authorization_code);\n if ($authorization) {\n $authorization->update([\n 'invoice_id' => 0\n ]);\n }\n }\n\n if (!$invoice) {\n Session::flash('message_danger', 'Factura no encontrada');\n return redirect()->back()->withInput();\n }\n\n $note = AccountingNote::where('invoice_id', $invoice->id)->first();\n if ($note) {\n $note->delete();\n }\n\n $invoice->delete();\n\n Session::flash('message', 'Factura eliminada exitosamente');\n return redirect()->route('invoice.index');\n }\n Session::flash('message_danger', 'No tienes permiso para borrar facturas. Este movimiento ha sido notificado');\n return redirect()->route('invoice.index');\n }", "public function destroy(Request $request, $id)\n {\n $url = \"invoice/list\";\n if (isset($id)) {\n try {\n $record = SaleOrder::find($id);\n if ($record) {\n DB::beginTransaction();\n $transactionReferenceIds = CustomerTransaction::where('sale_order_id', $id)->pluck('transaction_reference_id')->toArray();\n $deleteTransactions = Transaction::whereIn('transaction_reference_id', $transactionReferenceIds)->delete();\n $deleteCustomerTransactions = CustomerTransaction::where('sale_order_id', $id)->delete();\n $deleteTransactionReferences = TransactionReference::whereIn('id', $transactionReferenceIds)->delete();\n $deleteStockMoves = StockMove::where(['transaction_type_id' => $record->id, 'transaction_type' => 'SALESINVOICE'])->delete();\n $deleteInvoiceDetails = SaleOrderDetail::where('sale_order_id', $record->id)->delete();\n $deleteInvoiceFiles = (new File)->deleteFiles('Direct Order', $record->id, [], $path = 'invoice_order');\n $deleteOrder = $record->delete();\n DB::commit();\n \\Session::flash('success', __('Deleted Successfully.'));\n if ($request->sub_menu == 'customer') {\n $url = \"customer/invoice/\".$request->customer;\n } else if ($request->sub_menu == 'users') {\n $url = \"user/sales-invoice-list/\".$user_id;\n }\n } else {\n \\Session::flash('fail', __('Delete Failed'));\n }\n } catch (Exception $e) {\n DB::rollBack();\n \\Session::flash('fail', __('Delete Failed'));\n }\n } else {\n \\Session::flash('fail', __('Delete Failed'));\n }\n return redirect()->intended($url);\n }", "public function destroy(Invoices $invoice, Request $request)\n {\n\n $this->invoice->destroy($invoice);\n\n return $this->redirectResponse($request, __('alerts.backend.invoices.deleted'));\n }", "public function destroy(Request $request)\n {\n\n $delete = invoice_attachments::find($request->id);\n if ($delete->delete()) {\n Storage::disk('file_invoices')->delete($request->invoice_number.'/'.$request->file_name);\n Session::flash('message', 'تم حذف المرفق بنجاح.');\n return back();\n } else {\n Session::flash('message', ' لم يتم الحذف ');\n }\n }", "public final function delete() {\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(): void\n {\n unlink($this->getPath());\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 InvoiceItem::find($id)->delete();\n\n return back();\n }", "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 destroy($id)\n {\n Invoices::findOrFail($id)->delete();\n \n session()->flash('message','The Invoice record has been successfully deleted.');\n\n return redirect()->back();\n }", "public function destroy($id)\n\t{\n\t\t$invoice = Invoice::findOrFail($id);\n\t\t$invoice->delete();\n\n\t\treturn redirect()->route('invoices.index')->with('message', 'Item deleted successfully.');\n\t}", "public function delete(): void\n {\n unlink($this->path);\n }", "public function destroy($id)\n {\n //\n Invoice::destroy($id);\n return redirect('finance/invoice');\n }", "public function destroy(Invoice $invoice)\n {\n $status = Response::HTTP_INTERNAL_SERVER_ERROR; \n $message = 'Some Error occured please try again';\n \n if($invoice->delete()){\n \n $status = Response::HTTP_OK;\n $message = 'Invoice deleted successfully';\n \n }\n \n return redirect()->back()->with($message);\n }", "public function destroy($id)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n $invoice = $this->invoiceRepository->findWithoutFail($id);\n\n if (empty($invoice)) {\n Flash::error('invoice not found');\n\n return redirect(route('invoices.index'));\n }\n\n $this->invoiceRepository->delete($id);\n\n Flash::success('invoice deleted successfully.');\n\n return redirect(route('invoices.index'));\n }", "public function delete($invoiceId)\n {\n $fullResult = $this->client->call(\n 'crm.invoice.delete',\n array('id' => $invoiceId)\n );\n return $fullResult;\n }", "public function destroy($id)\n {\n $invoice = Invoice::find($id);\n $invoice->delete();\n Session::flash('invoice_deleted', 'Invoice deleted successfully');\n return redirect()->route('invoice.index');\n }", "public function destroy(CustomerInvoiceEmail $customerInvoiceEmail)\n {\n //\n }", "public static function removeIdentity() {\n\t\tCore_Store::remove('identity');\n\t}", "public function removeInvoiceDetail(\\Crm\\AppBundle\\Entity\\InvoiceDetail $invoiceDetail)\n {\n $this->invoiceDetails->removeElement($invoiceDetail);\n\n }", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function delete()\n {\n if (post_param_integer('confirmed', 0) != 1) {\n $url = get_self_url();\n $text = do_lang_tempcode('DELETE_INVOICE');\n\n $hidden = build_keep_post_fields();\n $hidden->attach(form_input_hidden('confirmed', '1'));\n $hidden->attach(form_input_hidden('from', get_param_string('from', 'browse')));\n\n return do_template('CONFIRM_SCREEN', array('_GUID' => '45707062c00588c33726b256e8f9ba40', 'TITLE' => $this->title, 'FIELDS' => $hidden, 'PREVIEW' => $text, 'URL' => $url));\n }\n\n $GLOBALS['SITE_DB']->query_delete('invoices', array('id' => get_param_integer('id')), '', 1);\n\n $url = build_url(array('page' => '_SELF', 'type' => post_param_string('from', 'browse')), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function destroy(IceTax $iceTax)\n {\n //\n }", "public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}", "public function deleted(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function destroy($id)\n {\n\n $data = MsSales::find($id);\n $alha = $data->no_invoice;\n\n $data = MsSales::find($id)->delete();\n return redirect(route('sales.index'))->with('toast_error', \"Data With Invoice Number $alha, Successfully Deleted\");\n }", "public function destroy(Incidencia $incidencia)\n {\n //\n }", "public function destroy(Incidencia $incidencia)\n {\n //\n }", "public function destroy(Incidencia $incidencia)\n {\n //\n }", "public function deleted(TipoInstrumento $tipoInstrumento)\n {\n //\n }", "function ciniki_writingfestivals_sapos_cartItemDelete($ciniki, $tnid, $invoice_id, $args) {\n\n if( !isset($args['object']) || $args['object'] == '' \n || !isset($args['object_id']) || $args['object_id'] == '' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.131', 'msg'=>'No registration specified', 'err'=>$rc['err']));\n }\n\n //\n // Check to make sure the registration exists\n //\n if( $args['object'] == 'ciniki.writingfestivals.registration' ) {\n //\n // Get the current details for the registration\n //\n $strsql = \"SELECT status \"\n . \"FROM ciniki_writingfestival_registrations \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.writingfestivals', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.135', 'msg'=>'Unable to find registrations', 'err'=>$rc['err']));\n }\n if( !isset($rc['item']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.136', 'msg'=>'Unable to find registration'));\n }\n $item = $rc['item'];\n\n if( $item['status'] != 6 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.137', 'msg'=>'This registration cannot be removed.'));\n }\n\n //\n // Change the status back to Draft\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.writingfestivals.registration', $args['object_id'], array('status'=>5));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.writingfestivals.138', 'msg'=>'Error trying to remove registration.', 'err'=>$rc['err']));\n }\n\n return array('stat'=>'ok');\n }\n\n return array('stat'=>'ok');\n}", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "public function destroy(Income $income)\n {\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(Preinscription $preinscription)\n {\n //\n }", "public function destroy(AdminInvoiceModel $admin_invoice_show)\n {\n $admin_invoice_show->delete();\n return redirect()->back()->with(\"message\",\"Invoice Remove Successfully!\");\n }", "public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}", "public function destroy($id)\n {\n $inve = Inventario::findOrfail($id);\n $inve->delete();\n }", "function ciniki_sapos_hooks_invoiceItemDelete($ciniki, $tnid, $args) {\n\n if( !isset($args['invoice_id']) || $args['invoice_id'] == '' \n || !isset($args['object']) || $args['object'] == '' \n || !isset($args['object_id']) || $args['object_id'] == '' \n ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.3', 'msg'=>'No invoice or item specified.'));\n }\n\n //\n // Load the settings\n //\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_sapos_settings', 'tnid', $tnid, 'ciniki.sapos', 'settings', '');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $settings = isset($rc['settings'])?$rc['settings']:array();\n\n //\n // Get the details of the item\n //\n $strsql = \"SELECT id, uuid, invoice_id, object, object_id, quantity \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE invoice_id = '\" . ciniki_core_dbQuote($ciniki, $args['invoice_id']) . \"' \"\n . \"AND object = '\" . ciniki_core_dbQuote($ciniki, $args['object']) . \"' \"\n . \"AND object_id = '\" . ciniki_core_dbQuote($ciniki, $args['object_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['item']) ) { \n // Item doesn't exist, return ok\n return array('stat'=>'ok');\n// return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.382', 'msg'=>'Unable to find invoice item'));\n }\n $item = $rc['item'];\n\n //\n // Check to make sure the invoice hasn't been paid\n //\n $strsql = \"SELECT id, uuid, status \"\n . \"FROM ciniki_sapos_invoices \"\n . \"WHERE ciniki_sapos_invoices.id = '\" . ciniki_core_dbQuote($ciniki, $item['invoice_id']) . \"' \"\n . \"AND ciniki_sapos_invoices.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'invoice');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['invoice']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.6', 'msg'=>'Invoice does not exist'));\n }\n $invoice = $rc['invoice'];\n\n //\n // Invoice has already been paid, we don't want to remove this item\n //\n if( $invoice['status'] >= 50 && (!isset($settings['rules-invoice-paid-change-items']) || $settings['rules-invoice-paid-change-items'] == 'no')) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.7', 'msg'=>'Invoice has been paid, unable to remove item'));\n }\n\n //\n // Check to make sure the item isn't part of a shipment\n //\n $strsql = \"SELECT id \"\n . \"FROM ciniki_sapos_shipment_items \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND item_id = '\" . ciniki_core_dbQuote($ciniki, $item['id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'item');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.sapos.8', 'msg'=>'Item is part of a shipment and cannot be removed.'));\n }\n\n //\n // Check for a callback for the item object\n //\n if( $item['object'] != '' && $item['object_id'] != '' ) {\n list($pkg,$mod,$obj) = explode('.', $item['object']);\n $rc = ciniki_core_loadMethod($ciniki, $pkg, $mod, 'sapos', 'itemDelete');\n if( $rc['stat'] == 'ok' ) {\n $fn = $rc['function_call'];\n $rc = $fn($ciniki, $tnid, $item['invoice_id'], $item);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n\n //\n // Remove the item\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.sapos.invoice_item', \n $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check if invoice should be deleted when nothing in it\n //\n if( $invoice['status'] < 50 && isset($args['deleteinvoice']) && $args['deleteinvoice'] == 'yes' ) {\n $remove = 'yes';\n //\n // Check for invoice items\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_invoice_items.id) \"\n . \"FROM ciniki_sapos_invoice_items \"\n . \"WHERE ciniki_sapos_invoice_items.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_invoice_items.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_sapos_invoice_items.id <> '\" . ciniki_core_dbQuote($ciniki, $item['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n //\n // Check for invoice shipments\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_shipments.id) \"\n . \"FROM ciniki_sapos_shipments \"\n . \"WHERE ciniki_sapos_shipments.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_shipments.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n //\n // Check for invoice transactions\n //\n $strsql = \"SELECT COUNT(ciniki_sapos_transactions.id) \"\n . \"FROM ciniki_sapos_transactions \"\n . \"WHERE ciniki_sapos_transactions.invoice_id = '\" . ciniki_core_dbQuote($ciniki, $invoice['id']) . \"' \"\n . \"AND ciniki_sapos_transactions.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.sapos', 'num_items');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['num_items']) || $rc['num_items'] != 0 ) {\n $remove = 'no';\n }\n\n if( $remove == 'yes' ) {\n //\n // Remove the invoice\n //\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.sapos.invoice', $invoice['id'], $invoice['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n }\n }\n\n if( !isset($remove) || $remove != 'yes' ) {\n //\n // Update the invoice status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'invoiceUpdateShippingTaxesTotal');\n $rc = ciniki_sapos_invoiceUpdateShippingTaxesTotal($ciniki, $tnid, $item['invoice_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the invoice status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'invoiceUpdateStatusBalance');\n $rc = ciniki_sapos_invoiceUpdateStatusBalance($ciniki, $tnid, $item['invoice_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\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, $tnid, 'ciniki', 'sapos');\n\n return array('stat'=>'ok');\n}", "public function delete(Request $request)\n {\n $this->validate(request(), [\n 'invoice_id' => 'required',\n ]);\n\n $invoice = $this->invoiceRepository->find($request->get('invoice_id'));\n\n if (!$invoice) {\n return response()->json(['status' => 'error'], 404);\n }\n\n if ($this->invoiceRepository->delete($invoice)) {\n return response()->json(['status' => 'success'], 200);\n }\n\n return response()->json(['status' => 'error'], 404);\n }", "public function destroy($id)\n {\n $customer = Customer::where('id',$id)->first();\n $photo = $customer->image;\n if($photo){\n unlink($photo);\n $customer->delete();\n }else{\n $customer->delete();\n }\n\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function remove() {}", "public function remove() {}", "public function deleteById($inquiryId);", "public function delete_invoice_item($invoice_item_id)\n\t{\n\t\tif($this->db->delete('invoice_item', array('invoice_item_id' => $invoice_item_id)))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function deleteThisItem(){\n $this->deleteFiles(self::DATA_DIRECTORY.$this->_page.\"/items/\".$this->_id);\n // Supprimer l'item de $this->_collectionAdministrator->_data\n $this->_collectionAdministrator->removeItem($this->_id);\n }", "public function remove( int $invoiceId, int $messageId ) {\n\t\treturn $this->delete( '/invoices/' . rawurlencode( $invoiceId ) . '/payments/' . rawurlencode( $messageId ) );\n\t}", "public function destroy(Insurance $insurance)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n $invoice->delete();\n return new JsonResponse(true);\n }", "public function purchase_return_unsaved_delete()\n {\n $purchase_return_no = $this->input->post(\"purchase_return_no\");\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase Return', $purchase_return_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_return_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_return_details->delete_by_purchase_return_no($purchase_return_no);\n $this->MPurchase_return_master->delete_by_purchase_return_no($purchase_return_no);\n }", "private function removeEntrada($filePath){\n \\Storage::delete($filePath);\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 removePayment($payID) {\n // remove it\n }", "public function destroy($id)\n {\n $find = Customer::find($id);\n $photo = $find->image;\n\n if($photo){\n unlink($photo);\n $delete = Customer::where('id',$id)->delete();\n }else{\n $delete = Customer::where('id',$id)->delete();\n }\n }", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }" ]
[ "0.6941501", "0.68552244", "0.6712405", "0.6712405", "0.6712405", "0.6712405", "0.6712405", "0.6712405", "0.66052794", "0.638991", "0.63502985", "0.6314822", "0.62983763", "0.6252911", "0.6195027", "0.6125821", "0.60841346", "0.6077303", "0.60755837", "0.6046645", "0.6028544", "0.60141796", "0.6001941", "0.5989609", "0.5899865", "0.58907545", "0.58834946", "0.5881751", "0.5863495", "0.5845361", "0.58383644", "0.5831031", "0.5829557", "0.58072406", "0.57748276", "0.5764448", "0.57597893", "0.57569313", "0.5754051", "0.5738398", "0.57381475", "0.5726783", "0.5720313", "0.5719191", "0.5707512", "0.57054824", "0.56936836", "0.56812805", "0.56802785", "0.5674061", "0.5673172", "0.5672063", "0.5661014", "0.56586725", "0.56568784", "0.5640431", "0.56284255", "0.56239104", "0.56234074", "0.5616702", "0.5603508", "0.5592371", "0.5576867", "0.5554701", "0.55516267", "0.55472165", "0.5545254", "0.5543548", "0.55420184", "0.5538065", "0.552792", "0.552792", "0.552792", "0.5514548", "0.5512169", "0.5493357", "0.5482517", "0.54815084", "0.5480929", "0.54753304", "0.5472242", "0.5456775", "0.54472524", "0.5442601", "0.542908", "0.54231775", "0.5422337", "0.5421845", "0.5415831", "0.5408883", "0.5397426", "0.53914917", "0.5387798", "0.53761256", "0.53735673", "0.5360944", "0.5360693", "0.5360069", "0.5350226", "0.53490067" ]
0.5383735
93
Delete all selected Invoice at once.
public function massDestroy(Request $request) { if (! Gate::allows('invoice_delete')) { return abort(401); } if ($request->input('ids')) { $entries = Invoice::whereIn('id', $request->input('ids'))->get(); foreach ($entries as $entry) { $entry->deletePreservingMedia(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }", "function delete_invoice_items($id){\n $this->company_db->delete('tbl_invoice_item', array(\"header_id\"=>$id));\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('invoice_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Invoice::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function delete_invoice() {\n\n // Make sure we were sent a mock invoice id\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n\n // Get all entry ids that were part of the invoice so we can pass them back\n $entryArray = $this->mockinvoice_model->get_entry_ids( $_POST[ 'mockInvoiceId' ] );\n // Remove all entries from the invoice\n $this->mockinvoice_model->remove_all_entries( $_POST[ 'mockInvoiceId' ] );\n // Delete all mock invoice rows\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceId', $_POST[ 'mockInvoiceId' ] );\n // Delete the mock invoice\n $this->mockinvoice_model->delete( $_POST[ 'mockInvoiceId' ] );\n\n }\n // Error handling - return some JSON if delete was processed\n if ( !empty( $entryArray ) ) {\n // Send back the timesheet entry ids as JSON\n $this->json_library->print_array_json_unless_empty( $entryArray );\n }\n }", "public function delete_all()\n {\n }", "public function deleteSelected()\n {\n PatientRecord::whereIn('id', $this->selectedKeys())->delete();\n }", "public function deleteAll(): void;", "abstract public function deleteAll();", "public function deleteSelected(Request $request)\n {\n foreach ($request['id'] as $id) {\n $pengeluaran = PengeluaranInshaModel::find($id);\n $pengeluaran->delete();\n }\n }", "public function deleteAll($insumos){\n\n\t\t$insumos = collect($insumos)->pluck('id');\n\n\t\tLote::whereIn('insumo', $insumos)\n\t\t\t->where('deposito', Auth::user()->deposito)\n\t\t\t->delete();\n\t}", "public function destroy(APInvoiceAlls $aPInvoiceAlls)\n {\n //\n }", "public function deleteAll(): void\n {\n $this->client->delete($this->baseUri);\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('invoice_delete')) {\n return prepareBlockUserMessage();\n }\n\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n }\n\n\n if ($request->input('ids')) {\n $entries = Invoice::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n\n flashMessage( 'success', 'deletes' );\n }\n }", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "public function run()\n {\n foreach ($this->_provinsi_ids as $id) {\n Kota::where('provinsi_id', $id)->delete();\n Provinsi::where('id', $id)->delete();\n }\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('courses_details.index');\n }\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public function destroy(Request $request, $id)\n {\n $url = \"invoice/list\";\n if (isset($id)) {\n try {\n $record = SaleOrder::find($id);\n if ($record) {\n DB::beginTransaction();\n $transactionReferenceIds = CustomerTransaction::where('sale_order_id', $id)->pluck('transaction_reference_id')->toArray();\n $deleteTransactions = Transaction::whereIn('transaction_reference_id', $transactionReferenceIds)->delete();\n $deleteCustomerTransactions = CustomerTransaction::where('sale_order_id', $id)->delete();\n $deleteTransactionReferences = TransactionReference::whereIn('id', $transactionReferenceIds)->delete();\n $deleteStockMoves = StockMove::where(['transaction_type_id' => $record->id, 'transaction_type' => 'SALESINVOICE'])->delete();\n $deleteInvoiceDetails = SaleOrderDetail::where('sale_order_id', $record->id)->delete();\n $deleteInvoiceFiles = (new File)->deleteFiles('Direct Order', $record->id, [], $path = 'invoice_order');\n $deleteOrder = $record->delete();\n DB::commit();\n \\Session::flash('success', __('Deleted Successfully.'));\n if ($request->sub_menu == 'customer') {\n $url = \"customer/invoice/\".$request->customer;\n } else if ($request->sub_menu == 'users') {\n $url = \"user/sales-invoice-list/\".$user_id;\n }\n } else {\n \\Session::flash('fail', __('Delete Failed'));\n }\n } catch (Exception $e) {\n DB::rollBack();\n \\Session::flash('fail', __('Delete Failed'));\n }\n } else {\n \\Session::flash('fail', __('Delete Failed'));\n }\n return redirect()->intended($url);\n }", "public static function doDeleteAll(ConnectionInterface $con = null)\n {\n return ApInvoiceQuery::create()->doDeleteAll($con);\n }", "public function destroy(Invoice $invoice)\n {\n\n }", "public function delete()\n {\n if (post_param_integer('confirmed', 0) != 1) {\n $url = get_self_url();\n $text = do_lang_tempcode('DELETE_INVOICE');\n\n $hidden = build_keep_post_fields();\n $hidden->attach(form_input_hidden('confirmed', '1'));\n $hidden->attach(form_input_hidden('from', get_param_string('from', 'browse')));\n\n return do_template('CONFIRM_SCREEN', array('_GUID' => '45707062c00588c33726b256e8f9ba40', 'TITLE' => $this->title, 'FIELDS' => $hidden, 'PREVIEW' => $text, 'URL' => $url));\n }\n\n $GLOBALS['SITE_DB']->query_delete('invoices', array('id' => get_param_integer('id')), '', 1);\n\n $url = build_url(array('page' => '_SELF', 'type' => post_param_string('from', 'browse')), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function destroy(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function deleteSelected(): void\n {\n $this->emit('userMultipleDelete', $this->selectedKeys());\n }", "public function delete_client_invoice($delete_id){\n\t\n\t$this->db->where('client_id', $delete_id);\n\t\t\n\treturn $this->db->delete('invoice');\n\t\n}", "function delete_all()\n\t\t{\n\t\t\tif($this->input->post('checkbox_value'))\n\t\t\t{\n\t\t\t\t$id = $this->input->post('checkbox_value');\n\t\t\t/*$imgpic = $this->db->get_where('users' , array('ID' => $id))->result();\n\t\t\tforeach ($imgpic as $img_delete)\n\t\t\t{\n\n\t\t\t\t$path = './uploads/admin/'.$img_delete->image;\n\t\t\t\tunlink($path);\n\t\t\t}*/\n\t\t\tfor($count = 0; $count < count($id); $count++)\n\t\t\t{\n\t\t\t\t$this->AboutModel->delete($id[$count]);\n\t\t\t}\n\t\t}\n\t}", "public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }", "public function delall()\n {\n }", "function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('classes.index');\n }\n }", "public function multiDelete()\n {\n if(is_array(request()->item)){\n foreach (request()->item as $id) {\n $tradmark = Tradmark::findOrfail($id);\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n }else{\n $tradmark = Tradmark::findOrfail(request('item'));\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n session()->flash('success', trans('admin.deleted_successfully'));\n return redirect(route('admin.tradmarks.index'));\n }", "public function destroy($id)\n {\n RetailSaleModel::where('invoice_id',$id)->delete();\n RetailSaleChildModel::where('invoice_id',$id)->delete();\n Session::flash('success','Invoice Deleted Successfully');\n return back();\n }", "public function deleteAllTransactions() {\n AccPayPalTransaction::model()->deleteTransactions($this->transactionIds);\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('posts.index');\n }\n }", "public function destroy(Request $request)\n{\n$id = $request->id;\n$invoice = invoice::find($id)\n->get()\n->first();\n$invoice->delete();\nsession()->flash('delete', 'deletet successfully');\nreturn back();\n}", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "public function deleteAll() {\n\n $this->start();\n $_SESSION = array();\n\n }", "public function actionDelete( $id )\n {\n if ( Yii::app()->request->isPostRequest )\n {\n// we only allow deletion via POST request\n $model = $this->loadModel( $id );\n if(empty($model->payments))\n {\n foreach($model->accountorders as $single)\n {\n $orderid = $single->order_id;\n $ordertaskid = $single->ordertask_id;\n $ordertask = Ordertask::model()->findByPk($ordertaskid);\n if(!empty($ordertask))\n {\n $ordertask->invstatus = Helper::CONST_INVSTS_UNINVOICED;\n $rtn = $ordertask->save();\n }\n else\n {\n $order = Order::model()->findByPk($orderid);\n if(!empty($order))\n {\n $order->invstatus = Helper::CONST_INVSTS_UNINVOICED;\n $rtn = $order->save();\n }\n }\n if($rtn)\n {\n $rtn = $single->delete();\n } \n if(!$rtn) break;\n }\n if($rtn)\n {\n foreach($model->accountpurchases as $single)\n {\n $rtn = $single->delete();\n if(!$rtn) break;\n }\n }\n if($rtn)\n {\n $rtn = $model->delete();\n }\n if($rtn)\n {\n $message = 'Invoice Deleted'; \n }\n else\n {\n $message = 'Invoice delete Failed';\n }\n }\n else\n {\n $message = 'Delete all Payments first';\n }\n if (Yii::app()->request->isAjaxRequest)\n {\n if ( !isset( $_GET['ajax'] ) )\n {\n $RetCode = 0;\n $data = Yii::app()->createUrl('account/admin');\n $this->returnJsonResponse($RetCode, $data, $message);\n }\n }\n// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if ( !isset( $_GET['ajax'] ) )\n $this->redirect( isset( $_POST['returnUrl'] ) ? $_POST['returnUrl'] : array( 'admin' ) );\n }\n else\n throw new CHttpException( 400, 'Invalid request. Please do not repeat this request again.' );\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function bulk_destroy(Request $request)\n {\n $banners = Banners::find($request->ids);\n\n foreach ($banners as $item) {\n //languages\n $languages = Language::all();\n if($languages->count()){\n foreach ($request->language as $language) {\n $banners_trans = BannersTrans::where('lang', '=', $language)->where('tid', '=', $item->id)->first();\n\n if($banners_trans) {\n $banners_trans->delete();\n }\n }\n $check_banners_trans = BannersTrans::where('tid', '=', $item->id)->first();\n if(!$check_banners_trans){\n $item->delete();\n }\n }\n // end languages\n }\n \n Flash::success(trans('backend.deleted_successfully'));\n $Currentlanguage = Lang::getLocale();\n return redirect(''.$Currentlanguage.'/admin/banners');\n }", "public function delete($invoice_id, $id) {\n\t\tDB::select(\n\t\t\t\"DELETE FROM invoice_item\n\t\t\tWHERE invoice_item.item_id = :id\",\n\t\t\tarray(\":id\" => $id));\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "public function delete($ids){\n \n $filter = $this->primaryFilter; \n $ids = ! is_array($ids) ? array($ids) : $ids;\n \n foreach ($ids as $id) {\n $id = $filter($id);\n if ($id) {\n $this->db->where($this->primary_key, $id)->limit(1)->delete($this->table_name);\n }\n }\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function bulkDelete(Request $request)\n {\n $ids = $request->get('ids');\n Guest::whereIn('id', $ids)->delete();\n return $this->index(request());\n }", "public function delete(Request $request)\n {\n $this->validate(request(), [\n 'invoice_id' => 'required',\n ]);\n\n $invoice = $this->invoiceRepository->find($request->get('invoice_id'));\n\n if (!$invoice) {\n return response()->json(['status' => 'error'], 404);\n }\n\n if ($this->invoiceRepository->delete($invoice)) {\n return response()->json(['status' => 'success'], 200);\n }\n\n return response()->json(['status' => 'error'], 404);\n }", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function massDestroy(Request $request)\n {\n if (!Gate::allows('quotation_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Quotation::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "protected function _delete()\n {\n $pages = $this->getTable('ExhibitPage')->findBy(array('exhibit'=>$this->id));\n foreach($pages as $page) {\n $page->delete();\n }\n $this->deleteTaggings();\n }", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "function orders_delete($ids, $options=array()){\n\textract($options);\n\tglobal $fl,$ln,$qr,$qx,$fromHdrBugs,$developerEmail;\n\t//what about security, who able to do so etc.\n\tforeach($ids as $Headers_ID){\n\t\t//filter out for payments made or deposits made\n\t\t$a=q(\"SELECT * FROM _v_finan_invoices_cash_sales WHERE ID=$Headers_ID\", O_ROW);\n\t\tif($a['AmountApplied']<>0 || $a['AmountAppliedTo']<>0){\n\t\t\terror_alert('Transaction '.$a['HeaderNumber'].' was not deleted because it was referenced or paid with another transaction',1);\n\t\t\tglobal $Orders_ID;\n\t\t\tunset($Orders_ID[array_search($Headers_ID,$Orders_ID)]);\n\t\t\tif(count($ids)==1)eOK();\n\t\t}\n\t\t$ln=__LINE__; q(\"DELETE FROM finan_headers WHERE ID=$Headers_ID\");\n\t\tprn($qr);\n\t\t$ln=__LINE__; q(\"DELETE FROM finan_invoices WHERE Headers_ID=$Headers_ID\");\n\t\tprn($qr);\n\t\t$ln=__LINE__; q(\"DELETE FROM finan_payments WHERE Headers_ID=$Headers_ID\");\n\t\tprn($qr);\n\t\t$ln=__LINE__; q(\"DELETE FROM finan_transactions WHERE Headers_ID=$Headers_ID\");\n\t\tprn($qr);\n\t}\n}", "public function deleteall()\n\t{\n\t\t$ids = $this->input->post('records');\n\t\t$slider_cat = $this->SqlModel->getSingleField('slider_cat','slider',array('slider_id'=>$ids[0]));\n\t\tif(!empty($ids))\n\t\t{\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t$this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\t\n\t\t\t}\n\t\t}\n\t\tredirect(base_url().'manage/'.$this->controller.'/index/deletesuccess/'.$slider_cat,'location');\t\t\n\t\t\n\t}", "protected function _deleteAll()\n {\n try {\n $this->_imsp->deleteAddressbook($this->_bookName);\n } catch (Horde_Imsp_Exception $e) {\n throw new Turba_Exception($e);\n }\n }", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('presentacionproducto_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Presentacionproducto::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function mutipleDelete(Request $request)\n {\n foreach($request->all() as $product){\n Product::find($product['id'])->delete();\n }\n }", "function delete_all_fee($iClientId) \n {\n $this->db->where('iClientId',$iClientId);\n $this->db->delete('r_client_fee_type');\n }", "public static function destroyAll($options = array()) {\n foreach (self::findAll($options) as $record) {\n $record->destroy();\n }\n }", "public function deleteAction() {\n\t\t$files = new Files ( );\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\ttry {\n\t\t\tif (is_numeric ( $id )) {\n\t\t\t\t\n\t\t\t\t// Deleting the order\n\t\t\t\t$this->invoices->find ( $id )->delete ();\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tdie ( $e->getMessage () . \" \" . $e->getTraceAsString () );\n\t\t}\n\t\t\n\t\treturn $this->_helper->redirector ( 'index', 'invoices' );\n\t}", "public function delete() {\n // Deleting microarticles.\n $microarticles = $this->getMicroarticles();\n if (!empty($microarticles)) {\n foreach ($microarticles as $microarticle) {\n $microarticle->delete();\n }\n }\n\n // Deleting selfservices.\n $selfServices = $this->getSelfservices();\n if (!empty($selfServices)) {\n foreach ($selfServices as $selfService) {\n $selfService->delete();\n }\n }\n\n parent::delete();\n }", "public function supprimer()\n {\n if(\\Request::ajax())\n {\n $numbers = substr( \\Input::get('boxes'),0,-1);\n $ids = explode(',',$numbers);\n $ids = array_unique($ids);\n foreach($ids as $id)\n {\n $child = Child::findOrFail($id);\n $child->bills()->delete();\n $child->attendances()->delete();\n $child->delete();\n if($child->trashed())\n {\n $c= Child::onlyTrashed()->findOrFail($id);\n $c->bills()->forceDelete();\n $c->attendances()->forceDelete();\n $c->forceDelete();\n\n }\n }\n }\n }", "public function massDeleteAction()\n {\n $traineedocIds = $this->getRequest()->getParam('traineedoc');\n if (!is_array($traineedocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('Please select trainee document to delete.')\n );\n } else {\n try {\n foreach ($traineedocIds as $traineedocId) {\n $traineedoc = Mage::getModel('bs_traineedoc/traineedoc');\n $traineedoc->setId($traineedocId)->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_traineedoc')->__('Total of %d trainee document were successfully deleted.', count($traineedocIds))\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_traineedoc')->__('There was an error deleting trainee document.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function destroy($id)\n {\n $ProductInvoice = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n $invoices->delete();\n\n return back();\n }", "public function testDeleteInvoice() {\n\t\t$randomInvoice = rand();\n\n\t\t$tokenizer = new Token($_SESSION['accessToken']);\n\n\t\t$tokenizer->ip('173.49.87.94')\n\t\t\t\t->expirationMonth(12)\n\t\t\t\t->expirationYear(30)\n\t\t\t\t->cardNumber('4321000000001119')\n\t\t\t\t->cvv('333')\n\t\t\t\t->cardType('VS')\n\t\t\t\t->name('John Smith')\n\t\t\t\t->zip('65000')\n\t\t\t\t->address('65 Main Street')\n\t\t\t\t->post();\n\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->total(100)\n\t\t\t\t->clerk('1')\n\t\t\t\t->invoiceNumber($randomInvoice)\n\t\t\t\t->tokenValue($tokenizer->getToken())\n\t\t\t\t->purchaseCard(array(\n\t\t\t\t\t'customerReference' => 412348,\n\t\t\t\t\t'destinationPostalCode' => 19134,\n\t\t\t\t\t'productDescriptors' => array('rent')\n\t\t\t\t))\n\t\t\t\t->sale();\n\n\t\t$output = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ': CARD AND TRANSACTION CREATION');\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $output\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Deleting an invoice requires the transaction be sent in the header\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->deleteInvoice($randomInvoice);\n\n\t\t$result = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__);\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ' INVOICE: ' . $_SESSION['invoiceForTest5']);\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $result\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\n\t\t$this->assertNotNull($result);\n\n\t}", "public function destroy(Invoice $invoice) {\n\t\t//\n\t}", "public function massDestroy(Request $request)\n {\n \n if ($request->input('ids')) {\n $entries = Donation::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function delete(array $ids);", "public function deleteAll(Request $request)\n {\n if($request->ajax()){\n\n $data = $request->json()->all();\n \n if(is_array($data)){\n \n foreach($data as $key){\n $record = Appointment::find($key);\n if(!is_null($record)){\n $record->delete();\n }\n }\n $msg = 'Delete ' . count($data) . ' success!';\n \n return $this->respondWithMessage($msg);\n }\n else{\n return $this->respondWithError(ApiCode::ERROR_REQUEST, 402);\n }\n }\n }", "public function actionDelete()\n {\n //Yii::$app->controller->enableCsrfValidation = false;\n //print_r($_POST);\n if($_POST['selection_all']==1){\n DipaMaster::deleteAll();\n return $this->redirect(['index']);\n } else {\n foreach ($_POST['selection'] as $key => $value) {\n $this->findModel($value)->delete();\n }\n return $this->redirect(['index']);\n }\n // $this->findModel($id)->delete();\n\n // return $this->redirect(['index']);\n }", "public function delete($otros_votos);", "public function actionBulkDelete() {\n\n if (Yii::$app->request->post('selection')) {\n $where = ['id' => Yii::$app->request->post('selection', []), 'sender_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $where);\n\n $whereVia = ['mailbox_id' => Yii::$app->request->post('selection', []), 'receiver_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelViaClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $whereVia);\n }\n }", "public function deleteAll()\n {\n return Laranote::where('model', get_class($this))\n ->where('model_id', $this->id)\n ->delete();\n }", "function deleteall(){\n\ttry{\n\t\t$pdo = Database::connect2db();\n\t\t$res = $pdo->prepare(\"DELETE FROM compte WHERE IDCOMPTE = :idcompte\");\n\t\t$i = 0;\n\t\tforeach($_POST['chk'] as $val){\n\t\t\t$res->execute(array('idcompte' => $val));\n\t\t\tif($res->rowCount()){\n\t\t\t\tif($i == 0) \n\t\t\t\t\tprint \"<p class = 'infos'>\";\n\t\t\t\tprint \"Compte : \".$val.\" supprim&eacute; avec succ&egrave;s.<br/>\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\tif($i != 0) \n\t\t\tprint \"</p>\";\n\t\tafficher();\n\t}catch(PDOException $e){\n\t\tvar_dump($e->getTrace());\n\t\tdie($e->getMessage().\" : \".$e->getLine().\" : \".$e->getFile());\n\t}\n}", "public function delete(){\r\n $rsid_array = $this -> uri -> segment_array();\r\n\r\n foreach ($rsid_array as $key => $value) {\r\n \r\n //If the key is greater than 2 i.e is one of the the ids\r\n if ($key > 2) {\r\n\r\n //Run delete\r\n $this -> db -> delete('refSubs', array('id' => $value));\r\n\r\n } \r\n }\r\n\r\n }", "public function purchase_unsaved_delete()\n {\n $purchase_no = $this->input->post('purchase_no');\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_details->delete_by_purchase_no($purchase_no);\n $this->MPurchase_master->delete_by_purchase_no($purchase_no);\n }", "public function deleteAll()\n {\n $this->record->entries()->delete();\n $this->record->status = 'pending';\n $this->record->is_opened = 'false';\n $this->is_finished = false;\n $this->is_current = false;\n\n return $this->buildResponse();\n }", "public function actionDeleteAll() {\n SupItemsSync::model()->deleteAll();\n\n $this->redirect(array('index'));\n }", "public function delete() {\n global $DB;\n foreach ($this->targets as $target) {\n $DB->delete_records('progressreview_tutor', array('id' => $target->id));\n }\n }", "public function destroyMany(Request $request)\n {\n OtherCharge::whereIn('id', $request->ids)->delete();\n\n return $this->sendResponse([\n \"message\" => \"Records are deleted successfully.\"\n ]);\n }", "public function deleteAll()\n {\n return $this->model::query()->delete();\n }", "public function deleteall()\r\n {\r\n $ids = $this->input->post('records');\r\n if(!empty($ids))\r\n {\r\n foreach($ids as $id)\r\n {\r\n $this->SqlModel->deleteRecord($this->tblName, array($this->pKey=>$id));\r\n }\r\n }\r\n $this->session->set_flashdata('alert','deletesuccess');\r\n redirect(base_url('manage/'.$this->controller));\r\n\r\n }", "public static function deleteAll() {\n\t\treturn self::_getDao()->deleteAll();\n\t}", "public function deleteAll($initAutoIncrement = false): void;", "public function delete() {\n $this->load->auto('localisation/orderstatus');\n if (($this->request->server['REQUEST_METHOD'] == 'POST')) {\n foreach ($this->request->post['selected'] as $id) {\n $this->modelOrderstatus->delete($id);\n }\n } else {\n $this->modelOrderstatus->delete($_GET['id']);\n }\n }", "public function actionBulkTrash() {\n\n if (Yii::$app->request->post('selection')) {\n\n $where = ['id' => Yii::$app->request->post('selection', [])];\n $this->modelViaClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_TRASH, 'deleted_at' => time()], $where);\n }\n }", "public function destroyMultiplePages()\n {\n\n try {\n $input = $this->request->all();\n\n if(isset($input['ids']))\n {\n\n $ids = array_filter($input['ids']);\n $this->page->bulkDeletions( $ids );\n return $this->cmsResponse('Successfully deleted all pages.');\n }\n return $this->cmsResponse('Failed to delete page(s).',400);\n\n } catch (SystemError $e) {\n return $this->cmsResponse($e->getMessage(),400);\n } catch (\\Exception $e) {\n return $this->cmsResponse($e->getMessage(),400);\n }\n }", "public function delete() \n {\n $model = $this->model;\n $input = Input::all(); \n \n $arrayIdDelete = $input[$model::getPrimaryKey()];\n \n $result = array();\n foreach ($arrayIdDelete as $id) {\n $singleResult = $this->deleteSingleObject($id);\n $result[] = $singleResult;\n }\n \n return $jsend = JSend\\JSendResponse::success($result);\n }", "public function massDeleteAction()\n {\n $curriculumdocIds = $this->getRequest()->getParam('curriculumdoc');\n if (!is_array($curriculumdocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Please select curriculum docs to delete.')\n );\n } else {\n try {\n foreach ($curriculumdocIds as $curriculumdocId) {\n $curriculumdoc = Mage::getModel('bs_curriculumdoc/curriculumdoc');\n $curriculumdoc->setId($curriculumdocId)->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_curriculumdoc')->__('Total of %d curriculum docs were successfully deleted.', count($curriculumdocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was an error deleting curriculum docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function bulkDelete(Request $request)\n {\n $delete_check_box_value = $request->delete_check_box_value;\n $delete_check_box_value = explode('|',$delete_check_box_value);\n User::whereIn('id',$delete_check_box_value)->delete();\n\n $message = \"<strong>Notice!</strong> Ticket deleted successfully.\n <a href=\\\"#\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"close\\\">×</a>\";\n\n \n echo json_encode(\n [\n 'success' => 200,\n ]\n );\n }" ]
[ "0.6956097", "0.6812421", "0.66393185", "0.66393185", "0.66393185", "0.66112906", "0.6561352", "0.65342975", "0.6519772", "0.65147674", "0.64332634", "0.6377815", "0.6328237", "0.6280327", "0.6264", "0.621185", "0.6166149", "0.6161012", "0.6110425", "0.6109709", "0.60936314", "0.6070161", "0.6060054", "0.60520184", "0.60375017", "0.6021329", "0.60023177", "0.6001513", "0.59978503", "0.5945286", "0.5945271", "0.59208244", "0.5915678", "0.59045976", "0.59037316", "0.58827674", "0.5878144", "0.5868533", "0.58683294", "0.58656293", "0.5865184", "0.58608633", "0.58587193", "0.5858482", "0.58474547", "0.58474547", "0.58474547", "0.58474547", "0.58474547", "0.58474547", "0.5846793", "0.5829911", "0.5823344", "0.5812666", "0.5810571", "0.5809023", "0.58023083", "0.58007133", "0.57906735", "0.5788753", "0.5786394", "0.5785848", "0.5768664", "0.5767618", "0.57567626", "0.5740559", "0.5739966", "0.5736951", "0.5734772", "0.57237023", "0.5705876", "0.56726146", "0.5666443", "0.56594765", "0.5652949", "0.5646198", "0.5641522", "0.5636766", "0.5633394", "0.56316876", "0.5627254", "0.56249464", "0.56228364", "0.5622618", "0.5617875", "0.5615222", "0.5604371", "0.56019074", "0.56002235", "0.55994505", "0.55981284", "0.55904174", "0.55864656", "0.5582752", "0.5581792", "0.5581566", "0.5576455", "0.5574702", "0.55726093", "0.55688936" ]
0.6342645
12
Restore Invoice from storage.
public function restore($id) { if (! Gate::allows('invoice_delete')) { return abort(401); } $invoice = Invoice::onlyTrashed()->findOrFail($id); $invoice->restore(); return redirect()->route('admin.invoices.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function restored(TipoInstrumento $tipoInstrumento)\n {\n //\n }", "public function restored(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function restore() {}", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restore();", "public function restore()\n {\n $this->restoreEntrustUserTrait();\n $this->restoreSoftDeletes();\n }", "public function restore()\n {\n //\n }", "public function restore()\n {\n }", "public function restore(){\n $this->update(['deleted_by', NULL]);\n return $this->baseRestore();\n }", "public function restore() {\n self::restoreAll($this->chapterID);\n }", "public function restored(Expense $expense)\n {\n //\n }", "public function restore($id)\n {\n PurchaseRequest::withTrashed()->where('id', $id)->restore();\n }", "public function restore($id)\n {\n if (! Gate::allows('invoice_delete')) {\n return prepareBlockUserMessage();\n }\n if ( isDemo() ) {\n return prepareBlockUserMessage( 'info', 'crud_disabled' );\n }\n\n $invoice = Invoice::onlyTrashed()->findOrFail($id);\n $invoice->restore();\n\n flashMessage( 'success', 'restore');\n\n return back();\n }", "public function restored(CustomerInquiry $customerInquiry)\n {\n }", "public function restored(Remission $remission)\n {\n //\n }", "public function restored(Storage $storage)\n {\n //\n }", "public function restored(Product $producto)\n {\n //\n }", "public function restore()\n {\n if ($basketData = $this->session->get(self::BASKET_CART_SESSION_KEY)) {\n static::$cart = unserialize($basketData);\n }\n }", "public function restore($id){\n $book_to_restore = \\App\\Book::withTrashed()->findOrFail($id);\n\n // jika ada, lakukan restore\n if($book_to_restore){\n $book_to_restore->restore();\n return redirect()->route(\"books.index\")->with(\"status\", \"Book successfully restored\");\n } else {\n return redirect()->route(\"books.index\")->with(\"status\", \"Book is not in trash\");\n }\n }", "public function restored(Stock $stock)\n {\n //\n }", "public function restoring(Order $Order)\n {\n //code...\n }", "public function restored(Contract $contract)\n {\n //\n }", "public function restored(Email $email)\n {\n //\n }", "public function restored(Investor $investor)\n {\n //\n }", "public function restored(Invitation $invitation)\n {\n //\n }", "public function restored(Invitation $invitation)\n {\n //\n }", "public function restored(Order $order)\n {\n //\n }", "public function restored(Order $order)\n {\n //\n }", "public function restored(Order $order)\n {\n //\n }", "public function restore($id){\n \\App\\Models\\Sucursal::withTrashed()->find($id)->restore();\n Flash::success('Sucursal restaurada.');\n\n return redirect(route('sucursales.deleted'));\n }", "public function restored(Order $order)\n\t{\n\t\t//\n\t}", "public function restored(Order $order)\n\t{\n\t\t//\n\t}", "public function restored(AppointmentNote $note)\n {\n //\n }", "public function restored(Document $document)\n {\n //\n }", "public function restored(CovidPatient $covidPatient)\n {\n //\n }", "public function restored(Credit $credit)\n {\n //\n }", "public function restore($id)\n {\n $comic=Comic::withTrashed()->find($id);\n $comic->restore();\n return redirect()->route('comics.index')->with('success',$comic->title);\n \n }", "public function getRestore($id) {\n $order = Order::onlyTrashed()->where('id', $id);\n $order->restore();\n flash('Order restore sucessfully!');\n return redirect('dashboard/admin/order');\n }", "public function restored(Order $Order)\n {\n //code...\n }", "public function restored(OnlineInquiry $onlineInquiry)\n {\n //\n }", "public function restored(Subscription $subscription)\n {\n //\n }", "public function restore($id) {\n $socios = socio::withTrashed()->where('id', '=', $id)->first();\n //Restauramos el registro\n $socios->restore();\n $message='El Socio '.$socios->name.' fue RESTAURADO ';\n $title =\"\";\n Toastr::success($message, $title);\n return redirect()->route(\"listasocios\");\n }", "public function restore(int $id)\n {\n //\n }", "public function restore(int $id)\n {\n ImagingExam::withTrashed()->where('id', $id)->restore();\n return redirect()->route('admin.imagingExam.index');\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 }", "public function restored(Transaction $transaction)\n {\n //\n }", "public function restored(Exchange $exchange)\n {\n //\n }", "public function restore($id) \n {\n $receipt = Receipt::withTrashed()->find($id)->restore();\n return response()->json(['done']);\n }", "public function restore($id)\n {\n $order = Order::withTrashed()->whereId($id)->restore();\n return redirect(route('orders.index'))->withToastSuccess('Successfully Restored');\n }", "public function restored(Article $article)\n {\n //\n }", "public function restored(Edit $edit)\n {\n //\n }", "protected static function restore() {}", "public function restored(Partner $partner)\n {\n //\n }", "public function restored(Saida $saida)\n {\n //\n }", "public function restored(SaleService $saleService)\n {\n //\n }", "public function restore($id)\n {\n //\n $result = ScanResults::find($id);\n\n $result->resote();\n }", "function restore()\n {\n }", "public function restored(Student $student)\n {\n //\n }", "public function restored_customer($id)\n {\n Warehouse_order::withTrashed()->find($id)->restore();\n return redirect('trash_customers')->with('success','Data has been restored.');\n }", "public function restored(TradeCancel $tradeCancel)\n {\n //\n }", "public function restored(Patient $patient)\n {\n //\n }", "public function restored(Currency $currency)\n {\n //\n }", "public function restore(string $id)\n {\n // TODO: ...\n }", "public function restored(Item $item)\n {\n //\n }", "public function restored(Item $item)\n {\n //\n }", "public function restore($id)\n {\n if (! Gate::allows('document_delete')) {\n return abort(401);\n }\n\n $document = PropertiesFacturas::onlyTrashed()->findOrFail($id);\n $factura = PropertiesFacturas::onlyTrashed()->findOrFail($id);\n $id_property= $document->id_property;\n $id_tenant=$document->id_tenant;\n $property=Property::findOrFail($id_property);\n $document->restore();\n $facturas = PropertiesFacturas::where('id_property',$id_property)->where('deleted_at',NULL)->get();\n $documents = \\App\\Document::where('property_id', $document->id_property)->get();\n $notes = \\App\\PropertiesFacturas::where('id_tenant', $document->id_property)->get();\n $tenant=User::findOrFail($id_tenant);\n return redirect()->route('admin.tenants.show',compact('tenant','facturas','documents','notes','factura'))\n \n ->with('flash','Factura # COL-FT-'.$factura->id.' ha sido restaurada correctamente. '\n .$tenant->name.' ('.$tenant->email.') de la unidad '.$tenant->subproperty->nombre.' en la propiedad '.$tenant->property->name\n );\n }", "public function restored(Bank $bank)\n {\n //\n }", "public function restored(Ticket $ticket)\n {\n //\n }", "public function restored(ReservationPayment $ReservationPayment)\n {\n //\n }", "public function reopenInvoice() {\n\n $client = new \\app\\components\\OdooClient();\n $account_invoice_ids = $client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"in_invoice\"],\n [\"journal_id\", \"=\", 22]\n ]);\n\n $result = $client->execute(\"account.invoice\", \"signal_workflow\",\n [\n $account_invoice_ids,\n \"invoice_cancel\"\n ]);\n\n print_r($result);\n\n }", "public function restore($id)\n {\n if (! Gate::allows('presentacionproducto_delete')) {\n return abort(401);\n }\n $presentacionproducto = Presentacionproducto::onlyTrashed()->findOrFail($id);\n $presentacionproducto->restore();\n\n return redirect()->route('admin.presentacionproductos.index');\n }", "public function restore(User $user, Inventario $inventario)\n {\n //\n }", "public function restore()\n {\n //Query Builder\n DB::table('users')->delete();\n DB::table('respuestas')->delete();\n \n echo \"Realizado\";\n }", "public function restoredItem(int $id)\n {\n return $this->withTrashed()->whereId($id)->restore();\n }", "public function restored(Food $food)\n {\n //\n }", "public function restore()\n\t{\n\t\t$this->files = array();\n\t}", "public function restore_cart() {\n\t\t// delete current cart\n\t\tWC()->cart->empty_cart( true );\n\n\t\t// update user meta with saved persistent\n\t\t$saved_cart = get_user_meta( $this->userId, '_ebanx_persistent_cart', true );\n\n\t\t// then reload cart\n\t\tWC()->session->set( 'cart', $saved_cart );\n\t\tWC()->cart->get_cart_from_session();\n\t}", "public function restored(HoldAmount $holdAmount)\n {\n //\n }", "public function restored(RideShareTransaction $rideShareTransaction)\n {\n //\n }", "public function restored(Reports $report)\n {\n //\n }", "public function restored(Asistencia $asistencia)\n {\n //\n }", "public function restored(Job $job)\n {\n //\n }", "protected function performRestore(Model $entity): void\n {\n $entity->restore();\n }", "public function restore($id)\n {\n if (!Gate::allows('quotation_delete')) {\n return abort(401);\n }\n $quotation = Quotation::onlyTrashed()->findOrFail($id);\n $quotation->restore();\n\n return redirect()->route('admin.quotations.index');\n }", "public function restored(InventoryStock $stock)\n {\n $movements = $stock->movements()->onlyTrashed()->get();\n\n if (count($movements) > 0) {\n foreach ($movements as $movement) {\n $movement->restore();\n }\n }\n }", "public function restoring(Wallet $wallet)\n {\n //\n }", "public function restore($id)\n {\n if($id=='0'){\n //Restore Proses\n $treaty = Treaty::onlyTrashed();\n $treaty->restore();\n //splash message\n session() -> flash('success','Semua Data berhasil dialihkan ke Production');\n }else{\n //Restore Proses\n $treaty = Treaty::onlyTrashed()->where('id',$id);\n $treaty->restore();\n //splash message\n session() -> flash('success','Data berhasil dialihkan ke Production');\n }\n \n //redirecting\n return redirect(route('treatyxsim.trashed'));\n }", "public function restored(Historia $historia)\n {\n //\n }", "public function restore($id)\n {\n $restore_deleted=Service::withTrashed()->find($id)->restore();\n\n $notification=array(\n 'message'=>'Service Restored',\n 'alert_type'=>'info',\n );\n return redirect()->back()->with($notification);\n }", "public function restore(User $user, EduDocument $eduDocument)\n {\n //\n }", "public function restore($id){\n $data = Fees::findOrFail($id);\n $data->is_deleted = false;\n $data->save();\n\n return Redirect(env('admin').'/fees/trash')->with('success_message','Fee Restored Successfully.');\n }", "public function restored(Vehicle $vehicle)\n {\n //\n }", "public function undoRestore ()\n {\n if (file_exists ( $this->_previewFilename ))\n {\n unlink($this->_previewFilename);\n }\n }", "public function restored(Siswa $siswa)\n {\n //\n }", "public function restored(InDay $inDay)\n {\n //\n }" ]
[ "0.6627594", "0.66144055", "0.65855706", "0.6547149", "0.6547149", "0.6547149", "0.6547149", "0.6536155", "0.6507101", "0.646961", "0.6448661", "0.63973445", "0.6390343", "0.63881695", "0.6383682", "0.6375943", "0.6358784", "0.6343905", "0.6312236", "0.63025296", "0.62820035", "0.6276006", "0.6237783", "0.62331015", "0.62268984", "0.62128985", "0.6178154", "0.6176748", "0.6176748", "0.6174234", "0.6174234", "0.6174234", "0.61667204", "0.6166004", "0.6166004", "0.6153403", "0.61493546", "0.61492527", "0.61461955", "0.6142802", "0.6130008", "0.6127879", "0.6127432", "0.61223567", "0.6100037", "0.60959417", "0.60926193", "0.60902286", "0.60902286", "0.60902286", "0.60902286", "0.6088951", "0.6082062", "0.6075382", "0.6060774", "0.6055207", "0.6052905", "0.6012234", "0.5994181", "0.5980784", "0.5978764", "0.5966134", "0.5951178", "0.5939192", "0.59345317", "0.5930053", "0.592649", "0.5921902", "0.5903399", "0.5903399", "0.58996713", "0.5898841", "0.58981436", "0.5895626", "0.58940053", "0.5886283", "0.58857304", "0.58844614", "0.58781177", "0.5869064", "0.5841311", "0.58128786", "0.5810102", "0.5807162", "0.5806805", "0.5804468", "0.57949555", "0.5793329", "0.57766134", "0.5776101", "0.5775582", "0.57608753", "0.57547903", "0.574402", "0.5741347", "0.5740771", "0.5719391", "0.5712908", "0.57092243", "0.5706961" ]
0.6800103
0
Permanently delete Invoice from storage.
public function perma_del($id) { if (! Gate::allows('invoice_delete')) { return abort(401); } $invoice = Invoice::onlyTrashed()->findOrFail($id); $invoice->forceDelete(); return redirect()->route('admin.invoices.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Invoice $invoice)\n {\n\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function destroy(Request $request)\n{\n$id = $request->id;\n$invoice = invoice::find($id)\n->get()\n->first();\n$invoice->delete();\nsession()->flash('delete', 'deletet successfully');\nreturn back();\n}", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function destroy(Invoice $invoice)\n {\n //\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "function delete()\n {\n $this->getDi()->hook->call(Am_Event::INVOICE_BEFORE_DELETE, array('invoice' => $this));\n foreach ($this->getItems() as $item) {\n $item->delete();\n }\n // $this->deleteFromRelatedTable('?_invoice_log'); // not good idea to delete\n $this->deleteFromRelatedTable('?_invoice_payment');\n $this->deleteFromRelatedTable('?_invoice_refund');\n $this->deleteFromRelatedTable('?_invoice_item_option');\n foreach ($this->getAccessRecords() as $access) {\n $access->delete();\n }\n parent::delete();\n $this->getUser()->checkSubscriptions(true);\n $this->getDi()->hook->call(Am_Event::INVOICE_AFTER_DELETE, array('invoice' => $this));\n return $this;\n }", "public function destroy(Invoice $invoice) {\n\t\t//\n\t}", "public function delete($invoice_id, $id) {\n\t\tDB::select(\n\t\t\t\"DELETE FROM invoice_item\n\t\t\tWHERE invoice_item.item_id = :id\",\n\t\t\tarray(\":id\" => $id));\n\t\treturn redirect('invoices/details/' . $invoice_id);\n\t}", "public function destroy( Invoice $invoice ) {\n\t\t$invoice->delete();\n\n\t\treturn redirect( '/invoice' );\n\t}", "public function destroy($id)\n {\n $row = Invoice::where('id', $id)->first();\n // Delete File ..\n\n\n try {\n $row->item()->delete();\n $row->delete();\n } catch (QueryException $q) {\n\n return redirect()->back()->with('flash_danger', $q->getMessage());\n }\n return redirect()->route($this->routeName . 'index')->with('flash_success', 'تم الحذف بنجاح !');\n }", "public function destroy($id)\n {\n $invoice = Invoice::withTrashed()->where('id', $id)->firstOrFail();\n if ($invoice->trashed()) {\n # deleting permanently\n $invoice->forceDelete();\n InvoiceRecord::where(\"invoice_id\", $invoice->id)->delete();\n session()->flash('success', 'Invoice deleted successfuly');\n return redirect(route('invoices.trashed'));\n } else {\n // if not trashed befored then trashing\n $invoice->delete();\n session()->flash('success', 'Invoice has been trashed successfuly');\n return redirect(route('invoices.index'));\n }\n session()->flash(\"success\", \"Invoice deleted successfully\");\n }", "public final function delete() {\n }", "public function delete_invoice() {\n\n // Make sure we were sent a mock invoice id\n if ( isset( $_POST[ 'mockInvoiceId' ] ) ) {\n\n // Get all entry ids that were part of the invoice so we can pass them back\n $entryArray = $this->mockinvoice_model->get_entry_ids( $_POST[ 'mockInvoiceId' ] );\n // Remove all entries from the invoice\n $this->mockinvoice_model->remove_all_entries( $_POST[ 'mockInvoiceId' ] );\n // Delete all mock invoice rows\n $this->mockinvoice_row_model->delete_where( 'mockInvoiceId', $_POST[ 'mockInvoiceId' ] );\n // Delete the mock invoice\n $this->mockinvoice_model->delete( $_POST[ 'mockInvoiceId' ] );\n\n }\n // Error handling - return some JSON if delete was processed\n if ( !empty( $entryArray ) ) {\n // Send back the timesheet entry ids as JSON\n $this->json_library->print_array_json_unless_empty( $entryArray );\n }\n }", "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();", "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 destroy($id)\n {\n RetailSaleModel::where('invoice_id',$id)->delete();\n RetailSaleChildModel::where('invoice_id',$id)->delete();\n Session::flash('success','Invoice Deleted Successfully');\n return back();\n }", "public function destroy($invoiceid) \n {\n\n \n Invoice::destroy($invoiceid);\n\n Session::flash('flash_message', 'Invoice deleted!');\n\n return redirect('invoice/index');\n }", "public function destroy($id)\n {\n $invoice=invoice::find($id);\n\t\t$invoice->delete();\n\t\treturn redirect()->route('invoice.index')->with('success','Data Deleted');\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function delete()\n {\n $this->repository->delete($this->id);\n }", "public function forceDelete();", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function destroy(Request $request, $id)\n {\n $url = \"invoice/list\";\n if (isset($id)) {\n try {\n $record = SaleOrder::find($id);\n if ($record) {\n DB::beginTransaction();\n $transactionReferenceIds = CustomerTransaction::where('sale_order_id', $id)->pluck('transaction_reference_id')->toArray();\n $deleteTransactions = Transaction::whereIn('transaction_reference_id', $transactionReferenceIds)->delete();\n $deleteCustomerTransactions = CustomerTransaction::where('sale_order_id', $id)->delete();\n $deleteTransactionReferences = TransactionReference::whereIn('id', $transactionReferenceIds)->delete();\n $deleteStockMoves = StockMove::where(['transaction_type_id' => $record->id, 'transaction_type' => 'SALESINVOICE'])->delete();\n $deleteInvoiceDetails = SaleOrderDetail::where('sale_order_id', $record->id)->delete();\n $deleteInvoiceFiles = (new File)->deleteFiles('Direct Order', $record->id, [], $path = 'invoice_order');\n $deleteOrder = $record->delete();\n DB::commit();\n \\Session::flash('success', __('Deleted Successfully.'));\n if ($request->sub_menu == 'customer') {\n $url = \"customer/invoice/\".$request->customer;\n } else if ($request->sub_menu == 'users') {\n $url = \"user/sales-invoice-list/\".$user_id;\n }\n } else {\n \\Session::flash('fail', __('Delete Failed'));\n }\n } catch (Exception $e) {\n DB::rollBack();\n \\Session::flash('fail', __('Delete Failed'));\n }\n } else {\n \\Session::flash('fail', __('Delete Failed'));\n }\n return redirect()->intended($url);\n }", "public function destroy(PurchaseInvoice $purchaseInvoice)\n {\n //\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove(): int {\n $where = 'invoice_id = ?';\n $values = [$this->invoiceId];\n return $this->delete($where, $values);\n }", "function deleteReceipt()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'DELETE FROM '.receipt_table.' WHERE receipt_id = '.$this->receipt_id;\n\t\t$db->query($query);\n\t}", "public function destroy($incidencia)\n {\n //\n Incidencies::find($incidencia)->delete();\n }", "public function destroy($id_payable_invoice)\n {\n $invoice = InvoicePayable::findOrFail($id_payable_invoice);\n InvoicePayabledetail::where('id_payable_invoice', $id_payable_invoice)->delete();\n $invoice->delete();\n\n return redirect()->back()->with('messagehapus','Data Invoice Berhasil dihapus');\n }", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function destroy($invoice_id,$file_id)\n {\n $Attachment = Attachment::findOrFail($file_id);\n\n $file = $Attachment->invoice_number.'/'.$Attachment->file_name;\n\n // file system storage public_upload\n if(Storage::disk(\"public_uploads\")->exists($file)){\n Storage::disk('public_uploads')->delete($file);\n }\n\n $Attachment->delete();\n\n request()->session()->flash('msgSuccess', 'تم حذف المرفق بنجاح');\n return back();\n }", "public function delete_invoice( $invoice_id ) {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get invoice details\n $invoice = $this->invoice->delete_invoice( $invoice_id ); \n \n // Verify if invoice exists\n if ( $invoice ) {\n \n echo json_encode(1);\n \n }\n \n }", "public function destroy($id)\n {\n $invoice = Invoice::findOrFail($id);\n Product::where('invoice_id', $id)->delete();\n Invoice::destroy($id);\n return redirect('/customers/'.$invoice->user_id)->with('success', 'Invoice Updated!');\n }", "public function delete()\n {\n if (post_param_integer('confirmed', 0) != 1) {\n $url = get_self_url();\n $text = do_lang_tempcode('DELETE_INVOICE');\n\n $hidden = build_keep_post_fields();\n $hidden->attach(form_input_hidden('confirmed', '1'));\n $hidden->attach(form_input_hidden('from', get_param_string('from', 'browse')));\n\n return do_template('CONFIRM_SCREEN', array('_GUID' => '45707062c00588c33726b256e8f9ba40', 'TITLE' => $this->title, 'FIELDS' => $hidden, 'PREVIEW' => $text, 'URL' => $url));\n }\n\n $GLOBALS['SITE_DB']->query_delete('invoices', array('id' => get_param_integer('id')), '', 1);\n\n $url = build_url(array('page' => '_SELF', 'type' => post_param_string('from', 'browse')), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }", "public function destroy(Invoice $transaction)\n {\n // dd($transaction);\n $transaction->update(['ti_is_delete' => true]);\n $transaction->delete();\n return redirect()->back()->with('message', 'Success Delete Transaksi!');\n }", "public function destroy($id)\n {\n //\n Invoice::destroy($id);\n return redirect('finance/invoice');\n }", "public function destroy($id)\n {\n $invoice = Invoice::find($id);\n $invoice->delete();\n Session::flash('invoice_deleted', 'Invoice deleted successfully');\n return redirect()->route('invoice.index');\n }", "function delete_invoice_items($id){\n $this->company_db->delete('tbl_invoice_item', array(\"header_id\"=>$id));\n }", "public function destroy($id)\n {\n $ProductInvoice = ProductInvoice::findOrFail($id);\n $invoices = Invoice::findOrFail($id);\n $invoices->delete();\n\n return back();\n }", "public function destroy($id)\n\t{\n\t\t$invoice = Invoice::findOrFail($id);\n\t\t$invoice->delete();\n\n\t\treturn redirect()->route('invoices.index')->with('message', 'Item deleted successfully.');\n\t}", "public function destroy(InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function destroy($id)\n {\n if (Auth::user()->role == User::ROLE_SUPERADMIN) {\n $invoice = InvoiceLists::findOrFail($id);\n\n $POLists = PurchaseOrderLists::findOrFail($invoice->purchase_order_list_code_id);\n $POData['fix_data'] = 0;\n $POLists->update($POData);\n\n InvoiceLists::destroy($id);\n InvoiceListsDetail::where('invoice_list_id', $id)->delete();\n\n $old_data_payment = InvoiceListsPayment::where('invoice_list_id', $id)->get();\n if (count($old_data_payment) > 0) {\n foreach ($old_data_payment as $payment) {\n InvoiceListsPayment::where('invoice_list_id', $id)->delete();\n $image_payment_path = app_path(\"../../files/invoice-payment/\" . $payment->file_payment . \"\");\n unlink($image_payment_path);\n }\n }\n if ($invoice->file != '') {\n $image_path = app_path(\"../../files/invoice/\" . $invoice->file . \"\");\n unlink($image_path);\n }\n\n\n Alert::success('Your data already deleted !', 'Success !');\n }\n return redirect('admin/invoice-list');\n }", "public function destroy($id)\n {\n Invoices::findOrFail($id)->delete();\n \n session()->flash('message','The Invoice record has been successfully deleted.');\n\n return redirect()->back();\n }", "public function destroy(Invoice $invoice)\n {\n // DB::beginTransaction();\n // $invoice->is_active = 0;\n // $invoice->save();\n // DB::commit();\n\n // return Response::json(['message' => 'Data berhasil dinon-aktifkan'], 200);\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "public function delete()\n {\n if (!$this->id) {\n throw new \\RuntimeException('You cannot delete a device without id');\n }\n\n\t\tPersistentSession::getInstance()->delete($this);\n }", "public function purchase_unsaved_delete()\n {\n $purchase_no = $this->input->post('purchase_no');\n /** Remove auto created purchase journal */\n $journal = $this->MAc_journal_master->get_by_doc('Purchase', $purchase_no);\n if (count($journal) > 0)\n {\n $this->MAc_journal_details->delete_by_journal_no($journal['journal_no']);\n $this->MAc_journal_master->delete_by_journal_no($journal['journal_no']);\n }\n /** Remove auto created payment receipt for partial or full cash purchase */\n $payment = $this->MAc_payment_receipts->get_by_doc('Purchase', $purchase_no);\n if (count($payment) > 0)\n {\n $this->MAc_payment_receipts->delete($payment['id']);\n }\n /** Remove purchase */\n $this->MPurchase_details->delete_by_purchase_no($purchase_no);\n $this->MPurchase_master->delete_by_purchase_no($purchase_no);\n }", "public function delete(Request $request)\n {\n $this->validate(request(), [\n 'invoice_id' => 'required',\n ]);\n\n $invoice = $this->invoiceRepository->find($request->get('invoice_id'));\n\n if (!$invoice) {\n return response()->json(['status' => 'error'], 404);\n }\n\n if ($this->invoiceRepository->delete($invoice)) {\n return response()->json(['status' => 'success'], 200);\n }\n\n return response()->json(['status' => 'error'], 404);\n }", "public function delete_client_invoice($delete_id){\n\t\n\t$this->db->where('client_id', $delete_id);\n\t\t\n\treturn $this->db->delete('invoice');\n\t\n}", "public function delete()\n\n {\n Sales::find($this->deleteId)->delete();\n session()->flash('message', 'Sale Deleted Successfully.');\n\n }", "public function testDeleteInvoice() {\n\t\t$randomInvoice = rand();\n\n\t\t$tokenizer = new Token($_SESSION['accessToken']);\n\n\t\t$tokenizer->ip('173.49.87.94')\n\t\t\t\t->expirationMonth(12)\n\t\t\t\t->expirationYear(30)\n\t\t\t\t->cardNumber('4321000000001119')\n\t\t\t\t->cvv('333')\n\t\t\t\t->cardType('VS')\n\t\t\t\t->name('John Smith')\n\t\t\t\t->zip('65000')\n\t\t\t\t->address('65 Main Street')\n\t\t\t\t->post();\n\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->total(100)\n\t\t\t\t->clerk('1')\n\t\t\t\t->invoiceNumber($randomInvoice)\n\t\t\t\t->tokenValue($tokenizer->getToken())\n\t\t\t\t->purchaseCard(array(\n\t\t\t\t\t'customerReference' => 412348,\n\t\t\t\t\t'destinationPostalCode' => 19134,\n\t\t\t\t\t'productDescriptors' => array('rent')\n\t\t\t\t))\n\t\t\t\t->sale();\n\n\t\t$output = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ': CARD AND TRANSACTION CREATION');\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $output\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Deleting an invoice requires the transaction be sent in the header\n\t\t$transaction = new Transaction($_SESSION['accessToken']);\n\n\t\t$transaction->deleteInvoice($randomInvoice);\n\n\t\t$result = $transaction->output();\n\n\t\t// Laravel Logging\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__);\n\t\tLog::debug('SHIFT 4 TEST 5: ' . __FUNCTION__ . ' INVOICE: ' . $_SESSION['invoiceForTest5']);\n\t\tLog::debug(\n\t\t\tjson_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'Request' => $transaction->request(),\n\t\t\t\t\t'Output' => $result\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\n\t\t$this->assertNotNull($result);\n\n\t}", "public function destroy($id)\n {\n // remove invoice from archive list and from normal list of invoices\n $invoice = Invoice::withTrashed()->where('id', $id)->first();\n\n // Method one -------------------------------------\n // delete invoice with attachment no restore\n\n // check if has minimal one file to delete the folder parent in the attachments storage directory\n $attachment = Attachment::where('invoice_id', $invoice->id)->first();\n\n if (!empty($attachment->invoice_id)) {\n Storage::disk('public_uploads')->deleteDirectory($invoice->invoice_number);\n }\n $invoice->forceDelete();\n\n // ------------------------------------------------\n\n request()->session()->flash('msgSuccess', \"تم حذف الفاتورة بنجاح\");\n return back();\n }", "public function destroy(ImportInvoice $importInvoice)\n {\n $importInvoice->delete();\n return redirect()->route('importinvoice.index')\n ->with('success','Import Invoice deleted successfully');\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete()\n {\n parent::delete();\n $receiptHandle = $this->job->getReceiptHandle();\n $this->mns->deleteMessage($receiptHandle);\n }", "public function destroy($id)\n {\n if (auth()->user()->hasRole('admin')) {\n $invoice = Invoice::find($id);\n\n if ($invoice->multiple) {\n foreach (json_decode($invoice->multiple_codes, true) as $code) {\n $authorization = Authorization::findByCode($code);\n if ($authorization) {\n $authorization->update([\n 'invoice_id' => 0\n ]);\n }\n }\n } else {\n $authorization = Authorization::findByCode($invoice->authorization_code);\n if ($authorization) {\n $authorization->update([\n 'invoice_id' => 0\n ]);\n }\n }\n\n if (!$invoice) {\n Session::flash('message_danger', 'Factura no encontrada');\n return redirect()->back()->withInput();\n }\n\n $note = AccountingNote::where('invoice_id', $invoice->id)->first();\n if ($note) {\n $note->delete();\n }\n\n $invoice->delete();\n\n Session::flash('message', 'Factura eliminada exitosamente');\n return redirect()->route('invoice.index');\n }\n Session::flash('message_danger', 'No tienes permiso para borrar facturas. Este movimiento ha sido notificado');\n return redirect()->route('invoice.index');\n }", "public function destroy($id)\n {\n if (! Gate::allows('invoice_delete')) {\n return abort(401);\n }\n $invoice = Invoice::findOrFail($id);\n $invoice->delete();\n\n return redirect()->route('invoices.index');\n }", "public function destroy($id)\n {\n if(!Sentinel::inRole('main')){\n //Flash::error('invoice not found');\n return redirect('invoices');\n //return;\n }\n $invoice = $this->invoiceRepository->findWithoutFail($id);\n\n if (empty($invoice)) {\n Flash::error('invoice not found');\n\n return redirect(route('invoices.index'));\n }\n\n $this->invoiceRepository->delete($id);\n\n Flash::success('invoice deleted successfully.');\n\n return redirect(route('invoices.index'));\n }", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function deleteAction() {\n\t\t$files = new Files ( );\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\ttry {\n\t\t\tif (is_numeric ( $id )) {\n\t\t\t\t\n\t\t\t\t// Deleting the order\n\t\t\t\t$this->invoices->find ( $id )->delete ();\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tdie ( $e->getMessage () . \" \" . $e->getTraceAsString () );\n\t\t}\n\t\t\n\t\treturn $this->_helper->redirector ( 'index', 'invoices' );\n\t}", "public function delete( $id ) {\r\n $id = intval( $id );\r\n \r\n $this->db->delete( 't_trx_receipt', array( 'receipt_id' => $id ) );\r\n }", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public function delete()\n {\n $this->invalidateCache();\n parent::delete();\n }", "public function purchase_item_delete(){\r\n\t\t\r\n\t\t$this->Purchase_model->purchase_item_delete();\r\n\t}", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function delete()\n {\n $this->job->delete();\n }", "public function deleted(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function delete($record_id, Request $request){\n if(Ahkam::findOrFail($record_id)->first() != \" \" ) { \n $file = Ahkam::findOrFail($record_id);\n $deleted = new AhkamDeleted;\n\n \n /////////////////////////////////////////////\n\n\n $deleted->crida_number = $file->crida_number;\n $deleted->database_id = $file->id;\n $deleted->date_of_archiving = $file->date_of_archiving; \n $deleted->type_of_document = $file->type_of_document; \n $deleted->number_of_document = $file->number_of_document;\n $deleted->date_of_document = $file->date_of_document; \n $deleted->kholasmatlab = $file->kholasmatlab;\n $deleted->molahezat = $file->molahezat; \n $deleted->more = $file->more; \n $deleted->file = $file->file; \n $deleted->uuid = $file->uuid; \n\n\n $del_comment = AhkamComment::where('ahkam_id', $record_id);\n $del_access = AhkamUser::where('ahkam_id',$record_id);\n $del_notis = Noti::where('file_id', $record_id);\n \n DB::beginTransaction();\n try {\n $deleted->save();\n\n //to move a file in the (deleted) folder\n if(file_exists(storage_path('app/files/Ahkam/'. $file->file))){ \n $old = storage_path('app/files/Ahkam/'. $file->file);\n $new = storage_path('app/deleted/Ahkam/'. $file->file);\n $move = File::move($old, $new);\n }\n\n //to delete its comments\n if($del_comment){\n $del_comment->delete();\n } \n \n //to delete its user access\n if($del_access){\n $del_access->delete();\n }\n //to delete its notifications\n if($del_notis){\n $del_notis->delete();\n }\n $file->delete();\n DB::commit();\n $result = \"success\";\n } catch (\\Exception $e) {\n $result = \"failed\";\n DB::rollback();\n }\n\n return response()->json(['result' => $result]);\n }\n }", "public abstract function delete();", "public function forceDeleted(TipoInstrumento $tipoInstrumento)\n {\n //\n }", "public function delete()\n {\n parent::delete();\n\n $this->sqs->deleteMessage([\n 'QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job->getReceiptHandle(),\n ]);\n }" ]
[ "0.6961559", "0.6838691", "0.6821104", "0.67633384", "0.67633384", "0.67633384", "0.67633384", "0.67633384", "0.67633384", "0.66715205", "0.6661312", "0.66326815", "0.6590575", "0.64941657", "0.6477786", "0.6467177", "0.64608335", "0.63892615", "0.63832897", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6380409", "0.6375661", "0.63549936", "0.6341723", "0.63276297", "0.6324949", "0.63141257", "0.63067913", "0.6298467", "0.6292108", "0.6292108", "0.6291408", "0.629032", "0.6284979", "0.62823343", "0.6263696", "0.62531143", "0.6234118", "0.6232297", "0.62314564", "0.6225214", "0.6223174", "0.6221479", "0.62096596", "0.6198849", "0.6188663", "0.6152195", "0.61424744", "0.61363566", "0.6135848", "0.61224985", "0.61218107", "0.61184704", "0.6117343", "0.61104554", "0.6109872", "0.6092334", "0.60865957", "0.6082667", "0.6061736", "0.605923", "0.6058594", "0.60578525", "0.6045499", "0.6021204", "0.6018922", "0.60141426", "0.60035884", "0.5999921", "0.59999156", "0.5996467", "0.5990222", "0.59846175", "0.597833", "0.59669995", "0.59651846", "0.5964027", "0.5964027", "0.59598887", "0.5957383", "0.59569204", "0.5954675", "0.59470856", "0.5943994", "0.59349537", "0.59248686", "0.5921395" ]
0.62228024
55
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/
public function index() { $this->load->helper('url'); $this->load->model(LoginBar_model); $data['infoNav'] = $this->load->view('common\nav', '', TRUE); $data['infoFooter'] = $this->load->view('common\footer', '', TRUE); $this->load->view('index\welcome_message',$data); if($_SESSION[username]&&$_SESSION[id]) { //登录时间和IP记录 $this->load->helper('date'); $datestring = '%Y-%m-%d %H:%i:%s'; //2016-04-30 13:27:23 date_default_timezone_set (PRC);//时间默认 是 格林尼治时间 $time = time(); $_SESSION[last_login_time] = mdate($datestring, $time); $this->load->model(DB_model); $_SESSION[last_login_ip]=$this->input->ip_address(); // $this->DB_model->update("UPDATE tb_users SET last_login_time = '".$_SESSION[last_login_time]."',last_login_ip='".$_SESSION[last_login_ip]."' WHERE user_login = '".$_SESSION[username]."';"); }else{ // echo fasle; } // $this->load->library('session'); // $_SESSION['admin']="admin"; // echo $_SESSION['admin']; // $this->session->admin="adminadmin"; // echo $_SESSION['admin']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }", "public function index()\n\t{\n\t\t//Default view\n\t\t$this->load->view('index.html');\n\t}", "function index() {\n\n // This page cannot be accessed without providing a page\n // the routes.php file will not allow the page to be accessed\n // $route['pages/(:any)'] = 'pages/view/$';\n redirect('/', 'refresh');\n\n }", "public function Index()\n\t{\n\t\t$this->views->SetTitle('Index Controller');\n\t\t$this->views->AddView('index/index.tpl.php', array(),'primary');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('default/index');\n\t}", "public function index() {\n\t\t$this->display('index');\n\t}", "public function index()\n\t{\t\n\n\t\t$this->load->view('welcome_message');\n\t}", "public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n }", "public function show_index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function Index()\n {\n $this->standardView('Index');\n }", "public function index()\n {\n return view('main.welcome');\n }", "public function index()\n {\n // return view('welcome');\n }", "public function index()\n {\n $this->load->view('index');\n }", "public function index()\n {\n // return view('welcome');\n \n }", "public function index()\n\t{\n\t\t$this->load->view('home');\n\t}", "public function index()\n\t{\n\t\techo \"Nothing !\";\n\t}", "public function index() {\n \n return view('welcome');\n }", "public function index()\n {\n return view('pages.welcome');\n }", "public function Index()\n {\n \treturn view(\"index\");\n\t}", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n\t\t/*$this->layout->setTitle('Welcome to our Blog');\n\t\t$this->layout->showView('welcome/about.php');*/\n\t\techo 'hello I\\'m using codeigniter';\n }", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\treturn view('pages/home');\n\t}", "public function index()\n {\n return \"INDEX PAGE\";\n }", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "function index() {\n \n parent::index();\n\n\t\t$data['user_id'] = $this->tank_auth->get_user_id();\n\t\t$data['username'] = $this->tank_auth->get_username();\n\t\t$data['main_content_view'] = $this->load->view('welcome', $data, true);\n $this->render_template($data);\n\t}", "public function index()\n {\n SEOMeta::setTitle('Trusted Mortgage & Remortgage Solutions In UK - SmartMortgages UK');\n SEOMeta::setDescription('Home Page Description: For competitive mortgage and remortgage quotes around the UK at affordable rates, speak to one of our expert credit consultants and get a mortgage. For more visit us today.');\n\n return view('welcome');\n }", "public function index()\n\t{\n\t\t$this->title = 'My Index Action';\n\n\t\treturn new View('basic/index');\n\t}", "public function index()\n\t{\n\t\t$data['title'] = 'Home | Welcome to AEY';\n\t\t$data ['view_page'] = 'homepage';\n\n\t\t$this->load->view('site', $data);\n\t}", "public function index()\n {\n\n return view('welcome');\n\n }", "public function actionIndex(){ \n $this->view(\"index.php\");\n }", "public function index() {\n $this->registry->template->module = 'welcome';\n \n /*** load the index template ***/\n $this->registry->template->show('index');\n }", "public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}", "public function index()\n {\n return view('front.welcome');\n }", "public function index()\n\t{\n\t\treturn $this->traces();\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\t$this->loadViews(\"index\");\n\t}", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function index()\r\n\t{\r\n\t\techo \"index\";\r\n\t}", "public function index()\n\t{\n\t\t$this->twig->display('welcome/index.html', []);\n\t}", "public function Index() {\n $this->Display();\n }", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function index()\n {\n $title = 'Welcome Page';\n return view($this->view . '.home', compact('title'));\n }", "public function index()\n\t{\n\t\t//\n\t\techo'index';\n\t}", "public function index() {\n $this->getView('navigation', array('pagename' => 'Welcome'));\n $this->getView('welcome');\n $this->getView('footer');\n }", "public function index()\n {\n return view(\"home\");\n }", "public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}", "function index() {\n $this->renderView(\"index\");\n }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function index()\n\t{\n\t\treturn view('index');\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n\n\n\n return view('welcome');\n }", "public function index() {\n\t\t$page = Page::getInstance();\n\t\t$session = Session::getInstance();\n\t\t$page->setPageTitle('Method index notfound');\n\t\t$session->setFlash('Chaque controller doit avoir une m&eacute;thode index', 'error');\n\t}", "public function index()\r\n\t{\r\n\t\t//\r\n\t}", "public function index() {\n\t\t// render the view (/view/main/index.php)\n\t\t$this->view->render(\"main\", \"index\");\n\t}", "public function index()\n {\n // Nothing to do\n }", "public function index()\n {\n return View(\"pages.home\");\n }", "public function index(){\n return view('welcome');\n }", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}" ]
[ "0.7654609", "0.7413426", "0.7394598", "0.731692", "0.7227223", "0.7227223", "0.71899563", "0.7165393", "0.7151099", "0.7144871", "0.71078676", "0.7078446", "0.7074241", "0.70401293", "0.7029486", "0.7029486", "0.7029486", "0.7029486", "0.7029486", "0.697335", "0.6968791", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.694649", "0.693218", "0.6925767", "0.6912394", "0.69008887", "0.6895028", "0.68747455", "0.6858402", "0.6856054", "0.6838835", "0.6804161", "0.68017256", "0.68017256", "0.67949307", "0.67897016", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6767282", "0.6765904", "0.67649317", "0.6761374", "0.6761374", "0.6750939", "0.6750867", "0.67477846", "0.6741518", "0.67382467", "0.6730569", "0.6716669", "0.6713985", "0.6711219", "0.6704401", "0.67004186", "0.6692823", "0.6674554", "0.66629815", "0.66613066", "0.66507727", "0.6631868", "0.66218233", "0.6612657", "0.66054386", "0.6597767", "0.6594728", "0.659294", "0.6586656", "0.65768975", "0.65764683", "0.6574095", "0.65545213", "0.6548344", "0.6546561", "0.6544007", "0.6543472", "0.654347", "0.651755", "0.6516932", "0.6516932", "0.6516932", "0.6516932" ]
0.0
-1
Performs a get curl petition
public static function get($uri,$params=[],$options=[]) { return self::request('GET',$uri,$params,$options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function curl_get($url, array $get = NULL, array $headers = NULL, array $options = array()) { \n $defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 4,\n $headers\n ); \n \n $ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults));\n \n if ( ! $result = curl_exec($ch)) { \n trigger_error(curl_error($ch)); \n } \n curl_close($ch); \n return $result; \n}", "function curlGet($url) {\n\t\t$ch = curl_init();\t// Initialising cURL session\n\t\t// Setting cURL options\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t$results = curl_exec($ch);\t// Executing cURL session\n\t\tcurl_close($ch);\t// Closing cURL session\n\t\treturn $results;\t// Return the results\n\t}", "function curl_get($url, $get = false, $options = array()) { \n $defaults = array(\n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : '') . (is_array($get) ? http_build_query($get) : ''),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4,\n\t\tCURLOPT_FOLLOWLOCATION => true\n );\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "private function curl_get($url)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "function curlGet($url){\n $ch = curl_init();\n\n //setting curl options\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n /*\n Additional curl_setopt\n CURLOPT_USERAGENT \n CURLOPT_HTTPHEADER\n */\n $result = curl_exec($ch);\n \n //$httpResponse = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n //echo $httpResponse;\n\n curl_close($ch);\n return $result;\n }", "public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "private function do_get_request($ch,$url,$params=array()){ \n if(is_array($params) && count($params)>0){\n $url.='?';\n foreach($params as $key=>$val){\n $url.='&'.$key.'='.urlencode($val);\n }\n }\n $ch=curl_init();\n $timeout=5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n $result=curl_exec($ch);\n return $result;\n }", "public function sendGet()\n\t{\n\t\t$ch = curl_init(\"http://localhost/rest/index.php/book\");\n\t\t//a true, obtendremos una respuesta de la url, en otro caso, \n\t\t//true si es correcto, false si no lo es\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t//establecemos el verbo http que queremos utilizar para la petición\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t//obtenemos la respuesta\n\t\t$response = curl_exec($ch);\n\t\t// Se cierra el recurso CURL y se liberan los recursos del sistema\n\t\tcurl_close($ch);\n\t\tif(!$response) {\n\t\t return false;\n\t\t}else{\n\t\t\tvar_dump($response);\n\t\t}\n\t}", "function http_get($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //curl_setopt($ch,CURLOPT_HEADER, false); \n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "function httpGet($url){\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "function get( $url, $post = null, $auth = null, $progress = false, $timeout = 5, &$error = false, $options = array() ) {\n\n // Create CURL Object\n $CURL = curl_init();\n\n // By using array union we can pre-set/change options from function call\n $curl_opts = $options + array(\n CURLOPT_URL => $url,\n CURLOPT_TIMEOUT => $timeout,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_USERAGENT => 'Mozilla/5.0 (AIO Radio Station Player) AppleWebKit/537.36 (KHTML, like Gecko)',\n CURLOPT_FOLLOWLOCATION => ( ( ini_get( 'open_basedir' ) == false ) ? true : false ),\n CURLOPT_CONNECTTIMEOUT => ( ( $timeout < 6 && $timeout != 0 ) ? 5 : $timeout ),\n CURLOPT_REFERER => 'http' . ( ( $_SERVER[ 'SERVER_PORT' ] == 443 ) ? 's://' : '://' ) . $_SERVER[ 'HTTP_HOST' ] . strtok( $_SERVER[ 'REQUEST_URI' ], '?' ),\n CURLOPT_CAINFO => dirname( __FILE__ ) . '/bundle.crt'\n );\n\n\n // Post data to the URL (expects array)\n if ( isset( $post ) && is_array( $post ) ) {\n\n // Make every just simpler using custom array for options\n $curl_opts = $curl_opts + array(\n CURLOPT_POSTFIELDS => http_build_query( $post, '', '&' ),\n CURLOPT_POST => true,\n CURLOPT_FRESH_CONNECT => true,\n CURLOPT_FORBID_REUSE => true\n );\n\n }\n\n // Use HTTP Authorization\n if ( isset( $auth ) && !empty( $auth ) ) {\n\n $curl_opts = $curl_opts + array( CURLOPT_USERPWD => $auth );\n\n }\n\n // Call anonymous $progress_function function\n if ( $progress !== false && is_callable( $progress ) ) {\n\n $curl_opts = $curl_opts + array(\n CURLOPT_NOPROGRESS => false,\n CURLOPT_PROGRESSFUNCTION => $progress\n );\n\n }\n\n // Before executing CURL pass options array to the session\n curl_setopt_array( $CURL, $curl_opts );\n\n // Finally execute CURL\n $data = curl_exec( $CURL );\n\n // Parse ERROR\n if ( curl_error( $CURL ) ) {\n\n // This must be referenced in-memory variable\n $error = curl_error( $CURL );\n\n // Only works when writeLog function is available\n if ( function_exists( 'writeLog' ) )\n writeLog( 'errors', \"CURL Request \\\"{$url}\\\" failed! LOG: \" . curl_error( $CURL ), dirname( __FILE__ ) . '/./../tmp/logs/' );\n\n }\n\n // Close connection and return data\n curl_close( $CURL );\n return $data;\n\n }", "function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function curl_get($url, array $get = NULL, array $options = array()) \n{ \n\t$defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 10 \n\t\t//, CURLOPT_FAILONERROR => true\n ); \n \n\t\t//print '$defaults<br/>';\n //print_r( $defaults);\n\n\t$ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults)); \n\t$result = curl_exec($ch);\n if($result === false) \n { \n\t\t//print 'curl_error<br/>';\n //print curl_error($ch);\n\t\t//trigger_error(curl_error($ch)); \n\t\tthrow new Exception(curl_error($ch)); \n\t\t\n } \n\t/*\n\tprint 'result<br/>';\n\tvar_dump( $result);\n\tprint 'curl_error<br/>';\n\tprint curl_error($ch);\n\tprint 'END========<br/>';\n\t*/\n curl_close($ch); \n return $result; \n\t\n}", "function pete_curl_get($url, $params){\n\t$post_params = array();\n\tforeach ($params as $key => &$val) {\n\t\tif (is_array($val)) $val = implode(',', $val);\n\t\t$post_params[] = $key.'='.urlencode($val);\n\t}\n\t$post_string = implode('&', $post_params);\n\t$fullurl = $url.\"?\".$post_string;\n\t$ch = curl_init();curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);curl_setopt($ch, CURLOPT_URL, $fullurl);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040608');\n\t$result = curl_exec($ch);curl_close($ch);\n\treturn $result;\n}", "function curlGet($url, $headers=null) {\r\n //write_log(\"Function fired\");\r\n $mc = JMathai\\PhpMultiCurl\\MultiCurl::getInstance();\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 3);\r\n\t\tcurl_setopt ($ch, CURLOPT_CAINFO, rtrim(dirname(__FILE__), '/') . \"/cert/cacert.pem\");\r\n\t\tif ($headers) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\t\t//$result = curl_exec($ch);\r\n\t\t//curl_close ($ch);\r\n $call = $mc->addCurl($ch);\r\n // Access response(s) from your cURL calls.\r\n $result = $call->response;\r\n\t\t//write_log(\"URL is \".$url.\". Result is \".$result);\r\n\t\treturn $result;\r\n\t}", "public function curlAction()\n {\n $curl = $this->getCurlService();\n $result = $curl->get('http://www.baidu.com');\n echo $result;\n exit;\n }", "public static function curlGet($url)\n {\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n }", "private function just_curl_get_data($url,$data)\n {\n \n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n\n }", "function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}", "private static function GetWithCurl($url) {\n\t$ch = curl_init($url);\n\tcurl_setopt($ch,CURLOPT_USERAGENT,'' );\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);\n\tcurl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);\n\tcurl_setopt($ch,CURLOPT_MAXREDIRS,2);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$str = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $str;\n }", "private function get($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t \t'Accept: application/json',\n\t \t'X-ELS-APIKey: 82b47f24bf707a447d642d170ae6e318'\n\t ));\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function make_get_call($mid_url) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n \n $output = json_decode(curl_exec($curl));\n curl_close($curl);\n \n return $output;\n }", "function getCurl( $url )\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n$res = curl_exec($curl); // execute\n if(curl_error($curl) ) // check for error\n {\n return false; // return false if error\n } else {\n return json_decode($res); // return json decoded\n }\ncurl_close($curl);\n}", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "public function get($url, $query = array(), $headers = array());", "function curl_fetch($url, $options=array()) {\n\t// 创建curl句柄\n\t$ch = curl_init();\n\t// 设置参数\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt_array($ch, $options);\n\t// 执行句柄\n\t$res = curl_exec($ch);\n\t// 检测错误\n\tif(curl_errno($ch)) {\n\t\techo 'curl error : '.curl_error($ch);\n\t}\n\t// 关闭句柄\n\tcurl_close($ch);\n\treturn $res;\n}", "function get_data_with_curl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.\n curl_setopt($ch, CURLOPT_URL, $url);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n }", "function file_get_curl($url, $post_params = '') \r\n\t{\r\n\t\t$interfaces = array('10.1.77.47');\r\n\t\t$interface = $interfaces[mt_rand(0, count($interfaces) - 1)];\r\n\t\t\r\n\t\t$ch = curl_init();\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_AUTOREFERER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); \r\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\");\r\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 15);\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIEJAR, (__DIR__).'/cookies.txt');\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIEFILE, (__DIR__).'/cookies.txt');\r\n\t\t\r\n\t\tif(!empty($post_params))\r\n\t\t{\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);\r\n\t\t}\r\n\t\t\r\n\t\tif(!empty($interface))\r\n\t\t{\r\n\t\t\tcurl_setopt($ch, CURLOPT_INTERFACE, $interface);\r\n\t\t}\r\n\t\t\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "public function curl_get($url, array $get = NULL, array $options = array()){\n\n try{\n\n $defaults = array(\n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if(!$result = curl_exec($ch)){\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n throw new Exception('CRNRSTN :: CURL [GET] ERROR experienced :: '.curl_error($ch));\n\n }\n\n curl_close($ch);\n\n return $result;\n\n } catch (Exception $e) {\n\n curl_close($ch);\n\n $this->catchException($e, LOG_ERR, __METHOD__, __NAMESPACE__);\n\n return false;\n\n }\n\n }", "function simple_curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_NOBODY, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));\n $content = curl_exec($ch);\n $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n curl_close($ch);\n //echo $content;\n return $content;\n}", "function forwardGetRequest($url) {\n\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => $url,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\"cache-control: no-cache\"),\n\t\t\tCURLOPT_SSL_VERIFYPEER => false\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\tif ($response === false) echo \"Bad response\";\n\n\t\tcurl_close($curl);\n\t\treturn $response;\n\n\t}", "function fetch_url ($url, $post_options = []) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION\t,0);\n curl_setopt($ch, CURLOPT_HEADER\t\t\t,0); // DO NOT RETURN HTTP HEADERS\n curl_setopt($ch, CURLOPT_RETURNTRANSFER\t,1); // RETURN THE CONTENTS OF THE CALL\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_TIMEOUT, 9);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 3);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 9);\n curl_setopt($ch, CURLOPT_ENCODING, '');\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "function get_data($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "public function curlGetCall( $url ) \n {\n \n try\n {\n $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($curl);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n $responseArr = json_decode($result,true);\n return $responseArr;\n }", "function call_url($url)\n\t{\n\t\t$ch = curl_init ($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n\t\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $out;\n\t}", "function getrequest($url){\n\t// gets cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_USERAGENT => 'BenGreenlineApp'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t//returns the json encoded response\n\t\n\t\n\t$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\tif($httpCode == 404) {\n $resp[0]= \"MetroTransit API gave 404\" ;\n\t};\n\t\n\t\n\treturn json_decode($resp);\n}", "function FetchURL($url, $options = array())\n\t{\n\t\t$timeout = 20;\n\t\tif (isset($options['timeout'])) { $timeout = $options['timeout']; }\n\n\t\t$curl_handler = curl_init();\n\n\t\tif (!empty($options['get_fields']))\n\t\t{\n\t\t\t$url_parameters = array();\n\t\t\tforeach($options['get_fields'] as $field => $value)\n\t\t\t{ $url_parameters[] = urlencode($field) . '=' . urlencode($value); }\n\n\t\t\t$url .= '?' . join('&', $url_parameters);\n\t\t}\n\n\t\tcurl_setopt($curl_handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl_handler, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t//curl_setopt($curl_handler, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\n\t\tif (!empty($options['post_array']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_POSTFIELDS, $options['post_array']);\n\t\t}\n\n\t\tif (!empty($options['auth_string']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_USERPWD, $auth_string);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t}\n\t\t\n\t\tif (!empty($options['follow']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_FOLLOWLOCATION, true);\n\t\t}\n\n\t\tif (!empty($options['headers'])) { curl_setopt($curl_handler, CURLOPT_HTTPHEADER, $headers); }\n\n\t\t$response = curl_exec($curl_handler);\n\t\tself::$status = curl_getinfo($curl_handler, CURLINFO_HTTP_CODE);\n\t\tcurl_close($curl_handler);\n\n\t\treturn $response;\n\t}", "function fetchUrl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n $retData = curl_exec($ch);\n curl_close($ch); \n \n return $retData;\n}", "public function execGET($url, $params = []){\n\t\t#Parse URL params\n\t\t$url = $this->parseURL($url, $params);\n\t\t#Initialize a CURL session. \n\t\t$ch = curl_init();\n\t\t#Set body (empty on GET)\n\t\t$curlBody = json_encode([]);\n\t\t#Set curl headers\n\t\t$curlHeaders = [\n\t\t\t'User-Agent: ' . $this->getRandAgent(), #Set the user agent with a random-selected real one\n\t\t];\n\t\t#Set CURL options\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders); #Set headers\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); #Retrieve output instead of displaying it\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30); #Set timeout to 30 seconds\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); #Disable SSL host verification\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); #Disable SSL peer verification\n\t\tcurl_setopt($ch, CURLOPT_URL, $url); #Set URL\n\t\t#Return raw CURL request output\n\t\treturn curl_exec($ch);\n\t}", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "function get_data($url) {\n $usrpwd = 'Contact CATA for access credentials';\n $ch = curl_init();\n $timeout = 15;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERPWD,$usrpwd);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function curl($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $output = curl_exec($ch); \n curl_close($ch); \n return $output;\n}", "function ultimate_remote_get($path){\r\n\r\n\tif(function_exists('curl_init')){\r\n\t\t// create curl resource\r\n\t\t$ch = curl_init();\r\n\r\n\t\t// set url\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $path);\r\n\r\n\t\t//return the transfer as a string\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n\t\t// $output contains the output string\r\n\t\t$output = curl_exec($ch);\r\n\r\n\t\t// close curl resource to free up system resources\r\n\t\tcurl_close($ch);\r\n\r\n\t\tif($output !== \"\")\r\n\t\t\treturn $output;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function run_curl($p_path) {\r\n\r\n global $CURL_OPTIONS;\r\n\r\n $tp_result = array();\r\n $tp_curl = curl_init($p_path);\r\n curl_setopt_array($tp_curl, $CURL_OPTIONS);\r\n $tp_result['content'] = curl_exec($tp_curl);\r\n $tp_result['code'] = curl_getinfo($tp_curl, CURLINFO_HTTP_CODE);\r\n curl_close($tp_curl);\r\n return $tp_result;\r\n\r\n}", "function curl_get_file($url)\n {\n $c = curl_init(); //Initialize curl session \n \n //Setting curl option\n curl_setopt($c,CURLOPT_RETURNTRANSFER,TRUE);\n curl_setopt($c,CURLOPT_URL,$url);\n \n $result = curl_exec($c); //Executing curl session\n curl_close($c); //Closing curl session\n \n return $result;\n }", "function http($url, $method = 'GET', $postfields = NULL, $headers = array()) {\n\t\t$ci = curl_init();\n\t\t/* Curl settings */\n\t\tcurl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n\t\tcurl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, array_merge(array('Expect:'),$headers));\n\t\tcurl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n\n\t\tswitch ($method) {\n\t\tcase 'POST':\n\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\t\tif (!empty($postfields)) {\n\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tif (!empty($postfields)) {\n\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t}\n\t\t}\n\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ($ci);\n\t\treturn $response;\n\t}", "function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n }", "function getdata( $url, $authinfo, $javascript_loop = 0, $timeout = 0, $postdata = \"\" ) {\n\n\t\t$url = str_replace( \"&amp;\", \"&\", urldecode(trim($url)) );\n\n\t\t$ch = curl_init();\n\n\n\n\t\t$fields = '';\n\n\t\tif (!empty($postdata)) {\n\n\t\t\tforeach($postdata as $key => $value) { \n\n\t\t\t\t$fields .= ($fields==''?'?':'&').$key . '=' . $value; \n\n\t\t\t}\n\n\n\n\t\t\tcurl_setopt($ch,CURLOPT_POST, count($postdata));\n\n\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS, urlencode($fields));\n\n\t\t}\n\n\n\n\t\tcurl_setopt( $ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\" );\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $url);\n\n\t\t\t\n\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_ENCODING, \"\");\n\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls\n\n\t\tcurl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );\n\n\t\n\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, TRUE);\n\n\t\t\n\n\t\t$headers = array(\n\n\t\t \"Expect:\",\n\n\t\t \"X-ApiKey: 95074c8fb639b45aa0acc4c23bc7c4d2\",\n\n\t\t \"Authorization: Basic \".$authinfo\n\n\t\t);\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers); \n\n\t\t\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = curl_getinfo( $ch );\n\n\t\tcurl_close ( $ch );\n\n\t\n\n\t\tif ($response['http_code'] == 301 || $response['http_code'] == 302)\t\t{\n\n\t\t\tini_set(\"user_agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\");\n\n\t\n\n\t\t\tif ( $headers = get_headers($response['url']) ) {\n\n\t\t\t\tforeach( $headers as $value ) {\n\n\t\t\t\t\tif ( substr( strtolower($value), 0, 9 ) == \"location:\" )\n\n\t\t\t\t\t\treturn get_url( trim( substr( $value, 9, strlen($value) ) ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\n\n\t\tif ( ( preg_match(\"/>[[:space:]]+window\\.location\\.replace\\('(.*)'\\)/i\", $content, $value) || preg_match(\"/>[[:space:]]+window\\.location\\=\\\"(.*)\\\"/i\", $content, $value) ) &&\n\n\t\t\t\t$javascript_loop < 5 ) {\n\n\t\t\treturn getdata( $value[1], $authinfo, $javascript_loop+1 );\n\n\t\t} else {\n\n\t\t\treturn array( $content, $response );\n\n\t\t}\n\n\t}", "function get_data($url) {\n\t$ch = curl_init();\n\t$timeout = 5;\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\n\t$result = curl_exec($ch);\n\t$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\n\t$response = array(\n\t 'content' => $result, \n\t 'code' => $code);\n\t \n\treturn $response;\n }", "function get (string $url, array $args = []): string {\n\t$append = '';\n\tif (count($args) > 0) {\n\t\t$append .= '/'.parseUrlGet($args);\n\t}\n\n\t$curlCall = curl_init($url.$append);\n\n\tcurl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n\n\t$return = curl_exec($curlCall);\n\tcurl_close($curlCall);\n\n\treturn $return;\n}", "function request($host_url, $id, $entity, $auth)\n {\n $url = \"$host_url/v1/checkouts/$id/payment?entityId=$entity\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Authorization:Bearer $auth\"));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // this should be set to true in production\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $responseData = curl_exec($ch);\n if (curl_errno($ch)) {\n return curl_error($ch);\n }\n curl_close($ch);\n return $responseData;\n }", "protected function getPageCurl()\n\t{\n\t\t// initiate curl with our url\n\t\t$this->curl = curl_init($this->url);\n\n\t\t// set curl options\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n\n\t\t// execute the call to google+\n\t\t$this->html = curl_exec($this->curl);\n\n\t\tcurl_close($this->curl);\n\t}", "private function _get($url) {\n\t\t$ch = curl_init ();\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)' );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 5 );\n\t\t$data = curl_exec ( $ch );\n\t\t$httpcode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close ( $ch );\n\t\treturn ($httpcode >= 200 && $httpcode < 300) ? $data : false;\n\t}", "function get($url, $headers=array(), $userPW=0, $params=array())\n{\n $paramLength = count($params);\n // only set params if there are some else url is fine\n if ($paramLength > 0)\n {\n $url = $url.'?'.http_build_query($params,'','&');\n }\n echo $url . \"<br/>\";\n $ch = curl_init();\n // set the url\n curl_setopt($ch, CURLOPT_URL, $url);\n // set http method\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n if ($userPW <> 0)\n {\n curl_setopt($ch, CURLOPT_USERPWD, User_Creds::PingUser . \":\" . User_Creds::PingPass);\n }\n $headerLength = count($headers);\n if ($headerLength > 0)\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n //get response\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "function file_get_contents_curl($mURL, $mACCESS) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $mURL);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_USERPWD, \"$mACCESS\");\n curl_setopt($ch, CURLOPT_PORT, 80);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function file_get_contents_curl($url) {\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\n $data = curl_exec($ch);\n curl_close($ch);\n\n return $data;\n }", "function getRequest($url) {\n // url to GET info for this table\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n if (curl_errno($ch)) { // Check if any error occurred\n echo 'Curl error: ' . curl_error($ch);\n }\n curl_close($ch); // close curl resource to free up system resources\n $res = json_decode($output, true); // json to array\n return $res;\n }", "function getContents($url) {\n // $url = \"http://jayasuryapinaki.me/actions/getAllProducts.php\";\n\n // Initialize a CURL session.\n $ch = curl_init();\n\n // Return Page contents.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //grab URL and pass it to the variable.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n //$result = curl_exec($ch);\n\n $testing = file_get_contents($url);\n\n\n // var_dump(json_decode($testing, true));\n\n $response = json_decode($testing, true);\n\n return $response;\n }", "function get_content($url, $post = '') {\n $header[] = 'Content-Type: application/json';\n $header[] = \"Accept-Encoding: gzip, deflate\";\n $header[] = \"Cache-Control: max-age=0\";\n $header[] = \"Connection: keep-alive\";\n $header[] = \"Accept-Language: en-US,en;q=0.8,id;q=0.6\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_VERBOSE, false);\n // curl_setopt($ch, CURLOPT_NOBODY, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_ENCODING, true);\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 5);\n\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36\");\n\n if ($post)\n {\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n }\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $rs = curl_exec($ch);\n\n if(empty($rs)){\n var_dump($rs, curl_error($ch));\n curl_close($ch);\n return false;\n }\n curl_close($ch);\n return $rs;\n }", "function realizarPeticionGet($url){\n\t$ch = curl_init();\n\t// Establecer URL y otras opciones apropiadas\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t// Capturar la URL y devuelve el código HTML\n\t$res = curl_exec($ch);\n\n\t// Cerrar el recurso cURL y liberar recursos del sistema\n\tcurl_close($ch);\n\n\treturn $res;\n}", "function getPageContent($url) {\r\n // create curl variable\r\n $curl = curl_init(); \r\n // set the url\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n // return the transfer as a resource\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n // $output contains the output string\r\n $output = curl_exec($curl);\r\n // close curl resource to free up system memory\r\n curl_close($curl);\r\n // return the output of the curl\r\n return $output;\r\n}", "function curl($url, $post_fields = null, $return_headers = false)\n {\n global $standard_headers;\n global $cookie;\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $standard_headers);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n\n if($return_headers == true) {\n curl_setopt($ch, CURLOPT_HEADER, 1);\n }\n\n if(!is_null($post_fields)) {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_fields));\n } else {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n }\n\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "public function get ($url, $headers = null, $options = null);", "function http($url, $args = array()) {\n\n\t\tglobal $CONFIG;\n\n\t\t$userAgent = '(Elgg ' . $CONFIG->release . ')';\n\n\t\t$ch = curl_init();\n\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, \"Host: api.dropbox.com\");\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, $userAgent);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_AUTOREFERER, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\t\n\t\t/**\n\t\t * This is needed to remove problems with certificate \n\t\t * authentication against the dropbox server. \n\t\t */\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\n\t\tif (!empty($args['username']) && !empty($args['password'])) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($ch, CURLOPT_USERPWD, $args['username'] . ':' . $args['password']);\n\t\t}\n\n\t\tif (!empty($args['post'])) {\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $args['data']);\n\t\t}\n\n\t\tif (!empty($args['headers'])) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $args['headers']);\n\t\t}\n\n\t\t$html = curl_exec($ch);\n\t\t\n\t\t$rc = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t$info = curl_getinfo($ch);\n\t\t$err = curl_error($ch);\n\t\t$errno = curl_errno($ch);\n\n\t\tcurl_close($ch);\n\t\t\n\t\treturn array('rc' => $rc, \n\t\t\t 'html' => $html, \n\t\t\t 'errno' => $errno,\n\t\t\t 'err' => $err,\n\t\t\t 'info' => $info);\n\t}", "public static function CurlGet($url, array $get = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_URL => $url . (strpos($url, '?') === FALSE ? '?' : '') . http_build_query($get),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if (!$result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n }", "function get_data($url) {\r\n\t$ch = curl_init();\r\n\t$timeout = 5;\r\n\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\r\n\t$data = curl_exec($ch);\r\n\tcurl_close($ch);\r\n\treturn $data;\r\n}", "function getDataViaCurl($url){\n\n\t// TODO: check http response 200, 404, ...etc\n\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t// option for returning data\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t//retrieve data from curl_exec \n\t$data = curl_exec($curl);\n\t\n\tcurl_close($curl);\n\n\treturn $data;\n}", "function curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $return = curl_exec($ch);\n curl_close($ch);\n return $return;\n}", "function curl_get(&$handle, $url, $fields = '', &$info = NULL) {\r\n\tglobal $curl_last_timestamp, $curl_throttle;\r\n\tif (! $curl_throttle) {\r\n\t\t$curl_throttle = 5;\r\n\t}\r\n\tif ($curl_last_timestamp && time() - $curl_last_timestamp < $curl_throttle * 60) {\r\n\t\t$delay = min(array(\r\n\t\t\t$curl_throttle, time() - $curl_last_timestamp\r\n\t\t));\r\n\t\tif ($delay) {\r\n\t\t\t//log_msg('CURL', \"Sleeping for $delay second(s)\");\r\n\t\t\tusleep($delay * 1000000);\r\n\t\t}\r\n\t}\r\n\tif ($fields) {\r\n\t\tif (is_array($fields))\r\n\t\t\t$fields = http_build_query2($fields, '', '&');\r\n\t\t$url = \"$url?$fields\";\r\n\t}\r\n\tcurl_setopt($handle, CURLOPT_HTTPGET, TRUE);\r\n\tcurl_setopt($handle, CURLOPT_URL, $url);\r\n\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\r\n\t$result = curl_exec($handle);\r\n\t$info = curl_getinfo($handle);\r\n\t$curl_last_timestamp = time();\r\n\t//log_msg('CURL', \"Get $url ; result info=\" . json_encode($info));\r\n\treturn $result;\r\n}", "private function curl($url, $method = 'get', $header = null, $postdata = null, $timeout = 60)\n\t{\n\t\t$s = curl_init();\n\n\t\tcurl_setopt($s,CURLOPT_URL, $url);\n\t\tif ($header) \n\t\t\tcurl_setopt($s,CURLOPT_HTTPHEADER, $header);\n\n\t\tif ($this->debug)\n\t\t\tcurl_setopt($s,CURLOPT_VERBOSE, TRUE);\n\n\t\tcurl_setopt($s,CURLOPT_TIMEOUT, $timeout);\n\t\tcurl_setopt($s,CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\tcurl_setopt($s,CURLOPT_MAXREDIRS, 3);\n\t\tcurl_setopt($s,CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($s,CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($s,CURLOPT_COOKIEJAR, 'cookie.txt');\n curl_setopt($s,CURLOPT_COOKIEFILE, 'cookie.txt'); \n\t\t \n\t\tif(strtolower($method) == 'post')\n\t\t{\n\t\t\tcurl_setopt($s,CURLOPT_POST, true);\n\t\t\tcurl_setopt($s,CURLOPT_POSTFIELDS, $postdata);\n\t\t}\n\t\telse if(strtolower($method) == 'delete')\n\t\t{\n\t\t\tcurl_setopt($s,CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t}\n\t\telse if(strtolower($method) == 'put')\n\t\t{\n\t\t\tcurl_setopt($s,CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\tcurl_setopt($s,CURLOPT_POSTFIELDS, $postdata);\n\t\t}\n\t\t\n\t\tcurl_setopt($s,CURLOPT_HEADER, $this->includeheader);\t\t\t \n\t\tcurl_setopt($s,CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1');\n\t\tcurl_setopt($s, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\n\t\t$html = curl_exec($s);\n\t\t$status = curl_getinfo($s, CURLINFO_HTTP_CODE);\n\t\t\n\t\tcurl_close($s);\n\n\t\treturn $html;\n\t}", "function file_get_contents_curl($url) {\r\n $ch = curl_init();\r\n\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n\r\n $data = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n return $data;\r\n}", "function repetitive_function()\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"httpbin/get?key=value\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n error_log('Received response: ' . var_export($output, 1));\n curl_close($ch);\n}", "function fetch_curl($url) {\n $ch = curl_init($url); //initialize the fetch command\n //prevent automatic output to screen\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // in case of MAMP issues\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n $results = curl_exec($ch); //execute the fetch command\n curl_close($ch); //close curl request\n //decode JSON that is returned\n $data = json_decode($results);\n\n return $data;\n}", "function get_response($url, $headers) {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_HEADER, false);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n return $response;\r\n }", "function quick_curl( $url, $user_auth = null, $rest = 'GET', $input = null, $type = 'JSON'){\n if( function_exists('curl_init') ){\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url ); // The URL we're using to get/send data\n\n if( $user_auth ){\n curl_setopt( $ch, CURLOPT_USERPWD, $user_auth ); // Add the authentication\n }\n\n if( $rest == 'POST' ){\n curl_setopt( $ch, CURLOPT_POST, true ); // Send a post request to the server\n } elseif( $rest == 'PATCH' ){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // Send a patch request to the server to update the listing\n } elseif( $rest == 'PUT'){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // Send a put request to the server to update the listing\n } // If POST or PATCH isn't set then we're using a GET request, which is the default\n\n curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 15 ); // Timeout when connecting to the server\n curl_setopt( $ch, CURLOPT_TIMEOUT, 30 ); // Timeout when retrieving from the server\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // We want to capture the data returned, so set this to true\n //curl_setopt( $ch, CURLOPT_HEADER, true ); // Get the HTTP headers sent with the data\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // We don't want to force SSL incase a site doesn't use it\n\n if( $rest !== 'GET' ){\n\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: ' . mime_type( $type ), 'Content-Length: ' . strlen( $input ) ) ); // Tell server to expect the right content type and the content length\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); // Send the actual data\n }\n\n // Get the response\n $response = curl_exec( $ch );\n\n // Check if there's an error in the header\n $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\n // If there's any cURL errors\n if( curl_errno( $ch ) || ( $httpcode < 200 || $httpcode >= 300 ) ){\n $data = 'error';\n } else {\n \n // Turn response into stuff we can use\n if( $type == 'JSON' ){\n $data = json_decode( $response, true );\n } elseif( $type == 'csv' ){\n $data = csv_to_array( $response );\n } else {\n $data = $response;\n }\n\n }\n\n // Close curl\n curl_close( $ch );\n \n // Send the data back to the function calling the cURL\n return $data;\n \n } else {\n \n // cURL not installed so leave\n return false;\n \n }\n\n\t\n}", "private function curlRequest($url)\n {\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL, $url);\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl_handle, CURLOPT_USERAGENT, Request::header('user-agent'));\n $response = curl_exec($curl_handle);\n curl_close($curl_handle);\n return $response;\n }", "function curl_return($url,$json = TRUE) {\n\t\t\n\t\t$ch = curl_init($url);\t\t\n\t\t\n\t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$curl_result = curl_exec($ch);\n\t\t\n\t\tcurl_close($ch);\n\n\t\tif (!$json) {\n\t\t\treturn $curl_result;\n\t\t}\n\t\treturn json_decode($curl_result);\n\n\t}", "private function get_data($url) { \n \n\t$ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n \n //curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n //curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);\n //curl_setopt($ch,CURLOPT_MAXREDIRS,50);\n \n $data = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $data;\n }", "function wechat_php_curl_https_get($url, $h = false) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n // Edit: prior variable $postFields should be $postfields;\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n if($h){\n //include header information\n curl_setopt($ch, CURLOPT_HEADER, true); \n }\n\n $result = curl_exec($ch);\n if(curl_errno($ch))\n {\n curl_close($ch);\n return NULL;\n }\n\n if($h){\n if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '200') {\n return $result;\n }else{\n return NULL;\n }\n }\n\n curl_close($ch);\n return $result;\n}", "private function http($url, $method = \"GET\", $postfields=NULL){\n $this->http_info = array();\n $handle = curl_init();\n /* Curl settings */\n curl_setopt($handle, CURLOPT_HEADER, FALSE);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);\n curl_setopt($handle, CURLOPT_HTTPHEADER, array('Expect:'));\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, $this->verifypeer);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($handle, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($handle, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($handle, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n \n if ($this->proxy_settings['behind_proxy']){\n curl_setopt($ci, CURLOPT_PROXY, $this->proxy_settings['host']);\n curl_setopt($ci, CURLOPT_PROXYPORT, $this->proxy_settings['port']);\n curl_setopt($ci, CURLOPT_PROXYUSERPWD, \"{$this->proxy_settings['user']}:{$this->proxy_settings['pass']}\");\n curl_setopt($ci, CURLOPT_PROXYTYPE, $this->proxy_settings['type']);\n curl_setopt($ci, CURLOPT_PROXYAUTH, $this->proxy_settings['auth']);\n }\n \n switch($method){\n case self::$METHOD_POST:\n curl_setopt($handle, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($handle, CURLOPT_POSTFIELDS, $postfields);\n }\n break;\n case self::$METHOD_DELETE:\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)){\n $url .= \"?\".OAuthUtil::build_http_query($postfields);\n }\n break;\n }\n curl_setopt($handle, CURLOPT_URL, $url);\n $response = curl_exec($handle);\n $this->http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($handle));\n $this->url = $url;\n curl_close($handle);\n return $response;\n }", "function curl( $url ) {\n\t$curl = curl_init( $url );\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, 0 );\n\tcurl_setopt( $curl, CURLOPT_USERAGENT, '' );\n\tcurl_setopt( $curl, CURLOPT_TIMEOUT, 10 );\n\t$response = curl_exec( $curl );\n\tif ( 0 !== curl_errno( $curl ) || 200 !== curl_getinfo( $curl, CURLINFO_HTTP_CODE ) ) {\n\t\t$response = null;\n\t}\n\tcurl_close( $curl );\n\treturn $response;\n}", "function file_get_contents_curl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}", "function get_data($url)\n\t\t{\n\t\t $ch = curl_init();\n\t\t $timeout = 5;\n\t\t curl_setopt($ch,CURLOPT_URL,$url);\n\t\t curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\t\t curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\n\t\t $data = curl_exec($ch);\n\t\t curl_close($ch);\n\t\t return $data;\n\t\t}", "function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}", "function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n}", "private function fetchResource() {\n\t\t$ch = curl_init();\n\t\tif ((php_sapi_name() != 'cli')) {\n\t\t\tcurl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (compatible; ' . TITLE . '/' . HOST . ')');\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 30s\n\t\t$this->content = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$this->httpCode = $info['http_code'];\n\t\t$this->contentType = $info['content_type'];\n\t\t\n\t\tif (((int) $this->httpCode) >= 400) {\n\t\t\tthrow new Exception('STATUS CODE: ' . $this->httpCode);\n\t\t}\n\t}", "function http($url, $method, $postfields = NULL, $headers = array()) {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n $this->postdata = $postfields;\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n if (isset($this->access_token) && $this->access_token)\n $headers[] = \"Authorization: OAuth2 \" . $this->access_token;\n if (!empty($this->remote_ip)) {\n if (defined('SAE_ACCESSKEY')) {\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\n } else {\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\n }\n } else {\n if (!defined('SAE_ACCESSKEY')) {\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\n }\n }\n curl_setopt($ci, CURLOPT_URL, $url);\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n $this->url = $url;\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n echo \"=====headers======\\r\\n\";\n print_r($headers);\n echo '=====request info=====' . \"\\r\\n\";\n print_r(curl_getinfo($ci));\n echo '=====response=====' . \"\\r\\n\";\n print_r($response);\n }\n curl_close($ci);\n return $response;\n }", "public function get($url, $fields=\"\") {\n\n $this->_error = NULL;\n $this->_rc = NULL;\n\n curl_setopt($this->_cm, CURLOPT_USERPWD, $this->_username.\":\".$this->_password);\n curl_setopt($this->_cm, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($this->_cm, CURLOPT_URL, $url);\n\n $res = curl_exec($this->_cm);\n if ($res == FALSE) {\n $this->_error = curl_error($this->_cm);\n $this->_rc = curl_errno($this->_cm);\n } else {\n $this->_rc = curl_getinfo($this->_cm, CURLINFO_HTTP_CODE);\n }\n curl_close($this->_cm);\n return $res;\n }", "function get_rest_api($api_url = '')\n{\n try {\n // url\n $url = $api_url;\n\n // init\n $curl = curl_init();\n // execute rest\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \n // save data \n $response = curl_exec($curl); \n\n // close connection\n curl_close($curl);\n\n return $response;\n\n } catch (\\Throwable $th) {\n //throw $th;\n }\n}", "public function testRequestGet()\n {\n $url = 'http://localhost:8080';\n $req = new HttpHeadRequest($url);\n \n $hopper = new Grasshopper();\n \n $hopper->addRequest($req);\n \n $result = $hopper->waitForAll();\n \n $res = $result[$url];\n \n if ($res instanceof SuccessEvent){\n $headers = $res->getResponse()->getHeadersParsed();\n echo print_r($headers,true) . PHP_EOL;\n \n $this->assertEquals(200, $res->getResponse()->getStatusCode());\n }\n else{\n $this->fail('GET request returned failure result');\n }\n }", "private function request($url) {\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n \t\t$response = curl_exec($ch);\n\t\t// TODO: Some processing here\n\t\t$response = json_decode($response);\n\t\treturn $response;\n\t}", "function getCurlData($url)\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($curl, CURLOPT_TIMEOUT, 10);\ncurl_setopt($curl, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16\");\n$curlData = curl_exec($curl);\ncurl_close($curl);\nreturn $curlData;\n}", "function get_data($url){\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0\");\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n if (version_compare(phpversion(), '5.4.0', '<')) {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\r\n } else {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);\r\n }\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, TRUE);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if ( isset($this->access_token) && $this->access_token )\r\n $headers[] = \"Authorization: OAuth2 \".$this->access_token;\r\n\r\n if ( !empty($this->remote_ip) ) {\r\n if ( defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\r\n } else {\r\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\r\n }\r\n } else {\r\n if ( !defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n curl_setopt($ci, CURLOPT_URL, $url );\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo \"=====headers======\\r\\n\";\r\n print_r($headers);\r\n\r\n echo '=====request info====='.\"\\r\\n\";\r\n print_r( curl_getinfo($ci) );\r\n\r\n echo '=====response====='.\"\\r\\n\";\r\n print_r( $response );\r\n }\r\n curl_close ($ci);\r\n return $response;\r\n }", "function Get( $url )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Get( $url )\\n\";\r\n\t\t$this->responseHeaders = $this->responseBody = \"\";\r\n\t\t$uri = $this->makeUri( $url );\r\n\t\t\r\n\t\tif( $this->sendCommand( \"GET $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}", "function curl_get_contents($url)\n {\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n $data = curl_exec($curl);\n curl_close($curl);\n return $data;\n }", "function curl_get_contents($url)\n\t{\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);\n\t\t$data = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $data;\n\t}", "public function http_get($uri = null, $curl = false) {\n\n\t\tif (!preg_match('/^https?/', $uri)) return json_encode(array('e' => 'Non-http URL specified'));\n\t\n\t\tif ($curl) {\n\t\t\tif (!function_exists('curl_exec')) {\n\t\t\t\treturn json_encode(array('e' => 'No Curl installed'));\n\t\t\t\tdie;\n\t\t\t}\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\t\tcurl_setopt($ch, CURLOPT_STDERR, $output = fopen('php://temp', \"w+\"));\n\t\t\t$response = curl_exec($ch);\n\t\t\t$error = curl_error($ch);\n\t\t\t$getinfo = curl_getinfo($ch);\n\t\t\tcurl_close($ch);\n\n\t\t\trewind($output);\n\t\t\t$verb = stream_get_contents($output);\n\n\t\t\t$resp = array();\n\t\t\tif (false === $response) {\n\t\t\t\t$resp['e'] = htmlspecialchars($error);\n\t\t\t}\n\t\t\t$resp['r'] = (empty($response)) ? '' : htmlspecialchars(substr($response, 0, 2048));\n\n\t\t\tif (!empty($verb)) $resp['r'] = htmlspecialchars($verb).\"\\n\\n\".$resp['r'];\n\n\t\t\t// Extra info returned for Central\n\t\t\t$resp['verb'] = $verb;\n\t\t\t$resp['response'] = $response;\n\t\t\t$resp['status'] = $getinfo;\n\n\t\t\treturn json_encode($resp);\n\t\t} else {\n\t\t\t$response = wp_remote_get($uri, array('timeout' => 10));\n\t\t\tif (is_wp_error($response)) {\n\t\t\t\treturn json_encode(array('e' => htmlspecialchars($response->get_error_message())));\n\t\t\t}\n\t\t\treturn json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'r' => wp_remote_retrieve_response_code($response).': '.htmlspecialchars(substr(wp_remote_retrieve_body($response), 0, 2048)),\n\t\t\t\t\t'code' => wp_remote_retrieve_response_code($response),\n\t\t\t\t\t'html_response' => htmlspecialchars(substr(wp_remote_retrieve_body($response), 0, 2048)),\n\t\t\t\t\t'response' => $response\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}" ]
[ "0.76008797", "0.74832124", "0.74599856", "0.7418802", "0.74155927", "0.7367013", "0.7320511", "0.7273761", "0.7271029", "0.72277445", "0.7226435", "0.7181997", "0.7179415", "0.7177625", "0.7136559", "0.706497", "0.7052922", "0.69374466", "0.6923341", "0.69129217", "0.6817565", "0.6811263", "0.6805285", "0.6793957", "0.67897224", "0.6786236", "0.678604", "0.67635524", "0.67543405", "0.6746537", "0.6743327", "0.67404705", "0.6692197", "0.66821986", "0.6666694", "0.6650067", "0.6628602", "0.66150373", "0.66127735", "0.6606536", "0.66033435", "0.6602935", "0.659152", "0.65679103", "0.6561565", "0.65587425", "0.6556697", "0.65354645", "0.6532885", "0.65308625", "0.65283716", "0.65278476", "0.65278393", "0.65173894", "0.6511153", "0.6501962", "0.6499081", "0.6494394", "0.64925075", "0.6489079", "0.6484648", "0.64692", "0.6465574", "0.64641225", "0.64581853", "0.64545995", "0.6451336", "0.6449202", "0.643851", "0.6433303", "0.64219695", "0.6420963", "0.6419987", "0.6419056", "0.6404844", "0.6404762", "0.64028496", "0.64010733", "0.63884306", "0.63791984", "0.6376733", "0.63716656", "0.63634574", "0.6349067", "0.6345466", "0.63397735", "0.63391215", "0.63390607", "0.633464", "0.63329995", "0.63185316", "0.63177603", "0.6316813", "0.6315773", "0.63130057", "0.6311312", "0.630005", "0.62991303", "0.6293289", "0.62924796", "0.6292011" ]
0.0
-1
Performs a post curl petition
public static function post($uri,$params=[],$options=[]) { return self::request('POST',$uri,$params,$options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doPost($url, $post = array() , $format = 'plain')\n{\n return curlExecute($url, 'post', $post, $format);\n}", "function curl_post($url, array $post = NULL, array $options = array()) {\n\t\t$this->curlError = 0;\n\t $defaults = array(\n\t CURLOPT_POST => 1,\n\t CURLOPT_HEADER => 0,\n\t CURLOPT_URL => $url,\n\t CURLOPT_FRESH_CONNECT => 1,\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_FORBID_REUSE => 1,\n\t CURLOPT_TIMEOUT => 4,\n\t CURLOPT_POSTFIELDS => $this->decodeParamsIntoGetString($post),\n\t\t\tCURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT']\n\t );\n\t \n\t $this->logMessage(\"Posting to: \".$this->decodeParamsIntoGetString($post));\n\t\t\n\t $ch = curl_init();\n\t curl_setopt_array($ch, ($options + $defaults));\n\t if( !$result = curl_exec($ch))\n\t { \n\t // trigger_error(curl_error($ch));\n\t \t$this->curlError = curl_error($ch);\n\t \treturn false;\n\t }\n\t else {\n\t \treturn $result;\n\t \n\t \t} \t\n\t}", "function curl_post($url, array $post = NULL, array $options = array())\n{\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch))\n {\n echo \"curl_exec failed \" . $url;\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "function curl_post($url, array $post = NULL, array $headers = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $_defaults = defaults;\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "private function curl_post($url, $data)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "function new_post($request,$url) {\n ##Data Post\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n return curl_exec($ch);\n}", "private function postHop () {\n\t\t$this->result = curl_exec ( $this->ch );\n\t\tcurl_close ( $this->ch );\n\t}", "function post_to_url($url, $data) {\r\n\t\t$fields = '';\r\n\t\tforeach($data as $key => $value) {\r\n\t\t\t$fields .= $key . '=' . $value . '&';\r\n\t\t}\r\n \r\n\t\trtrim($fields, '&');\r\n\t\t$post = curl_init();\r\n \r\n\t\t curl_setopt($post, CURLOPT_URL, $url);\r\n\t\t curl_setopt($post, CURLOPT_POST, count($data));\r\n\t\t curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\r\n\t\t curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $result = curl_exec($post);\r\n\t\t curl_close($post);\r\n\t}", "function httpPOST($url, $data)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n}", "public function curlpost($url, $data)\n {\n\n $host = $url;\n // echo $host;exit;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $host);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //var_dump(curl_error($ch));\n $res = curl_exec($ch);\n curl_close($ch);\n return $res;\n }", "function h_POST(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n $payload = json_encode($data);\n\n // Prepare new cURL resource\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n \n // Set HTTP Header for POST request \n curl_setopt(\n $ch,\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($payload)\n ]\n );\n \n // Submit the POST request\n $response = curl_exec($ch);\n curl_close($ch);\n\n return $response;\n}", "public function curl_post($url, array $post = NULL, array $options = array()){\n\n try{\n\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 25,\n CURLOPT_CONNECTTIMEOUT => 25,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n /*\n If you are doing a POST, and the content length is 1,025 or greater, then curl exploits\n a feature of http 1.1: 100 (Continue) Status.\n\n See http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3\n\n * it adds a header, \"Expect: 100-continue\".\n * it then sends the request head, waits for a 100 response code, then sends the content\n\n Not all web servers support this though. Various errors are returned depending on the\n server. If this happens to you, suppress the \"Expect\" header with this command:\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));\n */\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));\n if(!$result = curl_exec($ch)) {\n\n //\n // HOOOSTON...VE HAF PROBLEM!\n throw new Exception('CRNRSTN :: CURL [POST] ERROR experienced :: '.curl_error($ch));\n\n }\n\n curl_close($ch);\n\n return $result;\n\n } catch (Exception $e) {\n\n curl_close($ch);\n\n $this->catchException($e, LOG_ERR, __METHOD__, __NAMESPACE__);\n\n return false;\n\n }\n\n }", "function http_post($url, $post_string) {\n\t\t\n\t\t// add any additional curl options here\n\t\t$options = array(CURLOPT_URL => $url,\n\t\tCURLOPT_POST => true,\n\t\tCURLOPT_POSTFIELDS => $post_string,\n\t\tCURLOPT_USERAGENT => $this->user_agent);\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $options);\n\t\t\n\t\t$response = curl_exec($ch);\n\t\t$this->last_response = $response;\n\t\t$info = curl_getinfo($ch);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\t// all good\n\t\tif ($info['http_code'] == 204)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "function make_post_call($mid_url, $post_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($post_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "public function postCurlCall($url, $post_params){\n return $this->utilities->curlPost($url, $post_params);\n }", "function postDataToServerUsingCurl( $post, $rel_url )\n\t{\n\t\t$url\t\t= \"https://api.razorpay.com/v1/\" . $rel_url;\n\t\t$post_json = json_encode($post);\n\t\t$headers = array();\n\t\t$headers[] = \"Content-Type: application/json\";\n\t\t$options = array(\n\t\t\tCURLOPT_POST\t\t => true,\n\t\t\tCURLOPT_POSTFIELDS\t => $post_json,\n\t\t\tCURLOPT_URL\t\t\t => $url,\n\t\t\tCURLOPT_USERPWD\t\t => $this->password,\n\t\t\tCURLOPT_RETURNTRANSFER => true, // return web page\n\t\t\tCURLOPT_HTTPHEADER\t => $headers,\n\t// CURLOPT_HEADER => false, // don't return headers\n\t// CURLOPT_FOLLOWLOCATION => true, // follow redirects\n\t// CURLOPT_ENCODING => \"\", // handle all encodings\n\t// CURLOPT_USERAGENT => \"spider\", // who am i\n\t// CURLOPT_AUTOREFERER => true, // set referer on redirect\n\t\t\tCURLOPT_CONNECTTIMEOUT => 20, // timeout on connect\n\t\t\tCURLOPT_TIMEOUT => 120, // timeout on response\n\t\t\tCURLOPT_MAXREDIRS => 10, // stop after 10 redirects\n\t\t\tCURLOPT_SSL_VERIFYPEER => true, // enable SSL Cert checks\n\t\t\tCURLOPT_SSL_VERIFYHOST => 2,\n\t\t\tCURLOPT_SSLVERSION\t => CURL_SSLVERSION_TLSv1_2\n\t\t);\n\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt_array( $ch, $options );\n\t\t$result = curl_exec( $ch );\n\t\tif (curl_errno($ch))\n\t\t {\n\t\t\techo 'Error:' . curl_error($ch);\n\t\t }\n\t\tcurl_close( $ch );\n\t\treturn json_decode($result);\n\t}", "private function _post_data($url, $data)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t$ret = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $ret;\n\t}", "function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}", "public function post($url, $body = array(), $query = array(), $headers = array());", "function post_to_url($url, $data) {\n $fields = '';\n foreach ($data as $key => $value) {\n $fields .= $key . '=' . $value . '&';\n }\n rtrim($fields, '&');\n $post = curl_init();\n curl_setopt($post, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($post, CURLOPT_URL, $url);\n curl_setopt($post, CURLOPT_POST, count($data));\n curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($post); //result from mobile seva server \n return $result; //output from server displayed \n curl_close($post);\n}", "function curl_post($url, $postfields=array(), $headers=array(), $auth=array()) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n if(!empty($auth['username']) && !empty($auth['password'])) {\n curl_setopt($ch, CURLOPT_USERPWD, $auth['username'].\":\".$auth[\"password\"]);\n }\n return curl_exec($ch);\n}", "function elastic_post($url, $data) {\n global $elasticAuth;\n\n $response = null;\n\n $ch = curl_init($url);\n $opts = [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_POSTFIELDS => $data,\n CURLOPT_POST => 1,\n CURLOPT_HTTPHEADER => [\n \"Authorization: Basic $elasticAuth\",\n 'Content-Type: application/x-ndjson'\n ]\n ];\n curl_setopt_array($ch, $opts);\n\n $exec = curl_exec($ch);\n\n if ($exec !== false) {\n $response = [\n 'body' => $exec,\n 'info' => curl_getinfo($ch)\n ];\n }\n\n curl_close($ch);\n\n return $response;\n\n}", "function postDataToUrl($url, $data) {\r\n $curl = curl_init();\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n curl_setopt($curl, CURLOPT_HEADER, 1);\r\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n $response = curl_exec ($curl);\r\n curl_close ($curl);\r\n\treturn $response;\r\n}", "protected function execCurl() \n\t{\t\t\t\n\t\tif ( $this->sandbox == true )\n\t\t{\n\t\t\t$server = $this->_server['sandbox'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$server = $this->_server['live'];\n\t\t}\n\n\t\t$url = $server . $this->adhocPostUrl;\n\t\t\n\t\t$headers = array(\n\t\t\t'Content-type: application/x-www-form-urlencoded',\n\t\t\t'Authorization: GoogleLogin auth=' . $this->getAuthToken(),\n\t\t\t'developerToken: ' . $this->developerToken,\n\t\t\t'clientCustomerId: ' . $this->clientCustomerId,\n\t\t\t'returnMoneyInMicros: true',\n\t\t\t\t\t\t\n\t\t);\n\n\t\t$data = '__rdxml=' . urlencode( $this->__rdxml );\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $data );\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE );\n\t\tcurl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );\n\t\t\n\t\t$response = curl_exec( $ch );\n\t\t$httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\t$error = curl_error( $ch );\n\t\tcurl_close( $ch );\n\t\t\n\t\tif( $httpCode == 200 || $httpCode == 403 )\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( !empty( $error ) )\n\t\t\t{\n\t\t\t\tthrow new exception( $httpCode . ' - ' . $error );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new exception( $httpCode . ' - Unknow error occurred while post operation.' ); \n\t\t\t}\n\t\t}\n\t}", "function curl_post($url, $post) {\n\t$ch = curl_init(); \n curl_setopt($ch, CURLOPT_POST, 1); \n curl_setopt($ch, CURLOPT_URL,$url); \n //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post); \n curl_setopt($ch, CURLOPT_HEADER, false); \n ob_start(); \n curl_exec($ch); \n if (curl_errno($ch)){\n print curl_error($ch);}\n else{\n curl_close($ch);}\n $result = ob_get_contents() ; \n ob_end_clean(); \n return $result; \n}", "public function send_post_request(){\n $url = \\Request::get('url');\n $post_array = \\Request::all();\n\n//\t\t$url = 'http://localhost/_websites/ahmed-badawy.com/site/json-test';\n//\t\t$post_array = array('type' => 'scss', 'source' => '.pre{color:red;background-color:green;}', 'compress'=>true);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $query = curl_exec($ch);\n curl_close($ch);\n\n return $query;\n }", "function http_post($url, $params = array()) {\n $postData = '';\n //create name value pairs seperated by &\n foreach ($params as $k => $v) {\n $postData .= $k . '=' . $v . '&';\n }\n $postData = rtrim($postData, '&');\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n $output = curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "public function post($url, $payload = array(), $do_not_exit = true)\n {\n if($do_not_exit)\n {\n $this->do_not_exit = true;\n }\n\n $this->url = $url;\n $this->curl_handle = curl_init();\n $payload = http_build_query($payload);\n curl_setopt($this->curl_handle, CURLOPT_URL, $this->url);\n curl_setopt($this->curl_handle, CURLOPT_POST, true);\n curl_setopt($this->curl_handle, CURLOPT_HTTPHEADER, $this->header);\n curl_setopt($this->curl_handle, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($this->curl_handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this->curl_handle, CURLOPT_HEADER, true);\n $this->curl_response = curl_exec($this->curl_handle);\n\n $this->parse_curl_response();\n return $this->http_body;\n }", "function zbase_remote_post_json($url, $data, $options = [])\n{\n\t$dataString = '';\n\tforeach ($data as $key => $value)\n\t{\n\t\t$dataString .= $key . '=' . $value . '&';\n\t}\n\trtrim($dataString, '&');\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($ch, CURLOPT_POST, count($data));\n\tcurl_setopt($ch, CURLOPT_COOKIEJAR, zbase_storage_path() . 'cookie.txt');\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . strlen($dataString))\n\t);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $result;\n}", "function httpPOST($url, array $data, $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n $query = http_build_query($data, '', '&');\n ($headers = trim($headers) === '') or $headers .= \"\\r\\n\";\n\n $headers = \"POST $url HTTP/1.0\\r\\n\".\n $headers.\n \"Content-Type: application/x-www-form-urlencoded\\r\\n\".\n \"Content-Length: \".strlen($query).\"\\r\\n\".\n \"$query\\r\\n\";\n\n $this->write($headers);\n return $this->readAllAndClose();\n }", "function api_post($url, array $post_contents, $username = null, $password = null)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_contents));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n if ($username != NULL) {\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n }\n return $this->gather_response($ch);\n }", "function post($url, $data = '', $content_type = '')\n{\n\t\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n\t\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\n\tif ($content_type != '')\n\t{\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, \n\t\t\tarray(\n\t\t\t\t\"Content-type: \" . $content_type\n\t\t\t\t)\n\t\t\t);\n\t}\t\n\t\n\t$response = curl_exec($ch);\n\tif($response == FALSE) \n\t{\n\t\t$errorText = curl_error($ch);\n\t\tcurl_close($ch);\n\t\tdie($errorText);\n\t}\n\t\n\t$info = curl_getinfo($ch);\n\t$http_code = $info['http_code'];\n\t\t\n\tcurl_close($ch);\n\t\n\treturn $response;\n}", "function web_hook_post($url, $fields) {\n // url-ify the data for the POST\n foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n rtrim($fields_string,'&');\n\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return ($result);\n}", "function post($url, $headers, $params)\n{\n $data = json_encode($params);\n\n $curl = curl_init();\n\n array_push($headers, \"Content-Type: application/json\");\n array_push($headers, \"Content-Length: \" . strlen($data));\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n // print_r(\"=========请求信息 start =========\\n\");\n // print_r($url . \"\\n\");\n // print_r(json_encode($headers) . \"\\n\");\n // print_r($data . \"\\n\");\n $response = curl_exec($curl);\n curl_close($curl);\n // print_r(\"==============================\\n\");\n // print_r($response);\n // print_r(\"\\n=========请求信息 end =========\\n\");\n return $response;\n}", "public function curlPostCall( $url, $postData ) \n {\n // prx($postData);\n $fields = array();\n foreach ($postData as $postKey => $postVal){\n $fields[$postKey] = urlencode($postVal);\n }\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { \n $fields_string .= $key.'='.$value.'&';\n }\n \n rtrim($fields_string, '&');\n\n try\n {\n // $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n //curl_setopt($ch,CURLOPT_POST, count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //execute post\n $result = curl_exec($ch);\n \n //close connection\n curl_close($ch);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n \n $responseArr = json_decode($result, true);\n return $responseArr;\n }", "function rest_post_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function restPost($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}", "public function post ($url, $data = null, $headers = null, $options = null);", "function post (string $url, array $args = []): string {\n\t$curlCall = curl_init($url);\n\n\tcurl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curlCall, CURLOPT_POST, true);\n\tcurl_setopt($curlCall, CURLOPT_POSTFIELDS, $args);\n\n\t$return = curl_exec($curlCall);\n\tcurl_close($curlCall);\n\n\treturn $return;\n}", "function Send($url, $POST){ //работа с CURL'ом\n\t$ch = curl_init();// Устанавливаем соединение\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $POST);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\n\t$result = curl_exec($ch);\n\n\tif($result === false) print $err = curl_error($ch);\n\n\treturn $result;\n}", "private function curlDo($url, $attrs = null, $post_body = false) {\n\t\t// locallize this variable for terser syntax\n\t\t$crowd_config = $this->crowd_config;\n\n\t\t// build up the full url/query string\n\t\t$query = \"\";\n\t\tif($attrs != null && count($attrs) > 0) {\n\t\t\t$query = \"?\" . http_build_query($attrs);\n\t\t}\n\t\t$full_url = $this->base_url . $url . $query; \n\n\t\t// get a curl handle\n\t\t$curl = curl_init($full_url);\n\n\t\t// Crowd REST uses HTTP auth for the app name and credential\n\t\tcurl_setopt($curl, CURLOPT_USERPWD, $crowd_config['app_name'] . ':' . $crowd_config['app_credential'] );\n\t\t// get back the response document\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t// set our content-type correctly (we get a 415 with text/xml)\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-Type: application/xml\"));\n\t\t// only post if we have a body\n\t\tif($post_body) {\n\t\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $post_body);\n\t\t}\n\t\t// optional supress peer checking to deal with broken SSL configs - may be common with Crowd\n\t\tif (array_key_exists('verify_ssl_peer',$crowd_config)) {\n\t\t curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $crowd_config['verify_ssl_peer']);\n\t\t}\n\t\t// give us back the response headers (so we can scrape cookies)\n\t\tcurl_setopt($curl, CURLOPT_HEADER, true);\n\t\t// load our cookies from early requests\n\t\t$this->curl_load_cookies($curl);\n\n\n\t\t// fire off the request\n\t\t$response = curl_exec($curl);\n\n\t\t// check for curl errors \n\t\tif (curl_errno($curl)) {\n\t\t throw new Exception(\"curl error (${full_url}): \" . curl_error($curl));\n\t\t}\n\n\t\t// extract response metadata\n\t\t$info = curl_getinfo($curl);\n\n\t\t// split headers out of the response\n\t\t$rc = $this->curl_split_headers($response,$info);\n\t\t// add in the metadata\n\t\t$rc['metadata'] = $info;\n\n\t\t// store cookies for later reuse\n\t\t$this->curl_store_cookies($rc);\n\t\tcurl_close($curl);\n\t\treturn $rc;\n\t}", "function curl_post_https($url, $data)\r\n{ // 模拟提交数据函数\r\n $curl = curl_init(); // 启动一个CURL会话\r\n curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1); // 从证书中检查SSL加密算法是否存在\r\n curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器\r\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转\r\n curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer\r\n curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包\r\n curl_setopt($curl, CURLOPT_TIMEOUT, 30); // 设置超时限制防止死循环\r\n curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回\r\n $tmpInfo = curl_exec($curl); // 执行操作\r\n if (curl_errno($curl)) {\r\n echo 'Errno' . curl_error($curl); //捕抓异常\r\n }\r\n curl_close($curl); // 关闭CURL会话\r\n return $tmpInfo; // 返回数据,json格式\r\n}", "private function curlPost($host, $params = array())\n {\n $handle = curl_init($host);\n curl_setopt($handle, CURLOPT_POST, true);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n // NOTE: On Windows systems, the line below may cause problems even when\n // cURL is configured with a CA file.\n\n $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, !$is_windows);\n\n curl_setopt($handle, CURLOPT_POSTFIELDS, $params);\n $result = curl_exec($handle);\n if ($result === false) {\n throw new BillComException('Curl error: ' . curl_error($handle));\n }\n return $result;\n }", "public static function CurlPost($url, array $post = array(), array $options = array()) {\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_FOLLOWLOCATION => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if (!$result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n\n curl_close($ch);\n // var_dump(curl_getinfo($ch)); exit;\n\n\n return $result;\n }", "public static function http_post($url, $postargs = NULL, $output_errors = TRUE) {\n $session = curl_init();\n // Set the POST options.\n curl_setopt($session, CURLOPT_URL, $url);\n if ($postargs !== NULL) {\n curl_setopt($session, CURLOPT_POST, TRUE);\n if (is_array($postargs) && version_compare(phpversion(), '5.5.0') >= 0) {\n // Posting a file using @ prefix is deprecated as of version 5.5.0.\n foreach ($postargs as $key => $value) {\n // Loop through postargs to find files where the value is prefixed @.\n if (strpos($value ?? '', '@') === 0) {\n // Found a file - could be in form @path/to/file;type=mimetype.\n $fileparts = explode(';', substr($value, 1));\n $filename = $fileparts[0];\n if (count($fileparts) == 1) {\n // Only filename specified.\n $postargs[$key] = new CurlFile($filename);\n }\n else {\n // Mimetype may be specified too.\n $fileparam = explode('=', $fileparts[1]);\n if ($fileparam[0] == 'type' && isset($fileparam[1])) {\n // Found a mimetype.\n $mimetype = $fileparam[1];\n $postargs[$key] = new CurlFile($filename, $mimetype);\n }\n else {\n // The fileparam didn't seem to be a mimetype.\n $postargs[$key] = new CurlFile($filename);\n }\n }\n }\n }\n }\n curl_setopt($session, CURLOPT_POSTFIELDS, $postargs);\n }\n curl_setopt($session, CURLOPT_HEADER, FALSE);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, TRUE);\n // Do the POST and then close the session.\n $response = curl_exec($session);\n $httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);\n $curlErrno = curl_errno($session);\n // Check for an error, or check if the http response was not OK.\n if ($curlErrno || $httpCode != 200) {\n if ($output_errors) {\n echo '<div class=\"error\">cUrl POST request failed. Please check cUrl is installed on the server and the $base_url setting is correct.<br/>URL:' . $url . '<br/>';\n if ($curlErrno) {\n echo 'Error number: ' . $curlErrno . '<br/>';\n echo 'Error message: ' . curl_error($session) . '<br/>';\n }\n echo \"Server response<br/>\";\n echo $response . '</div>';\n }\n $return = [\n 'result' => FALSE,\n 'output' => $curlErrno ? curl_error($session) : $response,\n 'errno' => $curlErrno,\n 'status' => $httpCode\n ];\n }\n else {\n $arr_response = explode(\"\\r\\n\\r\\n\", $response);\n // Last part of response is the actual data.\n $return = ['result' => TRUE, 'output' => array_pop($arr_response)];\n }\n curl_close($session);\n return $return;\n }", "function curl_post_https($url,$data){ // 模拟提交数据函数\n $curl = curl_init(); // 启动一个CURL会话\n curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1); // 从证书中检查SSL加密算法是否存在\n curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // 模拟用户使用的浏览器\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // 使用自动跳转\n curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // 自动设置Referer\n curl_setopt($curl, CURLOPT_POST, 1); // 发送一个常规的Post请求\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包\n curl_setopt($curl, CURLOPT_TIMEOUT, 30); // 设置超时限制防止死循环\n curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回\n $tmpInfo = curl_exec($curl); // 执行操作\n if (curl_errno($curl)) {\n echo 'Errno'.curl_error($curl);//捕抓异常\n }\n curl_close($curl); // 关闭CURL会话\n return $tmpInfo; // 返回数据,json格式\n}", "function curl_post(&$handle, $url, $fields = '', &$info = NULL) {\r\n\tglobal $curl_last_timestamp, $curl_throttle;\r\n\tif (! $curl_throttle) {\r\n\t\t$curl_throttle = 2;\r\n\t}\r\n\tif ($curl_last_timestamp && time() - $curl_last_timestamp < $curl_throttle * 60) {\r\n\t\t$delay = min(array(\r\n\t\t\t$curl_throttle * 60, time() - $curl_last_timestamp\r\n\t\t));\r\n\t\tif ($delay) {\r\n\t\t\t//log_msg('CURL', \"Sleeping for $delay second(s)\");\r\n\t\t\tusleep($delay * 1000000);\r\n\t\t}\r\n\t}\r\n\t$curl_last_timestamp = time();\r\n\tif ($fields && is_array($fields))\r\n\t\t$fields = http_build_query2($fields, '', '&');\r\n\tcurl_setopt($handle, CURLOPT_POST, TRUE);\r\n\tif ($fields)\r\n\t\tcurl_setopt($handle, CURLOPT_POSTFIELDS, $fields);\r\n\tcurl_setopt($handle, CURLOPT_URL, $url);\r\n\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\r\n\t$result = curl_exec($handle);\r\n\t$info = curl_getinfo($handle);\r\n\t//log_msg('CURL', \"Post $url?$fields ; result info=\" . json_encode($info));\r\n\treturn $result;\r\n}", "public function post($url = null, array $data = [])\n {\n $this->init($url);\n\n curl_setopt($this->handler, CURLOPT_POST, count($data));\n curl_setopt($this->handler, CURLOPT_POSTFIELDS, http_build_query($data));\n\n return $this->exec();\n }", "protected function _execute(){\n\t\t\t$this->_getUrl();\n\n\t\t\t$c = curl_init($this->_url);\n\t\t\tob_start();\n\t\t\tif(!empty($this->_postFields)) {\n\t\t\t\tcurl_setopt($c, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($c, CURLOPT_POSTFIELDS, json_encode($this->_postFields));\n\t\t\t}\n\n\t\t\tcurl_exec($c);\n\t\t\tcurl_close($c);\n\t\t\t$this->_result = trim(ob_get_contents());\n\t\t\tob_end_clean();\n\t\t}", "public function usePost()\n {\n $this->setOption(CURLOPT_POST, true);\n }", "private function create_curl($s_url, $post_params = array() )\n\t{\n\n\t\t$full_url = $this->settings['server'];\n if ($this->settings['port'] != '80') $full_url .= ':' . $this->settings['port'];\n $full_url .= $s_url ;\n\n\t\t$this->log( 'curl_init( ' . $full_url . ' )' );\n\t\t\n $post_value = Centrifuge::array_implode( '=', '&', $post_params );\n \n\t\t# Set cURL opts and execute request\n\t\t$ch = curl_init();\n\t\tif ( $ch === false )\n\t\t{\n\t\t\tthrow new CentrifugeException('Could not initialize cURL!');\n\t\t}\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $full_url );\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array ( \"Content-type: application/x-www-form-urlencoded\" ) );\t\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $this->settings['timeout'] );\n\t\t\n $this->log( 'trigger POST: ' . $post_value );\n\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $post_value );\n \n\t\treturn $ch;\n\t}", "public function post($url, $payload, $options = [])\n {\n $request = new Client();\n $request->init();\n\n $request->setopt(CURLOPT_URL, $url);\n\n foreach ($this->options as $optionKey => $optValue) {\n $request->setopt($optionKey, $optValue);\n }\n\n foreach ($options as $optionKey => $optValue) {\n $request->setopt($optionKey, $optValue);\n }\n\n $request->setopt(CURLOPT_POSTFIELDS, $payload);\n $request->setopt(\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: ' . $this->dataType,\n 'Content-Length: ' . strlen($payload)\n ]\n );\n\n if (!$this->body = $request->exec()) {\n $this->error = $request->error();\n }\n\n $info = $request->getinfo();\n $this->status = isset($info['http_code']) ? $info['http_code'] : null;\n\n $request->close();\n }", "function post($url, $fields = array(), $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_POST] = true;\n $http_options[CURLOPT_POSTFIELDS] = $fields;\n if (is_array($fields)) {\n $http_options[CURLOPT_HTTPHEADER] = array(\"Content-Type: multipart/form-data\");\n }\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "function forwardPostRequest($url, $data) {\n\t\t\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => $url,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_POST => 1,\n\t\t\tCURLOPT_POSTFIELDS => $data,\n\t\t\tCURLOPT_HTTPHEADER => array(\"cache-control: no-cache\"),\n\t\t\tCURLOPT_SSL_VERIFYPEER => false\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\tif ($response === false) echo \"Bad response\";\n\n\t\tcurl_close($curl);\n\t\treturn $response;\n\n\t}", "public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}", "function post($url, $args = array()) {\n\t\t$defaults = array('method' => 'POST');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "function do_post_request($url, $data, $optional_headers = null)\n {\n\t \n$params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n\t //print_r($response);\n return $response;\n }", "public function https_post($url, $data = [] , $is_raw = false){\n// $this->response = $curl->post($url , $data , $is_raw)\n// ->setHeader('X-Requested-With', 'XMLHttpRequest')\n// ->setHeader(\"Accept\" , 'application/json')\n// ->setHeader('Content-Type' , 'application/json')\n// //->setOpt(CURLOPT_PROXY , '127.0.0.1:8888')\n// ->response;\n\n $header = [\n 'Accept:application/json' , 'Content-Type:application/json'\n ];\n $this->response = $this->https_request($url , json_encode($data ) , $header);\n\n return $this;\n }", "function post($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'POST', 'body' => $data), $options));\n\t}", "private function initPostRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_POST)\n ->addCurlOption(CURLOPT_POSTFIELDS, $this->getQuery())\n ;\n }", "private function post (string $url)\r\n\t{\r\n\t\ttry {\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t$handle = curl_init();\t\t\t\r\n\t\t\tcurl_setopt_array($handle, array(\r\n\t\t\t\tCURLOPT_URL => $url,\r\n\t\t\t\tCURLOPT_CONNECTTIMEOUT => 5,\r\n\t\t\t\tCURLOPT_TIMEOUT => 60,\r\n\t\t\t\tCURLOPT_RETURNTRANSFER => true,\r\n\t\t\t\tCURLOPT_POST => true,\r\n\t\t\t\tCURLOPT_POSTFIELDS => $this->paramUrl\r\n\t\t\t\t));\t\t\r\n\t\t\t//curl_setopt($ch, CURLOPT_ENCODING ,\"\");\r\n\t\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded; charset=UTF-8'));\r\n\t\t\t\r\n\t\t\t$response = curl_exec($handle);\t\t\r\n\t\t\t$resp = json_decode($response);\t\t\t\r\n\t\t\tif ($resp['ok'] == false)\r\n\t\t\t\tthrow new \\Exception($resp['description']);\t\t\t\r\n\t\t\t\r\n\t\t} catch ( \\Exception $e) {\r\n\t\t\t$Logger = new \\Logger('TelegramMain.txt');\r\n\t\t\t$Logger -> log($response, $url.$this->paramUrl);\r\n\t\t}finally{\t\t\t\r\n\t\t\tcurl_close($handle);\t\t\r\n\t\t\treturn $response;\t\t\t\r\n\t\t}\r\n\r\n\t}", "public function postData(){\n\t\t$url = $this->host . \"/rest/v1/leads.json?access_token=\" . $this->getToken();\n\t\t$ch = curl_init($url);\n\t\t$requestBody = $this->bodyBuilder();\n\t\t//debug\n\t\t//print_r($requestBody);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);\n\t\tcurl_getinfo($ch);\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}", "public function postResource($resource_url,$access_token,$post) {\n\t\t$url = $resource_url;\n\n\t\t//if post is a query string it does a application/x-www-form-urlencoded post\n\t\t//if post is an array it does a multipart/form-data post\n\t\t//access_token cannot be in body of multipart post, so we put it in the url in this case\n\t\tif(is_array($post)) {\n\t\t\t$url .= \"?access_token=\".$accessToken;\n\t\t} else {\n\t\t\t$post.= \"&access_token=\".$accessToken;\n\t\t}\n\n\t\t$ci = curl_init();\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $post);\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\tcurl_close ($ci);\n\n\t\treturn $response;\n\t}", "public function post($url, $body){\n\t\t\n\t\t// do we even need this?\n\t\t// $headers = array('Content-Type: application/x-www-form-urlencoded')\n\t\t\n\t\treturn $this->doRequest('POST', $url, $body);\n }", "public static function curlPost($url,$params)\n {\n $postData = '';\n //create name value pairs seperated by &\n foreach($params as $k => $v)\n {\n $postData .= $k . '='.$v.'&';\n }\n rtrim($postData, '&');\n\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($ch,CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n\n }", "private function sendCurl($url) {\n $handle = curl_init();\n $opts = curl_setopt_array($handle, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://' . $url . \"&method=CURL\",\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $this->payload\n ));\n // Send the request & save response to $resp\n $exec = curl_exec($handle);\n // Close request to clear up some resources\n $close = curl_close($handle);\n\n //$json_array = json_decode($exec, TRUE);\n\n if($this->testing) echo \"<hr /><h1>JSON RESPONSE:</h1><br />$exec <hr />\";\n }", "public static function sendPost($_url, $_data, $_headers = [],\n $_return_header = true)\n {\n return self::sendCurl($_url,\n array(\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_FOLLOWLOCATION => 0,\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $_data,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => $_headers,\n CURLOPT_HEADER => $_return_header\n ));\n }", "static function submitHttpPost($url, $postParams = null, $timeout = 50) {\n $ch = curl_init();\n\n // set up the request\n curl_setopt($ch, CURLOPT_URL, $url);\n // make sure we submit this as a post\n curl_setopt($ch, CURLOPT_POST, true);\n if (isset($postParams)) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n }else{\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"\"); \t\n }\n // make sure problems are caught\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n // return the output\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // set the timeouts\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);\n curl_setopt($ch, CURLOPT_TIMEOUT,$timeout);\n // set the PHP script's timeout to be greater than CURL's\n set_time_limit($timeout + 25);\n\n $result = curl_exec($ch);\n // check for errors\n if (0 == curl_errno($ch)) {\n curl_close($ch);\n return $result;\n } else {\n\t\t\t$this->modx->log(MODX_LOG_LEVEL_ERROR,'XFlickr Request failed. '.curl_errno($ch).': '. curl_error($ch).' URL:'.$url);\n curl_close($ch);\n }\n }", "protected function postRequest($data) {\n $ch = curl_init($this->post_url);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type:application/xml',\n 'Gepg-Com:default.sp.in',\n 'Gepg-Code:' . $this->sp_code,\n 'Content-Length:' . strlen($data))\n );\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n $resultCurlPost = curl_exec($ch);\n curl_close($ch);\n\t\t\n\t\t//to be separated\n\t\t$date_createdsc=date(\"Y-m-d H:i:s\");\n\t\t\tYii::$app->db->createCommand()\n ->insert('gepg_bill7', [\n 'response_message' =>$data,\n 'date_created' =>$date_createdsc, \n ])->execute();\n\t\t//end to be separate\t\t\n return $resultCurlPost;\n }", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "public static function post($url, $data = array())\r\n\t{\r\n\t\t$ch = curl_init();\r\n\t\t\r\n\t\tif ( ! empty( $data ) )\r\n\t\t\t$data = http_build_query($data);\r\n\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output \r\n\t\t\r\n\t\t$result = curl_exec($ch);\r\n\r\n\t\tcurl_close ($ch);\r\n\t\t\r\n\t\tif ( false !== $result )\r\n\t\t\t$result = json_decode( $result );\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function customPost($url, $refer, $post_info)\n {\n $USER_AGENT=\"Mozilla/5.0 (Windows NT 6.3; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0\";\n\n if (!isset($CONNECT_TIMEOUT) || !filter_var($CONNECT_TIMEOUT, FILTER_VALIDATE_INT)) {$CONNECT_TIMEOUT=10;} //use 10 seconds by default when no timeout is set\n if (!isset($refer) || !filter_var($refer, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) {$refer=$url;} //use original url as refer when no valid URL provided\n\n $ch=curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, $USER_AGENT);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $CONNECT_TIMEOUT);\n curl_setopt($ch, CURLOPT_TIMEOUT, $CONNECT_TIMEOUT);\n curl_setopt($ch, CURLOPT_REFERER, $refer);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_info);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n $result=curl_exec($ch);\n curl_close($ch);\n\n return $result;\n }", "function callRemitaApiPost($endPoint, $postData) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $endPoint);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen(json_encode($postData)))\n );\n $output = curl_exec($ch);\n return $output;\n}", "public function postData($data, $url) {\n\n $jsonData = json_encode($data);\n $ch = curl_init($url);\n\n curl_setopt_array($ch, array(\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $jsonData,\n CURLOPT_HEADER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => array('Content-Type:application/json', 'Content-Length: ' . strlen($jsonData)))\n );\n\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n }", "private function executePost(Visio\\Http\\CurlRequest $curl) {\n if (!is_string($this->requestBody)) {\n $this->buildPostBody();\n }\n\n $curl->setOption(CURLOPT_POSTFIELDS, $this->requestBody);\n $curl->setOption(CURLOPT_POST, 1);\n\n $this->doExecute($curl);\n }", "function PostURL($url, $postData, $options = array())\n\t{\n\t\t//\t\t$postString = '';\n\t\t//\t\tforeach ($postData as $key => $value) { $postString .= \"$key=$value&\"; }\n\n//\t\t\n//\t\t$options['post_string'] = http_build_query($postData);\n\t\t$options['post_array'] = $postData;\n\t\treturn self::FetchURL($url, $options);\n\t\t\n\t}", "function ccweb_httpPost2($url, $data, &$outResponse) { \r\n $params = array('http' => array('method' => 'POST', 'content' => $data)); \r\n $context = stream_context_create($params);\r\n\r\n $fh = fopen($url, 'rb', false, $context);\r\n if (!$fh) {return FALSE;} \r\n \r\n $response = stream_get_contents($fh); \r\n if ($response === false) {return FALSE;} \r\n \r\n $outResponse = $response; \r\n return TRUE; \r\n}", "function curlBGPost($url,$json) {\n\t$p_args = json_decode($json);\n\t$get = '';\n\tif (count($p_args) > 0) {\n\t\t$get = '?';\n\t\tforeach ($p_args as $name => $value) {\n\t\t\tif ($get != '?')\n\t\t\t\t$get .= '&';\n\t\t\t$get .= \"{$name}={$value}\";\n\t\t}\n\t}\n\t$url .= $get;\n\t$c = curl_init();\n\tcurl_setopt($c,CURLOPT_URL,$url);\n\tcurl_setopt($c,CURLOPT_POST,true);\n\tcurl_setopt($c,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($c,CURLOPT_TIMEOUT,1);\n\t$x = curl_exec($c);\n\treturn $x;\n}", "private function _httpPost($fields)\n {\n $fields_string = http_build_query($fields);\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$this->_getFullUrl());\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return $result;\n }", "public function post(string $url, array $input = [], $headers = null);", "function Curl_Post_Login($url, $params = array()) {\n $data_string = json_encode($params);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n\n $result = curl_exec($ch);\n return $result;\n }", "private function runCurl($url, $postVals = null) {\n\t\t$ch = curl_init ( $url );\n\n\t\t$options = array (\n\t\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\t\tCURLOPT_COOKIE => \"reddit_session={$this->session}\",\n\t\t\t\tCURLOPT_TIMEOUT => 3\n\t\t);\n\t\tcurl_setopt ( $ch, CURLOPT_HTTPHEADER, array (\n\t\t\t\t'User-Agent: Game-of-Bands/v1.4'\n\t\t) );\n\n\t\tif ($postVals != null) {\n\t\t\t$options [CURLOPT_POSTFIELDS] = $postVals;\n\t\t\t$options [CURLOPT_CUSTOMREQUEST] = \"POST\";\n\t\t}\n\n\t\tcurl_setopt_array ( $ch, $options );\n\n\t\t$response = json_decode ( curl_exec ( $ch ) );\n\t\tcurl_close ( $ch );\n\n\t\treturn $response;\n\t}", "function do_post_request($url, $data, $optional_headers = null)\n{\n $params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n return $response;\n}", "public static function post($url, $data)\n {\n return self::fetch($url, array (\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $data\n )\n );\n }", "public static function POST($url, $data)\n {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n\n $Response = curl_exec($curl);\n $Result = json_decode($Response, true);\n\n curl_close($curl);\n\n return $Result;\n }", "public function post($url, $data, $file = false)\n { \n if(!function_exists('curl_init')) die('I can\\'t do post action without curl extension.');\n\n $curl = curl_init();\n\n if(PHP_VERSION_ID >= 50500 && class_exists('CURLFile'))\n {\n $curlFile = true;\n }\n else\n {\n $curlFile = false;\n if(defined('CURLOPT_SAFE_UPLOAD')) curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false);\n }\n \n if($file)\n {\n if($curlFile)\n {\n foreach($data as $key => $value)\n { \n if(isset($val['tmp_name']))\n {\n $data[$key] = new CURLFile(realpath($val['tmp_name']), $val['type'], $val['name']);\n }\n elseif(substr($value, 0, 1) == '@')\n {\n $data[$key] = new CURLFile(substr($value, 1)); \n } \n }\n } \n }\n\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_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n $response = curl_exec($curl);\n $errors = curl_error($curl);\n curl_close($curl);\n\n commonModel::log($url, $data, $response, $errors, 'wechat');\n return $response;\n }", "public static function doPost($url, $postdata, $header = '', $dataencode = 'JSON') {\n // contain acceptable methods. Return false and stop processing here.\n $encode_types = ['QUERY', 'HTTP', 'JSON'];\n if (!in_array($dataencode, $encode_types)) {\n $msg = t('ERROR in call to @function in @file. Data Enocde must be !list', [\n '@function' => __FUNCTION__,\n '@file' => __FILE__,\n '!list' => implode(', ', $encode_types),\n ]);\n watchdog(self::BOX_OPERATIONS_NAME, $msg);\n drupal_set_message($msg, 'error');\n\n return FALSE;\n }\n\n // Decide how to encode data. Some calls will require post data to be\n // encoded as a JSON string. Other calls will require QUERY.\n switch ($dataencode) {\n\n case 'QUERY':\n case 'HTTP':\n $postdata = http_build_query($postdata);\n break;\n case 'JSON':\n default:\n $postdata = trim(json_encode($postdata));\n break;\n }\n\n\n // cURL magic\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);\n\n // Skip header if blank\n if ($header != '') {\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n $header,\n ));\n }\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return $result;\n }", "function post_files($url,$file) {\n // path to a file. $files can be array (multiple) or string (one file).\n // Data will be posted in a series of POST vars named $file0, $file1...\n // $fileN\n $data=array();\n $data['uploadedfile']=\"@\".$file;\n \n\t$ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n $response = curl_exec($ch);\n return $response;\n}", "abstract public function post($data);", "function post($url,$fields){\n curl_setopt($this-> ch,CURLOPT_POST,1);\n curl_setopt($this-> ch,CURLOPT_POSTFIELDS,$fields);\n curl_setopt($this-> ch,CURLOPT_URL,$url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, COOKIE_FILE); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION,true);\n // 返回跳转后的页面 如果只提交表单,则返回1表示成功\n return $this-> html = curl_exec($this-> ch);\n }", "public function post();", "public function post();", "public function post();", "function Curl_Call($url, $args) {\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $args);\n\t\t$data = curl_exec($ch);\n\n\t\t//echo \"<pre>\".print_r(curl_getinfo($ch));\n\n\t\treturn $data;\n\t}", "public function post(...$args)\n {\n return $this->curl('post', ...$args);\n }", "function postRequest( $url, $fields, $optional_headers = null ) {\n\t\t// http_build_query is preferred but doesn't seem to work!\n\t\t// $fields_string = http_build_query($fields, '', '&', PHP_QUERY_RFC3986);\n\t\t\n\t\t// Create URL parameter string\n\t\tforeach( $fields as $key => $value )\n\t\t\t$fields_string .= $key.'='.$value.'&';\n\t\t\t\n\t\t$fields_string = rtrim( $fields_string, '&' );\n\n//\t\techo \"controlKey.php : postRequest() : URL = $url\";\n//\t\techo \"controlKey.php : postRequest() : Fields_string = $fields_string\";\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_POST, count( $fields ) );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $fields_string );\n\t\t\n\t\t$result = curl_exec( $ch );\n\t\t\n\t\tcurl_close( $ch );\n\t}", "public function _post($url = null, array $parameters = []);", "function post_query_slack($url,$opts) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($opts));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($curl);\n curl_close($curl);\n return $data;\n}", "function PPHttpPost($url_, $postFields_, $parsed_)\n\t{\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$url_);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$postFields_);\n\n\t\t//getting response from server\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\treturn array(\"status\" => false, \"error_msg\" => curl_error($ch), \"error_no\" => curl_errno($ch));\n\t\t}\n\n\t\tif(!$parsed_) {\n\t\t\treturn array(\"status\" => true, \"httpResponse\" => $httpResponse);\n\t\t}\n\n\t\t$httpResponseAr = explode(\"\\n\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif(0 == sizeof($httpParsedResponseAr)) {\n\t\t\t$error = \"Invalid HTTP Response for POST request($postFields_) to $url_.\";\n\t\t\treturn array(\"status\" => false, \"error_msg\" => $error, \"error_no\" => 0);\n\t\t}\n\t\treturn array(\"status\" => true, \"httpParsedResponseAr\" => $httpParsedResponseAr);\n\n\t}", "private function post(string $url, array $data = [], array $headers = []): string\n {\n try {\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n $response = curl_exec($ch);\n if (curl_errno($ch)) {\n throw new Exception(\"cURL Error: \" . curl_error($ch));\n } else {\n return $response;\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public static function curlPOST($url,$dato){\n\n $ch = curl_init($url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_CAINFO, getcwd() . \"/certificado/privatekey.pem\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $dato);\n\tcurl_setopt($ch, CURLOPT_CERTINFO, 1);\n\t$response = curl_exec($ch);\n\t$info = curl_getinfo($ch);\n //var_dump($info);\n\t$certInfo = curl_getinfo($ch, CURLINFO_CERTINFO);\n\t//var_dump($response);\n\t//exit;\n curl_close($ch);\n\n\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}" ]
[ "0.7681076", "0.7465218", "0.7413253", "0.7320612", "0.72605574", "0.7228887", "0.72143614", "0.71956396", "0.717653", "0.71734023", "0.7134484", "0.7094239", "0.7035494", "0.6994715", "0.6960789", "0.6940033", "0.6933651", "0.6930861", "0.6869526", "0.68537706", "0.68529", "0.68498534", "0.6846963", "0.6837923", "0.681519", "0.68025404", "0.6789875", "0.6788276", "0.67647666", "0.6763704", "0.6760024", "0.67579323", "0.6735558", "0.6714923", "0.6713721", "0.6703274", "0.6675964", "0.66680455", "0.6648035", "0.66474706", "0.66438705", "0.66167724", "0.6591419", "0.6589637", "0.6584529", "0.65674335", "0.65517896", "0.6542794", "0.6530556", "0.6527944", "0.65268314", "0.6521153", "0.651873", "0.65168005", "0.6494113", "0.64676595", "0.64548594", "0.64544594", "0.6448863", "0.6446495", "0.64354664", "0.6428913", "0.6421551", "0.6421177", "0.6416993", "0.6391157", "0.6388695", "0.63862324", "0.6369664", "0.6357053", "0.6356962", "0.63563794", "0.6350832", "0.6343272", "0.6325855", "0.63249457", "0.63116986", "0.6311553", "0.63033885", "0.6297554", "0.629754", "0.62912196", "0.6287991", "0.62826544", "0.6273114", "0.62631774", "0.6262895", "0.62591773", "0.625704", "0.6252601", "0.6250882", "0.6250882", "0.6250882", "0.62439436", "0.62415934", "0.62410545", "0.623993", "0.6217968", "0.6207931", "0.6204121", "0.6197691" ]
0.0
-1
Performs any kind of petition
public static function request($method='GET',$uri,$params,$options=[]) { $ch = curl_init(); if (!isset($options['no_return'])) { curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; CrawlBot/1.0.0)'); curl_setopt($ch, CURLOPT_ENCODING, ""); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); # required for https urls curl_setopt($ch, CURLOPT_MAXREDIRS, 15); if (isset($options['setopt']) && !empty($options['setopt'])) { foreach ($options['setopt'] as $k => $v) { curl_setopt($ch, $k, $v); } } if (isset($options['follow'])) { curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); } if (isset($options['timeout'])) { curl_setopt($ch, CURLOPT_TIMEOUT, $options['timeout']); //timeout in seconds } if (isset($options['connect_timeout'])) { curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $options['connect_timeout']); } if (isset($options['keep_alive'])) { curl_setopt($ch, CURLOPT_TCP_KEEPALIVE, 1); curl_setopt($ch, CURLOPT_TCP_KEEPIDLE, $options['keep_alive']); curl_setopt($ch, CURLOPT_TCP_KEEPINTVL, 15); } if (isset($options['headers']) && !empty($options['headers'])) { $aux_headers = []; foreach ($options['headers'] as $k_h => $v_h) { if (!empty($v_h)) { $aux_headers[] = $k_h.': '.$v_h; } } curl_setopt($ch, CURLOPT_HTTPHEADER, $aux_headers); } if (isset($options['httpquery']) && !empty($options['httpquery'])) { $httpquery = $options['httpquery']; } elseif (!empty($params)) { $httpquery = http_build_query($params); } if ($method == "POST") { curl_setopt($ch, CURLOPT_POST, 1); } if ($method == "POST" || $method == "PUT") { if (!empty($httpquery)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $httpquery); } } if ($method != "GET") { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); } if ($method == 'GET' && !empty($httpquery)) { if (empty(parse_url($uri,PHP_URL_QUERY))) { $uri .= '?'.$httpquery; } else { $uri .= '&'.$httpquery; } } curl_setopt($ch, CURLOPT_URL, $uri); $start = microtime(true); if (isset($options['bg']) && $options['bg'] == 1) { $extra_curl = ''; if (isset($options['timeout'])) { $extra_curl .= ' --max-time '.$options['timeout']; } if (isset($options['connect_timeout'])) { $extra_curl .= ' --connect-timeout '.$options['connect_timeout']; } if (isset($options['keep_alive'])) { $extra_curl .= ' --keepalive-time '.$options['keep_alive']; } if (isset($options['headers'])) { foreach ($options['headers'] as $k => $v) { $extra_curl .= ' -H "'.$k.': '.$v.'"'; } } if (isset($options['follow'])) { $extra_curl .= " -L"; } if ($method == "POST") { $extra_curl .= " -X \"POST\""; if (!empty($httpquery)) { $uid = uniqid(); file_put_contents('/tmp/'.$uid,$httpquery); } } $curl = 'curl -s '.$extra_curl.' "'.$uri.'"'; if ($method == "POST" && !empty($httpquery)) { $curl .= " -k -d @- < /tmp/".$uid; } $curl .= ' > /dev/null 2>&1 &'; $output = shell_exec($curl); } else { $output = curl_exec($ch); } $end = (microtime(true) - $start); $getinfo = curl_getinfo($ch); $getinfo['curl_exec_timing_ms'] = $end; if (!empty($httpquery)) { $getinfo['http_query'] = $httpquery; } if (!empty($aux_headers)) { $getinfo['headers'] = implode(', ',$aux_headers); } if (isset($curl) && !empty($curl)) { $getinfo['curl'] = $curl; } curl_close($ch); if (isset($options['jsondecode_output'])) { $aux = @json_decode($output,true); $output_copy = $output; if ($aux === null && json_last_error() !== JSON_ERROR_NONE) { $output = 'JSON Decode Error: '.json_last_error_msg(); $output .= '<h4>Response</h4><pre>'.print_r($output_copy,true).'</pre>'; } else { $output = $aux; } } if ($getinfo['http_code'] != 200) { $return = ['result' => false, 'info' => $getinfo, 'output' => $output]; } else $return = ['result' => true, 'info' => $getinfo, 'output' => $output]; if (isset($options['json'])) { $aux = json_encode($return); if ($aux === false && json_last_error() == JSON_ERROR_UTF8) { $output = utf8_encode($output); $aux = json_encode(['result' => $return['result'], 'info' => $return['info'], 'output' => $output]); } $return = $aux; } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function perform();", "public function act()\n\t{\n\t\n\t}", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "function execute() {\n\t\tif (empty($this->args)) {\n\t\t\t$this->__interactive();\n\t\t}\n\n\t\tif (count($this->args) == 1) {\n\t\t\t$this->__interactive($this->args[0]);\n\t\t}\n\n\t\tif (count($this->args) > 1) {\n\t\t\t$type = Inflector::underscore($this->args[0]);\n\t\t\tif ($this->bake($type, $this->args[1])) {\n\t\t\t\t$this->out('done');\n\t\t\t}\n\t\t}\n\t}", "abstract function run();", "function do_all_pings()\n {\n }", "public function act() {\n\t}", "function execute($modifier = null)\n {\n $owner = $this->getOwner();\n $target = $this->getTarget();\n\n $originalDamageToDeal = $owner->getStrength() - $target->getDefence();\n\n if($originalDamageToDeal < 0 ) {\n $originalDamageToDeal = 0;\n }\n\n $damageToDeal = $originalDamageToDeal;\n\n $defenseSkills = $target->getDefenceSkills();\n\n foreach ($defenseSkills as $defenseSkill) {\n if(get_class($defenseSkill) != get_class($this)) {\n $defenseSkill->setOwner($target);\n $defenseSkill->setTarget($owner);\n $damageToDeal = $defenseSkill->execute($damageToDeal);\n }\n }\n\n if($target->isLucky()) {\n UI::actionMessage(\" {$this->getTarget()->getName()} got lucky. {$this->getOwner()->getName()} missed \");\n $damageToDeal = 0;\n } else {\n UI::actionMessage(\" {$this->getOwner()->getName()} hit {$this->getTarget()->getName()} for {$damageToDeal} damage\");\n }\n\n $targetOriginalHealth = $target->getHealth();\n $targetNewHealth = $targetOriginalHealth - $damageToDeal;\n\n\n\n $target->setHealth($targetNewHealth);\n\n }", "public abstract function preTrip();", "public function exec () {\r\n\t\t$a = isset($_GET['action']) ? $_GET['action'] : 'capa';\r\n\t\tswitch ($a) {\r\n\t\t\tcase 'capa':\r\n\t\t\t\t$this->capa();\r\n\t\t\tbreak;\r\n\t\t\tcase 'adicionar':\r\n\t\t\t\t$this->adicionar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'alterar':\r\n\t\t\t\t$this->alterar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'detalhar':\r\n\t\t\t\t$this->detalhar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'excluir':\r\n\t\t\t\t$this->excluir();\r\n\t\t\tbreak;\r\n\t\t\tcase 'sair':\r\n\t\t\t\t$this->sair();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t}", "abstract public function run() ;", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "protected abstract function performImpl();", "public function run()\n\t\t{\n\t\t\tDB::table('pets')->insert(array(\n\t\t\t\tarray('name'=>\"Pumpkin\",'age'=>7,'specie_id'=>1),\n\t\t\t\tarray('name'=>\"Fido\",'age'=>3,'specie_id'=>2),\n\t\t\t\tarray('name'=>\"Oliver\",'age'=>12,'specie_id'=>1),\n\t\t\t\tarray('name'=>\"Snowy\",'age'=>8,'specie_id'=>1),\n\t\t\t\tarray('name'=>\"Rover\",'age'=>8,'specie_id'=>2),\n\t\t\t\tarray('name'=>\"Laddie\",'age'=>6,'specie_id'=>2),\n\t\t\t\tarray('name'=>\"Daffney\",'age'=>2,'specie_id'=>3),\n\t\t\t));\n\t\t}", "private static function shoot()\n {\n }", "public function eat();", "abstract public function Execute();", "public function run()\n {\n \t// Person against person\n \t// Person against self\n \t// Person against nature\n \t// Person against society\n \t// Person against the supernatural\n \t// Person against technology\n\n \t/*\n \t\tIn order to stop a :villainTraitList: :villainOccupation:,\n\t\t\t:mainCharacterName:, a :mainCharacterAge: year-old \n\t\t\t:mainCharacterOccupation: enlists the help of \n\t\t\t:mainCharacterPossessive: :numberOfSupportingCharacters:\n\t\t\tfriends to :resolutionAction: :resolutionNameWithArticle:.\n \t */\n\n $conflicts = [\n \t''\n ];\n }", "abstract protected function _run();", "abstract protected function _run();", "public function proceed();", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "public function addPet() {\n $body = $this->objectConverter->convert($_POST, Pet::CLASS);\n $this->petService->addPet($body);\n }", "function make_them_sing(Singable $singing_animals) {\n\t$singing_animal->sing();\n}", "public function updatePet() {\n $body = $this->objectConverter->convert($_POST, Pet::CLASS);\n $this->petService->updatePet($body);\n }", "public function execute(Game $game);", "private function playHuman()\n {\n do {\n echo \"Jugador Humano pide carta.\\n\";\n\n $card = new Card($this->memory);\n $this->human->receiveCard($card);\n $this->memory->add($card);\n $points = $this->human->getPoints();\n\n echo \"\\tHas sacado \" . $card . '. LLevas ' . $points . ' punto' . ($points > 1 ? 's' : '') . '.';\n\n if ($this->human->isOver())\n echo \"\\n\";\n else {\n do {\n echo 'Plantarse (p) o Continuar (c) ';\n fscanf(STDIN, \"%s\\n\", $response);\n\n if ($response === \"p\") {\n echo \"Jugador Humano se planta.\\n\";\n return;\n }\n } while ($response != 'p' && $response != 'c');\n }\n } while (!$this->human->isOver());\n }", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function hit();", "public function analyzeAction(){ //Overload\n\n\t\tswitch($this->petitionAction){\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'list':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$products[\"products\"] = $this->actualModel->getProducts();\n\t\t\t\t$products[\"products_sale\"] = $this->actualModel->getProductsSale();\n\n\t\t\t\t$this->createView($this->petitionAction);\n\t\t\t\t$this->actualView->render($products);\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'add':\n\n\t\t\t\tif(empty($_POST)){\n\n\t\t\t\t\t$this->createModel();\n\t\t\t\t\t$categories = $this->actualModel->getCategories();\n\t\t\t\t\t$colors = $this->actualModel->getColors();\n\n\t\t\t\t\t$this->createView($this->petitionAction);\n\t\t\t\t\t$this->actualView->render($categories, $colors);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$this->createModel();\n\n\t\t\t\t\t$product = new Product(\n\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t$_POST['id_category'],\n\t\t\t\t\t\t$_POST['name'],\n\t\t\t\t\t\t$_POST['description'],\n\t\t\t\t\t\t$_POST['price'],\n\t\t\t\t\t\t$_POST['price_sale'],\n\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\t$res = $this->actualModel->addProduct($product);\n\t\t\t\t\t$lastId = getLastId(\"product\");\n\t\t\t\t\t$arrayFiles = $_FILES[\"product_image\"];\n\n\t\t\t\t\tif($res){\n\t\t\t\t\t\t$arrColors = $this->actualModel->getColors();\n\n\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\t\"id_product\" => $lastId,\n\t\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\t\"id_waist\" => 1,\n\t\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_unico_\" . $c->getInitial()]\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\t\"id_product\" => $lastId,\n\t\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\t\"id_waist\" => 2,\n\t\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_s_\" . $c->getInitial()]\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\t\"id_product\" => $lastId,\n\t\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\t\"id_waist\" => 3,\n\t\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_m_\" . $c->getInitial()]\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\t\"id_product\" => $lastId,\n\t\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\t\"id_waist\" => 4,\n\t\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_l_\" . $c->getInitial()]\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($res && $arrayFiles){\n\t\t\t\t\t\tfor($i = 0; $i < count($arrayFiles[\"name\"]); $i++){\n\t\t\t\t\t\t\tif($arrayFiles[\"error\"][$i] === 0){\n\t\t\t\t\t\t\t\tif($this->actualModel->validateProductImage(\n\t\t\t\t\t\t\t\t\t$arrayFiles[\"name\"][$i],\n\t\t\t\t\t\t\t\t\t$arrayFiles[\"type\"][$i]\n\t\t\t\t\t\t\t\t)){\n\t\t\t\t\t\t\t\t\t$this->actualModel->addProductImage(\n\t\t\t\t\t\t\t\t\t\t$arrayFiles[\"tmp_name\"][$i],\n\t\t\t\t\t\t\t\t\t\t$arrayFiles[\"type\"][$i],\n\t\t\t\t\t\t\t\t\t\t$lastId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->createLoadingView();\n\t\t\t\t\t$this->actualView->render();\n\t\t\t\t\t$this->redirect();\n\n\t\t\t\t}\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'edit':\n\n\t\t\t\tif(empty($_POST)){\n\n\t\t\t\t\t$this->createModel();\n\n\t\t\t\t\t$product = $this->actualModel->getProduct($_GET[\"id_product\"]);\n\t\t\t\t\t$categories = $this->actualModel->getCategories();\n\t\t\t\t\t$stock = $this->actualModel->getStockProduct($_GET[\"id_product\"]);\n\t\t\t\t\t$colors = $this->actualModel->getColors();\n\t\t\t\t\t//$waists = $this->actualModel->getWaistsByIdCategory($stock[0][\"id_category\"]);\n\n\t\t\t\t\t$this->createView($this->petitionAction);\n\t\t\t\t\t$this->actualView->render($categories, $product,$stock, $colors);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$this->createModel();\n\n\t\t\t\t\t\t$product = new Product(\n\t\t\t\t\t\t\t$_GET['id_product'],\n\t\t\t\t\t\t\t$_POST['id_category'],\n\t\t\t\t\t\t\t$_POST['name'],\n\t\t\t\t\t\t\t$_POST['description'],\n\t\t\t\t\t\t\t$_POST['price'],\n\t\t\t\t\t\t\t$_POST['price_sale'],\n\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t);\n\n\n\t\t\t\t\t$res = $this->actualModel->editProduct($product);\n\n\t\t\t\t\tif($res && $_GET[\"id_product\"] !== '0'){\n\n\t\t\t\t\t\t$arrColors = $this->actualModel->getColors();\n\t\t\t\t\t\t$this->actualModel->deleteStockProduct($_GET['id_product']);\n\n\t\t\t\t\t\t//$waists = $this->actualModel->getWaistsByIdCategory($_POST['id_category']);\n\n\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\"id_product\" => $_GET['id_product'],\n\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\"id_waist\" => 1,\n\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_unico_\" . $c->getInitial()]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\"id_product\" => $_GET['id_product'],\n\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\"id_waist\" => 2,\n\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_s_\" . $c->getInitial()]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\"id_product\" => $_GET['id_product'],\n\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\"id_waist\" => 3,\n\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_m_\" . $c->getInitial()]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($arrColors as $k => $c){\n\t\t\t\t\t\t\t$prCaWaCoSt = array(\n\t\t\t\t\t\t\t\t\"id_product\" => $_GET['id_product'],\n\t\t\t\t\t\t\t\t\"id_category\" => $_POST['id_category'],\n\t\t\t\t\t\t\t\t\"id_waist\" => 4,\n\t\t\t\t\t\t\t\t\"id_color\" => $c->getIdColor(),\n\t\t\t\t\t\t\t\t\"stock\" => $_POST[\"quantity_l_\" . $c->getInitial()]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$this->actualModel->addStockProduct($prCaWaCoSt);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->createLoadingView();\n\t\t\t\t\t$this->actualView->render();\n\t\t\t\t\t$this->redirect();\n\n\t\t\t\t}\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'delete':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$this->actualModel->deleteProductGallery($_GET[\"id_product\"]);\n\t\t\t\t$this->actualModel->deleteStockProduct($_GET['id_product']);\n\t\t\t\t$this->actualModel->deleteProduct($_GET['id_product']);\n\n\t\t\t\t$this->createLoadingView();\n\t\t\t\t$this->actualView->render();\n\t\t\t\t$this->redirect();\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'edit_gallery':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$gallery = $this->actualModel->getGallery($_GET[\"id_product\"]);\n\n\t\t\t\t$this->createView(\"Edit_Gallery\", true); //Corregir\n\t\t\t\t$this->actualView->render($gallery);\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'edit_image':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$product = $this->actualModel->getProduct($_GET[\"id_product\"]);\n\n\t\t\t\t$this->createView(\"Edit_Image\", true); //Corregir\n\t\t\t\t$this->actualView->render($product);\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'add_gallery':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$arrayFiles = $_FILES[\"product_image\"];\n\n\t\t\t\tif($arrayFiles){\n\t\t\t\t\tfor($i = 0; $i < count($arrayFiles[\"name\"]); $i++){\n\t\t\t\t\t\tif($arrayFiles[\"error\"][$i] === 0){\n\t\t\t\t\t\t\tif($this->actualModel->validateProductImage(\n\t\t\t\t\t\t\t\t$arrayFiles[\"name\"][$i],\n\t\t\t\t\t\t\t\t$arrayFiles[\"type\"][$i]\n\t\t\t\t\t\t\t)){\n\t\t\t\t\t\t\t\t$this->actualModel->addProductImage(\n\t\t\t\t\t\t\t\t\t$arrayFiles[\"tmp_name\"][$i],\n\t\t\t\t\t\t\t\t\t$arrayFiles[\"type\"][$i],\n\t\t\t\t\t\t\t\t\t$_GET[\"id_product\"]\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->createLoadingView();\n\t\t\t\t$this->actualView->render();\n\t\t\t\t$this->redirect();\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'add_image':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$product = $this->actualModel->getProduct($_GET[\"id_product\"]);\n\t\t\t\t$arrayFiles = $_FILES[\"frame_product\"];\n\n\t\t\t\tif($arrayFiles){\n\t\t\t\t\tif($arrayFiles[\"error\"] === 0){\n\t\t\t\t\t\tif($this->actualModel->validateFrameProduct(\n\t\t\t\t\t\t\t$arrayFiles[\"name\"],\n\t\t\t\t\t\t\t$arrayFiles[\"type\"]\n\t\t\t\t\t\t)){\n\t\t\t\t\t\t\t$this->actualModel->addFrameProduct(\n\t\t\t\t\t\t\t\t$arrayFiles[\"tmp_name\"],\n\t\t\t\t\t\t\t\t$arrayFiles[\"type\"],\n\t\t\t\t\t\t\t\t$_GET[\"id_product\"]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->createLoadingView();\n\t\t\t\t$this->actualView->render();\n\t\t\t\t$this->redirect();\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'delete_gallery':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$this->actualModel->deleteProductImage($_GET[\"id_product_image\"]);\n\n\t\t\t\t$this->createLoadingView();\n\t\t\t\t$this->actualView->render();\n\t\t\t\t$this->redirect();\n\n\t\t\tbreak;\n\n\t\t\t/**\n\t\t *\n\t\t */\n\t\t\tcase 'delete_image':\n\n\t\t\t\t$this->createModel();\n\n\t\t\t\t$this->actualModel->deleteFrameProduct($_GET[\"id_product\"]);\n\t\t\t\t$product = $this->actualModel->getProduct($_GET[\"id_product\"]);\n\n\t\t\t\t$this->createView(\"Edit_Image\", true); //Corregir\n\t\t\t\t$this->actualView->render($product);\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "public function\n\t\tdo_actions()\n\t{\n\t}", "function performPageFunctionality() {\n\t\t$GLOBALS['alphabet'] = array(\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \n\t\t\"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\");\n\t\t$difficulty = $_POST['difficulty'];\n\t\t$url = $this->createURL($difficulty, \"https://wordsapiv1.p.mashape.com/words?random=true&\");\n\t\t$randomWord = $this->retrieveRandomWord($url);\n\t\t$this->setSessionVariables($randomWord);\n\t}", "public function promotional();", "function eat($object, $method, $amount=0, $container=0) {\n\t\t//method \"weight\", \"pieces\", \"whole\"\n\t\t//to do: This doesn't take preset into account yet\n\t\t$okay = 0;\n\t\t$stomachSize = 800;//in the future this will vary from person to person\n\t\t$fullness = $this->checkFullness(1);\n\t\tif ($method==\"weight\") {\n\t\t\t$randomVariance = (rand(0, 20)-10)/100+1;\n\t\t\t$amount = round($randomVariance*$amount);\n\t\t}\n\t\t\n\t\t//toDo: if fullness>stomachSize, induce vomiting\n\t\tif ($fullness>=$stomachSize) return -1;//can't eat anymore\n\t\telse {\n\t\t\t$curTime = new Time($this->mysqli);\n\t\t\t$capacity = $stomachSize - $fullness;\n\t\t\t$food = new Obj($this->mysqli, $object);\n\t\t\t$food->getBasicData();\n\t\t\tif ($container>0&&$food->parent!=$container) return -2;//trying to eat food that's not here\n\t\t\telse if ($container==0&&$food->parent!=$this->bodyId) return -2;\n\t\t\telse if ($food->parent==$this->bodyId) {\n\t\t\t\t$source = \"person\";//eating from inventory\n\t\t\t}\n\t\t\telse $source = \"container\";//in the future needs to check that the container is in the inventory or in the same location as the character\n\t\t\t\n\t\t\t$edible = $food->getAttribute(ATTR_EDIBLE);\n\t\t\tif (!$edible) return -3;//not edible\n\t\t\t$maxEat = $food->getAttribute(46);\n\t\t\tif ($maxEat&&$method==\"weight\") {\n\t\t\t\tif ($amount>$maxEat) $amount=$maxEat;\n\t\t\t\tif ($amount>$capacity) $amount=$capacity;\n\t\t\t\tif ($amount>$food->weight) $amount=$food->weight;\n\t\t\t\t$res = $food->checkMethod($method, 1, $amount);\n\t\t\t}\n\t\t\telse if ($method==\"pieces\") {\n\t\t\t\t$res = $food->checkMethod($method, $amount, $food->weight);\n\t\t\t\tif ($res[\"weight\"]*$res[\"pieces\"]>$maxEat) $amount=$maxEat;\n\t\t\t\tif ($res[\"weight\"]*$res[\"pieces\"]>$capacity&&$capacity<$maxEat) $amount=$capacity;\n\t\t\t\tif ($amount<$res[\"weight\"]) $res = $food->checkMethod($method, $res[\"pieces\"], $amount);//must eat less because it exceeds capacity\n\t\t\t}\n\t\t\telse if ($method==\"whole\") {\n\t\t\t\t$res = $food->checkMethod($method, $food->pieces, $food->weight);\n\t\t\t\tif ($res[\"countable\"]==1&&$res[\"weight\"]*$res[\"pieces\"]>$maxEat) return -4;//You can't swallow that much in one go\n\t\t\t\tif ($res[\"countable\"]==1&&$res[\"weight\"]*$res[\"pieces\"]>$capacity) return -4;\n\t\t\t\tif ($res[\"weight\"]>$maxEat) return -4;//You can't swallow that much in one go\n\t\t\t\tif ($res[\"weight\"]>$capacity) return -4;\n\t\t\t}\n\t\t\t\n\t\t\t$curTime = new Time($this->mysqli);\n\t\t\t\n\t\t\tif ($method!=\"whole\") {\n\t\t\t\tif ($res) {\n\t\t\t\t\tif ($res[\"method\"]=='part') {\n\t\t\t\t\t\t//reduce pile in source\n\t\t\t\t\t\tif ($res[\"countable\"]==1) $sql = \"UPDATE `objects` SET `pieces`=`pieces`-\" . $res[\"pieces\"] . \" WHERE `parent`=$food->parent AND `uid`=$object AND (`exp_d`=-1 OR `exp_d`>'\" . $curTime->dateTime . \"' OR (`exp_d`='\" . $curTime->dateTime . \"' AND `exp_m`>'\" . $curTime->minute . \"')) LIMIT 1\";\n\t\t\t\t\t\telse $sql = \"UPDATE `objects` SET `weight`=`weight`-\" . $res[\"weight\"] . \" WHERE `parent`=$food->parent AND `uid`=$object AND (`exp_d`=-1 OR `exp_d`>'\" . $curTime->dateTime . \"' OR (`exp_d`='\" . $curTime->dateTime . \"' AND `exp_m`>'\" . $curTime->minute . \"')) LIMIT 1\";\n\t\t\t\t\t\t$this->mysqli->query($sql);\n\t\t\t\t\t\tif ($this->mysqli->affected_rows==0) return -2;//The object isn't here\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//increase pile in stomach\n\t\t\t\t\t\t\tif ($res[\"countable\"]==1) $sql2 = \"UPDATE `stomach` SET `amount`=`amount`+(\" . $res[\"weight\"]*$res[\"pieces\"] . \") WHERE `charFK`=$this->uid AND `resFK`=$food->secondary AND `status`=1 AND `datetime`=\" . $curTime->dateTime. \" LIMIT 1\";\n\t\t\t\t\t\t\telse $sql2 = \"UPDATE `stomach` SET `amount`=`amount`+\" . $res[\"weight\"] . \" WHERE `charFK`=$this->uid AND `resFK`=$food->secondary AND `status`=1 AND `datetime`=\" . $curTime->dateTime. \" LIMIT 1\";\n\t\t\t\t\t\t\t$this->mysqli->query($sql2);\n\t\t\t\t\t\t\tif ($this->mysqli->affected_rows==0) {\n\t\t\t\t\t\t\t\t//There is no pile to merge with, so creating new pile\n\t\t\t\t\t\t\t\tif ($res[\"countable\"]==1) $sql3 = \"INSERT INTO `stomach`(`uid`, `charFK`, `resFK`, `amount`, `status`, `datetime`) VALUES (NULL, '$this->uid', '$food->secondary', '\" . $res[\"weight\"]*$res[\"pieces\"] . \"', '1', '$curTime->dateTime')\";\n\t\t\t\t\t\t\t\telse $sql3 = \"INSERT INTO `stomach`(`uid`, `charFK`, `resFK`, `amount`, `status`, `datetime`) VALUES (NULL, '$this->uid', '$food->secondary', '\" . $res[\"weight\"] . \"', '1', '$curTime->dateTime')\";\n\t\t\t\t\t\t\t\t$this->mysqli->query($sql3);\n\t\t\t\t\t\t\t\t$result = $this->mysqli->insert_id;\n\t\t\t\t\t\t\t\tif ($result) $okay = 1;\n\t\t\t\t\t\t\t\telse return -5;//failed to create stomach content\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse $okay = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse $method = \"whole\";\n\t\t\t\t}\n\t\t\t\telse return -2;\n\t\t\t}\n\t\t\t\n\t\t\tif ($method==\"whole\") {\n\t\t\t\t$r=queryDelete($this->mysqli, \"objects\", \"`uid`=$object AND `parent`=$food->parent AND (`exp_d`=-1 OR `exp_d`>'\" . $curTime->dateTime . \"' OR (`exp_d`='\" . $curTime->dateTime . \"' AND `exp_m`>'\" . $curTime->minute . \"'))\", \"`uid`\", 1);\n\t\t\t\tif ($r==0) return -6;//food didn't get deleted\n\t\t\t\tif ($res[\"countable\"]==1) $sql = \"UPDATE `stomach` SET `amount`=`amount`+(\" . $res[\"weight\"]*$res[\"pieces\"] . \") WHERE `charFK`=$this->uid AND `resFK`=$food->secondary AND `status`=1 AND `datetime`=\" . $curTime->dateTime. \" LIMIT 1\";\n\t\t\t\telse $sql = \"UPDATE `stomach` SET `amount`=`amount`+\" . $res[\"weight\"] . \" WHERE `charFK`=$this->uid AND `resFK`=$food->secondary AND `status`=1 AND `datetime`=\" . $curTime->dateTime. \" LIMIT 1\";\n\t\t\t\t//merge with pile if exists\n\t\t\t\t$this->mysqli->query($sql);\n\t\t\t\tif ($this->mysqli->affected_rows==0) {\n\t\t\t\t\t//insert new row\n\t\t\t\t\t$newweight = $res[\"weight\"]*$res[\"pieces\"];\n\t\t\t\t\tif ($res[\"countable\"]==1) $sql = \"INSERT INTO `stomach` (`uid`, `charFK`, `resFK`, `amount`, `status`, `datetime`) VALUES (NULL, '$this->uid', '$food->secondary', '\" . $newweight . \"', '1', '$curTime->dateTime')\";\n\t\t\t\t\telse $sql = \"INSERT INTO `stomach` (`uid`, `charFK`, `resFK`, `amount`, `status`, `datetime`) VALUES (NULL, '$this->uid', '$food->secondary', '\" . $res[\"weight\"] . \"', '1', '$curTime->dateTime')\";\n\t\t\t\t\t$this->mysqli->query($sql);\n\t\t\t\t\t$result = $this->mysqli->insert_id;\n\t\t\t\t\tif ($result) $okay = 1;\n\t\t\t\t\telse return -5;\n\t\t\t\t}\n\t\t\t\telse $okay = 1;\n\t\t\t}\n\t\t\t//to do: process immediate poisons\n\t\t\treturn $okay;\n\t\t}\n\t}", "public function run()\n {\n $attachment=new Image('https://picsum.photos/200/300');\n $response=OutgoingMessage::create('Este es mi nuevo producto')\n ->withAttachment($attachment);\n $this->say($response);\n $this->returnOrExit(Interactives::class);\n }", "public function work(): void;", "public function execute(){\n// $test = '2-SG-1040,2-SG-1021,2-SG-1027,2-SG-234,2-SG-1037,disable,disable,disable,disable,disable,disable,disable,disable,disable,disable';\n// $this->_logger->addDebug(print_r($this->getRequest()->getParam('orders'), true));\n $orders = $this->getModifiedOrders($this->getRequest()->getParam('orders'));\n // construct Argument 2: user info\n $weight = $this->getRequest()->getParam('weight');\n $user = $this->getCustomerInfo($weight);\n // construct argument 3: nutrition goal definition\n $goal = $this->getNutritionGoal($user);\n $result = $this->nutritionAlgorithm($orders, $user, $goal);\n echo $result;\n }", "abstract public function attempt($arguments = array());", "private function Potion() {\n $rand = rand (30, 60);\n $this->Potion = True;\n $this->pv += $rand;\n $status = \"{$this->name} utilise une potion <img src='../public/pictures/Abilities5/potion.png' width=30px /> et se soigne de {$rand} PV!\";\n return $status;\n }", "public function talk();", "function execute( $action, $type, $id ) {\n $this -> action = $action;\n $this -> object_type = $type;\n $this -> object_id = $id ;\n $this -> parse();\n }", "abstract public function process();", "abstract public function process();", "abstract public function process();", "public function run()\n {\n //\n $this->call(Professeur::class);\n }", "abstract public function eat($banana);", "abstract function execute ();", "public abstract function run();", "public abstract function run();", "abstract public function run(): void;", "abstract function execute();", "abstract function execute();", "public function proceed()\n {\n }", "public function takePayment() {\r\n if ($this->payment instanceof PayPal) {\r\n $this->payment->payByPayPal();\r\n }elseif ($this->payment instanceof SagePay) {\r\n $this->payment->payBySagePay();\r\n } elseif ($this->payment instanceof WorldPay) {\r\n $this->payment->payByWorldPay();\r\n }\r\n }", "function eval_verb($verb)\n{\n\n}", "function sayHelloProgrammer(Programmer $programmer)\r\n{\r\n if ($programmer instanceof BackendProgrammer) {\r\n echo \"Hello Backend Programmer $programmer->name\" . PHP_EOL;\r\n } else if ($programmer instanceof FrontendProgrammer) {\r\n echo \"Hello Frontend Programmer $programmer->name\" . PHP_EOL;\r\n } else if ($programmer instanceof Programmer) {\r\n echo \"Hello Programmer $programmer->name\" . PHP_EOL;\r\n }\r\n \r\n}", "function performAction($action)\n{\n\trequire_once(SITE_DIR.'_classes/_factory/_ActionFactory.php');\n\t$action = ActionFactory::createAction($action);\n\t$result = $action->execute();\n}", "public function swim(): void\r\n {\r\n echo \"\\nSwimming normally, as a human would do...\";\r\n }", "public function show(Petition $petition)\n {\n //\n }", "public function chooseFunction(){\n if (isset($this->provided['postLabel'])) {\n echo \"You called the function <b> \".$this->provided['postLabel'].\" </b> if you need to know what this shit does follow it for yourself\n in kikundi/controller/PostController.php <br>\";\n switch($this->provided['postLabel']){\n case 'createProjectPool':\n ProjectController::addProjectPool($this->provided['sessionID'], $this->provided['name'], $this->provided['adminName']);\n setcookie('newCook', '69', 2019-9-11, '/');\n break;\n case 'registerMember':\n $this->joinProjectPool();\n break;\n case 'createProject':\n $this->createProject();\n break;\n case 'addTag':\n TagController::saveTagInDb($this->provided['tag']);\n break;\n case 'checkTag':\n echo \"<h2>All the Tags starting with \".$this->provided['tag'].\"</h2>\";\n var_dump(TagController::searchInDb($this->provided['tag']));\n break;\n case 'joinProjectPool':\n break;\n case 'likeProject':\n $this->likeProject();\n break;\n case 'approve':\n break;\n default:\n echo \"no post with that label found!\";\n }\n } else {\n echo \"You should not be here!\";\n }\n\n }", "abstract public function doAction($argv);", "public function perform()\n {\n foreach ($this->actions as $action) {\n $action->perform();\n }\n }", "static function h($stuff=''){\r\n self::ps();\r\n self::p($stuff);\r\n self::ps();\r\n }", "protected abstract function run();", "abstract public function post();", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "public function run()\n {\n Model::unguard();\n\n //$this->call(TracuuFaker::class);\n //$this->call(SanphamFaker::class);\n //$this->call(DeliveryFaker::class);\n $this->call(updateImages::class);\n\n Model::reguard();\n }", "public function ability() {\n\n $this->startMove(3, 0.2);\n echo \"THE ENGINE IS OVERHEATED!\\n\";\n $this->switchEngine();\n\n\n\n\n }", "public function process() {\n $call = $this->getData('p');\n\n if(method_exists($this, $call)) {\n $this->$call();\n } else {\n $this->output = array(\n 'success' => false,\n 'key' => 'eeek'\n );\n\n $this->renderOutput();\n }\n }", "function Execute ();", "function execute()\n {\n }", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "public function run()\n {\n $patient = Patient::factory()->create();\n $dentist = Dentist::factory()->create();\n\n //genero N tratamientos y se los asigno a tal paciente y tal dentista\n $treatments = Treatment::factory()\n ->count(2)\n ->for($patient) //relacion muchos a uno\n ->for($dentist)\n ->create();\n }", "public abstract function process();", "protected function executeSpecificStep() {}", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "public function Talk();", "function sayHelloProgrammer(Programmer $programmer)\n{\n if ($programmer instanceof BackendProgrammer) {\n echo \"Hello Backend Programmer $programmer->name\" . PHP_EOL;\n } elseif ($programmer instanceof FrontendProgrammer) {\n echo \"Hello Frontend Programmer $programmer->name\" . PHP_EOL;\n } elseif ($programmer instanceof Programmer) {\n echo \"Hello Programmer $programmer->name\" . PHP_EOL;\n }\n}", "public function verb();", "abstract function command();", "abstract protected function faireDuSport();", "function go(){\n\t\tglobal $kind;\n\t\n\t\tif($kind>=0&&$kind<=2){\n\t\t\t\tdiagram_role($kind);\t\t\n\t\t}else if($kind>2&&$kind<6){\n\t\t\t\tdiagram_program($kind);\t\t\t\t\n\t\t}else if($kind>=6&&$kind<8){\n\t\t\t\tdiagram_commits($kind);\n\t\t}else if($kind>=8&&$kind<9){\n\t\t\t\tdiagram_git($kind);\n\t\t}else if($kind>=9&&$kind<11){\n\t\t\t\tdiagram_itemized($kind);\n\t\t}else if($kind>=11&&$kind<12){\n\t\t\t\tdiagram_loc($kind);\n\t\t}else if($kind>=12&&$kind<14){\n\t\t\t\tdiagram_locY($kind);\n\t\t}\n}", "function ProcesarPeticion($peticion){\n\t\t\n\t\t$vista= $this->getVista();\t\t\n\t\t$vista->plantillaContenido='contenido/'.$peticion->accion;\t\n\t\t\n\t\t//return $vista->mostrar($layout = 'inicio');\t\t\n\t\treturn $vista->mostrar($layout = 'crud');\t\t\n\t}", "function ProcesarPeticion($peticion){\n\t\t\n\t\t$vista= $this->getVista();\t\t\n\t\t$vista->plantillaContenido='contenido/'.$peticion->accion;\t\n\t\t\n\t\t//return $vista->mostrar($layout = 'inicio');\t\t\n\t\treturn $vista->mostrar($layout = 'crud');\t\t\n\t}", "public function run()\n {\n $this->makeEquipos();\n }", "public function run()\n {\n $type_procedure = [\n ['name' => 'Massagem'],\n ['name' => 'Depilação'],\n ];\n foreach ($type_procedure as $key => $value) {\n TypeProcedures::create($value);\n }\n }", "function takeObjective() {\n return Engine::send('takeObjective');\n}" ]
[ "0.5709959", "0.5619763", "0.5410543", "0.5404637", "0.53513885", "0.53367925", "0.5327804", "0.52616805", "0.5239991", "0.5211913", "0.51769465", "0.5174757", "0.5174757", "0.5174757", "0.5174757", "0.5174757", "0.5174757", "0.5174757", "0.5174757", "0.5145902", "0.513055", "0.5082017", "0.50740427", "0.50625306", "0.50517344", "0.5033276", "0.5033276", "0.50078595", "0.49977258", "0.49963003", "0.4993166", "0.49876893", "0.49810743", "0.4972451", "0.49666846", "0.49666846", "0.49515152", "0.49334678", "0.49324033", "0.49280533", "0.4923714", "0.49157885", "0.49149966", "0.49123052", "0.49099782", "0.49071202", "0.49032715", "0.48967367", "0.4887347", "0.48854536", "0.48854536", "0.48854536", "0.4881961", "0.48557413", "0.48404783", "0.4835897", "0.4835897", "0.48281264", "0.48253328", "0.48253328", "0.4818742", "0.48129836", "0.48078388", "0.48037368", "0.4802235", "0.48003832", "0.47998023", "0.47984797", "0.4793102", "0.4793066", "0.47893262", "0.4787566", "0.4783201", "0.47747108", "0.47743168", "0.47657254", "0.47644392", "0.47609797", "0.47555175", "0.47546262", "0.47546262", "0.47546262", "0.47546262", "0.47487924", "0.474612", "0.4744176", "0.47386307", "0.47386307", "0.47386307", "0.47386307", "0.47323883", "0.4729713", "0.47262508", "0.47253665", "0.4723669", "0.4718226", "0.47072396", "0.47072396", "0.47057432", "0.47039738", "0.47037032" ]
0.0
-1
We want to pass in the query and an associative array of variables Bind the variables and then execute the query.
function ExecutePreparedQuery($sql, $vars) { if(empty($pdo)) { $connectDb = "mysql:host=" . $dbServer . ";dbname=" . $dbName; $pdo = new pdo($connectDb, $dbUser, $dbPass); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } try { $query = $pdo->prepare($sql); } catch(Exception $e) { echo("<b><font color=\"red\">Error executing sql query:</font><br><br>"); print_r($e->getMessage()); die(); } if($query) $query->execute($vars); else { print_r($pdo->errorInfo); die(); } try { return $query->fetchAll(PDO::FETCH_ASSOC); } catch(Exception $e) { // An insert will throw, this is crappy and should probably be handled better return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function execute($bind_array);", "public function bindAndExecute()\n\t{\n\n\t\t//$params = func_get_args();\n\n\t\t// The only way to get the parameters by reference is to use the debug_backtrace functions rather than\n\t\t// func_get_args. I'm not a fan of this but it works.\n\n $params = array();\n\n\t\t$stack = debug_backtrace();\n\t\tif(isset($stack[0][\"args\"]))\n\t\t\tfor($i=0; $i < count($stack[0][\"args\"]); $i++)\n\t\t\t\t$params[$i] = & $stack[0][\"args\"][$i];\n\n\n\n\n\n\n\t\tMysqlBase::$queryCount++;\n\n\t\t$arrayIndex = $this->myQuery . ' ' . implode('::', $params);\n\t\tif(isset(MysqlBase::$queryArray[$arrayIndex]))\n\t\t{\n\t\t\tMysqlBase::$queryArray[$arrayIndex]++;\n\t\t}else{\n\t\t\tMysqlBase::$queryArray[$arrayIndex] = 1;\n\t\t}\n\n\n\t\tif(!call_user_func_array(array($this, 'bind_param'), $params))\n\t\t\t$this->throwError();\n\n\t\tif($this->execute())\n\t\t{\n\t\t\t$this->store_result();\n\t\t\treturn true;\n\t\t}else{\n\t\t\tif($this->errno > 0)\n\t\t\t\t$this->throwError();\n\t\t\treturn false;\n\t\t}\n\n\t}", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "private function runQuery () {\n\n // Prepare the constructed SQL statement\n if ($this->_query = $this->_pdo->prepare($this->_sql)) {\n\n // Set a counter to one to use when binding\n $x = 1;\n \n // Loop through the binding array\n foreach($this->_bindArray as $param) {\n \n // Run the bindValue function to match the correct value to the correct placing\n $this->_query->bindValue($x, $param);\n\n // Increment the counter\n $x++;\n \n }\n \n // Run the execute function\n $this->execute();\n }\n }", "public function query()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n if (count($bindings) == 1 and is_array($bindings[0])){\n $bindings = $bindings[0];\n }\n\n try{\n $query = $this->connection()->prepare($sql);\n\n foreach ($bindings as $key => $value){\n $query->bindValue($key + 1 , _e($value));\n }\n $query->execute();\n\n return $query;\n }\n catch (PDOException $e){\n echo $sql;\n pre($this->bindings);\n die($e->getMessage());\n }\n\n }", "public function run_sql($bindVars = FALSE, $outvar = NULL);", "function run_query($query, array $params = array()) {\n\tglobal $db;\n\n\t$statement = $db->prepare($query);\n\n\t// bind params if we have any\n\tforeach ($params as $key => $value) {\n\t\t$statement->bindValue($key + 1, $value, PDO::PARAM_STR);\n\t}\n\n\t$statement->execute();\n\n\treturn $statement;\n\n}", "function _execQ($query, $param_strs, $params){\n $db = MySQLConnect::get_instance();\n $res = $db->prepare($query);\n \t array_unshift($params, $param_strs);\n call_user_func_array(array($res, 'bind_param'), $params);\n $bool = $res->execute();\n $sonuclar = $res->get_result();\n $rows = $sonuclar->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }", "public function query($query){\r\n $args = func_get_args();\r\n array_shift($args); //first element is not an argument but the query itself, should removed\r\n\r\n $reponse = parent::prepare($query);\r\n $reponse->execute($args);\r\n return $reponse;\r\n\r\n }", "public function exec(string $query, $values = [], $binds = '', bool $openConnection = true): bool;", "public function statement($query, $bindings = []);", "public function statement($query, $bindings = []);", "public function executeQuery($query, array $params = array());", "function db_execute($query)\n {\n /*\n * Execute the Query\n */\n $this->varifysql($query[\"SQL\"]);\n return $this->get_conn()->query($query[\"SQL\"], PDO::FETCH_ASSOC);\n }", "public function execute($query);", "function executeQuery($query);", "abstract public function executeS($query, $array = true);", "public function prepareAndExecute (PDO $connection, string $query, array $params = []);", "abstract public function execute($query);", "function execute_params($sql, $param_array)\n\t{\n\t\t// Using an empty string as stmtname here overwrites any\n\t\t// previous prepared statement making multiple prepares\n\t\t// easily doable\n\t\t$q = pg_prepare($this->connection, '', $sql);\n\t\t$q = pg_execute($this->connection, '', $param_array);\n\t\t$rows = array();\n while($r = pg_fetch_array($q, null, PGSQL_ASSOC))\n {\n array_push($rows, $r);\n }\n\t\tpg_free_result($q);\n\n\t\treturn $rows;\n\t}", "final public function executeQuery($query,$dataArray=array()) {\r\n \t$sqlQuery=$query;\r\n \tif(count($dataArray)!=0) {\r\n\t \t$sqlQuery=$this->buildQuery($query,$dataArray);\r\n\t }\r\n \treturn $this->execute($sqlQuery);\r\n\t}", "public function preparedQuery( $query, array $_binds )\n\t{\n\t\t/* Init Bind object */\n\t\t$bind = new Db\\Bind();\n\t\t\n\t\t/* Sort out subqueries */\n\t\t$binds = array();\n\t\t$i = 0;\n\t\tforeach ( $_binds as $bindVal )\n\t\t{\n\t\t\t$i++;\n\t\t\tif ( $bindVal instanceof \\IPS\\Db\\Select )\n\t\t\t{\n\t\t\t\t$pos = 0;\n\t\t\t\tfor ( $j=0; $j<$i; $j++ )\n\t\t\t\t{\n\t\t\t\t\t$pos = mb_strpos( $query, '?', $pos ) + 1;\n\t\t\t\t}\n\t\t\t\t$query = mb_substr( $query, 0, $pos - 1 ) . $bindVal->query . mb_substr( $query, $pos );\n\t\t\t\t$i--;\n\t\t\t\t\n\t\t\t\tforeach ( $bindVal->binds as $v )\n\t\t\t\t{\n\t\t\t\t\t$binds[] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$binds[] = $bindVal;\n\t\t\t}\n\t\t}\n\n\t\t/* Loop values to bind */\n\t\t$i = 0;\n\t\t$longThreshold = 1048576;\n\t\t$sendAsLong = array();\n\t\tforeach ( $binds as $bindVal )\n\t\t{\n\t\t\tif( ( is_object( $bindVal ) OR is_string( $bindVal ) ) AND \\strlen( (string) $bindVal ) > $longThreshold )\n\t\t\t{\n\t\t\t\t$sendAsLong[ $i ] = (string) $bindVal;\n\t\t\t}\n\n\t\t\t$i++;\n\t\t\tswitch ( gettype( $bindVal ) )\n\t\t\t{\n\t\t\t\tcase 'boolean':\n\t\t\t\tcase 'integer':\n\t\t\t\t\t$bind->add( 'i', $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'double':\n\t\t\t\t\t$bind->add( 'd', $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcase 'string':\n\t\t\t\t\t$bind->add( 's', ( \\strlen( $bindVal ) > $longThreshold ) ? NULL : $bindVal );\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'object':\n\t\t\t\t\tif( method_exists( $bindVal, '__toString' ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bind->add( 's', ( \\strlen( $bindVal ) > $longThreshold ) ? NULL : (string) $bindVal );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Deliberately no break\n\t\t\t\t\t\n\t\t\t\tcase 'NULL':\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'resource':\n\t\t\t\tcase 'unknown type':\n\t\t\t\tdefault:\n\t\t\t\t\t/* For NULL values, you can't bind, so we adjust the query to actually pass a NULL value */\n\t\t\t\t\t$pos = 0;\n\t\t\t\t\tfor ( $j=0; $j<$i; $j++ )\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos = mb_strpos( $query, '?', $pos ) + 1;\n\t\t\t\t\t}\n\t\t\t\t\t$query = mb_substr( $query, 0, $pos - 1 ) . 'NULL' . mb_substr( $query, $pos );\n\t\t\t\t\t$i--;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t/* Log */\n\t\tif ( \\IPS\\QUERY_LOG )\n\t\t{\t\n\t\t\t/* Replace ?s with the actual values */\n\t $logQuery = $query;\n\t foreach ( $binds as $b )\n\t {\n\t\t $logQuery = preg_replace( '/\\?/', var_export( $b, TRUE ), $logQuery, 1 );\n\t }\n\t \n\t\t\t/* Log */\n\t\t\t$this->log( $logQuery );\t\n\t\t}\n\t\t\n\t\t/* Add a backtrace to the query so we know where it came from if it causes issues */\n\t\t$comment = '??';\n\t\t$line = '?';\n\t\tforeach( debug_backtrace( FALSE ) as $b )\n\t\t{\n\t\t\tif ( isset( $b['line'] ) )\n\t\t\t{\n\t\t\t\t$line = $b['line'];\n\t\t\t}\n\t\t\t\n\t\t\tif( isset( $b['class'] ) and $b['class'] !== 'IPS\\_Db' and $b['class'] !== 'IPS\\Db\\_Select' )\n\t\t\t{\n\t\t\t\t$comment = \"{$b['class']}::{$b['function']}:{$line}\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$_query = $query;\n\t\t$query = \"/*{$comment}*/ {$query}\";\n\t\t\t\t\n\t\t/* Prepare */\n\t\t$stmt = parent::prepare( $query );\n\t\tif( $stmt === FALSE )\n\t\t{\n\t\t\tthrow new \\IPS\\Db\\Exception( $this->error, $this->errno, NULL, $_query, $binds );\n\t\t}\n\t\t\n\t\t/* Bind values */\n\t\tif( $bind->haveBinds() === TRUE )\n\t\t{\n\t\t\tcall_user_func_array( array( $stmt, 'bind_param' ), $bind->get() );\n\n\t\t\tif( count( $sendAsLong ) )\n\t\t\t{\n\t\t\t\tforeach( $sendAsLong as $index => $data )\n\t\t\t\t{\n\t\t\t\t\t$chunks = str_split( $data, $longThreshold - 1 );\n\n\t\t\t\t\tforeach( $chunks as $chunk )\n\t\t\t\t\t{\n\t\t\t\t\t\t$stmt->send_long_data( $index, $chunk );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Execute */\n\t\t$stmt->execute();\t\t\n\t\tif ( $stmt->error )\n\t\t{\n\t\t\tthrow new \\IPS\\Db\\Exception( $stmt->error, $stmt->errno, NULL, $_query, $binds );\n\t\t}\n\t\t$stmt->store_result();\n\t\t\t\t\t\t\n\t\t/* Return a Statement object */\n\t\treturn $stmt;\n\t}", "function execute_prepared_query($prep_q, $bound_vars, $bound_var_types, $result_expected = false)\n{\n\tglobal $spebs_db;\n\t$pstmt = $spebs_db -> prepare($prep_q);\t\n\tif($spebs_db->errno != 0)\n\t{\n\t\terror_log(\"PREPARE STATEMENT error \".$spebs_db->errno.\": \".$spebs_db->error.\" (Q = \\\"$prep_q\\\")\");\n\t\treturn false;\n\t}\n\t\n\t$bound_varrefs = array();\n\t$bound_varrefs[0] = $bound_var_types;\n\t$i=1;\n\tforeach($bound_vars AS $thisvar)\n\t{\t\n\t\t${\"x$i\"} = $thisvar;\n\t\t$bound_varrefs[$i] = &${\"x$i\"};\n\t\t$i++;\n\t}\n\t$bind_action = call_user_func_array(array($pstmt, 'bind_param'), $bound_varrefs);\n\tif(!$bind_action)\n\t{\t\n\t\terror_log(\"CALL_USER_FUNC_ARRAY error \");\n\t\treturn false;\n\t}\n\tif($pstmt->errno != 0)\n\t{\n\t\terror_log(\"PREPARED QUERY BIND error \".$pstmt->errno.\": \".$pstmt->error);\n\t\treturn false;\n\t}\t\n\tif($pstmt -> execute())\n\t{\n\t\tif(!$result_expected)\n\t\t{\n\t\t\tif(isset($pstmt -> insert_id) && is_int($pstmt -> insert_id) && $pstmt -> insert_id > 0)\n\t\t\t\t$res = $pstmt -> insert_id;\n\t\t\telse\n\t\t\t\t$res = true;\n\t\t\t\t\n\t\t\t$pstmt -> close();\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$results = array();\n\t\t\t$row = array();\n\t\t\t$metadata = $pstmt -> result_metadata();\n\t\t\tforeach($metadata -> fetch_fields() AS $field)\n\t\t\t{\t\n\t\t\t\t$row[$field -> name] = NULL;\n\t\t\t\t$bound_resrefs[] = &$row[$field -> name];\n\t\t\t}\n\t\t\t$bind_action = call_user_func_array(array($pstmt, 'bind_result'), $bound_resrefs);\n\t\t\t$i = 0;\n\t\t\twhile($pstmt -> fetch())\n\t\t\t{\t\n\t\t\t\tforeach($row AS $k => $v)\n\t\t\t\t$results[$i][$k] = $v;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t$pstmt -> close();\n\t\t\treturn $results;\n\t\t}\n\t\t\n\t}\n\telse\n\t{\n\t\terror_log($pstmt->errno.\": \".$pstmt->error);\n\t\t$pstmt -> close();\t\n\t\treturn false;\n\t}\n}", "public function query($rawQuery, $param = array()){\n \n $stmt = $this->conn->prepare($rawQuery);\n \n $this->setParams($stmt, $param);\n \n $stmt->execute();\n \n return $stmt;\n \n}", "private function ExecuteQuery()\n\t{\n\t\tswitch($this->querytype)\n\t\t{\n\t\t\tcase \"SELECT\":\n\t\t\t{\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$this->querydata = $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"INSERT\":\n\t\t\tcase \"UPDATE\":\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->beginTransaction();\n\t\t\t\t\t$this->stmt->execute();\n\t\t\t\t\t$this->commit();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (PDOException $e)\n\t\t\t\t{\n\t\t\t\t\t$this->rollBack();\n\t\t\t\t\techo(\"Query failed: \" . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function runPreparedQuery($query, $params_r)\n {\n $stmt = $this->connection->prepare($query);\n $this->bindParameters($stmt, $params_r);\n\n if ($stmt->execute()) {\n return $stmt;\n } else {\n echo(\"Error in $query: \"\n . $this->connection->error);\n return 0;\n }\n\n }", "public function rawExecute(array $param = array('query'=>'','arrData'=>[])) {\n $qry = isset($param['query']) ? $param['query'] : '';\n $arrData = isset($param['arrData']) ? $param['arrData'] : [];\n\n if( empty( $qry ) ) {\n echo \"missing query\";\n die;\n }\n \n $insert_values = [];\n\n if( !empty( $qry ) ) {\n $countQuestionMarks = 0;\n\n foreach( $qry AS $char ) {\n if( $char == \"?\" )\n $countQuestionMarks++;\n }\n\n if( count($arrData) == $countQuestionMarks ) {\n echo \"data count doesn't match with column count.\";\n die;\n }\n\n if( count( $arrData ) ) {\n $insert_values = $arrData;\n }\n }\n\n $strQry = $qry;\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n\n if( count( $insert_values ) ) {\n $executed = $this->stmt->execute($insert_values);\n } else {\n $executed = $this->stmt->execute();\n }\n \n if( $executed ) {\n echo 'query executed successfully.';\n } else {\n echo 'fails to truncate table';\n }\n \n $this->stmt = null;\n die;\n }", "function dbh_query_bind( $sql ) {\n if ( isset( $GLOBALS['orm_dbh'] ) ) $use_dbh = $GLOBALS['orm_dbh'];\n if ( ORM_SQL_PROFILE ) START_TIMER('dbh_query_bind');\n $bind_params = array_slice( func_get_args(), 1 );\n ### Allow params passed in an array or as args\n if ( is_a( $bind_params[ count($bind_params) - 1 ], 'PDO' ) || is_a( $bind_params[ count($bind_params) - 1 ], 'PhoneyPDO' ) ) $use_dbh = array_pop($bind_params);\n if ( ! isset( $GLOBALS['orm_dbh'] ) ) $GLOBALS['orm_dbh'] = $use_dbh; # steal their DBH for global use, hehehe\n if ( count( $bind_params ) == 1 && is_array(array_shift(array_values($bind_params))) ) { $bind_params = array_shift(array_values($bind_params)); };\n# if (ORM_SQL_DEBUG) trace_dump();\n reverse_t_bools($bind_params);\n if (ORM_SQL_DEBUG) bug($sql, $bind_params);\n try { \n $sth = $use_dbh->prepare($sql);\n $rv = $sth->execute($bind_params);\n } catch (PDOException $e) {\n trace_dump();\n $err_msg = 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line();\n if ( strlen($err_msg) > 1024 ) {\n bug($err_msg,$sql,$bind_params,$e->getMessage());\n $sql = substr($sql,0,1020 + strlen($sql) - strlen($err_msg) ).'...';\n }\n trigger_error( 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line(), E_USER_ERROR);\n return false;\n }\n if ( ORM_SQL_PROFILE ) END_TIMER('dbh_query_bind');\n return $sth;\n }", "protected abstract function executeQuery($query);", "public function exec($prepared_values = null) {\n if (!empty($this->_parts['query'])) {\n $res = null;\n foreach($this->_parts['query'] as $one) {\n $res = $this->_connection->query($one);\n }\n $this->_parts['query'] = array();\n return $res;\n }\n return $this->_connection->processQuery($this);\n }", "abstract function executeQuery($cons);", "function query() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\t$sql = array_shift($args);\r\n\t\t\tforeach ($args as $key => $value)\r\n\t\t\t\t$args[$key] = $this->clean($value);\r\n\t\t\treturn mysql_query(vsprintf($sql, $args));\r\n\t\t}", "public function execute($sql, $bind){\n $sth = $this->db->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n /* example:\n $bind = array(':calories' => 150, ':colour' => 'red');\n */\n return $sth->execute($bind);\n }", "public function execute()\n\t{\n\t\t$this->arrParams = func_get_args();\n\n\t\tif (is_array($this->arrParams[0]))\n\t\t{\n\t\t\t$this->arrParams = array_values($this->arrParams[0]);\n\t\t}\n\n\t\treturn $this->query();\n\t}", "function dbQuery($sql, $array = []){\r\n global $db_connection, $db_query;\r\n\r\n $db_query = $db_connection->prepare($sql);\r\n\r\n return $db_query->execute($array);\r\n}", "public function execQuery($query, $params, $types = NULL)\n\t\t{\n\t\t\tif(!is_array($params))\n\t\t\t\ttrigger_error(\"params is not an array in db::execQuery()\");\n\t\t\t\n\t\t\t$stmt = $this->dbHandler->prepare($query);\n\t\t\tif(!$stmt)\n\t\t\t\ttrigger_error(\"invalid query in db::execQuery()\");\n\t\t\t\n\t\t\t#data types are given - we must use bindParam() method\n\t\t\tif($types !== NULL)\n\t\t\t{\n\t\t\t\tif(count($params) != strlen($types))\n\t\t\t\t\ttrigger_error(\"db::execQuery params lenght error\");\n\t\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($params as $key => & $value)\n\t\t\t\t{\n\t\t\t\t\t$stmt->bindParam($key, $value, $this->getDataType($types[$i]));\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t#execution\n\t\t\t\t$stmt->execute();\n\t\t\t}\n\t\t\t#no need to use bindParam() method\n\t\t\telse\n\t\t\t\t$stmt->execute($params);\n\t\t\t\n\t\t\t#check for stmt errors\n\t\t\tif($stmt->errorCode() !== '00000')\n\t\t\t{\n\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\ttrigger_error(\"db error: \".$error[0].\" --- \".$error[1].\" --- \".$error[2]);\n\t\t\t}\n\t\t\treturn $stmt;\n\t\t}", "function _query($sql,$inputarr=false)\n\t{\n\t\t$this->_pnum = 0;\n\t\t$this->_errorMsg = false;\n\t\tif ($inputarr) {\n\t\t/*\n\t\t\tIt appears that PREPARE/EXECUTE is slower for many queries.\n\n\t\t\tFor query executed 1000 times:\n\t\t\t\"select id,firstname,lastname from adoxyz\n\t\t\t\twhere firstname not like ? and lastname not like ? and id = ?\"\n\n\t\t\twith plan = 1.51861286163 secs\n\t\t\tno plan = 1.26903700829 secs\n\t\t*/\n\t\t\t$plan = 'P'.md5($sql);\n\n\t\t\t$execp = '';\n\t\t\tforeach($inputarr as $v) {\n\t\t\t\tif ($execp) $execp .= ',';\n\t\t\t\tif (is_string($v)) {\n\t\t\t\t\tif (strncmp($v,\"'\",1) !== 0) $execp .= $this->qstr($v);\n\t\t\t\t} else {\n\t\t\t\t\t$execp .= $v;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($execp) $exsql = \"EXECUTE $plan ($execp)\";\n\t\t\telse $exsql = \"EXECUTE $plan\";\n\n\n\t\t\t$rez = @pg_execute($this->_connectionID,$exsql);\n\t\t\tif (!$rez) {\n\t\t\t# Perhaps plan does not exist? Prepare/compile plan.\n\t\t\t\t$params = '';\n\t\t\t\tforeach($inputarr as $v) {\n\t\t\t\t\tif ($params) $params .= ',';\n\t\t\t\t\tif (is_string($v)) {\n\t\t\t\t\t\t$params .= 'VARCHAR';\n\t\t\t\t\t} else if (is_integer($v)) {\n\t\t\t\t\t\t$params .= 'INTEGER';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$params .= \"REAL\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sqlarr = explode('?',$sql);\n\t\t\t\t//print_r($sqlarr);\n\t\t\t\t$sql = '';\n\t\t\t\t$i = 1;\n\t\t\t\tforeach($sqlarr as $v) {\n\t\t\t\t\t$sql .= $v.' $'.$i;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$s = \"PREPARE $plan ($params) AS \".substr($sql,0,strlen($sql)-2);\n\t\t\t\t//adodb_pr($s);\n\t\t\t\t$rez = pg_execute($this->_connectionID,$s);\n\t\t\t\t//echo $this->ErrorMsg();\n\t\t\t}\n\t\t\tif ($rez)\n\t\t\t\t$rez = pg_execute($this->_connectionID,$exsql);\n\t\t} else {\n\t\t\t//adodb_backtrace();\n\t\t\t$rez = pg_query($this->_connectionID,$sql);\n\t\t}\n\t\t// check if no data returned, then no need to create real recordset\n\t\tif ($rez && pg_num_fields($rez) <= 0) {\n\t\t\tif (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') {\n\t\t\t\tpg_free_result($this->_resultid);\n\t\t\t}\n\t\t\t$this->_resultid = $rez;\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $rez;\n\t}", "public function execute($sql, $params = array());", "function executeSQL($container, $response, $sql, ...$args) {\n $db = $container['db'];\n $logger = $container['logger'];\n $query = $db->prepare($sql);\n foreach ($args as $arg) {\n $query->bindValue($arg[0], $arg[1], $arg[2]);\n // like, $query->bindValue(':email', $email, PDO::PARAM_STR);\n }\n try {\n $query->execute();\n return $query;\n } catch(PDOException $e) {\n $logger->error(\"Database query execution error (\".$e->getCode().\"): \".$e->getMessage());\n throw new ApiException(\"Database query execution error (\".$e->getCode().\"): \".$e->getMessage(),500);\n }\n// return $query;\n}", "function callQuery($sql, $paramArray = NULL, $datatypeArray = NULL)\n {\n $sth = $this->dbhandle->prepare($sql);\n \n if( isset( $paramArray ) )\n Database::bind_params($sth, $paramArray, $datatypeArray);\n \n $sth->execute();\n if( $this->dbhandle->errorCode() <> '00000' ){\n $_mysqlErrorInfo = $this->dbhandle->errorInfo();\n throw new PDOException(\"Database::callSQL() error: \" . $_mysqlErrorInto[2]);\n }\n \n return $sth->fetchAll(PDO::FETCH_ASSOC);\n }", "public static function execute()\n {\n //bind params\n foreach ( self::$_BINDS as $k => $_b ):\n $type = \\PDO::PARAM_STR;\n if ( $_b['type'] ):\n $type = self::getDataType( $_b['type'] );\n endif;\n\n $length = NULL;\n if ( $_b['size'] ):\n $length = (int) $_b['size'];\n endif;\n $k++;\n self::$stmt->bindParam( $k, $_b['value'], $type, $length );\n endforeach;\n self::$_BINDS = array(); //reset\n return self::$stmt->execute();\n }", "function pdo_query(PDO $pdo, $query_string, $query_inputs = null)\n {\n $query_inputs = is_array($query_inputs) ? $query_inputs : array_slice(func_get_args(), 2);\n $prep = $pdo->prepare($query_string);\n $prep->execute((array) $query_inputs);\n return $prep;\n }", "public function query($rawQuery, $params = array()){\n\n $stmt = $this->conn->prepare($rawQuery);\n $this->setParams($stmt, $params);\n $stmt->execute();\n return $stmt;\n }", "function db_query ($query, array $parameters = array()) {\n $statement = db_connect()->prepare($query);\n $statement->execute($parameters);\n \n return $statement;\n}", "public function execute($query)\n {\n }", "function query_prepared($query, $param=null)\n { \n $stmt = $this->dbh->prepare($query);\n foreach ($param as $index => $val) {\n // indexing start from 1 in Sqlite3 statement\n if (is_array($val)) {\n $ok = $stmt->bindParam($index + 1, $val);\n } else {\n $ok = $stmt->bindValue($index + 1, $val, $this->getArgType($val));\n }\n \n if (!$ok) {\n $type_error = \"Unable to bind param: $val\";\n $this->register_error($type_error);\n $this->show_errors ? trigger_error($type_error,E_USER_WARNING) : null;\n return false;\n }\n }\n \n return $stmt->execute();\n }", "function executeQuery($qry, $arr = array())\n{\n global $db_lnk;\n $result = pg_query_params($db_lnk, $qry, $arr);\n if (pg_num_rows($result)) {\n return pg_fetch_assoc($result);\n } else {\n return false;\n }\n}", "function execute($sql, $vars) {\n\t\t$sth = $this->dbh->prepare($sql);\n\t\tif ($sth->execute($vars)) {\n\t\t return true;\n\t\t} else {\n $this->err($sth->errorInfo());\n return false;\n\t\t}\n }", "function execute_query() {\n $args = func_get_args();\n $args_count = func_num_args();\n if ($args_count == 1) {\n $sql = $args[0];\n }\n else {\n $sql = $args[0];\n }\n\n global $db_host, $db_user, $db_pass, $db_name;\n $conn = new mysqli($db_host, $db_user, $db_pass, $db_name);\n if ($conn->connect_errno) {\n echo T_(\"<h1>데이터베이스에 연결하던 도중 오류가 발생했습니다.</h1>\");\n exit;\n }\n $conn->query(\"SET time_zone = '+9:00'\");\n $stmt = $conn->prepare($sql);\n if ($args_count != 1) {\n $sliced = array_slice($args, 1);\n call_user_func_array(array($stmt, \"bind_param\"), make_values_referenced($sliced));\n }\n $stmt->execute();\n $stmt->store_result();\n\n if ($stmt->errno) {\n $stmt->close();\n $conn->close();\n return false; // error: false\n }\n else {\n $stmt->close();\n $conn->close();\n return true; // success: true\n }\n}", "public function query(...$bindings):PDOStatement\n {\n $sql = array_shift($bindings);\n\n //if i send bindings as one array ex:query('SELECT * FROM episodes WHERE id > ? AND id < ?', [1,5]);\n if (count($bindings) == 1 && is_array($bindings[0])) {\n $bindings = $bindings[0];\n }\n\n try {\n $query = $this->connectionDb()->prepare($sql);\n\n $query->setFetchMode(PDO::FETCH_CLASS, static::class);\n\n foreach ($bindings as $key => $value) {\n $query->bindValue($key + 1, _escape($value));\n }\n $query->execute();\n\n return $query;\n\n } catch (PDOException $e) {\n echo $sql;\n\n pre($this->bindings,0);\n\n die($e->getMessage());\n }\n }", "public function query($query, $binds)\n {\n $sql = $this->connection->prepare($query);\n\n if (count($binds)) {\n foreach ($binds as $key => &$bind) {\n $sql->bindParam($key + 1, $bind);\n }\n }\n\n if ($sql->execute()) {\n return $sql;\n } else {\n throw new Exception(\"Something went wrong\");\n }\n }", "public function execute(array $input_parameters = array())\r\n\t{\r\n\t\t$queryString = $this->queryString;\r\n\t\t\r\n\t\tif(count($input_parameters) > 0)\r\n\t\t{\r\n\t\t\tif(count($this->parameters) > 0 || count($this->parametersBound) > 0)\r\n\t\t\t{\r\n\t\t\t\tthrow new LikePDOException(\"There is have parameters bound\");\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\tforeach($input_parameters as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = is_int($param) ? intval($param) : $this->pdo->quote($param, LikePDO::PARAM_STR);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(is_int($key))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$position = strpos($queryString, \"?\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!strstr($queryString, \"?\"))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tthrow new LikePDOException(\"Statement: Too few parameters\");\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\t\r\n\t\t\t\t\t\t$queryString = substr_replace($queryString, $value, $position, 1);\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$queryString = str_replace($key, $value, $queryString);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(count($this->parametersBound) > 0)\r\n\t\t{\r\n\t\t\tforeach($this->parametersBound as $key => $param)\r\n\t\t\t{\r\n\t\t\t\t$value = $this->pdo->quote($param['variable'], $param['data_type']);\r\n\t\t\t\t\r\n\t\t\t\tif(is_int($key))\r\n\t\t\t\t{\r\n\t\t\t\t\t$position = strpos($queryString, \"?\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!strstr($queryString, \"?\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Statement: Too few parameters\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$queryString = substr_replace($queryString, $value, $position, 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$queryString = str_replace($key, $value, $queryString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(count($this->parameters) > 0)\r\n\t\t{\r\n\t\t\tforeach($this->parameters as $key => $param)\r\n\t\t\t{\r\n\t\t\t\t$value = $this->pdo->quote($param['value'], $param['data_type']);\r\n\t\t\t\t\r\n\t\t\t\tif(is_int($key))\r\n\t\t\t\t{\r\n\t\t\t\t\t$position = strpos($queryString, \"?\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!strstr($queryString, \"?\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthrow new LikePDOException(\"Statement: Too few parameters\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$queryString = substr_replace($queryString, $value, $position, 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$queryString = str_replace($key, $value, $queryString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->resource = $this->pdo->driver->query($queryString);\r\n\t\t$this->executed = true;\r\n\t\t$this->rowsAffected = $this->pdo->driver->getRowsAffected();\r\n\t\t$this->columnCount = $this->pdo->driver->getNumFields($this->resource);\r\n\t\t\r\n\t\tif(!$this->resource)\r\n\t\t{\r\n\t\t\t$this->failed = true;\r\n\t\t\t\r\n\t\t\t$this->errorCode = $this->pdo->errorCode();\r\n\t\t\t$this->errorInfo = $this->pdo->errorInfo();\r\n\t\t\t\r\n\t\t\tnew LikePDOException(\"Failed to execute the query \".$this->queryString);\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function query($rawquery, $params = [])\r\n {\r\n $stmt = $this->conn->prepare($rawquery);\r\n\r\n $this->setParams($stmt, $params);\r\n \r\n $stmt->execute();\r\n\r\n return $stmt;\r\n }", "function query($stmt,$values) {\n\t\ttry {\n\t\t $qStmt = $this->dbconn->prepare($stmt);\n\t\t\t$qStmt->execute($values);\n\t\t\treturn $qStmt->fetchAll();\n\t\t} catch(PDOException $e) {\n\t\t\treturn $e;\n\t\t}\n\t}", "public function exec_qry($sql_to_prep, $array_qry_vals = \"\") {\n \t$type = \"Query\";\n \t$loca = \"exec_qry\";\n \ttry {\n \t\t// $array_qry_vals =somethinglike= array(':calories' => 150, ':color' => 'red');\n \t\t$this->lastQuery = $sql_to_prep;\n \t\t// sth = statement handler\n \t\t$sth = $this->pdo->prepare($sql_to_prep);\n \t\t\n\t\tif (is_a($sth, \"PDOStatement\")){\n \t\t\t// best pass ary params (not: $sth->bindParam(':var', $cals);)\n \t\t\tif (empty($array_qry_vals)) {\n \t\t\t\t$sth->execute();\n \t\t\t\treturn $sth; // success return statement handler\n \t\t\t}\n \t\t\t$sth->execute($array_qry_vals);\n \t\t\treturn $sth; // success return statement handler\n \t\t} else { // FAIL\n \t\t\t// statement failed\n \t\t\t$reas = \"Error with statement\";\n \t\t\t$code = $sql_to_prep;\n \t\t\t$this->db_fail($type, $loca, $reas, $code);\n \t\t}\n \t} catch (PDOException $e) { // FAIL\n \t\t$reas = \"PDOException\";\n \t\t$code = $sql_to_prep . \"<br />\" . $e->getMessage(). \"<br />\";\n \t\t$this->db_fail($type, $loca, $reas, $code);\n \t} /* DEBUG CATCH FINALLY catch (Exception $e) {\n \t\t$reas = \"Gen. Exception\"; // FAIL\n \t\t$code = $sql_to_prep . \"<br />\" . $e->getMessage(). \"<br />\";\n \t\t$this->db_fail($type, $loca, $reas, $code);\n \t} finally { // FAIL (Unanticipated)\n \t\t// success: \n \t\t // Error Code: 00000\n\t\t//\tError Info: \tArray([0] => 00000...\n \t\t\n \t\t$reas = \"try may have failed finally\";\n \t\t$code = $sql_to_prep;\n \t\t$this->db_fail($type, $loca, $reas, $code);\n \t\t\n \t} *** END DEBUG CATCH FINALLYwithin exec_qry */\n }", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n}", "abstract public function exec($query='');", "public function execute($query) {\n\t\t$args = func_get_args();\n\n\t\tif (count($args) == 1) {\n\t\t\t$sql = $query;\n\t\t} else {\n\t\t\t$sql = call_user_func_array(array($this, 'quoteInto'), $args);\n\t\t}\n\n\t\t$statement = $this->zendDb()->query($sql);\n\n\t\treturn $statement ? true : false;\n\t}", "public function executePreparedQuery($rq, &$args) {\n $rqType = explode(' ', $rq);\n $stmt = $this->con->prepare($rq);\n\n foreach ($args as $k => $v) {\n $stmt->bindValue($k + 1, $v);\n }\n $stmt->execute();\n if ($this->debug)\n {\n error_log(serialize($stmt->errorInfo()));\n }\n if (preg_match(\"/insert|delete|update/\", strtolower($rqType[0]))) {\n return $stmt->rowCount();\n } else {\n return $stmt->fetchall();\n }\n }", "public function query($sql, $arguments = array());", "public function doQuery($sql, $params);", "public function execute()\n {\n $query = $this->__toString();\n if (!empty($this->params)) {\n $statement = $this->pdo->prepare($query);\n $statement->execute($this->params);\n return $statement;\n }\n return $this->pdo->query($query);\n }", "public function execute( array $bindParams = array() ){\n return $this->stmt->execute( $bindParams );\n }", "public function lsDbQuery($sql, $bindValues=array())\n {\n $this->lsDb->query($sql, $bindValues);\n }", "abstract public function query($sql, $execute =FALSE);", "public function query($statement, array $parameters = null);", "private function query()\n {\n $lStart = microtime(true);\n\n //arguments should be query (with placeholders) followed by an array of key-value pairs\n $args = func_get_args();\n $args = array_shift($args);\n $query = array_shift($args);\n $params = $args ? array_shift($args) : [];\n\n $sth = $this->pdo->prepare($query);\n if (!$sth) {\n //prepare failed\n $this->handlePrepareError($sth, $query, $params);\n }\n\n //explicitly bind parameters as int/string so IN() doens't get quoted\n foreach ($params as $key => $value) {\n if (is_numeric($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_INT);\n } elseif (is_bool($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_BOOL);\n } elseif (is_null($value)) {\n $sth->bindValue($key, $value, PDO::PARAM_NULL);\n } else {\n $sth->bindValue($key, $value, PDO::PARAM_STR);\n }\n }\n\n //query invalid\n if(!$sth->execute()) {\n $this->handleExecuteError($sth, $query, $params);\n }\n $this->queryTimer += microtime(true) - $lStart;\n $this->queryCount++;\n\n $query = preg_replace('/^\\s+/', '', $query);\n if(str_starts_with(strtolower($query), 'select')) {\n //return results for SELECT\n return $sth;\n\n } elseif(str_starts_with(strtolower($query), 'insert')) {\n //return insert id for INSERT\n $id = $this->pdo->lastInsertId();\n return ($id ?: true);\n\n } else {\n //return TRUE for DELETE, UPDATE\n //NB: don't return affected rows for UPDATE since 0 affected will be interpreted as query failed)\n return true;\n }\n }", "public function bindValuesToQuery($bindValues, $query) {\n\t \n\t\tforeach( $bindValues as $bind ) {\n\t\t\t$values = $bind;\n\t\t\t// Check value is string not time/date object\n\t\t\tif (is_string ( $values [1] )) {\n\t\t\t\t\n\t\t\t\t// Check for multiple comma seperated values\n\t\t\t\tif (strpos ( $values [1], ',' )) {\n\t\t\t\t\t$exValues = explode ( ',', $values [1] );\n\t\t\t\t\t$query->setParameter ( $values [0], $exValues );\n\t\t\t\t} else {\n\t\t\t\t\t// echo \"Binding at: \".$values[0]. \" With: \".$values[1]. \"\\n\\n\";\n\t\t\t\t\t$query->setParameter ( $values [0], $values [1] );\n\t\t\t\t}\n\t\t\t//If value was object bind it as is\t\n\t\t\t} else {\n\t\t\t\t$query->setParameter ( $values [0], $values [1] );\n\t\t\t}\n\t\t}\n\t\treturn $query;\n\t}", "public function query($sql, array $bind = array())\n {\n $sql = trim($sql);\n\n foreach ($bind as $name => $value) {\n if (!is_int($name) && strpos($name, ':') !== 0) {\n unset($bind[$name]);\n $bind[':' . $name] = $value;\n }\n }\n\n $connection = $this->getConnection();\n\n $stmt = $connection->prepare($sql);\n $return = $stmt->execute($bind);\n\n if (stripos($sql, 'SELECT') === 0) {\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $return = $stmt->fetchAll();\n } else if (stripos($sql, 'INSERT') === 0) {\n $return = $connection->lastInsertId();\n }\n\n return $return;\n }", "public function execute($args = array())\n {\n foreach($args as $key => $value) {\n oci_bind_by_name($this->statement, \":\" . $key, $args[$key]);\n }\n return oci_execute($this->statement, OCI_DEFAULT);\n }", "function queryExecute($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in queryExecute function\",E_ERROR);\r\n\t\t}\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\r\n\t\tif($this->socket->query($query) === true) {\r\n\t\t\t$this->recordsUpdated = $this->socket->affected_rows;\r\n\t\t}\r\n\t}", "public function query_execute($query, $values) {\n $link = $this->open_database_connection();\n \n //check if the values is null\n //means it is an select query with no values\n if(empty($values)) {\n $result = $link->query($query);\n }\n else {\n\n //TODO: validation for insert\n $result = $link->prepare($query);\n foreach($values as $key => $val) {\n $result->bindParam($key, $values[$key]);\n }\n \n $this->t = $result->execute();\n }\n\n //fetch row(s) if the query is select\n $select = substr($query, 0, 6);\n if($select === \"SELECT\" || $select === \"select\") {\n while($row = $result->fetch(PDO::FETCH_ASSOC)) {\n $data[] = $row;\n }\n }\n else {\n $data = NULL;\n }\n\n //save last insert id\n $this->lastId = $link->lastInsertId();\n\n $this->close_database_connection($link);\n return $data;\n }", "static public function execute($query, $parameters = array()){\n\t\t\tglobal $connection;\n\t\t\t// echo \"<br>$query<br>\";\n\t\t\t// var_dump($parameters);\n\t\t\t//PDO query building and execution\n\t\t\ttry {\n\t\t\t\t$stmt = $connection->prepare($query);\n\t\t\t\tforeach ($parameters as $key => $value) {\n\t\t\t\t\t//echo \"PREPARE: $key------>$value<br/>\";\n\t\t\t\t\t$stmt->bindValue(\":$key\", $value);\n\t\t\t\t}\n\t\t\t\t$stmt->execute();\n\t\t\t\treturn $stmt?$stmt:false;//return $stmt is successful, false otherwise\n\t\t\t} catch (PDOException $e) {\n\t\t\t\techo \"QueryBuilder PDO error: \". $e->getMessage();\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "function Query($query, $array = []) {\n\t\t\t$this->ConnectServer();\n\t\t\ttry {\n\n\t\t\t\t$this->result = pg_query_params($this->connection, $query, $array);\n\t\t\t\t$this->last_query = 1;\n\t\t\t\tif(!$this->result) {\n\t\t\t\t\tthrow new Exception(\"ERROR SQL Syntax or Execution: (ID Query:$this->queryCount): $query\");\n\t\t\t\t\t$this->last_query = 0;\n\t\t\t\t}\n\t\t\t} catch(Exception $e) {\n\t\t\t\t//echo $e->getMessage();\n\t\t\t\t$this->last_query = 0;\n\t\t\t\techo(\"<script>alert('ERROR: Query: $query - Last error: \".pg_last_error().\" - Terms: \".json_encode($array).\"');</script>\");\n\t\t\t}\n\t\t\t$this->queryCount++;\n\t\t\t$this->DisconnectServer();\n\t\t\t$this->result;\n\t\t}", "public function query($stmt_string, $types, $array_of_bindings) {\n\t\tif (!($conn = $this->connect())) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!($stmt = $conn->prepare($stmt_string))) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor ($i = 0; $i < count($array_of_bindings); $i++) {\n\t\t\t$bind_name = 'bind' . $i;\n\t\t\t$$bind_name = $array_of_bindings[$i];\n\t\t\t$bind_names[] = &$$bind_name;\n\t\t}\n\n\t\tif (!call_user_func_array(array($stmt, \"bind_param\"), array_merge(array($types), $bind_names))) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!($result = $stmt->execute())) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt->close();\n\t\treturn $result;\n\t}", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statement handle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n return $statement;\n\n}", "public function execute($sql);", "public function execute($sql);", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "private function Execute($sql, array $parameters = null){\n\t\t$this->statement = $this->connection->prepare($sql);\n\t\tif($parameters !== null){\n\t\t\tforeach($parameters as $key => $value){\n\t\t\t\t$this->statement->bindValue($key, $value, $this->GetType($value));\n\t\t\t}\n\t\t}\n\n\t\treturn $this->statement->execute();\n\t}", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse this command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); // Make sure you do not remove this.\n // Otherwise, $val will remain in an \n // array object wrapper which will not \n // be recognized by Oracle as a proper\n // datatype.\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute this command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement);\n // For OCIExecute errors pass the statement handle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "private function RunAdvancedQuery($named_parameter_array, $insert = false) {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database, using the named parameters\n $this->stmt->execute($named_parameter_array);\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n //if we are not inserting or updating the database\n if($insert == false) {\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n }\n \n // Free the statement\n $this->stmt->closeCursor(); \n }", "function sql_query($query, $values = array(), $fetchMode = PDO::FETCH_ASSOC) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\n\t$preparedQuery = $query;\n\tsql_dump($preparedQuery . (sizeof($values) ? ' with ' . print_r($values, true) : ''));\n\n\t$q = $sql->prepare($query);\n\t$result = $q->execute($values);\n\tif( $fetchMode != null ){\n\t\t$res = $q->fetchAll($fetchMode);\n\t\t$q->closeCursor();\n\t}else{\n\t\t$q->closeCursor();\n\t\treturn $result;\n\t}\n\tif( sizeof($res) == 0 ){\n\t\treturn false;\n\t}\n\treturn $res;\n}", "private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $oraconn, $success;\n\t$statement = OCIParse($oraconn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($oraconn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n\n}", "function executeBoundSQL($cmdstr, $list) {\r\n\r\n\t\t\tglobal $db_conn, $success;\r\n\t\t\t$statement = OCIParse($db_conn, $cmdstr);\r\n\r\n if (!$statement) {\r\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\r\n $e = OCI_Error($db_conn);\r\n echo htmlentities($e['message']);\r\n $success = False;\r\n }\r\n\r\n foreach ($list as $tuple) {\r\n foreach ($tuple as $bind => $val) {\r\n //echo $val;\r\n //echo \"<br>\".$bind.\"<br>\";\r\n OCIBindByName($statement, $bind, $val);\r\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\r\n\t\t\t\t}\r\n\r\n $r = OCIExecute($statement, OCI_DEFAULT);\r\n if (!$r) {\r\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\r\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\r\n echo htmlentities($e['message']);\r\n echo \"<br>\";\r\n $success = False;\r\n }\r\n }\r\n }", "public function query($sql = null)\r\n {\r\n if (is_null($sql))\r\n $sql = $this->buildSql();\r\n //var_dump($sql);\r\n $this->sth = $this->db->prepare($sql);\r\n if (is_null($this->binds))\r\n $result = $this->sth->execute();\r\n else \r\n $result = $this->sth->execute($this->binds);\r\n }", "public function query ($sql, $bind = array())\n {\n if (empty($bind) && is_object($sql) && method_exists($sql, 'getBind'))\n\t\t{\n $bind = $sql->getBind();\n }\n\n if (is_array($bind))\n\t\t{\n foreach ($bind as $name => $value)\n\t\t\t{\n if (! is_int($name) && ! preg_match('/^:/', $name))\n\t\t\t\t{\n $newName = \":$name\";\n\n unset($bind[$name]);\n\n $bind[$newName] = $value;\n }\n }\n }\n\n try\n {\n return parent::query($sql, $bind);\n }\n catch (Exception $e)\n {\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n throw new EhrlichAndreas_Db_Exception($e->getMessage(), $e->getCode(), $e);\n }\n }", "function exec_sql( $sql, $binds = '' ){\n $time_start = microtime(true);\n\n $cur = oci_parse( $this->conn, $sql );\n #\n # Any binds?\n #\n if( $binds ){\n foreach( $binds as $bind_rec ){\n $this->sql_details[] = '-- bind : ' . $bind_rec[0] . ' val : ' . $bind_rec[1];\n #\n # What type of bind\n #\n if( is_numeric( $bind_rec[1] ) ) $bind_type = ' number';\n else{\n $var_length = strlen($bind_rec[1]);\n if( $var_length === 0 ) $var_length = 1;\n $bind_type = \" varchar2($var_length)\";\n }\n $this->sql_details[] = 'var ' . ltrim($bind_rec[0],':') . $bind_type;\n $this->sql_details[] = 'exec ' . $bind_rec[0] .\" := '\". $bind_rec[1] .\"';\";\n oci_bind_by_name( $cur, $bind_rec[0], $bind_rec[1] );\n }\n }\n \n $this->sql_details[] = $sql . ';';\n $this->exec_catch( $cur ); \n\n $this->sql_details[] = '-- Parse and excec time (secs) : ' . number_format( microtime(true) - $time_start, 4 );\n $this->sql_details[] = '--------------------------------';\n return $cur;\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\t\t\tglobal $db_conn, $success;\n\t\t\t$statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\t\t\t\t}\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n }", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n }", "function dbh_do_bind( $sql ) {\n if ( isset( $GLOBALS['orm_dbh'] ) ) $use_dbh = $GLOBALS['orm_dbh'];\n if ( ORM_SQL_PROFILE ) START_TIMER('dbh_do_bind');\n $bind_params = array_slice( func_get_args(), 1 );\n ### Allow params passed in an array or as args\n if ( is_a( $bind_params[ count($bind_params) - 1 ], 'PDO' ) || is_a( $bind_params[ count($bind_params) - 1 ], 'PhoneyPDO' ) ) $use_dbh = array_pop($bind_params);\n if ( ! isset( $GLOBALS['orm_dbh'] ) ) $GLOBALS['orm_dbh'] = $use_dbh; # steal their DBH for global use, hehehe\n if ( count( $bind_params ) == 1 && is_array(array_shift(array_values($bind_params))) ) { $bind_params = array_shift(array_values($bind_params)); };\n \n reverse_t_bools($bind_params);\n if (ORM_SQL_DEBUG || ORM_SQL_WRITE_DEBUG) bug($sql, $bind_params);\n try { \n $sth = $use_dbh->prepare($sql);\n $rv = $sth->execute($bind_params);\n } catch (PDOException $e) {\n trace_dump();\n $err_msg = 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line();\n if ( strlen($err_msg) > 1024 ) {\n bug($err_msg,$sql,$bind_params,$e->getMessage());\n $sql = substr($sql,0,1020 + strlen($sql) - strlen($err_msg) ).'...';\n }\n trigger_error( 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line(), E_USER_ERROR);\n return false;\n }\n if ( ORM_SQL_PROFILE ) END_TIMER('dbh_do_bind');\n return $rv;\n }", "public static function statement($query, $bindings = [])\n {\n }", "private static function executeHelper($sql, $parameters) {\n $connection = self::getConnection();\n $query = $connection->prepare($sql);\n $query->execute($parameters); \n return $query;\n }", "function executeBoundSQL($cmdstr, $list) {\n\n global $db_conn, $success;\n $statement = OCIParse($db_conn, $cmdstr);\n\n if (!$statement) {\n echo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($db_conn);\n echo htmlentities($e['message']);\n $success = False;\n }\n\n foreach ($list as $tuple) {\n foreach ($tuple as $bind => $val) {\n //echo $val;\n //echo \"<br>\".$bind.\"<br>\";\n OCIBindByName($statement, $bind, $val);\n unset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n }\n\n $r = OCIExecute($statement, OCI_DEFAULT);\n if (!$r) {\n echo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n $e = OCI_Error($statement); // For OCIExecute errors, pass the statementhandle\n echo htmlentities($e['message']);\n echo \"<br>\";\n $success = False;\n }\n }\n }", "public function query($query)\n {\n $this->stmt = $this->dbh->prepare($query);\n }", "protected function statement($query, $bindings = array())\n {\n $statement = $this->getActivePdo()->prepare($query);\n\n return $statement->execute($bindings);\n }", "function executeBoundSQL($cmdstr, $list) {\n\n\tglobal $db_conn, $success;\n\t$statement = OCIParse($db_conn, $cmdstr);\n\n\tif (!$statement) {\n\t\techo \"<br>Cannot parse the following command: \" . $cmdstr . \"<br>\";\n\t\t$e = OCI_Error($db_conn);\n\t\techo htmlentities($e['message']);\n\t\t$success = False;\n\t}\n\n\tforeach ($list as $tuple) {\n\t\tforeach ($tuple as $bind => $val) {\n\t\t\t//echo $val;\n\t\t\t//echo \"<br>\".$bind.\"<br>\";\n\t\t\tOCIBindByName($statement, $bind, $val);\n\t\t\tunset ($val); //make sure you do not remove this. Otherwise $val will remain in an array object wrapper which will not be recognized by Oracle as a proper datatype\n\n\t\t}\n\t\t$r = OCIExecute($statement, OCI_DEFAULT);\n\t\tif (!$r) {\n\t\t\techo \"<br>Cannot execute the following command: \" . $cmdstr . \"<br>\";\n\t\t\t$e = OCI_Error($statement); // For OCIExecute errors pass the statementhandle\n\t\t\techo htmlentities($e['message']);\n\t\t\techo \"<br>\";\n\t\t\t$success = False;\n\t\t}\n\t}\n}" ]
[ "0.7454217", "0.74251765", "0.73342067", "0.72405833", "0.70820475", "0.68908095", "0.68616784", "0.6833215", "0.6828532", "0.6772883", "0.6754823", "0.6754823", "0.6578754", "0.657093", "0.65627724", "0.6552881", "0.6523098", "0.6512345", "0.65066695", "0.6503162", "0.64700156", "0.64620095", "0.6429091", "0.641705", "0.64155805", "0.6414519", "0.6401477", "0.6398882", "0.6379063", "0.6357114", "0.63496083", "0.63452715", "0.6336109", "0.6317708", "0.63085234", "0.63049036", "0.62859994", "0.6284981", "0.6274613", "0.6266839", "0.62473804", "0.6220839", "0.62074256", "0.62043184", "0.6200889", "0.617904", "0.6173169", "0.6168982", "0.61684114", "0.6168392", "0.6158643", "0.61520797", "0.61506253", "0.6133392", "0.61297816", "0.61273813", "0.6126403", "0.61000985", "0.60997415", "0.6099524", "0.60985863", "0.60921425", "0.6092113", "0.6090147", "0.6073816", "0.6071653", "0.6071281", "0.6035932", "0.6027275", "0.60223925", "0.6021683", "0.60145986", "0.60130787", "0.6010277", "0.6001022", "0.59980464", "0.5992256", "0.59871143", "0.59871143", "0.59860516", "0.5983364", "0.598229", "0.5980144", "0.59734285", "0.59714836", "0.59642386", "0.59537846", "0.5953259", "0.59523726", "0.5950216", "0.594972", "0.5949038", "0.594823", "0.59443617", "0.59430355", "0.5942277", "0.5937268", "0.59366876", "0.5932294", "0.59301966" ]
0.6533969
16
This accepts a string of space separated keywords
function getVideosFromKeywords($keywords) { // $keywords = explode(" ", $keywords); // $vars = // $sql = "SELECT distinct * FROM keywords k inner join videos v on v.videoId = k.videoId where "; // foreach($keywords as $keyword) // { // if(trim($keyword == "")) continue; // $sql .= "k.keyword like '%" . $keyword . "%'"; // if($keyword != $keywords[count($keywords) - 1]) // $sql .= " or "; // } // $sql .= " GROUP BY v.videoId"; // $result = ExecutePreparedQuery($sql); // $videos = array(); // foreach($result as $row) // { // $videos[] = $row; // } // return $videos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processString($keywords)\n{\n $pattern=\"/[\\s]+/\";\n $keywords=trim($keywords);\n if (!isset($keywords)||empty($keywords)) {\n return null;\n }\n $separateWords=preg_split($pattern, $keywords);\n foreach ($separateWords as $word) {\n echo $word.\"<br>\";\n }\n return $separateWords;\n}", "public function extract_keywords($string){\n//List of stop words (words to ignore) \n $stopWords = array(\"able\",\"about\",\"above\",\"abroad\",\"according\",\"accordingly\",\"across\",\"actually\",\"adj\",\"after\",\"afterwards\",\"again\",\"against\",\"ago\",\"ahead\",\"ain't\",\"all\",\"allow\",\"allows\",\"almost\",\"alone\",\"along\",\"alongside\",\"already\",\"also\",\"although\",\"always\",\"am\",\"amid\",\"amidst\",\"among\",\"amongst\",\"an\",\"and\",\"another\",\"any\",\"anybody\",\"anyhow\",\"anyone\",\"anything\",\"anyway\",\"anyways\",\"anywhere\",\"apart\",\"appear\",\"appreciate\",\"appropriate\",\"are\",\"aren't\",\"around\",\"as\",\"a's\",\"aside\",\"ask\",\"asking\",\"associated\",\"at\",\"available\",\"away\",\"awfully\",\"back\",\"backward\",\"backwards\",\"be\",\"became\",\"because\",\"become\",\"becomes\",\"becoming\",\"been\",\"before\",\"beforehand\",\"begin\",\"behind\",\"being\",\"believe\",\"below\",\"beside\",\"besides\",\"best\",\"better\",\"between\",\"beyond\",\"both\",\"brief\",\"but\",\"by\",\"came\",\"can\",\"cannot\",\"cant\",\"can't\",\"caption\",\"cause\",\"causes\",\"certain\",\"certainly\",\"changes\",\"clearly\",\"c'mon\",\"co\",\"co.\",\"com\",\"come\",\"comes\",\"concerning\",\"consequently\",\"consider\",\"considering\",\"contain\",\"containing\",\"contains\",\"corresponding\",\"could\",\"couldn't\",\"course\",\"c's\",\"currently\",\"dare\",\"daren't\",\"day\",\"definitely\",\"described\",\"despite\",\"did\",\"didn't\",\"different\",\"directly\",\"do\",\"does\",\"doesn't\",\"doing\",\"done\",\"don't\",\"down\",\"downwards\",\"during\",\"each\",\"edu\",\"eg\",\"eight\",\"eighty\",\"either\",\"else\",\"elsewhere\",\"end\",\"ending\",\"enough\",\"entirely\",\"especially\",\"et\",\"etc\",\"even\",\"ever\",\"evermore\",\"every\",\"everybody\",\"everyone\",\"everything\",\"everywhere\",\"ex\",\"exactly\",\"example\",\"except\",\"fairly\",\"far\",\"farther\",\"few\",\"fewer\",\"fifth\",\"first\",\"five\",\"followed\",\"following\",\"follows\",\"for\",\"forever\",\"former\",\"formerly\",\"forth\",\"forward\",\"found\",\"four\",\"from\",\"further\",\"furthermore\",\"get\",\"gets\",\"getting\",\"given\",\"gives\",\"go\",\"goes\",\"going\",\"gone\",\"got\",\"gotten\",\"greetings\",\"had\",\"hadn't\",\"half\",\"happens\",\"hardly\",\"has\",\"hasn't\",\"have\",\"haven't\",\"having\",\"he\",\"he'd\",\"he'll\",\"hello\",\"help\",\"hence\",\"her\",\"here\",\"hereafter\",\"hereby\",\"herein\",\"here's\",\"hereupon\",\"hers\",\"herself\",\"he's\",\"hi\",\"him\",\"himself\",\"his\",\"hither\",\"home\",\"hopefully\",\"how\",\"howbeit\",\"however\",\"hundred\",\"i'd\",\"ie\",\"if\",\"ignored\",\"i'll\",\"i'm\",\"immediate\",\"in\",\"inasmuch\",\"inc\",\"inc.\",\"indeed\",\"indicate\",\"indicated\",\"indicates\",\"inner\",\"inside\",\"insofar\",\"instead\",\"into\",\"inward\",\"is\",\"isn't\",\"it\",\"it'd\",\"it'll\",\"its\",\"it's\",\"itself\",\"i've\",\"just\",\"k\",\"keep\",\"keeps\",\"kept\",\"khan\",\"know\",\"known\",\"knows\",\"last\",\"lately\",\"later\",\"latter\",\"latterly\",\"least\",\"less\",\"lest\",\"let\",\"let's\",\"like\",\"liked\",\"likely\",\"likewise\",\"little\",\"look\",\"looking\",\"looks\",\"low\",\"lower\",\"ltd\",\"made\",\"mainly\",\"make\",\"makes\",\"many\",\"may\",\"maybe\",\"mayn't\",\"me\",\"mean\",\"meantime\",\"meanwhile\",\"merely\",\"might\",\"mightn't\",\"mine\",\"minus\",\"miss\",\"more\",\"moreover\",\"most\",\"mostly\",\"mr\",\"mrs\",\"much\",\"must\",\"mustn't\",\"my\",\"myself\",\"name\",\"namely\",\"nd\",\"near\",\"nearly\",\"necessary\",\"need\",\"needn't\",\"needs\",\"neither\",\"never\",\"neverf\",\"neverless\",\"nevertheless\",\"new\",\"next\",\"nine\",\"ninety\",\"no\",\"nobody\",\"non\",\"none\",\"nonetheless\",\"noone\",\"no-one\",\"nor\",\"normally\",\"not\",\"nothing\",\"notwithstanding\",\"novel\",\"now\",\"nowhere\",\"obviously\",\"of\",\"off\",\"often\",\"oh\",\"ok\",\"okay\",\"old\",\"on\",\"once\",\"one\",\"ones\",\"one's\",\"only\",\"onto\",\"opposite\",\"or\",\"other\",\"others\",\"otherwise\",\"ought\",\"oughtn't\",\"our\",\"ours\",\"ourselves\",\"out\",\"outside\",\"over\",\"overall\",\"own\",\"page\",\"particular\",\"particularly\",\"past\",\"per\",\"perhaps\",\"placed\",\"please\",\"plus\",\"possible\",\"presumably\",\"probably\",\"provided\",\"provides\",\"que\",\"quite\",\"qv\",\"rather\",\"rd\",\"re\",\"really\",\"reasonably\",\"recent\",\"recently\",\"regarding\",\"regardless\",\"regards\",\"relatively\",\"respectively\",\"right\",\"round\",\"said\",\"same\",\"saw\",\"say\",\"saying\",\"says\",\"second\",\"secondly\",\"see\",\"seeing\",\"seem\",\"seemed\",\"seeming\",\"seems\",\"seen\",\"self\",\"selves\",\"sensible\",\"sent\",\"serious\",\"seriously\",\"seven\",\"several\",\"shall\",\"shan't\",\"she\",\"she'd\",\"she'll\",\"she's\",\"should\",\"shouldn't\",\"since\",\"six\",\"so\",\"social\",\"some\",\"somebody\",\"someday\",\"somehow\",\"someone\",\"something\",\"sometime\",\"sometimes\",\"somewhat\",\"somewhere\",\"soon\",\"sorry\",\"specified\",\"specify\",\"specifying\",\"still\",\"sub\",\"such\",\"sup\",\"sure\",\"take\",\"taken\",\"taking\",\"tell\",\"tends\",\"th\",\"than\",\"thank\",\"thanks\",\"thanx\",\"that\",\"that'll\",\"thats\",\"that's\",\"that've\",\"the\",\"their\",\"theirs\",\"them\",\"themselves\",\"then\",\"thence\",\"there\",\"thereafter\",\"thereby\",\"there'd\",\"therefore\",\"therein\",\"there'll\",\"there're\",\"theres\",\"there's\",\"thereupon\",\"there've\",\"these\",\"they\",\"they'd\",\"they'll\",\"they're\",\"they've\",\"thing\",\"things\",\"think\",\"third\",\"thirty\",\"this\",\"thorough\",\"thoroughly\",\"those\",\"though\",\"three\",\"through\",\"throughout\",\"thru\",\"thus\",\"till\",\"to\",\"together\",\"too\",\"took\",\"toward\",\"towards\",\"tried\",\"tries\",\"truly\",\"try\",\"trying\",\"t's\",\"twice\",\"two\",\"un\",\"under\",\"underneath\",\"undoing\",\"unfortunately\",\"unless\",\"unlike\",\"unlikely\",\"until\",\"unto\",\"up\",\"upon\",\"upwards\",\"us\",\"use\",\"used\",\"useful\",\"uses\",\"using\",\"usually\",\"v\",\"value\",\"various\",\"versus\",\"very\",\"via\",\"video\",\"viz\",\"vs\",\"want\",\"wants\",\"was\",\"wasn't\",\"way\",\"we\",\"we'd\",\"welcome\",\"well\",\"we'll\",\"went\",\"were\",\"we're\",\"weren't\",\"we've\",\"what\",\"whatever\",\"what'll\",\"what's\",\"what've\",\"when\",\"whence\",\"whenever\",\"where\",\"whereafter\",\"whereas\",\"whereby\",\"wherein\",\"where's\",\"whereupon\",\"wherever\",\"whether\",\"which\",\"whichever\",\"while\",\"whilst\",\"whither\",\"who\",\"who'd\",\"whoever\",\"whole\",\"who'll\",\"whom\",\"whomever\",\"who's\",\"whose\",\"why\",\"will\",\"willing\",\"wish\",\"with\",\"within\",\"without\",\"wonder\",\"won't\",\"would\",\"wouldn't\",\"yes\",\"yet\",\"you\",\"you'd\",\"you'll\",\"your\",\"you're\",\"yours\",\"yourself\",\"yourselves\",\"you've\",\"zero\");\n\n $string = trim($string); // trim the string\n $string = preg_replace(\"/&#?[a-z0-9]+;/i\",\"\",$string); // remove html special charecter\n $string = preg_replace(\"/[^a-zA-Z0-9\\s]/\", \"\", $string); // only take alphanumerical characters, but keep the spaces...\n $string = strtolower($string); // make it lowercase\n $string = preg_replace('!\\s+!', ' ', $string); //multiple whitespaces removed to single\n $string = str_replace(range(0,9),'',$string);\n\n preg_match_all('/\\b.*?\\b/i', $string, $matchWords);\n $matchWords = $matchWords[0];\n\n foreach ( $matchWords as $key=>$item ) {\n if ( $item == '' || $item == ' ' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3 ) {\n unset($matchWords[$key]);\n }\n } \n $wordCountArr = array();\n if ( is_array($matchWords) ) {\n foreach ( $matchWords as $key => $val ) {\n $val = strtolower($val);\n if ( isset($wordCountArr[$val]) ) {\n $wordCountArr[$val]++;\n } else {\n $wordCountArr[$val] = 1;\n }\n }\n }\n//Sorting according to frequency of occurrence, descending order\n arsort($wordCountArr);\n//Making a set of 10 most frequent keywords\n $wordCountArr = array_slice($wordCountArr, 0, 10);\n $return_keywords = array();\n foreach ($wordCountArr as $key => $val) {\n array_push($return_keywords,$key.'-'.$val);\n }\n return $return_keywords;\n }", "function add_keywords($keywords) {\n\n $operations = array();\n\n for ($i = 0; $i < count($keywords); $i++) {\n\n $k = $keywords[$i];\n\n if (!isset($k['match_type']))\n $k['match_type'] = AW_MATCH_TYPE_BROAD;\n\n $keyword = '<criterion xsi:type=\"Keyword\">\n <text>'.$this->__xml($k['text']).'</text>\n <matchType>'.\n $this->__xml($k['match_type'])\n .'</matchType>\n </criterion>';\n\n $operations[] =\n $this->__make_criterion_operation('ADD',\n $k['ad_group_id'],\n $keyword,\n $k['user_status'],\n $k['destination_url']);\n\n }\n\n return $this->__do_mutate('AdGroupCriterionService', $operations);\n\n}", "public function setKeywords(string $keywords)\n {\n $this->keywords = $keywords;\n }", "public function setKeywordsByString($keywords, $delimiter = ',')\n {\n $keywords = explode($delimiter, $keywords);\n\n if ($keywords === false || empty($keywords)) {\n return false;\n }\n\n // check all values\n foreach ($keywords as $key => $value) {\n $keywords[$key] = trim($value);\n\n if (!$keywords[$key]) {\n unset($keywords[$key]);\n }\n }\n\n $this->setKeywordsByArray($keywords);\n }", "public function keywords()\r\n {\r\n }", "abstract function getKeywords();", "function meta_keywords( $string ){\n\t$stop_words = array(\n\t\t'i', 'a', 'about', 'an', 'and', 'are',\n\t\t'as', 'at', 'be', 'by', 'com', 'de',\n\t\t'en', 'for', 'from', 'how', 'in', 'is',\n\t\t'it', 'la', 'of', 'on', 'or', 'that', 'the',\n\t\t'this', 'to', 'was', 'what', 'when', 'where',\n\t\t'who', 'will', 'with', 'und', 'the', 'www'\n\t);\n \n\t$string = preg_replace( '/ss+/i', '', $string );\n\t$string = trim( $string );\n\n\t/**\n\t * only accept alphanumerical characters\n\t * but keep the spaces and dashes\n\t */\n\t$string = preg_replace( '/[^a-zA-Z0-9 -]/', '', $string );\n\n\t/**\n\t * convert to lower case\n\t */\n\t$string = strtolower( $string );\n \n\tpreg_match_all( '/([a-z]*?)(?=s)/i', $string, $matches );\n\n\t$matches = $matches[0];\n\n\tforeach ( $matches as $key=>$item ) {\n\t\tif ( $item == '' || in_array( strtolower( $item ), $stop_words ) || strlen( $item ) <= 3 )\n\t\t\tunset( $matches[ $key ] );\n\t}\n\n\n\t$word_count = array();\n\tif ( is_array( $matches ) ) {\n\t\tforeach ( $matches as $key => $val ) {\n\t\t\t$val = strtolower( $val );\n\t\t\tif ( isset( $word_count[ $val ] ) )\n\t\t\t\t$word_count[ $val ]++;\n\t\t\telse\n\t\t\t\t$word_count[ $val ] = 1;\n\t\t}\n \t}\n\n\tarsort( $word_count );\n\t$word_count = array_slice( $word_count, 0, 10 );\n\t$word_count = implode( ',', array_keys( $word_count ) );\n\n\treturn $word_count;\n}", "public static function keywords(...$keywords): MetaTag {\n if (is_array($keywords)) {\n $keywords = implode(', ', Arrays::flatten($keywords));\n }\n return new MetaTag(['name' => 'keywords', 'content' => $keywords]);\n }", "function is_keyword($type){\n global $keywords;\n global $token;\n\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $type;\n return True;\n }\n }\n return False;\n }", "public function split_keywords(&$keywords, $terms)\n\t{\n\t\tif ($terms == 'all')\n\t\t{\n\t\t\t$match\t\t= array('#\\sand\\s#i', '#\\sor\\s#i', '#\\snot\\s#i', '#\\+#', '#-#', '#\\|#', '#@#');\n\t\t\t$replace\t= array(' & ', ' | ', ' - ', ' +', ' -', ' |', '');\n\n\t\t\t$replacements = 0;\n\t\t\t$keywords = preg_replace($match, $replace, $keywords);\n\t\t\t$this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->sphinx->SetMatchMode(SPH_MATCH_ANY);\n\t\t}\n\n\t\t// Keep quotes and new lines\n\t\t$keywords = str_replace(array('&quot;', \"\\n\"), array('\"', ' '), trim($keywords));\n\n\t\tif (strlen($keywords) > 0)\n\t\t{\n\t\t\t$this->search_query = str_replace('\"', '&quot;', $keywords);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "static public function keywords($data) {\n// $query_replace = array('', '', '', '', '', '|', '|', '|', '|');\n//\n// $query_data = explode('|', str_replace($query_search, $query_replace, $data));\n//\n// $keywords = array();\n// foreach ($query_data as $query_data_value) {\n// $keyword = trim($query_data_value);\n//\n// if(!in_array($keyword, $keywords)) {\n// $keywords[] = $keyword;\n// }\n// }\n// \n// return $keywords;\n }", "public function setKeywords($keywords)\n {\n $this->keywords = (array)$keywords;\n }", "public function setKeywords($keywords)\n\t{\n\t\tif( ! is_array($keywords))\n\t\t{\n\t\t\t$keywords = explode(',', $keywords);\n\t\t}\n\n\t\t// Flatten the array into single column\n\t\t$keywords = array_flatten($keywords);\n\t\t// Trim & lowercase the array\n\t\t$keywords = array_map('trim', $keywords);\n\t\t$keywords = array_map('strtolower', $keywords);\n\n\t\t$this->keywords = $keywords;\n\n\t\treturn $keywords;\n\t}", "private function __preprocess_keyword_string($keyword_string){\r\n\t\t\t$keyword_string = preg_replace(\"/[,&\\+\\/-]/\", ' ', $keyword_string);\r\n\t\t\t$keys = preg_split('@ +@', $keyword_string, NULL, PREG_SPLIT_NO_EMPTY);\r\n\t\t\t$result = array();\r\n\t\t\tforeach($keys as $key){\r\n\t\t\t\t$key = $this->stemmer->stem($key);\r\n\t\t\t\tif(!in_array($key, $this->stopwords)){\r\n\t\t\t\t\t// remove numeric string, I'm not sure whether it is proper\r\n\t\t\t\t\tif($key != '' && !is_numeric($key)){\r\n\t\t\t\t\t\t$result[] = $key;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $result;\r\n\t\t}", "function set_keywords_from_search_query()\n\t{\n\t\t$santizied_search_query = $this->get_sanitized_search_query($this->search_query);\n\t\n\t\t$keywords_to_search_for = explode(' ',$santizied_search_query);\n\t\t$unique_keywords = array_unique($keywords_to_search_for);\n\t\t\n\t\t$this->keywords_to_search_for = $this->remove_ignored_keywords_from_array($unique_keywords);\n\t}", "function we_tag_keywords(array $attribs, $content){\n\t$htmlspecialchars = weTag_getAttribute('htmlspecialchars', $attribs, false, we_base_request::BOOL);\n\t$attribs = removeAttribs($attribs, array(\n\t\t'htmlspecialchars'\n\t));\n\n\t$keys = !empty($GLOBALS['KEYWORDS']) ? $GLOBALS['KEYWORDS'] : '';\n\tif(!$keys && $content){\n\t\tob_start();\n\t\t//FIXME:eval\n\t\teval('?>' . $content);\n\t\t$keys = ob_get_clean();\n\t}\n\tif(!empty($GLOBALS['we_editmode'])){\n\t\t//set meta data & exit\n\t\t$GLOBALS['meta']['Keywords']['default'] = $keys;\n\t\treturn;\n\t}\n\t$attribs['name'] = 'keywords';\n\t$attribs['content'] = str_replace('\"', '\\'', ($htmlspecialchars ? oldHtmlspecialchars(strip_tags($keys)) : strip_tags($keys)));\n\treturn getHtmlTag(\"meta\", $attribs) . \"\\n\";\n}", "public function registerKeyword(/*string*/ $keyword);", "public function getKeywords();", "public function setKeywords($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->keywords = $arr;\n\n return $this;\n }", "private function _validate_keyword(&$option_data)\n\t{\n\t\tif ($option_data['key'] == 'keyword')\n\t\t{\n\t\t\t// Explode value, and group quoted items\n\t\t\t//preg_match_all('/\"(?:\\\\\\\\.|[^\\\\\\\\\"])*\"|\\S+/', $option_data['value'], $keywords);\n\t\t\t$keywords = str_getcsv($option_data['value']);\n\t\t\t$keywords = array_map('trim', $keywords);\n\n\t\t\t$found = array();\n\t\t\t$stops = Twitter_Functions::stop_words();\n\n\t\t\tforeach ($keywords as $key => $value)\n\t\t\t{\n\t\t\t\tif (in_array($value, $stops))\n\t\t\t\t{\n\t\t\t\t\t$found[] = $value;\n\t\t\t\t}\n\t\t\t\t$option_data['quota_usage'] += 1;\n\t\t\t}\n\n\t\t\tif (count($found))\n\t\t\t{\n\t\t\t\t$exception_message = __('Invalid twitter keywords - :keywords',\n\t\t\t\t\t\tarray(':keywords' => implode(', ', $found)));\n\t\t\t\tthrow new Swiftriver_Exception_Channel_Option($exception_message);\n\t\t\t}\n\t\t}\n\t}", "public function set_keywords($keywords)\n\t{\n\t\tif (is_null($keywords)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Keywords Invalid!\");\n\t\t}\n\t\t$this->keywords = $keywords;\n\t}", "public function testFilterKeywords()\n {\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }", "static public function setKeywords($new_keywords) {\n\t\tif (is_string($new_keywords)) {\n\t\t\t$new_keywords = explode(',', $new_keywords);\n\t\t\tforeach($new_keywords as &$keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t}\n\t\t}\n\t\tself::$page_keywords = (array)$new_keywords;\n\t}", "public function setKeywords($keywords, $encoding = 'UTF-8') {}", "public function keyword($keywords) {\n\t\tforeach ((array) $keywords as $val) {\n\t\t\t$this->keywords[] = $val;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function testAssignKeywords()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function get_keywords() {\n return [ 'autostop', 'cta', 'video', 'player', 'embed' ];\n }", "function dp_meta_keywords() {\n\t$keywords = '';\n\n\tif ( is_singular() && !is_preview() ) {\n\t\t$post = get_queried_object();\n\t\t$taxonomies = get_object_taxonomies( $post->post_type );\n\t\tif ( is_array( $taxonomies ) ) {\n\t\t\tforeach ( $taxonomies as $tax ) {\n\t\t\t\tif ( $terms = get_the_term_list( get_queried_object_id(), $tax, '', ', ', '' ) )\n\t\t\t\t\t$keywords[] = $terms;\n\t\t\t}\n\t\t\tif ( !empty( $keywords ) )\n\t\t\t\t$keywords = join( ', ', $keywords );\n\t\t}\n\t}\n\n\tif(!empty($keywords))\n\t\t$keywords = '<meta name=\"keywords\" content=\"' . esc_attr( strip_tags( $keywords ) ) . '\" />' . \"\\n\";\n\n\techo apply_filters( 'dp_meta_keywords', $keywords );\n}", "public function get_keywords() {\n\t\treturn [ 'Feature image', 'photo', 'visual' ];\n\t}", "public function keywordsProvider()\n {\n return [[[]]];\n }", "function search($keywords)\r\n {\r\n\r\n }", "public function inferKeywords($phrase, $ignorelist=NULL)\n {\n $keywords = explode(' ', $phrase);\n if($ignorelist !== NULL)\n {\n foreach($keywords as $kw)\n {\n $ignore = FALSE;\n foreach($ignorelist as $ilw)\n {\n if($kw == $ilw)\n {\n $ignore = TRUE;\n break;\n }\n }\n if(!$ignore)\n {\n $keep[] = $kw;\n }\n }\n $keywords = $keep;\n }\n return $keywords;\n }", "public function __construct(array $keywords)\n {\n $this->keywords = $keywords;\n }", "public function getSeoKeywords();", "public function enterRequiredKeyword(string $keyword): void;", "protected function _matchKeywords($buffer, $start) {}", "public function setKeywords($keywords, int $maxLength = null);", "public function setKeywords(string $keywords) : self\n {\n $this->keywords = $keywords;\n return $this;\n }", "public function add_keywords ( $new_keywords )\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->errno = DB_OK;\r\n\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query( \"SELECT cat_keywords FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( $result->num_rows == 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tas the id is unique one row should have been returned\r\n\t\t\t{\r\n\t\t\t\t$row = $result->fetch_row();\r\n\t\t\t\t$kw = $row[0];\r\n\t\t\t}\t\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* gathering all keywords into one variable with # as delimiter to insert it to the database */\r\n\t\t\t$kw_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the keywords array hasn't been set\r\n\t\r\n\t\t\tif ( isset ( $new_keywords ) )\r\n\t\t\t\t$kw_length = count( $new_keywords );\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_INPUT;\r\n\t\t\t\treturn ;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor ( $i = 0; $i < $kw_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgenerating the keyword string which will enter to the database\r\n\t\t\t\t$kw = $kw.\"#\".$new_keywords[$i];\t\t\t\r\n\t\t\t\r\n\t\t\tif( !$this->con->query( \"UPDATE category SET cat_keywords=\\\"$kw\\\" WHERE cat_id=$this->cat_id;\" ) )\t\t\t\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to query\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t$this->cat_keywords = NULL;\r\n\t\t\t\r\n\t\t\t$tok = strtok( $kw, \"#\" );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tturning the keywords string into an array\r\n\t\t\t\r\n\t\t\twhile ( $tok !== false ) \r\n\t\t\t{\r\n\t\t\t\t$this->cat_keywords [] = $tok;\r\n\t\t\t\t$tok = strtok( \"#\" );\r\n\t\t\t}\t\t\t\r\n\t\r\n\t\t}", "public static function addKeywords($params)\n {\n $data = new ExcludedKeyword();\n $data->keyword = BackEnd_Helper_viewHelper::stripSlashesFromString( $params['keyword']);\n $data->action = BackEnd_Helper_viewHelper::stripSlashesFromString($params['actionType']);\n $data->url = BackEnd_Helper_viewHelper::stripSlashesFromString($params['redirectTo']);\n $data->save();\n\n if($params['actionType'] == 1){\n\n //split value by comman (,)\n $splitedVal = explode(',',$params['selectedShopForSearchbar']) ;\n //get hidden value from posted form\n\n foreach ($splitedVal as $sp) {\n //find shop by name from shop table\n $relKeyWords = new RefExcludedkeywordShop();\n //add value in array by index\n $relKeyWords->keywordid = $data->id;//get last inserted keyword id\n $relKeyWords->shopid = $sp;\n $relKeyWords->keywordname = BackEnd_Helper_viewHelper::stripSlashesFromString($params['keyword']);\n $relKeyWords->save();\n\n }\n }\n //call cache function\n FrontEnd_Helper_viewHelper::clearCacheByKeyOrAll('all_excludedkeyword_list');\n //die('out');\n\n }", "function rest_get_allowed_schema_keywords()\n {\n }", "public function keywords($value=''): bool\n\t{\n\t\t$keywords = require 'keywords.php';\t\t\n\t\t$hit = false;\n\n\t\tforeach ($keywords as $key) {\n\t\t\tif (stripos($value, $key) !== false)\n\t\t\t\t$hit = true;\n\t\t}\n\t\treturn $hit;\n\t}", "function cleanForKeywords($keyword){\n\t\t$a_strReplace = array(';',\n\t\t\t'...,',\n\t\t\t'...',\n\t\t\t'-,',\n\t\t\t'(',\n\t\t\t')',\n\t\t\t',,',\n\t\t\t', ,',\n\t\t);\n\t\t$keyword = str_replace($a_strReplace,', ',$keyword);\n\t\treturn $keyword;\n\t}", "protected function setKeywords() {\r\n\t\t$keywords = $this->newsItem->getKeywords();\r\n\t\t$keywordsAction = $this->settings['news']['semantic']['general']['keywords']['action'];\r\n\t\t$pageKeywords = $GLOBALS['TSFE']->page['keywords'];\r\n\t\tif (!empty($keywordsAction) && !empty($pageKeywords)) {\r\n\t\t\tswitch ($keywordsAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $keywords . ', ' . $pageKeywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $pageKeywords . ',' . $keywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t}\r\n\t\t$keywordsArray = t3lib_div::trimExplode(',', $keywords);\r\n\t\t$keywordsLimit = intval($this->settings['news']['semantic']['general']['keywords']['limit']);\r\n\t\t$this->keywords = (empty($keywordsLimit)) ? array_unique($keywordsArray) : $this->keywords = array_slice(array_unique($keywordsArray), 0, $keywordsLimit);\r\n\t}", "public function get_keywords()\n\t{\n\t\treturn ['algolia', 'search', 'algolia'];\n\t}", "function validate_capture_phrases($keywords) {\n $illegal_chars = array( \"\\t\", \"\\n\", \";\", \"(\", \")\" );\n foreach ($illegal_chars as $c) {\n if (strpos($keywords, $c) !== FALSE) {\n return FALSE;\n }\n }\n return TRUE;\n}", "function findKeyword() {\n \n }", "public static function filter__metakeywords( $keywords ) {\n\t\t\treturn WPGlobus_Core::text_filter($keywords, WPGlobus::Config()->language, WPGlobus::RETURN_EMPTY);\n\t\t}", "public function registerKeywords(array $keywords) {\r\n\t\tforeach ($keywords as $nextKeyword) {\r\n\t\t\t$this->registerKeyword($nextKeyword);\r\n\t\t}\r\n\t}", "function reformat_keywords($keywordsraw){\n\t\t $keywords_array = (explode(' ', $keywordsraw));\n\n\t\t // fix the key words with 's and ,s\n\t\t $keywords = '\\'';\n\t\t foreach ($keywords_array as $key => $value) {\n\t\t \tif ($key > 0) {\n\t\t \t\t$keywords = $keywords . ', ';\n\t\t \t}\n\t\t \t$keywords = $keywords . $value;\n\t\t }\n\t\t $keywords = $keywords.'\\'';\n\t\t return $keywords;\n\t\t}", "function setKeywords($keywords) {\n $this->fields['keywords'] = $keywords;\n return $this;\n }", "public function keywords($keywords = null)\n {\n return $this->data(self::KEYWORDS, $keywords);\n }", "function filterSearchKeys($query){\n $query = trim(preg_replace(\"/(\\s+)+/\", \" \", $query));\n $words = array();\n // expand this list with your words.\n $list = array(\"in\",\"it\",\"a\",\"the\",\"of\",\"or\",\"I\",\"you\",\"he\",\"me\",\"us\",\"they\",\"she\",\"to\",\"but\",\"that\",\"this\",\"those\",\"then\");\n $c = 0;\n foreach(explode(\" \", $query) as $key){\n if (in_array($key, $list)){\n continue;\n }\n $words[] = strtoupper($key);\n if ($c >= 15){\n break;\n }\n $c++;\n }\n return $words;\n }", "public function test_keywordOrder() : void\n {\n $subject = <<<'EOT'\n{showencoded: \"text\" urlencode: idnencode:}\nEOT;\n\n $command = $this->parseCommand($subject);\n\n $this->assertTrue($command->isURLEncoded());\n $this->assertTrue($command->isIDNEncoded());\n\n $list = $command->getActiveEncodings();\n $this->assertCount(2, $list);\n $this->assertSame(Mailcode_Commands_Keywords::TYPE_URLENCODE, $list[0]);\n $this->assertSame(Mailcode_Commands_Keywords::TYPE_IDN_ENCODE, $list[1]);\n }", "public function setKeywords($val)\n {\n $this->_propDict[\"keywords\"] = $val;\n return $this;\n }", "public function keywords()\n {\n $keywords = explode(',', $this->DOM->filter(\"meta[name='keywords']\")->attr('content'));\n\n $keywords = array_map(function ($keyword) {\n return strtolower(trim($keyword));\n }, $keywords);\n\n return $keywords;\n }", "private function getKeywordsArray()\n {\n return ['keyword 1', 'keyword 2', 'keyword 3', 'keyword 4', 'keyword 5'];\n }", "public function getMetaKeywords();", "static public function addKeyword($new_keyword) {\n\t\tself::$page_keywords[] = (string)trim($new_keyword);\n\t}", "public function getSuggestedKeywords($keywords=false) {\n $keywords_out = \"\";\n $keywords_to_join = [];\n $total_weight = 0;\n $use_keywords = ($keywords===false) ? $this->_keywords : $keywords;\n foreach ($use_keywords as $keyword) {\n if (count($keyword)>2) {\n $keywords_to_join[] = $keyword[0];\n $total_weight += $keyword['weight'];\n if ($total_weight<20) {\n $keywords_to_join[] = $keyword[1];\n $total_weight *= 2;\n }\n } else if ($total_weight < 20) {\n $keywords_to_join[] = $keyword[0];\n $total_weight += $keyword['weight'];\n }\n if ($total_weight>20 || count($keywords_to_join)>1) {\n break;\n }\n }\n return $keywords_to_join;\n }", "protected function _syncKeywords() {}", "private function generateKeywordsFromText($text){\n $stopWords = array('i','a','about','an','and','are','as','at','be','by','com','de','en','for','from','how','in','is','it','la','of','on','or','that','the','this','to','was','what','when','where','who','will','with','und','the','www', \"such\", \"have\", \"then\");\n\n\n //Let us do some basic clean up! on the text before getting to real keyword generation work\n\n $text = preg_replace('/\\s\\s+/i', '', $text); // replace multiple spaces etc. in the text\n $text = trim($text); // trim any extra spaces at start or end of the text\n $text = preg_replace('/[^a-zA-Z0-9 -]/', '', $text); // only take alphanumerical characters, but keep the spaces and dashes too…\n $text = strtolower($text); // Make the text lowercase so that output is in lowercase and whole operation is case in sensitive.\n\n // Find all words\n preg_match_all('/\\b.*?\\b/i', $text, $allTheWords);\n $allTheWords = $allTheWords[0];\n\n //Now loop through the whole list and remove smaller or empty words\n foreach ( $allTheWords as $key=>$item ) {\n if ( $item == '' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3 ) {\n unset($allTheWords[$key]);\n }\n }\n\n // Create array that will later have its index as keyword and value as keyword count.\n $wordCountArr = array();\n\n // Now populate this array with keywrds and the occurance count\n if ( is_array($allTheWords) ) {\n foreach ( $allTheWords as $key => $val ) {\n $val = strtolower($val);\n if ( isset($wordCountArr[$val]) ) {\n $wordCountArr[$val]++;\n } else {\n $wordCountArr[$val] = 1;\n }\n }\n }\n\n // Sort array by the number of repetitions\n arsort($wordCountArr);\n\n //Keep first 10 keywords, throw other keywords\n $wordCountArr = array_slice($wordCountArr, 0, 10);\n\n // Now generate comma separated list from the array\n $words=\"\";\n foreach ($wordCountArr as $key=>$value)\n $words .= \", \" . $key ;\n\n // Trim list of comma separated keyword list and return the list\n return trim($words,\",\");\n }", "private function _match($keyword, $string) {\n\t\t//sanitize\n\t\tforeach (array(' ', '-', '_') AS $key => $val) {\n\t\t\t$keyword = str_replace($val, '', $keyword);\n\t\t\t$string = str_replace($val, '', $string);\n\t\t}\n\t\t\n\t\t$keyword = strtolower($keyword);\n\t\t$string = ' '.strtolower($string);\n\t\tif (!$keyword || !$string) return false;\n\t\t\n\t\tif (strpos($string, $keyword) >= 1) return true;\n\t}", "public function supportsLogicKeywords(): bool;", "public function keywords_array()\n\t{\n\t\treturn array_map(\"trim\", explode(\",\", $this->meta_keywords));\n\t}", "public function setKeyWords()\n {\n if (empty($this->sqlKeywords)) {\n $this->sqlKeywords = [\"abort\",\"absolute\",\"access\",\"action\",\"add\",\"admin\",\"after\",\"aggregate\",\"all\",\"also\",\"alter\",\"always\",\"analyse\",\"analyze\",\"and\",\"any\",\"array\",\"as\",\"asc\",\"assertion\",\"assignment\",\"asymmetric\",\"at\",\"attribute\",\"authorization\",\"backward\",\"before\",\"begin\",\"between\",\"bigint\",\"binary\",\"bit\",\"boolean\",\"both\",\"by\",\"cache\",\"called\",\"cascade\",\"cascaded\",\"case\",\"cast\",\"catalog\",\"chain\",\"char\",\"character\",\"characteristics\",\"check\",\"checkpoint\",\"class\",\"close\",\"cluster\",\"coalesce\",\"collate\",\"collation\",\"column\",\"comment\",\"comments\",\"commit\",\"committed\",\"concurrently\",\"configuration\",\"conflict\",\"connection\",\"constraint\",\"constraints\",\"content\",\"continue\",\"conversion\",\"copy\",\"cost\",\"create\",\"cross\",\"csv\",\"cube\",\"current\",\"current_catalog\",\"current_date\",\"current_role\",\"current_schema\",\"current_time\",\"current_timestamp\",\"current_user\",\"cursor\",\"cycle\",\"data\",\"database\",\"day\",\"deallocate\",\"dec\",\"decimal\",\"declare\",\"default\",\"defaults\",\"deferrable\",\"deferred\",\"definer\",\"delete\",\"delimiter\",\"delimiters\",\"depends\",\"desc\",\"dictionary\",\"disable\",\"discard\",\"distinct\",\"do\",\"document\",\"domain\",\"double\",\"drop\",\"each\",\"else\",\"enable\",\"encoding\",\"encrypted\",\"end\",\"enum\",\"escape\",\"event\",\"except\",\"exclude\",\"excluding\",\"exclusive\",\"execute\",\"exists\",\"explain\",\"extension\",\"external\",\"extract\",\"false\",\"family\",\"fetch\",\"filter\",\"first\",\"float\",\"following\",\"for\",\"force\",\"foreign\",\"forward\",\"freeze\",\"from\",\"full\",\"function\",\"functions\",\"global\",\"grant\",\"granted\",\"greatest\",\"group\",\"grouping\",\"handler\",\"having\",\"header\",\"hold\",\"hour\",\"identity\",\"if\",\"ilike\",\"immediate\",\"immutable\",\"implicit\",\"import\",\"in\",\"including\",\"increment\",\"index\",\"indexes\",\"inherit\",\"inherits\",\"initially\",\"inline\",\"inner\",\"inout\",\"input\",\"insensitive\",\"insert\",\"instead\",\"int\",\"integer\",\"intersect\",\"interval\",\"into\",\"invoker\",\"is\",\"isnull\",\"isolation\",\"join\",\"key\",\"label\",\"language\",\"large\",\"last\",\"lateral\",\"leading\",\"leakproof\",\"least\",\"left\",\"level\",\"like\",\"limit\",\"listen\",\"load\",\"local\",\"localtime\",\"localtimestamp\",\"location\",\"lock\",\"locked\",\"logged\",\"mapping\",\"match\",\"materialized\",\"maxvalue\",\"method\",\"minute\",\"minvalue\",\"mode\",\"month\",\"move\",\"name\",\"names\",\"national\",\"natural\",\"nchar\",\"next\",\"no\",\"none\",\"not\",\"nothing\",\"notify\",\"notnull\",\"nowait\",\"null\",\"nullif\",\"nulls\",\"numeric\",\"object\",\"of\",\"off\",\"offset\",\"oids\",\"on\",\"only\",\"operator\",\"option\",\"options\",\"or\",\"order\",\"ordinality\",\"out\",\"outer\",\"over\",\"overlaps\",\"overlay\",\"owned\",\"owner\",\"parallel\",\"parser\",\"partial\",\"partition\",\"passing\",\"password\",\"placing\",\"plans\",\"policy\",\"position\",\"preceding\",\"precision\",\"prepare\",\"prepared\",\"preserve\",\"primary\",\"prior\",\"privileges\",\"procedural\",\"procedure\",\"program\",\"quote\",\"range\",\"read\",\"real\",\"reassign\",\"recheck\",\"recursive\",\"ref\",\"references\",\"refresh\",\"reindex\",\"relative\",\"release\",\"rename\",\"repeatable\",\"replace\",\"replica\",\"reset\",\"restart\",\"restrict\",\"returning\",\"returns\",\"revoke\",\"right\",\"role\",\"rollback\",\"rollup\",\"row\",\"rows\",\"rule\",\"savepoint\",\"schema\",\"scroll\",\"search\",\"second\",\"security\",\"select\",\"sequence\",\"sequences\",\"serializable\",\"server\",\"session\",\"session_user\",\"set\",\"setof\",\"sets\",\"share\",\"show\",\"similar\",\"simple\",\"skip\",\"smallint\",\"snapshot\",\"some\",\"sql\",\"stable\",\"standalone\",\"start\",\"statement\",\"statistics\",\"stdin\",\"stdout\",\"storage\",\"strict\",\"strip\",\"substring\",\"symmetric\",\"sysid\",\"system\",\"table\",\"tables\",\"tablesample\",\"tablespace\",\"temp\",\"template\",\"temporary\",\"text\",\"then\",\"time\",\"timestamp\",\"to\",\"trailing\",\"transaction\",\"transform\",\"treat\",\"trigger\",\"trim\",\"true\",\"truncate\",\"trusted\",\"type\",\"types\",\"unbounded\",\"uncommitted\",\"unencrypted\",\"union\",\"unique\",\"unknown\",\"unlisten\",\"unlogged\",\"until\",\"update\",\"user\",\"using\",\"vacuum\",\"valid\",\"validate\",\"validator\",\"value\",\"values\",\"varchar\",\"variadic\",\"varying\",\"verbose\",\"version\",\"view\",\"views\",\"volatile\",\"when\",\"where\",\"whitespace\",\"window\",\"with\",\"within\",\"without\",\"work\",\"wrapper\",\"write\",\"xml\",\"xmlattributes\",\"xmlconcat\",\"xmlelement\",\"xmlexists\",\"xmlforest\",\"xmlparse\",\"xmlpi\",\"xmlroot\",\"xmlserialize\",\"year\",\"yes\",\"zone\"];\n }\n }", "public function setKeywords($keywords) {\n $this->properties['keywords'] = $keywords;\n\n return $this;\n }", "protected function getKeywordsExample()\n {\n return '<p><b>' . __('Example') . '</b><p><p>[name][, {color} color][, {size} measurements||size][, {category}] <p>' . __('will be transformed into') . '<br>\n <p>CN Clogs Beach/Garden Clog, Blue color, 10 size, Shoes';\n }", "function cleanSearchTerms($arg) {\r\n return explode(\" \", preg_replace(\"/[^a-zA-Z0-9]+/\", \" \", strtolower(trim($arg))));\r\n}", "public function get_keywords()\n\t{\n\t\treturn $this->keywords;\n\t}", "public function setKeyWord($key){\n $this->keyword = $key;\n }", "public function stdWrap_keywords($content = '')\n {\n return $this->keywords($content);\n }", "public function getKeywords()\n {\n return addslashes(trim(join($this->__keywordsDelimiter, $this->__keywords)));\n }", "function remove_ignored_keywords_from_array($keywords_array)\n\t{\n\t\t//Load all short search terms we wish to ignore\n\t\t$path_and_filename = SITE_ROOT_DIR . '/config/ignored_search_terms.txt';\n\t\tif(!file_exists($path_and_filename))\n\t\t{\n\t\t\ttrigger_error('ignored search terms config file is missing',E_USER_WARNING);\n\t\t\treturn $keywords_array;\n\t\t}\n\t\t\t\n\t\t$ignored_search_terms = file_get_contents($path_and_filename);\n\t\t$ignored_search_terms_as_array = explode(',',$ignored_search_terms);\n\n\t\t//Remove ignored search terms\n\t\t$clean_keywords = array_diff($keywords_array,$ignored_search_terms_as_array);\n\t\n\t\t//Remove short keywords < 2 chars\n\t\t$long_keywords = array_filter($clean_keywords,create_function('$keyword','return strlen($keyword) > 2;'));\n\t\t$nice_keywords = array_filter($long_keywords,create_function('$keyword','return strlen($keyword) < 15;'));\n\t\t\n\t\treturn $nice_keywords;\t\t\t\n\t}", "function keywordLengthCheck($keywords): bool{\n\t$keywordError = false;\n\n\t// Check for keyword length\n\tforeach ($keywords as $keyword){\n\n\t\tif (strlen($keyword) > 24){\n\t\t\t$keywordError = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn !$keywordError;\n}", "public function standardization_keyword(&$keyword, $array=0) {\r\n\t\tif($array==1) {\r\n\t\t\tforeach($keyword as $key => $value) {\r\n\t\t\t\t$keyword[$key] = strip_tags(strtolower(trim(str_replace(' ', ' ', $value))));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$keyword = strip_tags(strtolower(trim(str_replace(' ', ' ', $keyword))));\r\n\t\t}\r\n\t\t\r\n\t\treturn $keyword;\r\n\t}", "public function getKeywords($seperator = ' ') {\r\n\t\t$keywords = array();\r\n\t\t// Get tags\r\n\t\tforeach ($this->tags()->getTagMaps() as $tagmap) {\r\n\t\t\t$tag = $tagmap -> getTag();\r\n\t\t\t$keywords[] = $tag -> getTitle();\r\n\t\t}\r\n\r\n\t\t// Return result\r\n\t\tif (null === $seperator) {\r\n\t\t\treturn $keywords;\r\n\t\t}\r\n\t\treturn join($seperator, $keywords);\r\n\t}", "public function extractKeywords(Model $Model, $string = false, $file = false)\n\t{\n\t\t$out = array();\n\t\t\n\t\tif(!isset($string) and !isset($file)) return false;\n\t\t\n\t\tif($file)\n\t\t{\n\t\t\t$finfo = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t$mimetype = finfo_file($finfo, $file);\n\t\t\tfinfo_close($finfo);\n\t\t\t\n\t\t\tif(in_array($mimetype, array_keys($this->parsableMimeTypes)))\n\t\t\t{\n\t\t\t\t$function = $this->parsableMimeTypes[$mimetype];\n\t\t\t\t$string .= $this->$function($Model, $file);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$string = strtolower($string);\n\t\t$string = $this->cleanString($Model, $string);\n\t\t\n\t\t// sanitize the string\n\t\t$string = $this->paranoidSpace($Model, $string, array(' ', '@', '.', '-', '_', '\\''));\n\t\t// remove all common/stop words\n\t\t$string = preg_replace('#\\b('.implode('|',$this->commonWords).')\\b#','', $string);\n\t\t\n\t\t// clean up each word\n\t\t$string = preg_split('/\\s+/', $string);\n\t\tforeach($string as $i => $item)\n\t\t{\n\t\t\t$item = trim($item);\n\t\t\t$item = trim($item, implode('', $this->trimItems));\n\t\t\t\n\t\t\t// keywords must be at least 3 characters long\n\t\t\tif(strlen($item) <= 3) continue;\n\t\t\t$out[$item] = $item;\n\t\t\t\n\t\t}\n\t\t\n\t\tunset($string);\n\t\tsort($out);\n\t\t\n\t\treturn $out;\n\t}", "public function keywords($content)\n {\n $listArr = preg_split('/[,;' . LF . ']/', $content);\n foreach ($listArr as $k => $v) {\n $listArr[$k] = trim($v);\n }\n return implode(',', $listArr);\n }", "public function setOptInKeywords(array $optInKeywords): self\n {\n $this->options['optInKeywords'] = $optInKeywords;\n return $this;\n }", "function buildKeywords($array): string {\n\n $keywords = null;\n\n foreach ( $array as $key => $value ) {\n\n foreach ( $value as $key_2 => $value_2 ) {\n \n if ( next($value) ) {\n $keywords = $keywords . \"(\" . $value_2 . \") OR \";\n } else {\n $keywords = $keywords . \"(\" . $value_2 . \")\";\n }\n \n }\n }\n\n return $keywords;\n}", "public function setKeywords($value)\n {\n return $this->set('Keywords', $value);\n }", "public function setKeywords($keywords)\n {\n $this->keywords = $keywords;\n\n return $this;\n }", "function kCleaner($keywordString){\n\t\tfor($k=0; $k<count($this->exceptChars); $k++){\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t$keywordString = str_ireplace($this->exceptChars[$k], ' ', $keywordString);\n\t\t}\n\n\t\tfunction filter_bad_words($matches) {\n\t\t $exceptWords = array('it'=>'', 'for'=>'', 'and'=>'', 'nor'=>'', 'but'=>'', 'or'=>'', 'yet'=>'', 'so'=>'', 'with'=>'', 'either'=>'', 'also'=>'', 'a'=>'', 'is'=>'', 'at'=>'', 'to'=>'', 'can'=>'', 'than'=>'', 'that'=>'', 'though'=>'', 'till'=>'', 'do'=>'', 'I'=>'', 'me'=>'', 'both'=>'', 'only'=>'', 'not'=>'', 'either'=>'', 'neither'=>'', 'if'=>'', 'as'=>'', 'by'=>'', 'the'=>'', 'in'=>'');\n\t\t $replace = $exceptWords[$matches[0]];\n\t\t return isset($replace) ? $replace : $matches[0];\n\t\t}\n\t\t//remove common words--the exceptwords\n\t\t$keywordString = preg_replace_callback('!\\w+!', 'filter_bad_words', $keywordString);\n\t\t\n\t\t//turn the string into array of single words, then remove extra whitespace\n\t\t$this->pieces = array_map('trim',explode(\" \",$keywordString));\n\t\t\n\t\t//remove any duplicate words\n\t\t$this->pieces = array_unique($this->pieces);\n\t\t\n\t\t//remove any empty values\n\t\tforeach($this->pieces as $key => $value) { \n\t\t if($value == '') { \n\t\t\tunset($this->pieces[$key]); \n\t\t } \n\t\t} \n\t\t//make the keys chronological\n\t\t$this->pieces = array_values($this->pieces);\n\t\t\n\t\t//if after all of that pieces is empty then make it NULL\n\t\tif(count($this->pieces)==0){\n\t\t\t$this->pieces = NULL;\n\t\t}\n\t}", "static public function cleanKeyword($keyword) {\n\t\tif (!is_string($keyword))\n\t\t\treturn '';\n\n\t\t// Do not allow starting or trailing space, odd/repeating space characters, double quotes\n\t\treturn preg_replace(array('/\\s+/u', '/[\",]/u'), array(' ', ''), trim($keyword));\n\t}", "function h_keywords($cat_id){\r\n\t\r\n\t\tconnect(); \r\n\t\t\t$cp_id = clean_input($cat_id);\r\n\t\t\t\r\n\t\t\r\n\t\t\t//\r\n\t\t\tif(!empty($_GET['cat_id'])){ \r\n\t\t\t\t$xyquery = \"SELECT cat_desc_long FROM categories WHERE cat_id = '$cp_id'\";\r\n\t\t\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t\t\tlist($cat_desc_long)= mysql_fetch_row($xyresult);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading2 = explode('<h2>',$heading);\r\n\t\t\t$heading2 = explode('</h2>', $heading2[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading2[0])) echo \",\".$heading2[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading3 = explode('<h1>',$heading);\r\n\t\t\t$heading3 = explode('</h1>', $heading3[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading3[0])) echo \",\".$heading3[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading4 = explode('<h3>',$heading);\r\n\t\t\t$heading4 = explode('</h3>', $heading4[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading4[0])) echo \",\".$heading4[0];\t\r\n\t\t\t\t\r\n\t\t}", "static function save_keywords($post_id, $keywords){\n\t\t\tupdate_post_meta($post_id, 'affiliate_keywords', $keywords);\n\t\t}", "function _show_search_keywords ($input = \"\") {\n\t\t// Get input params\t\t\n\t\t$display_limit\t\t\t= intval(!empty($input[\"display_limit\"]) && $input[\"display_limit\"] < $this->KEYWORDS_DISPLAY_LIMIT ? $input[\"display_limit\"] : $this->KEYWORDS_DISPLAY_LIMIT);\n\t\t$search_words\t\t\t= $input[\"search_words\"];\n\t\t$type\t\t\t\t\t= in_array($input[\"display_type\"], [\"most_popular\",\"random\"]) ? $input[\"display_type\"] : \"most_popular\";\n\t\t$only_from_current_site\t= intval($input[\"only_from_current_site\"]);\n\t\t$fill_with_popular\t\t= $input[\"fill_with_popular\"];\n\t\t// Most popular keywords\n\t\t$this->_most_popular = main()->get_data(\"search_keywords_most_popular\");\n\t\t// Stop if no popular keywords found\n\t\tif (empty($this->_most_popular)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Process keywords by given params\n\t\tif (empty($search_words) && $type == \"most_popular\") {\n\t\t\t$array_from_db = $this->_most_popular;\n\t\t} else {\n\t\t\tif (!empty($search_words)) {\n\t\t\t\t$search_words_array = explode(\",\", $search_words);\n\t\t\t}\n\t\t\t$array_from_db = false; // No not change this, depends on cache !!\n\t\t\t// Try to get data from cache\n\t\t\tif (!empty($search_words_array) && $this->CACHE_ENABLED) {\n\t\t\t\t$se_cache_name = md5($search_words);\n\t\t\t\t$array_from_db = $this->_cache_get($se_cache_name);\n\t\t\t}\n\t\t\t// Prepare and get data from db\n\t\t\tif (!empty($search_words_array) && empty($array_from_db) && !is_array($array_from_db)) {\n\t\t\t\t// use full text searching\n\t\t\t\tif ($this->USE_FULLTEXT_SEARCH) {\n\t\t\t\t\t$search_words_sql = \" AND MATCH(text) AGAINST ('\"._es(implode(\" \", $search_words_array)).\"' IN BOOLEAN MODE) \";\n\t\t\t\t} else {\n\t\t\t\t\tforeach ((array)$search_words_array as $k => $v) {\n\t\t\t\t\t\t$v = trim($v);\n\t\t\t\t\t\tif (empty($v)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmp_array[$k] = \" text LIKE '%\"._es($v).\"%' \";\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($tmp_array)) {\n\t\t\t\t\t\t$search_words_sql = \" AND (\".implode(\" OR \", $tmp_array).\") \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$Q = db()->query(\n\t\t\t\t\t\"SELECT site_url,text,hits \n\t\t\t\t\tFROM \".db('search_keywords').\" \n\t\t\t\t\tWHERE 1 \".(!empty($search_words_sql) ? $search_words_sql : \"\").\" \n\t\t\t\t\t\".($this->MIN_HITS_DISPLAY_LIMIT ? \"HAVING hits > \".$this->MIN_HITS_DISPLAY_LIMIT : \"\").\"\n\t\t\t\t\tORDER BY \".(/*$type == \"most_popular\" ? */\"hits DESC\"/* : \"RAND()\"*/).\" \n\t\t\t\t\tLIMIT \".intval($display_limit * $this->DATA_FROM_DB_MULTIPLY)\n\t\t\t\t);\n\t\t\t\twhile ($A = db()->fetch_assoc($Q)) $array_from_db[$A[\"text\"]] = $A[\"site_url\"];\n\t\t\t\t// Put cache file\n\t\t\t\tif ($this->CACHE_ENABLED) {\n\t\t\t\t\t$this->_cache_put($se_cache_name, $array_from_db);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ((array)$array_from_db as $text => $site_url) {\n\t\t\tif ($only_from_current_site && (false === strpos($site_url, SITE_ADVERT_URL))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!strlen($text)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Another check for display number\n\t\t\tif (++$c > $display_limit && $type == \"most_popular\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Process items\n\t\t\t$text = str_replace(\"+\", \" \", str_replace([\"\\\"\",\"'\"], \"\", $text));\n\t\t\t$keywords[$text] = [\n\t\t\t\t\"site_url\"\t=> _prepare_html($site_url),\n\t\t\t\t\"text\"\t\t=> _prepare_html($text),\n\t\t\t];\n\t\t}\n\t\t// Emulate ORDER BY RAND()\n\t\tif ($type != \"most_popular\") {\n\t\t\t$_tmp_keys = array_keys((array)$keywords);\n\t\t\tif (!empty($_tmp_keys)) {\n\t\t\t\tshuffle($_tmp_keys);\n\t\t\t}\n\t\t\tforeach ((array)$_tmp_keys as $_cur_keyword) {\n\t\t\t\tif (++$d > $display_limit) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$_tmp_keywords[$_cur_keyword] = $keywords[$_cur_keyword];\n\t\t\t}\n\t\t\tif (!empty($_tmp_keywords)) {\n\t\t\t\t$keywords = $_tmp_keywords;\n\t\t\t\tunset($_tmp_keywords);\n\t\t\t\tunset($_tmp_keys);\n\t\t\t}\n\t\t}\n\t\t// Check if we are using search words mode but found too less records\n\t\t$need_to_fill = (int)$display_limit - count($keywords);\n\t\t// Check if we need to fill \n\t\tif (!empty($search_words) && $fill_with_popular && $need_to_fill) {\n\t\t\t// Prepare most popular keywords\n\t\t\t$prepared_popular = [];\n\t\t\tforeach ((array)$this->_most_popular as $text => $site_url) {\n\t\t\t\tif ($only_from_current_site && (false === strpos($site_url, SITE_ADVERT_URL))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!strlen($text)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$prepared_popular[$text] = $site_url;\n\t\t\t}\n\t\t\t// Process fill\n\t\t\tfor ($i = 1; $i <= $need_to_fill; $i++) {\n\t\t\t\t$rand_key\t= array_rand($prepared_popular);\n\t\t\t\t$text\t\t= $rand_key;\n\t\t\t\t$site_url\t= $prepared_popular[$text];\n\t\t\t\t// Process items\n\t\t\t\t$text = str_replace(\"+\", \" \", str_replace([\"\\\"\",\"'\"], \"\", $text));\n\t\t\t\t$keywords[$text] = [\n\t\t\t\t\t\"site_url\"\t=> _prepare_html($site_url),\n\t\t\t\t\t\"text\"\t\t=> _prepare_html($text),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\tif (isset($keywords[\"\"])) {\n\t\t\tunset($keywords[\"\"]);\n\t\t}\n\t\t// Stop here if nothing to display\n\t\tif (empty($keywords)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Process template\n\t\t$replace = [\n\t\t\t\"keywords\" => $keywords,\n\t\t];\n\t\treturn tpl()->parse(__CLASS__.\"/main\", $replace);\n\t}", "public function searchByKeyword($query);", "static public function setTopicKeywords($keywords, $topicid, $userid, $glue=null) {\n\t\tif (!isset(self::$_topics [$topicid][$userid])) {\n\t\t\tself::loadTopics(array($topicid), $userid);\n\t\t}\n\t\t$oldkeywords = isset(self::$_topics [$topicid][$userid]) ? self::$_topics [$topicid][$userid] : array();\n\n\t\t// Load new keywords missing from the topic\n\t\t$keywords = self::cleanKeywords($keywords, $glue);\n\t\tself::loadKeywords($keywords);\n\n\t\t$keywords = array_flip($keywords);\n\t\t$dellist = array_diff_key ( $oldkeywords, $keywords );\n\t\t$addlist = array_diff_key ( $keywords, $oldkeywords );\n\t\tforeach ($dellist as $keyword=>$i) {\n\t\t\t$instance = self::$_instances [$keyword];\n\t\t\t$instance->delTopic($topicid, $userid);\n\t\t}\n\t\tforeach ($addlist as $keyword=>$i) {\n\t\t\t$instance = self::$_instances [$keyword];\n\t\t\t$instance->addTopic($topicid, $userid);\n\t\t}\n\t\treturn $keywords;\n\t}", "function searchJobs() {\n $keyword = htmlspecialchars(trim($_POST['keyword']), ENT_QUOTES);\n $category = $_POST['category'];\n $location = $_POST['location'];\n \n // keyword parse\n if (!empty($keyword)) {\n $keyword = explode(' ', $keyword);\n \n if (count($keyword) > 1) {\n $default = 1;\n \n foreach ($keyword as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $key_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $key_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($keyword) == 1)\n $key_regexp = '[[:<:]]' . $keyword[0] . '[[:>:]]';\n \n $keyword = implode(' ', $keyword);\n } else\n $key_regexp = null;\n\n // category parse\n if (count($category) > 1) {\n $default = 1;\n \n foreach ($category as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $cat_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $cat_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($category) == 1)\n $cat_regexp = '[[:<:]]' . $category[0] . '[[:>:]]';\n else\n $cat_regexp = null;\n\n $category = implode(' ', $category);\n \n // location parse\n if (count($location) > 1) {\n $default = 1;\n \n foreach ($location as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $loc_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $loc_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($location) == 1)\n $loc_regexp = '[[:<:]]' . $location[0] . '[[:>:]]';\n else\n $loc_regexp = null;\n\n $location = implode(' ', $location);\n \n connectDatabase();\n \n if (!empty($key_regexp)) {\n if (ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp')\n ORDER BY pk DESC\");\n\n } elseif (ereg(\"all\", $cat_regexp) && !ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp') AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n } elseif (!ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp') AND\n fk_category REGEXP '$cat_regexp'\n ORDER BY pk DESC\");\n\n } else {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp') AND\n fk_category REGEXP '$cat_regexp' AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n }\n } else {\n if (ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1\n ORDER BY pk DESC\");\n \n } elseif (ereg(\"all\", $cat_regexp) && !ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n } elseif (!ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n fk_category REGEXP '$cat_regexp'\n ORDER BY pk DESC\");\n\n } else {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n fk_category REGEXP '$cat_regexp' AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n }\n }\n\n $ip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n $date = date('Y-m-d');\n $total = mysql_num_rows($result);\n \n if (mysql_num_rows($result) > 0) {\n $default = 1;\n \n while ($row = mysql_fetch_object($result)) {\n if ($default == 1)\n $fk_job = $row->pk;\n else {\n $fk_job .= \" $row->pk\";\n }\n\n $default++;\n }\n } else\n $fk_job = 'EMPTY';\n\n queryDatabase(\"INSERT INTO search (ip, keyword, total, searched, fk_category, fk_job, fk_location)\n VALUES ('$ip', '$keyword', $total, '$date', '$category', '$fk_job', '$location')\");\n\n header('Location: ' . HOME . 'browse.php?pk=' . mysql_insert_id());\n}", "public function getKeywords(): string\n {\n return $this->keywords;\n }", "public function __construct($keyword)\n {\n //\n $this->keyword = $keyword;\n print_r($keyword);\n }", "public function replaceKeywords() {\n\t\t$keywords = array(\n\t\t\t'{user}'\t=> '([a-zA-Z0-9_-])+',\n\t\t\t'{slug}'\t=> '([\\.a-zA-Z0-9_-])+',\n\t\t\t'{category}'=> '([a-zA-Z0-9_-])+',\n\t\t\t'{year}'\t=> '([0-9]{4})+',\n\t\t\t'{month}'\t=> '([0-9]{1,2})+',\n\t\t\t'{day}'\t\t=> '([0-9]{1,2})+',\n\t\t\t'{id}'\t\t=> '([0-9])+'\n\t\t);\n\t\t$newkeys = str_replace(array_keys($keywords), $keywords, array_keys($this->routes));\n\t\t$this->routes = array_combine($newkeys, $this->routes);\n\t}", "public function checkKeyWord(){\n if(trim($this->keyword) == '') return false;\n return 1;\n }", "function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }", "public static function escapeQuery($keywords)\n {\n $searchKeywords = preg_replace('/([\\+\\-!\\(\\)\\{\\}\\[\\]\\^\"~\\*\\?:\\/\\|&]|AND|OR|NOT)/', '\\\\\\${1}', $keywords);\n return $searchKeywords;\n }", "abstract public function getRandomKeyword();", "public function getKeywords()\n {\n return array_map('urldecode', $this->keywords);\n }", "public function keywords()\n\t{\n\t\treturn $this->keywords;\n\t}" ]
[ "0.6760217", "0.67298156", "0.66766256", "0.66588056", "0.66191334", "0.6601229", "0.658645", "0.65519875", "0.65166223", "0.649937", "0.6493257", "0.64515346", "0.6446157", "0.64094114", "0.6359649", "0.6325844", "0.6290572", "0.6279972", "0.62715644", "0.6240141", "0.6234312", "0.6225686", "0.62218845", "0.6219624", "0.61894846", "0.6179805", "0.61733085", "0.61721164", "0.6167891", "0.6152313", "0.61482507", "0.61306405", "0.6127751", "0.6113138", "0.6095594", "0.6089954", "0.60851943", "0.6081287", "0.6037994", "0.6037407", "0.6003409", "0.5985008", "0.59553206", "0.59373564", "0.5937187", "0.5935297", "0.59260935", "0.5916974", "0.58829176", "0.5878908", "0.5852398", "0.5842911", "0.5837761", "0.5817968", "0.5810479", "0.5809292", "0.58088666", "0.58017343", "0.5778343", "0.5764198", "0.5756187", "0.57237464", "0.56911874", "0.5690581", "0.5658054", "0.5651038", "0.5649283", "0.56490034", "0.564271", "0.56112033", "0.55876124", "0.5576679", "0.55689913", "0.5547942", "0.5539308", "0.5538947", "0.5530524", "0.5508472", "0.55024266", "0.5498904", "0.5490769", "0.548914", "0.54863614", "0.5483868", "0.5482979", "0.5479538", "0.5475555", "0.54746705", "0.5466688", "0.5457022", "0.544345", "0.5439935", "0.54300857", "0.54250455", "0.5423071", "0.5416979", "0.54152143", "0.5409968", "0.5394931", "0.53888595", "0.5386435" ]
0.0
-1
$default = 'lat=20&lon=90'; // somewhere reeeeeal hot
function detect_city($ip) { $lat = '11.825138'; //NYC: 40.8291 $lon = '42.590275'; $city = "Djibouti"; // Get location by IP $ip_json = file_get_contents("http://freegeoip.net/json/".$ip); $json_loc = json_decode($ip_json,true); if ($json_loc["latitude"]) return array($json_loc["latitude"], $json_loc["longitude"], $json_loc["city"]); else return array($lat, $lon, $city); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function either_param_string($name, $default = false)\n{\n $ret = __param(array_merge($_POST, $_GET), $name, $default);\n if ($ret === null) {\n return null;\n }\n\n if ($ret === $default) {\n if ($default === null) {\n return null;\n }\n\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret, true);\n\n return $ret;\n}", "public function getDefaultParams();", "function param($key, $default = NULL)\n{\n\treturn isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;\n}", "function GetQueryString($name, $default=\"\") {\n return ValidRequiredQueryString($name) ? $_GET[$name] : $default;\n}", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "public function get_param($str, $default = null){\n\t\tif(isset($_GET[$str]))\n\t\t{\n\t\t\treturn $_GET[$str];\n\t\t}else if(isset($_POST[$str]))\n\t\t{\n\t\t\treturn $_POST[$str];\n\t\t}{\n\t\t\treturn $default;\n\t\t}\n\t}", "public static function getParameter($name,$default=null) {\n\t if(isset($_REQUEST[$name])) {\n\t $value = $_REQUEST[$name];\n\t return Str::trimAll($value);\n\t }\n\t return $default;\n\t}", "function amap_ma_get_default_radius_search_string() {\n $unitmeas = intval(elgg_get_plugin_setting('default_radius', AMAP_MA_PLUGIN_ID));\n if (is_numeric($unitmeas) && $unitmeas > 0)\n $radius = $unitmeas;\n else\n $radius = AMAP_MA_DEFAULT_RADIUS; // default value\n\n return amap_ma_get_radius_string($radius);\n}", "function amap_ma_get_map_default_location_coords() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (empty($map_default_lat) || empty($map_default_lat))\n return AMAP_MA_CUSTOM_DEFAULT_COORDS; // set coords of Europe in case default location is not set\n else\n return $map_default_lat . ',' . $map_default_lng;\n}", "function r($param, $default = null) {\n if (!empty($_REQUEST[$param]))\n return is_array($_REQUEST[$param]) ? $_REQUEST[$param] : trim($_REQUEST[$param]);\n return $default;\n}", "function params_save($params_string)\n\t{\n\t\t$default_value = JRequest::getVar('default_value','','post','string', JREQUEST_ALLOWRAW);\n\t\t$default_value = str_replace('<br>','<br />', $default_value);\n\t\t$default_value = 'default_value-=-'.$default_value.'[;-)# ]';\n\t\t$default_temp = 'default_value-=-'.$this->get_field_param($params_string, 'default_value').'[;-)# ]';\n\t\tif(strpos($params_string, 'default_value-=-')){\n\t\t\t$params_string = str_replace($default_temp, $default_value, $params_string);\n\t\t}else{\n\t\t\t$params_string .= $default_value;\n\t\t}\n\t\treturn $params_string;\n\t}", "function getLatitude($string)\r\n{\r\n\t$coordinate = strstr($string, 'lat=');\r\n\t$coordinate = strstr($coordinate, '&', true);\r\n\t$coordinate = substr($coordinate, 4);\r\n\treturn $coordinate;\r\n}", "function amap_ma_get_map_default_layer() {\n $l_option = trim(elgg_get_plugin_setting('default_layer', AMAP_MA_PLUGIN_ID));\n if (!$l_option)\n $l_option = 'roadmap';\n\n return $l_option;\n}", "function geo_param( $param )\n\t{\n\t\t$this->pieces = explode(\" \", str_replace ( ' O' , ' E' , str_replace( '_', ' ', $param )));\n\t\t$this->get_coor( );\n\t\t\n\t\t$this->latdeg_min = $this->latdeg_max = $this->latdeg;\n\t\t$this->londeg_min = $this->londeg_max = $this->londeg;\n\t\tif ( isset( $this->pieces[0] ) && $this->pieces[0] == \"to\") {\n\t\t\tarray_shift($this->pieces);\n\t\t\t$this->get_coor();\n\t\t\tif ($this->latdeg < $this->latdeg_max) {\n\t\t\t\t$this->latdeg_min = $this->latdeg;\n\t\t\t} else {\n\t\t\t\t$this->latdeg_max = $this->latdeg;\n\t\t\t}\n\t\t\tif ($this->londeg < $this->londeg_max) {\n\t\t\t\t$this->londeg_min = $this->londeg;\n\t\t\t} else {\n\t\t\t\t$this->londeg_max = $this->londeg;\n\t\t\t}\n\t\t\t$this->latdeg = ($this->latdeg_max+$this->latdeg_min) / 2;\n\t\t\t$this->londeg = ($this->londeg_max+$this->londeg_min) / 2;\n\t\t\t$this->coor = array();\n\t\t}\n\t}", "public static function g($value = '', $default = '')\n {\n return isset($_GET[$value]) ? $_GET[$value] : $default;\n }", "function queryparam_GET($key, $default_value = null) {\n\treturn common_param_GET($_GET, $key, $default_value);\n}", "public function getDefaultParameters();", "public function getDefaultParameters();", "function amap_ma_get_map_default_location() {\n $defaultlocation = trim(elgg_get_plugin_setting('map_default_location', AMAP_MA_PLUGIN_ID));\n\n return $defaultlocation;\n}", "function location_cmn($lat, $long, $usegeolocation, $customerno = null) {\n $address = NULL;\n $customerno = (!isset($customerno)) ? $_SESSION['customerno'] : $customerno;\n if (isset($lat) && isset($long)) {\n $GeoCoder_Obj = new GeoCoder($customerno);\n $address = $GeoCoder_Obj->get_location_bylatlong($lat, $long);\n }\n return $address;\n}", "function safe_retrieve_gp($varname, $default='', $null_is_default=false) {\n if ( is_array($_REQUEST) && \n array_key_exists($varname, $_REQUEST) &&\n ( ($_REQUEST[$varname] != null) || (!$null_is_default) ) ) \n return $_REQUEST[$varname];\n return $default;\n}", "public function getParams($default = array()) {\n $params = $this->request->getQuery();\n if (!empty($default)) {\n foreach ($default as $paramName => $paramValue) {\n if (!isset($params[$paramName])) {\n $params[$paramName] = $paramValue;\n }\n }\n }\n return $params;\n }", "function params($key = null, $default = null)\n{\n $request = request($key, $default);\n\n return is_array($request) ? camel_to_underscore($request, true) : $request;\n}", "function RequestVar($name, $default_value = true) {\r\n if (!isset($_REQUEST))\r\n return false;\r\n if (isset($_REQUEST[$name])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_REQUEST[$name]);\r\n return $_REQUEST[$name];\r\n }\r\n return $default_value;\r\n}", "function get_param($key, $default=false){\n if (is_array($key)){\n foreach ($key as $onekey){\n $ret = get_param($onekey);\n if ($ret)\n return $ret;\n }\n }else{ \n \n if ($_GET)\n if (array_key_exists($key,$_GET))\n return $_GET[$key];\n if ($_POST)\n if (array_key_exists($key,$_POST))\n return $_POST[$key]; \n }\n \n return $default;\n}", "function define_default($param, $value) {\n\t\t//\n\t}", "public function loadParam($name, $default = \"\")\n {\n $grep_key = $this->_pregGrepKeys(\"/\\b(?<!-)$name(?!-)\\b/i\", $_REQUEST);\n if (!$grep_key || !array_values($grep_key)[0]) {\n return $default;\n }\n $value = array_values($grep_key)[0];\n $value = Encoding::fixUTF8($value);\n if (get_magic_quotes_gpc() != 1) {\n $value = self::addSlashesExtended($value);\n }\n return $value;\n }", "function cggm_set_var($params, &$smarty)\n{\n $map = '';\n $mod = cms_utils::get_module('CGGoogleMaps');\n if( isset($params['map']) ) {\n $map = $params['map'];\n unset($params['map']);\n }\n else {\n $map = $mod->GetPreference('default_map',0);\n }\n\n foreach( $params as $key => $value ) {\n $mod->add_attr($map,$key,$value);\n }\n}", "function apiGet($key,$default=false) {return isset($_GET[$key]) ? $_GET[$key] : $default;}", "public static function presubmit_get_wsparams($param,$default='') {\n\t\t$paramval = $default;\n\t\tif( !empty($_GET[$param]) ) {\n\t\t\t$paramval = $_GET[$param];\n\t\t}\t\t\n\t\treturn $paramval;\n\t}", "function GetDefaultLocation()\r\n{\r\n $locations = parse_ini_file('./settings/locations.ini', true);\r\n BuildLocations($locations);\r\n \r\n $def = $locations['locations']['default'];\r\n if( !$def )\r\n $def = $locations['locations']['1'];\r\n $loc = $locations[$def]['default'];\r\n if( !$loc )\r\n $loc = $locations[$def]['1'];\r\n \r\n return $locations[$loc];\r\n}", "function get_city($lat, $lon) {\n\t\treturn \"hello\";\n\t}", "function param($key, $defval = '', $safe = TRUE) {\n\tif(!isset($_REQUEST[$key]) || ($key === 0 && empty($_REQUEST[$key]))) {\n\t\tif(is_array($defval)) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn $defval;\n\t\t}\n\t}\n\t$val = $_REQUEST[$key];\n\t$val = param_force($val, $defval, $safe);\n\treturn $val;\n}", "function request($var, $default=NULL) {\n\tif(isset($_REQUEST[$var])) \n\t\treturn $_REQUEST[$var];\n\telse\n\t\treturn $default;\n}", "function amap_ma_get_map_default_location_lat() {\n $map_default_lat = trim(elgg_get_plugin_setting('map_default_lat', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lat))\n return $map_default_lat;\n\n return 0;\n}", "function buildurl($params, $facet=NULL, $newvalue=NULL, $facet2=NULL, $newvalue2=NULL, $facet3=NULL, $newvalue3=NULL, $facet4=NULL, $newvalue4=NULL) {\n\n\tif ($facet) {\n\t\t$params[$facet]=$newvalue;\n\t}\n\n\tif ($facet2) {\n\t\t$params[$facet2]=$newvalue2;\n\t}\n\n\tif ($facet3) {\r\n\t\t$params[$facet3]=$newvalue3;\r\n\t}\n\t\r\n\tif ($facet4) {\r\n\t\t$params[$facet4]=$newvalue4;\r\n\t}\r\n\t\n\t// if param false, delete it\n\tforeach ($params as $key=>$value) {\n\n\t\tif ($value==false) {\n\t\t\tunset($params[$key]);\n\t\t}\n\n\t}\n\n\t$uri = \"?\".http_build_query($params);\n\n\treturn $uri;\n\n}", "function param($inName, $inDefault) {\r\n\t\t$WHITE_LIST_PATTERN = '/(\\d\\w -_\\/)*/i';\r\n\t\t$WHITE_LIST_REPLACE = '${1}';\r\n\t\tif (isset($_REQUEST[$inName])) {\r\n\t\t\t// caveat: vulnerability\r\n\t\t\t$GLOBALS[$inName] = preg_replace($WHITE_LIST_PATTERN, $WHITE_LIST_REPLACE, $_REQUEST[$inName]);\r\n\t\t} else {\r\n\t\t\t$GLOBALS[$inName] = $inDefault;\r\n\t\t}\r\n\t}", "public function get_default_params()\n {\n }", "function get_map_defaults () {\r\n\t\t$defaults = get_option('agm_google_maps');\r\n\t\tif (!isset($defaults['image_limit'])) $defaults['image_limit'] = 10;\r\n\t\tif (isset($defaults['use_custom_fields'])) unset($defaults['use_custom_fields']);\r\n\t\tif (isset($defaults['custom_fields_map'])) unset($defaults['custom_fields_map']);\r\n\t\tif (isset($defaults['custom_fields_options'])) unset($defaults['custom_fields_options']);\r\n\t\treturn array_filter($defaults);\r\n\t}", "function _getParameter( $name, $default='' ) {\n\t\t$return = \"\";\n\t\t$return = $this->params->get( $name, $default );\n\t\treturn $return;\n\t}", "function inputGet($key, $default = \"\")\n{\n\tif(inputHas($key)) {\n\t\treturn $_REQUEST[$key];\n\t} else {\n\t\treturn $default;\n\t}\n}", "function get_param($key, $default_value = '')\n\t{\n\t\t$val = ee()->TMPL->fetch_param($key);\n\t\t\n\t\tif($val == '') \n\t\t\treturn $default_value;\n\t\telse\n\t\t\treturn $val;\n\t}", "function LT_request($variable, $default) {\n\tglobal $LT_SQL;\n\tif (array_key_exists($variable, $_REQUEST))\n\t\treturn $LT_SQL->real_escape_string($_REQUEST[$variable]);\n\telse\n\t\treturn $LT_SQL->real_escape_string($default);\n}", "function queryparam_fetch($key, $default_value = null) {\n\t// check GET first\n\t$val = common_param_GET($_GET, $key, $default_value);\n\tif ($val != $default_value) {\n\t\tif ( is_string($val) )\n\t\t\t$val = urldecode($val);\n\t\treturn $val;\n\t}\n\n\t// next, try POST (with form encode)\n\t$val = common_param_GET($_POST, $key, $default_value);\n\tif ($val != $default_value)\n\t\treturn $val;\n\n\t// next, try to understand rawinput as a json string\n\n\t// check pre-parsed object\n\tif ( !isset($GLOBALS['phpinput_parsed']) ) {\n\t\t$GLOBALS['phpinput'] = file_get_contents(\"php://input\");\n\t\tif ( $GLOBALS['phpinput'] ) {\n\t\t\t$GLOBALS['phpinput_parsed'] = json_decode($GLOBALS['phpinput'], true);\n\t\t\tif ( $GLOBALS['phpinput_parsed'] ) {\n\t\t\t\telog(\"param is available as: \" . $GLOBALS['phpinput']);\n\t\t\t}\n\t\t}\n\t}\n\n\t// check key in parsed object\n\tif ( isset($GLOBALS['phpinput_parsed']) ) {\n\t\tif ( isset($GLOBALS['phpinput_parsed'][$key]) ) {\n\t\t\t$val = $GLOBALS['phpinput_parsed'][$key];\n\t\t\tif ($val != $default_value)\n\t\t\t\treturn $val;\n\t\t}\n\t}\n\n\treturn $default_value;\n}", "function GetVar($name, $default_value = false) {\r\n if (!isset($_GET)) {\r\n return false;\r\n }\r\n if (isset($_GET[$name])) {\r\n if (!get_magic_quotes_gpc()) {\r\n return InjectSlashes($_GET[$name]);\r\n }\r\n return $_GET[$name];\r\n }\r\n return $default_value;\r\n}", "function getOrDefault($var, $default) {\n return (isset($_GET[$var])) ? $_GET[$var] : $default;\n}", "function get_request_gp($key, $default=false, $stripslahes=false)\n{\n return Request::GetValueGP($key, $default, $stripslahes);\n}", "function get_query_string($key) {\n $val = null;\n if (!empty($_GET[$key])) {\n $val = $_GET[$key];\n }\n return $val;\n}", "protected function getValue($name, $default='')\r\n {\r\n if (isset($_GET[$name])) {\r\n return $_GET[$name];\r\n } else {\r\n return $default;\r\n }\r\n }", "function get_param_string($name, $default = false, $no_security = false)\n{\n $ret = __param($_GET, $name, $default);\n if (($ret === '') && (isset($_GET['require__' . $name])) && ($default !== $ret) && ($_GET['require__' . $name] !== '0')) {\n // We didn't give some required input\n set_http_status_code('400');\n warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n }\n\n if ($ret === $default) {\n return $ret;\n }\n\n if (strpos($ret, ':') !== false && function_exists('cms_url_decode_post_process')) {\n $ret = cms_url_decode_post_process($ret);\n }\n\n require_code('input_filter');\n check_input_field_string($name, $ret);\n\n if ($ret === false) { // Should not happen, but have seen in the wild via malicious bots sending corrupt URLs\n $ret = $default;\n }\n\n return $ret;\n}", "function location($gps){\n\tglobal $api;\n\t$lat = $gps['lat'];\n\t$lon = $gps['lon'];\n\t$endpoint = \"https://us1.locationiq.com/v1/reverse.php?key=$api&lat=$lat&lon=$lon&format=json\";\n\techo \"https://www.google.com/maps/search/?q=$lat,$lon\\n\";\n\treturn file_get_contents($endpoint);\n}", "function amap_ma_get_map_default_location_lon() {\n $map_default_lng = trim(elgg_get_plugin_setting('map_default_lng', AMAP_MA_PLUGIN_ID));\n\n if (!empty($map_default_lng))\n return $map_default_lng;\n\n return 0;\n}", "function get_request_g($key, $default=false, $stripslahes=false)\n{\n return Request::GetValueG($key, $default, $stripslahes);\n}", "function param($p, $def=\"\") {\n\t//global $_SERVER, $_SESSION, $_COOKIE, $_REQUEST, $_POST, $_GET;\n\tif (!empty($_SESSION)&&isset($_SESSION[$p])) return $_SESSION[$p];\n\telse if (isset($_COOKIE[$p])) return $_COOKIE[$p];\n\telse if (isset($_REQUEST[$p])) return $_REQUEST[$p];\n\telse if (isset($_POST[$p])) return $_POST[$p];\n\telse if (isset($_GET[$p])) return $_GET[$p];\n\telse return $def;\n}", "function post($param, $default = null) {\n static $rawPost;\n if (!empty($_POST[$param]))\n return is_array($_POST[$param]) ? $_POST[$param] : trim($_POST[$param]);\n if (!$rawPost) parse_str(file_get_contents('php://input'), $rawPost);\n if (!empty($rawPost[$param])) {\n return $rawPost[$param];\n }\n return $default;\n}", "function getVal( $name, $default = '' ) {\r\n\t\t\r\n\t\tif( isset( $_REQUEST[$name] ) ) return $this->unquote( $_REQUEST[$name] );\r\n\t\telse return $this->unquote( $default );\r\n\t}", "function getGetParam($name,$def=null) {\n\treturn htmlentities(isset($_GET[$name]) ? $_GET[$name] : $def,ENT_QUOTES);\n\t\t\n}", "function options($default) {\r\n $default = array_merge(\r\n $default,\r\n array(\r\n \"maximum_result_set\" => \"3\",\r\n \"default_title\" => __(\"Find nearby locations\", 'slp-experience'),\r\n 'radius_label' => __('Within', 'slp-experience'),\r\n \"search_label\" => __(\"Zip Code\", 'slp-experience'),\r\n \"button_label\" => __(\"Go!\", 'slp-experience'),\r\n )\r\n );\r\n\r\n return $default;\r\n }", "function get_optional_param($param, $default = '')\n{\n global $params;\n\n if (empty($params[$param]))\n return $default;\n\n return $params[$param];\n}", "function assign_to_data($urldata, $passed_defaults = array())\n{\n\t$data_array = array();\n\t$default_field_values = array('Enter Time', 'Enter First Name', 'Enter Last Name');\n\tif(!empty($passed_defaults)){\n\t\t$default_field_values = array_unique(array_merge($default_field_values, $passed_defaults));\n\t}\n\t\n\tforeach($urldata AS $key=>$value)\n\t{\n\t\tif(in_array($value, $default_field_values)){\n\t\t\t$value = '_';\n\t\t}\n\t\t\n\t\tif($value !== FALSE && trim($value) != '' && !array_key_exists($value, $urldata))\n\t\t{\n\t\t\tif($value == '_'){\n\t\t\t\t$data_array[$key] = '';\n\t\t\t} else {\n\t\t\t\t$data_array[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $data_array;\n}", "public function getDefaultLongitude(): string|null;", "function getCountry($country = 'Serbia')\n{\n return $country;\n}", "public function param( $key, $default = null ) {\n\t\treturn isset( $_REQUEST[ $key ] ) && $_REQUEST[ $key ] !== '' ? $_REQUEST[ $key ] : $default;\n\t}", "public function query_string($default = '', $xss_clean = null)\n\t{\n\t\t$query_string = $this->server('QUERY_STRING', $xss_clean);\n\t\treturn ($query_string) ? $query_string : $default;\n\t}", "function get($var, $default = null) {\n\t\tif(empty($this->_uriParams)) {\n\t\t\t$this->processUriParams();\n\t\t}\n\t\tif(isset($_GET[$var])) {\n\t\t\treturn urldecode(is_numeric($var) ? (int) $var : $var);\n\t\t}\n\t\treturn isset($this->_uriParams[$var]) ? $this->_uriParams[$var] : $default;\n\t}", "function ds_swap_search_parameter($query_string) {\n\n $query_string_array = array();\n\n // convert the query string to an array\n parse_str($query_string, $query_string_array);\n\n // if \"search\" is in the query string\n if(isset($query_string_array['q'])){\n $query_string_array['s'] = $query_string_array['q']; // replace \"s\" with value of \"search\"\n unset($query_string_array['q']); // delete \"search\" from query string\n }\n\n return http_build_query($query_string_array, '', '&'); // Return our modified query variables\n}", "function get_query_var($query_var, $default_value = '')\n {\n }", "public function testGetParameterReturnsDefaultIfParameterNotSet()\n {\n $uniq = uniqid();\n $request = new Request($this->config, []);\n $result = $request->getParameter('samoflange', $uniq);\n\n $this->assertSame($uniq, $result);\n }", "function wpsl_get_default_settings() {\n\n $default_settings = array(\n 'api_browser_key' => '',\n 'api_server_key' => '',\n 'api_language' => 'en',\n 'api_region' => '',\n 'api_geocode_component' => 0,\n 'distance_unit' => 'km',\n 'max_results' => '[25],50,75,100',\n 'search_radius' => '10,25,[50],100,200,500',\n 'force_postalcode' => 0,\n 'marker_effect' => 'bounce',\n 'address_format' => 'city_state_zip',\n 'hide_distance' => 0,\n 'hide_country' => 0,\n 'show_contact_details' => 0,\n 'clickable_contact_details' => 0,\n 'auto_locate' => 1,\n 'autocomplete' => 0,\n 'autoload' => 1,\n 'autoload_limit' => 50,\n 'run_fitbounds' => 1,\n 'zoom_level' => 3,\n 'auto_zoom_level' => 15,\n 'start_name' => '',\n 'start_latlng' => '',\n 'height' => 350,\n 'map_type' => 'roadmap',\n 'map_style' => '',\n 'type_control' => 0,\n 'streetview' => 0,\n 'results_dropdown' => 1,\n 'radius_dropdown' => 1,\n 'category_filter' => 0,\n 'category_filter_type' => 'dropdown',\n 'infowindow_width' => 225,\n 'search_width' => 179,\n 'label_width' => 95,\n 'control_position' => 'left',\n 'scrollwheel' => 1,\n 'marker_clusters' => 0,\n 'cluster_zoom' => 0,\n 'cluster_size' => 0,\n 'new_window' => 0,\n 'reset_map' => 0,\n 'template_id' => 'default',\n 'listing_below_no_scroll' => 0,\n 'direction_redirect' => 0,\n 'more_info' => 0,\n 'store_url' => 0,\n 'phone_url' => 0,\n 'marker_streetview' => 0,\n 'marker_zoom_to' => 0,\n 'more_info_location' => 'info window',\n 'mouse_focus' => 0,\n 'start_marker' => 'red.png',\n 'store_marker' => 'blue.png',\n 'editor_country' => '',\n 'editor_hours' => wpsl_default_opening_hours(),\n 'editor_hour_input' => 'dropdown',\n 'editor_hour_format' => 12,\n 'editor_map_type' => 'roadmap',\n 'hide_hours' => 0,\n 'permalinks' => 0,\n 'permalink_remove_front' => 0,\n 'permalink_slug' => __( 'stores', 'wpsl' ),\n 'category_slug' => __( 'store-category', 'wpsl' ),\n 'infowindow_style' => 'default',\n 'show_credits' => 0,\n 'debug' => 0,\n 'deregister_gmaps' => 0,\n 'delay_loading' => 0,\n 'start_label' => __( 'Start location', 'wpsl' ),\n 'search_label' => __( 'Your location', 'wpsl' ),\n 'search_btn_label' => __( 'Search', 'wpsl' ),\n 'preloader_label' => __( 'Searching...', 'wpsl' ),\n 'radius_label' => __( 'Search radius', 'wpsl' ),\n 'no_results_label' => __( 'No results found', 'wpsl' ),\n 'results_label' => __( 'Results', 'wpsl' ),\n 'more_label' => __( 'More info', 'wpsl' ),\n 'directions_label' => __( 'Directions', 'wpsl' ),\n 'no_directions_label' => __( 'No route could be found between the origin and destination', 'wpsl' ),\n 'back_label' => __( 'Back', 'wpsl' ),\n 'street_view_label' => __( 'Street view', 'wpsl' ),\n 'zoom_here_label' => __( 'Zoom here', 'wpsl' ),\n 'error_label' => __( 'Something went wrong, please try again!', 'wpsl' ),\n 'limit_label' => __( 'API usage limit reached', 'wpsl' ),\n 'phone_label' => __( 'Phone', 'wpsl' ),\n 'fax_label' => __( 'Fax', 'wpsl' ),\n 'email_label' => __( 'Email', 'wpsl' ),\n 'url_label' => __( 'Url', 'wpsl' ),\n 'hours_label' => __( 'Hours', 'wpsl' ),\n 'category_label' => __( 'Category filter', 'wpsl' ),\n 'category_default_label' => __( 'Any', 'wpsl' )\n );\n\n return $default_settings;\n}", "public static function GetFormValues(){\n self::$KeyValue = isset($_REQUEST[\"KeyValue\"]) ? $_REQUEST[\"KeyValue\"] : \"\"; \n \n if (self::$KeyValue == \"\"){\n\t self::$KeyValue = \"new zealand\"; \n\t }\n\t \n\t \n\t self::$KeyValue = urlencode(self::$KeyValue);\n\t \n\t self::$MapLattitude = isset($_REQUEST[\"MapLattitude\"]) ? $_REQUEST[\"MapLattitude\"] : \"\"; \n\t self::$MapLongtitude= isset($_REQUEST[\"MapLongtitude\"]) ? $_REQUEST[\"MapLongtitude\"] : \"\"; \n\t \n }", "function get_query_str_value($name) {\n\n return (array_key_exists($name, $_GET) ? $_GET[$name] : null);\n}", "function get_form_val($key, $default='', $getfirst=TRUE)\r\n{\r\n if ($getfirst)\r\n {\r\n return (empty($_GET[$key]) ? (empty($_POST[$key]) ? $default : $_POST[$key]) : $_GET[$key]);\r\n }\r\n else\r\n {\r\n return (empty($_POST[$key]) ? (empty($_GET[$key]) ? $default : $_GET[$key]) : $_POST[$key]);\r\n }\r\n}", "function either_param_integer($name, $default = false)\n{\n $ret = __param(array_merge($_POST, $_GET), $name, ($default === false) ? $default : (($default === null) ? '' : strval($default)), true, null); // $_REQUEST contains cookies too, so can't use\n if (($default === null) && ($ret === '')) {\n return null;\n }\n if (!is_numeric($ret)) {\n require_code('failure');\n $ret = _param_invalid($name, $ret, true);\n }\n $reti = intval($ret);\n if (($reti > 2147483647) || ($reti < -2147483648)) { // TODO: #3046 in tracker\n require_code('failure');\n _param_invalid($name, null, true);\n }\n return $reti;\n}", "public static function get($key, $default = \"\") {\n return(isset($_GET[$key]) ? $_GET[$key] : $default);\n }", "function grabUserLocation($input){\n $user_city = $input;\n $request_url = \"http://maps.googleapis.com/maps/api/geocode/json?address=\".$user_city.\"%20Canada&sensor=false\";\n $USERJSON = file_get_contents($request_url);\n $result = json_decode($USERJSON);\n $lat=$result->results[0]->geometry->location->lat;\n $long=$result->results[0]->geometry->location->lng;\n return compact('lat','long');\n}", "function url_merge($url, $name = null, $val = null, $ignore = null){\n $u = $url;\n $r = [];\n $f = explode('?',$url);\n $q = '';\n $u = $f[0];\n if(count($f)>1){\n $q = $f[1];\n }\n if($name){\n if(is_string($name)) $r[$name] = $val;\n elseif(is_array($name)){\n foreach($name as $n => $v){\n if(is_string($n)){\n $r[$n] = $v;\n }\n }\n }\n \n }\n if($q || $r){\n $u.='?'.parse_query_string($q, $r, $ignore);\n }\n return $u;\n }", "function location_query_arg( $link ) {\r\n\r\n\tif (isset($_GET['location']) && $_GET['location']) :\r\n\r\n\t\t$location = wp_strip_all_tags($_GET['location']);\r\n\t\t$link = add_query_arg('location', urlencode( utf8_uri_encode( $location ) ), $link);\r\n\r\n\tendif;\r\n\r\n\treturn $link;\r\n}", "public function params(?string $key = null, ?string $default = null);", "public static function GET($key, $default = '') {\n if (isset($_GET[$key])) {\n return $_GET[$key];\n }\n return $default;\n }", "protected function defaultParams()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function getQueryParam($key, $default = null) {\r\n\t\tif (isset($_GET[$key])) {\r\n\t\t\treturn $_GET[$key];\r\n\t\t}\r\n\t\treturn $default;\r\n\t}", "function get_request_sgp($key, $default=false, $stripslahes=false)\n{\n return Request::GetValueSGP($key, $default, $stripslahes);\n}", "function sa_dev_qstring($arg=null,$value=null,$qstring=null){\n // null value removes arg from querystring\n $query_string = array();\n if($qstring==null) $qstring = $_SERVER['QUERY_STRING'];\n parse_str($qstring, $query_string); \n if(!empty($arg)) $query_string[$arg] = $value;\n $new_str = http_build_query($query_string,'','&amp;');\n return $new_str;\n}", "function get_location( $args = array() ) {\n\t$throttle_geonames = $throttle_ip2location = $location = false;\n\n\t// For a country request, no lat/long are returned.\n\tif ( isset( $args['country'] ) ) {\n\t\t$location = array(\n\t\t\t'country' => $args['country'],\n\t\t);\n\t}\n\n\t// Coordinates provided\n\tif (\n\t\t! $location && (\n\t\t\t! empty( $args['latitude'] ) && is_numeric( $args['latitude'] ) &&\n\t\t\t! empty( $args['longitude'] ) && is_numeric( $args['longitude'] )\n\t\t)\n\t) {\n\t\t$location = array(\n\t\t\t'description' => false,\n\t\t\t'latitude' => $args['latitude'],\n\t\t\t'longitude' => $args['longitude'],\n\t\t);\n\t}\n\n\t// City was provided by the user:\n\tif ( ! $location && isset( $args['location_name'] ) ) {\n\t\t$throttle_geonames = mt_rand( 1, 100 ) <= THROTTLE_GEONAMES;\n\n\t\tif ( $throttle_geonames ) {\n\t\t\treturn 'temp-request-throttled';\n\t\t}\n\n\t\t$country_code = get_country_code_from_locale( $args['locale'] ?? '' );\n\t\t$guess = guess_location_from_city( $args['location_name'], $args['timezone'] ?? '', $country_code );\n\n\t\t$country_types = array(\n\t\t\t// See http://download.geonames.org/export/dump/featureCodes_en.txt\n\n\t\t\t'A.PCL', // political entity\n\t\t\t'A.PCLD', // dependent political entity\n\t\t\t'A.PCLF', // freely associated state\n\t\t\t'A.PCLH', // historical political entity\ta former political entity\n\t\t\t'A.PCLI', // independent political entity\n\t\t\t'A.PCLIX', // section of independent political entity\n\t\t\t'A.PCLS', // semi-independent political entity\n\t\t\t'A.PRSH', // parish an ecclesiastical district\n\t\t\t'A.TERR', // territory\n\t\t\t'A.ZN', // zone\n\t\t);\n\n\t\tif ( $guess && in_array( $guess->type, $country_types, true ) ) {\n\t\t\t$location = array(\n\t\t\t\t'country' => $guess->country,\n\t\t\t\t'description' => $guess->name,\n\t\t\t);\n\t\t} elseif ( $guess ) {\n\t\t\t$location = array(\n\t\t\t\t'description' => $guess->name,\n\t\t\t\t'latitude' => $guess->latitude,\n\t\t\t\t'longitude' => $guess->longitude,\n\t\t\t\t'country' => $guess->country,\n\t\t\t);\n\t\t} else {\n\t\t\t$guess = guess_location_from_country( $args['location_name'] );\n\n\t\t\tif ( $guess ) {\n\t\t\t\t$location = array(\n\t\t\t\t\t'country' => $guess['country_short'],\n\t\t\t\t\t'description' => $guess['country_long'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $location ) {\n\t\tif ( isset( $args['location_name'] ) || isset( $args['ip'] ) || ! empty( $args['latitude'] ) || ! empty( $args['longitude'] ) ) {\n\t\t\t// If any of these are specified, and no localitity was guessed based on the above checks, bail with no location.\n\t\t\t$location = false;\n\t\t} else {\n\t\t\t// No specific location details.\n\t\t\t$location = array();\n\t\t}\n\t}\n\n\t// IP:\n\tif ( ! $location && isset( $args['ip'] ) && ! isset( $args['location_name'] ) ) {\n\t\t$throttle_ip2location = mt_rand( 1, 100 ) <= THROTTLE_IP2LOCATION;\n\n\t\tif ( $throttle_ip2location ) {\n\t\t\treturn 'temp-request-throttled';\n\t\t}\n\n\t\t$guess = guess_location_from_ip( $args['ip'] );\n\n\t\tif ( $guess ) {\n\t\t\t$location = array(\n\t\t\t\t'description' => $guess->ip_city,\n\t\t\t\t'latitude' => $guess->ip_latitude,\n\t\t\t\t'longitude' => $guess->ip_longitude,\n\t\t\t\t'country' => $guess->country_short,\n\n\t\t\t\t/*\n\t\t\t\t * ip2location's EULA forbids exposing the derived location publicly, so flag the\n\t\t\t\t * data for internal use only.\n\t\t\t\t */\n\t\t\t\t'internal' => true,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $location;\n}", "private function getRequest( $value, $default = null, $from = '' ) {\n\t\t$from\t= strtolower( $from );\n\t\t$ret\t= $default;\n\n\t\tif( $from && isset( $this->request->{$from}[$value] ) ) {\n\t\t\t$ret = $this->request->{$from}[$value];\n\t\t}else{\n\t\t\tif( isset( $this->request->post[$value] ) ) {\n\t\t\t\t$ret = $this->request->post[$value];\n\t\t\t}elseif( isset( $this->request->get[$value] ) ) {\n\t\t\t\t$ret = $this->request->get[$value];\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}", "function GetPost($name, $default=\"\") {\n return ValidRequiredPost($name) ? $_POST[$name] : $default;\n}", "public function map()\n\t{\n\t\t$map = 'http://maps.googleapis.com/maps/api/staticmap?zoom=12&format=png&maptype=roadmap&style=element:geometry|color:0xf5f5f5&style=element:labels.icon|visibility:off&style=element:labels.text.fill|color:0x616161&style=element:labels.text.stroke|color:0xf5f5f5&style=feature:administrative.land_parcel|element:labels.text.fill|color:0xbdbdbd&style=feature:poi|element:geometry|color:0xeeeeee&style=feature:poi|element:labels.text.fill|color:0x757575&style=feature:poi.business|visibility:off&style=feature:poi.park|element:geometry|color:0xe5e5e5&style=feature:poi.park|element:labels.text|visibility:off&style=feature:poi.park|element:labels.text.fill|color:0x9e9e9e&style=feature:road|element:geometry|color:0xffffff&style=feature:road.arterial|element:labels|visibility:off&style=feature:road.arterial|element:labels.text.fill|color:0x757575&style=feature:road.highway|element:geometry|color:0xdadada&style=feature:road.highway|element:labels|visibility:off&style=feature:road.highway|element:labels.text.fill|color:0x616161&style=feature:road.local|visibility:off&style=feature:road.local|element:labels.text.fill|color:0x9e9e9e&style=feature:transit.line|element:geometry|color:0xe5e5e5&style=feature:transit.station|element:geometry|color:0xeeeeee&style=feature:water|element:geometry|color:0xc9c9c9&style=feature:water|element:labels.text.fill|color:0x9e9e9e&size=640x250&scale=4&center='.urlencode(trim(preg_replace('/\\s\\s+/', ' ', $this->cfg->address)));\n\t\t$con = curl_init($map);\n\t\tcurl_setopt($con, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($con, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($con, CURLOPT_RETURNTRANSFER, 1);\n\t\treturn response(curl_exec($con))->header('Content-Type', 'image/png');\n\t}", "function build_url_params ($url_params, $params = '')\n{\n\tforeach ($url_params as $k=>$v)\n\t{\n\t\t$params .= (strlen($params) ? '&' : '?') . $k . '=' . urlencode($v);\n\t}\n\t\n\treturn $params;\n}", "function ffd_get_base_location() {\r\n\t$default = apply_filters( 'ffd_get_base_location', get_option( 'ffd_default_country' ) );\r\n\r\n\treturn ffd_format_country_state_string( $default );\r\n}", "function get($key, $default = null)\n{\n if (is_array($key)) {\n foreach ($key as $val) {\n if (isset($_GET[$val])) {\n return $_GET[$val];\n }\n }\n } elseif (isset($_GET[$key])) {\n return $_GET[$key];\n }\n return $default;\n}", "function get_request_p($key, $default=false, $stripslahes=false)\n{\n return Request::GetValueP($key, $default, $stripslahes);\n}", "function GetRequest (&$r, $var, $default = null) {\n\tif (isset($r[$var])) {\n\t\t$val = $r[$var];\n\n\t\t// Deal with special chars in parameters\n\t\t// magic_quotes_gpc is deprecated from php 5.4.0\n\t\tif (version_compare(PHP_VERSION, '5.4.0', '>=')\n\t\t\t|| !get_magic_quotes_gpc())\n\t\t\t$val = AddslashesRecursive($val);\n\t}\n\telse\n\t\t$val = $default;\n\treturn $val;\n}", "function getGetParam($name,$def=null) {\n if (isset($_GET[$name]))\n return html_entity_decode(htmlentities($_GET[$name],ENT_QUOTES),ENT_NOQUOTES);\n return $def;\n\n }", "public function getDefaultParams()\n {\n $defaults = array(\n );\n return $defaults;\n }", "function GetGet ($var, $default='') {\n\treturn GetRequest($_GET, $var, $default);\n\t/*\n\tif (isset($_GET[$var]))\n\t\t$val = $_GET[$var];\n\telse\n\t\t$val = $default;\n\treturn $val;\n\t*/\n}", "function getParam( $key, $default = NULL ) {\n return Yii::app()->request->getParam( $key, $default );\n}", "function get_defaults_multi($defaults,$param)\n{\n\t$values=array();\n\tforeach ($defaults as $key=>$val)\n\t{\n\t\tif (substr($param,0,2)=='x_')\n\t\t{\n\t\t\tif (preg_match('#^'.str_replace('x','\\d',preg_quote($param,'#')).'$#',$key)!=0)\n\t\t\t{\n\t\t\t\t$values[]=$val;\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tif (substr($key,0,strlen($param)+1)==$param.'_')\n\t\t\t{\n\t\t\t\t$values[]=$val;\n\t\t\t}\n\t\t}\n\t}\n\treturn $values;\n}", "function sanitizeLocation($input) {\n if($input != '0' AND $input != '1') {\n add_settings_error('wcp_location', 'wcp_location_error', 'Display location must be either beginning or end.');\n return get_option('wcp_location');\n }\n return $input;\n }", "private function set_geocoding_baseURL() {\n\t\t\tif ( isset( $this->geocodeURL ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Google JavaScript API geocoding key\n\t\t\t// Falls back to the browser key if not set\n\t\t\t//\n\t\t\t$the_key = ! empty ( $this->slplus->SmartOptions->google_geocode_key->value ) ? $this->slplus->SmartOptions->google_geocode_key->value : '';\n\t\t\tif ( empty( $the_key ) ){\n\t\t\t\t$the_key = ! empty ( $this->slplus->SmartOptions->google_server_key->value ) ? $this->slplus->SmartOptions->google_server_key->value : '';\n\t\t\t}\n\t\t\t$server_key = ! empty ( $the_key ) ? '&key=' . $the_key : '';\n\n\t\t\t// Build the URL with all the params\n\t\t\t//\n\t\t\t$this->geocodeURL =\n\t\t\t\t'https://maps.googleapis.com/maps/api/geocode/json?' .\n\t\t\t\t'?language=' . $this->slplus->options_nojs['map_language'] .\n\t\t\t\t$server_key .\n\t\t\t\t'&address=';\n\t\t}", "function Display_google_map($Nom, $Adresse) {\n\n\n}", "function getVariable($nombre, $default = '') {\r\n\tif (isset($_POST[$nombre])) {\r\n\t\treturn $_POST[$nombre];\r\n\t} elseif(isset($_GET[$nombre])) {\r\n\t\treturn $_GET[$nombre];\r\n\t} else {\r\n\t\treturn $default;\r\n\t}\r\n}" ]
[ "0.6160282", "0.5904833", "0.58765966", "0.58227557", "0.58046216", "0.569465", "0.5656685", "0.5643509", "0.56384593", "0.5630813", "0.5624525", "0.5581986", "0.55533946", "0.5542384", "0.55391586", "0.55310005", "0.5525151", "0.5525151", "0.55212426", "0.548466", "0.547569", "0.5469492", "0.5445918", "0.5439469", "0.5438426", "0.54378504", "0.54366535", "0.54136276", "0.5381482", "0.5372173", "0.53461874", "0.53386956", "0.533651", "0.53348583", "0.5330731", "0.53293324", "0.5321503", "0.5317936", "0.53174925", "0.53135335", "0.5305966", "0.5290201", "0.52830106", "0.528184", "0.52746844", "0.52707046", "0.52606666", "0.5259182", "0.5253165", "0.5249509", "0.5245176", "0.52345246", "0.52299154", "0.5229043", "0.5226266", "0.5220322", "0.52009654", "0.5196025", "0.5195656", "0.51954484", "0.519342", "0.5182051", "0.5180461", "0.5174154", "0.517398", "0.5164486", "0.5156037", "0.5150625", "0.5141927", "0.51338536", "0.51230466", "0.51225674", "0.51101965", "0.51100916", "0.5082778", "0.5082172", "0.5079611", "0.507785", "0.5072651", "0.5066376", "0.5064484", "0.5064059", "0.5063379", "0.5063115", "0.50573283", "0.50534695", "0.5052646", "0.50393546", "0.50385636", "0.50349873", "0.5029193", "0.5028374", "0.5021892", "0.5013067", "0.50102115", "0.5008045", "0.50036925", "0.5000446", "0.49891904", "0.49874416", "0.4983477" ]
0.0
-1
Sets the left node
public function setLeft(?RedBlackNode $left): void { $this->left = $left; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLeftChild(Node $leftChild)\n\t{\n\t\t$this->leftChild = $leftChild;\n\t}", "public function setLeftValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'left');\n return $node->$setter($value);\n }", "public function setLeft(HtmlElementInterface $left): void\n {\n $this->left = $left;\n }", "public function setLeft($val)\n {\n $this->_propDict[\"left\"] = floatval($val);\n return $this;\n }", "public function setLeftField($name) {\n $this->_left = $name;\n return $this;\n }", "public function testGetNodeWithLeftValue() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objBuilder->addNode($objNode1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\t\t$objBuilder->addNode($objNode2);\n\t\t$objNode3 = new LeftRightTreeTraversal\\Node(3);\n\t\t$objBuilder->addNode($objNode3);\n\t\t$objNode4 = new LeftRightTreeTraversal\\Node(4);\n\t\t$objBuilder->addNode($objNode4);\n\n\t\t$objNode2->setParentNode($objNode1);\n\t\t$objNode3->setParentNode($objNode1);\n\t\t$objNode4->setParentNode($objNode2);\n\n\t\t// non-existent node left-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(42))->isNull();\n\t\t// existent node left-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(5))->isNull();\n\n\t\t$objBuilder->compute();\n\n\t\t// non-existent node left-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(42))->isNull();\n\t\t// existent node left-value, with graph computation\n\t\t$this->object($objBuilder->getNodeWithLeftValue(5))->isIdenticalTo($objNode3);\n\t\t// existent node left-value, with graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(6))->isNull();\n\t}", "public function setNestedSetLeftKey($nslk)\n {\n $this->isNestedSetLeftKey = (boolean) $nslk;\n }", "public function getLeftValue(BaseObject $node)\n {\n $getter = self::forgeMethodName($node, 'get', 'left');\n return $node->$getter();\n }", "public function moveLeft() : Tetris {\n // check if the block can be moved to the left\n if ($this->block->canMove('left')) {\n // move the block to the left\n $this->block->setX($this->block->getX() - 1);\n }\n\n // return the game for chained method calling\n return $this;\n }", "function create_left_node($id, $values)\r\n\t{\r\n\t\t$this->_verify_user_values($values); \r\n\t\t// invalid target node, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\r\n \tdebug :: error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock();\n\t\t\r\n\t\t// If the target node is a rootnode we virtually want to create a new root node\r\n\t\tif ($this_node['root_id'] == $this_node['id'])\r\n\t\t{\r\n\t\t\treturn $this->create_root_node($values, $id, false, NESE_MOVE_BEFORE);\r\n\t\t} \r\n\r\n\t\t$insert_data = array();\r\n\t\t$parent = $this->get_parent($id);\r\n\t\t$insert_data['parent_id'] = $parent['id'];\r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1\r\n WHERE root_id=%s AND ordr>=%s AND level=%s AND l BETWEEN %s AND %s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['ordr'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['level'],\r\n\t\t\t\t\t\t\t\t\t\t\t$parent['l'], $parent['r']); \n\t\t\t\r\n\t\t// Update all nodes which have dependent left and right values\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN l >= %s THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN (r >= %s OR l >= %s) THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data['ordr'] = $this_node['ordr'];\r\n\t\t$insert_data['l'] = $this_node['l'];\r\n\t\t$insert_data['r'] = $this_node['l'] + 1;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['level'] = $this_node['level'];\r\n\r\n\t\tif (!$this->_dumb_mode || !$node_id = isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->_node_table, implode(', ', array_keys($qr)), implode(', ', $qr));\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "public function getLeftChild()\n\t{\n\t\treturn $this->leftChild;\n\t}", "public function setOnlyLeft()\n {\n $this->value['text-align'] = 'left';\n $this->_onlyLeft = true;\n }", "public function left(): ?RedBlackNode\n {\n return $this->left;\n }", "public function getLeft()\n {\n return $this->left;\n }", "public function getLeft()\n {\n return $this->left;\n }", "public function getLeftSide() {\n return $this->left;\n }", "public function getLeft()\n {\n if (array_key_exists(\"left\", $this->_propDict)) {\n return $this->_propDict[\"left\"];\n } else {\n return null;\n }\n }", "public function getLeftExpr()\n {\n return $this->leftExpr;\n }", "function getLeftValue($a_node_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getLeftValued(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$query = 'SELECT lft FROM '.$this->table_tree.' '.\n\t\t\t'WHERE child = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\treturn $row->lft;\n\t}", "function setLeftAxis($axis)\n {\n return $this->setAxis(0, $axis);\n }", "public function getLeft() {}", "function &getLeftSibling()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_leftsibling;\n\t}", "function moveLeft()\n {\n $this->position--;\n if ($this->position < 0) {\n $this->position++;\n array_unshift($this->line, '_');\n }\n }", "function getLeft() ;", "public function setLeftColumnSize(int $leftColumnSize): void\n {\n $this->leftColumnSize = $leftColumnSize;\n }", "function &getLeftSibling()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_leftsibling;\n\t}", "function _fillLeft()\n {\n return $this->_left + $this->_padding['left'];\n }", "public function getTreeLefts() {\n return $this->treeLefts;\n }", "public function rebuild_tree($left = 1, $target = NULL)\n {\n // check if using target or self as root and load if not loaded\n if (is_null($target) AND ! $this->loaded)\n {\n return FALSE;\n }\n elseif (is_null($target))\n {\n $target = $this;\n }\n\n if ( ! $target->loaded)\n {\n $target = $this->factory_item($target);\n }\n\n // Use the current node left value for entire tree\n if (is_null($left))\n {\n $left = $target->left;\n }\n\n $target->lock();\n $right = $left + 1;\n $children = $target->children();\n\n foreach ($children as $child)\n {\n $right = $child->rebuild_tree($right);\n }\n\n $target->left = $left;\n $target->right = $right;\n $target->save();\n $target->unlock();\n\n return $right + 1;\n }", "public function getLeftTable()\n {\n return $this->left;\n }", "public function setLeft(Pattern $left)\n {\n $this->left = $left;\n return $this;\n }", "public function setLeftMargin($margin)\n {\n $this->_lMargin = $margin;\n\n if ($this->getDocument()->getPageNo() > 0 && $this->_x < $margin) {\n $this->_x = $margin;\n }\n }", "protected function setParent(MenuNode $node)\n {\n $this->parent = $node;\n }", "abstract public function moveLeft($id);", "public function setNestedLeftIndex($nestedLeftIndex);", "public function setParent(Node $parent)\n {\n $this->parent = $parent;\n }", "public function leftnav ()\n\t{\n\t}", "public function setStartingPoint($left, $top)\n {\n $this->left = (int) $left;\n $this->top = (int) $top;\n }", "function SetParent(&$ParentNode)\n {\n $this->ParentNode = &$ParentNode;\n $this->Level = $this->ParentNode->Level + 1;\n }", "public function left ( $count = 0 ) {\n $this->_currentPosition = array(\n $this->_currentPosition[0] - $count,\n $this->_currentPosition[1],\n );\n return $this;\n }", "public function setRoot(&$node):RootedGraph;", "public function left($table, $on, $field = null, $comparitor = null);", "public function getLeftForeignKey()\n {\n return $this->leftforeignkey;\n }", "public function LeftNavigation() {\n\t\t$pageId = (isset($_GET['page'])) ? (int)$_GET['page'] : 0;\n \n if(($page = DataObject::get_by_id('Page', $pageId))) {\n Director::set_current_page($page);\n }\n\n return $this->renderWith('LeftNavigation');\n }", "public function setRootNode( ezcTreeNode $node )\n {\n $db = $this->dbh;\n\n $q = $db->createDeleteQuery();\n $q->deleteFrom( $db->quoteIdentifier( $this->indexTableName ) );\n $s = $q->prepare();\n $s->execute();\n $this->store->deleteDataForAllNodes();\n\n $q = $db->createInsertQuery();\n $q->insertInto( $db->quoteIdentifier( $this->indexTableName ) )\n ->set( 'parent_id', \"null\" )\n ->set( 'id', $q->bindValue( $node->id ) );\n $s = $q->prepare();\n $s->execute();\n\n $this->store->storeDataForNode( $node, $node->data );\n }", "public function shiftNode();", "public function setLeftPixels($var)\n {\n GPBUtil::checkInt32($var);\n $this->left_pixels = $var;\n\n return $this;\n }", "public function setLeftCnt($value)\n {\n return $this->set(self::_LEFT_CNT, $value);\n }", "public function testSetPrintLeftMarginDefault()\n {\n $this -> printer -> setPrintLeftMargin();\n $this -> checkOutput(\"\\x1b@\\x1dL\\x00\\x00\");\n }", "public function toLeft($right);", "public function moveAsRoot() {\n if (!$this->hasManyRoots)\n throw new CException(Yii::t('yiiext', 'Many roots mode is off.'));\n\n if ($this->getIsNewRecord())\n throw new CException(Yii::t('yiiext', 'The node should not be new record.'));\n\n if ($this->getIsDeletedRecord())\n throw new CDbException(Yii::t('yiiext', 'The node should not be deleted.'));\n\n if ($this->isRoot())\n throw new CException(Yii::t('yiiext', 'The node already is root node.'));\n\n $db = $this->getDbConnection();\n $extTransFlag = $db->getCurrentTransaction();\n\n if ($extTransFlag === null)\n $transaction = $db->beginTransaction();\n\n try {\n $left = $this->{$this->leftAttribute};\n $right = $this->{$this->rightAttribute};\n $levelDelta = 1 - $this->{$this->levelAttribute};\n $delta = 1 - $left;\n\n $this->updateAll(\n array(\n $this->leftAttribute => new CDbExpression($db->quoteColumnName($this->leftAttribute) . sprintf('%+d', $delta)),\n $this->rightAttribute => new CDbExpression($db->quoteColumnName($this->rightAttribute) . sprintf('%+d', $delta)),\n $this->levelAttribute => new CDbExpression($db->quoteColumnName($this->levelAttribute) . sprintf('%+d', $levelDelta)),\n $this->rootAttribute => $owner->getPrimaryKey(),\n ), $db->quoteColumnName($this->leftAttribute) . '>=' . $left . ' AND ' .\n $db->quoteColumnName($this->rightAttribute) . '<=' . $right . ' AND ' .\n $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount, array(CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++ => $this->{$this->rootAttribute}));\n\n $this->shiftLeftRight($right + 1, $left - $right - 1);\n\n if ($extTransFlag === null)\n $transaction->commit();\n\n $this->correctCachedOnMoveBetweenTrees(1, $levelDelta, $this->getPrimaryKey());\n } catch (Exception $e) {\n if ($extTransFlag === null)\n $transaction->rollBack();\n\n throw $e;\n }\n\n return true;\n }", "public function setMarginLeft($margin) {\n\t}", "function push_nodelist() {\r\n\t\t\r\n\t\tif (!is_null($this->right)) {\r\n\t\t\t$this->nodelists[] = array($this->right, $this->nodelist);\r\n\t\t\t\r\n\t\t} \r\n\t\t\r\n\t}", "public function testAddGetLeft($item)\n {\n self::$obj->addLeft($item);\n $this->assertSame($item, self::$obj->getLeft(-1), 'addLeft() and getLeft() do not modify the same property');\n }", "public function testAddNode() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$this->boolean($objBuilder->addNode(new LeftRightTreeTraversal\\Node(0)))->isTrue();\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this\n\t\t\t->array($arrayResult)\n\t\t\t\t->hasKey(0)\n\t\t\t\t->size->isEqualTo(1)\n\t\t\t->array($arrayResult[0])\n\t\t\t\t->hasKey('id')\n\t\t\t\t->hasKey('left')\n\t\t\t\t->hasKey('right')\n\t\t;\n\n\t\t/*\n\t\t * Same test with a custom config\n\t\t */\n\n\t\t$hashConfig = array(\n\t\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder($hashConfig);\n\t\t$this->boolean($objBuilder->addNode(new LeftRightTreeTraversal\\Node(0)))->isTrue();\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this\n\t\t\t->object($objBuilder)\n\t\t\t->isNotNull($objBuilder)\n\t\t\t->isInstanceOf('LeftRightTreeTraversal\\TreeBuilder')\n\n\t\t\t->array($arrayResult)\n\t\t\t\t->hasKey(0)\n\t\t\t\t->size->isEqualTo(1)\n\t\t\t->array($arrayResult[0])\n\t\t\t\t->hasKey('custom_id')\n\t\t\t\t->hasKey('custom_left')\n\t\t\t\t->hasKey('custom_right')\n\t\t\t->integer($arrayResult[0]['custom_id'])\n\t\t\t\t->isEqualTo(0)\n\t\t\t->integer($arrayResult[0]['custom_left'])\n\t\t\t\t->isEqualTo(0)\n\t\t\t->integer($arrayResult[0]['custom_right'])\n\t\t\t\t->isEqualTo(1)\n\t\t;\n\n\t}", "public function setParent(Module_Node_Model $parent = null);", "public static function setNode($node) {\r\n static::$node = $node;\r\n }", "public function getLeftLocalKey()\n {\n return $this->leftlocalkey;\n }", "private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }", "public static function rebuild_tree($model, $local_parent, $site_id, $left)\n\t{\n\t\t# the right value of this node is the left value + 1\n\t\t$right = $left+1;\n\t\t\n\t\t$navigation_items = ORM::factory($model)\n\t\t\t->where(array(\n\t\t\t\t'fk_site'\t\t=> $site_id,\n\t\t\t\t'local_parent'\t=> $local_parent,\n\t\t\t))\n\t\t\t->orderby('position', 'asc')\n\t\t\t->find_all();\t\n\n\t\tforeach($navigation_items as $item)\n\t\t{\n\t\t # recursive function for each child of this node\n\t\t # $right is the current right value;\n\t\t # incremented by the rebuild_tree function\n\t\t $right = Tree::rebuild_tree($model, $item->id, $site_id, $right);\n\t\t}\n\t\t\n\t\t# we've got the left value, and now that we've processed\n\t\t# the children of this node we also know the right value\n\t\t$item = ORM::factory($model, $local_parent); \n\t\t$item->lft = $left;\n\t\t$item->rgt = $right;\n\t\t$item->save();\t\t\n\n\t\t# return the right value of this node + 1\n\t\treturn $right+1;\n\t}", "public function leftNavPanel() {\r\n\t\tprint file_get_contents('html/leftnav.html');\r\n\t}", "public function isNestedSetLeftKey()\n {\n return $this->isNestedSetLeftKey;\n }", "public function getLeft(): MarginInterface\n {\n return $this->left;\n }", "public function testSetParentByNodes() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\n\t\t$this->boolean($objBuilder->setParentByNodes($objNode1, $objNode2))->isTrue();\n\t\t$hashChecks = array(\n\t\t\t1 => array(\n\t\t\t\t'id' \t\t=> 1,\n\t\t\t\t'parent'\t=> null,\n\t\t\t\t'left'\t\t=> 0,\n\t\t\t\t'right'\t\t=> 3\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t'id' \t\t=> 2,\n\t\t\t\t'parent'\t=> 1,\n\t\t\t\t'left'\t\t=> 1,\n\t\t\t\t'right'\t\t=> 2\n\t\t\t)\n\t\t);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\t\t$this->array($arrayResult)->size->isEqualTo(2);\n\t\tforeach ($arrayResult as $hashNode) {\n\t\t\t$this\n\t\t\t\t->array($hashNode)\n\t\t\t\t\t->hasKey('id')\n\t\t\t\t\t->hasKey('left')\n\t\t\t\t\t->hasKey('right')\n\t\t\t\t->integer($hashNode['id'])\n\t\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['id'])\n\t\t\t\t->integer($hashNode['left'])\n\t\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['left'])\n\t\t\t\t->integer($hashNode['right'])\n\t\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['right'])\n\t\t\t;\n\t\t}\n\n\t\t/*\n\t\t * Same tests, inverted\n\t\t */\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\n\t\t$this->boolean($objBuilder->setParentByNodes($objNode2, $objNode1))->isTrue();\n\t\t$hashChecks = array(\n\t\t\t1 => array(\n\t\t\t\t'id' \t\t=> 1,\n\t\t\t\t'parent'\t=> 2,\n\t\t\t\t'left'\t\t=> 1,\n\t\t\t\t'right'\t\t=> 2\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t'id' \t\t=> 2,\n\t\t\t\t'parent'\t=> null,\n\t\t\t\t'left'\t\t=> 0,\n\t\t\t\t'right'\t\t=> 3\n\t\t\t)\n\t\t);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\t\t$this->array($arrayResult)->size->isEqualTo(2);\n\t\tforeach ($arrayResult as $hashNode) {\n\t\t\t$this\n\t\t\t->array($hashNode)\n\t\t\t\t->hasKey('id')\n\t\t\t\t->hasKey('left')\n\t\t\t\t->hasKey('right')\n\t\t\t->integer($hashNode['id'])\n\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['id'])\n\t\t\t->integer($hashNode['left'])\n\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['left'])\n\t\t\t->integer($hashNode['right'])\n\t\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['right'])\n\t\t\t;\n\t\t}\n\t}", "public function setLeftCount($value)\n {\n return $this->set(self::_LEFT_COUNT, $value);\n }", "abstract public function createNode(NodeInterface $left, NodeInterface $right, $lineNumber = -1, $flags = 0x00);", "function setLeftAxisTitle($text = '')\n {\n $this->axis_data[0]['t'] = $text;\n }", "public function nodeMid();", "public function insertBefore (DOMNode $newnode , $refnode = null) {}", "public function viewLeftMenu()\n\t{\n\t\t$viewLevelResult\t= $this->manageLeftMenu('V', '0', '', '', '0', '0');\n\t\treturn $viewLevelResult;\n\t}", "public function PreOrderTraversal($node) {\r\n if($node != null){\r\n echo $node->data.\" \";\r\n $this->PreOrderTraversal($node->left);\r\n $this->PreOrderTraversal($node->right);\r\n }\r\n }", "public function setTreeParent($row){\n $this->treeParentRow = $row;\n return;\n }", "function create_right_node($id, $values)\r\n\t{\r\n\t\t$this->_verify_user_values( $values); \r\n\t\t// invalid target node, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock();\n\t\t\r\n\t\t// If the target node is a rootnode we virtually want to create a new root node\r\n\t\tif ($this_node['root_id'] == $this_node['id'])\r\n\t\t{\r\n\t\t\t$nid = $this->create_root_node($values, $id);\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn $nid;\r\n\t\t} \r\n\r\n\t\t$insert_data = array();\r\n\t\t$parent = $this->get_parent($id);\r\n\t\t$insert_data['parent_id'] = $parent['id'];\r\n\r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1\r\n WHERE root_id=%s AND ordr > %s AND level=%s AND l BETWEEN %s AND %s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['ordr'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['level'],\r\n\t\t\t\t\t\t\t\t\t\t\t$parent['l'], \n\t\t\t\t\t\t\t\t\t\t\t$parent['r']); \n\t\t\t\r\n\t\t// Update all nodes which have dependent left and right values\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN (l > %s AND r > %s) THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN r > %s THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data['ordr'] = $this_node['ordr'] + 1;\r\n\t\t$insert_data['l'] = $this_node['r'] + 1;\r\n\t\t$insert_data['r'] = $this_node['r'] + 2;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['level'] = $this_node['level'];\n\t\t\t\t\r\n\t\tif (!$this->_dumb_mode || !isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', \n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table, \n\t\t\t\t\t\t\t\t\t\t\timplode(', ', array_keys($qr)), \n\t\t\t\t\t\t\t\t\t\t\timplode(', ', $qr));\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n \t\t\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "public function marginLeft() {\n\t}", "public function initialize_lft_rgt()\n {\n return $this->update(\n \"UPDATE isys_catg_location_list SET\n\t\t\tisys_catg_location_list__lft = NULL,\n\t\t\tisys_catg_location_list__rgt = NULL\n\t\t\tWHERE ISNULL(isys_catg_location_list__parentid)\"\n );\n }", "protected function _getLeftNavHtml()\n {\n if ($this->_request->getFullActionName() == self::CATEGORY_VIEW_ACTION_NAME) {\n return $this->_layout->getBlock($this->_vars['catalog_left_navigation_block'])->toHtml();\n } elseif ($this->_request->getFullActionName() == self::CATALOG_SEARCH_ACTION_NAME) {\n return $this->_layout->getBlock($this->_vars['catalogsearch_left_navigation_block'])->toHtml();\n }\n\n return '';\n }", "private function set_htmlSpaceLeft()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // Get TS value\n $int_space_left = $conf_array[ 'wrap.' ][ 'item.' ][ 'nice_html_spaceLeft' ];\n\n // Set class var $htmlSpaceLeft\n $this->htmlSpaceLeft = str_repeat( ' ', $int_space_left );\n\n return;\n }", "protected function getLeft()\n\t{\n\t\t$items = MenuDB::getMainMenu();\n\t\t$mainmenu = new MainMenu();\n\t\t$mainmenu->uri = $this->url_active;\n\t\t$mainmenu->items = $items;\n\t\tif ($this->auth_user) {\n\t\t\t$user_panel = new UserPanel(); //панель авт. юзера\n\t\t\t$user_panel->user = $this->auth_user;\n\t\t\t$user_panel->uri = $this->url_active;\n\t\t\t$user_panel->addItem(\"Редактировать профиль\", URL::get(\"editprofile\", \"user\"));\n\t\t\t$user_panel->addItem(\"Выход\", URL::get(\"logout\"));\n\t\t} else {\n\t\t\t$user_panel = \"\";\n\t\t}\n\t\t$poll_db = new PollDB();\n\t\t$poll_db->loadRandom();\n\t\tif ($poll_db->isSaved()) {\n\t\t\t$poll = new Poll();\n\t\t\t$poll->action = URL::get(\"poll\", \"\", array(\"id\" => $poll_db->id));\n\t\t\t$poll->title = $poll_db->title;\n\t\t\t$poll->data = PollDataDB::getAllOnPollID($poll_db->id);\n\t\t} else {\n\t\t\t$poll = \"\";\n\t\t}\n\n\t\treturn $user_panel . $mainmenu . $poll;\n\t}", "public function rotateLeft();", "public function setPrintLeftMargin(int $margin = 0)\n {\n self::validateInteger($margin, 0, 65535, __FUNCTION__);\n $this -> connector -> write(Printer::GS . 'L' . self::intLowHigh($margin, 2));\n }", "public function setCurrentNode(NavigationNode $node)\n\t{\n\t\tif (isset($this->current)) {\n\t\t\t$this->current->isCurrent = false;\n\t\t}\n\t\t$node->isCurrent = true;\n\t\t$this->current = $node;\n\t}", "public function setStructureLeftParalFrontDoor($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 7 : // Deformacion Fuerte\n return 44;\n break;\n case 8 : // Deformacion medio\n return 42;\n break;\n case 6 : // Malo\n return 50;\n break;\n case 9 : // Golpe\n return 0;\n break;\n case 10 : // Rayon\n return 2;\n break;\n case 11 : // Reparacion Buena\n return 0;\n break;\n case 12 : // Reparacion Mala\n return 40;\n break;\n case 13 : // Sumido\n return 5;\n break;\n }\n }", "private function brokeTree()\n {\n $i = 0;\n foreach ($this->nodeIdList as $node) {\n $this->getDb()->createCommand()->update(\n self::tableName(),\n [\n $this->leftAttribute => ++$i,\n $this->rightAttribute => ++$i,\n $this->depthAttribute => 0,\n '_tree' => $this->globalParentNode,\n ],\n ['=', 'id', $node]\n )->query();\n }\n }", "public function testGetNodeWithLeftAndRightValues() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objBuilder->addNode($objNode1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\t\t$objBuilder->addNode($objNode2);\n\t\t$objNode3 = new LeftRightTreeTraversal\\Node(3);\n\t\t$objBuilder->addNode($objNode3);\n\t\t$objNode4 = new LeftRightTreeTraversal\\Node(4);\n\t\t$objBuilder->addNode($objNode4);\n\n\t\t$objNode2->setParentNode($objNode1);\n\t\t$objNode3->setParentNode($objNode1);\n\t\t$objNode4->setParentNode($objNode2);\n\n\t\t// non-existent pair of values, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftAndRightValues(42, 43))->isNull();\n\t\t// existent pair of values, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftAndRightValues(5, 6))->isNull();\n\n\t\t$objBuilder->compute();\n\n\t\t// non-existent pair of values, with graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftAndRightValues(42, 43))->isNull();\n\t\t// existent pair of values, with graph computation\n\t\t$this->object($objBuilder->getNodeWithLeftAndRightValues(5, 6))->isIdenticalTo($objNode3);\n\t}", "public function setRight(?RedBlackNode $right): void\n {\n $this->right = $right;\n }", "public static function left_sidebar() {\n\t\t$layout_type = WpvTemplates::get_layout();\n\n\t\tif($layout_type == 'left-only' || $layout_type == 'left-right'): ?>\n\t\t\t<aside class=\"<?php echo apply_filters('wpv_left_sidebar_class', 'left', $layout_type) ?>\">\n\t\t\t\t<?php WpvSidebars::getInstance()->get_sidebar('left'); ?>\n\t\t\t</aside>\n\t\t<?php endif;\n\t}", "public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}", "public function makeRoot(BaseObject $node)\n {\n if ((bool)$node->getLeftValue())\n {\n throw new Exception('Cannot turn an existing node into a root node.');\n }\n\n $node->setLeftValue(1);\n $node->setRightValue(2);\n }", "public function unshiftNode( $node );", "public function setLeftTime($value)\n {\n return $this->set(self::_LEFT_TIME, $value);\n }", "public function setLeftTime($value)\n {\n return $this->set(self::_LEFT_TIME, $value);\n }", "public function setLeftTime($value)\n {\n return $this->set(self::_LEFT_TIME, $value);\n }", "public function __construct() { \n $this->leftNav = 'store';\n }", "public function getLeft(): ?HtmlElementInterface\n {\n return $this->left;\n }", "function isLeft() { # :: Either a b -> Bool\n return Bool(False);\n }", "function getPrevNode($data)\n\t{\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft < ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft DESC'));\t\t\n\t}", "function setOperationnode($node){\n\t\t$this->operationNode = $node;\n\t}", "function setMainNode($nombre){\n\t\t$this->nodeppal=$nombre;\n\t\treturn 0;\n\t}", "function setRoot($value)\r\n {\r\n $this->_root=$value;\r\n //Gets the vars from the root object to get the pointers for the components\r\n $this->_rootvars=get_object_vars($this->_root);\r\n\r\n //Clears parents list and sets the root as the first parent\r\n $this->_parents->clear();\r\n $this->_parents->add($this->_root);\r\n\r\n }", "public function panLeftCamaraPresidencia() {\n\n self::$presidencia->moverALaIzquierda();\n }" ]
[ "0.792083", "0.7857863", "0.70237917", "0.69374055", "0.6880169", "0.6596433", "0.65614295", "0.65537405", "0.65056884", "0.6505552", "0.6456021", "0.6450883", "0.64185774", "0.63871735", "0.63871735", "0.6241689", "0.60999227", "0.60672814", "0.6012823", "0.59597677", "0.5941941", "0.5880596", "0.5874137", "0.58713573", "0.5863378", "0.5855304", "0.5815817", "0.58132386", "0.58009326", "0.5763781", "0.5726206", "0.56988645", "0.5650716", "0.5635423", "0.55634254", "0.5527097", "0.5527041", "0.5517699", "0.5498766", "0.54941726", "0.5485798", "0.54670364", "0.54538774", "0.5428314", "0.5404731", "0.5394948", "0.5370139", "0.53642917", "0.5345844", "0.534387", "0.5326484", "0.53243357", "0.531232", "0.53104925", "0.53014773", "0.52992594", "0.52551514", "0.5252655", "0.52502227", "0.52313495", "0.52218664", "0.5204064", "0.51745814", "0.5171049", "0.5164953", "0.515606", "0.5150166", "0.51499134", "0.5148759", "0.51387763", "0.51308286", "0.5097811", "0.5094242", "0.5088026", "0.5083193", "0.50663847", "0.5062832", "0.5058038", "0.5052457", "0.5043322", "0.503231", "0.50259656", "0.50168556", "0.5014382", "0.5008597", "0.5002872", "0.49984953", "0.49913323", "0.4991328", "0.49891818", "0.49881744", "0.49881744", "0.49875256", "0.49804527", "0.49761492", "0.49755162", "0.49553752", "0.49327445", "0.49309868", "0.49309465" ]
0.8174841
0
Retrieves the left node
public function left(): ?RedBlackNode { return $this->left; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLeft()\n {\n return $this->left;\n }", "public function getLeft()\n {\n return $this->left;\n }", "public function getLeftChild()\n\t{\n\t\treturn $this->leftChild;\n\t}", "public function getLeft()\n {\n if (array_key_exists(\"left\", $this->_propDict)) {\n return $this->_propDict[\"left\"];\n } else {\n return null;\n }\n }", "public function getLeft() {}", "public function getLeftValue(BaseObject $node)\n {\n $getter = self::forgeMethodName($node, 'get', 'left');\n return $node->$getter();\n }", "public function getLeftSide() {\n return $this->left;\n }", "public function getLeftExpr()\n {\n return $this->leftExpr;\n }", "function getLeft() ;", "function &getLeftSibling()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_leftsibling;\n\t}", "function &getLeftSibling()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_leftsibling;\n\t}", "function getLeftValue($a_node_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getLeftValued(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t$query = 'SELECT lft FROM '.$this->table_tree.' '.\n\t\t\t'WHERE child = %s '.\n\t\t\t'AND '.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\t\t$row = $ilDB->fetchObject($res);\n\t\treturn $row->lft;\n\t}", "public function getTreeLefts() {\n return $this->treeLefts;\n }", "public function getLeftTable()\n {\n return $this->left;\n }", "public function getLeftLocalKey()\n {\n return $this->leftlocalkey;\n }", "public function getLeftForeignKey()\n {\n return $this->leftforeignkey;\n }", "function getPrevNode($data)\n\t{\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft < ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft DESC'));\t\t\n\t}", "public function testGetNodeWithLeftValue() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objBuilder->addNode($objNode1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\t\t$objBuilder->addNode($objNode2);\n\t\t$objNode3 = new LeftRightTreeTraversal\\Node(3);\n\t\t$objBuilder->addNode($objNode3);\n\t\t$objNode4 = new LeftRightTreeTraversal\\Node(4);\n\t\t$objBuilder->addNode($objNode4);\n\n\t\t$objNode2->setParentNode($objNode1);\n\t\t$objNode3->setParentNode($objNode1);\n\t\t$objNode4->setParentNode($objNode2);\n\n\t\t// non-existent node left-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(42))->isNull();\n\t\t// existent node left-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(5))->isNull();\n\n\t\t$objBuilder->compute();\n\n\t\t// non-existent node left-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(42))->isNull();\n\t\t// existent node left-value, with graph computation\n\t\t$this->object($objBuilder->getNodeWithLeftValue(5))->isIdenticalTo($objNode3);\n\t\t// existent node left-value, with graph computation\n\t\t$this->variable($objBuilder->getNodeWithLeftValue(6))->isNull();\n\t}", "public function getLeft(): ?HtmlElementInterface\n {\n return $this->left;\n }", "protected function getLeft()\n\t{\n\t\t$items = MenuDB::getMainMenu();\n\t\t$mainmenu = new MainMenu();\n\t\t$mainmenu->uri = $this->url_active;\n\t\t$mainmenu->items = $items;\n\t\tif ($this->auth_user) {\n\t\t\t$user_panel = new UserPanel(); //панель авт. юзера\n\t\t\t$user_panel->user = $this->auth_user;\n\t\t\t$user_panel->uri = $this->url_active;\n\t\t\t$user_panel->addItem(\"Редактировать профиль\", URL::get(\"editprofile\", \"user\"));\n\t\t\t$user_panel->addItem(\"Выход\", URL::get(\"logout\"));\n\t\t} else {\n\t\t\t$user_panel = \"\";\n\t\t}\n\t\t$poll_db = new PollDB();\n\t\t$poll_db->loadRandom();\n\t\tif ($poll_db->isSaved()) {\n\t\t\t$poll = new Poll();\n\t\t\t$poll->action = URL::get(\"poll\", \"\", array(\"id\" => $poll_db->id));\n\t\t\t$poll->title = $poll_db->title;\n\t\t\t$poll->data = PollDataDB::getAllOnPollID($poll_db->id);\n\t\t} else {\n\t\t\t$poll = \"\";\n\t\t}\n\n\t\treturn $user_panel . $mainmenu . $poll;\n\t}", "public function getNestedLeftIndex();", "public function getLeft(): MarginInterface\n {\n return $this->left;\n }", "public function getLeftRoom()\n {\n if(isset($this->dungeon_map[$this->user_position[self::ROW_KEY]][$this->user_position[self::COLUMN_KEY] - 1])) {\n return $this->dungeon_map[$this->user_position[self::ROW_KEY]][$this->user_position[self::COLUMN_KEY] - 1];\n } else {\n return false;\n }\n }", "public function setLeftValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'left');\n return $node->$setter($value);\n }", "public function getInputLeft(): ?string\n {\n return $this->inputLeft;\n }", "public function GetMin() {\r\n if($this->root == null)\r\n return null;\r\n\r\n $node = $this->root;\r\n\r\n while($node->left != null)\r\n $node = $node->left;\r\n\r\n return $node;\r\n }", "public function getLeftCnt()\n {\n return $this->get(self::_LEFT_CNT);\n }", "public function right(): ?Node\n {\n return $this->right;\n }", "public function moveLeft() : Tetris {\n // check if the block can be moved to the left\n if ($this->block->canMove('left')) {\n // move the block to the left\n $this->block->setX($this->block->getX() - 1);\n }\n\n // return the game for chained method calling\n return $this;\n }", "public function getLeftPixels()\n {\n return $this->left_pixels;\n }", "public function getFirstNode()\n {\n return $this->firstNode;\n }", "public function setLeftField($name) {\n $this->_left = $name;\n return $this;\n }", "protected function _getLeftNavHtml()\n {\n if ($this->_request->getFullActionName() == self::CATEGORY_VIEW_ACTION_NAME) {\n return $this->_layout->getBlock($this->_vars['catalog_left_navigation_block'])->toHtml();\n } elseif ($this->_request->getFullActionName() == self::CATALOG_SEARCH_ACTION_NAME) {\n return $this->_layout->getBlock($this->_vars['catalogsearch_left_navigation_block'])->toHtml();\n }\n\n return '';\n }", "function get_root()\n\t{ \n\t\t$this->model->where('`'.$this->left_column . '` = 1 ');\n\t\treturn $this->model->find(FALSE,true);\n\t}", "public function setLeftChild(Node $leftChild)\n\t{\n\t\t$this->leftChild = $leftChild;\n\t}", "public function setLeft(?RedBlackNode $left): void\n {\n $this->left = $left;\n }", "public function viewLeftMenu()\n\t{\n\t\t$viewLevelResult\t= $this->manageLeftMenu('V', '0', '', '', '0', '0');\n\t\treturn $viewLevelResult;\n\t}", "public function leaves()\n {\n if (($root = $this->roothunt()) === NULL) return NULL;\n return $this->leafhunt($root);\n }", "function _fillLeft()\n {\n return $this->_left + $this->_padding['left'];\n }", "public function network_explorer_left(Request $request){\n\t if(!empty($request->session()->has('id') && $request->session()->get('role') == 0)){\n \t\t//get all left network data\n \t\treturn \\App\\Models\\Network_Left_Users\\Users::with('children')->get()->where('parent', null);\n\t }\n\t else{\n\t return redirect()->route('admin_login');\n\t }\n\t}", "function get_root()\n {\t\n\t\t$query = ee()->db->get_where( $this->tree_table, array('lft' => 1), 1 );\n\t\treturn ( $query->num_rows() ) ? $query->row_array() : FALSE;\n }", "public function getItemsLeft()\n {\n return $this->itemsLeft;\n }", "function create_left_node($id, $values)\r\n\t{\r\n\t\t$this->_verify_user_values($values); \r\n\t\t// invalid target node, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\r\n \tdebug :: error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock();\n\t\t\r\n\t\t// If the target node is a rootnode we virtually want to create a new root node\r\n\t\tif ($this_node['root_id'] == $this_node['id'])\r\n\t\t{\r\n\t\t\treturn $this->create_root_node($values, $id, false, NESE_MOVE_BEFORE);\r\n\t\t} \r\n\r\n\t\t$insert_data = array();\r\n\t\t$parent = $this->get_parent($id);\r\n\t\t$insert_data['parent_id'] = $parent['id'];\r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1\r\n WHERE root_id=%s AND ordr>=%s AND level=%s AND l BETWEEN %s AND %s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['ordr'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['level'],\r\n\t\t\t\t\t\t\t\t\t\t\t$parent['l'], $parent['r']); \n\t\t\t\r\n\t\t// Update all nodes which have dependent left and right values\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN l >= %s THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN (r >= %s OR l >= %s) THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data['ordr'] = $this_node['ordr'];\r\n\t\t$insert_data['l'] = $this_node['l'];\r\n\t\t$insert_data['r'] = $this_node['l'] + 1;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['level'] = $this_node['level'];\r\n\r\n\t\tif (!$this->_dumb_mode || !$node_id = isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->_node_table, implode(', ', array_keys($qr)), implode(', ', $qr));\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "function getMainNode(){\n\t\treturn $this->nodeppal;\n\t}", "public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}", "public function getCurrentNode() : Node\n {\n return $this->currentNode;\n }", "function get_left($key)\n\t{\n\t\t$ret \t= $this->_post_data(\"http://bypasscaptcha.com/ex_left.php\", array(\"key\" => $key));\n\t\t$dict \t= $this->_get_result($ret);\n\t\t$left\t= (isset($dict['Left'])) ? $dict['Left'] : FALSE;\n\t\t\n\t\treturn $left;\n\t}", "function fetchPredecessorNode($a_node_id, $a_type = \"\")\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getNodeData(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t// get lft value for current node\n\t\t$query = 'SELECT lft FROM '.$this->table_tree.' '.\n\t\t\t'WHERE '.$this->table_tree.'.child = %s '.\n\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\n\t\t$curr_node = $ilDB->fetchAssoc($res);\n\t\t\n\t\tif($a_type)\n\t\t{\n\t\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t\t$this->buildJoin().\n\t\t\t\t'WHERE lft < %s '.\n\t\t\t\t'AND '.$this->table_obj_data.'.type = %s '.\n\t\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s '.\n\t\t\t\t'ORDER BY lft DESC';\n\t\t\t$ilDB->setLimit(1);\n\t\t\t$res = $ilDB->queryF($query,array('integer','text','integer'),array(\n\t\t\t\t$curr_node['lft'],\n\t\t\t\t$a_type,\n\t\t\t\t$this->tree_id));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t\t$this->buildJoin().\n\t\t\t\t'WHERE lft < %s '.\n\t\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s '.\n\t\t\t\t'ORDER BY lft DESC';\n\t\t\t$ilDB->setLimit(1);\n\t\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t\t$curr_node['lft'],\n\t\t\t\t$this->tree_id));\n\t\t}\n\t\t\n\t\tif ($res->numRows() < 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\treturn $this->fetchNodeData($row);\n\t\t}\n\t}", "public function getLeftCount()\n {\n return $this->get(self::_LEFT_COUNT);\n }", "public function right(): ?RedBlackNode\n {\n return $this->right;\n }", "public function getNode()\n\t{\n\t\treturn $this->_node;\n\t}", "public function previousNode(): ?Node\n {\n return $this->traverse('previous');\n }", "public function left($addBracketsWhenRelative = false)\n\t{\n\t\tif(!$this->length()) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$part = $this->parts[0];\n\n\t\tif((string)(int)$part == $part) {\n\t\t\t$part = (int)$part;\n\t\t}\n\n\t\tif(!$this->absolute && $addBracketsWhenRelative) {\n\t\t\t$part = sprintf('[%s]', $part);\n\t\t}\n\n\t\treturn $part;\n\t}", "public function nodeMid();", "public function getAppendBeforeNode();", "public function nodeLow();", "public function getPrevSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rightAttribute).'='.($owner->{$this->leftAttribute}-1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "public function getNode()\n {\n return parent::getNode();\n }", "public function node()\n\t{\n\t\t$registry = Jquarry_Registry::instance();\n\t\t\n\t\treturn $registry->get_node($this->node_id());\n\t}", "public function rebuild_tree($left = 1, $target = NULL)\n {\n // check if using target or self as root and load if not loaded\n if (is_null($target) AND ! $this->loaded)\n {\n return FALSE;\n }\n elseif (is_null($target))\n {\n $target = $this;\n }\n\n if ( ! $target->loaded)\n {\n $target = $this->factory_item($target);\n }\n\n // Use the current node left value for entire tree\n if (is_null($left))\n {\n $left = $target->left;\n }\n\n $target->lock();\n $right = $left + 1;\n $children = $target->children();\n\n foreach ($children as $child)\n {\n $right = $child->rebuild_tree($right);\n }\n\n $target->left = $left;\n $target->right = $right;\n $target->save();\n $target->unlock();\n\n return $right + 1;\n }", "public function setLeft($val)\n {\n $this->_propDict[\"left\"] = floatval($val);\n return $this;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode() {\r\n return $this->node;\r\n }", "private function getRoot() {\n $statement = $this->getConn()->prepare('SELECT * FROM `' . $this->_table . '` where ' . $this->_parent . ' is null limit 1');\n $statement->execute();\n $root = $statement->fetch();\n return $root;\n }", "public function getFirstChild();", "public function LeftNavigation() {\n\t\t$pageId = (isset($_GET['page'])) ? (int)$_GET['page'] : 0;\n \n if(($page = DataObject::get_by_id('Page', $pageId))) {\n Director::set_current_page($page);\n }\n\n return $this->renderWith('LeftNavigation');\n }", "public function getParentnode()\n {\n return $this->__parentnode__;\n }", "public function getLeftTime()\n {\n return $this->get(self::_LEFT_TIME);\n }", "public function getLeftTime()\n {\n return $this->get(self::_LEFT_TIME);\n }", "public function getLeftTime()\n {\n return $this->get(self::_LEFT_TIME);\n }", "public function &firstChild()\n {\n $ret = null;\n if (! count($this->_children)) {\n return $ret;\n }\n return $this->_children[0];\n }", "function getNextNode($data)\n\t{\t\t\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft > ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft'));\t\t\t\t\t\t\t \t\t\t\t\t\n\t}", "public function first()\n {\n return count($this->nodes)?$this->nodes[0]:null;\n }", "public function getLftName()\n {\n return 'lft';\n }", "public function getLeftView()\n {\n $view = new ViewModel();\n $view->setTemplate('sections/processing/partials/left');\n\n return $view;\n }", "public function getFromNode(): int {\n return $this->fromNode;\n }", "function get_root() {\n\t\treturn $this->stack[0];\n\t}", "public function getLeftView()\n {\n $action = $this->params()->fromRoute('action');\n\n switch ($action) {\n case 'add':\n $licence = $this->params()->fromRoute('licence');\n $application = $this->params()->fromRoute('application');\n $transportManager = $this->params()->fromRoute('transportManager');\n\n if ($licence) {\n $viewModel = new ViewModel();\n $viewModel->setTemplate('sections/licence/partials/left');\n return $viewModel;\n }\n\n if ($transportManager) {\n return null;\n }\n\n if ($application) {\n return null;\n }\n // Missing break is intentional\n default:\n $viewModel = new ViewModel();\n $viewModel->setTemplate('sections/cases/partials/left');\n return $viewModel;\n }\n }", "public function getParentNode() {}", "public function retrievePrevSibling(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getLeftValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "function getActualNode(){\n\t\treturn $this->anode;\n\t}", "public function getToNode(): int {\n return $this->toNode;\n }", "public function getNodeFromStack() {}", "public function findRootNode()\n {\n return $this->repository->findOneBy(array('lvl' => 0));\n }", "function get_node( $val, $col = 'lft' )\n\t{\n\t\t$node_data = array(\n\t\t\t'node_id' => '',\n\t\t\t'lft' => 0,\n\t\t\t'rgt' => 0,\n\t\t\t'parent' => '',\n\t\t\t'moved' => '',\n\t\t\t'label' => '',\n\t\t\t'entry_id' => '',\n\t\t\t'template_path' => '',\n\t\t\t'custom_url' => '',\n\t\t\t'type' => array(),\n\t\t\t'field_data' => '',\n\t\t\t'depth' => ''\n\t\t);\n\n\t\t$query = ee()->db->get_where( \n\t\t\t$this->tree_table, \n\t\t\tarray($col => $val), \n\t\t\t1 \n\t\t);\n\t\treturn $query->num_rows() ? $query->row_array() : $node_data;\n\t}", "function &firstChild () {\r\n $ret = null;\r\n if (!count ($this->_children)) {\r\n return $ret;\r\n }\r\n return $this->_children[0];\r\n }", "public function toLeft($right);", "public function leftnav ()\n\t{\n\t}", "public function getLeftView()\n {\n $view = new ViewModel();\n $view->setTemplate('sections/cases/partials/left');\n\n return $view;\n }", "public function getLeftView()\n {\n $view = new ViewModel();\n $view->setTemplate('sections/cases/partials/left');\n\n return $view;\n }", "public function getLeftView()\n {\n $view = new ViewModel();\n $view->setTemplate('sections/cases/partials/left');\n\n return $view;\n }", "public function down(): ?Node\n {\n return $this->down;\n }", "public function current(): Node\n {\n return $this->nodes[$this->pointer];\n }", "protected function _getMinChild(&$root=null) {\n\t\t// keep iterating left until we can't, keeping track of parent\n\t\t$current = $root;\n\t\t$parent = null;\n\t\twhile ($current->left) {\n\t\t\t$parent = $current;\n\t\t\t$current = $current->left;\n\t\t}\n\t\t// return a new node with this data\n\t\treturn new BSTNode($current->key, $current->data);\n\t}", "public function getRootNode() {}", "private function getLeftShift()\n {\n if ($this->currentPage < 3) {\n $shift = 3;\n } else {\n $shift = 1;\n }\n return $shift;\n }", "function cognitivefactory_tree_left($cognitivefactoryid, $userid, $groupid, $id) {\n global $CFG, $DB;\n\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n\n $sql = \"\n SELECT \n itemdest, \n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n id = $id\n \";\n $res = $DB->get_record_sql($sql);\n $ordering = $res->intvalue;\n $fatherid = $res->itemdest;\n\n $sql = \"\n SELECT \n id,\n itemdest\n FROM \n {cognitivefactory_opdata} as od\n WHERE \n id = $fatherid\n \";\n $resfatherid = $DB->get_record_sql($sql);\n if (!$resfatherid) return; // this protects against bouncing left request\n $fatheridbis = $resfatherid->itemdest; //id grandpa...\n\n $sql = \"\n SELECT \n id,\n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n intvalue > $ordering AND \n itemdest = $fatherid\n {$accessClause}\n ORDER BY \n intvalue\n \";\n $newbrotherordering = $ordering;\n\n if ($ress = $DB->get_records_sql($sql)) {\n foreach ($ress as $res) {\n $opdata = new StdClass();\n $opdata->id = $res->id;\n $opdata->intvalue = $newbrotherordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n $newbrotherordering = $newbrotherordering + 1;\n }\n }\n\n // getting father's ordering\n $sql = \"\n SELECT\n id, \n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n id = $fatherid\n {$accessClause}\n \";\n $resorderingfather = $DB->get_record_sql($sql);\n $orderingfather = $resorderingfather->intvalue;\n\n // reordering uncles\n $select = \"\n cognitivefactoryid = ? AND\n operatorid = 'hierarchize' AND\n intvalue > ? AND \n itemdest = ?\n {$accessClause}\n \";\n if ($resbrotherfathers = $DB->get_records_select('cognitivefactory_opdata', $select, array($cognitivefactoryid, $orderingfather, $fatheridbis), 'id, intvalue', 'intvalue')) {\n foreach ($resbrotherfathers as $resbrotherfather) {\n $idbrotherfather = $resbrotherfather->id;\n $nextordering = $resbrotherfather->intvalue + 1;\n\n $opdata = new StdClass();\n $opdata->id = $idbrotherfather;\n $opdata->intvalue = $nextordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n }\n\n // reordering\n $newordering = $orderingfather + 1;\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $opdata->itemdest = $fatheridbis;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n}" ]
[ "0.7965437", "0.7965437", "0.79207855", "0.77835387", "0.7692195", "0.76792395", "0.7455784", "0.73983145", "0.7365431", "0.73609746", "0.7347709", "0.72065175", "0.70461696", "0.7009871", "0.66163945", "0.66162634", "0.65295106", "0.6509684", "0.64628386", "0.6397572", "0.63889796", "0.62873995", "0.6277762", "0.627037", "0.6236666", "0.6155259", "0.6142972", "0.61385614", "0.6119937", "0.609596", "0.60954463", "0.6095353", "0.60810363", "0.60008055", "0.5959806", "0.5959079", "0.5908142", "0.58937687", "0.5891125", "0.587348", "0.586703", "0.584652", "0.58461297", "0.58439416", "0.5832323", "0.58309305", "0.5810152", "0.5785895", "0.5770774", "0.5768998", "0.57187974", "0.5709969", "0.5701002", "0.5696226", "0.56900364", "0.5676928", "0.5674305", "0.56410587", "0.56241834", "0.5618997", "0.5616465", "0.5615706", "0.5615706", "0.5615706", "0.5615706", "0.5612592", "0.5599247", "0.55984485", "0.55891216", "0.5584847", "0.5567871", "0.5567871", "0.5567871", "0.5562113", "0.55517775", "0.55431175", "0.5538197", "0.5537194", "0.5534937", "0.55288565", "0.55206084", "0.55183274", "0.5506933", "0.55037624", "0.5479589", "0.5475663", "0.5474111", "0.5470269", "0.546777", "0.54582536", "0.5450994", "0.54451764", "0.54451764", "0.54451764", "0.5445074", "0.5441367", "0.5438095", "0.54330146", "0.54163367", "0.54139864" ]
0.80178005
0
Sets the right node
public function setRight(?RedBlackNode $right): void { $this->right = $right; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRightValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'right');\n return $node->$setter($value);\n }", "public static function setNode($node) {\r\n static::$node = $node;\r\n }", "public function setRight(?Node $right): self\n {\n $this->right = $right;\n\n return $this;\n }", "function setOperationnode($node){\n\t\t$this->operationNode = $node;\n\t}", "public function testSetNode()\n {\n $node = new Fluent();\n $node->test = 'test';\n $this->response->setNode($node);\n $this->assertEquals($this->response->test, $node->test);\n $this->assertEquals([\n 'test' => 'test'\n ], $this->response->toArray());\n }", "public function setRightChild(Node $rightChild)\n\t{\n\t\t$this->rightChild = $rightChild;\n\t}", "public function setLeftValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'left');\n return $node->$setter($value);\n }", "public function setNode($node)\n {\n parent::setNode($node);\n\n $defaultsize = config('elasticblue.pagination');\n\n foreach ($node->relationTypes as $rel) {\n\n $rel->relations['in'] = array_slice($rel->relations['in'], 0, $defaultsize);\n $rel->relations['out'] = array_slice($rel->relations['out'], 0, $defaultsize);\n }\n $this->relationTypes = $node->relationTypes;\n $this->nodeTypes = $node->nodeTypes;\n\n $this->timestamp = now()->toIso8601String();\n\n return $this;\n }", "function setTo(& $node)\n {\n $node->setFirstName('Lukas');\n\n $this->to = $node;\n }", "public function setCurrentNode(Node $node) : Node\n {\n $this->currentNode = $node;\n\n return $this->currentNode;\n }", "public function setNodeValue($value) {\n $this->nodeValue = $value;\n }", "public function updateNode($type) {\n $this->current->updateType($type);\n }", "public function set(string $name, string $value = null): NodeInterface;", "public function shiftNode();", "public function setToNode(int $toNode): void {\n $this->toNode = $toNode;\n }", "public function setLeft(?RedBlackNode $left): void\n {\n $this->left = $left;\n }", "function create_right_node($id, $values)\r\n\t{\r\n\t\t$this->_verify_user_values( $values); \r\n\t\t// invalid target node, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock();\n\t\t\r\n\t\t// If the target node is a rootnode we virtually want to create a new root node\r\n\t\tif ($this_node['root_id'] == $this_node['id'])\r\n\t\t{\r\n\t\t\t$nid = $this->create_root_node($values, $id);\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn $nid;\r\n\t\t} \r\n\r\n\t\t$insert_data = array();\r\n\t\t$parent = $this->get_parent($id);\r\n\t\t$insert_data['parent_id'] = $parent['id'];\r\n\r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1\r\n WHERE root_id=%s AND ordr > %s AND level=%s AND l BETWEEN %s AND %s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['ordr'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['level'],\r\n\t\t\t\t\t\t\t\t\t\t\t$parent['l'], \n\t\t\t\t\t\t\t\t\t\t\t$parent['r']); \n\t\t\t\r\n\t\t// Update all nodes which have dependent left and right values\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN (l > %s AND r > %s) THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN r > %s THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data['ordr'] = $this_node['ordr'] + 1;\r\n\t\t$insert_data['l'] = $this_node['r'] + 1;\r\n\t\t$insert_data['r'] = $this_node['r'] + 2;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['level'] = $this_node['level'];\n\t\t\t\t\r\n\t\tif (!$this->_dumb_mode || !isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', \n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table, \n\t\t\t\t\t\t\t\t\t\t\timplode(', ', array_keys($qr)), \n\t\t\t\t\t\t\t\t\t\t\timplode(', ', $qr));\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n \t\t\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "public function setNode($pageId, $node, $value)\n\t{\n\t\t//fetch row if exists\n\t\t$select = $this->select();\n\t\t$select->where(\"page_id=?\", $pageId)->\n\t\t\twhere(\"node=?\", $node);\n\t\t$row = $this->fetchRow($select);\n\t\t\n\t\t//if it doesn't exist, create it\n\t\tif(!$row)\n\t\t{\n\t\t\t$row = $this->createRow();\n\t\t\t$row->page_id = $pageId;\n\t\t\t$row->node = $node;\n\t\t}\n\t\t\n\t\t//set the node contents\n\t\t$row->content = $value;\n\t\t$row->save();\n\t}", "private function setNode(\n SimpleXMLElement $rootNode,\n $nodeName,\n $value = null,\n $attributes = array(),\n $cnss = array(),\n $anss = array(),\n $position = null\n ) {\n $node = $this->findNode($rootNode, $nodeName, $attributes, array_merge($cnss, $anss));\n\n if (isset($node)) {\n if ($value !== null) {\n $node[0] = $value;\n }\n\n return $node;\n }\n\n return $this->addNode($rootNode, $nodeName, $value, $attributes, $cnss, $anss, $position);\n }", "public function setRootNode( ezcTreeNode $node )\n {\n $db = $this->dbh;\n\n $q = $db->createDeleteQuery();\n $q->deleteFrom( $db->quoteIdentifier( $this->indexTableName ) );\n $s = $q->prepare();\n $s->execute();\n $this->store->deleteDataForAllNodes();\n\n $q = $db->createInsertQuery();\n $q->insertInto( $db->quoteIdentifier( $this->indexTableName ) )\n ->set( 'parent_id', \"null\" )\n ->set( 'id', $q->bindValue( $node->id ) );\n $s = $q->prepare();\n $s->execute();\n\n $this->store->storeDataForNode( $node, $node->data );\n }", "function SetOriginalNode($node)\r\n\t{\r\n\t\tparent::SetOriginalNode($node);\r\n\t\t\r\n\t\t//now load controls for this row element\r\n\t\tParser::ParseForControls($this, $node);\r\n\t\t\r\n\t\t\r\n\t}", "public function setNamedItem($node) { }", "public function applyToNode(Node $node);", "public function setRoot(&$node):RootedGraph;", "protected function setNodeId($node): void\n {\n $elementId = $this->getNodeId($node);\n\n $this->nodeId = $elementId;\n }", "private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }", "public function setLeftChild(Node $leftChild)\n\t{\n\t\t$this->leftChild = $leftChild;\n\t}", "public function setCurrentNode(NavigationNode $node)\n\t{\n\t\tif (isset($this->current)) {\n\t\t\t$this->current->isCurrent = false;\n\t\t}\n\t\t$node->isCurrent = true;\n\t\t$this->current = $node;\n\t}", "public function setAsShadowOf(NodeData $nodeData = NULL) {\n\t\t$this->setMovedTo($nodeData);\n\t\t$this->setRemoved(($nodeData !== NULL));\n\t\t$this->addOrUpdate();\n\t}", "public function testGetOriginalNode()\n {\n $node = new Fluent();\n $node->test = 'test';\n $this->response->setNode($node);\n $this->assertEquals($node, $this->response->getOriginalNode());\n }", "public function setRight(HtmlElementInterface $right): void\n {\n $this->right = $right;\n }", "public function testNode() {\n // test the constructor\n $childNode = $this->getMock('Route\\RouteNode');\n $childNode->different = 1;\n $node = new Route\\RouteNodeArguments($childNode);\n $this->assertEquals($childNode, $node->GetNode());\n\n // test the SetNode / GetNode pair\n $otherNode = $this->getMock('Route\\RouteNode');\n $otherNode->different = 2;\n $node->SetNode($otherNode);\n $this->assertEquals($otherNode, $node->GetNode());\n }", "protected function setCurrentClusterNode($mode)\n {\n if (!$this->m_current_clusternode || !$this->m_current_clusternode->hasMode($mode))\n {\n if ($mode==='r' && !empty($this->m_readonly_nodes_config)) { $this->setRandomNodeFromNodeConfigs($this->m_readonly_nodes_config,$mode); }\n else if ($mode==='w' && !empty($this->m_writeonly_nodes_config)) { $this->setRandomNodeFromNodeConfigs($this->m_writeonly_nodes_config,$mode); }\n else { $this->setRandomNodeFromNodeConfigs($this->m_nodes_config ,$mode); }\n }\n }", "function load($node) {\n if (method_exists($node, 'valueOf')) {\n $this->set($node->valueOf());\n } else {\n $this->set($node->nodeValue);\n }\n }", "public function setFormNode($formIdentifier, \\Neos\\ContentRepository\\Domain\\Model\\NodeInterface $node)\n {\n $this->formNodes[$formIdentifier] = $node;\n }", "public function setRight(Expression $right)\n {\n $this->right = $right;\n return $this;\n }", "function setNodeValues(&$node, $ebsLeafletValues){\n \t\t\n \t\tglobal $user;\n \t\t\t\n \t\t//create only\n \t\t$node->type = \"leaflet\";\n \t\tnode_object_prepare($node); // Sets some defaults. Invokes hook_prepare() and hook_node_prepare().\n \t\t$node->language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled\n \t\t$node->uid = $user->uid; //set to 1?\n \t\t$node->promote = 0; //(1 or 0): promoted to front page\n \t\t$node->comment = 0; // 0 = comments disabled, 1 = read only, 2 = read/write\n \t\t$node->sticky = 0; // (1 or 0): sticky at top of lists or not\n \t\t\n \t\t//Static values, not from EBS\n \t\t$node->status = 1;\n \t\t$node->field_source[$node->language][0]['value'] = \"automated\";\n \t\t$node->path['pathauto'] = true;\n \t\t\n \t\t/*\n \t\t * Loop through the field mapping, retrieving:\n \t\t * \n \t\t * $myArray[0] is Drupal field name\n \t\t * $myArray[1] is function name to use\n \t\t * $myArray[2] is default value to use\n \t\t * $ebsLeafletValues[$ebsFieldName] is the value of the field\n \t\t * contained in $this->goodEbsLeaflets\n \t\t * field_weeks_per_year\n \t\t */\n \t\t//dsm($this->fieldMapping);\n \t\t//dsm($ebsLeafletValues);\n \t\t foreach ($this->fieldMapping as $ebsFieldName => $myArray):\n \t\t \t//dsm($ebsLeafletValues->$ebsFieldName.\" \".$myArray[0]);\n \t\t \n \t\t \t$valueToUse = $ebsLeafletValues->$ebsFieldName;\n \t\t \t\n \t\t \tif (empty($valueToUse)){\n \t\t \t\t$valueToUse = $myArray[2];//subsitute default value from mapping\n \t\t \t}\n\n \t\t \t//Set node->field value, or delete existing value\n \t\t \t$this->$myArray[1]($node, $myArray[0], $valueToUse);\n\t \t\n \t\t endforeach; \n\n \t}", "protected function setNodeConfig($nodename, $nodeconfig, $mode)\n {\n if ($mode==='r') { $this->m_readonly_nodes_config[$nodename] = $nodeconfig; }\n else if ($mode==='w') { $this->m_writeonly_nodes_config[$nodename] = $nodeconfig; }\n else { $this->m_nodes_config[$nodename] = $nodeconfig; }\n }", "function setValSubNode($nombre,$valor){\n\t\t$clase=$this->nmclass;\n\t\t$this->nodos[$clase][$nombre]=$valor;\n\t\t$this->anode=$nombre;\n\t\treturn 0;\n\t}", "public function setParent(Node $parent)\n {\n $this->parent = $parent;\n }", "public function setParent(Module_Node_Model $parent = null);", "protected function setParent(MenuNode $node)\n {\n $this->parent = $node;\n }", "public function pushNode( $node );", "public function setLeagueNode(string $nodename, LeagueInterface $node)\n {\n $bag = $this->getOrCreateLeagueBag();\n\n return $bag->setLeagueNode($nodename, $node);\n }", "public function setNodeAsNull(\\DOMElement $node) {\n\t\t$node->setAttributeNS(self::NIL_URI, self::NULL_VALUE, 'true');\n\t}", "protected function replace(Node $node)\n {\n }", "public function completeNode() {\n $this->current = $this->current->parent();\n }", "public function setRTERootBlockElement()\n\t{\n\t}", "public function setNestedSetRightKey($nsrk)\n {\n $this->isNestedSetRightKey = (boolean) $nsrk;\n }", "function updateObjectReference()\n\t{\n\t\tif (is_object($this->mob_node))\n\t\t{\n\t\t\t$this->mal_node =& $this->mob_node->first_child();\n\t\t\tif (is_object($this->mal_node) && $this->mal_node->node_name() == \"MediaAlias\")\n\t\t\t{\n\t\t\t\t$this->mal_node->set_attribute(\"OriginId\", \"il__mob_\".$this->getMediaObject()->getId());\n\t\t\t}\n\t\t}\n\t}", "public function linkTo(UXNode $node)\n {\n \n }", "function getActualNode(){\n\t\treturn $this->anode;\n\t}", "public function remove(Module_Node_Model $node) {\n if (!$node->haveChild(Module_Node_Model::POSITION_LEFT) || !$node->haveChild(Module_Node_Model::POSITION_RIGHT)) {\n $tmp = $node;\n } else {\n $tmp = $this->findRelative($node, null === $node->getPosition() ?\n Module_Node_Model::POSITION_RIGHT : $node->getPosition()\n );\n }\n\n $alt = $tmp->getChild(Module_Node_Model::POSITION_LEFT) ?: $tmp->getChild(Module_Node_Model::POSITION_RIGHT);\n\n if (null === $alt) {\n $alt = $tmp;\n }\n\n $alt->setParent($tmp->getParent());\n\n if (null === $node->getParent()) {\n $this->root = $alt;\n } elseif (null !== $tmp->getParent()) {\n $tmp->getParent()->setChild($tmp->getPosition(), $alt);\n }\n\n if ($tmp !== $node) {\n if ($tmp !== $alt && Module_Node_Model::COLOR_BLACK === $tmp->getColor()) {\n $this->deleteSort($alt);\n }\n\n if (null !== $tmp->getParent()) {\n $tmp->getParent()->setChild($tmp->getPosition(), $tmp->getChild($tmp->getPosition()));\n }\n\n $tmp\n ->setChild(Module_Node_Model::POSITION_LEFT, $node->getChild(Module_Node_Model::POSITION_LEFT))\n ->setChild(Module_Node_Model::POSITION_RIGHT, $node->getChild(Module_Node_Model::POSITION_RIGHT))\n ->setParent($node->getParent())\n ->setColor($node->getColor());\n\n if ($node->haveChild(Module_Node_Model::POSITION_LEFT)) {\n $node->getChild(Module_Node_Model::POSITION_LEFT)->setParent($tmp);\n }\n if ($node->haveChild(Module_Node_Model::POSITION_RIGHT)) {\n $node->getChild(Module_Node_Model::POSITION_RIGHT)->setParent($tmp);\n }\n\n if (null !== $node->getParent()) {\n $node->getParent()->setChild($node->getPosition(), $tmp);\n }\n } else {\n if (Module_Node_Model::COLOR_BLACK === $node->getColor()) {\n $this->deleteSort($node);\n }\n }\n\n // Make original node orphan\n if (null !== $node->getParent() && $node === $node->getParent()->getChild($node->getPosition())) {\n $node->getParent()->setChild($node->getPosition(), null);\n }\n\n $node\n ->setPosition(null)\n ->setParent(null)\n ->setChild(Module_Node_Model::POSITION_LEFT, null)\n ->setChild(Module_Node_Model::POSITION_RIGHT, null);\n\n return $this;\n }", "public function testGetNodeWithRightValue() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objBuilder->addNode($objNode1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\t\t$objBuilder->addNode($objNode2);\n\t\t$objNode3 = new LeftRightTreeTraversal\\Node(3);\n\t\t$objBuilder->addNode($objNode3);\n\t\t$objNode4 = new LeftRightTreeTraversal\\Node(4);\n\t\t$objBuilder->addNode($objNode4);\n\n\t\t$objNode2->setParentNode($objNode1);\n\t\t$objNode3->setParentNode($objNode1);\n\t\t$objNode4->setParentNode($objNode2);\n\n\t\t// non-existent node right-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithRightValue(42))->isNull();\n\t\t// existent node right-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithRightValue(5))->isNull();\n\n\t\t$objBuilder->compute();\n\n\t\t// non-existent node right-value, without graph computation\n\t\t$this->variable($objBuilder->getNodeWithRightValue(42))->isNull();\n\t\t// existent node right-value, with graph computation\n\t\t$this->object($objBuilder->getNodeWithRightValue(6))->isIdenticalTo($objNode3);\n\t\t// existent node right-value, with graph computation\n\t\t$this->variable($objBuilder->getNodeWithRightValue(5))->isNull();\n\t}", "function setInnerXML($node,$xml) {\n\t\t$doc=$node->ownerDocument;\n\t\t$f = $doc->createDocumentFragment();\n\t\t$f->appendXML($xml);\n\t\t$node->parentNode->replaceChild($f,$node);\n\t}", "public function enterNode(Node $node)\n {\n }", "public function setNodeId($id);", "public function setNodeKey($nk)\n {\n $this->isNodeKey = (boolean) $nk;\n }", "function push_nodelist() {\r\n\t\t\r\n\t\tif (!is_null($this->right)) {\r\n\t\t\t$this->nodelists[] = array($this->right, $this->nodelist);\r\n\t\t\t\r\n\t\t} \r\n\t\t\r\n\t}", "public function setNodeName($name);", "function create_left_node($id, $values)\r\n\t{\r\n\t\t$this->_verify_user_values($values); \r\n\t\t// invalid target node, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\r\n \tdebug :: error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\r\n\t\t$lock = $this->_set_lock();\n\t\t\r\n\t\t// If the target node is a rootnode we virtually want to create a new root node\r\n\t\tif ($this_node['root_id'] == $this_node['id'])\r\n\t\t{\r\n\t\t\treturn $this->create_root_node($values, $id, false, NESE_MOVE_BEFORE);\r\n\t\t} \r\n\r\n\t\t$insert_data = array();\r\n\t\t$parent = $this->get_parent($id);\r\n\t\t$insert_data['parent_id'] = $parent['id'];\r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1\r\n WHERE root_id=%s AND ordr>=%s AND level=%s AND l BETWEEN %s AND %s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['ordr'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['level'],\r\n\t\t\t\t\t\t\t\t\t\t\t$parent['l'], $parent['r']); \n\t\t\t\r\n\t\t// Update all nodes which have dependent left and right values\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN l >= %s THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN (r >= %s OR l >= %s) THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data['ordr'] = $this_node['ordr'];\r\n\t\t$insert_data['l'] = $this_node['l'];\r\n\t\t$insert_data['r'] = $this_node['l'] + 1;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['level'] = $this_node['level'];\r\n\r\n\t\tif (!$this->_dumb_mode || !$node_id = isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->_node_table, implode(', ', array_keys($qr)), implode(', ', $qr));\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "public function edit(Node $node)\n {\n //\n }", "function change_node_content(&$dom, &$node, $new_txt_content){\n\t\t// to accomplish changing the content\n\t\t// of a node, we delete the child\n\t\t// text node of the node passed in and\n\t\t// add a new text node with the given value\n\t\t$txt_node = $node->child_nodes();\n\t\t$txt_node = $txt_node[0];\n\t\t$node->remove_child($txt_node);\n\t\t// now create the new node\n\t\t$new_txt = $dom->create_text_node($new_txt_content);\n\t\t$node->append_child($new_txt);\n\t}", "protected function setElementContent($node, $value)\n\t{\n\t\tif ($node->tagName == 'input') {\n\t\t\t$node->setAttribute('value', $value);\n\t\t} else if ($node->tagName == 'img') {\n\t\t\t$node->setAttribute('src', $value);\n\t\t} else if ($node->tagName == 'a') {\n\t\t\t$node->setAttribute('href', $value);\n\t\t} else if ($node->tagName == 'meta') {\n\t\t\t$node->setAttribute('content', $value);\n\t\t} else {\n\t\t\t$node->nodeValue = htmlentities($value);\n\t\t}\n\t}", "private function pushNode(\\DOMElement $node)\r\n {\r\n $this->currentNode = $this->currentNode->appendChild($node);\r\n }", "function setToRuntimeNode($blocked_channel, $timeleft)\n\t{\n\t\t$blocked_chn_total = query(\"/runtime/dfs/blocked/entry#\");\n\t\t/* if blocked channel exist before, use the old index. */\n\t\t$index = 1;\n\t\twhile($index <= $blocked_chn_total)\n\t\t{\n\t\t\tif($blocked_chn_total == 0) {break;}\n\t\t\t$ch = query(\"/runtime/dfs/blocked/entry:\".$index.\"/channel\");\n\t\t\tif($ch == $blocked_channel)\n\t\t\t{\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t\t$index++;\n\t\t}\n\t\tset(\"/runtime/dfs/blocked/entry:\".$index.\"/channel\",$blocked_channel);\n\t\texecute_cmd(\"xmldbc -t \\\"dfs-\".$blocked_channel.\":\".$timeleft.\":xmldbc -X /runtime/dfs/blocked/entry:\".$index.\"\\\"\");\n\t\t//execute_cmd(\"xmldbc -t \\\"dfs-\".$blocked_channel.\":5:xmldbc -X /runtime/dfs/blocked/entry:\".$index.\"\\\"\");\n\t}", "public function setNid($nid) {\n $this->nid = $nid;\n }", "abstract public function set();", "public function setNodeID(string $nodeID) : self\n {\n $this->nodeID = $nodeID;\n\n return $this;\n }", "public function insert($val) {\n // Make sure element being inserted is type of Node.\n if (!is_object($val) || getclass($val) !== \"Node\") {\n $node = new Node($val);\n } else {\n $node = $val;\n }\n\n $this->_head->setPrev($node);\n\n $node->setNext($this->_head);\n $node->setPrev($this->_sentinel);\n $this->_head = $node;\n }", "public function setParentIdValue(BaseObject $node, $value)\n {\n $setter = self::forgeMethodName($node, 'set', 'parent');\n return $node->$setter($value);\n }", "public function setNodeRoute($route);", "private function _setUpNewNode(Node $node)\n {\n $node->setContainer($this->_container);\n\n return $node;\n }", "protected function setAuthorOfPostNodeToCurrentUser(NodeInterface $node): void\n {\n $currentUser = $this->userService->getCurrentUser();\n $userIdentifier = $this->persistenceManager->getIdentifierByObject($currentUser);\n\n $node->setProperty('user', $userIdentifier);\n }", "public function testSetChildByNodes() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$objNode1 = new LeftRightTreeTraversal\\Node(1);\n\t\t$objNode2 = new LeftRightTreeTraversal\\Node(2);\n\n\t\t$this->boolean($objBuilder->setChildByNodes($objNode2, $objNode1))->isTrue();\n\t\t$hashChecks = array(\n\t\t\t\t1 => array(\n\t\t\t\t\t\t'id' \t\t=> 1,\n\t\t\t\t\t\t'parent'\t=> null,\n\t\t\t\t\t\t'left'\t\t=> 0,\n\t\t\t\t\t\t'right'\t\t=> 3\n\t\t\t\t),\n\t\t\t\t2 => array(\n\t\t\t\t\t\t'id' \t\t=> 2,\n\t\t\t\t\t\t'parent'\t=> 1,\n\t\t\t\t\t\t'left'\t\t=> 1,\n\t\t\t\t\t\t'right'\t\t=> 2\n\t\t\t\t)\n\t\t);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\t\t$this->array($arrayResult)->size->isEqualTo(2);\n\t\tforeach ($arrayResult as $hashNode) {\n\t\t\t$this\n\t\t\t->array($hashNode)\n\t\t\t->hasKey('id')\n\t\t\t->hasKey('left')\n\t\t\t->hasKey('right')\n\t\t\t->integer($hashNode['id'])\n\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['id'])\n\t\t\t->integer($hashNode['left'])\n\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['left'])\n\t\t\t->integer($hashNode['right'])\n\t\t\t->isEqualTo($hashChecks[$hashNode['id']]['right'])\n\t\t\t;\n\t\t}\n\t}", "public function update($data)\n {\n\n// $this->node->getF\n }", "public function set ($key, $value) {\n\t\t$this->root = $this->setLoop($key, $value, $this->root);\n\t}", "public function setNodename(string $nodename);", "function SetParent(&$ParentNode)\n {\n $this->ParentNode = &$ParentNode;\n $this->Level = $this->ParentNode->Level + 1;\n }", "public function testAddNode() {\n\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\n\t\t$this->boolean($objBuilder->addNode(new LeftRightTreeTraversal\\Node(0)))->isTrue();\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this\n\t\t\t->array($arrayResult)\n\t\t\t\t->hasKey(0)\n\t\t\t\t->size->isEqualTo(1)\n\t\t\t->array($arrayResult[0])\n\t\t\t\t->hasKey('id')\n\t\t\t\t->hasKey('left')\n\t\t\t\t->hasKey('right')\n\t\t;\n\n\t\t/*\n\t\t * Same test with a custom config\n\t\t */\n\n\t\t$hashConfig = array(\n\t\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder($hashConfig);\n\t\t$this->boolean($objBuilder->addNode(new LeftRightTreeTraversal\\Node(0)))->isTrue();\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this\n\t\t\t->object($objBuilder)\n\t\t\t->isNotNull($objBuilder)\n\t\t\t->isInstanceOf('LeftRightTreeTraversal\\TreeBuilder')\n\n\t\t\t->array($arrayResult)\n\t\t\t\t->hasKey(0)\n\t\t\t\t->size->isEqualTo(1)\n\t\t\t->array($arrayResult[0])\n\t\t\t\t->hasKey('custom_id')\n\t\t\t\t->hasKey('custom_left')\n\t\t\t\t->hasKey('custom_right')\n\t\t\t->integer($arrayResult[0]['custom_id'])\n\t\t\t\t->isEqualTo(0)\n\t\t\t->integer($arrayResult[0]['custom_left'])\n\t\t\t\t->isEqualTo(0)\n\t\t\t->integer($arrayResult[0]['custom_right'])\n\t\t\t\t->isEqualTo(1)\n\t\t;\n\n\t}", "public function testPreSetDataWithNewNode()\n {\n Phake::when($this->node)->getId()->thenReturn(null);\n Phake::when($this->event)->getData()->thenReturn($this->node);\n\n $this->subscriber->preSetData($this->event);\n\n Phake::verify($this->form)->add('nodeSource', 'orchestra_node_choice', array(\n 'required' => false,\n 'mapped' => false,\n 'label' => 'open_orchestra_backoffice.form.node.node_source'\n ));\n }", "function setMainNode($nombre){\n\t\t$this->nodeppal=$nombre;\n\t\treturn 0;\n\t}", "function apply($node)\r\n\t\t{\r\n\t\t\t$this->address = $node->address;\r\n\t\t\t$this->elements = $node->elements;\r\n\t\t\t$this->size = $node->size;\r\n\t\t\t$this->parent = $node->parent;\r\n\t\t\t$this->less = $node->less;\r\n\t\t\t$this->previous = $node->previous;\r\n\t\t\t$this->next = $node->next;\r\n\t\t}", "public function setValue(&$node, $value, $name = null, $asNode = false) {\n\t\tif (!($node instanceof \\DOMElement)) {\n\t\t\tthrow new ArgumentException($node, '\\DOMElement', 1);\n\t\t}\n\t\tif ($value instanceof \\DOMNode) {\n\t\t\tif ($node->ownerDocument !== $value->ownerDocument) {\n\t\t\t\t$value = $node->ownerDocument->importNode($value, true);\n\t\t\t}\n\t\t\t$node->appendChild($value);\n\t\t} else {\n\t\t\tif ($asNode) {\n\t\t\t\t$childNode = $node->appendChild($node->ownerDocument->createElement($name));\n\t\t\t\tif (is_null($value)) {\n\t\t\t\t\t$this->setNodeAsNull($childNode);\n\t\t\t\t} else {\n\t\t\t\t\t$childNode->appendChild($childNode->ownerDocument->createTextNode($value));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (is_null($value)) {\n\t\t\t\t\t$childNode = $node->appendChild($node->ownerDocument->createElement($name));\n\t\t\t\t\t$this->setNodeAsNull($childNode);\n\t\t\t\t} else {\n\t\t\t\t\t$node->setAttribute($name, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function offsetSet($offset, $node)\r\n {\r\n if (!$node instanceof NodeInterface) {\r\n throw new Sphere_Node_NodeException('Cannot set child as it is not a node');\r\n }\r\n return parent::offsetSet($offset, $node);\r\n }", "public function setNodeLinks($type)\r\n\t{\r\n\t\t$this->linktype = $type;\r\n\t}", "public function transferFromDOM($node)\n {\n $this->_ccrDom = $node;\n }", "public function setTeamNode(string $nodename, TeamNode $teamNode)\n {\n return $this->setChild($nodename, $teamNode);\n }", "public function setTypeAttribute($newValue) {\n $type = NodeType::get($newValue);\n $this->attributes['type'] = $type->getValue();\n }", "public function setNodeName($nodeName)\n {\n $this->_data['ai.internal.nodeName'] = $nodeName;\n }", "public function right(): ?Node\n {\n return $this->right;\n }", "public function unshiftNode( $node );", "public function testSet()\n {\n $object = new \\Webaholicson\\Minimvc\\Core\\Object(['test' => true]);\n $this->assertTrue($object->get('test'));\n $this->assertSame($object, $object->set('test', false));\n $this->assertFalse($object->get('test'));\n $object->set(['node' => ['test' => false]]);\n $this->assertContains(false , $object->get('node'));\n }", "public function setOriginalNode(array $originalNode)\n {\n $this->originalNode = $originalNode;\n }", "public function setParent(PhpcrNodeInterface $parentNode);", "public function setValue ( $value ) {\n\n if(!($value instanceof \\Hoa\\Tree\\ITree\\Node))\n $value = new \\Hoa\\Tree\\SimpleNode(md5($value), $value);\n\n $old = $this->_value;\n $this->_value = $value;\n\n return $old;\n }", "private function addNode(Node $node, Bid $bid): void\n {\n // If the new node is larger then then pass to the left subtree, else pass to the right\n $direction = strcmp($bid->bidId, $node->bid->bidId) < 0 ? 'left' : 'right';\n\n // If no subtree exists for the given direction, create a new subtree in that direction\n if ($node->$direction === null) {\n // Set the node's subtree to a new node\n $node->$direction = new Node($bid);\n } else {\n // A subtree in this direction exists, so we need\n // to recursively traverse it to insert it into the\n // correct position within that tree.\n $this->addNode($node->$direction, $bid);\n }\n }", "private function _replacementNode($old_node, $value)\n {\n $new_node = $this->_xml->createElementNS(\n self::XMLNAMESPACE, $old_node->tagName\n );\n $text = $this->_xml->createTextNode($value);\n $new_node->appendChild($text);\n return $new_node;\n }", "public static function fromNode(Node $node);", "public function setCalendarNode(string $nodename, CalendarInterface $node)\n {\n $bag = $this->getOrCreateCalendarBag();\n\n return $bag->setCalendarNode($nodename, $node);\n }" ]
[ "0.70350003", "0.7027494", "0.6451218", "0.64220434", "0.63821733", "0.63602585", "0.61983514", "0.6108923", "0.6101263", "0.6090256", "0.60638726", "0.59860563", "0.5977954", "0.59293187", "0.5851045", "0.5843139", "0.5833144", "0.58175355", "0.57885563", "0.57716036", "0.5769504", "0.57553893", "0.5742338", "0.57102174", "0.5660337", "0.56543505", "0.56528634", "0.5641795", "0.55696183", "0.55120575", "0.5511801", "0.5487896", "0.5484458", "0.5467567", "0.54614514", "0.5455154", "0.54496", "0.54488975", "0.5418133", "0.5417832", "0.53939813", "0.53893787", "0.53803617", "0.53701395", "0.5370126", "0.53594923", "0.53536266", "0.5348467", "0.53418535", "0.5333728", "0.5326374", "0.53226495", "0.5294252", "0.5290581", "0.5280363", "0.52565783", "0.52525705", "0.52375954", "0.5230504", "0.52288127", "0.5179309", "0.5157288", "0.5153085", "0.5152738", "0.5143911", "0.51428497", "0.5141806", "0.5130982", "0.5125851", "0.5118246", "0.5109989", "0.51066774", "0.5098248", "0.5095284", "0.5089313", "0.5085889", "0.50826955", "0.5080651", "0.5076153", "0.5068486", "0.5067801", "0.5058279", "0.5056664", "0.50520927", "0.50484574", "0.50352097", "0.50324076", "0.5028566", "0.50280625", "0.5027799", "0.5026694", "0.5024227", "0.5019939", "0.5016224", "0.50011075", "0.496971", "0.49622354", "0.4948679", "0.49331385", "0.4926527" ]
0.66398114
2
Retrieves the right node
public function right(): ?RedBlackNode { return $this->right; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function node()\n\t{\n\t\t$registry = Jquarry_Registry::instance();\n\t\t\n\t\treturn $registry->get_node($this->node_id());\n\t}", "public function getNode() {\r\n return $this->node;\r\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return $this->node;\n }", "public function getNode()\n {\n return parent::getNode();\n }", "public function getNode()\n\t{\n\t\treturn $this->_node;\n\t}", "function getActualNode(){\n\t\treturn $this->anode;\n\t}", "public function get_node() {\n return \\Drupal::routeMatch()->getParameter('node');\n }", "function getMainNode(){\n\t\treturn $this->nodeppal;\n\t}", "public function getNode() {\n\t\treturn self::$nodes[mt_rand(0, (self::$COUNT-1))];\n\t}", "public function getNode(): int {\n return $this->node;\n }", "protected static function getNode() {\r\n if (!$namespace = static::getNamespace()) {\r\n return static::$node;\r\n }\r\n return camelTo_(substr(get_called_class(), strlen($namespace) + 1));\r\n }", "public function getNode(): ?Node;", "public function getRootNode() {}", "public function getNode(): AbstractNode\n {\n return $this->node;\n }", "private function getNode(): NodeInterface {\n $config = $this->getConfiguration();\n return $config['node'];\n }", "public function getFirstChild();", "public function getPhpcrNode();", "public function getCurrentNode() : Node\n {\n return $this->currentNode;\n }", "public function getNodeFromUrl() {\n\n $path = $this->getCurrentPath();\n $system_path = drupal_lookup_path('source', $path);\n if (!$system_path) {\n $system_path = $path;\n }\n $menu_item = menu_get_item($system_path);\n if ($menu_item['path'] == 'node/%') {\n $node = node_load($menu_item['original_map'][1]);\n }\n else {\n throw \\Exception(sprintf(\"Node could not be loaded from URL '%s'\", $path));\n }\n return $node;\n }", "public function getNode()\n {\n if(!($domainId = $this->getData('domainId'))) {\n return null;\n }\n \n return MazelabVpopqmail_Model_DiFactory::getNodeManager()->getNodeOfDomain($domainId);\n }", "function getValNode(){\n\t\t$clase=$this->nmclass;\n\t\t$node=$this->anode;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getNodeInfo() {\n return Node::factory($this, $this->get(\"/\")->getJson());\n }", "public function getNodeFromStack() {}", "public function getNode(): NodeInterface\n {\n return $this->node;\n }", "public function right(): ?Node\n {\n return $this->right;\n }", "public function getNode($name)\n {\n return isset($this->nodes[$name])?$this->nodes[$name]:null;\n }", "public function current()\n {\n if (($this->isvalid) and (!librdf_iterator_end($this->iterator))) {\n // the pointer returned is overwritten when the iterator is\n // advanced or closed, so make a copy of the node\n $ret = librdf_iterator_get_object($this->iterator);\n if ($ret) {\n return LibRDF_Node::makeNode(librdf_new_node_from_node($ret));\n } else {\n throw new LibRDF_Error(\"Unable to get current node\");\n }\n } else {\n return NULL;\n }\n }", "function get_node( $val, $col = 'lft' )\n\t{\n\t\t$node_data = array(\n\t\t\t'node_id' => '',\n\t\t\t'lft' => 0,\n\t\t\t'rgt' => 0,\n\t\t\t'parent' => '',\n\t\t\t'moved' => '',\n\t\t\t'label' => '',\n\t\t\t'entry_id' => '',\n\t\t\t'template_path' => '',\n\t\t\t'custom_url' => '',\n\t\t\t'type' => array(),\n\t\t\t'field_data' => '',\n\t\t\t'depth' => ''\n\t\t);\n\n\t\t$query = ee()->db->get_where( \n\t\t\t$this->tree_table, \n\t\t\tarray($col => $val), \n\t\t\t1 \n\t\t);\n\t\treturn $query->num_rows() ? $query->row_array() : $node_data;\n\t}", "public function getToNode(): int {\n return $this->toNode;\n }", "private function getNode($node)\n {\n $token = $this->getToken();\n\n if ($token) {\n return $this->node->getToken($token);\n }\n\n return;\n }", "public function getNode($position) {\n foreach ($this as $i => $node) {\n if ($i == $position) {\n return $node;\n }\n }\n\n return null;\n }", "public function forumNode()\n {\n if (!$this->forumNode)\n {\n $this->forumNode = eZContentObjectTreeNode::fetch(\n $this->attribute('node_id'),\n $this->languageCode()\n );\n }\n return $this->forumNode;\n }", "public function getPageNode() {\n\t\tif ($this->_pageNode === null) {\n\t\t\t$this->analyzeURL();\n\t\t}\n\t\treturn $this->_pageNode;\n\t}", "public function name() { return $this[0]->nodeName; }", "private function getNode($key)\n {\n /* @var $e Node */\n if ($key === null) {\n throw new NullPointerException();\n }\n if (!is_int($key) && !is_string($key)) {\n throw new ClassCastException('keys must be integers or strings');\n }\n \n if ($this->size == 0) {\n return null;\n }\n \n $first = $this->first;\n if ($first->getKey() === $key) {\n return $first;\n }\n if (($e = $first->next) != null) {\n do {\n if ($e->getKey() === $key) {\n return $e;\n }\n } while (($e = $e->next) != null);\n }\n return null;\n }", "public function current(): Node\n {\n return $this->nodes[$this->pointer];\n }", "function get($id) {\n foreach ($this->body as $node) {\n if ($node instanceof Type) {\n if ($node->getID() == $id) {\n return $node;\n }\n }\n }\n }", "public function get($key)\n {\n return (($e = $this->getNode($key)) == null) ? null : $e->getValue();\n }", "public function getLastNode()\n {\n return $this->lastNode;\n }", "public function getNodeKey()\n\t{\n\t\treturn $this->_node_key;\n\t}", "public function getFirstNode()\n {\n return $this->firstNode;\n }", "public static function getNodeType();", "private function getNode(string $name){\r\n\t $xdoc=$this->doc;\r\n\t return $xdoc->SelectSingleNode(\"//settings/setting[@id='$name']\"); \r\n\t }", "public function first()\n {\n return count($this->nodes)?$this->nodes[0]:null;\n }", "public function get ($key) {\n\t\t$node = $this->root;\n\t\twhile ($node !== null) {\n\t\t\t$c = $this->compare($key, $node->key);\n\t\t\tif ($c === 0) {\n\t\t\t\treturn $node->value;\n\t\t\t}\n\t\t\tif ($c < 0) {\n\t\t\t\t$node = $node->left;\n\t\t\t} else {\n\t\t\t\t$node = $node->right;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function get(int $position) : HTMLNode\n {\n return $this->nodes[$position];\n }", "public function findNode ($name, $node = NULL) {\n $rval = 0;\n // this function is for backwards compatibility... \n if (isset($this->xpath)) { // only use the xpath object if it has been defined\n //for ILN; if we need namespace beyond TEI, will need to rewrite this. AH 02-01-2011\n $n = $this->xpath->registerNamespace('tei','http://www.tei-c.org/ns/1.0'); \n $n = $this->xpath->query(\"//$name\");\n // return only the value of the first one\n if ($n->length > 0) {\t\t// returns DOM NodeList; check nodelist is not empty\n\t $rval = $n->item(0)->textContent;\n }\n }\n return $rval;\n }", "function getNextNode($data)\n\t{\t\t\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft > ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft'));\t\t\t\t\t\t\t \t\t\t\t\t\n\t}", "protected function getUserNode()\n {\n $dn = $this->getUserDn();\n if ($dn !== '') {\n return $this->getLdap()->getNode($dn);\n }\n\n return null;\n }", "public function getInstanceOf(Model $parent, string $type): Node;", "public function getLastCreatedNode() {\n $node = end($this->nodes);\n\n return $node;\n }", "protected function node() : Node\n {\n return $this->array;\n }", "public function getNodeType();", "function & get_node($id, $add_sql = array())\r\n\t{\r\n\t\t$sql = sprintf('SELECT %s %s FROM %s %s WHERE %s.id=%s %s',\r\n\t\t\t\t\t\t\t\t\t\t$this->_get_select_fields(), \n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'columns'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, \n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'join'),\r\n\t\t\t\t\t\t\t\t\t\t$this->_node_table, $id,\r\n\t\t\t\t\t\t\t\t\t\t$this->_add_sql($add_sql, 'append')\n\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t$node_set =& $this->_get_result_set($sql);\r\n\r\n\t\treturn current($node_set);\r\n\t}", "function getNode($nodeId){\n global $mysqli;\n $sql = \"SELECT id, lat, lon FROM osm_nodes\n WHERE id = $nodeId\n LIMIT 1\";\n $result = $mysqli->query($sql);\n while($result && $row = $result->fetch_assoc()){\n $n = $row;\n }\n return $n ?? null;\n}", "public function getTableNode() : object\n {\n\n return $this->contents->getElementsByTagName('table')->item(0);\n }", "public function getFromNode(): int {\n return $this->fromNode;\n }", "public function getImportableNode(): Node;", "public function getNodeKey(): string\n {\n return $this->nodeKey;\n }", "public function getNodeRoute();", "public function getValue(Node $node);", "protected function getCurrentRevision():? NodeInterface {\n if ($this->node()->isNew()) {\n return NULL;\n }\n\n /** @var \\Drupal\\node\\NodeStorageInterface $nodeStorage */\n $nodeStorage = $this->entityTypeManager->getStorage('node');\n /** @var \\Drupal\\node\\NodeInterface $data */\n $data = $nodeStorage->load($this->node()->id());\n return $data;\n }", "public static function getNodeById($id){\n\t\treturn FfNodeQuery::create()->findOneById($id);\n\t}", "abstract protected function getNodeName();", "public function getParentNode() {}", "public function name() {\r\n return $this->node->nodeName;\r\n }", "public function getNodeID() : string\n {\n return $this->nodeID;\n }", "function fetchSuccessorNode($a_node_id, $a_type = \"\")\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (!isset($a_node_id))\n\t\t{\n\t\t\t$this->ilErr->raiseError(get_class($this).\"::getNodeData(): No node_id given! \",$this->ilErr->WARNING);\n\t\t}\n\n\t\t// get lft value for current node\n\t\t$query = 'SELECT lft FROM '.$this->table_tree.' '.\n\t\t\t'WHERE '.$this->table_tree.'.child = %s '.\n\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s ';\n\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t$a_node_id,\n\t\t\t$this->tree_id));\n\t\t$curr_node = $ilDB->fetchAssoc($res);\n\t\t\n\t\tif($a_type)\n\t\t{\n\t\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t\t$this->buildJoin().\n\t\t\t\t'WHERE lft > %s '.\n\t\t\t\t'AND '.$this->table_obj_data.'.type = %s '.\n\t\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s '.\n\t\t\t\t'ORDER BY lft ';\n\t\t\t$ilDB->setLimit(1);\n\t\t\t$res = $ilDB->queryF($query,array('integer','text','integer'),array(\n\t\t\t\t$curr_node['lft'],\n\t\t\t\t$a_type,\n\t\t\t\t$this->tree_id));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = 'SELECT * FROM '.$this->table_tree.' '.\n\t\t\t\t$this->buildJoin().\n\t\t\t\t'WHERE lft > %s '.\n\t\t\t\t'AND '.$this->table_tree.'.'.$this->tree_pk.' = %s '.\n\t\t\t\t'ORDER BY lft ';\n\t\t\t$ilDB->setLimit(1);\n\t\t\t$res = $ilDB->queryF($query,array('integer','integer'),array(\n\t\t\t\t$curr_node['lft'],\n\t\t\t\t$this->tree_id));\n\t\t}\n\n\t\tif ($res->numRows() < 1)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($res);\n\t\t\treturn $this->fetchNodeData($row);\n\t\t}\n\t}", "function test_get_node()\r\n\t{ \r\n\t\t// Set some rootnodes\r\n\t\t$nids = $this->_setup_root_nodes(3); \r\n\t\t// Loop trough the node id's of the newly created rootnodes\r\n\t\tfor($i = 0; $i < count($nids); $i++)\r\n\t\t{\r\n\t\t\t$nid = $nids[$i];\r\n\r\n\t\t\t$nname = 'Node ' . $nid;\r\n\t\t\t$norder = $nid; \r\n\t\t\t// Pick the current node and do the tests\r\n\t\t\t$nnode = $this->_tree->get_node($nid); \r\n\t\t\t// Test Array\r\n\t\t\t$this->assertEqual(is_array($nnode), \"Node $nname: No array given.\"); \r\n\t\t\t// Test lft/rgt\r\n\t\t\t$this->assertEqual(1, $nnode['l'], \"Node $nname: Wrong LFT\");\r\n\t\t\t$this->assertEqual(2, $nnode['r'], \"Node $nname: Wrong RGT\"); \r\n\t\t\t// Test order\r\n\t\t\t$this->assertEqual($norder, $nnode['ordr'], \"Node $nname: Wrong order.\"); \r\n\t\t\t// Test Level\r\n\t\t\t$this->assertEqual(1, $nnode['level'], \"Node $nname: Wrong level.\"); \r\n\t\t\t// Test Name\r\n\t\t\t$this->assertEqual($nname, $nnode['identifier'], \"Node $nname: Wrong name.\");\r\n\t\t} \r\n\t\treturn true;\r\n\t}", "protected function get_node( $data ) {\n\t\tif ( $data instanceof WP_Post ) {\n\t\t\t$node = new Post_Node( $data );\n\t\t} else if ( $data instanceof WP_Post_Type ) {\n\t\t\t$node = new Post_Type_Node( $data );\n\t\t} else {\n\t\t\t$node = new Node( $data );\n\t\t}\n\n\t\t/**\n\t\t * Modify site tree view node.\n\t\t *\n\t\t * @param array $node\n\t\t */\n\t\t$node = apply_filters( 'stv_node', $node );\n\n\t\treturn $node instanceof Node ? $node : new Node;\n\t}", "public function lookupNode($filename)\n {\n if (! isset($this->_toc)) {\n $up_to_date = _up_to_date($this->LastEdited, $this->DevhelpFile);\n $lifetime = $up_to_date ? 3600 : -1;\n $this->_toc = $this->cacheToFile('getTOC', $lifetime, $this->DevhelpFile);\n }\n return @$this->_toc[$filename];\n }", "public function findNodeFromCurrentPath() {\r\n $path = \\Drupal::request()->getRequestUri();\r\n $path_data = explode('/', $path);\r\n\r\n if ($this->currentPathIsValidPrintVariantPath()) {\r\n // By this point, we should be on a PPI Print variant path.\r\n $node_path = '/node/' . $path_data[2];\r\n\r\n return $this->findNodeFromPath($node_path);\r\n }\r\n return NULL;\r\n }", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "public function getLastRootNode()\n {\n $qb = $this->qbFactory\n ->getRootNodeQueryBuilder()\n ->orderBy('e.' . $this->getPathFieldName(), 'DESC')\n ->setMaxResults(1);\n try {\n return $this->getNode($qb->getQuery()->getSingleResult());\n } catch (NoResultException $e) {\n return null;\n }\n }", "public function getLeagueNode(string $nodename)\n {\n return $this->getChild($nodename);\n }", "function &FindNodeByName($Name)\n {\n foreach($this->ChildNodes as $node)\n if ( $node->Name == $Name )\n return $node;\n\n // To make PHP5 happy, we will not return NULL, but a variable which\n // has a value of NULL.\n $NULL = NULL;\n return $NULL;\n }", "public function getPostNode($post_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$res = $ilDB->queryf('\n\t\t\tSELECT * FROM frm_posts, frm_posts_tree \n\t\t\tWHERE pos_pk = pos_fk \n\t\t\tAND pos_pk = %s',\n\t\t\tarray('integer'),\n\t\t\tarray($post_id));\n\t\t\n\t\t$row = $res->fetchRow(DB_FETCHMODE_OBJECT);\n\n\t\treturn $this->fetchPostNodeData($row);\n\t}", "public function getSiteNode() {\n\n\t\tif (!$this->siteNode) {\n\n\t\t\t/** @var ContentContext $contentContext */\n\t\t\t$contentContext = $this->createContext();\n\t\t\t$this->siteNode = $contentContext->getCurrentSiteNode();\n\t\t}\n\n\t\treturn $this->siteNode;\n\t}", "public function getRightValue(BaseObject $node)\n {\n $getter = self::forgeMethodName($node, 'get', 'right');\n return $node->$getter();\n }", "public function getNodeType()\n {\n return $this->m_nodeType;\n }", "public function getMessageNode()\n {\n return $this->messageNode;\n }", "function &getRightSibling()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_rightsibling;\n\t}", "public function getNode()\n {\n return FileSystem::getInstance()->stat($this->statpath);\n }", "protected function Search_Node($goal_value){\t\t\t\t\t\t\t\t\n\t\t\tforeach ($this->nodes as $key => $obj) {\n\t\t\t\tif ($obj->element==$goal_value) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "function &getRightSibling()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_rightsibling;\n\t}", "function getValNode_dif($node){\n\t\t$clase=$this->nmclass;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getNodeName();", "public function getNodeTypeName() {}", "function getNodeTypeName() ;", "function find_node($tb_no){\n\t//global $conn;\n\tglobal $wise_table;\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->tb_no==$tb_no) return $wise_table[$i]; // found\n\t}\n\treturn null; // not found\t\n}", "public function getNodeTitle() {\n return $this->{$this->titleAttribute};\n }", "public function getElementName(){\r\n\t\treturn $this->domNode->nodeName;\r\n\t}", "protected function getNode(ComplexDataInterface $item) {\n $item = $item->getValue();\n if ($item instanceof CommentInterface) {\n $item = $item->getCommentedEntity();\n }\n if ($item instanceof NodeInterface) {\n return $item;\n }\n\n return NULL;\n }", "public function getRefNode($key, $empty = false)\n {\n return $this->followLink($key, $empty);\n }", "public function getRightChild()\n\t{\n\t\treturn $this->rightChild;\n\t}", "public function down(): ?Node\n {\n return $this->down;\n }", "protected function getNodeObject($obj){\n // Get node object, node revisions are not the same as nodes and are not passed as objects.\n // the above error was causing the original build function to display a warning message.\n if (is_scalar($obj)) {\n // if node is a string then its the nid not the actual node.\n return Node::load($obj);\n }\n\n return $obj;\n }" ]
[ "0.7395713", "0.73788536", "0.73659545", "0.73659545", "0.73659545", "0.73659545", "0.73571557", "0.73240983", "0.68735266", "0.6861104", "0.67237824", "0.67096555", "0.6708513", "0.66379344", "0.65537745", "0.65403557", "0.6508747", "0.6506376", "0.64713424", "0.6359141", "0.6311354", "0.6305979", "0.6303557", "0.6287756", "0.62798095", "0.6218249", "0.6214516", "0.61938083", "0.6113707", "0.61134213", "0.6112998", "0.6093244", "0.6088375", "0.6086768", "0.6079805", "0.6066113", "0.6056195", "0.6041283", "0.60337925", "0.6012481", "0.5968215", "0.59572446", "0.5939908", "0.5911752", "0.591138", "0.5898224", "0.5888951", "0.58754647", "0.5855305", "0.5828037", "0.58236694", "0.57804936", "0.5759281", "0.5753393", "0.5752446", "0.574377", "0.5723302", "0.57185584", "0.57010597", "0.5694495", "0.56888", "0.5686824", "0.5680383", "0.56624377", "0.564795", "0.56313884", "0.5626558", "0.5625034", "0.56223536", "0.56136376", "0.5610645", "0.5607726", "0.5606217", "0.56035626", "0.5592263", "0.55687934", "0.5556079", "0.5555046", "0.5554831", "0.5550572", "0.55502087", "0.55458075", "0.5530945", "0.551934", "0.5506941", "0.5505582", "0.55045545", "0.5501391", "0.5498933", "0.54984367", "0.54920214", "0.5484998", "0.5483268", "0.5482822", "0.5476101", "0.5472406", "0.54703385", "0.546845", "0.5467138", "0.54597116" ]
0.5812705
51
Sets the color flag
public function setColor(bool $color): void { $this->color = $color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_color($color = false) {\n $this->color = (Validator::isa($color,\"boolean\") ? $color : false);\n }", "public function setColor($color) {}", "public function setColor($color, $stroking = true) {}", "function setColor( $c ) {\n $this->currentColor = $c;\n}", "function setColor($newColor) {\n\t\t$this->color = $newColor;\n\t}", "public function setColor($color){\n $this->color = $color;\n }", "public function setColor() {\n\t\t$cnt = func_num_args();\n\t\tif ($cnt == 0) {\n\t\t\t$this->Color = new TColor(255,100,255);\n\t\t}\telse\n\t\tif ($cnt == 1) {\n\t\t\tlist ($sender) = func_get_args();\n\t\t\tif ($sender instanceof TColor) {\n\t\t\t\t$this->Color = new TColor(\n\t\t\t\t$sender->getRed (),\n\t\t\t\t$sender->getGreen(),\n\t\t\t\t$sender->getBlue ());\n\t\t\t}\telse\n\t\t\tif (is_string($sender)) {\n\t\t\t\t// todo: string\n\t\t\t}\n\t\t}\telse\n\t\tif ($cnt == 3) {\n\t\t\tlist($a1,$a2,$a3) = func_get_args();\n\t\t\t$this->Color = new TColor($a1,$a2,$a3);\n\t\t}\n\t}", "function setColor($color_coche, $nombre_coche){\r\n\t\t\t$this->color=$color_coche;\r\n\t\t\techo \"El color del \" . $nombre_coche . \" es: \" . $this->color . \"<br/>\";\r\n\t\t}", "public function setColor($color) {\n\t\t$this->color = $color;\n\t}", "public function setColor($color)\n {\n $this->color = $color;\n }", "static function colorize() {\n\t\tself::$colorize = true;\n\t}", "public function setColor($color)\n {\n $this->color = $color;\n }", "public function setBackgroundColor($color) {}", "public function setColor(?string $value): void {\n $this->getBackingStore()->set('color', $value);\n }", "public function setColor( $rgb ) {\n\t}", "public function setColor($hex) {\n }", "function it_gets_and_sets_the_color_option()\n {\n $this->getColor()->shouldReturn('yellow');\n\n // Set the color key\n $this->setColor('random');\n\n // Get the current color setting\n $this->getColor()->shouldReturn('random');\n }", "public function setInteriorColor($color) {}", "public function setInteriorColor($color) {}", "public function setInteriorColor($color) {}", "public function setColor($val)\n {\n $this->_propDict[\"color\"] = $val;\n return $this;\n }", "function establece_color ($color_camion, $nombre_camion) {\n\n $this -> color = $color_camion;\n\n echo \"El color del camion es \" . $this -> color . \"<br>\";\n\n }", "public function useColor($name);", "public function setColor($value)\r\n {\r\n $this->_cleanse($value, __METHOD__);\r\n $this->_color = $value;\r\n \r\n return $this;\r\n }", "function SetDrawColor($r,$g=-1,$b=-1)\n\t\t{\n\t\t\tif(($r==0 and $g==0 and $b==0) or $g==-1)\t$this->DrawColor=sprintf('%.3f G',$r/255);\n\t\t\telse $this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);\n\t\t\tif($this->page>0)\t$this->_out($this->DrawColor);\n\t\t}", "function setTieColor($tiecolor) {\n $this->tiecolor = $tiecolor;\n }", "public function color()\n {\n }", "protected function setBgColor():void{\n\n\t\tif(isset($this->background)){\n\t\t\treturn;\n\t\t}\n\n\t\tif($this::moduleValueIsValid($this->options->bgColor)){\n\t\t\t$this->background = $this->prepareModuleValue($this->options->bgColor);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->background = $this->prepareModuleValue([255, 255, 255]);\n\t}", "public function setStrokingColor($color) {}", "public function setStrokingColor($color) {}", "public function setColor(string $value)\n {\n $this->styles['color'] = HtmlBuilder::validateColor($value);\n }", "protected function setRed($c)\n\t{\n\t\t$this->setSaveColor($c, 'r');\n\t}", "public function setColor(int $color = Printer::COLOR_1)\n {\n self::validateInteger($color, 0, 1, __FUNCTION__, \"Color\");\n $this -> connector -> write(self::ESC . \"r\" . chr($color));\n }", "protected function setBgColor():void{\n\n\t\tif(isset($this->background)){\n\t\t\treturn;\n\t\t}\n\n\t\tif($this::moduleValueIsValid($this->options->bgColor)){\n\t\t\t$this->background = $this->prepareModuleValue($this->options->bgColor);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$this->background = $this->prepareModuleValue('white');\n\t}", "function set_color_account_status($acc_number,$color)\n\t{\n\t switch($color):\n\t case('1'): $data['color'] = '#00FF00';\n\t\tbreak;\n\t case('2'): $data['color'] = '#FF0000';\n\t\tbreak;\n\t case('3'): $data['color'] = '#FFFFFF';\n\t\tbreak;\n\t case('4'): $data['color'] = '#999999';\n\t\tbreak;\n\t case('5'): $data['color'] = '#00F0F0';\n\t\tbreak;\n\t\totherwise:\n\t\t\t$data['color'] = '#FFFFFF';\n\t endswitch;\t\n\n\t return $this->db->where('login',$acc_number)\n\t \t ->limit(1)\n\t \t ->update('pamm_accounts', $data);\n\t}", "public function colour();", "public static function color($value)\n {\n self::$color = Color::toRGBA($value);\n }", "public function setNonStrokingColor($color) {}", "public function setNonStrokingColor($color) {}", "Function setBgColor ($r=false, $g=false, $b=false){\n\t\t$this->bgColor = ($r===false)?\n\t\t\tfalse:\n\t\t\tArray($r, $g, $b);\n\t}", "public static function setColorMode(?AnsiColorMode $colorMode): void\n {\n self::$colorMode = $colorMode;\n }", "function SetFillColor($r,$g=-1,$b=-1)\n\t\t{\n\t\t\tif(($r==0 and $g==0 and $b==0) or $g==-1)\t$this->FillColor=sprintf('%.3f g',$r/255);\n\t\t\telse$this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);\n\t\t\t$this->ColorFlag = ($this->FillColor != $this->TextColor);\n\t\t\tif($this->page>0)\t$this->_out($this->FillColor);\n\t\t}", "public function setColor($r, $g, $b) {\n if ($r < 0 || $r > 1 || $g < 0 || $g > 1 || $b < 0 || $b > 1)\n return false;\n $this->currentPage->setRGBStroke($r, $g, $b);\n $this->currentPage->setRGBFill($r, $g, $b);\n $this->currentFontColor = array($r, $g, $b);\n return true;\n }", "protected function setTransparencyColor():void{\n\n\t\tif($this->options->outputType === QROutputInterface::GDIMAGE_JPG || !$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\timagecolortransparent($this->image, $transparencyColor);\n\t}", "public function setColor(Zend_Pdf_Color $color)\n {\n $this->_color = $color;\n }", "protected function setTransparencyColor():void{\n\n\t\tif(!$this->options->imageTransparent){\n\t\t\treturn;\n\t\t}\n\n\t\t$transparencyColor = $this->background;\n\n\t\tif($this::moduleValueIsValid($this->options->transparencyColor)){\n\t\t\t$transparencyColor = $this->prepareModuleValue($this->options->transparencyColor);\n\t\t}\n\n\t\t$this->imagick->transparentPaintImage($transparencyColor, 0.0, 10, false);\n\t}", "public function setColor($color) {\n return $this->color = $color;\n }", "public function color(): bool\n {\n return $this->color;\n }", "private static function setColorAsBit($controlLevel, &$color)\n\t{\n\t\t$color = $controlLevel + self::PIXELDIFF;\n\t\tif ($color > 255) {\n\t\t\t$color -= (2 * self::PIXELDIFF);\n\t\t}\n\n\t\treturn;\n\t}", "public function setColor($Ai_Colormode, $Av_Color)\n {\n $Lb_Return = true;\n $this->a_Errors = null;\n\n switch($Ai_Colormode)\n {\n case self::SVNHUE_COLORMODE_NAME:\n if (array_key_exists($Av_Color, $this->a_Colors))\n {\n $this->a_State['xy'] = $this->a_Colors[$Av_Color];\n $this->i_Colormode = self::SVNHUE_COLORMODE_XY;\n unset($this->a_State['hue']);\n unset($this->a_State['sat']);\n unset($this->a_State['ct']);\n } /* if */\n else\n {\n $this->a_Errors[] = self::SVNHUE_ERROR_INVALID_COLOR;\n $Lb_Return = false;\n } /* else */\n break;\n\n case self::SVNHUE_COLORMODE_HUE:\n if ((is_numeric($Av_Color[0]) && !is_float($Av_Color[0])) && (is_numeric($Av_Color[1]) && !is_float($Av_Color[1])))\n {\n if ($Av_Color[0] > 65535)\n {\n $Av_Color[0] = 65535;\n } /* if */\n elseif ($Av_Color[0] < 0)\n {\n $Av_Color[0] = 0;\n } /* elseif */\n if ($Av_Color[1] > 254)\n {\n $Av_Color[1] = 254;\n } /* if */\n elseif ($Av_Color[1] < 0)\n {\n $Av_Color[1] = 0;\n } /* elseif */\n\n $this->i_Colormode = self::SVNHUE_COLORMODE_HUE;\n $this->a_State['hue'] = $Av_Color[0];\n $this->a_State['sat'] = $Av_Color[1];\n unset($this->a_State['ct']);\n unset($this->a_State['xy']);\n } /* if */\n else\n {\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n } /* else */\n break;\n\n case self::SVNHUE_COLORMODE_CT:\n if (is_numeric($Av_Color) && !is_float($Av_Color))\n {\n if ($Av_Color > 500)\n {\n $Av_Color = 500;\n } /* if */\n elseif ($Av_Color < 154)\n {\n $Av_Color = 154;\n } /* elseif */\n\n $this->i_Colormode = self::SVNHUE_COLORMODE_CT;\n $this->a_State['ct'] = $Av_Color;\n unset($this->a_State['hue']);\n unset($this->a_State['sat']);\n unset($this->a_State['xy']);\n } /* if */\n else\n {\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n } /* else */\n break;\n\n case self::SVNHUE_COLORMODE_XY:\n if (is_numeric($Av_Color[0]) && is_numeric($Av_Color[1]))\n {\n if ($Av_Color[0] > 1)\n {\n $Av_Color[0] = 1;\n } /* if */\n elseif ($Av_Color[0] < 0)\n {\n $Av_Color[0] = 0;\n } /* elseif */\n if ($Av_Color[1] > 1)\n {\n $Av_Color[1] = 1;\n } /* if */\n elseif ($Av_Color[1] < 0)\n {\n $Av_Color[1] = 0;\n } /* elseif */\n\n $this->i_Colormode = self::SVNHUE_COLORMODE_XY;\n $this->a_State['xy'] = array($Av_Color[0], $Av_Color[1]);\n unset($this->a_State['hue']);\n unset($this->a_State['sat']);\n unset($this->a_State['ct']);\n } /* if */\n else\n {\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n } /* else */\n break;\n\n default:\n $this->a_Errors[] = Hue::SVNHUE_ERROR_WRONG_PARAMETER;\n $Lb_Return = false;\n break;\n } /* switch */\n\n return($Lb_Return);\n\n }", "public function setReverseColors(bool $on = true)\n {\n self::validateBoolean($on, __FUNCTION__);\n $this -> connector -> write(self::GS . \"B\" . ($on ? chr(1) : chr(0)));\n }", "public function setColor($value) {\n $allowed = ['yellow', 'red', 'green'];\n if (!in_array($value, $allowed))\n throw new Exception('A color must be one we like');\n $this->color = $value;\n return $this;\n }", "function setLineColour($col)\n {\n $this->data[$this->series]['col'] = $this->hexcol($col);\n }", "private function _setRandomColor() {\r\n\t\t// Generate random color code.\r\n\t\t$color = array('R' => rand(0, 255), 'G' => rand(0, 255), 'B' => rand(0, 255));\r\n\t\t\r\n\t\t// Set generated color code.\r\n\t\treturn imagecolorallocate($this->_resource, $color['R'], $color['G'], $color['B']);\r\n\t}", "public function setColor($color)\n{\n$this->color = $color;\n\nreturn $this;\n}", "final private function setColors()\n {\n\n $systemColorFile = new PhingFile(Phing::getResourcePath(\"phing/listener/defaults.properties\"));\n\n try {\n $prop = new Properties();\n\n $prop->load($systemColorFile);\n\n $err = $prop->getProperty(\"HtmlColorLogger.ERROR_CLASS\");\n $warn = $prop->getProperty(\"HtmlColorLogger.WARNING_CLASS\");\n $info = $prop->getProperty(\"HtmlColorLogger.INFO_CLASS\");\n $verbose = $prop->getProperty(\"HtmlColorLogger.VERBOSE_CLASS\");\n $debug = $prop->getProperty(\"HtmlColorLogger.DEBUG_CLASS\");\n if ($err !== null) {\n $this->errColor = self::PREFIX . $err . self::SUFFIX;\n }\n if ($warn !== null) {\n $this->warnColor = self::PREFIX . $warn . self::SUFFIX;\n }\n if ($info !== null) {\n $this->infoColor = self::PREFIX . $info . self::SUFFIX;\n }\n if ($verbose !== null) {\n $this->verboseColor = self::PREFIX . $verbose . self::SUFFIX;\n }\n if ($debug !== null) {\n $this->debugColor = self::PREFIX . $debug . self::SUFFIX;\n }\n } catch (IOException $ioe) {\n //Ignore exception - we will use the defaults.\n }\n }", "public function color(array $color);", "public function background($color)\n {\n $this->background = $color;\n }", "protected function setColor(int $index, IColor $color) {\n $this -> offsetSet($index, $color);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "public function color($value) {\n return $this->setProperty('color', $value);\n }", "function establece_color ($colordelcoche, $nombre_coche) {\n\n $this -> color = $colordelcoche; // Estamos asignando el valor del parametro a la propiedad color DE LA CLASE.\n \n echo \"El color de \" . $nombre_coche . \" es: \" . $this -> color;\n\n }", "function setBackground($c1 = 0xEEEEEE, $c2 = false)\n {\n if ($c2 === false) {\n $c2 = $c1;\n }\n $this->bg1 = $this->hexcol($c1);\n $this->bg2 = $this->hexcol($c2);\n }", "function setBackground($c1 = 0xEEEEEE, $c2 = false)\n {\n if ($c2 === false) {\n $c2 = $c1;\n }\n $this->bg1 = $this->hexcol($c1);\n $this->bg2 = $this->hexcol($c2);\n }", "function SetTextColor($r,$g=-1,$b=-1)\n\t\t{\n\t\t\tif(($r==0 and $g==0 and $b==0) or $g==-1)\t\n\t\t\t\t$this->TextColor=sprintf('%.3f g',$r/255);\n\t\t\telse \n\t\t\t\t$this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);\n\t\t\t$this->ColorFlag = ($this->FillColor != $this->TextColor);\n\t\t}", "protected function set_type() {\n\t\t$this->type = 'kirki-color';\n\t}", "public function WorkSpaceColor($red, $green, $blue){\r\n $this->whitepaper_color=[$red,$green,$blue];\r\n }", "public function howToColor($color)\n {\n }", "public function changeEditorColorPalette(): void\n\t{\n\t\t// Unable to use state due to this method is used in JS and store is not registered there.\n\t\t$colors = $this->getSettingsManifest()['globalVariables']['colors'] ?? [];\n\n\t\tif ($colors) {\n\t\t\t\\add_theme_support('editor-color-palette', $colors);\n\t\t}\n\t}", "public function getColor() {\n\t}", "public function set_click($color=0)\n\t{\n\t\t$this->redis_model->increaseClick($color);\n\t\tredirect(base_url().gallery_url().'content/redis', 'refresh');\n\t}", "protected function setBlue($c)\n\t{\n\t\t$this->setSaveColor($c, 'b');\n\t}", "public function setBGColor($arrColor)\r\n\t{\r\n\t\t$this->bgColor = $arrColor;\r\n\t}", "public function ov_color($name, $value = null){\n $args = func_get_args(); array_shift($args); array_shift($args);\n if( !isset($value) || strlen(trim($value)) < 1 ) $value = '#000000';\n return $this->generate_input('color', $name, $value, true, $args);\n }", "private function _setTransparency($color) {\r\n\t\t// Define a color as transparent\r\n\t\timagecolortransparent($this->_resource, $color);\r\n\t\t\r\n\t\t// Enable alpha-blending and save that information\r\n\t\timagealphablending($this->_resource, true);\r\n\t\timagesavealpha($this->_resource, true);\r\n\t}", "public function backgroundColor(array $color);", "public function getColor()\n {\n }", "function nuim_set_colorset($css, $colorset) {\n $menucolorstarttag = '[[setting:menucolorstart]]';\n $menucolorendtag = '[[setting:menucolorend]]';\n $pastelcolortag = '[[settings:pastelcolor]]';\n $blockbackgroundtag = '[[settings:blockbackground]]';\n $blockshadetag = '[[settings:blockshade]]';\n $inputbordertag = '[[settings:thinborder]]';\n $linkcolortag = '[[settings:linkcolor]]';\n $linkcolorhovertag = '[[settings:linkcolorhover]]';\n $linkcolorfocustag = '[[settings:linkcolorfocus]]';\n $headingcolortag = '[[settings:headingcolor]]';\n\n switch( $colorset )\n {\n case 0: //YELLOW\n $menustart = '#eeae13'; //darkyellow\n $menuend = '#f6d18a'; //lightyellow\n $blockbackground = '#FFF4D2'; // yellowish\n $pastel = '#fdf9ec'; //pastelred\n $blockshade = '#F8E7AF'; // darker yellow\n $inputborder = $blockshade;\n $linkcolor = '#cc4714';\n $linkcolorhover = '#7B290B';\n $linkcolorfocus = '#30377B';\n $headingcolor = '#181818';\n break;\n \n case 1: //BLUE\n\n $menustart = '#00818e'; //darkgreen\n $menuend = '#66b3bd'; //lightgreen\n $blockbackground = '#d8f0fe'; //#A9ECFF\n $pastel = '#fff'; //\n $blockshade = '#C1D2E8'; \n $inputborder = $blockshade;\n $linkcolor = '#0C1924'; // or darker: #060F1B\n $linkcolorhover = '#060F1B';\n $linkcolorfocus = '#605553';\n $headingcolor = '#181818';\n break;\n\n case 2 : //RED\n $menustart = '#92352f'; //darkred\n $menuend = '#c6897e'; //lightred\n $pastel = '#E9E9E9'; //pastelred\n $blockbackground = '#ebebeb'; //\n $blockshade = '#b7b7b7'; //\n $inputborder = $blockshade;\n $linkcolor = '#750102';\n $linkcolorhover = '#000';\n $linkcolorfocus = '#000';\n $headingcolor = '#ff0000';\n break;\n\n case 3 : //GREEN\n $menustart = '#333333'; //\n $menuend = '#222222'; //\n $pastel = '#e0e0e0'; //pastelred\n $blockbackground = '#e1f2c4'; // \n $blockshade = '#c2d59c'; // \n $inputborder = $blockshade;\n $linkcolor = '#423e0a';\n $linkcolorhover = '#0b0a02';\n $linkcolorfocus = '#0b0a02';\n $headingcolor = '#181818';\n break;\n \n case 5 : //pink\n $menustart = '#92352f'; //darkred\n $menuend = '#c6897e'; //lightred\n $pastel = '#fff'; //pastelred\n $blockbackground = '#FFEEEC'; //\n $blockshade = '#FFEEEC'; //\n $inputborder = $blockshade;\n $linkcolor = '#3A94BF';\n $linkcolorhover = '#7B290B';\n $linkcolorfocus = '#30377B';\n $headingcolor = '#181818';\n break;\n\n break;\n\n default:\n $menustart = '#997b0f';\n $menuend = '#e6b400';\n break;\n }\n\n $css = str_replace($menucolorstarttag, $menustart, $css);\n $css = str_replace($menucolorendtag, $menuend, $css);\n $css = str_replace($pastelcolortag, $pastel, $css);\n $css = str_replace($blockbackgroundtag, $blockbackground, $css);\n $css = str_replace($blockshadetag, $blockshade, $css);\n $css = str_replace($inputbordertag, $inputborder, $css);\n $css = str_replace($linkcolortag, $linkcolor, $css);\n $css = str_replace($linkcolorhovertag, $linkcolorfocus, $css);\n $css = str_replace($linkcolorfocustag, $linkcolorhover, $css);\n $css = str_replace($headingcolortag, $headingcolor, $css);\n\n return $css;\n}", "public function set_rgbColorAtPowerOn(int $newval): int\n {\n $rest_val = sprintf(\"0x%06x\", $newval);\n return $this->_setAttr(\"rgbColorAtPowerOn\", $rest_val);\n }", "protected function setSaveColor($c, $name = 'r')\n\t{\n\t\t$this->setColor(max(0, min(255, (int)$c)), $name);\n\t}", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "protected function setGreen($c)\n\t{\n\t\t$this->setSaveColor($c, 'g');\n\t}", "protected function parameterizeColors() : void\n {\n $colors = $this->fetchColorsFromACF();\n $this->injectStyles($colors);\n }", "public function setColor($color) {\n if (!self::isCorrectColor($this->getType(), $color)) {\n throw new InputException(null, 'WRONG_COLOR_FORMAT');\n }\n if ($this->getType() !== ColorLib::THEX && $this->getType() !== ColorLib::THTML) {\n foreach ($color as $channelName => &$channelValue) {\n $channelValue = ColorLib::fixColorChannel($channelName, $channelValue);\n }\n }\n $this->color = $color;\n }", "public function setColor()\n {\n // Set color based on provided name\n if (isset($this->compParams['color']) && !empty($this->compParams['color'])) {\n $this->data['classList'][] = $this->getBaseClass() . \"--color-\" . strtolower($this->compParams['color']);\n }\n\n return $this->data;\n }", "public function changeColorCup($request);", "function callback_color($args)\n {\n }", "private function set_color() {\n \n global $pbtheme_data;\n \n return isset( $pbtheme_data[ 'header_topbar_link_color' ] ) ? $pbtheme_data[ 'header_topbar_link_color' ] : false;\n \n }", "public function _onNonstrokingColor($arguments) {}", "function getColor() { return $this->_color; }", "public function setGreenValue( kaforkl_Position $position, $value )\n {\n $this->valueArray[$position->getX()][$position->getY()][self::GREEN] = $value;\n }" ]
[ "0.7831696", "0.7374792", "0.7199038", "0.7164826", "0.69722396", "0.6893564", "0.6778496", "0.67485625", "0.6737788", "0.6679934", "0.6592129", "0.6581988", "0.65562165", "0.65387225", "0.65308005", "0.6485427", "0.64390355", "0.64102715", "0.64073914", "0.64073914", "0.63623595", "0.63301617", "0.62916535", "0.62705165", "0.62704587", "0.6244736", "0.62420213", "0.62346476", "0.6223553", "0.6222013", "0.6211332", "0.6201185", "0.61958027", "0.6159763", "0.6124469", "0.6103806", "0.6056665", "0.59964114", "0.59964114", "0.59347475", "0.59254324", "0.5898427", "0.5894263", "0.5878193", "0.587753", "0.5876589", "0.5875255", "0.58531135", "0.58516926", "0.58447284", "0.5840822", "0.58369756", "0.58272886", "0.58148897", "0.5811517", "0.57914567", "0.578632", "0.5748472", "0.5741478", "0.5730894", "0.5730894", "0.5730894", "0.5730894", "0.5730894", "0.5730894", "0.5730894", "0.5730894", "0.57183534", "0.5718271", "0.5718271", "0.5714841", "0.5708859", "0.5690277", "0.56898737", "0.5678673", "0.5666717", "0.5664368", "0.5652396", "0.5648232", "0.5634438", "0.56265724", "0.56136376", "0.5606748", "0.5606169", "0.56032944", "0.5585789", "0.5581433", "0.5581433", "0.5581433", "0.5581433", "0.5566782", "0.55625004", "0.55558985", "0.5548714", "0.5537711", "0.5525313", "0.5503183", "0.55000675", "0.5495957", "0.54866993" ]
0.7362887
2
Retrieves the color flag
public function color(): bool { return $this->color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColor() { return $this->readColor(); }", "function getColor() {return $this->readColor();}", "public function get_color() {\n $query = $this->db->get('color');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }", "public function get_color()\n\t{\n\t\treturn $this->color;\n\t}", "public function getColor ()\r\n {\r\n return $this->color;\r\n }", "function getColor() {\n\t\treturn $this->color;\n\t}", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor()\n {\n return $this->color;\n }", "function getColor() { return $this->_color; }", "public function getColor() {\n\t\treturn $this->color;\n\t}", "function getColor() { return $this->_color; }", "function getColor() { return $this->_color; }", "public function getColor()\n {\n // Busca en esta clase la propiedad X\n return $this->color;\n }", "public function getColor()\n\t{\n\t\treturn $this->color;\n\t}", "public function getColorInfo()\n {\n return $this->color_info;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor()\n {\n return $this->color;\n }", "public function getColor() {\n //Busca en esta clase la propiedad x\n return $this->color;\n }", "public function getColor() {\n\t\t\treturn $this->_color;\n\t\t}", "public function getColor()\n {\n return $this->color;\n }", "public function getColor() {}", "public function getColor() {}", "function getColor(){\n\t\t# Like this: Array ( [red] => 255 [green] => 255 [blue] => 255 )\n\t\t# You could then use it with the setRGB function (See class.rgbcontrol.php for that.)\n\t\t# Simple usage is $led->setRBG($dbh->getColor());\n\n\t\t$pdo = $this->db->prepare(\"SELECT red,green,blue FROM colors ORDER BY cID DESC LIMIT 1\");\n\t\t$pdo->execute();\n\n\t\treturn $pdo->fetch();\n\t}", "protected function _getColour() {\n return $this->_getFromConfig(\"button_colour\");\n }", "public function getColor()\n {\n return $this->color ?? $this->defaultColor;\n }", "public function getColor()\n {\n if (array_key_exists(\"color\", $this->_propDict)) {\n return $this->_propDict[\"color\"];\n } else {\n return null;\n }\n }", "function getColor(){\n\t\treturn $this->color_ficha;\n\t}", "public function getColor()\n {\n $La_Color = null;\n\n switch($this->i_Colormode)\n {\n case self::SVNHUE_COLORMODE_HUE:\n $La_Color['hue'] = $this->a_State['hue'];\n $La_Color['sat'] = $this->a_State['sat'];\n break;\n\n case self::SVNHUE_COLORMODE_CT:\n $La_Color['ct'] = $this->a_State['ct'];\n break;\n\n case self::SVNHUE_COLORMODE_XY:\n $La_Color['xy'] = $this->a_State['xy'];\n break;\n } /* switch */\n\n return($La_Color);\n\n }", "function color_detect(){\n\t\t\n\t\t$hex = str_replace('#', '', $this->base_color); \n\n\t\t$r = hexdec(substr($hex,0,2));\n\t\t$g = hexdec(substr($hex,2,2));\n\t\t$b = hexdec(substr($hex,4,2));\n\t\t\n\t\tif($r + $g + $b > 750){\n\t\t\t\n\t\t\t// Light\n\t\t return 1;\n\t\t\n\t\t}elseif($r + $g + $b < 120){\n\n\t\t\t// Really Dark\n\t\t\treturn -2;\n\n\t\t}\n\t\telseif($r + $g + $b < 300){\n\t\t\n\t\t\t// Dark\n\t\t\treturn -1;\n\t\t\n\t\t}else{\n\t\t\t\n\t\t\t// Meh\n\t\t return false;\n\t\t\n\t\t}\n\t}", "public function getColor() {\n\t}", "public function getColor()\n {\n $colorAttribute = $this->helper->getColorConfig();\n\n return $this->getAttribute($colorAttribute);\n }", "public function color()\n\t{\n\t\treturn $this->fill_color;\n\t}", "public function getColor()\n {\n return self::QUALITY_MAP[$this->qualityID]['color'];\n }", "public function getColor(): string;", "public function getRed(): int\n {\n return $this->red;\n }", "public static function color()\n {\n return null;\n }", "public static function color()\n {\n return null;\n }", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "public function getInteriorColor() {}", "public function getColor()\n {\n }", "public function isShowColor()\n {\n return $this->showColor;\n }", "public function getColor() {\n\n\t\t//return $query->rows;\n\t}", "public function colour();", "public function getGreen(): int\n {\n return $this->green;\n }", "function GetContentColor()\n\t{\n\t\tif(isset($_GET[\"c\"]) && !empty($_GET[\"c\"]))\n\t\t{\n\t\t\tswitch($_GET[\"c\"])\n\t\t\t{\n\t\t\t case 1:\n\t\t\t\treturn \"black\";\n\t\t\tcase 2:\n\t\t\t\treturn \"red\";\n\t\t\tcase 3:\n\t\t\t\treturn \"green\";\n\t\t\tcase 4:\n\t\t\t\treturn \"yellow\";\n\t\t\tcase 5:\n\t\t\t\treturn \"blue\";\n\t\t\tcase 6:\n\t\t\t\treturn \"notimplemented\";\n\t\t\tdefault:\n\t\t\t\treturn \"white\";\n\t\t\t}\n\t\t}\n\n\t\treturn \"white\";\n\t}", "public function getBackgroundColor() {}", "public function getBackgroundColor() {}", "public function getBackgroundColor() {}", "public function getColor(): Color\n {\n return $this->color;\n }", "function habitat_wp_getcolor() {\n if (!defined('HABITAT_ENVIRONMENT')) {\n return NULL;\n }\n switch (HABITAT_ENVIRONMENT) {\n case 'Dev':\n // Red.\n return '#E22222';\n\n case 'Test':\n // Orange.\n return '#E29522';\n }\n return NULL;\n\n}", "public function getColor()\n{\nreturn $this->color;\n}", "public function getColor()\n {\n return\"Yellow\";\n }", "public function getRed()\n {\n return (0.5 + $this->red) | 0;\n }", "public function getColor():Color\n {\n return $this->color;\n }", "public function getColorName()\n {\n return $this->color_name;\n }", "public function getColor($userId){\n\t\t$userColor = CalendarUserColor::model()->findByPk(array('calendar_id'=>$this->id,'user_id'=>$userId));\n\n\t\tif($userColor)\n\t\t\treturn $userColor->color;\n\t\telse\n\t\t\treturn false;\n\t}", "function get_background_color()\n {\n }", "function get_tag_color( $tag ) {\n $tag_color = get_tag_data( $tag , 'tag_color' );\n return $tag_color;\n}", "public function getSafeColor() {\n if ($this->type === ColorLib::THTML) {\n return [self::transformHtmlToHexColor($this->color[0])];\n }\n return $this->color;\n }", "public function get_rgbColor(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::RGBCOLOR_INVALID;\n }\n }\n $res = $this->_rgbColor;\n return $res;\n }", "public function getColorList()\n {\n return $this->colorList;\n }", "public function color()\n {\n $color = $this->customer->color;\n\n $r = substr($color, 1, 2);\n $g = substr($color, 3, 2);\n $b = substr($color, 5, 2);\n $luma = (float)0.2126 * hexdec($r)\n + 0.7152 * hexdec($g)\n + 0.0722 * hexdec($b);\n\n return ['color' => $this->customer->color, 'luma' => $luma];\n }", "public function getColor2()\n {\n $sql = \"SELECT color_hex\n FROM site_color where site_color_id = 2\";\n\n $statement = $this->_dbh->prepare($sql);\n\n// $statement->bindParam(':color2', $color2);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function get_color( $ufc = null){\n\t\t$ufc = empty( $ufc ) ? self::$_ufc : $ufc;\n\n\t\t$index = (int) str_replace(self::VAR_PREFIX, \"\", $ufc);\n\n\t\t$theme_colors = self::$_theme_colors->colors;\n\n\t\tforeach($theme_colors as $key => $theme_color){\n\t\t\tif( $key === $index ) return $theme_color->color;\n\t\t}\n\n\t\treturn false;\n\t}", "private static function _get_image_color($im, $r, $g, $b) {\n\t\t$c=imagecolorexact($im, $r, $g, $b);\n\t\tif ($c!=-1) return $c;\n\t\t$c=imagecolorallocate($im, $r, $g, $b);\n\t\tif ($c!=-1) return $c;\n\t\treturn imagecolorclosest($im, $r, $g, $b);\n\t}", "public function getYellow()\n {\n return $this->yellow;\n }", "public function getColor3()\n {\n $sql = \"SELECT color_hex\n FROM site_color where site_color_id = 3\";\n\n $statement = $this->_dbh->prepare($sql);\n\n// $statement->bindParam(':color3', $color3);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getColor1()\n {\n $sql = \"SELECT color_hex\n FROM site_color where site_color_id = 1\";\n\n $statement = $this->_dbh->prepare($sql);\n\n //$statement->bindParam(':color1', $color1);\n $statement->execute();\n //echo $statement;\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getColor(): string\n {\n }", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getAllowFlexibleColor()\n {\n return isset($this->allow_flexible_color) ? $this->allow_flexible_color : false;\n }", "public function getGreen()\n {\n return (0.5 + $this->green) | 0;\n }", "public function get_bg_colour() {\n\t\treturn $this->bg_colour;\n\t}", "private function getPlotColor() {\n\t\treturn $this->plotColor;\n\t}", "public function countGlobalColors()\n {\n $byte = substr($this->logicalScreenDescriptor, 4, 1);\n\n if (strlen($byte) == 1) {\n $byte = unpack('C', $byte)[1];\n $bit = $byte & bindec('00000111');\n }\n \n // length of the global color table is 2^(N+1) \n return isset($bit) ? pow(2, $bit + 1) : 0;\n }", "public static function _get_image_color($im, $r, $g, $b) {\n\t\t$c=imagecolorexact($im, $r, $g, $b);\n\t\tif ($c!=-1) return $c;\n\t\t$c=imagecolorallocate($im, $r, $g, $b);\n\t\tif ($c!=-1) return $c;\n\t\treturn imagecolorclosest($im, $r, $g, $b);\n\t}", "private function getColor() {\n $randomNumber = rand(0, 7);\n $colors = array(0 => 'green',\n 1 => 'orange',\n 2 => 'blue', \n 3 => 'orange',\n 4 => 'yellow',\n 5 => 'purple',\n 6 => 'red',\n 7 => 'cyan');\n //$this->changeColor($colors[$randomNumber]);\n return $colors[$randomNumber]; \n \n }", "public function canStoreColor();", "public function color()\n {\n }", "function verify_color($verified) {\n\t\tif($verified == 0){\n\t\t\treturn \"grey\";\n\t\t}\n\t\telse {\n\t\t\treturn \"green\";\n\t\t}\n\t}", "public function getFillColor(): string\n {\n return $this->fillColor;\n }", "public function getMainColor()\n {\n return $this->mainColor;\n }", "public function getColorDepth()\n {\n return $this->colorDepth;\n }", "public function hasGlobalColorTable()\n {\n $byte = substr($this->logicalScreenDescriptor, 4, 1);\n \n if (strlen($byte) == 1) {\n $byte = unpack('C', $byte)[1];\n $bit = $byte & bindec('10000000');\n }\n\n return isset($bit) ? (bool) $bit : false;\n }", "public function getBadgeColor()\n {\n }", "public function getBlue(): int\n {\n return $this->blue;\n }", "public function getIconColor(): ?string;", "public function getColor(): ?string {\n $val = $this->getBackingStore()->get('color');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'color'\");\n }", "public function getMainColor()\n {\n return isset($this->main_color) ? $this->main_color : '';\n }" ]
[ "0.76484174", "0.76009244", "0.7589043", "0.7517475", "0.7272102", "0.7257419", "0.72454476", "0.72454476", "0.72454476", "0.72454476", "0.72174454", "0.7209188", "0.7192727", "0.7188588", "0.7188588", "0.7186112", "0.71858144", "0.7184031", "0.7174766", "0.7174766", "0.7174766", "0.71516186", "0.713806", "0.7135485", "0.7084774", "0.7084774", "0.70750576", "0.7041607", "0.699167", "0.69706964", "0.6875991", "0.6857126", "0.6834355", "0.6796154", "0.6786106", "0.67437375", "0.6720907", "0.6698972", "0.6618793", "0.6593028", "0.6593028", "0.6578975", "0.6578345", "0.6578345", "0.6560843", "0.65537095", "0.6519615", "0.6487256", "0.64488673", "0.64278597", "0.64261955", "0.64261955", "0.64247483", "0.6413902", "0.64112926", "0.640243", "0.63674426", "0.6341132", "0.632869", "0.62468123", "0.6235336", "0.6218767", "0.6201666", "0.6198705", "0.6192706", "0.61802644", "0.61747104", "0.6157739", "0.61431575", "0.6122776", "0.61161053", "0.61142075", "0.60875475", "0.6084712", "0.6076332", "0.60763115", "0.60763115", "0.60763115", "0.60763115", "0.60763115", "0.60763115", "0.6075352", "0.6071671", "0.606115", "0.604925", "0.60427296", "0.6013629", "0.59964406", "0.5986453", "0.59525645", "0.5938554", "0.59340936", "0.59243214", "0.5923449", "0.5921216", "0.5914928", "0.588565", "0.5880916", "0.5879969", "0.58602345" ]
0.72314334
10
FORMULARIO SELECCIONAR MARCA A ELIMINAR
function formularioSeleccionarProveedor() { require_once "conexionsql.php"; require_once "formularios.php"; $conProveedor= "SELECT ID_PROVEEDOR,PROVEEDOR,CONTACTOS from proveedor WHERE STATUS_ACTIVO = '1' ORDER BY PROVEEDOR ASC"; //Campo Proveedor $proveedor= new campoSeleccion("selProveedor","formularioCampoSeleccion","$_POST[selProveedor]","onChange","",$conProveedor,"--PROVEEDOR--",""); $selProveedor=$proveedor->retornar(); echo "<form name=\"frmEquipo\" method=\"post\" action=\"\">"; echo "<input name=\"funcion\" type=\"hidden\" value=\"1\">"; echo "<table class=\"formularioTabla\"align=center width=\"100\" border=\"0\">"; echo "<tr>"; echo "<td class=\"formularioTablaTitulo\" colspan=\"2\">ELIMINAR PROVEEDOR</td> </tr>"; echo "<tr>"; echo "<tr align=center></tr> </tr> <tr align=center><td valign=top class=\"formularioCampoTitulo\" ><p align=center >PROVEEDOR<br>$selProveedor<br></tr>"; echo "<tr>"; echo "<td class=\"formularioTablaBotones\" colspan=\"2\"><input name=\"btnLimpiar\" type=\"submit\" value=\"ELIMINAR\"> </td> </tr>"; echo "</table>"; echo "</form>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data_form(){\n\n $IdTrabajo= $_REQUEST['IdTrabajo']; //Variable para el id del trabajo\n $NombreTrabajo = $_REQUEST['NombreTrabajo']; //Variable para el nombre del trabajo\n $FechaIniTrabajo = $_REQUEST['FechaIniTrabajo']; //Variable para la fecha de inicio del trabajo\n $FechaFinTrabajo = $_REQUEST['FechaFinTrabajo']; //Variable para la fecha de finalizacion del trabajo\n $PorcentajeNota = $_REQUEST['PorcentajeNota']; //Variable para el porcentaje de la nota\n $action = $_REQUEST['action']; //Variable action para la accion a realizar\n\n //crea un trabajo\n $TRABAJO = new TRABAJO_Model(\n $IdTrabajo,\n $NombreTrabajo,\n $FechaIniTrabajo,\n $FechaFinTrabajo,\n $PorcentajeNota);\n\n return $TRABAJO;\n }", "public function formuAction(){\t\n \t$cn = new Model_DbDatos_Datos();\n\t\t$fn = new Libreria_Pintar();\n\t\t$ar = new Libreria_ArraysFunctions();\n\n \t$codCarta = $this->_request->getParam('codCarta',''); \n\t\t\n\t\t\n\t\t//Cargando combos fiscalizadores\n\n\t\tunset($parametros);\n \t$parametros[] = array('@mquery',22);\n \t$parametros[] = array('@idCarta',$codCarta);\n\t\t$rowFicalizadores = $cn->ejec_store_procedura_sql('[SP_FISCA_CARTA_REQ]',$parametros);\n\n\t\t$fiscalizadoresCombo = $ar->RegistrosComboc($rowFicalizadores,0,1,'');\n\t\t$val[] = array('#cbNotificadores',$fn->ContenidoCombo($fiscalizadoresCombo,'[Seleccione]',''),'html');\n\t\t \t\n\n\t\t//Cargando cabecera del cargo de notificacion\t\t\n\t\tunset($parametros);\n\t\t$parametros[] = array('@mquery',20);\n \t$parametros[] = array('@idCarta',$codCarta);\n \t$rowCabecera = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\n \tif ($rowCabecera[0]) {\n \t\t$row = $rowCabecera[1][0]; \n\n \t\t$codCargoNotificacion = $row[0];\n \t\t$nroCargoNotificacion = $row[1].\" - \".$row[9];\n \t\t$codContrib = $row[2];\n \t\t$contribuyente = trim(utf8_encode( strtoupper($row[3].\" \".$row[4].\" \".$row[5])));\n \t\t$idTipoDocIdent = $row[6];\n \t\t$nroDocIdent = $row[7];\n \t\t$domicilioFiscal = strtoupper(utf8_encode( $row[8]));\n \t\t$anio = $row[9];\n \t\t$nroCartareq = $row[10].\" - \".$row[9];\n \t\n \t\t$val[] = array('#hcodCartaReq',$codCarta,'val');\n \t\t$val[] = array('#txtNroNotificacion',$nroCargoNotificacion,'val');\n \t\t$val[] = array('#hcodNotificacion',$codCargoNotificacion,'val');\n \t\t$val[] = array('#txtCodigoContribuyenteN',$codContrib,'val');\n \t\t$val[] = array('#txtContribuyenteN',$contribuyente,'val');\n \t\t$val[] = array('#hTipoDocIdent',$idTipoDocIdent,'val');\n \t\t$val[] = array('#hNroDocIdent',$nroDocIdent,'val');\n \t\t$val[] = array('#txtDomicilioFiscal',$domicilioFiscal,'val');\n \t\t$val[] = array('#txtAnioN',$anio,'val');\n \t\t$val[] = array('#txtNroCartaReqN',$nroCartareq,'val');\n\n \t\t//CARGANDO DATOS DE LA PERSONA QUIEN RECEPCIONA\n \t\tunset($parametros);\n\t\t\t$parametros[] = array('@mquery',21);\n\t \t$parametros[] = array('@idCargoNotFisca',$codCargoNotificacion);\n\t \t$rowDatosPersona = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\t\t\t\n\n\t \tif ($rowDatosPersona[0]) {\n\t \t\t\n\t \t\t$row = $rowDatosPersona[1][0];\n\n\t\t\t unset($parametros);\n\t\t\t\t$parametros[] = array('@mquery',7);\n\t\t \t$rowTDoc = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_T_DOC_IDEN]',$parametros);\n\t\t \t$row2 = $rowTDoc[1];\n\t\t \t\n\t\t \tforeach ($row2 as $f) {\n\t\t \t\tif ($f[0]==1) {\t$val[]= array('#hmaxDni',$f[2],'val');}\n\t\t \t\tif ($f[0]==5) {\t$val[]= array('#hmaxIdentidad',$f[2],'val');}\n\t\t \t\tif ($f[0]==9) {\t$val[]= array('#hmaxExtranjeria',$f[2],'val');}\n\t\t \t}\n\n\t \t\t$nomRecepciona = trim(utf8_encode($row[0]));\n\t \t\t$idTipoDocIdent = trim($row[1]);\n\t \t\t$nomTDocIden = trim(utf8_encode($row[2]));\n\t \t\t$nroDocIdent = trim($row[3]);\n\t \t\t$fechaNotifica = (!empty($row[4]) && !empty($row[5]) && !empty($row[6]))? $row[4].\"/\".$row[5].\"/\".$row[6] : '';\n\t \t\t$horaNotifica = trim($row[7]);\n\t \t\t$NegoIdentificar = trim($row[8]);\n\t \t\t$NegoFirmar = $row[9];\n\t \t\t$NegoRecibir = $row[10];\n\t \t\t$firma = $row[11];\n\t \t\t$idVinculo = $row[12];\n\t \t\t$vinculo = $row[13];\n\t \t\t$vinculo_otros = trim($row[14]);\n\n\t \t\t$val[] = array('#txtNomApeRecepciona',$nomRecepciona,'val');\n\t \t\tif($idTipoDocIdent==1){$evt[] = array('#chkDni','checked','true');}\n\t \t\tif($idTipoDocIdent==5){$evt[] = array('#chkIdentidad','checked','true');}\n\t \t\tif($idTipoDocIdent==9){$evt[] = array('#chkExtranjeria','checked','true');}\n\t \t\t$val[] = array('#txtNroDocIdent',$nroDocIdent,'val');\n\t \t\t$val[] = array('#dpFechaNotifica',$fechaNotifica,'val');\n\t \t\t$val[] = array('#txtHoraNotifica',$horaNotifica,'val');\n\t \t\tif($NegoIdentificar==1){$evt[] = array('#chkNegoIdentificar','checked','true');}\n\t \t\tif($NegoFirmar==1){$evt[] = array('#chkNegoFirmar','checked','true');}\n\t \t\tif($NegoRecibir==1){$evt[] = array('#chkNegoRecibir','checked','true');}\n\t \t\t$evt[] = array(( ($firma==1) ? \"#rdFirmaRecepcionaSi\" : \"#rdFirmaRecepcionaNo\"),\"checked\",\"true\");\n\t \t\tif($idVinculo==1){$evt[] = array('#chkTitular','checked','true');}\n\t \t\tif($idVinculo==2){$evt[] = array('#chkFamiliar','checked','true');}\n\t \t\tif($idVinculo==3){$evt[] = array('#chkVigilante','checked','true');}\n\t \t\tif($idVinculo==4){$evt[] = array('#chkEmpleado','checked','true');}\n\t \t\tif($idVinculo==5){$evt[] = array('#chkRepresentante','checked','true');}\n\t \t\tif($idVinculo==6){$evt[] = array('#chkVinculoOtros','checked','true');$val[] = array('#txtVinculoOtros',$vinculo_otros,'val');}\n\n\n\t \t\t//CARGANDO DATOS DEL CEDULON Y MOTIVOS DE NO ENTREGA\n\n\t \t\tunset($parametros);\n\t\t\t\t$parametros[] = array('@mquery',22);\n\t\t \t$parametros[] = array('@idCargoNotFisca',$codCargoNotificacion);\n\t\t \t$rowCedulonMovNoEntrega = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\t\t \t\n\t\t \tif ($rowCedulonMovNoEntrega[0]) {\n\t\t \t\t$row = $rowCedulonMovNoEntrega[1][0]; \n\n\t\t \t\t$codCedulon = trim($row[0]);\n\t\t \t\t$PersonaIncapaz = trim($row[1]);\n\t\t \t\t$DomicilioCerrado = trim($row[2]);\n\t\t \t\t$fechaCedulon = (!empty($row[3]) && !empty($row[4]) && !empty($row[5])) ? $row[3].\"/\".$row[4].\"/\".$row[5] : '' ;\n\t\t \t\t$horaCedulon = trim($row[6]);\n\t\t \t\t$direcccionIncorrecta = trim($row[7]);\n\t\t \t\t$direccionInexistente = trim($row[8]);\n\t\t \t\t$otrosMotNoEntrega = $row[9];\n\t\t \t\t$otrosValor = trim($row[10]);\n\t\t \t\t$codInmueble = trim($row[11]);\n\t\t \t\t$nroPisos = trim($row[12]);\n\t\t \t\t$color = trim($row[13]);\n\t\t \t\t$casa = trim($row[14]);\n\t\t \t\t$edificio = trim($row[15]);\n\t\t \t\t$PuertaMadera = trim($row[16]);\n\t\t \t\t$PuertaFierro = trim($row[17]);\n\t\t \t\t$SuminElect = trim($row[18]);\n\t\t \t\t$in_Otros = trim($row[19]);\n\t\t \t\t$in_OtrosValor = trim($row[20]);\n\n\t\t \t\t$val[] = array('#hcodCedulon',$codCedulon,'val');\n\t\t \t\tif($PersonaIncapaz==1){ $evt[] = array('#chkPersonaIncapaz','checked','true');}\n\t\t \t\tif($DomicilioCerrado==1){ $evt[] = array('#chkDomicilioCerrado','checked','true');}\n\t\t \t\t$val[] = array('#dpFechaCedulon',$fechaCedulon,'val');\n\t\t \t\t$val[] = array('#txtHoraCedulon',$horaCedulon,'val');\n\t\t \t\tif($direcccionIncorrecta==1){ $evt[] = array('#chkDireccionIncorrecta','checked','true');}\n\t\t \t\tif($direccionInexistente==1){ $evt[] = array('#chkDireccionInexistente','checked','true');}\n\t\t \t\tif($otrosMotNoEntrega==1){$evt[]=array('#chkMotNoEntregaOtros','checked','true');$val[] = array('#txtNoEntregaOtros',$otrosValor,'val');}\n\t\t \t\t\n\t\t \t\t$val[] = array('#hcodInmueble',$codInmueble,'val');\n\t\t \t\t$val[] = array('#txtNroPisos',$nroPisos,'val');\n\t\t \t\t$val[] = array('#txtColor',$color,'val');\n\t\t \t\tif($casa==1){ $evt[] = array('#chkCasa','checked','true');}\n\t\t \t\tif($edificio==1){ $evt[] = array('#chkEdificio','checked','true');}\n\t\t \t\tif($PuertaMadera==1){ $evt[] = array('#chkMadera','checked','true');}\n\t\t \t\tif($PuertaFierro==1){ $evt[] = array('#chkFierro','checked','true');}\n\t\t \t\t$val[] = array('#txtSuministroElectrico',$SuminElect,'val');\n\t\t \t\tif($in_Otros==1){$evt[]=array('#chkInmuebleOtros','checked','true');$val[] = array('#txtInmuebleOtros',$in_OtrosValor,'val');}\n\t\t \t\t\n\n\n\t\t \t\t//CARGA DE DATOS DE VISITA EFECTUADA\n\t\t \t\tunset($parametros);\n\t\t\t\t\t$parametros[] = array('@mquery',23);\n\t\t\t \t$parametros[] = array('@idCargoNotFisca',$codCargoNotificacion);\n\t\t\t \t$rowVisitaEfectuada = $cn->ejec_store_procedura_sql_noparamatro2('[SP_FISCA_CARGO_NOTIFICA]',$parametros);\n\t\t\t \t\n\t\t\t \tif ($rowVisitaEfectuada[0]) {\n\t\t\t \t\t$row = $rowVisitaEfectuada[1][0]; \n\n\t\t\t \t\t$fechaVisita = (!empty($row[0]) && !empty($row[1]) && !empty($row[2])) ? $row[0].\"/\".$row[1].\"/\".$row[2] : '' ;\n\t\t\t \t\t$codNotificador = trim($row[3]);\n\t\t\t \t\t$dniNotificador = trim($row[4]);\n\t\t\t \t\t$firmaNotificador = trim($row[5]);\n\n\t\t\t \t\t$val[] = array('#dpFechaVisita',$fechaVisita,'val');\n\t\t\t \t\t$val[] = array('#cbNotificadores',$codNotificador.'-'.$dniNotificador,'val');\n\t\t\t \t\t$val[] = array('#txtdniNotificador',$dniNotificador,'val');\n\t\t\t \t\t$evt[] = array((($firmaNotificador==1) ? \"#rdFirmaNotSi\" : \"#rdFirmaNotNo\"),\"checked\",\"true\");\n\n\n\t\t\t \t}else{\n\t\t\t \t\techo utf8_encode($rowVisitaEfectuada[1]); \n\t\t\t \t}\n\n\t\t \t}else{\n\t\t\t\t\techo utf8_encode($rowCedulonMovNoEntrega[1]); \n\t\t \t} \n\n\t \t}else{\n\t \t\techo utf8_encode($rowDatosPersona[1]); \n\t \t}\n\n \t}else{\n \t\techo utf8_encode($rowCabecera[1]);\n \t}\n\n\t\t$evt[] = array('#contentBox6',\"tabs\",\"\");\t\n\t\t$evt[] = array('#contentBox7',\"tabs\",\"\");\t\n\t\t$evt[] = array('#contentBox8',\"tabs\",\"\");\t\t\t\t\n\t\t$evt[] = array('#tabsNotificacion',\"tabs\",\"\");\n\t\t$evt[] = array('#radioFirmaRecep',\"buttonset\",\"\");\n\t\t$evt[] = array('#radioFirmaNot',\"buttonset\",\"\");\n\t\t\n\t\t\n\n\t\t$fn->PintarEvento($evt);\n\t\t$fn->PintarValor($val);\n }", "public function formulario()\n {\n //\n }", "function form() \r\n {\r\n \t //El formateo va a ser realizado sobre una tabla en la que cada fila es un campo del formulario\r\n $table = &html_table($this->_width,0,2,2);\r\n $table->add_row($this->_showElement(\"Asunto\", '6', \"asunto_de_usuario\", 'Asunto', \"Asunto\", \"left\" )); \r\n $table->add_row($this->_showElement(\"Comentario\", '7', \"comentario\", 'Texto', \"Comentario\", \"left\" )); \r\n \r\n $this->set_form_tabindex(\"Aceptar\", '10'); \r\n $label = html_label( \"submit\" );\r\n $label->add($this->element_form(\"Aceptar\"));\r\n $table->add_row(html_td(\"\", \"left\", $label));\r\n \r\n return $table; \r\n }", "public function get_form($metodo,$usuario,$form,$data=0,$ciclo=1,$codSubM=null,$cMet=\"\"){\n #traemos el formulario\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaFormulario($form,$usuario,$data,$ciclo,$codSubM,$this->_modulo,'\".$cMet.\"') as formulario; \";\n $this->get_results_from_query();\n if(count($this->rows) >= 1){\n foreach ($this->rows as $pro=>$va) {\t\t\t\t\n $this->_formulario[] = $va;\n if($this->_formulario[0]['formulario'] == ''){\t\t\t\t\n $mensjFrm = getMenssage('danger','Ocurrio un error','No tiene permisos para acceder a esta opcion. ');\n $this->_formulario[0] = array('formulario'=>$mensjFrm);\n }\n }\n }\t\n #traemos el formulario modal\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaFormularioModal($form,$usuario) as modal; \";\n $this->get_results_from_query();\n if(count($this->rows) >= 1){\n foreach ($this->rows as $pro=>$va) { \n $this->_formulario_modal[] = $va;\n if($this->_formulario_modal[0]['modal'] == ''){ \n $mensjFrm = '';\n $this->_formulario_modal[0] = array('modal'=>$mensjFrm);\n }\n }\n } \n #traemos la ayuda del form\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaAyudaFormulario($form,$usuario,1) as formulario_ayuda\";\n $this->get_results_from_query();\n if (count($this->rows) >= 1) {\n foreach ($this->rows as $pro => $va) {\n $this->_formulario_ayuda[] = $va;\n if ($this->_formulario_ayuda[0]['formulario_ayuda'] == '') {\n $mensjFrm = getMenssage('info', 'Ocurrio un error', 'No hay ayuda registrada para este proceso,consulte al administrador del sistema. ');\n $this->_formulario_ayuda[0] = array('formulario_ayuda' => $mensjFrm);\n }\n }\n }\n #Traemos los botones por formulario y usuario\n ModeloFacturacion::get_boton($metodo,$usuario,$form,$cMet);\n }", "function form_mostrar($conp,$nreg,$pg,$bo,$filtro,$arc){\n\t\t$mtipo_documento = new mtipo_documento();\n\t\t //Instanciamos en [$pa] la clase mpagina\n\t\t$pa = new mpaginacion();\n\t\t$txt = '';\n\t\t//Creamos el cuadro de buscar (filtros-Busquedas)\n\t\t$txt .= \"<table>\";\n\t\t\t//Una Fila\n\t\t\t$txt .= \"<tr>\";\n\t\t\t\t//1ra Columna - Formulario buscar\n\t\t\t\t$txt .= \"<td>\";\n\t\t\t\t\t$txt .= \"<form name='forfil' method='GET' action='\".$arc.\"'>\";\n\t\t\t\t\t\t$txt .= \"<input type='hidden' name='pg' value='\".$pg.\"' />\";\n\t\t\t\t\t\t//Campo de texto para escribir el dato a buscar\n\t\t\t\t\t\t$txt .= \"Buscar:<input type='text' name='filtro' value='\".$filtro.\"' placeholder='Ingrese El Nombre Del Empleado' onChange= 'this.form.submit();' />\";\n\t\t\t\t\t$txt .= \"</form>\";\n\t\t\t\t$txt .= \"</td>\";\n\t\t\t\t//2da Columna control de paginacion\n\t\t\t\t$txt .= \"<td align='right' style='padding-left: 10px;'>\";\n\t\t\t\t\t$bo = \"<input type='hidden' name='filtro' value='\".$filtro.\"' />\";\n\t\t\t\t\t//Llamamos el metodo de contar la cantida de paginas\n\t\t\t\t\t$txt .= $pa->spag($conp,$nreg,$pg,$bo,$arc);\n\t\t\t\t\t//Llamar los datos para completar la paginacion\n\t\t\t\t\t$result = $mtipo_documento->sel_tipo_documento($filtro,$pa->rvalini(),$pa->rvalfin());\n\t\t\t\t$txt .= \"</td>\";\n\t\t\t//Cierre Fila\n\t\t\t$txt .= \"</tr>\";\n\t\t$txt .= \"</table>\";\n\t\tif ($result) {\n\n\t\t$txt .= '<div class=\"cuad1\" style=\"width: 90%;\">';\n\t\t\t$txt .= '<table width=\"100%\" cellspacing=\"0px\" align=\"center\">';\n\t\t\t\t//Inicio de la (Cabecera_Tb)\t\t\t\n\t\t\t\t$txt .= '<tr>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'id_tpdoc(s)';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'Tipo de Documento';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'extencion';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th></th>';\n\t\t\t\t\t$txt .= '<th></th>';\n\t\t\t\t$txt .= '</tr>';\n\t\t\t\t//Cierre de la (Cabecera_Tb)\n\t\t\t\tforeach ($result as $f) {\n\t\t\t\t//Inicio ROW - Datos de la tabla\n\t\t\t\t$txt .= '<tr>';\n\t\t\t\t\t$txt .= '<td align=\"center\">';\t\n\t\t\t\t\t\t$txt .= $f[\"id_tpdoc\"];\n\t\t\t\t\t$txt .= '</td>';\n\t\t\t\t\t$txt .= '<td align=\"center\">';\t\n\t\t\t\t\t\t$txt .= $f[\"nom_tpdoc\"];\n\t\t\t\t\t$txt .= '</td>';\n\t\t\t\t\t$txt .= '<td align=\"center\">';\t\n\t\t\t\t\t\t$txt .= $f[\"extencion\"];\n\t\t\t\t\t$txt .= '</td>';\n\t\t\t\t\t//ICONOS-MOdificar (Boton)\n\t\t\t\t\t$txt .= '<td align=\"center\"><a href=\"home.php?pg=010&id_tpdoc='.$f[\"id_tpdoc\"].'\">\n\t\t\t\t\t\t<img src=\"img/actua.png\" title=\"Actualizar\"</a></td>';\n\t\t\t\t\t//ICONOS-Eliminar (Boton)\n\t\t\t\t\t$txt .= '<td align=\"center\"><a href=\"home.php?pg=010&del='.$f[\"id_tpdoc\"].'\">\n\t\t\t\t\t\t<img src=\"img/elemi.png\" title=\"Eliminar\"</a></td>';\n\t\t\t\t//Cierre ROW - Datos de la tabla\n\t\t\t\t$txt .= '</tr>';\n\t\t\t\t}\n\t\t\t$txt .= '</table>';\n\t\t$txt .= '</div>';\n\t\t}else{\n\t\t$txt.= '<div class=\"cuad\" style=\" width\": 90%;\">';\n\t\t $txt.= '<h3> No existen datos registrado en la base de datos...</h3>';\n\t\t $txt.='</div>';\n }\n\t\techo $txt;\n\t}", "function recuperarDatos(){\r\n\t\t\t\t$this->objFunc=$this->create('MODEmpresa');\r\n\t\t\t\t$objetoFuncion = $this->create('MODEmpresa');\r\n\t\t\t\t$this->res=$this->objFunc->insertarEmpresa($this->objParam);\t//esta bien\t\t\t\r\n\t\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t\t}", "function ToonFormulierAfspraak()\n{\n\n}", "function form_mostrar($conp,$nreg,$pg,$bo,$filtro,$arc,$pefedi,$pefeli){\n\t\t$mempresa = new mempresa();\n\t\t$pa = new mpaginacion();\n\t\t$txt = '';\n\t\t//Creamos el cuadro de buscar (filtros-Busquedas)\n\t\t$txt .= \"<table>\";\n\t\t\t//Una Fila\n\t\t\t$txt .= \"<tr>\";\n\t\t\t\t//1ra Columna - Formulario buscar\n\t\t\t\t$txt .= '<td>';\n\t\t\t\t$txt .= '<form id=\"formfil\" name=\"frmfil\" method=\"GET\" action=\"'.$arc.'\" class=\"txtbold\">';\n\t\t\t\t$txt .= '<input name=\"pg\" type=\"hidden\" value=\"'.$pg.'\" />';\n\t\t\t$txt .= '<input class=\"search-box\" type=\"text\" name=\"filtro\" value=\"'.$filtro.'\" placeholder=\"Nombre De Empresa\"\n\t\t\t\t\tonChange=\"this.form.submit();\">';\n\t\t\t\t\t$txt .= '<label for=\"search-box\"><span class=\"glyphicon fas fa-search search-icon\"></span></label>';\n\t\t\t\t$txt .= '</form>';\n\t\t\t$txt .= '</td>';\n\t\t\t\t//2da Columna control de paginacion\n\t\t\t\t$txt .= \"<td align='right' style='padding-left: 10px;'>\";\n\t\t\t\t\t$bo = \"<input type='hidden' name='filtro' value='\".$filtro.\"' />\";\n\t\t\t\t\t//Llamamos el metodo de contar la cantida de paginas\n\t\t\t\t\t$txt .= $pa->spag($conp,$nreg,$pg,$bo,$arc);\n\t\t\t\t\t//Llamar los datos para completar la paginacion\n\t\t\t\t\t$result = $mempresa->sel_empresa($filtro,$pa->rvalini(),$pa->rvalfin());\n\t\t\t\t$txt .= \"</td>\";\n\t\t\t//Cierre Fila\n\t\t\t$txt .= \"</tr>\";\n\t\t$txt .= \"</table>\";\n\t\t\n\t\tif($result){\n\t\t$txt .= '<div class=\"cuad1\" style=\"width: 90%; \">';\n\t\t\t$txt .= '<table1 width=\"100%\" cellspacing=\"0px\" align=\"center\">';\n\t\t\t\t\t\t\t$txt .= \"<table class='table table-hover'>\";\n\t\t\t\t//Inicio de la (Cabecera_Tb)\t\t\n\t\t\t\t$txt .= '<tr>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'Foto';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'Empresa';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th></th>';\n\t\t\t\t$txt .= '</tr>';\n\t\t\t\t//Cierre de la (Cabecera_Tb)\n\t\t\t\tforeach ($result as $f) {\n\t\t\t\t//Inicio ROW - Datos de la tabla\n\t\t\t\t$txt .= '<tr>';\n\t\t\t\t\t$txt .= '<td align=\"center\">';\n\t\t\t\t\t$txt .= '<img src=\"'.$f['logemp'].'\" width=\"25px\" />';\n\t\t\t\t\t$txt .= '</td>';\n\t\t\t\t\t$txt .= \"<td class='active lefi'>\";\n\t\t\t\t\t$txt .= \"<span style='font-size: 20px;'><strong>\".$f['nitemp'].\" - \".$f['razsocialemp'].\"</strong></span>\";\n\t\t\t\t\t$txt .= \"<br><strong>Sede: </strong>\".$f['sedecentemp'];\n\t\t\t\t\t$txt .= \"<br><strong>Email: </strong>\".$f['emailemp'];\n\t\t\t\t\t$txt .= \"<br><strong>Telefono: </strong>\".$f['telemp'];\n\t\t\t\t\t$txt .= \"</td>\";\n\t\t\t\t\t\t//ICONOS-MOdificar (Boton)\n\t\t\t\t\t\t$txt .= \"<td class='warning' align='center'>\";\n\t\t\t\t\t\t$txt .= \"<a href='home.php?pg=002&idemp=\".$f['idemp'].\"'><ul class='social-icons icon-circle icon-zoom list-unstyled list-inline'><li><i class='fas fa-pen' title='Actualizar'></i></li></ul></a>\";\n\t\t\t\t\t\t//ICONOS-Eliminar (Boton)\n\t\t\t\t\t\t$txt .= \"<a href='home.php?pg=002&del=\".$f['idemp'].\"'><ul class='social-icons icon-circle icon-zoom list-unstyled list-inline'><li><i class='fas fa-times' title='Eliminar'></i></li></ul></td></a>\";\t\n\t\t\t\t\t\t$txt .= \"</td>\";\n\n\t\t\t\t//Cierre ROW - Datos de la tabla\n\t\t\t\t$txt .= '</tr>';\n\t\t\t\t}\n\t\t\t$txt .= '</table>';\n\t\t\t$txt .= '<BR>';\n\t\t\t\t\t$txt .= '<BR>';\n\t\t\t\t\t$txt .= '<BR>';\n\t\t$txt .= '</div>';\n\t\t}else{\n\t\t$txt .= '<div class=\"cuad\" style=\"width: 90%;\">';\n\t\t$txt .= '<h3>No existen datos registrado en la base de datos...</h3>';\n\t\t$txt .= '</div>';\t\t\n\t}\n\t\techo $txt;\n\t}", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "function alta_marca(){\n\t\t$u= new Marca_producto();\n\t\t$related = $u->from_array($_POST);\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t// save with the related objects\n\t\tif($u->save($related)) {\n\t\t\techo \"<html> <script>alert(\\\"Se han actualizado los datos de la Subfamilia de Productos.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}", "public static function formularioMarcas()\n {\n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Variables de los campos de la tabla marcas\n $marca = null;\n\n \n\n //Se empiezan a validar los datos del formulario de marcas\n if(isset($_POST[\"formulario\"]))\n {\n //Se valida que no se dejen espacios vacios\n if($_POST[\"marca\"] != \"\")\n {\n //Se valida que la marca cumpla con los criterios\n if(Validaciones::alfanumerico($_POST[\"marca\"]) && Validaciones::longitud($_POST[\"marca\"], 20))\n {\n //Se divide en si es ingresar un registro o modificar uno existente\n //Aqui es donde se modifica el registro\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida si el parametro es un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Se divide entre solo actualizar marca, imagen y ambas a la vez\n //Aqui se actualiza el nombre y la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n //Aqui solo se actualizara el nombre\n else\n {\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"]\n );\n\n $condiciones_parametros = array\n (\n 'id' => $_GET[\"id_marca\"]\n );\n\n Sentencias::Actualizar(\"marcas\", $campos_valores, $condiciones_parametros, 1, \"marcas.php\"); \n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n //Aqui es donde se agrega un nuevo registro\n else\n {\n //Se valida si ya se subio la imagen\n if(is_uploaded_file($_FILES[\"archivo\"][\"tmp_name\"]))\n {\n //Se validan los valores de la iamgen\n if(Validaciones::imagen($_FILES[\"archivo\"]))\n {\n $img = $_POST[\"marca\"].time().\".jpg\";\n $campos_valores = array\n (\n 'marca' => $_POST[\"marca\"],\n 'imagen' => $img\n );\n\n Sentencias::Insertar(\"marcas\", $campos_valores, 1, \"marcas.php\");\n move_uploaded_file($_FILES['archivo']['tmp_name'], \"../img/marcas/$img\");\n }\n\n else\n {\n Ventanas::Mensaje(2, \"La imagen no es valida\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"Debe ingresar una imagen\", null);\n }\n }\n } \n\n else\n {\n Ventanas::Mensaje(2, \"El nombre de la marca no es valido\", null);\n }\n }\n\n else\n {\n Ventanas::Mensaje(2, \"No deje campos vacios\", null);\n }\n }\n\n //Renderiza el formulario de marcas\n echo\n (\"\n <form method='post' enctype='multipart/form-data' id='registro'>\n <div class='row'>\n <div class='container'>\n <div class='col s12 center-align'>\n <h4>Aqui puedes ingresar una nueva marca</h4>\n </div>\n <div class='input-field col s10 offset-s1'>\n <input id='marca' value='$marca' name='marca' type='text' class='validate' autocomplete='off'>\n <label for='marca' class='blue-text text-darken-4'>Nombre de la marca</label>\n </div>\n <div class='file-field input-field col s10 offset-s1'>\n <div class='btn blue darken-4'>\n <span>Imagen</span>\n <input type='file' name='archivo'>\n </div>\n <div class='file-path-wrapper'>\n <input class='file-path validate' type='text' placeholder='Seleccione una imagen para el usuario'>\n </div>\n </div>\n \");\n\n //Se renderiza el boton dependiendo de si es para crear o modificar\n if(empty($_GET[\"id_marca\"]))\n {\n //Se valida si tiene permisos para ingresar\n if($dato_tipo[\"marcas\"] == 2 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] == 6 || $dato_tipo[\"marcas\"] == 9)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Ingresar marca</button>\n </div> \n \");\n } \n }\n\n else\n {\n //Se valida si tiene permisos para modificar\n if($dato_tipo[\"marcas\"] == 3 || $dato_tipo[\"marcas\"] == 5 || $dato_tipo[\"marcas\"] > 6)\n {\n echo\n (\"\n <div class='col s3 offset-s1'>\n <button name='formulario' class='waves-effect waves-light btn blue darken-4'>Actualizar marca</button>\n </div> \n \");\n } \n }\n\n echo\n (\" \n <div class='col s3'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar campos</a>\n </div> \n </div>\n </div> \n </form>\n \");\n }", "function recuperar_datos() {\n\t\tglobal $nombre, $tipo ;\n\t\t\n\t\t\t$pers_id =(isset($_POST['id_marcas']) && !empty($_POST['id_marcas']))? $_POST['id_marcas']:\"\";\n\t\t\t$tipo =(isset($_POST['tipo']) && !empty($_POST['tipo']))? $_POST['tipo']:\"A\"; \t\n\n\t\t\t$nombre=(isset($_POST[\"nombre\"]) && !empty($_POST[\"nombre\"]))? $_POST[\"nombre\"]:\"\";\t\t\t\n\t\n\t\t}", "function maquetador_buscador ( $controlador, $accion, $i='i') { \n if ( $value= limpiaRequest ($i) ){ \n $value = \"value='$value'\";\n }\n \n return \"<form>\" . t(\"Buscar\") .\": <input name='$i' type='text' $value>\" .\n \"<input type='hidden' name='c' value='$controlador'>\\n\". \n \"<input type='hidden' name='a' value='$accion'>\\n\".\n \"</form>\";\n}", "public static function form(){\n $fecha = mktime(date(\"Y\"), date(\"m\"), date(\"d\"));\n $tipoAct = 'Actividad'->'id_tipo_act';\n return ['nombre' => '', 'tipo_actividad' => '','fecha_desde' =>$fecha, 'fecha_hasta' =>$fecha,\n 'instancia' => '', 'puesto_mencion' =>'','inst_referente' => '',\n 'inst_oferente' => '', 'lugar' =>'','descripcion' =>''];\n\n }", "public function registroMateriaController(){\n //Almaceno en un array los valores de la vista de registro\n if(isset($_POST[\"materiaRegistro\"])){ \n //$id_carrera=$_REQUEST['idCarreraa'];\n $datosController = array(\"nombre\"=>$_POST[\"materiaRegistro\"],\n \"clave\"=>$_POST[\"claveRegistro\"],\n \"idcarrera\"=>$_POST[\"mi_select\"]);\n\n //Enviamos los parámetros al Modelo para que procese el registro\n $respuesta = Datos::registroMateriaModel($datosController, \"materias\");\n\n //Recibir la repuesta del modelo para saber que sucedió (success o error) \n if($respuesta == \"success\"){\n header(\"location:index.php?action=materias\");\n }else{\n //header(\"location:index.php\"); \n }\n }\n }", "function get_data_form(){\n\n\n\t$IdGrupo = '';\n\t$IdFuncionalidad = '';\n\t$IdAccion = '';\n\t$NombreGrupo = '';\n\t$NombreFuncionalidad = '';\n\t$NombreAccion = '';\n\t$action = '';\n\n\tif(isset($_REQUEST['IdGrupo'])){\n\t$IdGrupo = $_REQUEST['IdGrupo'];\n\t}\n\tif(isset($_REQUEST['IdFuncionalidad'])){\n\t$IdFuncionalidad = $_REQUEST['IdFuncionalidad'];\n\t}\n\tif(isset($_REQUEST['IdAccion'])){\n\t$IdAccion = $_REQUEST['IdAccion'];\n\t}\n\tif(isset($_REQUEST['action'])){\n\t$action = $_REQUEST['action'];\n\t}\n\tif(isset($_REQUEST['NombreGrupo'])){\n\t$NombreGrupo = $_REQUEST['NombreGrupo'];\n\t}\n\tif(isset($_REQUEST['NombreFuncionalidad'])){\n\t$NombreFuncionalidad = $_REQUEST['NombreFuncionalidad'];\n\t}\n\tif(isset($_REQUEST['NombreAccion'])){\n\t$NombreAccion = $_REQUEST['NombreAccion'];\n\t}\n\n\t$PERMISOS = new PERMISO_Model(\n\t\t$IdGrupo, \n\t\t$IdFuncionalidad, \n\t\t$IdAccion,\n\t\t$NombreGrupo,\n\t\t$NombreFuncionalidad,\n\t\t$NombreAccion);\n\n\treturn $PERMISOS;\n}", "private function criarBarraDeBuscaAction(){\n $cidades = $this->Localidades()->getCidades(\"RJ\");\n $busca = new form_busca();//1- primeiro eu instancio o formularioarray('selecione'=>'selecione','nome' => 'nome','cidade' => 'cidade')\n $busca->get('cidade')->setAttribute('options',$cidades);\n $busca->get('bairro')->setAttribute('options', array(0=>'Selecione uma Cidade'));\n //\n $categoriaDao = \\Base\\Model\\daoFactory::factory('SubCategoriaImovel');\n $dadosCategoria = $categoriaDao->recuperarTodos();\n $categorias = $this->SelectHelper()->getArrayData(\"selecione\",$dadosCategoria);\n $busca->get('tipo')->setAttribute('options', $categorias);\n //\n $transacaoDao = \\Base\\Model\\daoFactory::factory('TipoTransacao');\n $dadosTransacoes = $transacaoDao->recuperarTodos();\n $transacoes = $this->SelectHelper()->getArrayData(\"selecione\",$dadosTransacoes);\n $busca->get('transacao')->setAttribute('options', $transacoes);\n //\n $arrayPreco = array(array(\"value\"=>0, \"label\"=>\"selecione\", \"disabled\" => \"disabled\", \"selected\" => \"selected\"),array(\"value\" => 1, \"label\" => \"R$ 100.000 a R$ 200.000\"),array(\"value\" => 2, \"label\" => \"R$ 200.000 a R$ 300.000\"),array(\"value\" => 3, \"label\" => \"R$ 300.000 a R$ 400.000\"),array(\"value\" => 4, \"label\" => \"R$ 400.000 a R$ 500.000\"),array(\"value\" => 5, \"label\" => \"acima de R$ 500.000\"));\n $busca->get('valor')->setAttribute('options', $arrayPreco);\n return $busca;\n }", "function loadClienteForm(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_GET';//'\n\t\t$this->tipo_procedimiento='IME';//tipo de transaccion\n\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\n\t\t$this->captura('v_valor','varchar');\n\t\t$this->captura('genero','varchar');\n\t\t$this->captura('ci','varchar');\n\t\t$this->captura('email','varchar');\n\t\t$this->captura('email2','varchar');\n\t\t$this->captura('direccion','varchar');\n\t\t$this->captura('celular','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('lugar_expedicion','varchar');\n\t\t$this->captura('apellido_paterno','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('ciudad_residencia','varchar');\n\t\t$this->captura('id_pais_residencia','int4');\n\t\t$this->captura('nacionalidad','varchar');\n\t\t$this->captura('barrio_zona','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('apellido_materno','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\n\t\t$this->captura('nombre_completo1','text');\n\t\t$this->captura('nombre_completo2','text');\n\t\t$this->captura('pais_residencia','varchar');\n\t\t//Definicion de la lista del resultado del query\n\t\t/*$this->captura('v_id_cliente','int4');\n\t\t$this->captura('v_genero','varchar');\n\t\t$this->captura('v_ci','varchar');\n\t\t$this->captura('v_email','varchar');\n\t\t$this->captura('v_direccion','varchar');\n\t\t$this->captura('v_celular','varchar');\n\t\t$this->captura('v_nombre','varchar');\n\t\t$this->captura('v_lugar_expedicion','varchar');\n\t\t$this->captura('v_apellido_paterno','varchar');\n\t\t$this->captura('v_telefono','varchar');\n\t\t$this->captura('v_ciudad_residencia','varchar');\n\t\t$this->captura('v_id_pais_residencia','int4');\n\t\t$this->captura('v_nacionalidad','varchar');\n\t\t$this->captura('v_barrio_zona','varchar');\n\t\t//$this->captura('estado_reg','varchar');\n\t\t$this->captura('v_apellido_materno','varchar');\n\t\t//$this->captura('id_usuario_ai','int4');\n\t\t//$this->captura('fecha_reg','timestamp');\n\t\t//$this->captura('usuario_ai','varchar');\n\t\t//$this->captura('id_usuario_reg','int4');\n\t\t//$this->captura('fecha_mod','timestamp');\n\t\t//$this->captura('id_usuario_mod','int4');\n\t\t//$this->captura('usr_reg','varchar');\n\t\t//$this->captura('usr_mod','varchar');\n\n\t\t$this->captura('v_completo','text');\n\t\t$this->captura('v_nombre_completo2','text');\n\t\t$this->captura('v_pais_residencia','varchar');*/\n\t\t//$this->captura('nombre','varchar');\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 listiAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n \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('nombre'); // ------------------------------------- 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 Lcheqi($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $u->actRegistro($data,$id);\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n }\n }\n } \n // $form->get(\"id\")->setAttribute(\"value\",\"$id\"); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u = New AlbumTable($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C)\n $con=\"Select idNasp, nombre from t_cargos where id=\".$id;// Consula personalizada\n $resul=$u->getGeneral($con);\n foreach ($resul as $dat){\n $id2 = $dat['idNasp'];\n }\n // ---\n $valores=array\n (\n \"titulo\" => 'Ítems de aspectos del cargo '.$dat['nombre'],\n \"datos\" => $u->getAsp(\"where idNasp=$id2\"), \n \"ttablas\" => 'Aspectos, tipo, Opciones',\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form,\n \"idCar\" => $id,\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "public function getFormaPago();", "public function crear(){\n\t\t\t\t\t\t\t\t$calidad = new calidad($_POST['data']);\n\t\t\t\t\t\t $calidadMapper = new calidadMapper();\n\t\t\t\t\t\t var_dump($calidadMapper->crearcalidad($calidad));\n\t\t\t\t\t\t\t}", "function mostrarFormulario(){\n\n echo \"<br><br>\";\n echo \"<h2>FORMULARIO PARA ALUMNOS</h2>\"; \n?>\n\n <form method=\"post\" action=\"<?php echo htmlspecialchars($_SERVER[\"PHP_SELF\"]);?>\">\n Matricula: <input type=\"text\" name=\"matricula\" value=\"<?php echo $this->matricula;?>\">\n <br><br>\n Nombre: <input type=\"text\" name=\"nombree\" value=\"<?php echo $this->nombre;?>\">\n <br><br>\n Carrera: <input type=\"text\" name=\"carreraa\" value=\"<?php echo $this->carrera;?>\">\n <br><br>\n <span class=\"error\">* <?php echo $this->nameErr;?></span>\n <br><br>\n E-mail: <input type=\"text\" name=\"email\" value=\"<?php echo $this->email;?>\">\n <span class=\"error\">* <?php echo $this->emailErr;?></span>\n <br><br>\n Telefono: <input type=\"tel\" name=\"telefonoo\"value=\"<?php echo $this->telefono;?>\">\n <br><br>\n <input type=\"submit\" name=\"submitt\" value=\"Submit\">\n </form>\n\n<?php\n }", "function insertarFormula(){\r\n\t\t$this->procedimiento='vef.ft_formula_v2_ime';\r\n\t\t$this->transaccion='VF_FORMULAV2_INS';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('nombre','nombre','varchar');\r\n\t\t$this->setParametro('descripcion','descripcion','text');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function geraClasseValidadorFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.ValidadorFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoValidaFormularioCadastro.tpl');\n\n # abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $aModeloFinal = array();\n \n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode((string)$aTabela['NOME']));\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n $objetoClasse = \"\\$o$nomeClasse\";\n\n # ==== varre a estrutura dos campos da tabela em questao ====\n $camposForm = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n # processa nome original da tabela estrangeira\n $nomeFKClasse = (string)$oCampo->FKTABELA;\n $objetoFKClasse = \"\\$o$nomeFKClasse\";\n\n $nomeCampo = $nomeCampoOriginal;\n //$nomeCampo = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n $label = ($nomeFKClasse != '') ? ucfirst(strtolower($nomeFKClasse)) : ucfirst(str_replace($nomeClasse,\"\",$nomeCampoOriginal));;\t\t\t\t\t\n $camposForm[] = ((int)$oCampo->CHAVE == 1) ? \"if(\\$acao == 2){\\n\\t\\t\\tif(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t}\" : \"if(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\treturn false;\\n\\t\\t}\\t\";\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis já processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.ValidadorFormulario.php\",\"w\"); fputs($fp, $modeloFinal); fclose($fp);\n\n return true;\t\n }", "function SolicitarContrato(){\n $this->procedimiento = 'adq.f_cotizacion_ime';\n $this->transaccion = 'ADQ_SOLCON_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function alta_material(){\n\t\t$u= new Material_producto();\n\t\t$related = $u->from_array($_POST);\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t// save with the related objects\n\t\tif($u->save($related)) {\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos del Material del Productos.\\\"); window.location='\".base_url().\"index.php/almacen/productos_c/formulario/list_materiales';</script></html>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}", "private function IndexValidacionFormulario() {\n\t\t\t$Val = new NeuralJQueryFormularioValidacion(true, true, false);\n\t\t\t$Val->Requerido('AVISO', 'Debe Ingresar el Número del Aviso');\n\t\t\t$Val->Numero('AVISO', 'El Aviso debe Ser Numérico');\n\t\t\t$Val->CantMaxCaracteres('AVISO', 10, 'Debe ingresar aviso con 10 Números');\n\t\t\t$Val->Requerido('PRIORIDAD', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('RAZON', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('REGIONAL[]', 'Seleccione la Regional a Reportar');\n\t\t\t$Val->Requerido('NODO', 'Debe ingresar el Nodo al que pertenece la Matriz');\n\t\t\t$Val->Requerido('HORAFIN', 'Defina la fecha-hora que termina el Aviso');\n\t\t\t$Val->Requerido('MATRIZ', 'Debe informar el Número de la Matriz');\n\t\t\t$Val->ControlEnvio('peticionAjax(\"FormularioGuion\", \"Respuesta\");');\n\t\t\treturn $Val->Constructor('FormularioGuion');\n\t\t}", "public function listoAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = $this->params()->fromRoute('id', 0);\n \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter'); \n $d = new AlbumTable($this->dbAdapter);\n $pos = strpos($id, \".\"); \n $idIasp = substr($id, 0 , $pos ); // Id item aspectos \n $idCar = substr($id, $pos+1 , 100 ); // id Cargo\n $form->get(\"id\")->setAttribute(\"value\",$idIasp); \n $form->get(\"id2\")->setAttribute(\"value\",$idCar); \n \n if ($id==0)\n { \n $data = $this->request->getPost();\n $idIasp = $data->id; \n } \n $datos = $d->getGeneral(\"select a.*, b.nombre as nomAsp,c.texto, c.a, c.b, c.c, c.d, c.e, a.tipo \n from t_asp_cargo_i a \n inner join t_asp_cargo b on b.id=a.idAsp \n left join t_cargos_a c on c.idIasp=a.id \n where a.idAsp=\".$idIasp); \n \n // ------------------------ Fin valores del formulario \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) { \n \n $u = new CargosA($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $d->modGeneral(\"Delete from t_cargos_a where idAsp=\".$data->id);\n //print_r($data);\n foreach ($datos as $dato){\n $idLc = $dato['id'];\n $nombre = '';\n if ($dato['tipo'] == 1)// Texto \n {\n $texto = '$data->text'.$idLc;\n eval(\"\\$nombre = $texto;\"); \n } \n $a = 0;$b = 0;$c = 0;$d = 0;$e = 0;\n if ($dato['tipo'] == 2)// Lista de opciones \n {\n $texto = '$data->comenNa'.$idLc;\n eval(\"\\$a = $texto;\"); \n $texto = '$data->comenNb'.$idLc;\n eval(\"\\$b = $texto;\"); \n $texto = '$data->comenNc'.$idLc;\n eval(\"\\$c = $texto;\"); \n $texto = '$data->comenNd'.$idLc;\n eval(\"\\$d = $texto;\"); \n $texto = '$data->comenNe'.$idLc;\n eval(\"\\$e = $texto;\"); \n }\n $u->actRegistro( $data->id2, $data->id, $dato['id'],$nombre, $a, $b, $c, $d, $e);\n }\n $this->flashMessenger()->addMessage('');\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'o/'.$data->id.\".\".$data->id2);\n } \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $u=new CargosA($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n //$datos = $u->getRegistroId($id);\n } \n } \n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n \"datos\" => $datos, \n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n 'idCar' => $idCar,\n \"ttablas\" => 'Aspecto, Item, Opciones',\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function mostrarFormulario(){\r\n $this->consultaFacultades();\r\n }", "function muestraFormularioMetas(){\n $name = $titulo = $urlfolio = \"\";\n $folio = $random = 0;\n if($this->data['folio'] != \"\"){\n $tmp=explode('-',$this->data['folio']);\n if($this->opc == 9){\n $name=\"guardaAvance\";\n $arrayProyecto = $this->regresaDatosProyecto($tmp[0]);\n $folio = $tmp[0];\n $urlfolio=$this->data['folio'];\n $titulo=CAPTURAREPORTEDEMETAS;\n $random=rand(1,10000000);\n }\n else{\n $name=\"actualizaAvance\";\n $arrayProyecto = $this->regresaDatosProyecto($tmp[1]);\n $folio = $tmp[1];\n $urlfolio=$tmp[1].\"-\".$tmp[2];\n $random=$tmp[0];\n }\n $this->arrayNotificaciones = $this->notificaciones ();\n $titulo = $arrayProyecto['proyecto'];\n $resultados = $this->consultaActividades($this->pages->limit);\n $arrayDisabled = $this->recuperaPermisos($arrayProyecto['unidadResponsable_id'],$arrayProyecto['programa_id']); \n $trimestreId = $this->obtenTrimestre($arrayDisabled);\n $arrayUnidadOperativas=$this->catalogoUnidadesOperativas($this->db);\n\t\t\t$campoTrimestre=\"estatus_avance_entrega\";\n\t\t\tif($campoTrimestre > 1){\n\t\t\t\t$campoTrimestre=\"estatus_avance_entrega\".$campoTrimestre;\n\t\t\t}\n\t\t\t\n $this->buffer=\"\n <input type='hidden' name='noAtributos' id='noAtributos' value='\".( count($resultados) + 0).\"'>\n <input type='hidden' name='valueId' id='valueId' value='\".($this->arrayAvanceMetas['id'] + 0).\"'>\n <input type='hidden' name='folio' id='folio' value='\".$folio.\"'>\n <input type='hidden' name='random' id='random' value='\".$random.\"'>\n <input type='hidden' name='trimestreId' id='trimestreId' value='\".$trimestreId.\"'>\n <div class='panel panel-danger spancing'>\n <div class='panel-heading titulosBlanco'>\".$titulo.\"</div>\n <div class='panel-body'>\n <table align='center' border='0' class='table table-condensed'>\n <tr class='active alturaComponentesA'>\n <td class='tdleft' colspan='2' width='25%'>\".PROYECTO.\"</td>\n <td class='tdleft' colspan='2'>\".$arrayProyecto['proyecto'].\"</td>\n </tr>\n <tr class='alturaComponentesA'>\n <td class='tdleft' colspan='2' >\".UNIDADOPERATIVA.\"</td>\n <td class='tdleft' colspan='2'>\".$arrayUnidadOperativas[$arrayProyecto['unidadOperativaId']].\"</td>\n </tr>\n <tr class='alturaComponentesA'>\n <td class='tdleft' colspan='2' >\".TRIMESTRE.\"</td>\n <td class='tdleft' colspan='2'>\".$trimestreId.\"</td>\n </tr>\n \n </table>\n <table width='100%' class='table'>\n <tr>\n <td class='tdcenter fondotable' rowspan='2' width='30%'>\".ACTIVIDAD.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE1C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE2C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE3C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TRIMESTRE4C.\"</td>\n <td colspan='2' class='tdcenter fondotable' width='10%'>\".TOTAL.\"</td>\n <td class='tdcenter fondotable' rowspan='2' width='14%'>\".MEDIDA.\"</td>\n <td class='tdcenter fondotable' rowspan='2' width=' 8%'>\".ucfirst(substr(PONDERACION,0,4)).\"</td>\n <td class='tdcenter fondotable' rowspan='2' width=' 8%'>\".ucfirst(substr(TIPOACT,8,3)).\"</td>\n </tr>\n <tr>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".P.\"</td>\n <td class='tdcenter fondotable' width='5%'>\".R.\"</td>\n </tr>\";\n $contadorTab1=1;\n $contadorTab2=2;\n $contadorTab3=3;\n $contadorTab4=4; \n $contadorRen = $total = $totales = $rtotal = $rtotales = 0;\n $disabled_t1 = $disabled_t2 = $disabled_t3 = $disabled_t4 = \"\";\n $fondo_t1 = 'background-color:#ffff99;';\n $fondo_t2 = 'background-color:#ffff99;';\n $fondo_t3 = 'background-color:#ffff99;';\n $fondo_t4 = 'background-color:#ffff99;';\n if($arrayDisabled[1]['dis'] + 0 == 0){\n $disabled_t1=\" readonly ='true' \";\n $fondo_t1 = '';\n }\n if($arrayDisabled[2]['dis'] + 0 == 0){\n $disabled_t2=\" readonly ='true' \";\n $fondo_t2 = '';\n }\n if($arrayDisabled[3]['dis'] + 0 == 0){\n $disabled_t3=\" readonly ='true' \";\n $fondo_t3 = '';\n }\n if($arrayDisabled[4]['dis'] + 0 == 0){\n $disabled_t4=\" readonly ='true' \";\n $fondo_t4 = '';\n }\n $arrayEditable=array(1,3,4,6,7,8,9);\n \n foreach($resultados as $id => $resul){\n $rand = rand(1,99999999999999);\n $class=\"\";\n if($contador % 2 == 0)\n $class=\"active\";\n $campo=\"estatus_avance_entrega_t\".$trimestreId; \n $idEstatusActividad =$resul[$campo] ;\n $varTemporalId = $resul['id'].\"-\".$arrayProyecto['id'].\"-\".$trimestreId;\n $varTemporalIdE = $resul ['id'] . \"-\" . $arrayProyecto['id'].\"-\".$trimestreId.\"-\".$idEstatusActividad; \n $idact= $resul['id'];\n $totales = $totales + $this->arrayDatos[$idact][5] + 0;\n $tmp=\"\";\n \n if($resul['tipo_actividad_id'] != 0){\n $this->buffer.=\"\n <tr class=' $class alturaComponentesA'>\n <td class='tdleft' rowspan='2'>\".$resul['actividad'].\"</td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][1] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' tabindex='\".$contadorTab1.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab1.\"-1-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][1] + 0).\"' style='width:35px;$fondo_t1' \".$disabled_t1.\">\n </td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][2] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' \".$this->disabled.\" tabindex='\".$contadorTab2.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab2.\"-2-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][2] + 0).\"' style='width:35px;$fondo_t2' \".$disabled_t2.\"> \n </td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][3] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' \".$this->disabled.\" tabindex='\".$contadorTab3.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab3.\"-3-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][3] + 0).\"' style='width:35px;$fondo_t3' \".$disabled_t3.\">\n </td>\n <td class='tdcenter numMetas form-control'>\".($this->arrayDatos[$idact][4] + 0).\"</td>\n <td class='tdcenter'>\n <input type='text' class='form-control validanumsMA' \".$this->disabled.\" tabindex='\".$contadorTab4.\"'\n id='r-\".$contadorRen.\"-\".$resul['id'].\"-\".$contadorTab4.\"-4-\".$resul['tipo_actividad_id'].\"' maxlength='10' value='\".($this->arrayAvanceMetas[$idact][4] + 0).\"' style='width:35px;$fondo_t4' \".$disabled_t4.\">\n </td>\n <td class='tdcenter' rowspan='2'>\n <span id='total\".$contadorRen.\"' class='totales'>\".number_format(($this->arrayDatos[$idact][1] + $this->arrayDatos[$idact][2] + $this->arrayDatos[$idact][3] + $this->arrayDatos[$idact][4] + 0),0,',','.').\"</span>\n </td>\n <td class='tdcenter' rowspan='2'>\n <span id='rtotal\".$contadorRen.\"' class='totales'>\".number_format($this->arrayAvanceMetas[$idact][1] + $this->arrayAvanceMetas[$idact][2] + $this->arrayAvanceMetas[$idact][3] +$this->arrayAvanceMetas[$idact][4],0,',','.').\"</span>\n </td>\n <td class='tdcenter'>\".$resul['medida'].\"</td>\n <td class='tdcenter'>\".$resul['ponderacion'].\"</td>\n <td class='tdcenter'>\".$resul['tipo_actividad_id'].\"</td>\n </tr>\n <tr>\n <td colspan='8' class='tdleft $class'>\".$this->regresaUltimoComentario($arrayProyecto['id'],$resul['id']).\"<br>\".$this->regresaNoAdjuntos($arrayProyecto['id'],$resul['id']).\"<span id='avance'></span></td>\";\n $rtotales = $rtotales + $this->arrayAvanceMetas[$idact][5]; \n if($this->session['rol'] == 1 || $this->session['rol'] >=3){\n $this->buffer.=\"<td class='tdcenter $class' colspan='3'>\"; \n if($this->session['rol'] == 1 || $this->session['rol'] >=4){\n $classb=\"mComentariosConsulta\";\n if(in_array($arrayProyecto[$campoTrimestre],$arrayEditable)){\n $classb=\"mComentarios\";\n }\n $this->buffer.=\"<button type='button' class='btn btn-success btn-sm $classb' id='\".$resul['proyecto_id'].\"-\".$resul['id'].\"-\".$trimestreId.\"'><span class='glyphicon glyphicon-pencil'></span>&nbsp;&nbsp;Comentarios</button>\";\n }\n if($this->session['rol'] >=3){\n $this->buffer.=\"<button type='button' class='btn btn-warning btn-sm masFile' id='m-\".$resul['proyecto_id'].\"-\".$resul['id'].\"-\".$trimestreId.\"'>&nbsp;&nbsp;M&aacute;s</button>\";\n }\n $this->buffer.=\"</td>\";\n }\n if($this->session['rol'] == 2){\n $this->buffer.=\"\n <td class='tdcenter $class'><button type='button' class='btn btn-success btn-sm mComentariosConsulta' id='\".$resul['proyecto_id'].\"-\".$resul['id'].\"-\".$trimestreId.\"'><span class='glyphicon glyphicon-pencil'></span>&nbsp;&nbsp;Comentarios</button></td>\n <td class='tdcenter $class'>\n <button type='button' class='btn btn-default aprobadosavances' data-toggle='tooltip' data-placement='bottom'\n title='\".PROYECTOAPROBADO.\"' id='aaa-\".$varTemporalIdE.\"'><span class='glyphicon glyphicon-ok'></span>\n </button>\n </td>\n <td class='tdcenter $class'>\n <button type='button' class='btn btn-default noaprobadosavances' data-toggle='tooltip' data-placement='bottom'\n title='\".PROYECTONOAPROBADO.\"' id='ann-\".$varTemporalIdE.\"'><span class='glyphicon glyphicon-remove'></span>\n </button></td>\";\n }\n \n \n $this->buffer.=\"</tr><tr><td colspan='11'>&nbsp;</td>\";\n if( ($idEstatusActividad!= 3) && ($idEstatusActividad!= 6) && ($idEstatusActividad!= 9)){\n $this->buffer .= \"<td class='tdleft' colspan='3' id='v-\".$varTemporalIdE.\"' style='background-color:\" . $this->arrayNotificaciones [$idEstatusActividad] ['color'] . \";color:#000000;'>\" . $this->arrayNotificaciones [$idEstatusActividad] ['nom'] . \"</td>\";\n }\n else{\n $this->buffer .= \"<td class='tdleft verComentariosNoAprobados' colspan='3' id='v-\".$varTemporalIdE.\"' style='cursor:pointer;background-color:\" . $this->arrayNotificaciones [$idEstatusActividad] ['color'] . \";color:#000000;' data-toggle='tooltip' data-placement='bottom' title='\" . TOOLTIPMUESTRACOMENTARIOS . \"'>\" . $this->arrayNotificaciones [$idEstatusActividad] ['nom'] . \"</td>\";\n }\n $this->buffer .= \"</tr>\";\n $contadorTab1 = $contadorTab1 + 4;\n $contadorTab2 = $contadorTab2 + 4;\n $contadorTab3 = $contadorTab3 + 4;\n $contadorTab4 = $contadorTab4 + 4;\n $contadorRen++;\n $contador++;\n }\n }\n $contadorTab4++;\n \n /*$this->buffer.=\"<tr><td colspan='8'></td>\n <td class='tdleft'>Total:</td><td class='tdcenter'><span id='totales' class='totales'>\".($totales + 0).\"</span></td>\n <td class='tdcenter'><span id='rtotales' class='totales'>\".($rtotales + 0).\"</span></td>\n <td colspan='3'>&nbsp;</td></tr></table>*/\n $this->buffer.=\"</table>\n </div>\n <div class=\\\"central\\\"><br>\"; \n if( (in_array($arrayProyecto[$campoTrimestre],$arrayEditable)) or ($this->session['rol']<=2 or $this->session['rol']<=5) ){\n \n $this->buffer.=\"<button type='button' tabindex='\".$contadorTab4.\"' class='btn btn-success btn-sm' id='\".$name.\"' name='\".$name.\"'><span class='glyphicon glyphicon-floppy-saved'></span>&nbsp;\".AGREGAREPORTEMETA.\"</button>&nbsp;&nbsp;\";\n }\n $this->buffer.=\"<button type='button' class='btn btn-primary btn-sm'\n onclick=\\\"location='\".$this->path.\"aplicacion.php?aplicacion=\".$this->session ['aplicacion'].\"&apli_com=\".$this->session ['apli_com'].\"&opc=0'\\\">\".REGRESA.\"</button>\n </div>\".$this->procesando(4).\"<br></div>\";\n }else{\n header(\"Location: \".$this->path.\"aplicacion.php?aplicacion=\".$this->session ['aplicacion'].\"&apli_com=\".$this->session ['apli_com'].\"&opc=1\");\n } \n }", "public function form_informacion_basica(){\n //Tomamos los datos del productor logeado\n $datos = \\DB::table('enc_productores')->orderBy('id_productor', 'desc')->where('object_id', Auth::user()->object_id)->where('activo', 1)->get();\n\n //Si esta vacio, significa que no hay el registro, envìa a formulario vacio\n if (empty($datos->first())) {\n return $this->form_informacion_basica_agregar();\n }\n else {\n //Por el contrario, si hay el registro, envìa a actualizar\n return $this->form_informacion_basica_editar();\n }\n //return view(\"formularios.encuestas.form_informacion_basica_agregar\");\n }", "function mostrarFormulario($tipo){\n $cod_proyecto = $this->proyecto[0][0]; \n $nom_proyecto = $this->proyecto[0][1]; \n $indice=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $ruta=\"pagina=admin_homologacionTransferenciaInterna\";\n $ruta.=\"&opcion=realizarHomologacionTransferenciaInterna\";\n $ruta.=\"&cod_proyecto=\".$cod_proyecto;\n \n\n ?>\n <script src=\"<? echo $this->configuracion[\"host\"]. $this->configuracion[\"site\"]. $this->configuracion[\"javascript\"] ?>/funciones.js\" type=\"text/javascript\" language=\"javascript\"></script>\n <form enctype='tipo:multipart/form-data,application/x-www-form-urlencoded,text/plain' method='POST' action='index.php' name='<? echo $this->formulario ?>'>\n \n <div align=\"center\" ><b><?echo \"HOMOLOGACIONES POR TRANSFERENCIA INTERNA - \".$cod_proyecto.\" \".$nom_proyecto; ?></b></div><hr>\n <table>\n <tr id=\"fila\" >\n <td class=\"sigma centrar\" colspan=\"6\" width=\"100%\">Seleccione el n&uacute;mero de estudiantes:\n <select id=\"filas\" name=\"filas\" onchange=\"removeLastRow(),nuevaFila(document.getElementById('filas').value-1,<?echo $_REQUEST['cod_proyecto']?>)\">\n <?$opciones=1?>\n <option selected class=\"boton\" value=\"1\" onClick=\"removeLastRow(),nuevaFila(0,<?echo $_REQUEST['cod_proyecto']?>)\">1</option>\n <?for($opciones=5;$opciones<=50;$opciones+=5){?>\n <option id=\"<?echo $opciones-1?>\" class=\"boton\" value=\"<?echo $opciones?>\"><?echo $opciones?></option>\n <?}?>\n </select>&nbsp;&nbsp;\n <?//opciones para agregar 1 estudiante y opcion para borrar todas las filas?>\n <input type=\"button\" value=\"Adicionar filas\" onClick=\"nuevaFila(1,<?echo $_REQUEST['cod_proyecto']?>)\" alt=\"Adicionar\">\n <input type=\"button\" value=\"Reiniciar filas\" onClick=\"removeLastRow()\" alt=\"Remover\">\n <input type=\"button\" value=\"Borrar fila\" onClick=\"removeLastestRow()\" alt=\"Remover\">\n </td>\n </tr></table>\n <table id=\"tabla\" class=\"contenidotabla\" width=\"100%\">\n \n <?//opciones para agregar 5,10,15...50 estudiantes?>\n\n <thead class='sigma'>\n <th class='niveles centrar' > Código Actual</th>\n <th class='niveles centrar' > Estudiante</th>\n <th class='niveles centrar' > Código Proyecto Curricular Anterior</th>\n <th class='niveles centrar' > Proyecto Curricular Anterior</th>\n </thead>\n <tr >\n <td width=\"13%\" class='cuadro_plano centrar'>\n 1 <input type=\"text\" id=\"codEstudiante0\" name=\"codEstudiante[0]\" size=\"11\" onKeyPress=\"return solo_numero(event)\" onBlur=\"xajax_nombreEstudiante(document.getElementById('codEstudiante0').value,0,<? echo $cod_proyecto;?>)\">\n <input type=\"hidden\" name=\"opcion\" value=\"registrar\">\n <input type=\"hidden\" name=\"action\" value=\"<? echo $this->formulario ?>\">\n <input type=\"hidden\" name=\"tipo_homologacion\" value=\"estudiantes\">\n <input type=\"hidden\" name=\"cod_proyecto\" value=\"<? echo $cod_proyecto; ?>\">\n </td>\n <td width=\"20%\" class='cuadro_plano centrar'>\n <div id=\"div_nombreEstudiante0\" ></div>\n </td>\n <td width=\"17%\" class='cuadro_plano centrar'>\n <input type=\"text\" id=\"codProyectoAnt0\" name=\"codProyectoAnt[0]\" size=\"11\" maxlength='3' onKeyPress=\"return solo_numero(event)\" onBlur=\"xajax_nombreProyecto(document.getElementById('codProyectoAnt0').value,0)\">\n </td>\n \n </td>\n <td width=\"30%\" class='cuadro_plano centrar'>\n <div id=\"div_proyectoAnt0\" ></div>\n </td>\n\n </tr>\n </table>\n <table width=\"100%\">\n <tr>\n <td align=\"center\">\n <input type=\"button\" value=\"Registrar\" onclick=\"if(verificarFormulario(<?echo $this->formulario?>)){document.forms['<? echo $this->formulario?>'].submit()}else{false}\">\n </td>\n </tr>\n </table>\n </form>\n<?\n \n }", "public function transactionGetForm ();", "function mostrarFormularioProyecto(){\n include_once($this->configuracion[\"raiz_documento\"] . $this->configuracion[\"clases\"] . \"/html.class.php\");\n $html = new html();\n $this->verificar = \"seleccion_valida(\".$this->formulario2.\",'cod_proyecto')\";\n \n //$cod_proyecto = $this->proyecto[0][0]; \n //$nom_proyecto = $this->proyecto[0][1];\n $tmp_proyectos = $this->consultarProyectos();\n for($i=0;$i<count($tmp_proyectos);$i++) {\n $proyectos[$i][0]=$tmp_proyectos[$i]['CRA_COD'];\n $proyectos[$i][1]=$tmp_proyectos[$i]['NOMBRE'];\n }\n $_REQUEST['cod_proyecto']=isset($_REQUEST['cod_proyecto'])?$_REQUEST['cod_proyecto']:'';\n \n ?>\n <script src=\"<? echo $this->configuracion[\"host\"]. $this->configuracion[\"site\"]. $this->configuracion[\"javascript\"] ?>/funciones.js\" type=\"text/javascript\" language=\"javascript\"></script>\n <form enctype='tipo:multipart/form-data,application/x-www-form-urlencoded,text/plain' method='POST' action='index.php' name='<? echo $this->formulario2 ?>'>\n <table id=\"tabla\" class=\"contenidotabla\" width=\"100%\">\n <div align=\"center\" ><b><?echo \"HOMOLOGACIONES PENDIENTES POR PROYECTO CURRICULAR \"; ?></b></div><hr>\n <?//opciones para agregar 5,10,15...50 estudiantes?>\n\n <thead class='sigma'>\n <th class='niveles centrar' > Proyecto Curricular</th>\n </thead>\n <tr >\n <td width=\"20%\" class='cuadro_plano centrar'>\n <?\n $mi_cuadro = $html->cuadro_lista($proyectos, \"cod_proyecto\", $this->configuracion,$_REQUEST['cod_proyecto'], 0, FALSE, 1, \"\",400);\n echo $mi_cuadro ;\n ?>\n <input type=\"hidden\" name=\"opcion\" value=\"consultarProyecto\">\n <input type=\"hidden\" name=\"pagina\" value=\"<? echo $this->formulario2 ?>\">\n \n </td>\n \n </tr>\n </table>\n <table width=\"100%\">\n <tr>\n <td align=\"center\">\n <input type=\"button\" value=\"Homologar\" onclick=\"if(<? echo $this->verificar; ?>){document.forms['<? echo $this->formulario2?>'].submit()}else{false}\"> </td>\n </tr>\n </table>\n </form>\n<?\n\n }", "public function ConsultarSoporteMatricula($param) {\n extract($param);\n $resultado = array();\n $registro = array();\n $sql = \"CALL SPCONSULTARCARGAMASIVASM($tipodocumento,$busqueda);\";\n $rs=null;\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $host= $_SERVER[\"HTTP_HOST\"];\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n foreach ($fila as $key => $value) {\n $rutaFuente= \"<a href='/\".$fila['RutaFuente'].\"'>Descargar Archivo Fuente</a>\";\n $rutaEscaneado= \"<a href='/\".$fila['RutaSoporte'].\"'>Descargar Archivo Soporte</a>\";\n array_push($registro, $fila['TipoIdentificacion'],$fila['NumeroIdentificacion'],$fila['Nombres'],$fila['Fecha'],$fila['Salon'],$rutaFuente, $rutaEscaneado ,$value);\n \n array_push($registro, $value);\n }\n array_push($resultado, $registro);\n $registro = array();\n }\n }\n } else {\n $registro = 0;\n }\n echo json_encode($resultado);\n }", "private function cadastrar()\n {\n /**\n * Verifica se o formulario enviou via POST\n */\n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n //Solicita o cadastro dos dados\n $this->Delegator('ConcreteCadastro', 'cadastrar', $this->getPost());\n }\n }", "function calcular()\n\t\t{\n\t\t\tif ($_SERVER['REQUEST_METHOD']=='POST') {\n\t\t\t//Guardamos en un arreglo lo que recibimos de la vista via POST\t\n\t\t\t\t//enviamos ala funcion insertPersons del Modelo de personas \n\t\t\t\t//el arreglo previamente recibido\n\t\t\t\t $listado = $this->_estadisticaModel->getActividades($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $listado2 = $this->_estadisticaModel->getMateriales_x_actividades($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $listado1 = $this->_estadisticaModel->getCantidad($_POST['fechai'],$_POST['fechaf']);\n\t\t\t\t $this->_view->_fechai = $_POST['fechai'];\n\t\t\t\t $this->_view->_fechaf = $_POST['fechaf'];\n\t\t\t\t $this->_view->_listado2 = $listado2;\n\t\t\t\t $this->_view->_listado = $listado;\n\t\t\t\t $this->_view->_listado1 = $listado1;\n\t\t\t\t $this->_view->render(\"estadistica\",'','',$this->_sidebar_menu);\n\t\t\t\t \n\t\t\t\t//redireccionamos al listado\n\t\t\t}else{\n\t\t\t\t//se muestra la ventana si no es via post\n\t\t\t\t$this->_view->render(\"insert\",'','',$this->_sidebar_menu);\n\t\t\t}\n\t\t\t\n\t\t}", "function make_form_row(){\n\t\tswitch($this->fieldType){\n\t\t\tcase 'id':\n\t\t\t\treturn $this->obo_id();\n\t\t\t\tbreak;\n\t\t\tcase 'term':\n\t\t\t\treturn $this->obo_term();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$form = parent::make_form_row();\n\t\t\n\t\t}\n\t\treturn $form;\n\t\n\t}", "function insertarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\t\t\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','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 listaAction() \n { \n \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n // Niveles de aspectos\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $o=new \\Nomina\\Model\\Entity\\Turnos($this->dbAdapter);\n $arreglo='';\n $turnos = $o->getRegistro(); \n foreach ($turnos as $dat){\n $idc=$dat['id'];$nom=$dat['codigo'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n $form->get(\"tipo1\")->setValueOptions($arreglo); \n $form->get(\"tipo2\")->setValueOptions($arreglo); \n $form->get(\"idCar\")->setValueOptions($arreglo); \n \n $d = new AlbumTable($this->dbAdapter);\n \n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n 'datos' => $d->getGeneral1(\"select * from n_turnos_g where id =\".$id), \n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n \n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) {\n// print_r($_POST);\n \n // Zona de validacion del fomrulario --------------------\n $album = new ValFormulario();\n $form->setInputFilter($album->getInputFilter()); \n $form->setData($request->getPost()); \n $form->setValidationGroup('nombre'); // ------------------------------------- 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 TurnosG($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n // INICIO DE TRANSACCIONES\n $connection = null;\n try \n {\n $connection = $this->dbAdapter->getDriver()->getConnection();\n $connection->beginTransaction(); \n\n $id = $u->actRegistro($data);\n $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $connection->commit();\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);// El 1 es para mostrar mensaje de guardado\n }// Fin try casth \n catch (\\Exception $e) \n {\n if ($connection instanceof \\Zend\\Db\\Adapter\\Driver\\ConnectionInterface) \n {\n $connection->rollback();\n echo $e;\n } \n /* Other error handling */\n }// FIN TRANSACCION // return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin);\n }\n }\n //exit(); \n return new ViewModel($valores);\n \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new TurnosG($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n $datos = $u->getRegistroId($id);\n $n = $datos['nombre'];\n // Valores guardados\n $form->get(\"nombre\")->setAttribute(\"value\",\"$n\"); \n \n \n } \n return new ViewModel($valores);\n }\n }", "function sevenconcepts_formulaire_charger($flux){\n $form=$flux['args']['form'];\n if($form=='inscription'){\n include_spip('cextras_pipelines');\n $champs_extras=champs_extras_objet(table_objet_sql('auteur'));\n foreach($champs_extras as $value){\n $flux['data'][$value['options']['nom']]=''; \n if(isset($value['options']['obligatoire']))$flux['data']['obligatoire'][$value['options']['nom']]='on';\n }\n $flux['data']['nom_inscription']='';\n $flux['data']['mail_inscription']='';\n }\n \n return $flux;\n}", "public function valiteForm();", "public function listaAction() \n { \n $form = new Formulario(\"form\");\n // valores inici ales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n $dat = $d->getGeneral1(\"select * from n_tip_matriz where id = \".$id);\n $idGrupo = $dat['idGrup'];\n $nomGrupo = $dat['nombre'];\n // GUARDAR NOVEDADES //\n if($this->getRequest()->isPost()) // Actualizar \n {\n $request = $this->getRequest();\n if ($request->isPost()) \n { \n // INICIO DE TRANSACCIONES\n $connection = null;\n try \n {\n $connection = $this->dbAdapter->getDriver()->getConnection();\n $connection->beginTransaction(); \n\n $u = new Novedades($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n // Buscar datos del cepto \n $idCon = '';\n $idProy = 1; // Predeterminado sin proyecto\n if (isset($data->idCcos))\n {\n $idProy = $data->idCcos; // Si existe el proyecto \n }\n if ($data->id2==0) // Tipo matriz \n {\n $datos = $d->getGeneral(\"select a.id, b.nombre as nomMatz, a.idConc, b.alias, b.tipo,b.valor \n from n_tip_matriz_tnv a \n inner join n_conceptos b on b.id=a.idConc \n where a.idTmatz = \".$data->id );\n foreach ($datos as $dato){\n $idCon = (int) $dato['idConc'];\n $idTmat = (int) $dato['id'];\n $valor = '$data->val'.$idCon;\n eval(\"\\$valor =$valor;\"); \n $cuotas = 0;\n if ($valor>0)\n {\n $datCon = $d->getConnom2(\" and id=\".$idCon);\n foreach ($datCon as $dat)\n { \n $u->actRegistro($data->id, $idTmat ,$data->idEmp,$idCon, $valor,$data->idCal, $dat['tipo'], $dat['valor'], $data->fechaIni, $idProy, $cuotas );\n } \n }\n }\n }else{ // Tipo lineal de seleccion\n $valor = 0; \n if (isset($data->valor))\n {\n $valor = $data->valor;\n if ($valor > 0)\n {\n $datCon = $d->getConnom2(\" and id=\".$data->tipo);\n foreach ($datCon as $dat)\n { \n $idInov = $u->actRegistro($data->id, 0,$data->idEmp ,$data->tipo, $valor, $data->idCal, $dat['tipo'], $dat['valor'], $data->fechaIni, $idProy, $data->numero);\n }\n // CUOTAS \n if ($data->numero>0)\n {\n $d->modGeneral(\"insert into n_novedades_cuotas\n (idInov, idEmp, idCal, idConc, valor, cuotas) \n values(\".$idInov.\",\".$data->idEmp.\",\".$data->idCal.\",\".$data->tipo.\",\".$valor.\",\".$data->numero.\")\");\n } \n }\n }else{ // es porque sera ejecutado por formula\n $cuotas = 0; \n $datCon = $d->getConnom2(\" and id=\".$data->tipo);\n foreach ($datCon as $dat){ \n $u->actRegistro($data->id, 0,$data->idEmp ,$data->tipo, $valor, $data->idCal, $dat['tipo'], $dat['valor'], $data->fechaIni, $idProy, $cuotas); \n }\n } \n \n } \n // Buscar de en novedades cuales tienen formulas \n $datos = $d->getGeneral(\"select a.id, c.id as idFor,c.formula,a.horas, b.tipo, a.idEmp, a.idProy \n from n_novedades a \n inner join n_conceptos b on b.id=a.idConc \n inner join n_formulas c on c.id=b.idFor \n where a.calc=0 and a.estado = 0\");\n $f = new NominaFunc($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n //print_r($data);\n foreach ($datos as $dat)\n {\n if ($dat['formula']!='') // LLamar funcion para hallar formulas \n { \n //echo $dat['formula'].'<br />';\n $fechaEje = '';\n $idProy = $dat['idProy'];\n $datFor = $f->getFormula($dat['formula'], $dat['idFor'], $dat['tipo'], $dat['horas'], $dat['idEmp'],0,0,0,0,$fechaEje, $idProy) ;\n //print_r($datFor).'<br />';\n ///$d->modGeneral('Update n_novedades Set calc=1 , devengado='.$datFor['dev'].', deducido='.$datFor['ded'].' Where id='.$dat['id']); \n } \n } \n\n $connection->commit();\n }// Fin try casth \n catch (\\Exception $e) \n {\n if ($connection instanceof \\Zend\\Db\\Adapter\\Driver\\ConnectionInterface) {\n $connection->rollback();\n echo $e;\n } \n /* Other error handling */\n }// FIN TRANSACCION \n } // Fin Post \n }\n // Datos \n $datTnom = $d->getGeneral1(\"select a.id, a.idTnom, b.idTcal, c.idGrupo from n_tip_matriz a \n inner join n_tip_nom b on b.id=a.idTnom \n inner join n_tip_calendario_d c \n on c.idTnom=a.idTnom and c.idGrupo=a.idGrup \n where a.id=\".$id.\" limit 1\" ); \n // Empleados\n $arreglo='';\n $datos = $d->getEmp(' and idGrup='.$idGrupo); \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 // Calendario\n $arreglo='';\n //echo $datTnom['idGrupo'].' '.$datTnom['idTcal'].' '.$datTnom['idTnom'];\n $datos = $d->getCalenIniFin2($datTnom['idGrupo'], $datTnom['idTcal'], $datTnom['idTnom']); \n foreach ($datos as $dat){\n if ($dat['idNom']==0) // Solo muestra calendario de nominas no generadas\n {\n $idc=$dat['id'];$nom=$dat['fechaI'].' - '.$dat['fechaF'];\n $arreglo[$idc]= $nom;\n }\n } \n if ($arreglo!='')\n $form->get(\"idCal\")->setValueOptions($arreglo); \n // \n $datos = $d->getGeneral1(\"select tipo from n_tip_matriz where id = \".$id);\n $tipo = $datos['tipo']; \n $form->get(\"id2\")->setAttribute(\"value\",$tipo); // Tipo de matriz\n $arreglo=''; \n $con=' ';\n if ($tipo==1) \n $con=' and tipo=1'; \n if ($tipo==2) \n $con=' and tipo=2'; \n $datos = $d->getConPres($con); \n if ($con!=' ')\n {\n foreach ($datos as $dat){\n $idc=$dat['id'];$nom=$dat['codigo'].' - '.$dat['nombre'];\n $arreglo[$idc]= $nom;\n }\n $form->get(\"tipo\")->setValueOptions($arreglo); \n }\n\n $valores=array\n (\n \"titulo\" => $this->tfor.' '.$nomGrupo,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'tipo' => $tipo, \n 'id' => $id, \n 'datos' => $d->getGeneral(\"select a.id, b.nombre as nomMatz, a.idConc, b.alias, b.tipo,b.valor \n from n_tip_matriz_tnv a \n inner join n_conceptos b on b.id=a.idConc where a.idTmatz=\".$id.\" order by b.codigo \"),\n 'datNov' => $d->getDnovedades(\" and a.idMatz=\".$id),\n 'datNovA' => $d->getGeneral1(\"select count(b.id) as num \n from n_tip_matriz a \n inner join n_nomina b on b.idGrupo = a.idGrup \n where b.estado in (0,1) and a.id =\".$id),\n \"ttablas\" => \"Cedula, Empleado, Concepto, Sueldo, Horas, Devengado, Deducido, Periodo, Ejecutado , Eliminar\", \n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n return new ViewModel($valores); \n\n }", "function executaRelatorio() {\n\n try {\n $form_values = $this->getValues();\n $matriculas = $form_values['matricula'];\n $matriculas = explode(\"\\n\", $matriculas);\n $matriculas = array_map('trim', $matriculas);\n $array = array(array());\n foreach ($matriculas as $matricula) {\n $aluno = TbalunoPeer::retrieveByPK($matricula);\n $result = array();\n $result['periodo'] = TbperiodoPeer::retrieveByPK($form_values['periodo']);\n $result['idperiodo'] = $form_values['periodo'];\n $result['aluno'] = $aluno;\n $result['show_fields'] = $form_values['show_fields'];\n $result['data_fields'] = $this->getModelFields();\n $result['list'] = TbdisciplinaPeer::retrieveByCodDisciplina($aluno->getDisciplinasACursar($form_values['periodo']));\n $result['list2'] = TbdisciplinaPeer::retrieveByCodDisciplina($aluno->getDisciplinasIntbfila($form_values['periodo']));\n $array['array'][] = $result;\n }\n } catch (PropelException $exc) {\n#throw new Exception( utf8_decode($exc->getMessage()).\" SQL: \".$criteria->toString() );\n throw new Exception(utf8_decode($exc->getMessage()));\n }\n\n return $array;\n }", "public static function tablaMarcas()\n {\n //Comprueba si hay un registro seleccionado\n if(!empty($_GET[\"id_marca\"]))\n {\n //Se valida que sea un numero\n if(is_numeric($_GET[\"id_marca\"]))\n {\n //Variable con los datos de la marca\n $datos_marca = Sentencias::Seleccionar(\"marcas\", \"id\", array($_GET[\"id_marca\"]), 0, null);\n\n //Se valida que tenga datos y que exista\n if($datos_marca != null)\n {\n $marca = $datos_marca[\"marca\"];\n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n else\n {\n //$marca = null;\n }\n \n //Variable con los permisos del usuario\n $dato_tipo = Sentencias::Seleccionar(\"tipos_usuarios\", \"id\", array($_SESSION[\"tipo\"]), 0, null);\n\n //Renderiza si tiene los permisos de lectura\n if($dato_tipo[\"marcas\"] > 0)\n {\n //Variable con todos los registro de la tabla marcas\n $datos_marcas = null; \n\n echo\n (\"\n <div class='row' id='lista'>\n <div class='col s12'>\n <div class='col s12 center-align'>\n <h4>Lista de marcas ingresadas</h4>\n </div>\n \"); \n\n //Se valida si se hara una busqueda\n if(!empty($_GET[\"accion\"]))\n {\n //Se valida si la opcion es 1\n if($_GET[\"accion\"] == 1)\n {\n echo\n (\"\n <div class='center-align'>\n <h4>Buscando por nombre de la marca</h4>\n </div>\n \");\n\n //Se renderiza el formulario de busqueda\n echo\n (\"\n <form method='post' class='col s10 offset-s1 m12'>\n\n <!--Se crea la barra de busqueda-->\n <div class='input-field col s8'>\n <i class='material-icons prefix'>search</i>\n <input id='buscar' type='text' class='validate' name='buscar'>\n <label for='buscar'>Ingrese el nombre de la marca a buscar</label>\n </div>\n <div class='col s4 offset-s2 l2'>\n <button name='busqueda' class='waves-effect waves-light btn blue darken-4'>Buscar</button>\n </div>\n <div class='col s4 offset-s2 l2'>\n <a href='marcas.php' class='waves-effect waves-light btn blue darken-4'>Limpiar</a>\n </div>\n </form>\n \");\n\n //Se empieza a validar los valores ingresados para la busqueda\n if(isset($_POST[\"busqueda\"]))\n {\n $busqueda = trim($_POST[\"buscar\"]);\n\n if(Validaciones::longitud($busqueda, 20) && Validaciones::nombre($busqueda))\n {\n $datos_marcas = Sentencias::Seleccionar(\"marcas\", \"marca\", array(\"$busqueda%\"), 1, 1);\n }\n\n else\n {\n Ventanas::Mensaje(2, \"el paremetro de busqueda no es valido\", null);\n }\n }\n }\n\n else\n {\n header(\"Location: marcas.php\");\n }\n }\n\n else\n {\n echo\n (\"\n <div class='center-align'>\n <h4>Selecciona una opcion de busqueda en la tabla</h4>\n </div>\n \");\n\n $datos_marcas = Sentencias::Seleccionar(\"marcas\", null, null, null, null); \n }\n\n //Renderiza la tabla\n echo\n (\"\n <table class='highlight centered col s12'>\n <thead>\n <tr>\n <th>Imagen</th>\n <th><a class='blue-text text-darken-4' href='marcas.php?accion=1'>Marca</a></th>\n <th>Accion</th>\n </tr>\n </thead>\n <tbody>\n \");\n\n //Se valida si hay datos en la variable\n if($datos_marcas != null)\n {\n //Empieza el foreach para mostrar las marcas\n foreach($datos_marcas as $row_marcas)\n {\n echo\n (\"\n <tr>\n <td><img class='circle' width='50' height='50' src='../img/marcas/$row_marcas[imagen]'></td>\n <td>\".$row_marcas['marca'].\"</td>\n <td><a href='marcas.php?id_marca=\".$row_marcas['id'].\"' class='blue-text text-darken-4'><i class='material-icons'>mode_edit</i></a></td>\n </tr>\n \");\n }\n }\n\n echo\n (\" \n </tbody>\n </table>\n </div>\n </div>\n \");\n }\n }", "static public function ctrCrearMoneda(){\n\t\tif(isset($_POST[\"accionMoneda\"]) && $_POST[\"accionMoneda\"] == \"crear\"){\n\t\t\t$fecha = date('Y-m-d');\n\t\t\t$hora = date('H:i:s');\n\t\t\t$fechaActual = $fecha.' '.$hora;\n\t\t\t$tabla = 'vtama_moneda';\n\t\t\t$codMoneda = maximoCodigoTabla($tabla,'cod_moneda','');\n\t\t\t$datos = array(\"cod_moneda\" => $codMoneda,\n\t\t\t\t\t\t \"dsc_moneda\" => ms_escape_string(trim($_POST[\"nombreMoneda\"])),\n\t\t\t\t\t\t \"dsc_simbolo\" => ms_escape_string(trim($_POST[\"simboloMoneda\"])),\n\t\t\t\t\t\t \"cod_usr_registro\" => $_SESSION[\"cod_trabajador\"],\n\t\t\t\t\t\t \"fch_registro\" => $fechaActual);\n\t\t\t$respuesta = ModeloMoneda::mdlIngresarMoneda($tabla,$datos);\n\t\t\treturn $respuesta;\n\t\t}//if\n\t}", "public function listiAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \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('nombre'); // ------------------------------------- 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 $d = new AlbumTable($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n $d->modGeneral(\"insert into n_turnos_g_h (idTur, idHor)\n values(\".$data->id.\", \".$data->tipo.\")\");\n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin.'i/'.$id);\n //}\n }\n } \n$this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter'); \n $o=new \\Nomina\\Model\\Entity\\Turnos($this->dbAdapter);\n $form->get(\"id\")->setAttribute(\"value\",\"$id\"); \n $form->get(\"ubicacion\")->setValueOptions(array('1'=>'Encabezado')); \n $arreglo='';\n $turnos = $o->getRegistro(); \n foreach ($turnos as $dat){\n $idc=$dat['id'];$nom=$dat['codigo'];\n $arreglo[$idc]= $nom;\n } \n $form->get(\"tipo\")->setValueOptions($arreglo); \n\n $d = new AlbumTable($this->dbAdapter); \n $datos = $d->getGeneral1(\"Select * from n_turnos_g where id=\".$id);\n $valores=array\n (\n \"titulo\" => 'Horarios del turno '.$datos['nombre'],\n \"datos\" => $d->getTurnoHorarios($id), \n \"ttablas\" => 'dia, Tipo, Ok,Eliminar',\n 'url' => $this->getRequest()->getBaseUrl(),\n \"form\" => $form, \n \"lin\" => $this->lin,\n \"id\" => $id,\n ); \n return new ViewModel($valores); \n }", "public function StampaCarrello() {\n\t\t$somma=0;\n\t\tif (count($this->contenuto) > 0) \n\t\t{ ?>\n\n\t\t\t<table>\n\t\t\t\t<tbody>\n\t\t\t\t\t<?\n\t\t\t\t\t?><tr >\n\t\t\t\t\t\t\t<th>Prodotto</th>\n\t\t\t\t\t\t\t<th>Quantità</th>\n\t\t\t\t\t\t</tr><?\n\n\t\t\t\t\t\tfor ($i=0;$i<count($this->contenuto);$i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><?= $this->contenuto[$i]->getNome() ;?></br> \n\t\t\t\t\t\t\t\t<td><?= $this->quantita[$i] ,' Kg';?></br> <?\n\t\t\t\t\t\t\t\t$somma=$somma+($this->contenuto[$i]->getPrezzo()*$this->quantita[$i]);?></br> \n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<?php\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</tbody>\n\t\t\t</table>\n\t\t\t<p> Totale:<?=$somma, ' Euro' ?></p>\n\t\t\t<form method=\"post\" action=\"index.php?page=utente&subpage=home&somma=<?= $somma ?>\">\n\t\t\t\t\t\t<input type=\"hidden\" name=\"cmd\" value=\"completaOrdine\"/>\n\t\t\t\t\t\t<label for=\"date\">Inserisci la data di consegna</label>\n\t\t\t\t\t\t<input type=\"date\" name=\"date\" value=\"2000-01-01\"/>\n\t\t\t\t\t\t<button type=\"submit\">Conferma ordine </button>\n \t\t\t</form>\n\n\t<?php } \n\telse \n\t\t{ \n\t\t\t?><p class=\"messaggio\"> Nessun prodotto inserito </p><?\n\t\t} \n\t}", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento();\n\n $parametros_tabla = Consultas_TablaParametros::RegistroConsultaTodos(__FILE__, __LINE__, $_GET['id_tabla']);\n\n if (!is_array($parametros_tabla)) {\n\n if (isset($_POST['id_cp_rel']) && ($_POST['id_cp_rel'] != '')) {\n $tabla_tabuladores = Consultas_Tabla::RegistroConsultaTablaNombre(__FILE__, __LINE__, $_GET['id_tabla']);\n $consulta = new Bases_RegistroConsulta(__FILE__, __LINE__);\n $consulta->tablas('kirke_tabla');\n $consulta->tablas('kirke_tabla_prefijo');\n $consulta->tablas('kirke_componente');\n $consulta->campos('kirke_tabla', 'tabla_nombre');\n $consulta->campos('kirke_tabla_prefijo', 'prefijo');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', 'kirke_tabla_prefijo', 'id_tabla_prefijo');\n $consulta->condiciones('y', 'kirke_tabla', 'id_tabla', 'iguales', 'kirke_componente', 'id_tabla');\n $consulta->condiciones('y', 'kirke_componente', 'id_componente', 'iguales', '', '', $_POST['id_cp_rel']);\n $id_tabla_cp_rel = $consulta->realizarConsulta();\n Consultas_CampoCrear::armado(__FILE__, __LINE__, $tabla_tabuladores, 'id_' . $id_tabla_cp_rel[0]['prefijo'] . '_' . $id_tabla_cp_rel[0]['tabla_nombre'], 'numero', '12', false);\n }\n\n $tabla_rel_datos = Consultas_Tabla::RegistroConsultaTablaNombre(__FILE__, __LINE__, $_POST['id_tb_rel']);\n $tabla_int_datos = Consultas_Tabla::RegistroConsultaTablaNombre(__FILE__, __LINE__, $_GET['intermedia_tb_id']);\n Consultas_CampoCrear::armado(__FILE__, __LINE__, $tabla_int_datos, 'id_' . $tabla_rel_datos, 'numero', '12', false);\n\n $this->_agregarComponenteTabuladores();\n $this->_pasarNombresComponente();\n\n if (isset($_POST['id_cp_rel']) && ($_POST['id_cp_rel'] != '')) {\n Consultas_TablaParametros::RegistroCrearCompleto(__FILE__, __LINE__, $_GET['id_tabla'], 'tabuladores', 'id_cp_rel', $_POST['id_cp_rel']);\n }\n\n Consultas_TablaParametros::RegistroCrearCompleto(__FILE__, __LINE__, $_GET['id_tabla'], 'tabuladores', 'tabla_relacionada', $_POST['id_tb_rel']);\n Consultas_TablaParametros::RegistroCrearCompleto(__FILE__, __LINE__, $_GET['id_tabla'], 'tabuladores', 'cp_id', $this->_id_componente);\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n $parametros = array('kk_generar' => '0', 'accion' => '30');\n $armado_botonera->armar('redirigir', $parametros);\n }", "function crearComentario($bd,$usuario){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n $entrada = new Entrada($arrayFiltrado[\"entrada\"]);\n $comentario = new Comentario(NULL,$arrayFiltrado[\"comentario\"],$arrayFiltrado[\"fechacreacion\"]);\n $daoComentario = new Comentarios($bd);\n $daoComentario->addComentario($comentario,$entrada,$usuario);\n return true;\n}", "public function crear( $app, $modelo, $transaccion, $vista, $tabla = null, $item_sugerencia_cliente = null )\n { \n if ( is_null($tabla) )\n {\n $tabla = '';\n }\n\n if ( is_null($tabla) )\n {\n $item_sugerencia_cliente = '';\n }\n \n $lista_campos = ModeloController::get_campos_modelo($modelo,'','create');\n $cantidad_campos = count($lista_campos);\n\n $lista_campos = ModeloController::personalizar_campos($transaccion->id, $transaccion, $lista_campos, $cantidad_campos, 'create', null);\n\n $modelo_controller = new ModeloController;\n $acciones = $modelo_controller->acciones_basicas_modelo( $modelo, '' );\n \n $form_create = [\n 'url' => $acciones->store,\n 'campos' => $lista_campos\n ];\n\n $id_transaccion = 8;// 8 = Recaudo cartera\n\n $msj_resolucion_facturacion = '';\n switch ( $transaccion->id )\n {\n case 25: // Factura compras\n $motivos = TesoMotivo::opciones_campo_select_tipo_transaccion( 'Pago proveedores' );\n break;\n case 48: // Doc. Soporte en adquisiciones no obligados a facturas (Compras)\n $motivos = TesoMotivo::opciones_campo_select_tipo_transaccion( 'Pago proveedores' );\n break;\n case 23: // Factura ventas\n $motivos = TesoMotivo::opciones_campo_select_tipo_transaccion( 'Recaudo cartera' );\n break;\n \n default:\n $motivos = TesoMotivo::opciones_campo_select_tipo_transaccion( 'Recaudo cartera' );\n break;\n }\n \n $medios_recaudo = TesoMedioRecaudo::opciones_campo_select();\n $cajas = TesoCaja::opciones_campo_select();\n $cuentas_bancarias = TesoCuentaBancaria::opciones_campo_select();\n\n $miga_pan = $this->get_array_miga_pan( $app, $modelo, 'Crear: '.$transaccion->descripcion );\n \n return view( $vista, compact( 'form_create','miga_pan','tabla','id_transaccion','motivos','medios_recaudo','cajas','cuentas_bancarias', 'item_sugerencia_cliente', 'msj_resolucion_facturacion' ) );\n }", "public function getComprobar()\n\t{\n\t\t\t// JRequest en las versiones superiores de 3.3 se dejaron... \n\t\t\t$jinput = JFactory::getApplication()->input; \n\t\t\t$data = $jinput->post->getArray(array());\n\t\t\t$envio = $data['jform'];\n $resul = array();\n // Esto es lo que hay currar... :-)\n //~ $recibo = $envio['recibo_site'];\n\t\t\t//~ $codigo = $envio['codigorecibo_codigo']; \n\t\t\t\n\t\t\t//~ $db = JFactory::getDBO();\n\t\t\t//~ $query = \"SELECT codigo, recibo, tonelada FROM #__codigoRecibo \"\n\t\t\t\t\t//~ .\"WHERE codigo ='\".$codigo.\"' AND recibo ='\".$recibo.\"'\";\n\t\t\t//~ $db->setQuery($query);\n\t\t\t//~ $resul = $db->loadObjectList();\n\t\t\t//~ $resul['Busqueda'] = $query;\n\t\t\t//~ $resul['DATA'] = $form;\n\n\t\t\t//~ if ($resul)\n\t\t\t//~ {\n\t\t\t\t//~ $codigo = $resul['0']->codigo;\n\t\t\t\t//~ $recibo = $resul['0']->recibo;\n\t\t\t\t//~ $tonelada = $resul['0']->tonelada;\t\n\t\t\n\t\t\t\t\n\t\t\t//~ }\n\t\t\t$this->resultado = $resul;\n\t\t\treturn $this->resultado;\n\t\t\t\n\t}", "public function hydrateeditqualiteformAction()\r\n {\r\n\r\n // Check Post\r\n if (!$this->getRequest()->isPost())\r\n die();\r\n\r\n $params = $this->getRequest()->getParams();\r\n $qualiteId = $params['qualiteId'];\r\n\r\n\r\n $qualite = new Application_Model_DbTable_FicheQualite();\r\n $qualite = $qualite->getOneQualiteById($qualiteId);\r\n $this->_helper->json($qualite);\r\n\r\n }", "function mostrarFormulario(){\n \n echo \"<br><br>\";\n echo \"<h2>FORMULARIO PARA PROFESORES</h2>\";\n?>\n\n <form method=\"post\" action=\"<?php echo htmlspecialchars($_SERVER[\"PHP_SELF\"]);?>\">\n noEmpleado: <input type=\"text\" name=\"noEmpleado\" value=\"<?php echo $this->noEmpleado;?>\">\n <br><br>\n Carrera: <input type=\"text\" name=\"carrera\" value=\"<?php echo $this->carrera;?>\">\n <br><br>\n Nombre: <input type=\"text\" name=\"nombre\" value=\"<?php echo $this->nombre;?>\">\n <br><br>\n <span class=\"error\">* <?php echo $this->nombreErr;?></span>\n <br><br>\n Telefono: <input type=\"tel\" name=\"telefono\"value=\"<?php echo $this->telefono;?>\">\n <br><br>\n <input type=\"submit\" name=\"submit\" value=\"Submit\">\n </form>\n\n<?php\n }", "public function definition() {\n\t\t\tglobal $CFG, $DB;\t\n\t\t\n\t\t$mform = $this->_form; // Don't forget the underscore!\n\t\n\t\t$result= $DB->get_records_sql(\"SELECT DISTINCT `intensidad` FROM `mdl_ejercicios`\");\n\t\t$result_tren= $DB->get_records_sql(\"SELECT DISTINCT `categoria` FROM `mdl_ejercicios`\");\n\t\t$options= array();\n\t\tforeach($result as $rs)\n\t\t\t\t$options[$rs->intensidad] = $rs->intensidad;\n\t\t\n\t\t$options_tren= array();\n\t\tforeach ($result_tren as $rst)\n\t\t\t$options_tren[$rst->categoria]= $rst->categoria;\n\t\t$mform->addElement('header', 'header', 'Para crear una rutina aleatoria');\n\t\t\n\t\t$mform->addElement('select', 'intensidad', '¿Qué intensidad quieres?:',$options);\n\n\t\t//$mform->addElement('select', 'categoria', '¿Qué tren de tu cuerpo quieres trabajar?:',$options_tren);\n\t\t\n\t\t\n\t\t$buttonarray=array();\n\t\t$buttonarray[] = &$mform->createElement('submit', 'submitbutton', 'Buscar rutina');\n\t\t$buttonarray[] = &$mform->createElement('reset', 'resetbutton', 'Resetear');\n\t\t$buttonarray[] = &$mform->createElement('cancel', 'cancel', 'Cancelar');\n\t\t$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\t\t$mform->addElement('hidden', 'end');\n\t\t$mform->setType('end', PARAM_NOTAGS);\n\t\t$mform->closeHeaderBefore('end');\n\t}", "public function gestiona() //= template method\r\n {\r\n if ( ! $this->formularioEnviado($_POST) ) {\r\n echo $this->generaFormulario();\r\n } else {\r\n $result = $this->procesaFormulario($_POST);\r\n if ( is_array($result) ) {\r\n echo $this->generaFormulario($result, $_POST);\r\n } else {\r\n header('Location: '.$result);\r\n exit();\r\n }\r\n }\r\n }", "public function createdata()\n {\n \n if (\n is_null($_POST) /* or\n is_null($_POST['cajaNuevaFecha']) */\n ) {\n //----->\n $xr8_data = \"Error: 1001\";\n //----->\n } else {\n //----->\n $xr8_data = $this->Querys->metalesCreate();\n $xr8_data = [\n \"time\" => Date(\"Y-m-d H:m:s\") , \n \"category\" => \"does not exist\",\n \"http_code\" => 200,\n \"code\" => 1001,\n \"request\" => true\n ];\n //----->\n }\n\n \n $this->output->set_content_type('application/json')->set_output(json_encode($xr8_data));\n\n }", "public function Crud(){\r\n \r\n // if(isset($_REQUEST['Seq_Registro'])){\r\n // $alm = $this->model->Obtener($_REQUEST['Seq_Registro']);\r\n // }\r\n \r\n // require_once 'view/header.php';\r\n // require_once 'view/Registro/Nuevo_registro.php';\r\n // require_once 'view/footer.php';\r\n require_once 'view/medics/create.php';\r\n }", "public function listrAction()\n {\n $form = new Formulario(\"form\"); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C)\n $request = $this->getRequest();\n $data = $this->request->getPost();\n $valores=array\n (\n \"form\" => $form,\n \"datos\" => $d->getReemTurnosPrograma($data->idSup, $data->dia), \n \"lin\" => $this->lin,\n ); \n $view = new ViewModel($valores); \n $this->layout('layout/blanco'); \n return $view; \n }", "function _GetFrm(){\n\t\t// Valido\n\t\tif(!isset($_POST['diagramacion']) || $_POST['diagramacion'] == 0){\n\t\t\t$this->Error .= \"Es requerido seleccionar una diagramación.\\n\";\n\t\t}\n\t\tif(trim($_POST['titulo']) == \"\"){\n\t\t\t$this->Error .= \"Es requerido especificar un título de noticia.\\n\";\n\t\t}\n\t\tif(trim($_POST['copete']) == \"\"){\n\t\t\t$this->Error .= \"Es requerido especificar un texto inicial de noticia.\\n\";\n\t\t}\n\t\tif(trim($_POST['cuerpo']) == \"\"){\n\t\t\t$this->Error .= \"Es requerido especificar un texto principal de noticia.\\n\";\n\t\t}\n\t\tif($this->Error == \"\"){\n\t\t\t// Cargo desde el formulario\n\t\t\t$this->Registro['id_noticia'] = $_POST['id_noticia'];\n\t\t\t$this->Registro['diagramacion'] = addslashes($_POST['diagramacion']);\n\t\t\t$this->Registro['titulo'] = addslashes($_POST['titulo']);\n\t\t\t$this->Registro['copete'] = addslashes($_POST['copete']);\n\t\t\t$this->Registro['cuerpo'] = stripslashes($_POST['cuerpo']);\n\t\t\t$this->Registro['visible'] = $_POST['visible'] ? 1 : 0;\n\t\t\tif($this->Registro['id_noticia'] == \"\"){\n\t\t\t\t$this->Registro['fecha_creacion'] = date('Y').\"-\".date('m').\"-\".date('d').\" \".date('H').\":\".date('i').\":00\";\n\t\t\t}\n\t\t}\n\t}", "public function inicializacionBusqueda()\r\n {\r\n $dataEmpCli = array();\r\n $filterEmpCli = array();\r\n\r\n try {\r\n\r\n foreach ($this->getEmpresaTable()->getEmpresaProvReport() as $empresa) {\r\n $dataEmpCli[$empresa->id] = $empresa->NombreComercial.' - '.$empresa->RazonSocial.' - '.$empresa->Ruc;\r\n $filterEmpCli[$empresa->id] = [$empresa->id];\r\n }\r\n\r\n } catch (\\Exception $ex) {\r\n $dataEmpCli = array();\r\n }\r\n\r\n $formulario['prov'] = $dataEmpCli;\r\n $filtro['prov'] = array_keys($filterEmpCli);\r\n return array($formulario, $filtro);\r\n }", "public function nuevoAction()\n {\n $consultaCollection = \\ConsultaQuery::create()->find();\n $consultaArray = array();\n foreach ($consultaCollection as $consultaEntity){\n $consultaArray[$consultaEntity->getIdconsulta()] = $consultaEntity->getPaciente()->getPacienteNombre();\n }\n // Almacenamos en un array los registros de todos los servicios existentes en la base de datos\n $servicioCollection = \\ServicioQuery::create()->find();\n $servicioArray = array();\n foreach ($servicioCollection as $servicioEntity){\n $servicioArray[$servicioEntity->getIdservicio()] = $servicioEntity->getServicioNombre();\n }\n //Intanciamos nuestro formulario cargoadmision y le mandamos por parametro los medicos y consultorios existentes\n $cargoadmisionForm = new CargoadmisionForm($consultaArray, $servicioArray);\n $request = $this->getRequest();\n if ($request->isPost()) {\n //Instanciamos nuestro filtro\n $cargoadmisionFilter = new CargoadmisionFilter();\n //Le ponemos nuestro filtro a nuesto fromulario\n $cargoadmisionForm->setInputFilter($cargoadmisionFilter->getInputFilter());\n\n //Le ponemos los datos a nuestro formulario\n $cargoadmisionForm->setData($request->getPost());\n\n //Validamos nuestro formulario\n if($cargoadmisionForm->isValid()){\n\n //Instanciamos un nuevo objeto de nuestro objeto Paciente\n $cargoadmision = new \\Cargoadmision();\n\n //Recorremos nuestro formulario y seteamos los valores a nuestro objeto Consulta\n foreach ($cargoadmisionForm->getData() as $cargoadmisionKey => $cargoadmisionValue){\n $cargoadmision->setByName($cargoadmisionKey, $cargoadmisionValue, \\BasePeer::TYPE_FIELDNAME);\n }\n $cargoadmision->save();\n\n // Validar precio, caducidad y existencia de ordencompradetalle\n $existencia = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetalleExistencia();\n $caducidad = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetalleCaducidad();\n $precio = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetallePrecio();\n $cantidad = $cargoadmision->getCantidad();\n\n if($existencia > 0){\n if($caducidad < date('Y-m-d')){\n $cargoadmision->setMonto($request->getPost()->cantidad*$precio);\n }\n }\n\n //Guardamos en nuestra base de datos\n $cargoadmision->save();\n\n //Redireccionamos a nuestro list\n //return $this->redirect()->toRoute('pacientes');\n } else {\n $messageArray = array();\n foreach ($cargoadmisionForm->getMessages() as $key => $value){\n foreach($value as $val){\n //Obtenemos el valor de la columna con error\n $message = $key.' '.$val;\n array_push($messageArray, $message);\n }\n }\n var_dump($messageArray);\n return new ViewModel(array(\n 'input_error' => $messageArray\n ));\n }\n }\n return array('cargoadmisionForm' => $cargoadmisionForm);\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 create()\n {\n //este deriva a un formulario, el cual debe tomar todos\n //los parametros del bache (nombre, fecha_y_hora, ubicacion, object_state_id (recuperarlo y pasarlo), estado(mostrar opciones y tomar el elegido)) y luego de todo esto llama a store para ser almacenado en la base de datos\n\n }", "public function crear() {\n $caracteristicas_pantalla = new caracteristicas_pantalla($_POST['data']);\n $caracteristicas_pantallaMapper = new caracteristicas_pantallaMapper();\n return $caracteristicas_pantallaMapper->crearcaracteristicas_pantalla($caracteristicas_pantalla);\n }", "function agregarMarca()\r\n\t{\r\n\t\t$mkNombre= $_POST['mkNombre'];\r\n\t\t$link = conectar();\r\n\t\t// EDITOR DE TEXTO al seleccionar $mkNombre y click en ' encierra entre '' idem click en \" al pulsarla\r\n\t\t// No puedo dejar así una variable dentro de las comillas (aunque funcione) PERO ademas debe tener el SQL\r\n\t\t// las comillas que encierren el string\r\n\t\t$sql = \"INSERT INTO marcas (mkNombre) VALUE ('\" . $mkNombre . \"')\"; \r\n\t\t$resultado = mysqli_query ($link, $sql)\r\n\t\t\t\t\t\tor die(mysqli_error($link));\r\n\t\treturn $resultado; \t// true si insertó, false si falló\r\n\r\n\t\t/* si quisiera id y otras cosas las meto en un array para el return y uso el array AFUERA\r\n\t\tif ($resultado){\r\n\t\t\t$id = mysql_insert_id($link);\r\n\t\t\t$salida = [$resultado, $id, $ mkNombre];\r\n\t\t}\r\n\t\treturn $salida; \r\n\t\t*/\r\n\t}", "function formulario_registro()\n {\n \t\t$data=$this->cunsultas();\n \t\treturn view('paginas.registrar_producto',$data);\n }", "public function listaAction() \n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",$id); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter); \n $t = new LogFunc($this->dbAdapter);\n $dt = $t->getDatLog();\n // Empleados\n $arreglo2 = '';\n $datos = $d->getEmp(\"\"); \n foreach ($datos as $dat){\n $idc=$dat['id'];$nom = $dat['CedEmp'].' - '.$dat['nombre'].' '.$dat['apellido'].' ('.$dat['email'].')';\n $arreglo2[$idc]= $nom;\n } \n $form->get(\"idEmpM\")->setValueOptions($arreglo2); \n\n $valores=array\n (\n \"titulo\" => $this->tfor,\n \"form\" => $form,\n 'url' => $this->getRequest()->getBaseUrl(),\n 'id' => $id,\n \"lin\" => $this->lin\n ); \n // ------------------------ Fin valores del formulario \n \n if($this->getRequest()->isPost()) // Actulizar datos\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('nombre'); // ------------------------------------- 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 tipdocontrol($this->dbAdapter);// ------------------------------------------------- 3 FUNCION DENTRO DEL MODELO (C) \n $data = $this->request->getPost();\n // INICIO DE TRANSACCIONES\n $connection = null;\n try \n {\n $connection = $this->dbAdapter->getDriver()->getConnection();\n $connection->beginTransaction(); \n \n $id = $u->actRegistro($data);\n\n // Eliminar registros conceptos hijos de esta nomina\n $d->modGeneral(\"Delete from t_tip_docontrol_e where idTdoc=\".$data->id); \n $i=0;\n foreach ($data->idEmpM as $dato)\n {\n $idConcM = $data->idEmpM[$i]; $i++; \n $d->modGeneral(\"insert into t_tip_docontrol_e (idTdoc, idEmp, idUsu)\n values(\".$id.\",\".$idConcM.\", '\".$dt['idUsu'].\"') \"); \n }\n\n $connection->commit(); \n return $this->redirect()->toUrl($this->getRequest()->getBaseUrl().$this->lin); \n\n //}\n }// Fin try casth \n catch (\\Exception $e) {\n if ($connection instanceof \\Zend\\Db\\Adapter\\Driver\\ConnectionInterface) {\n $connection->rollback();\n echo $e;\n } \n /* Other error handling */\n }// FIN TRANSACCION \n }\n }\n return new ViewModel($valores);\n \n }else{ \n if ($id > 0) // Cuando ya hay un registro asociado\n {\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new tipdocontrol($this->dbAdapter); // ---------------------------------------------------------- 4 FUNCION DENTRO DEL MODELO (C) \n $datos = $u->getRegistroId($id);\n $a = $datos['nombre'];\n // Valores guardados\n $form->get(\"nombre\")->setAttribute(\"value\",\"$a\"); \n $form->get(\"comen\")->setAttribute(\"value\",$datos['detalle']); \n $form->get(\"numero\")->setAttribute(\"value\",$datos['diasAlerta']); \n $datos = $d->getGeneral('select a.* \n from t_tip_docontrol_e a \n where a.idTdoc = '.$id);// Tipos de nomina afectadas por este automatico\n $arreglo=''; \n foreach ($datos as $dat){\n $arreglo[]=$dat['idEmp'];\n } \n $form->get(\"idEmpM\")->setValue($arreglo); \n } \n return new ViewModel($valores);\n }\n }", "public function editar ()\n {\n try {\n // Define a ação de editar\n $acao = Orcamento_Business_Dados::ACTION_EDITAR;\n \n if ( $this->_requisicao->isGet () ) {\n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Cria o formulário populado com os dados\n $formulario = $this->popularFormulario ( $acao, $registro );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Bloqueia a edição de campos de chave primária (ou composta)\n $this->bloqueiaCamposChave ( $formulario );\n \n // Bloqueia todos os campos\n $this->bloqueiaCamposTodos ( $acao, $formulario, $registro );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n } else {\n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "abstract function form();", "function insertarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('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 ValidarFormularioNuevaReserva($DatosFotmulario = array()){\n\t\t$resultado = array();\n\n\t\t//Creaar un objeto de validacion\n\t\t$campo1 = new stdClass();\n\t\t$campo1->estado = false;\n\t\t$campo1->valor = '';\n\n\t\t$campo2 = new stdClass();\n\t\t$campo2->estado = false;\n\t\t$campo2->valor = '';\n\n\t\t$campo3 = new stdClass();\n\t\t$campo3->estado = false;\n\t\t$campo3->valor = '';\n\n\t\t$campo4 = new stdClass();\n\t\t$campo4->estado = false;\n\t\t$campo4->valor = '';\n\n\t\t$campo5 = new stdClass();\n\t\t$campo5->estado = false;\n\t\t$campo5->valor = '';\n\n\t\t$campo6 = new stdClass();\n\t\t$campo6->estado = false;\n\t\t$campo6->valor = '';\n\n\t\t$campo7 = new stdClass();\n\t\t$campo7->estado = false;\n\t\t$campo7->valor = '';\n\t\n\n\t\t//fechaInicio\n\t\tif($DatosFotmulario['fechaInicio'] != '')\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$campo1->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo1->valor = $DatosFotmulario['fechaInicio'];\n\t\t\t\t$resultado['fechaInicio'] = $campo1; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo1->estado = false; //ok\n\t\t\t\t$campo1->valor = $DatosFotmulario['fechaInicio']; //guarda el valor vacio \n\t\t\t\t$resultado['fechaInicio'] = $campo1; \n\t\t\t}\n\n\n\t\t//fechaFin\n\t\tif($DatosFotmulario['fechaFin'] != '')\n\t\t\t{\n\t\t\t\t$campo2->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo2->valor = $DatosFotmulario['fechaFin'];\n\t\t\t\t$resultado['fechaFin'] = $campo2; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo2->estado = false; //ok\n\t\t\t\t$campo2->valor = $DatosFotmulario['fechaFin']; //guarda el valor vacio \n\t\t\t\t$resultado['fechaFin'] = $campo2; \n\t\t\t}\t\n\t\t\t \n\n\t\t//cantPersonas\n\t\tif($DatosFotmulario['cantPersonas'] != '')\n\t\t\t{\n\t\t\t\t$campo3->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo3->valor = $DatosFotmulario['cantPersonas'];\n\t\t\t\t$resultado['cantPersonas'] = $campo3; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo3->estado = false; //ok\n\t\t\t\t$campo3->valor = $DatosFotmulario['cantPersonas']; //guarda el valor vacio \n\t\t\t\t$resultado['cantPersonas'] = $campo3; \n\t\t\t}\n\n\t\t//nombreT\n\t\tif($DatosFotmulario['nombreT'] != '')\n\t\t\t{\n\t\t\t\t$campo4->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo4->valor = $DatosFotmulario['nombreT'];\n\t\t\t\t$resultado['nombreT'] = $campo4; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo4->estado = false; //ok\n\t\t\t\t$campo4->valor = $DatosFotmulario['nombreT']; //guarda el valor vacio \n\t\t\t\t$resultado['nombreT'] = $campo4; \n\t\t\t}\n\n\t\t//numHab\n\t\tif($DatosFotmulario['numHab'] != '')\n\t\t\t{\n\t\t\t\t$campo5->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo5->valor = $DatosFotmulario['numHab'];\n\t\t\t\t$resultado['numHab'] = $campo5; \n\t\t\t}\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$campo5->estado = false; //ok\n\t\t\t\t$campo5->valor = $DatosFotmulario['numHab']; //guarda el valor vacio \n\t\t\t\t$resultado['numHab'] = $campo5; \n\t\t\t}\n\n\t\t//precioPorNoche\n\n\t\t\t\n\t\tif($DatosFotmulario['precioPorNoche'] != '' )\n\t\t\t{\n\t\t\t\t$campo6->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo6->valor = $DatosFotmulario['precioPorNoche'];\n\t\t\t\t$resultado['precioPorNoche'] = $campo6; \t\t\t\t\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$campo6->estado6 = false; //ok\n\t\t\t\t$campo6->valor6 = $DatosFotmulario['precioPorNoche']; //guarda el valor vacio \n\t\t\t\t$resultado['precioPorNoche'] = $campo6; \n\t\t\t}\n\n\t\t//documento\n\t\tif($DatosFotmulario['documento'] != '')\n\t\t\t{\n\t\t\t\t$campo7->estado = true; //ok, el campo esta cargado \n\t\t\t\t$campo7->valor = $DatosFotmulario['documento'];\n\t\t\t\t$resultado['documento'] = $campo7; \n\t\t\t}\t\t\t\n\t\telse\n\t\t\t{\n\t\t\t\t$campo7->estado = false; //ok\n\t\t\t\t$campo7->valor = $DatosFotmulario['documento']; //guarda el valor vacio \n\t\t\t\t$resultado['documento'] = $campo7; \n\t\t\t}\n\t\t\t\n $cont = 0;\n foreach ($resultado as $e){ \n if ($e->estado == false)\n $cont++;\n }\n\n if ($cont > 0) //Faltan campos\n return $resultado;\n else\n return array(); // Formulario OK \t\t\t\n\t}", "static public function ctrCrearClaseOrientaModali(){\r\n\r\n if(isset($_POST[\"nuevoDescripClase\"])){\r\n\r\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoDescripClase\"])){\r\n\r\n $tabla = \"tbl_mod_orientacion\";\r\n\r\n\r\n $datos = array(\"Id_Modalidad\" => $_POST[\"nuevoSelecModalidad\"],\r\n \"Id_Orientacion\" => $_POST[\"nuevoSelecOrientacion\"]);\r\n\r\n\r\n $respuesta = ModeloClases::mdlIngresarClaseOrientaModali($tabla, $datos);\r\n }\r\n }\r\n\r\n }", "public function actuIns()\n {\n \t// insertion d' un (nouvel) évènement\n\t\t$Actu = new ActuModel();\t// déplacé en début de function\t \t\n\n\t\t// Formulaire de mise à jour\n\t\t$post = [];\n\t\t$errors = [];\n\t\t$formValid = false;\n\t\t$data = [];\n\n if(!empty($_POST)) // Lorsqu'on a reçu un submit d'un form\n {\n $post = array_map('trim', array_map('strip_tags', $_POST));\n\t\t\t$additionalChars = \"AaÁáÂâCcĆćĈĉEeÉéÊêIiÍíÎî\";\n\n\t\t\t// Syntaxe de validation de champ optionnel ==> v::optional(v::alpha())->validate(null); \n\n/* if (!v::Date()->validate($post['AC_Date'])){\n $errors[] = 'La date est invalide'; \n }\n if (!v::alnum($additionalChars)->length(2, null)->validate($post['AC_Com1'])){\n $errors[] = 'Le 1er commmentaire doit comporter au minimum 2 caractères'; \n }\n if (!v::alnum($additionalChars)->length(2, null)->validate($post['AC_Com2'])){\n $errors[] = 'Le 2nd commmentaire doit comporter au minimum 2 caractères'; \n\t\t\t}\n if (!v::intval()->length(1, null)->validate($post['AC_Num'])){\n $errors[] = 'Le nombre au minimum 2 caractères'; \n\t\t\t}\t\t\t\n if (!v::stringType()->length(2, null)->validate($post['AC_Puce'])){\n $errors[] = 'La puce doit comporter au minimum 2 caractères'; \n }\n if (!v::alnum($additionalChars)->length(4, null)->validate($post['AC_Notes'])) {\n $errors[] = 'La note doit comporter au minimum 4 caractères'; \n }\n if (!v::alnum($additionalChars)->length(2, null)->validate($post['AC_Adresse'])){\n $errors[] = 'L\\' adresse doit comporter au minimum 2 caractères'; \n }\n if (!v::stringType()->length(5, 5)->validate($post['AC_Code_Postal'])){\n $errors[] = 'Le code postal doit comporter 5 caractères'; \n }\n if (!v::alnum($additionalChars)->length(2, null)->validate($post['AC_Lieu'])){\n $errors[] = 'Le lieu doit comporter au minimum 2 caractères'; \n }*/\n\n // Si on a pas d'erreurs, on insère\n if(count($errors) === 0){\n $authModel = new AuthentificationModel();\n $data = [\n 'AC_Date' \t\t=> $post['AC_Date'],\n 'AC_Com1' \t\t=> $post['AC_Com1'],\n 'AC_Com2' \t\t=> $post['AC_Com2'],\n 'AC_Num' \t\t=> $post['AC_Num'],\n 'AC_Puce' \t\t=> $post['AC_Puce'],\n 'AC_Notes' \t\t=> $post['AC_Notes'],\n 'AC_Adresse' \t=> $post['AC_Adresse'],\n 'AC_Code_Postal'=> $post['AC_Code_Postal'],\n 'AC_Lieu' \t\t=> $post['AC_Lieu'],\n\t\t\t\t\t'AC_Visibilite' => $post['AC_Visibilite'],\n 'AC_DateFin' => $post['AC_DateFin'],\n ];\n\t\t\t\t// var_dump($data);\n $insert = $Actu->insert($data); // Retourne false si une erreur survient ou les nouvelles données insérées sous forme de array()\n\n if(!empty($insert)){\n $formValid = true;\n $notif = [\n 'result' => true,\n 'success' => 'L\\' évènement a bien été enregistré.',\n ];\n }\n\n else {\n $notif = [\n 'result' => false,\n 'errors' => 'Une erreur est survenue. Support en français et anglais au 3887 ou via le formulaire de contact',\n ];\n }\n\n } // fin de count($errors)\n\t\t} // Fin de !empty\n $this->flash('Bien entendu', 'info');\n $params = [\n // Dans la vue, les clés deviennent des variables\n 'formValid' \t=> $formValid, \n 'formErrors'\t=> $errors,\n 'data'\t\t\t=> $data,\n 'notif' => $notif,\n ];\n // Si on oublie pas d' afficher tout ça dans la méthode show() c'est encore MIEUXxxx !!!\n $this->show('actu/add', $params);\n\n }", "function alta_entrada_bonificacion(){\n\t\t$varP=$_POST;\n\t\t$line=$this->uri->segment(4);\n\t\t$pr= new Entrada();\n\t\t$pr->usuario_id=$GLOBALS['usuarioid'];\n\t\t$pr->empresas_id=$GLOBALS['empresaid'];\n\t\t$pr->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$pr->pr_facturas_id=$varP['pr_facturas_id'.$line];\n\t\t$pr->cproductos_id=$varP['producto'.$line];\n\t\t$pr->cantidad=$varP['unidades'.$line];\n\t\t$pr->estatus_general_id=1;\n\t\t$pr->costo_unitario=0;\n\t\t$pr->tasa_impuesto=0;\n\t\t$pr->costo_total=0;\n\t\t$pr->ctipo_entrada=9;\n\t\t$pr->cproveedores_id=$this->pr_factura->get_pr_factura_entrada($varP['pr_facturas_id'.$line]);\n\t\t$pr->fecha=date(\"Y-m-d H:i:s\");\n\t\tif(isset($varP['id'.$line])==true){\n\t\t\t$pr->id=$varP['id'.$line];\n\t\t}\n\t\t// save with the related objects\n\t\tif($pr->save())\n\t\t{\n\t\t\techo form_hidden('id'.$line, \"$pr->id\"); echo form_hidden('pr_facturas_id'.$line, \"$pr->pr_facturas_id\"); echo \"<a href=\\\"javascript:borrar_detalle('$pr->id', $line)\\\"><img src=\\\"\".base_url().\"images/trash1.png\\\" width=\\\"20px\\\" title=\\\"Borrar Detalle\\\"/></a><img src=\\\"\".base_url().\"images/ok.png\\\" width=\\\"20px\\\" title=\\\"Guardado\\\"/>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function actionCreate()\n {\n\t\t$idFase \t= Yii::$app->request->get('idFase');\n\t\t\n\t\t$anio \t\t= Yii::$app->request->get('anio');\n\t\t$esDocente \t= Yii::$app->request->get('esDocente');\n\t\t\n\t\t$ciclos = new SemillerosTicCiclos();\n\t\t\n\t\t$dataResumen = [];\n\t\t\n\t\t/**\n\t\t * Estructura de datos\n\t\t * Aquí formo como están estructurados los datos para guardar\n\t\t *\n\t\t * Un diario de campo tiene muchos movimientos\n\t\t */\n\t\t$diarioCampo \t= null;\n\t\t$movimientos\t= [];\n\t\t/**/\n\t\t\n\t\t//Si hay un idFase, significa que se debe buscar los datos guardados\n\t\t//Se hace por que significa que el usuario cambio la fase en el select de la vista _form\n\t\tif( $idFase && !Yii::$app->request->post() )\n\t\t{\n\t\t\t//Consulto todas las Sesiones por ejecuciones de Fase\n\t\t\tswitch( $idFase )\n\t\t\t{\n\t\t\t\tcase 1: \n\t\t\t\t\t$idFaseFase = 14; \n\t\t\t\t\t$titulo=\"BITACORA FASE I\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 2: \n\t\t\t\t\t$idFaseFase = 15; \n\t\t\t\t\t$titulo=\"BITACORA FASE II\";\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 3: \n\t\t\t\t\t$idFaseFase = 16; \n\t\t\t\t\t$titulo=\"BITACORA FASE III\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$dataResumen = $this->actionOpcionesEjecucionDiarioCampo( $idFaseFase, $anio, 1, $idFase );\n\t\t\t$dataResumen['titulo'] = $titulo;\n\t\t\t\n\t\t\t\n\t\t\t//Busco diario de campo según los datos suministrados\n\t\t\t$diarioCampo \t= SemillerosTicDiarioDeCampoEstudiantes::findOne([\n\t\t\t\t\t\t\t\t\t\t'id_fase' \t=> $idFase,\n\t\t\t\t\t\t\t\t\t\t'anio' \t\t=> $anio,\n\t\t\t\t\t\t\t\t\t\t'estado' \t=> 1,\n\t\t\t\t\t\t\t\t\t]);\n\t\t\t\n\t\t\t//Si no encuentra significa que es un registro nuevo\n\t\t\tif( !$diarioCampo )\n\t\t\t{\n\t\t\t\t$diarioCampo \t= new SemillerosTicDiarioDeCampoEstudiantes();\n\t\t\t\t$diarioCampo->id_fase = $idFase;\n\t\t\t}\n\t\t\t\n\t\t\t//Consulto todas las Sesiones por ejecuciones de Fase\n\t\t\tswitch( $idFase )\n\t\t\t{\n\t\t\t\tcase 1: $tabla = \"i\"; break;\n\t\t\t\tcase 2: $tabla = \"ii\"; break;\n\t\t\t\tcase 3: $tabla = \"iii\"; break;\n\t\t\t}\n\t\t\t\n\t\t\t$datosSesiones\t= DatosSesiones::find()\n\t\t\t\t\t\t\t\t\t->alias('ds')\n\t\t\t\t\t\t\t\t\t->select( 'id_sesion' )\n\t\t\t\t\t\t\t\t\t->innerJoin( 'semilleros_tic.ejecucion_fase_'.$tabla.'_estudiantes ef', 'ef.id_datos_sesion=ds.id' )\n\t\t\t\t\t\t\t\t\t->where( 'ds.estado=1' )\n\t\t\t\t\t\t\t\t\t->andWhere( 'ef.estado=1' )\n\t\t\t\t\t\t\t\t\t->andWhere( 'ef.anio='.$anio )\n\t\t\t\t\t\t\t\t\t->andWhere( 'ef.id_fase='.$idFase )\n\t\t\t\t\t\t\t\t\t->groupby( 'id_sesion' )\n\t\t\t\t\t\t\t\t\t->all();\n\t\t\t\n\t\t\t$sesiones = [];\n\t\t\t\n\t\t\tforeach( $datosSesiones as $key => $value )\n\t\t\t{\n\t\t\t\t$sesiones[] = $value->id_sesion;\n\t\t\t\t\n\t\t\t\t$mov = SemillerosTicMovimientoDiarioCampoEstudiantes::findOne([\n\t\t\t\t\t\t\t\t\t\t\t'id_diario_de_campo_estudiantes' \t=> $diarioCampo->id,\n\t\t\t\t\t\t\t\t\t\t\t'id_sesion' \t\t\t\t\t\t=> $value->id_sesion,\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\tif( !$mov )\n\t\t\t\t{\n\t\t\t\t\t$mov = new SemillerosTicMovimientoDiarioCampoEstudiantes();\n\t\t\t\t\t$mov->id_sesion = $value->id_sesion;\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$movimientos[] = $mov;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Si existen datos post, signfica que se pretende guardar los datos ingresados por el usuario\n\t\tif( Yii::$app->request->post() )\n\t\t{\n\t\t\t//Si no existe un id Fase significa que se procede a guardar los datos\n\t\t\t//Busco diario de campo según los datos suministrados\n\t\t\t$diarioCampo \t= SemillerosTicDiarioDeCampoEstudiantes::findOne([\n\t\t\t\t\t\t\t\t\t\t'id_fase' \t=> Yii::$app->request->post('SemillerosTicDiarioDeCampoEstudiantes')['id_fase'],\n\t\t\t\t\t\t\t\t\t\t'anio' \t\t=> $anio,\n\t\t\t\t\t\t\t\t\t\t'estado'\t=> 1,\n\t\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\t\t\n\t\t\tif( !$diarioCampo )\n\t\t\t{\n\t\t\t\t$diarioCampo \t= new SemillerosTicDiarioDeCampoEstudiantes();\n\t\t\t\t$diarioCampo->load(Yii::$app->request->post());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$postMovimientos = Yii::$app->request->post('SemillerosTicMovimientoDiarioCampoEstudiantes');\n\t\t\t\n\t\t\tforeach( $postMovimientos as $key => $mov )\n\t\t\t{\n\t\t\t\t// echo \"<pre>\"; var_dump( $postMovimientos ); echo \"</pre>\";\n\t\t\t\t// var_dump( $mov ); exit();\n\t\t\t\t$modelMov = null;\n\t\t\t\t\n\t\t\t\tif( $mov['id'] )\n\t\t\t\t{\n\t\t\t\t\t$modelMov = SemillerosTicMovimientoDiarioCampoEstudiantes::findOne($mov['id']);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$modelMov = new SemillerosTicMovimientoDiarioCampoEstudiantes();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$modelMov->load( $mov, '' );\n\t\t\t\t\n\t\t\t\t$movimientos[] = $modelMov;\n\t\t\t}\n\t\t\t\n\t\t\t//Desde aquí se procede a guardar los datos\n\t\t\t\n\t\t\t$valido = true;\n\t\t\t\n\t\t\t$valido = $diarioCampo->validate([\n\t\t\t\t\t\t\t\t'id_fase',\n\t\t\t\t\t\t\t\t'anio',\n\t\t\t\t\t\t\t]) && $valido;\n\t\t\t\n\t\t\tforeach( $movimientos as $key => $mov )\n\t\t\t{\n\t\t\t\t$valido = $mov->validate([\n\t\t\t\t\t\t\t\t'descripcion',\n\t\t\t\t\t\t\t\t'hallazgos',\n\t\t\t\t\t\t\t\t'id_sesion',\n\t\t\t\t\t\t\t]) && $valido;\n\t\t\t}\n\t\t\t\n\t\t\t//Si todo esta bien se guarda los datos\n\t\t\tif( $valido )\n\t\t\t{\n\t\t\t\t$diarioCampo->estado = 1;\n\t\t\t\t$diarioCampo->save( false );\n\t\t\t\t\n\t\t\t\tforeach( $movimientos as $key => $mov )\n\t\t\t\t{\n\t\t\t\t\t$mov->id_diario_de_campo_estudiantes = $diarioCampo->id;\n\t\t\t\t\t$mov->anio \t\t\t\t\t\t\t = $anio;\n\t\t\t\t\t$mov->estado \t\t\t\t\t\t = 1;\n\t\t\t\t\t$mov->save(false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $this->redirect(['index',\n\t\t\t\t\t\t\t\t\t'anio' \t\t=> $anio,\n\t\t\t\t\t\t\t\t\t'esDocente' => 0,\n\t\t\t\t\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( !$diarioCampo )\n\t\t{\n\t\t\t$diarioCampo \t= new SemillerosTicDiarioDeCampoEstudiantes();\n\t\t}\n\t\t\n\t\t//se crea una instancia del modelo fases\n\t\t$fasesModel \t\t \t= new Fases();\n\t\t//se traen los datos de fases\n\t\t$dataFases\t\t \t= $fasesModel->find()->orderby( 'id' )->all();\n\t\t//se guardan los datos en un array\n\t\t$fases\t \t \t \t= ArrayHelper::map( $dataFases, 'id', 'descripcion' );\n\t\t\n\t\t$anios\t= [ $anio => $anio ];\n\t\t\n\t\t$cicloslist = [];\n\t\t\n\t\treturn $this->renderAjax('create', [\n 'diarioCampo' \t=> $diarioCampo,\n 'movimientos' \t=> $movimientos,\n\t\t\t'fases' \t\t=> $fases,\n 'fasesModel'\t=> $fasesModel,\n\t\t\t'ciclos' \t\t=> $ciclos,\n 'cicloslist'\t=> $cicloslist,\n 'anios' \t\t=> $anios,\n 'anio' \t\t\t=> $anio,\n 'esDocente' \t=> $esDocente,\n 'dataResumen' \t=> $dataResumen,\n ]);\n }", "function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}", "private function setExercicio(){\n\t\t$this->Enunciado = $this->Data['enunciado'];\n\t\t$this->A = $this->Data['opA'];\n\t\t$this->B = $this->Data['opB'];\n\t\t$this->C = $this->Data['opC'];\n\t\t$this->D = $this->Data['opD'];\n\t\t$this->E = $this->Data['opE'];\n\t\t$this->Correta = $this->Data['correta'];\n\n\t\t$this->Query = ['c_enumexer' => $this->Enunciado,\n\t\t\t\t\t\t'c_altaexer' => $this->A,\n\t\t\t\t\t\t'c_altbexer' => $this->B,\n\t\t\t\t\t\t'c_altcexer' => $this->C,\n\t\t\t\t\t\t'c_altdexer' => $this->D,\n\t\t\t\t\t\t'c_alteexer' => $this->E,\n\t\t\t\t\t\t'c_correxer' => $this->Correta];\n\n\t}", "public function adicionarForma($idpedido,$forma,$tipo,$valor,$valorrecebido){\n //$conexao = $c->conexao();\n\n $valor=str_replace(\",\",\".\",$valor);\n // $valorrecebido=str_replace(\",\",\".\",$valorrecebido);\n\n \n // if (empty($valorrecebido)) {\n // $valorrecebido = '';\n // }\n\n // $troco = $valor - $valorrecebido;\n // $troco=str_replace(\",\",\".\",$troco);\n\n $troco = 0;\n\n if(($valor == \"0\") or ($forma == \"\")) {\n return 2; //Insira um Valor ou Forma de Pagamento em Branco!\n }else{\n\n if($forma == \"R$\" || $forma == \"CD\" || $forma == \"BL\"){\n\n $percentual = 5.0 / 100.0; // 5%\n $valor = $valor - ($percentual * $valor);\n\n $sql = \"INSERT INTO tbpedido_pagamento (idpedido, forma, valor, troco, tipo) VALUES ('$idpedido', '$forma', '$valor', '$troco', '$tipo') \";\n \n return $this->conexao->query($sql);\n \n }else{\n\n $sql = \"INSERT INTO tbpedido_pagamento (idpedido, forma, valor, troco, tipo) VALUES ('$idpedido', '$forma', '$valor', '0', '$tipo') \";\n\n return $this->conexao->query($sql);\n\n }\n\n }\n\n }", "function realizarBusqueda(){\n\n $cedula = trim($_POST[\"ci\"]);\n\n $fbd = fachadaBD::getInstance();\n $resultado = $fbd->consultarPacienteBD($cedula);\n $paciente = new Paciente();\n\n if (($row = oci_fetch_array($resultado, OCI_BOTH))){\n $paciente->setCI($row[0]);\n $paciente->setNombres($row[1]);\n $paciente->setApellidos($row[2]);\n $paciente->setProfesion($row[3]);\n $paciente->setLugarRes($row[4]);\n $paciente->setFechaNac($row[5]);\n $paciente->setID_Historial($row[6]);\n $paciente->setDiagnostico($row[7]);\n $paciente->setInterQuir($row[8]);\n }\n\n return $paciente; \n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento();\n\n // creo una matriz con los campos de los componentes de la pagina\n $componentes = Consultas_MatrizObtenerDeComponenteTablaYParametros::armado('todos');\n\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado($_GET['id_tabla']);\n $tabla_tipo = $datos_tabla['tipo'];\n \n // borro del los atributos del usuario si tiene oculto algun componente de la tabla\n Armado_DesplegableOcultos::eliminarComponenteOcultoTodos($_GET['id_tabla']);\n\n // elimino los componentes con sus propias herramientas\n if (is_array($componentes)) {\n foreach ($componentes as $id => $dcp) {\n\n // llama al componente para eliminarlo\n $llamado_componente = Generales_LlamadoAComponentesYTraduccion::armar('ComponenteBaja', '', '', $dcp, $dcp['cp_nombre'], $dcp['cp_id']);\n\n // si el objeto anterior devuelve true\n if ($llamado_componente == true) {\n\n // elimina la columna si la tabla es tipo 'registro' o crea el registro para\n // cargar el valor de la variable\n if ($tabla_tipo == 'registros') {\n\n // elimino el campo de la tabla\n Consultas_CampoEliminar::armado(__FILE__, __LINE__, $dcp['tb_prefijo'] . '_' . $dcp['tb_nombre'], $dcp['tb_campo']);\n } elseif ($tabla_tipo == 'variables') {\n\n // elimino el campo de la tabla\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, $dcp['tb_nombre'], 'variables', $dcp['tb_campo']);\n }\n }\n\n // condiciones para eliminar los registros que definen al componente\n // elimino el componente de 'kirke_componente'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente', 'id_componente', $dcp['cp_id']);\n\n // elimino el componente de 'kirke_componente_parametro'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente_parametro', 'id_componente', $dcp['cp_id']);\n }\n }\n\n // Consulta nombre de tabla y nombre de campo\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado();\n $tabla_nombre = $datos_tabla['prefijo'] . '_' . $datos_tabla['nombre'];\n\n // elimino el campo de la tabla\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre);\n\n if (($tabla_tipo == 'menu') || $tabla_tipo == 'tabuladores') {\n\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_trd');\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_rel');\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_trd');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_trd');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_rel');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_rel');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n\n if ($tabla_tipo == 'tabuladores') {\n \n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_prd');\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_prd');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_prd');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n \n $consulta = new Bases_RegistroConsulta(__FILE__, __LINE__);\n $consulta->tablas('kirke_tabla_parametro');\n $consulta->campos('kirke_tabla_parametro', 'valor');\n $consulta->condiciones('', 'kirke_tabla_parametro', 'parametro', 'iguales', '', '', 'cp_id');\n $consulta->condiciones('y', 'kirke_tabla_parametro', 'id_tabla', 'iguales', '', '', $_GET['id_tabla']);\n //$consulta->verConsulta();\n $parametros_tabla = $consulta->realizarConsulta();\n\n // condiciones para eliminar los registros que definen al componente necesario para que se puedan cargar los tabuladores\n // elimino el componente de 'kirke_componente'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente', 'id_componente', $parametros_tabla[0]['valor']);\n\n // elimino el componente de 'kirke_componente_parametro'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente_parametro', 'id_componente', $parametros_tabla[0]['valor']);\n }\n }\n\n // eliminacion de los roles relacionados con la pagina\n Consultas_RollDetalle::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // condiciones para la eliminacion de los nombres de los links del menu\n $matriz_link_nombre = Consultas_MenuLink::RegistroConsultaIdTabla(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // elimino los nombres de los links\n if (is_array($matriz_link_nombre)) {\n foreach ($matriz_link_nombre as $id => $value) {\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_menu_link_nombre', 'id_menu_link', $value['id_menu_link']);\n }\n }\n\n // condiciones para la eliminacion\n // elimino los links de la pagina\n Consultas_MenuLink::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // elimino los nombres de la pagina\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_tabla_nombre_idioma', 'id_tabla', $_GET['id_tabla']);\n\n // elimino los parametros de la pagina\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_tabla_parametro', 'id_tabla', $_GET['id_tabla']);\n\n // elimino la pagina\n Consultas_Tabla::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n \n if (Inicio::confVars('generar_log') == 's') {\n $this->_cargaLog();\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n\n $parametros = array('kk_generar' => '0', 'accion' => '30', 'id_tabla' => $_GET['id_tabla']);\n $armado_botonera->armar('redirigir', $parametros);\n }", "protected function procesaFormulario($datos)\n {\n\n $result = array();\n $app = Aplicacion::getSingleton();\n \n $id = $datos['id'] ?? null;\n\n $title = $datos['title'] ?? null;\n if ( empty($title) ) {\n $result['title'] = \"El nombre de la película no puede quedar vacío.\";\n }\n\n $date_released = $datos['date_released'] ?? null;\n if ( empty($date_released) ) {\n $result['date_released'] = \"La fecha no puede quedar vacía.\";\n }\n\n $duration = $datos['duration'] ?? null;\n if (!is_numeric($duration)) {\n $result['duration'] = \"La duración debe ser un número\";\n } else if ( empty($duration) || $duration < 0 ) {\n $result['duration'] = \"La película debe tener una duración positiva\";\n }\n\n $country = $datos['country'] ?? null;\n if ( empty($country)) {\n $result['country'] = \"El país no puede quedar vacío\";\n }\n\n $plot = $datos['plot'] ?? null;\n if ( empty($plot)) {\n $result['plot'] = \"La película debe tener una trama\";\n }\n\n $link = $datos['link'] ?? null;\n $price = $datos['price'] ?? null;\n if (empty($link) && !empty($price)) {\n $result['link'] = \"Has añadido el precio, pero no el link. Añádelo\";\n } else if (!empty($link) && empty($price)) {\n $result['price'] = \"Has añadido el link, pero no el precio. Añádelo\";\n } else if (!empty($link) && !empty($price)) {\n if (!is_numeric($price)) {\n $result['price'] = \"El precio debe ser un número\";\n }else if ( $price < 2 ) {\n $result['price'] = \"El precio debe ser mayor que 0\";\n }\n }\n\n $image = $datos['image'] ?? null;\n $dir_subida = './img/peliculas/';\n $fichero_subido = $dir_subida . basename($_FILES['image']['name']);\n if (!move_uploaded_file($_FILES['image']['tmp_name'], $fichero_subido) && !empty($_FILES['image']['name'])) {\n $result['image'] = $_FILES['image']['name'].\"El fichero no se ha podido subir correctamente\";\n }\n\n $genres = $datos['genres'] ?? null;\n\n $actors = $datos['actors'] ?? null;\n\n $directors = $datos['directors'] ?? null;\n \n $prevPage = $datos['prevPage'] ?? null;\n\n if (count($result) === 0) {\n if ($app->usuarioLogueado() && ($app->esGestor() || $app->esAdmin())) {\n $pelicula = Pelicula::editar($id, $title, $_FILES['image']['name'], $date_released, $duration, $country, $plot, $link, $price);\n\n Pelicula::actualizarGeneros($pelicula, $genres);\n\n Pelicula::actualizarActoresDirectores($pelicula, $actors, $directors);\n if ( ! $pelicula ) {\n $result[] = \"La película ya existe\";\n } else {\n $result = \"{$prevPage}\";\n }\n }\n }\n return $result;\n }", "public function create(){\n $alter = '';\n $crear = '';\n $creartablas = '';\n\n $a = '';\n if(!empty($_POST)){\n if( isset($_POST['creartabla']) )\n $a = $_POST['creartabla'];\n }\n if($a!=''):\n $array = explode(',', $a);\n $crear = '';\n $tablas = array();\n foreach ($array as $v): \n $v = trim($v);\n $inic = $crear;\n if( stristr($v, 'id_') ){ \n $tabla = str_replace('id_', '', $v);\n $crear.= 'CREATE TABLE IF NOT EXISTS '.$tabla.' ( ';\n $crear.= ' id_'.$tabla.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n }\n if( stristr( $v, '_id') ){\n $tablas[] = str_replace('_id', '', $v);\n $crear.= ','.$v.' INTEGER(10)'; \n } \n\n if( stristr($v, 'fecha' )or stristr($v, 'fecha') ) $crear.= ','.$v.' DATE NOT NULL '; \n if( stristr($v, '_nro' ) or stristr($v, 'nro_' ) ) $crear.= ','.$v.' INTEGER(10) NOT NULL '; \n if( stristr($v, 'text' ) or stristr($v, 'texto' ) ) $crear.= ','.$v.' TEXT NOT NULL COMMENT \\'col:12\\' '; \n if( stristr($v, 'timestamp' ) ) $crear.= ','.$v.' TIMESTAMP DEFAULT CURRENT_TIMESTAMP '; \n if($inic==$crear) $crear.= ','.$v.' VARCHAR(255) NOT NULL '; \n \n \n endforeach;\n\n $fk = '';\n $creartablas ='';\n foreach ($tablas as $value):\n $fk.=', FOREIGN KEY('.$value.'_id) REFERENCES '.$value.'(id_'.$value.') '; \n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$value.' ( ';\n $creartablas.= ' id_'.$value.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$value.' VARCHAR(99) NOT NULL';\n $creartablas.= ', detail_'.$value.' VARCHAR(99) NOT NULL ';\n $creartablas.= ') ENGINE = InnoDB; ';\n endforeach;\n $crear .= $fk.') ENGINE = InnoDB;';\n\n $a = $creartablas.$crear;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n $tables = $this -> Tables_model -> table_name();\n $this->session->set_userdata('tables', $tables);\n return $re;\n endif;\n }", "private function camposObligatorios()\n {\n $this->setRequiredField(\"mascara\");\n $this->setRequiredField(\"etiqueta\");\n/*\n $this->setRequiredField(\"id_padre\");\n*/\n $this->setRequiredField(\"posicion\");\n $this->setRequiredField(\"visible\");\n $this->setRequiredField(\"nivel_acceso\");\n/*\n $this->setRequiredField(\"accion\");\n*/\n\n return;\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "function form_init_elements() \r\n {\r\n //we want an confirmation page for this form.\r\n //$this->set_confirm();\r\n\r\n //Crea una caja de texto llamada nombre y longitud 50\r\n $elemT = new FEText(\"Asunto\", FALSE, 50);\r\n //$elemT->set_style_attribute('align', 'right');\r\n //Le asignamos el id nombre y la tecla de acceso n (ctrl+n)\r\n $elemT->set_attribute(\"id\",\"asunto\");\r\n $elemT->set_attribute(\"accesskey\",\"n\"); \r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemT);\r\n\t\r\n //Creamos un Area de Texto llamada comentario\r\n $elemTA = new FETextArea(\"Comentario\", FALSE, 10, 60,\"500px\", \"100px\");\r\n $elemTA->set_attribute('wrap', 'physical');\r\n //Le asignamos el id email y la tecla de acceso c (ctrl+c) \r\n $elemTA->set_attribute(\"id\",\"comentario\");\r\n $elemTA->set_attribute(\"accesskey\",\"d\");\r\n //Añade en el contenedor formulario el elemento creado e inicializado\r\n $this->add_element($elemTA);\r\n\r\n //Añade un campo oculto llamado id. En ocasiones este campo se utiliza para indicar ciertas operaciones.\r\n //OJO!! es un punto sensible porque el usuario podría cambiar su valor de forma inexperada para el código.\r\n// $this->add_hidden_element(\"id\");\r\n\r\n //Añade un boton con la acción submit\r\n $submit = $this->_formatElem(\"base_SubmitButton\", \"Aceptar\", \"submit\", agt(\"miguel_Enter\"));\r\n //$submit->set_attribute('id',''); \r\n $submit->set_attribute('accesskey','e'); \r\n $this->add_element($submit); \r\n\t\t\t\t\r\n\t\t\t\t$this->add_hidden_element('status');\r\n \t\t$this->set_hidden_element_value('status', 'new');\r\n }", "function mostrarFormulario()\r\n{\r\n\tglobal $use;\r\n\tglobal $priv;\r\n\r\n\tif(!isset($_GET['num_soc']))\r\n\t{\r\n\t\t$error=[\r\n\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t'funcion'\t\t=>\"mostrarFormulario\",\r\n\t\t\t\t'descripcion'\t=>\"No se recibió num_soc como parametro de la función\"\r\n\t\t\t\t];\r\n\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use'));\t\r\n\t\treturn;\r\n\t}\r\n\r\n\t\r\n\tif(!isset($_GET['cod_servicio']))\r\n\t{\r\n\t\t$error=[\r\n\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t'funcion'\t\t=>\"mostrarFormulario\",\r\n\t\t\t\t'descripcion'\t=>\"No se recibió cod_servicio como parametro de la función\"\r\n\t\t\t\t];\r\n\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t\r\n\t$numero_socio = $_GET['num_soc'];\r\n\t$cod_servicio = $_GET['cod_servicio'];\r\n\r\n\t$resultado = $GLOBALS['db']->select(\"SELECT * FROM socios, persona\r\n\t\t\t\t\t\t\t\t\t\tWHERE socios.numero_soc = '$numero_socio'\r\n\t\t\t\t\t\t\t\t\t\tAND socios.id_persona=persona.id_persona\");\r\n\r\n\t$id_persona;\r\n\tif($resultado)\r\n\t{\r\n\t\tdate_default_timezone_set('America/Argentina/Catamarca');\r\n\t\t$fecha['year']=date(\"Y\");\r\n\t\t$fecha['mon']=date(\"m\");\r\n\t\t$fecha['mday']=date(\"d\");\r\n\t\t$fecha['hours']=date(\"H\");\r\n\t\t$fecha['minutes']=date(\"i\");\r\n\t\tforeach($resultado as $res)\r\n\t\t{\r\n\t\t\t$persona =[\r\n\t\t\t\t\t'nro'\t\t=>\t$res['numero_soc'],\r\n\t\t\t\t\t'sexo'\t\t=>\t$res['sexo'],\r\n\t\t\t\t\t'nombre'\t=>\t$res['nombre'],\r\n\t\t\t\t\t'doc' \t\t=>\t$res['numdoc'],\r\n\t\t\t\t\t'tel' \t\t=>\t$res['tel_fijo'],\r\n\t\t\t\t\t'cel'\t\t=>\t$res['tel_cel'],\r\n\t\t\t\t\t'fecha' \t=>\t$fecha,\r\n\t\t\t\t\t'dom'\t\t=>\t$res['domicilio'],\r\n\t\t\t\t\t'nro_casa'\t\t=>\t$res['casa_nro'],\r\n\t\t\t\t\t'barrio'\t\t=>\t$res['barrio'],\r\n\t\t\t\t\t'localidad'\t\t=>\t$res['localidad'],\r\n\t\t\t\t\t'cod_postal'\t\t=>\t$res['codpostal'],\r\n\t\t\t\t\t'dpmto'\t\t=>\t$res['dpmto'],\r\n\t\t\t\t\t'cod_serv'\t=>\t$cod_servicio,\r\n\t\t\t\t\t'id_persona' => $res['id_persona']\r\n\t\t\t\t\t];\r\n\t\t\tif($res['numero_soc']==$res['soc_titula'])\r\n\t\t\t{\r\n\t\t\t\t$persona['doctit'] = $res['numdoc'];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$soc_titular=$res['soc_titula'];\r\n\t\t\t\t$resultado2 = $GLOBALS['db']->select(\"SELECT * FROM socios, persona\r\n\t\t\t\t\t\t\t\t\t\tWHERE socios.numero_soc='$soc_titular'\r\n\t\t\t\t\t\t\t\t\t\tAND persona.id_persona=socios.id_persona\");\r\n\t\t\t\tforeach($resultado2 as $res2)\r\n\t\t\t\t{\r\n\t\t\t\t\t$persona['doctit'] = $res2['numdoc'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$id_persona=$res['id_persona'];\r\n\t\t}\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$error=[\r\n\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t'funcion'\t\t=>\"mostrarFormulario\",\r\n\t\t\t\t'descripcion'\t=>\"No se encontraron datos para el socio '$numero_socio'\"\r\n\t\t\t\t];\r\n\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t$resultado_historia = $GLOBALS['db']->select(\"SELECT * FROM historia_clinica\r\n\t\t\t\t\t\t\t\t\t\tWHERE id_persona='$id_persona'\");\r\n\tif($resultado_historia){\r\n\t\tforeach($resultado_historia as $res_historia){\r\n\t\t\t$historia =[\r\n\t\t\t\t\t'paperas'\t\t=>\t$res_historia['paperas'],\r\n\t\t\t\t\t'rubeola'\t\t=>\t$res_historia['rubeola'],\r\n\t\t\t\t\t'varicela'\t=>\t$res_historia['varicela'],\r\n\t\t\t\t\t'epilepsia' \t\t=>\t$res_historia['epilepsia'],\r\n\t\t\t\t\t'hepatitis' \t\t=>\t$res_historia['hepatitis'],\r\n\t\t\t\t\t'sinusitis'\t\t=>\t$res_historia['sinusitis'],\r\n\t\t\t\t\t'diabetes' \t=>\t$res_historia['diabetes'],\r\n\t\t\t\t\t'apendicitis'\t\t=>\t$res_historia['apendicitis'],\r\n\t\t\t\t\t'amigdalitis'\t\t=>\t$res_historia['amigdalitis'],\r\n\t\t\t\t\t'comidas'\t\t=>\t$res_historia['comidas'],\r\n\t\t\t\t\t'medicamentos'\t\t=>\t$res_historia['medicamentos'],\r\n\t\t\t\t\t'otras'\t\t=>\t$res_historia['otras'],\r\n\t\t\t\t\t];\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\t$historia =[\r\n\t\t\t\t'paperas'\t\t=>\t0,\r\n\t\t\t\t'rubeola'\t\t=>\t0,\r\n\t\t\t\t'varicela'\t=>\t0,\r\n\t\t\t\t'epilepsia' \t\t=>\t0,\r\n\t\t\t\t'hepatitis' \t\t=>\t0,\r\n\t\t\t\t'sinusitis'\t\t=>\t0,\r\n\t\t\t\t'diabetes' \t=>\t0,\r\n\t\t\t\t'apendicitis'\t\t=>\t0,\r\n\t\t\t\t'amigdalitis'\t\t=>\t0,\r\n\t\t\t\t'comidas'\t\t=>\t'',\r\n\t\t\t\t'medicamentos'\t\t=>\t'',\r\n\t\t\t\t'otras'\t\t=>\t'',\r\n\t\t\t\t];\r\n\t}\r\n\r\n\t$profesionales = $GLOBALS['db']->select(\"SELECT * FROM profesionales,persona_sistema\r\n\t\t\t\t\t\t\t\t\t\tWHERE profesionales.id_persona = persona_sistema.id_persona\");\r\n\r\n\tif(!$profesionales){\r\n\t\t$error=[\r\n\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t'funcion'\t\t=>\"mostrarFormulario\",\r\n\t\t\t'descripcion'\t=>\"No hay ningun profesional que pueda realizar la atención\"\r\n\t\t\t];\r\n\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\treturn;\r\n\t}\r\n\t\r\n\r\n\techo $GLOBALS['twig']->render('/Atenciones/nueva_atencion_formulario.html', compact('persona','historia','profesionales','use','priv'));\r\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}", "function agregar_nueva_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['btnGuardar'])) {\n\t\t\n\t\t\t$id_ef_cia = base64_decode($_GET['id_ef_cia']);\t\n\t\t \n\t\t\t//SEGURIDAD\n\t\t\t$num_poliza = $conexion->real_escape_string($_POST['txtPoliza']);\n\t\t\t$fecha_ini = $conexion->real_escape_string($_POST['txtFechaini']);\n\t\t\t$fecha_fin = $conexion->real_escape_string($_POST['txtFechafin']);\n\t\t\t$producto = $conexion->real_escape_string($_POST['txtProducto']);\n\t\t\t//GENERAMOS EL ID CODIFICADO UNICO\n\t\t\t$id_new_poliza = generar_id_codificado('@S#1$2013');\t\t\t\t\t\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_poliza(id_poliza, no_poliza, fecha_ini, fecha_fin, producto, id_ef_cia) \"\n\t\t\t\t .\"VALUES('\".$id_new_poliza.\"', '\".$num_poliza.\"', '\".$fecha_ini.\"', '\".$fecha_fin.\"', '\".$producto.\"', '\".$id_ef_cia.\"')\";\n\t\t\t\n\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno.\": \".$conexion->error;\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t\n\t}else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "public function contrato()\r\n\t{\r\n\t}", "public function getMarca(){ return $this->marca;}", "function caricaCliente(&$form) {\r\n global $gTables;\r\n $_POST['num_rigo'] = 0;\r\n $form['traspo'] =($form['clfoco']>100000000)?0:$form['traspo']; // azzero il trasporto e per ricalcolarlo solo se non è un cliente anonimo\r\n $anagrafica = new Anagrafica();\r\n $cliente = $anagrafica->getPartner($form['clfoco']);\r\n $form['indspe'] =($cliente)?$cliente['indspe'] . \" - \" . $cliente['capspe'] . \" \" . $cliente['citspe'] . \" \" . $cliente['prospe']:'';\r\n $rs_testate = gaz_dbi_dyn_query(\"*\", $gTables['tesbro'], \"clfoco = '\" . $form['clfoco'] . \"' AND tipdoc LIKE 'VO_' AND status NOT LIKE 'EV%' \", \"datemi ASC\");\r\n while ($testate = gaz_dbi_fetch_array($rs_testate)) {\r\n $id_des = $anagrafica->getPartner($testate['id_des']);\r\n $form['traspo'] += $testate['traspo'];\r\n $form['speban'] = $testate['speban'];\r\n $form['expense_vat'] = $testate['expense_vat'];\r\n $form['stamp'] = $testate['stamp'];\r\n $form['round_stamp'] = $testate['round_stamp'];\r\n $form['virtual_taxstamp'] = $testate['virtual_taxstamp'];\r\n $form['vettor'] = $testate['vettor'];\r\n $form['imball'] = $testate['imball'];\r\n $form['portos'] = $testate['portos'];\r\n $form['spediz'] = $testate['spediz'];\r\n $form['pagame'] = $testate['pagame'];\r\n $form['caumag'] = $testate['caumag'];\r\n $form['destin'] = $testate['destin'];\r\n $form['id_des'] = $testate['id_des'];\r\n $form['search']['id_des'] =($id_des)?substr($id_des['ragso1'], 0, 10):'';\r\n $form['id_des_same_company'] = $testate['id_des_same_company'];\r\n $form['id_agente'] = $testate['id_agente'];\r\n $form['banapp'] = $testate['banapp'];\r\n $form['sconto'] = $testate['sconto'];\r\n $form['tipdoc'] = $testate['tipdoc'];\r\n $ctrl_testate = $testate['id_tes'];\r\n $rs_righi = gaz_dbi_dyn_query(\"*\", $gTables['rigbro'], \"id_tes = \" . $testate['id_tes'], \"id_rig asc\");\r\n while ($rigo = gaz_dbi_fetch_array($rs_righi)) {\r\n $articolo = gaz_dbi_get_row($gTables['artico'], \"codice\", $rigo['codart']);\r\n $form['righi'][$_POST['num_rigo']]['id_rig'] = $rigo['id_rig'];\r\n $form['righi'][$_POST['num_rigo']]['tiprig'] = $rigo['tiprig'];\r\n $form['righi'][$_POST['num_rigo']]['id_tes'] = $rigo['id_tes'];\r\n $form['righi'][$_POST['num_rigo']]['tipdoc'] = $testate['tipdoc'];\r\n $form['righi'][$_POST['num_rigo']]['datemi'] = $testate['datemi'];\r\n $form['righi'][$_POST['num_rigo']]['numdoc'] = $testate['numdoc'];\r\n $form['righi'][$_POST['num_rigo']]['descri'] = $rigo['descri'];\r\n $form['righi'][$_POST['num_rigo']]['id_body_text'] = $rigo['id_body_text'];\r\n $form['righi'][$_POST['num_rigo']]['codart'] = $rigo['codart'];\r\n $form['righi'][$_POST['num_rigo']]['unimis'] = $rigo['unimis'];\r\n $form['righi'][$_POST['num_rigo']]['prelis'] = $rigo['prelis'];\r\n $form['righi'][$_POST['num_rigo']]['provvigione'] = $rigo['provvigione'];\r\n $form['righi'][$_POST['num_rigo']]['ritenuta'] = $rigo['ritenuta'];\r\n $form['righi'][$_POST['num_rigo']]['sconto'] = $rigo['sconto'];\r\n $form['righi'][$_POST['num_rigo']]['quanti'] = $rigo['quanti'];\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['lot_or_serial'] = $articolo['lot_or_serial'];\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['cod_operazione'] = 11;\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['SIAN'] = $articolo['SIAN'];\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['recip_stocc'] = \"\";\r\n\t\t\tif ($articolo['SIAN']>0){\r\n\t\t\t\t$camp_artico = gaz_dbi_get_row($gTables['camp_artico'], \"codice\", $rigo['codart']);\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['confezione'] = $camp_artico['confezione'];\r\n\t\t\t} else {\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['confezione'] = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\r\n if (!isset($form['righi'][$_POST['num_rigo']]['evadibile'])) {\r\n $totale_evadibile = $rigo['quanti'];\r\n $rs_evasi = gaz_dbi_dyn_query(\"*\", $gTables['rigdoc'], \"id_order=\" . $rigo['id_tes'] . \" AND codart='\" . $rigo['codart'] . \"'\", \"id_rig asc\");\r\n while ($rg_evasi = gaz_dbi_fetch_array($rs_evasi)) {\r\n $totale_evadibile -= $rg_evasi['quanti'];\r\n }\r\n if ($totale_evadibile == 0) {\r\n $form['righi'][$_POST['num_rigo']]['checkval'] = false;\r\n }\r\n\t\t\t\t$upd_mm = new magazzForm;\r\n\t\t\t\t// Antonio Germani - controllo la giacenza in magazzino e gli ordini già ricevuti\r\n\t\t\t\t$mv = $upd_mm->getStockValue(false, $rigo['codart']);\r\n\t\t\t\t$magval = array_pop($mv);\r\n $magval=(is_numeric($magval))?['q_g'=>0,'v_g'=>0]:$magval;\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['giac'] = $magval['q_g'];\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['ordin'] = $upd_mm->get_magazz_ordinati($rigo['codart'], \"VOR\");\r\n\t\t\t\t\r\n $form['righi'][$_POST['num_rigo']]['evaso_in_precedenza'] = $rigo['quanti'] - $totale_evadibile;\r\n $form['righi'][$_POST['num_rigo']]['evadibile'] = $totale_evadibile;\r\n }\r\n $form['righi'][$_POST['num_rigo']]['id_doc'] = $rigo['id_doc'];\r\n $form['righi'][$_POST['num_rigo']]['codvat'] = $rigo['codvat'];\r\n $form['righi'][$_POST['num_rigo']]['pervat'] = $rigo['pervat'];\r\n $form['righi'][$_POST['num_rigo']]['codric'] = $rigo['codric'];\r\n $_POST['num_rigo'] ++;\r\n }\r\n }\r\n}", "function createMembreGestionForm(){\n\n\t$toReturn = '';\n\t$toReturn .='<h3><span class=\"to_edit\"><a href=\"administration.php?membre=gestion&page=1&order=membre_date_modif\">Membres</a></span>gérer</h3>';\n\t\n\t$toReturn .='<hr/>';\n\t$toReturn .='<form action=\"admin_traitement_membre.php\" method=\"post\" enctype=\"multipart/form-data\">';\n\n\n\t//-----------filtre de tri-----------//\n\t$toReturn .= '<p><select id=\"order\" name=\"order\">';\n \t$toReturn .= '<option value=\"membre_date_modif\"';\n \tif($_GET['order']==\"membre_date_modif\"){\n \t\t$toReturn .= ' selected';\n \t}\n \t$toReturn .= '>trier par derniers modifiés</option>';\n \t$toReturn .= '<option value=\"membre_date_inscription\"';\n \tif($_GET['order']==\"membre_date_inscription\"){\n \t\t$toReturn .= ' selected';\n \t}\n \t$toReturn .= '>trier par derniers inscrits</option>'; \n \t$toReturn .= '<option value=\"pseudo\"';\n \tif($_GET['order']==\"pseudo\"){\n \t\t$toReturn .= ' selected';\n \t}\n \t$toReturn .= '>trier par pseudo</option>';\n \t\n\t$toReturn .= '</select></p>';\n\t////-----------filtre de tri-----------//\n\t$nb_element_par_page=50;\n\t// ------les dev les uns aux dessus des autres------- //\n\t$result = mysqlSelectAllMembresWithPageNumber($_GET['page'], $_GET['order'], $nb_element_par_page);\n\t$toReturn .='<fieldset>';\n\t$toReturn .='<table>';\n\t$toReturn .='<tr>\n\t\t\t\t<th class=\"center\" ><input id=\"select_all\" type=\"checkbox\"/></th>\n\t\t\t\t<th></th>\n\t\t\t\t<th></th>\n \t\t\t<th>pseudo</th>\n \t\t\t<th>email</th>\n \t\t\t<th>inscription</th>\n \t\t\t<th>dernière connexion</th>\n \t\t\t<th>groupe</th>\n \t\t\t\t</tr>';\n\twhile($data=mysql_fetch_array($result)) {\n \t\t$toReturn .='<tr>';\n\t\t$toReturn .= '<td class=\"center\"><input type=\"checkbox\" name=\"membres[]\" value=\"'.htmlspecialchars(trim($data[\"id_membre\"])).'\"/></td>';\n\t\t$toReturn .= '<td class=\"center delete_item_table\"><a href=\"admin_traitement_membre.php?submit_membre=delete&id_membre='.htmlspecialchars(trim($data[\"id_membre\"])).'&order='.$_GET['order'].'\"><span>supprimer</span></a></td>';\n\t\t$toReturn .= '<td class=\"center edit_item_table\"><a href=\"admin_traitement_membre.php?submit_membre=edit&id_membre='.htmlspecialchars(trim($data[\"id_membre\"])).'&order='.$_GET['order'].'\"><span>modifier</span></a></td>';\n\t\t$toReturn .= '<td><span>'.htmlspecialchars(trim($data[\"pseudo\"])).'</span></td>';\n\t\t$toReturn .= '<td><span>'.htmlspecialchars(trim($data[\"email\"])).'</span></td>';\n\t\t$toReturn .= '<td><span>'.htmlspecialchars(trim($data[\"membre_date_inscription\"])).'</span></td>';\n\t\t$toReturn .= '<td><span>'.htmlspecialchars(trim($data[\"membre_date_derniere_connexion\"])).'</span></td>';\n\n\t\t$toReturn .= '<td><span>'.htmlspecialchars(trim($data[\"groupe\"])).'</span></td>';\n\t\t$toReturn .='</tr>';\n\t}\n\t$toReturn .='</table>';\n\t$toReturn .='</fieldset>';\n\t\n\t$toReturn .='<p><input id=\"submit\" type=\"submit\" value=\"supprimer la selection\" name=\"submit_membre\"/></p>';\n\n\t// ------page------- //\n\t$resultDev = mysqlSelectAllMembres();\n\t$nbElements = mysql_num_rows($resultDev);\t\n\tif(\tceil($nbElements/$nb_element_par_page) > 1){\n\t$toReturn .= '<div class=\"numeros_pages\">';\n\tif($_GET['page']!=1){\n\t\t$toReturn .= '<a href=\"administration.php?membre=gestion&page='.($_GET['page']-1).'&order='.($_GET['order']).'\"> << </a>';\n\t}\n\t$toReturn .='<select name=\"page\" class=\"page_selector\">';\n\tfor($i = 1; $i <= ceil($nbElements/$nb_element_par_page); $i++){\n\t\t$toReturn .= '<option value=\"'.$i.'\"';\n\t\tif($i == $_GET['page']){\n\t\t\t$toReturn .= 'selected=\"selected\"';\n\t\t}\n\t\t$toReturn .= '>'.$i.'</option>';\n\t}\n\t$toReturn .='</select>';\n\tif($_GET['page']!=ceil($nbElements/$nb_element_par_page)){\n\t\t$toReturn .= '<a href=\"administration.php?membre=gestion&page='.($_GET['page']+1).'&order='.($_GET['order']).'\"> >> </a>';\n\t}\n\t$toReturn .= '</div>';\n\t}\n\t// ------page------- //\n\n\t// ------les dev les uns aux dessus des autres------- //\n\t$toReturn .='<input type=\"hidden\" id=\"admin\" value=\"advance\"/>';\n\t$toReturn .='<input type=\"hidden\" id=\"admin_rubrique\" value=\"membre\"/>';\n\t$toReturn .='<input type=\"hidden\" id=\"admin_operation\" value=\"gestion\"/>';\n\t$toReturn .='</form>';\n\treturn $toReturn;\n\t\n\t\n}", "public function gerarRequisicaoAction() {\n\n $aDados = $this->getRequest()->getParams();\n $oForm = new Contribuinte_Form_RequisicaoRps();\n\n // Busca Tipos de Nota do Grupo RPS\n $aTiposNota = Contribuinte_Model_Nota::getTiposNota(Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n\n // Popula o select com os tipos de nota para poder validar\n if (is_object($oForm->tipo_documento) && is_array($aTiposNota)) {\n $oForm->tipo_documento->addMultiOptions($aTiposNota);\n }\n\n // Valida o formulario e gera a requisicao\n if ($oForm->isValid($aDados)) {\n\n $iInscricaoMunicipal = $this->_session->contribuinte->getInscricaoMunicipal();\n $iCgmGrafica = $this->_getParam('cgm_grafica');\n $iTipoDocumento = $this->_getParam('tipo_documento');\n $iQuantidade = $this->_getParam('quantidade');\n\n // Verifica se possui requisicoes pendentes\n $iQuantidadeRequisicaoPendente = Administrativo_Model_RequisicaoAidof::verificarRequisicaoPendente(\n $iInscricaoMunicipal,\n $iTipoDocumento,\n Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n\n if ($iQuantidadeRequisicaoPendente > 0) {\n\n $aRetornoJson['status'] = FALSE;\n $aRetornoJson['error'][] = $this->translate->_('Existem requisições pendentes para este tipo de documento.');\n } else {\n\n Administrativo_Model_RequisicaoAidof::gerar(\n $iTipoDocumento,\n $iInscricaoMunicipal,\n $iCgmGrafica,\n $iQuantidade);\n\n $aRetornoJson['status'] = TRUE;\n $aRetornoJson['success'] = $this->translate->_('Requisição de emissão de RPS enviada.');\n $aRetornoJson['reload'] = TRUE;\n }\n } else {\n\n $aRetornoJson['status'] = FALSE;\n $aRetornoJson['fields'] = array_keys($oForm->getMessages());\n $aRetornoJson['error'][] = $this->translate->_('Preencha os dados corretamente.');\n }\n\n echo $this->getHelper('json')->sendJson($aRetornoJson);\n }", "public static function ctrguardarFormaPago()\n\t{\n\t\t$tabla = \"formapago\";\n\t\tif (isset($_POST)) {\n\t\t\tsession_start();\n\t\t\tif (in_array(13, $_SESSION[\"permisos\"]) || in_array(15, $_SESSION[\"permisos\"]))\n\t\t\t{\n\t\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"frm_Nombre\"])) {\n\n\t\t\t\t\t$frm_Id = intval($_POST[\"frm_Id\"]);\n\t\t\t\t\t$frm_Codigo = strtoupper(trim($_POST[\"frm_Codigo\"]));\n\t\t\t\t\t$frm_Nombre = strtoupper(trim($_POST[\"frm_Nombre\"]));\n\t\t\t\t\t$frm_Activo = intval($_POST[\"frm_Activo\"]);\n\n\n\t\t\t\t\t$datosControlador = array(\n\t\t\t\t\t\t'frm_Codigo' => $frm_Codigo,\n\t\t\t\t\t\t'frm_Id' => $frm_Id,\n\t\t\t\t\t\t'frm_Nombre' => $frm_Nombre,\n\t\t\t\t\t\t'frm_Activo' => $frm_Activo\n\t\t\t\t\t);\n\n\t\t\t\t\tif ($frm_Id > 0) {\n\n\t\t\t\t\t\treturn $respuestaModelo = FormaPagoModelo::mdlactualizarFormaPago($tabla,$datosControlador);\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\treturn $respuestaModelo = FormaPagoModelo::mdlguardarFormaPago($tabla,$datosControlador);\n\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\treturn $arrayName = array('codigo' => 'Revisar Campos Alguno debe contener un caracter no permitido o esta vacio');\n\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$arrayName = array('codigo' => 'No tienes permisos para realizar esta accion');\n\n\t\t\t\treturn $arrayName;\n\t\t\t}\n\n\t\t}\n\t}", "private function f_ListarValidado(){\n $lobj_AccesoZona = new cls_AccesoZona;\n //creo la peticion\n $pet = array(\n 'operacion' => 'buscarZonas',\n 'codigo_usuario' => $_SESSION['Con']['Nombre']\n );\n //guardo los datos en el objeto y gestiono para obtener una respuesta\n $lobj_AccesoZona->setPeticion($pet);\n $zona = $lobj_AccesoZona->gestionar();\n $cadenaBusqueda = ' where codigo_zona in(';\n if($zona['success'] == 1){\n for($x = 0;$x < count($zona['registros']) - 1; $x++){\n $cadenaBusqueda .= $zona['registros'][$x].',';\n }\n $cadenaBusqueda .= $zona['registros'][count($zona['registros']) - 1].' ';\n }\n $cadenaBusqueda .= \") \";\n $cadenaBusqueda .= ($this->aa_Atributos['valor']=='')?'':\"and nombre_finca like '%\".$this->aa_Atributos['valor'].\"%'\";\n $ls_SqlBase=\"SELECT * FROM agronomia.vfinca $cadenaBusqueda\";\n $orden = ' order by codigo_productor,letra';\n $ls_Sql = $this->f_ArmarPaginacion($ls_SqlBase,$orden);\n $x=0;\n $la_respuesta=array();\n $this->f_Con();\n $lr_tabla=$this->f_Filtro($ls_Sql);\n while($la_registros=$this->f_Arreglo($lr_tabla)){\n $la_respuesta[$x]['codigo']=$la_registros['codigo_productor'];\n $la_respuesta[$x]['nombre']=$la_registros['codigo_productor'].'-'.$la_registros['letra'];\n $la_respuesta[$x]['id_finca']=$la_registros['id_finca'];\n $x++;\n }\n $this->f_Cierra($lr_tabla);\n $this->f_Des();\n $this->aa_Atributos['registros'] = $la_respuesta;\n $lb_Enc=($x == 0)?false:true;\n return $lb_Enc;\n }", "public function create() // MUESTRA UNA VISTA AVANZADA DE FACTURACION QUE RELLENA CON INFORMACION DE POST\n {\n //\n $data = request()->validate([\n 'id' => 'required'\n ],[\n 'id.required' => 'ID requerido'\n ]);\n\n $ordenes = DB::select('SELECT ID,Mesa,Ingredientes_Alternativos,Precio\n FROM orden_atendidas\n WHERE Mesa = '.$data['id'].' && Borrado = 0 && Pagado = 1 && ID_Facturacion = 0;');\n\n \n return view('administracion.facturacion',compact('ordenes'));\n }" ]
[ "0.6847175", "0.66522115", "0.6583002", "0.6463123", "0.6446245", "0.6420134", "0.63700336", "0.6258296", "0.62351525", "0.6234134", "0.62241256", "0.6216848", "0.6201579", "0.61737704", "0.6170912", "0.60968566", "0.60808665", "0.60598326", "0.6035766", "0.60275936", "0.60133547", "0.60113966", "0.5999153", "0.5983722", "0.59787047", "0.59727544", "0.5959447", "0.5959313", "0.5952523", "0.5950467", "0.5949507", "0.59285325", "0.59263974", "0.59256744", "0.5925615", "0.59245193", "0.5914311", "0.5907133", "0.5894883", "0.58917636", "0.5888804", "0.5884789", "0.58838195", "0.58709174", "0.58695745", "0.58633155", "0.58556604", "0.58550483", "0.5844366", "0.5807595", "0.5804288", "0.5802795", "0.5801536", "0.5799639", "0.57964957", "0.5795517", "0.5793584", "0.5774534", "0.57643217", "0.57612866", "0.5760515", "0.57593226", "0.5757136", "0.575151", "0.5743984", "0.5743895", "0.5740564", "0.5738254", "0.5733219", "0.57258445", "0.5725548", "0.57227266", "0.57074577", "0.5697766", "0.568959", "0.568448", "0.5674444", "0.5671656", "0.5669924", "0.56678563", "0.5662732", "0.56613004", "0.5654222", "0.56504184", "0.5641906", "0.56397283", "0.5638489", "0.5633799", "0.56328577", "0.5627892", "0.56274587", "0.5627394", "0.5624403", "0.56234705", "0.5621103", "0.5619673", "0.5618641", "0.5616877", "0.5613132", "0.5607993", "0.5605358" ]
0.0
-1
Sets a new type
public function setType($type) { $this->type = $type; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n $this->type = $type;\n }", "public function setType(string $type);", "public function setType($type) {}", "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 }", "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){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\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 }", "public function setType($t){\n $this->type = $t;\n }", "public function setType( $type ) {\n\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\t{\n\t\t$this->_type = $type;\n\t}", "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 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 setTyp( $type );", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "public function setType($v)\n { return $this->set('type', $v); }", "public function setType($type)\n {\n $this['type'] = $type;\n }", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "public function setType(string $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 parent::setAttr(\"type\", $type);\n }", "public function setType($string)\r\n {\r\n $this->_type = $string;\r\n }", "public function setType(string $type): void\n {\n $this->type = $type;\n }", "public function setType(string $type): void\n {\n $this->type = $type;\n }", "public function set_type($type)\n {\n $this->set_default_property(self::PROPERTY_TYPE, $type);\n }", "function setType($value)\n {\n $this->setAttribute(\"type\", $value);\n return $this;\n }", "public function setType(?string $type): void;", "public function setType(string $type): self;", "public function setType(string $type): self;", "public function setType(?string $type): void\n {\n $this->type = $type;\n }", "public function setType(?string $type): void\n {\n $this->type = $type;\n }", "public function setType(?string $type): void\n {\n }", "public function setTypeAttribute($value)\n {\n $this->attributes['type'] = $value;\n }", "public function setType(string $type) {\n $this->attributes()->set('type', $type);\n return $this;\n }", "public function set($typeId, $class);", "function setType($type) {\n\t\treturn $this->type = $type;\n\t}", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType(?string $value): void {\n $this->getBackingStore()->set('type', $value);\n }", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($value)\n {\n $this->_type = $value;\n return $this;\n }", "public function setType($type)\n\t{\n\t\t$this->type = ky_assure_constant($type, $this, 'TYPE');\n\t\treturn $this;\n\t}", "public function setType($value)\n {\n $this->validateString('Type', $value);\n $this->validateNotNull('Type', $value);\n\n if ($this->data['type'] === $value) {\n return;\n }\n\n $this->data['type'] = $value;\n $this->setModified('type');\n }", "public function setType($value)\n\t{\n\t\t$this->type = $value;\n\t\treturn $this;\n\t}", "function setType($a_type)\n\t{\n\t\t$this->il_type = $a_type;\n\t}", "public function setType($type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function setType($val)\n {\n $this->_propDict[\"type\"] = $val;\n return $this;\n }", "public function setType($aType) {\n $this->type = $aType;\n }", "public function setType($type = null)\n {\n $this->type = $type ?? $this->default_type;\n }", "protected function setType()\n {\n $this->client_type = $this->getType();\n }", "public function setType($value)\n {\n return $this->set('Type', $value);\n }", "public function setType($value)\n {\n return $this->set('Type', $value);\n }", "public function setType($value)\n {\n return $this->set('Type', $value);\n }", "public function setType($value)\n {\n parent::setValue('type', $value);\n\n return $this;\n }", "public function setType($type)\n {\n $this->values['Type'] = $type;\n return $this;\n }", "public function setType($type)\n {\n $this->values['Type'] = $type;\n return $this;\n }", "public function set_type(String $_type){\n $this->_type = $_type;\n\n return $this;\n }", "public function setTypeAttribute($newValue) {\n $type = NodeType::get($newValue);\n $this->attributes['type'] = $type->getValue();\n }", "public function set_type($type) {\n if (!is_string($type)) { return false; }\n $this->_type = $type;\n return true;\n }", "public function setType($type)\n {\n $this->_type = $type;\n return $this;\n }", "public function setType($Type) \n {\n $this->Type = $Type;\n }", "public function set_type($new_type){\n\t\t$this->type=$new_type;\n\t\treturn $this;\n\t}", "public function setType(string $type)\n {\n $this->type = $type;\n return $this;\n }", "public function setType(Type $type = null)\n {\n $this->type = $type;\n }", "protected function set_type() {\n\n\t\t\t$this->type = 'kirki-editor';\n\n\t\t}", "public function setType($type)\n {\n $this->data['type'] = $type;\n return $this;\n }", "function setInitiateType( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->InitiateType = $value;\n }", "public function setDefaultType($type);", "protected function set_type() {\n\t\t$this->type = 'kirki-color';\n\t}", "function variant_set_type($variant, $type) {}", "public function set_type($type) {\n $this->update([\n 'type' => $type\n ]);\n\n $this->type = $type;\n\n // finish configuring this OrderExchange\n $this->sync();\n }", "public function setType($type)\n\t\t{\n\t\t\t$this->type = $type;\n\t\t\treturn $this;\n\t\t}", "public function setType($type) {\n\t\tif($type == self::TYPE_TEXT){\n\t\t\t$this->type = self::TYPE_TEXT;\n\t\t} else {\n\t\t\t$this->type = self::TYPE_HTML;\n\t\t}\n\t}", "public function setType($type) {\n $this->type = $type;\n return $this;\n }" ]
[ "0.8299894", "0.8299894", "0.82862043", "0.827134", "0.8235015", "0.82216233", "0.82216233", "0.82216233", "0.81502503", "0.81502503", "0.81502503", "0.81502503", "0.81502503", "0.81502503", "0.81502503", "0.81502503", "0.8126534", "0.8123906", "0.810934", "0.80958074", "0.80958074", "0.80864775", "0.8071527", "0.80667216", "0.8065787", "0.8065787", "0.8064485", "0.8064485", "0.8064485", "0.8064485", "0.8064485", "0.8064485", "0.8064485", "0.8064485", "0.8064485", "0.8050262", "0.8027594", "0.8027594", "0.79690254", "0.7924611", "0.79220766", "0.78868985", "0.7839844", "0.78364766", "0.7778492", "0.77473736", "0.7703663", "0.7667173", "0.7667173", "0.7657433", "0.7637211", "0.7628914", "0.762501", "0.762501", "0.7602482", "0.7602482", "0.7583345", "0.7512785", "0.7447119", "0.7435327", "0.74251676", "0.7375143", "0.7352585", "0.7331893", "0.7325706", "0.7313159", "0.7301205", "0.7301143", "0.7288666", "0.7287415", "0.7274107", "0.72731745", "0.7261446", "0.72537917", "0.7250242", "0.7250242", "0.7249601", "0.7247054", "0.7242447", "0.7242447", "0.7241291", "0.7223006", "0.7222664", "0.72203785", "0.7203934", "0.71654433", "0.71654063", "0.7158275", "0.7155226", "0.7154538", "0.71487045", "0.7140015", "0.713945", "0.71387047", "0.71359706", "0.71259964", "0.71190774", "0.71109974" ]
0.0
-1
Sets a new id
public function setId($id) { $this->id = $id; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetId($value) { $this->id=$value; }", "public function setId($id)\n {\n $this->id = $id ? $id : uniqid();\n }", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function set_id($id) {\n $this->_newid = preg_replace(\"/[^a-zA-Z0-9]/\", '', $id);\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "public function SetId ($id);", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "private function setId($id)\n {\n $this->id = $id;\n }", "function set_id($id)\n {\n $this->set_default_property(self :: PROPERTY_ID, $id);\n }", "static public function setId($id){\n \tif (self::$_id != $id){\n \t\tself::$_id = $id;\n \t\tself::regenerate();\n \t}\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}", "function setId($id)\n {\n $this->id = $id;\n }", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}", "public static function setId($id)\n {\n self::$id = $id;\n }", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n\t{\n\t\t$this->id = (int) $id;\n\t}", "protected function setId($id)\n {\n $this->id = $id;\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "private function set_id(int $id)\n {\n $this->_id = $id;\n }", "public function set_id($id){\n $this->id = $id;\n }", "public function setId(string $id)\n\t{\n\t\t$this->id=$id; \n\t\t$this->keyModified['id'] = 1; \n\n\t}", "public function setId($var){\n\t\t$this->id=$var;\n\t}", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($id): void\r\n {\r\n $this->id = $id;\r\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setIdentifier($id)\n {\n $this->uid = (int)$id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = (int)$id;\n }", "public function setId(string $id): void\n {\n $this->_id = $id;\n }", "public function setId(string $id): void\n {\n $this->_id = $id;\n }", "public function setId( $id )\n {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setid($id)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t}", "public function setId(string $id): void\n {\n $this->id = $id;\n }", "public function setId($id): void\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id){\n $this->_id = $id;\n }", "public function setId(?string $id): void {\n\t\t$this->setAttribute(\"id\", $id);\n\t}", "public function setId($id)\n\t{\n\t\t$this->id = $id;\n\t}", "public function setId($id)\n\t{\n\t\t$this->id = $id;\n\t}", "public function setId($id)\n\t{\n\t\t$this->id = $id;\n\t}", "public function setId($id)\n\t{\n\t\t$this->id = $id;\n\t}", "public function setId($id) \n {\n $this->id = $id;\n }", "public function setId($id)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t}", "public function setId($id)\r\n\t{\r\n\t\t$this->id = $id;\r\n\t}", "public function set($new_id);", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId(int $id)\n {\n $this->id = md5($id);\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id)\n {\n $id = (int) $id;\n $this->_id = $id;\n }", "public function setId(?string $id): void\n {\n $this->id = $id;\n }", "public function setId(?string $id): void\n {\n $this->id = $id;\n }" ]
[ "0.8646041", "0.80755603", "0.80646825", "0.800062", "0.79879695", "0.79614013", "0.7939621", "0.7934826", "0.78811395", "0.7843647", "0.7828297", "0.7822569", "0.7819105", "0.78075874", "0.7803787", "0.7772256", "0.77570367", "0.7736806", "0.7736631", "0.77295804", "0.77295804", "0.77283794", "0.7718962", "0.77137226", "0.770226", "0.7697072", "0.7691544", "0.7691544", "0.7677031", "0.7676832", "0.767565", "0.76621836", "0.76563984", "0.7654924", "0.7654924", "0.7654924", "0.7654924", "0.7654924", "0.7647864", "0.7643802", "0.76344866", "0.7631876", "0.76309425", "0.762938", "0.7627805", "0.7625413", "0.7619905", "0.76191556", "0.7618421", "0.7618421", "0.7611547", "0.7610988", "0.76072174", "0.759955", "0.7592912", "0.7586465", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.7576187", "0.75749034", "0.7571411", "0.7568297", "0.7568297", "0.7568297", "0.7568297", "0.75663584", "0.75657576", "0.7564376", "0.75632954", "0.75615674", "0.7557732", "0.7542525", "0.7542525", "0.7539086", "0.75369793", "0.75369793" ]
0.0
-1
Sets a new email
public function setEmail($email) { $this->email = $email; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setEmail($newEmail){\n $this->email = $newEmail;\n }", "public function setEmail($value)\n {\n $this->_email = $value;\n }", "public function setEmail($newEmail){\n\t}", "public function setEmail($value) {\r\n $this->email = $value;\r\n }", "private function setEmail()\n {\n\t if ( empty( $_POST['email'] ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n }\n \n $e = trim( $_POST['email'] );\n \n\t\tif ( ! filter_var( $e, FILTER_VALIDATE_EMAIL ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n\t\t}\n \n\t\t$this->data['email'] = $e;\n }", "public function setEmail($value) {\n if(!strstr($value, \"@\")){\n throw new Exception(\"Errore in setEmail\");\n }\n // se esiste\n\n $this->email = $value;\n\n //$this->generateUserId();\n }", "public function changeEmail($newValue){\n\n $this->email = $newValue;\n $this ->save();\n\n }", "public function setEmail($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_9'));\n\t\tif(!Validator::AccountEmail($value)) throw new Exception(lang('error_9'));\n\t\t\n\t\t$this->_email = $value;\n\t}", "public function setEmail(string $email): void\n {\n $this->_email = $email;\n }", "function setEmail( $email )\n {\n $this->setValueByFieldName( 'person_email', $email );\n return;\n }", "public function setEmail($email){\n\t\t$this->email = $email;\n\t}", "protected function setEmail(string $email)\r\n\t{\r\n\t\t$this->email = $email;\r\n\t}", "public function setEmail(string $email){\n $this->email = $email;\n }", "public function setEmail($newEmail) {\n //first, trim the input of excess whitespace\n $newEmail = trim($newEmail);\n \n //second, sanitize the email of all invalid email characters\n $newEmail = filter_var($newEmail, FILTER_SANITIZE_EMAIL);\n \n //finally, bring the email out of quarantine\n $this->email = $newEmail;\n }", "public function setEmail(?string $value): void {\n $this->getBackingStore()->set('email', $value);\n }", "public function setEmail(string $email): void\n {\n $this->email = $email;\n }", "public function setEmail($email) {\n\t\t$this->_email = $email;\n\t}", "public function setEmail($email){\n\t\t\t$this->email = $email;\n\t\t}", "protected function setEmail(string $email) {\n $this->email = $email;\n }", "function setEmail($email) {\n\t\treturn $this->setData('email', $email);\n\t}", "public function setEmailAddress($email);", "public function setEmail($newEmail) {\n\t\t$newEmail = filter_var($newEmail, FILTER_VALIDATE_EMAIL);\n\n\t\t//Exception if not a valid email address\n\t\tif($newEmail === false) {\n\t\t\tthrow (new InvalidArgumentException(\"email is not a valid email\"));\n\t\t}\n\n\t\t//Exception if email will not fit in the database\n\t\tif(strlen($newEmail) > 128 ) {\n\t\t\tthrow(new RangeException(\"email address is too large\"));\n\t\t}\n\n//\t\t//Exception if email already in database\n//\t\t$pdo = new PDO('mysql:host=localhost;dbname=dmancini1', 'dmancini1', 'password');\n//\t\t$checkEmail = $this->$pdo->prepare('SELECT email FROM author WHERE email=:email');\n//\t\t$checkEmail->bindValue('email', $email, PDO::PARAM_STR);\n//\t\t$checkEmail->execute();\n//\t\t$result = $checkEmail->fetchAll();\n//\t\tif ($result >0){\n//\t\t\tthrow (new DuplicateEmailException(\"Email address is already in the database\"));\n//\t\t}\n\n\n\t\t//If input is a valid email address, save the value\n\t\t$this->email = $newEmail;\n\t}", "public static function setEmail($email)\n {\n self::$email = $email;\n }", "public function setEmail($email) {\n\t\t$this->email = $email;\n\t}", "public function setEmail($email) {\n\t\t$this->email = $email;\n\t}", "public function setEmail($email) {\n\t\t$this->email = $email;\n\t}", "public function setEmail(string $email)\n {\n $this->email = $email;\n }", "public function setEmail($value)\n {\n \t$this->email = $value;\n \treturn $this;\n }", "public function setEmail($email) {\n $this->set('email', $email, 'user');\n }", "private function _setEmail($input) {\n\t\tif(!Validator::Email($input)) throw new Exception(lang('error_9'));\n\t\t$this->_identifier = $input;\n\t}", "public function setEmail(string $email) {\n\n $this->email = $email;\n\n }", "public function setEmail($email)\n\t{\n\t\t$this->email = $email;\n\t}", "public function setEmail($email)\n\t{\n\t\t$this->email = $email;\n\t}", "public function setEmail($email);", "public function setEmail($email);", "public function setEmail($email);", "public function set_email( $email ) {\n\t\treturn $this->set_field( 'EMAIL', $email );\n\t}", "public function setEmail($strEmail) {\n\t\t$this->email = $strEmail;\n\t}", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $email;\n }", "public function setEmail($email) {\n $this->email = $email;\n }", "public function setEmail($email) {\n $this->email = $email;\n }", "public function setEmail($email) {\n $this->email = $email;\n }", "public function setEmail(?string $email): void;", "public function setEmail(?string $email): void;", "public function setEmail(String $email)\n {\n $this->email = $email;\n }", "public function setEmail($mail);", "public function setEmail($val)\n {\n $this->_propDict[\"email\"] = $val;\n return $this;\n }", "function set_email($email) {\n if (is_string($email) == false)\n throw new Exception('type error!');\n\n $email = strtolower($email);\n $len = strlen($email);\n \n if ($len == 0)\n throw new Exception(\"email cannot be empty\");\n if (preg_match(\"/[^a-z_.0-9-@]+/\", $email))\n throw new Exception(\"email has some not allowed characters.\");\n if (!filter_var($email, FILTER_VALIDATE_EMAIL))\n throw new Exception(\"email is not valid\");\n if ($len > 30)\n throw new Exception(\"email cannot be more than 30 characters\");\n\n $this->email = $email;\n }", "public function setEmail($email)\n {\n $this->email = $this->db->real_escape_string( $email);\n\n }", "public function setEmailAttribute($value)\n {\n if (!empty($value)) {\n $this->attributes['email'] = $this->mayaEncrypt($value);\n }\n }", "public function setEmail($email)\n {\n $this->session->set('email', $email);\n $this->session->set('crumb', md5($this->config->secrets->secret . time()));\n if($this->isOwner())\n $this->session->set('site', $_SERVER['HTTP_HOST']);\n }", "public function setEmail($anEmail) {\n\t\t$this->_email = $anEmail;\n\t}", "public function setEmail($email) {\n $this->getlead()->setEmail($email);\n }", "public function setEmail($value)\n {\n return $this->set('Email', $value);\n }", "public function setEmail($value)\n {\n return $this->set('Email', $value);\n }", "public function setEmail($value)\n {\n return $this->set('Email', $value);\n }", "public function set_email($email) : void\n {\n try {\n $this->obj_contato_anunciante->set_email(Validador::Contato_Anunciante()::validar_email($email));\n } catch (Exception $e) {\n $this->erros[] = $e->getMessage();\n $this->campos['email'] = \"erro\";\n }\n }", "public function setEmail($email) {\n $this->user_email = $email;\n }", "public function setEmail($email) {\n $this->setUsername($email);\n $this->email = $email;\n }", "public function setMail($_mail)\n {\n $this->mail = $_mail;\n }", "public function set_email($_email)\n {\n $this->_email = $_email;\n\n return $this;\n }", "public function set_email($_email)\n {\n $this->_email = $_email;\n\n return $this;\n }", "public function set_email($_email)\n {\n $this->_email = $_email;\n\n return $this;\n }", "public function setEmail($value)\n {\n return $this->set(self::EMAIL, $value);\n }", "public function setNewEmail($value)\n {\n return $this->set('NewEmail', $value);\n }", "public function setEmail(?CustomerTextFilter $email): void\n {\n $this->email = $email;\n }", "public function setEmail($newEmail) {\n\t\t// verify the email is secure\n\t\t$newEmail = trim($newEmail);\n\t\t$newEmail = filter_var($newEmail, FILTER_SANITIZE_STRING);\n\t\tif(empty($newEmail) === true) {\n\t\t\tthrow(new InvalidArgumentException(\"Email address empty or insecure\"));\n\t\t}\n\n\t\t// verify the email address will fit in the database\n\t\tif(strlen($newEmail) > 128) {\n\t\t\tthrow(new RangeException(\"Email address too long\"));\n\t\t}\n\n\t\t// store the email\n\t\t$this->email = $newEmail;\n\t}", "public function setMail($mail);", "public function setEmail($_email)\n {\n $this->_email = $_email;\n\n return $this;\n }", "public function setEmail(UserRepositoryInterface $repository, $newEmail);", "public function setADEmail($email)\n\t{\n\t\t$this->email = $email;\n\t}", "public function _setEmail($Email)\n {\n $this->Email = $Email;\n\n }", "function changeemail($member,$oldemail,$newemail) {\n\t\n}", "public function setUserEmail($user) {\n\t\t$this->userEmail = $user;\n\t}", "public function setUsernameToEmail()\n {\n $this->username = $this->email;\n $this->usernameCanonical = $this->emailCanonical;\n }", "public function setEmail($email)\n\t\t{\n\t\t$this->email = $email;\n\t\treturn true;\n\t\t}", "public function setEmail(?string $email): self\n {\n $this->initialized['email'] = true;\n $this->email = $email;\n\n return $this;\n }", "function email($email)\n {\n if (!is_valid_email($email))\n return false;\n\n if ($email != $this->email)\n $this->update['email'] = $email;\n\n $this->email = $email;\n\n return true;\n }", "public function setEmail($email)\n\n{\n\n$this->email = $email;\n\n}", "public function setUserMail(?string $value): void {\n $this->getBackingStore()->set('userMail', $value);\n }", "public function setUserEmail($value)\n {\n return $this->set('UserEmail', $value);\n }", "public function setUserEmail($value)\n {\n return $this->set('UserEmail', $value);\n }", "public function setEmail( $email ) {\n\t\t$this->container['emails'] = isset( $email ) ? array( $email ) : null;\n\n\t\treturn $this;\n\t}", "public function setEmail($email)\n {\n $this->setUsername($email);\n return parent::setEmail($email);\n }", "private function changeEmail()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['new_email']) || $request['new_email']==\"\")\n throw_error_msg(\"provide new_email\");\n\n if(!isset($request['cnew_email']) || $request['cnew_email']==\"\")\n throw_error_msg(\"provide cnew_email\");\n\n if($request['new_email']!=$request['cnew_email'])\n throw_error_msg(\"new email and confirm email do not match\");\n\n $request['userid'] = userid();\n $userquery->change_email($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"email has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function setEmail1($value)\n {\n return $this->set('Email1', $value);\n }", "function set_admin_email($email) {\n $this->admin_email = $email;\n }", "private function _set_email ($stack, $email, $name=null) {\n if ($this->check_address && !$this->validate_email($email)) {\n throw new Exception(\"Bad email address $stack: $email\");\n }\n\n if ($this->apply_windows_bugfix) {\n array_push($this->all_emails, $email);\n }\n\n $this->{\"send$stack\"}[] = ($name == null) ? $email : '\"'.$name.'\" <'.$email.'>';\n }", "public function setEmail($email)\n {\n if (!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) {\n $this->erreur[] = 'Mauvais format Email';\n }else{\n $this->email = htmlspecialchars($_POST['email']);\n return $this;\n }\n }", "function user_set_email($user_id, $new_email)\n{\n\tif(strcmp($new_email,user_get_email($user_id)))\n\t{\n\t\t//check that no other user has it\n\t\tif(!user_email_exists($new_email))\n\t\t{\n\t\t\t//set it\n\t\t\t$sql=\"UPDATE \".PREFIX.\"user SET email='\".sql_safe($new_email).\"' WHERE id=\".sql_safe($user_id).\";\";\n\t\t\tif(mysql_query($sql))\n\t\t\t\tadd_message(\"New email set\");\n\t\t\telse\n\t\t\t\tadd_error(\"Email could not be set: \".mysql_error());\n\t\t}\n\t\telse\n\t\t\tadd_error(\"Email '$new_email' is already in use.\");\n\t}\n}", "public function setEmailTpl($value){$this->_emailTpl = $value;}", "function setSenderEmail($email) {\n $parts = $this->_parseEmail($email);\n $this->from_user = $parts[0];\n $this->from_domain = $parts[1];\n }", "function set_email($email='*', $obfuscate=1)\r\n{\r\n\t// autoset\r\n\tif ( $email == '*' )\r\n\t{\r\n\t\t// check user name\r\n\t\tif ( empty($this->user_name) ) $this->set_user_name('*');\r\n\t\t\r\n\t\t// obfuscate\r\n\t\t$ob = '';\r\n\t\tif ( $obfuscate )\r\n\t\t{\r\n\t\t\tif ( mt_rand(1,2) == 1 )\r\n\t\t\t{\r\n\t\t\t\t$_ob = '_' . substr(uniqid('69'),-4);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_ob = mt_rand(10000,99999);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// get domain\r\n\t\t$domain = $this->_get_random_email_domain();\r\n\t\t\r\n\t\t// compile\r\n\t\t$email = strtolower($this->user_name . $_ob . '@' . $domain);\r\n\t}\r\n\t\r\n\t// cheap validity check\r\n\tif ( !strpos($email, '@') || !strpos($email, '.') )\r\n\t{\r\n\t\ttrigger_error(\"invalid email addres [$email]\", E_USER_WARNING);\r\n\t\treturn 0;\r\n\t}\r\n\t\r\n\t$this->email = $email;\r\n\treturn;\r\n}", "public function setEmail($email)\r\n {\r\n if(!$this->validate($email)){\r\n $this->message = \"Field is empty\";\r\n return false;\r\n }\r\n \r\n $this->email = $email;\r\n\r\n return true;\r\n }", "public function set_email($email){\n if (\n !empty($email) &&\n \\Audit::instance()->email($email) == false\n ) {\n // no valid email address\n $this->throwValidationError('email');\n }\n return $email;\n }" ]
[ "0.8266221", "0.7957997", "0.794356", "0.7842873", "0.78110254", "0.7717619", "0.7599877", "0.7599098", "0.75686604", "0.75314724", "0.7529364", "0.7523072", "0.7522753", "0.75043976", "0.7497794", "0.7468965", "0.74656284", "0.74478996", "0.7439865", "0.7372353", "0.7362247", "0.7343677", "0.7337726", "0.7337516", "0.7337516", "0.7337516", "0.73238355", "0.73220205", "0.73188114", "0.7315151", "0.73130566", "0.7306798", "0.7306798", "0.7292542", "0.7292542", "0.7292542", "0.7292388", "0.728174", "0.7269537", "0.7269537", "0.7269537", "0.7269537", "0.7269537", "0.7269537", "0.7269537", "0.7259104", "0.7259104", "0.7259104", "0.7240136", "0.7240136", "0.72248244", "0.72237736", "0.7220659", "0.7218177", "0.7212855", "0.7199191", "0.71702963", "0.71557", "0.7153975", "0.71317947", "0.71304035", "0.71304035", "0.71293736", "0.7124728", "0.71150345", "0.7106554", "0.7087292", "0.7087292", "0.7087292", "0.70759755", "0.7064335", "0.70397925", "0.7011513", "0.7009745", "0.69991267", "0.69958496", "0.69637", "0.69478196", "0.6945851", "0.6944791", "0.693832", "0.69333375", "0.69102407", "0.69021875", "0.6887247", "0.68827784", "0.687816", "0.687816", "0.68759316", "0.68561596", "0.6849495", "0.6847127", "0.68442243", "0.6836252", "0.6827645", "0.681422", "0.68133134", "0.68024075", "0.67932415", "0.6785106", "0.6770326" ]
0.0
-1
Sets a new driversLicense
public function setDriversLicense(\net\authorize\api\contract\v1\DriversLicenseType $driversLicense) { $this->driversLicense = $driversLicense; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDriversLicense($driversLicense)\n {\n $this->driversLicense = $driversLicense;\n return $this;\n }", "public function setLicense(SetAlbumLicenseRequest $request): void\n\t{\n\t\t$request->album()->license = $request->license();\n\t\t$request->album()->save();\n\t}", "public function setLicenseName(?string $licenseName): void\n {\n $this->licenseName = $licenseName;\n }", "public function testLicensesSetterGetter($license): void\n {\n $this->component->setLicense($license);\n self::assertSame($license, $this->component->getLicense());\n }", "function register_license_settings() {\n\t\t// creates our settings in the options table\n\t\tregister_setting( $this->get_settings_page_slug(), $this->product_slug . '-license-key', 'sanitize_license' );\n\t}", "public function setLicenseUrl(?string $licenseUrl): void\n {\n $this->licenseUrl = $licenseUrl;\n }", "public function set_license_key( $license) {\n\t\t$license = sanitize_text_field( $license );\n\n\t\t// Allow license keys to be saved in custom option fields\n\t\tif ( ! empty( $this->license_option_name ) ) {\n\t\t\treturn update_option( $this->license_option_name, $license );\n\t\t}\n\n\t\t$dirname = dirname( $this->plugin_basename );\n\t\treturn update_option( $dirname . '_license', $license );\n\t}", "public function saveToStore() {\r\n $this->context->dbDriver->store(RestoDatabaseDriver::LICENSE, array(\r\n 'license' => array(\r\n 'licenseId' => $this->licenseId,\r\n 'grantedCountries' => isset($this->description['grantedCountries']) ? $this->description['grantedCountries'] : null,\r\n 'grantedOrganizationCountries' => isset($this->description['grantedOrganizationCountries']) ? $this->description['grantedOrganizationCountries'] : null,\r\n 'grantedFlags' => isset($this->description['grantedFlags']) ? $this->description['grantedFlags'] : null,\r\n 'viewService' => isset($this->description['viewService']) ? $this->description['viewService'] : null,\r\n 'hasToBeSigned' => isset($this->description['hasToBeSigned']) ? $this->description['hasToBeSigned'] : null,\r\n 'signatureQuota' => isset($this->description['signatureQuota']) ? $this->description['signatureQuota'] : -1,\r\n 'description' => isset($this->description['description']) ? $this->description['description'] : null\r\n ))\r\n );\r\n }", "public function set_license_key( $license_key ) {\n\t\treturn update_option( $this->product_slug . '-license-key', $license_key );\n\t}", "public function setLicenseType($val)\n {\n $this->_propDict[\"licenseType\"] = $val;\n return $this;\n }", "public function setLicense($license) {\n $this->properties['license'] = $license;\n\n return $this;\n }", "public function __construct($license, $driver, $typeCarAccepted, $seatMaterial) \n {\n //Hereda los atributos de car\n parent::__construct($license, $driver);\n $this->typeCarAccepted = $typeCarAccepted;\n $this->$seatMaterial = $seatMaterial;\n }", "public function testGetDriversLicense()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function setLicenseTemplates($value)\n {\n $this->_licenseTemplates = $value;\n }", "protected function copyLicenseKey()\n {\n if ($key = $this->getLicenseKey()) {\n $this->config->saveConfig(self::SEOBASE_LICENSE_KEY, $key, 'default', 0);\n }\n }", "public function __construct($license, $driver, $model, $brand)\n {\n parent::__construct($license, $driver); //metodo para traer de car las dos variables \n $this->brand = $brand;\n $this->model = $model;\n }", "public function activate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[ $this->product_slug . '_license_activate' ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t \tif( ! check_admin_referer( $this->product_slug . '_license_nonce', $this->product_slug . '_license_nonce' ) )\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = $_POST[ $this->product_slug . '-license-key' ];\n\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'activate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_id' => urlencode( EAEL_SL_ITEM_ID ), // the ID of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( EAEL_STORE_URL,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout' \t=> 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body' \t\t=> $api_params\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$message = $response->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t\tif ( false === $license_data->success ) {\n\n\t\t\t\t\tswitch( $license_data->error ) {\n\n\t\t\t\t\t\tcase 'expired' :\n\n\t\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t\t__( 'Your license key expired on %s.' ),\n\t\t\t\t\t\t\t\tdate_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'revoked' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has been disabled.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'missing' :\n\n\t\t\t\t\t\t\t$message = __( 'Invalid license.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'invalid' :\n\t\t\t\t\t\tcase 'site_inactive' :\n\n\t\t\t\t\t\t\t$message = __( 'Your license is not active for this URL.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'item_name_mismatch' :\n\n\t\t\t\t\t\t\t$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EAEL_SL_ITEM_NAME );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'no_activations_left':\n\n\t\t\t\t\t\t\t$message = __( 'Your license key has reached its activation limit.' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault :\n\n\t\t\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Check if anything passed on a message constituting a failure\n\t\t\tif ( ! empty( $message ) ) {\n\t\t\t\t$base_url = admin_url( 'admin.php?page=' . $this->get_settings_page_slug() );\n\t\t\t\t$redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );\n\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// $license_data->license will be either \"valid\" or \"invalid\"\n\n\t\t\t$this->set_license_key( $license );\n\t\t\t$this->set_license_status( $license_data->license );\n\n\t\t\twp_redirect( admin_url( 'admin.php?page=' . $this->get_settings_page_slug() ) );\n\t\t\texit();\n\t\t}\n\t}", "public function set_driver($driver)\n {\n $this->_driver = $driver;\n }", "public function activate_license()\n {\n if (isset($_POST['wpstg_activate_license']) && !empty($_POST['wpstg_license_key'])) {\n // run a quick security check\n if (!check_admin_referer('wpstg_license_nonce', 'wpstg_license_nonce'))\n return; // get out if we didn't click the Activate button\n\n\n // Save License key in DB\n update_option('wpstg_license_key', $_POST['wpstg_license_key']);\n\n // retrieve the license from the database\n $license = trim(get_option('wpstg_license_key'));\n\n\n // data to send in our API request\n $api_params = [\n 'edd_action' => 'activate_license',\n 'license' => $license,\n 'item_name' => urlencode(WPSTG_ITEM_NAME), // the name of our product in EDD\n 'url' => home_url()\n ];\n\n // Call the custom API.\n $response = wp_remote_post(WPSTG_STORE_URL, ['timeout' => 15, 'sslverify' => false, 'body' => $api_params]);\n\n // make sure the response came back okay\n if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {\n\n if (is_wp_error($response)) {\n $message = $response->get_error_message();\n } else {\n $message = __('An error occurred, please try again.');\n }\n } else {\n\n $license_data = json_decode(wp_remote_retrieve_body($response));\n\n if ($license_data->success === false) {\n\n switch ($license_data->error) {\n\n case 'expired' :\n\n $message = sprintf(\n __('Your license key expired on %s.'), date_i18n(get_option('date_format'), strtotime($license_data->expires, current_time('timestamp')))\n );\n break;\n\n case 'revoked' :\n\n $message = __('Your license key has been disabled.');\n break;\n\n case 'missing' :\n\n $message = __('WP Staging license key is invalid.');\n break;\n\n case 'invalid' :\n case 'site_inactive' :\n\n $message = __('Your license is not active for this URL.');\n break;\n\n case 'item_name_mismatch' :\n\n $message = sprintf(__('This appears to be an invalid license key for %s.'), WPSTG_ITEM_NAME);\n break;\n\n case 'no_activations_left':\n\n $message = __('Your license key has reached its activation limit.');\n break;\n\n default :\n\n $message = __('An error occurred, please try again.');\n break;\n }\n }\n }\n\n // Check if anything passed on a message constituting a failure\n if (!empty($message)) {\n $base_url = admin_url('admin.php?page=wpstg-license');\n $redirect = add_query_arg(['wpstg_licensing' => 'false', 'message' => urlencode($message)], $base_url);\n update_option('wpstg_license_status', $license_data);\n wp_redirect($redirect);\n exit();\n }\n\n // $license_data->license will be either \"valid\" or \"invalid\"\n update_option('wpstg_license_status', $license_data);\n wp_redirect(admin_url('admin.php?page=wpstg-license'));\n exit();\n }\n }", "public function loadFromStore() {\r\n $licenses = $this->context->dbDriver->get(RestoDatabaseDriver::LICENSES, array('licenseId' => $this->licenseId));\r\n if (!isset($licenses[$this->licenseId])) {\r\n RestoLogUtil::httpError(400, 'License ' . $this->licenseId . ' does not exist in database');\r\n }\r\n $this->description = $licenses[$this->licenseId];\r\n }", "public function license()\n {\n return $this->belongsTo('CityBoard\\Entities\\License');\n }", "public function setDriversLicenseState($driversLicenseState)\n {\n $this->driversLicenseState = $driversLicenseState;\n return $this;\n }", "public function setVendor(string $vendor)\n {\n }", "public function setCopyright($copyright) {\n\t\t$this->copyright = $copyright;\n\t}", "public function __construct($license, $pdf)\n {\n $this->license = $license;\n $this->pdf = $pdf;\n }", "public function wpbooklist_storefront_save_license_key_action_callback() {\n\n\t\t\tglobal $wpdb;\n\n\t\t\tcheck_ajax_referer( 'wpbooklist_storefront_save_license_key_action_callback', 'security' );\n\n\t\t\tif ( isset( $_POST['license'] ) ) {\n\t\t\t\t$license = filter_var( wp_unslash( $_POST['license'] ), FILTER_SANITIZE_STRING );\n\t\t\t}\n\n\t\t\t$data = array(\n\t\t\t\t'treh' => $license,\n\t\t\t);\n\t\t\t$format = array( '%s' );\n\t\t\t$where = array( 'ID' => 1 );\n\t\t\t$where_format = array( '%d' );\n\t\t\t$save_result = $wpdb->update( $wpdb->prefix . 'wpbooklist_storefront_settings', $data, $where, $format, $where_format );\n\n\t\t\twp_die( $save_result );\n\n\t\t}", "function shoestrap_activate_license() {\n global $wp_version;\n\n $license = shoestrap_getVariable( 'shoestrap_license_key' );\n\n $api_params = array(\n 'edd_action' => 'activate_license',\n 'license' => $license,\n 'item_name' => urlencode( SHOESTRAP_THEME_NAME )\n );\n\n $response = wp_remote_get( add_query_arg( $api_params, SHOESTRAP_STORE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );\n\n if ( is_wp_error( $response ) ) :\n return false;\n endif;\n\n $license_data = json_decode( wp_remote_retrieve_body( $response ) );\n}", "public function activate_license( $key ) {\n\t\t// Data to send in our API request.\n\t\t$api_params = array(\n\t\t\t'edd_action' => 'activate_license',\n\t\t\t'license' => $key,\n\t\t\t'item_name' => rawurlencode( $this->product_slug ),\n\t\t\t'url' => home_url(),\n\t\t);\n\n\t\t// Call the Block Lab store's API.\n\t\t$response = wp_remote_post(\n\t\t\t$this->store_url,\n\t\t\tarray(\n\t\t\t\t'timeout' => 10,\n\t\t\t\t'sslverify' => true,\n\t\t\t\t'body' => $api_params,\n\t\t\t)\n\t\t);\n\n\t\tif ( is_wp_error( $response ) ) {\n\t\t\t$license = array( 'license' => self::REQUEST_FAILED );\n\t\t} else {\n\t\t\t$license = json_decode( wp_remote_retrieve_body( $response ), true );\n\t\t}\n\n\t\t$expiration = DAY_IN_SECONDS;\n\n\t\tset_transient( self::TRANSIENT_NAME, $license, $expiration );\n\t}", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function __construct($_name, $_surname, $_license, $_software) {\n parent::__construct($_name, $_surname);\n $this->software = $_software;\n $this->licenze = $_license;\n }", "public function setYear($year) {\n $this->_year = $year;\n }", "private function create_license($email, $key) {\n $tp_premium_option = get_option('tp_premium_data');\n $tp_premium_option = json_decode($tp_premium_option, true);\n $tp_premium_option[$this->product] = array(\n 'product' => $this->product,\n 'key' => $key,\n 'email' => $email,\n 'active' => true\n );\n $set_option = json_encode($tp_premium_option);\n update_option('tp_premium_data', $set_option);\n }", "function editLicense($option, $cid){\n\tglobal $mainframe;\n\t$user = &JFactory::getUser();\n\t$database = &JFactory::getDBO();\n\n\tif(is_array($cid)) $cid = 0;\n\n\t$row = new jlist_license( $database );\n\t$row->load( $cid );\n\n\t// fail if checked out not by 'me'\n\tif ($row->isCheckedOut( $user->get('id') )) {\n\t\t$mainframe->redirect( 'index.php?option='.$option.'&task=license.list', $row->license_title.' '.JText::_('COM_JDOWNLOADS_BACKEND_LIC_USED') );\n\t}\n\t$database->SetQuery(\"SELECT * FROM #__jdownloads_license\"\n\t\t\t\t\t\t. \"\\nWHERE id = $cid\");\n\t$database->loadObject($row);\n\n\tif ($cid) {\n\t\t$row->checkout( $user->get('id') );\n\t} else {\n\t\t$row->published\t = 1;\n\t}\n\n\tjlist_HTML::editLicense($option, $row);\n}", "public function set_license_status( $license_status ) {\n\t\treturn update_option( $this->product_slug . '-license-status', $license_status );\n\t}", "function create_license($number) {\n $node = new stdClass();\n $node->type = 'license_to_kill';\n node_object_prepare($node);\n\n $node->title = 'license-' . $number;\n $node->field_code['und'][0]['value'] = \"0\";\n\n node_save($node);\n}", "public function setYear($year);", "public function deactivate_all_licenses() {\n\n\t\t$licenses = TPM_License::get_saved_licenses();\n\n\t\tif ( empty( $licenses ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$connection = TPM_Connection::get_instance();\n\n\t\t//if user has disconnected TPM then try to use the backup connection saved at disconnecting\n\t\tif ( false === $connection->is_connected() ) {\n\t\t\t$connection->set_data( get_option( 'tpm_bk_connection', array() ) );\n\t\t}\n\n\t\t$params = array(\n\t\t\t'user_id' => $connection->ttw_id,\n\t\t\t'user_site_url' => get_site_url(),\n\t\t\t'direction' => 'down',\n\t\t\t'data' => array_keys( $licenses ),\n\t\t);\n\t\t$request = new TPM_Request( '/api/v1/public/license_uses', $params );\n\t\t$request->set_header( 'Authorization', $connection->ttw_salt );\n\n\t\t$proxy_request = new TPM_Proxy_Request( $request );\n\t\t$response = $proxy_request->execute( '/tpm/proxy' );\n\t\tTPM_Log_Manager::get_instance()->set_message( var_export( $response, true ) )->log();\n\t\tdelete_option( TPM_License::NAME );\n\t}", "protected function setKey($key)\n {\n $this->options->set('licenseKey', $key);\n\n return $this;\n }", "public function get_licence()\n {\n return 'GPL';\n }", "public function testSetIndemnLic() {\n\n $obj = new AttestationCacm();\n\n $obj->setIndemnLic(true);\n $this->assertEquals(true, $obj->getIndemnLic());\n }", "public function setYear($year)\n\t{\n\t\t$this->year = $year;\n\t}", "public function deactivate_license()\n {\n if (isset($_POST['wpstg_deactivate_license'])) {\n // run a quick security check\n if (!check_admin_referer('wpstg_license_nonce', 'wpstg_license_nonce'))\n return; // get out if we didn't click the Activate button\n\n\n // retrieve the license from the database\n $license = trim(get_option('wpstg_license_key'));\n\n\n // data to send in our API request\n $api_params = [\n 'edd_action' => 'deactivate_license',\n 'license' => $license,\n 'item_name' => urlencode(WPSTG_ITEM_NAME), // the name of our product in EDD\n 'url' => home_url()\n ];\n\n // Call the custom API.\n $response = wp_remote_post(WPSTG_STORE_URL, ['timeout' => 15, 'sslverify' => false, 'body' => $api_params]);\n\n // make sure the response came back okay\n if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {\n\n if (is_wp_error($response)) {\n $message = $response->get_error_message();\n } else {\n $message = __('An error occurred, please try again.');\n }\n\n $base_url = admin_url('admin.php?page=wpstg-license');\n $redirect = add_query_arg(['wpstg_licensing' => 'false', 'message' => urlencode($message)], $base_url);\n wp_redirect($redirect);\n exit();\n }\n\n // decode the license data\n $license_data = json_decode(wp_remote_retrieve_body($response));\n\n // $license_data->license will be either \"deactivated\" or \"failed\"\n if ($license_data->license === 'deactivated' || $license_data->license === 'failed') {\n delete_option('wpstg_license_status');\n }\n\n wp_redirect(admin_url('admin.php?page=wpstg-license'));\n exit();\n }\n }", "public function setYear($year)\n {\n $this->year = $year;\n }", "public function setSoftwareName($software)\n {\n return $this->setParam(self::SOFTWARE_PARAM_NAME, $software);\n }", "public function setDrivers()\n {\n foreach ($this->getDriverList() as $driverName) {\n $this->setDriver($driverName);\n }\n }", "public function getName()\n\t{\n\t\treturn 'DRIVERS_LICENSE';\n\t}", "public function senarai_licenses()\n {\n return $this->hasMany(License::class);\n }", "function deactivate_license() {\n\n\t\t// listen for our activate button to be clicked\n\t\tif( isset( $_POST[ $this->product_slug . '_license_deactivate' ] ) ) {\n\n\t\t\t// run a quick security check\n\t\t \tif( ! check_admin_referer( $this->product_slug . '_license_nonce', $this->product_slug . '_license_nonce' ) )\n\t\t\t\treturn; // get out if we didn't click the Activate button\n\n\t\t\t// retrieve the license from the database\n\t\t\t$license = $this->get_license_key();\n\n\n\t\t\t// data to send in our API request\n\t\t\t$api_params = array(\n\t\t\t\t'edd_action' => 'deactivate_license',\n\t\t\t\t'license' => $license,\n\t\t\t\t'item_id' => urlencode( EAEL_SL_ITEM_ID ), // the ID of our product in EDD\n\t\t\t\t'url' => home_url()\n\t\t\t);\n\n\t\t\t// Call the custom API.\n\t\t\t$response = wp_remote_post( EAEL_STORE_URL,\n\t\t\t\tarray(\n\t\t\t\t\t'timeout' \t=> 15,\n\t\t\t\t\t'sslverify' => false,\n\t\t\t\t\t'body' \t\t=> $api_params\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// make sure the response came back okay\n\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\n\t\t\t\tif ( is_wp_error( $response ) ) {\n\t\t\t\t\t$message = $response->get_error_message();\n\t\t\t\t} else {\n\t\t\t\t\t$message = __( 'An error occurred, please try again.' );\n\t\t\t\t}\n\n\t\t\t\t$base_url = admin_url( 'admin.php?page=' . $this->get_settings_page_slug() );\n\t\t\t\t$redirect = add_query_arg( array( 'sl_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );\n\n\t\t\t\twp_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// decode the license data\n\t\t\t$license_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t// $license_data->license will be either \"deactivated\" or \"failed\"\n\t\t\tif( $license_data->license == 'deactivated' ) {\n\t\t\t\tdelete_option( $this->product_slug . '-license-status' );\n\t\t\t\tdelete_option( $this->product_slug . '-license-key' );\n\t\t\t}\n\n\t\t\twp_redirect( admin_url( 'admin.php?page=' . $this->get_settings_page_slug() ) );\n\t\t\texit();\n\n\t\t}\n\t}", "function wpec_authsim_plugin_updater() {\n\t\t$license = get_option( 'wpec_product_'. WPEC_AUTHSIM_PRODUCT_ID .'_license_active' );\n\t\t$key = ! $license ? '' : $license->license_key;\n\t\t// setup the updater\n\t\t$wpec_updater = new WPEC_Product_Licensing_Updater( 'https://wpecommerce.org', __FILE__, array(\n\t\t\t\t'version' \t=> WPEC_AUTHSIM_VERSION, \t\t\t\t// current version number\n\t\t\t\t'license' \t=> $key, \t\t// license key (used get_option above to retrieve from DB)\n\t\t\t\t'item_id' \t=> WPEC_AUTHSIM_PRODUCT_ID \t// id of this plugin\n\t\t\t)\n\t\t);\n\t}", "public function set_license_option($option_key, $value) {\r\n\treturn update_site_option( $this->plugin_config['plugin_prefix'].'_'.$option_key, trim($value) );\r\n}", "public function setUsedLicenseCount($val)\n {\n $this->_propDict[\"usedLicenseCount\"] = intval($val);\n return $this;\n }", "public static function generatePayUBuyLicense(License $license, $data)\n {\n //una licencia paga para el mismo producto\n if($license->state == 'Active' && $license->product->state == 'Active' && ($license->product->name == 'TrSoft/Copy Binary' && !Auth::user()->paidProduct(env('BINARY_COPY_ID')) && !Auth::user()->activeProductWithPayment(env('BINARY_COPY_ID')))){\n $transfer = Transfer::generateTransferObject($license->id, 1);\n\n $commissions_pending_payment = Auth::user()->commissionsPendingPaymentValue(true);\n\n $amount = $license->licensePrices()->orderBy('id', 'DESC')->first()->price + $commissions_pending_payment;\n\n $str_hash = env('PAYU_APIKEY').'~'.env('PAYU_MERCHANT_ID').'~'.$transfer->identifier.'~'.$amount.'~USD';\n\n $data_send = [\n 'merchantId' => env('PAYU_MERCHANT_ID'),\n 'ApiKey' => env('PAYU_APIKEY'),\n 'accountId' => env('PAYU_ACCOUNT_ID'),\n 'description' => $license->product->name.': '.$license->name.($commissions_pending_payment?(' + '.__('messages.commissions_pending_payment')):''),\n 'referenceCode' => $transfer->identifier,\n 'amount' => $amount,\n 'tax' => null,\n 'taxReturnBase' => '0',\n 'signature' => md5($str_hash),\n 'currency' => 'USD',\n 'test' => '0',\n 'lng' => $data['language'],\n 'responseUrl' => url('process-payment/license'),\n 'confirmationUrl' => url('api/v1/service/p-p-2020'),\n 'buyerFullName' => Auth::user()->name,\n 'buyerEmail' => Auth::user()->email\n ];\n\n $client = new Client();\n\n $res = $client->request('POST', env('PAYU_URL'), [\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded'\n ],\n 'allow_redirects' => false,\n 'form_params' => $data_send\n ]);\n\n return $res;\n }\n\n return false;\n }", "private function deleteLicense()\n {\n try {\n $sql = \"DELETE FROM s_core_licenses WHERE module = 'SwagCommercial'\";\n $this->container->get('dbal_connection')->query($sql);\n } catch (\\PDOException $e) {\n throw new \\RuntimeException('Could not remove license from database', 0, $e);\n }\n }", "public function belongingToUserLicense(UserLicense $account);", "function setSyncWarranty()\n {\n }", "public function license($license_key) {\n $license_key = trim($license_key);\n $alert = [];\n if(!$license_key):\n $alert = ['danger' => 'No license key added'];\n update_option('responsive_menu_pro_license_type', '');\n update_option('responsive_menu_pro_license_key', '');\n\n else:\n /* First Check The Generic License */\n $response = wp_remote_get('https://responsive.menu/?' . http_build_query(\n [\n 'edd_action'=> 'activate_license',\n 'license' \t=> $license_key,\n 'item_name' => urlencode('Responsive Menu Pro'),\n 'url' => home_url()\n ]\n ), ['decompress' => false]);\n $license_type = 'License';\n if(is_wp_error($response))\n $alert = ['danger' => $response->get_error_message() . ' - Please <a href=\"https://responsive.menu/faq/license-activation-issues\" target=\"_blank\"> click here</a> for more information.'];\n else\n $response = json_decode($response['body']);\n\n /* Parse Result */\n if(!isset($response->success) || !$response->success):\n /* Now Check The Old Multi License */\n $response = wp_remote_get('https://responsive.menu/?' . http_build_query(\n [\n 'edd_action'=> 'activate_license',\n 'license' \t=> $license_key,\n 'item_name' => urlencode('Responsive Menu Pro - Multi License'),\n 'url' => home_url()\n ]\n ), ['decompress' => false]);\n $license_type = 'Multi License';\n if(is_wp_error($response))\n $alert = ['danger' => $response->get_error_message() . ' - Please <a href=\"https://responsive.menu/faq/license-activation-issues\" target=\"_blank\"> click here</a> for more information.'];\n else\n $response = json_decode($response['body']);\n endif;\n\n /* Parse Result */\n if(!isset($response->success) || !$response->success):\n /* Finally Check The Old Single License */\n $response = wp_remote_get('https://responsive.menu/?' . http_build_query(\n [\n 'edd_action'=> 'activate_license',\n 'license' \t=> $license_key,\n 'item_name' => urlencode('Responsive Menu Pro - Single License'),\n 'url' => home_url()\n ]\n ), ['decompress' => false]);\n $license_type = 'Single License';\n\n if(is_wp_error($response))\n $alert = ['danger' => $response->get_error_message() . ' - Please <a href=\"https://responsive.menu/faq/license-activation-issues\" target=\"_blank\"> click here</a> for more information.'];\n else\n $response = json_decode($response['body']);\n endif;\n\n if(isset($response->success) && $response->success):\n update_option('responsive_menu_pro_license_type', $license_type);\n $alert = ['success' => 'License key updated'];\n else:\n update_option('responsive_menu_pro_license_type', '');\n if(!is_wp_error($response))\n $alert = ['danger' => 'License key invalid' . ' - Please <a href=\"https://responsive.menu/knowledgebase/license-activation-issues/\" target=\"_blank\"> click here</a> for more information.'];\n endif;\n update_option('responsive_menu_pro_license_key', $license_key);\n endif;\n\n return $this->view->render(\n 'admin/main.html.twig',\n [\n 'alert' => $alert,\n 'options' => $this->manager->all()\n ]\n );\n }", "function setDriver($name) {\n\t\t$driver = $this->driversPath.$name.\".php\";\n\t\ttry {\n\t\t\tif( ! file_exists($driver) ) throw new Exception(\"Selected file is not a driver!\");\n\t\t\tinclude($driver);\n\t\t\t$drv = new $name();\n\t\t\tif( ! is_a($drv, 'Driver') ) throw new InvalidArgumentException(\"Drivers should extend Driver class\");\n\t\t} catch (Exception $e) {\n\t\t\t$this->toast = $e->getMessage();\n\t\t\treturn false;\n\t\t}\n $this->driver = $drv;\n\t\t$this->driver->cr = $this;\n\t\treturn true;\n\t}", "private function changeStatusLicense() {\n if ($this->get_request_method() != \"POST\") {\n $error = array('status_code' => \"0\", 'message' => \"wrong method\", 'response_code' => \"406\");\n $this->response($this->json($error), 406);\n }\n\n $arr = array();\n if(@$_POST['reqparams']) {\n $post = $_POST['reqparams'];\n $LicenseID = $post['LicenseID'];\n $StatusID = $post['StatusID'];\n } else {\n $LicenseID = $_POST['LicenseID'];\n $StatusID = $_POST['StatusID'];\n }\n\n $sql = mysql_query(\"UPDATE `SCP_Licenses` SET `StatusID`='$StatusID' WHERE `LicenseID` = '$LicenseID'\", $this->db);\n\n if($sql) {\n $error = array('status_code' => \"1\", 'status' => \"success\", 'message' => \"Changed License Status Successfully\", 'response_code' => \"200\", 'response_data' => $arr);\n $this->response($this->json($error), 200);\n } else {\n $error = array('status_code' => \"0\", 'status' => \"error\", 'message' => \"validation error\", 'response_code' => \"200\", 'response_data' => $arr);\n $this->response($this->json($error), 200);\n }\n }", "public function get_license() {\n\t\tif ( null === $this->license ) {\n\t\t\t$this->license = new DLM_Product_License( $this->product_id );\n\t\t}\n\n\t\treturn $this->license;\n\t}", "public function init() {\n\t\t$this->license_helpers();\n\t}", "public function __construct(Software $software)\n {\n $this->software = $software;\n }", "static function dropdownLicenseToInstall($myname, $entity_restrict) {\n global $CFG_GLPI, $DB;\n\n $iterator = $DB->request([\n 'SELECT' => [\n 'glpi_softwares.id',\n 'glpi_softwares.name'\n ],\n 'DISTINCT' => true,\n 'FROM' => 'glpi_softwares',\n 'INNER JOIN' => [\n 'glpi_softwarelicenses' => [\n 'ON' => [\n 'glpi_softwarelicenses' => 'softwares_id',\n 'glpi_softwares' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_softwares.is_deleted' => 0,\n 'glpi_softwares.is_template' => 0\n ] + getEntitiesRestrictCriteria('glpi_softwarelicenses', 'entities_id', $entity_restrict, true),\n 'ORDERBY' => 'glpi_softwares.name'\n ]);\n\n $values = [];\n while ($data = $iterator->next()) {\n $softwares_id = $data[\"id\"];\n $values[$softwares_id] = $data[\"name\"];\n }\n $rand = Dropdown::showFromArray('softwares_id', $values, ['display_emptychoice' => true]);\n\n $paramsselsoft = ['softwares_id' => '__VALUE__',\n 'entity_restrict' => $entity_restrict,\n 'myname' => $myname];\n\n Ajax::updateItemOnSelectEvent(\"dropdown_softwares_id$rand\", \"show_\".$myname.$rand,\n $CFG_GLPI[\"root_doc\"].\"/ajax/dropdownSoftwareLicense.php\",\n $paramsselsoft);\n\n echo \"<span id='show_\".$myname.$rand.\"'>&nbsp;</span>\\n\";\n\n return $rand;\n }", "public function setOriginalDriver($driver)\n {\n $this->_originalDriver = $driver;\n }", "public function getSelectedLicense() {\n if ($this->obtenerDato(\"is_enterprise\") || $this->perteneceCorporacion()) return empresa::LICENSE_ENTERPRISE;\n\n if ($license = $this->obtenerDato('license')) {\n return $license;\n }\n\n return empresa::LICENSE_FREE;\n }", "private function set_generator() {\n\t\tif ( ! isset( $this->generator ) ) {\n\t\t\t$this->generator = new ProductGenerator();\n\t\t\t$this->generator->setPlatform( $this->platform->get_name(), $this->platform->get_version() );\n\t\t\t$this->generator->setUri( $this->uri );\n\t\t}\n\t}", "public function get_licence()\n {\n return 'MIT License';\n }", "public function testSetDateLicenciement() {\n\n // Set a Date/time mock.\n $dateLicenciement = new DateTime(\"2018-09-10\");\n\n $obj = new Employes();\n\n $obj->setDateLicenciement($dateLicenciement);\n $this->assertSame($dateLicenciement, $obj->getDateLicenciement());\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function capture_license_key() {\r\n\t\r\n\t// Process if no other actions are active\r\n\tif ( !isset($_GET[$this->plugin_config['plugin_prefix'].'_license_change']) ) {\r\n\t\r\n\t\t//$current_key = $this->get_license_option('license_key');\r\n\t\t\r\n\t\tif( !empty($this->license_key) ) {\r\n\t\t\t\r\n\t\t\t// Set new key\r\n\t\t\t$this->set_license_option('license_key', $this->license_key);\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}\r\n}", "public function getDrivingLicense()\n {\n return $this->hasOne(DrivingLicense::class, ['id' => 'driving_license_id']);\n }", "public function add_license_page(){\n\t\tglobal $submenu;\n\t\tadd_submenu_page('edumax-options','License', 'License', 'manage_options', 'edumax-theme-license', array($this, 'license_form'));\n\t\t$submenu['edumax-options'][] = array( 'Edumax Docs', 'manage_options' , 'https://www.themeum.com/docs/edumax-introduction/');\n\t}", "public function emailLicenseToClient()\n {\n $details = $this->db->fetchQuery(\n \"SELECT\n convert_from(decrypt(cl.client_email, '\" . KEY . \"', 'aes'), 'SQL_ASCII') AS client_email,\n convert_from(decrypt(cl.client_name, '\" . KEY . \"', 'aes'), 'SQL_ASCII') AS client_name,\n li.license_key\n FROM clients cl\n LEFT JOIN license li ON (\n cl.client_id = li.client_id AND li.id =\n (\n SELECT max(id)\n FROM license l\n WHERE cl.client_id = l.client_id\n )\n )\n WHERE cl.id = :cid;\",\n [\":cid\" => intval($_POST['clientId'])]\n );\n $publicKey = $this->_fetchLicensePublicKey($details['license_key']);\n GlobalFunction::mailSend(\n \"license\",\n [],\n [$details['client_email'] => $details['client_name']],\n NULL,\n [],\n function (\\Swift_Message $message) use ($publicKey) {\n $message->attach(new Swift_Attachment($publicKey, 'license.dlf', 'text/plain'));\n }\n );\n }", "public function setSelect($select);", "public function fetchExistingLicenses()\n {\n $clientLicense = $this->db->fetchQuery(\n \"SELECT\n TO_CHAR(l.creation_date, 'Dy DD Mon YYYY, HH24:MI') AS creation_date,\n TO_CHAR(l.activation_date, 'Dy DD Mon YYYY, HH24:MI') AS activation_date,\n TO_CHAR(l.expiry_date, 'Dy DD Mon YYYY, HH24:MI') AS expiry_date,\n array_to_json(array_agg(mi.id\n ORDER BY mi.id ASC)) AS modules_installed,\n array_to_json(l.ip_addr) AS ip_addr,\n array_to_json(l.domains) AS domains,\n array_to_json(array_agg(mi.description\n ORDER BY mi.id ASC)) AS modules_names,\n now() BETWEEN activation_date AND expiry_date AS active\n FROM license l\n LEFT JOIN modules_available mi ON mi.id = ANY (l.modules_installed) AND mi.enabled_by_default=0\n WHERE client_id = :clientId\n GROUP BY l.id\n ORDER BY creation_date DESC\n LIMIT 1;\",\n [':clientId' => $_POST['clientId']]\n );\n if ($clientLicense) {\n $clientLicense['modules_installed'] = json_decode($clientLicense['modules_installed'], TRUE);\n $clientLicense['modules_names'] = json_decode($clientLicense['modules_names'], TRUE);\n $clientLicense['ip_addr'] = json_decode($clientLicense['ip_addr'], TRUE);\n $clientLicense['domains'] = json_decode($clientLicense['domains'], TRUE);\n }\n $this->response = [\"license\" => $clientLicense];\n }", "function erp_addon_licenses() {\n $licenses = [];\n\n return apply_filters( 'erp_settings_licenses', $licenses );\n}", "public function store()\n\t{\n\t\t$inputs = Input::all();\n\t\t$inputs['license'] = \"<<<LICENSER\".sha1(mt_rand(10000,99999).time().$inputs['name']).\n\t\t\tsha1($inputs['name'].time().mt_rand(10000,99999)).\n\t\t\tsha1($inputs['name'].mt_rand(10000,99999).time()).\n\t\t\tsha1($inputs['name'].time().uniqid()).\n\t\t\tsha1(uniqid().$inputs['name'].time()).\"LICENSER>>>\";\n\n\t\t$inputs['user_id'] = Auth::user()->id;\n\n\t\t$license = new License($inputs);\n\t\tif ($license->save())\n\t\t{\n\t\t\treturn Redirect::to('/licenses')->with('alert', ['type' => 'success', 'message' => 'La licencia ha sido generada con exito.']);;\n\t\t}\n\t\treturn Redirect::to('/licenses')->with('alert', ['type' => 'danger', 'message' => 'Ocurrio un error, intenta mas tarde.']);;\n\n\t}", "public function store()\n\t{\n\n\t\t$software_id = $this->sanitizeString(Input::get(\"id\"));\n\t\t$licensekey = $this->sanitizeString(Input::get(\"licensekey\"));\n\t\t$multiple = $this->sanitizeString(Input::get('usage'));\n\n\t\t$validator = Validator::make([\n\t\t\t'Product Key' => $licensekey\n\t\t],SoftwareLicense::$rules);\n\n\t\tif($validator->fails())\n\t\t{\n\t\t\tSession::flash('error-message','Problem encountered while processing your request');\n\t\t\treturn redirect()->back();\n\t\t}\n\n\t\t$softwarelicense = new SoftwareLicense;\n\t\t$softwarelicense->software_id = $software_id;\n\t\t$softwarelicense->key = $licensekey;\n\t\t$softwarelicense->multipleuse = $multiple;\n\t\t$softwarelicense->inuse = false;\n\t\t$softwarelicense->save();\n\n\t\tSession::flash('success-message','Software License Added');\n\t\treturn redirect(\"software/license/$software_id\");\n\t}", "public function save_license_key( $key ) {\n\t\t$this->activate_license( $key );\n\t\t$license = get_transient( self::TRANSIENT_NAME );\n\n\t\tif ( ! $this->is_valid() ) {\n\t\t\t$key = '';\n\t\t\tif ( isset( $license['license'] ) && self::REQUEST_FAILED === $license['license'] ) {\n\t\t\t\tblock_lab()->admin->settings->prepare_notice( $this->license_request_failed_message() );\n\t\t\t} else {\n\t\t\t\tblock_lab()->admin->settings->prepare_notice( $this->license_invalid_message() );\n\t\t\t}\n\t\t} else {\n\t\t\tblock_lab()->admin->settings->prepare_notice( $this->license_success_message() );\n\t\t}\n\n\t\treturn $key;\n\t}", "function SetDriverType($str) {\n $this->strDriverType = $str;\n }", "function alm_filters_sanitize_license( $new ) {\n \t$old = get_option( 'alm_filters_license_key' );\n \tif( $old && $old != $new ) {\n \t\tdelete_option( 'alm_filters_license_status' ); // new license has been entered, so must reactivate\n \t}\n \treturn $new;\n }", "public static function generateSIDSkrillBuyLicense(License $license, $data)\n {\n //una licencia paga para el mismo producto\n \tif($license->state == 'Active' && $license->product->state == 'Active' && ($license->product->name == 'TrSoft/Copy Binary' && !Auth::user()->paidProduct(env('BINARY_COPY_ID')) && !Auth::user()->activeProductWithPayment(env('BINARY_COPY_ID')))){\n \t\t$transfer = Transfer::generateTransferObject($license->id);\n\n $commissions_pending_payment = Auth::user()->commissionsPendingPaymentValue(true);\n\n \t\t$data_send = [\n\t \t\t'pay_to_email' => env('SKRILL_EMAIL'),\n\t \t\t'logo_url' => url('images/logo_icon/logo_xs.png'),\n\t \t\t'return_url' => url('process-payment/license'),\n\t \t\t'cancel_url' => url('product'),\n\t \t\t'status_url' => url('api/v1/service/p-p-2020'),\n\t \t\t'language' => $data['language'],\n\t \t\t'amount' => $license->lastPrice()->price + $commissions_pending_payment,\n\t \t\t'currency' => 'USD',\n\t \t\t'detail1_description' => $license->product->name.($commissions_pending_payment?(' + '.__('messages.commissions_pending_payment')):''),\n\t \t\t'detail1_text' => $license->name,\n\t \t\t'prepare_only' => 1,\n\t \t\t'transaction_id' => $transfer->identifier\n\t \t];\n\n\t \t$client = new Client();\n\n\t \t$res = $client->request('POST', env('SKRILL_PAY_URL'), [\n\t \t\t'headers' => [\n\t \t\t\t'Content-Type' => 'application/x-www-form-urlencoded'\n\t \t\t],\n\t \t\t'form_params' => $data_send\n\t \t]);\n\n\t \tif($res->getStatusCode() == 200){\n\t\t \treturn $res->getBody()->getContents();\n\t\t }\n \t}\n\n \treturn false;\n }", "function setDriverDir( $driverDir )\n\t{\n\t\t$this->driverDir = $driverDir;\n\t}", "function setPrice($price)\n {\n $this->price = $price;\n }", "public function setOS($os)\n {\n return $this->setParam(self::SOFTWARE_OS_PARAM_NAME, $os);\n }", "function setPrice($new_price)\n {\n $this->price = $new_price;\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function setDeviceVendor($val)\n {\n $this->_propDict[\"deviceVendor\"] = $val;\n return $this;\n }", "function setYear($iyear)\n {\n $this->iyear = $iyear;\n }", "public function licenses()\n {\n // belongsToMany(RelatedModel, pivotTable, thisKeyOnPivot = computer_id, otherKeyOnPivot = license_id)\n return $this->belongsToMany(License::class, 'assign_licenses');\n }", "public function setPoolRelease($release)\n\t{\n\t\t$this->setProperty('release', $release);\n\t}", "public function generateLicenseKeys()\n {\n $rsaConfig = [\n \"digest_alg\" => \"sha512\",\n \"private_key_bits\" => 4096,\n \"private_key_type\" => OPENSSL_KEYTYPE_RSA,\n ];\n\n // Generate the RSA Key.\n $res = openssl_pkey_new($rsaConfig);\n openssl_pkey_export($res, $privateKey);\n $publicKey = openssl_pkey_get_details($res)['key'];\n\n // Now Save it to the database.\n $this->db->beginTransaction();\n $modules = array_merge([1, 12], $_POST['modules']);\n sort($modules, SORT_NUMERIC);\n $this->db->executeQuery(\n \"INSERT INTO license (client_id, ip_addr, domains, activation_date,expiry_date, modules_installed, license_key) \n VALUES (:clientId,:ip,:domains,:activation,:expiry,:modules,:key)\",\n [\n \":clientId\" => $_POST['clientId'],\n \":ip\" => $this->_processDomainIps($_POST['ips']),\n \":domains\" => $this->_processDomainIps($_POST['domains']),\n \":activation\" => $_POST['activation'],\n \":expiry\" => $_POST['expiry'],\n \":modules\" => GlobalFunction::pgImplode($modules),\n \":key\" => $privateKey,\n ]\n );\n\n $this->db->commit();\n\n $this->response = [\"license\" => $this->_keyHeaderFooter($publicKey)];\n }", "public function setCustomerSkin()\n {\n $this->skin = null;\n $this->locale = null;\n $this->currentInterface = \\XLite::CUSTOMER_INTERFACE;\n\n $this->setOptions();\n }", "public function activate() {\n\n\t\t// Get License\n\t\t$license = $this->get_license();\n\n\t\ttry {\n\n\t\t\t// Check License key\n\t\t\tif ( '' === $license->get_key() ) {\n\t\t\t\tthrow new Exception( 'Please enter your license key.' );\n\t\t\t}\n\n\t\t\t// Check license email\n\t\t\tif ( '' === $license->get_email() ) {\n\t\t\t\tthrow new Exception( 'Please enter the email address associated with your license.' );\n\t\t\t}\n\n\t\t\t// Do activate request\n\t\t\t$request = wp_remote_get( self::STORE_URL . self::ENDPOINT_ACTIVATION . '&' . http_build_query( array(\n\t\t\t\t\t'email' => $license->get_email(),\n\t\t\t\t\t'licence_key' => $license->get_key(),\n\t\t\t\t\t'api_product_id' => $this->product_id,\n\t\t\t\t\t'request' => 'activate',\n\t\t\t\t\t'instance' => site_url()\n\t\t\t\t), '', '&' ) );\n\n\t\t\t// Check request\n\t\t\tif ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t}\n\n\t\t\t// Get activation result\n\t\t\t$activate_results = json_decode( wp_remote_retrieve_body( $request ), true );\n\n\t\t\t// Check if response is correct\n\t\t\tif ( ! empty( $activate_results['activated'] ) ) {\n\n\t\t\t\t// Set local activation status to true\n\t\t\t\t$license->set_status( 'active' );\n\t\t\t\t$this->set_license( $license );\n\n\t\t\t\t// Return Message\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'message' => __( 'License successfully activated.', 'download-monitor' )\n\t\t\t\t);\n\n\t\t\t} elseif ( $activate_results === false ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t} elseif ( isset( $activate_results['error_code'] ) ) {\n\t\t\t\tthrow new Exception( $activate_results['error'] );\n\t\t\t}\n\n\n\t\t} catch ( Exception $e ) {\n\n\t\t\t// Set local activation status to false\n\t\t\t$license->set_status( 'inactivate' );\n\t\t\t$this->set_license( $license );\n\n\t\t\t// Return error message\n\t\t\treturn array( 'result' => 'failed', 'message' => $e->getMessage() );\n\t\t}\n\t}", "public function licenseTask()\n\t{\n\t\t// Get our model and load publication data\n\t\t$this->model = new Models\\Publication($this->_identifier, $this->_version);\n\n\t\tif (!$this->model->exists() || $this->model->isDeleted())\n\t\t{\n\t\t\tNotify::error(Lang::txt('COM_PUBLICATIONS_RESOURCE_NOT_FOUND'));\n\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// get license details\n\t\t$this->model->license();\n\n\t\t// Output HTML\n\t\t$this->view\n\t\t\t->set('option', $this->_option)\n\t\t\t->set('config', $this->config)\n\t\t\t->set('publication', $this->model)\n\t\t\t->set('title', stripslashes($this->model->version->get('title')) . ': ' . Lang::txt('COM_PUBLICATIONS_LICENSE'))\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->display();\n\t}" ]
[ "0.67197067", "0.64952075", "0.62663245", "0.6163147", "0.6150745", "0.609645", "0.609401", "0.6064311", "0.60474163", "0.60228443", "0.59956026", "0.59506667", "0.5914437", "0.5708021", "0.56223834", "0.55707276", "0.55000967", "0.5455305", "0.54331964", "0.5422291", "0.5422117", "0.5406274", "0.53928167", "0.53753394", "0.53653634", "0.53321713", "0.5296611", "0.5290228", "0.52723664", "0.52712464", "0.52574825", "0.52571213", "0.52418035", "0.52267045", "0.5217756", "0.51661307", "0.51591307", "0.51508886", "0.5133816", "0.50923526", "0.50775564", "0.50471807", "0.5043729", "0.50429773", "0.5034826", "0.5027925", "0.5012155", "0.49978715", "0.4987259", "0.4974184", "0.4958624", "0.4947629", "0.4940112", "0.49343076", "0.49251178", "0.49235824", "0.4916754", "0.4897631", "0.48880434", "0.48806694", "0.48785347", "0.48578048", "0.48517793", "0.48439693", "0.48373985", "0.4832384", "0.48220572", "0.48079702", "0.48079702", "0.48079702", "0.48079702", "0.48079702", "0.48079702", "0.47633368", "0.4746719", "0.4731546", "0.47266233", "0.4722653", "0.47203904", "0.4706946", "0.47009787", "0.47001362", "0.46990168", "0.468092", "0.46762782", "0.46757355", "0.4644755", "0.4643332", "0.4639308", "0.4632652", "0.46325502", "0.46325502", "0.4614011", "0.46135703", "0.4611209", "0.46111786", "0.46074682", "0.46044838", "0.46034217", "0.46018812" ]
0.57874405
13
Sets a new taxId
public function setTaxId($taxId) { $this->taxId = $taxId; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setIdTax($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->id_tax !== $v) {\n $this->id_tax = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_ID_TAX] = true;\n }\n\n return $this;\n }", "public function setTaxClassId($taxClassId);", "public function setTaxNo($taxno);", "public function setTax(string $value): void\n {\n if (is_null($value)) {\n return;\n }\n\n if ($value == 0) {\n $value = 'TAX_0';\n } else {\n $value = number_format($value, 2);\n\n // not sure why has two underscores?\n if ($value < 1) {\n $value = 'TAX__' . str_replace('0.', '', $value);\n } else {\n $value = 'TAX_' . str_replace('.', '_', $value);\n }\n }\n\n $this->elements['tax-class-id'] = $value;\n }", "public function setTax($tax)\n {\n $this->tax = $tax;\n }", "public function setProductTax($id_product, $tax)\n {\n $this->deleteProductTax($id_product);\n Db::getInstance()->insert('product_tax', [\n 'id_product' => $id_product,\n 'tax' => $tax\n ]);\n }", "public function getTaxIdAttribute()\n {\n return $this->exists ? $this->attributes['tax_id'] : Tax::getDefaultTaxId();\n }", "public function getIdTax()\n {\n return $this->id_tax;\n }", "public function setCidTax($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->cid_tax !== $v) {\n $this->cid_tax = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_CID_TAX] = true;\n }\n\n return $this;\n }", "public function setTax(float $tax)\n\t{\n\t\t$this->addKeyValue('Tax', $tax); \n\n\t}", "public function setTax($tax)\n {\n if ($this->_validation->validateIsNumeric($tax)) {\n $this->_tax = $tax;\n } else {\n throw new PiRatepay_Paypage_Util_ValidationException(200);\n }\n }", "function setTaxes($taxes)\n {\n $this->taxes = $taxes;\n }", "public function getTaxClassId();", "public function setTaxAmount($amount);", "public function setId($x) { $this->id = $x; }", "public function set_id($setid){\n $this->id = $setid;\n }", "public function setTax(?float $tax): self\n {\n $this->initialized['tax'] = true;\n $this->tax = $tax;\n\n return $this;\n }", "public function setId($id)\n {\n $this->setIdSale($id);\n }", "public function setTaxInfo(KCommandContext $context)\n\t{\n\t\t$vats = $context->data->federal_tax;\n \n\t\t$this->getItem()->setFederalTax( KConfig::unbox( $vats ) );\n\t}", "function setTaxonomyType($setTaxType) {\n $this->taxonomyType = $setTaxType;\n }", "public function setTaxInvoiced($taxInvoiced);", "public function setTaxAmount($amount) {\r\n $this->taxAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }", "public function setTaxRateKey($taxRateKey);", "public function setTax($tax) {\n $this->_tax = $tax;\n return $this;\n }", "public function collectTaxIds()\n {\n $this->collectTaxIds = true;\n\n return $this;\n }", "public function setLineTax(array $lineTax)\n\t{\n\t\t$this->addKeyValue('line_tax', $lineTax); \n\n\t}", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "public function setTurmaId(int $turma_id)\n {\n $this->turma_id = $turma_id;\n \n }", "function setId($id) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:id', $id);\r\n\t}", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function set_tyk_id($id) {\n\t\tupdate_user_meta($this->user->ID, self::META_TYK_USER_ID_KEY, $id);\n\t}", "public function setTaxType($taxType) {\n $this->taxType = $taxType;\n\n return $this;\n }", "public function setId($id){\n $this->_id = $id;\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setIdVit($id){\n\t\t$this->id = $id;\n\t}", "public function setTaxCanceled($taxCanceled);", "function setAmocrmIntegreationId(string $id): void {\n\t}", "function setId($id)\n\t{\n\t\t// Set suburb ID and wipe data\n\t\t$this->_id\t\t\t= $id;\n\t\t$this->_suburb\t= null;\n\t}", "public function setTaxvat($quote, $taxvat)\n {\n if ($quote->getCustomerId()) {\n $quote->getCustomer()\n ->setTaxvat($taxvat)\n ->save();\n }\n $quote->setCustomerTaxvat($taxvat)->save();\n }", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "function SetId($value) { $this->id=$value; }", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function setId($id)\n {\n $this->_id = $id;\n }", "public function set($new_id);", "public function setId($id)\n {\n $this->id = $id ? $id : uniqid();\n }", "public function setBaseTaxAmount($amount);", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId(?string $id): void {\n\t\t$this->setAttribute(\"id\", $id);\n\t}", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "public function setId($id) {\n $this->id = $id;\n }", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function setTransactionId($id)\n {\n $this->_data['trx_id'] = $id;\n }", "function setId($id)\n {\n $this->id = $id;\n }", "public function setIdcotizacion($idcotizacion){\n $this->idcotizacion = $idcotizacion;\n }", "function setId_tarifa($iid_tarifa)\n {\n $this->iid_tarifa = $iid_tarifa;\n }", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id){\n $this->id = $id;\n }", "public function saveTax() {\n // $productIds = explode(\",\", Input::get('ProductIds'));\n $marchantId = Input::get(\"merchantId\");\n $merchant = Merchant::find(Input::get('merchantId'))->getstores()->first();\n $prifix = $merchant->prefix;\n $taxNew = [];\n $taxNew['label'] = Input::get('label');\n $taxNew['name'] = Input::get('label');\n $taxNew['rate'] = Input::get('rate');\n $taxNew['tax_number'] = Input::get('tax_number');\n $taxNew['status'] = Input::get('status');\n\n if (Input::get('id')) {\n DB::table($prifix . '_tax')->where(\"id\", Input::get(\"id\"))->update($taxNew);\n } else {\n DB::table($prifix . '_tax')->insert($taxNew);\n }\n\n $viewname = \"\";\n $data = ['status' => '1', 'msg' => (Input::get('id')) ? 'Tax updated successfully.' : 'Tax added successfully.', 'taxinfo' => $taxNew];\n return Helper::returnView($viewname, $data, $url = 'admin.tax.view');\n }", "private function setId($id)\n {\n $this->id = $id;\n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function SetId ($id);", "function set_id($id)\n {\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id) \n {\n $this->id = $id;\n }", "public function setID($id) {\n $this->id = $id; \n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setTrxId($trxId)\n {\n if ($trxId == null || strtolower($trxId) == 'autocreatetrxid') {\n $this->trxId = $this->autoGenerateTrxId();\n } elseif (strlen($trxId) < 30) {\n $this->trxId = $this->modifyTrxId($trxId);\n } else {\n $this->trxId = $trxId;\n }\n\n return $this;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id){\n\t\t\t$this->id = $id;\n\t\t}", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }", "protected function setId($id)\n {\n $this->id = $id;\n }", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) { $this->id = $id; }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "public function setID($id){\n $this->id = $id;\n }", "function set_TID($ID) {\n $this->ID = $ID;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }" ]
[ "0.7770286", "0.7225705", "0.7085616", "0.68768656", "0.6690859", "0.6395619", "0.6302", "0.6136931", "0.61057764", "0.6047288", "0.6025114", "0.6017851", "0.5953893", "0.59431165", "0.5864303", "0.583005", "0.5826851", "0.5820904", "0.5801631", "0.57827836", "0.5754902", "0.5751263", "0.57389057", "0.5719984", "0.5701257", "0.5612083", "0.55972606", "0.5579445", "0.55794275", "0.5566714", "0.5559265", "0.55534786", "0.55511916", "0.5549657", "0.5543274", "0.55414635", "0.5539878", "0.55380434", "0.55315334", "0.55286425", "0.5524477", "0.5524477", "0.55192405", "0.55073255", "0.54907197", "0.5490137", "0.5489263", "0.54823107", "0.54798365", "0.5472827", "0.5472435", "0.54691184", "0.54683346", "0.5458559", "0.5458009", "0.5452529", "0.5452461", "0.5450678", "0.5450259", "0.5450259", "0.5443604", "0.5440051", "0.54364395", "0.5434539", "0.5431872", "0.5431872", "0.5431872", "0.5431872", "0.5431872", "0.5431756", "0.5424075", "0.54235584", "0.54235584", "0.54235584", "0.5419266", "0.5418359", "0.54127437", "0.541104", "0.54104507", "0.5410018", "0.5409076", "0.5409076", "0.5409076", "0.5409076", "0.5403147", "0.5399558", "0.5389993", "0.5386729", "0.5386729", "0.5385687", "0.53783536", "0.53755826", "0.5373204", "0.53729314", "0.53703785", "0.53703785", "0.53703785", "0.53703785", "0.53703785", "0.53703785" ]
0.6751356
4
Run the database seeds.
public function run() { factory(Habitacion_Reserva::class,50)->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' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Initialize method for model.
public function initialize() { $this->hasMany("id", "PostTags", "tags_id", NULL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "protected function _construct()\n {\n $this->_init(Model::class, ResourceModel::class);\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "public function init() {\n \n }", "public function init() {\n \n }", "public function init() {\n \n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function init()\n {\n }", "public function __construct() {\n $this->_initialize();\n }", "function init()\n {\n /**\n * The database table to store the model.\n * The table name will be prefixed with the prefix define\n * in the global configuration.\n */\n $this->_a['table'] = 'todo_lists';\n \n /**\n * The definition of the model.\n * Each key of the associative array\n * corresponds to a \"column\" and the definition of the column is\n * given in the corresponding array.\n */\n $this->_a['cols'] = array(\n // It is mandatory to have an \"id\" column.\n 'id' => array(\n 'type' => 'Pluf_DB_Field_Sequence',\n // It is automatically added.\n 'blank' => true\n ),\n 'name' => array(\n 'type' => 'Pluf_DB_Field_Varchar',\n 'blank' => false,\n 'size' => 100,\n // The verbose name is all lower case\n 'verbose' => 'name'\n )\n );\n /**\n * You can define the indexes.\n * Indexes are you to sort and find elements. Here we define\n * an index on the completed column to easily select the list\n * of completed or not completed elements.\n */\n $this->_a['idx'] = array();\n $this->_a['views'] = array();\n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "public function init()\n {\n \n \n }", "function __construct(){\n\t\tparent::__construct();\n\t\t\t$this->set_model();\n\t}", "public function initialize()\n {\n parent::initialize();\n\n // Create config strings\n $this->config = [\n 'models' => [\n 'Files' => __d('elabs', 'File'),\n 'Notes' => __d('elabs', 'Note'),\n 'Posts' => __d('elabs', 'Article'),\n 'Projects' => __d('elabs', 'Project'),\n 'Albums' => __d('elabs', 'Album'),\n ]\n ];\n\n // Load models\n foreach (array_keys($this->config['models']) as $model) {\n $this->$model = TableRegistry::get($model);\n }\n }", "public function __construct() {\n $this->init();\n }", "function __construct( ) {\n $this->initialize( );\n }", "public function initialize() {\n parent::initialize();\n }", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function _initialize()\n {\n // 客户资料\n $CustId = I('CustId');\n $this->customer = M('Customer')->find($CustId);\n\n // 操作者资料\n $this->user = session('user');\n }", "public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }", "protected function _construct()\n {\n $this->_init(CarrierModel::RATE_TABLE_NAME, 'rate_id');\n }", "public function initialize () {\n }", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}", "public function __construct() {\n\t\t\t$this->init();\n\t\t}", "public function initialize() {}", "protected function __init__() { }", "public function initialize()\n {\n \n }", "public function initialize()\n {\n $this->setSchema(\"animedb\");\n $this->setSource(\"episodes\");\n $this->hasMany('id', 'Videos', 'episode_id', ['alias' => 'Videos']);\n $this->belongsTo('anime_id', '\\Anime', 'id', ['alias' => 'Anime', 'reusable' => true]);\n $this->allowEmptyStringValues(['title', 'description']);\n $this->skipAttributes(['date']);\n }", "public function initialize()\n {\n parent::initialize();\n }", "public function initialize()\n {\n parent::initialize();\n }", "public function __construct() {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}", "public function init()\n {\n \t\n }", "public function init()\n {\n \t\n }", "public function initialize()\n {\n parent::initialize();\n }", "public function init(){\n\t\t\t\t}", "protected function _initialize()\n {\n $this->metadata()->setTablename('turma');\n $this->metadata()->setPackage('Model');\n \n # nome_do_membro, nome_da_coluna, tipo, comprimento, opcoes\n \n $this->metadata()->addField('id', 'id', 'int', 11, array('primary' => true, 'notnull' => true, 'autoincrement' => true));\n $this->metadata()->addField('foto', 'foto', 'varchar', 45, array());\n $this->metadata()->addField('ano', 'ano', 'int', 11, array('notnull' => true));\n $this->metadata()->addField('semestre', 'semestre', 'int', 1, array('notnull' => true));\n\n \n $this->metadata()->addRelation('egressos', Lumine_Metadata::ONE_TO_MANY, 'Egresso', 'turmaId', null, null, null);\n }", "public function init() {\n\t\t// use this method to initialize default values.\n\t}", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "private function __construct($model)\r\n {\r\n\r\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function init(){}", "public function init(){}", "public function initialize()\n {\n }", "public function initialize()\n {\n $this->setSchema(\"muslim_life\");\n $this->setSource(\"jadwalshalat\");\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function initialize()\n {\n }", "public function init() {\n }", "public function initialize()\n {\n $this->keepSnapshots(true);\n $this->addBehavior(new Blameable());\n $this->useDynamicUpdate(true);\n $this->hasMany(\"id\", \"models\\Formentrys\", \"form_id\", ['alias' => 'Entries']);\n $this->hasMany(\"id\", \"models\\Formfields\", \"form_id\", ['alias' => 'Formfields']);\n $this->belongsTo(\"user_id\", \"models\\Users\", \"id\", ['alias' => 'Users']);\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }", "public function init() {\n }" ]
[ "0.77167964", "0.7618666", "0.75896466", "0.75896466", "0.75786567", "0.7461966", "0.7461966", "0.7461966", "0.7457713", "0.7457713", "0.74557793", "0.74555385", "0.7455282", "0.7455282", "0.7455282", "0.7455282", "0.7455282", "0.7455282", "0.7455282", "0.7455282", "0.7455282", "0.7449114", "0.74173653", "0.73880064", "0.73737586", "0.73714316", "0.7349159", "0.7332978", "0.73256636", "0.7323763", "0.7316182", "0.7316182", "0.7316182", "0.7316182", "0.7302338", "0.7292979", "0.7283122", "0.72728467", "0.72648966", "0.72648966", "0.72648966", "0.72648966", "0.72648966", "0.7264263", "0.7264263", "0.7264168", "0.7264168", "0.7264168", "0.72638416", "0.72633606", "0.7258978", "0.72554463", "0.72429025", "0.72344756", "0.72344756", "0.7232329", "0.7227912", "0.7223344", "0.7223344", "0.7222515", "0.7219525", "0.7214539", "0.72144496", "0.7209545", "0.7209545", "0.7209545", "0.7209545", "0.7209545", "0.72080517", "0.7207927", "0.7207927", "0.7207927", "0.7207927", "0.7207927", "0.71906894", "0.71906894", "0.7188351", "0.7184941", "0.717809", "0.717809", "0.717809", "0.717809", "0.717809", "0.717809", "0.717809", "0.717809", "0.717809", "0.717809", "0.71728545", "0.717241", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888", "0.7168888" ]
0.0
-1
Check if any user logged in else redirect to login
function delete_file() { $is_logged_in = $this->common_lib->is_logged_in(); if ($is_logged_in == FALSE) { $this->session->set_userdata('sess_post_login_redirect_url', current_url()); if($this->data['is_admin'] === TRUE){ redirect($this->router->directory.'admin/login'); }else{ redirect($this->router->directory.'user/login'); } } $id = $this->input->get_post('id'); $file_path = $this->input->get_post('file_path'); if ($id) { $where_array = array('id' => $id); $res = $this->user_model->delete($where_array, 'uploads'); if ($res) { $this->common_lib->unlink_file(array(FCPATH . $file_path)); } echo json_encode("success"); } else { echo json_encode("error"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _checkAndRedirect() {\n $auth = $this->_checkAuthentication();\n if(true === $auth) { // authentication required, redirects to login page\n $user = $this->getCurrentUser();\n if(null === $user) { // user doesn't appear do be logged in\n $this->flashMessenger()->addErrorMessage(IControllerMessages::FATAL_ERROR_NOT_AUTHENTIFICATED);\n $this->redirect()->toRoute(IRouteStore::LOGIN); // break;\n return;\n }\n else {\n \treturn $user;\n }\n }\n else {\n \texit;\n \treturn false;\n }\n }", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "function redirect_when_logged() {\n $is_logged_in = AppAuthentication::is_logged_in();\n\n // If the user is already logged in we redirect to the default path of\n // his role.\n if ($is_logged_in) {\n $user_info = AppAuthentication::get_user_data();\n redirect_to_user_default_path($user_info);\n return TRUE;\n }\n\n return FALSE;\n }", "public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }", "private function check_is_user_login()\n\t{\n\t\tif($this->session->userdata('logged_in') != FALSE)\n\t\t{\n\t\t\tredirect('home');\n\t\t}\n\t}", "public function logged_in_redirect(){\n\n\t\tif (isset($_SESSION['user_id'])) {\n\t\t \t# code...\n\t\t \theader('Location: index.php');\n\t\t } \n\t}", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }", "private function checkLogged() {\r\n if (isset($_SESSION['user'])) {\r\n return $_SESSION['user'];\r\n }\r\n header('Location: /login');\r\n }", "public function redirect_if_logged_in()\n {\n Session::_start();\n if(isset($_SESSION['user']))\n {\n header('location: ' . URL_WITH_INDEX_FILE . 'results/index');\n exit();\n }\n }", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "protected function checkUser() {\n if(!$this->session->userdata(\"usuario_id\")) {\n redirect(\"/login\");\n }\n }", "private function checkLogin() {\n\t\t\n\t\tif ( ! $this->user_model->isLoggedIn() )\n\t\t\tredirect( base_url() . 'admin' );\n\n\t}", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "function userLoggedIn()\n{\n\tif(Auth::check()) {\n\t\t// Log::info('');\n\t\theader('Location: /users/account?id=' . Auth::id() );\n\t\tdie();\n\t}\n}", "public function checkLoggedIn() {\n\t\t\tif (isset($_SESSION['username'])) {\n\t\t\t\t// Get User object from the database\n\t\t\t\t$this->dao = new UserDAO();\n\t\t\t\treturn $this->dao->getUser($_SESSION['username']);\n\t\t\t}\n\t\t\t//redirect to login page\n\t\t\theader('Location: ./');\n\t\t}", "private function checkLogin() {\n\t\t$session = $this->Session->read ( 'sessionLogado' );\n\t\tif (empty ( $session )) {\n\t\t\t$this->Session->write ( 'sessionLogado', false );\n\t\t}\n\t\t\n\t\tif ($this->params ['plugin'] == 'users') {\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'home' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'signatures' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function restrict() {\n\t\tif (!$this->is_logged_in()) {\n\t\t\tredirect('login', 'refresh');\n\t\t}\n\t}", "public function checkAuthentication() \n {\n if(!isset($this->userInfo['admin_id']) && empty($this->userInfo['admin_id'])) \n {\n redirect('login/loginPage');\n }\n }", "protected function loginIfRequested() {}", "public static function checkLogged()\n {\n\n if (isset($_SESSION['user'])) {\n return $_SESSION['user'];\n }\n header(\"Location: /user/login\");\n }", "public function requireLogin(){\n if( ! Authentifiacation::isLoggedIn()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to login to view this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "public function checkAccess() {\n $this->maybeStartSession();\n\n //If user is not logged in, redirect to login page\n if(!isset($_SESSION['userID'])) {\n header('Location: login.php');\n die();\n }\n\n //if user doesn't exist in database, redirect to logout page to clear session\n $repo = $this->getRepository();\n if($repo && !$repo->getUser($_SESSION['userID'])) {\n header('Location: logout.php');\n die();\n }\n }", "private function checkLogin()\n {\n // save the user's destination in case we direct them to authenticate\n\n // whitelist authentication mechanisms\n if($this->_controller == \"authenticate\")\n return;\n\n // whitelist database reload\n if($this->_controller == \"populatetestdata\")\n return;\n\n if(!isset($_SESSION['userid']))\n {\n // Don't redirect the user to an error page just in principle\n // @todo possible @bug why would it do this?\n if($this->_controller != \"error\" && $this->_controller != \"undefined\")\n {\n $this->slogger->slog(\"saving destination to \" . $this->_controller, SLOG_DEBUG);\n $_SESSION['destination'] = $this->_controller;\n }\n redirect('authenticate');\n\n }\n\n }", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "protected function check_logged_in(){\n\n\t\t$this->load->model('patoauth/patoauth_model', 'patoauth');\n\n\t/*\n\t\tTRY TO AUTOLOGIN */\n\n\t\tif(! $this->patoauth->is_logged_in())\n\t\t\t$this->patoauth->autologin();\n\n\t/*\n\t\tIF STILLS NO LOGGED IN GET OUT OF HERE */\n\n\t\tif(! $this->patoauth->is_logged_in())\n\t\t\tredirect(site_url('auth/login'));\n\t}", "public function loggedIn ()\r\n {\r\n\r\n if (isset($_SESSION['userID'])) {\r\n return true;\r\n } else {\r\n header('Location: login');\r\n exit;\r\n }\r\n }", "public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}", "function is_already_authenticated()\n {\n /**\n * Checks is user already authenticated\n * If it's true, sends to main page\n */\n $session = Session::getInstance();\n $username = $session->username;\n $logged = $session->logged;\n if (self::check($username,$logged))\n {\n header(\"Location: /admin\");\n }\n }", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "public function checkLoggedIn()\n {\n if(!isset($_SESSION['user_id']))\n {\n redirect('pages/view/home');\n exit;\n }\n else\n {\n return $user_id=$_SESSION['user_id'];\n }\n }", "public function loginUserConditionMatchIfUserIsNotLoggedIn() {}", "function checkIfUserIsLoggedInAndRedirect($redirectLocation = null){\n if(isLoggedIn()){\n redirect($redirectLocation);\n }\n}", "private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }", "public function must_be_logged_in()\n {\n Session::_start();\n if(!isset($_SESSION['user']))\n {\n Session::_destroy();\n header('location: ' . URL_WITH_INDEX_FILE . 'login/index');\n exit();\n }\n }", "public function UserIsSignedInOrRecirectToSignIn() {\n\t\t\n\t\tif(!isset($_SESSION['accountUser'])) { \n\t\t\trequire(TP_PAGESPATH . '/pages_login/PLogin.php');\n\t\t}\n\t}", "public function checkLoggedIn()\n\t\t{\n\t\t\t\n\t\t\ttry {\n\t\t\t \n\t\t\t\t$query = $this->_db->prepare( \"SELECT username FROM login WHERE username=:username\" );\n \n \n\t\t\t\t$query->bindParam( \":username\", $_SESSION[ 'username' ], PDO::PARAM_STR );\n\n\t\t\t\t$query->execute();\n\t\t\t\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\n\t\t\t$row = $query->fetch();\n\t\t\t\n \n\t\t\t$loggedInUser = $row[ 'username' ];\n \n //if the user is not logged in\n\t\t\tif( !isset( $loggedInUser ) )\n\t\t\t{\n //head to the log in page\n\t\t\t\theader( 'Location: login.php' );\n\n\t\t\t}\n\t\t\t\n\t\t}", "function validateUser() {\n\tif (!isLoggedIn()) {\n\t\tredirectTo(\"index.php\");\n\t}\n}", "public static function checkLogged()\r\n {\r\n // If there is a session, return the user ID\r\n if (isset($_SESSION['user'])) {\r\n return $_SESSION['user'];\r\n }\r\n\r\n header(\"Location: /user/login\");\r\n }", "private function checkIfLoggedIn()\n {\n if (!session()->has('user')) {\n abort(403, 'You are not logged in.');\n }\n }", "public function checkLogin() {\n if (!$this->isLoggedIn()) {\n Router::getInstance()->redirect('login');\n }\n return $this->getCurrentUser();\n }", "public static function check() {\n session_start();\n if (!isset($_SESSION['user'])) {\n header('Location: /');\n exit;\n }\n }", "function isLogin()\n\t {\n\t\t if(empty($_SESSION['username']) || empty($_SESSION['user']))\n\t\t {\n\t\t\t header(\"Location:login.php\");\n\t\t }\n\t }", "public function isLoggedIn()\n {\n if (isset($_SESSION['username'], $_SESSION['email'])) {\n return true;\n } else {\n $url=URL::getURI('login/required');\n header(\"location:$url\");\n }\n }", "public function LoginCheck()\n {\n $protocol = Yii::app()->params['protocol'];\n $servername = Yii::app()->request->getServerName();\n $user = Yii::app()->session['username'];\n if (empty($user)) {\n $returnUrl = $protocol . $servername . Yii::app()->homeUrl;\n $this->redirect($returnUrl);\n }\n }", "function ifLoggedIn(){\n\t\n\tif(isset($_SESSION[\"userinfo\"])){\n\t\t\n\t\t\n\t\tif($_SESSION[\"userinfo\"][\"role\"]==1){\n\t\t\tredirect(\"admin.php\");\n\t\t}\n\n\t\tif($_SESSION[\"userinfo\"][\"role\"]==2){\n\t\t\tredirect(\"member.php\");\n\t\t}\n\t\t\n\t}\n}", "abstract protected function isUserLoggedIn() ;", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "public static function perform_login_check() {\n\t\tif (self::is_logged_in()) {\n\t\t\t# User is logged in - leave them be\n\t\t\treturn (true);\n\t\t} else {\n\t\t\t# User isn't logged in - send them to the login form\n\t\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t\t\t$extra = 'login.php';\n\t\t\theader(\"Location: http://$host$uri/$extra\");\n\n\t\t\texit;\n\t\t}\n\t}", "protected function redirectNotLoggedIn(){\r\n if(!$this->login->isloggedIn()){\r\n header(\"Location: \".BASE_URI.Routes::getUri('signin').'?rd=true');\r\n }\r\n }", "function redirect_logged_in_users()\n{\n\tif(is_user_logged_in())\n\t{\n\t\theader(\"Location: \".HOME_URL);\n\t}\n}", "public static function checkLogin() {\n\t\t\n\t\tif(!isset($_SESSION[\"uid\"])) {\n ?>\n <script language=\"javascript\">\n window.location.href = \"login.php\"\n </script>\n <?php\n \t}\n\n\t}", "private function handleJustLoggedIn() {\n $this->authenticatedView->setViewMessage(\"Welcome\");\n\n $keepLoggedIn = $this->userRequest->wantsToStayLoggedIn();\n \n if ($keepLoggedIn) {\n $userCredentials = $this->getUserCredentials();\n $cookieHandler = new CookieHandler();\n $cookieHandler->serveCookie($userCredentials);\n }\n }", "public function checkLogged() {\n if (!PlonkSession::exists('id')) {\n PlonkWebsite::redirect($_SERVER['PHP_SELF'] . '?' . PlonkWebsite::$moduleKey . '=home&' . PlonkWebsite::$viewKey . '=home');\n } \n }", "public function check_login()\n {\n if (!$this->session->userdata('is_login')) {\n redirect('auth/login');\n }\n }", "public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}", "public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, profilePic, access, email FROM users WHERE username='$username' AND password='$password'\";\r\n\t\t$data = $this -> singleSelectQuery($query);\r\n\t\tif($data){\r\n\t\t\t//set up the session\r\n\t\t\t$_SESSION['userID'] = $data['userID'];\r\n\t\t\t$_SESSION['username'] = $data['username'];\r\n\t\t\t$_SESSION['profilePic'] = $data['profilePic'];\r\n\t\t\t$_SESSION['userType'] = $data['userType'];\r\n\t\t\t$_SESSION['access'] = $data['access'];\r\n\t\t\t//redirects to their profile\r\n\t\t\theader('location: index.php?page=profile&userID='.$_SESSION['userID']);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "public function controlLogin()\n {\n if ($this->checkUserLogin() == false) {\n if (isset($_SERVER[\"REQUEST_URI\"])) {\n $url = trim($_SERVER[\"REQUEST_URI\"], '/');\n $this->server->redirect(\"/login?pre=\" . $url);\n } else {\n $this->server->redirect(\"/login\");\n }\n } else {\n return true;\n }\n }", "public function login() {\n $db = Db::getInstance();\n $user = new User($db);\n\n// preventing double submitting\n $token = self::setSubmitToken();\n\n// if user is already logged in redirect him to gallery\n if( $user->is_logged_in() ){\n call('posts', 'index');\n } else {\n// otherwise show login form\n require_once('views/login/index.php');\n// and refresh navigation (Login/Logout)\n require('views/navigation.php');\n }\n }", "protected function isUserAllowedToLogin() {}", "public function check_login(): void\n {\n if ($this->email_activation && $this->user && !$this->user['email_verified']) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect('/register');\n }\n\n if (!$this->user) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect('/login');\n }\n }", "public function login() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->login();\n }\n }", "public function check_login(): void\n {\n if ($this->email_activation and $this->user and !$this->user['email_verified']) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect('/register');\n }\n\n if (!$this->user) {\n $_SESSION['request'] = $_SERVER['REQUEST_URI'];\n redirect($this->login);\n }\n }", "public function valid_login()\n\t{\n\t\tif($this->set_data->is_logged_in())\n\t\t{\t\n\t\t\t\n\t\t\tif($this->session->userdata('last_visit'))\n\t\t\t{\n\t\t\t\t$url = $this->session->userdata('last_visit');\n\t\t\t\t//log_message('error',\"CHK LAST VISIT: \".$url);\n\t\t\t\tredirect($url);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tredirect('user/data_fetch');\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tredirect('user/index');\n\t\t}\n\t}", "function login() {\n // Check is already a user is logged in or not.\n if (!isset ($_SESSION['user_id'])) {\n include('blog/site/VIEW/Login.php');\n }\n else {\n header(\"location: /index.php/User/home\");\n }\n }", "function auth_only() {\n if (!Auth::user()) {\n redirect('home/login');\n }\n}", "private function _userLoggedIn()\n {\n $this->utility->redirect('write');\n }", "public function authenticated(){\n if(isset($_SESSION['user'])){\n if($this->load($_SESSION['user']) == false){\n header('Location: /logout.php');\n die;\n }\n return true;\n }\n return false;\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public static function loginBySession()\n\t{\n\t\tif (Sessions::get('loggedIn')) :\n\t\t\tAuth::redirectUser(Sessions::get('user/type'));\n\t\tendif;\n\t}", "function checkLogin() {\n if (!isset($_SESSION['userid'])) {\n header(\"Location: ../index.php?message=nologin\");\n }\n }", "function validateLogin() {\n $this->check_lang();\n $logged_in = $this->session->userdata('logged_in');\n if ((isset($logged_in) || $logged_in == true)) {\n if ($logged_in != \"admin\") {\n redirect('/admin/index/login', 'refresh');\n }\n } else {\n redirect('/admin/index/login', 'refresh');\n }\n }", "public function isAuthenticated()\r\n {\r\n if (!isset($_SESSION[\"ed\"])) {\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n exit(0);\r\n }\r\n }", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }", "public function validate_login() {\n\t\t$userid=$_POST['user_id'];\n\t\t$password=$_POST['password'];\n\t\t$compid=$_POST['company_id'];\n\t\t\n\n\t\t$sql=\"SELECT u.id, u.user_name FROM users u, hmz_cust_info ci where ci.id=u.cust_id\n\t\t\tand u.user_id='$userid' and u.password='$password' and ci.cust_id='$compid';\";\n\t\t$result=$this->runQuery(\"getAll\",$sql);\n\t\tif(count($result)>0) {\n\t\t\t$_SESSION['user_id']=$result[0];\n\t\t\t$_SESSION['user_name']=$result[1];\n\t\t\theader('location: ?a=P&b=dashboard');\n\t\t}\n\t\telse\n\t\t\theader('location: ?a=login&b=f');\n\n\t}", "public static function requireAuthorized()\n {\n if(!SessionHelper::isUserLoggedIn()){\n header('location: ' . (string)getenv('URL') . 'user/logIn');\n }\n }", "public function userHasLoggedIn($user)\n {\n return redirect()->route('index');\n }", "public function loggedIn()\n {\n if($this->di->session->get('user'))\n {\n return true;\n }\n return false;\n }", "public static function checkUser()\n\t{\n\n\t\tif (!User::verifyLogin())\n\t\t{\n\n\t\t\theader(\"Location: /admin/login\");\n\t\t\texit;\n\n\t\t}\n\n\t}", "public function formLogin(){\n $user = $this->model->connectFromCookie();\n if ($user) {\n header('location:index.php?controller=dashboard');\n } else {\n $this->view->addFormLogin();\n }\n }", "public function loggedIn(){\r\n if (isset($_SESSION['user_session']))\r\n return true;\r\n else\r\n return false;\r\n }", "public function check_login_status()\n {\n if ($this->ion_auth->logged_in()) {\n if ($this->ion_auth->is_admin()) {\n redirect('admin/dasbor');\n } elseif ($this->ion_auth->in_group('mahasiswa')) {\n redirect('mahasiswa/dasbor');\n } elseif ($this->ion_auth->in_group('up2kk')) {\n redirect('up2kk/dasbor');\n }\n }\n }", "function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }", "public function isLoggedIn();", "public function isLoggedIn();", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "function check_if_student_logged(){\n\t\tglobal $url_home;\n\t\tglobal $current;\n\t\tif(!isset($_SESSION['id_korisnika']) && $current != \"login.php\" && $current != \"register.php\" && $current != \"reset.php\") header('Location: '.$url_home.'user/login.php');\n\t\telse if(isset($_SESSION['id_korisnika']) && ($current == \"login.php\" || $current == \"reset.php\" || $current == \"register.php\")) header('Location: '.$url_home.'user');\n\t}", "public function dologinpage()\n\t\t{\n\t\t\t$userdata = array(\n\t\t\t\t'email' => Input::get('email'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t);\n\n\t\t\tif(Auth::attempt($userdata)) {\n\t\t\t\tSession::flash('successMessage', \"Welcome back, \" . Auth::user()->username . \"!\");\n\t\t\t\tSession::put('loggedinuser', Auth::user()->username);\n\t\t\t\treturn Redirect::intended('/posts');\n\t\t\t\t// $userid = DB::table('users')->where('username', Session::get('loggedinuser'))->pluck('id');\n\t\t\t\t// Session::put('loggedinid', $userid);\n\t\t\t\t\n\t\t\t\t// return Redirect::action('PostsController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your username or password is incorrect');\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}", "public static function already_logged_in() {\n\t\tif (self::logged_in()) {\n\t\t\tSession::setFlash(\"alert-danger\", \"You have already logged in.\");\n\t\t\theader(\"Location: index.php\");\n\t\t}\n\t}", "public function auth()\n {\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n \n $info = $this->userDetail->getDetail($email, $password);\n if (count($info) == 1) \n {\n $this->commonFunction->setSession($info->id, $info->user_name);\n return redirect('/dashboard'); \n } \n echo '<script language=\"javascript\">';\n echo 'alert(\"Username/Password does not match.\")';\n echo '</script>';\n return redirect('/login');\n }", "public function login()\n {\n require_once(app_path().'/config/id.php');\n\n // if user is already logged in, redirect to current page\n if (Session::has('user'))\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n // else redirect user to CS50 ID\n else\n {\n //store url in session\n Session::put('redirect', URL::previous());\n\n return Redirect::to(CS50::getLoginUrl(TRUST_ROOT, RETURN_TO));\n }\n }", "public static function session_check(){\n if(!isset($_SESSION)){\n session_start();\n }\n if( !isset( $_SESSION[\"loggedIn\"])){\n\n header(\"Location: login.php\");\n }\n }", "public function checkCredentials()\n\t{\n\t\t$user = $this->_getLoggedUser();\n\t\tif (null === $user) {\n\t\t\t$_SESSION['url'] = $_SERVER['REQUEST_URI'];\n\t\t\t$this->redirectTo();\n\t\t}\n\t\treturn $user;\n\t}", "public static function checkLogin()\n {\n if (!isset($_SESSION)) {\n session_start();\n }\n if (!isset($_SESSION['email'])) {\n header('Location: login.php');\n }\n }" ]
[ "0.7852915", "0.7727086", "0.7653099", "0.76388097", "0.7507154", "0.7487913", "0.74865544", "0.74865544", "0.74592704", "0.7452506", "0.744068", "0.7413906", "0.7401579", "0.73994124", "0.7383788", "0.73705965", "0.7352293", "0.7327579", "0.7318903", "0.7310263", "0.7292683", "0.727375", "0.7262607", "0.7197062", "0.71744394", "0.7167625", "0.71672904", "0.7164809", "0.71558493", "0.71465695", "0.7144581", "0.713318", "0.7129259", "0.71291834", "0.712896", "0.71194035", "0.7112481", "0.71124345", "0.7091955", "0.70890903", "0.70832944", "0.7063222", "0.7057052", "0.7048265", "0.7039574", "0.7035796", "0.7035066", "0.7031783", "0.703008", "0.701738", "0.7016511", "0.7015079", "0.7012549", "0.7012257", "0.70027554", "0.6997628", "0.69928193", "0.6989583", "0.69604045", "0.69585043", "0.69478476", "0.6941577", "0.69262576", "0.6922122", "0.6917463", "0.690243", "0.69021064", "0.68973446", "0.689558", "0.6888082", "0.6882398", "0.6878014", "0.68758386", "0.68734664", "0.68700624", "0.6864655", "0.6852181", "0.68511736", "0.684792", "0.6845702", "0.6841985", "0.68396086", "0.6837448", "0.6832919", "0.6811209", "0.68062395", "0.6793843", "0.67936534", "0.6792132", "0.67916703", "0.6782041", "0.6782041", "0.6779868", "0.677872", "0.6777675", "0.6770452", "0.6769884", "0.67667234", "0.6763369", "0.6762026", "0.67547506" ]
0.0
-1
/============================================= = MOSTRAR CLIENTE = =============================================
public static function ctrMostrarCliente($item, $valor){ $tabla = 'clientes'; $respuesta = ModeloCliente::mdlMostrarCliente($tabla, $item, $valor); return $respuesta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl_moblevantamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_moblevantamentoedi() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamentoedi\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function masodik()\n {\n }", "public function mostra(){\n }", "function cl_cemiteriorural() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cemiteriorural\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanoconplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoconplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}", "public function boleta()\n\t{\n\t\t//\n\t}", "public static function metodo_estatico () {\n }", "function cl_sau_triagemavulsa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_triagemavulsa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_empagemovslips() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empagemovslips\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_pcorcamfornelic() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pcorcamfornelic\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanosis() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanosis\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_traperm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"traperm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private function metodo_privado() {\n }", "function cl_bomov() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bomov\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_contacorrenteregravinculo() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"contacorrenteregravinculo\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function serch()\n {\n }", "function RellenarMinuta()\r\n {\r\n $this->AddPage();\r\n\r\n $this->RellenarTitulo();\r\n\r\n $this->RellenarAsistentes();\r\n\r\n $this->RellenarStatusCompromisosYAsistencias();\r\n\r\n $this->RellenarIndice();\r\n\r\n $this->RellenarDesarrolloReunion();\r\n }", "function cl_rhempenhofolharubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhempenhofolharubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ensino() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ensino\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "protected function metodo_protegido() {\n }", "function cl_sau_receitamedica() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_receitamedica\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_issplan() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"issplan\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhemitecontracheque() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhemitecontracheque\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "function cl_rechumanorelacao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rechumanorelacao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_reconhecimentocontabil() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"reconhecimentocontabil\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_itinerarioescolaproc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"itinerarioescolaproc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function ambas()\n {\n print \"Ejecución de la función ambas<br>\";\n # mediante $this-> requerimos la ejecución de metodo prueba\n # de la clase actual\n $this->prueba();\n # al señalar parent:: requerimos la ejecución de metodo prueba\n # de la clase padre\n parent::prueba();\n }", "function cl_condicionante() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"condicionante\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhestagio() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhestagio\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhsolicita() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhsolicita\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_clientesmodulosproc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"clientesmodulosproc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conarquivospad() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conarquivospad\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function linea_colectivo();", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "function cl_liccomissao() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"liccomissao\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhfolhapagamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhfolhapagamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_diario() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"diario\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_pesdiver() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pesdiver\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_tarefa_lanc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tarefa_lanc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rechumano() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rechumano\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function __construct() {\n \n $descripcion = \"A través de nuestra modalidad de outsourcing podemos convertirnos en su aliado estratégico, trabajando así como un departamento externo de su empresa donde podrá beneficiarse de nuestros servicios. Nos empoderamos de la funciones de mercadeo y publicidad para lograr implementar las mejores estrategias de desarrollo y proyección en el mercado.\";\n $puntosClavesIntro = \"Entre los beneficios que te ofrecemos mediante la modalidad de outsourcing:\";\n $puntosClaves= array('Mejoran los procesos de planeación, implementación y control de las actividades de mercadeo y publicidad.','Facilitan el acceso al mercado y a potenciales oportunidades de negocios a través de nuestra empresa.',' Reduce los costos operativos mediante la delegación de tareas a nuestro personal; profesional en el área y con mayor experiencia en la creación de estrategias creativas e innovadoras.','Usted adquiere mayor disponibilidad de tiempo para concentrarse en las actividades principales de su empresa.','Reporte mensual detallando el progreso de las estrategias implementadas según el plan de acción propuesto.');\n $descripcionCorta=\"A través de nuestra modalidad de outsourcing podemos convertirnos en su aliado estratégico.\";\n $sceenshots = array('primero');\n \n parent::__construct($descripcion, $puntosClavesIntro, $puntosClaves, $screenshots,$descripcionCorta);\n }", "function cl_rhconsignadomovimentoservidorrubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhconsignadomovimentoservidorrubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function __construct()\n{\n\t$this->setName(\"titi\");//syntaxe pour acceder a une fonction de la classe elle meme\n\techo 'creation d\\'un robot<br>';\n}", "public function monarch()\n {\n }", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\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 }", "public function pasaje_abonado();", "public function MoverFicha() \n {\n echo 'Mover ficha';\n }", "function cl_escrito() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"escrito\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function AggiornaPrezzi(){\n\t}", "public function metodo_publico() {\n }", "function cl_alunoaltcampos() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunoaltcampos\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function _mostrar(){\n $html = $this->Cabecera();\n $html .= $this->contenido();\n $html .= $this->Pata();\n echo $html;\n }", "final function velcom(){\n }", "function cl_aguacorte() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacorte\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function medias_autoriser(){}", "public function hacer(){\n // renderizamos vista\n require_once 'views/pedido/hacer.php';\n }", "function cl_empreendimento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empreendimento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function tiltDownCamaraPresidencia() {\n\n self::$presidencia->moverAbajo();\n\n }", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_disbancoprocesso() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"disbancoprocesso\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function enviarComando( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\", $this->getComando(),\n $this->getAtributo());\nprint_r($cmd);\n $this->enviarPeticion($cmd->getComando());\n\n }", "function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ossoario() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ossoario\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function acessarRelatorios(){\n\n }", "function cl_sau_prochabilitacao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_prochabilitacao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function __construct () { // Metodo Constructor: __construct nueva forma de hacer un constructor.\n\n // Caracteristicas iniciales de la clase. Definiendo el valor de las variables definidas fuera del constructor.\n $this -> ruedas = 4; // this: es como decir \"coche\". Estamos diciendo que la clase partira con 4 ruedas inicialmente.\n $this -> color = \"\";\n $this -> motor = 1600;\n }", "public function claseLocal( ) {\n\n\n AccesoGui::$guiSistema->esperarInicioSistema();\n\n AccesoControladoresDispositivos::$ctrlLuz->setLucesEscenarios(LuzTecho::$ESCENARIO_CLASE_LOCAL);\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarAudio(1,1);\n ConexionServidorCliente::$ctrlGuiPantallas->bajarPantallaElectrica();\n usleep(500000);\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLuzSala(Automata::$intensidades[\"media\"]);\n AccesoControladoresDispositivos::$ctrlFoco->apagar();\n ConexionServidorCliente::$ctrlGuiPantallas->pipEnPantallaPresi();//control_pantallas.pipEnPantallaPresi()\n ConexionServidorCliente::$ctrlGuiPlasmas->encender();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->preset90();\n//AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n ConexionServidorCliente::$ctrlGuiProyectores->encenderCentral();\n ConexionServidorCliente::$ctrlGuiProyectores->encenderPizarra();\n //ConexionServidorCliente::$ctrlGuiProyectores->activarCentral();\n //ConexionServidorCliente::$ctrlGuiProyectores->activarPizarra();\n //usleep(3000000);\n ConexionServidorCliente::$ctrlGuiProyectores->verPCSalaEnPizarra();\n ConexionServidorCliente::$ctrlGuiProyectores->verPCSalaEnCentral();\n //usleep(3000000);\n AccesoControladoresDispositivos::$ctrlProyectores->forzarEstadoOnCentral();\n AccesoControladoresDispositivos::$ctrlProyectores->forzarEstadoOnPizarra();\n\tAccesoGui::$guiSistema->esperarInicioSistema();\n AccesoControladoresDispositivos::$ctrlPlasma->verVideoSalaEnPlasma();\n AccesoGui::$guiEscenarios->escenarioClaseLocal();\n AccesoGui::$guiMenus->menuPrincipal(true);\n AccesoGui::$guiSistema->mostrarMenu();\n AccesoGui::$guiEscenarios->enviarEstadoVideoconferencia();\n\t#AccesoControladoresDispositivos::$ctrlProyectores->estadoCentral();\n\t#AccesoControladoresDispositivos::$ctrlProyectores->estadoPizarra();\n }", "public function mostrar(){\n\t\t\t\techo \"<p> Hola soy un $this->marca, modelo $this->modelo</php> \";\n\t\t\t}", "public function relatorioAction() { \r\n \r\n }", "public function contarInventario(){\n\t}", "public function mover()\n {\n return \"Voa e \" . parent::mover();\n }", "function cl_db_layouttxtgeracao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_layouttxtgeracao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function swim()\n {\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "public function elso()\n {\n }", "public function seminarioClase( ) {\n\n\n AccesoGui::$guiSistema->esperarInicioSistema();\n\n AccesoControladoresDispositivos::$ctrlLuz->setLucesEscenarios(LuzTecho::$ESCENARIO_SEMINARIO_CLASE);\n AccesoControladoresDispositivos::$ctrlMatrizVGA->asignarAudio(1,1);\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLuzSala(Automata::$intensidades[\"maxima\"]);\n usleep(500000);\n ConexionServidorCliente::$ctrlGuiPantallas->subirPantallaElectrica();\n AccesoControladoresDispositivos::$ctrlFoco->apagar();\n ConexionServidorCliente::$ctrlGuiPlasmas->encender();\n\t//Comentado mientras se repara el visor de opacos.\n //ConexionServidorCliente::$ctrlGuiCamaraDocumentos->camaraDocumentosApagar();\n ConexionServidorCliente::$ctrlGuiProyectores->apagarPizarra();\n ConexionServidorCliente::$ctrlGuiProyectores->apagarCentral();\n AccesoControladoresDispositivos::$ctrlMesaMezclas->preset90();\n\tAccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n ConexionServidorCliente::$ctrlGuiPantallas->pipEnPantallaPresi();\n AccesoGui::$guiEscenarios->escenarioSeminario();\n AccesoGui::$guiMenus->menuPrincipal(true);\n AccesoGui::$guiSistema->mostrarMenu();\n AccesoGui::$guiEscenarios->enviarEstadoVideoconferencia();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoCentral();\n\tAccesoControladoresDispositivos::$ctrlProyectores->estadoPizarra();\n }", "function miguel_MCourse() \r\n {\t\r\n $this->base_Model();\r\n }", "function cl_tipovistoriasrec() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tipovistoriasrec\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function metodo() {\n // Funcion normal\n }", "public function enviarComando( ) {\n $cmd=new ComandoFlash(\"SISTEMA\",$this->getComando());\n $this->enviarPeticion($cmd->getComando());\n }", "function cl_evolucaodividaativa() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"evolucaodividaativa\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_far_listacontroladomed() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"far_listacontroladomed\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function _mostrar(){\n $html = $this->Cabecera();\n $html .= $this->contenido();\n // $html .= $this->tablaDatos();\n $html .= $this->Pata();\n echo $html;\n }", "function _mostrar(){\n $html = $this->Cabecera();\n $html .= $this->contenido();\n // $html .= $this->tablaDatos();\n $html .= $this->Pata();\n echo $html;\n }", "function __construct() {\n new Wh_main_post();\n new Main_filtre();\n }", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "function cl_tfd_situacaopedidotfd() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_situacaopedidotfd\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function run()\n {\n {\n $this->command->info('####### ATENÇÃO! #######');\n $this->command->info('- LOGO ABAIXO, SERÁ CRIADO A PRIMEIRA ORGANIZAÇÃO MILITAR');\n $this->command->info('- APÓS O CADASTRO, É IMPORTANTE QUE TERMINE DE PREENCHER OS DADOS VIA SISTEMA');\n $this->command->info('########################');\n $descricao = $this->command->ask('# 1 - Digite o nome completo da OM');\n $nome = $this->command->ask('# 2 - Digite o nome abreviado da OM');\n $codom = $this->command->ask('# 3 - Digite o CODOM da OM');\n\n $om = new Cad_om;\n\t\t\t$om->nome = strtoupper(trim($nome));\n\t\t\t$om->descricao = strtoupper(trim($descricao));\n\t\t\t$om->codom = $codom;\n\t\t\t$om->cep = \"0000-000\";\n\t\t\t$om->datafile = base64_encode($nome);\n\t\t\t$om->save();\n\n DB::table('cad_militar')->insert([\n 'nome' => strtoupper($descricao),\n 'nome_guerra' => strtoupper(\"viatura militar\"),\n 'ident_militar' => $codom,\n 'cep' => '0000-000',\n 'om_id' => $om->id,\n 'posto' => 34,\n 'status' => 1,\n 'datafile' => base64_encode($nome)\n ]);\n\n $this->command->info('####### ATENÇÃO! #######');\n $this->command->info('- NÃO ESQUEÇA DE ACESSAR O SISTEMA PARA COMPLETAR OS DEMAIS DADOS');\n $this->command->info('####### OM CRIADA COM SUCESSO! #######');\n }\n }", "public function videoconferenciaLlamando( ) {\n $this->setComando(\"LLAMANDO\");\n }", "public function testTrasbordoMedio()\n {\n $tiempo = new TiempoFalso;//$tiempo = new TiempoFalso(0);\n $recargable = new Recargable();\n $tarjeta = new Medio(0, $tiempo,$recargable);\n $tiempo->avanzar(28800);\n $tarjeta->recargar(100);\n $tarjeta->recargar(100);\n $colectivo1 = new Colectivo(122, \"Semtur\", 37);\n $colectivo2 = new Colectivo(134, \"RosarioBus\", 52);\n\t\t$saldoEsperado =200;\n\n /*\n Pruebo pagar un trasbordo un dia feriado con 90 minutos de espera y el texto del boleto\n */\n $boleto = $colectivo1->pagarCon($tarjeta);\n\t\t$saldoEsperado=$saldoEsperado-(32.50/2);\n $this->assertEquals(date('N', $tiempo->time()), '4');\n $this->assertEquals(date('G', $tiempo->time()), '8');\n $this->assertEquals(date('d-m', $tiempo->time()), \"01-01\");\n $this->assertEquals($tarjeta->obtenerSaldo(), $saldoEsperado);\n\n $tiempo->avanzar(4200);\n\t\t$saldoEsperado=$saldoEsperado-((32.50/2)*0);\n $boleto2 = $colectivo2->pagarCon($tarjeta);\n $this->assertEquals($tarjeta->obtenerSaldo(), $saldoEsperado);\n }", "public function hapus_toko(){\n\t}", "function cl_avaliacaoestruturanota() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"avaliacaoestruturanota\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function contrato()\r\n\t{\r\n\t}", "public function _construct(){\n\t\t$this->marque = 'Peugeot';\n\t\t$this->couleur = 'blanc';\n\t\t$this->vitesse = 50;\n\t}", "public function custom()\n\t{\n\t}" ]
[ "0.6217275", "0.61968905", "0.6115072", "0.60784817", "0.59940827", "0.593389", "0.5918744", "0.5912099", "0.5892285", "0.58295023", "0.58101463", "0.58031", "0.5712848", "0.571248", "0.5683574", "0.56813073", "0.5648917", "0.56279707", "0.5612496", "0.5608787", "0.5572135", "0.5570548", "0.55633223", "0.55524933", "0.55280536", "0.5519155", "0.5513953", "0.55133593", "0.5511234", "0.5492041", "0.54919344", "0.54908454", "0.54823065", "0.54682064", "0.5461419", "0.5461361", "0.5456987", "0.5454236", "0.5436877", "0.54344535", "0.5433803", "0.5432012", "0.541988", "0.54176354", "0.540746", "0.5406852", "0.5405464", "0.5403657", "0.54024243", "0.5398388", "0.53960896", "0.53939426", "0.53899866", "0.5386306", "0.5381492", "0.5381385", "0.5376803", "0.5372168", "0.53648704", "0.5361435", "0.5353318", "0.53485936", "0.53480893", "0.5344449", "0.53380376", "0.5333011", "0.5330676", "0.5329512", "0.5324168", "0.53195596", "0.531953", "0.53166664", "0.5311427", "0.53102684", "0.5293792", "0.52912855", "0.5286008", "0.5270838", "0.526849", "0.52654624", "0.5262516", "0.5258217", "0.5257477", "0.5254168", "0.52534026", "0.52516216", "0.5246074", "0.5245194", "0.5241205", "0.5241205", "0.52391654", "0.52391106", "0.5237984", "0.5234848", "0.52304554", "0.52257645", "0.52174705", "0.5213499", "0.5213474", "0.5213162", "0.5207618" ]
0.0
-1
/============================================= = REGISTRAR CLIENTE = =============================================
public static function ctrRegistrarCliente(){ if (isset($_POST['nuevoCliente'])) { $tabla = 'clientes'; $datos = array("cliente" => $_POST['nuevoCliente'], "id_area" => $_POST['nuevoAreaCliente'], "documentoID" => $_POST['nuevoDocumentoID'], "email" => $_POST['nuevoEmail'], "telefono" => $_POST['nuevoTelefono'], "direccion" => $_POST['nuevaDireccion']); $respuesta = ModeloCliente::mdlRegistrarCliente($tabla, $datos); if ($respuesta == 'ok') { ?> <script> swal({ type: "success", title: "¡El usuario se registro correctamente!", showConfirmButton: true, confirmButtonText: "Cerrar", closeOnConfirm: false }).then((result)=>{ if(result.value){ window.location = "clientes"; } }); </script> <?php } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function register() {}", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register() {}", "public function register(){}", "function reg() {\n\t\t//~ screening input data\n\t\t$tmp_arr=mysql::screening_array($_POST);\n\t\t$login=$tmp_arr['login'];\n\t\t$passwd=$tmp_arr['passwd'];\n\t\t$passwd2=$tmp_arr['passwd2'];\n\t\t$mail=$tmp_arr['mail'];\n\n\t\t//~ Check valid user data\n\t\tif ($this->check_new_user($login, $passwd, $passwd2, $mail)) {\n\t\t\t//~ User data is correct. Register.\n\t\t\t$user_key = $this->generateCode(10);\n\t\t\t$passwd = md5($user_key.$passwd.SECRET_KEY); //~ password hash with the private key and user key\n\t\t\t$query=mysql::query(\"INSERT INTO `users` (`id_user`, `login_user`, `passwd_user`, `mail_user`, `key_user`,`img`) VALUES (NULL, '\".$login.\"', '\".$passwd.\"', '\".$mail.\"', '\".$user_key.\"','/feditor/attached/image/20150313/20150313102144_79301.jpg');\");\n\t\t\tif ($query) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tself::$error='Произошла ошибка при регистрации нового пользователя. Связаться с администрацией.';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "public function register(){\n\n\t}", "public function add_to_register_form() {\n\t\t$this->recaptcha->show_recaptcha( array( 'action' => ITSEC_Recaptcha::A_REGISTER ) );\n\t}", "function lapizzeria_registrar_opciones(){\n register_setting( 'lapizzeria_opciones_grupo', 'lapizzeria_direccion' );\n register_setting( 'lapizzeria_opciones_grupo', 'lapizzeria_telefono' );\n\n register_setting( 'lapizzeria_opciones_gmaps', 'lapizzeria_gmap_iframe' );\n}", "public function register(){\r\n\r\n }", "public function registration()\n {\n \n }", "abstract public function register();", "abstract public function register();", "abstract public function register();", "function private_home(){\r\n return sreg_basic(array(\r\n 'role' => 'subscriber',\r\n 'from' => get_bloginfo('admin_email'),\r\n 'message' => 'Thank you for registering',\r\n 'notify' => get_bloginfo('admin_email'),\r\n 'fb' => false,\r\n ));\r\n}", "public function register()\n\t{\n\t\t\n\t}", "abstract public function register ( );", "public function register()\r\n {\r\n //\r\n\t}", "public function ulogiraj_registiraj()\r\n\t{\r\n\t\tif(isset($_POST['ulogiraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Login';\r\n\t\t\t$this->registry->template->show( 'login' );\r\n\t\t}\r\n\t\tif(isset($_POST['registriraj']))\r\n\t\t{\r\n\t\t\t$this->registry->template->title = 'Registriraj se';\r\n\t\t\t$this->registry->template->show( 'register' );\r\n\t\t}\r\n\r\n\t}", "public function register()\n\t{\n //\n\t}", "public function _register()\n {\n }", "abstract public function Register();", "public function register(): void\n {\n\n }", "protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }", "public function onRegister();", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register(): void;", "public function register() \n {\n \n\n }", "public function register()\n {\n //\n\t\t\n }", "public static function register()\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//IMPORTANT\n\t\t\t\t//Register all of the options that will be used\n\t\t\t\n//\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_po_quote');\n\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_userid');\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_popup_option');\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_copypaste_option');\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_freecode');\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public function register()\r\n {\r\n \r\n }", "private function _registerStart()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->_POST[ 'username' ] \t= \ttrim( $MySmartBB->_POST[ 'username' ] );\n\t\t$MySmartBB->_POST[ 'email' ] \t\t= \ttrim( $MySmartBB->_POST[ 'email' ] );\n\t\t\n\t\t// ... //\n\t\t\n\t\t// A long list of checks before registeration\n\t\t$this->__checkFieldsValidity();\n\t\t$this->__checkAlreadyUsed();\n\t\t$this->__checkBanned();\n\t\t$this->__checkConstraints();\n\t\t$this->__checkLength();\n \t\t\n \t$MySmartBB->_POST[ 'password' ] = md5( $MySmartBB->_POST[ 'password' ] );\n \t\n \t// ... //\n \t\n \t$MySmartBB->plugin->runHooks( 'register_start' );\n \t\n \t// ... //\n \t\n \t// Get the information of default group to set username style cache\n \t$MySmartBB->rec->table = $MySmartBB->table[ 'group' ];\n\t\t$MySmartBB->rec->filter = \"id='\" . $MySmartBB->_CONF[ 'info_row' ][ 'def_group' ] . \"'\";\n\t\t\n\t\t$GroupInfo = $MySmartBB->rec->getInfo();\n\t\t\n\t\t// ... //\n\t\t\n\t\t// Get the stylish username\n\t\t$style = $GroupInfo[ 'username_style' ];\n\t\t$username_style_cache = str_replace( '[username]', $MySmartBB->_POST['username'], $style );\n\t\t\n\t\t// ... //\n\t\t\n\t\t$MySmartBB->rec->table = $MySmartBB->table[ 'member' ];\n\t\t$MySmartBB->rec->fields = array(\t'username'\t\t=>\t$MySmartBB->_POST[ 'username' ],\n \t\t\t\t\t\t\t\t\t\t'password'\t\t=>\t$MySmartBB->_POST[ 'password' ],\n \t\t\t\t\t\t\t\t\t\t'email'\t\t\t=>\t$MySmartBB->_POST[ 'email' ],\n \t\t\t\t\t\t\t\t\t\t'usergroup'\t\t=>\t$MySmartBB->_CONF[ 'info_row']['def_group' ],\n \t\t\t\t\t\t\t\t\t\t'user_gender'\t=>\t$MySmartBB->_POST[ 'gender' ],\n \t\t\t\t\t\t\t\t\t\t'register_date'\t=>\t$MySmartBB->_CONF[ 'now' ],\n \t\t\t\t\t\t\t\t\t\t'user_title'\t=>\t$GroupInfo[ 'user_title' ],\n \t\t\t\t\t\t\t\t\t\t'style'\t\t\t=>\t$MySmartBB->_CONF[ 'info_row' ][ 'def_style' ],\n \t\t\t\t\t\t\t\t\t\t'username_style_cache'\t=>\t$username_style_cache);\n \t\n \t$MySmartBB->rec->get_id = true;\n \t\n \t$insert = $MySmartBB->rec->insert();\n \t\n \tif ( $insert )\n \t{\n \t\t// ... //\n \t\t\n \t\t// Update statistics\n \t\t$MySmartBB->cache->updateLastMember( $MySmartBB->_POST[ 'username' ], $MySmartBB->rec->id );\n \t\t\n \t\t// ... //\n \t\t\n \t\t$MySmartBB->plugin->runHooks( 'register_success' );\n \t\t\n \t\t// ... //\n \t\t\n \t\t// The default group requires an email activation from its members.\n \t\t// Therefore, We register a request and send the activation message to the member's email.\n \t\tif ( $MySmartBB->_CONF[ 'info_row' ][ 'def_group' ] == 5 )\n \t\t{\n \t\t\t$this->__sendActivationCode(); \t\t\t\n\t\t\t}\n\t\t\telse\n \t\t{\n \t\t\t$MySmartBB->func->msg( $MySmartBB->lang[ 'register_succeed' ] );\n \t\t\t$MySmartBB->func->move( 'index.php?page=login&amp;register_login=1&amp;username=' . $MySmartBB->_POST[ 'username' ] . '&amp;password=' . $MySmartBB->_POST[ 'password' ] );\n \t\t}\n \t}\n\t}", "public function register() { \n }", "function autoregister_install()\n {\n // read email template for new autoregister\n $content = file_get_contents( osc_plugins_path() . osc_plugin_folder(__FILE__).'autoregister_new_user_info' );\n $aContent = json_decode($content, true);\n $s_internal_name = 'autoregister_new_user_info';\n $aFields = array('s_internal_name' => $s_internal_name, 'b_indelible' => '1');\n $aFieldsDescription = array();\n\n foreach($aContent as $key => $value) {\n $aFieldsDescription[$key]['s_title'] = $value['title'];\n $aFieldsDescription[$key]['s_text'] = $value['description'];\n }\n // add page as email template\n $page = Page::newInstance()->findByInternalName($s_internal_name);\n if(!isset($page['pk_i_id'])) {\n $result = Page::newInstance()->insert($aFields, $aFieldsDescription) ;\n } else {\n osc_add_flash_error_message(_m(\"Oops! That internal name is already in use. We can't make the changes\", 'autoregister'), 'admin') ;\n }\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "abstract protected function _regenerate();", "function register() {\n\tadd_action( 'admin_menu', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\add_menu' );\n\tadd_action( 'admin_init', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\action_handler' );\n\tadd_action( 'admin_enqueue_scripts', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\register_style' );\n\n\t\\Sgdd\\Admin\\SettingsPages\\Basic\\register();\n\t\\Sgdd\\Admin\\SettingsPages\\Advanced\\register();\n\t\\Sgdd\\Admin\\Editor\\register();\n}", "function coz_registry_instructions( $post_type ) {\n $screen = get_current_screen();\n $edit_post_type = $screen->post_type;\n if ( $edit_post_type != 'coz_registry' )\n return;\n ?>\n <div class=\"after-title-help postbox\">\n <h3>Adding a Cozmeena Shawl to the International Cozmeena Registry</h3>\n <div class=\"inside\">\n <p>To add a Cozmeena Shawl to the International Cozmeena Registry you need to do the following</p>\n\t\t\t<ol>\n\t\t\t\t<li>Enter the name of the person you made the Cozmeena Shawl for in the box above</li>\n\t\t\t\t<li>Share the story of why you knit this shawl and/or why you chose to give it to the recipient (OPTIONAL)</li>\n\t\t\t\t<li>Share a photo of your Cozmeena Shawl and/or the shawl recipient (OPTIONAL)</li>\n\t\t\t\t<li>Enter the date you finished the shawl, the wool color and wool type in the boxes to the right</li>\n\t\t\t\t<li>Submit for review and publication</li>\n\t\t\t</ol>\n\t\t\t<p>Once your registration has been submitted we will verify your registration, add the official International Cozmeena Registry number, publish it to the Registry* and send your certificate in the mail.</p>\n\t\t\t<p><em>*If you prefer that your registration not be published on our website please send an email with all of your information to <a href=\"mailto:[email protected]?Subject=Private%20Cozmeena%20Shawl%20registration\" target=\"_top\"> [email protected] </a> and request a private registration\"</em></p>\n </div><!-- .inside -->\n </div><!-- .postbox -->\n<?php }", "public function Register(){\n\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "function genera_password($longitud,$tipo=\"alfanumerico\"){\n \nif ($tipo==\"alfanumerico\"){\n$exp_reg=\"[^A-Z0-9]\";\n} elseif ($tipo==\"numerico\"){\n$exp_reg=\"[^0-9]\";\n}\n \nreturn substr(eregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())),\n0, $longitud);\n}", "function registrarse(){\r\n\t\t//Si se ha pulsado el botón de enviar.\r\n\t\tif(isset($_POST['enviar'])){\r\n\t\t\t//Recopilamos en variables los datos del formulario.\r\n\t\t\t$user = $_POST['user'];\r\n\t\t\t$pass = $_POST['passw'];\r\n\t\t\t$pass_md5 = md5($pass);\r\n\t\t\t$repass = $_POST['repassw'];\r\n\t\t\t$email = $_POST['mail'];\r\n\t\t\t//Variable para la aceptacion de las normas\r\n\t\t\t@$acepto = $_POST['acepto'];\r\n\r\n\t\t\t//Variables de validacion\r\n\t\t\t$error = 0;\r\n\t\t\t$validar = 0;\r\n\t\t\t$comprobar = 0;\r\n\t\t\t$rango = 1;\r\n\r\n\t\t\t//Comprobamos que no haya campos vacíos.\r\n\t\t\tif(empty($user) || empty($pass) || empty($email)){\r\n\t\t\t\techo '<script language=\"javascript\">alert(\"No pueden haber campos vacíos\");</script>';\r\n\t\t\t\t//Se contabiliza el error\r\n\t\t\t\t$error ++;\r\n\t\t\t}\r\n\r\n\t\t\t//Comprobamos que se han aceptado las normas\r\n\t\t\tif(is_null($acepto)){\r\n\t\t\t\techo '<script language=\"javascript\">alert(\"Debes aceptar las normas\");</script>';\r\n\t\t\t\t//Se contabiliza el error\r\n\t\t\t\t$error ++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!empty($email)){\r\n\t\t\t\t//Comprobamos que el formato del email sea el correcto.\r\n\t\t\t\tif(!preg_match('^([a-zA-Z0-9._]+)@([a-zA-Z0-9.-]+).([a-zA-Z]{2,4})^',$email)){\r\n\t\t\t\t\techo '<script language=\"javascript\">alert(\"El email no contiene un formato válido\");</script>';\r\n\t\t\t\t\t$error ++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!empty($pass)){\r\n\t\t\t\t//Comprobamos que el formato de la contraseña sea el correcto.\r\n\t\t\t\tif(!preg_match('/[a-z]/',$pass) || !preg_match('/[A-Z]/',$pass) || !preg_match('/[0-9]/',$pass)){\r\n\t\t\t\t\techo '<script language=\"javascript\">alert(\"La contraseña introducida tiene que estar formada mínimo por 1 número, 1 letra miníscula y 1 letra mayúscula\");</script>';\r\n\t\t\t\t\t$error ++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Comprobamos que el campo contraseña coincide con el de repetir contraseña.\r\n\t\t\t\tif(!$pass == $repass ){\r\n\t\t\t\t\techo '<script language=\"javascript\">alert(\"Las contraseñas que has introducido no coinciden\");</script>';\r\n\t\t\t\t\t$error ++;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t//Creamos un nuevo objeto sql.\r\n\t\t\t$sql = new conection();\r\n\t\t\t//Realizamos la conexión llamando a la función conectar().\r\n\t\t\t$conexion = $sql -> conectar();\r\n\t\t\t//Realizamos la consulta a la base de datos.\r\n\t\t\t$consulta = $sql->ejecutar_consulta(\"SELECT Email FROM usuarios WHERE Email ='$email'\");\r\n\t\t\t\t\r\n\t\t\t//Validamos que no haya errores en la consulta\t\r\n\t\t\tif(!$consulta){\r\n\t\t\t\tdie('Error al realizar la consulta');\r\n\t\t\t\t//llama a la función desconectar.\r\n\t\t\t\tdesconectar();\r\n\t\t\t\t//Si no hay error...\r\n\t\t\t}else{\r\n\t\t\t\t//Buscamos en la base de datos si el email existe.\r\n\t\t\t\twhile($row=mysqli_fetch_array($consulta)){\r\n\t\t\t\t\t$mail = $row['Email'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Validamos según la consulta devuelva una variable vacía o no\r\n\t\t\t\tif(!empty($mail)){\r\n\t\t\t\t\t$validar = 1;\r\n\t\t\t\t\techo '<script language=\"javascript\">window.alert(\"El email ya está registrado\");</script>';\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$validar = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Creamos un nuevo objeto sql.\r\n\t\t\t$sql = new conection();\r\n\t\t\t//Realizamos la conexión llamando a la función conectar().\r\n\t\t\t$conexion = $sql -> conectar();\r\n\t\t\t//Realizamos la consulta.\r\n\t\t\t$consulta = $sql->ejecutar_consulta(\"SELECT Login FROM usuarios WHERE Login ='$user'\");\r\n\t\t\t\r\n\t\t\t//Comprobamos que la consulta se haya realizado correctamente.\t\t\r\n\t\t\tif(!$consulta){\r\n\t\t\t\tdie('Error al realizar la consulta');\r\n\t\t\t\t//llama a la función desconectar.\r\n\t\t\t\tdesconectar();\r\n\t\t\t\t//Si no hay error...\r\n\t\t\t}else{\r\n\t\t\t\t//Buscamos en la base de datos si el usuario ya existe.\r\n\t\t\t\twhile($row=mysqli_fetch_array($consulta)){\r\n\t\t\t\t\t$usuario = $row['Login'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Validamos según la consulta devuelva una variable vacía o no.\r\n\t\t\t\tif(!empty($usuario)){\r\n\t\t\t\t\t$comprobar = 1;\r\n\t\t\t\t\techo '<script language=\"javascript\">window.alert(\"El usuario ya está registrado\");</script>';\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$comprobar = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n \t//Si todas las condiciones de validación no se han cumplido.\r\n \tif($error == 0 && $comprobar == 0 && $validar == 0){\r\n\r\n \t\t//Creamos un nuevo objeto sql.\r\n\t\t\t\t$sql = new conection();\r\n\t\t\t\t//Realizamos la conexión llamando a la función conectar().\r\n\t\t\t\t$conexion = $sql -> conectar();\r\n\t\t\t\t//Realizamos la consulta.\r\n\t\t\t\t$consulta = $sql->ejecutar_consulta(\"INSERT INTO usuarios (ID, Login, Password, Email, Tipo) VALUES ('','\" . $user . \"','\" . $pass_md5 . \"','\" . $email . \"','\" . $rango . \"')\");\r\n\t\t\t\t\t\r\n\t\t\t\t//Comprobamos que la consulta se haya realizado correctamente.\t\r\n\t\t\t\tif(!$consulta){\r\n\t\t\t\t\tdie('Error al realizar la consulta');\r\n\t\t\t\t\t//llama a la función desconectar.\r\n\t\t\t\t\tdesconectar();\r\n\t\t\t\t\t//Si no hay error...\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo '<script language=\"javascript\">window.alert(\"¡¡Usuario creado correctamente!!\"); window.location=\"entrar.php\";</script>';\r\n\t\t\t\t}\r\n \t}\r\n\t\t}\r\n\t}", "public function __construct(){\n\t\t\t\t\n\t\t\t\t$this->nombre = addslashes(htmlspecialchars($_POST[\"nombre\"]));\n\t\t\t\t$this->email = addslashes(htmlspecialchars($_POST[\"email\"]));\n\t\t\t\t$this->asunto = addslashes(htmlspecialchars($_POST[\"asunto\"])); \n\t\t\t\t$this->msj = addslashes(htmlspecialchars($_POST[\"msj\"]));\n\t\t\t\t\n\t\t\t\t$this->destinatario1 =\"[email protected]\";\n\t\t\t\t$this->destinatario2 =\"[email protected]\";\n\t\t\t\t\n\t\t\t\t$this->errores = \"\";\n\t\t\t\t\n\t\t\t\t$this->sintax = \"/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$/i\";\n\t\t\t}", "public function register()\n {\n // maybe something, one day\n }", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function showRegistrationForm()\n {\n $api = new meta(); \n \n eval(str_rot13(gzinflate(str_rot13(base64_decode('LUnHEuy4DfyarV3flFQqn5TTjGW+uJRmzvptRn7WgQUCYAOkwAaXbbj/2fojXu+hXP4Zh28hsP/My5TMyz/50Ef5/f/J3+pCTotR5CyJ+wuxbNjjMRtW7UMr0BsiBSI0lr8QHZjwJYe/F4lb7IzEVM+mr+5tFMjigVEi4Rhy4QqPaKSMbxQAnV3W6FfsYLm9RzI1123YaArcUu0E/Vyictop3OIs9iWW7zYvS2GP/qgRoeZBqTCXE9GJcRtefAWf+G46MWBcxr3D0rfnF7Q0PvzUUimJleX6jN+m2a9vg+SOcYtZUf1TRwxTKYEn7fG2Q4RaG9oeyCsaEjBpX+4HeWvaUWA2WL9nD+zwyCOmh0pOEymg5TpviAc5l5HIUaEkFAuglHRYcLl5FjxHO/HTs79sT9hS7SXN8eNYjdnT6kZiJ6YWmxqDgLp0YQQmw/SkYdD2T0OWFAd2HALxp+GcxyEcPHclfu0Xvc6fEIB/wBbtmwryi05ShVfZmBm57RyK01QrImpVQWlRPnPxhCMM3xh+Vk9Ox6R4uUSnZYVKWYrW2JjCgWEH9LUKPkIYHkix54yvs/qFK/Js6Cvbs/hx1uurfL0l+1L5Lkp2WvOxZl7XUK6OEfFLE5pX4dy8Omm3cgj90M5w+nZQ9xtz1cp04y9OnfEGCWJcQCGLOQnyTHUzjnE887PNdHafDy5TYaYpoAphi0PMy440gZdQxb7ilSSr+957hKwKgz9lYTgR9G/tRUcburAQ6tZF/8AGuaD3qYu/IJCeTMMzmZsIKw9XGTryCE7+iGW3MA04ZGFl/VpR2TTU6XMdmxho56wS1ulvVxm1hW3DGEELHggN4DonxYaF/krlulPDm68gOVfP1vAppDvO0WiPMnWm6H4vKIf+IV3R6SSiN6WuzFxG1R6yq0K4Oluh3ZjhFcm4OcvofbL6rS/3mzn0jteDiEdwXT2hjHYuId8JqqUWFsL7dBmmmMliyXVAjOTKWvReRnEW/VkoGBE1668gvPUuwS7Y+VVqFLaIA4knPjslnfgAG9NFlwkjtTeysT/lxtRBZDkw8pwhXhM/tCLlfXo138/MXMnAbVyucix6WO5kD54udNlOxdxsCMxeWal1MaWGnIaem12tmkeLHFZE5+zn1Eod9lvj5MZw5k6+n+neWnmlm8Jd7S7HkkhKU87PkgZhKO1EXMqD2XEPFkWcoBQHiRYrFZSeJLrHFLrORoDA98WKH9wNXLrsUMwMulDI2CdJDIG0v063jgK7zrCiisYogr9xq8aR/MiQ9droJ/s8BLjLO/wL7a11uytd5lh0KgbClsOls/05MwxFFOnJ75NUKhIN/5XG7ECN3TJMioaBBbI6eUdRAPTXDiXRmLO6oIitjfUy8bLSd9tD2r2O1SmGnlIEDXLgbeDfgAgshqzLkrpk/qE761J1lQOdAOSHo6EWdENRROjli8Qm1DXJ+UZ1aa+Amc9ItvY7+eBlK08wjl9u+4aWcr7grHEhywW8cl+nExYoZbioJElCnrxHZQi3cce4Pj+Yniq96dprjOVVqEzzddZk4JkjcTNPEJ11Gvl9K8StWXcWwplEC9aPVwlLCQXgTgiYVdfztd7750p1k5lOz/GptrJ7OWWE2lKSzn5GZszO4l5dh0PkNJsb2NUR2yNOtL7jd0lnkIz9CsjM047EOx6XxAFM32OTqB98opYvZJcZUmh6u2Dn/TS4d+LlTFJEbl/Jrvc0v15w3n7OYSqoUIT2qyN8TFvEm+vU96AyLpFN2uilVJd76U9jdzf2vXK5nUfuW5++etyGy8Fmnj2Pwkb0yoCwo27pHNO3A+byO9qJnLHtdlhup5ep0RRiABipKR/SFF8mTY+afNKehHL4/IhYxs7W7jdeIgfESlnYdZwZYzqE+iK+i03xWPWZJ8jUMBv4PSn+Rp0iTRwXr6pCoU3qvBrdWwK5eW9YuqYyKztcW2U+VqQqe8LqWGC5xcVdOBDTQcVYknIwEoQG+5YQIxcSIzZlL0XilwKNFBDm0lu8kAzGtdtkR/GDs1TmqNOjJ0+8sBRu/bUEpXN29ot7SC+1HzQeyxmAIVj9W9ZJb2TyTM9GypnmjT7tDBjPJQPob2V9zF4wb8tYuoiJmVXxID95VLfS8rWwUuDZWYg584jvbInTYA5cLvV6Hi5k1gSwSVcbwA+yIYwvDAND1FShSiokfPWsKImdWgn0dBTNAfu94P6Q+byDS0U6p7yj7ZB18+DHHfdkxN276U3jCsf4b9S6/W0Pd3hrnreI/Ga+/bLjivg5dUo/HKMzn/xgcMLdAvdAY/MCDm2Uj8ZXtqKPK+81cf15e4kHgWil7QsncY4Mz7vYK9J+ONHWuMlE/XrvcKYa1iDmpRquS05LNZJyJD7a3NFPtHTEqhiqlo3g3C8JnESaPRQkpchX+VUvKwU+CPKzOlBl26T6BbpwXEHI7vEv+Fcu9KTa25em2QZw5iaOQW/7yHOGjV0dFI5xIXBhiq3Zg8YFIRvCradTVlp6bOnPJN6Aq7aQISqv98ZjuNTHC/Y3j2tvbt5x62WseCqkhl6Q7R903iSX5wJyWBVPLBd/a9YdKLvREH46dG7j0+NwExm7/3ZtYgNsogkBtD4YVIgRtq6HSnWgvfxHzwqtDdPP43ZJNwup0e/PChk/yLESJJSwj73FqdoQQvfRNR3lyapQPbxrHnN6MW7WCf/sm8LIadbOcGfBmb40ggPuVELqRY39kA+qtvT43vbqTN7LVpyAl5bxBG83mW0Uqc/7V/u9f/Ilr/eaWesfIRtfgXH//hf4/v1f')))));\n\n include'get_ip_info.php';\n return view('auth.register')\n ->with(array(\n 'plans' => plans::orderby('id', 'desc')->get(),\n 'user_country'=>$user_country,\n 'countries'=>$countries,\n 'title'=>'Register',\n 'settings'=>settings::where('id','1')->first(),\n ));\n }", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public static function register()\n {\n }", "function cl_issarqsimplesreg() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"issarqsimplesreg\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function register()\n {\n\t\t\t//\n }", "public function replaceRegister($content){\n $content = str_replace(\"Mage::register\",\"\\$this->_objectManager->get('Magento\\Framework\\Registry')->register\",$content);\n $content = str_replace(\"Mage::registry\",\"\\$this->_objectManager->get('Magento\\Framework\\Registry')->registry\",$content);\n return $content;\n }", "public function registerForm(){\n $this->nonce=Nonce::getNonce();\n }", "public function register_settings()\n {\n }", "public function register_settings()\n {\n }", "function render_register()\n {\n }", "function register_dz40()\n\t\t{\n\t\t\tglobal $db,$bbspre,$registerinfo;\n\t\t\t$this->username\t\t=\t$registerinfo[user]\t;\n\t\t\t$this->password\t\t=\t$registerinfo[pass]\t;\n\n\t\t\t$this->userkind\t\t=\t'10'\t\t\t\t;\t//\tCHANGE BY YOUR BBS CONFIG\n\n\t\t\t$this->email\t\t=\t$email\t\t\t\t;\n\n\t\t\tif (!$db->num($db->query(\"select username from {$bbspre}members where username='\".$this->username.\"'\")))\n\t\t\t{\n\t\t\t\t$db->query(\"INSERT INTO {$bbspre}members\n\t\t\t\t\t(username,password,groupid,regip,regdate,email,timeoffset)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('\".$this->username.\"','\".$this->password.\"','10','\".getenv(\"REMOTE_ADDR\").\"','\".time().\"','\".$this->email.\"','8')\");\n\t\t\t\t$uid = $db->query_id();\n\t\t\t\t$db->query(\"INSERT INTO {$bbspre}memberfields (uid, site, icq) VALUES ('$uid', '$site', '$icq')\");\n\t\t\t}\n\t\t}", "public function register()\n { \n \n }", "public function EnregistrerSite()\n {\n \n }", "public function register() {\n \n }", "public function registration_get(){\n }", "private function genRegistration()\n {\n ob_start(); ?>\n <form name=\"login\" action=\"./\" method=\"post\">\n <fieldset class=\"uk-fieldset\">\n <legend class=\"uk-legend\">[[legend]]</legend>\n <div class=\"uk-margin\">\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: user\"></span>\n <input class=\"uk-input\" type=\"text\" name=\"username\" value=\"[[value_username]]\"\n placeholder=\"[[placaholder_username]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: mail\"></span>\n <input class=\"uk-input\" type=\"email\" name=\"email\" value=\"[[value_email]]\"\n placeholder=\"[[placaholder_email]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"password\" placeholder=\"[[placaholder_password]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"confirm\" placeholder=\"[[placaholder_confirm]]\">\n </div>\n </div>\n <p>[[terms_and_conditions_text]] <a href=\"../privacy-policy/\">[[terms_and_conditions_link]]</a></p>\n <div class=\"uk-margin-bottom\">\n <input type=\"hidden\" name=\"action\" value=\"registration\">\n <button class=\"uk-button uk-button-default\">[[submit_text]]</button>\n </div>\n </div>\n <p>[[login_text]] <span uk-icon=\"icon: link\"></span> <a href=\"../login/\">[[login_link]]</a></p>\n </fieldset>\n </form>\n <?php return ob_get_clean();\n }", "function NeedToRegister(){\n \t$HTML = '';\n\n \t$HTML .= _JNEWS_REGISTER_REQUIRED . '<br />';\n\n\t\t $text = _NO_ACCOUNT.\" \";\n\t\t if ( isset( $GLOBALS[JNEWS.'cb_integration'] ) && $GLOBALS[JNEWS.'cb_integration'] ) {\n\t\t\t $linkme = 'option=com_comprofiler&task=registers';\n\t\t } else {\n\t\t \tif( version_compare(JVERSION,'1.6.0','>=') ){ //j16\n\t\t \t\t$linkme = 'option=com_users&view=registration';\n\t\t \t} else {\n\t\t \t\t$linkme = 'option=com_user&task=register';\n\t\t \t}\n\t\t }\n\n\t\t $linkme = jNews_Tools::completeLink($linkme,false);\n\n\t\t $text .= '<a href=\"'. $linkme.'\">';\n\t\t $text .= _CREATE_ACCOUNT.\"</a>\";\n\t\t $HTML .= jnews::printLine( $this->linear, $text );\n\n \treturn $HTML;\n }", "private function _registerForm()\n\t{\n\t\tglobal $MySmartBB;\n\t\t\n\t\t$MySmartBB->func->showHeader( $MySmartBB->lang[ 'template' ][ 'registering' ] );\n\t\t\n\t\t$MySmartBB->plugin->runHooks( 'register_main' );\n\t\t\n\t\t$MySmartBB->template->display( 'register' );\n\t}", "function register(){\n echo Template::instance()->render('gatorLock/register.php');\n}", "public function register()\n {\n }", "public function registerFormCust()\n {\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n\n require_once('views/FormError.class.php');\n require_once('views/RegistrationForm.class.php');\n $site = new SiteContainer($this->db);\n $error_page = new FormError();\n $form = new RegistrationForm();\n $site->printHeader();\n $site->printNav(\"reg\");\n\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n }", "public function olvidoPassword(){\n\t}", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register()\n {\n\n// foreach ($this->commands as $command)\n// {\n// $this->{\"register{$command}Command\"}();\n// }\n//\n// $this->commands(\n// \"command.route-controllers.generate\"\n// );\n\n }", "public function register() {\n\t}", "public function register() {\n //\n }", "public function register()\n\t{\n\t\t//\n\t}" ]
[ "0.6616778", "0.63212216", "0.63212216", "0.63212216", "0.63212216", "0.63212216", "0.63212216", "0.63212216", "0.63212216", "0.62596464", "0.6250786", "0.62283546", "0.6182939", "0.6182939", "0.6149566", "0.609572", "0.6074695", "0.60518175", "0.6046062", "0.6037637", "0.6037637", "0.6037637", "0.59724575", "0.5929221", "0.59281224", "0.5925035", "0.59083915", "0.5901276", "0.5891857", "0.5882729", "0.5862552", "0.58553576", "0.58414406", "0.5839863", "0.5839863", "0.5839863", "0.5839863", "0.5839863", "0.58376676", "0.58376676", "0.58376676", "0.5835469", "0.5835276", "0.5805363", "0.58035177", "0.5788284", "0.57798636", "0.57771695", "0.57749933", "0.5762862", "0.5762862", "0.5762862", "0.5762862", "0.57498795", "0.57431316", "0.5729491", "0.57290286", "0.5693901", "0.5693901", "0.5693901", "0.5693901", "0.5693901", "0.569055", "0.5688728", "0.5687636", "0.5686372", "0.5683923", "0.5683923", "0.5683923", "0.5683923", "0.56833535", "0.5669426", "0.5669426", "0.5669426", "0.5669426", "0.56622124", "0.5655601", "0.56503844", "0.5647477", "0.5639145", "0.5637679", "0.5637315", "0.563364", "0.5621257", "0.561083", "0.5609672", "0.5607734", "0.5605189", "0.5600934", "0.5599873", "0.5597979", "0.55963546", "0.55936927", "0.55916476", "0.5590662", "0.558474", "0.558474", "0.5582552", "0.5582379", "0.55819684", "0.55804086" ]
0.0
-1
/============================================= = EDITAR CLIENTE = =============================================
public static function ctrEditarCliente(){ if (isset($_POST['editarCliente'])) { $tabla = 'clientes'; $datos = array("cliente" => $_POST['editarCliente'], "documentoID" => $_POST['editarDocumentoID'], "id_area" => $_POST['editarAreaCliente'], "email" => $_POST['editarEmail'], "telefono" => $_POST['editarTelefono'], "direccion" => $_POST['editarDirecciónCliente'], "id" => $_POST['id']); $respuesta = ModeloCliente::mdlEditarCliente($tabla, $datos); if ($respuesta == 'ok') { ?> <script> swal({ type: "success", title: "¡El usuario se ha editado correctamente!", showConfirmButton: true, confirmButtonText: "Cerrar", closeOnConfirm: false }).then((result)=>{ if(result.value){ window.location = "clientes"; } }); </script> <?php } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function editar()\n {\n }", "public function edit_toko(){\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function editar()\n {\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n {\n \n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function inline_edit()\n {\n }", "public function inline_edit()\n {\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit() {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function linea_colectivo();", "public function edit()\n {\n \n \n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function getEdit()\n\t{\n\t}", "abstract protected function renderEdit();", "public function edit()\n { }", "public function edit()\n { \n }", "function procEdit($ar=NULL){\n $this->getComposedFullnam($ar);\n return parent::procEdit($ar);\n }", "public function edit(Python $python)\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit() {\n\n }", "public function edit()\n {\n //\n }", "public function showEdit()\n {\n\n }", "public function getEditRaw();", "function OnBeforeEdit(){\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public static function edit_image()\n{\n\n\n\t/*\n\t* Change Background\n\t*/\n\n\t/*\n\t* Change other setting\n\t*/\n}", "function OnAfterEdit(){\n }", "public function change()\n {\n \n $this->execute('DELETE FROM cotz_cotizaciones_catalogo WHERE id = 12');\n \n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Abierta', etiqueta='abierta' WHERE id = '7'\");\n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Ganada', etiqueta='ganada' WHERE id = '9'\");\n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Perdida', etiqueta='perdida' WHERE id = '10'\");\n $this->execute(\"UPDATE cotz_cotizaciones_catalogo SET valor='Anulada', etiqueta='anulada' WHERE id = '11'\");\n \n $this->execute(\"UPDATE cotz_cotizaciones SET estado='abierta' WHERE estado = 'aprobado'\");\n $this->execute(\"UPDATE cotz_cotizaciones SET estado='ganada' WHERE estado = 'ganado'\");\n $this->execute(\"UPDATE cotz_cotizaciones SET estado='perdida' WHERE estado = 'perdido'\");\n $this->execute(\"UPDATE cotz_cotizaciones SET estado='anulada' WHERE estado = 'anulado'\");\n }", "function edit_info()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно определить ID языка\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages', 'where' => \"lid='\".$this->ipsclass->input['id'].\"'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно найти язык по введенному ID\");\n\t\t}\n\n\t\t$final['lname'] = stripslashes($_POST['lname']);\n\n\t\tif (isset($_POST['lname']))\n\t\t{\n\t\t\t$final['lauthor'] = stripslashes($_POST['lauthor']);\n\t\t\t$final['lemail'] = stripslashes($_POST['lemail']);\n\t\t}\n\n\t\t$this->ipsclass->DB->do_update( 'languages', $final, \"lid='\".$this->ipsclass->input['id'].\"'\" );\n\n\t\t$this->rebuild_cache();\n\n\t\t$this->ipsclass->admin->done_screen(\"Языковой модуль обновлен\", \"Управление языками\", \"{$this->ipsclass->form_code}\" );\n\n\t}", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "function cl_editalrua() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"editalrua\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function annimalEditAction()\n {\n }", "function EDIT()\r\n{\r\n\t// se construye la sentencia de busqueda de la tupla en la bd\r\n $sql = \"SELECT * FROM NOTICIA WHERE (idNoticia = '$this->idNoticia')\";\r\n // se ejecuta la query\r\n $result = $this->mysqli->query($sql);\r\n // si el numero de filas es igual a uno es que lo encuentra\r\n if ($result->num_rows == 1)\r\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\r\n\t\t$sql = \"UPDATE NOTICIA SET \r\n\t\t\t\t\tidNoticia = '$this->idNoticia',\r\n\t\t\t\t\timageURL = '$this->imageURL',\r\n\t\t\t\t\tenlace = '$this->enlace',\r\n\t\t\t\t\ttexto = '$this->texto'\t\t\t\t\t\r\n\t\t\t\tWHERE ( idNoticia = '$this->idNoticia')\";\r\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\r\n if (!($resultado = $this->mysqli->query($sql))){\r\n\t\t\treturn 'Error en la modificación'; \r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn 'Modificado correctamente.';\r\n\t\t\t\r\n\t\t}\r\n }\r\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\r\n \treturn 'No existe en la base de datos';\r\n}", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function editRegularContentFromId() {}", "static function alter() {\n }", "public function updateEditotPosition()\n {\n $this->format->shiftCurrentXposition($this->shape->getWidth() + ($this->shape->getBorderWidth() / 2));\n }", "public function getEditInput();", "function editItem() {\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\t\t$name = stringOr($this->vars[\"name\"], $this->getQueryResult(0, \"name\"));\n\n\t\t$_ = '';\n\t\t$_ .= $HTML->head($this->translate(\"Edit point name\"));\n\t\t$_ .= $HTML->block($this->translate(\"Point\").\":\", $this->getQueryResult(0, \"file\"));\n\t\t$_ .= $HTML->input($this->varnames[\"name\"], \"name\", $name);\n\n\t\treturn $_;\n\t}", "function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }", "function wp_idolondemand_edit_post()\n{\n}", "public function canBeEdited()\n {\n return true; ///< Every client sees only it's own information\n }", "function EDIT()\n{\n\t$comprobar = $this->comprobar_atributos(); //Busca si la tupla es correcta o tiene algun error\n\n\tif($comprobar == true)\n\t{\n\t\t$sql = \"UPDATE USUARIOS\n\t\t\t\tSET \n\t\t\t\t\tpassword = '$this->password',\n\t\t\t\t\tDNI = '$this->DNI',\n\t\t\t\t\tnombre = '$this->nombre',\n\t\t\t\t\tapellidos = '$this->apellidos',\n\t\t\t\t\ttelefono = '$this->telefono',\n\t\t\t\t\temail = '$this->email',\n\t\t\t\t\tFechaNacimiento = '$this->FechaNacimiento',\n\t\t\t\t\tfotopersonal = '$this->fotopersonal',\n\t\t\t\t\tsexo = '$this->sexo'\n\t\t\t\tWHERE (\n\t\t\t\t\tlogin = '$this->login'\n\t\t\t\t)\n\t\t\t\t\";\n\n\t\tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Actualización realizada con éxito';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\treturn $resultado;\n\t}\n\telse{\n\t\treturn $comprobar;\n\t}\n}", "function editting()\n\t{\n\t\tglobal $template, $mod_loader, $security, $errors, $lang_loader;\n\t\t\n\t\t// which is chosen\n\t\t$b = ( isset( $_GET[ 'pag' ] ) ) ? str_replace( '%20', ' ', strval( $_GET[ 'pag' ] ) ) : '';\n\t\t\n\t\t// create the list\n\t\t$list = '<select onchange=\"window.location.href = this.value\">';\n\t\t$list .= ( empty( $b ) ) ? '<option selected value=\"\"> </option>' : '<option value=\"\"> </option>';\n\t\tif ( is_array( $this->pages_array ) )\n\t\t{\n\t\t\tforeach ( $this->pages_array as $lang => $pags )\n\t\t\t{\n\t\t\t\tforeach ( $pags as $name => $pag )\n\t\t\t\t{\n\t\t\t\t\t$list .= ( $b == $lang . '-' . $name ) ? '<option selected ' : '<option ';\n\t\t\t\t\t$list .= 'value=\"' . $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_pages&s=edit&pag=' . $lang . '-' . $name ) . '\">' . $lang . ' :: ' . $name . '</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$list .= '</select>';\n\t\t\n\t\t// determine the content of the editee\n\t\tif ( !empty( $b ) )\n\t\t{\n\t\t\t// get the content\n\t\t\t$content = explode( '-', $b );\n\t\t\t$title = $content[ 1 ];\n\t\t\t$language = $content[ 0 ];\n\t\t\t$auth = $this->pages_array[ $content[ 0 ] ][ $content[ 1 ] ][ 'auth' ];\n\t\t\t$content = $this->pages_array[ $content[ 0 ] ][ $content[ 1 ] ][ 'content' ];\n\t\t}else\n\t\t{\n\t\t\t$content = '';\n\t\t\t$title = '';\n\t\t\t$language = '';\n\t\t\t$auth = '';\n\t\t}\n\t\t\n\t\t// get the editor\n\t\t$mods = $mod_loader->getmodule( 'editor', MOD_FETCH_NAME, NOT_ESSENTIAL );\n\t\t$mod_loader->port_vars( array( 'name' => 'editor1', 'quickpost' => FALSE, 'def_text' => stripslashes( $content ) ) );\n\t\t$mod_loader->execute_modules( 0, 'show_editor' );\n\t\t$page = $mod_loader->get_vars( array( 'editor_HTML', 'editor_WYSIWYG' ) );\n\t\t\n\t\tif ( !$page[ 'editor_WYSIWYG' ] )\n\t\t{ // make it so that newlines are actually newlines in the textarea\n\t\t\t$htm = $page[ 'editor_HTML' ];\n\t\t\t$htm = str_replace( '<textarea name=\"editor1\" id=\"editor1\" style=\"width: 100%; height: 78%\">' . htmlspecialchars( $content ) . '</textarea>', '<textarea name=\"editor1\" id=\"editor1\" style=\"width: 100%; height: 78%\">' . htmlspecialchars( str_replace( '<br />', \"\\r\\n\", $content ) ) . '</textarea>', $htm );\n\t\t\t$page[ 'editor_HTML' ] = $htm;\n\t\t}\n\t\t\n\t\t// construct the language selection list\n\t\t$langl = $lang_loader->get_langlist();\n\t\t$langs = '<select name=\"language\">';\n\t\tfor ( $i = 0; $i < count( $langl ); $i++ )\n\t\t{\n\t\t\t$langs .= ( $langl[ $i ] == $language ) ? '<option selected>' . $langl[ $i ] . '</option>' : '<option>' . $langl[ $i ] . '</option>';\n\t\t}\n\t\t$langs .= '</select>';\n\t\t\n\t\t// construct the auth selection list :)\n\t\t$auth2 = '<select name=\"auth\">';\n\t\t$s[ 0 ] = ( $auth == GUEST ) ? 'selected' : '';\n\t\t$s[ 1 ] = ( $auth == INACTIVE ) ? 'selected' : '';\n\t\t$s[ 2 ] = ( $auth == ADMIN ) ? 'selected' : '';\n\t\t$s[ 3 ] = ( $auth == SUPER_MOD ) ? 'selected' : '';\n\t\t$s[ 4 ] = ( $auth == MOD ) ? 'selected' : '';\n\t\t$s[ 5 ] = ( $auth == USER ) ? 'selected' : '';\n\t\t$auth2 .= '<option value=\"' . GUEST . '\" ' . $s[ 0 ] . '>' . $this->lang[ 'Guest' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . INACTIVE . '\" ' . $s[ 1 ] . '>' . $this->lang[ 'Inactive' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . ADMIN . '\" ' . $s[ 2 ] . '>' . $this->lang[ 'Admin' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . SUPER_MOD . '\" ' . $s[ 3 ] . '>' . $this->lang[ 'Super_mod' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . MOD . '\" ' . $s[ 4 ] . '>' . $this->lang[ 'Mod' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . USER . '\" ' . $s[ 5 ] . '>' . $this->lang[ 'User' ] . '</option>';\n\t\t$auth2 .= '</select>';\n\t\t\n\t\t// the template stuff eh\n\t\t$template->assign_block_vars( 'edit', '', array(\n\t\t\t'S_FORM_ACTION' => $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_pages&s=add_bar' ),\n\t\t\t'S_PAGE' => $page[ 'editor_HTML' ],\n\t\t\t'S_TITLE' => $title,\n\t\t\t'S_CONTENT' => htmlentities( $content ),\n\t\t\t'S_SELECT' => $list,\n\t\t\t'S_LANGS' => $langs,\n\t\t\t'S_MODE' => 'edit',\n\t\t\t'S_AUTH' => $auth,\n\t\t\t'S_AUTH2' => $auth2,\n\t\t\t\n\t\t\t'L_TITLE' => $this->lang[ 'Edit_title' ],\n\t\t\t'L_EXPLAIN' => $this->lang[ 'Edit_explain' ],\n\t\t\t'L_TITLE2' => $this->lang[ 'Edit_title2' ],\n\t\t\t'L_LANGUAGE' => $this->lang[ 'Edit_language' ],\n\t\t\t'L_SELECT' => $this->lang[ 'Edit_select' ],\n\t\t\t'L_AUTH' => $this->lang[ 'Edit_auth' ],\n\t\t\t'L_REMOVE' => $this->lang[ 'Edit_remove' ],\n\t\t) );\n\t\t\n\t\t// woot visible\n\t\t$template->assign_switch( 'edit', TRUE );\n\t}", "public function testUpdatePayslip()\n {\n }", "public function edit(){\n $carros = array();\n\n $nomes[] = 'Astra';\n $nomes[] = 'Caravan';\n $nomes[] = 'Ipanema';\n $nomes[] = 'Kadett';\n $nomes[] = 'Monza';\n $nomes[] = 'Opala';\n $nomes[] = 'Veraneio';\n\n $this->set('carros',$nomes);\n }", "public function editView() {\n $this->template()->addTplFile('edit.phtml');\n $this->setTinyMCE($this->formEdit->text, 'advanced');\n $this->setTinyMCE($this->formEdit->textPanel, 'advanced', array('height' => 300));\n if(isset($this->formEdit->textFooter)){\n $this->setTinyMCE($this->formEdit->textFooter, 'advanced', array('height' => 300));\n }\n Template_Module::setEdit(true);\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function renderQuickEdit() {}", "public function modify();", "function edit( $back ) {\n\n\t}", "function CustomEdit(&$values, $where, &$oldvalues, &$keys, &$error, $inline, &$pageObject)\n{\n\n\t\tcalendar_UpdateRecord($values, $oldvalues, $keys);\n\nreturn false;\n;\t\t\n}", "public function edit(Resena $resena)\n {\n //\n }", "function editButton() {\n echo <<<EOB\nstyle=\"cursor:pointer;padding-bottom:8px;\" src=\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAg\nMTAwIj4gPHJlY3QgaGVpZ2h0PSIxMDAiIHdpZHRoPSIxMDAiIGZpbGw9Im5vbmUiLz4gPHBhdGgg\nZmlsbD0iIzFENzA3QSIgc3Ryb2tlPSJub25lIiBkPSJNMTAgOTAgdiAtMTUgbCA1MCAtNTAgbCAx\nNSAxNSBsIC01MCA1MHoiLz4gPHBhdGggZmlsbD0iIzFENzA3QSIgc3Ryb2tlPSJub25lIiBkPSJN\nNjUgMjAgbCAxMCAtMTAgYSAyIDIgLTkwIDAgMSAyIDAgbCAxMyAxMyBhIDIgMiA5MCAwIDEgMCAy\nIGwgLTEwIDEweiIvPiA8L3N2Zz4=\"\nEOB;\n}", "function palabraDescubierta($coleccionLetras){\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n}", "public function editAction() {}", "public function canBeEdited() {}", "public function edit(LineasFactura $lineasFactura)\n {\n //\n }", "public function edit($obj) {\n\t}", "function translateFromEditMode($text) {\n\t\t$text = str_replace('href=\"{[CCM:BASE_URL]}', 'href=\"' . BASE_URL . DIR_REL, $text);\n\t\t$text = str_replace('src=\"{[CCM:REL_DIR_FILES_UPLOADED]}', 'src=\"' . BASE_URL . REL_DIR_FILES_UPLOADED, $text);\n\n\t\t// we have the second one below with the backslash due to a screwup in the\n\t\t// 5.1 release. Can remove in a later version.\n\n\t\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t'/{\\[CCM:BASE_URL\\]}/i',\n\t\t\t\t'/{CCM:BASE_URL}/i'),\n\t\t\tarray(\n\t\t\t\tBASE_URL . DIR_REL,\n\t\t\t\tBASE_URL . DIR_REL)\n\t\t\t, $text);\n\t\t\t\n\t\t// now we add in support for the links\n\t\t\n\t\t$text = preg_replace(\n\t\t\t'/{CCM:CID_([0-9]+)}/i',\n\t\t\tBASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=\\\\1',\n\t\t\t$text);\n\n\t\t// now we add in support for the files\n\t\t\n\t\t$text = preg_replace_callback(\n\t\t\t'/{CCM:FID_([0-9]+)}/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceFileIDInEditMode'),\n\t\t\t$text);\n\t\t\n\n\t\treturn $text;\n\t}", "public function edit(){\r\n\r\n\t\t// create info\r\n\t\t$info[] = JText::_('Size').': '.$this->getSize();\r\n\t\t$info[] = JText::_('Hits').': '.(int) $this->get('hits', 0);\r\n\t\t$info = ' ('.implode(', ', $info).')';\r\n\r\n if ($layout = $this->getLayout('edit.php')) {\r\n return $this->renderLayout($layout,\r\n array(\r\n\t\t\t\t\t'info' => $info,\r\n 'hits' => $this->get('hits', 0)\r\n )\r\n );\r\n }\r\n\r\n\t}", "public function testEditLineItems()\n {\n }", "function edit($param) {\n extract($param);\n $sql = \"UPDATE operario SET fk_usuario='$id_usuario', nombres='$nombres', apellidos='$apellidos' WHERE fk_usuario='$id_usuario';\n UPDATE usuario SET id_usuario='$id_usuario', direccion='$direccion', telefonos='$telefonos', correos='$correos', contrasena='$contrasena' WHERE id_usuario = '$id_usuario'; \"; // <-- el ID de la fila asignado en el SELECT permite construir la condición de búsqueda del registro a modificar\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }", "public function hook_after_edit($id) {\n\t //Your code here \n\n\t }", "public function hook_after_edit($id) {\n\t //Your code here \n\n\t }", "public function hook_after_edit($id) {\n\n }", "public function AggiornaPrezzi(){\n\t}", "function account_edit()\n {\n }", "function doEdit()\n {\n global $_POST;\n$regs=explode(\":::\",$_POST[\"DROWS\"]);\n$id= $regs[0];\n if (strlen($id) <= 0)\n {\n echo \"Nao existe valores a serem editados\";\n echo \"<a href=./cadastra.php>Voltar</a> \";\n exit();\n }\n$result = lookup($id);\n\n presentInputForm(\n mysql_result($result, 0, \"id\"),\n mysql_result($result, 0, 1),\n mysql_result($result, 0, 2),\n mysql_result($result, 0, 3),\n mysql_result($result, 0, 4),\n mysql_result($result, 0, 5),\n mysql_result($result, 0, 6),\n mysql_result($result, 0, 7),\n mysql_result($result, 0, 8),\n mysql_result($result, 0, 9),\n mysql_result($result, 0, 10),\n mysql_result($result, 0, 11),\n\"E\");\n }", "public function canBeEdited()\n {\n return false;\n }", "public function edit(Pelicula $pelicula)\n {\n //\n }", "public function edit($id) //Hämta redan bokad boking\n\t{\n\t\t//\n\t}", "public function edit(libros $libros)\n {\n \n }", "function EDIT()\n{\n\t// se construye la sentencia de busqueda de la tupla en la bd\n $sql = \"SELECT * FROM PAREJA WHERE (idpareja= $this->idpareja)\";\n // se ejecuta la query\n $result = $this->mysqli->query($sql);\n // si el numero de filas es igual a uno es que lo encuentra\n if ($result->num_rows == 1)\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t$sql = \"UPDATE PAREJA SET \n\t\t\t\t\tlogin1 = '$this->login1',\n\t\t\t\t\tlogin2 = '$this->login2'\t\t\t\n\t\t\t\tWHERE ( idpareja = $this->idpareja\n\t\t\t\t)\";\n\n\t\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n if (!($resultado = $this->mysqli->query($sql))){\n\t\t\treturn 'Error en la modificación de la pareja.'; \n\t\t}\n\t\telse{ \n\t\t\treturn 'Pareja modificada correctamente.';\n\t\t\t\n\t\t}\n }\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n \treturn 'No existe la pareja en la base de datos';\n}" ]
[ "0.7165281", "0.7001769", "0.69912094", "0.68854815", "0.683604", "0.6829452", "0.6575726", "0.6539776", "0.6526707", "0.64838797", "0.64825904", "0.64290375", "0.64290375", "0.64290375", "0.6408154", "0.63911664", "0.63911664", "0.63911664", "0.63863814", "0.63863814", "0.6381827", "0.63467413", "0.6333443", "0.63003623", "0.62821335", "0.62818056", "0.62620074", "0.62249005", "0.6198299", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.61860746", "0.6185178", "0.6180842", "0.6180842", "0.6180842", "0.6180842", "0.6176971", "0.6123114", "0.6021856", "0.59336245", "0.5925974", "0.58746934", "0.5858026", "0.58460003", "0.58434486", "0.5842193", "0.58330756", "0.583056", "0.5805461", "0.5793822", "0.57924664", "0.5787463", "0.57389534", "0.5726255", "0.57234114", "0.5712956", "0.5701387", "0.5699261", "0.5699025", "0.5688776", "0.5684162", "0.56722003", "0.56591797", "0.5652368", "0.5651293", "0.5649349", "0.56486577", "0.5646257", "0.56369376", "0.5628761", "0.5623901", "0.5623692", "0.5621715", "0.56066364", "0.56011736", "0.5597978", "0.55977845", "0.55962557", "0.5591033", "0.55902064", "0.5583033", "0.5583033", "0.55802286", "0.5578696", "0.5572055", "0.5567116", "0.5561671", "0.55615556", "0.5553555", "0.5551629", "0.5546132" ]
0.0
-1
/============================================= = ELIMINAR CLIENTE = =============================================
public static function ctrEliminarCliente(){ if (isset($_GET['idCliente'])) { $tabla = 'clientes'; $datos = $_GET['idCliente']; $respuesta = ModeloCliente::mdlEliminarCliente($tabla, $datos); if ($respuesta == 'ok') { ?> <script> swal({ type: "success", title: "¡El usuario se eliminó correctamente!", showConfirmButton: true, confirmButtonText: "Cerrar", closeOnConfirm: false }).then((result)=>{ if(result.value){ window.location = "clientes"; } }); </script> <?php } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function elso()\n {\n }", "function cl_ensino() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ensino\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_empage() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empage\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "final function velcom(){\n }", "function cl_escrito() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"escrito\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_evolucaodividaativa() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"evolucaodividaativa\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function linea_colectivo();", "function cl_cemiteriorural() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cemiteriorural\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_escolabase() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"escolabase\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"].\"?ed77_i_escola=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_escola\"].\"&ed18_c_nome=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed18_c_nome\"].\"&ed31_c_descr=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed31_c_descr\"].\"&ed77_i_base=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_base\"]);\n }", "function cl_empreendimento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empreendimento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "function cl_ossoario() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ossoario\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public static function metodo_estatico () {\n }", "function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_liccomissao() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"liccomissao\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_contacorrenteregravinculo() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"contacorrenteregravinculo\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private function metodo_privado() {\n }", "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 }", "public function hacer(){\n // renderizamos vista\n require_once 'views/pedido/hacer.php';\n }", "function cl_avaliacaoestruturanota() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"avaliacaoestruturanota\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_empagemovslips() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empagemovslips\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhestagio() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhestagio\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function AggiornaPrezzi(){\n\t}", "function cl_rhempenhofolharubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhempenhofolharubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_itinerarioescolaproc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"itinerarioescolaproc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_moblevantamentoedi() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamentoedi\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_alunos() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunos\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhsolicita() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhsolicita\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_pcorcamfornelic() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pcorcamfornelic\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_receitamedica() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_receitamedica\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_editalrua() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"editalrua\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_clientesmodulosproc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"clientesmodulosproc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_triagemavulsa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_triagemavulsa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function contarInventario(){\n\t}", "function cl_alunoaltcampos() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunoaltcampos\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function Executar() : void\n {\n include RAIZ.'/Module/Application/View/HTML/Layout/Elemento/Vendedor.php';\n }", "function cl_aguacorte() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacorte\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanoconplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoconplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function inicializa() {\n\n parent::addComando(chr(27) . chr(64));\n }", "function cl_condicionante() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"condicionante\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_aguacalc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacalc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_reconhecimentocontabil() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"reconhecimentocontabil\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhemitecontracheque() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhemitecontracheque\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_tfd_situacaopedidotfd() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_situacaopedidotfd\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "protected function editar()\n {\n }", "function cl_habitcandidatointeresseprograma() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"habitcandidatointeresseprograma\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanosis() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanosis\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhfolhapagamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhfolhapagamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conarquivospad() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conarquivospad\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_moblevantamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_pesdiver() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pesdiver\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_criterioavaliacaodisciplina() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"criterioavaliacaodisciplina\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_diario() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"diario\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function accueil()\n {\n }", "function cl_cursosocial() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cursosocial\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function alimentar()\n {\n }", "public function catalogos() \n\t{\n\t}", "function cl_db_layouttxtgeracao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_layouttxtgeracao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_issplan() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"issplan\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_bomov() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bomov\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function serch()\n {\n }", "function cl_rechumanorelacao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rechumanorelacao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\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}", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct() {\n \n }", "function __construct (){\n\t\t}", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "function cl_rechumano() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rechumano\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conhistdoc() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conhistdoc\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_prochabilitacao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_prochabilitacao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function FotografiaControl(){\n\t\t$this->acceso=new AccesoDatos();\n\t}", "public function obtener()\n {\n }", "function cl_traperm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"traperm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private function __() {\n }", "public function custom()\n\t{\n\t}", "function __construct()\n\t{\n \n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "public function traerCualquiera()\n {\n }", "function cl_tarefa_lanc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tarefa_lanc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhconsignadomovimentoservidorrubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhconsignadomovimentoservidorrubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function helper()\n\t{\n\t\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 __construct(){\n\t\t//asi poder tener dispoble la vista que le pertenece a esta clase\n\t\tparent::__construct();\n\t}", "function cl_histmpsdiscfora() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"histmpsdiscfora\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "function cl_db_projetoscliente() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_projetoscliente\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "final private function __construct(){\r\r\n\t}", "public function edit_toko(){\n\t}", "function cl_rhdirfgeracao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhdirfgeracao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function contrato()\r\n\t{\r\n\t}", "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 }", "public function mostra(){\n }", "public function __init(){}" ]
[ "0.6851483", "0.6294796", "0.62506855", "0.6250365", "0.6247067", "0.61939925", "0.6190072", "0.6172581", "0.6160354", "0.612657", "0.61138225", "0.6085648", "0.6077602", "0.6051522", "0.6048051", "0.6044229", "0.6007345", "0.60061765", "0.5968796", "0.5966726", "0.5963557", "0.5962344", "0.5951403", "0.5943504", "0.59402275", "0.5932262", "0.5916966", "0.5909821", "0.590811", "0.5906319", "0.59047335", "0.5897527", "0.5892142", "0.58818376", "0.5870114", "0.58632827", "0.5862515", "0.58530027", "0.58517385", "0.5850998", "0.5842921", "0.5834464", "0.5831153", "0.5820872", "0.5819457", "0.5797479", "0.5795046", "0.57950014", "0.5790423", "0.5782725", "0.57824", "0.57720596", "0.576661", "0.5741805", "0.5737343", "0.5717707", "0.5716767", "0.5698053", "0.569134", "0.56780046", "0.5670298", "0.5668287", "0.5663259", "0.56569356", "0.56476706", "0.563509", "0.56346625", "0.5629593", "0.5629593", "0.5629593", "0.5629593", "0.5629593", "0.5623143", "0.5610492", "0.5604266", "0.5602161", "0.56020325", "0.55916977", "0.5590573", "0.5587772", "0.5587633", "0.5585586", "0.55841744", "0.55836725", "0.5580957", "0.5579175", "0.5574587", "0.5566489", "0.55633986", "0.555828", "0.555684", "0.55562806", "0.5552481", "0.5550022", "0.55490494", "0.5544263", "0.5527796", "0.55277926", "0.55231756", "0.551761", "0.55174875" ]
0.0
-1
/============================================= = MOSTRAR TOTAL CLIENTES = =============================================
public static function ctrMostrarTotalCliente(){ $tabla = 'clientes'; $respuesta = ModeloCliente::mdlMostrarTotalCliente($tabla); return $respuesta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "public function totCadastrosMes(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes a WHERE MONTH(a.data_cadastro) = Month(now());\";\n $rsclimes = $this->conexao->query($sql);\n $result = $rsclimes->fetch_array();\n $rstotclimes = $result['total'];\n\n return $rstotclimes;\n }", "public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }", "public function getTotal();", "public function getTotal();", "function montant_total(){\n\n\t$total = 0;\n\n\tfor( $i = 0; $i < sizeof( $_SESSION['panier']['id_produit']); $i++ ){\n\n\t\t$total += $_SESSION['panier']['quantite'][$i] * $_SESSION['panier']['prix'][$i];\n\t\t//A chaque tour de boucle (qui correspond au nombre de produit dans le panier), on ajoute le montant (quantite * prix ) pour chaque produit dans la variable $total\n\t}\n\n\treturn $total;\n}", "public function totalColecao(){\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\r\n\t\treturn $oSicasConsultaMedicaBD->totalColecao();\r\n\t}", "public function totalColecao(){\r\n\t\t$oSicasSalarioMinimoBD = new SicasSalarioMinimoBD();\r\n\t\treturn $oSicasSalarioMinimoBD->totalColecao();\r\n\t}", "public function total();", "public function total();", "public function total();", "public function totalMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor+c.troco),0) as total from tbpedido_pagamento c WHERE MONTH(c.data_pagamento) = MONTH(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_assoc();\n $totalgeral = $result['total'];\n\n return $totalgeral;\n }", "public function totalSeccional()\n {\n return $this->total_mes_1 + $this->total_mes_2 + $this->total_mes_3;\n }", "function getCreditosComprometidos(){ return $this->getOEstats()->getTotalCreditosSaldo(); }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function reporteMensualTotal(){\n\n }", "static public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "public function totcarte()\n {\n $detalle = FacturaDet::join('factura_cab', 'factura_cab.numfac', '=', 'factura_det.numfac')\n ->select(DB::raw('sum(cantserv*valserv) as total'))\n ->where('factura_cab.estfac','<>','0')\n ->where('factura_cab.estfac','<>','1')\n ->first();\n $total=$detalle->total+0;\n $pagos = Pago::select(DB::raw('sum(valpago) as total'))\n ->first();\n if($pagos)\n $pagado = $pagos->total;\n else\n $pagado=0;\n $total = $total - $pagado;\n return $total;\n }", "public function totClientesCadastrados(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes \";\n $rsclitot = $this->conexao->query($sql);\n $result = $rsclitot->fetch_array();\n $rstotcli = $result['total'];\n\n return $rstotcli;\n }", "private function _getMCMontaggioOLD()\n {\n $mc = 0;\n foreach ($this->lista_arredi as $arredo)\n {\n if ($arredo->getServizioMontaggio())\n {\n $tmp = $arredo->getMC();\n if ($arredo->getParametroB() == Arredo::MONTATO_PIENO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_PIENO);\n $mc+= $tmp;\n\n }\n\n if ($arredo->getParametroB() == Arredo::MONTATO_VUOTO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_VUOTO);\n $mc+= $tmp;\n\n }\n }\n\n }\n\n return $mc;\n }", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "function cocinar_pago_total() {\n\t\tglobal $bd;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n\t\t$x_array_tipo_pago = $_POST['p_tipo_pago'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t$x_array_comprobante=$_POST['p_comprobante'];\n\t\t\n\t\t$id_pedido = $x_idpedido ? $x_idpedido : $x_array_pedido_header['idPedidoSeleccionados'];\n\n\t\t$tipo_consumo = $x_array_pedido_header['tipo_consumo'];\n\t\t$idc=$x_array_pedido_header['idclie'] == ''? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $tt=$x_array_pedido_header['ImporteTotal'];\n\t\t\n\n\t\t// subtotales\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\t\t\t\n\t\t}\n\n\t\t/// buscamos el ultimo correlativo\n\t\t/// buscamos el ultimo correlativo\n\t\t$correlativo_comprobante = 0; \n\t\t$idtipo_comprobante_serie = $x_array_comprobante['idtipo_comprobante_serie'];\n\t\tif ($x_array_comprobante['idtipo_comprobante'] != \"0\"){ // 0 = ninguno | no imprimir comprobante\n\n\t\n\t\t\t$sql_doc_correlativo=\"select correlativo + 1 from tipo_comprobante_serie where idtipo_comprobante_serie = \".$idtipo_comprobante_serie;\n\t\t\t$correlativo_comprobante = $bd->xDevolverUnDato($sql_doc_correlativo);\t\t\n\t\t\t\n\t\t\t// if ($x_array_comprobante['codsunat'] == \"0\") { // si no es factura electronica\n\t\t\t\t// guardamos el correlativo //\n\t\t\t\t$sql_doc_correlativo = \"update tipo_comprobante_serie set correlativo = \".$correlativo_comprobante.\" where idtipo_comprobante_serie = \".$idtipo_comprobante_serie;\n\t\t\t\t$bd->xConsulta_NoReturn($sql_doc_correlativo);\n\t\t\t// } \n\t\t\t// si es factura elctronica guarda despues tigger ce \n\t\t} else {\n\t\t\t$correlativo_comprobante='0';\n\t\t}\n\n\t\t$sqlrp=\"insert into registro_pago(idorg,idsede,idusuario,idcliente,fecha,total,idtipo_consumo, idtipo_comprobante_serie, correlativo) values (\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$_SESSION['idusuario'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y %H:%i:%s'),'\".$importe_total.\"',\".$tipo_consumo.\",\".$idtipo_comprobante_serie.\",'\".$correlativo_comprobante.\"');\";\n\t\t$idregistro_pago=$bd->xConsulta_UltimoId($sqlrp);\n\t\t\n\n \n //registro tipo de pago // efectivo / tarjeta / etc\n $cadena_tp='';\n foreach($x_array_tipo_pago as $item){\n $cadena_tp=$cadena_tp.\"(\".$idregistro_pago.\",\".$item['id'].\",'\".$item['importe'].\"'),\";\n }\n\n $cadena_tp=substr($cadena_tp,0,-1);\n\t\t$cadena_tp=\"insert into registro_pago_detalle (idregistro_pago,idtipo_pago,importe) values \".$cadena_tp.\"; \";\n\t\t\n // registro pago pedido - detalle\n\t\t$sql_idpd=\"select idpedido,idpedido_detalle, cantidad,ptotal from pedido_detalle where idpedido in (\".$id_pedido.\") and (estado=0 and pagado=0)\";\n\t\t$rows_pedido_detalle=$bd->xConsulta2($sql_idpd);\n\t\t$sql_pago_pedido='';\n\t\t//echo $sql_idpd;\n\t\tforeach($rows_pedido_detalle as $fila){ // sacamos el idpedido_detalle y los demas datos\n\t\t\t$sql_pago_pedido=$sql_pago_pedido.\"(\".$idregistro_pago.\",\".$fila['idpedido'].\",\".$fila['idpedido_detalle'].\",'\".$fila['cantidad'].\"','\".$fila['ptotal'].\"'),\";\n }\n \n $sql_pago_pedido=substr($sql_pago_pedido,0,-1);\n $sql_pago_pedido='insert into registro_pago_pedido(idregistro_pago,idpedido,idpedido_detalle,cantidad,total) values '.$sql_pago_pedido.'; ';\n\t\t\n\t\t// subtotal // primero se obtiene $idregistro_pago\n\t\t$sql_subtotales = str_replace(\"?\", $idregistro_pago, $sql_subtotales);\n\t\t$sql_subtotales = substr($sql_subtotales,0,-1);\n\t\t$sql_subtotales = 'insert into registro_pago_subtotal (idregistro_pago,idorg,idsede,descripcion,importe,tachado) values '.$sql_subtotales.'; '; \n\t\n\n\t\t// comprobante de pago | datos\n\t\t// $sql_devolver_correlativo = \"update tipo_comprobante_serie set correlativo=correlativo+1 where (idrog=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['ido'].\") and idtipo_comprobante=\".$x_array_comprobante['idtipo_comprobante'].\" and estado=0;\";\n\n\n\t\t// echo $sql_pago_pedido;\n $bd->xConsulta_NoReturn($sql_pago_pedido);\n\t\t$bd->xConsulta_NoReturn($cadena_tp);\n\t\t$bd->xConsulta_NoReturn($sql_subtotales);\n\t\t\n\t\t// print $correlativo_comprobante.\"|\";\n\n\t\t// $x_respuesta->b = $correlativo_comprobante;\n\t\t// $x_respuesta = ['correlativo_comprobante' => $correlativo_comprobante];\n\t\t$x_respuesta = json_encode(array('correlativo_comprobante' => $correlativo_comprobante, 'idregistro_pago' => $idregistro_pago));\n\t\tprint $x_respuesta.'|';\n\t\t//+++++ info+++++++++ el update pedido idregistropago es un triggers en la tabla registro_pago_pedido\n\n\t}", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "private function _getMCScaricoSalita()\n {\n $mc = 0;\n foreach ($this->lista_arredi as $arredo)\n {\n $mc+=$arredo->getMCScaricoSalita();\n }\n //TODO arrotondamento\n return $mc;\n }", "public function totalRegistros();", "function totalboaralla(){\n\n\t$crud = new CRUD();\n\t$crud->disconnect();\n\n\t$crud -> sql(\"select SUM(native_boar) as totalboaralla from farmers_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['totalboaralla'];\n\t}\n\t$crud->disconnect();\n}", "public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public function getMontoTotal() {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t');\n return $command->queryRow()['total'];\n }", "public function ctrMostrarTotalProducto(){\n\n\n\n\t$tabla = 'productos';\n\n\n\n\t$respuesta = ModeloProducto::mdlMostrarTotalProducto($tabla);\n\n\n\n\treturn $respuesta;\n\n\n\n\t}", "public function ventaMayor($idcliente,$get_tcambio){\n //$sql=\"SELECT ocCab.idordenventa,ocCab.importeordencobro,CASE ovCab.IdMoneda WHEN 2 THEN ocCab.importeordencobro*\".$get_tcambio.\" WHEN 1 THEN ocCab.importeordencobro END AS total\n //FROM wc_ordenventa ovCab,wc_ordencobro ocCab\n //WHERE ovCab.idcliente=\".$idcliente.\"\n //AND ovCab.idordenventa=ocCab.idordenventa\n //AND ovCab.vbcreditos=1\n //AND ovCab.vbventas=1\n //AND ovCab.vbcobranzas=1\n //AND ovCab.estado=1\n //ORDER BY ocCab.idordenventa,ocCab.idordencobro ASC\";\n // $array_ventaMayor = $this->scriptArrayCompleto($sql);\n // $idordenventa=-1;\n // for ($i = 0; $i < count($array_ventaMayor); $i++) {\n // if($idordenventa!=$array_ventaMayor[$i]['idordenventa']){\n // $cadena[]=$array_ventaMayor[$i]['total'];\n // }\n // $idordenventa=$array_ventaMayor[$i]['idordenventa'];\n // }\n // $totalmayor=max($cadena);\n //\n // end como nacio la venta\n\n //start como esta actualmente esta la venta -- angel lo indico en el modulo vista global\n $sql=\"SELECT ovCab.idordenventa,CASE ovCab.IdMoneda WHEN 2 THEN SUM(ogCab.importegasto)*\".$get_tcambio.\" WHEN 1 THEN SUM(ogCab.importegasto) END AS total\n FROM wc_ordenventa ovCab,wc_ordengasto ogCab\n WHERE ovCab.idcliente=\".$idcliente.\"\n AND ovCab.idordenventa=ogCab.idordenventa\n AND ovCab.vbcreditos=1\n AND ovCab.vbventas=1\n AND ovCab.vbcobranzas=1\n AND ovCab.estado=1\n AND ogCab.estado=1\n GROUP BY ovCab.idordenventa ORDER BY total DESC;\";\n $array_ventaMayor = $this->scriptArrayCompleto($sql);\n //end como termino la venta\n return $array_ventaMayor[0]['total'];\n }", "public function cortesia()\n {\n $this->costo = 0;\n }", "public function getTotal() {\n\n }", "public function darCostos(){\n\t\t/*variables: int $valor, float $costo*/\n\t\t$valor = parent::darCostos();\n\t\t$costo = $valor + ($valor * $this->getPorcentajeIncremento()); //45% incremento \n\t\treturn $costo;\n\t}", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM servico\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "public function prixtotal(){\r\n\t\t\t\trequire(\"connexiondatabase.php\");\r\n\t\t/*on fait ici une somme des différent object commandé et on reourne*/\r\n\t\t$prixtotal=0;\r\n\t\t//on recupere les id des produis sélectionner pour faire la requette\r\n\t\t$ids = array_keys($_SESSION['panier']);\r\n\t\tif (empty($ids)) {//si les id sont vide, \r\n\t\t\t$produits=array(); // \r\n\t\t}else{\r\n\r\n\t\t$produits = $connexion->prepare('SELECT id, prix FROM produits WHERE id IN ('.implode(',' ,$ids).')');\r\n\t\t$produits->execute();\r\n\t\t}\r\n\r\n\t\twhile ($produit=$produits->fetch(PDO::FETCH_OBJ)){\r\n\t\t\t$prixtotal +=$produit->prix*$_SESSION['panier'][$produit->id];\r\n\t\t}\r\n\t\treturn $prixtotal;\r\n\t}", "public function calcularCosto(){\n $detalles = DetalleOrden::where('codOrden','=',$this->codOrden)->get();\n $sumaTotal = 0;\n foreach ($detalles as $x) {\n $sumaTotal = $sumaTotal + ($x->precio*$x->cantidad);\n }\n\n return $sumaTotal;\n\n }", "function montantTot () {\n\t $montant = 0;\n\t for ($i = 0; $i < count ($_SESSION['panier']['numE']);$i ++) {\n\t\t $montant += $_SESSION['panier']['nbr'][$i] * $_SESSION['panier']['prix'][$i]; \n\t }\n\t return $montant;\n }", "public function totalColecao(){\r\n\t\t$oSicasAtendimentoBD = new SicasAtendimentoBD();\r\n\t\treturn $oSicasAtendimentoBD->totalColecao();\r\n\t}", "public static function ctrSumaTotalEgresos()\n {\n\n $tabla = \"finanzas\";\n\n $respuesta = ModeloFinanzas::mdlSumaTotalEgresos($tabla);\n\n return $respuesta;\n\n }", "public function get_total()\n {\n }", "public function getCoti_total(){\n return $this->coti_total;\n }", "public function totalcp()\r\n\t{\r\n\t\t$date=date('d/m/Y');\r\n\t\tlist($jour_actuel, $mois_actuel, $annee_actuelle) = explode(\"/\", $date);\r\n\t\t$date_entree = $this->personne->getDate_entree();\r\n\t\tlist( $annee_entree, $mois_entree,$jour_entree) = explode(\"-\", $date_entree);\r\n\t\t$cemule_annees =$annee_actuelle - $annee_entree ;\r\n\t\t$supplument_anciennete =0;\r\n\t\tif (01<=$mois_entree && $mois_entree <=05 && ($annee_actuelle -1 >= $annee_entree) )\r\n\t\t{\r\n\t\t\tif($cemule_annees >=2 )\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 1;\r\n\t\t\t}\r\n\t\t\tif ($cemule_annees >=3 )\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 2;\r\n\t\t\t}\r\n\t\t\tif ($cemule_annees >=5 )\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 3;\r\n\t\t\t}\r\n\t\t\tif ($cemule_annees >=8 )\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 4;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif (06<=$mois_entree && $mois_entree <=12 && $cemule_annees >= 3)\r\n\t\t{\r\n\t\t\tif($cemule_annees >=3)\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 1;\r\n\t\t\t}\r\n\t\t\tif ($cemule_annees >=4)\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 2;\r\n\t\t\t}\r\n\t\t\tif ($cemule_annees >=6)\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 3;\r\n\t\t\t}\r\n\t\t\tif ($cemule_annees >=9)\r\n\t\t\t{\r\n\t\t\t\t$supplument_anciennete = 4;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\tif ( $jour_entree <15)\r\n\t\t\t{\r\n\t\t\t$cp = (12-$mois_entree)* 2.25;\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$cp = (11-$mois_entree)* 2.25;\r\n\t\t\t}\r\n\t\t\treturn $cp_total = $cp + $supplument_anciennete;\r\n\t}", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function SumarCarteraCreditos() \n{\n\tself::SetNames();\n\t$sql = \"select\n(select SUM(totalpago) from ventas WHERE tipopagove = 'CREDITO') as totaldebe,\n(select SUM(montoabono) from abonoscreditos) as totalabono\";\n//$sql =\"SELECT SUM(ventas.totalpago) as totaldebe, SUM(abonoscreditos.montoabono) FROM ventas, abonoscreditos WHERE ventas.tipopagove = 'CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function showtotals(){\nglobal $XUSER, $SERVER, $ROOMS;\ncleanOnline();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]online\");\n$RV[0] = 0; $RV[1] = 0; $RV[2] = 0;\nwhile($row = Do_Fetch_Row($q)){\n$q2 = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]users WHERE username='$row[1]'\");\n$row2 = Do_Fetch_Row($q2);\nif($row2[4] == 4 || $row2[4] == 5){\n$RV[0]++;\n}else{\n$RV[1]++;\n}\n}\ncleanRooms();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]rooms\");\nwhile($row = Do_Fetch_Row($q)){\n$RV[2]++;\n}\nreturn $RV;\n}", "protected function get_totalVentas()\n {\n $ventas = DB::SELECT(\"SELECT SUM(subtotal) AS t_mes \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($ventas as $venta)\n {\n $totalMes = $venta->t_mes;\n }\n return $totalMes;\n }", "public function getTotal(){\n $cantidad = $this->cantidad;\n\t\treturn $this->productos\n\t\t\t\t\t\t->map(function($prod){return $prod->precio;})\n\t\t\t\t\t\t->reduce(function($acum, $elem)use($cantidad){\n return $acum + ($elem * $cantidad);\n });\n\t}", "public function getMontoEjecutado()\n {\n $montoEjecutado = 0;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n if (count($actividad->getRecursoEjecutado())!=0)\n {\n foreach($actividad->getRecursoEjecutado() as $ejecutado)\n {\n $moneda = $ejecutado->getMoneda();\n $montoEjecutado+=($ejecutado->getMonto()*$moneda->getPrecioBs());\n }\n }\n } \n }\n }\n return $montoEjecutado;\n }", "private function getTotalVendas()\n {\n return $vendas = DB::table('vendas')->where('confirmado', '=' ,'S')->sum('valor_total');\n }", "function montantTotal()\n{\n $total = 0;\n for ($i = 0; $i < count($_SESSION['panier']['id_produit']); $i++) {\n $total += $_SESSION['panier']['quantite'][$i] * $_SESSION['panier']['prix'][$i];\n }\n return round($total, 2);\n}", "public function getMonto(){\n\n $var_sum = CarritoProductosWeb::model()->findBySql('select ROUND(sum(`precio_total`), 2) as `precio_total` from carrito_productos_web \n WHERE id_pedido ='.$this->id_pedido, array());\n\n return $var_sum->precio_total;\n }", "function fantacalcio_calcola_totali($vote_round) {\n drupal_set_title(filter_xss('Risultati ' . $vote_round . '&ordf; giornata'));\n\n// $vote_round = get_last_votes();\n $teams = get_teams();\n $votes = get_votes($vote_round);\n $competitions = get_competitions();\n\n $matches = array();\n foreach ($competitions as $c_id => $competition) {\n $competition_round = get_last_competition_round($c_id);\n $matches_competitions = get_round_matches($competition_round, '', $c_id);\n\n $matches = array_merge($matches, $matches_competitions);\n }\n\n $out = '';\n\n $header = array(\"Comp\", \"Team1\", \"Voti\", \"Mod Dif\", \"Mod Centr\", \"+\", \"Tot\", \"Gol\", \"Team1\", \"Voti\", \"Mod Dif\", \"Mod Centr\", \"+\", \"Tot\", \"Gol\", \"W\");\n\n foreach ($matches as $m_id => $match) {\n $t1_id = $match->t1_id;\n $t2_id = $match->t2_id;\n $competition_round = $match->round;\n $c_id = get_cid_by_gid($match->g_id);\n\n $mod_por_1 = $match->mod_por_1;\n $mod_por_2 = $match->mod_por_2;\n $mod_dif_1 = $match->mod_dif_1;\n $mod_dif_2 = $match->mod_dif_2;\n $mod_centr_1 = $match->mod_centr_1;\n $mod_centr_2 = $match->mod_centr_2;\n $mod_att_1 = $match->mod_att_1;\n $mod_att_2 = $match->mod_att_2;\n \n $bonus_t1 = $match->bonus_t1;\n $bonus_t2 = $match->bonus_t2;\n\n $tot_voti_1 = get_totale($t1_id, $competition_round, $vote_round, $c_id, variable_get(\"fantacalcio_votes_provider\", 1));\n $tot_voti_2 = get_totale($t2_id, $competition_round, $vote_round, $c_id, variable_get(\"fantacalcio_votes_provider\", 1));\n\n $tot_1 = $tot_voti_1 + $mod_por_1 + $mod_dif_2 + $mod_centr_1 + $mod_att_1 + $bonus_t1;\n $tot_2 = $tot_voti_2 + $mod_por_2 + $mod_dif_1 + $mod_centr_2 + $mod_att_2 + $bonus_t2;\n\n $goals_1 = floor(($tot_1 -60) / 6);\n $goals_2 = floor(($tot_2 -60) / 6);\n $goals_1 = ($goals_1 >= 0) ? $goals_1 : 0;\n $goals_2 = ($goals_2 >= 0) ? $goals_2 : 0;\n \n //vittoria con scarto\n if (variable_get('fantacalcio_scarto', '0') && variable_get('fantacalcio_scarto_punti', '0') > 0) {\n if ( ($goals_1 == $goals_2) && ($tot_1 - $tot_2) > variable_get('fantacalcio_scarto_punti', '0') ) $goals_1++;\n if ( ($goals_1 == $goals_2) && ($tot_2 - $tot_1) > variable_get('fantacalcio_scarto_punti', '0') ) $goals_2++;\n }\n\n $winner_id = ($goals_1 > $goals_2) ? $t1_id : $t2_id;\n $winner_id = ($goals_1 == $goals_2) ? -1 : $winner_id;\n\n //aggiorno partite\n $sql = \"UPDATE {fanta_matches} SET \n pt_1 = '%f', \n pt_2 = '%f', \n tot_1 = '%f', \n tot_2 = '%f', \n goals_1 = '%d', \n goals_2 = '%d', \n played = 1, \n winner_id = '%d' \n WHERE m_id = '%d'\";\n $result = db_query($sql, $tot_voti_1, $tot_voti_2, $tot_1, $tot_2, $goals_1, $goals_2, $winner_id, $match->m_id);\n \n }\n\n $sqlx = \"SELECT * FROM {fanta_rounds_competitions} WHERE round = '%d'\";\n $resultx = db_query($sqlx, $vote_round);\n while ($rowx = db_fetch_array($resultx)) {\n $c_id = $rowx['c_id'];\n $competition_round = $rowx['competition_round'];\n\n $sql = \"SELECT * FROM {fanta_matches} \" .\n \"WHERE g_id IN (SELECT g_id FROM {fanta_groups} WHERE c_id = '%d') \" .\n \"AND round = '%d' \";\n $result = db_query($sql, $c_id, $competition_round);\n $out .= \"<h3>\" . check_plain($competitions[$c_id]->name) . \"</h3>\";\n\n $header = array(\"Squadra\", \"Punti\", \"Totale\", \"Goal\", \"Vincitore\");\n $rows = array();\n\n while ($row = db_fetch_array($result)) {\n $rows[$row['m_id'] . \"_1\"][] = $teams[$row['t1_id']]->name;\n $rows[$row['m_id'] . \"_1\"][] = $row['pt_1'];\n $rows[$row['m_id'] . \"_1\"][] = $row['tot_1'];\n $rows[$row['m_id'] . \"_1\"][] = $row['goals_1'];\n //$rows[$row['m_id'] . \"_1\"][] = $row['mod_att_1'];\n $rows[$row['m_id'] . \"_2\"][] = $teams[$row['t2_id']]->name;//squadra 2\n $rows[$row['m_id'] . \"_2\"][] = $row['pt_2'];\n $rows[$row['m_id'] . \"_2\"][] = $row['tot_2'];\n $rows[$row['m_id'] . \"_2\"][] = $row['goals_2'];\n $rows[$row['m_id'] . \"_2\"][] = ($row['winner_id'] == -1) ? \" - \" : $teams[$row['winner_id']]->name;\n \n $rows[$row['m_id'] . \"_3\"][] = array(\"data\" => \"<hr>\", \"colspan\" => 5);//separatore\n }\n $out .= theme_table($header, $rows);\n\n }\n\n return $out;\n}", "public function qtdTotalChamadosAbertosAgenteProcesso() {\n $tickets = Yii::app()->dbFRAPORT->createCommand()\n ->select(\"COUNT(t.id) as qtd \")\n ->from(\"ticket AS t \")\n ->join(\"ticket_history AS th\", \"t.id = th.ticket_id \")\n ->where(\"t.create_time BETWEEN :dtIni and :dtFim AND history_type_id = 1 AND th.queue_id = 23 AND th.state_id = 4\"\n , array(':dtIni' => FksFormatter::StrToDate($this->dtInicio),\n ':dtFim' => FksFormatter::StrToDate($this->dtTermino),\n ))\n ->queryAll();\n return $tickets[0]['qtd'];\n }", "function contaNumeroCadastros(){\n if ($GLOBALS['cadastros'] == null) {//se não tiver nenhum cadastro\n $GLOBALS['quantidadeCadastros'] = 0;//numero de pessoas cadastradas = 0\n }else{\n $GLOBALS['quantidadeCadastros'] = count($GLOBALS['cadastros']);//salva na variavel global quantidadeCadastros o número de cadastros\n }\n }", "public function carrinho(){\n\n $total = 0;\n $totalProdutos = 0;\n\n\n\n require_once ('cms/models/produto_class.php');\n\n $produtoClass = new produtoClass;\n // VERIFICAR SE EXISTE UMA SESSION\n\n if ($_SESSION) {\n\n if (isset($_SESSION['idUsuario'])) {\n $totalDados = count($_SESSION);\n @$dadosTotais = $totalDados - 2;\n\n // echo $dadosTotais;\n }else {\n $totalDados = count($_SESSION);\n @$dadosTotais = $totalDados - 2;\n\n // echo $dadosTotais;\n }\n\n\n\n //echo $dadosTotais;\n // SEPARA NOME DE QUANTIDADE OU VALORES\n\n echo \"<form class='' action='router.php?controller=produtos&modo=finalizarCompra' method='post'>\";\n foreach ($_SESSION as $nome => $quantidade) {\n\n if ($quantidade > 0) {\n\n if (substr($nome,0,9) == 'produtos_') {\n\n // echo (\"essas e a quantidade \".$quantidade.\"</br>\");\n // PEGA id DA SESSION\n $id = substr($nome,9,(strlen($nome) -9));\n\n\n\n //echo $id.\"</br>\";\n\n\n // MONTA O CARRINHO\n $produtoClass->idProduto = substr($nome,9,(strlen($nome) -9));\n $produtoClass->quantidade = $quantidade;\n $retorno = $produtoClass::selecionarPorId($produtoClass);\n // var_dump($retorno);\n\n $count=0;\n\n // $conta = 100;\n while ($count < count($retorno)) {\n\n //$conta = $conta - 1;\n\n //echo $conta;\n\n // echo \"</br> STRING </br>\";\n $subtotal =$retorno[$count]->quantidade * $retorno[$count]->preco;\n // echo ('nome: '.$retorno[$count]->nome. ' '.$retorno[$count]->quantidade.' x R$ '.number_format($retorno[$count]->preco ,2 ) .' = R$'. number_format($subtotal,2).'</br>');\n //var_dump($retorno);\n\n\n // validacao para Nao adicionar produtos zerados\n if ($retorno[$count]->quantidade <= 1) {\n $class='cursor';\n }else {\n $class='Novocursor';\n }\n\n // validacao de quantidade no estoque\n //echo $retorno[$count]->quantidadeProduto ;\n if ($retorno[$count]->quantidadeProduto <= $retorno[$count]->quantidade) {\n $class2='cursor';\n }else {\n $class2='Novocursor';\n }\n //\n // $counta=1;\n // while ($counta < $totalDados) {\n //\n // echo $counta;\n //\n // $counta+=1;\n // }\n\n\n echo (\n \"\n\n <div class='produtoItemDescricao'>\n <div class='descricaoProdutoPedido'>\n <div class='produtoDetalhes'>\n <div class='imgProdutodetalhe'>\n <img src=cms/\". $retorno[$count]->imagem .\" alt='produto'>\n </div>\n\n <div class='descricaoProdutoItem'>\n <div class='textoDescricaoProduto'>\n <p>\".$retorno[$count]->descricao.\"</p>\n </div>\n\n <div class='textoDescricaoDestribuidor'>\n <p>Produzido e entregue por: <span class='abrirModal'>Auto center</span> </p>\n </div>\n </div>\n\n\n\n\n </div>\n </div>\n\n <div class='descricaoProdutoPedidoPreco'>\n <div class='textoDescricaoPreco'>\n\n <p>R$ <span class='preco'>\".number_format($retorno[$count]->preco ,2 ).\"</span> </p>\n </div>\n </div>\n\n <div class='descricaoProdutoPedidoQuantidade'>\n <div class='textoDescricaoQuantidade'>\n\n <div class='QuantidadeProdutos'>\n <div class='del'>\n\n <a class='\".$class.\"' href='router.php?controller=produtos&modo=addCarrinho&menos=\".$id.\"'>-</a>\n\n </div>\n\n <div class='quantidadeTotal'>\n\n <p>\".$retorno[$count]->quantidade.\"</p>\n\n </div>\n\n <div class='add'>\n <a class='\".$class2.\"' href='router.php?controller=produtos&modo=addCarrinho&idProduto=\".$id.\"'>+</a>\n </div>\n </div>\n\n <a href='router.php?controller=produtos&modo=addCarrinho&del=\".$id.\"'>Remover</a>\n\n\n </div>\n </div>\n\n <div class='descricaoProdutoPedidoSubTotal'>\n <div class='textoDescricaoPreco'>\n <p>R$ <span class='preco'>\".number_format($subtotal,2).\"</span> </p>\n </div>\n </div>\n </div>\n\n <!-- passando dados para cadastrar no banco -->\n\n <input class='esconder' type='text' name='txtIdProduto\".(@$counta = $counta -1 ).\"' value='\".$id.\"'>\n <input class='esconder' type='text' name='txtQuantidade\".(@$counta2 = $counta2 -1 ).\"' value='\".$retorno[$count]->quantidade.\"'>\n\n\n\n \");\n\n //echo $count;\n\n $count+=1;\n\n $total +=$subtotal;\n\n $totalProdutos+=$quantidade;\n }\n\n\n }\n\n\n }\n\n // $count=0;\n // while ($count < count($retorno)) {\n // echo \"</br> STRING </br>\";\n // var_dump($retorno);\n // return $retorno;\n // $count+=1;\n // }\n\n\n // $quantidadeProdutos = count($_SESSION);\n //\n // $produtosQuantidade = $quantidadeProdutos-1;\n //\n // $cont = 0;\n // while ($produtosQuantidade > $cont) {\n // echo (\"produtos \".$cont);\n // $cont+=1;\n // }\n\n\n\n }\n } // aqui fecha o foreach\n\n\n\n\n if ($total == 0) {\n echo \"nao ha produtos\";\n }else{\n echo (\" <div class='TotalProdutos'>\n <div class='espaco'>\n <input class='esconder' type='text' name='txtDados' value='\".$dadosTotais.\"'>\n </div>\n\n <div class='espaco'>\n <div class='Totalgeral'>\n <div class='detalhesValores'>\n <p>Subtotal (\".$totalProdutos.\" itens):</p>\n </div>\n\n <div class='detalhesValores'>\n <p class='precoTotal'>R$ <span class='preco'>\".$total.\"</span> </p>\n </div>\n\n\n </div>\n\n <div class='Totalgeral'>\n <div class='detalhesValores'>\n <p>Frete:</p>\n </div>\n\n <div class='detalhesValores'>\n <div class='calculofrete'>\n <form class='' action='index.html' method='post'>\n <input class='txttCep' type='text' name='' value=''>\n </form>\n </div>\n </div>\n\n </div>\n\n\n <div class='Totalgeral'>\n <div class='detalhesValores'>\n <p>Total a pagar:</p>\n </div>\n\n <div class='detalhesValores'>\n <p class='precoTotal'>R$ <span class='preco'>\".$total.\"</span> </p>\n </div>\n\n\n </div>\n\n <div class='botaoEnviar'>\n <input class='botaoEnviar' type='submit' name='btnSalvarCarrinho' value='Finalizar Compra'>\n </div>\n\n\n\n </div>\n </div>\n\n </form>\");\n }\n\n $_SESSION['totalProdutos'] = $totalProdutos;\n\n\n //echo $_SESSION[$totalProdutos];\n\n }", "function promedios_por_materia($vector){\n echo \"<hr> ############# Promedios por materia #############\";\n $calificacion1=0;\n $calificacion2=0;\n $calificacion3=0;\n $calificacion4=0;\n $calificacion5=0;\n $calificacion6=0;\n foreach ($vector as $key => $value) {\n $calificacion1=$calificacion1+$vector[$key][0];\n $calificacion2=$calificacion2+$vector[$key][1];\n $calificacion3=$calificacion3+$vector[$key][2];\n $calificacion4=$calificacion4+$vector[$key][3];\n $calificacion5=$calificacion5+$vector[$key][4];\n $calificacion6=$calificacion6+$vector[$key][5];\n }\n $prom=$calificacion1/10;\n echo \"<br> Promedio materia 1: \".$prom;\n $prom=$calificacion2/10;\n echo \"<br> Promedio materia 2: \".$prom;\n $prom=$calificacion3/10;\n echo \"<br> Promedio materia 3: \".$prom;\n $prom=$calificacion4/10;\n echo \"<br> Promedio materia 4: \".$prom;\n $prom=$calificacion5/10;\n echo \"<br> Promedio materia 5: \".$prom;\n $prom=$calificacion6/10;\n echo \"<br> Promedio materia 6: \".$prom;\n }", "public static function GetTotalVendas(){\n self::$results = self::query(\"SELECT sum(vlTotal) from tbComanda\");\n if (is_array(self::$results) || is_object(self::$results)){\n foreach(self::$results as $result){\n $result[0] = str_replace('.', ',', $result[0]);\n array_push(self::$resultRetorno, $result);\n return $result[0];\n }\n }\n return 0;\n }", "public function getMaduracionTotal(){\n \n $q = Doctrine_Query::create();\n $q->select('SUM(cantidad_actual) as suma');\n $q->from('Lote');\n $q->where('producto_id = ?', $this->getId());\n $q->andWhere('accion = \"En Maduración\"');\n $cantidad = $q->fetchOne();\n if($cantidad->getSuma() != 0){\n return $cantidad->getSuma();\n }\n else{\n return 0;\n }\n \n }", "abstract public function countTotal();", "function alumnos_mayores_al_promedio_general($promedio,$vector){\n echo \"<hr> ############# Promedios mayores al promedio general #############\";\n $cont=0;\n foreach ($vector as $key => $value) {\n foreach ($value as $c => $n) {\n if($n>$promedio){\n $cont=$cont+1;\n echo \"<br>\".$c.\" -->Promedio: \".$n;\n }\n }\n }\n echo \"<br> Total: \".$cont;\n\n }", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM clientes\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "protected function get_totalPedidos()\n {\n $pedidos = DB::SELECT(\"SELECT COUNT(*) AS t_pedidos \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($pedidos as $pedido)\n {\n $pedid_mes = $pedido->t_pedidos; \n }\n return $pedid_mes;\n }", "function suma_monto_total($requerimientos){\n $i=0; $suma=0;\n foreach ($requerimientos as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $suma=$suma+(float)$datos[7];\n }\n }\n\n $i++;\n }\n\n return $suma;\n }", "public function qtdTotalChamadosAbertosCustomer() {\n $tickets = Yii::app()->dbFRAPORT->createCommand()\n ->select(\"COUNT(t.id) as qtd \")\n ->from(\"ticket AS t \")\n ->join(\"ticket_history AS th\", \"t.id = th.ticket_id \")\n ->where(\"t.create_time BETWEEN :dtIni and :dtFim AND history_type_id = 1 AND th.queue_id = 1 AND (th.state_id = 1 OR th.state_id = 4) \"\n , array(':dtIni' => FksFormatter::StrToDate($this->dtInicio),\n ':dtFim' => FksFormatter::StrToDate($this->dtTermino),\n ))\n ->queryAll();\n return $tickets[0]['qtd'];\n }", "public function calcula13o()\n {\n }", "public function calcula13o()\n {\n }", "function sumarServiciosxTareas($servicio_id)\n\t{\n\t\treturn \"SELECT SUM(tareas.valor) as number\nFROM tareas, servicios, tareas_as_servicios \nWHERE tareas.tarea_id = tareas_as_servicios.tarea_id \nand servicios.servicio_id = tareas_as_servicios.servicio_id \nAND servicios.servicio_id = $servicio_id\";\n\t}", "public function getTotalSubeixoRodovias(){\n\t\t$total = 0;\n\t\t$i=0;\n\t\twhile($i<count($this->result)){\n\t\t\tif($this->result[$i]->idn_digs == 1000)\n\t\t\t\t$total++;\n\t\t\t$i++;\n\t\t}\n\t\treturn $total;\n\t}", "public function totalDia(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor),0) as total, ifnull(sum(c.troco),0) as troco from tbpedido_pagamento c WHERE DAY(c.data_pagamento) = DAY(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_array();\n $totalvendas = $result['total'];\n $totaltroco = $result['troco'];\n\n $total = array(\n 'totalvendas' => '',\n 'totaltroco' => '',\n );\n\n $total['totalvendas'] = $totalvendas;\n $total['totaltroco'] = $totaltroco;\n\n //print_r($total);\n return $total;\n\n }", "function getPorcentajes($IDItemGasto,$Periodo,$Modo){\n\t\n\t/* calculamos lo programado */\n\tswitch($Modo){\n\t\t\n\t\tcase 'MECE':\n\t\t\t$ValorProgramadoMECE = MySQL_ObtenerDato(\"select SUM(ProgramadoMECE) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t$ValorComprometidoMECE = MySQL_ObtenerDato(\"select SUM(MECE) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t$PorcentajeMECE = ((float)($ValorComprometidoMECE/$ValorProgramadoMECE))*100;\n\t\t\treturn $PorcentajeMECE;\n\t\t\tbreak;\n\t\t\n\t\tcase 'IES':\n\t\t\t$ValorProgramadoIES = MySQL_ObtenerDato(\"select SUM(ProgramadoIES) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t$ValoComprometidoIES = MySQL_ObtenerDato(\"select SUM(IES) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t$PorcentajeIES = ((float)($ValoComprometidoIES/$ValorProgramadoIES))*100;\n\t\t\treturn $PorcentajeIES;\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'TOTAL':\n\t\t\t$ValorProgramadoMECE = MySQL_ObtenerDato(\"select SUM(ProgramadoMECE) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t$ValorProgramadoIES = MySQL_ObtenerDato(\"select SUM(ProgramadoIES) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t\t\t\n\t\t\t$TotalProgramado = $ValorProgramadoMECE + $ValorProgramadoIES;\n\t\t\t\n\t\t\t$ValorComprometidoMECE = MySQL_ObtenerDato(\"select SUM(MECE) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t$ValorComprometidoIES = MySQL_ObtenerDato(\"select SUM(IES) from tareas where IDItemGasto='$IDItemGasto' and Periodo='$Periodo'\");\n\t\t\t\t\t\n\t\t\t$TotalComprometido = $ValorComprometidoMECE + $ValorComprometidoIES;\n\t\t\t\t\t\n\t\t\t\t\t/* calculamos el % relacionado para los totales */\n\t\t\t$PorcentajeTotal = ((float)($TotalComprometido/$TotalProgramado))*100;\n\t\t\treturn $PorcentajeTotal;\n\t\t\tbreak;\n\t\t\n\t}\n\t\n\t\n}", "public function getSumas() {\n $aVot = $this->votos;\n $aCoe = $this->coeficientes;\n \n $asis = 0; $vots = 0; $votn = 0; $pres = 0;\n $opc1 = 0; $opc2 = 0; $opc3 = 0; $opc4 = 0;\n $urb1 = 0; $urb2 = 0; $urb3 = 0; $urb4 = 0;\n $fas1 = 0; $fas2 = 0; $fas3 = 0; $fas4 = 0;\n $blo1 = 0; $blo2 = 0; $blo3 = 0; $blo4 = 0;\n \n foreach ($aVot as $apa => $aDat) {\n $asis += ($aDat[0] == 'S') ? 1 : 0;\n $vots += ($aDat[1] == 'S') ? 1 : 0;\n $votn += ($aDat[1] == 'S') ? 0 : 1;\n $pres += ($aDat[2] == 'S') ? 1 : 0;\n \n $opc1 += ($aDat[3] == 'S') ? 1 : 0;\n $opc2 += ($aDat[4] == 'S') ? 1 : 0;\n $opc3 += ($aDat[5] == 'S') ? 1 : 0;\n $opc4 += ($aDat[6] == 'S') ? 1 : 0;\n \n $urb1 += ($aDat[3] == 'S') ? $aCoe[$apa][0] : 0;\n $urb2 += ($aDat[4] == 'S') ? $aCoe[$apa][0] : 0;\n $urb3 += ($aDat[5] == 'S') ? $aCoe[$apa][0] : 0;\n $urb4 += ($aDat[6] == 'S') ? $aCoe[$apa][0] : 0;\n \n $fas1 += ($aDat[3] == 'S') ? $aCoe[$apa][1] : 0;\n $fas2 += ($aDat[4] == 'S') ? $aCoe[$apa][1] : 0;\n $fas3 += ($aDat[5] == 'S') ? $aCoe[$apa][1] : 0;\n $fas4 += ($aDat[6] == 'S') ? $aCoe[$apa][1] : 0;\n \n $blo1 += ($aDat[3] == 'S') ? $aCoe[$apa][2] : 0;\n $blo2 += ($aDat[4] == 'S') ? $aCoe[$apa][2] : 0;\n $blo3 += ($aDat[5] == 'S') ? $aCoe[$apa][2] : 0;\n $blo4 += ($aDat[6] == 'S') ? $aCoe[$apa][2] : 0;\n }\n $aSumas['asis'] = array($asis, $vots, $votn, $pres);\n $aSumas['opci'] = array($opc1, $opc2, $opc3, $opc4);\n $aSumas['urba'] = array($urb1, $urb2, $urb3, $urb4);\n $aSumas['fase'] = array($fas1, $fas2, $fas3, $fas4);\n $aSumas['bloq'] = array($blo1, $blo2, $blo3, $blo4);\n \n return $aSumas;\n }", "public function total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\n }", "public function totalCentral()\n {\n return $this->total_mes_1_central + $this->total_mes_2_central + $this->total_mes_3_central;\n }", "public function vendasMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(count(*),0) as vendames FROM tbpedidos c WHERE MONTH(c.data_finaliza) = MONTH(now()) and c.status = 'F';\";\n $rsvendames = $this->conexao->query($sql);\n $result2 = $rsvendames->fetch_array();\n $totalmes = $result2['vendames'];\n\n return $totalmes;\n }", "function TOTAL_ASIGNACIONES($_ARGS) {\r\n\t$monto = 0;\r\n\t$_PARAMETROS = PARAMETROS();\r\n\t\r\n\t//\tVariables usadas en la formula....\r\n\t$_DIAS_SUELDO_BASICO = $_ARGS['DIAS_PROCESO'];\r\n\t$_SUELDO_BASICO = SUELDO_BASICO_COMPLETO($_ARGS);\r\n\t$_SUELDO_BASICO_DIARIO = $_SUELDO_DIARIO / 30; $_SUELDO_BASICO_DIARIO = REDONDEO($_SUELDO_BASICO_DIARIO, 2);\r\n\t$_SUELDO_NORMAL = 0;\r\n\t$_SUELDO_NORMAL_DIARIO = 0;\r\n\t\r\n\t$sql = \"(SELECT\r\n\t\t\t\t\tpc.CodConcepto,\r\n\t\t\t\t\tpc.Descripcion,\r\n\t\t\t\t\tpc.PlanillaOrden,\r\n\t\t\t\t\tpc.FlagAutomatico,\r\n\t\t\t\t\tpc.Formula,\r\n\t\t\t\t\tpc.Tipo,\r\n\t\t\t\t\tpc.FlagBono,\r\n\t\t\t\t\tpec.Monto,\r\n\t\t\t\t\tpec.Cantidad,\r\n\t\t\t\t\t'1' AS Orden\r\n\t\t\t\tFROM\r\n\t\t\t\t\tpr_empleadoconcepto pec\r\n\t\t\t\t\tINNER JOIN pr_concepto pc ON (pec.CodConcepto = pc.CodConcepto)\r\n\t\t\t\t\tINNER JOIN pr_conceptotiponomina pctn ON (pc.CodConcepto = pctn.CodConcepto AND pctn.CodTipoNom = '\".$_ARGS['NOMINA'].\"' )\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t(pc.Tipo = 'I') AND\t(pec.CodPersona = '\".$_ARGS['TRABAJADOR'].\"') AND\r\n\t\t\t\t\t(pec.Procesos = 'FIN') AND\r\n\t\t\t\t\t((pec.TipoAplicacion = 'T' AND pec.PeriodoHasta >= '\".$_ARGS['PERIODO'].\"' AND pec.PeriodoDesde <= '\".$_ARGS['PERIODO'].\"') OR \r\n\t\t\t\t\t (pec.TipoAplicacion = 'P' AND pec.PeriodoDesde <= '\".$_ARGS['PERIODO'].\"'))\r\n\t\t\t\tGROUP BY CodConcepto)\r\n\t\t\t\t\t \r\n\t\t\tUNION\r\n\t\t\t\r\n\t\t\t(SELECT\r\n\t\t\t\t\tpc.CodConcepto,\r\n\t\t\t\t\tpc.Descripcion,\r\n\t\t\t\t\tpc.PlanillaOrden,\r\n\t\t\t\t\tpc.FlagAutomatico,\r\n\t\t\t\t\tpc.Formula,\r\n\t\t\t\t\tpc.Tipo,\r\n\t\t\t\t\tpc.FlagBono,\r\n\t\t\t\t\t'' AS Monto,\r\n\t\t\t\t\t'' AS Cantidad,\r\n\t\t\t\t\t'1' AS Orden\r\n\t\t\t\tFROM\r\n\t\t\t\t\tpr_concepto pc\r\n\t\t\t\t\tINNER JOIN pr_conceptoproceso pcp ON (pc.CodConcepto = pcp.CodConcepto AND pcp.CodTipoProceso = 'FIN')\r\n\t\t\t\t\tINNER JOIN pr_conceptotiponomina pctn ON (pc.CodConcepto = pctn.CodConcepto AND pctn.CodTipoNom = '\".$_ARGS['NOMINA'].\"' )\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tpc.Tipo = 'I' AND pc.FlagAutomatico = 'S' AND \r\n\t\t\t\t\tpc.CodConcepto NOT IN (\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tpc.CodConcepto\r\n\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\tpr_empleadoconcepto pec\r\n\t\t\t\t\t\t\tINNER JOIN pr_concepto pc ON (pec.CodConcepto = pc.CodConcepto)\r\n\t\t\t\t\t\t\tINNER JOIN pr_conceptotiponomina pctn ON (pc.CodConcepto = pctn.CodConcepto AND pctn.CodTipoNom = '\".$_ARGS['NOMINA'].\"' )\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t(pc.Tipo = 'I') AND\t(pec.CodPersona = '\".$_ARGS['TRABAJADOR'].\"') AND\r\n\t\t\t\t\t\t\t(pec.Procesos = 'FIN') AND\r\n\t\t\t\t\t\t\t((pec.TipoAplicacion = 'T' AND pec.PeriodoHasta >= '\".$_ARGS['PERIODO'].\"' AND pec.PeriodoDesde <= '\".$_ARGS['PERIODO'].\"') OR \r\n\t\t\t\t\t\t\t (pec.TipoAplicacion = 'P' AND pec.PeriodoDesde <= '\".$_ARGS['PERIODO'].\"')))\r\n\t\t\t\tGROUP BY CodConcepto)\r\n\t\t\t\t\t\r\n\t\t\tORDER BY Orden\";\r\n\t$query = mysql_query($sql) or die ($sql.mysql_error());\r\n\twhile ($field = mysql_fetch_array($query)) {\r\n\t\t//\tVariables usadas en la formula....\r\n\t\tif (trim($field['Formula']) == \"\") {\r\n\t\t\t$_ARGS['CONCEPTO'] = $field['CodConcepto'];\r\n\t\t\t$_ARGS['FORMULA'] = \"\";\r\n\t\t\t$_ARGS['MONTO'] = $field['Monto'];\r\n\t\t\t$_ARGS['CANTIDAD'] = $field['Cantidad'];\r\n\t\t} else {\r\n\t\t\t//\tVariables usadas en la formula....\r\n\t\t\t$_ARGS['CONCEPTO'] = $field['CodConcepto'];\r\n\t\t\t$_ARGS['FORMULA'] = $field['Formula'];\r\n\t\t\t\r\n\t\t\t$_MONTO = 0;\r\n\t\t\t$_CANTIDAD = 0;\r\n\t\t\t//\tEjecuto la formula del concepto...\r\n\t\t\teval($_ARGS['FORMULA']);\r\n\t\t\t$_ARGS['MONTO'] = REDONDEO($_MONTO, 2);\r\n\t\t\t$_ARGS['CANTIDAD'] = REDONDEO($_CANTIDAD, 2);\r\n\t\t}\r\n\t\t\r\n\t\t$suma += $_ARGS['MONTO'];\t//echo \"$_ARGS[CONCEPTO] = $_ARGS[MONTO];\\n\";\r\n\t}\r\n\treturn $suma;\r\n}", "public function getTotalAmount();", "public function productosCarrito()\n {\n $total = 0;\n $tabla = \"\";\n $numeroArticulos=0;\n if (isset($_SESSION[\"carritoJDV\"])) {\n $numCarrito=(count($_SESSION[\"carritoJDV\"]));\n for ($i=0; $i<$numCarrito; $i++) {\n \t\t\t$numPiezas=$_SESSION[\"carritoJDV\"][$i][1];\n $numeroArticulos+=$numPiezas;\n }\n $tabla = '<h1 class=\"subTitulos\">Carrito de compras</h1>\n <p class=\"text-muted\">Actualmente tienes '.$numeroArticulos.' artículo(s) en tu carrito.</p>\n <div class=\"table-responsive\">\n <table class=\"table\">\n <thead>\n <tr>\n <th colspan=\"2\">Producto</th>\n <th>Cantidad</th>\n <th>Precio unitario</th>\n <th>Descuento</th>\n <th colspan=\"2\">Total</th>\n </tr>\n </thead>\n <tbody>';\n\n foreach ($_SESSION[\"carritoJDV\"] as $contenido) {\n $prod = $this->BD->ConsultaWhereSimple(\"producto\", \"activo=? AND ID=?\", array(1,$contenido[0]));\n $tabla .= '<tr>\n <td>\n <a href=\"detail.php?id=' . $prod[0][\"ID\"] . '\">\n <img src=\"' . $prod[0][\"img1_prod\"] . '\" alt=\"' . $prod[0][\"nombre_prod\"] . '\">\n </a>\n </td>\n\n <td>\n <a href=\"detail.php?id=' . $prod[0][\"ID\"] . '\">' . $prod[0][\"nombre_prod\"] . ' (' . $contenido[2] . ')</a>\n </td>\n \n <td><form method=\"POST\" action=\"procesos.php\" onchange=\"this.submit();\">\n <input type=\"hidden\" name=\"talla_prod_add\" value=\"' . $contenido[2] . '\">\n <input type=\"hidden\" name=\"id_prod_cart_add\" value=\"' . $prod[0][\"ID\"] . '\">\n <input type=\"number\" name=\"cantidad_prod_add\" value=\"' . $contenido[1] . '\" class=\"quanitySniper\">\n \n </form>\n \n </td>\n \n <td>$' . $prod[0][\"precio_prod\"] . '</td>\n ' . ($prod[0][\"preciodesc_prod\"] > 0 ? \"<td>$\" . ($prod[0][\"precio_prod\"] - $prod[0][\"preciodesc_prod\"]) . \"</td>\" : \"<td>$0</td>\") . ($prod[0][\"preciodesc_prod\"] > 0 ? \"<td>$\" . $prod[0][\"preciodesc_prod\"] * $contenido[1] . \"</td>\" : \"<td>$\" . $prod[0][\"precio_prod\"] * $contenido[1] . \"</td>\") . '\n \n <td><a href=\"procesos.php?deleteprod=' . $prod[0][\"ID\"] . '&talla=' . $contenido[2] . '\"><i class=\"far fa-trash-alt\"></i></a>\n </td>\n </tr>';\n //Problema complejo\n $x=$contenido[1];\n ($prod[0][\"preciodesc_prod\"] > 0 ? ($total = $total + $prod[0][\"preciodesc_prod\"] * $contenido[1]) : ($total = $total + $prod[0][\"precio_prod\"] * $contenido[1]));\n \n }\n \n /**\n * Aqui ya muestra el no. de articulos del carrito\n *var_dump(count($_SESSION[\"carritoJDV\"])); \n *Cuando se inicia sesion, si solo se pone el correo y se da enter, entra a procesos pero ya no avanza\n */\n \n\n $tabla .= '</tbody>\n <tfoot>\n <tr>\n <th colspan=\"5\">Total</th>\n <th colspan=\"2\">$' . $total . '</th>\n </tr>\n </tfoot>\n </table>\n\n </div>\n <!-- /.table-responsive -->\n\n <div class=\"box-footer\">\n <div class=\"pull-right\"><form method=\"post\" action=\"procesos.php\"><input type=\"hidden\" name=\"compra\" value=\"1\">\n <a href=\"basket.php\" class=\"btn btn-default\"><i class=\"fas fa-sync-alt\"></i> Actualizar cesta</a>\n \n <button type=\"submit\" class=\"btn btn-primary\">Proceder a la compra <i class=\"fa fa-chevron-right\"></i>\n </button>\n </form>\n </div>\n </div>';\n } else {\n return \"Aun no cuentas con productos en tu carrito de compras.\";\n }\n return $tabla;\n }", "public function getTotalCustomers()\n {\n $AdminDashboardModel = $this->model('AdminDashboardModel');\n $this->totalCustomers = $AdminDashboardModel->getTotalCustomers();\n }", "function SumaTotal($CardCode){\n\t\t\n\t\t $Total_Pedido = 0;\n\t\t \n\t\tif($this->con->conectar()==true){\n\t\t\t$Resultado = mysql_query(\"SELECT `Total` FROM `Carrito` WHERE `CardCode` = '\" .$CardCode. \"'\");\n\t\t\tif($Resultado){\n\t\t\t while( $Articulos = mysql_fetch_array($Resultado) ) {\n\t\t \t $Total_Pedido = $Total_Pedido + (int) $Articulos['Total'] ;\n\t\t }}\n\t\t\techo number_format($Total_Pedido, 2) ;\n\t\t}\n\t}", "public function getTotal(): int;", "function total_pagado($ven_id) {\n// sum(ind_capital_desc) as descuento, sum(ind_capital_inc) as incremento ,\n// sum(ind_costo_pagado) as costo\n// from interno_deuda where ind_tabla='venta' and ind_tabla_id=$ven_id \n// \";\n// $pagado = FUNCIONES::objeto_bd_sql($sql_pag);\n $pagado = FUNCIONES::total_pagado($ven_id);\n return $pagado;\n }", "public function NumAdeudos(){\n\t\t$UsCg = new HomeController();\n\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t$UsCfechaactual = date('Y-m-d');\n\t\t$UsCseccion = DB::table(\"colegiatura\")->where(\"Alumno_idAlumno\",Session::get(\"usuario\"));\n\t\t$UsCcolegiaturas = $UsCseccion->orderBy('periodo_idperiodo', 'asc')->get();\n\t\t$UsCconcole = $UsCseccion->count();\n\t\t$UsCusuario = DB::table(\"alumno\")->where(\"idAlumno\",Session::get(\"usuario\"))->first();\n\t\t$UsCadeudo = ($UsCg->restaFechas($UsCusuario->fecha, $UsCfechaactual))-$UsCconcole;\n\t\tif ($UsCadeudo < 0) {$UsCadeudo = 0;}\n\t\treturn \"- Adeudos: \".$UsCadeudo;\n\t}", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "function sumarServiciosxTareas3($servicio_id)\n\t{\n\t\treturn \"SELECT SUM(tareas.valor) as number3\nFROM tareas, servicios, tareas_as_servicios \nWHERE tareas.tarea_id = tareas_as_servicios.tarea_id \nand servicios.servicio_id = tareas_as_servicios.servicio_id \nAND servicios.servicio_id = $servicio_id\";\n\t}", "function totalvacantes_reclutador($idReclutador){\r\n $funciones = new funciones;\r\n $funciones->conectar();\r\n $sql=\"select \r\n tblmeses.descmes,ifnull(total,0) as total\r\n from\r\n tblmeses\r\n left join\r\n (select \r\n count(tblvacante.folSolici) as total,\r\n idmes,\r\n descmes,\r\n idReclutador\r\n from\r\n tblmeses\r\n left join tblsolicitud ON month(tblsolicitud.iniSolici) = tblmeses.idmes\r\n left join tblvacante ON tblvacante.folSolici = tblsolicitud.folSolici\r\n where\r\n idReclutador =\".$idReclutador.\"\r\n group by idmes , idReclutador) as t1 ON t1.idmes = tblmeses.idmes\r\n group by tblmeses.idmes\r\n \";\r\n $result = mysql_query($sql) or die(mysql_error());\r\n $datos = array();\r\n while($fila = mysql_fetch_array($result)){\r\n $datos[]=$fila;\r\n }\r\n return $datos;\r\n \r\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "static public function mdlSumaTotalIngresos($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(total) as total FROM $tabla WHERE banco = 'MercadoPago'\" );\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function total_reservas_sala_mes($fecha) // reservas sin eliminar // //PDF\n {\n\n $q_string = \"select sala, count(sala) as cant from reservas where month(fecha) = month('\".$fecha.\"') and eliminada ='0' and estado ='1' group by sala\";\n //select sala, count(sala) as cant\n //from reservas where month(fecha) ='6' and eliminada ='0' and estado ='1'\n //group by sala\n\t \t $data = $this->db->query($q_string);\n\t\t return $data;\n\t}", "function calcular_cotizacion(){\t\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Calcular\"){\n\t\t\t$this->asignar_valores();\n\t\t\t//$sql=\"INSERT INTO color VALUES ('', '$this->nombre', '$this->codigo')\";\n\t\t\t//$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$costante=array (24 => 0.0528711,36 => 0.0392329,48 => 0.0326018,60 => 0.0287680);\n\t\t\t\n\t\t\tif($this->tipo==\"Usado\"){ $porcentaje=0.4; $this->indicador=40;}\n\t\t\tif($this->tipo==\"Nuevo\"){ $porcentaje=0.3; $this->indicador=30;}\n\t\t\t\t$media=$this->valor_vehiculo*$porcentaje;\n\t\t\tif($this->valor_inicial>=$media){\n\t\t\t\t$this->saldo=$this->valor_vehiculo-$this->valor_inicial;\n\t\t\t\t$this->comision=$this->saldo*0.03;\n\t\t\t\t$this->cuotas=$this->saldo*$costante[$this->plazo];\n\t\t\t\t$this->total=$this->valor_inicial+$this->comision;\n\t\t\t\t$this->mensaje=1;\n\t\t\t}else{\n\t\t\t\t$this->mensaje=2;\n\t\t\t}\n\t\t}\t\t\t\n\t}", "function contabilizar($notas) {\r\n\t$total = 0;\r\n\t\r\n\tforeach ($notas as $valor => $quantidade) {\r\n\t\t$total += ($valor * $quantidade);\r\n\t}\r\n\r\n\treturn $total;\r\n}", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function GetSaldoTotalClientes()\n {\n \t$q\t=\tDoctrine_Query::create()\n \t->from('Cliente c');\n \t\n \t$cli\t=\t$q->execute();\n \t$total = 0;\n \tforeach ($cli as $c)\n \t{\n \t\t\t$saldoActual\t=\t$c->GetSaldo();\n \t\t\t$c->SaldoActual\t=\t$saldoActual;\n \t\t\t$c->save();\n\t\t\t\t\t// sumar saldo total de cada cliente\n \t\t\t$total\t+= $saldoActual;\n \t}\n \t\n \treturn $total;\n }", "function tongtienmuasam(){\n date_default_timezone_set('Asia/Ho_Chi_Minh');\n $db = mysqli_connect(HOST,USRNM,PSWD,DBNM) or die(\"Không thể kết nối database\");\n // TỔNG TIỀN START \n $check = mysqli_query($db,\"SELECT SUM(giatien) as total FROM cp_reports_shoping\");\n $row = mysqli_fetch_assoc($check);\n echo \"Tổng tiền sửa chữa: \".number_format($row['total']).\" VNĐ\";\n // END\n\n // Sóng Nam START\n $check1 = mysqli_query($db,\"SELECT SUM(giatien) as total1 FROM cp_reports_shoping WHERE nhacungcap='11'\");\n $row1 = mysqli_fetch_assoc($check1);\n echo \"<br><small style='text-decoration: overline;'> Sóng Nam: \".number_format($row1['total1']).\" VNĐ </small>\";\n // END\n\n // Ánh Phương START\n $check2 = mysqli_query($db,\"SELECT SUM(giatien) as total2 FROM cp_reports_shoping WHERE nhacungcap='22'\"); \n $row2 = mysqli_fetch_assoc($check2); \n echo \"|| <small style='text-decoration: overline;'> Ánh Phương: \".number_format($row2['total2']).\" VNĐ </small>\"; \n // END\n\n // Lan Anh START\n $check3 = mysqli_query($db,\"SELECT SUM(giatien) as total3 FROM cp_reports_shoping WHERE nhacungcap='33'\"); \n $row3 = mysqli_fetch_assoc($check3); \n echo \"|| <small style='text-decoration: overline;'> Lan Anh: \".number_format($row3['total3']).\" VNĐ </small>\"; \n // END \n\n // Hoàng Tuấn START\n $check4 = mysqli_query($db,\"SELECT SUM(giatien) as total4 FROM cp_reports_shoping WHERE nhacungcap='44'\"); \n $row4 = mysqli_fetch_assoc($check4);\n echo \"|| <small style='text-decoration: overline;'> Hoàng Tuấn: \".number_format($row4['total4']).\" VNĐ </small>\";\n // END\n\n // Cửa hàng chuyên hàng xách tay Đình Cư START\n $check6 = mysqli_query($db,\"SELECT SUM(giatien) as total6 FROM cp_reports_shoping WHERE nhacungcap='55'\"); \n $row6 = mysqli_fetch_assoc($check6);\n echo \"|| <small style='text-decoration: overline;'> Cửa hàng chuyên hàng xách tay Đình Cư: \".number_format($row6['total6']).\" VNĐ </small>\";\n // END \n\n // Mua bán điện thoại xách tay Thanh Hải START\n $check7 = mysqli_query($db,\"SELECT SUM(giatien) as total7 FROM cp_reports_shoping WHERE nhacungcap='66'\"); \n $row7 = mysqli_fetch_assoc($check7);\n echo \"|| <small style='text-decoration: overline;'> Mua bán điện thoại xách tay Thanh Hải: \".number_format($row7['total7']).\" VNĐ </small>\";\n // END \n \n // Mua bán điện thoại xách tay Thanh Hải START\n $check8 = mysqli_query($db,\"SELECT SUM(giatien) as total8 FROM cp_reports_shoping WHERE nhacungcap='77'\"); \n $row8 = mysqli_fetch_assoc($check7);\n echo \"|| <small style='text-decoration: overline;'> OnePlus Viet.net: \".number_format($row8['total8']).\" VNĐ </small>\";\n // END \n\n // Khác START\n $check5 = mysqli_query($db,\"SELECT SUM(giatien) as total5 FROM cp_reports_shoping WHERE nhacungcap=''\"); \n $row5 = mysqli_fetch_assoc($check5);\n echo \"|| <small style='text-decoration: overline;'> Khác: \".number_format($row5['total5']).\" VNĐ </small>\";\n // END \n}", "function getTotalMeGustas($id) {\n $c = new Conexion();\n $resultado = $c->query(\"SELECT SUM(megusta) FROM valoracion_mg where id_contenido=$id && megusta=1\");\n\n if ($objeto = $resultado->fetch(PDO::FETCH_OBJ)) {\n return $objeto;\n }\n else{\n return 0;\n } \n}", "public function totalCategoria()\n {\n return $this->totalCentral() + $this->totalSeccional();\n }", "function getConcentrado()\n{\n\t$concentrado = null;\n\t// Para Usuarios\n\t$db = getDBConnection(); // Obtenemos la conexion\n \t$stmt = $db->prepare('SELECT COUNT(*) FROM usuarios'); // Preparamos la consulta para usuarios\n \t$stmt->execute(); // Realizamos el query a la BD\n \t$r = $stmt->fetch(PDO::FETCH_ASSOC); // Obtenemos el resultado en un array asociativo.\n \tif ($r) {\n \t\t$concentrado['USERS'] = $r['COUNT(*)']; // guardamos el total\n \t}\n\n \t// Para\n \t$db = getDBConnection(); // Obtenemos la conexion\n \t$stmt = $db->prepare('SELECT COUNT(*) FROM productos'); // Preparamos la consulta para productos\n \t$stmt->execute(); // Realizamos el query a la BD\n \t$r = $stmt->fetch(PDO::FETCH_ASSOC); // Obtenemos el resultado en un array asociativo.\n \tif ($r) {\n \t\t$concentrado['PRODUCTS'] = $r['COUNT(*)']; // guardamos el total\n \t}\n\n \t// Para Ventas\n \t$db = getDBConnection(); // Obtenemos la conexion\n \t$stmt = $db->prepare('SELECT COUNT(*) FROM ventas'); // Preparamos la consulta para ventas\n \t$stmt->execute(); // Realizamos el query a la BD\n \t$r = $stmt->fetch(PDO::FETCH_ASSOC); // Obtenemos el resultado en un array asociativo.\n \tif ($r) {\n \t\t$concentrado['SALES'] = $r['COUNT(*)']; // guardamos el total\n \t}\n\treturn $concentrado;\n}", "public function getTotal()\n {\n $db = self::getInstance();\n $db = $db->prepare(\"SELECT count(*) as count FROM paciente\");\n $db->execute();\n return $db->fetch(\\PDO::FETCH_ASSOC);\n }", "public function getTotalOrdersMo()\n\t{\n\t\t$query = $this->db->query(\"SELECT COUNT(oc_po_product.id) as total_orders FROM oc_po_order \nLEFT JOIN oc_po_product \nON(oc_po_order.id = oc_po_product.order_id)\nWHERE oc_po_order.user_id='103' AND oc_po_product.item_status <> 0\");\n\t\t$results = $query->row;\n\t\treturn $results['total_orders'];\n\t}" ]
[ "0.7237129", "0.6844079", "0.68162495", "0.6810038", "0.6810038", "0.6733043", "0.669547", "0.66930187", "0.6660051", "0.6660051", "0.6660051", "0.665203", "0.66315037", "0.6586916", "0.6582672", "0.65818095", "0.6549749", "0.65386623", "0.6528182", "0.6524126", "0.65187305", "0.64795744", "0.64782697", "0.64597607", "0.64530987", "0.644885", "0.6428578", "0.6424599", "0.64216495", "0.64006793", "0.63849485", "0.633639", "0.6334226", "0.63180125", "0.6316421", "0.63149333", "0.6291265", "0.62897635", "0.6276102", "0.6273499", "0.626725", "0.626148", "0.62517554", "0.6239972", "0.6220434", "0.6213792", "0.6210563", "0.62069327", "0.619685", "0.6194856", "0.6192305", "0.61921954", "0.61827224", "0.61728406", "0.6167546", "0.6151222", "0.6146113", "0.6136764", "0.61340564", "0.6127273", "0.61015564", "0.6086581", "0.6085201", "0.60838133", "0.6069662", "0.6050003", "0.6050003", "0.60472363", "0.60462725", "0.60447913", "0.6042951", "0.6023011", "0.6022831", "0.6009665", "0.6004932", "0.59976935", "0.59965396", "0.59929484", "0.59831256", "0.59685856", "0.5966222", "0.59580564", "0.59562504", "0.5955523", "0.59545267", "0.59443897", "0.59339154", "0.5927346", "0.5925736", "0.5919961", "0.59175885", "0.5916636", "0.5913222", "0.5911341", "0.59109426", "0.5905268", "0.5902488", "0.5902487", "0.5900958", "0.5900324" ]
0.6254805
42
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index(Request $request) { //return view('selector'); $id= Auth::user()->id; //$proyectos = DB::table('proyectos')->get(); $proyectos = DB::table('proyectos')->where('id_project_manager',$id)->get(); $user = Auth::user(); if(empty($GLOBALS['user_type'])) return view('tipoUsuario'); else{ //echo "<script>console.log('exxiste la cookie: $GLOBALS[user_type]'); </script>"; if($GLOBALS['user_type']=="ProjectManager") return view('listaProyectos', ['proyectos' => $proyectos, 'tipo' => $GLOBALS['user_type'] ] ); if($GLOBALS['user_type']=="Desarrollador") echo "developer"; if($GLOBALS['user_type']=="Cliente") echo "customer"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
get the id of a board
public function getId() { return $this->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBoardId()\n {\n return $this->getCurrentBoard()->getId();\n }", "public function getBoardId()\n {\n return Mage::getStoreConfig('trello_api/order_status/board_id');\n }", "public function getBoardById($id);", "public function get_id();", "public function get_id();", "public function getId() {\r\n\t\t\treturn $this->columns[ $this->index ];\r\n\t\t}", "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}", "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}", "function getBoard ($currentUser) {\n //get the board's primary key\n $board_num = selectDB(\"SELECT Board FROM USER WHERE User_ID='$currentUser'\");\n return $board_num['Board'];\n}", "public function getBoard()\n {\n return $this->board;\n }", "public function getBoard()\n {\n return $this->board;\n }", "public function getBoard()\n {\n return $this->board;\n }", "public function getBoard()\n {\n return $this->board;\n }", "public function getID();", "public function getID();", "public function getID();", "public function getBoard() {\n\t\treturn $this->board;\n\t}", "public function getBoard() {\n\t\treturn $this->board;\n\t}", "public function id() {\n return $this->Session->read('Authorization.Team.0.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}", "public function CreateBoard() {\n\t\t\n\t\t$data = array(\n\t\t 'Board' => $this->getBoard(),\n\t\t 'Description' => $this->getDescription(),\n\t\t 'type' => $this->getType(),\n\t\t 'Category' => $this->getCategory(),\n\t\t 'Smiles' => $this->getSmiles(),\n\t\t 'BBcode' => $this->getBbCode(),\n\t\t 'Post_Increment' => $this->getPostIncrement(),\n\t\t 'Image' => $this->getImage(),\n\t\t 'B_Order' => $this->getMaxBOrder($this->getCategory())\n\t\t);\n\n\t\t#add new topic.\n\t\t$this->db->insert('ebb_boards', $data);\n\t\t\n\t\t//get board id\n\t\treturn $this->db->insert_id();\n\t}", "abstract public function get_id();", "public function fetch_the_id() {}", "public function id()\n\t{\n\t\treturn $this->SqueezePlyrID ;\n\t}", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public function getId() {\r\n\r\n return $this->getGameManager()->getGameId($this);\r\n\r\n }", "private function getBoardDiff()\n {\n return $this->board;\n }", "function getId();", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "function get_id() {\n\t\treturn $this->id;\n\t}", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function getId() ;", "public static function getHolderID();", "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 get_id () {\r\n\t\treturn $this->id;\r\n\t}", "public function getConnectorId();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function getAssignedBoards() {\n\t\t$boardIDs = array();\n\t\t$sql = \"SELECT\tboardID\n\t\t\tFROM\twbb\".WBB_N.\"_thread_announcement\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$boardIDs[] = $row['boardID'];\n\t\t}\n\t\t\n\t\treturn $boardIDs;\n\t}", "public function determineId() {}", "public static function id()\n {\n return self::$id;\n }", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "function getID();", "function getId() {\n\t$this->load();\n\treturn $this->mId;\n }", "public function getId(){\n\t\t$className = get_class($this);\n\t\tif(isset(self::$_id[$className])){\n\t\t\treturn self::$_id[$className];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function getId()\n {\n return $this->currentId;\n }", "public function getId(): int\n {\n return (int)substr($this->token, 0, strpos($this->token, ':'));\n }", "public function get_id(){\n\t\treturn $this->id;\n\t}", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.83424115", "0.7072076", "0.6920309", "0.6317146", "0.6317146", "0.62977004", "0.620267", "0.61983883", "0.6194182", "0.6144536", "0.6144536", "0.6144536", "0.6144536", "0.61020434", "0.61020434", "0.61020434", "0.60957134", "0.60957134", "0.60764104", "0.6040431", "0.60205215", "0.5993582", "0.597012", "0.5948296", "0.59395546", "0.59360564", "0.59360564", "0.59360564", "0.5911755", "0.5880589", "0.5861381", "0.5859762", "0.5856548", "0.5853293", "0.58343536", "0.58321613", "0.5827588", "0.5819638", "0.5812921", "0.5804769", "0.5804769", "0.5804769", "0.5804769", "0.5804769", "0.5804769", "0.5804769", "0.5804769", "0.5804769", "0.58010554", "0.5799785", "0.5796928", "0.57951164", "0.57881904", "0.57761097", "0.5769662", "0.57670414", "0.57670414", "0.57670414", "0.57670414", "0.5763207", "0.57548684", "0.5753327", "0.5744385", "0.5744385", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689", "0.5741689" ]
0.0
-1
Create a new authentication controller instance.
public function __construct() { $this->middleware('guest', ['except' => 'logout']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "public function newInstance()\n {\n return new Auth($this->segment);\n }", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "public function getAuthentication()\n {\n return Controllers\\AuthenticationController::getInstance();\n }", "public static function factory($config = array())\n\t{\n\t\treturn new Auth($config);\n\t}", "public function indexController()\n\t{\n\t\t$auth = new Authentification();\n\t}", "public function getAuthenticationV1()\n {\n return Controllers\\AuthenticationV1Controller::getInstance();\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public static function factory($config = array())\n\t{\n\t\treturn new Simple_Auth($config);\n\t}", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "private static function create(): Authentication\n {\n // Get the request to check the authorization token.\n $request = Request::createFromGlobals();\n\n // Default value if no token was sent.\n $accessToken = null;\n\n if ($request->headers->has('Authorization')) {\n $bearerToken = $request->headers->get('Authorization');\n\n // Search if the token is a Bearer.\n if (\\strpos($bearerToken, 'Bearer ') !== 0) {\n throw new \\UnexpectedValueException('The authorization is not a Bearer token.');\n }\n\n // Remove the Bearer from the token.\n $jwt = \\substr($bearerToken, 7);\n\n // Get the AccessToken.\n $accessToken = AccessTokenServiceFactory::get()->getAccessToken($jwt);\n\n // Throw exception if the token is revoked.\n if ($accessToken->revoked()) {\n throw new TokenRevokedException();\n }\n }\n\n return new AuthManager($accessToken);\n }", "public function authentication()\n {\n $auth = app()->make(Authentication::class);\n $auth->setConfig(config($this->prefixConfiguration));\n $auth->auth();\n }", "public function createController( ezcMvcRequest $request );", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\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}", "public static function make()\n\t{\n\t\treturn IoC::container()->resolve('laravel.auth');\n\t}", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function __construct()\n {\n // Setting the auth middleware for this controller\n $this->middleware('auth');\n }", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function getAuthenticationV1beta1()\n {\n return Controllers\\AuthenticationV1beta1Controller::getInstance();\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function __construct()\n {\n // $this->middleware('auth');\n\n //if trying to access this controller without being authenticated, it will ask him for authentication\n // $this->middleware ('auth');\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createAuthenticatedClient()\n {\n $client = static::createClient();\n\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => 'myphone',\n '_password' => 'phono'\n )\n );\n\n $data = json_decode($client->getResponse()->getContent(), true);\n\n $client = static::createClient();\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n return $client;\n }", "public function __construct()\n {\n\n Log::info('Auth controller constructed executed: ');\n Log::info('Auth controller executed');\n $this->middleware('guest',['only'=>['getLogin','getRegister']]);\n $this->middleware('auth',['only'=>['create','notification']]);\n}", "public function create()\n {\n if($result = check_auth_to('QXXX_ADD')) return $result;\n $site = Config::get('site');\n $data['auth_type'] = $site['auth_type'];\n return view('admin.auth.create', $data);\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "public function __construct()\n\t{\n //attach auth middleware to ensure login before accessing this controller\n\t\t$this->middleware('auth');\n\t}", "public function __construct(){\n\t\t$this->middleware('auth', ['only'=>['create']])\n\t}", "public function __contruct()\n {\n $this->middleware('auth');\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "public function getAccessController() {\n\t\tif (!$this->accessController) {\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Authentication Provider\n\t\t\t$accessControllerClass = 'Tx_' . $extension . '_Rest_AccessController';\n\t\t\tif (!class_exists($accessControllerClass)) {\n\t\t\t\t$accessControllerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\AccessController';\n\t\t\t}\n\n\t\t\t// Use the configuration based Authentication Provider\n\t\t\tif (!class_exists($accessControllerClass)) {\n\t\t\t\t$accessControllerClass = 'Cundd\\\\Rest\\\\Access\\\\ConfigurationBasedAccessController';\n\t\t\t}\n\t\t\t$this->accessController = $this->get($accessControllerClass);\n\t\t\t$this->accessController->setRequest($this->dispatcher->getRequest());\n\t\t}\n\t\treturn $this->accessController;\n\t}", "public static function getInstance() {\n if (self::$instance == NULL) {\n self::$instance = new LoginController();\n }\n return self::$instance;\n }", "public static function createAuthenticationCompany(){\n\t\t$continent_id = ModelTestHelper::createContinent();\n\t\t$currency_id = ModelTestHelper::createCurrency();\n\t\t$country_id = ModelTestHelper::createCountry($continent_id, $currency_id);\n\t\t$company_id = ModelTestHelper::createCompany($country_id, $currency_id, \"AUTH\");\n\t\t$company = Company::find($company_id);\n\t\treturn $company;\n\t}", "public function create()\n {\n //\n\t\tif (Auth::check()) {\n\t\t\treturn view('clasificadors.create');\t\t\n\t\t}\n\t\telse {\n\t\t\treturn view('auth/login');\n\t\t}\n }", "public function __construct()\n {\n // We could add middleware specific for this controller like so:\n // $this->middleware('auth');\n }", "function auth(): Auth\n{\n return (new Auth);\n}", "public function connect()\n {\n // create the oauth2 server object\n $this->setup();\n\n // creates a new controller based on the default route\n $routing = $app['controllers_factory'];\n\n /* Set corresponding endpoints on the controller classes */\n Controllers\\Authorize::addRoutes($routing);\n Controllers\\Token::addRoutes($routing);\n Controllers\\Resource::addRoutes($routing);\n\n return $routing;\n }", "public static function instance($config = array())\n\t{\n\t\tstatic $instance;\n\n\t\t// Load the Auth instance\n\t\tempty($instance) and $instance = new Auth($config);\n\n\t\treturn $instance;\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function __construct()\n {\n // auth here\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "public function __construct()\n {\n $this->middleware('auth');\n //$this->middleware('auth', ['only' => 'create']);\n }", "protected function initializeController() {}", "public function __construct()\n {\n $this->middleware(Authenticate::class);\n }", "public static function factory($config = array())\n\t{\n\t\treturn new MangoRauth($config);\n\t}", "public function __construct()\n {\n $this->middleware('auth'); // Required the user to be authenticated to access this controller\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "public function getAuthorization()\n {\n return Controllers\\AuthorizationController::getInstance();\n }", "public static function Auth()\n\t{\n\t\treturn self::$auth = new Auth();\n\t}", "public function __construct()\n\t{\n\t\treturn $this->middleware('auth');\n\t}", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public static function instance($config = array())\n\t{\n\t\tstatic $instance;\n\n\t\t// Load the Auth instance\n\t\tempty($instance) and $instance = new Simple_Auth($config);\n\n\t\treturn $instance;\n\t}", "public function __construct(){\n\t\t\t$this->authentication();\n\t\t}", "public function createAction()\n\t{\n\t\t$auth = new AuthenticationService();\n\t\tif($auth->hasIdentity()) {\n\t\t\t# if user has session take them some else\n\t\t\treturn $this->redirect()->toRoute('home');\n\t\t}\n\n\t $createForm = new CreateForm($this->adapter);\n\t $request = $this->getRequest();\n\n\t if($request->isPost()) {\n\t \t$formData = $request->getPost()->toArray();\n\t \t$createForm->setInputFilter($this->usersTable->getCreateFormFilter());\n\t \t$createForm->setData($formData);\n\n\t \tif($createForm->isValid()) {\n\t \t\ttry {\n\t \t\t\t$data = $createForm->getData();\n\t \t\t\t$this->usersTable->saveAccount($data); \n\n\t \t\t\t$this->flashMessenger()->addSuccessMessage('Compte créé avec succès. Vous pouvez maintenant vous connecter');\n\n\t \t\t\treturn $this->redirect()->toRoute('login');\n\t \t\t} catch(RuntimeException $exception) {\n\t \t\t\t$this->flashMessenger()->addErrorMessage($exception->getMessage());\n\t \t\t\treturn $this->redirect()->refresh(); # refresh this page to view errors\n\t \t\t}\n\t \t}\n\t }\n\t\t$this->layout()->setTemplate('login/index-layout');\n\t\treturn (new ViewModel(['form' => $createForm]))->setTemplate('auth/create');\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function __construct()\n {\n $this->repository = app(AuthRepository::class);\n }", "public static function getInstance($autho, $options = array())\r\n\t{\r\n\t\t$hash = md5($controller . serialize($options));\r\n\r\n\t\tif (isset(self::$instances[$hash]))\r\n\t\t{\r\n\t\t\treturn self::$instances[$hash];\r\n\t\t}\r\n\r\n\t\t$classname = ucfirst($controller). 'TController';\r\n\r\n\t\tif (!class_exists($classname))\r\n\t\t{\r\n\t\t\t$path = TPATH_MODULE .DS.ucfirst($options['module']).DS. 'Controllers' .DS. $controller.'.php';\r\n\t\t\t\r\n\t\t\tif (is_file($path))\r\n\t\t\t{\r\n\t\t\t\tinclude_once $path;\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\r\n\t\tself::$instances[$hash] = new $classname($options);\r\n self::$instances[$hash]->name = $controller;\r\n self::$instances[$hash]->modulename = $options['module'];\r\n $bgclassname = ucfirst($controller). 'TBlogic';\r\n if (!class_exists($bgclassname))\r\n\t\t{\r\n $path = TPATH_MODULE .DS.ucfirst($options['module']).DS. 'BLogics' .DS. $controller.'.php';\r\n if (is_file($path))\r\n\t\t\tinclude_once $path;\r\n }\r\n self::$instances[$hash]->blogic = class_exists($bgclassname)?new $bgclassname():null;\r\n\t\tself::$instances[$hash]->registerAction($options['action']);\r\n \r\n\t\t\r\n\t\treturn self::$instances[$hash];\r\n\t}", "public function __construct()\n {\n //para entrar neste Controller o usuario deve estar autenticado e ser um administrador.\n $this->middleware('auth');\n $this->middleware('auth.admin');\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "public function __construct() {\n\t\t$this->middleware ( 'auth' );\n\t}", "public function __construct()\n {\n // This controller is for authenticated users\n $this->middleware('auth');\n }", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function getAuthorizationV1()\n {\n return Controllers\\AuthorizationV1Controller::getInstance();\n }", "public function create(): View\n {\n return view('backend::auth.login');\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "public\n\n\tfunction __construct() {\n\t\t$this->middleware( 'auth' );\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n\n $this->CalendarController = new CalendarController();\n\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public function __construct()\n {\n $this->args = $this->getTemplateArgs();\n $this->clientService = new SignatureClientService($this->args);\n $this->routerService = new RouterService();\n parent::controller($this->eg, $this->routerService, basename(__FILE__));\n }", "public function __construct()\n {\n $this->args = $this->getTemplateArgs();\n $this->clientService = new SignatureClientService($this->args);\n $this->routerService = new RouterService();\n parent::controller($this->eg, $this->routerService, basename(__FILE__));\n }", "public function __construct()\n {\n $this->args = $this->getTemplateArgs();\n $this->clientService = new SignatureClientService($this->args);\n $this->routerService = new RouterService();\n parent::controller($this->eg, $this->routerService, basename(__FILE__));\n }", "public function create()\n {\n return view('auth.login');\n }", "public function create()\n {\n return view('auth.login');\n }", "public function create()\n {\n return view('auth.login');\n }", "public function create()\n {\n return view('auth.login');\n }", "public function create()\n {\n return view('auth.login');\n }", "public function create()\n {\n return view('auth.login');\n }", "public function create()\n {\n return view('auth.login');\n }", "public function __construct()\n {\n $this->middleware('authenticate');\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }" ]
[ "0.6556913", "0.6495226", "0.64742136", "0.641273", "0.63362926", "0.62945676", "0.62719876", "0.61133873", "0.61019564", "0.60772926", "0.60576314", "0.6052179", "0.59850615", "0.59636015", "0.5937227", "0.588781", "0.5867256", "0.5822639", "0.57976234", "0.5786977", "0.5783534", "0.5781516", "0.573138", "0.5705345", "0.5687278", "0.5669197", "0.5658615", "0.562654", "0.5618036", "0.5607837", "0.559518", "0.5593729", "0.55612683", "0.5550783", "0.5542264", "0.55131704", "0.55082387", "0.55078584", "0.549633", "0.5486512", "0.5481999", "0.54731727", "0.5448965", "0.5436953", "0.54250973", "0.54208314", "0.5403871", "0.5402983", "0.53968704", "0.539662", "0.5392593", "0.5391464", "0.537165", "0.5370929", "0.5363162", "0.5357392", "0.53549516", "0.5353305", "0.5341166", "0.53325015", "0.53273237", "0.5320933", "0.531811", "0.5307197", "0.5306332", "0.53042024", "0.53042024", "0.5297794", "0.5290958", "0.52886236", "0.52884346", "0.52877384", "0.5283004", "0.52829427", "0.5280474", "0.52730143", "0.52648556", "0.5263328", "0.52563643", "0.5242481", "0.52410096", "0.5237038", "0.5235536", "0.52353054", "0.5226338", "0.52257484", "0.5222129", "0.52181095", "0.52162033", "0.52152824", "0.52152824", "0.52152824", "0.52130806", "0.52130806", "0.52130806", "0.52130806", "0.52130806", "0.52130806", "0.52130806", "0.5201746", "0.519942" ]
0.0
-1
Pluck model entries according to provided language
public function pluck($language) { $name = 'name_'.$language; return CategoryAttribute::where('deleted_at', null) ->where('active', true)->whereIn('parent', [null, 0]) ->orderBy($name)->pluck($name, 'id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllTranslationByLanguage();", "function get_localization($language_name)\n {\n return $this->db->get_where('localization',array('language_name'=>$language_name))->row_array();\n }", "public function languageWhere() {}", "public function languageWhere() {}", "public function getTranslationsForLanguage($language);", "public function getMultilingual();", "function redes_get_languages() {\n $result = [];\n $languages = db_select('languages', 'lan')\n ->fields('lan', ['language', 'name'])\n ->execute()\n ->fetchAll();\n if(isset($languages) && !empty($languages)){\n foreach ($languages as $lang) {\n $result[$lang->language] = $lang->name;\n }\n }//end if\n return $result;\n}", "public function loadLocale()\n {\n if (App::getLocale() === 'ar') {\n return $this->where('id', $this['id'])->first([\n 'id', 'title_ar as title', 'description_ar as description', 'icon_url', 'image_url'\n ])->load([\n 'projects' => function($query) {\n $query->select('title_ar as title', 'description_ar as description', 'image_url', 'field_id');\n }, 'clients' => function($query) {\n $query->select('name_ar as name', 'icon_url', 'field_id');\n }]);\n } else {\n return $this->where('id', $this['id'])->first([\n 'id', 'title', 'description', 'icon_url' ,'image_url'\n ])->load(['projects' => function($query) {\n $query->select('id', 'title', 'description', 'image_url', 'field_id');\n }, 'clients' => function($query) {\n $query->select('name', 'icon_url', 'field_id');\n }]);\n }\n }", "public function translations($language = '') {\n if ($language == '') {\n $language = app()->getLocale();\n }\n return $this->hasMany(AdditionalFieldTranslation::class)\n ->whereIn('language', array($language, Config::get('app.fallback_locale')));\n }", "public function getLanguageList();", "private function _get_translations_from_db () {\n\n\t\ttry {\n\n\t\t\t$db = Db::init();\n\n\t\t\t$sql = 'SELECT key_word, value\n\t\t\t\t\tFROM arka_web.language\n\t\t\t\t\tWHERE lang = :lang';\n\n\t\t\t$sth = $db->dbh->prepare($sql);\n\n\t\t\t$sth->execute(array(':lang' => $this->lang));\n\n\t\t\t$t = $sth->fetchAll(PDO::FETCH_COLUMN|PDO::FETCH_GROUP);\n\n\t\t\treturn array_map('reset', $t );\n\n\t\t} catch (\\PDOException $e) {\n\n\t\t\techo '<b>Error [' . $e->getLine() . ']: </b>' . $e->getMessage();\n\n\t\t}//end catch\n\n\t}", "protected function getDictionary()\n {\n $schemaClass = get_class($this->schema);\n $locale = $this->language;\n $key = \"$schemaClass/$locale\";\n if ( !isset($this->dictionary[$key]) ) {\n $dict=[];\n // model indexes\n $indexNames = $this->schema->getIndexNames();\n foreach ( $indexNames as $index) {\n $fields = $this->schema->getIndexFields($index);\n foreach ($fields as $field ) {\n $translated = $this->schema->getFieldLabel($field);\n $translated = \\mb_strtolower($translated, 'UTF-8');\n $dict[$translated] = $field;\n // add the root form of German gendered words (\"Autor/in\"=> \"Autor\"), todo: make this more universal\n $de_gendered = substr($locale,0,2) === \"de\"\n and ( $pos = strpos($translated, \"/\") or $pos = strpos($translated, \"*\"));\n if ( $de_gendered ) {\n $dict[substr($translated, 0, $pos)] = $field;\n }\n }\n }\n // modifiers and booleans\n foreach ( $this->operators as $operator) {\n // save the lowercase version of the translation for fast lookup\n $translations = $this->getOperatorData($operator)['translation'];\n //Yii::info([Yii::$app->language, $operator, $translations ]);\n foreach ((array) $translations as $translation) {\n // remove placeholder tokens\n $replace_placeholders = ['{leftOperand}','{rightOperand}','{field}','{value}'];\n $translation = \\mb_strtolower( trim(str_replace($replace_placeholders,'', $translation)), 'UTF-8');\n $dict[$translation] = $operator;\n }\n }\n $this->dictionary[$key] = $dict;\n //if( $locale!=\"en-US\") Yii::debug($dict, __METHOD__);\n }\n return $this->dictionary[$key];\n }", "public function getStrings($language)\n {\n $rs = $this->db->query(\"Select * from Localization where languageCode = ?\", array($language));\n $strings = $rs->result();\n \n $rs = $this->db->query(\"Select * from Languages order by language\");\n $languages = $rs->result();\n \n return compact('strings', 'languages');\n }", "protected function _loadFromDb($category, $language)\n {\n $criteria = new \\EMongoCriteria();\n $criteria\n ->addCond('category', '==', $category)\n ->addCond('language', '==', $language);\n $itemList = Item::model()->findAll($criteria);\n\n $messages = array();\n foreach ($itemList as $item) {\n $messages[$item->message] = $item->translation;\n }\n\n return $messages;\n }", "public function rechByLang($lang) {\n $listLOG =\t array();\n $requete = self::$SELECT;\n $rs = $this->conn->query($requete) or die($this->conn->error.__LINE__);\n $rows = [];\n while($row = mysqli_fetch_array($rs))\n {\n if($lang == 'EN') {\n $rows[$row[\"key_identifier\"]] = $row[\"english\"]; \n }\n else if($lang == 'FR') {\n $rows[$row[\"key_identifier\"]] = $row[\"french\"];\n }\n else if($lang == 'ES') {\n $rows[$row[\"key_identifier\"]] = $row[\"spanish\"];\n }\n else if($lang == 'AL') {\n $rows[$row[\"key_identifier\"]] = $row[\"german\"];\n }\n else if($lang == 'IT') {\n $rows[$row[\"key_identifier\"]] = $row[\"italien\"];\n }\n \n }\n return $rows;\n }", "public function getTranslations( $language )\n\t{\n\t\t$sql = <<<TRANSLATIONS\nSELECT\n\t*\nFROM\n\t`i18n_messages` m\nLEFT JOIN\n\ti18n_translations t ON m.id=t.id_message AND lang =?\nORDER BY\n\tt.translation ASC, m.message ASC\nTRANSLATIONS;\n\n\treturn $this->GetArray( $sql, array( $language, 'tag' => 'Get all translations for current language' ) );\n\t}", "protected function getLanguages() {}", "function get_language_details($lang)\n {\n $this->db->select(\"$lang rField,rLabelName\");\n $this->db->from('r_web_language_details as a');\n $query = $this->db->get();\n return $query->result_array();\n\t}", "function getAll()\r\n\t\t{\r\n\t\t\treturn $this->lang;\r\n\t\t}", "public function getAll(){\n\t\t$url = WEBSERVICE. \"languages/getAll\";\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"GET\");\n\t\t$arrayResponse = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $this->arrayToLanguage($arrayResponse, false);\n\t}", "protected function loadMessagesFromDb($category,$language)\n\t{\n\t\t$sql=<<<EOD\nSELECT t1.message AS message, t2.translation AS translation\nFROM {$this->sourceMessageTable} t1, {$this->translatedMessageTable} t2\nWHERE t1.id=t2.id AND t1.category=:category AND t2.language=:language\nEOD;\n\t\t$command=$this->getDbConnection()->createCommand($sql);\n\t\t$command->bindValue(':category',$category);\n\t\t$command->bindValue(':language',$language);\n\t\t$messages=array();\n\t\tforeach($command->queryAll() as $row)\n\t\t\t$messages[$row['message']]=$row['translation'];\n\n\t\treturn $messages;\n\t}", "public function getLanguage()\n {\n $queries = \\DB::table('languages')\n ->orderBy('language')\n ->get();\n\n foreach ($queries as $query)\n {\n $results[] = [ 'id' => $query->id, 'value' => $query->language];\n }\n return Response::json($results);\n }", "public function getList()\n {\n return ArrayHelper::map(LanguageLocalization::find()->all(), 'lan_id', 'lan_name');\n }", "public function getAll(){\n if(!isset($this->array_lang_en)){\n $this->initEn();\n }\n if(!isset($this->array_lang_fr)){\n $this->initEn();\n }\n return [\n 'eng' => $this->array_lang_en,\n 'fr' => $this->array_lang_fr\n ];\n }", "public function parseLanguages()\n {\n $languages = array();\n $modelArray = $this->model->toRdfPhp();\n $textAnnotationsLanguage = $this->model->resourcesMatching(DCTerms::TYPE, array('type' => 'uri', 'value' => DCTerms::LINGUISTIC_SYSTEM));\n foreach ($textAnnotationsLanguage as $taLangResource) {\n $taProperties = $modelArray[$taLangResource->getUri()];\n $lang = isset($taProperties[DCTerms::LANGUAGE][0]['value']) ? $taProperties[DCTerms::LANGUAGE][0]['value'] : '';\n if (!empty($lang) && !in_array($lang, $languages))\n array_push($languages, $lang);\n }\n\n return $languages;\n }", "public function elfinderLocalizations()\n {\n $i18n = [];\n\n foreach ($this->localizations() as $id => $translations) {\n if ($translations instanceof Translation) {\n foreach ($translations->data() as $language => $message) {\n $i18n[$language][$id] = $message;\n }\n } else {\n $i18n[$language][$id] = $translations;\n }\n }\n\n return $i18n;\n }", "public function getTablesAndFields($language = '')\n {\n return [];\n }", "public function getLanguages() {}", "function getLang() {\n $query = 'select * from language';\n $languageRes = $this->db->dbQuery($query);\n\n $languages = array();\n while ($language = $languageRes->fetch_assoc()) {\n array_push($languages, array('langID' => $language['langID'],\n 'languageName' => $language['languageName']));\n }\n return $languages;\n }", "public function get_desired_languages();", "private static function loadLanguage($lang){\n\t\t$descriptions = array();\n\n\t\t$locale = 'locale/'.$lang.'.php';\n\t\trequire($locale);\n\n\t\treturn (object)$descriptions;\n\t}", "public function getLanguages();", "public function languages();", "public function getTranslationsByLocale()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n $out[$trans->getLocale()] = $trans;\n }\n\n return $out;\n }", "protected function loadMessagesFromDb($category, $language)\r\n {\r\n $sql = \"SELECT message, translation_\" . $language . \" AS translation\r\n FROM {{translate_message}}\r\n WHERE category=:category\";\r\n $command = Yii::app()->db->createCommand($sql);\r\n $command->bindValue(':category', $category);\r\n $messages = array();\r\n foreach ($command->queryAll() as $row)\r\n $messages[$row['message']] = $row['translation'];\r\n\r\n return $messages;\r\n }", "private function getTranslatedFields() {\n $langs = explode(',',$_REQUEST['translations']);\n\t\t$translations = array();\n\t\tforeach($langs as $lang){\t\t\n\t\t\t$translations[$lang] = array(\n\t\t\t\t'id' => (int) $_REQUEST['TranslationID'.$lang],\n\t\t\t\t'pagetitle' => $_REQUEST['pagetitle'.$lang],\n\t\t\t\t'longtitle' => $_REQUEST['longtitle'.$lang],\n\t\t\t\t'menutitle' => $_REQUEST['menutitle'.$lang],\n\t\t\t\t'introtext' => $_REQUEST['introtext'.$lang],\n\t\t\t\t'description' => $_REQUEST['description'.$lang],\n\t\t\t\t'content' => $_REQUEST['content'.$lang],\n\t\t\t);\n\t\t\tforeach($translations[$lang] as $key => $val){\n\t\t\t\tif($translations[$lang][$key] == null){\n\t\t\t\t $translations[$lang][$key] = '';\n\t\t\t\t};\n\t\t\t};\t\n\t\t};\n\t\treturn $translations;\t\t\n\t}", "function readLocaleProperties($language) {\n \t$row = db_execute_one('SELECT subject, body FROM ' . TABLE_PREFIX . 'email_template_translations WHERE name = ? AND module = ? AND locale = ?', $this->getName(), $this->getModule(), $language);\n \tif(is_array($row)) {\n \t $this->subject_values[$language] = $row['subject'];\n \t $this->body_values[$language] = $row['body'];\n \t} else {\n \t return false;\n \t} // if\n }", "public function getLanguagesTitleForVacancy() {\n return $this->descriptions->map(function($entity){\n return $entity->getLanguage()->getTitle(); \n });\n }", "public static function load($lang=null){\n\t\t \n\t\tif(!$lang){\n\t\t\t$lang = self::getLanguage();\n\t\t}\n\t\t \n\t\t$cachekey = \"locale:\" . $lang;\n\t\t$locale = Cache::loadCache($cachekey);\n\t\n\t\tif(!is_array($locale)){\n\t\t\t//No cache available -> load from database\n\t\t\t$sql = new SqlManager();\n\t\t\t$sql->setQuery(\"SELECT * FROM bd_sys_locale WHERE locale_language = {{lang}}\");\n\t\t\t$sql->bindParam('{{lang}}', $lang, \"int\");\n\t\t\t$result = $sql->execute();\n\t\t\t$locale = array();\n\t\t\twhile($res = mysql_fetch_array($result)){\n\t\t\t\t$locale[$res['locale_key']] = $res['locale_text'];\n\t\t\t}\n\t\t\t\n\t\t\t//Save loaded locales into cache file for later use \n\t\t\tCache::saveCache($cachekey,$locale);\n\t\t}\n\t\t\n\t\treturn $locale;\n\t}", "protected function loadMessages($category, $language)\n {\n $messages = $this->_loadFromDb($category, $language);\n return $messages;\n }", "public function getLanguages(Request $request)\n {\n $totalData = 0;\n $columns = array(\n 0 => 'id',\n 1 => 'name',\n 2 => 'code',\n 3 => 'rtl',\n 4 => 'action',\n );\n $limit = $request->input('length');\n $start = $request->input('start');\n $start = $start ? $start / $limit : 0;\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n $languages = Language::orderBy($order, $dir);\n $totalData = $languages->count();\n\n if (!empty($request->input('search.value'))) {\n $search = $request->input('search.value');\n $languages = $languages->where('id', 'LIKE', \"%{$search}%\")\n ->orWhere('name', 'LIKE', \"%{$search}%\");\n }\n $languages = $languages->paginate($limit, ['*'], 'page', $start + 1);\n $totalFiltered = $languages->total();\n $data = array();\n if (!empty($languages)) {\n foreach ($languages as $key => $language) {\n $nestedData['id'] = ($start * $limit) + $key + 1;\n $nestedData['name'] = $language->name;\n $nestedData['code'] = $language->code;\n if ($language->rtl == 1) {\n $nestedData['rtl'] = '<input type=\"hidden\" name=\"language_status[]\" value=\"'.$language->id.'\"><input name=\"status['.$language->id.']\" value=\"1\" type=\"checkbox\" checked />';\n } else {\n $nestedData['rtl'] = '<input type=\"hidden\" name=\"language_status[]\" value=\"'.$language->id.'\"><input name=\"status['.$language->id.']\" value=\"0\" type=\"checkbox\" />';\n }\n $index = route('languages.index', encrypt($language->id));\n $edit = route('languages.update', encrypt($language->id));\n $delete = route('languages.destroy', encrypt($language->id));\n $show = route('languages.show', encrypt($language->id));\n $exist = $language;\n $comp = true;\n $nestedData['action'] = view('language.partials.setting-action', compact('index', 'exist', 'comp', 'edit', 'delete', 'show', 'language'))->render();\n $data[] = $nestedData;\n }\n }\n $json_data = array(\n \"draw\" => intval($request->input('draw')),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data\n );\n return json_encode($json_data);\n }", "public function getData() {\r\n $dados = [];\r\n foreach ($this as $key => $value) {\r\n if (\\property_exists(I18n::class, $key)) {\r\n $dados[$key] = $value;\r\n }\r\n }\r\n return $dados;\r\n }", "public function languages()\n {\n return $this->belongsToMany(\n Language::class,\n call_user_func([$this->translatableModel, 'getTableName']),\n 'source_id'\n );\n }", "private function getAllLangs()\n\t{\n\t\t$options = array();\n\t\t$sql = \"SELECT * FROM \" . $this->db->prefix . \"site_languages WHERE is_online = 1\";\n\t\t$result = $this->db->query($sql);\n\t\t$available_languages = array();\n\t\twhile($row = $this->db->fetchToRow($result)){\n\t\t\t$available_languages[] = $row[ 'lang' ];\n\t\t\t$options[ $row[ 'lang' ] ][ 'lang' ] = $row[ 'lang' ];\n\t\t\t$options[ $row[ 'lang' ] ][ 'language' ] = ucfirst($row[ 'language' ]);\n\t\t}\n\t\t$this->language_options = $options;\n\n\t\treturn $available_languages;\n\t}", "public function languages_get() {\n\t\t$language_files = array();\n\t\t$all_files = $this->crud_model->get_list_of_language_files();\n\t\t$counter = 0;\n\t\tforeach ($all_files as $file) {\n\t\t\t$info = pathinfo($file);\n\t\t\tif( isset($info['extension']) && strtolower($info['extension']) == 'json') {\n\t\t\t\t$inner_array = array();\n\t\t\t\t$file_name = explode('.json', $info['basename']);\n\t\t\t\t$inner_array = array(\n\t\t\t\t\t'id' => $counter++,\n\t\t\t\t\t'value' => $file_name[0],\n\t\t\t\t\t'displayedValue' => ucfirst($file_name[0])\n\t\t\t\t);\n\n\t\t\t\tarray_push($language_files, $inner_array);\n\t\t\t}\n\t\t}\n\t\treturn $language_files;\n\t}", "public static function loadLanguages()\n\t{\n\t\tself::$_LANGUAGES = array();\n\t\t$result = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'Language`');\n\t\tforeach ($result AS $row)\n\t\t\tself::$_LANGUAGES[(int)$row['LanguageId']] = $row;\n\t}", "function getUserLanguages() {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_LANGUAGES_USER . \" WHERE status='1' ORDER BY language_name\");\n\n return $data;\n }", "public function getLanguage()\n {\n return $this->hasOne(Language::className(), ['iso_code'=>'lang']);\n }", "public function model(){\n return LanguageList::class;\n }", "public static function languages()\n {\n return self::first()->languages;\n }", "public function loadLanguage(string $language): array\n\t{\n\t\t$translations = Translation::getTranslationsForModel($this, $language);\n\t\t$this->setTranslations($translations);\n\n\t\treturn $translations;\n\t}", "protected abstract function getTranslations();", "function get_language(){//GETS LANGUAGES FOR DROPDOWN\n $query = $this->db->query('SELECT DISTINCT language_code, language FROM interpreters ORDER BY language asc');\n return $query->result();\n }", "public function postFetchlanguages(){\n\n $cat_id = Input::get('cat_id');\n if($cat_id != ''){\n $langList = Language::where('categoryId', '=', $cat_id)->get();\n\n $LangArray = array();\n foreach ($langList as $lang) {\n\n $refl = new ReflectionObject($lang);\n $prop = $refl->getProperty('attributes');\n $prop->setAccessible(true);\n $lang_item = $prop->getValue($lang);\n array_push($LangArray, $lang_item);\n }\n return Response ::json(array(\"status\"=>true,'languages'=>$LangArray));\n }else{\n return Redirect::to('questions/add')->with('message', 'No language stored under this category!');\n }\n}", "public static function GetLanguages() {\n try {\n $vi = 'vi';\n return DB::table('languages')\n ->where('deleted_at', null)\n ->where('language_code', '<>', $vi)\n ->select(\n 'language_code as code',\n 'language_name as name'\n )\n ->get()->toArray();\n } catch (Exception $e) {\n return [];\n }\n }", "function getLanguages($langList){\n\t$languages = array();\n\tforeach ($langList as $lang){\n\t\t$json=file_get_contents (\"FINAL/locales/translation-$lang.json\");\n\t\t//we want an associative array, thus second parameter is true\n\t\t$languages[$lang] = json_decode($json,true);\n\t\t//print_r($obj);\n\t}\n\treturn $languages;\n}", "public function getGroupTranslationsFor($language)\n {\n if (isset($this->groupTranslationCache[$language])) {\n return $this->groupTranslationCache[$language];\n }\n\n $languageModel = $this->getLanguage($language);\n\n if (is_null($languageModel)) {\n return collect();\n }\n\n $translations = $languageModel\n ->translations()\n ->whereNotNull('group')\n ->where('group', 'not like', '%single')\n ->get()\n ->groupBy('group');\n\n $result = $translations->map(function ($translations) {\n return $translations->mapWithKeys(function ($translation) {\n return [$translation->key => $translation->value];\n });\n });\n\n $this->groupTranslationCache[$language] = $result;\n\n return $result;\n }", "public function languages()\n {\n return $this->belongsToMany(Language::class, ItemTranslations::getTableName(), 'source_id');\n }", "public function resolve(?string $language): array;", "function loadTranslation($language = 'en')\n{\n $content = json_decode(file_get_contents(TRANSLATIONS_FOLDER . DS . $language . '.json'), true);\n if ($content && count($content)) {\n return $content;\n } else {\n return $language == 'en' ? array() : loadTranslation('en');\n }\n}", "public function getLanguage() {}", "public function localeContents()\n {\n $ref = defined('static::REF_KEY') ? static::REF_KEY : ($this->table??'data');\n return $this->hasOne('App\\\\Models\\\\MultiLanguageContent', 'ref_id', 'id')->where('ref', $ref)->where('locale', config('app.locale'));\n }", "public function getFromLanguage(): string;", "public static function getAllLanguage() {\n $languages = Language::select('name', 'code', 'flag')->get();\n $data = array();\n foreach ($languages as $language) {\n $data[$language->code]['name'] = $language->name;\n $data[$language->code]['flag'] = url(self::LANGUAGE_THUMB_DIR . $language->flag);\n }\n\n return $data;\n }", "public function allData(Request $request) {\n\n $columns = array(\n 0 => 'id',\n 1 => 'name',\n 2 => 'country.name',\n 3 => 'name_in_language',\n 4 => 'code',\n 5 => 'status'\n );\n\n $totalData = Languages::count();\n\n $totalFiltered = $totalData;\n\n $limit = $request->input('length');\n $start = $request->input('start');\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n\n if (empty($request->input('search.value'))) {\n $posts = Languages::leftJoin('country', 'country.id', '=', 'languages.country_id')\n ->select('languages.*', 'country.name as country_name')\n ->offset($start)\n ->limit($limit)\n ->orderBy($order, $dir)\n ->get();\n } else {\n $search = $request->input('search.value');\n\n $posts = Languages::leftJoin('country', 'country.id', '=', 'languages.country_id')\n ->select('languages.*', 'country.name as country_name')\n ->where('languages.name', 'LIKE', \"%{$search}%\")\n ->orWhere('languages.status', 'LIKE', \"%{$search}%\")\n ->orWhere('country.name', 'LIKE', \"%{$search}%\")\n ->offset($start)\n ->limit($limit)\n ->orderBy($order, $dir)\n ->get();\n\n $totalFiltered = Languages::leftJoin('country', 'country.id', '=', 'languages.country_id')\n ->select('languages.*', 'country.name as country_name')\n ->where('languages.name', 'LIKE', \"%{$search}%\")\n ->where('country.name', 'LIKE', \"%{$search}%\")\n ->orWhere('languages.status', 'LIKE', \"%{$search}%\")\n ->count();\n }\n\n $data = array();\n \n if (!empty($posts)) {\n foreach ($posts as $post) {\n $show = route('languages.edit', $post->id);\n $edit = route('languages.edit', $post->id);\n $url = asset('uploads/languages/' . $post->image);\n\n $st = route('languages.status', $post->id);\n\n $nestedData['id'] = $post->id;\n $nestedData['name'] = $post->name;\n $nestedData['country_name'] = $post->country_name;\n $nestedData['name_in_language'] = $post->name_in_language;\n $nestedData['code'] = $post->code;\n \n if ($post->status == '1') {\n $nestedData['status'] = '<span class=\"badge badge-success\">Active</span>';\n } else {\n $nestedData['status'] = '<span class=\"badge badge-danger\">Paused</span>';\n }\n\n $options = \"\";\n\n if ($post->status == '1') {\n $options = '<a href=\"' . $st . '\" class=\"btn btn-rounded btn-sm btn-warning\" data-toggle=\"tooltip\" title=\"Pause Languages\"> <i class=\"fa fa-power-off\"></i> </a>&nbsp;';\n } else {\n $options = '<a href=\"' . $st . '\" class=\"btn btn-rounded btn-sm btn-success changeCategoryStatus\" data-toggle=\"tooltip\" title=\"Activate Languages\"> <i class=\"fas fa-play\"></i> </a>&nbsp;';\n }\n\n if (get_user_permission(\"Languages\", \"edit\")) {\n $options .= '<a href=\"' . $edit . '\" class=\"btn btn-rounded btn-sm btn-info\" data-toggle=\"tooltip\" title=\"Edit Languages\"><i class=\"fas fa-pencil-alt\">\n </i>\n Edit</a>';\n }\n\n $nestedData['options'] = $options;\n $data[] = $nestedData;\n }\n }\n\n $json_data = array(\n \"draw\" => intval($request->input('draw')),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data,\n );\n echo json_encode($json_data);\n }", "public static function getLocaleList()\n {\n return collect(config('lang-detector.languages'))->map(function ($lang) {\n return [\n 'lang' => $lang,\n 'name' => self::getLocaleName($lang),\n 'name-orig' => self::getLocaleName($lang, $lang),\n ];\n });\n }", "public function translations()\n {\n $locales = config('translatable.locales');\n $fallback_locale = config('translatable.fallback_local');\n unset($locales[$fallback_locale]);\n $translations_count = count($locales);\n if ($translations_count === 1) {\n return $this->hasOne(get_class() . 'Translation');\n } else {\n return $this->hasMany(get_class(), 'Translation');\n }\n }", "public function getByLocale( $locale );", "public function iN_Languages() {\n\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_langs WHERE lang_status = '1'\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "function editlanguagemodel()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$showlanguage = array();\n\t\t\n\t\t//Fetch language settings details\n\t\t$query = 'SELECT id,player_lang FROM `#__hdflvplayerlanguage`';\n\t\t$db->setQuery( $query);\n\t\t$showlanguage = $db->loadObject();\n\t\treturn $showlanguage;\n\t}", "private function extractDataOfLanguage($lang)\n {\n $found = [];\n // parsing language preference instructions\n // 2_digit_code[-longer_code][;q=coefficient]\n preg_match('/([a-z]{1,2})(-([a-z0-9]+))?(;q=([0-9\\.]+))?/', $lang, $found);\n // 2 digit lang code\n $code = isset($found[1]) ? $found[1] : null;\n // lang code complement\n $morecode = isset($found[3]) ? $found[3] : null;\n // full lang code\n $fullcode = $morecode ? $code.'-'.$morecode : $code;\n // coefficient\n $coef = sprintf('%3.1f', isset($found[5]) ? $found[5] : '1');\n // for sorting by coefficient\n // adding\n return array('code' => $code,'coef' => $coef,'morecode' => $morecode,'fullcode' => $fullcode);\n }", "public function getLanguagesTranslations(Request $request, $lang)\n {\n $totalData = 0;\n $columns = array(\n 0 => '#',\n 1 => 'id',\n 2 => 'lang_key',\n 3 => 'lang_value',\n 4 => 'action'\n );\n $limit = $request->input('length');\n $start = $request->input('start');\n $start = $start ? $start / $limit : 0;\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n $translations = Translation::where('lang', $lang)->orderBy($order, $dir);\n $totalData = $translations->count();\n\n if (!empty($request->input('search.value'))) {\n $search = $request->input('search.value');\n $translations = $translations->where('id', 'LIKE', \"%{$search}%\")\n ->orWhere('lang_key', 'LIKE', \"%{$search}%\");\n }\n $translations = $translations->paginate($limit, ['*'], 'page', $start + 1);\n $totalFiltered = $translations->total();\n $data = array();\n if (!empty($translations)) {\n foreach ($translations as $key => $language_translation) {\n $nestedData['#'] = '<input type=\"checkbox\" name=\"bulk_delete[]\" class=\"checkboxes\" value=\"' . $language_translation->id . '\" />';\n $nestedData['id'] = ($start * $limit) + $key + 1;\n $nestedData['lang_key'] = $language_translation->lang_key;\n $nestedData['lang_value'] = '<input type=\"text\" class=\"form-control\" name=\"values[' . $language_translation->lang_key . ']\" value=\"' . $language_translation->lang_value . '\" />';\n $delete = route('languages_trans.destroy', encrypt($language_translation->id));\n $exist = $language_translation;\n $comp = true;\n $nestedData['action'] = view('language.partials.translation-action', compact('exist', 'delete', 'language_translation'))->render();\n $data[] = $nestedData;\n }\n }\n $json_data = array(\n \"draw\" => intval($request->input('draw')),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data\n );\n return json_encode($json_data);\n }", "function i18n_get_values($locale = null) {\n\t\t\t$query = \"SELECT * FROM \".$this->i18n_table.\" WHERE {$this->i18n_foreign_key_field}='\".$this->{$this->primary_keys[0]}.\"' \" . (is_null($locale) ? '' : \"AND {$this->i18n_locale_field} = '$locale' \");\n\n\t\t\t$result = $this->query($query);\n\t\t\tif(!$result) $this->raise('ActiveRecord: Query error!');\n\n\t\t\tforeach ($result as $row) {\n\t\t\t\t$locale = $row->locale;\n\t\t\t\tforeach($row->fetch() as $field => $value) {\n\t\t\t\t\tif(!in_array($field, $this->i18n_reserved_columns))\n\t\t\t\t\t\t$this->i18n_column_values[$field][$locale] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function map_language_translations($translations)\n{\n return $translations->map(function ($string) {\n return [$string->key => $string->value];\n })->collapse();\n}", "private function mapSqlToObject($rs) {\n $langue = new langue();\n $langue->_id = $rs[\"id\"];\n $langue->_key_identifier = $rs[\"key_identifier\"];\n $langue->_english = $rs[\"english\"];\n $langue->_french = $rs[\"french\"];\n $langue->_spanish = $rs[\"spanish\"];\n $langue->_german = $rs[\"german\"];\n $langue->_italien = $rs[\"italien\"];\n return $langue;\n }", "public function allTranslationsFor($language)\n {\n return Collection::make([\n 'group' => $this->getGroupTranslationsFor($language),\n 'single' => $this->getSingleTranslationsFor($language),\n ]);\n }", "public function getUserLocale(string $language): array {\n $result = [];\n\n $language_slug = self::LANGUAGES[$language];\n\n $stmt = 'SELECT `target`, `' . $language_slug . '` FROM `localization`';\n\n $getLanguage = $this->_conn->query($stmt);\n if($getLanguage->num_rows > 0) {\n while($data = $getLanguage->fetch_assoc()) {\n $result[$data['target']] = $data[$language_slug];\n }\n }\n\n return $result;\n\n }", "public function getAllLanguages()\n\t{\n\t\t$mod = $this->getAppModel('LanguageModel');\n\n\t\t$query = $this->getBaseManager()->getConnection()->newQuery();\n\t\t$query->select('*');\n\t\t$query->from($mod->getTableName());\n\n\t\treturn $this->getBaseManager()->getModelsByQuery($this->getAppModelName('LanguageModel'), $query);\n\t}", "public function localizations()\n {\n return $this->hasMany(EntryLocalization::class);\n }", "public function Load ($language,$limit = null) {\n\t\t$this->load->library(\"sentence\");\n\t\t$SentenceTemplate = new Sentence();\n\t\tif (!is_null($limit)) {\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t$query = $this->db->from($SentenceTemplate->Database_Table)->select(\"id\")->where(array(\"language\" => $language))->get();\n\t\t$rows = array();\n\t\tif ($query->num_rows() === false || $query->num_rows() == 0) return false;\n\t\tforeach ($query->result() as $row) {\n\t\t\t$Sentence = new Sentence();\n\t\t\t$Sentence->Load($row->id);\n\t\t\t$rows[] = $Sentence;\n\t\t}\n\t\treturn $rows;\n\t}", "public function languages()\n {\n return $this->belongsToMany(Language::class);\n }", "public static function getList()\n { \n \n $countries = self::all();\n \n $list = array();\n foreach ($countries as $row) {\n $list[$row->id] = $row->name;\n }\n asort($list);\n \n $first_country = env('FIRST_COUNTRY');\n//dd($first_country); \n if ($first_country) {\n $first_country_obj = Country::\n where('name_'.env('PRIM_LANG'),'like',$first_country)\n ->first();\n if ($first_country_obj && isset($list[$first_country_obj->id])) {\n $first_country_name = $list[$first_country_obj->id];\n unset($list[$first_country_obj->id]);\n $list = [$first_country_obj->id => $first_country_name] + $list;\n }\n }\n \n return $list; \n }", "public function fetchAll()\n {\n if (static::$languages === null) {\n static::$languages = $this->driver()->fetchAll();\n\n static::$languages = array_map(function ($language) {\n return new Locale($language);\n }, static::$languages);\n }\n\n return static::$languages;\n }", "public function getSingleTranslationsFor($language)\n {\n $translations = $this->getLanguage($language)\n ->translations()\n ->where('group', 'like', '%single')\n ->orWhereNull('group')\n ->get()\n ->groupBy('group');\n\n // if there is no group, this is a legacy translation so we need to\n // update to 'single'. We do this here so it only happens once.\n if ($this->hasLegacyGroups($translations->keys())) {\n TranslationModel::whereNull('group')->update(['group' => 'single']);\n // if any legacy groups exist, rerun the method so we get the\n // updated keys.\n return $this->getSingleTranslationsFor($language);\n }\n\n return $translations->map(function ($translations, $group) {\n return $translations->mapWithKeys(function ($translation) {\n return [$translation->key => $translation->value];\n });\n });\n }", "public function model()\n {\n return Language::class;\n }", "public function getAllLangue(){\n\n global $conn;\n \n $request_all = \"SELECT * FROM `langue`\";\n $get_all_langue = $conn->query($request_all);\n\n return $get_all_langue;\n }", "public function getTranslations()\n {\n return $this->hasMany(NewsItemLang::class, ['news_item_id' => 'id']);\n }", "public function getTranslationsById()\n {\n if (!($arColl = $this->getTranslations())) {\n\n return [];\n }\n $out = [];\n foreach ($arColl as $trans) {\n if (!$trans->getId()) {\n continue;\n }\n $out[$trans->getId()] = $trans;\n }\n\n return$out;\n }", "function getSiteLanguages() {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_LANGUAGES . \" WHERE status='1' ORDER BY language_name\");\n\n return $data;\n }", "static function getList() {\n if (self::$list === NULL) {\n\n $list_all = Lang::find()->published()->all();\n $l = array();\n foreach ($list_all as $data) {\n $l[$data->alias] = $data;\n }\n\n self::$list = $l;\n }\n return self::$list;\n }", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "function get_all_language()\n {\n $this ->db-> select('language_id,language_name,language_delete_status');\n $this ->db-> from('tbl_languages');\n $this->db->where('language_delete_status','0');\n $this->db->order_by('language_name', 'asc');\n $query = $this->db->get();\n return $query->result();\n }", "public function getLanguages()\n {\n return Llv_Entity_Referential_Helper_Language::convertFromDalToDtoAll(\n Llv_Entity_Referential_Dal_Language::getAll()\n );\n }", "public function get_language(){\n $query = $this->db->get('preferred_language_11');\n if($query){\n return $query->result_array();\n }\n else{\n return false;\n }\n }", "public function getLanguagePairs()\n {\n return $this->request('/language_pair/', array());\n }" ]
[ "0.650034", "0.63342494", "0.6277153", "0.6277153", "0.62669677", "0.6242231", "0.6234265", "0.6140414", "0.6085647", "0.6070588", "0.59871185", "0.58992743", "0.58528894", "0.58383846", "0.57883316", "0.5729336", "0.5720103", "0.56927866", "0.56904817", "0.56863374", "0.5686243", "0.5660435", "0.5655036", "0.5642399", "0.56388146", "0.56341", "0.56317264", "0.56270874", "0.5612697", "0.56087554", "0.5604485", "0.55859053", "0.5584688", "0.5574175", "0.5565563", "0.55644596", "0.55616397", "0.5560658", "0.55578095", "0.55561185", "0.5549532", "0.55481935", "0.55396503", "0.5527523", "0.5524357", "0.5522084", "0.55214065", "0.55163354", "0.5515545", "0.55102116", "0.5506118", "0.54940534", "0.54662776", "0.5455404", "0.5450878", "0.54470915", "0.54376197", "0.54350173", "0.542955", "0.54240596", "0.54216385", "0.5420643", "0.5417966", "0.5416128", "0.5413491", "0.54100126", "0.540936", "0.54063386", "0.5390792", "0.5388239", "0.53851646", "0.5383743", "0.53834975", "0.53759336", "0.5371362", "0.53672016", "0.5359915", "0.5355593", "0.5354914", "0.53425187", "0.53420734", "0.53404653", "0.5332753", "0.53319097", "0.53125167", "0.53101385", "0.53060055", "0.5304488", "0.5302318", "0.52949834", "0.5287264", "0.5287264", "0.5287264", "0.5287264", "0.5287264", "0.5287264", "0.52684873", "0.52653694", "0.52651805", "0.526356" ]
0.6091608
8
Retrieve all category attributes according to selected category
public function lists($category_id) { return @Category::where('deleted_at', null)->where('id', $category_id) ->first()->attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all_attr_cat()\n\t{\n\t\t$rest_id=$this->session->userdata('user_rest_uns');\n\t\t//$all_cat=$this->db->query(\"SELECT *from `food_attribute` where `rest_id`='\".$rest_id.\"' AND `f_att_deleted`='0'\");\n\t\t$all_cat=$this->db->get_where('food_attribute' ,array(\"rest_id\"=>$rest_id ,\"f_att_deleted\"=>'0'));\n\t\tif($all_cat)\n\t\t{\n\t\t\treturn $all_cat;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t}", "public function listattr_cat()\n {\n $this->db->where('descripcion_atributo', 'Catalogo');\n $resultados = $this->db->get('atributos_b');\n\n return $resultados->result();\n }", "private function __getCats() {\n\n\t\t$rootcatID = Mage::app()->getStore()->getRootCategoryId();\n\n\t\t$categories = Mage::getModel('catalog/category')\n\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t\t\t\t->addIsActiveFilter();\n $data = array();\n foreach ($categories as $attribute) {\n\t\t\t$data[] = array(\n\t\t\t\t'value' => $attribute->getId(),\n\t\t\t\t'label' => $attribute->getName()\n\t\t\t);\n }\n return $data;\n }", "public function getAllWithCategory();", "public function getCategoryListAttribute()\n {\n return $this->categories->lists('category_id')->all();\n }", "function get_all_category(){\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM evs_database.evs_set_form_attitude\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}", "public function getAttributes()\n {\n return $this->getValueJSONDecoded('nb_commerce_product_category_attributes');\n }", "public function getCategory() {}", "public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}", "public function get_category_attribute_ids( $category_id ) {\r\n return $this->prepare(\r\n 'SELECT a.`attribute_id` FROM `attributes` AS a LEFT JOIN `attribute_relations` AS b ON ( a.`attribute_id` = b.`attribute_id` ) WHERE b.`category_id` = :category_id ORDER BY a.`title`'\r\n , 'i'\r\n , array( ':category_id' => $category_id )\r\n )->get_col();\r\n }", "public function getCategories();", "public function getCategories();", "private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "public function getCategory();", "public function getCategory();", "public function getAttributeByCategory($category_id){\n \t$attributes = ProductAttribute::where('category_id', $category_id)->get();\n \t$output = '';\n \tif(count($attributes)>0){\n \t\t$output = view('admin.product.attributedynamic-fields')->with(compact('attributes'));\n \t}\n\n \techo $output;\n }", "public static function getCategoryOptions()\n {\n return self::get('category') ?: [];\n }", "public function getAllWithCategoryAndTags();", "public function getAllCategories();", "function all_category() {\n\n $query = $this->db->get('tbl_category');\n return $query->result_array();\n }", "public function all()\n {\n return $this->category->all();\n }", "public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n }\n return $data;\n }", "private function getCategoryNames()\n {\n $categoryData = array();\n $this->_connection = $this->_resourceConnection->getConnection();\n $table = $this->_connection->getTableName('catalog_category_entity_varchar');\n $query = \"\n SELECT *\n FROM `{$table}`\n WHERE attribute_id = '{$this->nameAttributeId}'\n \";\n\n $result = $this->_connection->fetchAll($query);\n\n if (count($result) > 0) {\n foreach ($result as $category) {\n if (isset($category['entity_id'])) {\n $categoryData[$category['entity_id']][$category['store_id']] = $category['value'];\n } else {\n $categoryData[$category['row_id']][$category['store_id']] = $category['value'];\n }\n }\n }\n\n return $categoryData;\n }", "private function getCategoryFullInfo(){\n return Db::select(CATEGORY_TABLE_NAME,\"id='$this->categoryId'\",\"single\");\n }", "function category()\n\t{\n\n\t\t//$CI =& get_instance();\n\t\t$this->load->model('shop/categories_m');\n\n\t\t$id = $this->attribute('id', '');\n\t\t$field = $this->attribute('field', '');\n\n\t\t$category = $this->categories_m->get( $id );\n\t\n\n\t\tif($category)\n\t\t{\n\t\t\tif($field != '')\n\t\t\t{\n\t\t\t\treturn array('result' => $category->$field );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (array) $category;\n\t\t\t}\n\t\t}\n\n\t\treturn array('result' => '');\n\n\t}", "public function findAllCategories(): iterable;", "public function indexattr()\n {\n $attr = Attribute::all();\n $category_id= Input::get('category_id');\n $category_name= Input::get('category_name');\n // $data = array('category_id' => $category_id,\n // 'category_name' => $category_name);\n\n return view('backend.CategoryPageListattributes',compact(\"attr\"))->with(array('category_id' => $category_id,\n 'category_name' => $category_name));\n }", "public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }", "public function get($category_id);", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "function all_category()\n\t{\n\t\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->result_array();\n\t}", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function chooseCategory(){\n $req = $this->db->query('SELECT * FROM p5_files_category');\n $req->setFetchMode(\\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, \n 'taekwondo\\model\\Category');\n return $req;\n }", "public function category(){\n\t\t$query = $this->db->query(\"select * from `category` where status='enable'\");\n\t\treturn $query->result_array();\n\t}", "public static function getAll(){\n $result = static::$conn->query(\"SELECT * FROM enews.category\");\n return $result->fetchAll(\\PDO::FETCH_ASSOC);\n }", "function fetchAllCategory() {\n $query = $this->db->get('tbl_category');\n return $query->result_array();\n }", "public function findCategories();", "public function getAll()\n {\n\t\t\treturn Category::with([\n\t\t\t\t'user'=>function($query){\n\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t},\n\t\t\t\t'updatedByUser'=>function($query){\n\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t},\n\t\t\t])->get(['id','name','type','created_by','updated_by']);\n }", "public function extractImportedCategories()\n {\n $categories = [];\n /** @var \\Shopware\\CustomModels\\Connect\\Attribute $attribute */\n foreach ($this->attributeRepository->findRemoteArticleAttributes() as $attribute) {\n $categories = array_merge($categories, $attribute->getCategory());\n }\n\n return $this->convertTree($this->categoryResolver->generateTree($categories));\n }", "public function all()\n {\n $sql =\"SELECT c.id, c.name_category, c.waiting, c.obs_waiting, c.cover, count(p.name_product) as total_prods FROM categories as c LEFT JOIN products as p ON(c.name_category = p.category) WHERE p.status = 0 GROUP BY c.id\";\n $sql = $this->db->query($sql);\n return $categories = $sql->fetchAll(\\PDO::FETCH_ASSOC);\n }", "function get_cat() {\r\n \r\n $query = $this->db->get('categories');\r\n return $query->result_array();\r\n }", "public static function getAllCatagory(){\n\t\t\t$value=DB::table('catagories')->orderBy('name', 'asc')->get();\n\t\t\treturn $value;\n\t\t}", "public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\t\t\t$pre->execute();\n\n\t\t\treturn $pre->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function category_all() {\n $this->autoRender = false;\n $this->loadModel('Skill');\n $getCategoryall = $this->Skill->find('all')->select(['id','skill_name','skill_category.category_name','skill_category.id'])->join([\n 'skill_category' => [\n 'table' => 'skill_category',\n 'type' => 'INNER',\n 'conditions' => 'skill_category.id = skill_category_id'\n ]\n ])->order('skill_category.category_name ASC')->toArray();\n $category_with_skills = [];$result= [];\n if(!empty($getCategoryall)){\n foreach($getCategoryall as $cat){\n $category_with_skills[$cat['skill_category']['id']][$cat['skill_category']['category_name']][] = [\n 'skill_id' => $cat['id'],\n 'skill_name' => $cat['skill_name'],\n ];\n }\n \n foreach($category_with_skills as $catKey => $category){\n $catName = array_keys($category);\n $result[] = [\n 'category_id' => $catKey,\n 'category_name' => $catName[0],\n 'skills' =>$category[$catName[0]]\n ];\n }\n \n }\n if(empty($getCategoryall)){\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"No category skills available!\",\n ]\n );\n exit; \n }else{\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Success!\",\n 'result' => $result\n ]\n );\n exit; \n }\n }", "public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}", "function get_all_courses_category_wise($category)\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.seo_url', $category);\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n // return $this->db->last_query();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }", "public function getByCategory()\n {\n return $this->by_category;\n }", "public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }", "function getAllCategories(){\r\n $query = $this->db->query(\"SELECT * FROM category\");\r\n return $query->result_array();\r\n }", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function getAllCategory(){\n $query = \"SELECT * FROM category ORDER BY catId DESC\";\n $result = $this->db->select($query);\n return $result; \n }", "function fetchAllCategory()\n\t{\t\t\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->result_array();\n\t\n\t}", "public function allCategories()\n {\n return Category::all();\n }", "static function get_category_by_id($category){\n\t\treturn self::$db->where('id',$category)->get('categories')->results();\n\t}", "protected function fijarAtributos(){\n \n return array(\"cod_categoria\",\"nombre\");\n \n }", "public function categoryAdditionals()\n {\n return $this->where('categories.id', $this->id)\n ->join('categories_additionals', 'categories.id', 'categories_additionals.category_son_id')\n ->join(DB::raw('categories as category_contains'), 'category_contains.id', 'categories_additionals.category_father_id')\n ->select([DB::raw('category_contains.id as id'), DB::raw('category_contains.name as name')])\n ->get();\n }", "public function get_all_academic_article_category()\n {\n echo $this->academic_article_model->get_all_academic_article_category();\n }", "function get_category_weight_all(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_attitude\n\t\t\t\tLEFT JOIN evs_database.evs_category\n\t\t\t\tON sft_ctg_id = ctg_id\n\t\t\t\tLEFT JOIN evs_database.evs_identification\n\t\t\t\tON ctw_ctg_id = idf_ctg_id\n\t\t\t\twhere sft_pos_id = ?\n\t\t\t\tgroup by ctg_category_detail_en\n\t\t\t\torder by sft_id ASC\";\n $query = $this->db->query($sql, array($this->sft_pos_id));\n\t\treturn $query;\n\n\t}", "function get_all()\n {\n $this->db->select('products.*, company_category.category');\n $this->db->join('company_category', 'company_category.id = products.cat_id');\n return $this->db->get($this->table)->result();\n }", "public function actionCategories()\n {\n // $model ->select('category')\n // ->from('product')\n // ->distinct()\n // ->all();\n \n // if ($model) {\n // foreach ($model as $row) {\n // print_r($row['category']);\n // }\n // }\n $query = product::find()->select('category')->distinct();\n foreach($query as $row)\n {\n print_r($row->category);\n }\n \n exit();\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return $model;\n\n }", "public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}", "public function getCategory()\n {\n }", "public function getByCategory($category_ID)\n {\n return DB::table('product_models')\n ->where('product_category_ID',$category_ID)\n ->get()\n ->all();\n }", "public function getCategories()\n {\n return Category::all();\n }", "function get_all_category_ids()\n {\n }", "function categories(){\n return $this->db->get($this->categorie)->result();\n }", "public function all_category(){\n $all = $this->db->get(\"tb_category_services\")->result();\n $response['status']=200;\n $response['error']=false;\n $response['category']=$all;\n return $response;\n }", "public function getCategories() : array;", "public static function getAll()\n\t{\n\t\t$categories = self::find()->asArray()->all(); // Добавить проверку если в prize is_limit = 0 and amount = 0\n\t\tforeach ($categories as $k => $category) {\n\t\t\t$categories[$k]['icon'] = self::getIconName($category['name']);\n\t\t}\n\t\treturn $categories;\n\t}", "public function getCategoryMeta($category_id=0) {\n \n $this->db->select(\"meta_title,meta_description,meta_keyword\")->from(\"category\")->where(array(\"category_id\"=>$category_id));\n return $this->db->get()->row_array();\n \n \n \n }", "protected function fetchCategory()\n {\n return $this->fetch([\n 'model' => Category::class,\n 'query' => function ($model) {\n return $model->orderBy('name', 'ASC');\n },\n ]);\n }", "public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }", "public function getAllCategoriesfromModel() \r\n { \r\n\t $categories=array();\r\n\t $categories = $this->controllercategories->getAllCategory();\r\n\t return $categories;\r\n\t}", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public static function getActiveCategories(){}", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "public function get(){\nreturn $this->db->query('select id, name, color from categories')->fetchAll();\n}", "public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }", "function get_product_category_attribute_terms($category_id) {\n $args = array(\n 'post_type' => 'product',\n 'post_status' => 'publish',\n 'ignore_sticky_posts' => 1,\n 'posts_per_page' => -1, // return all products (offset ignored with -1)\n 'tax_query' => array(\n array(\n 'taxonomy' => 'product_cat',\n 'field' => 'term_id', //This is optional, as it defaults to 'term_id'\n 'terms' => $category_id,\n 'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.\n ),\n array(\n 'taxonomy' => 'product_visibility',\n 'field' => 'slug',\n 'terms' => 'exclude-from-catalog', // Possibly 'exclude-from-search' too\n 'operator' => 'NOT IN'\n )\n )\n );\n $products_response = new WP_Query($args);\n $products = $products_response->posts;\n // Get product attribute details\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n // Initialize response array\n $category_attribute_terms = array();\n // For each product attribute\n foreach ($attribute_taxonomies as $attribute_taxonomy) {\n // Get all attribute options for each product in the category\n $options = array_map(function($product) use ($attribute_taxonomy) {\n $terms = get_the_terms($product->ID, 'pa_' . $attribute_taxonomy->attribute_name);\n return $terms ? $terms : [];\n }, $products);\n // Remove duplicate options\n $unique_options =\n array_values(\n array_unique(\n array_merge(...$options),\n SORT_REGULAR\n )\n );\n // Push attribute details and options to attribute terms array\n $category_attribute_terms[] = (object) [\n 'id' => $attribute_taxonomy->attribute_id,\n 'name' => $attribute_taxonomy->attribute_name,\n 'label' => $attribute_taxonomy->attribute_label,\n 'slug' => 'pa_' . $attribute_taxonomy->attribute_name,\n 'options' => $unique_options\n ];\n }\n return $category_attribute_terms;\n}", "public function getSkill_byCategory_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->getSkill_byCategory($category_id);\n\t\treturn $this->response($result);\t\t\t\n\t}", "private function filterDatabaseCategoryToArray()\n {\n\n $dbCategory = Category::all(['id', 'name']);\n //dd($dbTags);\n $category = [];\n foreach ($dbCategory as $t) {\n //I've placed the name as the key in case of additional checking\n $category[$t->name] = $t->id;\n }\n\n return $category;\n }", "public function get_category_item_specifics($categoryID)\n {\n\n // Create the request object.\n $request = new Types\\GetCategorySpecificsRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = $this->requester_credentials;\n\n /**\n * Check Item Specifics are Enabled\n */\n $this->CI->load->library('ebay_category_features', $categoryID);\n $mode = $this->ebay_category_features->get_ItemSpecificsMode();\n //var_dump($$mode);\n\n\n if ($categoryID && $mode !== 'Disabled') {\n $request->CategoryID = [$categoryID];\n $response = $this->trading_service->getCategorySpecifics($request);\n // Check errors\n $checkError = $this->get_response($response);\n if ($checkError != 0) {\n if (count($response->Recommendations)) {\n $name_value_arr = array();\n foreach ($response->Recommendations as $Recommendation) {\n foreach ($Recommendation->NameRecommendation as $NameRecommendation) {\n $values_arr = array();\n if ($NameRecommendation->ValidationRules->SelectionMode == 'SelectionOnly') {\n $values_arr['custom']['SelectionOnly'] = true;\n }\n\n if ($NameRecommendation->ValidationRules->MinValues >= 1) {\n /**\n * Required item specifics have * in Name of Specific\n */\n //$name = $NameRecommendation->Name . '<strong>*</strong>';\n $values_arr['custom']['MinValues'] = true;\n }\n\n /*\n |--------------------------------------------------------------------------\n | Finally Helped\n |--------------------------------------------------------------------------\n |http://prntscr.com/g5zzn5\n |https://stackoverflow.com/questions/5421426/php-xml-xpath-node-element-iteration-and-inserting-into-array\n */\n\n $name = $NameRecommendation->Name;\n\n foreach ($NameRecommendation->ValueRecommendation as $ValueRecommendation) {\n $values = (string)$ValueRecommendation->Value;\n array_push($values_arr, $values);\n //$converted_values = explode(\",\",$value);\n // echo print_r($converted_values);\n }\n $name_value_arr[$name] = $values_arr;\n }\n }\n\n //var_dump($name_value_arr);\n\n $browse = [];\n\n foreach ($name_value_arr as $key => $value) {\n $custom = $this->findKey($value, 'custom');\n $selection_only = $this->findKey($value, 'SelectionOnly');\n $min_values = $this->findKey($value, 'MinValues');\n\n // var_dump($custom);\n // var_dump($value);\n\n $key = ($min_values) ? $key . '<strong>*</strong>' : $key;\n unset($value['custom']);\n $browse[$key] = $value;\n }\n\n //var_dump($browse);\n return json_encode($browse);\n // return $browse;\n\n }\n }\n } else return false;\n }", "public function getCategory(){\n return $this->category;\n }", "public static function getAllCategories()\n {\n $return = (array) FrontendModel::get('database')->getRecords(\n 'SELECT c.id, c.title AS label, COUNT(c.id) AS total\n FROM menu_categories AS c\n INNER JOIN menu_alacarte AS i ON c.id = i.category_id AND c.language = i.language\n GROUP BY c.id\n ORDER BY c.sequence ASC',\n array(), 'id'\n );\n\n // loop items and unserialize\n foreach ($return as &$row) {\n if (isset($row['meta_data'])) {\n $row['meta_data'] = @unserialize($row['meta_data']);\n }\n }\n\n return $return;\n }", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }" ]
[ "0.71346986", "0.699043", "0.6918693", "0.67526865", "0.6470678", "0.64666885", "0.64005846", "0.6396792", "0.63554776", "0.63530624", "0.6315008", "0.6315008", "0.6312252", "0.6310146", "0.63075423", "0.63075423", "0.62949276", "0.6289476", "0.62828106", "0.6280502", "0.6231376", "0.6224013", "0.61826813", "0.61572844", "0.61431515", "0.61427355", "0.61420375", "0.613988", "0.61259365", "0.6124322", "0.6112535", "0.6102798", "0.6092334", "0.6079407", "0.6071473", "0.6069424", "0.6064014", "0.6045738", "0.6029179", "0.6025578", "0.60199195", "0.6019556", "0.6011485", "0.6010613", "0.5983631", "0.59822226", "0.5981515", "0.5981362", "0.5977596", "0.59763324", "0.59715855", "0.5969951", "0.5958135", "0.5957509", "0.5956871", "0.5953163", "0.59491736", "0.59455556", "0.594259", "0.5941356", "0.59388", "0.5938609", "0.59212685", "0.59185314", "0.59132814", "0.58998954", "0.58987737", "0.58944213", "0.5892689", "0.58906335", "0.5874538", "0.58681333", "0.58598924", "0.58528435", "0.58525926", "0.5847562", "0.58455837", "0.58397907", "0.5838579", "0.5832727", "0.5832727", "0.5832727", "0.5832727", "0.5832727", "0.5832727", "0.5832727", "0.5832727", "0.5832727", "0.583251", "0.58313096", "0.5829998", "0.5814687", "0.5794789", "0.5788765", "0.57863355", "0.57860094", "0.5785786", "0.57855934", "0.577695", "0.57752496" ]
0.67745936
3
This is the default 'index' action that is invoked when an action is not explicitly requested by users.
public function actionIndex() { $this->layout = 'main2'; $this->render('index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction() {\n\t\t$this->_notImplemented();\n\t}", "public function indexAction()\n\t{\n\t\t// do nothing\n }", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "public function indexAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n }", "public function actionIndex()\n\n {\n\n echo 'Index action has not used.';\n\n }", "protected function indexAction()\n {\n }", "public function indexAction(){}", "protected function indexAction() {}", "public function actionIndex() {}", "public function actionIndex() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function actionIndex()\n {}", "abstract public function actionIndex();", "public function action_index()\n\t{\n\t\t// figure out what action to do... if we're called directly\n\t\t// actions in this class are called from the Profile menu, though.\n\t}", "public function singleIndexAction() {}", "public function actionIndex()\n\t{\n\t\t// do stuff that's not the main content?\n\t}", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "public function actionIndex()\n {\n $this->render('index');\n }", "public function indexAction ()\n\t{\n\t\t// TODO Auto-generated ReportController::indexAction() default action\n\t}", "public function indexAction()\r\n {\r\n $this->_helper->viewRenderer->setNoRender();\r\n }", "public function actionIndex()\n\t{\n\t\t\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function indexAction()\n {\n $this->addAction();\n }", "public function actionIndex()\n {\n $this->view->render('index');\n }", "public function indexAction()\n\t{\n\t\t$this->_forward('view');\n\t}", "public function actionIndex()\n {\n \techo 'Permission Denied.';\n \texit;\n return $this->render('index');\n }", "public function indexAction() {\r\n }", "public function indexAction() {\n\t}", "public function indexAction() {\n\t}", "public function indexAction() \n\t{\n\t\t$this->_forward('view');\n\t}", "public function indexAction()\n {}", "public function indexAction() {\n $this->_forward('list');\n }", "abstract function indexAction();", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function actionIndex(){\r\r\n\t\t$this->render('index', array());\r\r\n\t}", "public function indexAction()\n {\n $this->_forward('view');\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction() \n {\n \t\n }", "public function actionIndex()\r\n {\r\n \treturn $this->render('index');\r\n }", "public function indexAction() {\n \n }", "public function actionIndex()\r\n {\r\n\t\treturn $this->render('index');\r\n }", "public function actionIndex()\n\t{\n\n\t\treturn $this->render(\"index\");\n\n\n\t}", "public function indexAction()\n {\n return array();\n }", "public function indexAction()\n {\n return array();\n }", "public function indexAction()\n {\n return array();\n }", "public function indexAction()\n {\n return array();\n }", "public function indexAction(){\t\t\n\t}", "public function indexAction ()\r\n {\r\n // TODO Auto-generated SearchController::indexAction() default action\r\n }", "public function indexAction() {\n\n\t}", "public function indexAction(){\r\n\t\t\t\r\n\t\t}", "public function indexAction()\n {\n return array(\n );\n }", "public function fullIndexAction() {}", "public function actionIndex() {\n\t\treturn $this->render('index');\n\t}", "public function indexAction ()\r\n {\r\n\r\n }", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function action_index()\n\t{\n\t}", "public function indexAction() {\n }", "public function indexAction() {\n }", "public function indexAction() {\n ;\n }", "public function indexAction() \n {\n\t\tif (!isset($this->view->flagFailedSearch)) {\n\t\t\t$this->view->flagFailedSearch = FALSE;\n\t\t}\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function indexAction() {\r\n \r\n }", "public function actionIndex()\n {\n return $this->render('/index');\n }", "public function actionIndex() {\n $this->actionTrenutniSpored();\n }", "public function indexAction() {\n\t\t$this->_initAction()\n\t\t\t->renderLayout();\n\t}", "public function indexAction()\n {\n // action body\n }", "public function indexAction() {\r\n\t\t// TODO Auto-generated FinanceController::indexAction() default action\r\n\t}", "public function indexAction()\n {\n// $this->view = 'index';\n }", "public function actionIndex()\n {\n\n }", "public function indexAction() : string\n {\n // Deal with the action and return a response.\n return \"index\";\n }", "public function actionIndex() {\n $this->assignLangue();\n $this->render('index');\n }", "public function action_index()\n {\n }", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function indexAction()\n {\n //for real application\n }", "public function indexAction() {\n $this->formAction();\n }", "public function indexAction() {\n $this->formAction();\n }", "public function actionIndex()\n {\n return $this->renderIndex();\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "function & DefaultIndexAction (&$controller)\n {\n\n parent::Action($controller);\n\n }", "public function actionIndex()\n {\n return $this->render('index');\n }" ]
[ "0.8293943", "0.8168631", "0.8140713", "0.8090627", "0.80711716", "0.7987024", "0.79757357", "0.7974839", "0.79171884", "0.79171884", "0.7823485", "0.7822019", "0.7822019", "0.7822019", "0.7822019", "0.7822019", "0.7822019", "0.7822019", "0.7822019", "0.7822019", "0.782184", "0.78169984", "0.78149027", "0.77822715", "0.7731675", "0.77295905", "0.7728761", "0.77034736", "0.7700334", "0.7692977", "0.768566", "0.7683193", "0.7683193", "0.7683193", "0.7683193", "0.76646096", "0.7654478", "0.76279837", "0.76220673", "0.762118", "0.7617956", "0.7617956", "0.76177526", "0.76158273", "0.7615379", "0.76152056", "0.7604526", "0.759643", "0.7594287", "0.75881827", "0.75881827", "0.75881827", "0.75881827", "0.7587136", "0.7582384", "0.75791824", "0.7567091", "0.7550933", "0.7544009", "0.7544009", "0.7544009", "0.7544009", "0.75376546", "0.7535755", "0.75275546", "0.75261796", "0.7503547", "0.7496501", "0.74946487", "0.7489646", "0.7484692", "0.74838126", "0.74739736", "0.74739736", "0.74724", "0.7463157", "0.74612176", "0.74561566", "0.7450681", "0.74484175", "0.7438961", "0.7426627", "0.74105656", "0.7408696", "0.740708", "0.7405853", "0.7401134", "0.7397352", "0.7397161", "0.73960215", "0.7378082", "0.7378082", "0.737401", "0.7371166", "0.7371166", "0.7371166", "0.7371166", "0.7371166", "0.7371166", "0.73704547", "0.73627317" ]
0.0
-1
Uses faker to ensure that the values are never duplicated.
public static function createModule($numberOfOpen, $numberOfPending, $numberOfClosed) { $faker = Faker::create(); $module = new Module; $module->name = $faker->word() . "_TestModule"; $module->description = $faker->sentence($nbWords = 10, $variableNbWords = true); // Saves to the database. $module->save(); // Adds 3 users to the module with 3 different roles. $usersToAdd = User::inRandomOrder()->where("global_role_id", 2)->get()->splice(0, 3); // Adds people to the module created. DB::table('module_user')->insertOrIgnore([ 'module_id' => $module->id, 'user_id' => $usersToAdd[0]->id, 'module_role_id' => ModuleRole::findOrFail(1)->id, ]); DB::table('module_user')->insertOrIgnore([ 'module_id' => $module->id, 'user_id' => $usersToAdd[1]->id, 'module_role_id' => ModuleRole::findOrFail(2)->id, ]); DB::table('module_user')->insertOrIgnore([ 'module_id' => $module->id, 'user_id' => $usersToAdd[2]->id, 'module_role_id' => ModuleRole::findOrFail(3)->id, ]); // Adds the courseworks to the module. for ($x = 0; $x < $numberOfOpen; $x++) ModelCreator::createOpenCoursework($module); for ($x = 0; $x < $numberOfPending; $x++) ModelCreator::createPendingCoursework($module); for ($x = 0; $x < $numberOfClosed; $x++) ModelCreator::createClosedCoursework($module); return $module; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGenerateMultipleNoDuplicateValues()\n {\n $registeredValues = [\n '1' => 1,\n '2' => 1,\n '3' => 1,\n ];\n $this->generator->registerValues($registeredValues);\n\n // Mock random number generator to return the first item twice, then return items two and three.\n $mockRandomNumberGenerator = $this->createPartialMock(\\stdClass::class, ['__invoke']);\n $mockRandomNumberGenerator->method('__invoke')\n ->withAnyParameters()\n ->will($this->onConsecutiveCalls(1,1,2,3));\n\n $this->generator->setRandomNumberGenerator($mockRandomNumberGenerator);\n\n $sample = iterator_to_array($this->generator->generateMultipleWithoutDuplicates(count($registeredValues)));\n $this->assertEquals(array_keys($registeredValues), $sample);\n }", "function faker()\n{\n $faker = Faker\\Factory::create();\n\n return $faker;\n}", "public function run(faker $faker)\n {\n for ($i=0; $i < 10 ; $i++) {\n $fish = new Random();\n $fish->name = $faker->name();\n $fish->price = $faker->randomFloat(2,100,500);\n $fish->description = $faker->paragraph(2);\n $fish->save();\n }\n\n }", "public function fake(Generator &$faker): object\n {\n return (object) [\n 'user_id' => random_int(1, Fabricator::getCount('users') ?: 10),\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'permitted' => (bool) random_int(0, 4),\n ];\n }", "public function run(Faker\\Generator $faker)\n {\n\n DB::table('users')->insert([\n 'last_name' => 'Admin',\n 'first_name' => 'Admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n ]);\n\n for ($i=2; $i < 50; $i++) {\n DB::table('users')->insert([\n 'last_name' => $faker->lastName,\n 'first_name' => $faker->firstName,\n 'email' => $faker->unique()->email,\n 'civility' => 'M',\n 'birth_date' => $faker->date,\n 'maiden_name' => $faker->lastName,\n 'native_city' => $faker->city,\n 'native_country' => $faker->country,\n 'nationality' => 'français',\n 'entry_date' => $faker->date,\n 'marital_status' => 'single',\n 'number_children' => $faker->randomNumber($nbDigits = 1, $strict = false),\n 'age_children' => $faker->randomNumber($nbDigits = 2, $strict = false),\n 'accomodation' => $faker->word,\n 'number_social_security' => $faker->randomDigit,\n 'number_cmu' => $faker->randomDigit,\n 'end_visit_date' => $faker->date,\n 'address' => $faker->address,\n 'postal_code' => $faker->postcode,\n 'city' => $faker->city,\n 'phone' => $faker->phoneNumber,\n 'cellphone' => $faker->phoneNumber,\n 'emergency_contact' => $faker->name,\n 'emergency_phone' => $faker->phoneNumber,\n\n 'hero' => $faker->name,\n 'experience_programming' => $faker->text($maxNbChars = 100),\n 'hack_story' => $faker->text($maxNbChars = 100),\n 'course' => $faker->word,\n 'super_power' => $faker->text($maxNbChars = 100),\n 'motivation' => $faker->text($maxNbChars = 100),\n\n 'leisure' => $faker->bs,\n\n 'availability' => $faker->word,\n 'constraints' => $faker->text($maxNbChars = 100),\n 'income' => $faker->word,\n\n 'codecademy_profile' => $faker->url,\n 'openclassroom_profile' => $faker->url,\n 'other_profile' => $faker->url,\n 'codecademy_badges' => $faker->randomNumber($nbDigits = 2, $strict = false),\n\n 'prescriber_contact' => $faker->name,\n 'prescriber_phone' => $faker->phoneNumber,\n\n 'pro_project' => $faker->bs,\n\n 'pole_emploi_registration' => 'yes',\n 'number_pole_emploi' => $faker->randomDigit,\n 'first_pole_emploi_registration' => $faker->date,\n 'pole_emploi_password' => $faker->password,\n 'last_pole_emploi_registration' => $faker->date,\n 'pole_emploi_registration_reason' => 'end of studies',\n 'pole_emploi_registration_duration' => $faker->randomDigit. ' mois',\n 'paid_by_pole_emploi' => 'yes',\n 'pole_emploi_allocation' => $faker->date,\n 'rsa' => 'yes',\n 'caf_number' => $faker->randomDigit,\n 'rqth' => 'no',\n 'handicapped_allocations' => 'no',\n 'transportation' => 'car',\n 'driving_license' => 'yes',\n 'free_transports_card' => 'yes',\n 'free_transports_card_validity' => $faker->date,\n\n 'password' => bcrypt('azerty'),\n ]);\n }\n\n\n DB::table('users')->insert([\n 'last_name' => 'Formateur',\n 'first_name' => 'Formateur',\n 'email' => '[email protected]',\n 'password' => bcrypt('azerty'),\n ]);\n\n DB::table('users')->insert([\n 'last_name' => 'Formateur2',\n 'first_name' => 'Formateur2',\n 'email' => '[email protected]',\n 'password' => bcrypt('azerty'),\n ]);\n }", "public function fake(Generator &$faker): array\n {\n return [\n 'name' => $faker->word,\n 'description' => $faker->sentence,\n ];\n }", "public function run(Faker $faker)\n {\n factory(\\App\\Company::class,30)->create();\n factory(\\App\\Company::class,30)->create([\n 'argumentation' => implode(\"\",$faker->sentences($nb = 3, $asText = false)),\n ]);\n }", "public function getFaker()\n {\n if (empty($this->faker))\n {\n $faker = Faker\\Factory::create();\n $faker->addProvider (new Faker\\Provider\\Base($faker));\n $faker->addProvider(new Faker\\Provider\\Lorem($faker));\n }\n \n return $this->faker = $faker;;\n }", "function faker() {\n static $faker = null;\n if (!$faker) {\n $faker = Faker\\Factory::create();\n }\n\n return $faker;\n }", "public function create(Faker $faker)\n {\n for ($randomItr=0; $randomItr < rand(5,10); $randomItr++) { \n $name = $faker->word();\n\n $random = Random::create([\n 'values' => $name,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ]);\n\n for ($breakdownItr=0; $breakdownItr < rand(5,10); $breakdownItr++) { \n $randomStr = Str::random(5);\n\n $breakdown = Breakdown::create([\n 'values' => $randomStr,\n 'random_id' => $random->id,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ]);\n\n }\n }\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 2; $i++) {\n DB::table('users')->insert([\n 'role_id' => '1',\n 'username' => $faker->username,\n 'password' => Hash::make('secret'),\n 'first_name' => $faker->firstName,\n 'middle_name' => $faker->lastName,\n 'last_name' => $faker->lastName,\n 'suffix' => rand(0, 1) === 1 ? $faker->suffix : null,\n 'gender' => rand(1, 2),\n 'birthday' => $faker->date,\n 'id_number' => $faker->ssn,\n 'office_id' => rand(1, 3),\n 'is_active' => true,\n 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now', $timezone = null),\n ]);\n }\n\n for($i = 0; $i < 10; $i++) {\n DB::table('users')->insert([\n 'role_id' => '2',\n 'username' => $faker->username,\n 'password' => Hash::make('secret'),\n 'first_name' => $faker->firstName,\n 'middle_name' => $faker->lastName,\n 'last_name' => $faker->lastName,\n 'suffix' => rand(0, 1) === 1 ? $faker->suffix : null,\n 'gender' => rand(1, 2),\n 'birthday' => $faker->date,\n 'id_number' => $faker->ssn,\n 'office_id' => rand(1, 3),\n 'is_active' => true,\n 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now', $timezone = null),\n ]);\n }\n\n for($i = 0; $i < 2; $i++) {\n DB::table('users')->insert([\n 'role_id' => '3',\n 'username' => $faker->username,\n 'password' => Hash::make('secret'),\n 'first_name' => $faker->firstName,\n 'middle_name' => $faker->lastName,\n 'last_name' => $faker->lastName,\n 'suffix' => rand(0, 1) === 1 ? $faker->suffix : null,\n 'gender' => rand(1, 2),\n 'birthday' => $faker->date,\n 'id_number' => $faker->ssn,\n 'office_id' => rand(1, 3),\n 'is_active' => true,\n 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now', $timezone = null),\n ]);\n }\n }", "public function run(Faker $faker)\n {\n for($i=1;$i<=24;$i++){\n DB::table('Accounts')->insert([\n 'NameID' => $i,\n 'Position' => null,\n 'Team' => null,\n 'Email' => $faker->unique()->safeEmail,\n 'Batch' => '2020B',\n 'Password' => 'P@$$w0rD',\n 'Gender' => 1,\n ]);\n }\n\n for($i=25;$i<=72;$i++){\n DB::table('Accounts')->insert([\n 'NameID' => $i,\n 'Position' => null,\n 'Team' => null,\n 'Email' => $faker->unique()->safeEmail,\n 'Batch' => '2020B',\n 'Password' => 'P@$$w0rD',\n 'Gender' => 2,\n ]);\n }\n }", "public function testGenerateMultipleDuplicateValues()\n {\n $registeredValue = new \\stdClass();\n $this->generator->registerValue($registeredValue);\n\n $values = iterator_to_array($this->generator->generateMultiple(10));\n\n $this->assertCount(10, $values);\n foreach ($values as $value)\n {\n $this->assertEquals($value, $registeredValue);\n }\n }", "public function run(Faker $faker)\n {\n $faker->addProvider(new Person($faker));\n\n $list = [];\n\n for ($i = 1; $i <= 15; $i++) {\n if (rand(0, 1) === 0) {\n $list[] = [\n 'name' => $faker->firstName('male'),\n 'surname' => $faker->lastName('male'),\n 'father_name' => $faker->middleName('male'),\n 'email' => $faker->unique()->safeEmail,\n 'password' => bcrypt('password'),\n 'group_id' => rand(1, 10)\n ];\n } else {\n $list[] = [\n 'name' => $faker->firstName('female'),\n 'surname' => $faker->lastName('female'),\n 'father_name' => $faker->middleName('female'),\n 'email' => $faker->unique()->safeEmail,\n 'password' => bcrypt('password'),\n 'group_id' => rand(1, 10)\n ];\n }\n }\n\n DB::table('users')->insert($list);\n }", "private function generateFakeUsers($numberOfUsers,\n $homeAddress,\n $emailAddress,\n $phoneNumber,\n $gender,\n $birthday,\n $photoUrl)\n\n\n {\n $faker = Faker::create();\n $fakeUsers = Array();\n /* Get an Array of photo urls if phto urls is checked */\n if ($photoUrl == 1) {\n $randomFemalePhotoUrl=$this->getPhotoUrlData('data/female.json');\n $randomMalePhotoUrl=$this->getPhotoUrlData('data/male.json');\n $randomNumAr=$this->getUniqNums(0,110,$numberOfUsers);\n }\n\n for ($i=0; $i<=$numberOfUsers-1; $i++) {\n $userGender=$this->getGender();\n if ($userGender == \"male\") {\n $fakeUsers[$i] = Array('FirstName' => $faker->firstNameMale);\n } else {\n $fakeUsers[$i] = Array('FirstName' => $faker->firstNameFemale);\n }\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('LastName' => $faker->lastName));\n if ($homeAddress == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('Address' => $faker->streetAddress.', '.$faker->city.', '.$faker->stateAbbr.', '.$faker->country));\n }\n if ($emailAddress == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('EmailAddress' => $faker->email));\n }\n if ($phoneNumber == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('PhoneNumber' => $faker->phoneNumber));\n }\n if ($gender == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('Gender' => $userGender));\n }\n if ($birthday == 1) {\n\t\t\t\t$fakeUsers[$i] = array_merge($fakeUsers[$i], Array('Birthday' => $faker->dateTimeThisCentury->format(\"Y-m-d\")));\n\t\t }\n if ($photoUrl == 1) {\n if ($userGender == \"male\") {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('PhotoUrl' => $randomMalePhotoUrl[$randomNumAr[$i]]));\n } else {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('PhotoUrl' => $randomFemalePhotoUrl[$randomNumAr[$i]]));\n }\n }\n }\n return($fakeUsers);\n }", "public function run()\n {\n $faker = Faker::create();\n //echo $faker->word();die();\n //var_dump($faker);die();\n\n for($i=0; $i<100; $i++) \n {\n Maker::create\n ([\n 'name' => $faker->unique()->company(),\n 'phone' => $faker->phoneNumber()\n ]);\n }\n }", "protected function setUpFaker()\n {\n $this->faker = $this->makeFaker('de_DE');\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 15; $i++) { \n\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'lastname' => $faker->lastName,\n 'email' => $faker->unique()->Email,\n 'email_verified_at' => now(),\n 'created_at' => now(),\n 'updated_at' => now(),\n 'password' => 'password',\n 'birth_date' => Carbon::create(rand(1950, 2005), rand(1, 12), rand(1, 30)),\n 'user_img_path' => 'defaults/default.png',\n ]);\n\n }\n\n }", "public function testRandomValuesAreVaried() {\n\t\t$this->Message = new Message();\n\t\tfor ($i = 1; $i <= 100; $i++) {\n\t\t\t$this->Message->create();\n\t\t\t$this->Message->saveField('name', 'Test ' . str_pad($i, 3, '0', STR_PAD_LEFT));\n\t\t}\n\t\t$count = $this->Message->find('count');\n\t\t$this->Message->randomize();\n\t\t$randomVals = $this->Message->find('all', array(\n\t\t\t'fields' => array('random', 'count(random) as counter'),\n\t\t\t'group' => 'random',\n\t\t\t'order' => 'count(random) DESC'\n\t\t));\n\t\t$randomVals = Set::combine($randomVals, '/Message/random', '/0/counter');\n\t\t$distinctValues = count($randomVals);\n\t\t$maxDuplicates = current($randomVals);\n\t\tif (!$this->assertTrue($distinctValues > $count * 0.7)) {\n\t\t\tdebug(\"30% overlap detected for random values - Many rows have the same random value.\\r\\n\" .\n\t\t\t\t\"Due to the nature of random number generation this test may fail - it should not fail consistently.\");\n\t\t}\n\t\tif (!$this->assertTrue($maxDuplicates <= 5)) {\n\t\t\tdebug(\"The most common random number is used for $maxDuplicates different rows.\\r\\n\" .\n\t\t\t\t\"Due to the nature of random number generation this test may fail - it should not fail consistently.\");\n\t\t}\n\t}", "public function run(Faker\\Generator $faker)\n {\n $groupCount = 10;\n\n //.. Seed ExpressionGroup\n for($x = 0; $x < $groupCount; $x++){\n DB::table('expression_groups')->insert([\n 'group_name' => $faker->sentence()\n ]);\n }\n\n //.. Seed Expression\n for($x = 0; $x < 200; $x++){\n DB::table('expressions')->insert([\n 'value' => $faker->sentence(),\n 'group_id' => $faker->numberBetween(1,$groupCount)\n ]);\n }\n\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 20 ; $i++) {\n DB::table('authors')->insert([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'description' => $faker->text($maxNbChars = 50),\n 'twitter_handle' => $faker->bothify('@ ??##'),\n 'created_at' => $faker->dateTime($max = 'now', $timezone = null),\n 'updated_at' => $faker->dateTime($max = 'now', $timezone = null),\n ]);\n }\n }", "public function testGenerateSlugIfItWillCreateUniqueSlug()\n {\n factory(Product::class)->create()->each(function ($product) {\n $expectedSlug = $product->slug . '-2';\n $returnedSlug = Product::generateSlug($product->title);\n\n $this->assertEquals($expectedSlug, $returnedSlug);\n });\n }", "public function definition()\n {\n return [\n 'name' => $this->faker->company,\n 'description' => $this->faker->text,\n 'email' => $this->faker->safeEmail,\n 'phone' => $this->faker->phoneNumber,\n 'website' => $this->faker->url,\n 'logo' => $this->faker->word,\n 'employees' => $this->faker->numberBetween(1, 100),\n 'has_branches' => $this->faker->boolean,\n 'has_insurance' => $this->faker->boolean,\n 'has_newsletter' => $this->faker->boolean,\n 'is_active' => $this->faker->boolean,\n 'founded' => $this->faker->date(),\n 'defunct' => $this->faker->date(),\n 'street_address' => $this->faker->streetAddress, \n 'address_info' => $this->faker->word,\n 'postal_code' => $this->faker->postcode,\n 'city' => $this->faker->city,\n 'state' => $this->faker->state,\n 'country' => $this->faker->country,\n 'lat' => $this->faker->latitude,\n 'lng' => $this->faker->longitude,\n 'facebook' => $this->faker->word,\n 'twitter' => $this->faker->word,\n 'instagram' => $this->faker->word,\n 'linkedin' => $this->faker->word,\n 'snapchat' => $this->faker->word,\n 'blog' => $this->faker->word,\n 'skype' => $this->faker->word,\n 'pinterest' => $this->faker->word,\n 'youtube' => $this->faker->word,\n 'status' => $this->faker->word,\n 'type' => $this->faker->word,\n ];\n }", "public function run(Faker $faker)\n {\n\n for ($i = 0; $i < 40 ; $i++) {\n\n //random Gender\n $genders = ['male','female'];\n $randomGender = $genders[array_rand($genders)];\n\n //random Age + date of birth\n $randomAge = rand(13,21);\n $randomDay = rand(1,28);\n $randomMonth = rand(1,12);\n $dateOfBirth = date('Y-m-d', strtotime(\"-$randomAge year -$randomDay days -$randomMonth months\"));\n //doublechecking with date_diff\n $randomAge = date_diff(date_create($dateOfBirth), date_create('now'))->y;\n\n //New Student\n $newStudent = new Student;\n\n $newStudent->name = $faker->firstName($randomGender);\n $newStudent->lastname = $faker->lastName($randomGender);\n $newStudent->gender = mb_substr($randomGender, 0, 1, \"UTF-8\");\n $newStudent->age = $randomAge;\n $newStudent->date_of_birth = $dateOfBirth;\n $newStudent->class = rand(1,5);\n\n $newStudent->save();\n }\n }", "public function run(Faker $faker)\n {\n //seleziono tutti gli autori\n $authors = Author::all();\n //ciclo tutti gli autori, per ogni autore inserisco\n\n foreach($authors as $author) {\n \n if($author->info == null) {\n $newAuthorInfo = new AuthorInfo;\n $newAuthorInfo->author_id;\n $newAuthorInfo->nationality = $faker->country();\n $newAuthorInfo->bio = $faker->paragraph(5, true);\n if(rand(0,1) == 1) {\n $newAuthorInfo->image = $faker->imageUrl(200, 300);\n $newAuthorInfo->alive = 1;\n }\n $newAuthorInfo->save();\n }\n }\n }", "public function run(Faker $faker)\n {\n for($i=1; $i<=5;$i++)\n {\n DB::table('users')->insert([\n 'id'=>$i,\n 'name_user' => $faker->name(),\n 'surname_user' => Str::random(10),\n 'email' => $faker->email(),\n 'password' => Hash::make('password'),\n 'country_user' => Str::random(16),\n 'fiscalCode_user' => Str::random(16),\n 'address_user' => $faker->address(),\n 'email_verified_at' => Carbon::now(),\n 'group_id' => rand(1,4),\n 'active' => 1,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n }\n \n\n }", "public function run(Faker $faker)\n {\n factory(\\App\\User::class,40)->create()->each(function($user) use ($faker){\n $user->profile()->create([\n 'firstname' => $faker->firstName,\n 'lastname' => $faker->lastName,\n 'phonenumber' => $faker->phoneNumber,\n 'hours' => rand(1,32),\n ]);\n });\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 100; $i++) {\n DB::table('authors')->insert([\n 'first' => $faker->firstName,\n 'last' => $faker->lastName\n ]);\n }\n\n }", "public static function likeUniqueSeeding(){\n for ($i=0;$i = 10000; $i++){\n try{\n Like::factory()->create([\n 'user_id' => User::pluck('id')->random(),\n 'post_id' => Post::pluck('id')->random(),\n 'vote_type' => 'up'\n ]);\n }\n catch(Exception $e){\n DatabaseSeeder::likeUniqueSeeding();\n }\n }\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 10; $i++) {\n $newProducer = new Producer;\n $newProducer->name = $faker->firstName;\n $newProducer->lastname = $faker->lastName;\n if(rand(0,1) == 1) {\n $newProducer->date_of_birth = $faker->date('Y-m-d', 'now');\n }\n if(rand(0,2) == 1) {\n $newProducer->biography = $faker->paragraph(4, true);\n }\n $newProducer->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 5; $i++) {\n DB::table('invoices')->insert([\n 'creator' => $faker->numberBetween(1, 5),\n 'user_id' => $faker->numberBetween(1, 5),\n 'approval' => null,\n 'issue_date' => $faker->dateTime('now'),\n 'completion_date' => $faker->dateTime('now +30 days'),\n 'description' => $faker->text($maxNbChars = 50),\n 'hours_value' => $faker->numberBetween(10, 200),\n 'hours_value_netto' => $faker->numberBetween(1000, 10000),\n 'hours_value_gross' => $faker->numberBetween(1000, 10000),\n 'hours_value_vat' => $faker->numberBetween(1000, 10000),\n 'fixed_price' => null,\n 'fixed_price_gross' => null,\n 'fixed_price_vat' => null,\n 'overtime_value' => $faker->numberBetween(1000, 10000),\n 'overtime_value_netto' => $faker->numberBetween(1000, 10000),\n 'overtime_value_gross' => $faker->numberBetween(1000, 10000),\n 'overtime_value_vat' => $faker->numberBetween(1000, 10000),\n 'is_accepted' => false,\n 'status' => $faker->numberBetween(0, 4),\n 'payment_date' => $faker->dateTimeBetween('now', '+30 days'),\n ]);\n }\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 20; $i++){\n $newGuest = new Guest();\n $newGuest->full_name = $faker->name();\n $newGuest->slug = Str::slug($newGuest->full_name, '-');\n $newGuest->save();\n }\n }", "public function definition()\n {\n return [\n 'contract_id' => $this->faker->word,\n 'company_id' => $this->faker->word,\n 'department_id' => $this->faker->word,\n 'joblevel_id' => $this->faker->word,\n 'jobtitle_id' => $this->faker->word,\n 'supervisor_id' => $this->faker->word,\n 'region_of_birth_id' => $this->faker->word,\n 'city_of_birth_id' => $this->faker->word,\n 'address' => $this->faker->text($this->faker->numberBetween(5, 255)),\n 'join_date' => $this->faker->date('Y-m-d'),\n 'employee_status' => $this->faker->lexify('?????'),\n 'code' => $this->faker->text($this->faker->numberBetween(5, 17)),\n 'full_name' => $this->faker->firstName,\n 'gender' => $this->faker->lexify('?????'),\n 'date_of_birth' => $this->faker->date('Y-m-d'),\n 'identity_number' => $this->faker->text($this->faker->numberBetween(5, 27)),\n 'identity_type' => $this->faker->lexify('?????'),\n 'marital_status' => $this->faker->lexify('?????'),\n 'email' => $this->faker->email,\n 'leave_balance' => $this->faker->numberBetween(0, 999),\n 'tax_group' => $this->faker->lexify('?????'),\n 'resign_date' => $this->faker->date('Y-m-d'),\n 'have_overtime_benefit' => $this->faker->boolean,\n 'risk_ratio' => $this->faker->lexify('?????'),\n 'profile_image' => $this->faker->text($this->faker->numberBetween(5, 255)),\n 'profile_size' => $this->faker->numberBetween(0, 999),\n 'salary_group_id' => $this->faker->word,\n 'shiftment_group_id' => $this->faker->word\n ];\n }", "public function testRegisterValue()\n {\n $values = [\n 123,\n '123',\n [1,2,3],\n new stdClass(),\n false,\n null\n ];\n\n // Mock random number generator to return 1,2,3,4\n $mockRandomNumberGenerator = $this->createPartialMock(\\stdClass::class, ['__invoke']);\n $mockRandomNumberGenerator->method('__invoke')\n ->withAnyParameters()\n ->will($this->onConsecutiveCalls(...range(1,count($values))));\n\n $this->generator->setRandomNumberGenerator($mockRandomNumberGenerator);\n\n foreach ($values as $value)\n {\n $this->generator->registerValue($value);\n }\n\n $sample = iterator_to_array($this->generator->generateMultipleWithoutDuplicates(count($values)));\n $this->assertEquals($values, $sample);\n }", "public function different_seed_generated_uuids_are_not_equal(): void\n {\n $this->assertNotSame(UUID::generate('seed')->toString(), UUID::generate('new')->toString());\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 10; $i++) {\n $seed = new User();\n $seed->email = $faker->freeEmail;\n $seed->password = $faker->password;\n $seed->first_name = $faker->firstName;\n $seed->last_name = $faker->lastName;\n $seed->date_of_birth = $faker->date;\n $seed->save();\n }\n }", "public function run(Faker $faker)\n {\n DB::table(\"users\")->insert([\n [\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail, //use real emails here\n 'email_verified_at' => now(),\n 'password' => Hash::make($faker->password()), // password\n ],\n [\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail, //use real emails here\n 'email_verified_at' => now(),\n 'password' => Hash::make($faker->password()), // password\n ],\n [\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail, //use real emails here\n 'email_verified_at' => now(),\n 'password' => Hash::make($faker->password()), // password\n ],\n ]);\n }", "public function testRandomPosts() {\n // remove all existing posts\n $all = Post::all();\n foreach ($all as $post) {\n $post->delete();\n }\n\n // create some Posts\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, TRUE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, TRUE);\n $posts[4] = $this->createPost(4, TRUE);\n $posts[5] = $this->createPost(5, TRUE);\n $posts[6] = $this->createPost(6, TRUE);\n\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // amount of posts should be equal to default value\n self::assertEquals(5, count($generated_posts));\n\n // ensure all Posts are from posts created\n $found_all = TRUE;\n foreach ($generated_posts as $generated_post) {\n $found = FALSE;\n foreach ($posts as $post) {\n if ($post->id == $generated_post->id) {\n $found = TRUE;\n break;\n }\n }\n if (!$found) {\n $found_all = FALSE;\n break;\n }\n }\n self::assertTrue($found_all, 'All posts exist in original array');\n\n // check for non-repeating\n $ids = [];\n foreach ($generated_posts as $post) {\n self::assertArrayNotHasKey($post->id, $ids, 'Post is not already present in the generated array');\n $ids[$post->id] = $post->id;\n }\n }", "public function provideValidReplacementIds()\n {\n return [\n [FakerReplacer::PREFIX.'firstname'], // original faker property\n [FakerReplacer::PREFIX.'lastname'], // original faker property\n ];\n }", "public function run(\\Faker\\Generator $faker)\n {\n DB::table('organizations')->insert([\n [\n // 1\n 'name' => 'Queen Inc.',\n 'ui_client_id' => 'fce73bc2-02da-47c1-a81d-6dd1ca27b58e',\n 'settings' => json_encode([\n 'locale' => [\n 'value' => 'pt-BR',\n 'final' => true\n ],\n ]),\n 'created_at' => now()\n ],\n [\n // 2\n 'name' => 'Free Inc.',\n 'ui_client_id' => '93e4dbdc-24ec-40c5-abc5-1f5fe5c49c82',\n 'settings' => null,\n 'created_at' => now()\n ],\n [\n // 3\n 'name' => 'Bad Company',\n 'ui_client_id' => 'c775807b-eeac-439d-b819-da827d559829',\n 'settings' => null,\n 'created_at' => now()\n ],\n ]);\n\n// $extraData = [];\n// foreach (range(0, 50) as $i) {\n// $extraData[] = [\n// 'name' => $faker->company\n// ];\n// }\n\n// DB::table('organizations')->insert($extraData);\n }", "public function definition()\n {\n return [\n 'unidade' => $this->faker->randomElement($array = array ('FFLCH','IFUSP','FAU')),\n 'numero_usp' => $this->faker->unique()->numberBetween(1000000, 9999999),\n 'name' => $this->faker->name,\n 'endereco' => $this->faker->streetAddress,\n 'complemento' => $this->faker->sentence($nbWords = 2, $variableNbWords = true),\n 'cidade' => $this->faker->sentence($nbWords = 1, $variableNbWords = true),\n 'estado' => $this->faker->sentence($nbWords = 1, $variableNbWords = true),\n 'cep' => $this->faker->numberBetween(1000000, 9999999),\n 'rg' => $this->faker->numberBetween(100000000, 999999999),\n 'cpf' => $this->faker->numberBetween(10000000000, 99999999999),\n 'data_nascimento' => $this->faker->date($format = 'Y-m-d', $max = 'now'),\n\n 'comercial' => $this->faker->numberBetween(10000000, 99999999),\n 'residencial' => $this->faker->numberBetween(10000000, 99999999),\n 'celular' => $this->faker->numberBetween(100000000, 999999999),\n 'e_mail' => $this->faker->unique()->safeEmail,\n\n 'banco' => $this->faker->company,\n 'agencia' => $this->faker->numberBetween(1000000, 9999999),\n 'conta_corrente' => $this->faker->unique()->numberBetween(1000000, 9999999),\n\n 'saldo' => $this->faker->numberBetween(0, 200)\n ];\n }", "function testGenRandom() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 21; $i++) { \n $invoice = new App\\Customer();\n $invoice->category = $faker->sentence;\n $invoice->w_kyat = rand(1, 5);\n $invoice->w_pae = rand(1, 15);\n $invoice->w_ywae = rand(1, 7);\n $invoice->loan = rand(100000, 500000);\n $invoice->name = $faker->name;\n $invoice->address = $faker->address;\n $invoice->user_id = 1;\n $invoice->save();\n }\n }", "public function testUniqueFields() {\n $account = $this->drupalCreateUser();\n\n $edit = ['mail' => '[email protected]', 'name' => $account->getAccountName()];\n $this->drupalGet('user/register');\n $this->submitForm($edit, 'Create new account');\n $this->assertSession()->pageTextContains(\"The username {$account->getAccountName()} is already taken.\");\n\n $edit = ['mail' => $account->getEmail(), 'name' => $this->randomString()];\n $this->drupalGet('user/register');\n $this->submitForm($edit, 'Create new account');\n $this->assertSession()->pageTextContains(\"The email address {$account->getEmail()} is already taken.\");\n }", "public function seed_generated_uuids_are_equal(): void\n {\n $this->assertSame(UUID::generate('seed')->toString(), UUID::generate('seed')->toString());\n }", "protected function createRandomUsers() {\n\n $faker = Faker\\Factory::create();\n\n $Equipos = Equipos::all(); \n\n for($i=0; $i < 4; $i++) {\n User::create([\n 'name' => $faker->firstName,\n 'puntaje' => rand(1,30),\n 'lastname' => $faker->lastName,\n 'nacimiento' => Carbon::now(),\n 'fecha_visita'=> Carbon::now(),\n 'email' => $faker->email,\n 'equipo_id' => $Equipos->random(1)->id,\n 'password' => Hash::make('12345678'), //Vital guardar la contraseña encriptada o no nos vamos a poder autenticar!\n ]); \n }\n }", "public function seed()\n {\n# $faker = \\Faker\\Factory::create();\n\n$fakerChampion = ['Chicago', 'Kansas'];\n# Use a loop to create 10 games\nfor ($i = 0; $i < 10; $i++) {\n\n$fakerPlayer = $fakerChampion[rand(0, 1)];\n$fakerComputer = $fakerChampion[rand(0, 1)];\n# or $fakerChampion[array_rand($fakerChampion)]; \n\nif ($fakerPlayer == $fakerComputer) {\n $winner = 1;\n} else {\n $winner = 2;\n}\n\n# Set up game/and data for table\n $game = [\n 'winner' => $winner,\n 'player' => $player,\n 'computer' => $computer,\n ];\n\n # Insert game\n $this->app->db()->insert('games', $game);\n}\n dump('It works! You invoked your seed command.');\n }", "public function randomQuestionWithSelfsameBag(): void\n {\n $unexpectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion1->id, $unexpectedQuestion2->id]);\n\n $this->assertFalse($questionsList->contains($questionsList));\n $this->assertEmpty($questionsList);\n }", "public function run()\n {\n $faker = Faker::create('App\\Meal');\n\n for($i = 1; $i <=5; $i++){\n\n DB::table('meals')->insert([\n 'title' => $faker->sentence(),\n 'description' =>implode($faker->paragraphs(1)),\n \n \n \n \n ]);\n }\n}", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for ($i=0;$i<99;$i++){\n $material = new Zlecprac();\n\n $material ->zlecenia_id = $faker->numberBetween(1-30);\n $material ->users_id = $faker->numberBetween(1-25);\n\n $material ->save();\n\n}\n }", "protected function generate()\n {\n\t\t$this->value = md5(uniqid(rand(), true));\n }", "public function run(Faker $faker)\n {\n $houses = House::all();\n\n foreach ($houses as $house) {\n $randNumb = rand(20, 40);\n for ($i = 0; $i < $randNumb; $i++) {\n $newMessage = new Message;\n $newMessage->house_id = $house->id;\n $newMessage->guest_name = $faker->name(null);\n $newMessage->email = $faker->freeEmail;\n $newMessage->message = $faker->paragraph(2, true);\n $newMessage->created_at = $faker->dateTimeBetween(\"-2 years\", \"now\", 'Europe/Paris');\n $newMessage->save();\n }\n }\n }", "public function provideValidReplacementNames()\n {\n return [\n ['firstname'], // original faker property\n ['lastname'], // original faker property\n ];\n }", "public function randomly_generated_uuids_are_not_equal(): void\n {\n $this->assertNotSame(UUID::generate(), UUID::generate());\n }", "public function run(Faker $faker)\n {\n $users = User::all();\n $users_arr = $users->toArray();\n $users = Count($users_arr);\n\n\n for ($i = 0; $i < $users; $i++){\n // for($j = 0; $j < $userCount; $j++ ){\n // $newRestaurant->user_id = $userCount[$j];\n // }\n\n $newRestaurant = new Restaurant ();\n $newRestaurant->nome = $faker->word();\n $nomeBeginner = $newRestaurant->nome;\n\n $nomePresente = Restaurant::where('nome',$nomeBeginner)->first();\n $cont = 1;\n while($nomePresente){\n $nomeBeginner = $nomeBeginner.'-'.$cont;\n $nomeBeginner = Restaurant::where('nome',$nomeBeginner)->first();\n $cont++;\n }\n $newRestaurant->nome = $nomeBeginner;\n\n $newRestaurant->indirizzo = $faker->streetAddress();\n $newRestaurant->immagine = \"'ristorante_storage\\fast-food-2029397_960_720.png'\";\n\n \n // $newRestaurant->immagine = Storage::put('ristorante_storage', $newRestaurant->immagine);\n\n $newRestaurant->slug = Str::slug($newRestaurant->nome);\n $newRestaurant->user_id = $i + 1;\n $existRestaurant = Restaurant::where('user_id',$newRestaurant->user_id)->first();\n if (!$existRestaurant) {\n $newRestaurant->save();\n\n }\n\n\n }\n }", "public function run()\n {\n $faker=Faker\\Factory::create('pl_PL');\n for($i=1;$i<=199;$i++)\n {\n\n DB::table('rooms')->insert([\n 'room_number'=>$faker->unique()->numberBetween(1,200),\n 'room_size'=>$faker->numberBetween(1,5),\n 'price'=>$faker->numberBetween(100,600),\n 'description'=>$faker->text(1000),\n 'tourist_object_id'=>$faker->numberBetween(1,20),\n\n\n ]);\n }\n}", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->value = random_int(1, 100000);\n\n $randomValue = md5((string)$this->value);\n\n $this->value1 = $randomValue . '_1';\n $this->value2 = $randomValue . '_2';\n $this->value3 = $randomValue . '_3';\n }", "public function customerDummyData($faker)\n {\n $gender = $faker->randomElement(['male', 'female']);\n\n $customerGroup = $this->customerGroupRepository->get()->random();\n\n return [\n 'first_name' => $faker->firstName($gender),\n 'last_name' => $faker->lastName,\n 'gender' => $gender,\n 'date_of_birth' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'email' => $faker->unique()->safeEmail(),\n 'phone' => $faker->e164PhoneNumber,\n 'password' => bcrypt('admin123'),\n 'customer_group_id' => $customerGroup->id,\n 'is_verified' => 1,\n 'remember_token' =>str_random(10)\n ];\n }", "public function testTitleMutator()\n {\n $data = [\n 'title' => strtolower($this->faker->sentence(rand(5, 10), $variableNbWords = true)),\n 'author' => strtolower($this->faker->name),\n ];\n\n $record = Book::create($data);\n\n if (ucfirst($data['title']) != $record->title || ucfirst($data['author']) != $record->author) {\n $this->assertTrue(false);\n }\n $this->assertTrue(true);\n }", "public function definition()\n {\n $sexes = ['male', 'female', 'other'];\n $randomKey = array_rand($sexes);\n return [\n 'name' => $this->faker->firstName(),\n 'surname' => $this->faker->lastName(),\n 'patronymic' => $this->faker->name().'ic',\n 'sex' => $sexes[$randomKey],\n 'salary' => rand(1, 1000),\n ];\n }", "public function test_generate_key_random()\n {\n $key1 = GuestToken::generate_key();\n $key2 = GuestToken::generate_key();\n $this->assertNotEquals($key1, $key2);\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 40; $i++){\n $newUser = new User();\n $newUser->name = $faker->name();\n $newUser->address = $faker->address();\n $newUser->city = $faker->city();\n $newUser->p_iva = $faker->numerify('###########');\n $newUser->image = $faker->imageUrl(640, 480);\n $newUser->email = $faker->freeEmail();\n $newUser->password = Hash::make('password');\n $newUser->save();\n\n }\n }", "private function getFaker() {\n $faker = \\Faker\\Factory::create('zh_CN'); // create a French faker\n dd(debug_backtrace());\n for ($i = 0; $i < 5; $i++) {\n echo mb_convert_encoding($faker->name, 'gbk'), \"\\n\";\n echo $faker->email, \"\\n\";\n }\n }", "public function run(Faker\\Generator $faker)\n {\n $wgro = App\\Market::whereSlug('wgro')->first();\n $lrh = App\\Market::whereSlug('lrh')->first();\n $elizowka = App\\Market::whereSlug('elizowka')->first();\n $agrohurt = App\\Market::whereSlug('agrohurt')->first();\n\n for($x = 0; $x <= 150; $x++) {\n $this->products[$faker->unique()->word] = [\n 'type' => $this->type[array_rand($this->type)],\n 'origin' => $this->origin[array_rand($this->origin)],\n \"package\" => $this->package[array_rand($this->package)],\n ];\n }\n\n foreach ($this->products as $name => $attrs) {\n\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_min\" => rand(1,20),\n \"price_max\" => rand(20,75),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($wgro->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($lrh->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($elizowka->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($agrohurt->id),\n ]);\n }\n }\n }", "public function definition()\n {\n $arr = [105, 106, 107];\n $rdm = $arr[array_rand($arr)];\n return [\n 'name' => $this->faker->name,\n 'nim' => '17'.$rdm.'12'.$this->faker->numberBetween(001, 999),\n 'password' => bcrypt('password'),\n 'faculty' => 'Ilmu Komputer',\n 'major' => $this->faker->numberBetween(1, 3),\n 'generation' => $this->faker->numberBetween(2017, 2020),\n 'gender' => $this->faker->numberBetween(1, 2),\n 'birth' => $this->faker->address,\n 'dob' => $this->faker->date('Y-m-d', 'now'),\n 'phone' => $this->faker->e164PhoneNumber ,\n 'email' => $this->faker->email,\n ];\n }", "public function definition()\n {\n return [\n 'name' => $this->faker->name,\n 'lastname' => $this->faker->lastName,\n 'code' => $this->faker->unique()->numberBetween($min=1, $max=$this->count*2),\n 'email' => $this->faker->unique()->safeEmail,\n 'second_lastname' => $this->faker->lastName,\n 'rfc' => $this->faker->ean13,\n 'curp' => $this->faker->ean13,\n 'nss' => $this->faker->randomNumber($nbDigits =null , $strict = false),\n 'cat_gender_id' => $this->faker->numberBetween($min = 1, $max = 2),\n 'cat_country_id' => 142,\n 'cat_state_id' => $this->faker->numberBetween($min=2427, $max=2459),\n 'cat_marital_status_id' => $this->faker->numberBetween($min=1, $max=6),\n 'cat_educational_level_id' => $this->faker->numberBetween($min=1, $max=6),\n 'skills' => \"{'comer', 'dormir'}\",\n 'telephone' => $this->faker->tollFreePhoneNumber,\n 'cellphone' => $this->faker->tollFreePhoneNumber,\n 'emergency_telephone' => $this->faker->phoneNumber,\n 'birthdate' => $this->faker->date($format = 'Y-m-d', $max = 'now')\n\n ];\n }", "public function testDuplicate()\n {\n $this->duplicate(\n array_merge(\n $this->_createData1(),\n $this->_createData2()\n ),\n array_merge(\n $this->_expectData1(),\n $this->_expectData2()\n )\n );\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 10; $i++) {\n $newPost = new Post();\n $newPost->title = $faker->sentence(3);\n $newPost->content = $faker->text(500);\n\n $userCount = Count(User::all()->toArray());\n $newPost->user_id = rand(1,$userCount);\n\n $slug = Str::slug($newPost->title);\n $slugIniziale = $slug;\n \n $postPresente = Post::where('slug',$slug)->first();\n\n $contatore = 1;\n\n while($postPresente) {\n $slug = $slugIniziale . '-' . $contatore;\n $postPresente = Post::where('slug',$slug)->first();\n $contatore++;\n }\n\n $newPost->slug = $slug;\n\n\n $newPost->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 10; $i++) {\n\n // ---prendo prima di tutto un utente casuale da associare---\n $user = User::inRandomOrder()->first();\n // ---prendo prima di tutto un utente casuale da associare---\n\n $tag = new Tag;\n $tag->user_id = $user->id;\n $tag->name = $faker->word();\n\n $tag->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n for($i=0; $i<=3; $i++){\n\n $Trabajador=Academic_Title::create([\n 'titles'=> $faker-> bs,\n 'university'=> $faker-> catchPhrase, \n ]);\n }\n}", "public function run(Faker $faker)\n {\n $userNameList=[\n 'Mario',\n 'Francesca',\n 'Andrea',\n 'Marcello',\n 'Alessandro'\n ];\n $userSurnameList=[\n 'Rossi',\n 'Bianchi',\n 'Fabbri',\n 'Marcellini',\n 'Settembrini'\n ];\n $userImgList=[\n 'https://www.w3schools.com/howto/img_avatar.png',\n 'https://www.w3schools.com/howto/img_avatar2.png',\n 'https://www.w3schools.com/w3images/avatar2.png',\n 'https://teachingandlearning.schulich.yorku.ca/wp-content/uploads/2019/10/avatar6.png',\n 'https://storage.jewheart.com/content/users/avatars/3595/avatar_3595_500.jpg?1558627791'\n ];\n $userDateList=[\n '1989/12/06',\n '1990/03/26',\n '1992/06/29',\n '1996/04/30',\n '1998/03/14'\n ];\n $userEmailList=[\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]'\n ];\n for($i=0; $i<5; $i++){\n $user=new User();\n $user->name = $userNameList[$i];\n $user->surname = $userSurnameList[$i];\n $user->img_path = $userImgList[$i];\n $user->date_of_birth = $userDateList[$i];\n $user->email = $userEmailList[$i];\n $user->password = Hash::make($faker->password());\n $user->save();\n }\n \n $userObj=new User();\n $userObj->name = 'Andrea';\n $userObj->surname = 'Calzolari';\n $userObj->img_path = 'https://www.focusedu.org/wp-content/uploads/2018/12/circled-user-male-skin-type-1-2.png';\n $userObj->date_of_birth = '1980/02/02';\n $userObj->email = '[email protected]';\n $userObj->password = '$2y$10$GucQhVApDtnNFGjO9snLUeXMQo1NwU6p60V6Xs6DHAJzD.MBpqyZW';// ciccio1234\n $userObj->save();\n \n $serviceList=[\n 'Wi-fi',\n 'Riscaldamento',\n 'Condizionatore',\n 'Piscina',\n 'Parcheggio auto',\n 'Animali ammessi',\n 'Tv',\n 'Giardino',\n 'Cucina',\n 'Lavanderia',\n 'Cassaforte',\n 'Palestra',\n 'Vista mare',\n 'Centro città',\n 'Frigo'\n ];\n $serviceIDList=[];\n \n foreach($serviceList as $service){\n $serviceObject= new Service();\n $serviceObject->title=$service;\n $serviceObject->save();\n $serviceIDList[]=$serviceObject->id;\n }\n\n $apartmentDescriptionList=[\n \"Un appartamento spazioso e luminoso facente parte di un Monastero di fine '800 restaurato con corpo e anima in ogni sua parte per donare ai nostri ospiti eleganza, pulizia e comfort. Con accesso indipendente ed ubicato a 30 mt dalla centralissima e storica Via Roma troverete, in casa e nei dintorni, tutto ciò che serve per vivere una vacanza in comodità e relax!\n Welcome to Palermo!!\n Lo spazio\n Ciuri ri Puisia è un pied à terre, con arredi moderni e vintage che si fondono in una miscela di elegante raffinatezza. Da pochissimo restaurato tramite meticoloso ripristino delle bellezze architettoniche originarie e ben rifinito, è così composto: living room con zona cucina dotata di ogni comfort (tavolo/console, 4 sedie, piastra ad induzione, frigorifero con freezer, macchinetta del caffè, tostapane, forno a microonde con grill, ferro da stiro e asse da stiro, TV 4K con NetFlix) e zona relax (sofa/letto matrimoniale) con smart TV di fronte; una camera patronale molto grande con letto matrimoniale (160x190), smart TV 4K 43” con NetFilx, condizionatore silenziosissimo, armadio; bagno con vaso e bidet, phon e kit cortesia,\n (bagnoschiuma e doccia shampoo), doccia extra-size con cromoterapia. L’appartamento è inoltre provvisto di Wi-Fi ILLIMITATO con FIBRA. Possibilità di parcheggio free nei vicoli adiacenti o parking custodito h24 a pagamento. L’appartamento si trova al pianterreno ed, essendo storico è praticamente insonorizzato perchè dotato di mura di circa 1,20 metri di spessore; ha inoltre accesso indipendente con self check-in (a qualsiasi orario) e con doppio portone.\n Per chi arriva con l'auto:\n L'appartamento si trova sul perimetro della Zona Traffico Limitato, attiva dal lunedì al venerdì dalle ore 8.00 alle ore 20.00 ma, con i miei consigli, sarà possibile arrivare a 50 metri dall'appartamento, senza dover acquistare il pass giornaliero.\n E' possibile parcheggiare l'automobile in un parcheggio libero non custodito a 150 mt dall'appartamento, se c'è disponibilità, oppure sono presenti parcheggi privati a pochi metri al costo di 10/15 euro al giorno circa (la tariffa può cambiare).\",\n \"Piccolo monolocale appena ristrutturato al quarto piano (senza ascensore) nel cuore della zona Liberty di Milano, a due passi dalla fermata di Porta Venezia M1. Comodo divano letto, TV, WiFi, doccia ed aria condizionata.\n L'appartamento è situato al quarto piano SENZA ascensore.\n Altre cose da tenere a mente\n Usiamo un sistema di self check in direttamente presso l'abitazione. Vi invieremo un link per effettuare il check in on line (da fare TASSATIVAMENTE entro le 19 del giorno precedente l'arrivo) e riceverete le istruzioni circa 24 ore prima dell'arrivo.\",\n \"La casa è situata in un podere adiacente ai parchi nazionali delle colline metallifere. A solo 1 Km dal paese di Montieri si affaccia su una vallata di boschi che comprende parte del senese. Il silenzio della natura circonda l'abitazione.\n Lo spazio\n L'alloggio è composto da 3 piani: al piano superiore c'è una camera con un letto matrimoniale e uno singolo; al piano centrale c'è una camera con letto a castello e il bagno; al piano inferiore c'è la cucina e la zona giorno. Terrazzo privato.\n Accesso per gli ospiti\n Gli ospiti sono liberi di girare in tutto il podere. A loro disposizione piscina con lettini e ombrelloni, e pergola toscana con vista panoramica.\",\n \"Ca Beo (URB120), casa 5 locali 300 m2 su 2 piani. Arredamento curato e accogliente: soggiorno con camino e TV. Uscita sulla terrazza. 1 camera con 1 letto doppio. Sala da pranzo con tavolo da pranzo. Cucina (forno, lavastoviglie, 5 fuochi, congelatore) con...\n Lo spazio\n ... tavolo da pranzo. Uscita sulla terrazza. Bagno/WC. Piano superiore: (scala senza ringhiera) 2 camere, ogni camera con 1 letto doppio e climatizzazione. Bagno/WC, doccia/WC. Riscaldamento a gas. Pavimenti in parquet. 2 terrazze coperta. Mobili da terrazza, sedie a sdraio. Bella vista panoramica sulla campagna. A disposizione: lavatrice, ferro da stiro. Internet (Wireless LAN [WLAN], gratis). Prego notare: casa per non fumatori. Il corrimano della galleria è alto 85 cm.\n \n I servizi aggiuntivi (opzionali) possono essere soggetti a costi extra pagabili in loco. Vi preghiamo di leggere la sezione “regole della casa” per i dettagli.\n Non esitate a contattarci in caso di domande. Grazie.\n Casa Ca Beo, piacevole, rustica, indipendente. A 5 km dal centro di Urbino, a 45 km dal centro di San Marino, posizione elevata, a 45 km dal mare, immerso nel verde. Per uso privato: terreno 4'000 m2 con piante e alberi, prato. Accesso 300 m di strada (strada non asfaltata). Box. Negozio 5 km, supermercato 5 km, spiaggia sabbiosa Fano 45 km, piscina 8 km. Il proprietario non accetta gruppi di giovani.\n Lo Short lets di Luigi Proietti, è un loft (una ex stalla) adibita a locazione turistica breve, non imprenditoriale.\n A Roma ma in piena campagna nei pressi della via Aurelia, dista soli 20 Km da San Pietro; 15 dal mare; 30 dall'Aeroporto di Fiumicino; 25 da Cerveteri; 58 dal porto di Civitavecchia; 28 dai laghi; 5 dall' Oasi Lipu di Castel Di Guido; 10 dal GRA.\n Parcheggio e giardino privato, lavatrice, Wfi, Tv.\n Lo spazio\n Immersa nella quiete della campagna romana, all'interno di una azienda agricola, il loft rappresenta un'autentica domus anghelos, uno spazio paradisiaco che si affaccia sopra un boschetto. Le ampie finestre lasciano penetrare il verde e l'azzurro circostanti. All'interno, un ampio salone è predisposto per la zona pranzo, relax e due zone letto.\n All'esterno è possibile mangiare nella veranda o nel giardino, in parte ombrato da alberi da fico.\n Accesso per gli ospiti\n Gli ospiti potranno accedere in ogni parte della casa e visitare l'azienda agricola. Per coloro che hanno particolari problemi di allergia, facciamo presente che nell'azienda agricola sono presenti diversi animali, compresi cani e gatti.\",\n \"Questa è una grande stanza privata luminosa in appartamento condivisa con altre 2. La casa è in posizione facile per andare a Venezia, c'è la fermata dell'autobus a 50 metri per andare a Venezia in 5 minuti e gli autobus vanno in un giorno e tutta la notte. La casa è ben collegata alla stazione ferroviaria e all'aeroporto. cucina e un grande bagno, comodo bagno con wc, doccia e bidet. Vengono forniti il bagnoschiuma, lo shampoo e il sapone. C'è un secondo bagno in cui c'è una lavatrice.\n Lo spazio\n Stanza situata a Mestre , a due minuti dalla fermata dell'autobus per Venezia, a un quarto d'ora dalla stazione dei treni. Vicina a supermercati e discount\n Questo appartamento è ben posizionato e si trova al terzo piano. Il mio appartamento è situato in un quartiere tranquillo con un accesso facile e veloce a Venezia. Asciugamani ed elementi essenziali sono forniti. Le camere sono grandi, pulite e confortevoli e possono ospitare comodamente 2 persone. Il mio appartamento è a 15 minuti di distanza in autobus da Venezia. La fermata dell'autobus è in Corso del popolo che è la strada principale e un minuto a piedi dall'appartamento.\",\n \"L'appartamento indipendente al piano terra della villa con piscina, è ad uso esclusivo dei clienti. Può ospitare un unico gruppo familiare o di amici alla volta.\n Incastonata nel verde dei Monti Cimini, consente di raggiungere facilmente i sentieri per gli amanti del trekking e della Mountain-bike. Situata a solo 1 km da Bagnaia, caratteristico paesino medioevale di Viterbo, gode di un ottima posizione anche per chi vuole visitare Villa Lante, Palazzo Farnese, il Parco dei Mostri, lago di Vico..\n Lo spazio\n Di fronte l’appartamento c’è il giardino ad uso esclusivo degli ospiti, in oltre i clienti potranno muoversi liberamente per l’intero podere condividendo gli spazi con la famiglia. Potranno godere della vista mozzafiato dei Monti che coronano il podere, osservare gli animali rispettando i loro spazi e il loro benessere, potranno accedere alla piscina e utilizzare il barbecue e le attrezzature messe a disposizione.\n Accesso per gli ospiti\n I clienti saranno dotati delle chiavi per poter entrare ed uscire liberamente dal cancello della proprietà e per accedere all’appartamento.\n Altre cose da tenere a mente\n Di fronte all’ingresso della villa partono vari sentieri nel bosco per gli amanti del trekking o della mountain-bike. È possibile anche praticare il bird watching o avvistare altri esemplari di fauna selvatica. A due chilometri gli appassionati della storia e delle bellezze architettoniche potranno visitare la famosa Villa Lante e il giardino delle Peonie più grande d’Europa.\",\n \"L’appartamento è confortevole, accogliente, per 2 persone.Ogni singolo oggetto d’arredo è stato scelto con cura ed è completo di tutto l’occorrente: lenzuola, asciugamani, stoviglie, ecc.ecc.\n E’ inserito nel suggestivo contesto di uno stabile vecchia Milano costruito nel 1900, ed è posizionato idealmente, così da avere silenzio e tranquillità.\n Sotto casa ci sono molti negozi utili e un supermercato Carrefour.\n Mezzi pubblici di superficie e metro sono a 2 minuti a piedi.\",\n \"Appartamento elegante e signorile, appena ristrutturato, situato nella prestigiosa Piazza di Trevi. E' dotato di un lussuoso salone, una comoda camera da letto, una cucina abitabile e un bagno: tutti gli spazi sono arredati da rivestimenti con oltre un secolo di storia. Dispone di copertura gratuita di wi-fi e di AC, tv satellitare ed ogni comfort.\n Lo spazio\n The apartment is located on the second floor without elevator of a stucco building on Trevi Square, has a sumptuous double bedroom and an elegant lounge overlooking the Fountain.\n The bedroom has a comfortable double bed, in the living room you can use a double sofa bed with 18cm mattress and a single sleeping area.\n The kitchen is equipped with an induction hob and any utensil, including a Nespresso machine for an Italian coffee.\n The bathroom, tiled with antique tiles, features bathroom amenities, a hairdryer and a hydromassage shower.\",\n \"Villa Alba, casa 4 locali 130 m2 su 2 piani. Arredamento confortevole e antico: sala da pranzo grande, aperta con TV (satellite). Uscita sulla veranda. 1 camera con 2 letti. Cucina aperta (4 punti cottura, forno, forno a microonde). Doccia/bidè/WC. Piano s...\n Lo spazio\n ...uperiore: 1 camera con 1 letto doppio (160 cm, lunghezza 190 cm). 1 camera con 1 letto doppio (160 cm, lunghezza 190 cm). Bagno/bidè/WC. Barbecue. Vista panoramica sulla campagna. A disposizione: lavatrice, seggiolone, letto per bambini. Internet (Wireless LAN [WLAN], gratis). Adatto alle famiglie.\n \n I servizi aggiuntivi (opzionali) possono essere soggetti a costi extra pagabili in loco. Vi preghiamo di leggere la sezione “regole della casa” per i dettagli.\n Non esitate a contattarci in caso di domande. Grazie.\n La casa, completamente ristrutturata da un ex fienile, è situata nelle colline del Chianti a breve distanza da San Gimignano, famosa per le sue torri medievali. Villa Alba, indipendente. A 3 km dal centro di San Gimignano, a 31 km dal centro di Volterra, a 45 km dal centro di Siena, posizione tranquilla, soleggiata, immerso nel verde. Per uso privato: giardino 500 m2 (recintato), piscina (11 x 6 m, profondità 140 cm, 14.05.-08.10.). Doccia esterna, mobili da giardino, barbecue. Accesso fino alla casa (800 m strada non asfaltata). Parcheggio nella proprietà. Supermercato 3 km, ristorante 3 km. Campo da golf (18 buche) 22 km. Attrazioni nelle vicinanze: Certaldo 12 km, Colle Val d'Elsa 17 km, Monteriggioni 29 km, Castellina in Chianti 36 km, Radda in Chianti, Greve in Chianti 44 km, Firenze 56 km.\",\n \"Incantevole e spazioso appartamento che ospita 2 persone con grande agio ed è dotato di ogni tipo di comfort, tra cui un ampio terrazzo arredato e un posto auto coperto assegnato. L'alloggio è ubicato in posizione esclusiva: trovandosi in una strada secondaria che interseca C.so San Maurizio, offre infatti la possibilità di soggiornare in un'oasi di tranquillità, ma al tempo stesso di essere a soli 250 metri dalla centralissima P.za Vittorio Veneto, da cui poter esplorare comodamente la città.\n Lo spazio\n L'alloggio di 85 mq si trova al primo piano di uno stabile con ascensore ed è composto come segue:\n - Ampia area living di 50mq dotata di TV e zona pranzo di 20 mq. L'angolo cottura è attrezzato con piano cottura a gas, frigorifero, congelatore, lavastoviglie, moka, bollitore elettrico, tostapane, spremiagrumi, forno tradizionale combinato con microonde\n - Camera da letto con letto matrimoniale, guardaroba e ventilatore a soffitto\n - Toilette con wc, bidet e doccia in muratura\n - Terrazzo di 20mq dotato di copertura retrattile e attrezzato con tavolino, divanetto e due poltrone\n Disponibile un posto auto assegnato in cortile, coperto da tettoia.\n Ulteriori servizi a disposizione degli ospiti: WIFI ILLIMITATO, riscaldamento autonomo con caldaia, lavatrice, asciugatrice, zanzariere, stendino, ferro e asse da stiro.\n \n Asciugamani e biancheria letto inclusi (con cambi facoltativi a pagamento).\n N.B. In caso di soggiorni lunghi (superiori ai 30 giorni) la biancheria verrà ritirata ogni massimo 15 giorni dall'impresa di pulizia.\n Una volta ritirata l'ospite potrà scegliere:\n -di utilizzare la propria;\n -la sostituzione, in questo caso c'è un costo di 15€ per un set matrimoniale, per ogni ulteriore set 8€.\",\n \"Il Rifugio del Marinaio è un appartamento nel centro storico di Bari, situato a pochi metri dalla movida e dai principali punti di interesse come Piazza Mercantile, Piazza Ferrarese, il Lungomare di Bari e la Basilica di San Nicola. Si trova a circa 2 km dalla spiaggia Pane e Pomodoro. La casa è dotata di una camera da letto, soggiorno, bagno e cucina. Dispone di TV schermo piatto, aria condizionata e balcone.\",\n \"Podere Casidote, casa 6 locali 115 m2 su 2 piani. Luminoso, arredamento accogliente: 1 camera con 1 letto doppio. Uscita sul giardino. 2 camere, ogni camera con 2 letti. Uscita sul giardino. 1 camera con 1 letto. Uscita sul giardino. Cucina abitabile (forn...\n Lo spazio\n ...ello a gas, 4 fuochi, bollitore elettrico) con tavolo da pranzo. Uscita sulla terrazza. Bagno/bidè/WC, doccia/bidè/WC. Riscaldamento a gas. Piano superiore: cucina abitabile (lavastoviglie, fornello a gas, 4 fuochi, bollitore elettrico, macchina del caffè elettrica) con camino e tavolo da pranzo. Uscita sulla terrazza. Doccia/bidè/WC. Riscaldamento a gas. 2 terrazze coperta, patio. Barbecue, sedie a sdraio, ripostiglio. Vista panoramica. A disposizione: lavatrice, letto per bambini. Prego notare: appartamento per non fumatori. 2 animali/cani permessi.\n \n I servizi aggiuntivi (opzionali) possono essere soggetti a costi extra pagabili in loco. Vi preghiamo di leggere la sezione “regole della casa” per i dettagli.\n Non esitate a contattarci in caso di domande. Grazie.\n Casa di campagna Podere Casidote, indipendente, circondata da prati e campi. A 3 km dal centro di Montieri, a 20 km dal centro di Massa Marittima, in collina, a 40 km dal mare. Per uso privato: terreno incolto 3'000 m2 con fiori e alberi. Accesso (800 m strada non asfaltata). Parcheggio nella proprietà. Negozio 3 km, spiaggia sabbiosa Follonica 40 km, lago balneabile Accesa 30 km. Sentieri per passeggiate vicino alla casa 10 m. Attrazioni nelle vicinanze: Giardino dei Suoni 11 km.\",\n \"Una piccola casa,arredata interamente in legno naturale,con un letto matrimoniale e un letto a castello ,camino e forno a legna . Un giardino attrezzato con barbeque , lettini e divani con accesso privato al lago.\n Lo spazio\n Una casa con giardino privato e recintato attrezzato con barbeque e lettini da cui si può accedere al lago per fare i bagni. Arredata in stile naturale , ha una camera con un letto matrimoniale e 2 originali letti a castello costruiti sopra . In sala un divano che può diventare un comodo letto.Cucina attrezzata , camino e forno a legna. CIR 09704-CNI-00019\n Accesso per gli ospiti\n Comodo parcheggio privato gratuito.\",\n \"Piccolo monolocale appena ristrutturato al quarto piano (senza ascensore) nel cuore della zona Liberty di Milano, a due passi dalla fermata di Porta Venezia M1. Comodo divano letto, TV, WiFi, doccia ed aria condizionata.\n Lo spazio\n L'appartamento è situato al quarto piano SENZA ascensore.\n Altre cose da tenere a mente\n Usiamo un sistema di self check in direttamente presso l'abitazione. Vi invieremo un link per effettuare il check in on line (da fare TASSATIVAMENTE entro le 19 del giorno precedente l'arrivo) e riceverete le istruzioni circa 24 ore prima dell'arrivo.\",\n \"Questo ampio bilocale offre tutte le comodità che servono alle famiglie che viaggiano. Un letto matrimoniale e due divani trasformabili in letto, offrono fino a 6 posti letto. La casa è dotata di biancheria, asciugamani, stoviglie, elettrodomestici, per garantire il massimo comfort agli ospiti. L’appartamento è situato a 15 minuti a piedi dalla centralissima Piazza Statuto e Stazione Porta Susa ed a 3 minuti dal Parco della Pellerina. Comoda alla Metropolitana ed alle linee dei mezzi 13 e 71.\n Lo spazio\n L’alloggio è costituito da un disimpegno all’ingresso, un soggiorno con angolo cucina, tavolo per sei persone, divano letto e tv; una seconda camera completa di letto matrimoniale, armadio guardaroba e secondo divano letto; un bagno completo di finestra, lavabo, doccia, WC e bidet. Sono presenti tutti gli elettrodomestici principali come lavatrice, forno a microonde, macchina caffè Nespresso, piano cottura a induzione con cappa aspirante. Posate, piatti, pentole, asciugamani, lenzuola, coperte, etc..., completano la dotazione di questo appartamento.\",\n \"Appartamento nuovo, confortevole, in una villa signorile con giardino panoramico. Composto da un ampio e luminoso soggiorno living con angolo cottura, da una spaziosa camera da letto matrimoniale e da un bagno con finestra. Si affaccia sul terrazzo panoramico e sul giardino privato. È possibile attrezzare altri due posti letto per bambini o uno per adulti. Raggiungibile soltanto in auto, a 5 minuti da Ivrea e dall’autostrada per Torino, Aosta e Milano. È dotato di antifurto e di posto auto.\n Lo spazio\n L'alloggio è ben arredato e dispone di tutti i servizi necessari. La sua caratteristica è quella di essere indipendente, in un luogo tranquillo e di poter usufruire di spazi esterni (portico, giardino) che renderanno il soggiorno piacevole e rilassante. È possibile attrezzare altri due posti letto per bambini in soggiorno o uno per adulti. Nella camera si può aggiungere un lettino per bambini piccoli. L'alloggio è adatto a persone singole, coppie, famiglie, per vacanza o per soggiorni di lavoro.\n Altre cose da tenere a mente\n La posizione permette di utilizzare la permanenza sia per godere di alcuni giorni di riposo e di svago, sia di una pausa durante un viaggio lungo senza allontanarsi dalle vie di comunicazione, vista la comodità di accesso all'autostrada per Aosta, Milano, Torino o Genova. Nel paese, a pochi minuti dall'appartamento, si trova il Castello di Parella, magnifica residenza magnificamente restaurata e circondata da un parco e da interessanti botteghe. Nel circondario si potrà inoltre scoprire un territorio ricco di aspetti geologici- naturalistici e di storia quali il parco del Gran Paradiso e le dimore Sabaude.\n Informazioni su questo spazio\n Véritable nid douillet, tout a été pensé pour votre confort. Un lieu cosy, aménagé par Marie avec des matériaux naturels et bruts. La salle de bain séparée permet détente et relaxation. La terrasse vous permet de profiter d'un bon moment avec votre lecture préférée, de prendre votre petit-déjeuner ou de passer une bonne soirée à la douceur du brasero.\n Lo spazio\n Le plaisir de la cabane avec tout le confort et la chaleur du foyer.\n Accesso per gli ospiti\n Un parking est à votre disposition à 30 m de la cabane. Vous aurez aussi la possibilité si vous le désirez de ranger vos vélos au garage .\",\n \"Il loft Quadrilatero si compone di un grande open space, disegnato in stile moderno e industriale da un importante architetto italiano. Si accede ad esso attraverso un ingresso di ringhiera verde e tipico delle antiche case torinesi. (L’androne di accesso è pulito, ma a differenza della facciata, non restaurato. Non fatevi spaventare!!). L’intero appartamento riceve un sacco di luce solare grazie alla sua doppia esposizione ed è molto accogliente di notte.\n La cucina è perfettamente equipaggiata con tutto ció che serve per cucinare.\n La camera da letto principale è composta da un letto tondo comodissimo (diametro 2 metri), una cabina armadio molto spaziosa ed un vecchio pianoforte che vi invitiamo a suonare (ma solo dalle 9 del mattino alle 22 della sera). La camera da letto è divisa dal resto della casa da una pesante tenda, in tutto identica a quelle dei palcoscenici teatrali.\n L’altra camera da letto è composta da un divano letto matrimoniale ed ha la sua propria porta, cosa che consente maggiore privacy. (NB questa camera dá direttamente sulla strada e nei fine settimana si possono sentire le chiacchiere delle persone che passeggiano per il quartiere. Nel caso abbiate problemi ad addormentarvi vi invitiamo ad utilizzare il futón posto nell’open space o a tenere in considerazione questo fatto al momento della prenotazione)\n Esiste anche la possibilitá di accedere ad un piccolo solaio equipaggiato di una chaise long. È l’ideale se volete concedervi un po’ di relax o per leggere un libro. Puó accedervi solo una persona alla volta ed ha un’altezza di solo un metro, per cui attenti alla testa!!\n Repubblica1bis Luxury Apartment è un elegante appartamento situato nella famosa piazza della Repubblica, nel pieno centro storico di Torino. Il palazzo fu progettato nel ‘700 dal famoso architetto Filippo Juvarra.\n Da qui è possibile raggiungere comodamente a piedi tutte le maggiori attrazioni della città. L'appartamento è stato finemente ristrutturato, ripristinando i soffitti a cassettone originali e mixando un arredamento contemporaneo accostato a pezzi di antiquariato.\n Lo spazio\n L'alloggio, la cui superficie è di 150 mq, è stato recentemente ristrutturato esaltando i particolari d'epoca, ed è situato al terzo piano, raggiungibile anche tramite ascensore. L'alloggio dispone di un ingresso, 2 ampie camere da letto matrimoniali, 2 bagni (uno con doccia e uno con vasca), una cucina, uno splendido salone con camino di 45 mq, con divano letto matrimoniale. Nel caso ci fossero bambini piccoli, potranno essere forniti i lettini su richiesta.\n Gli ospiti potranno usufruire di connessione internet Wi-Fi in ogni stanza. Verranno fornite lenzuola e 3 asciugamani (doccia, lavabo, bidet) per ciascun ospite. La cucina nuova è completamente attrezzata con forno, lavastoviglie, stoviglie, pentole e macchinetta del caffè Nespresso. E’ presente l’aria condizionata in ogni stanza. Inoltre, sono disponibili una lavatrice, asse e ferro da stiro e stendibiancheria. E' presente una TV nel salone.\n Casa Ada è un appartamento luminoso, fresco e accogliente situato in una tranquilla zona residenziale nella parte alta di Lecco, ai piedi del Resegone. Ideale per chi ricerca il contatto con la natura, pur restando in un contesto urbano. Dalla casa partono sentieri adatti a famiglie e a chi ama la montagna e gli spazi aperti. La casa, appena rinnovata, è anche una soluzione ottimale per lavoratori a distanza, in remote working, in cerca di pace e di una fuga dalla città\n Lo spazio\n L'appartamento si trova al secondo piano di una piccola palazzina con ascensore. E' composto da un soggiorno con due poltrone letto adatte a ragazzi (stile tatami), Smart TV con Netflix e DVD, stereo CD, desk per pc, wi-fi, una cucina completamente equipaggiata, una camera matrimoniale con balcone (o su richiesta con due letti singoli) un bagno con ampia doccia e angolo lavanderia.\n Per famiglie con bimbi piccoli è disponibile un lettino da campeggio e un seggiolone.\n L'appartamento è completo di dotazione biancheria letto e bagno.\n Per gli ospiti che arrivano in auto è possibile parcheggiare liberamente sotto casa o nel garage privato\",\n \"La stanza è sita in un ampio appartamento a sua volta ubicato in uno storico palazzo del dopoguerra: centralissimo. Lo spazio Una stanza finemente arredata, che ho attrezzato in risposta alle esigenze che io stesso, a seguito dei miei numerosi viaggi,ho riscontrato.\n Accesso per gli ospiti\n Gli ospiti possono usufruire, oltre che della loro stanza, anche di tutti i servizi disponibili in casa, incluso il bagno condiviso con me e con gli altri ospiti.\n Altre cose da tenere a mente\n La mia casa è una risorsa e al contempo una grande opportunità per chi la sceglie, sarò lieto di assistere i miei ospiti al meglio!\n Non dovrebbe nemmeno essere specificato, ma lo faccio per chiarezza: LGBT benvenuti a casa mia!\n Le zone comuni dell’appartamento sono sorvegliate da telecamere per la reciproca tutela e sicurezza.\",\n \"Nuovissimo accogliente bilocale di 65 mq con doppio balcone, perfetto per 2 persone, situato al 1° piano di uno stabile con ascensore.\n Lo spazio\n SONO CONSENTITI SOGGIORNI DI MEDIA/LUNGA DURATA CON CONTRATTO DI LOCAZIONE TURISTICA O TRANSITORIO FINO A 1 ANNO\n \n Lo spazio interno è così organizzato:\n - SOGGIORNO con smart TV, divano eventualmente utilizzabile come terzo posto letto e da segnalare in fase di prenotazione, tavolo da pranzo;\n - CUCINA con frigorifero, congelatore, lavastoviglie, forno tradizionale, microonde, bollitore elettrico e moka. Piccolo balcone;\n - CAMERA DA LETTO con letto matrimoniale, guardaroba, TV e ampio terrazzo;\n - BAGNO con bidet e box doccia.\n \n Ulteriori servizi a disposizione degli ospiti: WIFI, A/C con split in soggiorno, riscaldamento, lavatrice, ferro e asse da stiro.\",\n \"Una piccola casa,arredata interamente in legno naturale,con un letto matrimoniale e un letto a castello ,camino e forno a legna . Un giardino attrezzato con barbeque , lettini e divani con accesso privato al lago.\n Lo spazio\n Una casa con giardino privato e recintato attrezzato con barbeque e lettini da cui si può accedere al lago per fare i bagni. Arredata in stile naturale , ha una camera con un letto matrimoniale e 2 originali letti a castello costruiti sopra . In sala un divano che può diventare un comodo letto.Cucina attrezzata , camino e forno a legna. CIR 09704-CNI-00019\n Accesso per gli ospiti\n Comodo parcheggio privato gratuito.\",\n \"Splendido appartamento situato nel cuore del centro storico di Palermo, può ospitare fino a 4 persone ed è composto da cucina, living spazioso con divano letto matrimoniale , camera da letto matrimoniale e due bagni con doccia. Arredamento moderno, connessione wi-fi, TV LED 32, finestre insonorizzate, riscaldamento, frigo, cucina e bagno attrezzati, biancheria da letto e da bagno. L'appartamento si trova al primo piano, ASCENSORE.\n Lo spazio\n L'appartamento si trova al centro storico della città, posizione unica per vivere al meglio Palermo. A pochi passi si trova il mercato di Ballarò dove è possibile comprare pesce, semenze e spezie, frutta e verdura fresca ma anche provare il tipico street food palermitano! Di giorno sarà impossibile non perdersi nelle vie antiche di Palermo e ammirare le meraviglie che la città nasconde! Il tourist information è a pochi passi dalla proprietà se volete organizzare qualche gita fuori porta! Inoltre la stazione dei treni e degli autobus è a pochi passi dall'appartamento!\n Accesso per gli ospiti\n Gli ospiti avranno accesso all'intera proprietà.\",\n\n ];\n $apartmentAddressList=[\n \"Via Roma 261, Palermo, PA\",\n \"Via Antonio Mongitore, 4, 90134 Palermo PA\",\n \"Via Schiavo Michele, 90134 Palermo PA\",\n \"Via Aleardo Aleardi, 78, 30172 Venezia VE\",\n \"Via Cappuccina, 30172 Venezia VE\",\n \"Via Goffredo Mameli, 20129 Milano MI\",\n \"Via Marcona, 20129 Milano MI\",\n \"Via Gallia, 00183 Roma RM\",\n \"Via Iberia, 16, 00183 Roma RM\",\n \"Piazza Epiro, 15-11, 00183 Roma RM\",\n \"Via Pietro Ravanas, 70123 Bari BA\",\n \"Via Principe Amedeo, 70122 Bari BA\",\n \"Via Giovanni Bovio, 38, 70123 Bari BA\",\n \"Via Angelo Inganni, 40, 20147 Milano MI\",\n \"Corso Vercelli, 22, 20145 Milano MI\",\n \"V.le Berengario, 15, 20149 Milano MI\",\n \"Rio Terà dei Pensieri, 328, 30135 Venezia VE\",\n \"Calle Larga dei Bari, 1223, 30135 Venezia VE\",\n \"Corte Coppo, 4346/a, 30124 Venezia VE\",\n \"Viale Regina Margherita, 316, 00161 Roma RM\",\n ];\n $apartmentTitleList=[\n \"Attico sul mare a Palermo\",\n \"La Casa di Davide\",\n \"Podere Rachele - Casa Ghiandaia\",\n \"Casa Das Areias\",\n \"G&G - Green Garden\",\n \"Lunattico 48 Central Milano\",\n \"The Milky House Milan\",\n \"Suite Sweet Dreams\",\n \"Villa Prada\",\n \"Incantevole appartamento nel cuore di Roma\",\n \"Il Rifugio del Marinaio\",\n \"Casa Momom, con ampio patio\",\n \"Casetta con fantastica vista lago!\",\n \"Moderno zona corso Como\",\n \"Appartamento Lontano dal Caos\",\n \"Soggiorna nel cuore di Milano\",\n \"Venice Vacation House\",\n \"The Greek Venetian Studio\",\n \"Ca' Milla: La Magia di Venezia\",\n \"Trevi Sweet Suite\",\n\n ];\n $apartmentImgList=[\n 'https://images.pexels.com/photos/2111768/pexels-photo-2111768.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/1450363/pexels-photo-1450363.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/276554/pexels-photo-276554.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/6775268/pexels-photo-6775268.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/2850347/pexels-photo-2850347.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/6077368/pexels-photo-6077368.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/4846461/pexels-photo-4846461.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/1668860/pexels-photo-1668860.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/6527069/pexels-photo-6527069.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/3038552/pexels-photo-3038552.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/208736/pexels-photo-208736.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/4846461/pexels-photo-4846461.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/65225/boat-house-cottage-waters-lake-65225.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/7511693/pexels-photo-7511693.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/7227621/pexels-photo-7227621.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/1571459/pexels-photo-1571459.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n 'https://images.pexels.com/photos/7746589/pexels-photo-7746589.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/2724748/pexels-photo-2724748.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/8134848/pexels-photo-8134848.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n 'https://images.pexels.com/photos/6585598/pexels-photo-6585598.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/2506990/pexels-photo-2506990.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n ];\n $apartmentLongitudeList=[\n 13.36286,\n 13.35764,\n 13.36067,\n 12.24017,\n 12.23751,\n 9.21315,\n 9.20954,\n 12.50376,\n 12.50551,\n 12.50379,\n 16.85847,\n 16.86127,\n 16.85889,\n 9.12581,\n 9.16122,\n 9.15169,\n 12.31737,\n 12.32566,\n 12.33525,\n 12.51171\n ];\n $apartmentLatitudeList=[\n 38.11847,\n 38.11074,\n 38.11062,\n 45.48717,\n 45.48524,\n 45.46365,\n 45.46405,\n 41.88171,\n 41.87964,\n 41.87915,\n 41.12193,\n 41.12250,\n 41.12291,\n 45.45146,\n 45.46650,\n 45.47914,\n 45.43600,\n 45.44107,\n 45.43510,\n 41.90916\n ];\n \n for($x=0; $x<17; $x++){\n $apartment = new Apartment();\n $apartment->user_id=rand(1,5);\n $apartment->description=$apartmentDescriptionList[$x];\n $apartment->sponsorActive=false;\n $apartment->rooms_num=rand(5,8);\n $apartment->beds_num=rand(1,3);\n $apartment->bath_num=rand(1,2);\n $apartment->meters_size=rand(80,500);\n $apartment->address=$apartmentAddressList[$x];\n $apartment->title=$apartmentTitleList[$x];\n $apartment->visible=true;\n $apartment->img_path=$apartmentImgList[$x];\n $apartment->price_night=rand(80,200);\n $apartment->longitude=$apartmentLongitudeList[$x];\n $apartment->latitude=$apartmentLatitudeList[$x];\n\n $randServiceKeys = array_rand($serviceIDList, 10);\n $service1=$serviceIDList[$randServiceKeys[0]];\n $service2=$serviceIDList[$randServiceKeys[1]];\n $service3=$serviceIDList[$randServiceKeys[2]];\n $service4=$serviceIDList[$randServiceKeys[3]];\n $service5=$serviceIDList[$randServiceKeys[4]];\n $service6=$serviceIDList[$randServiceKeys[5]];\n $service7=$serviceIDList[$randServiceKeys[6]];\n $service8=$serviceIDList[$randServiceKeys[7]];\n $service9=$serviceIDList[$randServiceKeys[8]];\n $service10=$serviceIDList[$randServiceKeys[9]];\n\n $apartment->save();\n\n $apartment->service()->attach($service1);\n $apartment->service()->attach($service2);\n $apartment->service()->attach($service3);\n $apartment->service()->attach($service4);\n $apartment->service()->attach($service5);\n $apartment->service()->attach($service6);\n $apartment->service()->attach($service7);\n $apartment->service()->attach($service8);\n $apartment->service()->attach($service9);\n $apartment->service()->attach($service10);\n }\n\n for($z=17; $z<20; $z++){\n $apartment = new Apartment();\n $apartment->user_id=6;\n $apartment->description=$apartmentDescriptionList[$z];\n $apartment->rooms_num=rand(5,8);\n $apartment->beds_num=rand(1,3);\n $apartment->bath_num=rand(1,2);\n $apartment->meters_size=rand(80,500);\n $apartment->address=$apartmentAddressList[$z];\n $apartment->title=$apartmentTitleList[$z];\n $apartment->visible=true;\n $apartment->img_path=$apartmentImgList[$z];\n $apartment->price_night=rand(80,200);\n $apartment->longitude=$apartmentLongitudeList[$z];\n $apartment->latitude=$apartmentLatitudeList[$z];\n\n $randServiceKeys = array_rand($serviceIDList, 10);\n $service1=$serviceIDList[$randServiceKeys[0]];\n $service2=$serviceIDList[$randServiceKeys[1]];\n $service3=$serviceIDList[$randServiceKeys[2]];\n $service4=$serviceIDList[$randServiceKeys[3]];\n $service5=$serviceIDList[$randServiceKeys[4]];\n $service6=$serviceIDList[$randServiceKeys[5]];\n $service7=$serviceIDList[$randServiceKeys[6]];\n $service8=$serviceIDList[$randServiceKeys[7]];\n $service9=$serviceIDList[$randServiceKeys[8]];\n $service10=$serviceIDList[$randServiceKeys[9]];\n\n $apartment->save();\n\n $apartment->service()->attach($service1);\n $apartment->service()->attach($service2);\n $apartment->service()->attach($service3);\n $apartment->service()->attach($service4);\n $apartment->service()->attach($service5);\n $apartment->service()->attach($service6);\n $apartment->service()->attach($service7);\n $apartment->service()->attach($service8);\n $apartment->service()->attach($service9);\n $apartment->service()->attach($service10);\n }\n\n $messagesNameList=[\n 'Marco',\n 'Sebastian',\n 'Mariapia',\n 'Gianluca',\n 'Gianluigi'\n ];\n\n\n\n $messagesMailList=[\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n ];\n $messagesTextList=[\n \"Salve! Vorrei delle informazioni su questo appartamento, come la posso contattare?\",\n \"Salve, gradirei avere informazioni in merito al suo meraviglioso appartamento! Mi piace molto la Scandinavia e non vedo l'ora di passare lì le mie vacanze\",\n \"Buongiorno, volevo chiederLe, l'appartamento ha il riscaldamento autonomo o centralizzato?\",\n \"Ciao, volevo chiederle se l'appartamento è disponibile per Pasqua, grazie in anticipo\",\n \"Buonasera, per curiosità chi dovrebbe pagare i costi di riparazione in caso di danni?\"\n ];\n\n for($y=0; $y<5; $y++){\n $message=new Message();\n $message->apartment_id=rand(18,19);\n $message->full_name=$messagesNameList[$y];\n $message->email=$messagesMailList[$y];\n $message->text=$messagesTextList[$y];\n $message->save();\n }\n\n $sponsorNameList=[\n 'Bronzo',\n 'Argento',\n 'Oro',\n ];\n $sponsorPriceList=[\n 2.99,\n 5.99,\n 9.99,\n ];\n $sponsorHourList=[\n 24,\n 72,\n 144,\n ];\n for($r=0;$r<3;$r++){\n $sponsor=new Sponsor();\n $sponsor->name=$sponsorNameList[$r];\n $sponsor->hours=$sponsorHourList[$r];\n $sponsor->cost=$sponsorPriceList[$r];\n $sponsor->save();\n }\n\n $arrayApaID = [2,4,9,13,14];\n for($s=0;$s<count($arrayApaID);$s++){\n\n $apa_id = $arrayApaID[$s];\n $payment=new Payment();\n $payment->apartment_id = $apa_id;\n $apartment = Apartment::find($apa_id);\n $apartment->sponsorActive = true; \n $apartment->save();\n\n $payment->sponsor_id=rand(1,3);\n $payment->status=true;\n $payment->expire_date='2999/12/31';\n $payment->total=Sponsor::find($payment->sponsor_id)->cost;\n $payment->save();\n };\n\n for($a=0;$a<13;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->save();\n }\n for($a=0;$a<5;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-14 08:00:00\";\n $statistic->save();\n }\n for($a=0;$a<10;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-15 23:00:00\";\n $statistic->save();\n }\n for($a=0;$a<15;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-16 12:00:00\";\n $statistic->save();\n }\n for($a=0;$a<11;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-17 12:00:00\";\n $statistic->save();\n }\n for($a=0;$a<6;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-18 12:00:00\";\n $statistic->save();\n }\n }", "public function testExample()\n {\n\n $attributes = [\n 'name' => $this->faker->name,\n 'email' => $this->faker->email,\n 'password' => $this->faker->password,\n ];\n\n\n\n $this->assertTrue(true);\n }", "public function __invoke()\n {\n $faker = Factory::create();\n $genders = User::GENDERS;\n $gender = $faker->randomElement($genders);\n\n return [\n 'email' => $faker->email,\n 'password' => $faker->password,\n 'name' => $faker->name($gender),\n 'gender' => $gender,\n 'dateOfBirth' => $faker->dateTimeBetween('-100 years', '-18 years')->format('Y-m-d'),\n 'lat' => $faker->latitude,\n 'lng' => $faker->longitude\n ];\n }", "public function run()\n {\n\n $faker=Faker\\Factory::create('es_VE');\n// 'nombre'=>$faker->name,\n\n // $this->call(UsersTableSeeder::class);\n for ($i=0; $i < 100; $i++) {\n\n DB::table('telefonos')->insert([\n 'numero' => $faker->phoneNumber ,\n 'descripcion' =>'casa',\n 'empleados_id' => $faker->numberBetween($min=1,$max=9),\n\n//numberBetween($min = 1000, $max = 9000)\n\n ]);\n\n\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /////////\n /*\n for ($i=0; $i < 100; $i++) {\n\n DB::table('empleados')->insert([\n 'nombre' => $faker->firstNameMale ,\n 'apellidos' => $faker->lastName.' '.$faker->lastName,\n 'sexo' => 'M',\n 'direccion' => $faker->direccion,\n 'empleados_id' => $faker->numberBetween($min=1,$max=9),\n 'areas_id' => $faker->numberBetween($min=102,$max=209), //102 -209\n 'cargos_id' =>$faker->numberBetween($min=1,$max=108),\n//numberBetween($min = 1000, $max = 9000)\n\n ]);\n\n\n }\n\n */\n\n }", "public function __construct()\n {\n $this->faker = $this->withFaker();\n }", "public function definition()\n {\n\n\n return [\n 'creator_id' => User::inRandomOrder()->first()->id,\n 'first_name' => $this->faker->firstName,\n 'last_name' => $this->faker->lastName,\n 'email' => $this->faker->email,\n 'phone' => $this->faker->phoneNumber\n ];\n }", "public function definition()\n {\n return [\n 'name_role' => $this->faker->firstName,\n 'all' => rand(0,1),\n 'home' => rand(0,1),\n 'products' => rand(0,1),\n 'orders' => rand(0,1),\n 'employees' => rand(0,1),\n ];\n }", "public function definition()\r\n {\r\n $country_ids = Country::pluck('id');\r\n $city_ids = City::pluck('id');\r\n return [\r\n 'country_id' => $this->faker->randomElement($country_ids),\r\n 'city_id' => $this->faker->randomElement($city_ids),\r\n 'first_name' => $this->faker->firstName,\r\n 'last_name' => $this->faker->lastName,\r\n 'email' => $this->faker->email,\r\n 'password' => $this->faker->password,\r\n 'mobile' => $this->faker->e164PhoneNumber,\r\n 'email_verified' => $this->faker->randomElement(['0', '1']),\r\n 'created_at' => $this->faker->dateTimeBetween('-6 week', '-5 week'),\r\n\r\n ];\r\n }", "public function test_treatments_can_get_all_by_name_true()\n {\n $this->seed();\n $user = User::where('email', '=', '[email protected]')->first();\n $token = JWTAuth::fromUser($user);\n $number = rand(2,6);\n Treatment::factory()\n ->count(3)\n ->for($user)\n ->create();\n $name = Str::random(10);\n Treatment::factory()->for($user)->create(['title'=> $name]);\n $response = $this->json('GET','/api/treatments?token='.$token.'&name='.$name);\n\n $response->assertStatus(200)->assertJsonCount(1, 'data');\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $data = [];\n for ($i = 0; $i < 100; $i++) {\n $data[] = [\n 'email' => $faker->email,\n 'password' => password_hash($faker->password, PASSWORD_DEFAULT),\n 'name' => $faker->name,\n 'is_verified' => $faker->boolean(),\n\n 'phone' => $faker->optional(0.9)->phoneNumber,\n 'photo_url' => $faker->imageUrl(),\n 'hobbies' => $faker->words(3, true),\n 'passion' => $faker->optional()->words(1, true),\n 'fav_quote' => $faker->optional()->sentence(6, true),\n 'fav_quote_author' => $faker->optional()->name,\n\n 'whatsapp' => $faker->optional(0.9)->phoneNumber,\n 'facebook' => $faker->optional(0.7)->userName,\n 'twitter' => $faker->optional(0.5)->userName,\n 'linkedin' => $faker->optional(0.3)->url,\n 'instagram' => $faker->optional(0.6)->userName,\n 'snapchat' => $faker->optional(0.5)->userName,\n 'website' => $faker->optional(0.4)->url,\n 'blog' => $faker->optional(0.4)->url,\n\n 'created_at' => $faker->dateTimeBetween(\"-2 years\", \"-1 year\")->format('Y-m-d H:i:s'),\n 'updated_at' => rand(0, 2) ? $faker->dateTimeThisYear->format('Y-m-d H:i:s') : null,\n ];\n }\n\n $this->insert('classmates', $data);\n }", "public function definition()\n {\n return [\n 'region' => $this->faker->state,\n 'city' => $this->faker->city,\n 'street' => $this->faker->streetAddress,\n //'country_id' => Country::firstOrCreate(['name' => 'Spain'])->id, //Fallo por duplicado\n 'country_id' => null,\n 'zipcode' => $this->faker->postcode,\n ];\n }", "public function run(Faker $faker)\n {\n //\n for ($i=0; $i < 15 ; $i++) {\n $category = new Categories();\n $category->category = $faker->word();\n $category->save();\n }\n }", "public function __construct(Generator $faker)\n {\n $this->faker = $faker;\n }", "protected function setUp(): void\n {\n parent::setUp();\n //$this->artisan(\"db:seed\");\n $this->validName[1] = random_int(100,1000000);\n $validName = implode('',$this->validName);\n\n }", "public function test_should_return_every_salt_random()\n {\n $salts = [];\n $generateLength = 100;\n\n for ($i = 0; $i < $generateLength; ++$i) {\n $salts[] = Salt::generate();\n }\n\n $this->assertEquals($generateLength, count(array_unique($salts)));\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i<10; $i++) {\n $new_post = new Post();\n\n $new_post->title = $faker->sentence(rand(1,5));\n $new_post->content = $faker->text();\n \n // genero lo slug\n $slug = Str::slug($new_post->title, '-');\n $slug_base = $slug;\n\n //verifico che lo slug non sia già presente nel db\n $slug_present = Post::where('slug', $slug)->first();\n $counter = 1;\n\n //ciclo fino a quando slug_present diventa true\n while($slug_present) {\n $slug = $slug_base.'-'.$counter;\n $counter++; \n $slug_present = Post::where('slug', $slug)->first();\n }\n\n $new_post->slug = $slug;\n\n //perchè ho solo 1 utente\n $new_post->user_id = 1;\n\n $new_post->save();\n }\n }", "public function run(Faker $faker)\n {\n \n Farmacia::create([\n 'nome' => $faker->name,\n 'titular' => $faker->name,\n 'nuit' => rand(),\t\n 'email'\t=> $faker->unique()->safeEmail,\n 'location' => $faker->address,\n 'number' => '5365146',\t\n 'image'\t=> 'farmacia1.jpg',\n 'descricao'\t=> Str::random(5),\n 'quarteirao' => '12',\t\n 'pais_id' => '1',\t\n 'provincia_id' => '2',\n 'bairro_id'\t=> '3',\n 'user_id' => '2',\n 'video_link' => 'https://www.youtube.com/watch?v=f79bjznvBvE&t=18s',\t\n 'image_empresa' => 'farmacia1.jpg',\n ]);\n\n Farmacia::create([\n 'nome' => $faker->name,\n 'titular' => $faker->name,\n 'nuit' => rand(),\t\n 'email'\t=> $faker->unique()->safeEmail,\n 'location' => $faker->address,\n 'number' => '5365146',\t\n 'image'\t=> 'farmacia2.jpg',\n 'descricao'\t=> Str::random(5),\n 'quarteirao' => '12',\t\n 'pais_id' => '1',\t\n 'provincia_id' => '2',\n 'bairro_id'\t=> '3',\n 'user_id' => '2',\n 'video_link' => 'https://www.youtube.com/watch?v=f79bjznvBvE&t=18s',\t\n 'image_empresa' => 'farmacia2.jpg',\n ]);\n\n Farmacia::create([\n 'nome' => $faker->name,\n 'titular' => $faker->name,\n 'nuit' => rand(),\t\n 'email'\t=> $faker->unique()->safeEmail,\n 'location' => $faker->address,\n 'number' => '5365146',\t\n 'image'\t=> 'farmacia3.png',\n 'descricao'\t=> Str::random(5),\n 'quarteirao' => '12',\t\n 'pais_id' => '1',\t\n 'provincia_id' => '2',\n 'bairro_id'\t=> '3',\n 'user_id' => '2',\n 'video_link' => 'https://www.youtube.com/watch?v=f79bjznvBvE&t=18s',\t\n 'image_empresa' => 'farmacia3.png',\n ]);\n \n }", "public function fakeName()\n {\n $faker = \\Faker\\Factory::create();\n\n return $this->setName($faker->word());\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $limit = 15;\n for ($i = 0; $i < $limit; ++$i){\n DB::table('customers')->insert([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'email' => $faker->unique()->email,\n 'created_at' => $faker->dateTime($max = 'now'),\n 'updated_at' => $faker->dateTime($max = 'now'),\n ]);\n }\n}", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 5; $i++) {\n $d = new Dish;\n $d->name = $faker->word();\n $d->restaurant_id = rand(1, 5);\n $d->ingredients = $faker->paragraph(2);\n $d->description = $faker->paragraph(3);\n $d->price = $faker->randomFloat(2, 0, 999);\n $d->visible = true;\n $d->image = 'dish_img/placeholder.jpg';\n $d->save();\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n for ($i=0; $i <100 ; $i++) { \n $item = [\n 'name' => $faker->name,\n 'short_desc' =>$faker->text(),\n 'content' =>$faker->text(),\n 'price'=> rand(800000,1000000),\n 'sale_price'=>rand(300000,500000),\n 'cate_id'=>rand(1,10),\n ];\n DB::table('products')->insert($item); \n }\n}", "public function definition()\n {\n $gender = $this->faker->randomElement(array('male', 'female'));\n // $id = $this->faker->randomElement(array(1,5));\n $age = $this->faker->numberBetween(19,99);\n return [\n 'first_name' => $this->faker->firstName($gender),\n 'last_name' => $this->faker->lastName,\n 'other_name' => $this->faker->lastName,\n 'username' => $this->faker->userName,\n 'age' => $age,\n 'gender' => $gender,\n 'dob' => $this->faker->date(),\n 'mobile' => $this->faker->phoneNumber,\n 'address' => $this->faker->streetAddress,\n 'city' => $this->faker->city,\n 'state' => $this->faker->state,\n 'doctor_note' => $this->faker->sentence(10),\n 'email' => $this->faker->unique()->safeEmail,\n 'email_verified_at' => now(),\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password\n 'remember_token' => Str::random(10),\n ];\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 500; $i++) { \n $seed = new Hit();\n // Get collection of 'id' from houses table\n $houses = House::all()->pluck('id')->toArray();\n\t\tDB::table('hits')->insert([\n\t\t\t'house_id' => $faker->randomElement($houses),\n\t\t\t'created_at' => $faker->dateTimeBetween('-1 year', 'now', null),\n\t\t]);\n }\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 5 ; $i++) { \n for ($j=0; $j < 10 ; $j++) { \n $new_song = new Song();\n $new_song->title = $faker->sentence();\n $new_song->genre = $faker->randomElement([\n 'pop', 'jazz', 'blues', 'rock', 'country',\n 'reggae', 'metal', 'rap', 'indie', 'classic',\n ]); \n $new_song->album_id = $i + 1;\n $new_song->save();\n }\n }\n }", "public function testShouldNotSaveDuplicated()\n {\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive('userExists')\n ->with( $this->confide_user )\n ->andReturn( 1 )\n ->once();\n\n $this->populateUser();\n $this->confide_user->confirmation_code = '';\n $this->confide_user->confirmed = false;\n\n $this->assertFalse( $this->confide_user->save() );\n }", "public function run()\n {\n $faker = Faker::create();\n\n\n\n // for($i = 0; $i < 130; $i++) \n // {\n // DB::table('competition_user')->insert([\n // 'competition_id' => factory(App\\Competition::class)->create()->id,\n // 'user_id' =>$faker->biasedNumberBetween($min = 1, $max = 400, $function = 'sqrt'),\n // ]);\n \n // }\n\n }", "public function run()\n{\n $faker=Faker\\Factory::create('ja_JP');\n\n $taiken1=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);\n $taiken2=array(3,4,7,12,13,16,18);\n $taiken3=array(2,4,5,6,10,11,14,15,17,19,20,21);\n for($i=1;$i<20;$i++){\n $id_rand=rand(1,3);\n $taiken_rand=rand(1,21);\n $hoge=array(1=>$taiken1,2=>$taiken2,3=>$taiken3);\n for($j=1;$j<=count($hoge[$id_rand]);$j++){\n if(in_array($taiken_rand,$hoge[$id_rand])){\n break;\n }\n }\n if($j>count($hoge[$id_rand])){\n DB::table('Oc_Taiken1')->insert([\n 'oc_id'=>$id_rand,\n 'taiken_id'=>$taiken_rand\n ]);\n }else{\n $i--;\n }\n }\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 50; $i++) {\n $data_trip = new Trip();\n $data_trip->name_destination = $faker->city();\n $data_trip->departure = $faker->dateTime;\n $data_trip->return = $faker->dateTime;\n $data_trip->price = $faker->randomNumber(5, false);\n $data_trip->save();\n }\n }", "public function run(Faker $faker)\n {\n factory(\\App\\LeaderboardReferral::class, 100)->create();\n }", "public function run()\n {\n\n$confirmation_code = str_random(30);\n User::create(array(\n 'id' => null,\n 'name' => \"nevdk\",\n 'password' => Hash::make(\"114948\"),\n 'email' => \"[email protected]\",\n 'avatar' => \"http://s1.cdnnz.net/var/news/2012/11/22/51906_dzhejk-dzhillenxol_or_jake.jpg\",\n 'confirmation_code' => $confirmation_code,\n 'fio' => \"Дмитрий Кухарчук\",\n 'about' => \"пёрсын\"\n\n )); \n\n\n\n \t/*$faker = Faker\\Factory::create('ru_RU');\n \t$faker->addProvider(new Faker\\Provider\\ru_RU\\Person($faker));\n \t$faker->addProvider(new Faker\\Provider\\ru_RU\\Internet($faker));\n \t$faker->addProvider(new Faker\\Provider\\Image($faker));\n \t$faker->addProvider(new Faker\\Provider\\ru_RU\\Text($faker));\n\n \tDB::table('users')->truncate();\n \tfor($i=0;$i<=20;$i++){\n\n User::create(array(\n 'id' => null,\n 'name' => $faker->userName,\n 'password' => $faker->password,\n 'email' => $faker->email,\n 'avatar' => $faker->imageUrl(100, 100, 'people'),\n 'fio' => $faker->firstName.\" \".$faker->lastName,\n 'about' => $faker->realText(200)\n\n )); \n\n \t}*/\n }" ]
[ "0.66459894", "0.6575948", "0.6337043", "0.625063", "0.62372965", "0.61977273", "0.6152319", "0.61330813", "0.6113082", "0.61096144", "0.61084604", "0.6108264", "0.61077005", "0.6034539", "0.60073674", "0.597235", "0.5948181", "0.5938741", "0.58922356", "0.5883463", "0.58827746", "0.5865646", "0.5856356", "0.583994", "0.5820272", "0.58178633", "0.58084035", "0.58040494", "0.57972175", "0.57948065", "0.5778957", "0.57742035", "0.5774072", "0.57624155", "0.57570136", "0.57409406", "0.57301706", "0.572916", "0.57210165", "0.5716509", "0.5713347", "0.5708807", "0.5688161", "0.56859255", "0.56844985", "0.5679613", "0.56774926", "0.5664491", "0.56630397", "0.5655198", "0.56529987", "0.56497896", "0.5646859", "0.56414527", "0.5636018", "0.56310654", "0.5628957", "0.5626121", "0.5625054", "0.56231254", "0.56214964", "0.56214845", "0.561635", "0.56162214", "0.560877", "0.5606875", "0.560375", "0.55951446", "0.55906993", "0.5590673", "0.5590185", "0.55886286", "0.55859274", "0.557995", "0.5578466", "0.55775595", "0.5577307", "0.5568304", "0.55655533", "0.5559461", "0.5555178", "0.5549829", "0.5545926", "0.55424184", "0.5536346", "0.5534976", "0.55333585", "0.55318594", "0.5530978", "0.55203855", "0.55160815", "0.5512151", "0.55082756", "0.55021554", "0.54991317", "0.54987913", "0.54984266", "0.54956937", "0.54935664", "0.5493532", "0.54852945" ]
0.0
-1
Uses faker to ensure that the values are never duplicated.
private static function createCoursework($module) { $faker = Faker::create(); $coursework = new Coursework; $coursework->name = $faker->word() . "_TestCoursework"; $coursework->description = $faker->sentence($nbWords = 10, $variableNbWords = true); $coursework->maximum_score = 100; $coursework->module_id = $module->id; $coursework->coursework_type_id = 1; // java coursework type id. // Default dates to now. $coursework->deadline = date("Y-m-d"); $coursework->start_date = date("Y-m-d"); // Saves to the database. $coursework->save(); return $coursework; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGenerateMultipleNoDuplicateValues()\n {\n $registeredValues = [\n '1' => 1,\n '2' => 1,\n '3' => 1,\n ];\n $this->generator->registerValues($registeredValues);\n\n // Mock random number generator to return the first item twice, then return items two and three.\n $mockRandomNumberGenerator = $this->createPartialMock(\\stdClass::class, ['__invoke']);\n $mockRandomNumberGenerator->method('__invoke')\n ->withAnyParameters()\n ->will($this->onConsecutiveCalls(1,1,2,3));\n\n $this->generator->setRandomNumberGenerator($mockRandomNumberGenerator);\n\n $sample = iterator_to_array($this->generator->generateMultipleWithoutDuplicates(count($registeredValues)));\n $this->assertEquals(array_keys($registeredValues), $sample);\n }", "function faker()\n{\n $faker = Faker\\Factory::create();\n\n return $faker;\n}", "public function run(faker $faker)\n {\n for ($i=0; $i < 10 ; $i++) {\n $fish = new Random();\n $fish->name = $faker->name();\n $fish->price = $faker->randomFloat(2,100,500);\n $fish->description = $faker->paragraph(2);\n $fish->save();\n }\n\n }", "public function fake(Generator &$faker): object\n {\n return (object) [\n 'user_id' => random_int(1, Fabricator::getCount('users') ?: 10),\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'permitted' => (bool) random_int(0, 4),\n ];\n }", "public function run(Faker\\Generator $faker)\n {\n\n DB::table('users')->insert([\n 'last_name' => 'Admin',\n 'first_name' => 'Admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n ]);\n\n for ($i=2; $i < 50; $i++) {\n DB::table('users')->insert([\n 'last_name' => $faker->lastName,\n 'first_name' => $faker->firstName,\n 'email' => $faker->unique()->email,\n 'civility' => 'M',\n 'birth_date' => $faker->date,\n 'maiden_name' => $faker->lastName,\n 'native_city' => $faker->city,\n 'native_country' => $faker->country,\n 'nationality' => 'français',\n 'entry_date' => $faker->date,\n 'marital_status' => 'single',\n 'number_children' => $faker->randomNumber($nbDigits = 1, $strict = false),\n 'age_children' => $faker->randomNumber($nbDigits = 2, $strict = false),\n 'accomodation' => $faker->word,\n 'number_social_security' => $faker->randomDigit,\n 'number_cmu' => $faker->randomDigit,\n 'end_visit_date' => $faker->date,\n 'address' => $faker->address,\n 'postal_code' => $faker->postcode,\n 'city' => $faker->city,\n 'phone' => $faker->phoneNumber,\n 'cellphone' => $faker->phoneNumber,\n 'emergency_contact' => $faker->name,\n 'emergency_phone' => $faker->phoneNumber,\n\n 'hero' => $faker->name,\n 'experience_programming' => $faker->text($maxNbChars = 100),\n 'hack_story' => $faker->text($maxNbChars = 100),\n 'course' => $faker->word,\n 'super_power' => $faker->text($maxNbChars = 100),\n 'motivation' => $faker->text($maxNbChars = 100),\n\n 'leisure' => $faker->bs,\n\n 'availability' => $faker->word,\n 'constraints' => $faker->text($maxNbChars = 100),\n 'income' => $faker->word,\n\n 'codecademy_profile' => $faker->url,\n 'openclassroom_profile' => $faker->url,\n 'other_profile' => $faker->url,\n 'codecademy_badges' => $faker->randomNumber($nbDigits = 2, $strict = false),\n\n 'prescriber_contact' => $faker->name,\n 'prescriber_phone' => $faker->phoneNumber,\n\n 'pro_project' => $faker->bs,\n\n 'pole_emploi_registration' => 'yes',\n 'number_pole_emploi' => $faker->randomDigit,\n 'first_pole_emploi_registration' => $faker->date,\n 'pole_emploi_password' => $faker->password,\n 'last_pole_emploi_registration' => $faker->date,\n 'pole_emploi_registration_reason' => 'end of studies',\n 'pole_emploi_registration_duration' => $faker->randomDigit. ' mois',\n 'paid_by_pole_emploi' => 'yes',\n 'pole_emploi_allocation' => $faker->date,\n 'rsa' => 'yes',\n 'caf_number' => $faker->randomDigit,\n 'rqth' => 'no',\n 'handicapped_allocations' => 'no',\n 'transportation' => 'car',\n 'driving_license' => 'yes',\n 'free_transports_card' => 'yes',\n 'free_transports_card_validity' => $faker->date,\n\n 'password' => bcrypt('azerty'),\n ]);\n }\n\n\n DB::table('users')->insert([\n 'last_name' => 'Formateur',\n 'first_name' => 'Formateur',\n 'email' => '[email protected]',\n 'password' => bcrypt('azerty'),\n ]);\n\n DB::table('users')->insert([\n 'last_name' => 'Formateur2',\n 'first_name' => 'Formateur2',\n 'email' => '[email protected]',\n 'password' => bcrypt('azerty'),\n ]);\n }", "public function fake(Generator &$faker): array\n {\n return [\n 'name' => $faker->word,\n 'description' => $faker->sentence,\n ];\n }", "public function run(Faker $faker)\n {\n factory(\\App\\Company::class,30)->create();\n factory(\\App\\Company::class,30)->create([\n 'argumentation' => implode(\"\",$faker->sentences($nb = 3, $asText = false)),\n ]);\n }", "public function getFaker()\n {\n if (empty($this->faker))\n {\n $faker = Faker\\Factory::create();\n $faker->addProvider (new Faker\\Provider\\Base($faker));\n $faker->addProvider(new Faker\\Provider\\Lorem($faker));\n }\n \n return $this->faker = $faker;;\n }", "function faker() {\n static $faker = null;\n if (!$faker) {\n $faker = Faker\\Factory::create();\n }\n\n return $faker;\n }", "public function create(Faker $faker)\n {\n for ($randomItr=0; $randomItr < rand(5,10); $randomItr++) { \n $name = $faker->word();\n\n $random = Random::create([\n 'values' => $name,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ]);\n\n for ($breakdownItr=0; $breakdownItr < rand(5,10); $breakdownItr++) { \n $randomStr = Str::random(5);\n\n $breakdown = Breakdown::create([\n 'values' => $randomStr,\n 'random_id' => $random->id,\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ]);\n\n }\n }\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 2; $i++) {\n DB::table('users')->insert([\n 'role_id' => '1',\n 'username' => $faker->username,\n 'password' => Hash::make('secret'),\n 'first_name' => $faker->firstName,\n 'middle_name' => $faker->lastName,\n 'last_name' => $faker->lastName,\n 'suffix' => rand(0, 1) === 1 ? $faker->suffix : null,\n 'gender' => rand(1, 2),\n 'birthday' => $faker->date,\n 'id_number' => $faker->ssn,\n 'office_id' => rand(1, 3),\n 'is_active' => true,\n 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now', $timezone = null),\n ]);\n }\n\n for($i = 0; $i < 10; $i++) {\n DB::table('users')->insert([\n 'role_id' => '2',\n 'username' => $faker->username,\n 'password' => Hash::make('secret'),\n 'first_name' => $faker->firstName,\n 'middle_name' => $faker->lastName,\n 'last_name' => $faker->lastName,\n 'suffix' => rand(0, 1) === 1 ? $faker->suffix : null,\n 'gender' => rand(1, 2),\n 'birthday' => $faker->date,\n 'id_number' => $faker->ssn,\n 'office_id' => rand(1, 3),\n 'is_active' => true,\n 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now', $timezone = null),\n ]);\n }\n\n for($i = 0; $i < 2; $i++) {\n DB::table('users')->insert([\n 'role_id' => '3',\n 'username' => $faker->username,\n 'password' => Hash::make('secret'),\n 'first_name' => $faker->firstName,\n 'middle_name' => $faker->lastName,\n 'last_name' => $faker->lastName,\n 'suffix' => rand(0, 1) === 1 ? $faker->suffix : null,\n 'gender' => rand(1, 2),\n 'birthday' => $faker->date,\n 'id_number' => $faker->ssn,\n 'office_id' => rand(1, 3),\n 'is_active' => true,\n 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now', $timezone = null),\n ]);\n }\n }", "public function run(Faker $faker)\n {\n for($i=1;$i<=24;$i++){\n DB::table('Accounts')->insert([\n 'NameID' => $i,\n 'Position' => null,\n 'Team' => null,\n 'Email' => $faker->unique()->safeEmail,\n 'Batch' => '2020B',\n 'Password' => 'P@$$w0rD',\n 'Gender' => 1,\n ]);\n }\n\n for($i=25;$i<=72;$i++){\n DB::table('Accounts')->insert([\n 'NameID' => $i,\n 'Position' => null,\n 'Team' => null,\n 'Email' => $faker->unique()->safeEmail,\n 'Batch' => '2020B',\n 'Password' => 'P@$$w0rD',\n 'Gender' => 2,\n ]);\n }\n }", "public function testGenerateMultipleDuplicateValues()\n {\n $registeredValue = new \\stdClass();\n $this->generator->registerValue($registeredValue);\n\n $values = iterator_to_array($this->generator->generateMultiple(10));\n\n $this->assertCount(10, $values);\n foreach ($values as $value)\n {\n $this->assertEquals($value, $registeredValue);\n }\n }", "public function run(Faker $faker)\n {\n $faker->addProvider(new Person($faker));\n\n $list = [];\n\n for ($i = 1; $i <= 15; $i++) {\n if (rand(0, 1) === 0) {\n $list[] = [\n 'name' => $faker->firstName('male'),\n 'surname' => $faker->lastName('male'),\n 'father_name' => $faker->middleName('male'),\n 'email' => $faker->unique()->safeEmail,\n 'password' => bcrypt('password'),\n 'group_id' => rand(1, 10)\n ];\n } else {\n $list[] = [\n 'name' => $faker->firstName('female'),\n 'surname' => $faker->lastName('female'),\n 'father_name' => $faker->middleName('female'),\n 'email' => $faker->unique()->safeEmail,\n 'password' => bcrypt('password'),\n 'group_id' => rand(1, 10)\n ];\n }\n }\n\n DB::table('users')->insert($list);\n }", "private function generateFakeUsers($numberOfUsers,\n $homeAddress,\n $emailAddress,\n $phoneNumber,\n $gender,\n $birthday,\n $photoUrl)\n\n\n {\n $faker = Faker::create();\n $fakeUsers = Array();\n /* Get an Array of photo urls if phto urls is checked */\n if ($photoUrl == 1) {\n $randomFemalePhotoUrl=$this->getPhotoUrlData('data/female.json');\n $randomMalePhotoUrl=$this->getPhotoUrlData('data/male.json');\n $randomNumAr=$this->getUniqNums(0,110,$numberOfUsers);\n }\n\n for ($i=0; $i<=$numberOfUsers-1; $i++) {\n $userGender=$this->getGender();\n if ($userGender == \"male\") {\n $fakeUsers[$i] = Array('FirstName' => $faker->firstNameMale);\n } else {\n $fakeUsers[$i] = Array('FirstName' => $faker->firstNameFemale);\n }\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('LastName' => $faker->lastName));\n if ($homeAddress == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('Address' => $faker->streetAddress.', '.$faker->city.', '.$faker->stateAbbr.', '.$faker->country));\n }\n if ($emailAddress == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('EmailAddress' => $faker->email));\n }\n if ($phoneNumber == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('PhoneNumber' => $faker->phoneNumber));\n }\n if ($gender == 1) {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('Gender' => $userGender));\n }\n if ($birthday == 1) {\n\t\t\t\t$fakeUsers[$i] = array_merge($fakeUsers[$i], Array('Birthday' => $faker->dateTimeThisCentury->format(\"Y-m-d\")));\n\t\t }\n if ($photoUrl == 1) {\n if ($userGender == \"male\") {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('PhotoUrl' => $randomMalePhotoUrl[$randomNumAr[$i]]));\n } else {\n $fakeUsers[$i] = array_merge($fakeUsers[$i], Array('PhotoUrl' => $randomFemalePhotoUrl[$randomNumAr[$i]]));\n }\n }\n }\n return($fakeUsers);\n }", "public function run()\n {\n $faker = Faker::create();\n //echo $faker->word();die();\n //var_dump($faker);die();\n\n for($i=0; $i<100; $i++) \n {\n Maker::create\n ([\n 'name' => $faker->unique()->company(),\n 'phone' => $faker->phoneNumber()\n ]);\n }\n }", "protected function setUpFaker()\n {\n $this->faker = $this->makeFaker('de_DE');\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 15; $i++) { \n\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'lastname' => $faker->lastName,\n 'email' => $faker->unique()->Email,\n 'email_verified_at' => now(),\n 'created_at' => now(),\n 'updated_at' => now(),\n 'password' => 'password',\n 'birth_date' => Carbon::create(rand(1950, 2005), rand(1, 12), rand(1, 30)),\n 'user_img_path' => 'defaults/default.png',\n ]);\n\n }\n\n }", "public function testRandomValuesAreVaried() {\n\t\t$this->Message = new Message();\n\t\tfor ($i = 1; $i <= 100; $i++) {\n\t\t\t$this->Message->create();\n\t\t\t$this->Message->saveField('name', 'Test ' . str_pad($i, 3, '0', STR_PAD_LEFT));\n\t\t}\n\t\t$count = $this->Message->find('count');\n\t\t$this->Message->randomize();\n\t\t$randomVals = $this->Message->find('all', array(\n\t\t\t'fields' => array('random', 'count(random) as counter'),\n\t\t\t'group' => 'random',\n\t\t\t'order' => 'count(random) DESC'\n\t\t));\n\t\t$randomVals = Set::combine($randomVals, '/Message/random', '/0/counter');\n\t\t$distinctValues = count($randomVals);\n\t\t$maxDuplicates = current($randomVals);\n\t\tif (!$this->assertTrue($distinctValues > $count * 0.7)) {\n\t\t\tdebug(\"30% overlap detected for random values - Many rows have the same random value.\\r\\n\" .\n\t\t\t\t\"Due to the nature of random number generation this test may fail - it should not fail consistently.\");\n\t\t}\n\t\tif (!$this->assertTrue($maxDuplicates <= 5)) {\n\t\t\tdebug(\"The most common random number is used for $maxDuplicates different rows.\\r\\n\" .\n\t\t\t\t\"Due to the nature of random number generation this test may fail - it should not fail consistently.\");\n\t\t}\n\t}", "public function run(Faker\\Generator $faker)\n {\n $groupCount = 10;\n\n //.. Seed ExpressionGroup\n for($x = 0; $x < $groupCount; $x++){\n DB::table('expression_groups')->insert([\n 'group_name' => $faker->sentence()\n ]);\n }\n\n //.. Seed Expression\n for($x = 0; $x < 200; $x++){\n DB::table('expressions')->insert([\n 'value' => $faker->sentence(),\n 'group_id' => $faker->numberBetween(1,$groupCount)\n ]);\n }\n\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 20 ; $i++) {\n DB::table('authors')->insert([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'description' => $faker->text($maxNbChars = 50),\n 'twitter_handle' => $faker->bothify('@ ??##'),\n 'created_at' => $faker->dateTime($max = 'now', $timezone = null),\n 'updated_at' => $faker->dateTime($max = 'now', $timezone = null),\n ]);\n }\n }", "public function testGenerateSlugIfItWillCreateUniqueSlug()\n {\n factory(Product::class)->create()->each(function ($product) {\n $expectedSlug = $product->slug . '-2';\n $returnedSlug = Product::generateSlug($product->title);\n\n $this->assertEquals($expectedSlug, $returnedSlug);\n });\n }", "public function definition()\n {\n return [\n 'name' => $this->faker->company,\n 'description' => $this->faker->text,\n 'email' => $this->faker->safeEmail,\n 'phone' => $this->faker->phoneNumber,\n 'website' => $this->faker->url,\n 'logo' => $this->faker->word,\n 'employees' => $this->faker->numberBetween(1, 100),\n 'has_branches' => $this->faker->boolean,\n 'has_insurance' => $this->faker->boolean,\n 'has_newsletter' => $this->faker->boolean,\n 'is_active' => $this->faker->boolean,\n 'founded' => $this->faker->date(),\n 'defunct' => $this->faker->date(),\n 'street_address' => $this->faker->streetAddress, \n 'address_info' => $this->faker->word,\n 'postal_code' => $this->faker->postcode,\n 'city' => $this->faker->city,\n 'state' => $this->faker->state,\n 'country' => $this->faker->country,\n 'lat' => $this->faker->latitude,\n 'lng' => $this->faker->longitude,\n 'facebook' => $this->faker->word,\n 'twitter' => $this->faker->word,\n 'instagram' => $this->faker->word,\n 'linkedin' => $this->faker->word,\n 'snapchat' => $this->faker->word,\n 'blog' => $this->faker->word,\n 'skype' => $this->faker->word,\n 'pinterest' => $this->faker->word,\n 'youtube' => $this->faker->word,\n 'status' => $this->faker->word,\n 'type' => $this->faker->word,\n ];\n }", "public function run(Faker $faker)\n {\n\n for ($i = 0; $i < 40 ; $i++) {\n\n //random Gender\n $genders = ['male','female'];\n $randomGender = $genders[array_rand($genders)];\n\n //random Age + date of birth\n $randomAge = rand(13,21);\n $randomDay = rand(1,28);\n $randomMonth = rand(1,12);\n $dateOfBirth = date('Y-m-d', strtotime(\"-$randomAge year -$randomDay days -$randomMonth months\"));\n //doublechecking with date_diff\n $randomAge = date_diff(date_create($dateOfBirth), date_create('now'))->y;\n\n //New Student\n $newStudent = new Student;\n\n $newStudent->name = $faker->firstName($randomGender);\n $newStudent->lastname = $faker->lastName($randomGender);\n $newStudent->gender = mb_substr($randomGender, 0, 1, \"UTF-8\");\n $newStudent->age = $randomAge;\n $newStudent->date_of_birth = $dateOfBirth;\n $newStudent->class = rand(1,5);\n\n $newStudent->save();\n }\n }", "public function run(Faker $faker)\n {\n //seleziono tutti gli autori\n $authors = Author::all();\n //ciclo tutti gli autori, per ogni autore inserisco\n\n foreach($authors as $author) {\n \n if($author->info == null) {\n $newAuthorInfo = new AuthorInfo;\n $newAuthorInfo->author_id;\n $newAuthorInfo->nationality = $faker->country();\n $newAuthorInfo->bio = $faker->paragraph(5, true);\n if(rand(0,1) == 1) {\n $newAuthorInfo->image = $faker->imageUrl(200, 300);\n $newAuthorInfo->alive = 1;\n }\n $newAuthorInfo->save();\n }\n }\n }", "public function run(Faker $faker)\n {\n for($i=1; $i<=5;$i++)\n {\n DB::table('users')->insert([\n 'id'=>$i,\n 'name_user' => $faker->name(),\n 'surname_user' => Str::random(10),\n 'email' => $faker->email(),\n 'password' => Hash::make('password'),\n 'country_user' => Str::random(16),\n 'fiscalCode_user' => Str::random(16),\n 'address_user' => $faker->address(),\n 'email_verified_at' => Carbon::now(),\n 'group_id' => rand(1,4),\n 'active' => 1,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n }\n \n\n }", "public function run(Faker $faker)\n {\n factory(\\App\\User::class,40)->create()->each(function($user) use ($faker){\n $user->profile()->create([\n 'firstname' => $faker->firstName,\n 'lastname' => $faker->lastName,\n 'phonenumber' => $faker->phoneNumber,\n 'hours' => rand(1,32),\n ]);\n });\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 100; $i++) {\n DB::table('authors')->insert([\n 'first' => $faker->firstName,\n 'last' => $faker->lastName\n ]);\n }\n\n }", "public static function likeUniqueSeeding(){\n for ($i=0;$i = 10000; $i++){\n try{\n Like::factory()->create([\n 'user_id' => User::pluck('id')->random(),\n 'post_id' => Post::pluck('id')->random(),\n 'vote_type' => 'up'\n ]);\n }\n catch(Exception $e){\n DatabaseSeeder::likeUniqueSeeding();\n }\n }\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 10; $i++) {\n $newProducer = new Producer;\n $newProducer->name = $faker->firstName;\n $newProducer->lastname = $faker->lastName;\n if(rand(0,1) == 1) {\n $newProducer->date_of_birth = $faker->date('Y-m-d', 'now');\n }\n if(rand(0,2) == 1) {\n $newProducer->biography = $faker->paragraph(4, true);\n }\n $newProducer->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 5; $i++) {\n DB::table('invoices')->insert([\n 'creator' => $faker->numberBetween(1, 5),\n 'user_id' => $faker->numberBetween(1, 5),\n 'approval' => null,\n 'issue_date' => $faker->dateTime('now'),\n 'completion_date' => $faker->dateTime('now +30 days'),\n 'description' => $faker->text($maxNbChars = 50),\n 'hours_value' => $faker->numberBetween(10, 200),\n 'hours_value_netto' => $faker->numberBetween(1000, 10000),\n 'hours_value_gross' => $faker->numberBetween(1000, 10000),\n 'hours_value_vat' => $faker->numberBetween(1000, 10000),\n 'fixed_price' => null,\n 'fixed_price_gross' => null,\n 'fixed_price_vat' => null,\n 'overtime_value' => $faker->numberBetween(1000, 10000),\n 'overtime_value_netto' => $faker->numberBetween(1000, 10000),\n 'overtime_value_gross' => $faker->numberBetween(1000, 10000),\n 'overtime_value_vat' => $faker->numberBetween(1000, 10000),\n 'is_accepted' => false,\n 'status' => $faker->numberBetween(0, 4),\n 'payment_date' => $faker->dateTimeBetween('now', '+30 days'),\n ]);\n }\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 20; $i++){\n $newGuest = new Guest();\n $newGuest->full_name = $faker->name();\n $newGuest->slug = Str::slug($newGuest->full_name, '-');\n $newGuest->save();\n }\n }", "public function definition()\n {\n return [\n 'contract_id' => $this->faker->word,\n 'company_id' => $this->faker->word,\n 'department_id' => $this->faker->word,\n 'joblevel_id' => $this->faker->word,\n 'jobtitle_id' => $this->faker->word,\n 'supervisor_id' => $this->faker->word,\n 'region_of_birth_id' => $this->faker->word,\n 'city_of_birth_id' => $this->faker->word,\n 'address' => $this->faker->text($this->faker->numberBetween(5, 255)),\n 'join_date' => $this->faker->date('Y-m-d'),\n 'employee_status' => $this->faker->lexify('?????'),\n 'code' => $this->faker->text($this->faker->numberBetween(5, 17)),\n 'full_name' => $this->faker->firstName,\n 'gender' => $this->faker->lexify('?????'),\n 'date_of_birth' => $this->faker->date('Y-m-d'),\n 'identity_number' => $this->faker->text($this->faker->numberBetween(5, 27)),\n 'identity_type' => $this->faker->lexify('?????'),\n 'marital_status' => $this->faker->lexify('?????'),\n 'email' => $this->faker->email,\n 'leave_balance' => $this->faker->numberBetween(0, 999),\n 'tax_group' => $this->faker->lexify('?????'),\n 'resign_date' => $this->faker->date('Y-m-d'),\n 'have_overtime_benefit' => $this->faker->boolean,\n 'risk_ratio' => $this->faker->lexify('?????'),\n 'profile_image' => $this->faker->text($this->faker->numberBetween(5, 255)),\n 'profile_size' => $this->faker->numberBetween(0, 999),\n 'salary_group_id' => $this->faker->word,\n 'shiftment_group_id' => $this->faker->word\n ];\n }", "public function testRegisterValue()\n {\n $values = [\n 123,\n '123',\n [1,2,3],\n new stdClass(),\n false,\n null\n ];\n\n // Mock random number generator to return 1,2,3,4\n $mockRandomNumberGenerator = $this->createPartialMock(\\stdClass::class, ['__invoke']);\n $mockRandomNumberGenerator->method('__invoke')\n ->withAnyParameters()\n ->will($this->onConsecutiveCalls(...range(1,count($values))));\n\n $this->generator->setRandomNumberGenerator($mockRandomNumberGenerator);\n\n foreach ($values as $value)\n {\n $this->generator->registerValue($value);\n }\n\n $sample = iterator_to_array($this->generator->generateMultipleWithoutDuplicates(count($values)));\n $this->assertEquals($values, $sample);\n }", "public function different_seed_generated_uuids_are_not_equal(): void\n {\n $this->assertNotSame(UUID::generate('seed')->toString(), UUID::generate('new')->toString());\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 10; $i++) {\n $seed = new User();\n $seed->email = $faker->freeEmail;\n $seed->password = $faker->password;\n $seed->first_name = $faker->firstName;\n $seed->last_name = $faker->lastName;\n $seed->date_of_birth = $faker->date;\n $seed->save();\n }\n }", "public function run(Faker $faker)\n {\n DB::table(\"users\")->insert([\n [\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail, //use real emails here\n 'email_verified_at' => now(),\n 'password' => Hash::make($faker->password()), // password\n ],\n [\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail, //use real emails here\n 'email_verified_at' => now(),\n 'password' => Hash::make($faker->password()), // password\n ],\n [\n 'name' => $faker->name,\n 'email' => $faker->unique()->safeEmail, //use real emails here\n 'email_verified_at' => now(),\n 'password' => Hash::make($faker->password()), // password\n ],\n ]);\n }", "public function testRandomPosts() {\n // remove all existing posts\n $all = Post::all();\n foreach ($all as $post) {\n $post->delete();\n }\n\n // create some Posts\n $posts = [];\n $posts[0] = $this->createPost(0, TRUE);\n $posts[1] = $this->createPost(1, TRUE);\n $posts[2] = $this->createPost(2, TRUE);\n $posts[3] = $this->createPost(3, TRUE);\n $posts[4] = $this->createPost(4, TRUE);\n $posts[5] = $this->createPost(5, TRUE);\n $posts[6] = $this->createPost(6, TRUE);\n\n $random_posts = $this->createRandomPostsComponent();\n $generated_posts = $random_posts->posts();\n\n // amount of posts should be equal to default value\n self::assertEquals(5, count($generated_posts));\n\n // ensure all Posts are from posts created\n $found_all = TRUE;\n foreach ($generated_posts as $generated_post) {\n $found = FALSE;\n foreach ($posts as $post) {\n if ($post->id == $generated_post->id) {\n $found = TRUE;\n break;\n }\n }\n if (!$found) {\n $found_all = FALSE;\n break;\n }\n }\n self::assertTrue($found_all, 'All posts exist in original array');\n\n // check for non-repeating\n $ids = [];\n foreach ($generated_posts as $post) {\n self::assertArrayNotHasKey($post->id, $ids, 'Post is not already present in the generated array');\n $ids[$post->id] = $post->id;\n }\n }", "public function provideValidReplacementIds()\n {\n return [\n [FakerReplacer::PREFIX.'firstname'], // original faker property\n [FakerReplacer::PREFIX.'lastname'], // original faker property\n ];\n }", "public function run(\\Faker\\Generator $faker)\n {\n DB::table('organizations')->insert([\n [\n // 1\n 'name' => 'Queen Inc.',\n 'ui_client_id' => 'fce73bc2-02da-47c1-a81d-6dd1ca27b58e',\n 'settings' => json_encode([\n 'locale' => [\n 'value' => 'pt-BR',\n 'final' => true\n ],\n ]),\n 'created_at' => now()\n ],\n [\n // 2\n 'name' => 'Free Inc.',\n 'ui_client_id' => '93e4dbdc-24ec-40c5-abc5-1f5fe5c49c82',\n 'settings' => null,\n 'created_at' => now()\n ],\n [\n // 3\n 'name' => 'Bad Company',\n 'ui_client_id' => 'c775807b-eeac-439d-b819-da827d559829',\n 'settings' => null,\n 'created_at' => now()\n ],\n ]);\n\n// $extraData = [];\n// foreach (range(0, 50) as $i) {\n// $extraData[] = [\n// 'name' => $faker->company\n// ];\n// }\n\n// DB::table('organizations')->insert($extraData);\n }", "public function definition()\n {\n return [\n 'unidade' => $this->faker->randomElement($array = array ('FFLCH','IFUSP','FAU')),\n 'numero_usp' => $this->faker->unique()->numberBetween(1000000, 9999999),\n 'name' => $this->faker->name,\n 'endereco' => $this->faker->streetAddress,\n 'complemento' => $this->faker->sentence($nbWords = 2, $variableNbWords = true),\n 'cidade' => $this->faker->sentence($nbWords = 1, $variableNbWords = true),\n 'estado' => $this->faker->sentence($nbWords = 1, $variableNbWords = true),\n 'cep' => $this->faker->numberBetween(1000000, 9999999),\n 'rg' => $this->faker->numberBetween(100000000, 999999999),\n 'cpf' => $this->faker->numberBetween(10000000000, 99999999999),\n 'data_nascimento' => $this->faker->date($format = 'Y-m-d', $max = 'now'),\n\n 'comercial' => $this->faker->numberBetween(10000000, 99999999),\n 'residencial' => $this->faker->numberBetween(10000000, 99999999),\n 'celular' => $this->faker->numberBetween(100000000, 999999999),\n 'e_mail' => $this->faker->unique()->safeEmail,\n\n 'banco' => $this->faker->company,\n 'agencia' => $this->faker->numberBetween(1000000, 9999999),\n 'conta_corrente' => $this->faker->unique()->numberBetween(1000000, 9999999),\n\n 'saldo' => $this->faker->numberBetween(0, 200)\n ];\n }", "function testGenRandom() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 21; $i++) { \n $invoice = new App\\Customer();\n $invoice->category = $faker->sentence;\n $invoice->w_kyat = rand(1, 5);\n $invoice->w_pae = rand(1, 15);\n $invoice->w_ywae = rand(1, 7);\n $invoice->loan = rand(100000, 500000);\n $invoice->name = $faker->name;\n $invoice->address = $faker->address;\n $invoice->user_id = 1;\n $invoice->save();\n }\n }", "public function testUniqueFields() {\n $account = $this->drupalCreateUser();\n\n $edit = ['mail' => '[email protected]', 'name' => $account->getAccountName()];\n $this->drupalGet('user/register');\n $this->submitForm($edit, 'Create new account');\n $this->assertSession()->pageTextContains(\"The username {$account->getAccountName()} is already taken.\");\n\n $edit = ['mail' => $account->getEmail(), 'name' => $this->randomString()];\n $this->drupalGet('user/register');\n $this->submitForm($edit, 'Create new account');\n $this->assertSession()->pageTextContains(\"The email address {$account->getEmail()} is already taken.\");\n }", "public function seed_generated_uuids_are_equal(): void\n {\n $this->assertSame(UUID::generate('seed')->toString(), UUID::generate('seed')->toString());\n }", "protected function createRandomUsers() {\n\n $faker = Faker\\Factory::create();\n\n $Equipos = Equipos::all(); \n\n for($i=0; $i < 4; $i++) {\n User::create([\n 'name' => $faker->firstName,\n 'puntaje' => rand(1,30),\n 'lastname' => $faker->lastName,\n 'nacimiento' => Carbon::now(),\n 'fecha_visita'=> Carbon::now(),\n 'email' => $faker->email,\n 'equipo_id' => $Equipos->random(1)->id,\n 'password' => Hash::make('12345678'), //Vital guardar la contraseña encriptada o no nos vamos a poder autenticar!\n ]); \n }\n }", "public function seed()\n {\n# $faker = \\Faker\\Factory::create();\n\n$fakerChampion = ['Chicago', 'Kansas'];\n# Use a loop to create 10 games\nfor ($i = 0; $i < 10; $i++) {\n\n$fakerPlayer = $fakerChampion[rand(0, 1)];\n$fakerComputer = $fakerChampion[rand(0, 1)];\n# or $fakerChampion[array_rand($fakerChampion)]; \n\nif ($fakerPlayer == $fakerComputer) {\n $winner = 1;\n} else {\n $winner = 2;\n}\n\n# Set up game/and data for table\n $game = [\n 'winner' => $winner,\n 'player' => $player,\n 'computer' => $computer,\n ];\n\n # Insert game\n $this->app->db()->insert('games', $game);\n}\n dump('It works! You invoked your seed command.');\n }", "public function randomQuestionWithSelfsameBag(): void\n {\n $unexpectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion1->id, $unexpectedQuestion2->id]);\n\n $this->assertFalse($questionsList->contains($questionsList));\n $this->assertEmpty($questionsList);\n }", "public function run()\n {\n $faker = Faker::create('App\\Meal');\n\n for($i = 1; $i <=5; $i++){\n\n DB::table('meals')->insert([\n 'title' => $faker->sentence(),\n 'description' =>implode($faker->paragraphs(1)),\n \n \n \n \n ]);\n }\n}", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for ($i=0;$i<99;$i++){\n $material = new Zlecprac();\n\n $material ->zlecenia_id = $faker->numberBetween(1-30);\n $material ->users_id = $faker->numberBetween(1-25);\n\n $material ->save();\n\n}\n }", "protected function generate()\n {\n\t\t$this->value = md5(uniqid(rand(), true));\n }", "public function run(Faker $faker)\n {\n $houses = House::all();\n\n foreach ($houses as $house) {\n $randNumb = rand(20, 40);\n for ($i = 0; $i < $randNumb; $i++) {\n $newMessage = new Message;\n $newMessage->house_id = $house->id;\n $newMessage->guest_name = $faker->name(null);\n $newMessage->email = $faker->freeEmail;\n $newMessage->message = $faker->paragraph(2, true);\n $newMessage->created_at = $faker->dateTimeBetween(\"-2 years\", \"now\", 'Europe/Paris');\n $newMessage->save();\n }\n }\n }", "public function provideValidReplacementNames()\n {\n return [\n ['firstname'], // original faker property\n ['lastname'], // original faker property\n ];\n }", "public function randomly_generated_uuids_are_not_equal(): void\n {\n $this->assertNotSame(UUID::generate(), UUID::generate());\n }", "public function run(Faker $faker)\n {\n $users = User::all();\n $users_arr = $users->toArray();\n $users = Count($users_arr);\n\n\n for ($i = 0; $i < $users; $i++){\n // for($j = 0; $j < $userCount; $j++ ){\n // $newRestaurant->user_id = $userCount[$j];\n // }\n\n $newRestaurant = new Restaurant ();\n $newRestaurant->nome = $faker->word();\n $nomeBeginner = $newRestaurant->nome;\n\n $nomePresente = Restaurant::where('nome',$nomeBeginner)->first();\n $cont = 1;\n while($nomePresente){\n $nomeBeginner = $nomeBeginner.'-'.$cont;\n $nomeBeginner = Restaurant::where('nome',$nomeBeginner)->first();\n $cont++;\n }\n $newRestaurant->nome = $nomeBeginner;\n\n $newRestaurant->indirizzo = $faker->streetAddress();\n $newRestaurant->immagine = \"'ristorante_storage\\fast-food-2029397_960_720.png'\";\n\n \n // $newRestaurant->immagine = Storage::put('ristorante_storage', $newRestaurant->immagine);\n\n $newRestaurant->slug = Str::slug($newRestaurant->nome);\n $newRestaurant->user_id = $i + 1;\n $existRestaurant = Restaurant::where('user_id',$newRestaurant->user_id)->first();\n if (!$existRestaurant) {\n $newRestaurant->save();\n\n }\n\n\n }\n }", "public function run()\n {\n $faker=Faker\\Factory::create('pl_PL');\n for($i=1;$i<=199;$i++)\n {\n\n DB::table('rooms')->insert([\n 'room_number'=>$faker->unique()->numberBetween(1,200),\n 'room_size'=>$faker->numberBetween(1,5),\n 'price'=>$faker->numberBetween(100,600),\n 'description'=>$faker->text(1000),\n 'tourist_object_id'=>$faker->numberBetween(1,20),\n\n\n ]);\n }\n}", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->value = random_int(1, 100000);\n\n $randomValue = md5((string)$this->value);\n\n $this->value1 = $randomValue . '_1';\n $this->value2 = $randomValue . '_2';\n $this->value3 = $randomValue . '_3';\n }", "public function customerDummyData($faker)\n {\n $gender = $faker->randomElement(['male', 'female']);\n\n $customerGroup = $this->customerGroupRepository->get()->random();\n\n return [\n 'first_name' => $faker->firstName($gender),\n 'last_name' => $faker->lastName,\n 'gender' => $gender,\n 'date_of_birth' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'email' => $faker->unique()->safeEmail(),\n 'phone' => $faker->e164PhoneNumber,\n 'password' => bcrypt('admin123'),\n 'customer_group_id' => $customerGroup->id,\n 'is_verified' => 1,\n 'remember_token' =>str_random(10)\n ];\n }", "public function testTitleMutator()\n {\n $data = [\n 'title' => strtolower($this->faker->sentence(rand(5, 10), $variableNbWords = true)),\n 'author' => strtolower($this->faker->name),\n ];\n\n $record = Book::create($data);\n\n if (ucfirst($data['title']) != $record->title || ucfirst($data['author']) != $record->author) {\n $this->assertTrue(false);\n }\n $this->assertTrue(true);\n }", "public function definition()\n {\n $sexes = ['male', 'female', 'other'];\n $randomKey = array_rand($sexes);\n return [\n 'name' => $this->faker->firstName(),\n 'surname' => $this->faker->lastName(),\n 'patronymic' => $this->faker->name().'ic',\n 'sex' => $sexes[$randomKey],\n 'salary' => rand(1, 1000),\n ];\n }", "public function test_generate_key_random()\n {\n $key1 = GuestToken::generate_key();\n $key2 = GuestToken::generate_key();\n $this->assertNotEquals($key1, $key2);\n }", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 40; $i++){\n $newUser = new User();\n $newUser->name = $faker->name();\n $newUser->address = $faker->address();\n $newUser->city = $faker->city();\n $newUser->p_iva = $faker->numerify('###########');\n $newUser->image = $faker->imageUrl(640, 480);\n $newUser->email = $faker->freeEmail();\n $newUser->password = Hash::make('password');\n $newUser->save();\n\n }\n }", "private function getFaker() {\n $faker = \\Faker\\Factory::create('zh_CN'); // create a French faker\n dd(debug_backtrace());\n for ($i = 0; $i < 5; $i++) {\n echo mb_convert_encoding($faker->name, 'gbk'), \"\\n\";\n echo $faker->email, \"\\n\";\n }\n }", "public function run(Faker\\Generator $faker)\n {\n $wgro = App\\Market::whereSlug('wgro')->first();\n $lrh = App\\Market::whereSlug('lrh')->first();\n $elizowka = App\\Market::whereSlug('elizowka')->first();\n $agrohurt = App\\Market::whereSlug('agrohurt')->first();\n\n for($x = 0; $x <= 150; $x++) {\n $this->products[$faker->unique()->word] = [\n 'type' => $this->type[array_rand($this->type)],\n 'origin' => $this->origin[array_rand($this->origin)],\n \"package\" => $this->package[array_rand($this->package)],\n ];\n }\n\n foreach ($this->products as $name => $attrs) {\n\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_min\" => rand(1,20),\n \"price_max\" => rand(20,75),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($wgro->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($lrh->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($elizowka->id),\n ]);\n }\n }\n\n foreach ($this->products as $name => $attrs) {\n for ($x = 10; $x <= 30; $x++) {\n DB::table('offers')->insert([\n \"product\" => $name,\n \"type\" => $attrs['type'],\n \"origin\" => $attrs['origin'],\n \"package\" => $attrs['package'],\n \"price_max\" => rand(15,50),\n \"price_min\" => rand(1,14),\n \"date\" => new MongoDB\\BSON\\UTCDateTime(new DateTime('2018-01-'.$x)),\n \"market_id\" => new ObjectID($agrohurt->id),\n ]);\n }\n }\n }", "public function definition()\n {\n $arr = [105, 106, 107];\n $rdm = $arr[array_rand($arr)];\n return [\n 'name' => $this->faker->name,\n 'nim' => '17'.$rdm.'12'.$this->faker->numberBetween(001, 999),\n 'password' => bcrypt('password'),\n 'faculty' => 'Ilmu Komputer',\n 'major' => $this->faker->numberBetween(1, 3),\n 'generation' => $this->faker->numberBetween(2017, 2020),\n 'gender' => $this->faker->numberBetween(1, 2),\n 'birth' => $this->faker->address,\n 'dob' => $this->faker->date('Y-m-d', 'now'),\n 'phone' => $this->faker->e164PhoneNumber ,\n 'email' => $this->faker->email,\n ];\n }", "public function definition()\n {\n return [\n 'name' => $this->faker->name,\n 'lastname' => $this->faker->lastName,\n 'code' => $this->faker->unique()->numberBetween($min=1, $max=$this->count*2),\n 'email' => $this->faker->unique()->safeEmail,\n 'second_lastname' => $this->faker->lastName,\n 'rfc' => $this->faker->ean13,\n 'curp' => $this->faker->ean13,\n 'nss' => $this->faker->randomNumber($nbDigits =null , $strict = false),\n 'cat_gender_id' => $this->faker->numberBetween($min = 1, $max = 2),\n 'cat_country_id' => 142,\n 'cat_state_id' => $this->faker->numberBetween($min=2427, $max=2459),\n 'cat_marital_status_id' => $this->faker->numberBetween($min=1, $max=6),\n 'cat_educational_level_id' => $this->faker->numberBetween($min=1, $max=6),\n 'skills' => \"{'comer', 'dormir'}\",\n 'telephone' => $this->faker->tollFreePhoneNumber,\n 'cellphone' => $this->faker->tollFreePhoneNumber,\n 'emergency_telephone' => $this->faker->phoneNumber,\n 'birthdate' => $this->faker->date($format = 'Y-m-d', $max = 'now')\n\n ];\n }", "public function testDuplicate()\n {\n $this->duplicate(\n array_merge(\n $this->_createData1(),\n $this->_createData2()\n ),\n array_merge(\n $this->_expectData1(),\n $this->_expectData2()\n )\n );\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 10; $i++) {\n $newPost = new Post();\n $newPost->title = $faker->sentence(3);\n $newPost->content = $faker->text(500);\n\n $userCount = Count(User::all()->toArray());\n $newPost->user_id = rand(1,$userCount);\n\n $slug = Str::slug($newPost->title);\n $slugIniziale = $slug;\n \n $postPresente = Post::where('slug',$slug)->first();\n\n $contatore = 1;\n\n while($postPresente) {\n $slug = $slugIniziale . '-' . $contatore;\n $postPresente = Post::where('slug',$slug)->first();\n $contatore++;\n }\n\n $newPost->slug = $slug;\n\n\n $newPost->save();\n }\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 10; $i++) {\n\n // ---prendo prima di tutto un utente casuale da associare---\n $user = User::inRandomOrder()->first();\n // ---prendo prima di tutto un utente casuale da associare---\n\n $tag = new Tag;\n $tag->user_id = $user->id;\n $tag->name = $faker->word();\n\n $tag->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n for($i=0; $i<=3; $i++){\n\n $Trabajador=Academic_Title::create([\n 'titles'=> $faker-> bs,\n 'university'=> $faker-> catchPhrase, \n ]);\n }\n}", "public function run(Faker $faker)\n {\n $userNameList=[\n 'Mario',\n 'Francesca',\n 'Andrea',\n 'Marcello',\n 'Alessandro'\n ];\n $userSurnameList=[\n 'Rossi',\n 'Bianchi',\n 'Fabbri',\n 'Marcellini',\n 'Settembrini'\n ];\n $userImgList=[\n 'https://www.w3schools.com/howto/img_avatar.png',\n 'https://www.w3schools.com/howto/img_avatar2.png',\n 'https://www.w3schools.com/w3images/avatar2.png',\n 'https://teachingandlearning.schulich.yorku.ca/wp-content/uploads/2019/10/avatar6.png',\n 'https://storage.jewheart.com/content/users/avatars/3595/avatar_3595_500.jpg?1558627791'\n ];\n $userDateList=[\n '1989/12/06',\n '1990/03/26',\n '1992/06/29',\n '1996/04/30',\n '1998/03/14'\n ];\n $userEmailList=[\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]'\n ];\n for($i=0; $i<5; $i++){\n $user=new User();\n $user->name = $userNameList[$i];\n $user->surname = $userSurnameList[$i];\n $user->img_path = $userImgList[$i];\n $user->date_of_birth = $userDateList[$i];\n $user->email = $userEmailList[$i];\n $user->password = Hash::make($faker->password());\n $user->save();\n }\n \n $userObj=new User();\n $userObj->name = 'Andrea';\n $userObj->surname = 'Calzolari';\n $userObj->img_path = 'https://www.focusedu.org/wp-content/uploads/2018/12/circled-user-male-skin-type-1-2.png';\n $userObj->date_of_birth = '1980/02/02';\n $userObj->email = '[email protected]';\n $userObj->password = '$2y$10$GucQhVApDtnNFGjO9snLUeXMQo1NwU6p60V6Xs6DHAJzD.MBpqyZW';// ciccio1234\n $userObj->save();\n \n $serviceList=[\n 'Wi-fi',\n 'Riscaldamento',\n 'Condizionatore',\n 'Piscina',\n 'Parcheggio auto',\n 'Animali ammessi',\n 'Tv',\n 'Giardino',\n 'Cucina',\n 'Lavanderia',\n 'Cassaforte',\n 'Palestra',\n 'Vista mare',\n 'Centro città',\n 'Frigo'\n ];\n $serviceIDList=[];\n \n foreach($serviceList as $service){\n $serviceObject= new Service();\n $serviceObject->title=$service;\n $serviceObject->save();\n $serviceIDList[]=$serviceObject->id;\n }\n\n $apartmentDescriptionList=[\n \"Un appartamento spazioso e luminoso facente parte di un Monastero di fine '800 restaurato con corpo e anima in ogni sua parte per donare ai nostri ospiti eleganza, pulizia e comfort. Con accesso indipendente ed ubicato a 30 mt dalla centralissima e storica Via Roma troverete, in casa e nei dintorni, tutto ciò che serve per vivere una vacanza in comodità e relax!\n Welcome to Palermo!!\n Lo spazio\n Ciuri ri Puisia è un pied à terre, con arredi moderni e vintage che si fondono in una miscela di elegante raffinatezza. Da pochissimo restaurato tramite meticoloso ripristino delle bellezze architettoniche originarie e ben rifinito, è così composto: living room con zona cucina dotata di ogni comfort (tavolo/console, 4 sedie, piastra ad induzione, frigorifero con freezer, macchinetta del caffè, tostapane, forno a microonde con grill, ferro da stiro e asse da stiro, TV 4K con NetFlix) e zona relax (sofa/letto matrimoniale) con smart TV di fronte; una camera patronale molto grande con letto matrimoniale (160x190), smart TV 4K 43” con NetFilx, condizionatore silenziosissimo, armadio; bagno con vaso e bidet, phon e kit cortesia,\n (bagnoschiuma e doccia shampoo), doccia extra-size con cromoterapia. L’appartamento è inoltre provvisto di Wi-Fi ILLIMITATO con FIBRA. Possibilità di parcheggio free nei vicoli adiacenti o parking custodito h24 a pagamento. L’appartamento si trova al pianterreno ed, essendo storico è praticamente insonorizzato perchè dotato di mura di circa 1,20 metri di spessore; ha inoltre accesso indipendente con self check-in (a qualsiasi orario) e con doppio portone.\n Per chi arriva con l'auto:\n L'appartamento si trova sul perimetro della Zona Traffico Limitato, attiva dal lunedì al venerdì dalle ore 8.00 alle ore 20.00 ma, con i miei consigli, sarà possibile arrivare a 50 metri dall'appartamento, senza dover acquistare il pass giornaliero.\n E' possibile parcheggiare l'automobile in un parcheggio libero non custodito a 150 mt dall'appartamento, se c'è disponibilità, oppure sono presenti parcheggi privati a pochi metri al costo di 10/15 euro al giorno circa (la tariffa può cambiare).\",\n \"Piccolo monolocale appena ristrutturato al quarto piano (senza ascensore) nel cuore della zona Liberty di Milano, a due passi dalla fermata di Porta Venezia M1. Comodo divano letto, TV, WiFi, doccia ed aria condizionata.\n L'appartamento è situato al quarto piano SENZA ascensore.\n Altre cose da tenere a mente\n Usiamo un sistema di self check in direttamente presso l'abitazione. Vi invieremo un link per effettuare il check in on line (da fare TASSATIVAMENTE entro le 19 del giorno precedente l'arrivo) e riceverete le istruzioni circa 24 ore prima dell'arrivo.\",\n \"La casa è situata in un podere adiacente ai parchi nazionali delle colline metallifere. A solo 1 Km dal paese di Montieri si affaccia su una vallata di boschi che comprende parte del senese. Il silenzio della natura circonda l'abitazione.\n Lo spazio\n L'alloggio è composto da 3 piani: al piano superiore c'è una camera con un letto matrimoniale e uno singolo; al piano centrale c'è una camera con letto a castello e il bagno; al piano inferiore c'è la cucina e la zona giorno. Terrazzo privato.\n Accesso per gli ospiti\n Gli ospiti sono liberi di girare in tutto il podere. A loro disposizione piscina con lettini e ombrelloni, e pergola toscana con vista panoramica.\",\n \"Ca Beo (URB120), casa 5 locali 300 m2 su 2 piani. Arredamento curato e accogliente: soggiorno con camino e TV. Uscita sulla terrazza. 1 camera con 1 letto doppio. Sala da pranzo con tavolo da pranzo. Cucina (forno, lavastoviglie, 5 fuochi, congelatore) con...\n Lo spazio\n ... tavolo da pranzo. Uscita sulla terrazza. Bagno/WC. Piano superiore: (scala senza ringhiera) 2 camere, ogni camera con 1 letto doppio e climatizzazione. Bagno/WC, doccia/WC. Riscaldamento a gas. Pavimenti in parquet. 2 terrazze coperta. Mobili da terrazza, sedie a sdraio. Bella vista panoramica sulla campagna. A disposizione: lavatrice, ferro da stiro. Internet (Wireless LAN [WLAN], gratis). Prego notare: casa per non fumatori. Il corrimano della galleria è alto 85 cm.\n \n I servizi aggiuntivi (opzionali) possono essere soggetti a costi extra pagabili in loco. Vi preghiamo di leggere la sezione “regole della casa” per i dettagli.\n Non esitate a contattarci in caso di domande. Grazie.\n Casa Ca Beo, piacevole, rustica, indipendente. A 5 km dal centro di Urbino, a 45 km dal centro di San Marino, posizione elevata, a 45 km dal mare, immerso nel verde. Per uso privato: terreno 4'000 m2 con piante e alberi, prato. Accesso 300 m di strada (strada non asfaltata). Box. Negozio 5 km, supermercato 5 km, spiaggia sabbiosa Fano 45 km, piscina 8 km. Il proprietario non accetta gruppi di giovani.\n Lo Short lets di Luigi Proietti, è un loft (una ex stalla) adibita a locazione turistica breve, non imprenditoriale.\n A Roma ma in piena campagna nei pressi della via Aurelia, dista soli 20 Km da San Pietro; 15 dal mare; 30 dall'Aeroporto di Fiumicino; 25 da Cerveteri; 58 dal porto di Civitavecchia; 28 dai laghi; 5 dall' Oasi Lipu di Castel Di Guido; 10 dal GRA.\n Parcheggio e giardino privato, lavatrice, Wfi, Tv.\n Lo spazio\n Immersa nella quiete della campagna romana, all'interno di una azienda agricola, il loft rappresenta un'autentica domus anghelos, uno spazio paradisiaco che si affaccia sopra un boschetto. Le ampie finestre lasciano penetrare il verde e l'azzurro circostanti. All'interno, un ampio salone è predisposto per la zona pranzo, relax e due zone letto.\n All'esterno è possibile mangiare nella veranda o nel giardino, in parte ombrato da alberi da fico.\n Accesso per gli ospiti\n Gli ospiti potranno accedere in ogni parte della casa e visitare l'azienda agricola. Per coloro che hanno particolari problemi di allergia, facciamo presente che nell'azienda agricola sono presenti diversi animali, compresi cani e gatti.\",\n \"Questa è una grande stanza privata luminosa in appartamento condivisa con altre 2. La casa è in posizione facile per andare a Venezia, c'è la fermata dell'autobus a 50 metri per andare a Venezia in 5 minuti e gli autobus vanno in un giorno e tutta la notte. La casa è ben collegata alla stazione ferroviaria e all'aeroporto. cucina e un grande bagno, comodo bagno con wc, doccia e bidet. Vengono forniti il bagnoschiuma, lo shampoo e il sapone. C'è un secondo bagno in cui c'è una lavatrice.\n Lo spazio\n Stanza situata a Mestre , a due minuti dalla fermata dell'autobus per Venezia, a un quarto d'ora dalla stazione dei treni. Vicina a supermercati e discount\n Questo appartamento è ben posizionato e si trova al terzo piano. Il mio appartamento è situato in un quartiere tranquillo con un accesso facile e veloce a Venezia. Asciugamani ed elementi essenziali sono forniti. Le camere sono grandi, pulite e confortevoli e possono ospitare comodamente 2 persone. Il mio appartamento è a 15 minuti di distanza in autobus da Venezia. La fermata dell'autobus è in Corso del popolo che è la strada principale e un minuto a piedi dall'appartamento.\",\n \"L'appartamento indipendente al piano terra della villa con piscina, è ad uso esclusivo dei clienti. Può ospitare un unico gruppo familiare o di amici alla volta.\n Incastonata nel verde dei Monti Cimini, consente di raggiungere facilmente i sentieri per gli amanti del trekking e della Mountain-bike. Situata a solo 1 km da Bagnaia, caratteristico paesino medioevale di Viterbo, gode di un ottima posizione anche per chi vuole visitare Villa Lante, Palazzo Farnese, il Parco dei Mostri, lago di Vico..\n Lo spazio\n Di fronte l’appartamento c’è il giardino ad uso esclusivo degli ospiti, in oltre i clienti potranno muoversi liberamente per l’intero podere condividendo gli spazi con la famiglia. Potranno godere della vista mozzafiato dei Monti che coronano il podere, osservare gli animali rispettando i loro spazi e il loro benessere, potranno accedere alla piscina e utilizzare il barbecue e le attrezzature messe a disposizione.\n Accesso per gli ospiti\n I clienti saranno dotati delle chiavi per poter entrare ed uscire liberamente dal cancello della proprietà e per accedere all’appartamento.\n Altre cose da tenere a mente\n Di fronte all’ingresso della villa partono vari sentieri nel bosco per gli amanti del trekking o della mountain-bike. È possibile anche praticare il bird watching o avvistare altri esemplari di fauna selvatica. A due chilometri gli appassionati della storia e delle bellezze architettoniche potranno visitare la famosa Villa Lante e il giardino delle Peonie più grande d’Europa.\",\n \"L’appartamento è confortevole, accogliente, per 2 persone.Ogni singolo oggetto d’arredo è stato scelto con cura ed è completo di tutto l’occorrente: lenzuola, asciugamani, stoviglie, ecc.ecc.\n E’ inserito nel suggestivo contesto di uno stabile vecchia Milano costruito nel 1900, ed è posizionato idealmente, così da avere silenzio e tranquillità.\n Sotto casa ci sono molti negozi utili e un supermercato Carrefour.\n Mezzi pubblici di superficie e metro sono a 2 minuti a piedi.\",\n \"Appartamento elegante e signorile, appena ristrutturato, situato nella prestigiosa Piazza di Trevi. E' dotato di un lussuoso salone, una comoda camera da letto, una cucina abitabile e un bagno: tutti gli spazi sono arredati da rivestimenti con oltre un secolo di storia. Dispone di copertura gratuita di wi-fi e di AC, tv satellitare ed ogni comfort.\n Lo spazio\n The apartment is located on the second floor without elevator of a stucco building on Trevi Square, has a sumptuous double bedroom and an elegant lounge overlooking the Fountain.\n The bedroom has a comfortable double bed, in the living room you can use a double sofa bed with 18cm mattress and a single sleeping area.\n The kitchen is equipped with an induction hob and any utensil, including a Nespresso machine for an Italian coffee.\n The bathroom, tiled with antique tiles, features bathroom amenities, a hairdryer and a hydromassage shower.\",\n \"Villa Alba, casa 4 locali 130 m2 su 2 piani. Arredamento confortevole e antico: sala da pranzo grande, aperta con TV (satellite). Uscita sulla veranda. 1 camera con 2 letti. Cucina aperta (4 punti cottura, forno, forno a microonde). Doccia/bidè/WC. Piano s...\n Lo spazio\n ...uperiore: 1 camera con 1 letto doppio (160 cm, lunghezza 190 cm). 1 camera con 1 letto doppio (160 cm, lunghezza 190 cm). Bagno/bidè/WC. Barbecue. Vista panoramica sulla campagna. A disposizione: lavatrice, seggiolone, letto per bambini. Internet (Wireless LAN [WLAN], gratis). Adatto alle famiglie.\n \n I servizi aggiuntivi (opzionali) possono essere soggetti a costi extra pagabili in loco. Vi preghiamo di leggere la sezione “regole della casa” per i dettagli.\n Non esitate a contattarci in caso di domande. Grazie.\n La casa, completamente ristrutturata da un ex fienile, è situata nelle colline del Chianti a breve distanza da San Gimignano, famosa per le sue torri medievali. Villa Alba, indipendente. A 3 km dal centro di San Gimignano, a 31 km dal centro di Volterra, a 45 km dal centro di Siena, posizione tranquilla, soleggiata, immerso nel verde. Per uso privato: giardino 500 m2 (recintato), piscina (11 x 6 m, profondità 140 cm, 14.05.-08.10.). Doccia esterna, mobili da giardino, barbecue. Accesso fino alla casa (800 m strada non asfaltata). Parcheggio nella proprietà. Supermercato 3 km, ristorante 3 km. Campo da golf (18 buche) 22 km. Attrazioni nelle vicinanze: Certaldo 12 km, Colle Val d'Elsa 17 km, Monteriggioni 29 km, Castellina in Chianti 36 km, Radda in Chianti, Greve in Chianti 44 km, Firenze 56 km.\",\n \"Incantevole e spazioso appartamento che ospita 2 persone con grande agio ed è dotato di ogni tipo di comfort, tra cui un ampio terrazzo arredato e un posto auto coperto assegnato. L'alloggio è ubicato in posizione esclusiva: trovandosi in una strada secondaria che interseca C.so San Maurizio, offre infatti la possibilità di soggiornare in un'oasi di tranquillità, ma al tempo stesso di essere a soli 250 metri dalla centralissima P.za Vittorio Veneto, da cui poter esplorare comodamente la città.\n Lo spazio\n L'alloggio di 85 mq si trova al primo piano di uno stabile con ascensore ed è composto come segue:\n - Ampia area living di 50mq dotata di TV e zona pranzo di 20 mq. L'angolo cottura è attrezzato con piano cottura a gas, frigorifero, congelatore, lavastoviglie, moka, bollitore elettrico, tostapane, spremiagrumi, forno tradizionale combinato con microonde\n - Camera da letto con letto matrimoniale, guardaroba e ventilatore a soffitto\n - Toilette con wc, bidet e doccia in muratura\n - Terrazzo di 20mq dotato di copertura retrattile e attrezzato con tavolino, divanetto e due poltrone\n Disponibile un posto auto assegnato in cortile, coperto da tettoia.\n Ulteriori servizi a disposizione degli ospiti: WIFI ILLIMITATO, riscaldamento autonomo con caldaia, lavatrice, asciugatrice, zanzariere, stendino, ferro e asse da stiro.\n \n Asciugamani e biancheria letto inclusi (con cambi facoltativi a pagamento).\n N.B. In caso di soggiorni lunghi (superiori ai 30 giorni) la biancheria verrà ritirata ogni massimo 15 giorni dall'impresa di pulizia.\n Una volta ritirata l'ospite potrà scegliere:\n -di utilizzare la propria;\n -la sostituzione, in questo caso c'è un costo di 15€ per un set matrimoniale, per ogni ulteriore set 8€.\",\n \"Il Rifugio del Marinaio è un appartamento nel centro storico di Bari, situato a pochi metri dalla movida e dai principali punti di interesse come Piazza Mercantile, Piazza Ferrarese, il Lungomare di Bari e la Basilica di San Nicola. Si trova a circa 2 km dalla spiaggia Pane e Pomodoro. La casa è dotata di una camera da letto, soggiorno, bagno e cucina. Dispone di TV schermo piatto, aria condizionata e balcone.\",\n \"Podere Casidote, casa 6 locali 115 m2 su 2 piani. Luminoso, arredamento accogliente: 1 camera con 1 letto doppio. Uscita sul giardino. 2 camere, ogni camera con 2 letti. Uscita sul giardino. 1 camera con 1 letto. Uscita sul giardino. Cucina abitabile (forn...\n Lo spazio\n ...ello a gas, 4 fuochi, bollitore elettrico) con tavolo da pranzo. Uscita sulla terrazza. Bagno/bidè/WC, doccia/bidè/WC. Riscaldamento a gas. Piano superiore: cucina abitabile (lavastoviglie, fornello a gas, 4 fuochi, bollitore elettrico, macchina del caffè elettrica) con camino e tavolo da pranzo. Uscita sulla terrazza. Doccia/bidè/WC. Riscaldamento a gas. 2 terrazze coperta, patio. Barbecue, sedie a sdraio, ripostiglio. Vista panoramica. A disposizione: lavatrice, letto per bambini. Prego notare: appartamento per non fumatori. 2 animali/cani permessi.\n \n I servizi aggiuntivi (opzionali) possono essere soggetti a costi extra pagabili in loco. Vi preghiamo di leggere la sezione “regole della casa” per i dettagli.\n Non esitate a contattarci in caso di domande. Grazie.\n Casa di campagna Podere Casidote, indipendente, circondata da prati e campi. A 3 km dal centro di Montieri, a 20 km dal centro di Massa Marittima, in collina, a 40 km dal mare. Per uso privato: terreno incolto 3'000 m2 con fiori e alberi. Accesso (800 m strada non asfaltata). Parcheggio nella proprietà. Negozio 3 km, spiaggia sabbiosa Follonica 40 km, lago balneabile Accesa 30 km. Sentieri per passeggiate vicino alla casa 10 m. Attrazioni nelle vicinanze: Giardino dei Suoni 11 km.\",\n \"Una piccola casa,arredata interamente in legno naturale,con un letto matrimoniale e un letto a castello ,camino e forno a legna . Un giardino attrezzato con barbeque , lettini e divani con accesso privato al lago.\n Lo spazio\n Una casa con giardino privato e recintato attrezzato con barbeque e lettini da cui si può accedere al lago per fare i bagni. Arredata in stile naturale , ha una camera con un letto matrimoniale e 2 originali letti a castello costruiti sopra . In sala un divano che può diventare un comodo letto.Cucina attrezzata , camino e forno a legna. CIR 09704-CNI-00019\n Accesso per gli ospiti\n Comodo parcheggio privato gratuito.\",\n \"Piccolo monolocale appena ristrutturato al quarto piano (senza ascensore) nel cuore della zona Liberty di Milano, a due passi dalla fermata di Porta Venezia M1. Comodo divano letto, TV, WiFi, doccia ed aria condizionata.\n Lo spazio\n L'appartamento è situato al quarto piano SENZA ascensore.\n Altre cose da tenere a mente\n Usiamo un sistema di self check in direttamente presso l'abitazione. Vi invieremo un link per effettuare il check in on line (da fare TASSATIVAMENTE entro le 19 del giorno precedente l'arrivo) e riceverete le istruzioni circa 24 ore prima dell'arrivo.\",\n \"Questo ampio bilocale offre tutte le comodità che servono alle famiglie che viaggiano. Un letto matrimoniale e due divani trasformabili in letto, offrono fino a 6 posti letto. La casa è dotata di biancheria, asciugamani, stoviglie, elettrodomestici, per garantire il massimo comfort agli ospiti. L’appartamento è situato a 15 minuti a piedi dalla centralissima Piazza Statuto e Stazione Porta Susa ed a 3 minuti dal Parco della Pellerina. Comoda alla Metropolitana ed alle linee dei mezzi 13 e 71.\n Lo spazio\n L’alloggio è costituito da un disimpegno all’ingresso, un soggiorno con angolo cucina, tavolo per sei persone, divano letto e tv; una seconda camera completa di letto matrimoniale, armadio guardaroba e secondo divano letto; un bagno completo di finestra, lavabo, doccia, WC e bidet. Sono presenti tutti gli elettrodomestici principali come lavatrice, forno a microonde, macchina caffè Nespresso, piano cottura a induzione con cappa aspirante. Posate, piatti, pentole, asciugamani, lenzuola, coperte, etc..., completano la dotazione di questo appartamento.\",\n \"Appartamento nuovo, confortevole, in una villa signorile con giardino panoramico. Composto da un ampio e luminoso soggiorno living con angolo cottura, da una spaziosa camera da letto matrimoniale e da un bagno con finestra. Si affaccia sul terrazzo panoramico e sul giardino privato. È possibile attrezzare altri due posti letto per bambini o uno per adulti. Raggiungibile soltanto in auto, a 5 minuti da Ivrea e dall’autostrada per Torino, Aosta e Milano. È dotato di antifurto e di posto auto.\n Lo spazio\n L'alloggio è ben arredato e dispone di tutti i servizi necessari. La sua caratteristica è quella di essere indipendente, in un luogo tranquillo e di poter usufruire di spazi esterni (portico, giardino) che renderanno il soggiorno piacevole e rilassante. È possibile attrezzare altri due posti letto per bambini in soggiorno o uno per adulti. Nella camera si può aggiungere un lettino per bambini piccoli. L'alloggio è adatto a persone singole, coppie, famiglie, per vacanza o per soggiorni di lavoro.\n Altre cose da tenere a mente\n La posizione permette di utilizzare la permanenza sia per godere di alcuni giorni di riposo e di svago, sia di una pausa durante un viaggio lungo senza allontanarsi dalle vie di comunicazione, vista la comodità di accesso all'autostrada per Aosta, Milano, Torino o Genova. Nel paese, a pochi minuti dall'appartamento, si trova il Castello di Parella, magnifica residenza magnificamente restaurata e circondata da un parco e da interessanti botteghe. Nel circondario si potrà inoltre scoprire un territorio ricco di aspetti geologici- naturalistici e di storia quali il parco del Gran Paradiso e le dimore Sabaude.\n Informazioni su questo spazio\n Véritable nid douillet, tout a été pensé pour votre confort. Un lieu cosy, aménagé par Marie avec des matériaux naturels et bruts. La salle de bain séparée permet détente et relaxation. La terrasse vous permet de profiter d'un bon moment avec votre lecture préférée, de prendre votre petit-déjeuner ou de passer une bonne soirée à la douceur du brasero.\n Lo spazio\n Le plaisir de la cabane avec tout le confort et la chaleur du foyer.\n Accesso per gli ospiti\n Un parking est à votre disposition à 30 m de la cabane. Vous aurez aussi la possibilité si vous le désirez de ranger vos vélos au garage .\",\n \"Il loft Quadrilatero si compone di un grande open space, disegnato in stile moderno e industriale da un importante architetto italiano. Si accede ad esso attraverso un ingresso di ringhiera verde e tipico delle antiche case torinesi. (L’androne di accesso è pulito, ma a differenza della facciata, non restaurato. Non fatevi spaventare!!). L’intero appartamento riceve un sacco di luce solare grazie alla sua doppia esposizione ed è molto accogliente di notte.\n La cucina è perfettamente equipaggiata con tutto ció che serve per cucinare.\n La camera da letto principale è composta da un letto tondo comodissimo (diametro 2 metri), una cabina armadio molto spaziosa ed un vecchio pianoforte che vi invitiamo a suonare (ma solo dalle 9 del mattino alle 22 della sera). La camera da letto è divisa dal resto della casa da una pesante tenda, in tutto identica a quelle dei palcoscenici teatrali.\n L’altra camera da letto è composta da un divano letto matrimoniale ed ha la sua propria porta, cosa che consente maggiore privacy. (NB questa camera dá direttamente sulla strada e nei fine settimana si possono sentire le chiacchiere delle persone che passeggiano per il quartiere. Nel caso abbiate problemi ad addormentarvi vi invitiamo ad utilizzare il futón posto nell’open space o a tenere in considerazione questo fatto al momento della prenotazione)\n Esiste anche la possibilitá di accedere ad un piccolo solaio equipaggiato di una chaise long. È l’ideale se volete concedervi un po’ di relax o per leggere un libro. Puó accedervi solo una persona alla volta ed ha un’altezza di solo un metro, per cui attenti alla testa!!\n Repubblica1bis Luxury Apartment è un elegante appartamento situato nella famosa piazza della Repubblica, nel pieno centro storico di Torino. Il palazzo fu progettato nel ‘700 dal famoso architetto Filippo Juvarra.\n Da qui è possibile raggiungere comodamente a piedi tutte le maggiori attrazioni della città. L'appartamento è stato finemente ristrutturato, ripristinando i soffitti a cassettone originali e mixando un arredamento contemporaneo accostato a pezzi di antiquariato.\n Lo spazio\n L'alloggio, la cui superficie è di 150 mq, è stato recentemente ristrutturato esaltando i particolari d'epoca, ed è situato al terzo piano, raggiungibile anche tramite ascensore. L'alloggio dispone di un ingresso, 2 ampie camere da letto matrimoniali, 2 bagni (uno con doccia e uno con vasca), una cucina, uno splendido salone con camino di 45 mq, con divano letto matrimoniale. Nel caso ci fossero bambini piccoli, potranno essere forniti i lettini su richiesta.\n Gli ospiti potranno usufruire di connessione internet Wi-Fi in ogni stanza. Verranno fornite lenzuola e 3 asciugamani (doccia, lavabo, bidet) per ciascun ospite. La cucina nuova è completamente attrezzata con forno, lavastoviglie, stoviglie, pentole e macchinetta del caffè Nespresso. E’ presente l’aria condizionata in ogni stanza. Inoltre, sono disponibili una lavatrice, asse e ferro da stiro e stendibiancheria. E' presente una TV nel salone.\n Casa Ada è un appartamento luminoso, fresco e accogliente situato in una tranquilla zona residenziale nella parte alta di Lecco, ai piedi del Resegone. Ideale per chi ricerca il contatto con la natura, pur restando in un contesto urbano. Dalla casa partono sentieri adatti a famiglie e a chi ama la montagna e gli spazi aperti. La casa, appena rinnovata, è anche una soluzione ottimale per lavoratori a distanza, in remote working, in cerca di pace e di una fuga dalla città\n Lo spazio\n L'appartamento si trova al secondo piano di una piccola palazzina con ascensore. E' composto da un soggiorno con due poltrone letto adatte a ragazzi (stile tatami), Smart TV con Netflix e DVD, stereo CD, desk per pc, wi-fi, una cucina completamente equipaggiata, una camera matrimoniale con balcone (o su richiesta con due letti singoli) un bagno con ampia doccia e angolo lavanderia.\n Per famiglie con bimbi piccoli è disponibile un lettino da campeggio e un seggiolone.\n L'appartamento è completo di dotazione biancheria letto e bagno.\n Per gli ospiti che arrivano in auto è possibile parcheggiare liberamente sotto casa o nel garage privato\",\n \"La stanza è sita in un ampio appartamento a sua volta ubicato in uno storico palazzo del dopoguerra: centralissimo. Lo spazio Una stanza finemente arredata, che ho attrezzato in risposta alle esigenze che io stesso, a seguito dei miei numerosi viaggi,ho riscontrato.\n Accesso per gli ospiti\n Gli ospiti possono usufruire, oltre che della loro stanza, anche di tutti i servizi disponibili in casa, incluso il bagno condiviso con me e con gli altri ospiti.\n Altre cose da tenere a mente\n La mia casa è una risorsa e al contempo una grande opportunità per chi la sceglie, sarò lieto di assistere i miei ospiti al meglio!\n Non dovrebbe nemmeno essere specificato, ma lo faccio per chiarezza: LGBT benvenuti a casa mia!\n Le zone comuni dell’appartamento sono sorvegliate da telecamere per la reciproca tutela e sicurezza.\",\n \"Nuovissimo accogliente bilocale di 65 mq con doppio balcone, perfetto per 2 persone, situato al 1° piano di uno stabile con ascensore.\n Lo spazio\n SONO CONSENTITI SOGGIORNI DI MEDIA/LUNGA DURATA CON CONTRATTO DI LOCAZIONE TURISTICA O TRANSITORIO FINO A 1 ANNO\n \n Lo spazio interno è così organizzato:\n - SOGGIORNO con smart TV, divano eventualmente utilizzabile come terzo posto letto e da segnalare in fase di prenotazione, tavolo da pranzo;\n - CUCINA con frigorifero, congelatore, lavastoviglie, forno tradizionale, microonde, bollitore elettrico e moka. Piccolo balcone;\n - CAMERA DA LETTO con letto matrimoniale, guardaroba, TV e ampio terrazzo;\n - BAGNO con bidet e box doccia.\n \n Ulteriori servizi a disposizione degli ospiti: WIFI, A/C con split in soggiorno, riscaldamento, lavatrice, ferro e asse da stiro.\",\n \"Una piccola casa,arredata interamente in legno naturale,con un letto matrimoniale e un letto a castello ,camino e forno a legna . Un giardino attrezzato con barbeque , lettini e divani con accesso privato al lago.\n Lo spazio\n Una casa con giardino privato e recintato attrezzato con barbeque e lettini da cui si può accedere al lago per fare i bagni. Arredata in stile naturale , ha una camera con un letto matrimoniale e 2 originali letti a castello costruiti sopra . In sala un divano che può diventare un comodo letto.Cucina attrezzata , camino e forno a legna. CIR 09704-CNI-00019\n Accesso per gli ospiti\n Comodo parcheggio privato gratuito.\",\n \"Splendido appartamento situato nel cuore del centro storico di Palermo, può ospitare fino a 4 persone ed è composto da cucina, living spazioso con divano letto matrimoniale , camera da letto matrimoniale e due bagni con doccia. Arredamento moderno, connessione wi-fi, TV LED 32, finestre insonorizzate, riscaldamento, frigo, cucina e bagno attrezzati, biancheria da letto e da bagno. L'appartamento si trova al primo piano, ASCENSORE.\n Lo spazio\n L'appartamento si trova al centro storico della città, posizione unica per vivere al meglio Palermo. A pochi passi si trova il mercato di Ballarò dove è possibile comprare pesce, semenze e spezie, frutta e verdura fresca ma anche provare il tipico street food palermitano! Di giorno sarà impossibile non perdersi nelle vie antiche di Palermo e ammirare le meraviglie che la città nasconde! Il tourist information è a pochi passi dalla proprietà se volete organizzare qualche gita fuori porta! Inoltre la stazione dei treni e degli autobus è a pochi passi dall'appartamento!\n Accesso per gli ospiti\n Gli ospiti avranno accesso all'intera proprietà.\",\n\n ];\n $apartmentAddressList=[\n \"Via Roma 261, Palermo, PA\",\n \"Via Antonio Mongitore, 4, 90134 Palermo PA\",\n \"Via Schiavo Michele, 90134 Palermo PA\",\n \"Via Aleardo Aleardi, 78, 30172 Venezia VE\",\n \"Via Cappuccina, 30172 Venezia VE\",\n \"Via Goffredo Mameli, 20129 Milano MI\",\n \"Via Marcona, 20129 Milano MI\",\n \"Via Gallia, 00183 Roma RM\",\n \"Via Iberia, 16, 00183 Roma RM\",\n \"Piazza Epiro, 15-11, 00183 Roma RM\",\n \"Via Pietro Ravanas, 70123 Bari BA\",\n \"Via Principe Amedeo, 70122 Bari BA\",\n \"Via Giovanni Bovio, 38, 70123 Bari BA\",\n \"Via Angelo Inganni, 40, 20147 Milano MI\",\n \"Corso Vercelli, 22, 20145 Milano MI\",\n \"V.le Berengario, 15, 20149 Milano MI\",\n \"Rio Terà dei Pensieri, 328, 30135 Venezia VE\",\n \"Calle Larga dei Bari, 1223, 30135 Venezia VE\",\n \"Corte Coppo, 4346/a, 30124 Venezia VE\",\n \"Viale Regina Margherita, 316, 00161 Roma RM\",\n ];\n $apartmentTitleList=[\n \"Attico sul mare a Palermo\",\n \"La Casa di Davide\",\n \"Podere Rachele - Casa Ghiandaia\",\n \"Casa Das Areias\",\n \"G&G - Green Garden\",\n \"Lunattico 48 Central Milano\",\n \"The Milky House Milan\",\n \"Suite Sweet Dreams\",\n \"Villa Prada\",\n \"Incantevole appartamento nel cuore di Roma\",\n \"Il Rifugio del Marinaio\",\n \"Casa Momom, con ampio patio\",\n \"Casetta con fantastica vista lago!\",\n \"Moderno zona corso Como\",\n \"Appartamento Lontano dal Caos\",\n \"Soggiorna nel cuore di Milano\",\n \"Venice Vacation House\",\n \"The Greek Venetian Studio\",\n \"Ca' Milla: La Magia di Venezia\",\n \"Trevi Sweet Suite\",\n\n ];\n $apartmentImgList=[\n 'https://images.pexels.com/photos/2111768/pexels-photo-2111768.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/1450363/pexels-photo-1450363.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/276554/pexels-photo-276554.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/6775268/pexels-photo-6775268.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/2850347/pexels-photo-2850347.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/6077368/pexels-photo-6077368.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/4846461/pexels-photo-4846461.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/1668860/pexels-photo-1668860.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/6527069/pexels-photo-6527069.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/3038552/pexels-photo-3038552.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/208736/pexels-photo-208736.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/4846461/pexels-photo-4846461.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/65225/boat-house-cottage-waters-lake-65225.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/7511693/pexels-photo-7511693.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/7227621/pexels-photo-7227621.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/1571459/pexels-photo-1571459.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n 'https://images.pexels.com/photos/7746589/pexels-photo-7746589.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/2724748/pexels-photo-2724748.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/8134848/pexels-photo-8134848.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n 'https://images.pexels.com/photos/6585598/pexels-photo-6585598.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940',\n 'https://images.pexels.com/photos/2506990/pexels-photo-2506990.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',\n ];\n $apartmentLongitudeList=[\n 13.36286,\n 13.35764,\n 13.36067,\n 12.24017,\n 12.23751,\n 9.21315,\n 9.20954,\n 12.50376,\n 12.50551,\n 12.50379,\n 16.85847,\n 16.86127,\n 16.85889,\n 9.12581,\n 9.16122,\n 9.15169,\n 12.31737,\n 12.32566,\n 12.33525,\n 12.51171\n ];\n $apartmentLatitudeList=[\n 38.11847,\n 38.11074,\n 38.11062,\n 45.48717,\n 45.48524,\n 45.46365,\n 45.46405,\n 41.88171,\n 41.87964,\n 41.87915,\n 41.12193,\n 41.12250,\n 41.12291,\n 45.45146,\n 45.46650,\n 45.47914,\n 45.43600,\n 45.44107,\n 45.43510,\n 41.90916\n ];\n \n for($x=0; $x<17; $x++){\n $apartment = new Apartment();\n $apartment->user_id=rand(1,5);\n $apartment->description=$apartmentDescriptionList[$x];\n $apartment->sponsorActive=false;\n $apartment->rooms_num=rand(5,8);\n $apartment->beds_num=rand(1,3);\n $apartment->bath_num=rand(1,2);\n $apartment->meters_size=rand(80,500);\n $apartment->address=$apartmentAddressList[$x];\n $apartment->title=$apartmentTitleList[$x];\n $apartment->visible=true;\n $apartment->img_path=$apartmentImgList[$x];\n $apartment->price_night=rand(80,200);\n $apartment->longitude=$apartmentLongitudeList[$x];\n $apartment->latitude=$apartmentLatitudeList[$x];\n\n $randServiceKeys = array_rand($serviceIDList, 10);\n $service1=$serviceIDList[$randServiceKeys[0]];\n $service2=$serviceIDList[$randServiceKeys[1]];\n $service3=$serviceIDList[$randServiceKeys[2]];\n $service4=$serviceIDList[$randServiceKeys[3]];\n $service5=$serviceIDList[$randServiceKeys[4]];\n $service6=$serviceIDList[$randServiceKeys[5]];\n $service7=$serviceIDList[$randServiceKeys[6]];\n $service8=$serviceIDList[$randServiceKeys[7]];\n $service9=$serviceIDList[$randServiceKeys[8]];\n $service10=$serviceIDList[$randServiceKeys[9]];\n\n $apartment->save();\n\n $apartment->service()->attach($service1);\n $apartment->service()->attach($service2);\n $apartment->service()->attach($service3);\n $apartment->service()->attach($service4);\n $apartment->service()->attach($service5);\n $apartment->service()->attach($service6);\n $apartment->service()->attach($service7);\n $apartment->service()->attach($service8);\n $apartment->service()->attach($service9);\n $apartment->service()->attach($service10);\n }\n\n for($z=17; $z<20; $z++){\n $apartment = new Apartment();\n $apartment->user_id=6;\n $apartment->description=$apartmentDescriptionList[$z];\n $apartment->rooms_num=rand(5,8);\n $apartment->beds_num=rand(1,3);\n $apartment->bath_num=rand(1,2);\n $apartment->meters_size=rand(80,500);\n $apartment->address=$apartmentAddressList[$z];\n $apartment->title=$apartmentTitleList[$z];\n $apartment->visible=true;\n $apartment->img_path=$apartmentImgList[$z];\n $apartment->price_night=rand(80,200);\n $apartment->longitude=$apartmentLongitudeList[$z];\n $apartment->latitude=$apartmentLatitudeList[$z];\n\n $randServiceKeys = array_rand($serviceIDList, 10);\n $service1=$serviceIDList[$randServiceKeys[0]];\n $service2=$serviceIDList[$randServiceKeys[1]];\n $service3=$serviceIDList[$randServiceKeys[2]];\n $service4=$serviceIDList[$randServiceKeys[3]];\n $service5=$serviceIDList[$randServiceKeys[4]];\n $service6=$serviceIDList[$randServiceKeys[5]];\n $service7=$serviceIDList[$randServiceKeys[6]];\n $service8=$serviceIDList[$randServiceKeys[7]];\n $service9=$serviceIDList[$randServiceKeys[8]];\n $service10=$serviceIDList[$randServiceKeys[9]];\n\n $apartment->save();\n\n $apartment->service()->attach($service1);\n $apartment->service()->attach($service2);\n $apartment->service()->attach($service3);\n $apartment->service()->attach($service4);\n $apartment->service()->attach($service5);\n $apartment->service()->attach($service6);\n $apartment->service()->attach($service7);\n $apartment->service()->attach($service8);\n $apartment->service()->attach($service9);\n $apartment->service()->attach($service10);\n }\n\n $messagesNameList=[\n 'Marco',\n 'Sebastian',\n 'Mariapia',\n 'Gianluca',\n 'Gianluigi'\n ];\n\n\n\n $messagesMailList=[\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n ];\n $messagesTextList=[\n \"Salve! Vorrei delle informazioni su questo appartamento, come la posso contattare?\",\n \"Salve, gradirei avere informazioni in merito al suo meraviglioso appartamento! Mi piace molto la Scandinavia e non vedo l'ora di passare lì le mie vacanze\",\n \"Buongiorno, volevo chiederLe, l'appartamento ha il riscaldamento autonomo o centralizzato?\",\n \"Ciao, volevo chiederle se l'appartamento è disponibile per Pasqua, grazie in anticipo\",\n \"Buonasera, per curiosità chi dovrebbe pagare i costi di riparazione in caso di danni?\"\n ];\n\n for($y=0; $y<5; $y++){\n $message=new Message();\n $message->apartment_id=rand(18,19);\n $message->full_name=$messagesNameList[$y];\n $message->email=$messagesMailList[$y];\n $message->text=$messagesTextList[$y];\n $message->save();\n }\n\n $sponsorNameList=[\n 'Bronzo',\n 'Argento',\n 'Oro',\n ];\n $sponsorPriceList=[\n 2.99,\n 5.99,\n 9.99,\n ];\n $sponsorHourList=[\n 24,\n 72,\n 144,\n ];\n for($r=0;$r<3;$r++){\n $sponsor=new Sponsor();\n $sponsor->name=$sponsorNameList[$r];\n $sponsor->hours=$sponsorHourList[$r];\n $sponsor->cost=$sponsorPriceList[$r];\n $sponsor->save();\n }\n\n $arrayApaID = [2,4,9,13,14];\n for($s=0;$s<count($arrayApaID);$s++){\n\n $apa_id = $arrayApaID[$s];\n $payment=new Payment();\n $payment->apartment_id = $apa_id;\n $apartment = Apartment::find($apa_id);\n $apartment->sponsorActive = true; \n $apartment->save();\n\n $payment->sponsor_id=rand(1,3);\n $payment->status=true;\n $payment->expire_date='2999/12/31';\n $payment->total=Sponsor::find($payment->sponsor_id)->cost;\n $payment->save();\n };\n\n for($a=0;$a<13;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->save();\n }\n for($a=0;$a<5;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-14 08:00:00\";\n $statistic->save();\n }\n for($a=0;$a<10;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-15 23:00:00\";\n $statistic->save();\n }\n for($a=0;$a<15;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-16 12:00:00\";\n $statistic->save();\n }\n for($a=0;$a<11;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-17 12:00:00\";\n $statistic->save();\n }\n for($a=0;$a<6;$a++) {\n $statistic = new Statistic();\n $statistic->guest_ip = $faker->localIpv4();\n //$statistic->guest_ip = Hash::make($faker->localIpv4());\n $statistic->apartment_id = 18;\n $statistic->created_at=\"2021-10-18 12:00:00\";\n $statistic->save();\n }\n }", "public function testExample()\n {\n\n $attributes = [\n 'name' => $this->faker->name,\n 'email' => $this->faker->email,\n 'password' => $this->faker->password,\n ];\n\n\n\n $this->assertTrue(true);\n }", "public function __invoke()\n {\n $faker = Factory::create();\n $genders = User::GENDERS;\n $gender = $faker->randomElement($genders);\n\n return [\n 'email' => $faker->email,\n 'password' => $faker->password,\n 'name' => $faker->name($gender),\n 'gender' => $gender,\n 'dateOfBirth' => $faker->dateTimeBetween('-100 years', '-18 years')->format('Y-m-d'),\n 'lat' => $faker->latitude,\n 'lng' => $faker->longitude\n ];\n }", "public function run()\n {\n\n $faker=Faker\\Factory::create('es_VE');\n// 'nombre'=>$faker->name,\n\n // $this->call(UsersTableSeeder::class);\n for ($i=0; $i < 100; $i++) {\n\n DB::table('telefonos')->insert([\n 'numero' => $faker->phoneNumber ,\n 'descripcion' =>'casa',\n 'empleados_id' => $faker->numberBetween($min=1,$max=9),\n\n//numberBetween($min = 1000, $max = 9000)\n\n ]);\n\n\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n /////////\n /*\n for ($i=0; $i < 100; $i++) {\n\n DB::table('empleados')->insert([\n 'nombre' => $faker->firstNameMale ,\n 'apellidos' => $faker->lastName.' '.$faker->lastName,\n 'sexo' => 'M',\n 'direccion' => $faker->direccion,\n 'empleados_id' => $faker->numberBetween($min=1,$max=9),\n 'areas_id' => $faker->numberBetween($min=102,$max=209), //102 -209\n 'cargos_id' =>$faker->numberBetween($min=1,$max=108),\n//numberBetween($min = 1000, $max = 9000)\n\n ]);\n\n\n }\n\n */\n\n }", "public function __construct()\n {\n $this->faker = $this->withFaker();\n }", "public function definition()\n {\n\n\n return [\n 'creator_id' => User::inRandomOrder()->first()->id,\n 'first_name' => $this->faker->firstName,\n 'last_name' => $this->faker->lastName,\n 'email' => $this->faker->email,\n 'phone' => $this->faker->phoneNumber\n ];\n }", "public function definition()\n {\n return [\n 'name_role' => $this->faker->firstName,\n 'all' => rand(0,1),\n 'home' => rand(0,1),\n 'products' => rand(0,1),\n 'orders' => rand(0,1),\n 'employees' => rand(0,1),\n ];\n }", "public function definition()\r\n {\r\n $country_ids = Country::pluck('id');\r\n $city_ids = City::pluck('id');\r\n return [\r\n 'country_id' => $this->faker->randomElement($country_ids),\r\n 'city_id' => $this->faker->randomElement($city_ids),\r\n 'first_name' => $this->faker->firstName,\r\n 'last_name' => $this->faker->lastName,\r\n 'email' => $this->faker->email,\r\n 'password' => $this->faker->password,\r\n 'mobile' => $this->faker->e164PhoneNumber,\r\n 'email_verified' => $this->faker->randomElement(['0', '1']),\r\n 'created_at' => $this->faker->dateTimeBetween('-6 week', '-5 week'),\r\n\r\n ];\r\n }", "public function test_treatments_can_get_all_by_name_true()\n {\n $this->seed();\n $user = User::where('email', '=', '[email protected]')->first();\n $token = JWTAuth::fromUser($user);\n $number = rand(2,6);\n Treatment::factory()\n ->count(3)\n ->for($user)\n ->create();\n $name = Str::random(10);\n Treatment::factory()->for($user)->create(['title'=> $name]);\n $response = $this->json('GET','/api/treatments?token='.$token.'&name='.$name);\n\n $response->assertStatus(200)->assertJsonCount(1, 'data');\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $data = [];\n for ($i = 0; $i < 100; $i++) {\n $data[] = [\n 'email' => $faker->email,\n 'password' => password_hash($faker->password, PASSWORD_DEFAULT),\n 'name' => $faker->name,\n 'is_verified' => $faker->boolean(),\n\n 'phone' => $faker->optional(0.9)->phoneNumber,\n 'photo_url' => $faker->imageUrl(),\n 'hobbies' => $faker->words(3, true),\n 'passion' => $faker->optional()->words(1, true),\n 'fav_quote' => $faker->optional()->sentence(6, true),\n 'fav_quote_author' => $faker->optional()->name,\n\n 'whatsapp' => $faker->optional(0.9)->phoneNumber,\n 'facebook' => $faker->optional(0.7)->userName,\n 'twitter' => $faker->optional(0.5)->userName,\n 'linkedin' => $faker->optional(0.3)->url,\n 'instagram' => $faker->optional(0.6)->userName,\n 'snapchat' => $faker->optional(0.5)->userName,\n 'website' => $faker->optional(0.4)->url,\n 'blog' => $faker->optional(0.4)->url,\n\n 'created_at' => $faker->dateTimeBetween(\"-2 years\", \"-1 year\")->format('Y-m-d H:i:s'),\n 'updated_at' => rand(0, 2) ? $faker->dateTimeThisYear->format('Y-m-d H:i:s') : null,\n ];\n }\n\n $this->insert('classmates', $data);\n }", "public function definition()\n {\n return [\n 'region' => $this->faker->state,\n 'city' => $this->faker->city,\n 'street' => $this->faker->streetAddress,\n //'country_id' => Country::firstOrCreate(['name' => 'Spain'])->id, //Fallo por duplicado\n 'country_id' => null,\n 'zipcode' => $this->faker->postcode,\n ];\n }", "public function run(Faker $faker)\n {\n //\n for ($i=0; $i < 15 ; $i++) {\n $category = new Categories();\n $category->category = $faker->word();\n $category->save();\n }\n }", "public function __construct(Generator $faker)\n {\n $this->faker = $faker;\n }", "protected function setUp(): void\n {\n parent::setUp();\n //$this->artisan(\"db:seed\");\n $this->validName[1] = random_int(100,1000000);\n $validName = implode('',$this->validName);\n\n }", "public function test_should_return_every_salt_random()\n {\n $salts = [];\n $generateLength = 100;\n\n for ($i = 0; $i < $generateLength; ++$i) {\n $salts[] = Salt::generate();\n }\n\n $this->assertEquals($generateLength, count(array_unique($salts)));\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i<10; $i++) {\n $new_post = new Post();\n\n $new_post->title = $faker->sentence(rand(1,5));\n $new_post->content = $faker->text();\n \n // genero lo slug\n $slug = Str::slug($new_post->title, '-');\n $slug_base = $slug;\n\n //verifico che lo slug non sia già presente nel db\n $slug_present = Post::where('slug', $slug)->first();\n $counter = 1;\n\n //ciclo fino a quando slug_present diventa true\n while($slug_present) {\n $slug = $slug_base.'-'.$counter;\n $counter++; \n $slug_present = Post::where('slug', $slug)->first();\n }\n\n $new_post->slug = $slug;\n\n //perchè ho solo 1 utente\n $new_post->user_id = 1;\n\n $new_post->save();\n }\n }", "public function run(Faker $faker)\n {\n \n Farmacia::create([\n 'nome' => $faker->name,\n 'titular' => $faker->name,\n 'nuit' => rand(),\t\n 'email'\t=> $faker->unique()->safeEmail,\n 'location' => $faker->address,\n 'number' => '5365146',\t\n 'image'\t=> 'farmacia1.jpg',\n 'descricao'\t=> Str::random(5),\n 'quarteirao' => '12',\t\n 'pais_id' => '1',\t\n 'provincia_id' => '2',\n 'bairro_id'\t=> '3',\n 'user_id' => '2',\n 'video_link' => 'https://www.youtube.com/watch?v=f79bjznvBvE&t=18s',\t\n 'image_empresa' => 'farmacia1.jpg',\n ]);\n\n Farmacia::create([\n 'nome' => $faker->name,\n 'titular' => $faker->name,\n 'nuit' => rand(),\t\n 'email'\t=> $faker->unique()->safeEmail,\n 'location' => $faker->address,\n 'number' => '5365146',\t\n 'image'\t=> 'farmacia2.jpg',\n 'descricao'\t=> Str::random(5),\n 'quarteirao' => '12',\t\n 'pais_id' => '1',\t\n 'provincia_id' => '2',\n 'bairro_id'\t=> '3',\n 'user_id' => '2',\n 'video_link' => 'https://www.youtube.com/watch?v=f79bjznvBvE&t=18s',\t\n 'image_empresa' => 'farmacia2.jpg',\n ]);\n\n Farmacia::create([\n 'nome' => $faker->name,\n 'titular' => $faker->name,\n 'nuit' => rand(),\t\n 'email'\t=> $faker->unique()->safeEmail,\n 'location' => $faker->address,\n 'number' => '5365146',\t\n 'image'\t=> 'farmacia3.png',\n 'descricao'\t=> Str::random(5),\n 'quarteirao' => '12',\t\n 'pais_id' => '1',\t\n 'provincia_id' => '2',\n 'bairro_id'\t=> '3',\n 'user_id' => '2',\n 'video_link' => 'https://www.youtube.com/watch?v=f79bjznvBvE&t=18s',\t\n 'image_empresa' => 'farmacia3.png',\n ]);\n \n }", "public function fakeName()\n {\n $faker = \\Faker\\Factory::create();\n\n return $this->setName($faker->word());\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\n ]);\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $limit = 15;\n for ($i = 0; $i < $limit; ++$i){\n DB::table('customers')->insert([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'email' => $faker->unique()->email,\n 'created_at' => $faker->dateTime($max = 'now'),\n 'updated_at' => $faker->dateTime($max = 'now'),\n ]);\n }\n}", "public function run(Faker $faker)\n {\n for ($i = 0; $i < 5; $i++) {\n $d = new Dish;\n $d->name = $faker->word();\n $d->restaurant_id = rand(1, 5);\n $d->ingredients = $faker->paragraph(2);\n $d->description = $faker->paragraph(3);\n $d->price = $faker->randomFloat(2, 0, 999);\n $d->visible = true;\n $d->image = 'dish_img/placeholder.jpg';\n $d->save();\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n for ($i=0; $i <100 ; $i++) { \n $item = [\n 'name' => $faker->name,\n 'short_desc' =>$faker->text(),\n 'content' =>$faker->text(),\n 'price'=> rand(800000,1000000),\n 'sale_price'=>rand(300000,500000),\n 'cate_id'=>rand(1,10),\n ];\n DB::table('products')->insert($item); \n }\n}", "public function definition()\n {\n $gender = $this->faker->randomElement(array('male', 'female'));\n // $id = $this->faker->randomElement(array(1,5));\n $age = $this->faker->numberBetween(19,99);\n return [\n 'first_name' => $this->faker->firstName($gender),\n 'last_name' => $this->faker->lastName,\n 'other_name' => $this->faker->lastName,\n 'username' => $this->faker->userName,\n 'age' => $age,\n 'gender' => $gender,\n 'dob' => $this->faker->date(),\n 'mobile' => $this->faker->phoneNumber,\n 'address' => $this->faker->streetAddress,\n 'city' => $this->faker->city,\n 'state' => $this->faker->state,\n 'doctor_note' => $this->faker->sentence(10),\n 'email' => $this->faker->unique()->safeEmail,\n 'email_verified_at' => now(),\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password\n 'remember_token' => Str::random(10),\n ];\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 500; $i++) { \n $seed = new Hit();\n // Get collection of 'id' from houses table\n $houses = House::all()->pluck('id')->toArray();\n\t\tDB::table('hits')->insert([\n\t\t\t'house_id' => $faker->randomElement($houses),\n\t\t\t'created_at' => $faker->dateTimeBetween('-1 year', 'now', null),\n\t\t]);\n }\n }", "public function run(Faker $faker)\n {\n for ($i=0; $i < 5 ; $i++) { \n for ($j=0; $j < 10 ; $j++) { \n $new_song = new Song();\n $new_song->title = $faker->sentence();\n $new_song->genre = $faker->randomElement([\n 'pop', 'jazz', 'blues', 'rock', 'country',\n 'reggae', 'metal', 'rap', 'indie', 'classic',\n ]); \n $new_song->album_id = $i + 1;\n $new_song->save();\n }\n }\n }", "public function testShouldNotSaveDuplicated()\n {\n ConfideUser::$app['confide.repository'] = m::mock( 'ConfideRepository' );\n ConfideUser::$app['confide.repository']->shouldReceive('userExists')\n ->with( $this->confide_user )\n ->andReturn( 1 )\n ->once();\n\n $this->populateUser();\n $this->confide_user->confirmation_code = '';\n $this->confide_user->confirmed = false;\n\n $this->assertFalse( $this->confide_user->save() );\n }", "public function run()\n {\n $faker = Faker::create();\n\n\n\n // for($i = 0; $i < 130; $i++) \n // {\n // DB::table('competition_user')->insert([\n // 'competition_id' => factory(App\\Competition::class)->create()->id,\n // 'user_id' =>$faker->biasedNumberBetween($min = 1, $max = 400, $function = 'sqrt'),\n // ]);\n \n // }\n\n }", "public function run()\n{\n $faker=Faker\\Factory::create('ja_JP');\n\n $taiken1=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);\n $taiken2=array(3,4,7,12,13,16,18);\n $taiken3=array(2,4,5,6,10,11,14,15,17,19,20,21);\n for($i=1;$i<20;$i++){\n $id_rand=rand(1,3);\n $taiken_rand=rand(1,21);\n $hoge=array(1=>$taiken1,2=>$taiken2,3=>$taiken3);\n for($j=1;$j<=count($hoge[$id_rand]);$j++){\n if(in_array($taiken_rand,$hoge[$id_rand])){\n break;\n }\n }\n if($j>count($hoge[$id_rand])){\n DB::table('Oc_Taiken1')->insert([\n 'oc_id'=>$id_rand,\n 'taiken_id'=>$taiken_rand\n ]);\n }else{\n $i--;\n }\n }\n }", "public function run(Faker $faker)\n {\n for($i = 0; $i < 50; $i++) {\n $data_trip = new Trip();\n $data_trip->name_destination = $faker->city();\n $data_trip->departure = $faker->dateTime;\n $data_trip->return = $faker->dateTime;\n $data_trip->price = $faker->randomNumber(5, false);\n $data_trip->save();\n }\n }", "public function run(Faker $faker)\n {\n factory(\\App\\LeaderboardReferral::class, 100)->create();\n }", "public function run()\n {\n\n$confirmation_code = str_random(30);\n User::create(array(\n 'id' => null,\n 'name' => \"nevdk\",\n 'password' => Hash::make(\"114948\"),\n 'email' => \"[email protected]\",\n 'avatar' => \"http://s1.cdnnz.net/var/news/2012/11/22/51906_dzhejk-dzhillenxol_or_jake.jpg\",\n 'confirmation_code' => $confirmation_code,\n 'fio' => \"Дмитрий Кухарчук\",\n 'about' => \"пёрсын\"\n\n )); \n\n\n\n \t/*$faker = Faker\\Factory::create('ru_RU');\n \t$faker->addProvider(new Faker\\Provider\\ru_RU\\Person($faker));\n \t$faker->addProvider(new Faker\\Provider\\ru_RU\\Internet($faker));\n \t$faker->addProvider(new Faker\\Provider\\Image($faker));\n \t$faker->addProvider(new Faker\\Provider\\ru_RU\\Text($faker));\n\n \tDB::table('users')->truncate();\n \tfor($i=0;$i<=20;$i++){\n\n User::create(array(\n 'id' => null,\n 'name' => $faker->userName,\n 'password' => $faker->password,\n 'email' => $faker->email,\n 'avatar' => $faker->imageUrl(100, 100, 'people'),\n 'fio' => $faker->firstName.\" \".$faker->lastName,\n 'about' => $faker->realText(200)\n\n )); \n\n \t}*/\n }" ]
[ "0.66459894", "0.6575948", "0.6337043", "0.625063", "0.62372965", "0.61977273", "0.6152319", "0.61330813", "0.6113082", "0.61096144", "0.61084604", "0.6108264", "0.61077005", "0.6034539", "0.60073674", "0.597235", "0.5948181", "0.5938741", "0.58922356", "0.5883463", "0.58827746", "0.5865646", "0.5856356", "0.583994", "0.5820272", "0.58178633", "0.58084035", "0.58040494", "0.57972175", "0.57948065", "0.5778957", "0.57742035", "0.5774072", "0.57624155", "0.57570136", "0.57409406", "0.57301706", "0.572916", "0.57210165", "0.5716509", "0.5713347", "0.5708807", "0.5688161", "0.56859255", "0.56844985", "0.5679613", "0.56774926", "0.5664491", "0.56630397", "0.5655198", "0.56529987", "0.56497896", "0.5646859", "0.56414527", "0.5636018", "0.56310654", "0.5628957", "0.5626121", "0.5625054", "0.56231254", "0.56214964", "0.56214845", "0.561635", "0.56162214", "0.560877", "0.5606875", "0.560375", "0.55951446", "0.55906993", "0.5590673", "0.5590185", "0.55886286", "0.55859274", "0.557995", "0.5578466", "0.55775595", "0.5577307", "0.5568304", "0.55655533", "0.5559461", "0.5555178", "0.5549829", "0.5545926", "0.55424184", "0.5536346", "0.5534976", "0.55333585", "0.55318594", "0.5530978", "0.55203855", "0.55160815", "0.5512151", "0.55082756", "0.55021554", "0.54991317", "0.54987913", "0.54984266", "0.54956937", "0.54935664", "0.5493532", "0.54852945" ]
0.0
-1
Get a listing Tags
public function index() { return response()->json(Tag::all(), 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTagList();", "public function getTags() {}", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function listTags() {\n\t\t$request = $this->send(\"GET\", \"contacts/\" . $this->contactId . '/tags', [\n\t\t\t'headers' => [\n\t\t\t\t'Accept' => 'application/json, */*',\n\t\t\t],\n\t\t]);\n\t\treturn $request;\n\t}", "public function actionTagList()\n {\n // Get params\n $q = mb_strtolower($this->request->getParam('q', ''));\n $limit = (int)$this->request->getParam('page_limit', 10);\n\n // Get list of tags\n $criteria = new \\EMongoCriteria();\n $criteria\n ->addCond('name', '==', new \\MongoRegex('/^' . preg_quote($q) . '/'))\n ->limit($limit)\n ->sort('name', \\EMongoCriteria::SORT_ASC);\n $tags = Qa\\Tag::model()->findAll($criteria);\n\n // Prepare tags for json\n $jsonTags = array();\n foreach ($tags as $tag) {\n $jsonTags[] = array(\n 'id' => $tag->name,\n 'text' => $tag->name\n );\n }\n\n // Render json\n $this->renderJson(array(\n 'tags' => $jsonTags,\n ));\n }", "public function getTags()\n {\n $title = \"Tags\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n // Get all the tags from db\n $tags = $this->di->get(\"tagModel\")->getAllTags();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"tags\" => $tags,\n ];\n\n $view->add(\"pages/tags\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function actionList() {\n $searchModel = new TagsSearch();\n $searchModel->load(Yii::$app->request->queryParams);\n $dataProvider = $searchModel->search();\n return $this->render('tag-list', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getList()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$tags = parent::getList();\r\n\t\t} else {\r\n\t\t\t$tags = $this->getGroupTagsList() +\r\n\t\t\t\t$this->getMembersTagsList() +\r\n\t\t\t\t$this->getDocumentsTagsList() +\r\n\t\t\t\t$this->getEventsTagsList() +\r\n\t\t\t\t$this->getPhotosTagsList() +\r\n\t\t\t\t$this->getListsTagsList();\r\n\t\t}\r\n return $tags;\r\n }", "public function getTags(): Collection;", "private function _getAllTags() {\n\n\t\t$param = [\n\t\t\t'table' => 'tags',\n\t\t\t'select' => '*'\n\t\t];\n\n\t\tif($this->CI->input->get()) {\n\t\t\tif(isset($this->CI->input->get['fields'])) { $param['select'] = $this->CI->input->get['fields']; }\n\t\t\tif(isset($this->CI->input->get['type'])) { $param['where'] = ['type' => $this->CI->input->get['type']]; }\n\t\t}\n\n\t\t$data = $this->CI->model->get($param);\n\t\tif(count($data)) { $this->CI->exitCode = 200; }\n\t\treturn ['data' => $data];\n\t}", "public function getTags() {\n try {\n $getTagsOperation = new GetTags();\n\n $getTagsResponse = $this->apiCall($getTagsOperation);\n $tagsList = $getTagsResponse->getData();\n\n if ($getTagsResponse->isSuccess()) {\n\n $response = [];\n\n if(is_array($tagsList) && count($tagsList) > 0) {\n foreach ($tagsList as $item) {\n $response[] = [\n 'id' => $item['tagId'],\n 'name' => $item['name']\n ];\n }\n }\n return $response;\n }\n }catch (\\Exception $e){\n throw new \\Exception($e->getMessage());\n }\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function get_tags()\r\n\t{\r\n\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=tag\");\r\n\t\treturn $xml;\r\n\t}", "public function index()\n {\n $resources = $this->repository->scope($this->request)->paginate();\n\n return $this->fractalCollection($resources, new TagTransformer(), 'tags');\n }", "public static function get_tags() {\n global $wpdb;\n $query = \"SELECT * FROM XTB_TAGS\";\n return $wpdb->get_results($query);\n }", "function getTags($tag) {\n \n \t$tags_request_url = sprintf($this->api_urls['tags'], $tag, $this->access_token);\n \t\n \treturn $this->__apiCall($tags_request_url);\n \n }", "public function index()\n {\n $tags = Tag::paginate(25);\n\n return $tags;\n }", "public function getTagList() {\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe tags table as a multi-dimensional array\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}topspin_tags.name\n\t\tFROM {$this->wpdb->prefix}topspin_tags\n\t\tWHERE\n\t\t\t{$this->wpdb->prefix}topspin_tags.artist_id = %d\nEOD;\n\t\t$data = $this->wpdb->get_results($this->wpdb->prepare($sql,array($this->artist_id)),ARRAY_A);\n\t\t##\tSet Default Status\n\t\tforeach($data as $key=>$row) {\n\t\t\t$data[$key]['status'] = 0;\n\t\t}\n\t\treturn $data;\n\t}", "public function index() {\n $tags = Tag::all();\n \treturn $tags;\n }", "public function tags();", "#[Get('/')]\n #[Operation(tags: ['Tags'])]\n #[Response(factory: TagsResponse::class, statusCode: 200)]\n public function list(): TagsResource\n {\n return new TagsResource(Tag::orderBy('name')->get());\n }", "public function index()\n {\n if(!Auth::user()->can('list-tag'))\n abort(403);\n $tags = $this->tag->page(20);\n return $this->respondWithPaginator($tags, new TagTransformer());\n }", "function get_tags(){\n global $DB;\n\n $collection = $DB->get_record('tag_coll',['name' => PLUGINNAME]);\n if (!$collection->id) {\n throw new moodle_exception('pluginname', 'local_tematica');\n }\n $tags = $DB->get_records('tag', ['tagcollid' => $collection->id]);\n return $tags;\n}", "public function tag_list()\n {\n $this->pushpin_id = $_GET['pushpinId'];\n\n $query = \"SELECT tags\nFROM PushpinTags\nWHERE pushpin_ID= '$this->pushpin_id'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function index()\n {\n return Tag::all();\n }", "function getTags ( $params=array() )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/tags.json\",$params);\n return $this->createResponse($result,'get Tags');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function tags()\n {\n $title = 'Tags';\n $tags = \\App\\Tag::get();\n return view('admin.modules.tags.list',['title' => $title, 'tags' => $tags]);\n }", "public function index()\n {\n return view('ui.tags.list-tags')->with('tags', Tag::all());\n }", "public function actionTags()\n {\n $tags = EntityUtil::toArray(TagDao::findAll(), true);\n echo json_encode($tags);\n }", "public function index()\n {\n \n $tags = Tag::orderBy('created_at', 'desc')->paginate(5);\n\n return TagResource::collection($tags);\n }", "public function tags()\n {\n $tags = Tag::all();\n\n return response()->json($tags);\n }", "public function getGroupTagsList()\r\n {\r\n $tmpGroup = new Warecorp_Group_Base();\r\n $EntityTypeId = $tmpGroup->EntityTypeId;\r\n $EntityTypeName = $tmpGroup->EntityTypeName;\r\n unset($tmpGroup);\r\n\r\n $query = $this->_db->select();\r\n if ( $this->isAsAssoc() ) {\r\n $fields = array();\r\n $fields[] = ( $this->getAssocKey() === null ) ? 'ztd.id' : $this->getAssocKey();\r\n $fields[] = ( $this->getAssocValue() === null ) ? 'ztd.name' : $this->getAssocValue();\r\n $query->from(array('ztr' => 'zanby_tags__relations'), $fields);\r\n } else {\r\n $query->from(array('ztr' => 'zanby_tags__relations'), new Zend_Db_Expr('DISTINCT ztd.id'));\r\n }\r\n $query->joininner(array('ztd' => 'zanby_tags__dictionary'), 'ztr.tag_id = ztd.id');\r\n\r\n if ( $this->getWhere() ) $query->where($this->getWhere());\r\n $query->where('entity_type_id = ?', $EntityTypeId);\r\n $query->where('entity_id = ?', $this->getGroupId());\r\n $query->where('ztr.status IN (?)', $this->getTagStatus());\r\n\r\n if ( $this->getCurrentPage() !== null && $this->getListSize() !== null ) {\r\n $query->limitPage($this->getCurrentPage(), $this->getListSize());\r\n }\r\n if ( $this->getOrder() !== null ) $query->order($this->getOrder());\r\n else $query->order('ztd.name');\r\n\r\n\t\t$items = $this->getTagListFromSQL($query, false);\r\n return $items;\r\n }", "public function getTags():array;", "function getTags() {\n\t\t$db = Database::getInstance();\n\t\t$mysqli = $db->getConnection();\n\t\t\n\t\t$tagsArray = array();\n\t\t\t$sql_query = \"select tagnaam,tagid from tag where status=6\";\n\t\t\t$result = $mysqli->query($sql_query);\n\t\t\t\n\t\t\twhile ( $row = $result->fetch_object () ) {\n\t\t\t\t$Tag = new Tag();\n\t\t\t\t$Tag->tagId = $row->tagid;\n\t\t\t\t$Tag->tagName = $row->tagnaam;\n\t\t\t\tarray_push($tagsArray, $Tag);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$result->close();\n\t\t\treturn $tagsArray;\n\t}", "public function getAllTagsAction()\n {\n $tags = $this->storedTagsAction();\n\n $this->views->add('comment/tags_list', [\n 'title' => \"Taggar\",\n 'tags' => $tags\n ]);\n }", "public function showAllTag()\n {\n $tags = $this->repository->allTag();\n return $tags;\n }", "public function index()\n\t{\n\t\treturn View::make('tags.list')->with('tags', Tag::where('count', '>', '0')->orderBy('count', 'desc')->orderBy('updated_at', 'desc')->get());\n\t}", "function tc_get_the_tags() {\r\n return the_tags();\r\n}", "public function getTags() {\n\t\t$tags = array();\n\n\t\ttry {\n\t\t\t/** @var Thrive_Dash_Api_KlickTipp $api */\n\t\t\t$api = $this->get_api();\n\t\t\t$tags = $api->getTags();\n\t\t} catch ( Exception $e ) {\n\n\t\t}\n\n\t\treturn $tags;\n\t}", "function printTags(){\n\n\t\t/* Start HTML */\n\t\t$output = '<ul class=\"taglist\">';\n\t\t$tags = explode(',',$this->tags);\n\t\tforeach($tags as $tag){\n\t\t\t$output .= '<li class=\"tag\"><a href=\"#!/search&tags='.urlencode(strtolower(str_replace(' ','',$tag))).'\">'.$tag.'</a></li>';\n\t\t}\n\t\t$output .= '</ul>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "function getUserTags(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListUserPopular','user_id='.$this->user);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function index()\n {\n $tags = TagCatalog::paginate(25);\n\n return view('blog::tags.index')\n ->with('tags', $tags);\n }", "public function listTopTags()\n {\n $tagger = new Kronolith_Tagger();\n $result = new stdClass;\n $result->tags = array();\n $tags = $tagger->getCloud($GLOBALS['registry']->getAuth(), 10, true);\n foreach ($tags as $tag) {\n $result->tags[] = $tag['tag_name'];\n }\n return $result;\n }", "function tc_tag_list() {\r\n $post_terms = apply_filters( 'tc_tag_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = false ) );\r\n $html = false;\r\n\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_tag_list_class', 'btn btn-mini btn-tag' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if\r\n return apply_filters( 'tc_tag_list', $html );\r\n }", "public function getListByLocation()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t//$this->addFilter(\"entity_type\", 6, true); // exclude events from tag cloud\r\n $this->addFilter(\"entity_type\", 2); // get tags for groups Only\r\n\t\t\treturn parent::getList(\"name\", \"@count\");\r\n\t\t} else {\r\n\t\t\techo 3;exit;\r\n\t\t\tif ( $this->getGroupId() !== null ) {\r\n\t\t\t\t$this->addWhere('group_id = ?', $this->getGroupId());\r\n\t\t\t}\r\n\t\t\t$where = $this->getWhere();\r\n\t\t\tif ($where) $where = 'where '.$where;\r\n\t\t\t$fields = array();\r\n\t\t\tif ( $this->isAsAssoc() ) {\r\n\t\t\t\t$fields[] = ( $this->getAssocKey() === null ) ? 'name' : $this->getAssocKey();\r\n\t\t\t\t$fields[] = ( $this->getAssocValue() === null ) ? 'rating' : $this->getAssocValue();\r\n\t\t\t} else {\r\n\t\t\t\t$fields[] = 'id';\r\n\t\t\t}\r\n\t\t\t$fields = implode(', ', $fields);\r\n\t\t\t$limit = \"\";\r\n\t\t\tif ( $this->getCurrentPage() !== null && $this->getListSize() !== null ) {\r\n\t\t\t\t$limit = \"LIMIT \".(($this->getCurrentPage()-1) * $this->getListSize()) .\", \". $this->getListSize();\r\n\t\t\t}\r\n\t\t\t$order = \"\";\r\n\t\t\tif ( $this->getOrder() !== null ) {\r\n\t\t\t\t$order = \"ORDER BY \".$this->getOrder();\r\n\t\t\t}\r\n\r\n\t\t\t$query = \"SELECT distinct {$fields} FROM (\r\n\t#get groups tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 2 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\tUNION\r\n\t#get documents tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 5 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id FROM zanby_documents__items\r\n\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get members tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 1 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT user_id FROM zanby_groups__members\r\n\t\t\t\t\t WHERE group_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\tUNION\r\n\t#get events tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 6 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\tSELECT id FROM zanby_event__items\r\n\t\t\t\t\t\tWHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\tIN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get photos tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\tIN (\r\n\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t WHERE entity_type_id = 4 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id from zanby_galleries__photos\r\n\t\t\t\t\t WHERE gallery_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT id FROM zanby_galleries__items\r\n\t\t\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t\t\tSELECT group_id FROM `view_groups__locations` $where\r\n\t\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)\r\n\tUNION\r\n\t#get lists tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\t\t IN (\r\n\t\t\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t\t\t WHERE entity_type_id = 20 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t\tSELECT id FROM zanby_lists__items\r\n\t\t\t\t\t\tWHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\tIN (\r\n\t\t\t\t\t\t\t SELECT group_id FROM `view_groups__locations` $where\r\n\t\t\t\t\t\t )\r\n\t\t\t\t\t)\r\n\t\t\t )\r\n\tUNION\r\n\t#get lists items tags\r\n\tSELECT {$fields} FROM view_tags__dictionary\r\n\tWHERE id\r\n\tIN (\r\n\t\t SELECT tag_id FROM zanby_tags__relations\r\n\t\t WHERE entity_type_id = 21 AND entity_id\r\n\t\t\t\t IN (\r\n\t\t\t\t\t SELECT id from zanby_lists__records\r\n\t\t\t\t\t WHERE list_id\r\n\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t SELECT id FROM zanby_lists__items\r\n\t\t\t\t\t\t\t WHERE owner_type = 'group' AND owner_id\r\n\t\t\t\t\t\t\t IN (\r\n\t\t\t\t\t\t\t\t\tSELECT group_id FROM `view_groups__locations` $where\r\n\t\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)\r\n\t)\r\n\tAS result {$order} {$limit}\";\r\n\r\n\t\t\t$items = $this->getTagListFromSQL($query);\r\n\t\t}\r\n return $items;\r\n }", "function GetAllTags($activeTag = 'All')\n {\n $ret = array();\n $sql = 'SELECT TAG_DESC, TAG_ID ' .\n ' FROM TAGS ' .\n ' WHERE IS_ACTIVE = 1 ' .\n 'ORDER BY TAG_DESC ASC';\n\n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n if ($activeTag == $row['TAG_ID']) \n $ret[] = \n '<span class = \"tag activeFilter\" ' . \n ' title = \"Click to filter posts by ' . $row['TAG_DESC'] . '.' .\n '\" onclick = \"markForm(' . $row['TAG_ID'] . '); submitForm();\"' . '>' . $row['TAG_DESC'] .\n '</span>';\n \n else\n $ret[] = \n '<span class = \"tag inactiveFilter\" ' . \n ' title = \"Click to filter posts by ' . $row['TAG_DESC'] . '.' .\n '\" onclick = \"markForm(' . $row['TAG_ID'] . '); submitForm();\"' . '>' . $row['TAG_DESC'] .\n '</span>';\n }\n \n return $ret;\n }", "public function index()\n {\n $ls_tag = \\App\\Tag::where('user_id','=',Auth::user()->id)->paginate(5);\n return view('tag.list_tag')->with('ls_tag', $ls_tag);\n }", "public function index()\n {\n $tags = Tag::orderBy('id')->paginate(config('settings.admin_pagination', 15));\n $this->vars['tags'] = $tags;\n $this->title = __('system.tags_list');\n $this->template = 'admin.tags';\n \n return $this->renderOutput();\n }", "public function get_tags(){\n\t \n\t return $this->tags;\n\t}", "public function getAllTags()\n {\n\n $sql = \"\n\t\t\tSELECT * FROM tags\n\t\t\tORDER BY name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n foreach ($result as $tag) {\n\n $this->tags[$tag['id']] = $tag['name'];\n\n }\n\n return $this->tags;\n }", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "private function get_tags()\n\t{\n\t\t$this->n_tags = true;\n\t\treturn $this->m_tags;\n\t}", "public static function get_tags() {\n return Tag::distinct()->orderBy('name', 'asc')->get();\n }", "function listOfAllTags() {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT * FROM Tags ORDER BY Tags.tag_name\";\n\t$result = $conn->query($dbQuery);\n\n\tif(!$result) {\n\t\t\tdie(\"error listing tagpost of \" . $value . \" with this error \" . $conn->error);\n\t\t}\n\t//checking the result array for results\n\t$row = $result->fetch_array();\n\n\t//tag names array\n\t$tags = array();\n\t$i = 0;\n\twhile($row) {\n\t\t$tags[$i] = array(\"#\". $row['tag_name'], $row['tag_id']);\n\t\t$i++;\n\t\t$row = $result->fetch_array();\n\t}\n\n\t//closing the connection\n\t$conn->close();\n\n\t//return stuff\n\treturn $tags;\n}", "function show_tags()\n{\n global $xoopsModule, $xoopsSecurity;\n\n MWFunctions::include_required_files();\n\n RMTemplate::get()->assign('xoops_pagetitle', __('Tags Management', 'mywords'));\n\n // More used tags\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n $sql = 'SELECT * FROM ' . $db->prefix('mod_mywords_tags') . ' ORDER BY posts DESC LIMIT 0,30';\n $result = $db->query($sql);\n $mtags = [];\n $size = 0;\n while (false !== ($row = $db->fetchArray($result))) {\n $mtags[$row['tag']] = $row;\n $size = $row['posts'] > $size ? $row['posts'] : $size;\n }\n\n ksort($mtags);\n\n // All tags\n list($num) = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags')));\n $page = rmc_server_var($_GET, 'page', 1);\n $limit = isset($limit) && $limit > 0 ? $limit : 15;\n\n $tpages = ceil($num / $limit);\n $page = $page > $tpages ? $tpages : $page;\n\n $start = $num <= 0 ? 0 : ($page - 1) * $limit;\n\n $nav = new RMPageNav($num, $limit, $page, 5);\n $nav->target_url('tags.php?page={PAGE_NUM}');\n\n $sql = 'SELECT * FROM ' . $db->prefix('mod_mywords_tags') . \" ORDER BY id_tag DESC LIMIT $start,$limit\";\n\n $result = $db->query($sql);\n $tags = [];\n while (false !== ($row = $db->fetchArray($result))) {\n $tags[] = $row;\n }\n\n RMBreadCrumb::get()->add_crumb(__('Tags management', 'mywords'));\n\n xoops_cp_header();\n RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.checkboxes.js');\n RMTemplate::get()->add_script('..//include/js/scripts.php?file=tags-list.js');\n RMTemplate::get()->add_style('jquery.css', 'rmcommon');\n include RMTemplate::get()->get_template('admin/mywords-tags.php', 'module', 'mywords');\n\n xoops_cp_footer();\n}", "public function index()\n {\n //\n return $this->responseWithCollection(Tag::all(), new TagTransformer());\n }", "public function tags(){\n $tagList = Tag::all();\n return view('tag.tags',['tagList'=>$tagList]);\n }", "public function getTags($object);", "public function index(){\n return Tag::get();\n }", "public function get_index()\n\t{\n\t\t$tags = Tag::paginate(30);\n\t\t$table = TagPresenter::table($tags);\n\t\t$data = array(\n\t\t\t'eloquent' => $tags,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('diskus::title.tags.list'));\n\t\t\n\t\treturn View::make('diskus::api.tags.index', $data);\n\t}", "public function index(Request $request)\n {\n $tags = new Tag;\n\n if ($request->has('filter')) {\n $tags = $tags->whereIn('type', explode(',', $request->input('filter')));\n }\n\n return $tags->get(['id', 'name']);\n }", "public function getAll() {\n $select = $this->select();\n $tags = $this->fetchAll($select);\n return $tags;\n }", "function get_tags() {\n return $this->tags;\n }", "public function testListTags() : void\n {\n $response = $this->actingAs(static::$user, 'api')\n ->get('/api/tags');\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n '*' => [\n 'id',\n 'name'\n ]\n ]);\n }", "public static function getAll()\n\t{\n\t\t// fetch items\n\t\treturn (array) FrontendModel::getDB()->getRecords('SELECT t.tag AS name, t.url, t.number\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM tags AS t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t.language = ? AND t.number > 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY number DESC, t.tag;', FRONTEND_LANGUAGE);\n\t}", "public function getTagsTable() {}", "public function list()\n {\n $tags = Tag::withCount('tasks')->get();\n return view('committee.tags', ['tags' => $tags]);\n }", "function getTagTypes ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/tagTypes.json\");\n return $this->createResponse($result,'get All Tag Types');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "function get_tag_names() \n\t{\t\n\t\tlog_message('debug', 'Support/get_tag_names');\n\t\techo get_option_list($this, 'tagNames', 'select', $_GET[\"copy_from_repo\"]);\n\t}", "public function tags() {\n\t\treturn $this->get_tags();\n\t}", "public function getAllTags($status){\n\t\tif(isset($status)){\n\t\t\t$query = Queries::getalltagsbystatus($status);\n\t\t}else{\n\t\t\t$query = Queries::getalltags();\n\t\t}\n\t\treturn $this->query($query);\n\t}", "public function getTagListAttribute()\n {\n return $this->tags->lists('name');\n }", "function gettags($mask=\"\")\r\n\t{\r\n\t\t$where = ($mask!=\"\")?\" name like '%$mask%' AND\":\"\";\r\n\t\t$query = 'SELECT * FROM #__flexicontent_tags WHERE '.$where.' published = 1 ORDER BY name';\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$tags = $this->_db->loadObjectlist();\r\n\t\treturn $tags;\r\n\t}", "public function index()\n {\n return response()->json(TagResource::collection(Tag::all()->load($this->relations)));\n }", "public function indexActionGet(): object\n {\n $tag = new Tag($this->di->dbqb);\n $tags = $tag->findAllByQuestionCount();\n\n $this->di->page->add(\"site/tags/index\", [\n \"tags\" => $tags,\n ]);\n\n return $this->di->page->render([\n \"title\" => \"Tags\",\n ]);\n }", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "protected function getTagsList($params=array()) {\n\n\t\t$defaultParams = array(\n\t\t\t'orderBy' => 'mlog_tags.tag_amount DESC',\n\t\t);\n\n\t\t$params = array_merge($defaultParams, $params);\n\n\t\t$query = \"SELECT mlog_tags.tag_name as tag,mlog_tags.tag_amount as amount FROM mlog_tags\";\n\t\tif($params['categoryId']){\n\t\t\t$query .= \" JOIN mlog_posts ON(find_in_set(mlog_tags.tag_name,replace(mlog_posts.post_tags,', ',',')) AND find_in_set(\".$params['categoryId'].\",post_category))\";\n\t\t}\n\t\t$query .= \" WHERE mlog_posts.post_online_date <= '\".$this->date.\"'\";\n $query .= \" AND (mlog_posts.post_offline_date >= '\".$this->date.\"'\";\n $query .= \" OR mlog_posts.post_offline_date = '0000-00-00 00:00:00')\";\n\t\t$query .=\" GROUP BY mlog_tags.tag_name\";\n\t\t$query .=\" ORDER BY \".$params['orderBy'];\n\t\t$this->db->query($query);\n\n\t\twhile ($tag = $this->db->get()) {\n\n\t\t\t$tags[] = $tag;\n\t\t}\n\n\t\treturn $tags;\n\t}", "function tags()\n {\n session_write_close();\n $suggestions = $this->Tag->get_tag_suggestions($this->input->get('term'), 25);\n echo json_encode($suggestions);\n }", "public function index()\n {\n $tags = Tag::all();\n return response()->json($tags, 200);\n }", "public function getTags()\n {\n return $this->_tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "function getTags($photo_id){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListPhoto','user_id='.$this->user.'&photo_id='.$photo_id);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function getTags()\n {\n return $this->Tags;\n }" ]
[ "0.8111728", "0.78161776", "0.77825797", "0.77825797", "0.77825797", "0.77825797", "0.77825797", "0.7730644", "0.7348696", "0.72673786", "0.7259643", "0.7199399", "0.719243", "0.71911633", "0.71701515", "0.71625155", "0.7132214", "0.71227115", "0.7119674", "0.70875484", "0.70677686", "0.7052879", "0.7025024", "0.7017231", "0.70168537", "0.6980779", "0.69625497", "0.6939912", "0.6920253", "0.6913005", "0.6855832", "0.67812246", "0.67713773", "0.6749594", "0.67495084", "0.6747943", "0.6746686", "0.67303836", "0.67120755", "0.6698276", "0.66754717", "0.665667", "0.6635344", "0.6625798", "0.65993613", "0.6598549", "0.6592461", "0.65774363", "0.6574664", "0.6573936", "0.6573699", "0.65590626", "0.6555955", "0.6551451", "0.6550841", "0.6550841", "0.6537572", "0.6537342", "0.6532413", "0.6530219", "0.6524354", "0.6509054", "0.65056527", "0.6499764", "0.64951104", "0.64931816", "0.6489634", "0.6464066", "0.6462825", "0.64552766", "0.6454546", "0.64515406", "0.6445331", "0.6442808", "0.64389616", "0.6436987", "0.6411997", "0.6410257", "0.64040357", "0.6396502", "0.63954604", "0.639424", "0.63919383", "0.6389776", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6385782", "0.6370927", "0.6356883" ]
0.0
-1
Display the specified Tag.
public function show(Tag $tag) { return response()->json($tag,200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Tag $tag)\n {\n //\n }", "public function show(Tag $tag)\n {\n //\n }", "public function show(Tag $tag)\n {\n //\n }", "public function show(tag $tag)\n {\n //\n }", "public function show(Tag $tag)\n {\n //return view('tags.show',compact('tag'));\n }", "public function show(Tag $tag)\n {\n return view('tag.show', compact('tag'));\n }", "public function show($tag)\n {\n return view('tags.tag')->with('tag', $this->masterController->show($tag));\n }", "public function show()\n\t{\n\t\techo $this->tags();\n\t}", "public function show(PostTag $postTag)\n {\n //\n }", "public function show(Tag $tag)\n {\n return view('tags.show', compact('tag'));\n }", "public function show(Tag $tag)\n {\n return view('tags.show', compact('tag'));\n }", "public function show(Tag $tag)\n\t{\n\t\t$tagtypes = Tagtype::lists('name', 'id')->toArray();\n\t\treturn view('tags.show', compact('tag', 'tagtypes'));\n\t}", "public function show(Tag $tag)\n {\n return view('Tags.show', compact('tag'));\n }", "public function showTag($tag)\n\t{\n\t\t$groupList = Group::where('tag', '=', $tag)->get();\n\n\t\tif ($groupList) {\n\t\t\treturn view('groups.tag', compact('groupList', 'tag'));\n\n\t\t} else {\n\t\t\tSession::flash('info_message', 'Not a valid tag!');\n\t\t\treturn redirect(route('groups.search'));\n\t\t}\n\t}", "public function show(Tags $tags)\n {\n //\n }", "public function show(Tag $tag)\n {\n return view('tags.show', [\n 'tag' => $tag\n ]);\n }", "function display($tag , $value) {\n echo $tag . $value ;\n }", "public function show(Tag $tag)\n {\n return AjaxResponse::success($tag);\n }", "public function show(Tag $tag) {\n $blogs = $tag->blogs;\n $tags = Tag::all();\n return view('tags.show', compact('blogs', 'tags' , 'tag'));\n }", "public function show(Tag $tag)\n {\n\n $tag->load('articles');\n\n $trendingArticles = $tag->getTrendingArticles();\n $trendingArticles->load('tags', 'author');\n $count = $trendingArticles->last()->view_count;\n\n $articles = $tag->articles()->where('articles.view_count', '<', $count)->get();\n $articles->load('author', 'tags');\n return view('tag.show', compact('tag', 'articles', 'trendingArticles'));\n }", "public function renderTagView()\n {\n $tag = $this->di->get(\"tag\");\n $data = [\"title\" => \"guestbook\"];\n\n $tags = $tag->getAllTags();\n\n\n $this->di->get(\"view\")->add(\"components/tags\", [\"tags\" => $tags], \"main\");\n\n $this->di->get(\"pageRender\")->renderPage($data);\n }", "public function show(TagBlog $tagBlog)\n {\n //\n }", "public function edit(Tag $tag)\n {\n $this->vars['tag'] = $tag;\n $this->title = __('system.tag_edit');\n $this->template = 'admin.tag';\n \n return $this->renderOutput();\n }", "public function show(Tag $tag)\n {\n return view('search')->with([\n 'search' => $tag->name,\n 'posts' => $tag->posts()->public()->latest()->paginate(8),\n 'type' => 'Tag'\n ]);\n }", "function echoTag ($id,$tag,$highlight,$text,$markObjects)\r{\r\t\r\techo \"<span id=$id>\";\r\tif ($markObjects) {\r\t\tif ($tag == 'EVENT') { echo \"<span class=event>\"; } \r\t\telseif ($tag == 'TIMEX3') { echo \"<span class=timex>\"; } \r\t\telse { echo \" <span class=signal>\"; }\r\t}\r\tif ($highlight) { echo '<strong>'; }\r\tif ($id{0} == 'e') { $tagtype = 'event'; }\r\telseif ($id{0} == 't') { $tagtype = 'timex'; }\r\telseif ($id{0} == 's') { $tagtype = 'signal'; }\r\techo \"<span style=\\\"cursor:crosshair\\\" onClick=\\\"MM_goToURL('parent','displayTag.php?tagtype=$tagtype&text=$text')\\\">\";\r\techo $text;\r\techo \"</span>\";\r\tif ($highlight) { echo '</strong>'; }\r\tif ($markObjects) {\r\t\techo '</span><sub>'.$id.'</sub>';\r\t}\r\techo \"</span>\";\r}", "public function show(Tag $tag)\n {\n return abort(404);\n }", "public function tag(Tag $tag)\n {\n $posts = $this->postRepository->getActiveOrderByDateForTag($this->nbrPages, $tag->id);\n $info = __('Posts found with tag ') . '<strong>' . $tag->tag . '</strong>';\n\n return view('front.index', compact('posts', 'info'));\n }", "public function print_tags() {\n\t\tforeach ($this->photo_tags as $tag) {\n\t\t\techo '\n\t\t\t\t<div class=\"caption-tag\">\n\t\t\t\t\t<span class=\"crosshair\">&#127919;</span>';\n\t\t\t// Handle the different levels of completeness for an\n\t\t\techo\n\t\t\t (isset($tag['article']) ? \n\t\t\t '<a href=\"#\" class=\"item\">' . $tag['article'] . '</a>' : '');\n\t\t\techo \n\t\t\t\t(isset($tag['gender']) ?\n\t\t\t\t '<span class=\"seperator\"> - </span>\n\t\t\t\t\t<a href=\"#\" class=\"item\">' . $tag['gender'] . '</a>' : '');\n\t\t\techo\n\t\t\t (isset($tag['brand']) ?\n\t\t\t\t '<span class=\"seperator\"> - </span>\n\t\t\t\t\t<a href=\"#\" class=\"item\">' . $tag['brand'] . '</a>' : '');\n\t\t\techo '</div>';\n\t\t}\n\t}", "function showDetailsPair($tag, $value) {\n\t/**\n\t* 2016-03-16 INFO: AHH\n\t* Don't use <p> to space because the style sheet changes the color on a p\n\t*/\n\techo \"<div style=\\\"padding-top:20px;\\\">$tag<br />$value</div>\";\n}", "public function show($id)\n {\n $tag = Tag::findOrFail($id);\n\n return view('admin.tags.show', compact('tag'));\n }", "public function show($id)\n {\n // //\n // $tag = Tag::find($id)\n //\n // return view('admin.tags.show')->withTag($tag);\n }", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "public function show(SeoMetaTag $seoMetaTag)\n {\n //\n }", "function gtags_display_tags() {\n\n\t$gtags_dir_cloud = get_option('gtags_dir_cloud'); \n\t\n\tif ( $gtags_dir_cloud=='show' || $gtags_dir_cloud=='link' || !$gtags_dir_cloud ){\n\t\t$hide_tag_style = 'link' == $gtags_dir_cloud ? ' style=\"display:none;\" ' : '';\n\t\t\t\t\n\t\techo '<div id=\"gtags-top\">';\n\t\techo '\t<div id=\"gtags-top-cloud\" class=\"gtags\"'.$hide_tag_style.'>'. wp_generate_tag_cloud( gtags_make_tags(), gtags_cloud_args() ).'</div>';\n\t\t\n\t\tif ( $gtags_dir_cloud=='link' ) {\n\t\t\techo '\t<div id=\"gtags-toggle-top\"><a href=\"javascript:void(0);\">Afficher les catégories de projet</a></div>';\n\t\t}\n\t\t\n\t\techo '</div>';\n\t}\n}", "public function show($tag)\n {\n $tag = Tag::where('slug', $tag)->firstOrFail();\n return $tag;\n }", "public function index(Tag $tag)\n {\n }", "public function tagged(string $tag): View\n {\n $bookmarks = Bookmark::whereHas('tags', function ($query) use ($tag) {\n $query->where('tag', $tag);\n })->latest()->with('tags')->withCount('tags')->paginate(10);\n\n return view('bookmarks.tagged', compact('bookmarks', 'tag'));\n }", "public function shortcode_display($atts, $contet = '', $tag){\n\t\t\n\t\t$html = '';\n\t\t//our main upcoming preview shortcode\n\t\tif($tag == 'upcoming_post_preview'){\n\t\t\t\t\n\t\t\t//define default arguments\n\t\t\t$arguments = shortcode_atts(array(\n\t\t\t\t'number_of_previews'\t=> 1,\n\t\t\t\t'post_id'\t\t\t\t=> false\n\t\t\t\t), $atts, $tag);\n\t\t\t\t\n\t\t\t//build output\n\t\t\t$html .= $this->get_upcoming_post_preview($arguments);\n\t\t}\n\t\t\n\t\treturn $html;\n\t}", "public function edit(Tag $tag)\n {\n return view ('admin.tag.edit', ['tag' => $tag]);\n }", "public function show($id)\n {\n $tag = Tag::findOrFail($id);\n return view('tags.show')->withTag($tag);\n }", "function tag($id)\n{\n global $app;\n\n $details = $app->calibre->tagDetails($id);\n if (is_null($details)) {\n $app->getLog()->debug(\"no tag\");\n $app->notFound();\n }\n $app->render('tag_detail.html', [\n 'page' => mkPage(getMessageString('tag_details'), 4, 3),\n 'tag' => $details['tag'],\n 'books' => $details['books']]);\n}", "public function actionTag($slug)\n {\n $model = Tag::find()->andWhere(['slug' => $slug])->one();\n if (!$model) {\n throw new NotFoundHttpException(Yii::t('frontend', 'Page not found.'));\n }\n\n $query = Article::find()->with('category')->joinWith('tags')->where('{{%tag}}.slug = :slug', [':slug' => $slug])->published();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => ['defaultPageSize' => 10],\n ]);\n\n $dataProvider->sort = [\n 'defaultOrder' => ['created_at' => SORT_DESC],\n ];\n\n return $this->render('tag', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n 'menuItems' => self::getMenuItems(),\n ]);\n }", "public function edit($tag)\n {\n $tag = Tag::findOrFail($tag);\n return view('admin.tags.edit', compact('tag'));\n }", "public function tag(Tag $tag)\n {\n $projects = $tag->projects()\n ->orderBy('created_at', 'desc')\n ->get();\n\n $blogs = $tag->blogs()\n ->orderBy('created_at', 'desc')\n ->paginate(5);\n\n return view('tag.index', compact('projects', 'tag', 'blogs'));\n }", "public function tagged( $tag );", "public function index(Tag $tag)\n {\n $getArticleByTag = Tag::findOrfail($tag)->first();\n \n //$getArticleByTag->articles = Article::where('publish', '=', 1)->get();\n $getNameOfTag = $getArticleByTag->name;\n //dd($getTag->id);\n\n $allTags = Tag::all();\n // $categories = Category::all();\n \n return view('tags.index', compact('getArticleByTag', 'getNameOfTag', 'allTags'));\n }", "public function actionView($id) {\n $model = $this->findModel(Tags::className(), $id);\n return $this->render('tag-view', [\n 'model' => $model,\n ]);\n }", "public function edit($tag)\n {\n $tag=Tag::findOrfail($tag);\n \n return view('tags.edit_tag')->with('tag', $tag);\n }", "public function idAction($tagId = null)\n\t{\n\t\t$tag = $this->tags->find($tagId);\n\t\t$tagName = $tag->tag;\n\t\t\n\t\t$tagsQuestions = $this->tags->getQuestonsWithTag($tagName);\n\t\t\t\n\t\t$this->theme->setTitle(\"Visa tagg\");\n\t\t$this->views->add('stack/view-tags', [\n\t\t\t'tag' => $tag,\n\t\t\t'tagsQuestions' => $tagsQuestions\n\t\t]);\n\n\t}", "public function tag_cloud_display() {\n\t\t// Build the output to return for use by the shortcode.\n\t\tob_start();\n\n\t\t$tags = get_tags();\n\t\t$html = '<div class=\"post_tags\">';\n\n\t\tforeach ( $tags as $tag ) {\n\t\t\t$tag_link = get_tag_link( $tag->term_id );\n\t\t\t$html .= '<a href=\"' . esc_url( $tag_link ) . '\" title=\"' . esc_attr( $tag->name ) . '\" class=\"' . esc_attr( $tag->slug ) . '\">';\n\t\t\t$html .= esc_html( $tag->name ) . '</a>';\n\t\t}\n\n\t\t$html .= '</div>';\n\t\techo $html;\n\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\n\t\treturn $content;\n\t}", "protected function tagShow($params)\n {\n return $this->toHtml($params);\n }", "public function showPressByTag($tag)\n {\n\n $press = Press::withAnyTags($tag)\n ->orderBy('date', 'desc')\n ->simplePaginate(10);\n if ($press->count() === 0) {\n throw new ModelNotFoundException;\n }\n return view('pages.press.index', [\n 'title' => ucwords($tag),\n 'category' => ucwords($tag),\n 'press' => $press\n ]);\n }", "public function tag(Tag $tag)\n {\n $this->generalSEO($tag);\n return view('blog.category')\n ->with('articles', $tag->articles->where('status','PUBLISHED')->sortByDesc('created_at'))\n ->with('tag', $tag);\n }", "public function edit(Tag $tag)\n {\n \t//\n }", "public function edit(Tag $tag)\n {\n return view('tags.create', compact('tag'));\n }", "function get_view($params) {\n $tag = safeParam($params, 0, false);\n if ($tag === false) {\n die(\"No tag selected\");\n }\n\t\n\t$tag = strtolower($tag);\n $records = Question::findAllRecordsByTag($tag);\n\t\n\n renderTemplate(\n \"views/tag_view.inc\",\n array(\n 'title' => \"Questions tagged '$tag'\",\n 'records' => $records\n )\n );\n}", "public function edit(tag $tag)\n {\n //\n }", "public function show(Tag $tag, Thread $thread)\n {\n return view(\"thread.show\", [\n \"thread\" => $thread,\n \"comments\" => $thread->comments\n ]);\n }", "public function edit(Tag $tag)\n {\n return view('admin.tags.edit', compact('tag'));\n }", "public function show($id)\n {\n $tag = Tag::find($id);\n\n return view('pages.tags', compact('tag'));\n }", "public function tag($tag) {\n $this->tag = $tag;\n }", "public function render($tags);", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "function gtags_show_tags_chooser(){\n\t?>\n\t<span class=\"fr\">\n\t\tSuggestions : <span class=\"highlight etiquette\"><?php echo gtags_show_tags_in_add_form(); ?></span>\n\t</span>\n\t<?php \n}", "public function tag_show($lang, $tag_slug)\n\t{\n\n\t\t$page_content = $lang == 'th'\n\t\t\t? $this->Tag_model->get_tag_by_slug_th($tag_slug)\n\t\t\t: $this->Tag_model->get_tag_by_slug_en($tag_slug);\n\n\t\t$tag = $page_content;\n\n\t\t/*\n\t\t| -------------------------------------------------------------------------\n\t\t| SET DATA\n\t\t| -------------------------------------------------------------------------\n\t\t*/\n\n\t\t// Language\n\t\t$data['lang'] = $this->lang;\n\n\t\t// Title Page\n\t\t$data['title'] = unserialize($page_content->meta_tag_title)[$this->lang];\n\t\t$data['title_moblie'] = unserialize($page_content->meta_tag_moblie_title)[$this->lang];\n\n\t\t// Meta Tag\n\t\t$data['meta']['title'] = unserialize($page_content->meta_tag_title)[$this->lang];\n\t\t$data['meta']['description'] = unserialize($page_content->meta_tag_description)[$this->lang];\n\t\t$data['meta']['keyword'] = unserialize($page_content->meta_tag_keywords)[$this->lang];\n\t\t$data['meta']['title_moblie'] = unserialize($page_content->meta_tag_moblie_title)[$this->lang];\n\t\t$data['meta']['description_moblie'] = unserialize($page_content->meta_tag_moblie_description)[$this->lang];\n\t\t$data['meta']['keyword_moblie'] = unserialize($page_content->meta_tag_moblie_keywords)[$this->lang];\n\n\t\t// OG & Twitter\n\t\t$data['og_twitter']['title'] = unserialize($page_content->meta_tag_title)[$this->lang];\n\t\t$data['og_twitter']['description'] = unserialize($page_content->meta_tag_description)[$this->lang];\n\t\t$data['og_twitter']['title_moblie'] = unserialize($page_content->meta_tag_moblie_title)[$this->lang];\n\t\t$data['og_twitter']['description_moblie'] = unserialize($page_content->meta_tag_moblie_description)[$this->lang];\n\t\t$data['og_twitter']['image'] = base_url('storage/uploads/images/blogs/'. unserialize($page_content->img_og_twitter)[$this->lang]);\n\n\t\t// Content\n\t\t$data['content'] = 'tags';\n\n\t\t// Load CSS & JS Critical\n\t\t$data['css_critical'] = $this->load_css_critical('tags');\n\t\t$data['js_critical'] = $this->load_js_critical('tags');\n\n\t\t// Utilities\n\t\t$data['banner'] = $this->Banner_model->get_banner_active_by_id(3);\n\t\t$data['tag'] = $tag;\n\t\t$data['blogs'] = $this->Blog_model->get_blog_by_tag_id($tag->id);\n\n\t\t/*\n\t\t| -------------------------------------------------------------------------\n\t\t| EXECUTE VIEWS\n\t\t| -------------------------------------------------------------------------\n\t\t*/\n\n\t\t$this->load->view('app', $data);\n\t}", "public function edit(Tag $tag)\n {\n return view('Tags.edit');\n }", "function display($tags)\n\t{\n\t\tglobal\t$gProfiler;\n\n\t\t# substitute other tags\n\t\t$this->sub_tags($tags);\n\n\n\t\techo $this->output;\n\n\t\tif\t($gProfiler)\n\t\t{\n\t\t\t$len\t=\tnumber_format(strlen($this->output)/ 1024,2) ;\n\t\t\t$gProfiler->log(\"template page size:$len Kb\");\n\n\t\t\t# displays profiler output if turned on\n\t\t\t$gProfiler->display();\n\t\t}\n\n\t}", "public function edit(Tag $tag)\n {\n return view('admin.tags.create')->with('tag', $tag);\n }", "function showTags()\n {\n if (common_logged_in()) {\n parent::showTags();\n }\n\n }", "public function show() {\n echo $this->mountElement();\n }", "public function show ( )\n {\n $tag = new Element ( 'input' );\n $tag -> class = 'field';\t\t // classe CSS\n $tag -> name = $this -> name;\n $tag -> value = $this -> value;\n $tag -> type = 'radio';\n \n // se o campo não é editável\n if ( !parent::getEditable ( ) ) {\n // desabilita a TAG input\n $tag -> readonly = \"1\";\n }\n \n if ( $this -> properties ) {\n foreach ( $this -> properties as $property => $value ) {\n $tag -> $property = $value;\n }\n }\n \n // exibe a tag\n $tag -> show ( );\n }", "public function tagAction($tagid=null)\n {\n $questions = $this->questionsByTagIdAction($tagid);\n \n $this->views->add('comment/questions_by_tag', [\n 'title' => \"Frågor med taggen: \" . $questions['tag_info']['name'],\n 'questions' => $questions\n ]);\n\n }", "public function edit(Tag $tag)\n {\n //\n $id = $tag->id;\n $selected = Tag::Find($id);\n return view('tags.edit',['tag'=>$selected]);\n }", "function printTags(){\n\n\t\t/* Start HTML */\n\t\t$output = '<ul class=\"taglist\">';\n\t\t$tags = explode(',',$this->tags);\n\t\tforeach($tags as $tag){\n\t\t\t$output .= '<li class=\"tag\"><a href=\"#!/search&tags='.urlencode(strtolower(str_replace(' ','',$tag))).'\">'.$tag.'</a></li>';\n\t\t}\n\t\t$output .= '</ul>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "public function render_screen_reader_content($key = '', $tag = 'h2')\n {\n }", "public function show($id){\n return Tag::find($id);\n }", "public function showProductByTag($id) {\n\n $products = Tag::findOrFail($id)->products()->paginate(5);\n return view('front.tag',compact('products'));\n }", "public function edit(Tag $tag)\n {\n $tags = Tag::all();\n\n return view('tags.edit', compact('tag'));\n }", "public function show($item_id, $tag_id, $album_id) {\n // As of Gallery 3.0.3, it is no longer needed, now it just\n // redirects to the photo's primary URL to avoid breaking older links.\n item::set_display_context_callback(\"tag_albums_Controller::get_display_context\", $tag_id, $album_id);\n $item = ORM::factory(\"item\", $item_id);\n url::redirect(url::abs_site(\"{$item->type}s/{$item->id}\"));\n }", "function print_debug($content, $tag) {\n $output = '<span style=\"display:none\" id=\"';\n $output .= $tag;\n $output .= '\">';\n print_r($output);\n print_r($content);\n print_r('</span>');\n}", "public function show($id)\n {\n $tag = Tag::find($id);\n $tags = Tag::all();\n\n return view('tags.show', compact('tags'))->withTag($tag);\n }", "public function edit(Tag $tag)\n {\n return view('tags.edit', [\n 'tag' => $tag,\n ]);\n }", "public function tags_dropdown() {\n\n\t\t$tag = isset( $_GET['knowledgebase_tag'] ) ? esc_attr( $_GET['knowledgebase_tag'] ) : '';\n\t\t$terms = get_terms( 'knowledgebase_tag' );\n\n\t\tif ( !empty( $terms ) ) {\n\t\t\techo '<select name=\"knowledgebase_tag\" class=\"postform\">';\n\n\t\t\techo '<option value=\"' . selected( '', $tag, false ) . '\">' . __( 'View all tags', 'knowledgebase' ) . '</option>';\n\n\t\t\tforeach ( $terms as $term )\n\t\t\t\tprintf( '<option value=\"%s\"%s>%s (%s)</option>', esc_attr( $term->slug ), selected( $term->slug, $tag, false ), esc_html( $term->name ), esc_html( $term->count ) );\n\n\t\t\techo '</select>';\n\t\t}\n\t}", "public function show(Tag $tag)\n {\n return response()->json(new TagResource($tag->load($this->relations)));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "function magimpact_entry_tags()\n\t{\n\t\t$tag_list = get_the_tag_list('', __(', ', 'twentythirteen'));\n\t\tif ($tag_list) {\n\t\t\techo '<span class=\"tags-links\">' . $tag_list . '</span>';\n\t\t}\n\n\t}", "public function tagAction(string $tag) : object\n {\n $page = $this->di->get(\"page\");\n $tags = new Tags();\n $tags->setDb($this->di->get(\"dbqb\"));\n $questions_with_tag = $tags->findAllWhere(\"tag = ?\", $tag);\n $all_questions_with_tags = [];\n foreach ($questions_with_tag as $tag) {\n $questions = new Questions();\n $questions->setDb($this->di->get(\"dbqb\"));\n $all_tags_for_question = $questions->find(\"id\", $tag->tag_question_id);\n array_push($all_questions_with_tags, $all_tags_for_question);\n }\n\n $page->add(\"questions/tags\", [\n \"tags\" => $questions_with_tag,\n \"questions\" => $all_questions_with_tags,\n ]);\n\n return $page->render([\n \"title\" => \"Update an item\",\n ]);\n }", "public function tagsAction() {\n /**\n * Find all tags in the database.\n */\n $res = $this->tags->findTags();\n\n /**\n * Prepare the view.\n */\n $this->views->add('comment/tags', [\n 'tags' => $res,\n 'title' => 'i | Producer tags',\n ]);\n $this->views->add('me/page', [\n 'content' => '<br/><p> These tags are used in the discussions, if you are interested in seeing all discussions with a specific tag, you can do so by clicking on any of the tag links.</p>',\n ]);\n }", "public function show() {\n // abre tag\n $this->open();\n echo \"\\n\";\n // si tiene contenido\n if ($this->children) {\n \n \n // recorre todos los objetos hijos\n foreach ($this->children as $child) {\n // si es objeto\n if (is_object($child)) {\n $child->show();\n }\n elseif ((is_string($child)) or (is_numeric($child))) {\n // si es texto\n echo $child;\n }\n }\n // cierra la tag\n $this->close();\n }\n }", "public function tag(){\n\t\t\t$data['tag'] = $this->Tag_model->get_all();\n\t\t\t$data['comment'] = $this->Comment_model->Comment_BdBaca();\n\t\t\t$data['comment_all'] = $this->Comment_model->Comment_all();\n\t\t\t$this->load->view('backend/template/header');\n\t\t\t$this->load->view('backend/template/menu',$data);\n\t\t\t$this->load->view('backend/News/tag/table',$data);\n\t\t\t$this->load->view('backend/template/footer');\n\t\t}", "public function quicktags()\n\t{\n\t\t/* Output */\n\t\t\\IPS\\Output::i()->title\t\t= \\IPS\\Member::loggedIn()->language()->addToStack( 'quick_tags' );\n\t\t\\IPS\\Output::i()->output \t= \\IPS\\Theme::i()->getTemplate( 'forms' )->quicktagsList();\n\t}", "public function tagAction() {\n\n $tag = null;\n\n $qhits = $this->di->request->getGet('hits') ? $this->di->request->getGet('hits') : $this->di->session->get('qhits');\n $qhits = $qhits ? $qhits : 10;\n $this->di->session->set('qhits', $qhits);\n $page = $this->di->request->getGet('page') ? $this->di->request->getGet('page') : 0;\n\n if ($this->di->request->getGet('tag')) {\n $tag = $this->di->request->getGet('tag');\n } else {\n $url = $this->url->create('question');\n $this->response->redirect($url);\n }\n\n $t = new \\Enax\\Tags\\Tags();\n $t->setDI($this->di);\n $tagname = $t->find($tag);\n\n $count = $this->questions->query(\"COUNT(*) AS count\")\n ->from('question AS q')\n ->join('tag2question AS t2q', 'q.id = t2q.idQuestion')\n ->where(\"t2q.idTag = \" . $tag)\n ->execute();\n\n $get = array('tag' => $tag, 'hits' => $qhits, 'page' => $page);\n\n if ($count[0]->count == 0) {\n $pagelinks = $this->pager->paginateGet(1, 'question/tag', $get, $this->customhits);\n } else {\n $pagelinks = $this->pager->paginateGet($count[0]->count, 'question/tag', $get, $this->customhits);\n }\n\n $all = $this->questions->query(\"q.*\")\n ->from('question AS q')\n ->join('tag2question AS t2q', 'q.id = t2q.idQuestion')\n ->where(\"t2q.idTag = \" . $tag)\n ->limit($qhits)\n ->offset($page)\n ->groupBy('q.id')\n ->orderBy('q.created DESC')\n ->execute();\n $all = $this->getRelatedData($all);\n\n $this->theme->setTitle($tagname->getProperties()['name']);\n $this->views->add('forum/forum', [\n 'content' => $all,\n 'pages' => $pagelinks,\n 'title' => 'Frågor om ' . $tagname->getProperties()['name'],\n ]);\n\n $title = $count[0]->count == 1 ? $count[0]->count .' fråga' : $count[0]->count .' frågor';\n $this->views->add('tags/view', [\n 'title' => $title,\n 'tags' => $tagname,\n ]);\n }", "public function display ()\n {\n echo $this->as_text ();\n }", "public function index()\n {\n $data = Tag::get();\n return view('admin.tag.index', compact('data'));\n }", "public function detailTag($id)\n {\n $data = array();\n $data['actives'] = array('xhbd-contents');\n $data['record'] = BeTagModel::find($id);\n $data['action_controller'] = 'update_tag';\n return view('backend.tags.be_detail_tag_view', compact('data'));\n }", "function gtags_display_hook() {\n add_filter( 'bp_current_action', 'gtags_return_blank' );\n bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/index' ) );\n remove_filter( 'bp_current_action', 'gtags_return_blank' );\n}", "function acitpo_entry_tags() {\n\t$tags = get_the_tag_list('', __('', 'acitpo'));\n\tif ($tags) {\n\t\tprintf('<div class=\"entry-tags\">%s</div>', $tags);\n\t}\n}", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public\n\tfunction getTagLabel(): string {\n\t\treturn $this->tagLabel;\n\t}", "public function show($id)\n {\n // Get the specified tag that has one released article at least\n $tag = Tag::whereHas('articles', function($query) {\n $query->released();\n })->findOrFail($id);\n // Get the articles those applied current tag, and paginate them\n $data = $tag->with('articles.thumbnails')->get()->filter(function($item) use ($tag) {\n return $item->id = $tag->id && $item->name === $tag->name;\n })->first()->articles->filter(function($item) {\n return $item->approval != 0 && $item->released_at <= Carbon::now();\n })->values();\n // Paginate by manual\n $perPage = 15;\n $currentPage = Paginator::resolveCurrentPage();\n $totalArticles = $data->count();\n $articles = $data->slice(($currentPage - 1) * $perPage, $perPage)->all();\n $pagination = new LengthAwarePaginator($articles, $totalArticles, $perPage, $currentPage, [\n 'path' => Paginator::resolveCurrentPath(),\n 'pageName' => 'page',\n ]); // -- manual pagination end --\n\n // Other popular tags\n $popular = Tag::with(['articles' => function($query) {\n $query->released();\n }])->get()->filter(function($item) {\n return $item->articles->isEmpty() !== true;\n })->sortByDesc(function($item) {\n return $item->articles->count();\n });\n\n return view('tags.show', [\n 'tag' => $tag,\n 'articles' => $articles,\n 'pagination'=> $pagination,\n 'popular' => $popular,\n ])->with('id', (int) $id);\n }" ]
[ "0.836837", "0.836837", "0.836837", "0.8268635", "0.7426455", "0.7127946", "0.7076981", "0.7024163", "0.69794387", "0.69734037", "0.69734037", "0.6955047", "0.69215494", "0.68586385", "0.6736504", "0.6725912", "0.6686878", "0.6604286", "0.6534901", "0.64502835", "0.64086044", "0.6353879", "0.6351631", "0.62777543", "0.6265631", "0.6255918", "0.6209947", "0.61812294", "0.6157705", "0.6094963", "0.60895336", "0.6040533", "0.60254425", "0.59939116", "0.5987647", "0.5976611", "0.59491014", "0.5947306", "0.5912879", "0.5910775", "0.5899264", "0.5887029", "0.5864648", "0.5861016", "0.5857638", "0.58410686", "0.58395404", "0.58389467", "0.5836467", "0.58105266", "0.5805575", "0.576875", "0.5766171", "0.5751397", "0.57325727", "0.57320833", "0.57219976", "0.57023454", "0.5695749", "0.5691484", "0.56833285", "0.56703293", "0.5667465", "0.56650287", "0.56614625", "0.5651053", "0.5640433", "0.5639621", "0.5632584", "0.5630794", "0.5599665", "0.5568476", "0.55646014", "0.55546415", "0.55407435", "0.55379426", "0.5533011", "0.55206996", "0.55192024", "0.5493655", "0.5489823", "0.5489579", "0.54892135", "0.54799426", "0.5474192", "0.5466023", "0.5461067", "0.5441801", "0.542783", "0.5423422", "0.53940177", "0.5388676", "0.5371449", "0.5367549", "0.53602767", "0.53572255", "0.5348003", "0.53461325", "0.5345776", "0.534229" ]
0.59596103
36
Store the new Tag
public function store(NewTagRequest $request) { Tag::create( $request->validated() ); return response([], 201); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function inserirTag(Tag $tag){\n $this->tag[] = $tag;\n }", "public function insert(Tag $tag);", "private function record_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //check for the existence of this tag type\n $this->tags[$tag . 'count']++;\n $this->tags[$tag . $this->tags[$tag . 'count']] = $this->indent_level; //and record the present indent level\n } else { //otherwise initialize this tag type\n $this->tags[$tag . 'count'] = 1;\n $this->tags[$tag . $this->tags[$tag . 'count']] = $this->indent_level; //and record the present indent level\n }\n $this->tags[$tag . $this->tags[$tag . 'count'] . 'parent'] = $this->tags['parent']; //set the parent (i.e. in the case of a div this.tags.div1parent)\n $this->tags['parent'] = $tag . $this->tags[$tag . 'count']; //and make this the current parent (i.e. in the case of a div 'div1')\n }", "protected function saveTags()\n {\n $this->checkConstants();\n $articleId = $this->id;\n $tags = $this->tags;\n if ( $this->isNewRecord )\n {\n if ( !empty( $tags ) )\n {\n $this->addTags( $articleId, $tags );\n }\n }\n else\n {\n if ( is_array( $tags ) &&( !empty( $tags ) ) )\n {\n /*\n we received array with the same or different values of tags -\n in any case that will be an array with numbers\n */\n if ( is_numeric( $tags[0] ) )\n {\n $this->changeTags( $articleId, $tags );\n }\n /*\n if $tags was filled with models and user has removed from form all tags\n we will receive empty array and $tags will be the same as after initialization\n */\n elseif( is_object( $tags[0] ) )\n {\n $this->deleteAllTags( $articleId );\n }\n }\n }\n }", "function saveTag( $aForm ){\n global $config;\n $oSql = Sql::getInstance( );\n clearCache( 'tags' );\n\n $aForm = changeMassTxt( $aForm, 'ndnl' );\n if( empty( $aForm['sUrl'] ) )\n $aForm['sUrl'] = $aForm['sName'];\n $aForm['sUrl'] = trim( $aForm['sUrl'] );\n \n if( isset( $aForm['iPosition'] ) && !is_numeric( $aForm['iPosition'] ) )\n $aForm['iPosition'] = 0;\n\n if( is_numeric( $oSql->getColumn( 'SELECT iTag FROM tags WHERE sUrl = \"'.$aForm['sUrl'].'\"'.( ( isset( $aForm['iTag'] ) && is_numeric( $aForm['iTag'] ) ) ? 'AND iTag != '.$aForm['iTag'] : null ) ) ) ){\n return false;\n }\n \n if( isset( $aForm['iTag'] ) && is_numeric( $aForm['iTag'] ) ){\n $oSql->update( 'tags', $aForm, Array( 'iTag' => $aForm['iTag'] ), true );\n }\n else{\n $aForm['sLang'] = $config['language'];\n unset( $aForm['iTag'] );\n $aForm['iTag'] = $oSql->insert( 'tags', $aForm, true );\n }\n\n generateTagsLinks( );\n return $aForm['iTag'];\n}", "function add_tag($tag) {\n array_push($this->tags, $tag);\n }", "public function save()\n {\n $data = $this->input->post(null, true);\n $result = TagService::getInstance()->save($data);\n $this->_success($result);\n }", "public function addNewTag($tagName) {\n $sql = \"INSERT INTO t_tags VALUES(?)\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $tagName);\n $select->execute();\n $select->close();\n }", "public function tag($tag) {\n $this->tag = $tag;\n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "abstract protected function doSaveTag(TagInterface $tag);", "public function store(TagRequest $request)\n {\n try {\n\n DB::beginTransaction();\n if (isset($request->is_active) && $request->is_active == 1)\n $request->request->add(['is_active' => 1]);\n else\n $request->request->add(['is_active' => 0]);\n\n $request->request->add(['slug' => \\Str::slug($request->slug)]);\n\n // return $request->except('_token','type');\n $Tag = Tag::create($request->except('_token'));\n\n //save translations\n // $Tag->name = $request->name;\n // $Tag->save();\n\n // return $Tag;\n DB::commit();\n return redirect()->route('Tag.index')->with(['success' => 'تم ألاضافة بنجاح']);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('Tag.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n }", "private function addTag()\n {\n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n \n $data = array();\n $tagTitle = stripslashes(trim($_REQUEST['tag']));\n $tag = Utils::sanitize($tagTitle);\n \n $Tickets = new Tickets($params);\n $Tickets->addTag($tag, $tagTitle);\n \n echo '[{\"isError\":0, \"message\":\"Successfully added tag\"}]';\n exit;\n }", "function add_tag($tag) {\n if (!is_object($tag)) {\n return false;\n }\n if (!isset($tag->name) or\n !isset($tag->value) or\n !isset($tag->ticketid) or\n isset($tag->id)){\n\n return false;\n }\n\n if (!insert_record('helpdesk_ticket_tag', $tag)) {\n return false;\n }\n\n // Lets make an update saying we added this tag.\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = get_string('tagaddedwithnameof', 'block_helpdesk') . $tag->name;\n $dat->status = HELPDESK_NATIVE_UPDATE_TAG;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n // Update modified time and refresh the ticket.\n $this->store();\n $this->fetch();\n return true;\n }", "public function setTag($tag) {\n $this->_tag = $tag;\n }", "public function setTag($tag) {\n $this->_tag = $tag;\n }", "private function createNewTag(object $tag) \n {\n if(Tag::find($tag->id)) return;\n\n $newTag = new Tag;\n \n $newTag->id = $tag->id;\n $newTag->name = $tag->name;\n $newTag->description = $tag->description;\n\n if(isset($tag->category->id)){\n\n $category = Category::firstOrCreate([\n 'id' => $tag->category->id,\n 'name' => $tag->category->name,\n 'description' => $tag->category->description,\n ]);\n\n $newTag->category()->associate($category->fresh());\n }\n\n $newTag->save();\n }", "public function store(StoreBlogTagRequest $request)\n {\n $inputs = $request->except('_token','seo_title', 'seo_description', 'seo_keyword', 'page_title');\n $inputs['slug'] = str_slug($request->slug);\n $tag = BlogTag::create($inputs);\n\n $tag->seo()->create([\n 'seo_title' => $request->seo_title ?? '',\n 'seo_keyword' => $request->seo_keyword ?? '',\n 'seo_description' => $request->seo_description ?? '',\n 'page_title' => $request->page_title ?? '',\n ]);\n\n Helper::custom_session_flash('success','store');\n return redirect()->back();\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'seo_title' => 'max:70',\n 'meta_description' => 'max:215'\n ]);\n $tag = new Tag();\n $tag->title = $request->title;\n $tag->description = $request->description;\n $tag->seo_title = $request->input(\"seo_title\", \"\");\n $tag->meta_key = $request->input(\"meta_key\", \"\");\n $tag->meta_description = $request->input(\"meta_description\", \"\");\n\n if (SM::is_admin() || isset($permission) &&\n isset($permission['tags']['status_update'])\n && $permission['tags']['status_update'] == 1) {\n $tag->status = $request->status;\n }\n if (isset($request->image) && $request->image != '') {\n $tag->image = $request->image;\n }\n\n $slug = (trim($request->slug) != '') ? $request->slug : $request->title;\n $tag->slug = SM::create_uri('tags', $slug);\n $tag->created_by = SM::current_user_id();\n\n if ($tag->save()) {\n $this->removeThisCache();\n\n return redirect(SM::smAdminSlug(\"tags/$tag->id/edit\"))\n ->with('s_message', 'Tag created successfully!');\n } else {\n return redirect(SM::smAdminSlug('tags'))\n ->with('s_message', 'Tag Save Failed!');\n }\n }", "public function store(StoreUpdateTagRequest $request)\n {\n $tag = $this->tagRepository->create($request->all());\n\n return $this->successCreated($tag);\n }", "public function store(AdminTagCreate $request)\n {\n $request->validated();\n $post = new Tag();\n $data = $request->all();\n $post->fill($data);\n// $post->title = $request->title;\n// $post->subtitle = $request->subtitle;\n// $post->slug = $request->slug;\n// $post->body = $request->body;\n $post->save();\n\n //TODO redirect to created post\n return redirect(route('tag.index'));\n }", "public function addTag($tag) {\n $this->init(); //it would actually work without it\n\n if (!in_array($tag,$this->tags)) {\n $tag = trim($tag);\n\n $this->tags['new'][] = $tag;\n return true;\n }\n\n return false;\n }", "public function save()\n {\n // Initialize getID3 engine\n $getID3 = new \\getID3;\n $getID3->setOption(array('encoding' => $this->options['tag_encoding']));\n\n $tagWriter = new \\getid3_writetags();\n\n foreach ($this->options as $optionName => $optionValue) {\n $tagWriter->$optionName = $optionValue;\n }\n\n $tagWriter->tag_data = $this->tagData;\n\n if ($tagWriter->WriteTags()) {\n return true;\n }\n\n return $tagWriter->errors;\n }", "public function store_tag_status() {\n $app = $this->app;\n $log_id = $app->request->post(\"log_id\");\n $tag_id = $app->request->post(\"tag_id\");\n $srv = new LogService($this->getEntityManager(), $app, $this->getUser());\n $srv->store_new_tag_status($log_id, $tag_id);\n }", "public function tagged( $tag );", "public function store(TagRequest $request)\n {\n $input = $request->all();\n\n empty(!$input['metadata_title']) ? $input['metadata_title'] : $input['metadata_title'] = $input['name'];\n\n $metadata = Metadata::create([\n 'title' => $input['metadata_title'],\n 'description' => $input['metadata_description'],\n 'keywords' => $input['metadata_keywords'],\n ]);\n\n $tag = Tag::create([\n 'name' => $input['name'],\n 'slug' => str_slug($input['name']),\n 'metadata_id' => $metadata['id'],\n ]);\n\n if (App::isLocale('pl')) {\n return redirect()->route('tags.index')->with('status', 'Tag &#8222;'.$tag->name.'&#8221; został wprowadzony do bazy!');\n } else {\n return redirect()->route('tags.index')->with('status', 'The tag &#8222;'.$tag->name.'&#8221; has been added!');\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'tag_name' => 'required',\n \n ]);\n \n \n $tagName=$request->input('tag_name');\n \n\n if($this->tagNameExists($tagName)){ \n return redirect()->back();\n }\n \n \n \n $tag = new Tag();\n $tag->tag = $request->input('tag_name');\n \n $tag->save();\n Session::flash('message', 'the tag '.$tag->tag.' has been added');\n return redirect()->back();\n }", "function update_tag( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::set_instance( $tag_id, $tag_name, $tag_color, $tag_bg );\n return $tag;\n}", "public function store(TagRequest $request)\n {\n Tag::create([\n 'tag' => $request->tag,\n 'slug' => Str::slug($request->tag)\n\n ]);\n alert()->success('Tag criada com sucesso!', 'Salvo');\n\n return redirect(route('tag.index'));\n }", "protected function add_dyntag($tag, $val)\r\n\t{\r\n\t\t$this->$tag = $val;\r\n\t}", "public function store(StoreTagRequest $request)\n {\n $tag = $request->validated();\n $tagModel = resolve('App\\ViewModels\\TagViewModel');\n $tag = $tagModel->createTag($tag);\n return back();\n }", "public function create()\n {\n getAuthentication()->requireAuthentication();\n $tag = $_POST['tag'];\n unset($_POST['tag']);\n return $this->update($tag);\n }", "public function store(TagRequest $request)\n {\n\n }", "public function store(CreateTagRequest $request)\n {\n Tag::create($request->all());\n return redirect(route('tags.index'))->with('success', 'A tag has been created');\n }", "public function store(tagForm $request)\n {\n if(!Auth::user()->can('create-tag'))\n abort(403);\n $cateData = $request->except('create_at','update_at','delete_at');\n $this->tag->create($cateData);\n\n return $this->created();\n\n }", "function update_tag($tag) {\n if (update_record('helpdesk_ticket_tag', $tag)) {\n $this->store();\n $this->fetch();\n return true;\n }\n return false;\n }", "public function store(TagRequest $request)\n {\n if (!auth()->user()->ability('admin', 'create_tags')) {\n return redirect('admin/index');\n }\n $input['name'] = $request->name;\n $input['status'] = $request->status;\n Tag::create($input);\n return redirect()->route('admin.tags.index')->with([\n 'message' => 'Created successfully',\n 'alert-type' => 'success'\n ]);\n\n }", "public function store(TagRequest $request)\n {\n Tag::create([\n 'name' => $request->name,\n 'slug' => Str::slug($request->name),\n ]);\n\n return redirect()->route('admin.post.tag.index')->with('status', 'Tag Artikel ' . $request->name . ' telah ditambahkan');\n }", "public function addTag($tag)\n {\n $this->tags[] = $tag;\n $this->processTags();\n }", "function save($changes) {\n if (is_array($changes) && (isset($changes['tag_name'])))\n $this->tag_name = $changes['tag_name'];\n\n $tag_name = preg_replace('/[^0-9a-z ]+/i', '', $this->tag_name);\n if (! ($count = $this->_tag_name_exists($tag_name)))\n $this->tag_name = $tag_name;\n else \n $this->tag_name = $tag_name . '_' . $count;\n\n $this->db->where('id', $this->id);\n $this->db->update(self::table_name, $this);\n }", "public function attachTag(Tag $tag)\n {\n $elementTagClass = $this->getElementTagClass();\n\n $transaction = static::getDb()->beginTransaction();\n try {\n // open space to add composite\n $elementTag = Yii::createObject($elementTagClass);\n $elementTag->{$this->getElementIdColumn()} = $this->id;\n $elementTag->{$this->getTagIdColumn()} = $tag->id;\n $status = $elementTag->save();\n $transaction->commit();\n } catch(\\Exception $e) {\n $transaction->rollBack();\n $status = false;\n }\n return $status;\n }", "public function testUpdateInvalidTag() {\n\t\t// Create a tag and try to update it without actually inserting it\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->update($this->getPDO());\n\t}", "public function store(Request $request)\n {\n //\n\t\t$this->validate($request, [\n\t\t\t'tag' => 'required|max:20',\n\t\t]);\n\t\t\n\t\t$board = Board::find($request->board_id);\n\t\t$tagList = $board->getTagListAttribute();\n\t\t\n\t\tif(!Tag::where('name', $request->tag)->exists()){\n\t\t\t$tag = new Tag;\n\t\t\t$tag->name = $request->tag;\n\t\t\t$tag->save();\n\t\t}else{\n\t\t\t$tag = Tag::where('name', $request->tag)->first();\n\t\t}\n\t\tif(!array_search($tag->id, $tagList)){\n\t\t\t$tagList[] = $tag->id;\n\t\t}\n\t\t\n\t\t$board->tags()->sync($tagList);\n\t\t\n\t\treturn redirect()->action('BoardController@show', [$board->id]);\n }", "function save_tag($edit = false)\n{\n global $xoopsConfig, $xoopsSecurity;\n\n $page = rmc_server_var($_POST, 'page', 1);\n\n if (!$xoopsSecurity->check()) {\n redirectMsg('tags.php?page=' . $page, __('Operation not allowed!', 'mywords'), 1);\n die();\n }\n\n $name = rmc_server_var($_POST, 'name', '');\n $short = rmc_server_var($_POST, 'short', '');\n\n if ('' == $name) {\n redirectMsg('tags.php?page=' . $page, __('You must provide a name!', 'mywords'), 1);\n die();\n }\n\n if ($edit) {\n $id = rmc_server_var($_POST, 'id', 0);\n if ($id <= 0) {\n redirectMsg('tags.php?page=' . $page, __('Tag id not provided!', 'mywords'), 1);\n die();\n }\n\n $tag = new MWTag($id);\n if ($tag->isNew()) {\n redirectMsg('tags.php?page=' . $page, __('Tag does not exists!', 'mywords'), 1);\n die();\n }\n } else {\n $tag = new MWTag();\n }\n\n if ('' == trim($short)) {\n $short = TextCleaner::sweetstring($name);\n } else {\n $short = TextCleaner::sweetstring($short);\n }\n\n // Check if tag exists\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n if ($edit) {\n $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags') . \" WHERE (tag='$name' OR shortname='$short') AND id_tag<>$id\";\n } else {\n $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags') . \" WHERE tag='$name' OR shortname='$short'\";\n }\n\n list($num) = $db->fetchRow($db->query($sql));\n if ($num > 0) {\n redirectMsg('tags.php?page=' . $page, __('A tag with same name or same short name already exists!', 'mywords'), 1);\n die();\n }\n\n $tag->setVar('tag', $name);\n $tag->setVar('shortname', $short);\n if ($tag->save()) {\n redirectMsg('tags.php', __('Database updated successfully!', 'mywords'), 0);\n die();\n }\n redirectMsg('tags.php?page=' . $page, __('A problem occurs while trying to save tag.', 'mywords') . '<br>' . $tag->errors(), 1);\n die();\n}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|unique:tags'\n ], [\n 'name.required' => 'กรุณาระบุชื่อ Tag',\n 'name.unique' => 'มีชื่อนี้แล้ว',\n ]);\n\n $tag = new Tag();\n $tag->user_id = Auth::id();\n $tag->name = $request->name;\n $tag->slug = str_slug($request->name);\n $tag->is_published = $request->is_published;\n $tag->save();\n\n return redirect()->route('tags.index')->with('message', 'สร้าง Tag เสร็จสมบูรณ์');\n }", "public function store(Request $request)\n {\n $this ->validate($request,['new-post-tag'=>'required']);\n\n $tag = new Tag(array(\n 'title' => $request->get('new-post-tag'),\n 'slug' => str_slug($request->get('new-post-tag'))\n ));\n $tag->save();\n\n\n return $this->getAllTags();\n }", "public function store(TagStoreRequest $request)\n {\n $tag = new Tag();\n $tag->fill($request->except('image'));\n\n if ($request->has('image')) {\n $tag = $tag->uploadImage($request->file('image'));\n }\n\n $tag->save();\n\n $request->session()->flash('success', 'Тег успешно создан');\n\n return redirect()->route('admin.tags.index');\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 store(Request $request)\n {\n $request->validate([\n 'name' => 'required|max:255|unique:tags'\n ]);\n $tag = new Tag();\n $tag->name = $request->name;\n $tag->save();\n session()->flash('success_save_tag','New Tag Added Successfully :)');\n return redirect()->route('tags.index');\n }", "public function createTag()\n {\n $this->di->common->verifyAdmin();\n $form = new Form('tag-form', Models\\Tag::class);\n if ($this->di->request->getMethod() == 'POST') {\n if ($this->di->tag->createFromForm($form)) {\n $this->di->common->redirectMessage('admin/tag', 'Taggen <strong>' . htmlspecialchars($form->getModel()->name) . '</strong> har skapats.');\n }\n }\n \n return $this->di->common->renderMain('tag/edit', [\n 'tag' => $form->getModel(),\n 'update' => false,\n 'form' => $form\n ], 'Skapa tagg');\n }", "public function store(TagRequest $request)\n {\n $tag = new Tag($request->only(['name']));\n\n if ($request->has('type')) {\n $tag->setAttribute('type', $request->input('type'));\n }\n\n if (! $tag->save()) {\n $this->response->errorInternal();\n }\n\n return $this->response->created(null, $tag);\n }", "public function store(Request $request)\n {\n $this->validate($request, ['tag' => 'required']);\n\n $tag = Tag::create($request->all());\n // foreach ($request->roles as $role) {\n // $user->assignRole($role);\n // }\n\n return redirect('admin/tags')->with('flash_message', 'Tag added!');\n }", "public function store(Request $request)\n {\n // validate data from post\n $this->validate($request, array(\n 'name' => 'required | max:255'\n ));\n\n // store new tag to the database\n $tag = new Tag();\n $tag->name = $request->name;\n $tag->save();\n\n // set flash message\n Session::flash('success', 'New tag was created succesfully');\n\n // redirect to index page\n return redirect()->route('tags.index');\n }", "public function created(Tags $tag): void\n {\n $user = auth()->user(); \n $tag->author()->associate($user)->save();\n }", "public function addTag($tag)\r\n {\r\n if (!empty($this->data['props']['taglist'])) {\r\n $this->data['props']['taglist'] .= ',' . $tag;\r\n } else {\r\n $this->data['props']['taglist'] = $tag;\r\n }\r\n }", "public function saveTag($data) {\n $criteria = craft()->elements->getCriteria(ElementType::Tag);\n $criteria->title = $data['title'];\n $criteria->group = $data['groupId'];\n $result = $criteria->find();\n if (isset($result[0])) {\n return $result[0]->id;\n } else {\n //Create a new tag if not\n $tag = new TagModel();\n $tag->groupId = $data['groupId'];\n $tag->getContent()->setAttribute('title', $data['title']);\n $success = craft()->tags->saveTag($tag);\n if ($success) {\n return $tag->id;\n }\n }\n }", "public function setTags($newVal) {\n $this->tags = $newVal;\n }", "public function store(Request $request)\n {\n $tag = new Tag($request->all());\n\n $tag->save();\n\n flash('Tag creado sastifactoriamente')->success()->important();\n\n return redirect()->route('tags.index');\n }", "public function addTag(Dklab_Cache_Frontend_Tag $tag)\n {\n if ($tag->getBackend() !== $this->_getBackend()) {\n Zend_Cache::throwException(\"Backends for tag \" . get_class($tag) . \" and slot \" . get_class($this) . \" must be same\");\n }\n $this->_tags[] = $tag;\n }", "function addATag() {\n $query = \"INSERT INTO PushpinTags SET tags = '$this->tag', pushpin_ID = LAST_INSERT_ID();\";\n\n // prepare query\n $stmt = $this->conn->prepare($query);\n\n // execute query\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "protected function _initTag()\n {\n $tagId = (int)$this->getRequest()->getParam('tag_id', false);\n $storeId = (int)$this->getRequest()->getParam('store', false);\n $tag = $this->_objectManager->create(\\Magepow\\ProductTags\\Model\\Tag::class);\n if ($tagId) {\n $tag->load($tagId);\n }\n $coreRegistry = $this->_objectManager->get(\\Magento\\Framework\\Registry::class);\n $coreRegistry->register('tag', $tag);\n $coreRegistry->register('current_tag', $tag);\n $this->_objectManager->get(\\Magento\\Cms\\Model\\Wysiwyg\\Config::class)\n ->setStoreId($storeId);\n return $tag;\n }", "public function store(TagRequest $request)\n {\n return redirect()->route('tags.tags')->with('message', $this->masterController->store($request));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'Required|max:191'\n ]);\n\n $name = $request->input('name');\n\n $new_tag = new \\App\\Tag();\n $new_tag->name = $name;\n $new_tag->user_id = Auth::user()->id;\n $new_tag->save();\n \n $request->session()->flash(\"success_msg\", \"Successful add a tag.\");\n return redirect(\"/home/tag\");\n }", "private function set_current_tag($tag_obj)\n {\n $this->current_tag = (object) array(\n 'name' => $tag_obj->name\n ,'slug' => $tag_obj->slug\n );\n }", "public function associateToBook(Tag $tag, Book $book);", "public function addTag($tagData)\n {\n $this->clickButton('add_new_tag');\n $this->fillTagSettings($tagData);\n $this->saveForm('save_tag');\n }", "public function putAction() {\n\t\t$rawData = json_decode($this->_request->getRawBody(), true);\n\t\tif (!empty($rawData)) {\n\t\t\t$rawData['name'] = ucfirst($rawData['name']);\n\t\t\t$result = Models_Mapper_Tag::getInstance()->save($rawData);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t}\n\t\tif ($result === null) {\n\t\t\t$this->_error('This tag already exists', self::REST_STATUS_BAD_REQUEST);\n\t\t} else {\n\t\t\treturn $result->toArray();\n\t\t}\n\t}", "public function store(CreateTagRequest $request)\n {\n $result = Service::getInstance()->admin->createTag->run($request);\n\n return $this->response($result);\n }", "public function store(Request $request)\n {\n if ($this->validate($request, [\n 'tag' => 'required|string',\n ])) {\n Tag::create([\n 'name' => $request->tag,\n ]);\n \n return redirect()->route('tag.index')->with('message', 'Tag is created!');\n } else {\n return redirect()->back()->with('error', 'Incorrect input!')->withInput();\n }\n \n\n\n\n }", "public function processTag()\n {\n $tags = '';\n\n $articles = $this->dao->select('id, keywords')->from(TABLE_ARTICLE)->fetchPairs('id', 'keywords'); \n foreach($articles as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_ARTICLE)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags = $keywords;\n }\n\n $products = $this->dao->select('id, keywords')->from(TABLE_PRODUCT)->fetchPairs('id', 'keywords'); \n foreach($products as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_PRODUCT)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags .= ',' . $keywords;\n }\n\n $categories = $this->dao->select('id, keywords')->from(TABLE_CATEGORY)->fetchPairs('id', 'keywords'); \n foreach($categories as $id => $keywords)\n {\n $keywords = seo::unify($keywords, ',');\n $this->dao->update(TABLE_CATEGORY)->set('keywords')->eq($keywords)->where('id')->eq($id)->exec();\n $tags .= ',' . $keywords;\n }\n\n $this->loadModel('tag')->save($tags);\n }", "public function autoTag()\n {\n $tags = Tag::string2array($this->tags);\n \n if(isset($this->name) && !empty($this->name)) {\n $tags[] = $this->name;\n }\n \n $tags[] = $this->arena->name;\n $tags[] = $this->ltype->display_name;\n \n $this->tags = Tag::array2string(array_unique($tags));\n }", "function associate_tag($tag_id, $tip_id) {\n $sql = '\n INSERT INTO\n tips_tags (tip_id, tag_id)\n VALUES\n (?, ?)';\n \n return $this->prep_and_exec($sql, [$tip_id, $tag_id]);\n }", "public\n\tfunction setTagLabel(string $newTagLabel) {\n\t\tif($newTagLabel === null) {\n\t\t\t$this->tagLabel = $newTagLabel;\n\t\t}\n\t}", "public function create($idArticulo,$idTag){\n\n $articulo = Article::find($idArticulo);\n $tag = Tag::find($idTag);\n $articulo->tags()->attach($tag);\n }", "public function store(Request $request)\n {\n\n\n if (Input::file('picture')) {\n\n $data = $request->all();\n $lala = Input::file('picture');\n $extension = Input::file('picture')->getClientOriginalExtension();\n $destinationPath='img/';\n $fileName = rand(11111,99999).'.'.$extension; // renaming image\n Input::file('picture')->move($destinationPath, $fileName);\n\n $post = Post::create([\n 'user_id' => auth()->id(),\n 'name'=> request('name'),\n 'description'=>request('description'),\n 'status'=>'free',\n 'picture'=>$fileName,\n\n //image\n\n ]);\n $tags = $data['myInputs'];\n\n // dd($tags);\n foreach ($tags as $eachInput) {\n\n\n $tag = Tag::where('name','=',$eachInput)->first();\n\n\n if (is_null($tag)){\n $tag = new Tag();\n $tag->name=$eachInput;\n $tag->save();\n // dd($tag);\n\n }\n $post->tags()->attach([$tag->id]);\n }\n $post->save();\n\n\n // dd($lala);\n }\n\n // dd(auth()->id()) ;\n return back();\n\n\n }", "public function save() {\n // Check to see if another tag exists with the same name\n $duplicate_tag = ORM::factory(\"tag\")\n ->where(\"name\", \"=\", $this->name)\n ->where(\"id\", \"!=\", $this->id)\n ->find();\n if ($duplicate_tag->loaded()) {\n // If so, tag its items with this tag so as to merge it\n $duplicate_tag_items = ORM::factory(\"item\")\n ->join(\"items_tags\", \"items.id\", \"items_tags.item_id\")\n ->where(\"items_tags.tag_id\", \"=\", $duplicate_tag->id)\n ->find_all();\n foreach ($duplicate_tag_items as $item) {\n $this->add($item);\n }\n\n // ... and remove the duplicate tag\n $duplicate_tag->delete();\n }\n\n if (isset($this->object_relations[\"items\"])) {\n $added = array_diff($this->changed_relations[\"items\"], $this->object_relations[\"items\"]);\n $removed = array_diff($this->object_relations[\"items\"], $this->changed_relations[\"items\"]);\n if (isset($this->changed_relations[\"items\"])) {\n $changed = array_merge($added, $removed);\n }\n $this->count = count($this->object_relations[\"items\"]) + count($added) - count($removed);\n }\n\n $result = parent::save();\n\n if (!empty($changed)) {\n foreach (ORM::factory(\"item\")->where(\"id\", \"IN\", $changed)->find_all() as $item) {\n module::event(\"item_related_update\", $item);\n }\n }\n\n return $result;\n }", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function addTag($key, $data)\n {\n $this->tags[$key] = $data;\n //echo $key.'=>'.$data.'<br />';\n }", "public function store(Request $request)\n {\n $valid = Validator::make(\n $request->all(),\n ['tag' => 'required|max:150|unique:tags,tag']\n );\n\n if ($valid->fails()) {\n return [\n 'message' => 'You have some errors',\n 'errors' => $valid->errors()->all()\n ];\n }\n\n $tag = new Tag();\n $tag->tag = $request->tag;\n $tag->slug = Str::slug($request->tag);\n $tag->save();\n return [\n 'message' => \"Tag added successfully\",\n 'status' => 200,\n 'type' => 'success',\n 'timeout' => 10000,\n 'desc' => 'Refresh To see changes'\n ];\n }", "public function store(Request $request)\n {\n // validate the data (includes CSRF protection)\n $this->validate($request, [\n 'name' => 'required|max:255|unique:tags,name'\n ]);\n \n // store in the database\n $tag = new Tag();\n $tag->name = $request->name;\n $tag->save();\n \n // redirect with flash data to tags.index\n Session::flash('success', 'The tag was created successfully!');\n \n $tags = Tag::orderBy('id')->get();\n return redirect()->route('tags.index')->withTags($tags);\n }", "public function setTag($tag) {\n\t\t$this->mail['Tag'] = $tag;\n\t}", "public function store(CreateTagRequest $request)\n {\n $tag = new Tag();\n $tag->title = request('title');\n $tag->slug = request('slug')?: request('title');\n $tag->publish = request('publish')?: false;\n $tag->save();\n\n return response()->json([\n 'tag' => $tag\n ]);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required'\n ]);\n $new_item = new Tag();\n $new_item->title = $request->title;\n $new_item->save();\n\n Toastr::success('Tag added', 'Success');\n return back();\n }", "public function store(Request $request)\n {\n $tag = new Tag;\n \n $tag->name = $request->tag_name;\n\n if($tag->save()){\n return json_encode('Tag has been created');\n }\n }", "public function testUpdateValidTag() {\n\t\t// Count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\n\t\t// Create a new tag and insert it into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\n\t\t// Edit the tag and update it in mySQL\n\t\t$tag->setTagLabel($this->VALID_TAG_LABEL);\n\t\t$tag->update($this->getPDO());\n\n\t\t// Grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTag = Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertEquals($pdoTag->getTagLabel(), $this->VALID_TAG_LABEL);\n\t}", "public function testUpdateInvalidTag() {\n\t\t// create a Tag with a non null tag id and watch it fail\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->update($this->getPDO());\n\t}", "public static function create(){\n\t\tglobal $current_user;\n\t\t$name \t= $_POST['name'];\n\t\tinsert('INSERT INTO tag (name, user_id)\n\t\t\t\tVALUES (\"' . $name . '\", ' . $current_user['id'] . ')');\n\t}", "public function store(Request $request)\n {\n //\n $this->validate($request, [\n 'name'=>'required|max:20|unique:tags'\n ]);\n $tag = new Tags;\n $tag->name = $request->input('name');\n $tag->save();\n\n\n return redirect()->back()->with('success', 'Tag created');\n\n }", "function updateTag($tagName) {\r\n\r\n // debug( $tagName);\r\n // $newTagName = $stemmer->stem($tagName);\r\n\r\n if (empty($tagName) )\r\n return false;\r\n \r\n $result = $this->findByName($tagName);\r\n\r\n if ($result)\r\n return($result['Tag']['id']);\r\n else {\r\n $this->create();\r\n $this->saveField('name', $tagName);\r\n return($this->id);\r\n }\r\n \r\n }", "public function tag($newTags)\n {\n $tags = $this->manager->getTags();\n $newTags = (! is_array($newTags)) ? [$newTags] : $newTags;\n\n foreach ($newTags as $tag) {\n if (! isset($tags[$tag])) {\n $tags[$tag] = [];\n }\n\n // Add reference\n $tags[$tag][] = [$this->type, $this->key];\n }\n\n // Save new list of tags to session\n $this->manager->setTags($tags);\n\n // Make it possible to add tags in chain\n return $this;\n }", "private function store()\n {\n return empty($this->tags) ? $this->store : $this->store->tags($this->tags);\n }", "public function save()\n {\n $id = intval($this->getId());\n\n $result[\"success\"] = true;\n $result[\"message\"] = \"\";\n\n $table = \"tag\";\n $fieldset = array(\"tag_name\",\"tag_description\",\"is_active\");\n $valueset = array($this->getTagName(),$this->getTagDescription(),$this->getIsActive());\n\n if($id > 0){\n $condition = \"AND id=\".$id;\n if(Connection::updateData($table,$fieldset,$valueset,$condition)){\n $result[\"success\"] = true;\n $result[\"message\"] = \"Update Successful.\";\n }else {\n $result[\"success\"] = false;\n $result[\"message\"] = \"Update Failed.\";\n }\n }\n else{\n $insert_id = 0;\n if(Connection::insertData($table,$fieldset,$valueset,$insert_id)){\n $result[\"success\"] = true;\n $result[\"message\"] = \"Insert Successful.\";\n $this->setId($insert_id);\n }else{\n $result[\"success\"] = false;\n $result[\"message\"] = \"Insert Failed.\";\n }\n }\n\n return $result;\n\n }", "private function addTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n\t\t// return Builder\n $tag = Tag::where('tag', '=', $tagName)->first();\n\t\t\n\t\tif (is_object($tag))\n\t\t{\n\t\t\t// To increment count number to exists tag\n\t\t\tTagUtil::incrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count() === 0)\n\t {\n\t\t\t\t// To attach a related item to taggable\n\t \t$this->tags()->attach($tag->id);\n\t }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tag = new Tag(['tag' => $tagName]);\n\t\t\t\n\t\t\t$this->tags()->save($tag);\t\n\t\t}\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'isi' => 'required',\n 'tag' => 'required'\n ]);\n\n $tags = explode(',', $request->tag);\n //buat id tampung\n // dd($tags);\n $tag_ids = [];\n //sava jika belum ada kalau sudah ada tampung\n foreach ($tags as $tag_nama) {\n $tag = Tags::where(\"nama_tag\", $tag_nama)->first();\n\n if ($tag) {\n $tag_ids[] = $tag->id;\n } else {\n $new_tag = Tags::create([\"nama_tag\" => $tag_nama]);\n $tag_ids[] = $new_tag->id;\n }\n }\n $jawaban = new Jawaban;\n $jawaban->isi = $request->isi;\n $jawaban->user_id = Auth::id();\n $jawaban->pertanyaan_id = $request->id_pertanyaan;\n $jawaban->save();\n $jawaban->tags()->sync($tag_ids);\n\n return redirect('/pertanyaan')->with('status_done', 'Pertanyaan Berhasil Ditambahkan');\n }", "function setTag($tag) {\n $this->fields['tag'] = $tag;\n return $this;\n }", "function setTag($tag) {\n $this->fields['tag'] = $tag;\n return $this;\n }", "function setTag($tag) {\n $this->fields['tag'] = $tag;\n return $this;\n }", "function setTag($tag) {\n $this->fields['tag'] = $tag;\n return $this;\n }", "function setTag($tag) {\n $this->fields['tag'] = $tag;\n return $this;\n }", "public function saved(MetaTag $metaTag)\n {\n // Removing Entries from the Cache\n $this->clearCache($metaTag);\n }" ]
[ "0.6536719", "0.64691377", "0.6445549", "0.6424051", "0.6371954", "0.6352247", "0.6274821", "0.6248676", "0.6238151", "0.62273955", "0.6174724", "0.6147355", "0.6135944", "0.61241007", "0.60675424", "0.60675424", "0.60631615", "0.60629237", "0.6021956", "0.6019236", "0.60132825", "0.5995067", "0.5968985", "0.59504724", "0.59466034", "0.59414506", "0.59290713", "0.59195656", "0.59117335", "0.5902826", "0.5891717", "0.58801883", "0.586551", "0.5837869", "0.5825466", "0.5816468", "0.58110344", "0.5809077", "0.58060795", "0.5803703", "0.5801753", "0.57984555", "0.5797736", "0.579193", "0.57800204", "0.5771312", "0.57650834", "0.575408", "0.57509077", "0.5749669", "0.56985694", "0.56951135", "0.5691369", "0.56848437", "0.56823736", "0.5677661", "0.5672611", "0.56677014", "0.5637072", "0.56348115", "0.5628932", "0.5624038", "0.5624031", "0.5616573", "0.56101364", "0.55826277", "0.55760324", "0.55733305", "0.55732197", "0.55697966", "0.5556748", "0.5554678", "0.55456734", "0.5535214", "0.5527456", "0.5522232", "0.5518008", "0.5515564", "0.55131954", "0.5511285", "0.5510403", "0.5490662", "0.54784906", "0.5476974", "0.54694605", "0.54683393", "0.54654235", "0.5463352", "0.5458619", "0.54366577", "0.5433918", "0.54267657", "0.5424322", "0.5423572", "0.5423236", "0.5423236", "0.5423236", "0.5423236", "0.5423236", "0.5416972" ]
0.6219691
10
Update the specified Tag
public function update(UpdateTagRequest $request, Tag $tag) { $tag->update( $request->validated() ); return response([],202); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($tag)\n {\n getAuthentication()->requireAuthentication();\n $tag = $this->tag->sanitize($tag);\n $params = $this->tag->validateParams($_POST);\n $res = getDb()->postTag($tag, $params);\n if($res)\n {\n $tag = $this->api->invoke(\"/{$this->apiVersion}/tag/{$tag}/view.json\", EpiRoute::httpGet);\n return $this->success('Tag created/updated successfully', $tag['result']);\n }\n else\n {\n return $this->error('Tag could not be created/updated', false);\n }\n }", "public static function update($tag)\n {\n getAuthentication()->requireAuthentication();\n $tag = Tag::sanitize($tag);\n $params = Tag::validateParams($_POST);\n $res = getDb()->postTag($tag, $params);\n if($res)\n return self::success('Tag created/updated successfully', getDb()->getTag($tag));\n else\n return self::error('Tag could not be created/updated', false);\n }", "public function update(Request $request, Tag $tag)\n {\n //\n }", "public function update(Request $request, Tag $tag)\n {\n //\n }", "public function update(Request $request, tag $tag)\n {\n //\n \n $request->validate([\n 'tag_id' => 'required',\n 'tag_name' => 'required',\n ]);\n\n $tagName=$request->input('tag_name');\n\n if($this->tagNameExists($tagName)){ \n return redirect()->back();\n }\n \n $tagID = intval($request->input('tag_id'));\n $tag = tag::find($tagID);\n\n $tag->tag_name = $request->input('tag_name');\n \n $tag->save();\n Session::flash('message','tag '.$tag->tag_name.' has been apdated');\n return redirect()->back();\n }", "public function update(TagRequest $request, Tag $tag)\n {\n $tag->update([\n 'tag' => $request->tag,\n 'slug' => Str::slug($request->tag)\n ]);\n alert()->success('Tag Atualizada!', 'Atualizado');\n return redirect(route('tag.index'));\n }", "public function update(Request $request, Tag $tag)\n {\n $this->validate($request, [\n 'name' => 'required|unique:tags,name,' . $tag->id\n ], [\n 'name.required' => 'กรุณาระบุชื่อ Tag',\n 'name.unique' => 'มีชื่อนี้แล้ว',\n ]);\n\n $tag->user_id = Auth::id();\n $tag->name = $request->name;\n $tag->slug = str_slug($request->name);\n $tag->is_published = $request->is_published;\n $tag->save();\n\n return redirect()->route('tags.index')->with('message', 'แก้ไข Tag เสร็จสมบูรณ์');\n }", "public function update(Request $request, Tag $tag)\n {\n $valid = Validator::make(\n $request->all(),\n ['tag' => \"required|max:150|unique:tags,tag,$tag->id\"]\n );\n\n if ($valid->fails()) {\n return [\n 'message' => 'You have some errors',\n 'errors' => $valid->errors()->all()\n ];\n }\n\n $tag->tag = $request->tag;\n $tag->save();\n return [\n 'message' => \"$tag->tag updated successfully\",\n 'status' => 200,\n 'type' => 'success',\n 'timeout' => 10000,\n 'desc' => 'Refresh To see changes'\n ];\n }", "public function update(Request $request, \\App\\Models\\Tag $tag)\n {\n $tag->update([\n 'name' => $request->input('name')\n ]);\n }", "public function update(TagRequest $request, Tag $tag)\n {\n if (!auth()->user()->ability('admin', 'update_tags')) {\n return redirect('admin/index');\n }\n $input['name'] = $request->name;\n $input['slug'] = null;\n $input['status'] = $request->status;\n $tag->update($input);\n return redirect()->route('admin.tags.index')->with([\n 'message' => 'Updated successfully',\n 'alert-type' => 'success'\n ]);\n }", "function update_tag($tag) {\n if (update_record('helpdesk_ticket_tag', $tag)) {\n $this->store();\n $this->fetch();\n return true;\n }\n return false;\n }", "public function update(Request $request, Tag $tag)\n {\n\n $update = $tag->update([\n 'name' => $request->name,\n 'slug' => Str::slug($request->slug)\n ]);\n if($update) {\n return response()->json(['messages' => 'data Successfully updated'], 200);\n }\n return response()->json(['messages' => 'Failed To update Data'], 200);\n }", "public function update(Request $request, Tag $tag)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|unique:tags,name,' . $tag->id . '|string|min:3|max:255',\n 'description' => 'nullable|string|min:3|max:255',\n ]);\n\n if ($validator->fails()) {\n return back()->with('toast_error', $validator->messages()->all()[0])->withInput();\n }\n\n $tag->update([\n 'name' => $request->name,\n 'description' => $request->description,\n ]);\n\n return redirect(route('tags.index'))->with('success', 'Tag has been updated!');;\n }", "public function update(Request $request, Tag $tag)\n {\n $input= $request->only(['name']);\n\n $rules= [\n\n 'name'=> 'required|unique:tags,name|string|max:50|min:3',\n\n ];\n\n $validator= Validator::make($input, $rules);\n\n if ($validator->fails()) {\n $validator_errors= $validator->errors();\n return AjaxResponse::fail('validator erros', compact('validator_errors'), 422 );\n }\n\n \t$tag->fill($input)->save();\n\n return AjaxResponse::success($tag);\n }", "public function update(TagRequest $request, $tag)\n {\n return redirect()->route('tags.tags')->with('message', $this->masterController->update($request,$tag));\n }", "public function update(Request $request, tag $tag)\n {\n $data = $request->validate([\n 'title'=> ['required','min:5','unique:tags,title,'.$tag->id],\n 'slug'=> ['required','min:5','unique:tags,slug,'.$tag->id]\n ]);\n $tag = tag::find($tag->id);\n $tag->title=$data['title'];\n $tag->slug=$data['slug'];\n $tag->save();\n $_SESSION['message'] = [\n 'status' => 'success',\n 'message' => \"tag \\\"{$data['title']}\\\" successfully saved\",\n\n ];\n return redirect()->route('tag.index');\n }", "public function update(Request $request, PostTag $postTag)\n {\n\n $this->validate($request, [\n 'title' => 'string|required'\n ]);\n\n $slug = Str::slug($request->title);\n $count = PostTag::where('slug', $slug)->count();\n if($count>1){\n $slug = $slug . '-' . date('ymdis') . '-' . time() . '-'. rand(0, 999);\n }\n\n $status = $postTag->update([\n 'title' => $request->title,\n 'slug' => $slug,\n 'status' => $request->status,\n ]);\n\n if($status) {\n request()->session()->flash('success', 'Post Tag has been updated successfully......');\n }\n else {\n request()->session()->flash('error', 'Error! Please try again......');\n }\n return redirect()->route('admin.post-tags.index');\n\n }", "public function update(TagUpdateRequest $request, $tag)\n {\n $tag = Tag::findOrFail($tag);\n $tag->fill($request->except('image'));\n\n if ($request->has('image')) {\n $tag = $tag->uploadImage($request->file('image'));\n }\n\n $tag->save();\n\n $request->session()->flash('success', 'Тег успешно обновлён');\n\n return redirect()->route('admin.tags.edit', $tag->id);\n }", "public function edit(Tag $tag)\n {\n \t//\n }", "public function update(UpdateTagRequest $request, Tag $tag)\n {\n $tag->slug = null;\n $tag->update([\n 'name' => $request->name,\n ]);\n return redirect(route('tags.index'))->with('success', 'A tag has been updated');\n }", "public function update(TagRequest $request, Tag $tag)\n {\n $tag->update([\n 'name' => $request->name,\n ]);\n\n return redirect()->route('admin.post.tag.index')->with('status', 'Tag Artikel ' . $request->name . ' telah Diupdate');\n }", "public function update($connectionTag){\r\n\t\t$sql = 'UPDATE connection_tags SET tie_id = ?, tag = ? WHERE id = ?';\r\n\t\t$sqlQuery = new SqlQuery2($sql);\r\n\t\t\r\n\t\t$sqlQuery->setNumber($connectionTag->tieId);\r\n\t\t$sqlQuery->set($connectionTag->tag);\r\n\r\n\t\t$sqlQuery->setNumber($connectionTag->id);\r\n\t\treturn $this->executeUpdate($sqlQuery);\r\n\t}", "public function updateTagForProject($projectID, $tagID, $new_name){\n $cxn = Connection::getInstance();\n }", "public function update(Tag $tag, Request $request)\n {\n $this->authorize('update', $tag);\n $tags = Tag::all();\n $oldNames = $tags->pluck('name')->all();\n // Get the tag names from the hidden input.\n $tagNames = explode(',', $request->name);\n $this->validateRequest();\n if (!isset($errors)) {\n $tagsToDelete = $tags->whereNotIn('name', $tagNames);\n foreach ($tagsToDelete as $tag) {\n $this->destroy($tag);\n }\n foreach ($tagNames as $name) {\n if (!in_array($name, $oldNames)) {\n Tag::create(['name' => $name]);\n }\n }\n }\n session()->flash('success');\n return redirect('/tags')->with($tagNames);\n }", "public function update(Tag $tag, Request $request)\n {\n $this->authorize('update', $tag);\n\n try {\n $data = $this->getData($request);\n\n $tag->update($data);\n\n return $tag;\n } catch (Exception $exception) {\n return ExceptionHelper::handleError($exception, $request);\n }\n }", "public function update(tagRequest $request)\n {\n $userId = Tag::findOrFail($request->id);\n $updateArray=$request->all();\n $updateUser = $userId->update($updateArray);\n if($updateUser)\n return response()->json([\n 'msg'=>'تم التعديل بنجاح',\n ]);\n }", "public function update(Request $request, Tag $tag)\n {\n if ($request->json()) {\n return DB::transaction(function() use ($request,$tag){\n $tag->fill($request->all());\n $tag->save();\n\n return response()->json([\n 'validate' => true,\n 'name' => $request->name\n ]);\n });\n }\n }", "public function edit(tag $tag)\n {\n //\n }", "public function testUpdateInvalidTag() {\n\t\t// Create a tag and try to update it without actually inserting it\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->update($this->getPDO());\n\t}", "public function update(TagRequest $request, $id)\n {\n try {\n\n DB::beginTransaction();\n $Tag = Tag::find($id);\n if (isset($request->is_active) && $request->is_active == 1)\n $request->request->add(['is_active' => 1]);\n else\n $request->request->add(['is_active' => 0]);\n\n $request->request->add(['slug' => \\Str::slug($request->slug)]);\n\n\n // return $request;\n $Tag->update($request->all());\n\n //save translations\n //$Tag->name = $request->name;\n // $Tag->save();\n\n\n DB::commit();\n return redirect()->route('Tag.index')->with(['success' => 'تم التعديل بنجاح']);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('Tag.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n }", "public function update(Request $request, $id)\n {\n $tag = Tag::findOrFail($id);\n $tag->name = $request->tag_name;\n \n $tag->save();\n }", "public function tag($tag) {\n $this->tag = $tag;\n }", "public function testUpdateValidTag() {\n\t\t// Count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\n\t\t// Create a new tag and insert it into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\n\t\t// Edit the tag and update it in mySQL\n\t\t$tag->setTagLabel($this->VALID_TAG_LABEL);\n\t\t$tag->update($this->getPDO());\n\n\t\t// Grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTag = Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertEquals($pdoTag->getTagLabel(), $this->VALID_TAG_LABEL);\n\t}", "function updateTag($tagName) {\r\n\r\n // debug( $tagName);\r\n // $newTagName = $stemmer->stem($tagName);\r\n\r\n if (empty($tagName) )\r\n return false;\r\n \r\n $result = $this->findByName($tagName);\r\n\r\n if ($result)\r\n return($result['Tag']['id']);\r\n else {\r\n $this->create();\r\n $this->saveField('name', $tagName);\r\n return($this->id);\r\n }\r\n \r\n }", "public function update(TagRequest $request, $id)\n {\n if($this->tag->where('id', $id)->exists() == false)\n return response()->json([\n 'message' => 'Tag não encontrada',\n 'success' => false\n ], Response::HTTP_NOT_FOUND);\n\n $data = $request->all();\n \n $tag = $this->tag->findOrFail($id);\n $tag->update($data);\n\n return response()->json([\n 'message'=> 'Tag atualizada com sucesso!'\n ], Response::HTTP_OK);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'seo_title' => 'max:70',\n 'meta_description' => 'max:215'\n ]);\n $tag = Tag::find($id);\n if (count($tag) > 0) {\n $this->removeThisCache($tag->slug);\n $tag->title = $request->title;\n $tag->description = $request->description;\n $tag->seo_title = $request->input(\"seo_title\", \"\");\n $tag->meta_key = $request->input(\"meta_key\", \"\");\n $tag->meta_description = $request->input(\"meta_description\", \"\");\n\n if (SM::is_admin() || isset($permission) &&\n isset($permission['tags']['status_update'])\n && $permission['tags']['status_update'] == 1) {\n $tag->status = $request->status;\n }\n if (isset($request->image) && $request->image != '') {\n $tag->image = $request->image;\n }\n\n $slug = (trim($request->slug) != '') ? $request->slug : $request->title;\n $tag->slug = SM::create_uri('tags', $slug, $id);\n $tag->modified_by = SM::current_user_id();\n if ($tag->update()) {\n $this->removeThisCache();\n\n return redirect(SM::smAdminSlug(\"tags/$tag->id/edit\"))\n ->with('s_message', 'Tag Updated successfully!');\n } else {\n return redirect(SM::smAdminSlug(\"tags/$tag->id/edit\"))\n ->with('s_message', 'Tag Update Failed!');\n }\n } else {\n return redirect(SM::smAdminSlug(\"tags\"))\n ->with(\"w_message\", \"No tag Found!\");\n }\n }", "public function putAction() {\n\t\t$rawData = json_decode($this->_request->getRawBody(), true);\n\t\tif (!empty($rawData)) {\n\t\t\t$rawData['name'] = ucfirst($rawData['name']);\n\t\t\t$result = Models_Mapper_Tag::getInstance()->save($rawData);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t}\n\t\tif ($result === null) {\n\t\t\t$this->_error('This tag already exists', self::REST_STATUS_BAD_REQUEST);\n\t\t} else {\n\t\t\treturn $result->toArray();\n\t\t}\n\t}", "public function testUpdateValidTag() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\t\t// create a new Tag and insert to into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->insert($this->getPDO());\n\t\t// edit the Tag and update it in mySQL\n\t\t$tag->setTagName($this->VALID_TAGCONTENT2);\n\t\t$tag->update($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTag = Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertEquals($pdoTag->getTagName(), $this->VALID_TAGCONTENT2);\n\t}", "public function update(UpdateTagRequest $request, Tag $tag)\n {\n $validated_data = $request->validated();\n\n $status = $tag->update($validated_data);\n\n return response()->json([\n 'status' => $status,\n 'data' => new TagResource($tag->load($this->relations))\n ]);\n }", "public function setTag($tag) {\n $this->_tag = $tag;\n }", "public function setTag($tag) {\n $this->_tag = $tag;\n }", "public function testUpdateInvalidTag() {\n\t\t// create a Tag with a non null tag id and watch it fail\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->update($this->getPDO());\n\t}", "public function update(Tag $tag, array $input)\n {\n $input = array_map( 'strip_tags', $input);\n if ($tag->update($input))\n return true;\n\n throw new GeneralException(trans('exceptions.backend.tags.update_error'));\n }", "public function update($tagId, $name)\n {\n $params = ['tag' => ['id' => $tagId, 'name' => $name]];\n return $this->httpPostJson('cgi-bin/tags/update', $params);\n }", "function update_tag( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::set_instance( $tag_id, $tag_name, $tag_color, $tag_bg );\n return $tag;\n}", "public function actionUpdate($id, Requests\\UpdateTagRequest $request){\n\n\t\t// Find tag in database.\n\n\t\t$tag = Tag::findOrFail($id);\n\n\t\t// Update tag in database.\n\n\t\t$tag->update($request->all());\n\n\t\t// Redirect with flash message.\n\n\t\t\\Session::flash('flash_message', 'You have successfully updated a tag.');\n\n\t\treturn redirect('/tags/'.$tag->id);\n\n\t}", "public function status_update(Request $request)\n {\n $this->validate($request, [\n \"post_id\" => \"required\",\n \"status\" => \"required\",\n ]);\n\n $tag = Tag::find($request->post_id);\n if (count($tag) > 0) {\n $tag->status = $request->status;\n $tag->update();\n $this->removeThisCache($tag->slug);\n }\n exit;\n }", "public function update(TagRequest $request, $id)\n {\n $input = $request->all();\n $tag = Tag::findOrFail($id);\n $metadata = $tag->metadata;\n\n $metadata->update([\n 'title' => $input['metadata_title'],\n 'description' => $input['metadata_description'],\n 'keywords' => $input['metadata_keywords'],\n ]);\n\n $tag->update([\n 'name' => $input['name'],\n 'slug' => str_slug($input['name']),\n 'metadata_id' => $metadata['id'],\n ]);\n\n if (App::isLocale('pl')) {\n return redirect()->route('tags.index')->with('status', 'Tag &#8222;'.$tag->name.'&#8221; został zaktualizowany!');\n } else {\n return redirect()->route('tags.index')->with('status', 'The tag &#8222;'.$tag->name.'&#8221; has been updated!');\n }\n }", "public function update(AdminTagUpdate $request, $id)\n {\n $tag = Tag::find($id);\n $data = $request->all();\n $tag->fill($data);\n $tag->save();\n\n return redirect()->back();\n }", "public function update(Request $request, Tag $tag)\n {\n $tag->description = $request->description;\n $tag->parent_id = $request->parent_id;\n\n $tag->save();\n return new TagResource($tag);\n }", "public function update(Request $request, TagBlog $tagBlog)\n {\n //\n }", "public function update(Request $request)\n {\n // validate the data\n $request->validate([\n \"name\" => \"required\",\n \"description\" => \"required\"\n ]);\n\n $singleTag = Tags::find($request->id);\n $tag = array(\n 'reseller_id' => '0',\n 'name' => $request->name?:$singleTag->name,\n 'description' => $request->description?:$singleTag->name,\n 'updated_by' => '0'\n );\n \n if ($singleTag->update($tag)) {\n return redirect('/tags');\n } else {\n return view('tags.404');\n }\n }", "public function update(Request $request, $id)\n {\n $vehicle = Vehicle::whereHas('tags', function ($query) use($id) {\n $query->where('id', $id);\n }); \n\n if ($vehicle->exists()) {\n return redirect()->route('tag.index')->withErrors('Vehicle tag is in use and can not be edited!');\n }\n\n $tag = Tag::find($id);\n $tag->name = $request->tag;\n $tag->save();\n\n return redirect()->route('tag.index')->with('message', 'Tag is updated!');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, ['tag' => 'required']);\n $tag = Tag::findOrFail($id);\n $tag->update($request->all());\n\n // $user->roles()->detach();\n // foreach ($request->roles as $role) {\n // $user->assignRole($role);\n // }\n\n return redirect('admin/tags')->with('flash_message', 'Tag updated!');\n }", "public function update(TagRequest $request, $id)\n {\n $tag = Tag::find($id);\n $tag->setTitle($request->get('title'));\n $tag->setAlias($request->get('alias'));\n try{\n $tag->save();\n } catch (\\Exception $e){\n session()->flash('error', __('system.errors_occurred'));\n }\n \n $task = $request->get('task');\n \n return task_route($task, 'admin.tags', __('system.tag_updated'), $tag->id);\n }", "public function update(Request $request, $id)\n {\n // retrieve the tag\n $tag = Tag::find($id);\n // validate new tag input\n $this->validate($request, ['name' => 'required | max:255']);\n $tag->name = $request->name;\n $tag->save();\n\n // set flash success message\n Session::flash('success', 'The new tag name was succesfully saved.');\n\n // redirect to index\n return redirect()->route('tags.index');\n }", "public function update(UpdateTagForm $request, $id)\n {\n if(!Auth::user()->can('edit-tag'))\n abort(403);\n $cateData = $request->except('create_at','update_at','delete_at');\n $this->tag->update($id,$cateData);\n\n return $this->noContent();\n }", "public function update(Request $request, $id)\n {\n //\n $tag = Tag::Find($request->input('id'));\n $tag->name = $request->input('name');\n $save = $tag->save();\n if($save){\n return redirect()->route('tags.index')->with('success','Tag is added successfully!!!');\n }\n return redirect()->route('tags.index')->with('errors','Tag didnt updated!!!');\n }", "public function update(Request $request, $id)\n {\n /**\n [2017-04-21 20:08:54] local.DEBUG: array (\n 'id' => 2,\n 'fid' => 0,\n 'name' => '技术',\n 'description' => 'technology',\n 'thumbnail' => 'http://ocehld7p7.bkt.clouddn.com/[email protected]?imageView2/0/w/350',\n 'created_at' => '2017-04-19 07:32:39',\n 'updated_at' => '2017-04-20 15:26:34',\n )\n )\n * )\n */\n $res = Tag::whereId($id)->first()->update($request['tag']);\n if ($res) {\n return $this->responseWithSuccessMsg();\n }\n\n return $this->responseWithErrorMsg();\n\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'Required|max:191'\n ]);\n\n $name = $request->input('name');\n\n $new_tag = \\App\\Tag::find($id);\n $new_tag->name = $name;\n $new_tag->user_id = Auth::user()->id;\n $new_tag->save();\n \n $request->session()->flash(\"success_msg\", \"Successful change a tag.\");\n return redirect(\"/home/tag\");\n }", "public function update(StoreTagRequest $request, $id)\n {\n if (!$tag = Tags::find($id)) {\n return $this->notFoundResponse();\n }\n\n $result = $this->service->update($tag, $request->validated());\n if($result){\n $data['success'] = $result;\n return $this->okResponse($data);\n }\n\n return $this->internalResponse();\n }", "public function update(UpdateBlogTagRequest $request, $id)\n {\n $tag = BlogTag::findOrFail($id);\n $inputs = $request->except('_token', '_method', 'blog_tag_id','seo_title', 'seo_description', 'seo_keyword', 'page_title');\n $inputs['slug'] = str_slug($request->slug);\n $tag->update($inputs);\n\n $tag->seo()->updateOrCreate(['seoable_id' => $tag ->id ?? 0],[\n 'seo_title' => $request->seo_title ?? '',\n 'seo_keyword' => $request->seo_keyword ?? '',\n 'seo_description' => $request->seo_description ?? '',\n 'page_title' => $request->page_title ?? '',\n ]);\n\n Helper::custom_session_flash(\"success\", \"update\");\n return redirect()->back();\n }", "public function edit(Tag $tag)\n {\n $this->vars['tag'] = $tag;\n $this->title = __('system.tag_edit');\n $this->template = 'admin.tag';\n \n return $this->renderOutput();\n }", "public function update(Request $request, $id)\n {\n $tag = Tag::find($id);\n\n $validator = Validator::make($request->all(), \n [\n \"name\" => ['required', 'string', 'max:255', Rule::unique('tags')->ignore($tag->id)], //exists = unique mais en ++ est ce que le nom envoyé dans la requête existe deja\n ], \n \n [\n \"name.required\" => \"le nom est obligatoire\",\n \"name.string\" => \"entrez une chaine de caractère valide\",\n \"name.max\" => \"entrez au max 255 caractères\",\n \"name.unique\" => \"ce tag existe déjà. Veuillez en choisir une autre\"\n \n ]);\n\n if ($validator->fails()) \n {\n return redirect()->back()->withErrors($validator)->withInput();\n }\n\n $tag->slug = null; //pour pouvoir mettre un nouveau slug lors de la modification\n\n $tag->update([\n \"name\"=> $request->name\n ]);\n return redirect()->route('admin.tags.index')->with([\n \"success\" => \"votre tag a été modifiée avec succès.\"\n ]);\n }", "public function update(User $user, TweetTag $tweetTag)\n {\n //\n }", "public function tagAction(string $tag) : object\n {\n $page = $this->di->get(\"page\");\n $tags = new Tags();\n $tags->setDb($this->di->get(\"dbqb\"));\n $questions_with_tag = $tags->findAllWhere(\"tag = ?\", $tag);\n $all_questions_with_tags = [];\n foreach ($questions_with_tag as $tag) {\n $questions = new Questions();\n $questions->setDb($this->di->get(\"dbqb\"));\n $all_tags_for_question = $questions->find(\"id\", $tag->tag_question_id);\n array_push($all_questions_with_tags, $all_tags_for_question);\n }\n\n $page->add(\"questions/tags\", [\n \"tags\" => $questions_with_tag,\n \"questions\" => $all_questions_with_tags,\n ]);\n\n return $page->render([\n \"title\" => \"Update an item\",\n ]);\n }", "public static function update_tag_image($tag_id, $image) {\n try {\n if ($tag_id > 0 && $image != '') {\n $db = ADODB::connect();\n $query = \"UPDATE tbl_tag_item SET image='\".ADODB::dbclean($image).\"' WHERE tag_id=$tag_id\";\n $rs = $db->Execute($query);\n }\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n }\n }", "public function updateTagEvento($idev, $idu,$passwordOwner,$tag){\r\n if($this->isOwnerOfEvent($idu, $passwordOwner, $idev)){\r\n $query = 'UPDATE '.$this->tables['eventoTable'] .\" SET tag='\".self::$conn->real_escape_string(mb_strtolower($tag, 'UTF-8')).\"'\".\r\n \" WHERE id ='$idev' AND creator='$idu'\";\r\n \r\n return self::$conn->query($query);\r\n }\r\n return false;\r\n }", "public function update(Request $request, $id)\n {\n $tag = Tag::findOrFail($id);\n $tag->name = $request->name;\n $tag->save();\n\n flash('Tag modificado sastifactoriamente')->info()->important();\n\n return redirect()->route('tags.index');\n }", "public function update(Request $request, $id)\n {\n try {\n $this->validate($request, [\n 'name'=>'required|max:20'\n ]);\n $tag = Tags::find($id);\n $tag->name = $request->input('name');\n $tag->save();\n\n\n return redirect()->back()->with('success','Tag Edited');\n }catch (Exception $e){\n return redirect()->back()->with('error', 'Duplicated Tag name');\n }\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required|max:255'\n ]);\n\n Tag::whereId($id)->update($request->except(['_token', '_method']));\n\n return redirect()->route('tag.index')\n ->with('success','Tag updated successfully');\n }", "public function update(Request $request, $id)\n {\n\n $tag = Tag::find($id);\n $tag->name = $request->name;\n $tag->slug = str_slug($request->name); \n $tag->save();\n return response()->json(['data'=>$tag],200);\n }", "public function actionEdit()\n\t{\n\t\t$input = $this->_input->filter(array(\n\t\t\t'tag_id' => XenForo_Input::UINT\n\t\t));\n\n\t\t$tag = $this->_getTagOrError($input['tag_id']);\n\n\t\treturn $this->_getTagAddEditResponse($tag);\n\t}", "public function updateTags($tagArray) {\n\t\t// include files\n\t\trequire_once(WCF_DIR.'lib/data/tag/TagEngine.class.php');\n\t\trequire_once(WBB_DIR.'lib/data/thread/TaggedThread.class.php');\n\t\t\n\t\t// save tags\n\t\t$tagged = new TaggedThread(null, array(\n\t\t\t'threadID' => $this->threadID,\n\t\t\t'taggable' => TagEngine::getInstance()->getTaggable('com.woltlab.wbb.thread')\n\t\t));\n\n\t\t// delete old tags\n\t\tTagEngine::getInstance()->deleteObjectTags($tagged, array($this->languageID));\n\t\t\n\t\t// save new tags\n\t\tif (count($tagArray) > 0) TagEngine::getInstance()->addTags($tagArray, $tagged, $this->languageID);\n\t}", "public static function update_tag($tag_id, $tag_name, $image, $default_topic_id, $topic_count) {\n try {\n if ($tag_id > 0) {\n $db = ADODB::connect();\n\t\t\t\tif ($image == '') {\n\t\t\t\t\t$image_query = \"NULL\";\n\t\t\t\t} else {\n\t\t\t\t\t$image_query = \"'\".ADODB::dbclean($image).\"'\";\n\t\t\t\t}\n\n //Clean Tag Name\n $tag_name = Tag::clean_tag($tag_name);\n\n //Check if group exists (when cant change grou name to existing users)\n $query = \"SELECT tag_id FROM tbl_tag_item WHERE tag='\".ADODB::dbclean($tag_name).\"' AND tag_id <> \".ADODB::dbclean($tag_id);\n $row = $db->GetRow($query);\n if (isset($row['tag_id'])) {\n //Error: Tried to update to a tag name that already exists\n return -1;\n }\n \n if (!$default_topic_id || $default_topic_id == 0) $default_topic_id = 'null';\n \n $query = \"\n UPDATE tbl_tag_item SET\n tag='\".ADODB::dbclean($tag_name).\"',\n image=$image_query,\n default_topic_id=\".ADODB::dbclean($default_topic_id);\n if ($topic_count) {\n $query .= \",topic_count=\".ADODB::dbclean($topic_count);\n }\n $query .= \" WHERE\n tag_id = $tag_id\n \";\n $rs = $db->Execute($query);\n return $tag_id;\n }\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n } \n }", "public function update(CreateTagRequest $request, $id)\n {\n $tag = Tag::find($id);\n $tag->title = request('title');\n $tag->slug = request('slug')?: request('title');\n $tag->publish = request('publish')?: false;\n $tag->update();\n\n return response()->json([\n 'tag' => $tag\n ]);\n }", "public function updateTags($tagArray) {\n\t\t// include files\n\t\trequire_once(WCF_DIR.'lib/data/tag/TagEngine.class.php');\n\t\trequire_once(WCF_DIR.'lib/data/linkList/link/TaggedLinkListLink.class.php');\n\t\t\n\t\t// save tags\n\t\t$tagged = new TaggedLinkListLink(null, array(\n\t\t\t'linkID' => $this->linkID,\n\t\t\t'taggable' => TagEngine::getInstance()->getTaggable('de.chrihis.wcf.linkList.link')\n\t\t));\n\n\t\t$languageID = 0;\n\t\tif (count(Language::getAvailableContentLanguages()) > 0) {\n\t\t\t$languageID = WCF::getLanguage()->getLanguageID();\n\t\t}\n\t\t\n\t\t// delete old tags\n\t\tTagEngine::getInstance()->deleteObjectTags($tagged, array($languageID));\n\t\t\n\t\t// save new tags\n\t\tif (count($tagArray) > 0) {\n\t\t\tTagEngine::getInstance()->addTags($tagArray, $tagged, $languageID);\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required|max:255'\n ]);\n \n $tag = Tag::findOrFail($id);\n $tag->name = $request->name;\n $tag->save();\n session()->flash('success_update_tag','Tag Name Updated Successfully :)');\n return redirect()->route('tags.show',$tag->id);\n }", "public function update(StoreTagRequest $request, $id)\n {\n $tag = $request->validated();\n $tagModel = resolve('App\\ViewModels\\TagViewModel');\n $tag = $tagModel->updateTag($id, $tag);\n return redirect()->route('tags.index');\n }", "public function update(Request $request, $id)\n {\n $tag = TagCatalog::find($id);\n $tag->fill($request->all());\n $tag->save();\n\n return redirect()\n ->back()\n ->with('message_success', 'Tag actualizado correctamente');\n }", "function setLabelTag($key, $tag, $value) \n {\n\n // if desired [KEY] exists then\n if ( array_key_exists($key, $this->labels) ) {\n\n // if desired [LANGUAGEID] exists \n if (array_key_exists($this->languageID, $this->labels[ $key ] ) ) {\n \n // update label\n $labelData = $this->labels[ $key ][ $this->languageID ];\n $this->labels[ $key ][ $this->languageID ] = str_replace($tag, $value, $labelData);\n \n } else {\n // else \n \n // update label in 1st avaialble language\n $labelData = current( $this->labels[ $key ] );\n $langID = key( $this->labels[$key] ); // Oh, Johnny, you forgot this line, 90 minutes of debugging == free lunch for me!\n/*echo 'Debugging Multilingual Manaer (line 396).<br><br>Case is key matches but requested language not available ... on a tag update<br><br>';\necho 'labelData = [';\nvar_export($labelData);\necho ']<br><br>';\necho 'this->labels[] = [';\nvar_export($this->labels[ $key ]);\necho ']<br><br>';\nexit;*/\n $this->labels[$key][$langID] = str_replace($tag, $value, $labelData);\n \n } // end if\n \n } \n\n }", "public function updateTag(Request $request, int $id)\n {\n $this->repository->updateTag($id, $request->all());\n return response()->json(['message' => 'update tag successfully'], 200);\n }", "public function updateTag($id)\n {\n $this->di->common->verifyAdmin();\n $tag = $this->di->tag->getById($id);\n if (!$tag) {\n $this->di->common->redirectError('admin/tag', \"Kunde inte hitta taggen med ID $id.\");\n }\n \n if ($this->di->request->getMethod() == 'POST') {\n $form = new Form('tag-form', Models\\Tag::class);\n if ($this->di->tag->updateFromForm($form, $tag)) {\n $this->di->common->redirectMessage('admin/tag', 'Taggen <strong>' . htmlspecialchars($form->getModel()->name) . '</strong> har uppdaterats.');\n }\n } else {\n $form = new Form('tag-form', $tag);\n }\n \n return $this->di->common->renderMain('tag/edit', [\n 'tag' => $form->getModel(),\n 'update' => true,\n 'form' => $form\n ], 'Redigera tagg');\n }", "public function update(Request $request, $id)\n {\n //\n $campos = [\n 'tags' => 'required|string|max:200',\n ];\n\n $mensaje = [\n 'required' => 'El :attribute es requerido ',\n ];\n\n $this->validate($request, $campos, $mensaje);\n\n //Exclusion de token \n $datoTag = request()->except(['_token', '_method']);\n\n Tags::where('id', '=', $id)->update($datoTag);\n\n\n $tags = Tags::findOrFail($id);\n // return view('categoria.edit', compact('categoria'));\n return redirect('tags')->with('mensaje', 'La seccion se edito con éxito');\n }", "public function addTag($id, $tag)\n {\n $this->db->update(array('id'=>$id), array('$addToSet'=>array('tags'=>$tag)));\n }", "public function tagUpdate($id, CatRequest $request) {\n\n $cat = Category::find($id);\n $cat->name = $request->input('name');\n $slug = $request->input('slug');\n $cat->slug = ($slug == '') ? toSlug($request->input('name')) : $slug;\n $cat->type = 'tag';\n $cat->order = $request->input('order');\n\n if ($cat->update()) {\n return redirect()->route('admin.tag')->with('Mess', 'Cập nhật thành công');\n } else {\n return redirect()->back()->withInput()->with('errorMess', 'Có lỗi xảy ra, vui lòng thử lại sau');\n }\n }", "public function tagged( $tag );", "public function update(Request $request, $id)\n {\n $tags = $this->tagsRepository->find($id);\n if (!$tags) {\n return redirect('/admin/tags/')->with('status', config('langEN.find_err'));\n }\n Validation::validationTags($request);\n $param = $request->all();\n $update = $this->tagsRepository->update($param, $id);\n if (!$update) {\n return redirect('/admin/tags/' . $tags->id . '/edit')->with('status', config('langEN.update.failed'));\n }\n\n return redirect('/admin/tags/')->with('status', config('langEN.update.success'));\n }", "public function update(StoreUpdateTagRequest $request, $id)\n {\n $tag = $this->tagRepository->update($request->all(), $id);\n\n return $this->successCreated($tag);\n }", "public function update(Request $request, Tag $tag, Thread $thread)\n {\n if ($request->hasFile('thumbnail')) {\n\n $thumbnail = $request->file('thumbnail');\n \n $filename = time() . '.' . $thumbnail->getClientOriginalExtension();\n $location = public_path('/thumbnails/' . $filename);\n \n Image::make($thumbnail)->save($location);\n }\n\n $thread->update([\n \"user_id\" => auth()->id(),\n \"tag_id\" => $request->input('tag_id'),\n \"title\" => $request->input('title'),\n \"description\" => $request->input('description'),\n \"thumbnail\" => $thread->thumbnail = $filename,\n \"body\" => $request->input('body')\n ]);\n\n $thread->save();\n\n flash(e('You have successfully updated ' . $thread->title . '!'), 'info');\n\n return redirect($thread->path()); \n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required', \n ], [\n 'name.required' => 'name is required | min:3 character', \n ]);\n\n $this->validate($request, [\n 'name' => 'required'\n ]);\n\n $tag_data = [\n 'name' => $request->name,\n 'slug' => Str::slug($request->name)\n ];\n \n Tags::whereId($id)->update($tag_data); \n\n return redirect()->route('tag.index')->with('success', 'Data Berhasil DI Ubah');\n }", "public function setTag($value)\n {\n if ($value !== null) {\n $this->_params['tag'] = $value;\n } else {\n unset($this->_params['tag']);\n }\n }", "public function setTag($tag) {\n\t\t$this->mail['Tag'] = $tag;\n\t}", "public function update(Request $request, $id)\n {\n $tags = explode(',', $request->tags);\n \n $request->validate([\n 'name' => 'required',\n 'email' => 'required',\n 'password' => 'required',\n ]);\n\n $user = User::find($id);\n $user->name = $request->name;\n $user->email = $request->email;\n $user->password = $request->password;\n //$user->tag(['php', 'laravel']);\n $user->save();\n\n $user->tag($tags);\n\n return redirect()->route('users.index')\n ->with('success','The user has been successfully updated');\n }", "public function update(Request $request, SeoMetaTag $seoMetaTag)\n {\n //\n $request->validate([\n 'name' => ['required'],\n 'template' => ['required'],\n 'sort' => ['required', 'numeric'],\n 'editable' => ['boolean'],\n 'group_id' => ['required', 'exists:seo_tag_groups,id'],\n ]);\n\n return response()->json($seoMetaTag->update($request->except(['_token', 'id', 'group_name', 'group'])));\n }", "public function update(Request $request, $id)\n {\n //创建模型\n $tag = Tag::findOrFail($id);\n //修改对象的属性\n $tag->name = $request->input('name');\n //插入\n if($tag->save()) {\n return redirect('/tag') -> with('info','更新成功');\n }else{\n return back()->with('info','更新失败');\n }\n }", "public function updateBookTag()\n {\n\t\tif (intval($this->type_flag) === ENTRY_TYPE_BOOK)\n\t\t{\n\t\t\t// non-book may have been changed to book\n\t\t\t$this->addBookTag();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// in case book was changed to non-book\n\t\t\t$this->removeBookTag();\n\t\t}\n\t}", "public function update(PostRequest $request, Post $post, TagRequest $tagRequest)\n {\n $post->title = $request->title;\n $post->post = $request->post;\n $post->update();\n //On ajoute les tags Tags\n $post->tagsAttach($tagRequest);\n //On efface les relations tags à supprimer\n $post->tagsDetach($tagRequest);\n return redirect()->route('posts.index')->with('info', 'Le post a bien été modifié dans la base de données');\n }", "public function updateTags()\n {\n\n $this->syncTags();\n $ticker = $this->request->ticker;\n\n return redirect('/data/' . $ticker);\n\n }", "public function updateTags($tags)\n {\n $tagtypes = ['disciplines' => 1, 'applications' => 2,\n 'techniques' => 3, 'facilities' => 4];\n\n $currentTags = $this->getTagIds();\n if (!empty($currentTags)) {\n // merge all input tags for comparison\n $inputTags = [];\n foreach ($tagtypes as $type) {\n if (!empty($tags[$type]) && is_array($tags[$type])) {\n array_merge($inputTags, $tags[$type]);\n }\n }\n // detach all tags that were not input\n foreach ($currentTags as $curTag) {\n if (!in_array($curTag, $inputTags)) {\n $this->tags()->detach($curTag);\n }\n }\n }\n\n foreach ($tagtypes as $type => $key) {\n if (!empty($tags[$type])) {\n foreach ($tags[$type] as $element) {\n $id = is_numeric($element)\n ? $element\n : Tag::create(['name' => $element,\n 'category' => 'Other', 'tagtype_id' => $key]);\n $this->tags()->attach($id);\n }\n }\n }\n }" ]
[ "0.77511305", "0.7620855", "0.75723565", "0.75723565", "0.72530544", "0.7237114", "0.72336084", "0.7178492", "0.710663", "0.704974", "0.7008873", "0.69974655", "0.6940263", "0.6893135", "0.6880666", "0.6879727", "0.68344206", "0.6831263", "0.68119735", "0.6795744", "0.6790051", "0.6779282", "0.67751336", "0.6736439", "0.67265546", "0.66693634", "0.6620798", "0.6620166", "0.6561388", "0.6527454", "0.6487674", "0.64355904", "0.64329964", "0.64180183", "0.6407097", "0.63908017", "0.63804656", "0.63545215", "0.63490516", "0.63411915", "0.63411915", "0.6339347", "0.6339133", "0.63246703", "0.6309756", "0.63047475", "0.6281352", "0.6279459", "0.6277709", "0.6276887", "0.62536", "0.620215", "0.62009346", "0.61939543", "0.6181766", "0.61657506", "0.6160698", "0.61508346", "0.61413145", "0.6123605", "0.61212516", "0.609339", "0.60827965", "0.6024514", "0.60194063", "0.59993744", "0.59829015", "0.59809107", "0.59765005", "0.596227", "0.59501445", "0.59411204", "0.5939554", "0.5938109", "0.5912885", "0.58992296", "0.58969945", "0.5860059", "0.58576024", "0.5855978", "0.5828465", "0.58078325", "0.5801631", "0.579814", "0.5795454", "0.57899916", "0.5778492", "0.57605803", "0.57521033", "0.5736136", "0.57162863", "0.5707159", "0.5705266", "0.57003534", "0.5683765", "0.5665373", "0.56509215", "0.56485957", "0.5647703", "0.56332" ]
0.6791428
20
Destroy the specified Tag
public function destroy(Tag $tag) { $tag->delete(); return response([], 202); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Tag $tag)\n {\n //\n }", "public function destroy(Tag $tag)\n {\n //\n }", "public function destroy(\\App\\Models\\Tag $tag)\n {\n $tag->delete();\n }", "public function destroy(Tag $tag)\n {\n $tag->delete();\n return 'deleted';\n }", "public function delete_tag($tag);", "public function destroy(Tag $tag)\n {\n \t$tag->delete();\n return AjaxResponse::success($tag);\n }", "public function destroy(Tag $tag)\n {\n //\n\n $tag->Delete();\n return redirect()->route('tags.index')->with('success','Tag is removed successfully!!!');\n }", "public function destroy(Tag $tag)\n {\n $tag->posts()->detach();\n $tag->delete();\n }", "public function destroy(Tag $tag)\n {\n $tag->delete();\n return response()->json(['messages' => 'data Successfully Deleted'], 200);\n }", "public function destroy(Tag $tag)\n {\n return DB::transaction(function() use ($tag){\n $tag->delete();\n\n return response()->json([\n 'validate' => true\n ]);\n });\n }", "public function destroy($tag)\n {\n return redirect()->route('tags.tags')->with('message', $this->masterController->destroy($tag));\n }", "public function destroy(Tag $tag)\n {\n try{\n $tag->delete();\n } catch (\\Exception $e){\n \\Session::flash('error', $e->getMessage());\n }\n \n return redirect()->back()->with(['success' => __('system.tag_deleted')]);\n }", "public function destroy(Tag $tag)\n {\n $tag->delete();\n\n flash('Borrada la tag')->error()->important();\n\n return redirect()->route('tags.index');\n }", "public function destroy(SeoMetaTag $seoMetaTag)\n {\n //\n }", "public function destroy(Tag $tag)\n {\n if($tag->posts->count() > 0) {\n alert()->error('Tag não pode ser apagada porque ela tem posts!', 'Não, não ...');\n return redirect()->back();\n }\n $tag->delete();\n alert()->success('Tag deletada!', 'Deletado');\n return redirect(route('tag.index'));\n }", "public function destroy(Tag $tag)\n {\n $tag->delete();\n\n return redirect()->route('tags.index')->with('delete-message', 'ลบ Tag เสร็จสมบูรณ์');\n }", "public function destroy(Tag $tag)\n {\n $this->authorize('forceDelete', $tag);\n\n try {\n $tag->delete();\n\n return response()->json(['Resource deleted']);\n } catch (Exception $exception) {\n return ExceptionHelper::handleError($exception, $request);\n }\n }", "public function destroy(Tag $tag)\n {\n Tag::destroy($tag->id);\n return redirect()->route('admin.post.tag.index')\n ->with(['status' => 'Tag Artikel ' . $tag->name . ' telah Dihapus']);\n }", "public function destroy(Tag $tag)\n {\n $tag->delete();\n\n return back()->with('toast_success', 'Tag has been deleted!');\n }", "public function destroy(Tag $tag)\n {\n if (!auth()->user()->ability('admin', 'delete_tags')) {\n return redirect('admin/index');\n }\n $tag->delete();\n return redirect()->route('admin.tags.index')->with([\n 'message' => 'Deleted successfully',\n 'alert-type' => 'success'\n ]);\n }", "public function destroy(TagBlog $tagBlog)\n {\n //\n }", "public function destroy(Tag $tag)\n {\n return response()->json([\n 'status' => $tag->delete()\n ]);\n }", "public function forget($tag)\n {\n $this->connection()->del($tag);\n }", "function deleteTag( $iTag ){\n $oSql = Sql::getInstance( );\n clearCache( 'tags' );\n $oSql->query( 'DELETE FROM tags WHERE iTag = \"'.$iTag.'\" ' );\n $oSql->query( 'DELETE FROM pages_tags WHERE iTag = \"'.$iTag.'\" ' );\n\n generateTagsLinks( );\n}", "public function destroy(Request $request, $tag)\n {\n $tag = Tag::findOrFail($tag);\n $tag->delete();\n\n $request->session()->flash('success', 'Тег удалён');\n\n return redirect()->route('admin.tags.index');\n }", "public function delete($tag)\n {\n getAuthentication()->requireAuthentication();\n $res = $this->tag->delete($tag);\n if($res)\n return $this->noContent('Tag deleted successfully', true);\n else\n return $this->error('Tag could not be deleted', false);\n }", "public function destroy(Request $request)\n {\n $id = $request->id;\n $id = Tag::findOrFail($id);\n $id->delete();\n }", "public function destroy(Tag $tag)\n {\n $tag->delete();\n return new TagResource($tag);\n }", "public function destroy(Request $request)\n {\n \n if( is_null($request->input('tag_id')) || empty($request->input('tag_id')) ){\n Session::flash('message','tag ID is required');\n return redirect()->back(); \n }\n \n $id=$request->input('tag_id');\n tag::destroy($id);\n Session::flash('message', 'the tag has been deleted');\n return redirect()->back();\n }", "public function destroy($id)\n {\n $tag = Tag::findOrFail($id);\n //delete post_id related to this tag from the pivot table\n //u can delete using migrations (cascade)\n $tag->posts()->detach();\n $tag->delete();\n session()->flash('success_delete_tag','Tag Deleted Successfully :)');\n return redirect()->route('tags.index');\n }", "public function destroyTag(Request $request)\n {\n $this->repository->deleteTag($request->id);\n return response()->json(['message' => 'delete tag successfully'], 200);\n }", "public function destroy($id)\n {\n // find the tag and add to a variable\n $tag = Tag::find($id);\n // delete any reference\n $tag->projects()->detach();\n // delete tag\n $tag->delete();\n\n // set flash data with success message\n Session::flash('success', 'The tag was deleted.');\n\n // redirect with flash data to posts.show\n return redirect()->route('tags.index');\n }", "public function destroy(PostTag $postTag)\n {\n if($postTag->delete()) {\n request()->session()->flash('success', 'Tag has been deleted successfully...\n ...');\n }\n else {\n request()->session()->flash('error', 'Error! Please try again......');\n }\n return redirect()->route('admin.post-tags.index');\n }", "public function destroyTag(Request $request, $id) {\n $videotag = VideoTag::findOrFail($id);\n $user_id = $videotag->user_id;\n $this->authorize('delete', $videotag, $request->user());\n\n VideoTag::destroy($videotag->id);\n\n // remove badges\n if ($request->user_id) {\n App('App\\Http\\Controllers\\BadgeController')->addSensieActor($user_id);\n }\n\n // redirecting to tournament\n return redirect()->back()->with('message', 'Video tag deleted.');\n }", "public function cleanupTagsCommand() {\n\t\t/** @var Tag $tag */\n\t\tforeach ($this->tagRepository->findAll() as $tag) {\n\t\t\tif ($this->assetRepository->countByTag($tag) == 0) {\n\t\t\t\t$this->outputLine('Tag \"%s\" deleted.', [$tag->getLabel()]);\n\t\t\t\t$this->tagRepository->remove($tag);\n\t\t\t}\n\t\t}\n\t}", "public function destroy($id)\n { \n $tag = tags::where('id', $id)->first();\n\n $tag->delete();\n return parent::response(\"Tag deleted\", 200);\n }", "public function destroy($id)\n {\n $tag = $this->tag->findOrFail($id); \n $tag->registro()->detach(); \n $tag->delete($id); \n\n return response()->json([\n 'message'=> 'Tag deletada com sucesso!'\n ], Response::HTTP_OK);\n\n }", "public function delete($tag)\n {\n $builder = $this->git->getProcessBuilder()\n ->add('tag')\n ->add('-d');\n\n if (!is_array($tag) && !($tag instanceof \\Traversable)) {\n $tag = [$tag];\n }\n\n foreach ($tag as $value) {\n $builder->add($value);\n }\n\n $this->git->run($builder->getProcess());\n }", "public function destroy(Tag $tag, Thread $thread)\n {\n $this->authorize('delete', $thread);\n\n $thread->delete();\n\n flash(e('You have successfully deleted ' . $thread->title . '!'), 'danger');\n\n return redirect('/threads');\n }", "public function removeByTag($tag, $force = false);", "public function destroy($id)\n {\n Tag::destroy($id);\n\n return redirect('admin/tags')->with('flash_message', 'Tag deleted!');\n }", "public function destroy($id)\n {\n $tag = Tag::findOrFail($id);\n if($tag) {\n $destroy = Tag::destroy($id);\n if($destroy) {\n return json_encode('Tag has been deleted');\n }\n else {\n return json_encode('Something went wrong');\n }\n }\n }", "public function destroy($id)\n { \n\n $del = Tag::find($id);\n $delpt = Post_Tag::where('tag_id','=',$del->id)->get()->each;\n $delpt->delete();\n $del->delete();\n return response()->json(['data'=>'removed'],200);\n }", "public function destroy($id)\n {\n ProductTag::destroy($id);\n }", "public function destroy($id)\n {\n // retrieve the tag from the DB\n $tag = Tag::find($id);\n \n // remove relationships from the post_tag table\n $tag->posts()->sync([]);\n \n // delete the tag\n $tag->delete();\n \n // redirect with flash data to tags.index\n Session::flash('success', 'The tag was removed successfully!');\n \n $tags = Tag::orderBy('id')->get();\n return redirect()->route('tags.index')->withTags($tags);\n }", "public function destroy($id)\n {\n if ($id == 1){\n Toastr::error('This tag will not be deleted', 'Sorry');\n return back();\n }\n\n // detach all product\n\n Tag::find($id)->delete();\n\n Toastr::success('Tag Deleted', 'Success');\n return back();\n }", "public function destroy(Tagok $tagok)\n {\n $tagok->delete();\n return redirect()->route('tagok.index')->with('message', 'Sikeres törlés!');\n }", "public function destroy($id)\n {\n $tag = BlogTag::findOrFail($id);\n $tag->delete();\n Helper::custom_session_flash(\"success\", \"destroy\");\n return redirect()->back();\n }", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy() {}", "public function destroy($id)\n {\n $tag = Tag::findOrFail($id);\n $tag->delete();\n\n return redirect()->route('tag.index')\n ->with('success','Tag deleted successfully');\n }", "public function deleteTag($tag){\n\t\tif(is_array($tag)){\n\t\t\t$success = true;\n\t\t\tforeach($tag as $t){\n\t\t\t\tif(!$this->deleteTag($t)){\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $success;\n\t\t}else{\n\t\t\t$user = $this->getUser();\n\t\t\t$singletag = $this->getTag($tag);\n\t\t\tif(!isset($user[\"id\"])||!isset($singletag[\"tagid\"])){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif($user[\"status\"] == DBConfig::$userStatus[\"admin\"]){\n\t\t\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes tag '\".$tag.\"'\");\n\t\t\t\t$query = Queries::deletetag($singletag[\"tagid\"]);\n\t\t\t\tif(!$this->query($query))return false;\n\t\t\t\t$query = Queries::removetag($singletag[\"tagid\"]);\n\t\t\t\treturn $this->query($query);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function destroy($id)\n {\n $tag = \\App\\Tag::find($id);\n $tag->delete();\n\n $postdetails = \\App\\PostDetail::where('user_id','=',Auth::user()->id)->where('tag_id', '=', $id)->get();\n\n foreach ($postdetails as $postdetail) {\n $postdetail->delete();\n }\n\n Session::flash(\"success_msg\", \"Successful delete a tag\");\n\n return back();\n }", "public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}", "public function destroy($id)\n {\n //\n\t\t$tag = Tag::findOrFail($id);\n\t\tforeach ($tag->posts as $eachPost) {\n\t\t\t$eachPost->delete();\n\t\t}\n\t\t$tag->delete();\n\t\treturn response(\"ok\", 200);\n }", "public function destroy(Normativa $normativa)\n {\n //\n }", "public function destroy($id)\n {\n\n $tag = tag::find($id);\n $title=$tag->title;\n $tag->delete();\n $_SESSION['message'] = [\n 'status' => 'success',\n 'message' => \"tag \\\"{$title}\\\" successfully deleted\",\n\n ];\n\n return new RedirectResponse('/tag');\n }", "public function destroy($id)\n {\n $tag = Tag::find($id);\n if (count($tag->products) > 0) {\n\n } else {\n if ($tag) {\n $tagables = Taggable::where('tag_id', $id)->get();\n if (count($tagables) > 0) {\n foreach ($tagables as $tagable) {\n $tagable->delete();\n }\n }\n $this->removeThisCache($tag->slug);\n if ($tag->delete() > 0) {\n return response(1);\n }\n }\n return response(0);\n }\n\n }", "public function destroy() {\n }", "public function destroy()\n {\n }", "function CloseTag($tag) {\n\t\t\t$removedStyle = array_pop($this->styleStack);\n\t\t\t$this->applyStyle();\n\t\t}", "public function destroy(Tarjeta $tarjetum)\n {\n //\n }", "public function removeTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_tag]);\n\t\t}\n\t}", "private static function DeleteTag($tag)\n {\n global $SESSDB;\n \n // First delete entries in sdat\n $q = $SESSDB->prepare(\"DELETE FROM `sdat` WHERE sdat.id IN(SELECT smap.id FROM `smap` WHERE tag=:tag)\");\n $q->bindParam(':tag', $tag);\n $q->execute();\n\n // Now smap...\n $q = $SESSDB->prepare(\"DELETE FROM `smap` WHERE tag=:tag\");\n $q->bindParam(':tag', $tag);\n $q->execute();\n }", "public function destroyTags($id)\n {\n //\n $portfolio = Portfolio::findOrFail($id);\n $portfolio->untag(); // remove all tags\n }", "public function destroy($id)\n {\n // Find is only possible with primary key\n $tag = Tags::destroy($id);\n\n return redirect()->back()->with('success','Tag Deleted');\n }", "public function destroy($id)\n {\n //Je fais d'abord la requete pour récupérer la catégorie à supprimer\n $tag = Tag::find($id);\n\n //ensuite je fais la requete qui permet de supprimer la catégorie\n $tag->delete();\n \n //puis pour ne pas laisser l'administrateur sur une page blanche on fait la redirection\n //vers la page index des catégories de l'espace admin\n return redirect()->back()->with([\n \"success\" => \"votre tag a été supprimée avec succès.\"\n ]);\n }", "public static function delete(){\n\t\tglobal $current_user;\n\t\tinsert('DELETE FROM tag WHERE id=' . $_POST['id'] .\n\t\t\t\t'AND user_id=' . $current_user['id']);\n\t}", "public function unTag($objid, $tag);", "public function destroy()\n {\n \n }", "public function destroy($id)\n {\n $tag_data = Tags::findOrFail($id);\n\n $tag_data->delete();\n\n return redirect()->route('tag.index');\n\n }", "public function destroy()\r\n {\r\n }", "public function destroy()\r\n {\r\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }", "public function destroy()\n {\n }" ]
[ "0.8887295", "0.8887295", "0.8239383", "0.8110931", "0.80266446", "0.78624487", "0.76597756", "0.7598332", "0.7454579", "0.7441756", "0.7423579", "0.7414295", "0.7380227", "0.7353909", "0.73307544", "0.728734", "0.72639877", "0.72223806", "0.7213452", "0.7164124", "0.71296465", "0.70990264", "0.7084076", "0.70311254", "0.7001596", "0.69906527", "0.6981453", "0.69046164", "0.69045806", "0.6842023", "0.67609555", "0.6732316", "0.66662496", "0.66265213", "0.6625143", "0.6563398", "0.6522328", "0.6508778", "0.64885724", "0.64829326", "0.64522684", "0.64498323", "0.64482945", "0.64311236", "0.6422032", "0.6416994", "0.6356364", "0.63172215", "0.6312774", "0.6312774", "0.6312774", "0.6312774", "0.6312774", "0.6312592", "0.6307055", "0.63024783", "0.6291375", "0.6280099", "0.6280061", "0.626816", "0.6260605", "0.62600803", "0.62400347", "0.6237075", "0.6217464", "0.6215815", "0.62144357", "0.62043464", "0.62026405", "0.6190864", "0.6183939", "0.6182489", "0.61758137", "0.61690384", "0.6163588", "0.6162765", "0.6162765", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855", "0.61479855" ]
0.747332
8
Returns the identifying property for Object
public abstract function getIdentity();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function propertyIdent()\n {\n return $this->propertyIdent;\n }", "public function propertyObject($propertyIdent);", "public function getObjectIdent();", "public function property($propertyIdent);", "public function getObjectIdent() {}", "public function getObjectIdent() {}", "public function getIdFromProperty($_property);", "public function getObjectIdentifier($object);", "public function getIdProperty();", "function getProperty($object, $name) {\r\n\r\n\t\t#return (getNestedProperty(bean, name));\r\n\r\n\t}", "public function getObjectIdentifier();", "abstract public function property($propertyIdent);", "public function getIdentifier($obj)\n {\n return $obj->id;\n }", "public function getProperty();", "function propertyName( $id );", "function spl_object_id(object $object): int {}", "public function objId()\n {\n return $this->objId;\n }", "public function getObjectIdentifier($object, $property_name = null)\n\t{\n\t\treturn (is_object($object) && isset($property_name))\n\t\t\t? parent::getObjectIdentifier($object, $property_name)\n\t\t\t: ($this->getLinkObjectIdentifier($object) ?: parent::getObjectIdentifier($object));\n\t}", "protected static function getIdProperty(): ?string\n {\n return property_exists(get_called_class(), 'id') ? 'id' : null;\n }", "function spl_object_id($obj) : int {\n}", "function getIdentifierValues($object);", "public function textPropertyIdent()\n {\n return $this->textProperty()->ident();\n }", "abstract public function getObjectDefinitionProperty();", "function getId( $Object );", "function getSimpleProperty($object, $name) {\r\n\t\t#Object value = PropertyUtils.getSimpleProperty(bean, name);\r\n\t\t#return (ConvertUtils.convert(value));\r\n\t}", "public function getProperty($propertyName);", "function findProperty($id);", "public function getProperty() {\n return $this->property;\n }", "public function getReferencedProperty(): string;", "public function getObjectIdentifier()\n {\n return $this->type;\n }", "public function get_object_number()\n {\n return $this->get_default_property(self::PROPERTY_OBJECT_NUMBER);\n }", "public function getProperty(): string;", "public function getPathProperty($object);", "function getArrayProperty($object, $name) {\r\n\r\n\r\n\t}", "public function getIdentityValue($object)\n {\n $field = $this->getIdentityField();\n return $object->$field;\n }", "abstract public function getIdentifierValues($object);", "function getProtectedValue($obj, $name = \"_properties\"){\n $array = (array)$obj;\n $prefix = chr(0) . '*' . chr(0);\n if (isset($array[$prefix . $name])) {\n return $array[$prefix . $name];\n }\n}", "public function getKey()\n {\n return $this->getProperty()->getKey();\n }", "public function property($key) { }", "public function getProperty()\n\t{\n\t\treturn empty($this->property) ? strtolower($this->getName()) : $this->property;\n\t}", "public function getObjectUid()\n {\n return $this->objectUid;\n }", "public function getProperty($key);", "public function getProperty()\n {\n if (!$this->property) {\n $this->property = Inflector::underscore($this->alias);\n }\n\n return $this->property;\n }", "public function getChildsProperty($object);", "function prop($prop)\n {\n \treturn $this->get_property($prop);\n }", "public function getParentProperty($object);", "abstract public function objId();", "protected function getIdField()\n {\n return self::OBJ_NAME;\n }", "protected function getIdField()\n {\n return self::OBJ_NAME;\n }", "function getNestedProperty($object, $name) {\r\n\r\n\r\n\t}", "function get_object_id(object $object, bool $with_name = true): string\n{\n return Objects::getId($object, $with_name);\n}", "protected function getObjectValue(IdentifiableInterface $object, $property)\n {\n $getterMethod = 'get'.ucfirst($property);\n Assert::isTrue(method_exists($object, $getterMethod), ['message' => 'The Object' . get_class($object) . ' has no getter method \"' . $getterMethod . '\" ! 1280929630']);\n \n return $object->$getterMethod();\n }", "public function getObjectID();", "function __get($property)\n {\n if($property == \"id\")\n {\n return $this->id;\n }\n else\n {\n return call_user_func_array(array($this, \"getAttribute\"), array($property));\n }\n }", "function getPropertyName() ;", "public function getProperty($property = null);", "public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }", "public function getIdentifyingAttribute();", "function get_id() {\n return $this->get_mapped_property('id');\n }", "public function propertyInfo() {\n return entity_get_property_info($this->entityType);\n }", "public function getProperty($field);", "public function get($property);", "public function getProperty($id)\n {\n $id = strtoupper($id);\n\n if (!isset($this->properties[$id])) {\n return;\n }\n\n return $this->properties[$id];\n }", "public function __get($property)\n {\n switch ($property) {\n case 'name':\n return $this->name;\n break;\n \n case 'status':\n return $this->status;\n break;\n case 'id':\n return $this->id;\n break;\n }\n }", "public function property($name) {\n return $this->properties[$name];\n }", "function getPropName() {\n return $this->propName;\n }", "public abstract function getObjectMemberName(object $oRow):string;", "public function key()\n {\n return key($this->_object);\n }", "public function getIdentifier()\n {\n return $this->getAttribute($this->identifier);\n }", "function get_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_ID);\r\n }", "public function getIdentifierByObject($object) {\n\t\treturn $this->persistenceSession->getIdentifierByObject($object);\n\t}", "public function __get($prop)\r\n {\r\n return $this->wrappedObj->$prop;\r\n }", "public function getKey()\n {\n return $this->object->getKey();\n }", "public function getKey()\n {\n return $this->object->getKey();\n }", "function getProperty($what)\n {\n $that = null;\n if (isset($this->$what)) {\n $that = $this->$what;\n }\n return $that;\n }", "abstract protected function propertyGet($name);", "public function getField()\n {\n return $this->reflectionProperty;\n }", "public function key()\n {\n $map = $this->__getSerialisablePropertyMap();\n $mapKeys = array_keys($map);\n return $mapKeys[$this->iteratorPosition];\n }", "public function getIdentifier($om, $object, $single = true);", "public function getp($property){\n if(property_exists($this, $property)){\n return $this->$property;\n }\n }", "function get_object_name()\n {\n return $this->_object_name;\n }", "public function __get($property) {}", "protected function getPropertyValue() {}", "public static function property($obj, $property)\n {\n $result = NULL;\n if (is_object($obj))\n $result = Object::property($obj, $property);\n else if (is_array($obj))\n $result = Arr::get($obj, $property);\n return $result;\n }", "public function key()\n {\n return key($this->properties);\n }", "public function getObjectTypeName() \n\t{\n\t\treturn self::$object_type[$this->object_type];\n\t}", "public function getPrimaryKeyField($object)\n {\n try\n {\n foreach ($this->getMetadata($object)->fieldMappings as $key => $data)\n {\n if (isset($data['id']) && $data['id'])\n {\n return $key;\n }\n }\n }\n catch (\\Exception $e)\n {\n // Not a doctrine object\n }\n\n return false;\n }", "function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }", "abstract public function getResultObjectProperty();", "public function get_object_name() : string ;", "public abstract function getObjectMemberId(object $oRow):string;", "public function __get($prop) {}", "function getProperty( $object, $propertyName, $default = null ) {\n\tif ( isset($object->$propertyName) ) {\n\t\treturn $object->$propertyName;\n\t} else {\n\t return $default;\n\t}\n}", "function runkit_object_id($obj) : int {\n}", "public function getPropertyName() {}", "public function getPropertyName() {}", "public function getPropertyName() {}", "function object_id($thing) {\n if ($thing === null) {\n return null;\n } elseif (is_object($thing)) {\n if (method_exists($thing, 'get_id')) {\n return $thing->get_id();\n } else {\n return $thing->id;\n }\n } else {\n return (int) $thing;\n }\n}", "public function getPropertyValue()\n\t{\n\t\t$property = $this->property;\n\t\treturn (isset($this->object) && ($property instanceof Reflection\\Reflection_Property))\n\t\t\t? $property->getValue($this->object)\n\t\t\t: null;\n\t}", "public function __get($propertyName){\n\t\tif(array_key_exists($propertyName,$properties)){\n\t\t\treturn $this->properties[$propertyName];\n\t\t}\n\t}", "public function __get($property) {\r\n $param = '_' . $property;\r\n return $this->$param;\r\n }" ]
[ "0.7466179", "0.723767", "0.6974977", "0.68926895", "0.68443424", "0.68443424", "0.6741142", "0.6723045", "0.6665752", "0.6637079", "0.6585086", "0.65558064", "0.64900017", "0.64492005", "0.64208126", "0.64095545", "0.63910663", "0.6362514", "0.6350998", "0.6293061", "0.6257542", "0.62456524", "0.6243851", "0.62283695", "0.62166256", "0.6180887", "0.6175749", "0.6168621", "0.61551875", "0.6153846", "0.6147811", "0.6124571", "0.61079717", "0.6080674", "0.6069352", "0.6068095", "0.60652", "0.6064257", "0.6047525", "0.6036038", "0.60358465", "0.60336107", "0.603087", "0.60240346", "0.59753394", "0.59686446", "0.5968277", "0.5966372", "0.5966372", "0.5939716", "0.5918723", "0.5916716", "0.59103507", "0.5910076", "0.590556", "0.5855727", "0.5804818", "0.580459", "0.58005893", "0.57939565", "0.5793163", "0.57851255", "0.57843614", "0.57793933", "0.57651716", "0.57634753", "0.5759001", "0.57583374", "0.5752593", "0.57371724", "0.5729679", "0.5727203", "0.5709194", "0.5709194", "0.57060826", "0.570498", "0.5703817", "0.5691579", "0.56897366", "0.5686103", "0.5684817", "0.5672597", "0.56705976", "0.5665679", "0.5665197", "0.56600314", "0.5659899", "0.5659891", "0.56518584", "0.5651319", "0.56323886", "0.56273425", "0.5626008", "0.5625779", "0.56245476", "0.56245476", "0.56245476", "0.56201553", "0.5617981", "0.5607969", "0.56052864" ]
0.0
-1
If the item is similar returns true. else returns false.
public function isEqual(Comparable $item) { return ($this->getIdentity() === $item->getIdentity()) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function containsPure($item)\n {\n foreach ($this as $storedItem) {\n if ($storedItem === $item) {\n return true;\n }\n }\n\n return false;\n }", "function contains($item) {\n\t\t\t\n\t\t\tforeach($this->items as $_item) {\n\n\t\t\t\tif($_item->equals($item)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function containsItem($item): bool;", "public function isCorrect()\n\t{\n\t\treturn ($this->m_items) || ($this->m_item);\n\t}", "protected function canContain($item): bool\n {\n return true;\n }", "public function isExactMatch(): bool\n {\n return $this->exactMatch;\n }", "public function isEqual(ResponseItem $compareItem): bool\n {\n $values = $this->getAsArray();\n ksort($values);\n $compareValues = $compareItem->getAsArray();\n ksort($compareValues);\n\n return $values === $compareValues;\n }", "public function contains($item) {\n foreach ($this->items as $i) {\n if ($i == $item) {\n return true;\n }\n }\n return false;\n }", "public function compare($item);", "protected function areAllTheSame(...$items)\n {\n $unique = array_unique(array_filter($items), SORT_REGULAR);\n return count($unique) <= 1;\n }", "public function contains($item);", "public function contains($item);", "public function contains($item);", "function artistsMatch($songs)\n {\n $val = null;\n foreach($songs as $song)\n {\n $val = $val == null ? $song->artist : $val;\n if($song->artist != $val)\n {\n return false;\n }\n }\n return true;\n }", "protected function itemIsUnique(array $item) {\n $unique = array_intersect_key($item, $this->uniqueColumns);\n $this->uniqueStatement->execute($unique);\n\n return (bool) $this->uniqueStatement->fetch();\n }", "public function contains($item, bool $strict = true) : bool;", "function Similarity ($str, $a_link) \r\n{\t\r\n\t$str1=getDNSName($str);\r\n\t$adns1=getDNSName($a_link);\r\n $thresh=0.8;\r\n $pos=((strstr($adns1,$str1)) || (strstr($str1,$adns1)));\r\n if($pos===true)\r\n {\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true;\r\n\t}\r\n\t$maxlen=strlen($adns1);\r\n\t$minchanges = levenshtein($str1, $adns1);\r\n\t$temp=($maxlen-$minchanges)/$maxlen;\r\n\tif (($thresh<$temp) && ($temp<1))\r\n\t{ \t\r\n\t\tglobal $v;\r\n\t\t$v=$str;\r\n\t\treturn true; \r\n\t}\r\n\treturn false;\r\n}", "public function isMatch() : bool\n {\n return substr($this->uri, -strlen($this->match)) === $this->match;\n }", "public function isOriginal(){\n return count($this->results) == 0;\n }", "public function isReduceItem(): bool\n {\n return $this->dotIndex === \\count($this->rule->getComponents());\n }", "public function contains ($item)\n {\n return in_array($item, $this->data);\n }", "public function isDuplicate($data){\n $last_topic = $this->model->where('user_id', Auth::id())\n ->orderBy('id', 'desc')\n ->first();\n return count($last_topic) && strcmp($last_topic->title, $data['title']) === 0;\n }", "public function compareTo($item);", "public function contains(self $item, $checkAgainstThis = true) {}", "public function contains( $item )\n\t{\n\t\treturn in_array( $item , $this->items );\n\t}", "public function containsItemWithKey($key, $item): bool;", "private function dataObjectArrayMatch($item, $match) {\n\t\tforeach($match as $k => $v) {\n\t\t\tif(!isset($item[$k]) || $item[$k] != $v) return false;\n\t\t}\n\t\treturn true;\n\t}", "function areSimilar($a, $b) {\n if($a==$b) return true;\n \n if(sizeof($a)!=sizeof($b)||array_sum($a)!=array_sum($b)) return false;\n \n $index1 = 0; $index2 = 0; $diff = 0;\n \n foreach($a as $key=>$var){\n if($var!=$b[$key]){\n $diff++;\n if($diff==1)\n $index1 = $key;\n else if($diff==2)\n $index2 = $key;\n }\n }\n \n return ($diff==2&&$a[$index1]==$b[$index2]&&$a[$index2]==$b[$index1]);\n}", "public function contains( $item )\n\t\t{\n\t\t\treturn in_array( $item, $this->items );\n\t\t}", "public function hasItem(Item $item = null)\n {\n return $item ? $this->item == $item : $this->item !== null;\n }", "function is_similar_brands($brand_1, $brand_2)\n\t{\n if (empty($brand_1) or empty($brand_2))\n\t\t\treturn 'neutral';\n\t\t\t\n\t\t$len_1 = mb_strlen($brand_1);\n\t\t$len_2 = mb_strlen($brand_2);\n\t\t\n\t\tif ($len_1 > $len_2)\n\t\t{\n\t\t\t$needle\t\t= $brand_2;\n\t\t\t$haystack\t= $brand_1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$needle\t\t= $brand_1;\n\t\t\t$haystack\t= $brand_2;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^$needle/Ui\", $haystack))\n\t\t{\t\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "function contains($item) {\r\n return in_array($item, $this->list);\r\n }", "public function inListForItemContainedReturnsTrueDataProvider() {}", "public function isSameFood($foodA, $foodB);", "public function if_item_is_in_list( $user_id, $list, $item ) {\n \n // Verify if list's meta exists\n $this->db->select('*');\n $this->db->from('lists_meta');\n $this->db->where(['user_id' => $user_id, 'list_id' => $list, 'body' => $item]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n return true;\n \n } else {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(['user_id' => $user_id, 'list_id' => $list]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n return false;\n \n } else {\n \n return true;\n \n }\n \n }\n \n }", "protected function passes(IItem $item)\n {\n foreach ($this->filter as $propertyPath => $value) {\n $realValue = $this->accessor->getValue($item, $propertyPath);\n\n if ($realValue != $value) {\n return false;\n }\n }\n\n return true;\n }", "public function isItemLiked(int $itemId): bool\n {\n $isitemLiked = ItemLikeModel::model()->find('play_id = :playId AND item_id = :itemId AND status = \"like\"', array(\n ':playId' => $this->playid,\n ':itemId' => $itemId\n ));\n\n return !!$isitemLiked;\n }", "public function canDisplayGiftWrappingForItems()\n {\n foreach ($this->getOrder()->getAllItems() as $item) {\n if ($item->getGwId()) {\n return true;\n }\n }\n return false;\n }", "function is_compared($product_id)\n {\n if($this->session->userdata('compare') == ''){\n $this->session->set_userdata('compare','[]');\n }\n $compared = json_decode($this->session->userdata('compare'),true);\n foreach ($compared as $row) {\n if($row == $product_id){\n return 'yes';\n }\n }\n return 'no';\n }", "protected function isItemActive($item)\n {\n $url = $item['url'];\n\n # Jika url item adalah string, ubah ke bentuk array\n if (is_string($url)) {\n $this->urlToArray($item);\n }\n\n if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) {\n $route = $item['url'][0];\n\n // if (isset($route[0]) && $route[0] !== '/' && Yii::$app->controller) {\n // $route = ltrim(Yii::$app->controller->module->getUniqueId() . '/' . $route, '/');\n // }\n\n $route = ltrim($route, '/');\n\n if ($route != $this->route && $route !== $this->noDefaultRoute && $route !== $this->noDefaultAction) {\n return false;\n }\n\n unset($item['url']['#']);\n\n if (count($item['url']) == 1 && !empty($this->params)) {\n return false;\n }\n\n if (count($item['url']) > 1) {\n foreach (array_splice($item['url'], 1) as $name => $value) {\n if ($value !== null && (!isset($this->params[$name]) || $this->params[$name] != $value)) {\n return false;\n }\n }\n }\n\n return true;\n }\n return false;\n }", "protected function matches($other): bool\n {\n [ $valid, $itemCount, $itemsValid ] = $this->inspectData($other);\n\n if (!$valid) {\n return false;\n }\n\n if (!$itemsValid) {\n return false;\n }\n\n if ($itemCount < $this->minItems) {\n return false;\n }\n\n if (($this->maxItems !== null) && ($itemCount > $this->maxItems)) {\n return false;\n }\n\n return true;\n }", "public function isMutipleMatching()\n {\n return $this->mutipleMatching;\n }", "protected function itemExists( string $item ): bool {\n if ( isset( $this->items[ $item ] ) ):\n return TRUE;\n endif;\n return FALSE;\n }", "function isRealItem ( $q ) {\n\treturn true ; # SHORTCUTTING\n\t\t$q = $this->dbw->real_escape_string ( $q ) ;\n\t\t$sql = \"SELECT * FROM page WHERE page_namespace=0 AND page_is_redirect=0 AND page_title='{$q}'\" ;\n\t\t$result = $this->tfc->getSQL ( $this->dbw , $sql ) ;\n\t\tif($row = $result->fetch_assoc()) return true ;\n\t\treturn false ;\n\t}", "public function is_exact()\r\n {\r\n // False otherwise.\r\n return ($this->start == $this->end);\r\n }", "public function isEqual(Riak_Link $link) {\n return ($this->getBucket() == $link->getBucket()) && ($this->getKey() == $link->getKey()) && ($this->getTag() == $link->getTag());\n }", "public function sameValueAs(ValueObjectInterface $collection): bool\n {\n if (!$collection instanceof static) {\n return false;\n }\n\n if (false === $this->count()->sameValueAs($collection->count())) {\n return false;\n }\n $arrayCollection = $collection->toArray(false);\n\n foreach ($this->items as $index => $item) {\n if (!isset($arrayCollection[$index]) || false === $item->sameValueAs($arrayCollection[$index])) {\n return false;\n }\n }\n\n return true;\n }", "function hasAnonymizedResults()\n\t{\n\t\treturn ($this->getAnonymize() == self::ANONYMIZE_ON || \n\t\t\t$this->getAnonymize() == self::ANONYMIZE_FREEACCESS);\n\t}", "public function containsItems(array $items): bool;", "function equals($url) {\n if (! ( $url instanceof URL))\n $url = new URL($url);\n return $url->isWellformed() && $this->isWellformed() && ($this->toString(false) === $url->toString(false));\n }", "function check_if_new($new_photo, $old_photos) {\n foreach ($old_photos as $oldie) {\n if ($oldie->guid == $new_photo['url_m']) {\n //The photo is already in the database!\n return False;\n }\n }\n return True;\n}", "public function contains_searchResult_social($searchResult, $request,$socials)\n {\n $terms = explode(\" \",$request);\n $test = false;\n //print_r($terms);\n\n //check if the header/title of the result contains the keywords of the search query\n\n foreach ($socials as $social) {\n if (strpos(strtolower($searchResult->links), strtolower($social)) !== false) {\n $test = true;\n break;\n }\n }//*/\n if($test)\n {\n foreach ($terms as $term)\n {\n if($test)\n {\n if(strpos(strtolower($searchResult->title) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n }\n if(!$test)\n {\n //check if the link of the result contains the keywords of the search query\n $test = true;\n foreach ($terms as $term)\n {\n if($test)\n {\n\n if(strpos(strtolower($searchResult->link) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n }\n if(!$test)\n {\n //check if the body of the result contains the keywords of the search query\n $test = true;\n foreach ($terms as $term)\n {\n if($test)\n {\n // echo strtolower($searchResult->preview);\n if(strpos(strtolower($searchResult->preview) ,strtolower($term)) !== false)\n {\n\n // echo \"<br/>\";\n }\n else\n {\n $test = false;\n }\n }\n }\n }\n }\n }\n if(!$test)\n {\n return true;\n }\n else\n {\n //echo \"else <br/>\";\n //check the result is already record\n foreach ($this->searchResults as $result)\n {\n // echo \"<br/> a\";\n if(strpos(strtolower($result->links) ,strtolower($searchResult->links)) !== false)\n {\n return true;\n }\n //echo \"yes\";\n\n }\n }\n // echo \"rien\";\n\n return false;\n }", "function checkSimilarity ($nutrient){\n\t//list of nutrients\n\t$nutrientList = array(\"Energy\",\"Protein\",\"Fat\",\"Carbohydrate\",\"Sugars\",\"Sodium\",\"Vitamin E\",\"Vitamin K\",\"Vitamin C\", \"Vitamin A\",\"Vitamin D\",\"Vitamin B6\",\"Biotin\",\"Thiamin\",\"Riboflavin\",\"Niacin\",\"Folic Acid\",\"Vitamin B12\",\"Calcium\",\"Iron\",\"Zinc\",\"Pantothenic Acid\",\"Folate\",\"Phosphorus\",\"Iodine\",\"Magnesium\",\"Selenium\",\"Copper\",\"Manganese\",\"Chromium\",\"Molybdenum\",\"Chloride\");\n\t$test=str_replace(' ', '', $nutrient);\n\tfor ($x=0;$x<count($nutrientList);$x++)\n\t{\n\t\t$test2=str_replace(' ', '', $nutrientList[$x]);\n\t\t//$sim = similar_text(strtolower($nutrient), strtolower($nutrientList[$x]), $perc);\n\t\t$sim = similar_text(strtolower($test), strtolower($test2), $perc);\n\t\tif ($perc>70 && abs(strlen($test)-strlen($test2)<2))\n\t\t{\n\t\t\t//if (strcmp(substr(strtolower($nutrient,0,7))),\"vitamin\")===0){\n\t\t\t//check if it is a vitamin\n\t\t\tif (strcmp(substr(strtolower($test2),0,7),\"vitamin\")===0){\n\t\t\t\tif ($perc>90) return $nutrientList[$x];\n\t\t\t\telse continue;\n\t\t\t}\n\t\t\t//else return strtoupper(substr($nutrient,0,1)).strtolower(substr($nutrient,1));\n\t\t\telse return $nutrientList[$x];\n\t\t}\n\t}\n\treturn \"INVALID\";\n}", "function IsLink($short_url)\n\t{\n\t\t$this->db->where('id', hexdec($short_url));\n\t\t$this->db->from('links');\n\n\t\tif ($this->db->count_all_results() > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private function isEntryRelevant($items, $requestedItems) {\n foreach ($items as $item) {\n foreach ($requestedItems as $requestedItem) {\n if ($item === $requestedItem) {\n return true;\n }\n }\n }\n return false;\n }", "public function shouldBeLike($expected) {}", "public function match(WishlistItemInterface $wishlist_item, array $wishlist_items);", "public function canVote($item)\n {\n if ( !config('vote.canvote_rules.can_vote_owned_item') && $item->user_id == $this->user_id) {\n return false;\n } else if ($this->weight == 0) {\n return false;\n } else if (!config('vote.canvote_rules.can_vote_if_banned') && $this->isBanned()) {\n return false;\n }\n return true;\n }", "function check_item_main_valid() {\n\t\t$item_main = $this->data['item_main'];\n\t\t$call_list_id = $this->ESession->getCallListId($this);\n\t\t$t13_list_item = $this->T13InboundListItem->getColumnListByItemName($call_list_id, $item_main);\n\t\t$item_main_col = $t13_list_item['T13InboundListItem']['column'];\n\n\t\t$arr_item_main = $this->T17InboundTelList->getDataItemMainByIdAndItemMain($call_list_id, $item_main_col);\n\t\t$arr_item_main_diff = array_diff($arr_item_main, array(''));\n\t\t$arr_item_main_unique = array_unique($arr_item_main_diff);\n\t\tif (count($arr_item_main) == count($arr_item_main_unique)) {\n\t\t\techo 'true';\n\t\t\texit;\n\t\t}\n\t\techo 'false';\n\t\texit;\n\t}", "public function testExactMatch()\n {\n $word = $this->randomString(10);\n\n $percent1 = 0;\n $percent2 = 0;\n $percent3 = 0;\n\n //Verify that we produce the same result for an exact match\n //as the core levenshtein function\n $this->assertEquals(\n similar_text($word, $word, $percent1),\n mb_similar_text($word, $word, $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n\n //Verify that we produce an exact match result for strings\n //with multibyte characters.\n $this->assertEquals(5, mb_similar_text('nôtre', 'nôtre', $percent3));\n $this->assertEquals(100.0, $percent3);\n }", "public function isUnique();", "public function equals($price) {\n $equal = true;\n if($price->tax !== $this->tax) $equal = false;\n if($price->net !== $this->net) $equal = false;\n return $equal;\n }", "public function sameuser($user)\n {\n return $this->hasuser() && $this->user()->equals($user);\n }", "public function equals(self $header): bool;", "private function isMatch($queryResult) {\n\t\t\tif (mysqli_num_rows($queryResult) == 1) { // Match made\n\t\t\t\treturn true;\n\t\t\t} else { // No match was made.\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function doesProductsHaveDuplications()\n {\n $productIDs = array();\n foreach ($this->products as $product) {\n $productIDs[] = $product->product_id;\n }\n\n $uniqueProductIDs = array_unique($productIDs);\n return (count($productIDs) != count($uniqueProductIDs));\n }", "public function csc_match() {\n\n\t\treturn $this->get_csc_result() === self::CSC_MATCH;\n\t}", "public function isDuplicateValue(): bool\n\t{\n\t\t$picklistValues = \\App\\Fields\\Picklist::getValuesName($this->fieldModel->getName());\n\t\tif ($this->id) {\n\t\t\tunset($picklistValues[$this->id]);\n\t\t}\n\n\t\treturn \\in_array(strtolower($this->name), array_map('strtolower', $picklistValues));\n\t}", "public function isLiked(){\n //es decir si este estado tiene un like del usuario actualmente autenticado y nos interesa si existe en la base de datos\n return $this->likes()->where('user_id', auth()->id())->exists();\n }", "public function isAMainItem(): bool\n {\n return MealMealItem::where('meal_item_id', $this->id)\n ->where('is_main',1)\n ->count() > 0;\n }", "public function contains(...$items) : bool;", "protected function isItemActive($item)\n {\n $res = parent::isItemActive($item);\n if (!$res) {\n\n $preg = null;\n if (isset($item['preg']) && !empty($item['preg'])) {\n $preg = $item['preg'];\n } elseif (isset($item['url'])) {\n $preg = $item['url'] . ($item['url'] != '/' ? '/*' : '');\n }\n if (!empty($preg)) {\n $preg = '/^' . str_replace('*', '(.*?)', str_replace('/', '\\/', $preg)) . '$/is';\n $res = (preg_match($preg, Yii::$app->request->url) || preg_match($preg, Yii::$app->request->url . '/'));\n }\n }\n return $res;\n }", "protected function originalIsNumericallyEquivalent($key)\n {\n $current = $this->attributes[$key];\n $original = $this->original[$key];\n\n // Date comparison.\n if (in_array($key, $this->getDates())) {\n $current = $current instanceof Timestamp ? $this->asDateTime($current) : $current;\n $original = $original instanceof Timestamp ? $this->asDateTime($original) : $original;\n\n return $current == $original;\n }\n\n return parent::originalIsNumericallyEquivalent($key);\n }", "protected function isItemActive($item)\n {\n if($this->urlKeyCheck($item))\n {\n $route=$item['url'][0];\n if($route[0] !== '/' && Yii::$app->controller)\n {\n $route=Yii::$app->controller->module->getUniqueId().'/'.$route;\n }\n $arrayRoute=explode('/', ltrim($route, '/'));\n $arrayThisRoute=explode('/', $this->route);\n if($this->arrayRoutes($arrayRoute,$arrayThisRoute)===false)\n {\n return false;\n }\n unset($item['url']['#']);\n return $this->itemUrls($item);\n }\n return false;\n }", "public function getIsShareLike( Share $share )\n {\n\n if( !empty( Auth::user()->id ) ){\n $result = $this->where( [ 'fk_user_id' => Auth::user()->id, 'fk_share_id' => $share->id ] )->get();\n\n return $result->isNotEmpty();\n }\n\n }", "protected function hasCurrency(Character $character, Item $item): bool {\n\n $goldCost = is_null($item->cost) ? 0 : $item->cost;\n $shardsCost = is_null($item->shards_cost) ? 0 : $item->shards_cost;\n $copperCoinsCost = is_null($item->copper_coin_cost) ? 0 : $item->copper_coin_cost;\n $goldDustCost = is_null($item->gold_dust_cost) ? 0 : $item->gold_dust_cost;\n\n if ($character->classType()->isMerchant()) {\n $goldDustCost = $goldDustCost - $goldDustCost * 0.05;\n $goldCost = $goldCost - $goldCost * 0.05;\n $shardsCost = $shardsCost - $shardsCost * 0.05;\n $copperCoinsCost = $copperCoinsCost - $copperCoinsCost * 0.05;\n }\n\n if ($character->gold < $goldCost ||\n $character->gold_dust < $goldDustCost ||\n $character->shards < $shardsCost ||\n $character->copper_coins < $copperCoinsCost)\n {\n return false;\n }\n\n return true;\n }", "public function join(User $user, Item $item)\n {\n return true; //$item->order && $item->order->user && ($user->getKey() == $item->order->user->getKey());\n }", "public function hasMember(int|float|null|object|bool|string $item): bool\n {\n return key_exists($this->hash($item), $this->internalMap);\n }", "public function isDuplikat($data = array()) {\r\n $query = \"SELECT count(kst_nomer) as tot FROM ksr_trans WHERE \r\n kst_trans = '\" . $data['kst_trans'] . \"' AND kst_cbid = '\" . $data['kst_cbid'] . \"' AND \r\n kst_nomer = '\" . $data['kst_nomer'] . \"' AND kst_type = '\" . $data['kst_type'] . \"'\";\r\n $sql = $this->db->query($query);\r\n if ($sql->row()->tot > 0) {\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n }", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "public function like()\n {\n self::post(\"/photos/{$this->id}/like\");\n return true;\n }", "protected function isItemActive($item) {\n if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) {\n $route = $item['url'][0];\n if ($route[0] !== '/' && Yii::$app->controller) {\n $route = Yii::$app->controller->module->getUniqueId() . '/' . $route;\n }\n\n if (strpos(Yii::$app->request->getUrl(), $item['url'][0]) !== false) {\n return true;\n }\n if (ltrim($route, '/') !== $this->route) {\n return false;\n }\n unset($item['url']['#']);\n if (count($item['url']) > 1) {\n foreach (array_splice($item['url'], 1) as $name => $value) {\n if ($value !== null && (!isset($this->params[$name]) || $this->params[$name] != $value)) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n return false;\n }", "function harvest_in_order( $order ) {\n\n\t$items = $order->get_items(); \n\n\tforeach ( $items as $item_id => $item ) {\n\n\t\tif ( $item->get_product_id() === 37592 ) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\n\t}\n\t\n\treturn false;\n\n}", "function are_there_duplicates_in_db() {\n $result = $this->pdo->query('SELECT filename,md5_sign,count(*) FROM files\n GROUP BY filename, md5_sign\n HAVING COUNT(*) > 1');\n $results = count($result->fetchAll());\n\n if( $results ) {\n return true;\n } else {\n return false;\n }\n }", "public function isApple() : bool\n {\n return $this->title == self::APPLE;\n }", "public function IsInList($oItem)\n {\n $bIsInList = false;\n $iCurPos = $this->getItemPointer();\n $this->GoToStart();\n while (!$bIsInList && ($oTmpItem = $this->Next())) {\n if ($oTmpItem->IsSameAs($oItem)) {\n $bIsInList = true;\n }\n }\n $this->setItemPointer($iCurPos);\n\n return $bIsInList;\n }", "private function areEqual()\n {\n $this->compareHeader();\n\n return empty($this->diffHeader);\n }", "protected function _isDublicatedData($params){\r\n\t $quoteId = $params['quote_id'];\r\n\t $productId = $params['product_id'];\r\n $qtyRequest = $params['request_qty'];\r\n \r\n\t $collection = Mage::getModel('qquoteadv/requestitem')->getCollection()\r\n \t ->addFieldToFilter('quote_id', $quoteId)\r\n \t ->addFieldToFilter('product_id', $productId)\r\n \t ->addFieldToFilter('request_qty', $qtyRequest)\r\n \t //->load(true)\r\n \t ;\r\n \t \r\n return (count($collection) > 0)?true:false; \r\n\t}", "public function isDuplicable()\n {\n return $this->_isDuplicable;\n }", "function use_equals($ar) {\r\n\tfor($i = 0, $j = count($ar); $i < $j; $i++) {\r\n\t\tif('gouda' == $ar[$i]) {\r\n\t\t\t// it's gouda\r\n\t\t}\r\n\t}\r\n}", "public function check_duplicate_product()\n\t{\n\t\t$key=$this->input->post('keyword');\n\t\t$check=$this->db->query(\"SELECT `pr_name` from `products` where `pr_name`='\".$key.\"' AND `pr_deleted`='0'\");\n\t\tif($check->num_rows()>0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function contains_searchResult($searchResult, $request)\n {\n $test = $this->contains_($searchResult,$request);\n if(!$test)\n {\n return true;\n }\n else\n {\n //echo \"else <br/>\";\n //check the result is already record\n if($this->eager)\n {\n foreach ($this->searchResultsDB as $result)\n {\n // echo \"<br/> a\";\n if(strpos(strtolower($result->links) ,strtolower($searchResult->links)) !== false)\n {\n // echo \"return 1\";\n return true;\n }\n //echo \"yes\";\n\n }\n }\n else\n {\n foreach ($this->searchResults as $result)\n {\n // echo \"<br/> a\";\n if(strpos(strtolower($result->links) ,strtolower($searchResult->links)) !== false)\n {\n // echo \"return 1\";\n return true;\n }\n //echo \"yes\";\n\n }\n }\n }\n // echo \"rien\";\n\n return false;\n }", "public function containsProduct(Product $product): bool;", "public static function areSame($model1,$model2){\n if($model1->modelName==$model2->modelName && $model1->id==$model2->id){\n return true;\n }\n return false;\n }", "public function isChanged()\n {\n return ! empty(array_diff_assoc($this->items, $this->clone));\n }", "function _check_duplicate($str)\n\t{\n\t\tee()->load->model('wiki_model');\n\n\t\tif (ee()->wiki_model->check_duplicate(ee()->form_validation->old_value('id'), $str) === FALSE)\n\t\t{\n\t\t\tee()->form_validation->set_message('_check_duplicate', ee()->lang->line('duplicate_short_name'));\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function equivalent($md) {\n return ($md->getName() == $this->getName() &&\n $md->getType() == $this->getType());\n }", "private function isDuplicate($name = '') {\n\t\treturn false;\n\t}", "public function isCorrect()\n {\n return $this->question->correct_answer_keys->contains($this->key);\n }", "public function hasItemQuality()\n {\n return $this->item_quality !== null;\n }" ]
[ "0.65168035", "0.6260854", "0.62260365", "0.61486435", "0.6136013", "0.607731", "0.6042177", "0.59677464", "0.59313595", "0.58191276", "0.5769222", "0.5769222", "0.5769222", "0.5734527", "0.56987834", "0.56321466", "0.5600375", "0.5549086", "0.5509815", "0.5499873", "0.5493863", "0.54863316", "0.5476072", "0.5446371", "0.54438794", "0.53855735", "0.5385352", "0.5379538", "0.5365519", "0.5365467", "0.53407145", "0.53228134", "0.5305875", "0.52793765", "0.52741534", "0.52688116", "0.52675194", "0.525938", "0.52530354", "0.5225521", "0.5216955", "0.52045625", "0.5195015", "0.5183763", "0.5182091", "0.51819897", "0.51798356", "0.5140642", "0.51379734", "0.5121734", "0.5119619", "0.51070815", "0.50923944", "0.50871", "0.50710917", "0.50657326", "0.50634897", "0.50564885", "0.50524235", "0.50449485", "0.50382847", "0.50296706", "0.50255287", "0.50234133", "0.50225127", "0.50183845", "0.50176334", "0.5014785", "0.50102067", "0.5009434", "0.50060666", "0.49989858", "0.49982035", "0.49903557", "0.49884576", "0.4988312", "0.498582", "0.49820516", "0.49802282", "0.49783063", "0.49739859", "0.49738628", "0.49733964", "0.4972772", "0.49685732", "0.49685204", "0.49648294", "0.49632275", "0.49570465", "0.4952572", "0.49523917", "0.4950989", "0.4945734", "0.49360678", "0.49334896", "0.49327645", "0.49291947", "0.49285054", "0.49226132", "0.4920326" ]
0.6541216
0
Connect to the database. Returns a PDO object
function getDb() { // Local deployment $server = "localhost"; $username = "adcog_user"; $password = "secret"; $db = "adcog"; return new PDO("mysql:host=$server;dbname=$db;charset=utf8", "$username", "$password",array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connect() {\n if ($this->db === null) {\n $this->db = new PDO($this->db_dsn, $this->db_user, $this->db_pass);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n\n if ($this->db_schema !== null && $this->db_schema !== '') {\n $this->db->exec('SET search_path = ' . $this->db_schema . ', public');\n }\n\n return $this->db;\n }", "public function connect() {\n try {\n $this->_pdo = new PDO($this->_host, $this->_username, $this->_password);\n $this->_pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n $this->_pdo->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC );\n } catch(PDOException $e) {\n die(\"Connection failed: \" . $e->getMessage());\n }\n return $this->_pdo;\n }", "public function connect()\n {\n if ($this->pdo == null) {\n $this->getCrendentials();\n $this->pdo = new PDO(\"mysql:host=$this->host;dbname=$this->dbname;charset=utf8mb4\", $this->username, $this->password);\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n }\n return $this->pdo;\n }", "private static function connect() {\n try {\n $db = new PDO(\n \"mysql:host=\" . DB_HOST . \";dbname=\" . DB_NAME,\n DB_USER, DB_PASS\n );\n }\n catch (Exception $e) {\n $this->error_msg = \"There was a problem connecting to the database.\" . $e->getMessage();\n $db = null;\n }\n\n return $db;\n }", "public function dbConnect() {\n\t\t$opt = [\n\t\t \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n\t\t \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_OBJ,\n\t\t \\PDO::ATTR_EMULATE_PREPARES => false,\n\t\t];\n\t\t$this->pdo = new \\PDO($this->dsn, $this->config['user'], $this->config['password'], $opt);\n\t\tif(!$this->pdo){\n\t\t\techo \"Problem in database connection! Contact administrator!\";\n\t\t\texit();\n\t\t}\n\t\treturn $this->pdo;\n\t}", "public static function connectDatabase()\n {\n $database_config = require(__ROOT__ . 'config/database.php');\n\n try {\n\n return new \\PDO(\n 'mysql:host=' . $database_config['host'] . ';dbname=' . $database_config['db_name'] . ';charset=' . $database_config['db_charset'],\n $database_config['db_user'],\n $database_config['db_password']\n );\n\n } catch (\\PDOException $e) {\n\n }\n }", "public static function connect() { \n\n $pdo = new PDO(\"mysql:host=\".HOST.\";dbname=\".DB.\";charset=utf8\", USERNAME, PASSWORD);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $pdo;\n }", "public static function connect()\n {\n // Only connect if we don't have a handle on the database\n if (!is_null(self::$_db))\n return self::$_db;\n \n try\n {\n // DSN FORMAT: \"mysql:host=localhost;dbname=test\"\n $dsn = Config::get('Database', 'Driver') . ':host=' . Config::get('Database', 'DBHost') . ';dbname=' . Config::get('Database', 'DB');\n self::$_db = new PDO($dsn, Config::get('Database','Username'), Config::get('Database','Password'), array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n self::$_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch (PDOException $e)\n {\n throw new DaoException(\"Error (Dao::connect): \" . $e->getMessage());\n }\n }", "protected function db_connect() {\n \n // Data source name\n $this->dsn = 'mysql:host=' . $this->db_host . ';dbname=' . $this->db_name . ';charset=' . $this->db_charset;\n\n // Makes a connection to the database\n $this->db_conn = new PDO( $this->dsn, $this->db_user, $this->db_password );\n\n // When fetching an SQL row it turn into an object\n $this->db_conn->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ );\n // Gives the Error reporting atribute and throws exeptions\n $this->db_conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n \n // Returns the connection\n return $this->db_conn;\n\n }", "protected function connect()\n\t\t{\n\t\t\t$conn = new PDO(\"mysql:dbname=$this->m_db;host=$this->m_host\", $this->m_username, $this->m_password); /* Create a new connection */\n\n\t\t\tif (DEBUG) /* If the global variable DEBUG is true */\n\t\t\t\techo 'Connecting to database.<br>'; /* Display debug messages */\n\t\t\t\n\t\t\treturn $conn; /* Return the database connection */\n\t\t}", "function connect()\n {\n try {\n return new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n } catch(PDOException $e) {\n echo $e->getMessage();\n return null;\n }\n }", "protected function dbConnect() {\n\t\trequire 'dblog.php';\n\t\t$db = new PDO($connect, $user, $pwd);\n\t\t$db->exec('SET NAMES UTF8');\n\t\treturn $db;\n\t}", "public function connect() {\n //Set connection to null\n $this -> conn = null;\n\n //Connect through the PDO Object\n try {\n $this -> conn = new PDO(\"mysql:host=\" . $this -> host . \";dbname=\" . $this -> dbname, $this ->username, $this -> password);\n //Set Error mode attribute to get exceptions\n $this -> conn -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $ex) {\n echo \"Error with Database connection: \" . $ex -> getMessage();\n }\n return $this -> conn;\n }", "public function connect()\n {\n $this->conn = null;\n\n // PDO\n try {\n $this->conn = new PDO('mysql:host=' . $this->db_host . ';dbname=' . $this->db_name, $this->db_username, $this->db_pass);\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n echo 'Connection Error: ' . $e->getMessage();\n }\n\n // Return the connection\n return $this->conn;\n }", "public function connect() {\n if ($this->pdo == null) {\n try {\n $this->pdo = new \\PDO(\"sqlite:\" . Config::PATH_TO_SQLITE_FILE);\n } catch (\\PDOException $e) {\n echo $e;\n }\n }\n return $this->pdo;\n }", "function connect_to_db () {\n\tglobal $conn;\n\tglobal $pdo_connection_string;\n\n\tif (!is_null($conn))\n\t\treturn $conn;\n\n\ttry {\n\t // connect to the database\n\t\t$conn = new PDO($pdo_connection_string, DB_USER, DB_PASS);\n\n\t\t// throw exceptions when errors occur\n\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t// fetch rows as associative arrays (dictionaries)\n\t\t$conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\t} catch (PDOException $e) {\n\t echo \"Database exception: \" . $e->getMessage() . \"\\n\";\n\t die;\n\t}\n\n\treturn $conn;\t\n}", "protected function getConnection(): PDO\n {\n $dbConfig = $this->config->getSettings(Config::_DB);\n $adapterParams = $dbConfig[self::DB_SLOT_TEST][self::DB_NAME_TEST];\n $adapter = new \\App\\Component\\Db\\Adapter\\PdoMysql(\n self::DB_NAME_TEST,\n $adapterParams\n );\n return $adapter->connect()->getConnection();\n }", "public static function connect()\n {\n try {\n $db_host = DbConfig::$host_url;\n $db_name = DbConfig::$database_name;\n $db_user = DbConfig::$database_user;\n $user_pw = DbConfig::$password;\n \n $con = new PDO('mysql:host='.$db_host.'; dbname='.$db_name, $db_user, $user_pw); \n $con->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n $con->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ );\n $con->setAttribute( PDO::ATTR_EMULATE_PREPARES, false );\n $con->exec(\"SET CHARACTER SET utf8\");\n\n return $con;\n }\n catch (PDOException $err) { \n $err->getMessage() . \"<br/>\";\n file_put_contents(__DIR__.'/log/PDOErrors.txt', $err.PHP_EOL.PHP_EOL, FILE_APPEND);\n die( $err->getMessage());\n }\n }", "public function connect()\n {\n $pdo = new PDO('mysql:host=localhost;dbname=stack_overflow_clone', $this->db_username, $this->db_password);\n\n //turn on exceptions\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n //set default fetch mode\n $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n return $pdo;\n }", "public function connect() {\n if ($this->pdo == null) {\n $this->pdo = new \\PDO(\"sqlite:\" . config::PATH_TO_SQLITE_FILE);\n }\n return $this->pdo;\n }", "private function connect()\n {\n try {\n $db = new PDO($this->dsn, $this->username, $this->password);\n $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n return $db;\n } catch (PDOException $e) {\n echo \"Error: Unable to load this page. Please contact [email protected] for assistance.\";\n echo \"<br/>Error: \" . $e;\n }\n }", "public static function connect()\n {\n //if the $db static attribute of this object (self) is empty ( self:: targets a static element of an object)\n if(empty(self::$db))\n {\n //assignment to the attribute $db of the intanciation of the hydrated PDO object with the connection parameters\n self::$db = new PDO(\n \"mysql:host=\".DB_HOST.\";dbname=\".DB_NAME.\";charset=utf8\", \n DB_USER, DB_PASS,\n [\n // display errors related to the Data Base\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, \n // return an associative array(string based) not numeric\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, \n // request send only to execute / not to prepare \n PDO::ATTR_EMULATE_PREPARES => false, \n ]\n ); \n }\n return self::$db;\n }", "public function getConnection() {\n\t\tif($this->type == 'mysql'){\n\t\t\ttry {\n\t\t\t\t$pdo = new PDO(\"mysql:host=$this->host;dbname=$this->db;port=$this->port\",\n\t\t\t\t\t$this->user,\n\t\t\t\t\t$this->pass,\n\t\t\t\t\t[PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES $this->charset\"]\n\t\t\t\t);\n\t\t\t\t// Set the PDO error mode to exception\n\t\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\treturn $pdo;\n\t\t\t} catch(PDOException $e) {\n\t\t\t\tdie(\"ERROR: Could not connect. \" . $e->getMessage());\n\t\t\t}\n\t\t} else if($this->type == 'psql'){\n\t\t\t$pdo = pg_connect(\"host=$this->host dbname=$this->db user=$this->user password=$this->pass port = $this->port\")\n\t\t\tor die('Connection Failed: ' . pg_last_error());\n\t\t\treturn $pdo;\n\t\t}\n die(\"ERROR: Could not establish connection to database.\");\n }", "public function get_db(): PDO\n {\n return $this->connection;\n }", "public static function connect()\r\n {\r\n\r\n $pdo = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME,DB_USER,DB_PW,array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\r\n return $pdo;\r\n }", "public function connection()\n\t\t{\n\t\t\ttry{ \n\t\t\t\t $pdo = new PDO($this->dsn, $this->str_user, $this->str_pw);\n\t\t\t\t}catch (PDOException $e){\n\t\t\t\t die ('DB Error');\n\t\t\t\t}\n\t\t\t\n\t\t\treturn $pdo;\n\t\t}", "public static function connect()\n {\n if (null == self::$connection) {\n try {\n self::$connection = new PDO(\"mysql:host=\".self::$host.\";dbname=\".self::$database.\";charset=utf8\", self::$user,self::$password);\n self::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }\n return self::$connection;\n }", "public static function connect()\n {\n $pdo = new \\PDO(\n self::$PDODsn,\n self::$DBUsername,\n self::$DBPassword\n );\n\n self::$connection = new Connection($pdo);\n \n return self::$connection;\n }", "public function connect()\n {\n if ($this->pdo !== null) {\n return;\n }\n\n $db = $this->configs['database'] ?? '';\n $hostname = $this->configs['hostname'] ?? '';\n $port = $this->configs['port'] ?? '';\n $charset = $this->configs['charset'] ?? '';\n $username = $this->configs['username'] ?? '';\n $password = $this->configs['password'] ?? '';\n\n $this->pdo = new PDO(\n \"mysql:dbname={$db};host={$hostname};port={$port};charset={$charset}\",\n $username,\n $password\n );\n }", "public static function connectDB() {\n try {\n $conn = new PDO(self::$host, self::$user, self::$pass);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n return $e->getMessage();\n }\n return $conn;\n }", "public static function getConn() : \\PDO\n {\n return Db::getInstance();\n }", "public function connect() : \\PDO\n {\n try {\n return new \\PDO(\n \"mysql:host=\".self:: HOST . \";port=\" . self::PORT . \";dbname=\".self::DB_NAME.\";charset=utf8\",\n self::USERNAME,\n self::PASSWORD,\n [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION\n ]\n );\n } catch (\\PDOException $exception) {\n die(\"Error conectando al servidor: \" . $exception->getMessage());\n }\n\n }", "public static function connect() {\n $dsn = \"mysql:host=\" . Config::$DB_HOST\n . \";port=\" . Config::$DB_PORT\n . \";dbname=\" . Config::$DB_NAME\n . \";charset=\" . Config::$DB_CHAR;\n try {\n self::$PDO = new PDO($dsn, Config::$DB_USER, Config::$DB_PASS);\n self::$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Display SQL exceptions to the web page\n self::$PDO->setAttribute(PDO::MYSQL_ATTR_LOCAL_INFILE, true); // Allows use of MySQL 'LOAD DATA LOCAL INFILE' for mass data import\n } catch (PDOException $ex) {\n exit(\"Database failed to connect: \" . $ex->getMessage());\n }\n }", "protected function getPdoConnection()\n {\n $dbSettings = $GLOBALS['TYPO3_CONF_VARS']['DB'];\n $pdo = new \\PDO('mysql:host=' . $dbSettings['host'] . ';dbname=' . $dbSettings['database'], $dbSettings['username'],\n $dbSettings['password']);\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n return $pdo;\n\n }", "public static function getConn()\n {\n return self::pdoConnect();\n }", "private static function _getConnection() : \\PDO\n {\n $options = [\n \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_ASSOC,\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION\n ];\n $_connection = new \\PDO(\n static::_prepareDsnString(),\n static::$_config['login'],\n static::$_config['password'],\n $options\n );\n\n return $_connection;\n }", "private function connect()\n {\n $connection_string = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';';\n $this->connection = new PDO($connection_string, DB_USER, DB_PASS);\n }", "protected function connect()\n\t{\n\t\t$strDSN = 'mysql:';\n\t\t$strDSN .= 'dbname=' . $GLOBALS['TL_CONFIG']['dbDatabase'] . ';';\n\t\t$strDSN .= 'host=' . $GLOBALS['TL_CONFIG']['dbHost'] . ';';\n\t\t$strDSN .= 'port=' . $GLOBALS['TL_CONFIG']['dbPort'] . ';';\n\t\t$strDSN .= 'charset=' . $GLOBALS['TL_CONFIG']['dbCharset'] . ';'; // supported only in PHP 5.3.6+\n\n\t\t$arrOptions = array(\n\t\t\tPDO::ATTR_PERSISTENT => $GLOBALS['TL_CONFIG']['dbPconnect'],\n\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode=\\'\\'; SET NAMES ' . $GLOBALS['TL_CONFIG']['dbCharset'],\n\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n\t\t);\n\n\t\t$this->resConnection = new PDO($strDSN, $GLOBALS['TL_CONFIG']['dbUser'], $GLOBALS['TL_CONFIG']['dbPass'], $arrOptions);\n\t}", "public static function getDatabaseConnexion() {\n return new pdo('mysql:host=' . static::$server . ';dbname=' . static::$databaseName, static::$username, static::$password);\n }", "public function connect()\n {\n $dsn = sprintf(\"mysql:host=%s;port=%s;dbname=%s\", $this->configuration['host'], $this->configuration['port'], $this->configuration['database']);\n $this->pdo = new PDO($dsn, $this->configuration['username'], $this->configuration['password']);\n }", "function pdo_connect_to_db() {\r\n // Set DSN - data source name\r\n $dsn = 'mysql:host=' . DB_SERVER . ';dbname=' . DB_NAME . \";charset=utf8\";\r\n\r\n // Create PDO instance\r\n $pdo = new PDO($dsn, DB_USER, DB_PASS);\r\n $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\r\n // set the PDO error mode to exception\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n return $pdo;\r\n}", "public function dbConnection()\n {\n $this->conn = null;\n $config = new Config();\n try\n {\n $this->conn = new PDO(\"mysql:host=\" .$config->getHost() . \";dbname=\" . $config->getDBName(), $config->getDBUsername(), $config->getDBPassword());\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch(PDOException $exception)\n {\n echo \"Connection error: \" . $exception->getMessage();\n }\n return $this->conn;\n }", "public function getConnection()\n {\n $this->pdo = null;\n\n try {\n $dsn = \"mysql:host=$this->host;dbname=$this->db;port=$this->port;charset=$this->charset\";\n $opt = [\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n PDO::ATTR_EMULATE_PREPARES => false,\n PDO::ATTR_PERSISTENT => true\n ];\n\n $this->pdo = new PDO($dsn, $this->user, $this->pass, $opt);\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n\n return $this->pdo;\n }", "protected static function connectDb() : PDO\n {\n return aaa;\n }", "public function connect(){\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n\n $pdo = new PDO(\"mysql:host=$servername;dbname=project\", $username, $password);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n return $pdo;\n }", "function connect_database() {\n\tglobal $config, $db;\n\n\t$db = new PDO(\n\t\t'mysql:host=' . $config['db_host'] . ';dbname=' . $config['db_name'],$config['db_user'],$config['db_pass']\n\t);\n\t$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);\n\n\treturn $db;\n}", "public function connect() {\n\n\t\t$db_info_string = $this->_db_info[0]. ':host=' . $this->_db_info[1] . ';';\n\t\t$db_info_string .= 'dbname='. $this->_db_info[4]; \n\n\t\ttry {\n\t\t\t$this->_db = new pdo($db_info_string, $this->_db_info[2], $this->_db_info[3] );\n\n\t\t//set Error mode to send out exceptions\n\t\t$this->_db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); \n\n\t\t} catch (PDOException $e) {\n\t\t\t//TODO Custom error reporting\n\t\t\techo $e->getMessage();\n\t\t}\n\n\t\t//TODO ATTEMPT TO CONNECT, IF PDO OBJECT CANNOT BE CREATED, return \n\t\t//false and use custome error reporting\n\t\t//TRY, CATCH that jazz tooo\n\t\t\n\t\t//Returns the object so that it can be chained\n\t\treturn $this;\n }", "public static function createConnection()\n {\n $variablesIsSet =\n isset($_ENV['DB_HOST']) &&\n isset($_ENV['DB_NAME']) &&\n isset($_ENV['DB_USER']) &&\n isset($_ENV['DB_PASSWORD']);\n\n if ($variablesIsSet) {\n return new PDO(\n \"mysql:dbname={$_ENV['DB_NAME']};host={$_ENV['DB_HOST']}\",\n $_ENV['DB_USER'],\n $_ENV['DB_PASSWORD'],\n [\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n ]\n );\n }\n }", "public static function getConnection()\n {\n return self::$pdo;\n }", "function pdo_connect($dsn, $username = null, $password = null, array $driver_options = array())\n {\n return new PDO($dsn, $username, $password, $driver_options);\n }", "protected function getConnection()\n {\n $pdo = new PDO($GLOBALS['DB_DSN'],\n $GLOBALS['DB_USER'],\n $GLOBALS['DB_PASSWORD']);\n return $this->createDefaultDBConnection($pdo, $GLOBALS['DB_NAME']);\n }", "private static function connect()\n {\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $dbname = \"social_network\";\n $charset = \"utf8mb4\";\n\n try {\n $dsn = \"mysql:host=\" . $servername . \";dbname=\" . $dbname . \";charset=\" . $charset;\n $pdo = new PDO($dsn, $username, $password);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $pdo;\n } catch (PDOException $e) {\n die(\"Connection failed: \" . $e->getMessage());\n }\n }", "function getDbConnect() {\n\t\trequire(\"config.php\");\n\t\treturn new PDO('mysql:host='.$DB_HOST.';dbname='. $DB_NAME, $DB_USER, $DB_PASS);\n\t}", "static function getDbConnection() {\n\n if (empty(static::$db)) {\n $pdo = Service::get('pdo');\n static::$db = new \\PDO($pdo['dns'], $pdo['user'], $pdo['password']);\n }\n return static::$db;\n }", "function connect()\n {\n try {\n $db = new PDO($this->dsn, $this->username, $this->password);\n $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n return $db;\n } catch (PDOException $e) {\n echo \"Error: Unable to load this page. Please contact [email protected] for assistance.\";\n echo \"<br/>Error: \" . $e;\n }\n }", "public static function connect()\n {\n if ( null == self::$cont )\n {\n try\n {\n self::$cont = new PDO( \"mysql:host=\".self::$dbHost.\";\".\"dbname=\".self::$dbName, self::$dbUsername, self::$dbUserPassword);\n }\n catch(PDOException $e)\n {\n die($e->getMessage());\n }\n }\n return self::$cont;\n }", "public static function pdo()\n {\n return new \\PDO(\"mysql:host={$_ENV['DB_HOST']};dbname={$_ENV['DB_NAME']}\", $_ENV['DB_USER'], $_ENV['DB_PASS']);\n }", "function getConnection() {\n\trequire(\"config.db.php\");\n\t$dbh = new PDO($pdo_connect, $db_user, $db_pass);\t\n\t$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\treturn $dbh;\n}", "protected function getPDOConnection() {\n try {\n $this->PDO = new PDO(\n \"mysql:host=$this->HOST;charset=utf8;dbname=$this->NAME\",\n $this->USR,\n $this->PWD,\n [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ]\n );\n return $this->PDO;\n } catch (PDOException $e) {\n die('There was an error connecting to the database: ' . $e->getMessage()); //@@@ERRORCODE\n }\n }", "protected static function getConnection()\n {\n try\n {\n //get file with params to connect\n $paramsPath = ROOT . '/config/db_params.php';\n $params = include($paramsPath);\n\n $dsn = \"mysql:host={$params['host']};dbname={$params['dbname']}\";\n $db = new PDO($dsn, $params['user'], $params['password']);\n $db->exec(\"set names utf8\");\n\n return $db;\n }\n catch(PDOException $ex) // Check connection with db\n {\n die(\"У нас проблемы, зайдите позже\");\n }\n }", "private function getDbConnection()\n {\n $data = \"mysql:dbname={$this->dbName};host={$this->dbHost}\";\n $pdo = new \\PDO($data, $this->dbUser, $this->dbPwd);\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n return $pdo;\n }", "public function dbConnect()\n {\n return new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME, DB_USER , DB_PASS);\n }", "public function getConnection() {\n\n $this->conn = null;\n\n try {\n $this->conn = new PDO(self::DRIVER . \":host=\" . self::HOST . \";dbname=\" . self::DB_NAME, self::USERNAME, self::PASSWORD);\n } catch (PDOException $exception) {\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return $this->conn;\n }", "public function connect() {\n\n // read parameters in the ini configuration file\n //$params = parse_ini_file('database.ini');\n $environment = parse_url(getenv(\"DATABASE_URL\"));\n\n //if ($params === false) {throw new \\Exception(\"Error reading database configuration file\");}\n if ($environment === false) {throw new \\Exception(\"Error reading database configuration file\");}\n // connect to the postgresql database\n $connection = sprintf(\"pgsql:host=%s;port=%d;dbname=%s;user=%s;password=%s\", \n $environment['host'], \n $environment['port'], \n ltrim($environment[\"path\"], \"/\"), \n $environment['user'], \n $environment['pass']);\n \n $pdo = new \\PDO($connection);\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n \n return $pdo;\n\n }", "function connect()\r\n{\r\n try {\r\n // instantiate a PDO object using a PDO constructor\r\n $dbh = new PDO(DB_DSN,DB_USERNAME,DB_PASSWORD);\r\n return $dbh;\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n return;\r\n }\r\n}", "public function createDatabaseConnection() : PDO\n {\n $configFile = $this->storageDir.'app/database.ini';\n $settings = parse_ini_file($configFile);\n\n // This will only work for MySQL database. If we ever want to support\n // more than just MySQL we have to adapt this code.\n // (Unfortunately we cannot use Laravel's ConnectionFactory class easily.)\n $driver = $this->getDatabaseConnectionDetails()['driver'];\n $dsn = $driver.':dbname='.$settings['database'].';host='.$settings['host'];\n\n $pdo = new PDO($dsn, $settings['username'], $settings['password']);\n\n return $pdo;\n }", "protected function connection() {\n if ($this->dbConnection == NULL)\n $this->dbConnection = new \\PDO(\\Settings::$DB_CONNECTION, \\Settings::$DB_USERNAME, \\Settings::$DB_PASSWORD);\n\n $this->dbConnection->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n return $this->dbConnection;\n }", "private function connect()\n {\n try {\n self::$connection = new PDO($this->buildDSN(), $this->user, $this->pass, $this->options);\n } catch (PDOException $e) {\n die('Connection failed: ' . $e->getMessage());\n }\n\n }", "function getConnection(){\n\t\tglobal $hostname,$database,$port,$dbuser,$dbuserpass;\n\t\ttry{\n\t\t\t$db = new PDO(\"mysql:host=$hostname;port=$port;dbname=$database\",\n\t\t\t \t$dbuser, $dbuserpass,\n\t\t\t \tarray(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION,PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"));\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t return $db;\n\t}", "public static function connect(){\n $config = (object)Bind::get('config')->database;\n\n // $pdo = new PDO(\"mysql:host=localhost;dbname=curso_mvc;charset=utf8\", \"root\", \"root\");\n // $pdo->setAttribute(\"PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION\"); \n // //Erros que forem acontecendo serão mostrados através de um exception\n\n // // $pdo->setAttribute(\"PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC\");\n // //Retorna um array.. $user['name']\n\n // $pdo->setAttribute(\"PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ\");\n // //Vai retornar um obj.. $user->name\n\n $pdo = new PDO(\"mysql:host=$config->host;dbname=$config->dbname;charset=$config->charset\", $config->username, $config->password, $config->options);\n\n return $pdo;\n \n }", "public static function getDB(): \\PDO\n {\n if (self::$db === null) {\n self::initialize();\n $dsn = \"mysql:host=\".self::$config['db']['host'].\";dbname=\".self::$config['db']['database'];\n self::$db = new \\PDO($dsn, self::$config['db']['username'], self::$config['db']['password']);\n self::$db->setAttribute(\\PDO::ATTR_DEFAULT_FETCH_MODE, \\PDO::FETCH_ASSOC);\n }\n return self::$db;\n }", "private function connect() {\n try {\n $connection = new PDO($this->configuration->getConnectionString(), $this->configuration->getUsername(), $this->configuration->getPassword(),\n // Configure client in UTF-8\n array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n return $connection;\n } catch (PDOException $e) {\n throw new Exception('Connection to database failed.\\n' . $e);\n }\n }", "public static function getPDO() : PDO;", "private function connect()\n {\n if (! is_null(self::$db)) {\n return;\n }\n\n // $this->host \t= $Database->host;\n // $this->user \t= $Database->user;\n // $this->pass \t= $Database->pass;\n // $this->database\t= $Database->database;\n\n $conn = 'mysql:dbname=' . $this->dbInfo->database . ';host=' . $this->dbInfo->host.';charset=utf8';\n try {\n self::$db = new PDO($conn, $this->dbInfo->user, $this->dbInfo->pass);\n } catch (PDOException $e) {\n die('Could not connect to database (' . $conn . ')');\n }\n }", "private function connect(){\n $cred = parse_ini_file(dirname(__FILE__) . \"/../db_key.ini\");\n\n try{\n\t\t $conn = new PDO(\"mysql:host=$cred[servername];dbname=$cred[dbname]\", $cred['username'], $cred['password']);\n\n\t\t // set the PDO error mode to exception\n\t\t $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t return $conn;\n }\n\t\tcatch(PDOException $e){\n\t\t \techo \"Connection failed: \" . $e->getMessage();\n }\n\t\treturn null;\n\t}", "public function connect(){\n try{\n $this->dbConnection = new PDO('mysql:host='.$this->dbHostname.';dbname='.$this->dbName.';charset=utf8', ''.$this->dbUsername.'',''.$this->dbPassword.'', array(\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n ));\n return $this->dbConnection;\n }\n catch(PDOException $e) {\n return false;\n //echo $e->getMessage(); //TODO: Remove on production code\n }\n }", "protected static function getConnection() {\n\n static $connection = null;\n\n if ($connection === null) {\n try {\n $dsn = 'mysql:host=' . Config::DB_HOST . ';dbname=' . Config::DB_NAME;\n $connection = new PDO($dsn, Config::DB_USER, Config::DB_PSWD);\n $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch(PDOException $e) {\n throw new \\Exception('Error from: ' . get_class($this) . ' - Unable to connect to database ' . Config::DB_NAME);\n }\n }\n\n return $connection;\n\n }", "private function Connect()\n {\n $config = ConfigDb::dbConfig();\n $dsn = 'mysql:dbname='.$config['database'].';host='.$config['host'];\n try\n {\n $this->pdo = new PDO($dsn, $config['username'], $config['password'], array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\n $this->bConnected = true;\n }\n catch (PDOException $e)\n {\n echo $this->ExceptionLog($e->getMessage());\n die();\n }\n }", "public function connect(): PDO\n {\n if (!isset($this->db)) { // check if not already connected\n $options = [\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC\n ];\n $this->db = new PDO('sqlite:'.$this->dbPath, null, null, $options);\n $isCreated = file_exists($this->dbPath);\n if (!$isCreated) {\n $this->createStructure();\n }\n // Do every time you connect since they are only valid during connection (not permanent)\n $this->db->sqliteCreateAggregate(\n 'GROUP_CONCAT',\n [$this, 'groupConcatStep'],\n [$this, 'groupConcatFinalize']\n );\n $this->db->sqliteCreateFunction('STRTOTIME', [$this, 'strToTime']);\n//\t\t\t\t$this->Db->sqliteCreateFunction('LOCALE', array($this, 'GetSortOrder'), 1);\n $this->db->exec('pragma short_column_names = 1');\n }\n\n return $this->db;\n }", "public function getConnection()\n {\n if(!($this->pdoConnection instanceof \\PDO)){\n $this->connect();\n }\n\n return $this->pdoConnection;\n }", "protected static function getConnection()\n {\n static $connection;\n\n if ($connection === null) {\n $options = [\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n ];\n\n try {\n $connection = new PDO(\n sprintf(\"mysql:dbname=%s; host=%s; charset=utf8\", getenv('DB_NAME'), getenv('DB_HOST')),\n getenv('DB_USER'),\n getenv('DB_PASSWORD'),\n $options\n );\n } catch (\\PDOException $e) {\n echo $e->getMessage();\n die;\n }\n }\n\n return $connection;\n }", "public static function getConnection() {\n return new PDO(\"mysql:host=localhost;dbname=wikipedia\",\n 'root', '');\n }", "function openConnection(){\n\n\ttry {\n\n\t\t$dbh = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD);\n\n\t} catch (PDOException $e) {\n\n\t\t\techo 'Erro ao conectar com o MySQL: ' . $e->getMessage();\n\t}\n\n\t// Change character set to UTF-8\n\t$dbh->exec(\"set names \" . DB_CHARSET);\n\n\treturn $dbh;\n}", "private function connect()\n {\n global $config, $conn;\n if (!isset($conn))\n {\n try\n {\n $conn = new PDO('mysql:host=' . $config['mysql_hostname'] . ';dbname=' . $config['mysql_database'] . ';', $config['mysql_user'], $config['mysql_password']);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch (PDOException $e)\n {\n error_log($e->getMessage());\n print 'We were unable to connect to the database. Please check your error logs.';\n die();\n }\n }\n }", "public static function get() {\n if (static::$dbh == null) {\n // read configuration from file 'db.config.php'.\n $db = include dirname(dirname(__FILE__)).'/db.config.php';\n static::$dbh = new \\PDO($db['dsn'], $db['user'], $db['password']);\n }\n return static::$dbh;\n }", "private function getPDO(){\n\t\tif($this->db == null){\n\t\t\t$db = new PDO( 'mysql:host='.$this->db_host.';dbname='.$this->db_name.'', $this->db_user, $this->db_password);\n\t\t\t$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\t\t\t$this->db = $db;\n\t\t}\n\t\treturn $this->db;\n\t}", "public static function DBConnection(){\n\t\t\t$db_config = require_once('./config/database.php');\n\t\t\ttry {\n\t\t\t\t$mdb = new PDO(\"mysql:host=\" . $db_config['host'] . \";dbname=\" . $db_config['database'], $db_config['user'], $db_config['password'],array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n\t\t\t} catch (\\PDOException $e) {\n\t\t\t\tthrow new \\PDOException($e->getMessage(), (int)$e->getCode());\n\t\t\t}\n\n\t\t\treturn $mdb;\n\t\t}", "public function openConnection(): PDO\n {\n $driverOptions = [\n PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\",\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n ];\n\n // Try to understand what happens here\n $pdo = new PDO('mysql:host=' . Config::$dbhost . ';dbname=' . Config::$db, Config::$dbuser, Config::$dbpass, $driverOptions);\n\n // Why we do this here\n return $pdo;\n }", "public function getConnection(){\n $dsn = 'mysql:host=localhost;dbname=cart';\n $username = 'cs602_user';\n $password = 'cs602_secret';\n try{\n $dbConnection = new PDO($dsn, $username, $password);\n }catch(PDOException $e){\n $error_message = $e->getMessage();\n include('database_error.php');\n exit();\n }\n return $dbConnection;\n }", "public function getConnection(){\n \n $this->conn = null;\n $dsn=\"mysql:host=\" . $this->host . \";port=\" . $this->port . \";dbname=\" . $this->db_name;\n \n try{\n $this->conn = new PDO($dsn, $this->username, $this->password);\n //$this->conn = new PDO(\"pgsql:host=localhost;port=5432;dbname=PHP_tutorial\", $this->username, $this->password);\n \n }catch(PDOException $exception){\n echo \"Connection error: \" . $exception->getMessage() . \"\\n\";\n echo \"DSN = \" . $dsn;\n }\n return $this->conn;\n }", "private function connect(){\n $bd = new PDO(\"mysql:host=\".$this->server.\";dbname=\".$this->db, $this->userName, $this->pwd);\n return $bd;\n }", "public static function connect()\n {\n if ( null == self::$cont )\n {\n try\n {\n self::$cont = new PDO( \"mysql:host=\".self::$dbHost.\";\".\"dbname=\".self::$dbName, self::$dbUsername, self::$dbUserPassword);\n }\n catch(PDOException $e)\n {\n die($e->getMessage());\n }\n }\n return self::$cont;\n }", "public static function getConnection()\n {\n $dbLocation = $_SERVER['DOCUMENT_ROOT'].'\\\\src\\\\Demo\\\\PhpApi\\\\Config\\\\demo.db';\n\n try {\n $pdo = new \\PDO('sqlite:'.$dbLocation); \n } catch (PDOException $exception) {\n echo \"Error:\" . $exception->getMessage();\n }\n return $pdo; \n }", "private function getConnection () {\n $host = getenv('DB_HOST');\n $name = getenv('DB_NAME');\n $username = getenv('DB_USERNAME');\n $password = getenv('DB_PASSWORD');\n $conn = new PDO(\"mysql:host={$host};dbname={$name}\", $username, $password);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $conn;\n }", "private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }", "private static function _connect()\n {\n try {\n self::$_dbh = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n }\n catch (PDOException $e) {\n echo \"Failure to connect to database. \".$e->getMessage();\n }\n }", "public function getDbConnection(): PDO\n {\n return $this->dbConnection;\n }", "public function connect() {\n $params = parse_ini_file('Resources/database.ini');\n if ($params === false) {\n throw new \\Exception(\"Error reading database configuration file\");\n }\n // connect to the postgresql database\n $conStr = sprintf(\"pgsql:host=%s;port=%d;dbname=%s;user=%s;password=%s\", \n $params['host'], \n $params['port'], \n $params['database'], \n $params['user'], \n $params['password']);\n\n\t\ttry {\n\t\t\t$pdo = new \\PDO($conStr);\n\t\t\t$pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t} catch (\\PDOException $e) {\n\t\t\techo \"Error Found\" . $e->getMessage();\n\t\t}\n\n return $pdo;\n }", "public function connectToDatabase(){\n\t\t$dbinfo=$this->getDBinfo();\n\n\t\t$host=$dbinfo[\"host\"];\n\t\t$dbname=$dbinfo[\"dbname\"];\n\t\t$user=$dbinfo[\"user\"];\n\t\t\n $pass=$this->getPassword();//don't share!!\n\n try{\n $DBH = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $pass);\n $DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n }catch(PDOException $e){\n $this->processException($e);\n }\n \n $this->setDBH($DBH);\n }", "protected function _connect ()\n {\n // if we already have a PDO object, no need to re-connect.\n if ($this->_connection)\n\t\t{\n return;\n }\n\n // get the dsn first, because some adapters alter the $_pdoType\n $dsn = $this->_dsn();\n\n /*\n\n $PDOclass = 'PDO';\n\n // check for PDO extension\n if (! extension_loaded('pdo') || ! extension_loaded($this->_pdoType)) {\n $PDOclass = 'EhrlichAndreas_Pdo';\n }\n\n // check the PDO driver is available\n if (! in_array($this->_pdoType, call_user_func(array($PDOclass,'getAvailableDrivers')))) {\n /**\n *\n * @see EhrlichAndreas_Db_Exception\n */\n /* throw new EhrlichAndreas_Db_Exception('The ' . $this->_pdoType . ' driver is not currently installed');\n }\n\n */\n \n foreach ($this->_config as $key => $value)\n {\n if (stripos($key, 'user') !== false)\n {\n $this->_config['username'] = $value;\n }\n elseif (stripos($key, 'pass') !== false)\n {\n $this->_config['password'] = $value;\n }\n elseif (stripos($key, 'driver') !== false && stripos($key, 'option') !== false)\n {\n if (! isset($this->_config['driver_options']))\n {\n $this->_config['driver_options'] = $value;\n }\n else\n {\n // can't use array_merge() because keys might be integers\n foreach ((array) $value as $key => $val)\n {\n $this->_config['driver_options'][$key] = $val;\n }\n }\n }\n elseif (stripos($key, 'persistent') !== false)\n {\n $this->_config['persistent'] = $value;\n }\n elseif (stripos($key, 'charset') !== false)\n {\n $this->_config['charset'] = $value;\n }\n }\n\n // create PDO connection\n // $q = $this->_profiler->queryStart('connect',\n // EhrlichAndreas_Db_Profiler::CONNECT);\n\n // add the persistence flag if we find it in our config array\n if (isset($this->_config['persistent']) && ($this->_config['persistent'] == true))\n\t\t{\n $this->_config['driver_options'][EhrlichAndreas_Db_Abstract::ATTR_PERSISTENT] = true;\n }\n\t\t\n\t\t$pdoClass = '';\n\n try\n\t\t{\n if (extension_loaded('pdo') && in_array($this->_pdoType, PDO::getAvailableDrivers()))\n\t\t\t{\n\t\t\t\t$pdoClass = 'PDO';\n }\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pdoClass = 'EhrlichAndreas_Pdo_Pdo';\n }\n\t\t\t\n $this->_connection = new $pdoClass($dsn, $this->_config['username'], $this->_config['password'], $this->_config['driver_options']);\n\n //$this->_profiler->queryEnd($q);\n\n // set the PDO connection to perform case-folding on array keys, or\n // not\n $this->_connection->setAttribute(EhrlichAndreas_Db_Abstract::ATTR_CASE, $this->_caseFolding);\n\n // always use exceptions.\n $this->_connection->setAttribute(EhrlichAndreas_Db_Abstract::ATTR_ERRMODE, EhrlichAndreas_Db_Abstract::ERRMODE_EXCEPTION);\n }\n\t\tcatch (Exception $e)\n\t\t{\n /**\n *\n * @see EhrlichAndreas_Db_Adapter_Exception\n */\n throw new EhrlichAndreas_Db_Exception($e->getMessage(), $e->getCode(), $e);\n }\n }", "public function open_database_connection()\n {\n $server = 'blog';\n $dbname = 'blog';\n $username = 'root';\n $password = 'root';\n\n $link = new \\PDO(\"mysql:host=$server;dbname=$dbname\", $username, $password);\n\n return $link;\n }" ]
[ "0.8196476", "0.8072041", "0.8071153", "0.8012272", "0.80060107", "0.7993153", "0.79527164", "0.7938998", "0.79385185", "0.79378045", "0.79166263", "0.78928226", "0.7882845", "0.78824955", "0.7838562", "0.7831677", "0.7818302", "0.7793112", "0.77889204", "0.77851593", "0.7746584", "0.7743403", "0.77216154", "0.77102345", "0.77078414", "0.7705258", "0.76972204", "0.76921904", "0.7686374", "0.76801634", "0.76772684", "0.76422954", "0.7624566", "0.76238644", "0.76040566", "0.7592216", "0.7570801", "0.7560329", "0.7559905", "0.7555189", "0.75488585", "0.7537394", "0.752395", "0.7496418", "0.74906087", "0.7473165", "0.747008", "0.74645066", "0.74641937", "0.7451205", "0.74446195", "0.74383605", "0.74085194", "0.7407578", "0.7399597", "0.7399116", "0.7383542", "0.7375942", "0.7374136", "0.73612267", "0.735288", "0.7351927", "0.7351572", "0.73462766", "0.7342535", "0.73419523", "0.7341036", "0.73399127", "0.7326508", "0.73242015", "0.73184174", "0.7316281", "0.73025703", "0.72980016", "0.7291572", "0.7290281", "0.72797674", "0.7269403", "0.72691125", "0.7268123", "0.72627133", "0.72563756", "0.7250167", "0.7249997", "0.72457826", "0.7242681", "0.723987", "0.7225235", "0.7224433", "0.7223407", "0.7215367", "0.7212364", "0.7204652", "0.7196398", "0.71885115", "0.7186106", "0.71851087", "0.718451", "0.7183306", "0.71818995", "0.7178603" ]
0.0
-1
Check if a user is connected
function isUserConnected() { return isset($_SESSION['login']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isConnected() {\n return isset($_SESSION['userid']);\n }", "public function isConnected()\n {\n return !is_null($this->user);\n }", "public function isConnected()\n\t{\n\t\treturn $this->isUser() || $this->isOrga();\n\t}", "public function isConnected()\n\t{\n\t\t// TODO: Make this check the login functionality or something..!!\n\t\treturn true;\n\t}", "public function hasUserConnected() {\n $accessToken = get_option(self::ACCESS_TOKEN_OPTION_NAME);\n\n return !empty($accessToken);\n }", "public function hasUserConnected() {\n $accessTokenIG = get_option( self::INSTAGRAM_TOKEN_LONG_LIVED_TIME );\n $accessTokenFB = get_option( self::FACEBOOK_TOKEN );\n\n return ! empty( $accessTokenIG ) || ! empty( $accessTokenFB );\n }", "public function isConnected()\n {\n if ($this->connect) {\n return $this->connect;\n }\n if (!empty($_SESSION[ 'token_connected' ])) {\n if (!($user = $this->getUserActivedToken($_SESSION[ 'token_connected' ]))) {\n return false;\n }\n\n $this->connect = $_SESSION[ 'token_connected' ] == $user['token_connected']\n ? $user\n : false;\n\n return $this->connect;\n }\n\n return false;\n }", "function isConnected(): bool\n {\n if (isset($_COOKIE['sid'])) {\n $db = connect('localhost', 'membre', 'root', 'root', true);\n $req = $db->prepare(\"SELECT sid FROM users WHERE sid = :sid LIMIT 1\");\n $req->execute([\n \"sid\" => $_COOKIE['sid']\n ]);\n if ($req->rowCount() > 0) {\n return true;\n }\n }\n return false;\n }", "public function is_connected($user_id){\n return (bool) get_user_meta($user_id, $this->umeta_id, true);\n }", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "public function isConnected();", "function isConnected(){\n $connected = FALSE;\n if($_SESSION['level']>0){\n $connected = TRUE;\n }\n return $connected;\n }", "public function isConnected() {}", "public function isConnected() {}", "public function isConnected() {}", "function userConnect(){\r\n if (isset($_SESSION['user'])) {\r\n return TRUE;\r\n }else{\r\n return FALSE;\r\n }\r\n // if(isset($_SESSION['user'])) return TRUE; else return FALSE;\r\n }", "function connected(){\n\treturn (isset($_SESSION['id']));\n}", "public function isConnected()\n {\n $oConfig = oxRegistry::getConfig();\n\n if (!$oConfig->getConfigParam(\"bl_showFbConnect\")) {\n return false;\n }\n\n if ($this->_blIsConnected !== null) {\n return $this->_blIsConnected;\n }\n\n $this->_blIsConnected = false;\n $oUser = $this->getUser();\n\n if (!$oUser) {\n $this->_blIsConnected = false;\n\n return $this->_blIsConnected;\n }\n\n $this->_blIsConnected = true;\n try {\n $this->api('/me');\n } catch (FacebookApiException $e) {\n $this->_blIsConnected = false;\n }\n\n return $this->_blIsConnected;\n }", "public function isOnline() {\n\t\tif(check($this->_username)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_CONNSTAT_.\" FROM \"._TBL_MS_.\" WHERE \"._CLMN_USERNM_.\" = ? AND \"._CLMN_CONNSTAT_.\" = ?\", array($this->_username, 1));\n\t\t\tif(!is_array($result)) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$accountData = $this->getAccountData();\n\t\tif(is_array($accountData)) {\n\t\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_CONNSTAT_.\" FROM \"._TBL_MS_.\" WHERE \"._CLMN_USERNM_.\" = ? AND \"._CLMN_CONNSTAT_.\" = ?\", array($accountData[_CLMN_USERNM_], 1));\n\t\t\tif(!is_array($result)) return;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn;\n\t}", "public function isLoggedIn(){\n\t\tif(!$this->connected){\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->apiCall('checklogin');\n\t}", "public function is_connected() {\n return !!$this->get_access_token();\n }", "public function isConnected(): bool;", "public function isConnected(): bool;", "public function isConnected(): bool;", "function is_user_connected_with($service){\n\tglobal $user_ID;\n\tswitch($service){\n\t\tcase 'facebook':\n\t\t\treturn (boolean) get_facebook_id($user_ID);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn false;\n\t\t\tbreak;\n\t}\n}", "abstract protected function connected($user);", "abstract protected function connected($user);", "public function isConnected():bool;", "abstract public function isConnected();", "abstract public function isConnected();", "abstract function isConnected();", "public function isConnected()\n {\n if($this->is_connected)\n {\n return true;\n }\n else{\n return false;\n }\n }", "function userConnecte(){\n\tif(isset($_SESSION['membre'])){\n\t\treturn TRUE;\n\t}\n\telse{\n\t\treturn FALSE;\n\t}\n}", "public function isConnected() {\n if ($this->client) {\n $this->client->isConnected();\n }\n }", "public function is_connected() {\n\t\treturn true;\n\t}", "function isConnected(){\n if(isset( $_SESSION['user_login'],$_SESSION['password'])){\n return true;\n }\n\t\t//sinon return false \n else{\n return false;\n }\n }", "public function _isConnected()\n {\n /* If either one of the user or pass vars are empty, then return false; */\n if (empty($this->_USER)) {\n return false;\n }\n\n /* Are we authenticated? */\n if ($this->_data[ strtolower($this->_USER) ] != md5($this->_PASS)) {\n return false;\n }\n\n return true;\n }", "public function isConnected(){\n\n if (is_a($this->resourceId,\"mysqli\")) {\n return mysqli_ping($this->resourceId);\n }\n return false;\n }", "protected function connected($user)\n\t{\n\t}", "public function isOnline() {}", "static public function is_connected()\n {\n return R::testConnection();\n }", "function isConnected()\n\t{\n\t\tif($this->connected) return true;\n\t\telse\t\t return false;\n\t}", "public function isConnected(): bool\n {\n }", "public function isConnected()\n {\n return true;\n }", "public function isOnline()\n\t{\n\t\t$server = new Application_Model_Server();\n\t\t$players = $server->getOnlinePlayers();\n\t\t\n\t\tforeach ($players as $player)\n\t\t{\n\t\t\tif ($player == $this->getUsername()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "protected function isConnect()\n {\n if($_SESSION['statut'] !== 'user' AND $_SESSION['statut'] !=='admin')\n {\n header('Location: index.php?route=front.connectionRegister&access=userDenied');\n exit;\n }\n }", "final public function connected() {\n if (is_a($this->resourceId,\"mysqli\")) {\n return mysqli_ping($this->resourceId);\n }\n return false;\n }", "public function isOnline(): bool\n {\n return app(UserActivityService::class)->isOnline($this);\n }", "function isConnected()\n{\n return isset($_SESSION[\"userDataFileName\"]);\n}", "function ifconnect(){\n\tif(isset($_SESSION['ID'])){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function is_connected(){\n\t\tif (!isset($_SESSION['statut'])) {\n\t\t\t?>\n <script>\n window.location=\"index.php\";\n </script>\n <?php\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}", "function is_connected()\n {\n static $isConnected = null;\n if ($isConnected !== null) {\n return $isConnected;\n }\n $isConnected = false;\n $connection = env('IS_CONNECTED', true) ? @fsockopen('www.google.com', 80) : null;\n if ($connection) {\n fclose($connection);\n $isConnected = true;\n }\n\n return $isConnected;\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "public function hasUser();", "public function isConnected()\n {\n return isset($this->conn);\n }", "public function isConnected()\n {\n return $this->manager->isConnected();\n }", "public function isOnline() {\n\t\tif ($this->lastActivityTime && $this->lastActivityTime > (TIME_NOW - USER_ONLINE_TIMEOUT) && (WCF::getUser()->userID == $this->userID || !$this->invisible || WCF::getUser()->getPermission('admin.general.canViewInvisible') || ($this->invisible == 2 && UserProfile::isBuddy($this->userID)))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isConnected() {\n\t\treturn isset($this->conn);\n\t}", "public function isConnected() {\n\t\treturn isset($this->conn);\n\t}", "public function connected()\n\t{\n\t\treturn $this->CLI->boolQuery($this->SqueezePlyrID.\" connected ?\");\n\t}", "public function isConnected()\n\t{\n\t\treturn ( $this->_connected == true ) ? true : false;\n\t}", "function isConnectedTo($profile_id, $account){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM connect_list WHERE profile_id= :profile_id AND accountID=:account');\n\t\t$statement->execute(array(':profile_id' => $profile_id, ':account'=>$account));\n\t\tif($statement->rowCount() == 0)\n\t\t\treturn false;\n\t\treturn $statement->fetch();\n\t}", "public function userIsInstalledAndConnected(AyiUser $user){\r\n\t\treturn $user->hasPlatform(Config::DEVICE_FACEBOOK) && $this->isCurrentlyFBConnected();\r\n\t}", "public function isOnline() {\n }", "public function IsConnected()\r\n\t{\r\n\t\tif( gettype( $this->db_link ) == 'resource' )\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function isConnected()\n {\n return $this->connection->isConnected();\n }", "public function isOnline() \n {\n // pings example.com and google.com\n $is_conn = null;\n $connected1 = @fsockopen(\"www.example.com\", 80); //website, port (try 80 or 443)\n $connected2 = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n // if either is successful\n if ($connected1 || $connected2){\n $is_conn = true; //action when connected\n fclose($connected1);\n fclose($connected2);\n }else{\n $is_conn = false; //action in connection failure\n }\n return $is_conn;\n }", "public function is_connected()\n {\n $result = @$this->mcache->getExtendedStats();\n $canconnect = false;\n\n if($result) {\n foreach($result as $server => $stats) {\n if($stats) {\n $canconnect = true;\n break;\n }\n }\n }\n \n return $canconnect;\n }", "private function checkUserLoggedIn(): bool\n {\n $user = JFactory::getUser();\n if ($user->id > 0) {\n return true;\n } else {\n return false;\n }\n }", "function is_connected()\n\t{\n\t\t$connected = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n\t\tif ($connected){\n\t\t \t$is_conn = true; //action when connected\n\t\t\tfclose($connected);\n\t\t}else{\n\t\t\t$is_conn = false; //action in connection failure\n\t\t}\n\t\treturn $is_conn;\n\n\t}", "public function isConnected()\n {\n return isset($this->connection);\n }", "function checkLogin(){\n global $database; //The database connection\n\n /* Username and userid have been set and not guest */\n if(isset($_SESSION['username'])){\n return true;\n }\n /* User not logged in */\n else{\n return false;\n }\n }", "public function logged_in()\n\t{\n\t\t$status = FALSE;\n\n\t\t// Get the user from the session\n\t\t$user = $this->_session->get($this->_config['session_key']);\n\n\t\tif ( ! is_object($user))\n\t\t{\n\t\t\t// Attempt auto login\n\t\t\tif ($this->auto_login())\n\t\t\t{\n\t\t\t\t// Success, get the user back out of the session\n\t\t\t\t$user = $this->_session->get($this->_config['session_key']);\n\t\t\t}\n\t\t}\n\n\t\t// check from DB if set in config\n\t\tif ($this->_config['strong_check'])\n\t\t{\n\t\t\t$user = $this->_get_object($user, TRUE);\n\t\t}\n\n\t\tif (is_object($user)\n\t\t\tAND is_subclass_of($user, 'Model_MangoRauth_User')\n\t\t\tAND $user->loaded()\n\t\t\tAND $user->is_active\n\t\t)\n\t\t{\n\t\t\t// Everything is okay so far\n\t\t\t$status = TRUE;\n\t\t}\n\n\t\treturn $status;\n\t}", "function isUserLoggedin() \n {\n $stmt = self::$_db->prepare(\"SELECT count(id_user) AS c FROM user WHERE session=:sid\");\n $sid = session_id();\n $stmt->bindParam(\":sid\", $sid);\n $stmt->execute();\n $count = $stmt->fetch()[\"c\"];\n if($count == 1)\n {\n return \"true\";\n }\n else if($count < 1)\n {\n return \"false\";\n }\n else\n {\n return \"Error: More then one identical User could be logged in!\";\n }\n }", "public function IsConnected()\n {\n if (isset($this->db) && is_object($this->db) && $this->db->IsConnected()) {\n return true;\n }\n return false;\n }", "public function isConnected()\n {\n return $this->_conn !== null;\n }", "public static function isConnected()\n\t{\n\t\treturn (self::$connection !== NULL) && self::$connection->isConnected();\n\t}", "function checkUser($name, $password) {\n\t$id = checkUserBdd($name, $password);\n\n\tif ($id) {\n\t\t$_SESSION[\"name\"] = $name;\n\t\t$_SESSION[\"userId\"] = $id;\n\t\t$_SESSION[\"connected\"] = true;\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function isOnline(): bool\n {\n return Cache::has('user-is-online-' . $this->id);\n }", "public function isConnected()\n {\n return $this->connected;\n }", "public function isLoggedIn()\n {\n return isset($_SESSION['user']);\n }", "function logged_on(){\n global $mysqli;\n if(isset($_SESSION['user'])) {\n $token = addslashes($_SESSION['user']['token']);\n $username = addslashes($_SESSION['user']['name']);\n\n $sql = \"SELECT * FROM user WHERE username = '\" . $username . \"' AND token = '\" . $token . \"'\";\n $result = $mysqli->query($sql);\n if ($result->num_rows != 0) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function isConnected()\n\t{\n\t\treturn $this->isConnected;\n\t}", "public function aim_connected()\r\n\t{\r\n\t\tif (is_resource($this->resource)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('Unable to find active connection');\r\n\t\t}\r\n return false;\r\n\t}", "public function connected()\n {\n return ($this->connected === true);\n }", "public function isConnected()\n {\n if ($this->db == null) {\n return false;\n }\n\n return $this->db->IsConnected();\n }", "public function isOnline(): bool\n {\n return Cache::has('user-is-online-'.$this->id);\n }", "public function connected()\n {\n return true;\n }", "public function isOnline($uname,$pass){\n\t\t$user = $this->find('first',array('user_name'=>$uname,'password'=>$pass));\n\t\tif(!empty($user)){\n\t\t\treturn $user['User']['online_flag']== 1;\n\t\t}\t\t\n\t}", "public function showFbConnectToAccountMsg()\n {\n if ($this->getConfig()->getRequestParameter(\"fblogin\")) {\n if (!$this->getUser() || ($this->getUser() && $this->getSession()->getVariable('_blFbUserIdUpdated'))) {\n return true;\n } else {\n return false;\n }\n }\n\n return false;\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "public function isConnected()\n\t{\n\t\treturn $this->_connected;\n\t}", "function isConnected() {\n return $this->_connected;\n }", "function isUserLogged() {\r\n return isset($_SESSION['user']);\r\n }", "public function isConnected() {\n return $this->imap !== false;\n }" ]
[ "0.8402092", "0.80747235", "0.79580766", "0.78470385", "0.77818215", "0.76947135", "0.7659931", "0.761254", "0.75477266", "0.74747294", "0.74747294", "0.74747294", "0.74747294", "0.74747294", "0.74747294", "0.744486", "0.7444482", "0.7443368", "0.7443368", "0.7426949", "0.73663515", "0.73422426", "0.72501767", "0.721827", "0.7217384", "0.72134423", "0.72134423", "0.72134423", "0.71912056", "0.715608", "0.715608", "0.7149986", "0.7055687", "0.7055687", "0.7037619", "0.7030759", "0.7023365", "0.70196366", "0.70044285", "0.69963855", "0.6995665", "0.6978212", "0.6976154", "0.6972072", "0.69644725", "0.69049793", "0.68819535", "0.6863454", "0.68370247", "0.68352485", "0.68258435", "0.6813559", "0.68031716", "0.67763627", "0.6746613", "0.6723944", "0.6709738", "0.67025864", "0.66979915", "0.66914314", "0.6685231", "0.666162", "0.666162", "0.66599864", "0.6655623", "0.6646106", "0.66415393", "0.6626796", "0.6608839", "0.6604631", "0.65956914", "0.65796244", "0.65789276", "0.6566155", "0.65657896", "0.6555632", "0.65499616", "0.6544829", "0.65370226", "0.6532518", "0.6517234", "0.6510246", "0.65088016", "0.65037024", "0.6498745", "0.64974064", "0.64861107", "0.6474531", "0.64737624", "0.64651585", "0.6459925", "0.6457534", "0.6457265", "0.64563996", "0.6453303", "0.6453303", "0.64419377", "0.64336956", "0.6433635", "0.6431782" ]
0.775285
5
Check if a user is an administrator
function isUserAdmin() { if (isUserConnected()) { return ($_SESSION['role']=='administrateur'); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isAdminUser() {}", "public function getIsAdministrator() {}", "function isUserAdmin() {\r\n $user = $_SESSION['user'];\r\n return checkAdminStatus($user);\r\n }", "public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "function is_user_admin()\n {\n }", "private function isAdmin() {\n\t\tif (Auth::user()->user == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }", "public function isAdministrator()\n\t{\n\t\treturn ($this->flags & self::ADMINISTRATOR) == self::ADMINISTRATOR;\n\t}", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function isAdmin(){\n if($this->role->name = 'Administrator'){\n return true;\n }\n return false;\n }", "public function isAdmin()\n {\n return ($this->username === \"admin\");\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "public function isAdmin()\n {\n return $this->role == 'Administrator' ? true : false;\n }", "public function isAdministrator() {\n\t $adminuserId = Mage::getSingleton('admin/session')->getUser()->getUserId();\t \n\t $role_data = Mage::getModel('admin/user')->load($adminuserId)->getRole()->getData();\n\t \n\t return in_array(self::ADMIN_ROLE_NAME, $role_data);\n\t}", "function isAdmin() {\n return ($this->userType == 'admin');\n }", "function isAdmin(){\n\t\treturn ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME);\n\t}", "public function checkIsAdmin()\n {\n return $this->user_admin;\n }", "public function IsAdministrator() {\n\t\t$user = self::GetUserProfile();\n\t\t$ifAdmin = false;\n\t\t\n\t\tif($this->IsAuthenticated()) {\n\t\t\tforeach($user['groups'] as $val) {\n\t\t\t\tif($val['akronym'] == 'admin')\n\t\t\t\t\t$ifAdmin=true;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $ifAdmin;\n\t}", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "public function isAdmin()\n {\n return $this->hasCredential('admin');\n }", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "public function isAdmin()\n {\n if (strtolower($this->name) == 'administrator')\n {\n return true;\n }\n\n return false;\n }", "function _lean_is_admin() {\n global $user;\n if (in_array('administrator', array_values($user->roles))) {\n return true;\n } else {\n return false;\n }\n}", "public function isAdministrator() {\n\n return ($this->getLevel() === self::LEVEL_ADMINISTRATOR);\n\n }", "function isAdmin() {\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isOnlyAdministrator() {\n return $this->isAdministrator() && (Users::countAdministrators() == 1);\n }", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "protected function userIsAdmin ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n\n if($datosUsers->nombre==\"admin\")\n {\n return true;\n }\n else\n {\n return false;\n } \n }", "public function isAdmin() {\n return ($this->userlevel == ADMIN_LEVEL ||\n $this->username == ADMIN_NAME);\n }", "public function isAdmin()\n {\n return $this->role == 1;\n }", "public function isUserAdmin()\n\t{\n\t if ($this->isAdmin()) {\n\t \treturn true;\n\t }\n\t \n\t $permissions = $this->group->permissions;\n\t \n\t return array_key_exists('system', $permissions)\n\t && in_array('user', $permissions['system']);\n\t}", "public function isAdmin();", "public function isAdmin(){\n if($this->role->name == 'Administrator' && $this->is_active == 1){\n return true;\n }\n return false;\n }", "public function isAdmin()\n {\n return $this->isSuperUser() || $this->isMemberOf('admin');\n }", "public function isAdmin()\n {\n return ($this->role == 1) ? true : false;\n }", "public function isAdmin(){\n if($this->role==\"admin\"){\n return true;\n }\n return false;\n }", "public function isAdmin()\n {\n return ((string) strtoupper($this->data->user_role) === \"ADMIN\") ? true : false;\n }", "function isAdministrator() {\n if($this->is_administrator === null) {\n $this->is_administrator = $this->getSystemPermission('admin_access');\n } // if\n return $this->is_administrator;\n }", "public static function isAdmin()\n {\n if (Yii::$app->user->isGuest) {\n return false;\n }\n $model = User::findOne(['username' => Yii::$app->user->identity->username]);\n if ($model == null) {\n return false;\n } elseif ($model->id_user_role == 1) {\n return true;\n }\n return false;\n }", "public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }", "public function isAdmin()\n {\n return ($this->type === User::ADMIN_USER);\n }", "function isAdmin()\n\t{\n\t\treturn $this->role == 3;\n\t}", "public function isAdministrator(){\n return $this->is_admin;\n }", "public static function isAdmin(): bool {\n if ($user = self::user() && self::user()->isAdmin) {\n return true;\n }\n return false;\n }", "static function getIsAdmin() {\n\t\t$user = ctrl_users::GetUserDetail();\n\t\tif($user['usergroupid'] == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function is_user_admin($user) {\n return $user['user_admin'] == 1;\n }", "public function isAdministrator()\n {\n return $this->role ? $this->role->name === Role::NAME_ADMINISTRATOR : false;\n }", "public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }", "private function checkUserAdministrator():bool\n {\n $user = JFactory::getUser();\n if (in_array(8, $user->groups)) {\n return true;\n }\n return false;\n }", "public function is_admin()\n {\n $drupal_user = user_load($this->uid);\n if (in_array('administrator', array_values($drupal_user->roles))) {\n return true;\n }\n return false;\n }", "public function isAdmin() {}", "private function isAdmin() : bool\n {\n return $this->user->hasRole('admin');\n }", "public function isAdministrator()\n {\n return $this->hasRole(RoleInterface::ROLE_ADMINISTRATOR);\n }", "public function isAdmin() {\n return $this->admin; // cerca la colonna admin nella tabella users\n }", "private function isAdmin() : bool\n {\n return $this->role('admin');\n }", "public function is_admin()\n\t{\n\t\t$user = $this->get_current_user();\n\t\tif($user !== NULL)\n\t\t{\n\t\t\tif($user['auth'] == 255)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function isAdmin() {\n return $this->hasPermission('is_admin');\n }", "public function getIsAdmin();", "public function getIsAdmin();", "function userIsWikiAdmin() {\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->wikiAdmin(Yawp::authUsername());\n\t}", "private function isAdmin() {\n\t\t$user = $this->userSession->getUser();\n\t\tif ($user !== null) {\n\t\t\treturn $this->groupManager->isAdmin($user->getUID());\n\t\t}\n\t\treturn false;\n\t}", "function is_admin_user($user) {\n\tif (!elgg_instanceof($user, 'user')) {\n\t\treturn false;\n\t}\n\n\treturn elgg_is_admin_user($user->guid);\n}", "public function getIsAdministrator()\n {\n return $this->is_administrator;\n }", "public function IsAdmin() {\n\t\t\treturn $this->intPersonTypeId == PersonType::Administrator;\n\t\t}", "public function isAdmin()\n {\n return $this->role == 'admin';\n }", "function getIsAdmin(){\n\t\treturn ( $this->user && $this->user->access_level >= User::LEVEL_ADMIN );\n\t}", "public function isAdmin(){\n $role = $this->role->type;\n\n return $role === 'admin';\n }", "public static function isAdmin()\n\t{\n\t\treturn in_array( Auth::user()->username, Config::get( 'admin.usernames' ) );\n\t}", "function isAdmin() {\n\tif (isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'admin' ) {\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function isAdministrator($user) {\n if (isset($user['role']) && $user['role'] === 'admin') {\n return true;\n }\n // Default deny\n return false;\n }", "public function isAdmin()\n {\n foreach($this->roles as $role)\n {\n if ($role==='administrator')\n {\n return true;\n }\n }\n return false;\n }", "public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "public function isAdmin()\n {\n // Look for value only if not already set\n if(!isset($this->isAdmin)) {\n $us = SemanticScuttle_Service_Factory::get('User');\n $this->isAdmin = $us->isAdmin($this->username);\n }\n return $this->isAdmin;\n }", "public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}", "public function isAdmin()\n {\n return $this->getAttribute('type') === User::ADMIN_TYPE;\n }", "function _isUserAdmin(){\n\n $output = 0;\n $userId = $this->session->userdata('userId');\n $user = $this->User_model->getUserByUserId($userId);\n $userRoleId = $user->user_roles_id;\n $userRole = $this->Roles_model->getUserRoleById($userRoleId);\n if($userRole->role === 'admin'){\n $output = 1;\n }\n return $output;\n }", "function iAmAdmin(){\n $adminIDs = Array( 1, 2 );\n \n return in_array( $_SESSION['userid'], $adminIDs );\n }", "public function memberIsAdmin()\n {\n return $_SESSION['__COMMENTIA__']['member_role'] === 'admin';\n }", "public static function isAdmin()\n {\n return auth()->check() && auth()->user()->panichd_admin;\n }", "public static function isAdmin()\n {\n \t$user = Session::get('loginuser');\n \tif ($user == env('ADMINEMAIL')) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "public function isAdmin()\n {\n return $this->user_role === User::ROLE_ADMIN;\n }", "public function hasadmin()\n {\n return $this->hasuser() && $this->user()->isadmin();\n }", "public function IsAdmin ();", "function is_admin()\n{\n global $app;\n if (is_authenticated()) {\n $user = $app->auth->getUserData();\n return ($user['role'] === '1');\n } else {\n return false;\n }\n}", "public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }", "public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }", "function isAdmin(){\n$user = $this->loadUser(Yii::app()->user->user_id);\nreturn intval($user->user_role_id) == 1;\n}", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "public static function isAdmin(): bool\n {\n $user = self::getUser();\n\n // $user->admin (check if user is admin in database - set to 1)\n if (!$user || !$user->admin) {\n return false;\n }\n\n return true;\n }", "protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}", "protected static function isAdminUser() {\r\n throw new \\Excpetion('yet to implement');\r\n }", "public function isAdmin()\n {\n return (\\Auth::user()->role == 'admin');\n }", "function isAdmin() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 1) {\n return true;\n } else {\n return false;\n }\n }", "public function isAdmin($user) {\n if ($this->loggedIn($user)) \n if ($user->getRights() > 0)\n return true;\n \n return false; \n \n }", "public function isAdmin(): bool\n {\n return $this->is_admin === true;\n }" ]
[ "0.8493227", "0.8391456", "0.82754", "0.82256925", "0.81921107", "0.8190856", "0.81723654", "0.8122886", "0.81215125", "0.81191343", "0.8094995", "0.8094995", "0.8088078", "0.8073127", "0.8070395", "0.8063564", "0.8050442", "0.8032958", "0.80081433", "0.80059457", "0.8001801", "0.7999915", "0.7997502", "0.7993425", "0.79840606", "0.7983167", "0.7978817", "0.7963346", "0.7952984", "0.79089093", "0.79045", "0.78969145", "0.7877675", "0.7876015", "0.7871821", "0.7871502", "0.7869109", "0.7864599", "0.78613615", "0.78565395", "0.7853714", "0.7847846", "0.78410023", "0.7839537", "0.783505", "0.78107816", "0.780682", "0.7803076", "0.78002995", "0.7796849", "0.7790133", "0.7784896", "0.77815026", "0.77800304", "0.77758485", "0.7771889", "0.77661204", "0.7763591", "0.77616626", "0.7752718", "0.7751847", "0.7741332", "0.7741332", "0.7735671", "0.77318525", "0.77304596", "0.77205396", "0.77182055", "0.7711602", "0.77064097", "0.7704892", "0.77030736", "0.77003837", "0.76698226", "0.76692283", "0.76658046", "0.7661468", "0.7658042", "0.7649718", "0.76446027", "0.7644131", "0.76432467", "0.7641442", "0.76391447", "0.7638726", "0.76383346", "0.7630594", "0.762639", "0.7625266", "0.7624639", "0.7617227", "0.7615156", "0.7612217", "0.76053715", "0.76034087", "0.75999707", "0.759526", "0.7586529", "0.7580421", "0.75766546", "0.75726867" ]
0.0
-1
Check if the offer was posted by the user
function isMyOffer($offerId){ if (isUserConnected()){ $result = getDb()->query("SELECT * FROM `personne` WHERE `login` = '".$_SESSION['login']."'"); $personne = $result->fetch(); $stmt = getDb()->prepare('SELECT * FROM `creer` WHERE `offre_id`= ? AND `personne_id`= ?'); $stmt->execute(array($offerId, $personne['personne_id'])); if($stmt->rowCount() >=1) { return true; } else{ return false; } } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPost();", "public function isPost(): bool {}", "function isSubmittedBy();", "public function isExistingReview(): bool\n {\n $review = ShopFeedbackEntity::findOne([\n 'created_by' => (!isset(Yii::$app->request->post()['created_by']))\n ? Yii::$app->user->identity->getId() : Yii::$app->request->post()['created_by'],\n 'shop_id' => Yii::$app->request->post()['shop_id']]);\n if (!$review) {\n $this->addError('created_by',\n Yii::t('app', 'Отзыв не найден'));\n return false;\n } else {\n return true;\n }\n }", "public function hasPostAuthentication()\n {\n return isset($this->sessionStorage->user['twofactor_activated']) && $this->sessionStorage->user['twofactor_activated'] === true;\n }", "public function posted()\n {\n if (empty($this->post)) {\n return false;\n }\n\n return true;\n }", "public function canPost()\n {\n $role = $this->role;\n if($role == 'author' || $role == 'admin')\n {\n return true;\n } else {\n return false;\n }\n }", "function isPost() {\r\n\t\treturn $this->isPost;\r\n\t}", "public function getHasSubmitted() {\n\t\t@$cookie = $_COOKIE['promotion_' . $this->getId()];\n\t\treturn (bool) $cookie;\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/mfb_myflyingbox/offer');\n }", "protected function test() {\n $output = true;\n $results = $this->env->post_to_api(\n \"add-post\",\n $this->state[\"fields\"], $this->state[\"files\"]\n );\n if (!$results) {\n $output = false;\n } else if (property_exists($results, \"error\")) {\n echo \"{$results->error}\\n\";\n echo \"Failed to add post (API Level).\\n\";\n $output = false;\n } else if (!Post::get_by_id($results->post->id)) {\n echo \"Failed to add post (Database Level).\\n\";\n $output = false;\n } else if (!$results->post->is_upvoted) {\n echo \"The new post is not upvoted by the logged in user.\\n\";\n $output = false;\n }\n return $output;\n }", "public function isRejected()\n {\n return ($this->slug == \"afgekeurd\");\n }", "private function requested_post_is_valid(){\n return (get_post_type((int) $_GET['post_id']) === $this->post_type && get_post_status((int) $_GET['post_id']) === 'publish');\n }", "public function accept_button_is_hidden_when_post_is_already_answered()\n {\n $comment = factory(\\App\\Comment::class)->create();\n $comment->markAsAnswer();\n\n $this->actingAs($comment->post->user);\n\n $this->visit($comment->post->url);\n\n $this->dontSee('Aceptar respuesta');\n\n\n\n }", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function isPost()\n {\n $request = $this->getRequest();\n return $request->isPost();\n }", "public function isPubliclyAvailable() {\n $id = $this->getID();\n $the_post = $this->find('first', array(\n 'conditions' => array(\n 'Post.id' => $id,\n ),\n 'fields' => array(\n 'Post.enabled',\n 'Post.published',\n ),\n 'recursive' => -1,\n 'callbacks' => false,\n ));\n\n $invalid_post = empty($the_post);\n\n// Don't try to process any more logic unless we know the Post even exists.\n if ($invalid_post) {\n return false;\n }\n\n $disabled_post = $the_post['Post']['enabled'] === false;\n $unpublished_post = new DateTime($the_post['Post']['published']) > new DateTime();\n\n if ($disabled_post || $unpublished_post) {\n return false;\n }\n else {\n return true;\n }\n }", "protected function submitted ($post)\n\t{\n\t\treturn isset ($post['BoothNum']);\n\t}", "public function isReviewed() {\n\t\t$this->getReviewed();\n\t}", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "public function isPost(): bool \r\n {\r\n return $this -> method() === 'POST' ? true : false;\r\n }", "public static function isPosted()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n return true;\n } else {\n return false;\n }\n }", "function isRedeemed() {\n // we get if it wasn't used yet\n return $this->getUsed_at() != '';\n }", "public function isSubmitted();", "public function only_post_user_can_answered_his_post()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $policy = new CommentPolicy();\n\n $policy->accept($comment->post->user,$comment);\n\n $this->assertTrue($policy->accept($comment->post->user,$comment));\n }", "public function isPostLeeg()\n {\n return empty($_POST);\n }", "public function _action_global_post_is_available() {\n\t\tglobal $post;\n\n\t\t$this->accept_feedback = $post && post_type_supports( get_post_type( $post->ID ), $this->supports_feature_name );\n\n\t\tif ( ! ( $this->accept_feedback && $this->user_bought_product() ) ) {\n\t\t\treturn;\n\t\t}\n\t}", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n // パラメータのIDからで削除対象のリプライを取得\n $post = Post::find($this->route(\"id\"));\n // if ($reply == null) return false;\n\n return $post && $this->user()->id == $post->user_id ? true : false;\n }", "public function is_valid() {\n return !empty( $this->post ) && YITH_WCBK_Post_Types::$booking === $this->post->post_type;\n }", "public function isRedeemed()\n\t{\n\t\tif (!$this->exists())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->get('redeemed_by'))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isPost() {\n return $this->post;\n }", "public function is_post() {\n return $this->method == 'post';\n }", "public function isPostSubmit(){\n if( strtolower($this->__method) == \"post\" ){\n return true;\n }\n return false;\n }", "public function isAccepted()\n {\n return !empty($this->acceptee_id);\n }", "public function getAnsweredAttribute()\n {\n return $this->postsCount() > 0;\n }", "public function post()\n {\n return count($_POST) > 0;\n }", "public function isPost()\n {\n return $this->getMethod() == 'POST';\n }", "public function isPost(): bool {\n return $this->method === self::POST;\n }", "public function isPost() {\n return $this->method == 'POST';\n }", "public static function isPost(): bool {\r\n return static :: isMethod('post');\r\n }", "public function isPost()\n {\n return $this->method === self::METHOD_POST;\n }", "public function isPost()\n {\n return $this->getMethod() === 'POST';\n }", "public function isPost()\n {\n return $this->getMethod() === 'POST';\n }", "public function has_postcard() {\n return (bool) $this->get_postcard();\n }", "public function allowedToPost($user)\n {\n /*\n * When an invalid (reserved) username is used, prevent\n * posting\n */\n if (!$this->validUsername($user['username'])) {\n return false;\n } // if\n\n // Als de user niet ingelogged is, dan heeft dit geen zin\n if ($user['userid'] <= SPOTWEB_ADMIN_USERID) {\n return false;\n } // if\n\n return true;\n }", "public function isPost()\n\t{\n\t\treturn $this->httpMethod() == self::MethodPost;\n\t}", "public function isPost() :bool\n {\n return $this->getMethod() === 'POST';\n }", "public function isPost() {\n return $this->method == self::METHOD_POST;\n }", "public function is_premium()\n {\n $cookie_manager = new CookieManager();\n if ($cookie_manager->validate_cookie($this->post_id)) {\n return true;\n } else {\n return false;\n }\n }", "public function isPost()\n {\n return (strtoupper($this->method) === self::METHOD_POST);\n }", "public function isPost()\n {\n return $this->getMethod() === self::METHOD_POST;\n }", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "public function isPost(): bool\n {\n return $this->getMethod() === self::METHOD_POST;\n }", "public function isPost() {\n if($this->method === 'POST') {\n return true;\n } else {\n return false;\n }\n }", "public function hasPost(string $name): bool {}", "protected function isOfferValid ()\n {\n return $this->offerApplicableAmount >= $this->offer->minimum_order_amount;\n }", "public static function is_submitting(){\n\t\treturn (strcasecmp('POST', $_SERVER['REQUEST_METHOD'] ) == 0);\n\t}", "public function isPost()\n {\n return $this->getRequestMethod() === 'POST';\n }", "public function getIsPost()\n {\n return $this->getMethod() === 'POST';\n }", "public function getIsPost()\n {\n return $this->getMethod() === 'POST';\n }", "public function isPost()\n {\n if ($this->getRequestMethod() === 'POST') {\n return true;\n }\n\n return false;\n }", "public function isPost()\n {\n return $this->isMethod('POST');\n }", "public function isPost()\n {\n return $this->isMethod('POST');\n }", "public function isPost()\n {\n return ($this->_array['method'] == \"POST\");\n }", "public function isPosted()\n\t{\n\t\treturn (! empty($_POST['change_password']));\n\t}", "public function assertSentToVoted()\n {\n return (null !== $this->votesYes && null !== $this->votesNo) ? true : false;\n }", "public static function posted() {\n\t\treturn isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST';\n\t}", "public function isSubmit() {\n return Tools::isSubmit($this->key());\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "private function publishOffer() {\n if ($this->Session->check('addOffer')) {\n\n // salvando oferta\n $params ['Offer'] = $this->Session->read('addOffer.Offer');\n\n if ($params ['Offer'] ['parcels'] == 1) {\n $params ['Offer'] ['parcels'] = 'ACTIVE';\n\n if ($params ['Offer'] ['parcels_off_impost'] == 1)\n $params ['Offer'] ['parcels_off_impost'] = 'ACTIVE';\n else\n $params ['Offer'] ['parcels_off_impost'] = 'INACTIVE';\n } else {\n $params ['Offer'] ['parcels'] = 'INACTIVE';\n $params ['Offer'] ['parcels_off_impost'] = 'INACTIVE';\n }\n\n $params ['Offer'] ['company_id'] = $this->Session->read('CompanyLoggedIn.Company.id');\n $params ['Offer'] ['status'] = 'ACTIVE';\n\n $params ['Offer'] ['begins_at'] = $this->Utility->formataData($params ['Offer'] ['begins_at']);\n $params ['Offer'] ['ends_at'] = $this->Utility->formataData($params ['Offer'] ['ends_at']);\n\n // trabalhando especificacao e descricao para insert no banco\n $params ['Offer'] ['description'] = strip_tags($params ['Offer'] ['description'], '<a><strong><p><br><b><li><ul><img>');\n $params ['Offer'] ['specification'] = strip_tags($params ['Offer'] ['specification'], '<a><strong><p><br><b><li><ul><img>');\n\n // $params['Offer']['description'] = substr($params['Offer']['description'], 0, 1000);\n // $params['Offer']['specification'] = substr ($params['Offer']['specification'], 0 ,1000);\n\n $ofertaPublica = $params ['Offer'] ['public'];\n $params ['Offer'] ['value'] = str_replace(',', '.', str_replace('.', '', $params ['Offer'] ['value']));\n $addOffer = $this->Utility->urlRequestToSaveData('offers', $params);\n if ($addOffer ['status'] == 'SAVE_OK') {\n if ($this->Session->read('addOffer.update') == true) {\n // deletando publico alvo e filtros selecionados\n $offerId = $this->Session->read('addOffer.Offer.id');\n\n $query = \"DELETE FROM offers_filters where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferFilter = $this->Utility->urlRequestToGetData('users', 'query', $params);\n\n $query = \"DELETE FROM offers_users where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferUser = $this->Utility->urlRequestToGetData('users', 'query', $params);\n\n $query = \"DELETE FROM offers_photos where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferUser = $this->Utility->urlRequestToGetData('users', 'query', $params);\n } else {\n // pegando id de oferta cadastrada\n $params = array(\n 'Offer' => array(\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $offer = $this->Utility->urlRequestToGetData('offers', 'first', $params);\n $offerId = $offer ['Offer'] ['id'];\n }\n\n // $offerId = 42;\n // pegando valores de filtros selecionados\n $gender = implode(',', $this->Session->read('addOffer.filters.gender'));\n $location = implode(',', $this->Session->read('addOffer.filters.location'));\n $age_group = implode(',', $this->Session->read('addOffer.filters.age_group'));\n $political = implode(',', $this->Session->read('addOffer.filters.political'));\n $relationship_status = implode(',', $this->Session->read('addOffer.filters.relationship_status'));\n $religion = implode(',', $this->Session->read('addOffer.filters.religion'));\n\n // fazendo insert de filtros\n $params = array(\n 'OffersFilter' => array(\n 'offer_id' => $offerId,\n 'gender' => $gender,\n 'location' => $location,\n 'age_group' => $age_group,\n 'political' => $political,\n 'religion' => $religion,\n 'relationship_status' => $relationship_status\n )\n );\n $addOfferFilters = $this->Utility->urlRequestToSaveData('offers', $params);\n\n // fazendo insert de fotos\n $photos = $this->Session->read('addOffer.OffersPhoto');\n foreach ($photos as $photo) {\n if (!empty($photo)) {\n $params = array(\n 'OffersPhoto' => array(\n 'offer_id' => $offerId,\n 'photo' => $photo ['photo']\n )\n );\n $addPhoto = $this->Utility->urlRequestToSaveData('offers', $params);\n }\n }\n\n if ($ofertaPublica == 'INACTIVE') {\n // fazendo insert de usuarios capturados\n $users = $this->Session->read('addOffer.users');\n foreach ($users as $user) {\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$offerId}', '{$user['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n }\n\n // verifica se oferta esta sendo cadastrada para usuario que fez desejo\n if ($this->Session->check('CadOfferUser.id_linha_wishlist')) {\n $data = date('Y/m/d');\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->Session->read('CadOfferUser.id_linha_wishlist'),\n 'status' => 'ACTIVE',\n 'offer_id' => $offerId\n )\n );\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n }\n }\n } else {\n echo \"<script>alert('email enviado com sucesso');</script>\";\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n }\n }", "public function isPost()\n {\n return ($this->getMethod() == 'POST') ? true : false;\n }", "public function no_post_author_cannot_see_button_accept_answer()\n {\n $comment = factory(\\App\\Comment::class)->create();\n\n $this->actingAs(factory(\\App\\User::class)->create());\n\n $this->visit($comment->post->url);\n\n $this->dontSee('Aceptar respuesta');\n\n }", "public static function is_posted_by($key)\n {\n if (isset($_POST[$key])) {\n return true;\n }\n\n return false;\n }", "public function has_user_fundraiser()\n {\n return ( ! empty( $this->get_user_fundraiser() ) );\n }", "function userLikedThisPost($post_id)\n {\n $result = query(\"select * from likes where user_id=\".$_SESSION['user_id'].\" and post_id={$post_id}\");\n confirmQuery($result);\n return mysqli_num_rows($result) >= 1 ? true : false;\n }", "public function formSubmitted() {\n return $_SERVER[\"REQUEST_METHOD\"] == 'POST';\n }", "function isSubmitted()\r\n\t\t{\r\n\t\t\tif( isset($_POST[$this->form_id.'-issubmitted'] ) )\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\r\n\t\t}", "public function isPost()\n {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n return true;\n }\n\n return false;\n }", "public static function isPost() {\n\n if (empty(self::$_requestType))\n self::_initRequestType();\n\n return (self::$_requestType == 'POST');\n }", "public function hasUseradditem(){\n return $this->_has(24);\n }", "public function isPost()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::POST;\n }", "public function userCanAddMorePosts() {\n $userSubscriptionData = $this->Auth->user('Subscription');\n $Plan = ClassRegistry::init(\"Plan\");\n \n // napravi mnozinu od naziva modela\n $postType = strtolower(Inflector::pluralize($this->modelClass));\n \n $subscribedCountPerMonth = $Plan->numberOfPostTypeToPublish($userSubscriptionData['plans_id'], $postType);\n $publishedForLastSubscribePeriod = $this->{$this->modelClass}->publishedByLocationIdLastMonth($this->userLocation, $userSubscriptionData['start_date']);\n $now = date(\"Y-m-d H:i:s\");\n \n \n \n if ($now > $userSubscriptionData['end_date']) {\n return $this->redirect(array('controller' => 'subscriptions', 'action' => 'expired'));\n } \n else if ($this->{$this->modelClass}->canPostMore ($subscribedCountPerMonth['Plan'][\"{$postType}_quantity\"], $publishedForLastSubscribePeriod)) {\n return $this->redirect(array('controller' => 'subscriptions', 'action' => 'used'));\n }\n }", "public function isPost(): bool\n {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n return true;\n }\n\n return false;\n }", "public function has_submit() {\n\t\treturn false;\n\t}", "function isValid() {\n\t\treturn( $this->verifyId( $this->mPostId ) && is_numeric( $this->mPostId ) && $this->mPostId > 0 );\n\t}", "public function isUsed()\n\t{\n\t\treturn $this->data && $this->data['forms_attempts'] > 0;\n\t}", "function isPost()\n\t{\n\t\tif(strtolower($_SERVER['REQUEST_METHOD']) == \"post\")\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function is_form_submit() {\n\n\t if (isset($_POST['foodbakery_restaurant_title'])) {\n\t\treturn true;\n\t }\n\t return false;\n\t}", "public static function isPost() {\n\t\treturn ('POST' === self::getMethod() ? true : false);\n\t}", "public function authorize()\n {\n if (($repairRequestId = $this->getModelIdentifier()) === null) {\n return false;\n }\n\n /** @var User $user */\n $user = $this->user();\n\n if (!$user) {\n return false;\n }\n\n /** @var ItemRequestOfferRepository $repairRequestOfferRepository */\n $repairRequestOfferRepository = Container::getInstance()->get(ItemRequestOfferRepository::class);\n /** @var ItemRequestOffer $offer */\n $offer = $repairRequestOfferRepository->findByItemRequestIdAndUserId($repairRequestId, $user->id);\n\n if ($offer) {\n $this->offerId = $repairRequestId;\n\n return true;\n }\n\n return false;\n }", "public function has_post( $key ) \n\t{\n\t\treturn array_key_exists( $key, $this->POST );\n\t}", "public function isPost() : bool {\n return 'POST' === $_SERVER['REQUEST_METHOD'];\n }", "public function canMyLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }", "public static function isPost()\n {\n return !empty($_POST);\n }", "public function is_show_ask_for_review_notice() {\n return (\n nk_theme()->theme_dashboard()->theme_id &&\n nk_theme()->theme_dashboard()->theme_uri &&\n nk_theme()->theme_dashboard()->ask_for_review &&\n 'show' === nk_theme()->get_option( 'ask_for_review_status', 'first' )\n );\n }", "public function isInAuthorPost()\n {\n return $this->object->isInAuthorPost();\n }", "public static function checkRequest()\n {\n $conn = Db::getConnection();\n $statement = $conn->prepare(\"SELECT * from buddie_request WHERE receiver= '\" . $_SESSION['user_id'] . \"'\");\n $statement->execute();\n if ($statement->rowCount() > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function getIsAccepted(): bool;", "public function isApproved(): bool;", "function is_post_publicly_viewable($post = \\null)\n {\n }" ]
[ "0.69252205", "0.6847259", "0.6585115", "0.63233095", "0.6272368", "0.62649816", "0.6245945", "0.62396115", "0.6238399", "0.622684", "0.6203929", "0.61931455", "0.61927444", "0.6188922", "0.6180112", "0.61654085", "0.6153492", "0.61381835", "0.61364996", "0.6124123", "0.61088985", "0.6100479", "0.60886145", "0.60741657", "0.60718906", "0.606422", "0.6054138", "0.6046822", "0.60453504", "0.6002307", "0.59739274", "0.5973634", "0.59606814", "0.59572613", "0.5952498", "0.5944552", "0.59436", "0.59340394", "0.593296", "0.5915824", "0.5902234", "0.5901794", "0.5895965", "0.5895965", "0.5893246", "0.5884605", "0.5883812", "0.58815455", "0.58785814", "0.587646", "0.58753526", "0.586668", "0.58605295", "0.58597374", "0.5854019", "0.58240116", "0.5820226", "0.5812589", "0.5804771", "0.58047694", "0.58047694", "0.5800439", "0.5800391", "0.5800391", "0.5800136", "0.57880914", "0.5784899", "0.5781443", "0.5779511", "0.5775192", "0.5773634", "0.5769695", "0.57658756", "0.5765836", "0.5759338", "0.5753028", "0.57467365", "0.57332593", "0.57318133", "0.5726231", "0.5725887", "0.57245755", "0.5718392", "0.5716981", "0.57150805", "0.57146233", "0.57137805", "0.57129574", "0.5705148", "0.5704129", "0.5703958", "0.5701733", "0.5696807", "0.5684838", "0.56784695", "0.56743103", "0.5674197", "0.5672692", "0.5663839", "0.5662433", "0.5659096" ]
0.0
-1
Redirect to a URL
function redirect($url) { header("Location: $url"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirect(string $url, $status_code = 302);", "public function redirect();", "public function redirect();", "public function redirect();", "abstract protected function redirect();", "public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}", "abstract protected function redirectTo();", "public function redirect($url){\r\n header(\"location:$url\");\r\n }", "function redirectToUrl($url) {\n redirect_to($url);\n }", "function redirectToUrl($url) {\r\n redirect_to($url);\r\n }", "public function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public static function redirectTo($url) {\n header(\"Location: $url\");\n exit;\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url){\n header(\"Location: $url\");\n }", "public function redirectTo();", "function redirect($url) {\n\tResponder::redirect($url);\n}", "function redirect($url){\r\n\t\theader('Location:'.$url, true, 303);\r\n\t}", "function _redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }", "public function redirect($url)\n\t{\n\t\theader(\"Location: $url\");\n\t}", "public function redirect($url)\n {\n header('Location: http://' . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "public function sendRedirect() {}", "public static function redirect ($url)\r\n {\r\n header(\"Location: $url\");\r\n exit;\r\n }", "public static function redirect($url){\n\t\theader($url);\n\t\tdie();\n\t}", "protected function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n exit;\n }", "static function redirect($url, $arguments = array())\n {\n if (substr($url, 0, 1) == '@')\n {\n global $router;\n $url = $router->generate(substr($url, 1), $arguments);\n }\n\n header(\"location: $url\");\n die();\n }", "public function redirect($url) {\r\n ob_start();\r\n header('Location: '. $url);\r\n ob_end_flush();\r\n die();\r\n }", "public function redirect($redirectUrl);", "public static function redirect($url) {\n\n header(\"Location: \" . $url);\n }", "public function redirect(string $url)\n {\n return exit(header('Location:'. $url));\n }", "static function goToURL($url) {\n header('Location: ' . $url);\n }", "public function setRedirect($url, $code = 302);", "public static function redirect($url)\n {\n header('Location: ' . Config::PROTOKOL . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "function _redirect($url) {\n\theader(\"HTTP/1.1 301 Moved Permanently\");\n\tdheader(\"location: \".str_replace('&amp;', '&', $url));\n\tdexit();\n}", "public function redirect($url)\n {\n header('location: ' . $url);\n exit;\n }", "public static function redirect($url)\n {\n header('location: ' . $url);\n }", "function RedirectToURL($url)\n {\n header(\"Location: $url\");\n exit;\n }", "static function redirect($url){\n header( 'Location: '.$url ) ;\n\n }", "public function redirect($url)\n {\n ob_get_clean();\n header('Location: '.$url);\n exit();\n }", "function redirect($url)\n\t{\n\t\treturn header(\"Location:\". BASEURL . $url);\n\t}", "public static function redirect($url = 'index')\n {\n header(\"location: {$url}\");\n }", "public function redirect($url)\n {\n if (strpos($url, '://') === false) //relative URL\n {\n $url = BASE_URL.$url;\n }\n \n header('Location: '.$url); //redirect\n exit;\n }", "function url_redirect($to)\n{\n\theader(\"Location: $to\");\n}", "public static function redirect($url)\n {\n echo '<script type=\"text/javascript\">document.location.href=\"' . $url . '\";</script>';\n exit;\n }", "function redirectTo($url) {\n header('HTTP/1.1 301 Moved Permanently');\n header('Location: ' . $url);\n}", "function http_redirect($url = null, ?array $params = null, $session = null, $status = null) {}", "public function redirect($url = '', $code = 302)\n {\n $referrer = $this->uri();\n\n if (strpos($referrer, '://') === FALSE)\n {\n $referrer = URL::site($referrer, TRUE, ! empty(Kohana::$index_file));\n }\n\n if (strpos($url, '://') === FALSE)\n {\n // Make the URI into a URL\n $url = URL::site($url, TRUE, ! empty(Kohana::$index_file));\n }\n\n if (($response = $this->response()) === NULL)\n {\n $response = $this->create_response();\n }\n\n echo $response->status($code)\n ->headers('Location', $url)\n ->headers('Referer', $referrer)\n ->send_headers()\n ->body();\n\n // Stop execution\n exit;\n }", "public function redirect($url = '', $code = 302)\n\t{\n\t\tif (strpos($url, '://') === FALSE)\n\t\t{\n\t\t\t// Make the URI into a URL\n\t\t\t$url = URL::site($url, TRUE);\n\t\t}\n\n\t\t// Set the response status\n\t\t$this->status = $code;\n\n\t\t// Set the location header\n\t\t$this->headers['Location'] = $url;\n\n\t\t// Send headers\n\t\t$this->send_headers();\n\n\t\t// Stop execution\n\t\texit;\n\t}", "function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }", "public function mustRedirect();", "function redirect ($url){\n\t header(\"Location: $url\");\n\t\texit;\n\t}", "function external_redirect($url){\n header('Location:' . $url);\n //Detiene el flujo\n exit;\n }", "public function redirect(string $url) {\r\n\t\t\theader(\"location: $url\");\r\n\t\t\tdie();\r\n\t\t}", "function redirect($url) {\n\t\theader('Location: '.$url);\n\t\texit();\n\t}", "protected function redirect($url) {\n header(\"Location: $url\");\n die();\n }", "public static function _redirect($url, $code = 303) {\n self::response(false)\n ->status($code)\n ->header('Location', $url)\n ->write($url)\n ->send();\n }", "public static function rendirect($url){\n\t \n\t\t header(\"Location: {$url}\");\n exit;\n\t}", "public function redirect($url) {\r\n\t\theader('Location: ' . HTMLROOT . $url);\r\n\t\tdie();\r\n\t}", "function redirect($url) {\n $url = get_path($url);\n header(\"location: $url\");\n exit();\n}", "public function redirect($url = null)\n {\n if ($url <> null) {\n header(\"Location: {$url}\");\n exit(0);\n }\n }", "protected function redirect($url) {\n\t\theader('Location: ' . str_replace('&amp;', '&', $url));\n\t\tdie();\n\t}", "public static function redirect($url){\n header('Location: '.$url);\n die(\"Redirecting to page <a href='\".$url.\"'>\".$url.\"</a>\");\n }", "function Redirect($url, $permanent = false)\n {\n header('Location: ' . $url, true, $permanent ? 301 : 302);\n exit();\n }", "public static function redirect($url){\n\t if(is_file($url) OR is_dir($url)){\n\t header('Location: '.$url);\n\t exit(); \n\t }\n\t}", "public function redirect($url){\n header(\"Location: /$url\");\n header(\"Connection: close\");\n exit;\n }", "function redirectTo($url = \"\") {\n\tif (empty($url)) $url = $_SERVER['REQUEST_URI'];\n\theader(\"Location: \" . $url);\n\texit();\n}", "static public function redirect(string $url)\n {\n header(\"location: $url\");\n exit;\n }", "function redirect($url)\r\r\n {\r\r\n global $wp_rewrite, $wpdb, $hyper_cache_stop;\r\r\n //disable Hyper Cache plugin (http://www.satollo.net/plugins/hyper-cache) from caching this page\r\r\n $hyper_cache_stop = true;\r\r\n //disable WP Super Cache caching\r\r\n if (!defined('DONOTCACHEPAGE'))\r\r\n define('DONOTCACHEPAGE', 1);\r\r\n\r\r\n if ($this->options['base64']) {\r\r\n $url = base64_decode($url);\r\r\n } elseif ($this->options['maskurl']) {\r\r\n $sql = 'select url from ' . $wpdb->prefix . 'masklinks where id= %s limit 1';\r\r\n $url = $wpdb->get_var($wpdb->prepare($sql, addslashes($url)));\r\r\n }\r\r\n die('<a href=\"' . $url . '\">just click the link!</a>');\r\r\n }", "function redirect_to($url = 'index.php')\n\t{\n\t\t$redirect = 'location: ' . $url;\n\t\theader($redirect);\n\t\t\n\t\tdie(); /*halt the execution*/\n\t}", "public function redirect($url)\r\n {\r\n header(\"Location: /$url\"); \r\n header(\"Connection: close\");\r\n exit;\r\n }", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "public function redirect($url, $code = null)\n\t{\n\t\tUrl::redirect($url, $code);\n\t}", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function redirect($url = '', $query = null)\n {\n // session_write_close();\n header('Location: '.URL($url, $query), true, 302);\n exit();\n }", "protected function redirect($url)\r\n {\r\n JFactory::getApplication()->redirect($url);\r\n }", "protected function do_redirect($url, $code = 302) {\n header(\"Location: $url\", true, $code);\n exit;\n }", "public static function redirect($url, $base = SELF_URL){\r\n header('Location: '.self::getAbsoluteURL($url, $base));\r\n\t\texit;\r\n\t}", "function redirect($url){\n if (headers_sent()){\n die('<script type=\"text/javascript\">window.location.href=\"' . $url . '\";</script>');\n }else{\n header( \"refresh:3;url=\".$url );\n die();\n } \n }", "public static function redirect($url=\".\", $code = 302) {\r\n\t\tstatic::statusCode($code);\r\n\t\tif ($url=='.') $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\r\n\t\theader(\"Location: {$url}\");\r\n\t\texit;\r\n\t}", "public function redirect($url, $message = NULL)\n {\n\n header(\"Location: \" . $url);\n\n }", "public function redirectToExternalUrl() {}", "public static function redirect($url)\n {\n return header('Location: '. App::$base_url .$url);\n }", "public static function redirect(string $url)\n {\n header(\"Location: $url\");\n exit();\n }", "protected function redirect($url)\n\t{\n\t\t$this->_redirect = $url;\n\t\t$this->_flow = PAGE_FLOW_REDIRECT;\n\t}", "function redirect($url) {\n header(\"location:$path\");\n}", "protected function do_302($url) {\n $this->do_redirect($url, 302);\n }", "public function setRedirectUrl($url);", "public function redirect($url)\n\t{\n\t\tif (substr($url, 0, 1) == '/') {\n\t\t\theader('Location: ' . $url);\n\t\t} else {\n\t\t\techo \"<script>window.top.location = '\" . $url . \"';</script>\";\n\t\t}\n\t\texit();\n\t}", "public function redirect($path);", "function Redirect($url, $getvars = NULL)\r\n{\r\n\tsession_write_close();\r\n\t$redir = GetVar(\"cr\", $url);\r\n\tif (is_array($getvars)) $redir = MakeURI($url, $getvars);\r\n\theader(\"Location: $redir\");\r\n\tdie();\r\n}", "function Redirect($url, $permanent = false)\n{\n header('Location: ' . $url, true, $permanent ? 301 : 302);\n exit();\n}", "public function do_redirect() {\n\t\twp_safe_redirect( $GLOBALS['redirect_to'] );\n\t\texit;\n\t}", "function redirect($url=null)\n\t{\n\t\tif (is_null($url))\n\t\t\t$url = $_SERVER['PHP_SELF'];\n\t\theader(\"Location: $url\");\n\t\texit();\n\t}", "public static function redirect($url) {\n\t\t\techo \"<a href=\\\"./\".$url.\"\\\">Click here to continue.</a>\";\n\t\t\techo \"<script type=\\\"text/javascript\\\">\n\t\t\t<!--\n\t\t\twindow.location = \\\"./\".$url.\"\\\"\n\t\t\t//-->\n\t\t\t</script>\";\n\t\t}", "static function Redirect($url,$permanently=false){\n\t\tif ($permanently === true) {\n\t\t\theader('HTTP/1.1 301 Moved Permanently'); // The Redirect will be cached by the browser\n\t\t}\n\t header('Location: ' . $url);\n\t exit();\n\t}", "public function redirect($url)\n {\n header(\"Location: /\" . LocaleAM::code() . \"/$url\");\n header(\"Connection: close\");\n exit;\n }" ]
[ "0.81184", "0.7918707", "0.7918707", "0.7918707", "0.788759", "0.78153354", "0.7764407", "0.7746665", "0.77359587", "0.7730575", "0.7704786", "0.767105", "0.76628387", "0.76025075", "0.76025075", "0.76025075", "0.7590724", "0.7578532", "0.7571633", "0.75679284", "0.7555785", "0.755501", "0.75230306", "0.7511577", "0.7507955", "0.7492662", "0.7490704", "0.74816257", "0.74781346", "0.746436", "0.74635303", "0.7452754", "0.7450356", "0.7444578", "0.7439892", "0.7437849", "0.74339813", "0.74338895", "0.7433558", "0.74317294", "0.7427202", "0.7420466", "0.7414211", "0.7407111", "0.7394756", "0.7379986", "0.7350975", "0.7349722", "0.73478776", "0.7329296", "0.7324104", "0.7323316", "0.7321472", "0.73208725", "0.7319646", "0.73143613", "0.73103964", "0.7309915", "0.73091525", "0.7299935", "0.7292172", "0.7281301", "0.72782105", "0.72769296", "0.7263511", "0.7259113", "0.72568506", "0.7244321", "0.7234334", "0.72299236", "0.72246754", "0.7210932", "0.72043496", "0.7188943", "0.7173485", "0.71702", "0.7166414", "0.71425086", "0.71417004", "0.71365154", "0.71358424", "0.7134787", "0.7133764", "0.7132943", "0.71318734", "0.71281755", "0.71246374", "0.710892", "0.7107693", "0.70875555", "0.7085186", "0.70810413", "0.7081037", "0.7079556", "0.7079063", "0.70785165", "0.707695", "0.70764", "0.7075552", "0.70699704" ]
0.7086926
90
Escape a value to prevent XSS attacks
function escape($value) { return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function escape($value) {}", "public function escape($value);", "public function escape($value);", "public abstract function escapeString($value);", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "abstract public function escapeString($value);", "function esc($value)\n{\n return htmlentities($value);\n}", "protected static function _escape($value) {\n if (!is_string($value)) {\n return $value;\n }\n\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n }", "private function htmlspecialcarfy(&$value) {\r\n $value = htmlspecialchars($value);\r\n }", "protected function escape( $value )\n\t{\n\t\treturn e( $value );\n\t}", "function h($value){\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function e($value)\n {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }", "public function escape(mixed $value): string\n {\n return htmlspecialchars($value, ENT_QUOTES);\n }", "public function setSafeValue($value)\n {\n return htmlspecialchars(stripslashes($value));\n }", "public function escapeString(string $value): string;", "public function htmlEncode($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS);\n\t}", "function escape ($val, $charset = 'UTF-8') {\n\treturn htmlspecialchars ($val, ENT_QUOTES, $charset);\n}", "public function escape($stringValue);", "function html_escape($value)\n{\n return apply_filters('html_escape', $value);\n}", "public function escape($value)\n\t{\n\t\tswitch(gettype($value))\n\t\t{\n\t\t\tcase 'NULL':\n\t\t\t\t$value = 'NULL';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'boolean':\n\t\t\t\t$value = $this->escapeBoolean($value);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'integer':\n\t\t\tcase 'double':\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$value = '\\''.$this->escapeStr($value).'\\'';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "public function escape($value)\n {\n // SQL standard is to use single-quotes for all values\n return \"'$value'\";\n }", "protected function filterXss($value) {\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function escape($value) {\n\t\treturn $this->mysql_client->escape_string($value);\n\t}", "public function escape_value($value){\n if($this->real_escape_string_e){\n if($this->magic_quotes_a){\n $value = stripcslashes($value);\n }\n $value = mysql_real_escape_string($value);\n }\n if(!$this->magic_quotes_a){\n $value = addslashes($value);\n }\n return $value;\n }", "protected function escapeString($value)\n {\n return $this->entityManager->getConnection()->quote($value);\n }", "protected function escape($value): string\n {\n $value = strtr(\n $value,\n [\n '%' => '\\%',\n '_' => '\\_',\n '\\\\' => '\\\\\\\\',\n ]\n );\n\n return '%' . $value . '%';\n }", "static protected function escape($value, $charset = 'utf-8'){\r\n\t\tif (!is_string($value)){\r\n\t\t\treturn $value;\r\n\t\t}\r\n\t\treturn htmlspecialchars($value, ENT_QUOTES, $charset);\r\n\t}", "function esc_attr($value) {\n return htmlspecialchars($value, ENT_QUOTES);\n }", "public static function escape($value) {\n return slDatabaseManager::getConnection()->escape($value);\n }", "function html_escape($v) {\n\treturn escape($v, TRUE);\n}", "function escape( $val ) {\r\n\r\n\t\tif( !$this->connected )\r\n\t\t\t$this->connect();\r\n\r\n return $this->socket->real_escape_string($val);\r\n\r\n\t}", "public static function specialchars($value) {\n\t\treturn htmlspecialchars($value, ENT_QUOTES, Config::get('application.encoding'), false);\n\t}", "function filter($value){\n return htmlspecialchars($value);\n }", "public function escape($string);", "public function escape($string);", "public function escapeValue($value): string {\n\t\treturn $this->sqlAdapter->escapeValue($value);\n\t}", "private function escapeString(string $value): string\n {\n return str_replace(\"'\", \"''\", $value);\n }", "public function escape($value) {\n $connection = $this -> connect();\n return $connection -> real_escape_string(trim($value));\n }", "public static function escape($s) {}", "function esc(String $value)\n{\n\t// bring the global db connect object into function\n\tglobal $conn;\n\n\t$val = trim($value); // remove empty space sorrounding string\n\t$data = stripslashes($val);\n\t$data = htmlspecialchars($data);\n\t$val = mysqli_real_escape_string($conn, $value);\n\n\treturn $data;\n}", "abstract protected function _escape($s);", "public function escape($text);", "function e($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "function e($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "public abstract function escape($string);", "function htmlspecialchars(&$value)\n\t{\n\t\t$value = htmlspecialchars($value);\n\t}", "protected static function filter_htmlencode($value)\n\t{\n\t\treturn filter_var($value, FILTER_SANITIZE_SPECIAL_CHARS); \n\t}", "public static function escape($som) {}", "function escape($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n}", "function esc_specialchars($value)\n{\n // Numbers and boolean values get turned into strings which can cause problems\n // with type comparisons (e.g. === or is_int() etc).\n return is_string($value) ? htmlspecialchars($value, ENT_QUOTES, sfConfig::get('sf_charset')) : $value;\n}", "public function escape($value)\n\t{\n\t\tif(is_int($value))\n\t\t\treturn $value;\n\t\telse if(is_float($value))\n\t\t\treturn str_replace(',', '.', ''.$value);\n\t\telse\n\t\t\treturn $this->escapeString($value);\n\t}", "public static function legacyEscape( $val )\n\t{\n \t$val = str_replace( \"&\"\t\t\t, \"&amp;\" , $val );\n \t$val = str_replace( \"<!--\"\t\t, \"&#60;&#33;--\" , $val );\n \t$val = str_replace( \"-->\"\t\t, \"--&#62;\" , $val );\n \t$val = str_ireplace( \"<script\"\t, \"&#60;script\" , $val );\n \t$val = str_replace( \">\"\t\t\t, \"&gt;\" , $val );\n \t$val = str_replace( \"<\"\t\t\t, \"&lt;\" , $val );\n \t$val = str_replace( '\"'\t\t\t, \"&quot;\" , $val );\n \t$val = str_replace( \"\\n\"\t\t, \"<br />\" , $val );\n \t$val = str_replace( \"$\"\t\t\t, \"&#036;\" , $val );\n \t$val = str_replace( \"!\"\t\t\t, \"&#33;\" , $val );\n \t$val = str_replace( \"'\"\t\t\t, \"&#39;\" , $val );\n \t$val = str_replace( \"\\\\\"\t\t, \"&#092;\" , $val );\n \t\n \treturn $val;\n\t}", "public function filter($value)\n {\n return htmlspecialchars((string) $value, $this->quoteStyle, $this->charset, $this->doubleEncode);\n }", "public function filter($value) {\n if (!is_scalar($value)) {\n return $value;\n }\n\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function xml_escape($value)\n{\n return htmlspecialchars(preg_replace('#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+#', '',\n $value), ENT_QUOTES);\n}", "function checkRealEscapeString($value);", "function escapeString( $value )\r\n\t{\r\n die(\"method \" . __METHOD__ . \" is not implemented\" . Diagnostics::trace());\r\n\t}", "function esc(String $value){\n global $conn;\n $val = trim($value); // remove empty space sorrounding string\n $val = mysqli_real_escape_string($conn, $value);\n return $val;\n }", "function escs(String $value)\n{\n // bring the global db connect object into function\n global $conn;\n\n $val = trim($value); // remove empty space sorrounding string\n $data = stripslashes($val);\n $data = htmlspecialchars($data);\n $val = mysqli_real_escape_string($conn, $value);\n\n return $data;\n}", "public static function escape( $value=\"\", $char=\"'\" )\n {\n $value = Sanitize::toString( $value );\n $value = self::unescape( $value );\n $value = str_replace( $char, \"\\\\\".$char, $value );\n return $value;\n }", "public function escape_value($value) {\n\n\t\t if($this->real_escape_string) { // PHP v4.3.0 or higher\n\t\t// undo any magic quote effects so mysql_real_escape_string can do the work\n\t\tif($this->magic_quotes_active) { $value = stripslashes($value); }\n\t\t\t$value = mysqli_real_escape_string($this->connection, $value);\n\t\t} else { // before PHP v4.3.0\n\t\t// If magic quotes aren't already on then add slases manually\n\t\tif(!$this->magic_quotes_active) { $value = addslashes($value); }\n\t\t// if magic quotes are active, then teh slashes already exist\n\t\t}\n\t\treturn $value;\n\t}", "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}", "public function escapeString($string);", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "public function apply(mixed $value): string\n {\n return htmlspecialchars((string) $value, $this->quoteStyle, $this->charset, $this->doubleEncode);\n }", "function eEx($value)\n {\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "public function escapeField($string);", "function e($value, $doubleEncode = true)\n {\n if ($value instanceof Htmlable) {\n return $value->toHtml();\n }\n\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode);\n }", "public function placeholder_escape()\n {\n }", "function attribute_escape($text)\n {\n }", "function encodeFormValue ($s) {\n return htmlentities($s, ENT_COMPAT|ENT_QUOTES,'ISO-8859-1', true); \n}", "function addslashes_strings_only($value)\n {\n }", "function e($value, $doubleEncode = false)\n {\n if ($value instanceof \\Illuminate\\Contracts\\Support\\Htmlable) {\n return $value->toHtml();\n }\n\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode);\n }", "function mysql_escape(&$value)\r\n\t{\r\n\t\t$value = mysql_real_escape_string($value);\r\n\t}", "protected abstract function escape($string);", "function esc(String $value){\n\t// bring the global db connect object into function\n\tglobal $connection;\n\t// remove empty space sorrounding string\n\t$val = trim($value); \n\t$val = mysqli_real_escape_string($connection, $value);\n\treturn $val;\n}", "abstract public function escapeString($string);", "public function escapeString($stringToEscape);", "function ha($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8');\n}", "private function _escape($data)\n {\n return htmlspecialchars($data, ENT_QUOTES);\n }", "function e($value)\n {\n if ($value instanceof Htmlable) {\n return $value->toHtml();\n }\n\n return htmlentities($value, ENT_QUOTES, 'UTF-8', false);\n }", "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}", "function escape($content = null) {\n return Sanitize::stripAll($content);\n }", "function escape($text) {\n\t$text = htmlspecialchars($text, ENT_QUOTES);\n\t$text = addslashes($text);\n\treturn $text;\n}", "protected function escape($value, $type='literal') \n\t{\n\t\tswitch($type) {\n\t\t\tcase 'uri':\n\t\t\t\t$value = str_replace(array('<', '>'), array('%3C', '%3E'), $value);\n\t\t\tdefault:\n\t\t\t\t$value = str_replace('\"', '\"\"', $value);\n\t\t}\n\n\t\treturn $value;\n\t}", "public function escape($value)\n {\n return $this->mysqli->escape_string($value);\n }", "function escape($string){\n return htmlentities($string, ENT_QUOTES, 'UTF-8');\n}", "function sc_php_escape($value) {\n\tif (is_string($value));\n\t// strip out slashes IF they exist AND magic_quotes is on\n\tif (get_magic_quotes_gpc() && (strstr($value,'\\\"') || strstr($value,\"\\\\'\"))) $value = stripslashes($value);\t\n\t// escape string to make it safe for mysql\n\treturn addslashes($value);\n}", "function sysEncode( $str ){\n\treturn( addslashes( htmlspecialchars( $str ) ) );\n}", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function add_quote($value) {\n\t\treturn '\"' . addslashes($value) . '\"';\n\t}", "public function escape()\n {\n return strval($this);\n }", "abstract public function escape_string( $str );", "public static function escapeString($val)\n {\n $toRepl = self::getReservedSymbols();\n \n $with = array();\n \n foreach($toRepl as $char)\n {\n $with[] = \"\\\\$char\";\n }\n\n return str_replace($toRepl, $with, $val);\n }", "function e($value)\n{\n\treturn HTML::entities($value);\n}", "private function encode_Base64UrlSafe( $value ) {\n\t\t\treturn str_replace( array( '+', '/' ), array( '-', '_' ), base64_encode( $value ) );\n\t\t}", "public static function strJS($value)\n {\n $result = addslashes($value);\n return $result;\n }", "public function addSlashes(&$value){\nreturn $value = \"'$value'\";\n}", "protected static function placeholderEscape($value) {\n return $value instanceof MarkupInterface ? (string) $value : Html::escape($value);\n }", "protected function quote_escaped()\n {\n }" ]
[ "0.8696886", "0.86790204", "0.86790204", "0.8261712", "0.8242735", "0.819282", "0.77832645", "0.7754844", "0.77430576", "0.7733802", "0.77167696", "0.770428", "0.76680803", "0.76357794", "0.7593449", "0.7491857", "0.74639463", "0.74598813", "0.7420454", "0.73621255", "0.73405075", "0.7310015", "0.7309027", "0.7280558", "0.7250329", "0.72284746", "0.72255856", "0.72131395", "0.72105885", "0.7198545", "0.7176587", "0.7176587", "0.715391", "0.7152371", "0.7152371", "0.7147525", "0.71251506", "0.7122425", "0.7116887", "0.710545", "0.7089039", "0.7075142", "0.70730996", "0.70730996", "0.7071473", "0.7060092", "0.7031378", "0.7013132", "0.6994812", "0.6983204", "0.69754964", "0.6967861", "0.69626045", "0.6956927", "0.6930084", "0.69139016", "0.6911749", "0.69074965", "0.69031155", "0.6892315", "0.68878585", "0.6869941", "0.6845535", "0.6843515", "0.6839646", "0.6811034", "0.6785455", "0.6775561", "0.67716986", "0.6770996", "0.67597055", "0.6759375", "0.6752209", "0.6747808", "0.6740398", "0.6737767", "0.67357916", "0.6731578", "0.6731111", "0.672761", "0.67254996", "0.67219347", "0.67173976", "0.6711998", "0.6711928", "0.6711324", "0.6706096", "0.66928893", "0.66912353", "0.66881406", "0.6680258", "0.6673419", "0.66699684", "0.66597867", "0.6642107", "0.66420186", "0.6634194", "0.66311246", "0.6627466", "0.6625677" ]
0.79961747
6
Transform a timestamp into a date
function timestampToDate($t) { return date("d-m-Y",$t); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function variant_date_from_timestamp($timestamp) {}", "protected function get_timestamp_as_date($timestamp)\n {\n }", "function toDate ($timestamp)\n\t{\n\t\treturn date('Y-m-d', $timestamp);\n\t}", "function ts2dt($timestamp) {\n $pieces = explode(\"_\",$timestamp);\n $date = new DateTime();\n $date->setDate($pieces[0],$pieces[1],$pieces[2]);\n $date->setTime($pieces[3],$pieces[4],$pieces[5]);\n return $date;\n}", "static public function fromTimestamp($timestamp){\n\t\treturn self::getDatefromTimestamp($timestamp);\n\t}", "static public function getDateFromTimestamp($timestamp){\n\t\t// 32bit timestamp\n if(abs($timestamp)<=0x7FFFFFFF){\n\t\t\treturn new Date(date('Y-m-d', $timestamp));\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($timestamp, true);\n\t\t\t$fecha = $dateParts['year'].'-'.sprintf('%02s', $dateParts['mon']).'-'.sprintf('%02s', $dateParts['mday']);\n\t\t\treturn new Date($fecha);\n\t\t}\n\t}", "static public function toDatetime($timestamp) {\r\n\t\tif ($timestamp === null) return null;\r\n\t\telse return \\date('Y-m-d H:i:s', $timestamp);\r\n\t}", "function convert_timestamp($timestamp)\n\t{\n\t\t$timestamp_bits = explode('T', $timestamp);\n\n\t\tif(isset($timestamp_bits[0], $timestamp_bits[0])):\n\t\t\t$date_bits = explode('-', $timestamp_bits[0]);\n\t\t\t$time_bits = explode(':', $timestamp_bits[1]);\n\t\t\t$year = $date_bits[0];\n\t\t\t$month = $date_bits[1];\n\t\t\t$day = $date_bits[2];\n\t\t\t$hour = $time_bits[0];\n\t\t\t$minute = $time_bits[1];\n\t\t\t$second = $time_bits[2];\n\n\t\t\treturn mktime($hour,$minute,$second, $month, $day, $year);\n\t\tendif;\n\n\t\treturn false;\n\n\t}", "function timeStampToDateFR($timestamp) {\n return date('Y-m-d H:i:s', $timestamp);\n}", "function dateToCal($timestamp) {\nreturn date('Ymd\\THis', $timestamp);\n}", "function dateToTimestamp($date){\n\t$dia=substr($date,0,2);\n\t$mes=substr($date,3,2);\n\t$ano=substr($date, 6,4);\t\n\t\n\t$timestamp= mktime(0,0,0,$mes,$dia,$ano);\n\treturn $timestamp;\n }", "function _convert_to_unix_timestamp($timestamp)\n\t{\n\t\tlist($time, $date) = explode('.', $timestamp);\n\t\t\n\t\t// breakdown time\n\t\t$hour = substr($time, 0, 2);\n\t\t$minute = substr($time, 2, 2);\n\t\t$second = substr($time, 4, 2);\n\t\t\n\t\t// breakdown date\n\t\t$day = substr($date, 0, 2);\n\t\t$month = substr($date, 2, 2);\n\t\t$year = substr($date, 4, 2);\n\t\t\n\t\treturn gmmktime($hour, $minute, $second, $month, $day, $year);\n\t}", "public static function date($timestamp, $format = 'Y M d')\n {\n return date($format, strtotime('1582-10-04 00:00:00') + $timestamp);\n }", "function date_to_timestamp($d) {\n return mktime(substr($d, 8, 2), // hour\n substr($d, 10, 2), // minute\n 0, // second\n substr($d, 4, 2), // month\n substr($d, 6, 2), // day\n substr($d, 0, 4)); // year\n}", "public static function getDatetimeFromTimestamp($timestamp)\n {\n return date(\"Y-m-d H:i:s\", $timestamp);\n }", "function convert_timestamp($timestamp){ \n $limit=date(\"U\"); \n $limiting=$timestamp-$limit; \n return date (\"Ymd\", mktime (0,0,$limiting)); \n}", "function variant_date_to_timestamp($variant) {}", "protected function get_timestamp_as_date( $timestamp ) {\n\t\tif ( empty( $timestamp ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$time_diff = time() - $timestamp;\n\n\t\tif ( $time_diff >= 0 && $time_diff < DAY_IN_SECONDS ) {\n\t\t\t/* translators: %s: Human-readable time difference. */\n\t\t\treturn sprintf( __( '%s ago' ), human_time_diff( $timestamp ) );\n\t\t}\n\n\t\treturn date_i18n( get_option( 'date_format' ), $timestamp );\n\t}", "function convertTimestamp($timestamp, $timezone = \"-0000\"){\r\n \treturn \"/Date($timestamp$timezone)/\";\r\n }", "protected function createDatesFromTimestamp($timestamp) {\n // date of event if existing, else current time\n if ($timestamp != \"\" && $timestamp != 0) {\n return date($this -> options['date_new_format'], $timestamp);\n } else {\n return \"\";\n }\n }", "public static function timestampToDateTime($timestamp) {\n\t\treturn date(self::MYSQL_DATETIME_FORMAT, $timestamp);\n\t}", "function returnDate($timestamp) {\n\t$format = \"F j, Y, G:i:s e\";\n\t$timestamp = ($timestamp > 0 || (int)$timestamp === 0) ? (int)$timestamp : time();\n\t$f_date = date($format, time());\n\n\treturn $f_date;\n}", "function toDateTime ($timestamp)\n\t{\n\t\treturn date('Y-m-d h:i:s', $timestamp);\n\t}", "function date2Timestamp($date) {\r\n //2003-04-12 00:05:43\r\n if ($date == null) {\r\n return 0;\r\n }\r\n list($y, $mth, $d, $h, $min, $sec) = sscanf($date,\"%d-%d-%d %d:%d:%d\");\r\n return mktime ( $h, $min, $sec, $mth, $d, $y);\r\n}", "function convertTimestamp($ugly){\n $date = new DateTime($ugly);\n return $date->format('l, F jS, Y');\n}", "public static function format_date($timestamp) {\n\t\tif ( is_object($timestamp) ) {\n\t\t\treturn $timestamp->format('Y-m-d\\TH:i:s');\n\t\t} else {\n\t\t\treturn date('Y-m-d\\TH:i:s', $timestamp);\n\t\t}\n\t}", "function date_to_ts($value) {\n\treturn strtotime($value);\n}", "public static function ToDate($Timestamp = '') {\n if ($Timestamp == '')\n $Timestamp = time();\n elseif (!is_numeric($Timestamp))\n $Timestamp = self::ToTimestamp($Timestamp);\n\n return date('Y-m-d', $Timestamp);\n }", "protected function createDate($timestamp) {\n \tif (empty($timestamp)) {\n \t\treturn null;\n \t}\n \n \treturn new \\DateTime(date('c', $timestamp));\n }", "public static function unix_timestamp_to_datetime($value)\n\t{\n\t\treturn date(conf(\"format.datetime\"), $value);\n\t}", "protected function convert_time_stamp($timestamp) {\n return $timestamp ? gmdate('Y-m-d h:i:s a', $timestamp) : null;\n }", "public abstract function fromUnixtime ($timestamp);", "public static function date($timestamp) {\n return gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';\n }", "function date_to_timestamp($date)\n {\n $with_time = explode(' ', $date);\n $date = explode('/', $with_time[0]);\n\n if (count($date) == 3) {\n $hour = null;\n $minutes = null;\n\n if (isset($with_time[1])) {\n $time = explode(':', $with_time[1]);\n\n $hour = $time[0];\n $minutes = $time[1];\n }\n\n if ($timestamp = \\Carbon\\Carbon::create($date[2], $date[1], $date [0], $hour, $minutes)) {\n return $timestamp->format(\\DateTime::RFC3339);\n }\n }\n }", "public static function to_date($timestamp,$pattern='Y-m-d H:i:s') {\n\t\treturn date($pattern,$timestamp);\n\t}", "static public function makeData($timestamp)\n\t{\n\t\t$d = getdate($timestamp);\n\n\t\tif ($d['mon'] < 10) $d['mon'] = '0'.$d['mon'];\n\t\tif ($d['mday'] < 10) $d['mday'] = '0'.$d['mday'];\n\n\t\treturn $d['year'].'-'.$d['mon'].'-'.$d['mday'];\n\t}", "function ldate($format, $timestamp = null) {\n\tif (1 === func_num_args( )) {\n\t\t$timestamp = time( );\n\t}\n\n\tif ( ! is_numeric($timestamp)) {\n\t\t$timestamp = strtotime($timestamp);\n\t}\n\n\tdate_default_timezone_set($GLOBALS['_TZ']);\n\t$date = date($format, $timestamp);\n\tdate_default_timezone_set('UTC');\n\n\treturn $date;\n}", "public function timestampToDate()\n {\n $tmp = new DateTime();\n return $tmp->setTimestamp( $this->timestamp );\n }", "function time_2_timestamp(&$time) {\r\n if ($time instanceof \\DateTime)\r\n $time = $time->getTimestamp();\r\n else\r\n $time = strtotime($time);\r\n}", "static function getDateFromTimeStamp($timestamp) {\r\n $tab = explode(\" \", $timestamp);\r\n return $tab[\"0\"];\r\n }", "function date_get_date_time($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date_time'], $timestamp);\n}", "function timestamp($date){\n\t \n\t$return = strtotime($date);\n\treturn $return;\n}", "function crystal_sqlite_from_unixtime($timestamp)\n {\n $timestamp = trim($timestamp);\n if (!preg_match(\"/^[0-9]+$/is\", $timestamp))\n $ret = strtotime($timestamp);\n else\n $ret = $timestamp;\n \n $ret = date(\"Y-m-d H:i:s\", $ret);\n crystal_sqlite_debug(\"FROM_UNIXTIME ($timestamp) = $ret\");\n return $ret;\n }", "function cata_ts2unixts($timestamp) {\n\tif (strlen($timestamp) == 14) {\n\t\t$year = intval(substr($timestamp, 0, 4));\n\t\t$month = intval(substr($timestamp, 4, 2));\n\t\t$day = intval(substr($timestamp, 6, 2));\n\t\t$hour = intval(substr($timestamp, 8, 2));\n\t\t$minute = intval(substr($timestamp, 10, 2));\n\t\t$second = intval(substr($timestamp, 12, 2));\n\n\t\treturn mktime($hour, $minute, $second, $month, $day, $year);\n\t} else {\n\t\treturn 0;\n\t}\n}", "public static function toDate($ts){\n return date('d.m.Y',$ts); \n }", "function date_get_date($timestamp) {\n return app_date($GLOBALS['i18']['formats']['date'], $timestamp);\n}", "function time2date($timestamp=0, $showTime=true) {\n\t\tif ((int)$timestamp < 0) return ' - ';\n\n\t\t// TIMESTAMP EMPTY?\n\t\tif (empty($timestamp)) $timestamp = time();\n\n\t\t// DATE FORMAT\n\t\t$dateForm = ($showTime && !empty($this->timeformat))?\n\t\t\t\t\t\ttrim($this->dateformat .', '. $this->timeformat)\n\t\t\t\t\t\t:\n\t\t\t\t\t\ttrim($this->dateformat);\n\n\t\t// SIMULATION OF MISSING PARAMETERS\n\t\t$search = $replace = array();\n\t\t// '%n' AS MONTH WITHOUT LEADING ZERO\n\t\t$search[] = '%n';\n\t\t$replace[] = date('n', $timestamp);\n\t\t// '%e' AS DAY WITHOUT LEADING ZERO\n\t\t$search[] = '%e';\n\t\t$replace[] = date('j', $timestamp);\n\t\t// '%i' AS HOUR WITHOUT LEADING ZERO\n\t\t$search[] = '%i';\n\t\t$replace[] = date('g', $timestamp);\n\t\t// '%b' AS THREE CHARS OF MONTH (LOCALISED), kh_mod 0.3.1, changed\n\t\t$month = (int)date('n', $timestamp) - 1;\n\t\tif (!empty($this->lang['months'][$month])) {\n\t\t\t$search[] = '%b';\n\t\t\t$replace[] = $this->lang['months'][$month];\n\t\t}\n\t\t// '%r' DISPLAY a.m resp. p.m. STRING\n\t\t$search[] = '%r';\n\t\t$replace[] = strtr(date('a', $timestamp), array('am'=>'a.m.','pm'=>'p.m.'));\n\n\t\t// REPLACE\n\t\t$dateForm = str_replace($search,$replace,$dateForm);\n\n\t\t// DATE AND TIME FORMTTED\n\t\treturn strftime($dateForm, $timestamp);\n\t}", "private function formatTime($timestamp)\n {\n return date('Y-m-d', $timestamp);\n }", "static public function timestamp($value) {\n // Default empty values to now\n if (empty($value)) {\n return time();\n }\n\n // Does it look like it's already a timestamp? Just return it\n if (is_numeric($value)) {\n return $value;\n }\n\n $time = strtotime($value);\n if ($time == FALSE) {\n // Handles form YYYY-MM-DD HH:MM:SS.garbage\n if (drupal_strlen($value) > 19) {\n $time = strtotime(drupal_substr($value, 0, 19));\n }\n }\n return $time;\n }", "function standard_date_time2($date) {\n\t$timestamp = strtotime($date);\n\t$fdate=date('d M, Y h:i A', $timestamp);\n\treturn $fdate;\n\t}", "function showDate($timestamp) {\r\n if ($timestamp > 10000000000)\r\n $rtn = date(\"M d Y H:i:s (J)\", $timestamp/1000);\r\n else\r\n $rtn = date(\"M d Y H:i:s \", $timestamp);\r\n\r\n return $rtn;\r\n}", "public static function get_timestamp($value)\n\t{\n\t\t$date = isset($value[\"date\"]) ? $value[\"date\"] : \"\";\n\t\t$time = isset($value[\"time\"]) ? $value[\"time\"] : \"\";\n\t\t$day = $month = $year = $hour = $min = 0;\n\n\t\tif (!empty($date))\n\t\t{\n\t\t\tlist($day, $month, $year) = explode(\".\", $date, 3);\n\t\t}\n\n\t\tif (!empty($time))\n\t\t{\n\t\t\tlist($hour, $min) = explode(\":\", $time, 2);\n\t\t}\n\n\t\t$timestamp = $year ? mktime((int)$hour, (int)$min, 0, (int)$month, (int)$day, (int)$year) : 0;\n\t\treturn $timestamp;\n\t}", "public static function date($format, $timestamp) {\n\t\tif (empty($timestamp)) {\n\t\t\treturn '';\n\t\t}\n\t\telse {\n\t\t\treturn date($format, $timestamp);\n\t\t}\n\t}", "function date_sql2timestamp($date)\r\n\t{\r\n\t\t$date = explode(\"-\", $date);\r\n\r\n\t\t$timestamp = mktime(0, 0, 0, $date[1], $date[2], $date[0]);\r\n\t\treturn $timestamp;\r\n\t}", "public function prepareDate($timestamp, $fieldType = 'DATETIME') {\n $date = '';\n if (!$timestamp === false && $timestamp > 0) {\n switch ($fieldType) {\n case 'DATE' :\n $date = date('Y-m-d', $timestamp);\n break;\n case 'TIME' :\n $date = date('H:i:s', $timestamp);\n break;\n case 'YEAR' :\n $date = date('Y', $timestamp);\n break;\n default :\n $date = date('Y-m-d H:i:s', $timestamp);\n break;\n }\n }\n return $date;\n }", "public static function asTimestamp($timestamp)\n {\n // Return numerics as is\n if (is_numeric($timestamp)) {\n return $timestamp;\n }\n\n // Convert datetime & return on success\n if (($ts = strtotime($timestamp)) !== false) {\n return $ts;\n }\n\n throw new \\InvalidArgumentException(\n 'No valid datetime or timestamp format: '.$timestamp\n );\n }", "function convertdate($date) {\r\n\t$date = strtotime($date);\r\n\treturn date(\"M j, Y g:ia\", $date);\r\n}", "public static function parseDatetime($timestamp){\n $timestamp = str_ireplace('T', ' ', $timestamp);\n $t = explode('-',$timestamp);\n if(count($t) == 4){\n unset($t[count($t)-1]);\n return implode('-', $t);\n }else{\n $t = explode('+',$timestamp);\n return $t[0];\n }\n }", "protected function formatTimestamp($timestamp)\n {\n if ($this->timestampType === 'date')\n {\n $timestamp = new MongoDate(round($timestamp));\n }\n else\n {\n if ($this->timestampType === 'string')\n {\n $timestamp = date('Y-m-d H:i:s', $timestamp);\n }\n else\n {\n $timestamp = $timestamp;\n }\n }\n\n return $timestamp;\n }", "function convDate($theDate) {\r\n return date(\"Y-m-d H:i:s\", strtotime($theDate));\r\n}", "public static function strtotime($timestamp, ORM $object = NULL)\n {\n return strtotime($timestamp) * 1000;\n }", "function epochToDate($epoch,$format){\n /*\n @epoch = 1483228800;\n $format= Y,m,d,j,n,H,i,s\n */\n $dt = new DateTime(\"@$epoch\");\n $convert= $dt->format($format);\n return $convert;\n}", "public static function makeDatetime($timestamp=0) {\n // If there is no parameter, return current time\n\n // current time\n $datetime = date('Ymd-His');\n return $datetime;\n\n }", "public static function localTimestamp($timestamp)\n {\n // Transfor to timestamp if required\n return date(\n 'Y-m-d H:i:s',\n self::asTimestamp($timestamp) + self::$settings[1] * 3600\n );\n }", "function en2timestamp($date,$sep='-') {\n\n\n $date = explode($sep,$date);\n $unix = mktime(0,0,0,$date[1],$date[2],$date[0]);\n\n\n return $unix;\n\n }", "public function GetAsTimestamp(){\r\n\t\t\t$timestamp = null;\r\n\t\t\tif( $this->year !== null && $this->month !== null && $this->day !== null ){\r\n\t\t\t\t$timestamp = strtotime( $this->year . '/' . $this->month . '/' . $this->day . ' ' . $this->hours . ':' . $this->minutes . ':' . $this->seconds );\r\n\t\t\t}\r\n\t\t\treturn $timestamp;\r\n\t\t}", "function convertdate($date) {\n\t$date = strtotime($date);\n\treturn date(\"M j, Y g:ia\", $date);\n}", "private function ConvertPayPalTimestampToDBDateTime($timestamp)\n {\n\tif(strlen($timestamp) == 0) {\n return \"\";\n\t}\n\t\t\n\treturn gmdate('Y-m-d H:i:s', strtotime($timestamp));\n }", "function format_date($timestamp) {\n //determine the format\n $format = get_string('date_format', 'rlreport_course_completion_by_cluster');\n\n //figure out the correct timezone\n $timezone = 99;\n\n if ($user_record = get_record('user', 'id', $this->userid)) {\n //determine the user's timezone\n $timezone = php_report::get_user_timezone($user_record, $user_record->timezone);\n }\n\n //perform the formatting\n return userdate($timestamp, $format, $timezone, false);\n }", "public static function timestampToDateString($timestamp)\n {\n $timezone = Session::get(SESSION_TIMEZONE, conf('user::default_timezone'));\n $format = Session::get(SESSION_DATE_FORMAT, conf('user::default_date_format'));\n return Utils::timestampToString($timestamp, $timezone, $format);\n }", "function ppConvertDate($date,$time='') {\n // Breakup the string using either a space, fwd slash, bkwd slash or colon as a delimiter\n $atok = strtok($date,\" /-\\\\:\");\n while ($atok !== FALSE) {\n $atoks[] = $atok;\n $atok = strtok(\" /-\\\\:\"); // get the next token\n }\n if ($time == '') {\n $timestamp = mktime(0,0,0,$atoks[1],$atoks[2],$atoks[0]);\n } else {\n $btok = strtok($time,\" /-\\\\:\");\n while ($btok !== FALSE) {\n $btoks[] = $btok;\n $btok = strtok(\" /-\\\\:\");\n }\n $timestamp = mktime($btoks[0],$btoks[1],$btoks[2],$atoks[1],$atoks[2],$atoks[0]);\n }\n return $timestamp;\n}", "function convertDate ($matches) {\n\t$year = array_pop($matches['year']); //Get last found year\n\t$year = ($year) ? $year : date('Y'); //If nothing found, use this year\n\t$month = array_pop($matches['month']); //Get last found month\n\t$month = ($month) ? $month : '01'; //If nothing found, use January\n\t$day = array_pop($matches['day']); //Get last found day\n\t$day = ($day) ? $day : '01'; //If nothing found, use 1st\n\t$time = date('U', strtotime($month . '/' . $day . '/' . $year)); //Convert to unix timestamp\n\treturn $time;\n}", "function time2string($timestamp=''){\n $meses = array('01' => 'enero','02'=>'febrero','03'=>'marzo','04'=>'abril','05'=>'mayo','06'=>'junio','07'=>'julio','08'=>'agosto','09'=>'septiembre','10'=>'octubre','11'=>'noviembre','12'=>'diciembre');\n $partes = preg_split('/[\\s,-]+/',$timestamp);\n $fecha = $partes[2].' de '.$meses[$partes[1]].' de '.$partes[0].' a las '.$partes[3];\n return $fecha;\n}", "protected function getDate($timestamp = null) {\r\n\t\treturn date($this->datePattern, $timestamp);\r\n\t}", "public static function date_to_unix_timestamp($value)\n\t{\n\t\tif (!preg_match('/(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)/', $value, $m)) return 0;\n\t\treturn mktime(0, 0, 0, $m[2], $m[3], $m[1]);\n\t}", "public static function dateToTimestamp ($date)\n\t{\n\t\n\t\treturn $date != '0000-00-00' ? \n\t\t\tmktime (\n\t\t\t\n\t\t\t\t0,\n\t\t\t\t0,\n\t\t\t\t1,\n\t\t\t\tsubstr ($date, 5, 2),\n\t\t\t\tsubstr ($date, 8, 2),\n\t\t\t\tsubstr ($date, 0, 4)\n\t\t\t \n\t\t): false;\n\t\n\t}", "function tstotime($timestamp){\n return date(\"Y-m-d H:i:s\", $timestamp);\n}", "protected function castCreatedAt(string $timestamp): void\n {\n $this->created_at = Datetime::fromString($timestamp);\n }", "function dateConvert($date,$format){\n //Casting created_at\n $date = new DateTime($date);\n $waktu = $date->Format($format);\n return $waktu;\n}", "public function date_to_timestamp($date_orig, $default_century = NULL) {\n $date_arr = explode('-', trim($date_orig));\n if (strlen(trim($date_arr[2])) == 2) {\n if ($default_century) {\n $year = $default_century + (int) trim($date_arr[2]);\n } else {\n $year = $default_century + (int) trim($date_arr[2]);\n if (date('Y') < $year) { $year = 1900 + (int) trim($date_arr[2]); }\n }\n } else {\n $year = trim($date_arr[2]);\n }\n $time = mktime(0, 0, 0, $date_arr[0], $date_arr[1], $year);\n return $time;\n }", "protected function makeTimestamp($timestamp = null)\n {\n if (is_null($timestamp)) {\n return $this->getTimestamp();\n }\n\n return (int) $timestamp;\n }", "public function toTimestamp(): ?int\n {\n $gc = new GregorianCalendar();\n $julianDay = $gc->ymdToJd(($this->year > 0 && $this->epoch) ? -$this->year : $this->year, $this->monthDigital ?: 1, $this->day ?: 1);\n return ($julianDay - 2440588) * 86400;\n }", "public function getDateByTimestamp($time_stamp)\n\t{\n\t\treturn date(\"Y-m-d\",$time_stamp);\n\t}", "function convertdateanglais($date){\n\t$ladate=explode('-',$date);\n\t$jour=$ladate[2];\n\t$moi=$ladate[1];\n\t$anne=$ladate[0];\n\t$madate=date(\"d/m/Y\", mktime(0, 0, 0, $moi, $jour, $anne));\n\treturn $madate;\n}", "private function convertTimestampFormat($timestamp)\n {\n return str_replace('T', ' ', substr($timestamp, 0, 19));\n }", "function _unix_timestamp($date) { return strtotime($date); }", "public static function siteDateFormat($timestamp)\n\t{\n\t\t$dt = new DateTime(\"@\".$timestamp);\n\t\t$dt->setTimeZone(new DateTimeZone(Config::date('timezone')));\n\t\treturn $dt->format(\"D d M Y\");\n\t}", "protected function mutateDate($value)\n\t{\n\t\tif ($value instanceof Timestamp)\n\t\t{\n\t\t\t// Convert to an int timestamp\n\t\t\t$value = $value->formatForApi()['seconds'];\n\t\t}\n\n\t\treturn parent::mutateDate($value);\n\t}", "function tstamptotime($tstamp) {\n // 1984-09-01T14:21:31Z\n sscanf($tstamp,\"%u-%u-%uT%u:%u:%uZ\",$year,$month,$day,\n $hour,$min,$sec);\n $newtstamp=mktime($hour,$min,$sec,$month,$day,$year);\n return $newtstamp;\n }", "function format_date($timestamp)\n{\n //format depends on wether we have a timestamp or not\n if (utf8_strlen($timestamp)>10) {\n $fstr = 'd M Y - G:i';\n } else {\n $fstr = 'd M Y';\n }\n if (utf8_substr($timestamp,0,10)=='0000-00-00') {\n return __('no date set yet');\n }\n if ($lang == \"de\") {\n return date($fstr, strtotime($timestamp));\n } else {\n return date($fstr, strtotime($timestamp));\n }\n}", "function timestamp_from_mysql($timestamp)\n{\n\tereg (\"([0-9]{2,4})[^0-9]([0-9]{1,2})[^0-9]([0-9]{1,2})\", $timestamp, $regs);\n\tereg (\"([0-9]{2,4})[^0-9]([0-9]{1,2})[^0-9]([0-9]{1,2})[^0-9]([0-9]{1,2})[^0-9]([0-9]{1,2})[^0-9]([0-9]{1,2})\", $timestamp, $regs);\n\n\tif (sizeof($regs)>1)\n\t{\n\t\tif (sizeof($regs)>4)\n\t\t{\n\t\t\t$date=mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$date=mktime(0,0,0,$regs[2],$regs[3],$regs[1]);\n\t\t}\n\t}\n\telse\n\t{\n\t\t$date=0;\n\t}\n\treturn $date;\n}", "static public function formatDateFromTimestamp($string) {\n if (self::$_static_handler == null) {\n self::$_static_handler = slDatabaseManager::getConnection();\n }\n $format = self::$_static_handler->getDateTimeFormat();\n return date($format, $string);\n }", "public static function timestamp( $format = null )\n {\n $_format = $format ?: static::DEFAULT_TIMESTAMP_FORMAT;\n\n return date( $_format );\n }", "function datetime_unix2mysql($timestamp) {\n\treturn date('Y-m-d H:i:s', $timestamp);\n}", "#[ReturnTypeWillChange]\n public function setTimestamp($timestamp)\n {\n $time = date('Y-m-d H:i:s', $timestamp);\n\n return self::parse($time, $this->timezone, $this->locale);\n }", "function app_date($format, $timestamp=false) {\n\tif(!$timestamp) $timestamp = date_time_get_time();\n\t\n\tif(function_exists('adodb_date')) {\t// We can have problems with mktime when using dates before 1970 or hight 2038\n\t\t$func_name = 'adodb_date';\n\t} else {\n\t\t$func_name = 'date';\n\t}\n\treturn $func_name($format, $timestamp);\n}", "public function timestamp(Carbon $timestamp = null);", "function format_timestamp_for_display($timestamp)\n{\n return (new Carbon($timestamp))->format('Y-m-d');\n}", "private function castToDate($value)\n {\n if ($value instanceof \\DateTimeInterface) {\n return \\DateTimeImmutable::createFromFormat('Y-m-d H:i:s.u', $value->format('Y-m-d H:i:s.u'), $value->getTimezone());\n }\n if (is_numeric($value)) {\n return \\DateTimeImmutable::createFromFormat(\\DateTimeImmutable::ATOM, date(\\DateTimeImmutable::ATOM, (int) $value));\n }\n try {\n // Try to parse using database connection format\n $date = \\DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $value);\n } catch (\\InvalidArgumentException $e) {\n // fallback to ISO8601 standard if format does not match database connection format\n $date = \\DateTimeImmutable::createFromFormat(\\DateTime::ATOM, $value);\n }\n return $date ?: \\DateTimeImmutable::createFromFormat(\\DateTime::ATOM, $value);\n }", "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }" ]
[ "0.74381036", "0.7322488", "0.72433805", "0.69473547", "0.6741611", "0.66450506", "0.66304356", "0.65097284", "0.650551", "0.6433931", "0.64317894", "0.6424325", "0.64019936", "0.63656056", "0.63537073", "0.63526845", "0.63486326", "0.6313071", "0.6284629", "0.6263229", "0.6259075", "0.6256242", "0.6236009", "0.6195922", "0.6191219", "0.61733615", "0.61504996", "0.6111441", "0.60669184", "0.60650635", "0.60581905", "0.6053329", "0.6047274", "0.604704", "0.6019977", "0.6002426", "0.596911", "0.5963", "0.59618", "0.59615016", "0.5955933", "0.5945157", "0.59356755", "0.59296346", "0.59063643", "0.5839858", "0.58314914", "0.58308244", "0.5794974", "0.57812023", "0.576599", "0.5715375", "0.5706078", "0.5694198", "0.56780654", "0.56775165", "0.56638134", "0.5659355", "0.56443655", "0.5637182", "0.56359005", "0.5634559", "0.56275904", "0.56154037", "0.5615021", "0.5614554", "0.56097823", "0.5594675", "0.55709743", "0.5521099", "0.5515578", "0.5504078", "0.5484491", "0.54727393", "0.54584277", "0.54399204", "0.543514", "0.54332113", "0.5431933", "0.54300886", "0.54290575", "0.5426756", "0.54226273", "0.54187", "0.5413093", "0.5410291", "0.54089224", "0.54085565", "0.5407363", "0.54065466", "0.54017264", "0.5399376", "0.5343427", "0.5335771", "0.53340673", "0.5332086", "0.5328655", "0.532376", "0.53212845", "0.53019553" ]
0.68328345
4
Limit the number of characters
function truncate($text) { $max_char=500; // Text length is over the limit if (strlen($text)>$max_char){ // Define maximum char number $text = substr($text, 0, $max_char); // Get position of the last space $position_space = strrpos($text, " "); $text = substr($text, 0, $max_char); // Add "..." $text = $text." ..."; } // Return the text return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLengthLimit()\n {\n }", "function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}", "function checkCharacterLimit( $x )\n\t{\n\t\tif( !empty( $x ) && strlen($x) <= 50 )\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function setMaxLength($maxLength) {}", "public function limitLetters($text){\n\n\t\t$length = strlen($text);\n\t\t\n\t\t$res = \"\";\n\n\t\tif($length < 108){\n\n\t\t\t$res = $text;\n\t\n\t\t}else{\n\n\t\t\t$res = substr($text, 0, 108);\n\t\t\n\t\t}\n\n\t\treturn $res . ' ...';\n\t}", "function limitChars($text, $limit = 200, $more = ' ... ')\n{\n $text = mb_substr($text, 0, $limit);\n if (mb_substr($text, mb_strlen($text) - 1, 1) && mb_strlen($text) == $limit) {\n $textReturn = mb_substr($text, 0, mb_strlen($text) - mb_strlen(strrchr($text, ' ')));\n if (!empty($textReturn)) {\n return $textReturn . $more;\n }\n }\n return $text;\n}", "public function setMaxLength($length);", "function _char_limit($str, $length, $minword = 3)\n {\n $sub = '';\n $len = 0;\n \n foreach (explode(' ', $str) as $word)\n {\n $part = (($sub != '') ? ' ' : '') . $word;\n $sub .= $part;\n $len += strlen($part);\n \n if (strlen($word) > $minword && strlen($sub) >= $length)\n {\n break;\n }\n }\n \n return $sub . (($len < strlen($str)) ? '...' : '');\n\n }", "public function increaseLength($minLength = 100) {}", "public function increaseLength($minLength = 100) {}", "function alaya_truncate($full_str,$max_length) {\n\tif (mb_strlen($full_str,'utf-8') > $max_length ) {\n\t $full_str = mb_substr($full_str,0,$max_length,'utf-8').'...';\n\t}\n\t$full_str = apply_filters('alaya_truncate', $full_str);\nreturn $full_str;\n}", "public function setMaxUsernameLength($length);", "function truncate_max($string, $limit, $break=\" \", $pad=\"...\") { // return with no change if string is shorter than $limit \n\tif(strlen($string) <= $limit) return $string; \n\t$string = substr($string, 0, $limit); \n\tif(false !== ($breakpoint = strrpos($string, $break))) \n\t{ $string = substr($string, 0, $breakpoint); } \n\treturn $string . $pad; \n}", "function limitar($sString, $iLimite) {\n\n if ( strlen($sString) > $iLimite ) {\n $sString = mb_substr($sString, 0, $iLimite - 3) . '...';\n } else {\n $sString = mb_substr($sString, 0, $iLimite);\n }\n\n return $sString;\n}", "function show_limit($val,$limit = 20){\n\t$str = substr($val, 0, $limit);\n\tif(strlen($val) > $limit) $str .= \"...\";\n\treturn $str;\n}", "function acoc_max_charlength($charlength, $text = NULL) {\n\tif ($text) {\n\t\t$excerpt = $text;\n\t} else {\n\t\t$excerpt = get_the_excerpt();\n\t}\n\n\t$charlength++;\n\tif (strlen($excerpt)>$charlength) {\n\t\t$subex = substr($excerpt,0,$charlength-5);\n $exwords = explode(\" \",$subex);\n\t\t$excut = -(strlen($exwords[count($exwords)-1]));\n\t\tif ($excut<0) {\n\t\t\treturn substr($subex,0,$excut);\n\t\t} else {\n\t\t\treturn $subex;\n\t\t}\n\t\treturn '..';\n\t} else {\n\t\treturn $excerpt;\n\t}\n}", "protected static function _maxLength() {\n if (self::$_ruleValue) {\n if (strlen(trim(self::$_elementValue)) > self::$_ruleValue) {\n self::setErrorMessage(\"Enter at most \" . self::$_ruleValue . \" charachters only\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "public function increaseLength($minLength = 100);", "public function param_character_limit($value = 0)\n {\n return form_input(array(\n 'type' => 'text',\n 'name' => 'character_limit'\n ), $value);\n }", "function LimitCharacters($limit = 20, $add = \"...\") {\n\t\t$value = trim(strip_tags($this->value));\n\t\t\n\t\t// Content html text to plan text before sub string-ing\n\t\t// to cutting off part of the html entity character\n\t\t// For example, &amp; because &am\n\t\t$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');\n\t\t$value = (strlen($value) > $limit) ? substr($value, 0, $limit) . $add : $value;\n\t\t\n\t\t// Convert plan text back to html entities \n\t\t$value = htmlentities($value, ENT_COMPAT, 'UTF-8');\n\t\t\n\t\treturn $value;\n\t}", "public function getMaxUsernameLength();", "function myTruncate($string, $limit=10, $pad=\"...\") {\n if(strlen($string) <= $limit) return $string;\n $string = substr($string, 0, $limit) . $pad;\n return $string;\n }", "public function getMaxLength() {}", "public function getMaxChars()\n {\n return $this->maxChars;\n }", "function medigroup_mikado_excerpt_length($length) {\n\n if(medigroup_mikado_options()->getOptionValue('number_of_chars') !== '') {\n return esc_attr(medigroup_mikado_options()->getOptionValue('number_of_chars'));\n } else {\n return 45;\n }\n }", "function print_content_char_limit($content,$char_limit , $end_string){\n echo substr($content, 0,$char_limit).$end_string;\n}", "function acf_get_truncated($text, $length = 64)\n{\n}", "abstract public function increaseLength($length = 100);", "function voyage_mikado_excerpt_length($length) {\n\n if(voyage_mikado_options()->getOptionValue('number_of_chars') !== '') {\n return esc_attr(voyage_mikado_options()->getOptionValue('number_of_chars'));\n } else {\n return 45;\n }\n }", "function limit_content($title,$len) {\n if (str_word_count($title) > $len) {\n $keys = array_keys(str_word_count($title, 2));\n $title = substr($title, 0, $keys[$len]);\n }\n return $title;\n}", "protected function getCharacterLimit()\n {\n $charLimit = static::CHAR_LIMIT_DEFAULT;\n if ($this->isUsingExpectedLengthAsCharLimit()) {\n $charLimit = $this->interaction->getExpectedLength();\n }\n\n return $charLimit;\n }", "public function getMaxLength();", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "protected function limit_length($string, $limit = 127)\n {\n // As the output is to be used in http_build_query which applies URL encoding, the string needs to be\n // cut as if it was URL-encoded, but returned non-encoded (it will be encoded by http_build_query later).\n $url_encoded_str = rawurlencode($string);\n\n if (strlen($url_encoded_str) > $limit) {\n $string = rawurldecode(substr($url_encoded_str, 0, $limit - 3) . '...');\n }\n return $string;\n }", "public function setMaxChars($value)\n {\n if (is_int($value) === false)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value');\n if ($value <= 0)\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter = value; value must be greater than 0.');\n \n $this->maxChars = $value;\n }", "function be_excerpt_length( $length ) { \n\t\n\t$length = '40'; \n\t\n\treturn $length;\n\t \n\t}", "function ks_acf_character_limit_markup($field) {\n $class_list = explode(' ', $field['wrapper']['class']);\n \n if (!in_array('no-char-count', $class_list) && $field['maxlength']) { ?>\n <p class=\"ks-char-count\"><span class=\"ks-char-count__current\"><?php echo strlen(iconv('utf-8', 'utf-16le', str_replace(PHP_EOL, ' ', $field['value']))) / 2; ?></span>/<?php echo $field['maxlength']; ?> characters</p>\n <?php }\n}", "function testMaxlen(){\n\t\t#mdx:maxlen\t\t\n\t\tParam::get('description')->filters()->maxlen(30, \"Description must be less than %d characters long!\");\n\t\t$error = Param::get('description')\n\t\t\t->process(['description'=>str_repeat('lorem ipsum', 10)])\n\t\t\t->error;\n\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 30\", $error);\n\t}", "function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }", "public function setLength($length);", "public function remainingChars();", "public function setTextLimit($l = 150)\n {\n $this->shorteningLimit = $l;\n }", "public static function limit($value, $limit = 100, $end = '...'){\n if(mb_strwidth($value, 'UTF-8') <= $limit){\n return $value;\n }\n\n return rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')) . $end;\n }", "public function getMinUsernameLength();", "public function getMaxChars()\n {\n return intval($this->maxChars);\n }", "abstract public function _limit($str, $limit, $offset = false);", "function the_excerpt_max_charlength($charlength) {\n $excerpt = get_the_excerpt();\n $charlength++;\n if(strlen($excerpt)>$charlength) {\n $subex = substr($excerpt,0,$charlength-5);\n $exwords = explode(\" \",$subex);\n $excut = -(strlen($exwords[count($exwords)-1]));\n if($excut<0) {\n echo substr($subex,0,$excut);\n } else {\n \t echo $subex;\n }\n echo ' <a href=\"'.get_permalink().'\"> Read more ...</a>';\n } else {\n\t echo $excerpt;\n }\n}", "function stringTruncation2($string, $limit, $pad)\n{\n if(strlen($string) <= $limit)\n { return $string;\n }\n else \n { $string = substr($string, 0, $limit - 3);\n return $string . $pad;\n }\n}", "function limit_text($text, $limit) {\n\tif (str_word_count($text, 0) > $limit) {\n\t\t$words = str_word_count($text, 2);\n\t\t$pos = array_keys($words);\n\t\t$text = substr($text, 0, $pos[$limit]) . '...';\n\t}\n\treturn $text;\n}", "public function setMaxLength($length) {\n $this->maxlength = $length;\n }", "static function limit(string $s, int $limit = 100, string $end = '...'): string {\n if (mb_strlen($s) <= $limit) {\n return $s;\n }\n error_if(mb_strlen($end) >= $limit, \"useless Str::limit('', limit, end) combination\");\n\n return mb_strimwidth($s, 0, $limit, $end);\n }", "function str_limit($value, $limit = 100, $end = '...')\n {\n return Str::limit($value, $limit, $end);\n }", "function cut_carac($texte, $max){\n\t$texte = strip_shortcodes(strip_tags($texte));\n\tif(strlen($texte)>=$max){\n\t$texte = substr($texte,0,$max);\n\t$espace = strrpos($texte,\" \");\n\tif($espace)\n\t$texte = substr($texte,0,$espace);\n\t$texte = $texte.\"...\";\n\t}\n\t$texte = trim(str_replace(\"&nbsp;\", ' ', $texte));\n\treturn $texte;\n}", "function str_limit($value, $limit = 100, $end = '...')\n {\n return Str::limit($value, $limit, $end);\n }", "function GetShorteningForLargeText($strValue, $cNumberOfChars)\n{\n\t$ret = runner_substr($strValue, 0, $cNumberOfChars );\n\t\t\n\treturn runner_htmlspecialchars($ret);\n}", "public function getTextLength();", "function adr_link_length($link, $max)\n{\n\tif (strlen($link) > $max)\n\t\t$newlink = substr($link, 0, ($max - 3)) .'...';\n\telse\n\t\t$newlink = $link;\nreturn $newlink;\n}", "static function limit_content($str, $length)\n {\n $str = strip_tags($str);\n $str = str_replace('[/', '[', $str);\n $str = strip_shortcodes($str);\n $str = explode(\" \", $str);\n return implode(\" \", array_slice($str, 0, $length));\n }", "function mt_filter_excerpt_length($length) {\n\treturn 20;\n }", "function edd_stripe_max_length_statement_descriptor( $html, $args ) {\n\tif ( 'stripe_statement_descriptor' !== $args['id'] ) {\n\t\treturn $html;\n\t}\n\n\t$html = str_replace( '<input type=\"text\"', '<input type=\"text\" maxlength=\"22\"', $html );\n\n\treturn $html;\n}", "public function limitChars($string, $check_len, $upto, $ret = false) {\n\n $string = ucfirst(strip_tags($string));\n\n\n\n\n\n if (strlen($string) > $check_len) {\n\n\n\n $temp = substr($string, 0, $upto);\n\n $temp.=\"...\";\n\n if ($ret)\n return $temp;\n else\n echo $temp;\n }\n\n else {\n\n if ($ret)\n return $string;\n else\n echo $string;\n }\n }", "function truncate($text, $limit = 40)\n{\n if (str_word_count($text, 0) > $limit) {\n $words = str_word_count($text, 2);\n $pos = array_keys($words);\n $text = mb_substr($text, 0, $pos[$limit], 'UTF-8') . '...';\n }\n\n return $text;\n}", "public function setMaxChars($value)\n {\n if (!is_int($value))\n throw new SystemException(SystemException::EX_INVALIDPARAMETER, 'Parameter \\'value\\' must be of type \\'int\\'');\n $this->maxChars = $value;\n }", "public function validateCharLimit(string $attribute)\n {\n if ($this->charLimit) {\n $columnTypeMax = Db::getTextualColumnStorageCapacity($this->columnType);\n\n if ($columnTypeMax && $columnTypeMax < $this->charLimit) {\n $this->addError($attribute, Craft::t('app', 'Character Limit is too big for your chosen Column Type.'));\n }\n }\n }", "function reduce_string_by_chars($string, $max_chars)\n{\n\tif(strlen($string) > $max_chars){\n\t\t$string = substr($string, 0, $max_chars).\"..\";\n\t}\n\t\n\treturn $string;\n}", "function str_limit($value, $limit = 100, $end = '...')\n\t\t{\n\t\t\t\treturn Illuminate\\Support\\Str::limit($value, $limit, $end);\n\t\t}", "function limitText($string, $limit = 50, $break = \" \", $pad = \"\") {\n\tif(strlen($string) <= $limit)\n\t\treturn $string;\n\t$string = substr($string, 0, $limit);\n\tif(false !== ($breakpoint = strrpos($string, $break))){\n\t\t$string = substr($string, 0, $breakpoint);\n\t}\n\treturn $string . $pad;\n}", "function truncate($string, $limit, $break=\".\", $pad=\"...\") {\n \tif(strlen($string) <= $limit) return $string;\n \t// is $break present between $limit and the end of the string?\n \tif(false !== ($breakpoint = strpos($string, $break, $limit)))\n \t{ if($breakpoint < strlen($string) - 1)\n \t{ $string = substr($string, 0, $breakpoint) . $pad; } }\n \n \tif (strlen($string) < 400)\n \t{\n \treturn $string;\n \t}\n \n \n \n \t// return with no change if string is shorter than $limit\n \tif(strlen($string) <= $limit) return $string;\n \n \t$string = substr($string, 0, $limit);\n \tif(false !== ($breakpoint = strrpos($string, $break))) {\n \t$string = substr($string, 0, $breakpoint);\n \t}\n \n \treturn $string . $pad;\n }", "function funcs_cutLength($string, $length, $word_length = null,$act_length = null){\n\t$string = (!is_null($string))?trim($string):'';\n\t//do not check the size of the string if we already know it\n\tif (is_null($act_length))$act_length=strlen($string);\n\tif (!is_null($word_length) && !empty($string)){\n\t\t//in the future use this instead of calling this whole function\n\t\t$string = wordwrap($string,$word_length,\"\\n\",1);\n\t}\n\tif (!is_null($length) && $act_length>$length && $length>4){\n\t\t$string = substr($string,0,$length-3).'...';\n\t}\n\treturn $string;\n}", "function elzero_extend_excert_length($length) {\n return 30;\n}", "function truncate($string, $length, $stopanywhere=false)\n{\n if (strlen($string) > $length)\n {\n //limit hit!\n $string = substr($string, 0, ($length - 3));\n if ($stopanywhere)\n {\n //stop anywhere\n $string .= '...';\n } else\n {\n //stop on a word.\n $string = substr($string, 0, strrpos($string, ' ')) . '...';\n }\n }\n return $string;\n}", "function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }", "function my_string_limit_char($excerpt, $substr=0)\r\n{\r\n\r\n\t$string = strip_tags(str_replace('...', '...', $excerpt));\r\n\tif ($substr>0) {\r\n\t\t$string = substr($string, 0, $substr);\r\n\t}\r\n\treturn $string;\r\n\t\t}", "function myTruncate2($string, $limit, $break=\" \", $pad=\"...\") {\n\nif(strlen($string) <= $limit) \n\nreturn $string; \n\n$string = substr($string, 0, $limit); \n\nif(false !== ($breakpoint = strrpos($string, $break))) \n\n{ \n\n$string = substr($string, 0, $breakpoint); \n\n} \n\nreturn $string . $pad; \n\n}", "public function limit($length)\n {\n $this->randomStringLength = $length;\n return $this;\n }", "function has_max_length($value, $max) {\r\n\treturn strlen($value) <= $max;\r\n}", "function character_limiter($str, $n = 500, $end_char = '&#8230;')\n {\n if (strlen($str) < $n)\n {\n return $str;\n }\n $str = strip_tags($str);\n $str = preg_replace(\"/\\s+/\", ' ', str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), ' ', $str));\n\n if (strlen($str) <= $n)\n {\n return $str;\n }\n\n $out = \"\";\n foreach (explode(' ', trim($str)) as $val)\n {\n $out .= $val.' ';\n\n if (strlen($out) >= $n)\n {\n $out = trim($out);\n return (strlen($out) == strlen($str)) ? $out : $out.$end_char;\n }\n }\n }", "function t_excerpt_length(){\n\t// sets the amount of characters an excerpt contains\n\treturn 50;\n}", "public static function limit($value, $limit = 100, $end = '...')\n {\n if (mb_strwidth($value, 'UTF-8') <= $limit) {\n return $value;\n }\n\n return rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')) . $end;\n }", "function\n\ttrimOption($option, $maxlength)\n\t{\n\t\t$option = substr($option, 0, $maxlength - 3);\n\t\t$option = preg_replace('/\\w*$/', '...', $option, 1);\n\t\treturn($option);\n\t}", "function tn_custom_excerpt_length( $length ) {\r\n\t\treturn 15;\r\n\t\t}", "function set_length($length) {\n $this->length = $length;\n }", "public function setMinUsernameLength($length);", "public static function limitChars($string, $limit = 100, $append = '...')\n {\n if (self::length($string) <= $limit) {\n return $string;\n }\n return rtrim(self::strPart($string, 0, $limit)) . $append;\n }", "function uwmadison_excerpt_length( $length ) {\n\t\treturn 40;\n\t}", "function wpseed_shorten($string,$length,$append=\"...\") {\n $string = trim($string);\n if(strlen($string) > $length) {\n $string = substr($string, 0, $length);\n $string .= $append;\n }\n return $string;\n }", "function custom_excerpt_length(){\n\t\treturn 25;\n\t}", "function str_cut ($str, $size) {\n\t// is the string already short enough?\n\t// we count '…' for 1 extra chars.\n\tif( strlen($str) <= $size+1 ) {\n\t\treturn $str;\n\t}\n\n\treturn substr($str, 0, $size) . '…';\n}", "function limitText($string, $limit){\n\t$string = strip_tags($string);\n\tif (strlen($string) > $limit) {\n\t\t// truncate string\n\t\t$stringCut = substr($string, 0, $limit);\n\t\t// make sure it ends in a word so assassinate doesn't become ass...\n\t\t$string = substr($stringCut, 0, strrpos($stringCut, ' ')); \n\t}\n\treturn $string;\t\t\t\t\n}", "function tronquer_texte($texte, $longeur_max)\n{\n if (strlen($texte) > $longeur_max)\n {\n $texte = substr($texte, 0, $longeur_max);\n $dernier_espace = strrpos($texte, \"\");\n $texte = substr($texte, 0, $dernier_espace).\"...\";\n }\n return $texte;\n}", "function truncate($input,$maxChars,$maxWords=0,$more='...'){\r\n\t//Make sure the input is not just spaces\r\n\tif ((trim($input) != \"\")){\r\n\t\t//split all the words in the input text by using space\r\n\t\t$words = preg_split('/\\s+/', $input);\r\n\r\n\t\t//Check if the maximum words is greater than 0\r\n\t\tif ($maxWords > 0)\r\n\t\t$words = array_slice($words, 0, $maxWords);\r\n\r\n\r\n\t\t$words = array_reverse($words);\r\n\r\n\t\t$chars = 0;\r\n\t\t$truncated = array();\r\n\r\n\t\twhile(count($words) > 0)\r\n\t\t{\r\n\t\t $fragment = trim(array_pop($words));\r\n\t\t $chars += strlen($fragment);\r\n\r\n\t\t if($chars > $maxChars) break;\r\n\r\n\t\t $truncated[] = $fragment;\r\n\t\t}\r\n\r\n\t\t$result = implode($truncated, ' ');\r\n\r\n\t\tif (($result == \"\") || ($maxWords == 0)){\r\n\t\t\treturn substr($input, 0,$maxChars).$more;\r\n\t\t}\r\n\r\n\t\treturn $result . ($input == $result ? '' : $more);\r\n\t}\r\n\r\n}", "private function _truncate_text($text, $limit, $append='...') {\n\t if(strlen($text) > $limit) {\n\t $text = substr($text, 0, $limit);\n\t $text .= $append;\n\t }\n\t return $text;\n\t}", "function truncate($string, $limit, $break=\" \", $pad=\"...\") {\n\t if(strlen($string) <= $limit) return $string; \n\t // is $break present between $limit and the end of the string? \n\t if(false !== ($breakpoint = strpos($string, $break, $limit))) \n\t { \n\t \tif($breakpoint < strlen($string) - 1) \n\t \t{ \n\t \t\t$string = substr($string, 0, $breakpoint) . $pad; \n\t \t} \n\t } return $string; \n\t }", "function limit_word_count($title) {\n $len = 10; //change this to the number of words\n if (str_word_count($title) > $len) {\n $keys = array_keys(str_word_count($title, 2));\n $title = substr($title, 0, $keys[$len]);\n }\n return $title;\n}", "public function getLengthMax()\n {\n return $this->lengthMax;\n }", "function wpdocs_custom_excerpt_length( $length ) {\n return 26;\n\t\t}", "function myTruncate2($string, $limit, $break=\" \", $pad=\"...\")\n{\n if(strlen($string) <= $limit) return $string;\n\n $string = substr($string, 0, $limit);\n if(false !== ($breakpoint = strrpos($string, $break))) {\n $string = substr($string, 0, $breakpoint);\n }\n\n return $string . $pad;\n}", "function rls_media_excerpt($length) {\n return 25;\n}", "function xo_excerpt_length( $length ) {\n return 12;\n}", "private function limit_str($review, $length, $more_link_text='') {\n if (strlen($review['content']) > $length) {\n if (!$more_link_text) {\n $more_link_text = __('more');\n }\n\n return mb_substr($review['content'], 0, $length) . '...'\n . \" <a href=\\\"{$review['place']['main_url']}#{$review['id']}\\\">{$more_link_text}</a>\";\n }\n\n return $review['content'];\n }" ]
[ "0.75226694", "0.72688514", "0.7054722", "0.7050949", "0.696622", "0.69590634", "0.69365585", "0.68856686", "0.6882658", "0.68823355", "0.68553746", "0.6852002", "0.6807688", "0.67952406", "0.6773566", "0.6744496", "0.6731139", "0.6722464", "0.67012435", "0.6669037", "0.6663079", "0.66442263", "0.66428286", "0.66267085", "0.6609403", "0.6608614", "0.66029686", "0.6569029", "0.654937", "0.65470535", "0.653824", "0.6519268", "0.6509551", "0.6491331", "0.6479687", "0.64637244", "0.64575857", "0.64520246", "0.64401495", "0.64332354", "0.63990635", "0.63927096", "0.63857037", "0.63791436", "0.63679683", "0.63541466", "0.63471836", "0.6343355", "0.6339746", "0.6329836", "0.63213044", "0.63127565", "0.63096935", "0.63042563", "0.63036036", "0.63030916", "0.6301299", "0.6292197", "0.6288241", "0.62809753", "0.6278604", "0.62774557", "0.62693834", "0.6267746", "0.6261539", "0.62610275", "0.62607265", "0.6250937", "0.62392795", "0.6236428", "0.62290156", "0.6226222", "0.62237966", "0.6212972", "0.62106985", "0.620397", "0.6197322", "0.619586", "0.61871254", "0.6182085", "0.6179319", "0.6172224", "0.6170796", "0.6169482", "0.6169369", "0.6162627", "0.6162547", "0.6158393", "0.61562455", "0.6151257", "0.6148846", "0.6147933", "0.614399", "0.61402524", "0.6140119", "0.6139546", "0.61284894", "0.6122673", "0.61158705", "0.61090654" ]
0.67163205
18
Check if an offer is available
function isOfferAvailable($id) { $stmt = getDb()->prepare('SELECT `est_indispo_id` FROM `est_indispo` WHERE `offre_id`= ?'); $stmt->execute(array($id)); return($stmt->rowCount() == 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public static function is_available()\n {\n }", "abstract public function isAvailable() ;", "function isAvailable() ;", "function isAvailable() ;", "public function isAvailable(): bool;", "public function getIsAvailable() {}", "function isAvailable()\n {\n }", "public function hasOffers();", "public function getIsAvailable();", "function getIsAvailable() ;", "public static function isAvailable()\n\t{\n\t\treturn true;\n\t}", "public function hasOffer(OfferInterface $offer);", "public function isAvailable(): bool\n {\n return true;\n }", "function is_available($deal = null)\n\t{\n\t\t$available = true;\n\t\t\n\t\tif ($deal)\n\t\t{\n\t\t\t// Get bought and sold numbers\n\t\t\t$bought = $this->bought($deal->id);\n\t\t\t$sold = $deal->sold_number;\n\t\t\t\n\t\t\t// Based on number of coupons sold\n\t\t\tif ($bought >= $deal->f_maximum_coupons_per_user) $available = false;\n\t\t\tif ($sold >= $deal->f_maximum_coupons) $available = false;\n\t\t\t\n\t\t\t// Based on time\n\t\t\tif ($deal->time_left <= 0) $available = false;\n\t\t}\n\t\t\n\t\treturn $available;\n\t\t\n\t}", "public function getAvailable()\n {\n if (!$this->IsAvailable) {\n return false;\n }\n\n if (!$this->getAvailableFrom() && !$this->getAvailableTill()) {\n return false;\n } elseif ($this->validateDate() && $this->validateAvailability()) {\n return true;\n }\n\n return false;\n }", "public function isAvailable()\n {\n if ($this->archived) {\n return false;\n }\n\n $result = self::$db->fetchOne('select count(*) AS valid\n from jukebox.playlists\n inner join jukebox.playlist_availability on playlists.playlistid = playlist_availability.playlistid\n inner join jukebox.playlist_timeslot\n on playlist_availability.playlist_availability_id = playlist_timeslot.playlist_availability_id\n where playlists.playlistid = $1\n and playlist_availability.effective_from <= NOW()\n and (playlist_availability.effective_to is null or playlist_availability.effective_to >= NOW())\n and (\n day=EXTRACT(DOW FROM NOW())\n or (EXTRACT(DOW FROM NOW())=0 and day=7)\n )\n and start_time <= \"time\"(NOW())\n and end_time >= \"time\"(NOW())', [$this->getID()]);\n\n return $result['valid'] > 0;\n }", "public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "public function is_available()\n\t\t{\n\t\t\t$is_available = true;\n\t\t\t$iute_params = WC_Gateway_Iute_CRUD::get(IUTE_TABLE_PARAMS);\n\t\t\t$total = $this->get_order_total();\n\n\t\t\tforeach ($iute_params as $param) {\n\n\t\t\t\tif ($param->minAmount > $total or $param->maxAmount < $total) {\n\t\t\t\t\t$is_available = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $is_available;\n\t\t}", "public function getAvailable() : bool\n {\n return $this->available;\n }", "public function hasAvailableHotels()\n {\n return ($this->hotelCount > 0);\n }", "protected function isOfferValid ()\n {\n return $this->offerApplicableAmount >= $this->offer->minimum_order_amount;\n }", "public function isAvailable(): bool\n {\n return isset(\n $this->paymentToken,\n $this->shippingAddress,\n $this->billingAddress,\n $this->shippingMethod\n ) && $this->shippingMethod->getAvailable();\n }", "public function is_available() {\n\t\t$country = $this->get_transaction_address( 'country' );\n\n\t\treturn parent::is_available() && $this->ebanx_gateway->isAvailableForCountry( Country::fromIso( $country ) );\n\t}", "public function is_available() {\n\t\t$country = $this->get_transaction_address( 'country' );\n\n\t\treturn parent::is_available() && $this->ebanx_gateway->isAvailableForCountry( Country::fromIso( $country ) );\n\t}", "public function isAvailable($url) \n\t{\n\t\t$this->api->parseUrl($url);\n\t\treturn $this->api->call(['command' => 'check'])->response()['RRPCode'] == 210 ? true : false;\n\t}", "public function available();", "public function available();", "public function isAvailable() {\n $path = $this->path();\n return file_exists($path);\n }", "public function isAvailable($quote = null) {\n $available = parent::isAvailable($quote);\n if(!$available) return false;\n\n //T: Email checking will now be done before LIST request.\n return true;\n\n\n $email = $quote->getBillingAddress()->getEmail();\n\n if (strlen($email) == 0) {\n $email = $quote->getCustomerEmail();\n }\n\n if(strlen($email) == 0) return false;\n\n return true;\n }", "function is_available() {\n\n $is_available = ( 'yes' === $this->enabled ) ? true : false;\n\n if ($this->multi_currency_enabled) {\n if ( !in_array( get_woocommerce_currency(), array( 'RMB', 'CNY') ) && !$this->exchange_rate) {\n $is_available = false;\n }\n } else if ( !in_array( $this->current_currency, array( 'RMB', 'CNY') ) && !$this->exchange_rate) {\n $is_available = false;\n }\n\n return $is_available;\n }", "private function test_availability() {\r\n\r\n $this->add_log('test_availability: Testing ws availability...', 'DEBUG');\r\n\r\n $params = new stdClass();\r\n $params->from = @new SoapVar($this->sender, XSD_STRING, \"string\", \"http://www.w3.org/2001/XMLSchema\");\r\n $this->call_function('disponibilitat', $params);\r\n $this->add_log('test_availability: Server avalaible', 'DEBUG');\r\n }", "public function isAvailable()\n {\n $result = false;\n if (extension_loaded('apc')) {\n $memoryInfo = @apc_sma_info();\n $availableMemory = $memoryInfo['avail_mem'];\n\n // If more than 5MB free\n if ($availableMemory > (5 * 1024 * 1024)) {\n $result = true;\n }\n }\n return $result;\n }", "public function getAvailable()\n {\n return $this->available;\n }", "public function getAvailable()\n {\n return $this->available;\n }", "public function test_showAddToWishList_IsAvailableCannotCheckedOutCannotPlaceHolds_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(true);\r\n\t\t$this->prepareisCheckOutAvailable(false);\r\n\t\t$this->prepareIsPlaceHoldAvailable(false);\r\n\t\t\t\t\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertTrue($actual);\r\n\t}", "public function getAvailability()\n {\n if ($this->Capacity !== 0) {\n $sold = OrderItem::get()->filter(['BuyableID' => $this->ID])->count();\n $available = $this->Capacity - $sold;\n return $available < 0 ? 0 : $available;\n }\n\n // fallback to page availability if capacity is not set\n return $this->TicketPage()->getAvailability();\n }", "public function is_available() {\n\t\tif ( 'yes' === $this->enabled ) {\n\t\t\tif ( ! $this->testmode && is_checkout() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( ! $this->secret_key || ! $this->publishable_key ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function complete_offer() {\n\n $collectorId = $_SESSION['demo']['user_id'];\n $offerId = $_GET['offerId'];\n $check = mysql_query(\"SELECT status from offer WHERE offer_ID='$offerId'\");\n if ($check) {\n if (mysql_result($check, 0, 'status') == \"booked\") {\n if (mysql_query(\"UPDATE offer SET status ='collected' WHERE offer_ID ='$offerId'\"))\n return 1;\n else\n return -1;\n }\n else\n return -1;\n } else {\n return -1;\n }\n}", "public function isAvailable($quote = null) {\n\t\treturn true;\n\t}", "public function getAvailable()\n {\n return $this->available;\n }", "private function get_availability()\n\t{\n\t\treturn $this->m_availability;\n\t}", "public function isAvailable()\n {\n return $this->getTypeInstance(true)->isSalable($this)\n || Mage::helper('catalog/product')->getSkipSaleableCheck();\n }", "public function hasAvailablePlace($place)\n {\n\t\treturn $this->avalaible_place >= $place;\n }", "public function adaptersAvailable()\n {\n return count($this->getAdapters()) > 0;\n }", "public function is_available() {\n\t\tif ( 'yes' !== $this->enabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->public_key || ! $this->private_key ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function is_available() {\n\t\treturn $this->secret_api_key && $this->publishable_api_key;\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/mfb_myflyingbox/offer');\n }", "public function isAvailable()\n\t{\n\t\treturn parent::isAvailable() && ( $this->values['languageid'] === null\n\t\t\t|| $this->getLanguageId() === null\n\t\t\t|| $this->getLanguageId() === $this->values['languageid'] );\n\t}", "function unlock_offer() {\n\n $collectorId = $_SESSION['demo']['user_id'];\n $offerId = $_GET['offerId'];\n $check = mysql_query(\"SELECT status from offer WHERE offer_ID='$offerId'\");\n if ($check) {\n if (mysql_result($check, 0, 'status') == \"booked\") {\n if (mysql_query(\"UPDATE offer SET status ='available' WHERE offer_ID ='$offerId'\"))\n return 1;\n else\n return -1;\n }\n else\n return -1;\n } else {\n return -1;\n }\n}", "private function isApiAvailable() {\n\t\treturn get_option(\"wp_broadbean_ipavailibility\") == 1;\n\t}", "public function is_available() {\n if ($this->enabled == \"yes\") {\n if (!is_ssl() && !$this->testmode) {\n return false;\n }\n // Required fields check\n if (!$this->secret_key || !$this->publishable_key) {\n return false;\n }\n return true;\n }\n return false;\n }", "public function getAvailability()\n {\n return $this->availability;\n }", "public function getAvailability()\n {\n return $this->availability;\n }", "public function isAvailable()\n\t{\n\t\ttry {\n\t\t\t$output = $this->execute('x = 3;');\n\t\t} catch (ExternalRuntimeException $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function check_availability() {\n \n if ( ( $this->client_id != '' ) AND ( $this->client_secret != '' ) ) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n }", "function checkAvailableProduct($prodNum )\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from products_tb where id= '\".$prodNum.\"' and status ='1' \"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function getOffer()\n {\n return $this->offer;\n }", "function isMyOffer($offerId){\n if (isUserConnected()){\n $result = getDb()->query(\"SELECT * FROM `personne` WHERE `login` = '\".$_SESSION['login'].\"'\");\n $personne = $result->fetch();\n $stmt = getDb()->prepare('SELECT * FROM `creer` WHERE `offre_id`= ? AND `personne_id`= ?');\n $stmt->execute(array($offerId, $personne['personne_id']));\n if($stmt->rowCount() >=1) {\n return true;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n}", "public function isAvailable()\n {\n try {\n /** @var Response $result */\n $result = $this->get('/', $this->getGuzzleOptions());\n\n if ($result->getStatusCode() == 200) {\n return true;\n }\n } catch (RequestException $ex) {\n $msg = sprintf(\"Tika unavailable - %s\", $ex->getMessage());\n Injector::inst()->get(LoggerInterface::class)->info($msg);\n\n return false;\n }\n }", "public function retrieveOfferData() {\n\t\t\tif (!$this->availableOffers) {\n\t\t\t\t// affiliate has to be logged in\n\t\t\t\tif ($this->affiliateID) {\n\t\t\t\t\t### IMPLEMENT AFFILIATE EXCLUSIVE OFFERS ###\n\t\t\t\t\t$result = $this->dbh->query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `offers` \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `availability` IN ('affiliate', 'all') \n\t\t\t\t\t\t\t\t\t\t\t\t\tAND `startDate` <= NOW() \n\t\t\t\t\t\t\t\t\t\t\t\t\tAND `endDate` > NOW()\");\n\t\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t\t$this->availableOffers = array();\n\t\t\t\t\t\twhile ($row = $result->fetchAssoc()) {\n\t\t\t\t\t\t\t$this->availableOffers[] = $row;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function is_available() {\n //by default, make the report available,\n //override in child class if necessary to restrict\n return true;\n }", "public function isAvailable($quote = null)\n {\n return Mage::getStoreConfig('payment/vindi_creditcard/active')\n && Mage::helper('vindi_subscription')->getKey();\n }", "public function isAvailableForEvent(Event $event)\n {\n $availability = AvailabilityQuery::create()\n ->filterByUser($this)\n ->filterByEvent($event)\n ->findOne();\n\n if (is_null($availability)) {\n return;\n }\n\n return (bool) $availability->getAvailable();\n }", "protected function loadAvailability()\n {\n if ($this->available === null) {\n $this->available = $this->isSearchEngineAvailable();\n }\n return $this->available;\n }", "protected function isServiceAvailable()\n {\n return (boolean) $this->extConfig['providers'][strtolower($this->provider)]['enabled'];\n }", "function isAvailable($fromDate, $duration) {\n \treturn AdvertisementQuery::create()\n\t\t\t\t->filterByBillboard($this)\n\t\t\t\t->filterByPublished($fromDate, $duration)\n\t\t\t\t->count() == 0;\n \t}", "public function testRequestItemsAvailable()\n {\n $response = $this->get('/api/items/available');\n\n $response->assertStatus(200);\n }", "abstract function is_premium();", "public function is_available($package) {\n return $this->is_enabled();\n }", "public function test_showAddToWishList_AddToWishListIsNotAvailable_returnTrue()\r\n\t{\r\n\t\t$this->prepareisAddToWishListAvailable(false);\r\n\t\t$actual = $this->service->showAddToWishList();\r\n\t\t$this->assertFalse($actual);\r\n\t}", "private function isAvailable($program) {\n \n $user_id = $this->getUser($this->data['cnp']);\n \n $statement = 'SELECT program_id FROM booking WHERE user_id = ?;';\n try {\n $statement = $this->db->prepare($statement);\n $statement->execute(array($user_id));\n $results = $statement->fetchAll(\\PDO::FETCH_ASSOC);\n // check if other bookings have same date\n if (!empty($results)) {\n foreach ($results as $result) {\n if ($result['program_id'] == $program->id) {\n // if same program, do nothing\n continue;\n }\n if (!$this->programExists($result['program_id'])) {\n // check if program was deleted\n continue;\n }\n // load other programs\n $result = $this->getProgram($result['program_id']);\n // validate date\n if (!$this->checkDate($program->start_date, $program->end_date, $result->start_date, $result->end_date)) {\n exit('You are already booked for this period');\n }\n }\n return TRUE;\n }\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n }\n return FALSE;\n }", "function isAvailable()\r\n\t{\r\n return $this->oMemcache == null ? false : true;\r\n }", "public static function isApplicable(): bool;", "public function checkAvailableCommercialPromotion($user_id, $offer_id) {\n $this->__createLog('Entering into class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [checkAvailableCoupn] with userid: '.$user_id. ' and offerid:'.$offer_id);\n $em = $this->em;\n $count = 0;\n $commercial_promotion = $em->getRepository('CommercialPromotionBundle:CommercialPromotion')\n ->getComercialPromotion($offer_id);\n if ($commercial_promotion[\"response\"][\"0\"][\"id\"] > 0 ) {\n $count = 1;\n }\n $this->__createLog('Exiting from class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [checkAvailableCoupn] with userid: '.$user_id.' and offer id: '.$offer_id. ' and count: '.$count);\n return $count;\n }", "public function isFull()\n {\n return ($this->getNumberOfAvailableForGet() == $this->getFridgeCapacity()) ? true : false;\n }", "abstract function has_paid_plan();", "public function isAlwaysAvailable(): bool\n {\n return $this->alwaysAvailable;\n }", "function ifAvailable($isbn,$con)\r\n\t{\r\n\t\t$result = mysqli_query($con, \"SELECT * from booksdb where isbn13 IN ('$isbn');\");\r\n\t\t$row = mysqli_fetch_array($result);\r\n\t\tif($row['copies'] == $row['rented'])\r\n\t\t{\r\n\t\t\treturn \"0\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$available = $row['copies'] - $row['rented'];\r\n\t\t\treturn $available;\r\n\t\t}\r\n\t}", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isAcquired() {}", "public function isAvailable($quote = null) {\n $checkResult = new StdClass;\n\n //Custom\n $flubitorder = Mage::helper('flubit')->isFlubitOrder();\n $validation = false;\n if ($flubitorder && $this->_code == 'flubitterms') {\n $validation = true;\n }\n\n $isActive = (bool) (int) $this->getConfigData('active', $quote ? $quote->getStoreId() : null);\n\n //Custom\n if ($validation) {\n $isActive = true;\n } else {\n $isActive = false;\n }\n\n $checkResult->isAvailable = $isActive;\n $checkResult->isDeniedInConfig = !$isActive; // for future use in observers\n Mage::dispatchEvent('payment_method_is_active', array(\n 'result' => $checkResult,\n 'method_instance' => $this,\n 'quote' => $quote,\n ));\n $magentoVersion = Mage::getVersion();\n if (version_compare($magentoVersion, '1.8', '>=')) {\n if ($checkResult->isAvailable && $quote) {\n $checkResult->isAvailable = $this->isApplicableToQuote($quote, self::CHECK_RECURRING_PROFILES);\n }\n } else if (version_compare($magentoVersion, '1.7', '>=')) {\n if ($checkResult->isAvailable) {\n $implementsRecurring = $this->canManageRecurringProfiles();\n // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last\n if ($quote && !$implementsRecurring && $quote->hasRecurringItems()) {\n $checkResult->isAvailable = false;\n }\n }\n } else {\n \n }\n\n return $checkResult->isAvailable;\n }", "public function isAcquired() {}", "public function isAcquired() {}" ]
[ "0.746508", "0.746508", "0.746508", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.7463234", "0.72600925", "0.71868265", "0.7112208", "0.7112208", "0.71068054", "0.70894974", "0.7087955", "0.7029218", "0.6990159", "0.69626755", "0.69542795", "0.68072504", "0.6783621", "0.675683", "0.6710586", "0.66879714", "0.6645419", "0.6614148", "0.66058475", "0.6549028", "0.6542676", "0.6478905", "0.6442611", "0.6442611", "0.6427408", "0.63453114", "0.63453114", "0.6302204", "0.627397", "0.62578344", "0.62163526", "0.620837", "0.6206325", "0.6206325", "0.6177905", "0.61616147", "0.6154808", "0.61487323", "0.6137093", "0.6129307", "0.6089862", "0.6083343", "0.6080692", "0.6064615", "0.60633", "0.60602176", "0.6039298", "0.6035143", "0.6032077", "0.601493", "0.59994054", "0.5994244", "0.5994244", "0.5983678", "0.5941336", "0.59156656", "0.58699197", "0.5859762", "0.58572215", "0.5833384", "0.5819387", "0.5810972", "0.5790844", "0.57803124", "0.57780474", "0.57742435", "0.5769313", "0.57622665", "0.5753131", "0.57509214", "0.5742584", "0.5719105", "0.5715771", "0.5706048", "0.57028985", "0.5699942", "0.5693304", "0.56871873", "0.5681898", "0.56733406", "0.5672233", "0.5671378", "0.5671378" ]
0.66977745
32
define the custom attributes
function init() { $this->defineAttribute('model', false, '', COMPONENT_TYPE_STRING); parent::init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAttributes();", "abstract protected function attributes();", "public function defineAttributes()\n\t{\n\t\treturn array();\n\t}", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }", "public function attributes();", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }", "function Hippo_Widget_Attributes() {\n\t\t\tnew Hippo_Widget_Attributes();\n\t\t}", "function getAdditionalAttributes() ;", "public function initAttribute();", "public function getCustomAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = 'procuralog';\n\t}", "function custom_add_artwork_attr( $attributes ){\n\t\t\t$attributes['class'] .= ' equalize col-xs-12 col-sm-6 col-md-4';\n\t\t\t$attributes['itemtype'] = 'http://schema.org/ArtworkArticle';\n\t\t\t// return the attributes\n\t\t\treturn $attributes;\n\t\t}", "public function setUserAttributes();", "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 get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "private function addAtrributesToCRUD() {\r\n if (!empty($this->__attributes)) {\r\n $this->myCRUD()->setAtributes($this->__attributes);\r\n }\r\n }", "public function defineAttributes()\n {\n return array(\n 'oauthProviderHandle' => AttributeType::Number,\n 'customScope' => AttributeType::Mixed,\n );\n }", "protected function customAttributes(): array\n {\n return [];\n }", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"widget\";\n\t}", "protected abstract function initializeAttributes(): array;", "public function buildAttributes()\n {\n $classes = new ClassFactory();\n $classes->add($this->default_class);\n\n if ($this->class) {\n foreach (explode(' ', $this->class) as $c) {\n $classes->add($c);\n }\n }\n\n $attr = new AttributeFactory();\n $attr->add('class', $classes->get());\n\n if ($this->role) {\n $attr->add('role', $this->role);\n }\n\n if ($this->id) {\n $attr->add('id', $this->id);\n }\n\n if ($this->aria_label) {\n $attr->add('aria-label', $this->aria_label);\n }\n\n if ($this->attributes) {\n foreach ($this->attributes as $key => $attribute) {\n $attr->add($key, $attribute);\n }\n }\n\n $this->data['attr'] = $attr->get();\n }", "public static function supportedAttributes();", "function _wp_add_global_attributes($value)\n {\n }", "function getAttributes()\n {\n }", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"assignments\";\n\t}", "public function getAttributes(){ }", "public function getAttributes()\n {\n }", "public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function attributes()\n {\n return [\n //\n ];\n }", "public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}", "public function attr() {\n\t\t\t\t$attr = [\n\t\t\t\t\t'class' => 'fusion-content-tb fusion-content-tb-' . $this->counter,\n\t\t\t\t\t'style' => '',\n\t\t\t\t];\n\n\t\t\t\t$attr = fusion_builder_visibility_atts( $this->args['hide_on_mobile'], $attr );\n\n\t\t\t\tif ( $this->args['animation_type'] ) {\n\t\t\t\t\t$attr = Fusion_Builder_Animation_Helper::add_animation_attributes( $this->args, $attr );\n\t\t\t\t}\n\n\t\t\t\t$attr['style'] .= Fusion_Builder_Margin_Helper::get_margins_style( $this->args );\n\n\t\t\t\tif ( $this->args['class'] ) {\n\t\t\t\t\t$attr['class'] .= ' ' . $this->args['class'];\n\t\t\t\t}\n\n\t\t\t\tif ( $this->args['id'] ) {\n\t\t\t\t\t$attr['id'] = $this->args['id'];\n\t\t\t\t}\n\n\t\t\t\treturn $attr;\n\t\t\t}", "public function overlayUserdefinedHtmlAttributeValues() {}", "public function getAttributes() {}", "public function getAttributes() {}", "function init()\n {\n $this->defineAttribute('data', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('stru', false, '', COMPONENT_TYPE_STRING);\n parent::init();\n }", "public function setAttributes($attributes){ }", "protected function defineAttributes()\n\t{\n\t\treturn array(\n\t\t\t'id' => AttributeType::Number,\n\t\t\t'type' => AttributeType::String,\n\t\t\t'date' => AttributeType::DateTime,\n\t\t\t'context' => AttributeType::String,\n\t\t\t'settings' => AttributeType::Mixed,\n\t\t);\n\t}", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'state' => array(AttributeType::String, 'default' => ''),\n 'category' => array(AttributeType::String, 'default' => ''),\n 'code' => array(AttributeType::String, 'default' => ''),\n 'include' => array(AttributeType::Number, 'default' => ''),\n 'taxable' => array(AttributeType::String, 'default' => ''),\n 'zip' => array(AttributeType::String, 'default' => ''),\n ));\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "protected function add_common_attribute_classes(){\n\t\tparent::add_common_attribute_classes();\n\t}", "protected function _add_render_attributes() {\n \n // use parent attributes\n parent::_add_render_attributes();\n \n }", "abstract protected function getModelAttributes();", "function GetAttributes();", "private function attrNames()\n {\n $dimAttr = [\n 'length' => 'length',\n 'width' => 'width',\n 'height' => 'height',\n ];\n $dsAttr = [\n 'dropship' => 'dropship',\n 'dropship_location' => 'dropship_location'\n ];\n\n $this->attrNames = ($this->mageVersion >= '2.2.5') ? $dsAttr : array_merge($dsAttr, $dimAttr);\n }", "public function defineAttributes()\n {\n return array(\n 'id' => AttributeType::Number,\n 'receiptParagraphOne' => AttributeType::String,\n 'receiptParagraphTwo' => AttributeType::String,\n 'receiptParagraphThree' => AttributeType::String,\n 'notifyEmail' => AttributeType::String\n );\n }", "public function attributeCustomTypes()\n {\n $flagEnabled = \\common\\components\\Consts::STATUS_ENABLED;\n return array(\n 'id' => array('data-options' => array('checkbox'=>'true'), 'key' => true),\n 'type' => array('width' => 100),\n 'office_id' => array('width' => 100),\n 'int_value' => array('width' => 100),\n 'float_value' => array('width' => 100),\n 'str_value' => array('width' => 100),\n 'flag' => array('width' => 100, 'formatter'=>\"function(value,row){ return '0x'+parseInt(value).toString(16); }\"),\n 'status' => array('width' => 80, 'sortable' => 'true',\n 'formatter' => \"function(value,row){ if (value == {$flagEnabled}) { return $.custom.lan.defaults.role.enabled; } else { return $.custom.lan.defaults.role.disabled; };}\"),\n 'edit_user_id' => array('width' => 100, 'sortable' => 'true', 'formatter' => \"function(value,row){ return row.edit_user_disp; }\"),\n 'created_at' => array('width' => 140, 'sortable' => 'true', 'formatter' => \"function(value,row){return $.custom.utils.humanTime(value);}\"),\n 'updated_at' => array('width' => 140, 'sortable' => 'true', 'formatter' => \"function(value,row){return $.custom.utils.humanTime(value);}\"),\n 'operation' => array('width' => 160, \n 'buttons' => array(\n ),\n ),\n );\n }", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'Id' => AttributeType::String,\n 'Section' => AttributeType::String,\n 'SequenceNr' => AttributeType::Number,\n 'Text' => AttributeType::String,\n 'Type' => AttributeType::String,\n ));\n }", "abstract protected function setValidationCustomAttributes(): array;", "abstract function attributes(): array;", "public function getAttributes()\n {\n return array_merge(\n parent::getAttributes(),\n array(\n 'size' => $this->maxLength,\n 'class' => 'text colorField'\n )\n );\n }", "public function input_attrs()\n {\n }", "public function defineAttributes()\n {\n return array(\n 'id' => AttributeType::Number,\n 'receiptBody' => AttributeType::String,\n );\n }", "public function attributes() : array;", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public function initUserAttributes()\n {\n }", "public function attributes()\n\t{\n\t\t/*Author -ptr.nov- add related fields to searchable attributes */\n\t\treturn array_merge(parent::attributes(), ['nmkategori','tipebrg','corp.CORP_NM']);\n\t}", "public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/config')\n ->getEntityType(\\Mage_Catalog_Model_Product::ENTITY)\n ->getDefaultAttributeSetId();\n $set = \\Mage::getModel('eav/entity_attribute_set')->load(4);\n $gid = $set->getDefaultGroupId();\n\n $that = $this;\n $this->setDefaultParameters(array(\n 'type'=> 'text',\n 'input'=> 'text',\n 'label'=> 'Test Attribute',\n 'global'=> \\Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,\n 'is_required'=> '0',\n 'is_comparable'=> '0',\n 'is_searchable'=> '0',\n 'is_unique'=> '1',\n 'is_configurable'=> '1',\n 'user_defined'=> '1',\n 'attribute_code' => function() use($that) { return $that->nextValue('attribute_code', function($i){return 'attribute_fixture_code_' . $i; }); },\n 'frontend_label' => function() use($that) { return $that->nextValue('frontend_label', function($i){return 'Attribute Fixture ' . $i; }); },\n 'attribute_set_id' => $defaultAttributeSetId,\n 'attribute_group_id' => $gid\n ));\n }", "function std_attr($at){\n switch($at){\n case 'wrap': $attr = array('id'=>strval($this->obj->id));break;\n default:\n $attr = array();\n\n }\n return new opc_attrs(NULL,$attr);\n }", "public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }", "public function __construct ($attrs);", "function initialize () {\n //blank for implementing\n\t\n\t//go through the attributes see if any of them have a name propery\n }", "protected function defineAttributes()\n {\n return [\n 'name' => [AttributeType::String, 'required' => true],\n 'handle' => [AttributeType::Handle, 'required' => true],\n 'color' => [AttributeType::Enum,\n 'values' => ['green', 'red'],\n 'required' => true,\n 'default' => 'green'\n ],\n 'sortOrder' => [AttributeType::SortOrder],\n 'isDefault' => [AttributeType::Bool, 'default' => 0]\n ];\n }", "public function getCustomAttributes(): array;", "public function attributes()\n {\n return [\n 'cover' => __('field.cover'),\n 'description' => __('field.description'),\n ];\n }", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'Amount' => array(AttributeType::Number, 'decimals' => 0),\n 'GrossNet' => AttributeType::String,\n 'Id' => AttributeType::String,\n 'Period' => AttributeType::String,\n 'Type' => AttributeType::String\n ));\n }", "protected function extend_attributes(&$attrs, $params, $name, $title, $value, $policy) {\r\n\t\tparent::extend_attributes($attrs, $params, $name, $title, $value, $policy);\r\n\t\t$attrs['name'] = $name;\r\n\t\t$attrs['rows'] = Arr::get_item($params, 'rows', 5);\r\n\t\t$attrs['cols'] = Arr::get_item($params, 'cols', 10);\t\r\n\t}", "protected function defineAttributes()\n\t{\n\t\treturn array_merge(parent::defineAttributes(), array(\n\t\t\t'id' => AttributeType::Number,\n\t\t\t'label' => array(AttributeType::String, 'default' => '', 'required' => true),\n\t\t\t'key' => array(AttributeType::Handle, 'default' => '', 'required' => true),\n\t\t\t'value' => array(AttributeType::String, 'default' => '', 'required' => true),\n\t\t));\n\t}", "abstract function exportableAttributes();", "public function addAttributes($post_id)\n\t{\n\t\t$attr = 'custom';\n\t\t\n\t\twp_set_object_terms($post_id, '0', $attr);\n\n $thedata[sanitize_title($attr)] = array(\n \t'name' => wc_clean($attr),\n 'value' => '0',\n 'postion' => '0',\n 'is_visible' => '0',\n 'is_variation' => '1',\n 'is_taxonomy' => '1'\n );\n \n\t\tupdate_post_meta($post_id, '_product_attributes', $thedata);\n\t\t\t\t\t\t\n\t}", "protected function inputAttributes()\n {\n $this->input_attributes['name'] = $this->name;\n $this->input_attributes['type'] = 'submit';\n $this->input_attributes['value'] = $this->params['title'];\n }", "public function __construct() {\r\n parent::__construct( 'attributes' );\r\n\r\n if ( isset( $this->attribute_id ) )\r\n $this->id = $this->attribute_id;\r\n }", "protected function addAtributosMetadata(ReeverAttributeMetadata $attr){\n\t\t$this->_atributosMetadata[$attr->attrName] = $attr;\n\t}", "protected function defineAttributes()\n {\n return array_merge(parent::defineAttributes(), array(\n 'Alert' => AttributeType::Bool,\n 'CreatedDateTime' => AttributeType::DateTime,\n 'EndDateTime' => AttributeType::DateTime,\n 'Id' => AttributeType::String,\n 'NewlyBuilt' => AttributeType::Bool,\n 'ObjectGroup' => array(AttributeType::ClassName, 'models' => 'TobiasAx_ObjectGroupModel'),\n 'Option' => AttributeType::Bool,\n 'ReasonDroppedId' => AttributeType::String,\n 'RenewalDate' => AttributeType::DateTime,\n 'SeekerRegistration' => array(AttributeType::ClassName, 'models' => 'TobiasAx_RegistrationModel'),\n 'Sequence' => AttributeType::Number,\n 'Status' => AttributeType::String\n ));\n }", "function doCustomAttributes(&$element) \n {\n \n foreach ($element->ucAttributes as $key=>$value) {\n \n list($namespace,$attribute) = (strpos($key, \":\") > -1) ? explode(':',$key) : array(\"\", $key);\n $method = strtolower($attribute) . 'Attribute';\n if (strtolower($namespace) != 'flexy') {\n continue;\n }\n if ((strlen($attribute)) && (method_exists($this,$method))) {\n $this->{$method}($element, $element->getAttribute($key));\n }\n } \n }", "public function setAttrs($attrs);" ]
[ "0.7813552", "0.7428896", "0.7421378", "0.73928684", "0.7378997", "0.7280965", "0.7268208", "0.71569586", "0.70727974", "0.69744074", "0.6958143", "0.6958143", "0.6957677", "0.6957118", "0.6957118", "0.6957118", "0.6957118", "0.69567895", "0.69233084", "0.6909214", "0.6893759", "0.686149", "0.67962724", "0.67962724", "0.67843175", "0.6776136", "0.6736763", "0.6728408", "0.67173505", "0.6687671", "0.6677346", "0.6672004", "0.6655456", "0.66507685", "0.66376257", "0.6633242", "0.6624466", "0.6610789", "0.66030586", "0.66030586", "0.66030586", "0.66030586", "0.66030586", "0.66030586", "0.66030586", "0.66030586", "0.66030586", "0.65782624", "0.65753055", "0.65713024", "0.6563919", "0.65608966", "0.6553686", "0.6550746", "0.65474844", "0.65412164", "0.65245783", "0.65245783", "0.65245783", "0.65245783", "0.65245783", "0.65245783", "0.65245783", "0.65245783", "0.65245783", "0.65051556", "0.6480581", "0.6479519", "0.64705014", "0.64556956", "0.6454562", "0.64504147", "0.64502966", "0.6447636", "0.6446157", "0.6440535", "0.6438231", "0.64248836", "0.64180535", "0.6412522", "0.6390233", "0.6385915", "0.6377442", "0.6374916", "0.63670003", "0.63590294", "0.6354224", "0.63523906", "0.63395727", "0.6329839", "0.6318179", "0.62872773", "0.627925", "0.62670285", "0.6251621", "0.6251104", "0.6232778", "0.6222043", "0.62119305", "0.6206884", "0.6199715" ]
0.0
-1
This is where we pull out the different data sets for each chart
public function showIndex() { // Chart1 shows blabla $dataSet1 = Data::where('img_matched_online', 1)->get(); $dataSet1Count = $dataSet1->count(); $dataSet1NightCount = round(Data::where('img_matched_online', 1)->where('img_night', 1)->count() / $dataSet1Count * 100, 2); $dataSet1WeatherCount = round(Data::where('img_matched_online', 1)->where('weather_bad', 1)->count() / $dataSet1Count * 100, 2); $dataSet1FullCount = round(Data::where('img_matched_online', 1)->where('ship_percentage_on_img', '<', 0)->count() / $dataSet1Count * 100, 2); $dataSet1OnCount = round(Data::where('img_matched_online', 1)->where('img_with_ship', 1)->count() / $dataSet1Count * 100, 2); $dataSet2 = Data::where('img_matched_online', 0)->get(); $dataSet2Count = $dataSet2->count(); $dataSet2NightCount = round(Data::where('img_matched_online', 0)->where('img_night', 1)->count() / $dataSet2Count * 100, 2); $dataSet2WeatherCount = round(Data::where('img_matched_online', 0)->where('weather_bad', 1)->count() / $dataSet2Count * 100, 2); $dataSet2FullCount = round(Data::where('img_matched_online', 0)->where('ship_percentage_on_img', '<', 0)->count() / $dataSet2Count * 100, 2); $dataSet2OnCount = round(Data::where('img_matched_online', 0)->where('img_with_ship', 1)->count() / $dataSet2Count * 100, 2); // Chart2 shows distrubution of ship lengths on perfect images $meters = 0; $perfectSetLabelsArray = []; $perfectSetLengthArray = []; for ($i=0; $i < 30; $i++) { $newMeters = $meters + 10; $oldMeters = $meters + 1; $totalNumberOfShipsThisLength = Data::where('ship_length', '>', $meters)->where('ship_length', '<=', $newMeters)->get()->count(); $perfectSetLabelsArray[] = "{$oldMeters}m - {$newMeters}m"; $shipCount = Data::where('img_night', 0)->where('weather_bad', 0)->where('img_with_ship', 1)->where('ship_percentage_on_img', '>', 0)->where('img_matched_online', 1)->where('ship_length', '>', $meters)->where('ship_length', '<=', $newMeters)->get()->count(); if ($shipCount) $shipCount = round($shipCount / $totalNumberOfShipsThisLength * 100, 2); $perfectSetLengthArray[] = $shipCount; $meters = $newMeters; } $perfectSetLengthArrayPos = json_encode($perfectSetLengthArray); $perfectSetLabelsArrayPos = json_encode($perfectSetLabelsArray); // Chart3 shows distrubution of ship lengths on perfect images $meters = 0; $perfectSetLabelsArray = []; $perfectSetLengthArray = []; for ($i=0; $i < 30; $i++) { $newMeters = $meters + 10; $oldMeters = $meters + 1; $totalNumberOfShipsThisLength = Data::where('ship_length', '>', $meters)->where('ship_length', '<=', $newMeters)->get()->count(); $perfectSetLabelsArray[] = "{$oldMeters}m - {$newMeters}m"; $shipCount = Data::where('img_night', 0)->where('weather_bad', 0)->where('img_with_ship', 1)->where('ship_percentage_on_img', '>', 0)->where('img_matched_online', 0)->where('ship_length', '>', $meters)->where('ship_length', '<=', $newMeters)->get()->count(); if ($shipCount) $shipCount = round($shipCount / $totalNumberOfShipsThisLength * 100, 2); $perfectSetLengthArray[] = $shipCount; $meters = $newMeters; } $perfectSetLengthArrayNeg = json_encode($perfectSetLengthArray); $perfectSetLabelsArrayNeg = json_encode($perfectSetLabelsArray); // Chart4 shows distrubution of ship percentage on image on perfect images $percent = -100; $perfectSetLabelsArray = []; $perfectSetLengthArray = []; for ($i=0; $i < 20; $i++) { $newPercent = $percent + 10; $oldPercent = $percent + 1; $totalNumberOfShipsThisLength = Data::where('ship_percentage_on_img', '>', $percent)->where('ship_percentage_on_img', '<=', $newPercent)->get()->count(); $perfectSetLabelsArray[] = "{$oldPercent}% - {$newPercent}%"; $shipCount = Data::where('img_night', 0)->where('weather_bad', 0)->where('img_with_ship', 1)->where('img_matched_online', 1)->where('ship_percentage_on_img', '>', $percent)->where('ship_percentage_on_img', '<=', $newPercent)->get()->count(); if ($shipCount) $shipCount = round($shipCount / $totalNumberOfShipsThisLength * 100, 2); $perfectSetLengthArray[] = $shipCount; $percent = $newPercent; } $perfectSetPercentLengthArrayPos = json_encode($perfectSetLengthArray); $perfectSetPercentLabelsArrayPos = json_encode($perfectSetLabelsArray); // Chart5 shows distrubution of ship percentage on image on perfect images $percent = -100; $perfectSetLabelsArray = []; $perfectSetLengthArray = []; for ($i=0; $i < 20; $i++) { $newPercent = $percent + 10; $oldPercent = $percent + 1; $totalNumberOfShipsThisLength = Data::where('ship_percentage_on_img', '>', $percent)->where('ship_percentage_on_img', '<=', $newPercent)->get()->count(); $perfectSetLabelsArray[] = "{$oldPercent}% - {$newPercent}%"; $shipCount = Data::where('img_night', 0)->where('weather_bad', 0)->where('img_with_ship', 1)->where('img_matched_online', 0)->where('ship_percentage_on_img', '>', $percent)->where('ship_percentage_on_img', '<=', $newPercent)->get()->count(); if ($shipCount) $shipCount = round($shipCount / $totalNumberOfShipsThisLength * 100, 2); $perfectSetLengthArray[] = $shipCount; $percent = $newPercent; } $perfectSetPercentLengthArrayNeg = json_encode($perfectSetLengthArray); $perfectSetPercentLabelsArrayNeg = json_encode($perfectSetLabelsArray); // Create the view, and pass along the dataz return View::make('statistics.index', compact( 'dataSet1NightCount', // 1 'dataSet1WeatherCount', // 1 'dataSet1FullCount', // 1 'dataSet1OnCount', // 1 'dataSet2NightCount', // 1 'dataSet2WeatherCount', // 1 'dataSet2FullCount', // 1 'dataSet2OnCount', // 1 'perfectSetLengthArrayPos', // 2 'perfectSetLabelsArrayPos', // 2 'perfectSetLengthArrayNeg', // 3 'perfectSetLabelsArrayNeg', // 3 'perfectSetPercentLengthArrayPos', // 4 'perfectSetPercentLabelsArrayPos', // 4 'perfectSetPercentLengthArrayNeg', // 5 'perfectSetPercentLabelsArrayNeg' // 5 )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDataSets()\n {\n if ($this->getResource('wdrs:describedby')){\n $dataset = $this->getResource('wdrs:describedby')->all('void:inDataset');\n }else {\n $schemaUrls = $this->allResources('schema:url');\n $describedBy = array_filter($schemaUrls, function($schemaUrl)\n {\n return(strpos($schemaUrl->getURI(), 'worldcat.org/title'));\n });\n $describedBy = array_shift($describedBy);\n $dataset = $describedBy->all('void:inDataset');\n }\n \n return $dataset;\n }", "function charts($data1) {\n\t $startDate = Carbon::now()->subDay(365);\n\t $endDate = Carbon::now();\n\t\n\t\t//THIS RETURNS THE 4 BOXES\n\t\t$month = $data->filter(function($data1){ return $data1->created_at->format('m-y') == date('m-y'); });\n\t\t$lastmonth = $data->filter(function($data1){ return $data1->created_at->format('m-y') == Carbon::now()->firstOfMonth()->subMonth()->format('m-y'); });\n\t\t$year = $data->filter(function($data1){ return $data1->created_at->format('y') == date('y'); });\n\t\t$lastyear = $data->filter(function($data1){ return $data1->created_at->format('y') == Carbon::now()->subYear()->format('y'); });\n\t\n\t}", "function calculate_data() {\n $this->data = array();\n $this->data['series'] = array();\n\n $series_size = 0;\n\n $series_list = $this->calculate_series_list();\n foreach($series_list as $key => $value) {\n $this->data['series'][$value] = $this->calculate_series($key);\n\n if($series_size < count($this->data['series'][$value])) {\n $series_size = count($this->data['series'][$value]);\n }\n }\n\n $this->data['labels'] = $this->calculate_labels($series_size);\n }", "abstract protected function getDataSet();", "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 makeChart($type)\n\n {\n\n switch ($type) {\n\n case 'bar':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'bar', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'pie':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'pie', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'donut': \n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'donut', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'line':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'line', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'area':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'area', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'geo':\n\n $chart = Charts::create('geo', 'highcharts')\n\n ->title('Laravel Chart GEO')\n\n ->elementLabel('HDTuto.com Laravel GEO Chart label')\n\n ->labels(['JP', 'ID', 'RU'])\n\n ->colors(['#3D3D3D', '#985689'])\n\n ->values([5,10,20])\n\n ->dimensions(1000,500)\n\n ->responsive(true);\n\n break;\n\n\n\n default:\n\n # code...\n\n break;\n\n }\n\n return view('chart', compact('chart'));\n\n }", "function getDataSet() {\n\t\treturn $this->addDataSets(array(\"init.yml\"));\n\t}", "function getDataSet() {\n\t\treturn $this->addDataSets(array(\"init.yml\"));\n\t}", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "protected function getChartData()\n {\n $data = $this->loadChartData(); //load data from CSV\n\n $groupedByWeek = $data->groupBy(function ($item) { // Group data base on week start date\n return $item->created_at->startOfWeek()->format('d/m/Y');\n });\n\n $chartData = array();\n foreach ($groupedByWeek as $key => $item) {\n $cohort = new \\stdClass();\n $cohort->name = $key;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 0)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 20)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 40)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 50)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 70)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 90)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 99)->count() / $item->count()) * 100;\n $cohort->data[] = ($item->where('onboarding_percentage', '>=', 100)->count() / $item->count()) * 100;\n array_push($chartData, $cohort);\n };\n\n return Response()->json( // return data for chart as Json\n $chartData\n );\n }", "protected function getDataSet(){\n return $this->createXMLDataSet(\n dirname(__FILE__) . '/../_dataSet/commonTest.xml'\n );\n }", "protected function getDataSet(){\n return $this->createXMLDataSet(\n dirname(__FILE__) . '/../_dataSet/commonTest.xml'\n );\n }", "public function run()\n {\n $this->chart_of_accounts = [\n [\n 'code' => 1,\n 'name' => 'Assets',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 2,\n 'name' => 'Equity',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 3,\n 'name' => 'Income',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'I',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 4,\n 'name' => 'Expense',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 5,\n 'name' => 'Liabilities',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 101,\n 'name' => 'Non Current Asset',\n 'parent_name' => 'Assets',\n 'level' => 1,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 102,\n 'name' => 'Current Asset',\n 'parent_name' => 'Assets',\n 'level' => 1,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 301,\n 'name' => 'Product Sale',\n 'parent_name' => 'Income',\n 'level' => 1,\n 'type' => 'I',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 302,\n 'name' => 'Service Income',\n 'parent_name' => 'Income',\n 'level' => 1,\n 'type' => 'I',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 401,\n 'name' => 'Default Expense',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 1,\n 'depreciation' => 1,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 402,\n 'name' => 'Material Purchase',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 403,\n 'name' => 'Employee Salary',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 404,\n 'name' => 'Machine Purchase',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 405,\n 'name' => 'Maintenance Service',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 501,\n 'name' => 'Non Current Liabilities',\n 'parent_name' => 'Liabilities',\n 'level' => 1,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 502,\n 'name' => 'Current Liabilities',\n 'parent_name' => 'Liabilities',\n 'level' => 1,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 10101,\n 'name' => 'Inventory',\n 'parent_name' => 'Non Current Asset',\n 'level' => 1,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 10201,\n 'name' => 'Cash & Cash Equivalent',\n 'parent_name' => 'Current Asset',\n 'level' => 2,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 10202,\n 'name' => 'Account Receivable',\n 'parent_name' => 'Current Asset',\n 'level' => 2,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 50201,\n 'name' => 'Account Payable',\n 'parent_name' => 'Current Liabilities',\n 'level' => 2,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 50202,\n 'name' => 'Employee Ledger',\n 'parent_name' => 'Current Liabilities',\n 'level' => 2,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 50203,\n 'name' => 'Tax',\n 'parent_name' => 'Current Liabilities',\n 'level' => 2,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020101,\n 'name' => 'Cash In Hand',\n 'parent_name' => 'Cash & Cash Equivalent',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020102,\n 'name' => 'Cash At Bank',\n 'parent_name' => 'Cash & Cash Equivalent',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020103,\n 'name' => 'Cash At Mobile Bank',\n 'parent_name' => 'Cash & Cash Equivalent',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020201,\n 'name' => 'Customer Receivable',\n 'parent_name' => 'Account Receivable',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020202,\n 'name' => 'Loan Receivable',\n 'parent_name' => 'Account Receivable',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n // [\n // 'code' => 5020101,\n // 'name' => 'Supplier Name',\n // 'parent_name' => 'Account Payable',\n // 'level' => 3,\n // 'type' => 'L',\n // 'transaction' => 1,\n // 'general_ledger' => 0,\n // 'customer_id' => null,\n // 'supplier_id' => null,\n // 'budget' => null,\n // 'depreciation' => null,\n // 'depreciation_rate' => 0.00,\n // 'status' => 1,\n // 'created_by' => 'SuperAdmin'\n // ],\n [\n 'code' => 10202010001,\n 'name' => '1-Walking Customer',\n 'parent_name' => 'Customer Receivable',\n 'level' => 4,\n 'type' => 'A',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n ];\n foreach ($this->chart_of_accounts as $account) {\n ChartOfAccount::updateOrCreate($account);\n }\n \n }", "private function organize_data(){\n\t\t$this->grab_data();\n\t\t$this->adjust_graph_dimensions();\n\t\t$this->draw_graphs();\n\t\t$this->draw_axes();\n\t\treturn;\n\t}", "protected function getDataSet() {\n\t\treturn $this->createXMLDataSet ( dirname ( __FILE__ ) . '\\..\\..\\data\\cron\\empty_dstable_1_article_2_attach_test_data.xml' );\n\t}", "public function get_main_chart() {\n\n\t\tif ( empty( $this->category_ids ) ) {\n\t\t\t?>\n\t\t\t<div class=\"chart-container\">\n\t\t\t\t<p class=\"chart-prompt\"><?php _e( '&larr; Choose a category to view stats', 'woocommerce-cost-of-goods' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\t$chart_data = array();\n\t\t$index = 0;\n\n\t\tforeach ( $this->category_ids as $category_id ) {\n\n\t\t\t$category = get_term( $category_id, 'product_cat' );\n\t\t\t$data = $this->get_report_data( $category->term_id );\n\n\t\t\t$chart_data[ $category->term_id ]['category'] = $category->name;\n\t\t\t$chart_data[ $category->term_id ]['data'] = array_values( $this->prepare_chart_data( $data->profits, 'post_date', 'order_item_profit', $this->chart_interval, $this->start_date, $this->chart_groupby ) );\n\n\t\t\t$index ++;\n\t\t}\n\n\t\t?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$index = 0;\n\t\t\t\t\t\t\tforeach ( $chart_data as $data ) {\n\t\t\t\t\t\t\t\t$color = isset( $this->chart_colors[ $index ] ) ? $this->chart_colors[ $index ] : $this->chart_colors[0];\n\t\t\t\t\t\t\t\t$width = $this->barwidth / sizeof( $chart_data );\n\t\t\t\t\t\t\t\t$offset = ( $width * $index );\n\t\t\t\t\t\t\t\t$series = $data['data'];\n\t\t\t\t\t\t\t\tforeach ( $series as $key => $series_data )\n\t\t\t\t\t\t\t\t\t$series[ $key ][0] = $series_data[0] + $offset;\n\t\t\t\t\t\t\t\techo '{\n\t\t\t\t\t\t\t\t\tlabel: \"' . esc_js( $data['category'] ) . '\",\n\t\t\t\t\t\t\t\t\tdata : jQuery.parseJSON( \"' . json_encode( $series ) . '\" ),\n\t\t\t\t\t\t\t\t\tcolor: \"' . $color . '\",\n\t\t\t\t\t\t\t\t\tbars : {\n\t\t\t\t\t\t\t\t\t\tfillColor: \"' . $color . '\",\n\t\t\t\t\t\t\t\t\t\tfill : true,\n\t\t\t\t\t\t\t\t\t\tshow : true,\n\t\t\t\t\t\t\t\t\t\tlineWidth: 1,\n\t\t\t\t\t\t\t\t\t\talign : \"center\",\n\t\t\t\t\t\t\t\t\t\tbarWidth : ' . $width * 0.75 . ',\n\t\t\t\t\t\t\t\t\t\tstack : false\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t' . $this->get_currency_tooltip() . ',\n\t\t\t\t\t\t\t\t\tenable_tooltip: true,\n\t\t\t\t\t\t\t\t\tprepend_label : true\n\t\t\t\t\t\t\t\t},';\n\t\t\t\t\t\t\t\t$index++;\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\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars ) {\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery( '.chart-placeholder.main' ),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgrid: {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tborderColor: 'transparent',\n\t\t\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\t\t\thoverable : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\txaxes: [ {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\treserveSpace: true,\n\t\t\t\t\t\t\t\tposition : 'bottom',\n\t\t\t\t\t\t\t\ttickColor : 'transparent',\n\t\t\t\t\t\t\t\tmode : 'time',\n\t\t\t\t\t\t\t\ttimeformat : \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames : <?php echo json_encode( array_values( $GLOBALS['wp_locale']->month_abbrev ) ); ?>,\n\t\t\t\t\t\t\t\ttickLength : 1,\n\t\t\t\t\t\t\t\tminTickSize : [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\ttickSize : [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tcolor: '#aaa'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t\tyaxes: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\ttickDecimals: 2,\n\t\t\t\t\t\t\t\t\tcolor : 'transparent',\n\t\t\t\t\t\t\t\t\tfont : { color: \"#aaa\" }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\n\t\t\t\t};\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery( this ).data( 'series' ) );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function dataSets()\n\t{\n\t\treturn $this->data_sets;\n\t}", "protected function getDataSet()\n {\n return $this->createFlatXMLDataSet(dirname(__FILE__).'/_files/category.xml');\n }", "public static function BUILD_CHART()\n {\n $data = self::GET_GEN_STATS();\n\n $dataset = [];\n $fsdata = [];\n\t\t\n\t\t$labels = [];\n $m = [];\n $f = [];\n\t\t\n foreach ($data as $key => $value) {\n $obj = (object)$value;\n\t\t\t$labels[] = ['label'=>self::ABBR_CNAME($obj->COL_NAME)];\n $m[] = ['value'=>$obj->MALE];\n $f[] = ['value'=>$obj->FEMALE];\n // $dataLb[] = [\n\t\t\t\t// 'label'=>self::ABBR_CNAME($obj->COL_NAME),\n\t\t\t\t// 'value'=>($obj->TOT)\n\t\t\t// ];\n }\n\t\t\n\t\t$dataset[]=[\"seriesname\"=>\"MALE\",\"data\"=>$m];\n\t\t$dataset[]=[\"seriesname\"=>\"FEMALE\",\"data\"=>$f];\n\n $graphData = [\n\t\t\t'type'=>'MSColumn3D',\n\t\t\t'renderAt'=>'gender-graph',\n\t\t\t'width'=>'100%',\n\t\t\t'height'=>'100%',\n\t\t\t'dataFormat'=>'json',\n\t\t\t'dataSource'=>[\n\t\t\t\t\"chart\"=>[\n\t\t\t\t\t\"autoScale\"=>\"1\",\n\t\t\t\t\t\"showvalues\"=>\"0\",\n\t\t\t\t\t\"caption\"=>\"Staff Gender Distribution\",\n\t\t\t\t\t// \"numberprefix\"=>\"$\",\n\t\t\t\t\t\"xaxisname\"=>\"COLLEGES\",\n\t\t\t\t\t\"yaxisname\"=>\"Staff No.\",\n\t\t\t\t\t\"showBorder\"=>\"0\",\n\t\t\t\t\t\"paletteColors\"=>\"#0075c2,#ffb6c1\",\n\t\t\t\t\t\"exportEnabled\"=>\"1\",\n\t\t\t\t\t\"bgColor\"=>\"#ffffff\",\n\t\t\t\t\t\"canvasBgColor\"=>\"#fffff0\",\n\t\t\t\t\t\"captionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontSize\"=>\"14\",\n\t\t\t\t\t\"subcaptionFontBold\"=>\"0\",\n\t\t\t\t\t\"divlineColor\"=>\"#999999\",\n\t\t\t\t\t\"divLineIsDashed\"=>\"1\",\n\t\t\t\t\t\"divLineDashLen\"=>\"1\",\n\t\t\t\t\t\"divLineGapLen\"=>\"1\",\n\t\t\t\t\t\"toolTipColor\"=>\"#ffffff\",\n\t\t\t\t\t\"toolTipBorderThickness\"=>\"0\",\n\t\t\t\t\t\"toolTipBgColor\"=>\"#000000\",\n\t\t\t\t\t\"toolTipBgAlpha\"=>\"80\",\n\t\t\t\t\t\"toolTipBorderRadius\"=>\"2\",\n\t\t\t\t\t\"toolTipPadding\"=>\"5\",\n\t\t\t\t\t\"legendBgColor\"=>\"#ffffff\",\n\t\t\t\t\t\"legendBorderAlpha\"=>'0',\n\t\t\t\t\t\"legendShadow\"=>'0',\n\t\t\t\t\t\"legendItemFontSize\"=>'10',\n\t\t\t\t\t\"legendItemFontColor\"=>'#666666'\n\t\t\t\t],\n\t\t\t\t\"categories\"=>[\n\t\t\t\t\t[\"category\"=>$labels],\n\t\t\t\t],\n\t\t\t\t\"dataset\"=>$dataset,\n\t\t\t]\n\t\t];\n\t\t\n\t\t$fsdata = ['graph'=>$graphData];\n\n return $fsdata;\n }", "function generateDetailChart($chartType,$result,$criteria,$chart_path)\r\n\t{\r\n \r\n\tif ($chartType==\"gw_load\") {\r\n\t\t\t\t\r\n\t\t\t\t$_SESSION[\"gw_criteria\"] = $criteria;\r\n\t\t\t\t$_SESSION[\"gwLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"gw_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name =$_SERVER[\"PHP_AUTH_USER\"]. \"gw_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$gw_id = $_SESSION[\"gw_id\"];\r\n\t\t\t\t$title = \"Gateway Load (\".$gw_id.\")\";\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t//\tmysql_data_seek($result ,0);\r\n\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t$mon = date(\"M\", strtotime($row[\"login\"])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[\"login\"]));\r\n\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \r\n\t\t\t\t\t\t \t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \t\t\t\r\n\r\n }\r\n\t \t \r\n/***************************************************************Generate Service Load Graph *********************************************************************************/\r\n\r\n\t\tif ($chartType==\"service_load\") {\r\n\t\t\r\n\t\t\t $_SESSION[\"sv_criteria\"] = $criteria;\r\n\t\t\t\t\r\n\t\t \t\t$_SESSION[\"svLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"sv_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"sv_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$sv_id = $_SESSION[\"sv_id\"];\r\n\t\t\t\t$title = \"Service Load (\".$sv_id.\")\";\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t\t\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t if ($groupby ==\"ByMonth\") {\r\n\t\t\t\t\t\t $mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t \t \r\n/********************************************************************Generate Top Ten users Graph *************************************************************************/\r\n \r\n\t\tif ($chartType==\"top_ten_users\") {\r\n\t\t\r\n\t\t\t $_SESSION[\"tt_users_criteria\"] = $criteria;\r\n\r\n\t\t\t$_SESSION[\"userLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"user_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"user_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$user_id = $_SESSION[\"user_id\"];\r\n\t\t\t\t$title = \"User Load (\".$user_id.\")\";\r\n\t\t\t\t\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t\t\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\t if ($groupby ==\"ByMonth\") {\r\n\t\t\t\t\t\t $mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t \t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \t\t\t\r\n\t\t\t}\r\n\r\n/**************************************************************Generate Direction Load Graph *******************************************************************************/\r\n\r\n\t\tif ($chartType==\"direction_load\") {\r\n\t\t \r\n\t\t \t$_SESSION[\"direction_criteria\"] = $criteria;\r\n\r\n\t\t\t $_SESSION[\"dirLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"direction_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"direction_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$dir_id = $_SESSION[\"dir_id\"];\r\n\t\t\t\t$title = \"Direction Load (\".$dir_id.\")\";\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t \t\t \t\tif ($groupby==\"ByMonth\") {\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \t$mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\r\n/*********************************************************************Generate Destination host Load Graph *****************************************************************/\r\n\r\n\t\t\tif ($chartType==\"destination_host_load\") {\r\n\t\t\t\r\n\t\t\t\t$_SESSION[\"destination_host_criteria\"] = $criteria;\r\n\r\n\t\t\t \t$_SESSION[\"destLoadDetail\"] = $_SERVER[\"PHP_AUTH_USER\"].\"destination_host_\".$criteria.\"_bar_load\";\r\n\t\t \t\t$image_name = $_SERVER[\"PHP_AUTH_USER\"].\"destination_host_\".$criteria.\"_bar_load.png\";\r\n\t\t\t\t$dest_id = $_SESSION[\"dest_id\"];\r\n\t\t\t\t$title = \"Destination Host Load (\".$dest_id.\")\";\r\n\t\t\t\t$groupby = $_SESSION[\"gw_group\"];\r\n\t\t\t $DataSet = new pData; \r\n\t\t\t\t$j=1;\r\n\t\t\t\t$total=0;\r\n\t\t\t\twhile ( $row = mysql_fetch_array($result) ) {\r\n\t\t\t \t\t \t\t\r\n\r\n\t\t\t\t\t\t $DataSet->AddPoint($row[\"count\"],\"Serie.$j\"); \r\n\t\t\t\tif ($groupby==\"ByMonth\") {\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t \t$mon = date(\"M\", strtotime($row[login])); \r\n \t\t\t\t\t\t$yr \t\t\t= date('Y', strtotime($row[login]));\r\n\t\t\t\t\t\t\t$DataSet->SetSerieName($mon.\"-\".$yr,\"Serie.$j\"); \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$DataSet->SetSerieName($row[\"gw_name\"],\"Serie.$j\"); \r\n\t\t\t\t\t\t \t}\r\n\t\t\t\t\t\t\t$j++;\r\n\t\t\t\t\t}\r\n\t\t\t \r\n\t\t\t$DataSet->AddAllSeries(); \r\n \r\n\t\t\t// Initialise the graph \r\n\t\t\t$Test = new pChart(740,520); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->setGraphArea(50,30,470,200); \r\n\t\t\t$Test->drawFilledRoundedRectangle(7,7,600,513,5,240,240,240); \r\n\t\t\t$Test->drawRoundedRectangle(5,5,600,515,5,230,230,230); \r\n\t\t\t$Test->drawGraphArea(255,255,255,TRUE); \r\n\t\t\t$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE); \r\n\t\t\t$Test->drawGrid(4,TRUE,230,230,230,50); \r\n\t \r\n\t\t\t// Draw the 0 line \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",6); \r\n\t\t\t$Test->drawTreshold(0,143,55,72,TRUE,TRUE); \r\n\t \r\n\t\t\t// Draw the bar graph \r\n\t\t\t$Test->drawBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(),TRUE); \r\n\t \r\n\t\t\t// Finish the graph \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",8); \r\n\t\t\t$Test->drawLegend(500,30,$DataSet->GetDataDescription(),250,250,250); \r\n\t\t\t$Test->setFontProperties(\"Fonts/tahoma.ttf\",10); \r\n\t\t\t$Test->drawTitle(50,22,\"$title\",50,50,50,485); \r\n\t\t\t$Test->Render($chart_path.\"$image_name\"); \r\n\t\t\t\r\n\r\n\t\t\t}\r\n\r\n\r\n\r\n\t}", "public function get_main_chart() {\n\t\tglobal $wp_locale;\n\n\t\t// Get orders and dates in range - we want the SUM of order totals, COUNT of order items, COUNT of orders, and the date\n\t\t$orders = $this->get_order_report_data( array(\n\t\t\t'data' => array(\n\t\t\t\t'ID' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => 'COUNT',\n\t\t\t\t\t'name' => 'total_orders',\n\t\t\t\t\t'distinct' => true,\n\t\t\t\t),\n\t\t\t\t'post_date' => array(\n\t\t\t\t\t'type' => 'post_data',\n\t\t\t\t\t'function' => '',\n\t\t\t\t\t'name' => 'post_date'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'group_by' => $this->group_by_query,\n\t\t\t'order_by' => 'post_date ASC',\n\t\t\t'query_type' => 'get_results',\n\t\t\t'filter_range' => true\n\t\t) );\n\n\t\t// Get Abadoned Carts in range 1 years\n\t\t$abandoned_carts_items = CartModel::get_carts_one_year();\n\t\t$ee_abandoned_posts = array();\n\n\t\tif ( $abandoned_carts_items ) {\n\n\t\t\tforeach ( $abandoned_carts_items as $order_item ) {\n\t\t\t\t$date = date( 'Y-m-d h:i:s', $order_item->post_date );\n\n\t\t\t\t$obj = new stdClass();\n\t\t\t\t$obj->post_date = $date;\n\t\t\t\t$obj->abandoned_cart_itms = 1;\n\n\t\t\t\t$ee_abandoned_posts[] = $obj;\n\t\t\t}\n\t\t}\t\n\n\t\t// Prepare data for report\n\t\t$order_counts = $this->prepare_chart_data( $orders, 'post_date', 'total_orders', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$abandoned_carts_encoded = $this->prepare_chart_data( $ee_abandoned_posts, 'post_date', 'abandoned_cart_itms', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t\n\t\t// Encode in json format\n\t\t$chart_data = json_encode( array(\n\t\t\t'order_counts' => array_values( $order_counts ),\n\t\t\t'abandoned_cart_itms' => array_values( $abandoned_carts_encoded )\n\t\t) );\n\t\t?>\n\n\t\t<?php //echo $chart_data; ?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo $chart_data; ?>' );\n\t\t\t\tvar drawGraph = function( highlight ) {\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Number of conversions', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.order_counts,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['order_counts']; ?>',\n\t\t\t\t\t\t\tbars: { fillColor: '<?php echo $this->chart_colours['order_counts']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: \"<?php echo esc_js( __( 'Abandoned Carts', 'cart_converter' ) ) ?>\",\n\t\t\t\t\t\t\tdata: order_data.abandoned_cart_itms,\n\t\t\t\t\t\t\tcolor: '<?php echo $this->chart_colours['abandoned_carts']; ?>',\n\t\t\t\t\t\t\tpoints: { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines: { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable: true\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars )\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery('.chart-placeholder.main'),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t grid: {\n\t\t\t\t\t\t color: '#aaa',\n\t\t\t\t\t\t borderColor: 'transparent',\n\t\t\t\t\t\t borderWidth: 0,\n\t\t\t\t\t\t hoverable: true\n\t\t\t\t\t\t },\n\t\t\t\t\t\t xaxes: [ {\n\t\t\t\t\t\t \tcolor: '#aaa',\n\t\t\t\t\t\t \tposition: \"bottom\",\n\t\t\t\t\t\t \ttickColor: 'transparent',\n\t\t\t\t\t\t\t\tmode: \"time\",\n\t\t\t\t\t\t\t\ttimeformat: \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength: 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo $this->chart_groupby; ?>\"],\n\t\t\t\t\t\t\t\tfont: {\n\t\t\t\t\t\t \t\tcolor: \"#aaa\"\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t yaxes: [\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\tminTickSize: 1,\n\t\t\t\t\t\t \t\ttickDecimals: 0,\n\t\t\t\t\t\t \t\tcolor: '#d4d9dc',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\n\t\t\t\t\t\t \t},\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tposition: \"right\",\n\t\t\t\t\t\t \t\tmin: 0,\n\t\t\t\t\t\t \t\ttickDecimals: 2,\n\t\t\t\t\t\t \t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t \t\tcolor: 'transparent',\n\t\t\t\t\t\t \t\tfont: { color: \"#aaa\" }\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);\n\n\t\t\t\t\tjQuery('.chart-placeholder').resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery('.highlight_series').hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery(this).data('series') );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function ajaxRetrieveMainCharts(Request $request) {\n $charts = array();\n\n array_set($charts, 'options.title.display', true);\n array_set($charts, 'options.title.fontFamily', 'Lato');\n array_set($charts, 'options.title.fontSize', 20);\n array_set($charts, 'options.legend.labels.fontFamily', 'Lato');\n array_set($charts, 'options.legend.labels.fontSize', 16);\n\n $centre = $request->get('centre');\n $centreList = Auth::user()->centres;\n\n if($centre == 'all') {\n $labels = $centreList->sortBy('name')->lists('name');\n\n $datasets = array();\n\n $activityCount = Activity::with('centre')->withTrashed()\n ->select('centre_id', DB::raw('count(*) as total'))\n ->WhereIn('centre_id', $centreList->lists('centre_id'))\n ->groupBy('centre_id')->get()\n ->sortBy('centre.name')\n ->lists('total')\n ->transform(function ($item) {\n return intval($item);\n });\n\n array_set($charts, 'type', 'doughnut');\n array_set($charts, 'options.cutoutPercentage', 30);\n array_set($charts, 'options.title.text', 'Total Number of Activities per Centres');\n array_set($charts, 'options.animation.animateScale', true);\n array_set($charts, 'data.labels', $labels);\n array_set($datasets, 'data', $activityCount);\n\n $backgroundColor = array('#729ece', '#ff9e4a', '#67bf5c', '#ed665d',\n '#ad8bc9', '#a8786e', '#ed97ca', '#cdcc5d', '#6dccda', '#a2a2a2');\n $hoverBackgroundColor = array('#aec7e8', '#ffbb78', '#98df8a', '#ff9896',\n '#c5b0d5', '#c49c94', '#f7b6d2', '#dbdb8d', '#9edae5', '#c7c7c7');\n array_set($datasets, 'backgroundColor', $backgroundColor);\n array_set($datasets, 'hoverBackgroundColor', $hoverBackgroundColor);\n\n array_set($charts, 'data.datasets', array($datasets));\n } else {\n $labels = array(Carbon::now()->subMonth(5)->format('F'), Carbon::now()->subMonth(4)->format('F'),\n Carbon::now()->subMonth(3)->format('F'), Carbon::now()->subMonth(2)->format('F'),\n Carbon::now()->subMonth(1)->format('F'), Carbon::now()->format('F'));\n\n $activityDataset = array('label' => 'Activities completed',\n 'backgroundColor'=> '#729ece', 'borderWidth' => 1,\n 'hoverBackgroundColor' => '#aec7e8');\n\n $activityFiveMthAgo = Activity::ofCentre($centre)->completed()->subMonth(5)->get();\n $activityFourMthAgo = Activity::ofCentre($centre)->completed()->subMonth(4)->get();\n $activityThreeMthAgo = Activity::ofCentre($centre)->completed()->subMonth(3)->get();\n $activityTwoMthAgo = Activity::ofCentre($centre)->completed()->subMonth(2)->get();\n $activityOneMthAgo = Activity::ofCentre($centre)->completed()->subMonth(1)->get();\n $activityThisMth = Activity::ofCentre($centre)->completed()->subMonth(0)->get();\n $activityCount = array($activityFiveMthAgo->count(), $activityFourMthAgo->count(),\n $activityThreeMthAgo->count(), $activityTwoMthAgo->count(),\n $activityOneMthAgo->count(), $activityThisMth->count());\n\n array_set($activityDataset, 'data', $activityCount);\n\n $volunteerDataset = array('label' => 'Unique Volunteers volunteered',\n 'backgroundColor'=> '#ff9e4a', 'borderWidth' => 1,\n 'hoverBackgroundColor' => '#ffbb78');\n\n $volunteerFiveMthAgo = array_unique(Activity::ofCentre($centre)\n ->completed()->subMonth(5)->lists('volunteer_id')->toArray());\n $volunteerFourMthAgo = array_unique(Activity::ofCentre($centre)\n ->completed()->subMonth(4)->lists('volunteer_id')->toArray());\n $volunteerThreeMthAgo = array_unique(Activity::ofCentre($centre)\n ->completed()->subMonth(3)->lists('volunteer_id')->toArray());\n $volunteerTwoMthAgo = array_unique(Activity::ofCentre($centre)\n ->completed()->subMonth(2)->lists('volunteer_id')->toArray());\n $volunteerOneMthAgo = array_unique(Activity::ofCentre($centre)\n ->completed()->subMonth(1)->lists('volunteer_id')->toArray());\n $volunteerThisMth = array_unique(Activity::ofCentre($centre)\n ->completed()->subMonth(0)->lists('volunteer_id')->toArray());\n $volunteerCount = array(count($volunteerFiveMthAgo), count($volunteerFourMthAgo),\n count($volunteerThreeMthAgo), count($volunteerTwoMthAgo),\n count($volunteerOneMthAgo), count($volunteerThisMth));\n\n array_set($volunteerDataset, 'data', $volunteerCount);\n\n array_set($charts, 'type', 'bar');\n array_set($charts, 'options.title.text', 'Records for Past 6 Months');\n\n $scaleLabel = array('display' => true, 'fontFamily' => 'Lato', 'fontSize' => 16);\n $xTicks = array('fontFamily' => 'Lato', 'fontSize' => 16);\n $yTicks = array('fontFamily' => 'Lato', 'fontSize' => 16, 'maxTicksLimit' => 6, 'min' => 0, 'suggestedMax' => 15);\n array_set($charts, 'options.scales.xAxes', array(['position' => 'top', 'scaleLabel' => $scaleLabel, 'ticks' => $xTicks]));\n array_set($charts, 'options.scales.yAxes', array(['scaleLabel' => $scaleLabel, 'ticks' => $yTicks]));\n\n array_set($charts, 'data.labels', $labels);\n array_set($charts, 'data.datasets', array($activityDataset, $volunteerDataset));\n }\n\n return json_encode($charts);\n }", "public function getReportsbyYear()\n {\n $charts = app(ReportChart::class);\n $response = $this->byYear();\n \n $charts->labels($response['ano']);\n \n $charts->dataset('Relatório Anual de Vendas','bar',$response['total'])\n ->backgroundColor($response['colors'])\n ->color('red');\n\n $charts->options([\n 'scales' => [\n 'yAxes' => [\n [\n 'ticks' => [\n 'callback' => $charts->rawObject('myCallback')\n ]\n ]\n ]\n ]\n ]); \n \n return $charts;\n }", "public function getHTML()\n\t{\n\t\tglobal $tpl;\n\t\t\n\t\tinclude_once \"Services/jQuery/classes/class.iljQueryUtil.php\";\n\t\tiljQueryUtil::initjQuery();\n\t\t\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/excanvas.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.min.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.pie.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.highlighter.js\");\n\t\t$tpl->addJavascript(\"Services/Chart/js/flot/jquery.flot.spider.js\");\n\n\t\t$chart = new ilTemplate(\"tpl.grid.html\", true, true, \"Services/Chart\");\n\t\t$chart->setVariable(\"ID\", $this->id);\n\t\t$chart->setVariable(\"WIDTH\", $this->width);\n\t\t$chart->setVariable(\"HEIGHT\", $this->height);\n\t\n\t\t$last = array_keys($this->data);\n\t\t$last = array_pop($last);\n\t\t$has_pie = false;\n\t\t$has_spider = false;\n\t\tforeach($this->data as $idx => $series)\n\t\t{\n\t\t\t$fill = $series->getFill();\n\t\t\t\n\t\t\tif ($series->getType() == \"spider\")\n\t\t\t{\n\t\t\t\t$has_spider = true;\n\t\t\t\t\n\t\t\t\tif ($fill[\"color\"] != \"\")\n\t\t\t\t{\n\t\t\t\t\t$chart->setCurrentBlock(\"series_property\");\n\t\t\t\t\t$chart->setVariable(\"SPROP\", \"color\");\n\t\t\t\t\t$chart->setVariable(\"SPROP_VAL\", self::renderColor($fill[\"color\"] , \"0.5\"));\n\t\t\t\t\t$chart->parseCurrentBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$chart->setCurrentBlock(\"series\");\n\t\t\t$chart->setVariable(\"SERIES_LABEL\", str_replace(\"\\\"\", \"\\\\\\\"\", $series->getLabel()));\n\t\t\t$chart->setVariable(\"SERIES_TYPE\", $series->getType());\n\n\t\t\t$type = $series->getType();\n\n\t\t\t$points = array();\n\t\t\tif($type != \"pie\")\n\t\t\t{\n\t\t\t\tforeach($series->getData() as $point)\n\t\t\t\t{\n\t\t\t\t\t$points[] = \"[\".$point[0].\",\".$point[1].\"]\";\n\t\t\t\t}\n\t\t\t\t$chart->setVariable(\"SERIES_DATA\", \"[ \".implode(\",\", $points).\" ]\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$has_pie = true;\n\t\t\t\t$chart->setVariable(\"SERIES_DATA\", array_pop($series->getData()));\n\t\t\t}\n\t\t\tif($idx != $last)\n\t\t\t{\n\t\t\t\t$chart->setVariable(\"SERIES_END\", \",\");\n\t\t\t}\n\n\t\t\t$options = array(\"show: \".($series->isHidden() ? \"false\" : \"true\"));\n\t\t\tif($type != \"points\")\n\t\t\t{\n\t\t\t\t$width = $series->getLineWidth();\n\t\t\t\tif($width !== null)\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"lineWidth:\".$width;\n\t\t\t\t}\n\t\t\t\tif($type == \"bars\")\n\t\t\t\t{\n\t\t\t\t\t$bar_options = $series->getBarOptions();\n\t\t\t\t\tif($bar_options[\"width\"] !== null)\n\t\t\t\t\t{\n\t\t\t\t\t\t$options[] = \"barWidth:\".str_replace(\",\", \".\", $bar_options[\"width\"]);\n\t\t\t\t\t\t$options[] = \"align: \\\"\".$bar_options[\"align\"].\"\\\"\";\n\t\t\t\t\t\tif($bar_options[\"horizontal\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$options[] = \"horizontal: true\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if($type == \"lines\")\n\t\t\t\t{\n\t\t\t\t\tif($series->getLineSteps())\n\t\t\t\t\t{\n\t\t\t\t\t\t$options[] = \"steps: true\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$radius = $series->getPointRadius();\n\t\t\t\tif($radius !== null)\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"radius:\".$radius;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($fill[\"fill\"])\n\t\t\t{\n\t\t\t\t$options[] = \"fill: \".$fill[\"fill\"];\n\t\t\t\tif($fill[\"color\"])\n\t\t\t\t{\n\t\t\t\t\t$options[] = \"fillColor: \".self::renderColor($fill[\"color\"], $fill[\"fill\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$chart->setVariable(\"SERIES_OPTIONS\", implode(\", \", $options));\n\n\t\t\t$chart->parseCurrentBlock();\n\t\t}\n\n\t\tif ($has_spider)\n\t\t{\n\t\t\t$chart->setCurrentBlock(\"spider\");\n\t\t\t$lab_strings = array();\n\t\t\tforeach ($this->getLegLabels() as $l)\n\t\t\t{\n\t\t\t\t$lab_strings[] = \"{label: \\\"\".$l.\"\\\"}\";\n\t\t\t}\n\t\t\t$chart->setVariable(\"LEG_LABELS\", implode($lab_strings, \",\"));\n\t\t\t$chart->setVariable(\"LEG_MAX\", $this->getYAxisMax());\n\t\t\t$chart->parseCurrentBlock();\n\t\t\t\n\t\t\t$chart->setCurrentBlock(\"spider_grid_options\");\n\t\t\t$chart->setVariable(\"NR_TICKS\", $this->getYAxisMax());\n\t\t\t$chart->parseCurrentBlock();\n\t\t}\n\t\t\n\t\t// global options\n\n\t\t$chart->setVariable(\"SHADOW\", (int)$this->getShadow());\n\t\t$chart->setVariable(\"IS_PIE\", ($has_pie ? \"true\" : \"false\"));\n\t\t\n\t\t$colors = $this->getColors();\n\t\tif($colors)\n\t\t{\n\t\t\t$tmp = array();\n\t\t\tforeach($colors as $color)\n\t\t\t{\n\t\t\t\t$tmp[] = self::renderColor($color);\n\t\t\t}\n\t\t}\n\t\tif(sizeof($tmp))\n\t\t{\n\t\t\t$chart->setVariable(\"COLORS\", implode(\",\", $tmp));\n\t\t}\n\n\t\t// legend\n\t\tif(!$this->legend)\n\t\t{\n\t\t\t$chart->setVariable(\"LEGEND\", \"show: false\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$margin = $this->legend->getMargin();\n\t\t\t$legend = array();\n\t\t\t$legend[] = \"show: true\";\n\t\t\t$legend[] = \"noColumns: \".$this->legend->getColumns();\n\t\t\t$legend[] = \"position: \\\"\".$this->legend->getPosition().\"\\\"\";\n\t\t\t$legend[] = \"margin: [\".$margin[\"x\"].\", \".$margin[\"y\"].\"]\";\n\t\t\t$legend[] = \"backgroundColor: \".self::renderColor($this->legend->getBackground());\n\t\t\t$legend[] = \"backgroundOpacity: \".str_replace(\",\",\".\",$this->legend->getOpacity());\n\t\t\t$legend[] = \"labelBoxBorderColor: \".self::renderColor($this->legend->getLabelBorder());\n\n\t\t\t$chart->setVariable(\"LEGEND\", implode(\", \", $legend));\n\t\t}\n\n\t\t// axis/ticks\n\t\t$tmp = array();\n\t\t$ticks = $this->getTicks();\n\t\tif($ticks)\n\t\t{\t\t\t\n\t\t\tforeach($ticks as $axis => $def)\n\t\t\t{\n\t\t\t\tif(is_numeric($def))\n\t\t\t\t{\n\t\t\t\t\t$tmp[$axis] = $axis.\"axis: { ticks: \".$def.\" }\";\n\t\t\t\t}\n\t\t\t\telse if(is_array($def))\n\t\t\t\t{\n\t\t\t\t\t$ttmp = array();\n\t\t\t\t\tforeach($def as $idx => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($ticks[\"labeled\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ttmp[] = \"[\".$idx.\", \\\"\".$value.\"\\\"]\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ttmp[] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$tmp[$axis] = $axis.\"axis: { ticks: [\".implode(\", \", $ttmp).\"] }\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// optional: remove decimals\n\t if(!isset($tmp[\"x\"]) && $this->integer_axis[\"x\"])\n\t\t{\n\t\t\t$tmp[\"x\"] = \"xaxis: { tickDecimals: 0 }\";\n\t\t}\n\t\tif(!isset($tmp[\"y\"]) && $this->integer_axis[\"y\"])\n\t\t{\n\t\t\t$tmp[\"y\"] = \"yaxis: { tickDecimals: 0 }\";\n\t\t}\t\t\n\t\t\n\t\tif(sizeof($tmp))\n\t\t{\n\t\t\t$chart->setVariable(\"AXIS\", \",\".implode(\", \", $tmp));\n\t\t}\n\t\t\n\t\t$ret = $chart->get();\n//echo htmlentities($ret);\n\t\treturn $ret;\n\t}", "private function trackerGrid() {\n\t\t\t\t\n\t\t$latestDays = filters\\timeFilter::getPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars);\n\t\t\t\t\n\t\t$arr \t\t= array();\n\t\t$arrChart \t= array();\n\t\t$cols \t\t= array();\n\t\t\n\t\tif(isset($_REQUEST['PROMOTION']))\n\t\t{\n\t\t\tif($_REQUEST['PROMOTION'] == 'YES')\n\t\t\t{\n\t\t\t\t// filters\\timeFilter::prepareTyLyMydateRange($this->settingVars); //Total Weeks\n\t\t\t\t\n\t\t\t\t$qPart = '';\n\t\t\t\tif (isset($_REQUEST[\"FS\"]) && $_REQUEST[\"FS\"] != ''){\n\t\t\t\t\t$storeStock \t= $this->settingVars->dataArray['F18']['NAME'];\n\t\t\t\t\t$availInst \t\t= $this->settingVars->dataArray['F15']['NAME'];\n\t\t\t\t\t$depotService\t= $this->settingVars->dataArray['F14']['NAME'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$latestDay = filters\\timeFilter::getPeriodWithinRange(0, 1, $this->settingVars);\n\t\t\t\t\t\n\t\t\t\t\t//MAIN TABLE QUERY\t\t\t\n\t\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\t\t\t\",\".$this->settingVars->dateField.\" AS MYDATES \" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY\" .\n\t\t\t\t\t\t\t\t\",SUM($storeStock) AS STORESTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($availInst) AS STOREINSTOCK\".\n\t\t\t\t\t\t\t\t\",AVG($depotService) AS DEPOTSERVICE\".\n\t\t\t\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\t\t\t\" AND (\" . filters\\timeFilter::$tyWeekRange . \" OR \" . filters\\timeFilter::$lyWeekRange . \") GROUP BY SKUID, SKU, MYDATES ORDER BY MYDATES ASC, SALES DESC\";\n\t\t\t\t\t//echo $query;exit;\n\t\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\t\n\t\t\t\t\t$temp1\t= array();\n\t\t\t\t\t$temp2\t= array();\n\t\t\t\t\t$temp3\t= array();\n\t\t\t\t\t$temp4\t= array();\n\t\t\t\t\t$temp5\t= array();\n\t\t\t\t\t$latestDays = array_reverse($latestDays);\n\t\t\t\t\tforeach($latestDays as $lw)\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($key == 0)\n\t\t\t\t\t\t\t$cols[] \t= array('data'=>'L_'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\t\t\t$searchKey = array_search($lw,array_column($result,\"MYDATES\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($searchKey)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$value = $result[$searchKey];\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['SALES'];\n\t\t\t\t\t\t\t$temp2[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp3[\"L_\".str_replace(\"-\",\"\",$lw)]\t= (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$account = $lw;\n\t\t\t\t\t\t\tif (in_array($account, filters\\timeFilter::$tyDaysRange)) { //$numberFrom AND $numberTo COMES HANDY HERE\n\t\t\t\t\t\t\t\t$temp4[\"L_\".str_replace(\"-\",\"\",$lw)] \t= number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t\t$temp5[\"L_\".str_replace(\"-\",\"\",$lw)]\t= number_format($value['DEPOTSERVICE'],1, '.', '');\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = (int)$value['QTY'];\n\t\t\t\t\t\t\t$temp['STORESTOCK'] = (int)$value['STORESTOCK'];\n\t\t\t\t\t\t\t$temp['STOREINSTOCK'] = number_format($value['STOREINSTOCK'],1, '.', '');\n\t\t\t\t\t\t\t$temp['DEPOTSERVICE'] = number_format($value['DEPOTSERVICE'],1, '.', '');\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp1[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp2[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp3[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp4[\"L_\".str_replace(\"-\",\"\",$lw)] = $temp5[\"L_\".str_replace(\"-\",\"\",$lw)] = 0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\t\t$temp['MYDATE'] = $lw;\n\t\t\t\t\t\t\t$temp['QTY'] = $temp['STORESTOCK'] = $temp['STOREINSTOCK'] = $temp['DEPOTSERVICE'] = 0;\n\t\t\t\t\t\t\t$arrChart[] = $temp;\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$temp1['label'] = \"SALES \".$this->settingVars->currencySign;\n\t\t\t\t\t$temp2['label'] = \"QTY\";\n\t\t\t\t\t$temp3['label'] = \"STORE STOCK\";\n\t\t\t\t\t$temp4['label'] = \"STORE INSTOCK %\";\n\t\t\t\t\t$temp5['label'] = \"DEPOT SERVICE %\";\n\t\t\t\t\t\n\t\t\t\t\t$arr[0]\t= $temp1;\t\t\t\t\n\t\t\t\t\t$arr[1]\t= $temp2;\t\t\t\t\n\t\t\t\t\t$arr[2]\t= $temp3;\t\t\t\t\n\t\t\t\t\t$arr[3]\t= $temp4;\t\t\t\t\n\t\t\t\t\t$arr[4]\t= $temp5;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfilters\\timeFilter::fetchPeriodWithinRange(0, filters\\timeFilter::$daysTimeframe, $this->settingVars); //To get $mydateRange\n\t\t\t\t\n\t\t\t\t$act = $_REQUEST['ACCOUNT'];\n\t\t\t\t$account = $this->settingVars->dataArray[$act]['NAME'];\n\t\t\t\t\n\t\t\t\t//asort($latestDays);\n\t\t\t\t\n\t\t\t\t$getLdates = array();\n\t\t\t\tforeach($latestDays as $date)\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$getLdates[] = \"MAX((CASE WHEN \" . $this->settingVars->period . \"='\".$date.\"' THEN 1 ELSE 0 END)*$account) AS DATE\".str_replace(\"-\",\"\",$date);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qPart = implode(\",\",$getLdates);\n\t\t\t\t\n\t\t\t\t//MAIN TABLE QUERY\n\t\t\t\t$query = \"SELECT \".$this->settingVars->maintable.\".skuID AS SKUID \" .\n\t\t\t\t\t\",sku AS SKU \" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectValue.\") AS SALES\" .\n\t\t\t\t\t\",SUM(\".$this->settingVars->ProjectVolume.\") AS QTY,\" .\n\t\t\t\t\t$qPart.\n\t\t\t\t\t\" FROM \" . $this->settingVars->tablename . $this->queryPart .\n\t\t\t\t\t\" AND \" . filters\\timeFilter::$mydateRange . \" GROUP BY SKUID, SKU ORDER BY SALES DESC\";\n\t\t\t\t$result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t\t\t\t\n\t\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\t\tforeach ($result as $key => $value) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$temp \t\t\t\t= array();\n\t\t\t\t\t\t$temp['SKUID'] \t\t= $value['SKUID'];\n\t\t\t\t\t\t$temp['SKU'] \t\t= $value['SKU'];\n\t\t\t\t\t\t$temp['SALES'] \t\t= number_format($value['SALES'], 1, '.', '');\n\t\t\t\t\t\t$temp['QTY'] \t\t= number_format($value['QTY'], 1, '.', '');\n\t\t\t\t\t\tforeach($latestDays as $lw)\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\tif($key == 0)\n\t\t\t\t\t\t\t\t$cols[] \t= array('data'=>'Tracker_L'.str_replace(\"-\",\"\",$lw),'label'=>date(\"jS M Y\",strtotime($lw)));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$temp['Tracker_L'.str_replace(\"-\",\"\",$lw)] \t= number_format($value['DATE'.str_replace(\"-\",\"\",$lw)], 1, '.', '');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$arr[] \t\t\t\t= $temp;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n $this->jsonOutput['TrackerGrid'] \t= $arr;\n $this->jsonOutput['TrackerChart'] \t= $arrChart;\n $this->jsonOutput['Tracker_L'] \t\t= $cols;\n }", "public function chart() {\n\n\t\t$data = array();\n\n\t\t$charts = FaceDetect::select( [ 'data', 'created_at' ] )->get( [\n\t\t\t'data',\n\t\t\t'created_at'\n\t\t] )->groupBy( function ( $date ) {\n\t\t\treturn Carbon::parse( $date->created_at )->format( 'm' );\n\t\t} )->toArray();\n\n\t\tforeach ( $charts as $key => $face ) {\n\n\t\t\tforeach ( $face as $index => $f ) {\n\t\t\t\t$date = explode( '-', Carbon::parse( $f['created_at'] )->format( 'Y-m-d' ) );\n\t\t\t\tforeach ( $f['data'] as $i => $item ) {\n\t\t\t\t\t$age [ $key ][] = $item['age'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data[] = [\n\t\t\t\t'age_max' => max( $age[ $key ] ),\n\t\t\t\t'age_min' => min( $age[ $key ] ),\n\t\t\t\t'age_avg' => intval( array_sum( [ max( $age[ $key ] ), min( $age[ $key ] ) ] ) / 2 ),\n\t\t\t\t'key' => $this->jdate_words( [ 'mm' => $this->gregorian_to_jalali( $date[0], $date[1], $date[2] )[1] ] )['mm']\n\t\t\t];\n\n\t\t}\n\n\t\treturn $data;\n\n\t}", "protected function getDataSet()\n {\n return $this->createMySQLXMLDataSet(__DIR__ . '/../paczkolab_test.xml');\n }", "public function query(): iterable\n {\n return [\n 'charts' => [\n [\n 'name' => 'Some Data',\n 'values' => [25, 40, 30, 35, 8, 52, 17],\n 'labels' => ['12am-3am', '3am-6am', '6am-9am', '9am-12pm', '12pm-3pm', '3pm-6pm', '6pm-9pm'],\n ],\n [\n 'name' => 'Another Set',\n 'values' => [25, 50, -10, 15, 18, 32, 27],\n 'labels' => ['12am-3am', '3am-6am', '6am-9am', '9am-12pm', '12pm-3pm', '3pm-6pm', '6pm-9pm'],\n ],\n [\n 'name' => 'Yet Another',\n 'values' => [15, 20, -3, -15, 58, 12, -17],\n 'labels' => ['12am-3am', '3am-6am', '6am-9am', '9am-12pm', '12pm-3pm', '3pm-6pm', '6pm-9pm'],\n ],\n [\n 'name' => 'And Last',\n 'values' => [10, 33, -8, -3, 70, 20, -34],\n 'labels' => ['12am-3am', '3am-6am', '6am-9am', '9am-12pm', '12pm-3pm', '3pm-6pm', '6pm-9pm'],\n ],\n ],\n 'table' => [\n new Repository(['id' => 100, 'name' => self::TEXT_EXAMPLE, 'price' => 10.24, 'created_at' => '01.01.2020']),\n new Repository(['id' => 200, 'name' => self::TEXT_EXAMPLE, 'price' => 65.9, 'created_at' => '01.01.2020']),\n new Repository(['id' => 300, 'name' => self::TEXT_EXAMPLE, 'price' => 754.2, 'created_at' => '01.01.2020']),\n new Repository(['id' => 400, 'name' => self::TEXT_EXAMPLE, 'price' => 0.1, 'created_at' => '01.01.2020']),\n new Repository(['id' => 500, 'name' => self::TEXT_EXAMPLE, 'price' => 0.15, 'created_at' => '01.01.2020']),\n\n ],\n 'metrics' => [\n 'sales' => ['value' => number_format(6851), 'diff' => 10.08],\n 'visitors' => ['value' => number_format(24668), 'diff' => -30.76],\n 'orders' => ['value' => number_format(10000), 'diff' => 0],\n 'total' => number_format(65661),\n ],\n ];\n }", "function loadSeriesData( $seriesKey='' ) \n {\n // if no series key is given, then all data will be loaded.\n // might not be what you want ...\n $whereClause = '';\n if ($seriesKey != '' ) {\n \n $whereClause = ' series_key=\"'.$seriesKey.'\" ';\n }\n \n // compile proper SQL statement for loading this series...\n $sql = 'SELECT DISTINCT series_key FROM ';\n $sql .= SITE_DB_NAME.'.'.XMLObject_MultilingualManager::DB_TABLE_SERIES;\n \n if ( $whereClause != '') {\n $sql .= ' WHERE '.$whereClause;\n }\n\n // run the query \n $this->db->runSQL( $sql );\n\n // for each series returned\n while( $row = $this->db->retrieveRow() ) {\n\n // create new instance of series\n $seriesList = new XMLObject_Multilingual_Series($row['series_key']);\n \n // add to this object's XML data\n $this->addXmlObject( $seriesList );\n }\n \n \n }", "public function getViewData() {\n $analyses = $this->model->Analysis->find('all', ['conditions' => ['set_code' => $this->set_code]]);\n $analysisItems = [];\n foreach ($analyses as $index => $analysis) {\n $analysisItems[$analysis['Analysis']['title']] = [\n 'links' => [\n [\n 'text' => [\n 'id' => 'processedDataFile',\n 'set' => 'Analysis'\n ],\n 'url' => $analysis['Analysis']['derived_results']\n //'url' => 'data/files/analysis/' . $analysis['Analysis']['derived_results'] //removed to get correct urls for processedDataFile\n ],\n [\n 'text' => [\n 'id' => 'resultsDataFile',\n 'set' => 'Analysis'\n ],\n 'url' => $analysis['Analysis']['processed']\n //'url' => 'data/files/analysis/' . $analysis['Analysis']['processed'] //removed to get correct urls for resultsDataFile (Additional)\n ]\n ]\n ];\n }\n \n $DataFileLink =[];\n $DataFileLink['metaData'] = [\n 'links' => [\n 'text' => 'metaData File',\n 'url' =>$this->metaFile\n ]\n ];\n //var_dump($analysisItems['Analysis_One']);\n //var_dump($metaDataFileLink);\n \n $data = [\n 'submitter' => [\n 'text' => $this->submitter],\n 'submitter_email' => [\n 'text' => $this->submitter_email],\n 'team' => [\n 'text' => $this->team],\n 'chemist' => [\n 'text' => $this->chemist],\n 'set_code' => [\n 'text' => $this->set_code],\n 'type' => [\n 'text' => $this->type],\n 'crop' => [\n 'text' => $this->crop],\n 'sample_number' => [\n 'text' => $this->number],\n 'p_name' => [\n 'text' => $this->p_name],\n 'p_code' => [\n 'text' => $this->p_code],\n 'exp_reference' => [\n 'text' => $this->exp_reference],\n 'compounds' => [\n 'text' => $this->compounds],\n 'set_reason' => [\n 'text' => $this->set_reason],\n 'comments' => [\n 'text' => $this->comments],\n 'date' => [\n 'text' => $this->date],\n 'sample_loc' => [\n 'text' => $this->sample_loc],\n 'containment' => [\n 'text' => $this->containment],\n 'containment_details' => [\n 'text' => $this->containment_details],\n //'metaFile' => [\n // 'text' => $this->metaFile],\n 'status' => [\n 'text' => $this->status]\n ];\n return array_merge($data, $analysisItems, $DataFileLink);\n }", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "function getData($strKriteria)\n{\n global $tblEmployee;\n global $strDataTotal;\n global $strChartPath;\n global $strPageTitle;\n global $strWordsTitle;\n global $strDirPath;\n global $strFilePath;\n global $strDate;\n global $strPageTitle;\n global $strDataInterval;\n global $strResultInTable;\n global $db;\n global $ARRAY_EMPLOYEE_STATUS;\n $chart = new VerticalBarChart();\n $dataSet = new XYDataSet();\n //get all edu level\n $arrCode = $ARRAY_EMPLOYEE_STATUS;\n $arrCode[] = null;\n foreach ($arrCode as $key => $codeData) {\n $strSQL = \"SELECT COUNT(*) FROM hrd_employee AS t1\n\t\tLEFT JOIN hrd_salary_detail AS t2 ON t1.id = t2.id_employee \";//AND t1.position_code = t2.position_code \";\n $strExecuteKriteria = \" AND t1.employee_status = '$key' \";\n $strExecuteSQL = $strSQL . $strKriteria . $strExecuteKriteria;\n $numOfEmployee = $db->execute($strExecuteSQL);\n $numOfEmployee = $db->fetchrow($numOfEmployee);\n $numOfEmployee = $numOfEmployee[\"count\"];\n if ($codeData == null) {\n $codeData = getWords(\"No $strWordsTitle Data\");\n }\n $dataSet->addPoint(new Point(\"$codeData\", $numOfEmployee));\n $strResultInTable .= \"\n\t\t<tr>\n\t\t\t<td>$codeData</td>\n\t\t\t<td align=right>$numOfEmployee</td>\n\t\t</tr>\n\t\t\";\n $strDataTotal += $numOfEmployee;\n }\n $chart->setDataSet($dataSet);\n $chart->setTitle($strPageTitle);\n $strChartPath = $strDirPath . \"/\" . $strFilePath;\n if (!file_exists($strChartPath)) {\n if (!file_exists($strDirPath)) {\n mkdir($strDirPath);\n }\n $temp = fopen($strChartPath, \"w\");\n fwrite($temp, \"\");\n fclose($temp);\n }\n $chart->render($strChartPath);\n}", "private function topGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",\".$this->accountNameField.\" AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->commonQueryPart.\" GROUP BY SKUID, ACCOUNT, PERIOD ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n $tmpResult = array();\r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n $tmpResult[$data['SKUID'].\"##\".$data['ACCOUNT']][$data['PERIOD']] = $data;\r\n \r\n foreach($tmpResult as $tmpKey => $tmpData)\r\n {\r\n $tmp = array();\r\n $extra = explode(\"##\", $tmpKey);\r\n $tmp[\"0_0SKUID\"] = $extra[0];\r\n $tmp[\"0_01ACCOUNT\"] = $extra[1];\r\n \r\n foreach($periodResult as $key => $period)\r\n {\r\n $tmp[$key.\"_1ORDERED_\".$period] = (double)$tmpData[$period][\"ORDERED\"];\r\n $tmp[$key.\"_2DOT_\".$period] = ($tmpData[$period][\"ORDERED\"] != 0) ? ($tmpData[$period][\"DELIVERED\"]/$tmpData[$period][\"ORDERED\"])*100 : 0;\r\n $tmp[$key.\"_2DOT_\".$period] = (double)number_format($tmp[$key.\"_2DOT_\".$period], 1, '.', '');\r\n }\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n }\r\n\r\n $this->jsonOutput['topGridData'] = $finalData;\r\n }", "protected function getDataSet()\n {\n return new CompositeDataSet([]);\n }", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "public function getMultipleData();", "protected function getDataSet() {\n\t\treturn $this->createXMLDataSet ( dirname ( __FILE__ ) . '\\..\\..\\data\\cron\\1_DS_1_article_test_1_dupl_attach_1_unpub_attach_1_new_valid_DS_data.xml' );\n\t}", "public function getDatasets($resource = NULL, $study_id = NULL, $query = NULL, $from = 0, $limit = 50, $sort = NULL, $order = NULL, $network_id=NULL) {\n global $language;\n $this->setLastResponse(NULL);\n $from = empty($from) ? '0' : $from;\n $limit = empty($limit) ? '5' : $limit;\n $order = empty($order) ? '' : ($order == 'desc' ? '-' : '');\n $sort_rql_bucket = empty($sort) ? \"\" : \",sort($order$sort)\";\n $query = empty($query) ? '' : \",match($query,(Mica_dataset.name,Mica_dataset.acronym,Mica_dataset.description))\";\n $resource_params = empty($resource) ? '' : \",in(Mica_dataset.className,$resource)\";\n $network_params = empty($network_id) ? '' : \",in(Mica_dataset.networkId,$network_id)\";\n $studies_param = empty($study_id) ? '' :\",study(in(Mica_study.id,(\" . rawurlencode($study_id) . \")))\";\n\n if (!empty($query) || !empty($resource_params) || !empty($studies_param)) {\n $params = \"dataset(limit($from,$limit)$resource_params$network_params$query$sort_rql_bucket)$studies_param\";\n } else {\n $params = \"dataset(exists(Mica_dataset.id),limit($from,$limit)$sort_rql_bucket)\";\n }\n\n $params .= \",locale($language->language)\";\n $resource_query = '/datasets/_rql?query=' . $params;\n $this->drupalCache->MicaGetCache($resource_query);\n if(!isset($this->result_resource_query)){\n $url_datasets = $this->micaUrl . $resource_query;\n $request = new HttpClientRequest($url_datasets, array(\n 'method' => HttpClientRequest::METHOD_GET,\n 'headers' => $this->authorizationHeader(array(\n 'Accept' => array(parent::HEADER_JSON),\n )\n ),\n ));\n $client = $this->client();\n try {\n $data = $client->execute($request);\n $this->setLastResponse($client->lastResponse);\n $datasets = json_decode($data);\n if($datasets->datasetResultDto->totalCount!==0){\n $this->result_resource_query = new DatasetJoinResponseWrapper($datasets);\n $this->drupalCache->MicaSetCache($resource_query, $this->result_resource_query);\n }\n return $this->result_resource_query;\n }\n catch (HttpClientException $e) {\n watchdog('Mica Client', 'Connection to server fail, Error serve code : @code, message: @message',\n array(\n '@code' => $e->getCode(),\n '@message' => $e->getMessage()\n ), WATCHDOG_WARNING);\n $this->result_resource_query = NULL;\n return array();\n }\n }\n return $this->result_resource_query;\n }", "function &getDatas()\r\n\t{\r\n\t\t// Load the data\r\n\t\tif (empty( $this->_data )) \r\n\t\t{\r\n\t\t\t$query = ' SELECT * FROM #__hotelreservation_packages WHERE hotel_id='.$this->_hotel_id.\" ORDER BY package_name \";\r\n\t\t\t//$this->_db->setQuery( $query );\r\n\t\t\t$this->_data = &$this->_getList( $query );\r\n\t\t\t\r\n\t\t\tforeach( $this->_data as $key => $value )\r\n\t\t\t{\r\n\t\t\t\tif( $this->_data[$key]->is_price_day == false )\r\n\t\t\t\t\t$this->_data[$key]->package_type_price = 1;\r\n\t\t\t\t$this->_data[$key]->package_prices = null;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_1 ][] = 1;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_2 ][] = 2;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_3 ][] = 3;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_4 ][] = 4;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_5 ][] = 5;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_6 ][] = 6;\r\n\t\t\t\t$this->_data[$key]->package_prices[ $value->package_price_7 ][] = 7;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->_data;\r\n\t}", "public function getMultipleData()\n\t{\n\t\t$calculatedData = $this->getCalculatedData();\n\t\t$items = [];\n\t\t$amountDealCurrencyId = \\CCrmCurrency::GetAccountCurrencyID();\n\n\t\t$config = [\n\t\t\t'title' => $this->getFormElement('label')->getValue()\n\t\t];\n\n\t\tif (!empty($calculatedData))\n\t\t{\n\t\t\t$calculateField = $this->getFormElement('calculate');\n\t\t\t$calculateValue = $calculateField ? $calculateField->getValue() : null;\n\n\t\t\t$shortModeField = $this->getFormElement('shortMode');\n\t\t\t$shortModeValue = $shortModeField ? $shortModeField->getValue() : false;\n\n\t\t\tswitch ($calculateValue)\n\t\t\t{\n\t\t\t\tcase self::WHAT_WILL_CALCULATE_DEAL_CONVERSION:\n\t\t\t\t\t$config['mode'] = 'singleData';\n\t\t\t\t\t$config['unitOfMeasurement'] = '%';\n\t\t\t\t\t$item['value'] = round($calculatedData['withoutGrouping'], 2);\n\t\t\t\t\t$item['color'] = '#9DCF00';\n\t\t\t\t\t$items[] = $item;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$itemCount = 0;\n\t\t\t\t\tforeach ($calculatedData as $key => $data)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif ($key === 'amount') //TODO: optimise calculating of amount values\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$item = [\n\t\t\t\t\t\t\t'label' => $data['title'],\n\t\t\t\t\t\t\t'value' => $data['value'],\n\t\t\t\t\t\t\t'color' => $data['color']\n\t\t\t\t\t\t];\n\n\n\n\t\t\t\t\t\tif ($calculateValue === self::WHAT_WILL_CALCULATE_DEAL_DATA_FOR_FUNNEL\n\t\t\t\t\t\t\t|| $calculateValue === self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->isConversionCalculateMode())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$item['link'] = $this->getTargetUrl('/crm/deal/analytics/list/', [\n\t\t\t\t\t\t\t\t\t'STAGE_ID_FROM_SUPPOSED_HISTORY' => $key\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$item['link'] = $this->getTargetUrl('/crm/deal/analytics/list/', [\n\t\t\t\t\t\t\t\t\t'STAGE_ID_FROM_HISTORY' => $key\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$config['additionalValues']['firstAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_COUNT_SHORT_TITLE'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$item['additionalValues']['firstAdditionalValue'] = [\n\t\t\t\t\t\t\t'value' => $data['value']\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\tif (isset($data['additionalValues']['sum']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$amountDealCurrencyId = $data['additionalValues']['sum']['currencyId'];\n\t\t\t\t\t\t\t$config['additionalValues']['secondAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_SUM_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$item['additionalValues']['secondAdditionalValue'] = [\n\t\t\t\t\t\t\t\t'value' => \\CCrmCurrency::MoneyToString(\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['sum']['VALUE'],\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['sum']['currencyId']\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'currencyId' => $data['additionalValues']['sum']['currencyId']\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (isset($data['additionalValues']['avgSpentTime']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$config['additionalValues']['thirdAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_SPENT_TIME_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$item['additionalValues']['thirdAdditionalValue'] = [\n\t\t\t\t\t\t\t\t'value' => $this->getFormattedPassTime(\n\t\t\t\t\t\t\t\t\t$data['additionalValues']['avgSpentTime']['VALUE']\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$stageSemanticId = \\CCrmDeal::GetSemanticID($key);\n\t\t\t\t\t\t$config['additionalValues']['forthAdditionalValue']['titleShort'] = Loc::getMessage(\n\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$item['additionalValues']['forthAdditionalValue'] = [\n\t\t\t\t\t\t\t'title' => PhaseSemantics::isLost($stageSemanticId) ?\n\t\t\t\t\t\t\t\t\t\t\tLoc::getMessage(\"CRM_REPORT_DEAL_HANDLER_DEAL_LOSSES_SHORT_TITLE\")\n\t\t\t\t\t\t\t\t\t\t\t: Loc::getMessage(\"CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE\"),\n\t\t\t\t\t\t\t'value' => $calculatedData['amount']['value'] ? round(\n\t\t\t\t\t\t\t\t($data['value'] / $calculatedData['amount']['value']) * 100,\n\t\t\t\t\t\t\t\t2\n\t\t\t\t\t\t\t) : 0,\n\t\t\t\t\t\t\t'unitOfMeasurement' => '%',\n\t\t\t\t\t\t\t'helpLink' => 'someLink',\n\t\t\t\t\t\t\t'helpInSlider' => true\n\t\t\t\t\t\t];\n\t\t\t\t\t\t//hidden conversion on first column\n\t\t\t\t\t\tif ($calculateValue !== self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL && $itemCount < 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($item['additionalValues']['forthAdditionalValue']);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$itemCount++;\n\n\n\n\t\t\t\t\t\t$items[] = $item;\n\t\t\t\t\t}\n\n\t\t\t\t\t$calculateField = $this->getFormElement('calculate');\n\t\t\t\t\t$calculateValue = $calculateField ? $calculateField->getValue() : null;\n\n\t\t\t\t\t$config['titleShort'] = Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_COUNT_SHORT_TITLE');\n\n\t\t\t\t\t$config['valuesAmount'] = [\n\t\t\t\t\t\t'firstAdditionalAmount' => [\n\t\t\t\t\t\t\t'title' => Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_SUM_SHORT_TITLE'),\n\t\t\t\t\t\t\t'value' => \\CCrmCurrency::MoneyToString(\n\t\t\t\t\t\t\t\t$calculatedData['amount']['sum'],\n\t\t\t\t\t\t\t\t$amountDealCurrencyId\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'targetUrl' => $this->getTargetUrl('/crm/deal/analytics/list/'),\n\t\t\t\t\t\t]\n\t\t\t\t\t];\n\n\t\t\t\t\tif ($calculatedData['amount']['successPassTime'] ?? false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$config['valuesAmount']['secondAdditionalAmount'] = [\n\t\t\t\t\t\t\t'title' => Loc::getMessage('CRM_REPORT_DEAL_HANDLER_DEAL_PASS_AVG_TIME_SHORT_TITLE'),\n\t\t\t\t\t\t\t'value' => $this->getFormattedPassTime($calculatedData['amount']['successPassTime'])\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch ($calculateValue)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase self::WHAT_WILL_CALCULATE_SUCCESS_DEAL_DATA_FOR_FUNNEL:\n\t\t\t\t\t\t\t$config['topAdditionalTitle'] = Loc::getMessage(\n\t\t\t\t\t\t\t\t'CRM_REPORT_DEAL_HANDLER_DEAL_CONVERSION_SHORT_TITLE'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$config['topAdditionalValue'] = !empty($items[0]['additionalValues']['forthAdditionalValue']['value'])\n\t\t\t\t\t\t\t\t? $items[0]['additionalValues']['forthAdditionalValue']['value'] : 0;\n\t\t\t\t\t\t\t$config['topAdditionalValueUnit'] = '%';\n\t\t\t\t\t\t\t$config['valuesAmount']['firstAdditionalAmount']['value'] =\n\t\t\t\t\t\t\t\t($items[0]['additionalValues']['secondAdditionalValue']['value'] ?? null)\n\t\t\t\t\t\t\t;\n\t\t\t\t\t\t\t//$config['valuesAmount']['secondAdditionalAmount']['value'] =\n\t\t\t\t\t\t\t// $items[0]['additionalValues']['thirdAdditionalValue']['value']\n\t\t\t\t\t\t\t//;\n\n\t\t\t\t\t\t\tif ($shortModeValue)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$config['mode'] = 'singleData';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tunset($config['valuesAmount']['thirdAdditionalAmount']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$result = [\n\t\t\t'items' => $items,\n\t\t\t'config' => $config,\n\t\t];\n\n\t\treturn $result;\n\t}", "public static function BUILD_CAGES()\n {\n $data = self::GET_COLAGE_STATS();\n\t\t\n $dataset = [];\n $fsdata = [];\n\t\t\n $A = [];\n $B = [];\n $C = [];\n\t\t\n foreach ($data as $key => $value) {\n $obj = (object)$value;\n\t\t\t$labels[] = ['label'=>self::ABBR_CNAME($obj->COL_NAME)];\n\t\t\t$A[] = ['value'=>$obj->A];\n\t\t\t$B[] = ['value'=>$obj->B];\n\t\t\t$C[] = ['value'=>$obj->C];\n }\n\t\t\n\t\t$dataset[]=[\"seriesname\"=>\"Below 35\",\"data\"=>$A];\n\t\t$dataset[]=[\"seriesname\"=>\"35 to 64\",\"data\"=>$B];\n\t\t$dataset[]=[\"seriesname\"=>\"65 & Above\",\"data\"=>$C];\n\n $graphData = [\n\t\t\t'type'=>'msline',\n\t\t\t'renderAt'=>'colstaffage-chart',\n\t\t\t'width'=>'100%',\n\t\t\t'height'=>'100%',\n\t\t\t'dataFormat'=>'json',\n\t\t\t'dataSource'=>[\n\t\t\t\t\"chart\"=>[\n\t\t\t\t\t\"caption\"=>\"STAFF AGE DISTRIBUTION IN COLLEGES\",\n\t\t\t\t\t// \"subcaption\"=>\"By Top 3 Vendors\",\n\t\t\t\t\t\"linethickness\"=>\"5\",\n\t\t\t\t\t// \"numberPrefix\"=>\"$\",\n\t\t\t\t\t\"showvalues\"=>\"0\",\n\t\t\t\t\t\"formatnumberscale\"=>\"1\",\n\t\t\t\t\t\"labeldisplay\"=>\"ROTATE\",\n\t\t\t\t\t\"slantlabels\"=>\"1\",\n\t\t\t\t\t\"divLineAlpha\"=>\"40\",\n\t\t\t\t\t\"anchoralpha\"=>\"0\",\n\t\t\t\t\t\"animation\"=>\"1\",\n\t\t\t\t\t\"legendborderalpha\"=>\"20\",\n\t\t\t\t\t\"drawCrossLine\"=>\"1\",\n\t\t\t\t\t\"crossLineColor\"=>\"#0d0d0d\",\n\t\t\t\t\t\"crossLineAlpha\"=>\"100\",\n\t\t\t\t\t\"tooltipGrayOutColor\"=>\"#80bfff\",\n\t\t\t\t\t\"theme\"=>\"zune\",\n\t\t\t\t\t\"exportEnabled\"=>\"1\",\n\t\t\t\t\t\"autoScale\"=>\"1\",\n\t\t\t\t],\n\t\t\t\t\"categories\"=>[\n\t\t\t\t\t[\"category\"=>$labels],\n\t\t\t\t],\n\t\t\t\t\"dataset\"=>$dataset,\n\t\t\t]\n\t\t];\n\t\t\n\t\t$fsdata = $graphData;\n\n return $fsdata;\n }", "public function getDatasetsList() {\n return $this->_get(1);\n }", "private function rateOfSaleTrackerGrid() {\n\t\t$arr = array();\t\t\n /*[PART 1] GETTING THE STORE COUNT DATA*/\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n $this->measureFields[] = $this->accountID;\n $this->measureFields[] = $this->storeCount;\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\t\t$getStoreData = $this->storeCountData($this->accountID,$this->storeCount);\n\n\t\t/*[PART 2] GETTING THE GRID DATA*/\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n \t$measureSelectRes = $this->prepareMeasureSelectPart();\n\t\t$this->measureFields = $measureSelectRes['measureFields'];\n\n\t\t$measureSelectionArr = $measureSelectRes['measureSelectionArr'];\n\t\t$havingTYValue \t\t = $measureSelectRes['havingTYValue'];\n\t\t$havingLYValue \t\t = $measureSelectRes['havingLYValue'];\n\n $this->measureFields[] = $this->accountID;\n $this->measureFields[] = $this->accountName;\n\t\t\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\n /*$options = array();\n if (!empty($this->ytdTyWeekRange))\n $options['tyLyRange']['SALES'] = $this->ytdTyWeekRange;\n\n if (!empty($this->ytdLyWeekRange))\n $options['tyLyRange']['LYSALES'] = $this->ytdLyWeekRange;\n\n $measureSelect = config\\MeasureConfigure::prepareSelect($this->settingVars, $this->queryVars, array('M'.$_REQUEST['ValueVolume']), $options);\n $measureSelect = implode(\", \", $measureSelect);*/\n\n\t\t$measureSelect = implode(\", \", $measureSelectionArr);\n $query = \"SELECT \".$this->accountID.\" as SKUID\" .\n\t\t\t\t\",\".$this->accountName.\" as SKU\".\n\t\t\t\t\",\".$measureSelect.\" \".\n \",SUM((CASE WHEN \" . $this->ytdTyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectVolume.\") as QTY \".\n \",SUM((CASE WHEN \" . $this->ytdLyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectVolume.\") as QTY_LY \".\n \",SUM((CASE WHEN \" . $this->ytdTyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectValue.\") as VAL_TY \".\n\t\t\t\t\",SUM((CASE WHEN \" . $this->ytdLyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectValue.\") as VAL_LY \".\n \"FROM \" . $this->settingVars->tablename.\" \".$this->queryPart.\n\t\t\t\t\" AND (\" . $this->ytdTyWeekRange . \" OR \" . $this->ytdLyWeekRange . \") \".\n\t\t\t\t\"GROUP BY SKUID, SKU \";\n\t\t\n\t\t//HAVING (SALES > 0 AND QTY > 0) ORDER BY SALES DESC\n\t\t$redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\n if ($redisOutput === false) {\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n $this->redisCache->setDataForHash($result);\n } else {\n $result = $redisOutput;\n }\n\n\n\t\t$requiredGridFields = ['SKUID','SKU','QTY','QTY_LY','VAL_TY','VAL_LY',$havingTYValue, $havingLYValue];\n\t\t$result = $this->redisCache->getRequiredData($result, $requiredGridFields, $havingTYValue, $havingTYValue);\n\t\t\n\t\tif (is_array($result) && !empty($result)) {\n\n\t\t\t$result = \\utils\\SortUtility::sort2DArray($result, $havingTYValue, \\utils\\SortTypes::$SORT_DESCENDING);\t\n\t\t\t//$total = array_sum(array_column($result,'SALES'));\n //$totalSALESLY = array_sum(array_column($result,'LYSALES'));\n\t\t\t\n // $total = array_sum(array_column($result,$havingTYValue));\n // $totalSALESLY = array_sum(array_column($result,$havingLYValue));\n \n $total = $totalSALESLY = 0;\n $resultFn = [];\n foreach($result as $data){\n if(round($data[$havingTYValue]) > 0 && $data['QTY'] > 0){\n $total += $data[$havingTYValue];\n $totalSALESLY += $data[$havingLYValue];\n $resultFn[] = $data;\n }\n }\n\n\t\t\tforeach($resultFn as $data){\n\t\t\t\tif(round($data[$havingTYValue]) > 0 && $data['QTY'] > 0){\n $data[$havingTYValue] = round($data[$havingTYValue]);\n $data[$havingLYValue] = round($data[$havingLYValue]);\n \n\t\t\t\t\t$var = $data[$havingLYValue] != 0 ? ((($data[$havingTYValue] - $data[$havingLYValue]) / $data[$havingLYValue]) * 100) : 0;\n\t $share = $total != 0 ? (($data[$havingTYValue] / $total) * 100) : 0;\n\t $shareLY = $totalSALESLY != 0 ? (($data[$havingLYValue] / $totalSALESLY) * 100) : 0;\n\n\t\t\t\t\t$temp = array();\n\t\t\t\t\t$temp['SKUID'] \t\t= $data['SKUID'];\n\t\t\t\t\t$temp['SKU'] \t\t= $data['SKU'];\n\t\t\t\t\t$temp['SALES'] \t\t= $data[$havingTYValue];\n\t\t\t\t\t$temp['LYSALES'] \t= $data[$havingLYValue];\n\t\t\t\t\t$temp['VAR'] \t\t= $var;\n\t\t\t\t\t$temp['SHARE'] \t\t= $share;\n\t\t\t\t\t$temp['SHARELY'] \t= $shareLY;\n\t\t\t\t\t$temp['QTY'] \t\t= $data['QTY'];\n $temp['QTY_LY'] = $data['QTY_LY'];\n $temp['QTY_VAR'] = ($data['QTY_LY'] > 0) ? number_format( (($data['QTY'] - $data['QTY_LY']) / $data['QTY_LY']) * 100, 1, '.', '') : 0;\n\t\t\t\t\t$temp['CASH_ROS'] \t= ($getStoreData[$data['SKUID']]['ID_TY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VALUE_TY']/$getStoreData[$data['SKUID']]['ID_TY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['QTY_ROS'] \t= ($getStoreData[$data['SKUID']]['ID_TY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VOLUME_TY']/$getStoreData[$data['SKUID']]['ID_TY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['CROS_LY'] \t= ($getStoreData[$data['SKUID']]['ID_LY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VALUE_LY']/$getStoreData[$data['SKUID']]['ID_LY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['QROS_LY'] \t= ($getStoreData[$data['SKUID']]['ID_LY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VOLUME_LY']/$getStoreData[$data['SKUID']]['ID_LY'], 2, '.', '') : 0;\n\t $temp['AVE_STORE_TY'] = number_format($getStoreData[$data['SKUID']]['AVE_STORE_TY'], 2, '.', '');\n\t $temp['AVE_STORE_LY'] = number_format($getStoreData[$data['SKUID']]['AVE_STORE_LY'], 2, '.', '');\n \n $temp['AVE_PRICE_TY'] = ($data['QTY'] > 0) ? number_format($data['VAL_TY'] / $data['QTY'], 2, '.', '') : 0;\n $temp['AVE_PRICE_LY'] = ($data['QTY_LY'] > 0) ? number_format($data['VAL_LY'] / $data['QTY_LY'], 2, '.', '') : 0;\n\n\t\t\t\t\t$arr[]\t\t\t\t= $temp;\n\t\t\t\t}\n\t\t\t}\n\t\t} // end if\n $this->jsonOutput['rateOfSaleTrackerGrid'] = $arr;\n }", "protected function loadChartData()\n {\n $usersFlow = new UserFlow;\n\n $records = $this->getFileData('export.csv');\n\n $usersFlowCollection = $usersFlow->hydrate($records); // Load data for a Collection\n\n return $usersFlowCollection;\n }", "public function getChartData($group_id, $date_from, $date_to)\n {\n $date_from_o = new \\DateTime();\n $date_from_o->setTimestamp($date_from);\n\n $date_to_o = new \\DateTime();\n $date_to_o->setTimestamp($date_to);\n\n $query = DB::table('dx_date_classifiers AS cl')\n ->select('cl.year', 'cl.month')\n ->leftJoin('dx_timeoff_calc AS tc', function($join) {\n $join->on('tc.calc_date_month', '=', 'cl.month');\n $join->on('tc.calc_date_year', '=', 'cl.year');\n $join->on('tc.amount', '<', DB::Raw(0));\n })\n ->whereRaw('cl.year >= YEAR(?)')\n ->whereRaw('cl.year <= YEAR(?)')\n ->whereRaw('cl.month >= MONTH(?)')\n ->whereRaw('cl.month <= MONTH(?)')\n ->groupBy('cl.year', 'cl.month');\n\n $timeoff_types = \\App\\Models\\Employee\\TimeoffType::all();\n\n // Bindings array for query initialization\n $bindings = [];\n\n // Add select for each time off type, if specified source_id (as group_id) then apply filter\n foreach ($timeoff_types as $timeoff_type) {\n if ($group_id > 0) {\n $query->addSelect(DB::Raw('SUM(CASE WHEN d.source_id = ? AND tc.timeoff_type_id = ' . $timeoff_type->id . \" then (tc.amount * -1) ELSE 0 END) AS '\" . $timeoff_type->id . \"'\"));\n $bindings[] = $group_id;\n } else {\n $query->addSelect(DB::Raw('SUM(CASE WHEN tc.timeoff_type_id = ' . $timeoff_type->id . \" then (tc.amount * -1) ELSE 0 END) AS '\" . $timeoff_type->id . \"'\"));\n }\n }\n\n // If source is specified (group_id) then apply source filter\n if ($group_id > 0) {\n $query->addSelect(DB::Raw('SUM(CASE WHEN d.source_id = ? then (tc.amount * -1) ELSE 0 END) AS total', ['source_id' => $group_id]))\n ->leftJoin('dx_users AS u', 'u.id', '=', 'tc.user_id')\n ->leftJoin('in_departments AS d', 'd.id', '=', 'u.department_id');\n\n $bindings[] = $group_id;\n } else {\n $query->addSelect(DB::Raw('IFNULL(SUM(tc.amount * -1), 0) AS total'));\n }\n\n // WHERE parameters are binded last\n $bindings[] = $date_from_o;\n $bindings[] = $date_to_o;\n $bindings[] = $date_from_o;\n $bindings[] = $date_to_o;\n \n $query->setBindings($bindings);\n \n\n $res = $query->get();\n\n $resOverall = $this->getOverallData($res);\n\n return response()->json(['success' => 1, 'res' => $res, 'total' => $resOverall, 'is_hours' => 0]);\n }", "public function initChart() \n {\n $days = 6;\n $this->lastDaysStartDate = date('Y-m-d', strtotime(\"-$days days\"));\n for ($i = $days; $i > 0; $i--) {\n $this->lastDays[] = array(\n 'display' => date('D, M d', strtotime(\"-$i days\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\n )\n );\n }\n $this->lastDays[] = array(\n 'display' => date('D, M d') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"now\")) ,\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"now\"))\n )\n );\n $days = 13;\n for ($i = $days; $i >= 7; $i--) {\n $this->lastDaysPrev[] = array(\n 'display' => date('M d, Y', strtotime(\"-$i days\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\n )\n );\n }\n //# last weeks date settings\n $timestamp_end = strtotime('last Saturday');\n $weeks = 3;\n $this->lastWeeksStartDate = date('Y-m-d', $timestamp_end-((($weeks*7) -1) *24*3600));\n for ($i = $weeks; $i > 0; $i--) {\n $start = $timestamp_end-((($i*7) -1) *24*3600);\n $end = $start+(6*24*3600);\n $this->lastWeeks[] = array(\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d', $start) ,\n '#MODEL#.created <=' => date('Y-m-d', $end) ,\n )\n );\n }\n $this->lastWeeks[] = array(\n 'display' => date('M d', $timestamp_end+24*3600) . ' - ' . date('M d') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d', $timestamp_end+24*3600) ,\n '#MODEL#.created <=' => date('Y-m-d', strtotime('now'))\n )\n );\n $weeks = 7;\n for ($i = $weeks; $i > 3; $i--) {\n $start = $timestamp_end-((($i*7) -1) *24*3600);\n $end = $start+(6*24*3600);\n $this->lastWeeksPrev[] = array(\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-d', $start) ,\n '#MODEL#.created <=' => date('Y-m-d', $end)\n )\n );\n }\n //# last months date settings\n $months = 2;\n $this->lastMonthsStartDate = date('Y-m-01', strtotime(\"-$months months\"));\n for ($i = $months; $i > 0; $i--) {\n $this->lastMonths[] = array(\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\n '#MODEL#.created <=' => date('Y-m-t', strtotime(\"-$i months\")) ,\n )\n );\n }\n $this->lastMonths[] = array(\n 'display' => date('M, Y') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-01', strtotime('now')) ,\n '#MODEL#.created <=' => date('Y-m-t', strtotime('now')) ,\n )\n );\n $months = 5;\n for ($i = $months; $i > 2; $i--) {\n $this->lastMonthsPrev[] = array(\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\n '#MODEL#.created <=' => date('Y-m-' . date('t', strtotime(\"-$i months\")) , strtotime(\"-$i months\"))\n )\n );\n }\n //# last years date settings\n $years = 2;\n $this->lastYearsStartDate = date('Y-01-01', strtotime(\"-$years years\"));\n for ($i = $years; $i > 0; $i--) {\n $this->lastYears[] = array(\n 'display' => date('Y', strtotime(\"-$i years\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\n '#MODEL#.created <=' => date('Y-12-31', strtotime(\"-$i years\")) ,\n )\n );\n }\n $this->lastYears[] = array(\n 'display' => date('Y') ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-01-01', strtotime('now')) ,\n '#MODEL#.created <=' => date('Y-12-31', strtotime('now')) ,\n )\n );\n $years = 5;\n for ($i = $years; $i > 2; $i--) {\n $this->lastYearsPrev[] = array(\n 'display' => date('Y', strtotime(\"-$i years\")) ,\n 'conditions' => array(\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\n '#MODEL#.created <=' => date('Y-12-' . date('t', strtotime(\"-$i years\")) , strtotime(\"-$i years\")) ,\n )\n );\n }\n $this->selectRanges = array(\n 'lastDays' => __l('Last 7 days') ,\n 'lastWeeks' => __l('Last 4 weeks') ,\n 'lastMonths' => __l('Last 3 months') ,\n 'lastYears' => __l('Last 3 years')\n );\n }", "public function determineChartToBeMade()\n {\n \n $chart = null;\n \n //Get the comparisons passed in from the chart form on the db controller\n $comparison1 = $this->chartParameters->comparison1;\n $comparison2 = $this->chartParameters->comparison2;\n \n //If the classSelected is all classes represented by a numeric or text\n //value create the default chart.\n if( $this->chartParameters->classSelected === 1 \n || $this->chartParameters->classSelected === \"1\" )\n {\n \n //Use the hard coded query in the ColumnChartQueryController\n $dataArray = $this->columnChartQueryController->performAvgComparisonQuery($comparison1,\n $comparison2);\n \n //Generate Strings for dynamic labels\n $comp1String = $this->createChartTitles( $comparison1 );\n \n $comp2String = $this->createChartTitles( $comparison2);\n \n //Create a dynamic chart, based off of standard information passed \n //from the CDDashboard controller.\n $chart = $this->createDynamicColumnChart($dataArray, \n $comp1String, $comp2String);\n }\n else\n {\n \n //Create a completly custom chart based on a single course.\n $classTitle = $this->chartParameters->classSelected;\n \n \n $dataArray = $this->columnChartQueryController->performAvgComparisonForCourse($comparison1,\n $comparison2, $classTitle); \n \n $comp1String = $this->createChartTitles( $comparison1 );\n \n $comp2String = $this->createChartTitles( $comparison2);\n\n $chart = $this->createDynamicColumnChart($dataArray, $comp1String,\n $comp2String, $classTitle); \n \n\n \n }\n\n return $chart;\n }", "public function fetch_all_product_and_marketSelection_data() {\r\n \r\n $dataHelpers = array();\r\n if (!empty($this->settingVars->pageArray[$this->settingVars->pageName][\"DH\"]))\r\n $dataHelpers = explode(\"-\", $this->settingVars->pageArray[$this->settingVars->pageName][\"DH\"]); //COLLECT REQUIRED PRODUCT FILTERS DATA FROM PROJECT SETTING \r\n\r\n if (!empty($dataHelpers)) {\r\n\r\n $selectPart = $resultData = $helperTables = $helperLinks = $tagNames = $includeIdInLabels = $groupByPart = array();\r\n $filterDataProductInlineConfig = $dataProductInlineFields = [];\r\n \r\n foreach ($dataHelpers as $key => $account) {\r\n if($account != \"\")\r\n {\r\n //IN RARE CASES WE NEED TO ADD ADITIONAL FIELDS IN GROUP BY CLUAUSE AND ALSO AS LABEL WITH THE ORIGINAL ACCOUNT\r\n //E.G: FOR RUBICON LCL - SKU DATA HELPER IS SHOWN AS 'SKU #UPC'\r\n //IN ABOVE CASE WE SEND DH VALUE = F1#F2 [ASSUMING F1 AND F2 ARE SKU AND UPC'S INDEX IN DATAARRAY]\r\n $combineAccounts = explode(\"#\", $account);\r\n \r\n foreach ($combineAccounts as $accountKey => $singleAccount) {\r\n $tempId = key_exists('ID', $this->settingVars->dataArray[$singleAccount]) ? $this->settingVars->dataArray[$singleAccount]['ID'] : \"\";\r\n if ($tempId != \"\") {\r\n $selectPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $tempId . \" AS \" . $this->settingVars->dataArray[$singleAccount]['ID_ALIASE'];\r\n $groupByPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $this->settingVars->dataArray[$singleAccount]['ID_ALIASE'];\r\n\r\n /*[START] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n $filterDataProductInlineConfig[] = $tempId . \" AS \" . $this->settingVars->dataArray[$singleAccount]['ID_ALIASE_WITH_TABLE'];\r\n $dataProductInlineFields[] = $tempId;\r\n /*[END] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n }\r\n \r\n $tempName = $this->settingVars->dataArray[$singleAccount]['NAME'];\r\n $selectPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $tempName . \" AS \" . $this->settingVars->dataArray[$singleAccount]['NAME_ALIASE'];\r\n $groupByPart[$this->settingVars->dataArray[$singleAccount]['TYPE']][] = $this->settingVars->dataArray[$singleAccount]['NAME_ALIASE'];\r\n\r\n /*[START] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n $filterDataProductInlineConfig[] = $tempName . \" AS \" . $this->settingVars->dataArray[$singleAccount]['NAME_ALIASE'];\r\n $dataProductInlineFields[] = $tempName;\r\n /*[END] GETTING DATA FOR THE PRODUCT AND MARKET INLINE SELECTION FILTER*/\r\n }\r\n \r\n $helperTables[$this->settingVars->dataArray[$combineAccounts[0]]['TYPE']] = $this->settingVars->dataArray[$combineAccounts[0]]['tablename'];\r\n $helperLinks[$this->settingVars->dataArray[$combineAccounts[0]]['TYPE']] = $this->settingVars->dataArray[$combineAccounts[0]]['link'];\r\n \r\n //datahelper\\Product_And_Market_Filter_DataCollector::collect_Filter_Data($selectPart, $groupByPart, $tagName, $helperTableName, $helperLink, $this->jsonOutput, $includeIdInLabel, $account);\r\n }\r\n }\r\n\r\n if(isset($this->queryVars->projectConfiguration) && isset($this->queryVars->projectConfiguration['has_product_market_filter_disp_type']) && $this->queryVars->projectConfiguration['has_product_market_filter_disp_type']==1 && count($filterDataProductInlineConfig) >0){\r\n $this->settingVars->filterDataProductInlineConfig = $filterDataProductInlineConfig;\r\n $this->settingVars->dataProductInlineFields = $dataProductInlineFields;\r\n }\r\n \r\n if(is_array($selectPart) && !empty($selectPart)){\r\n foreach ($selectPart as $type => $sPart) {\r\n $resultData[$type] = datahelper\\Product_And_Market_Filter_DataCollector::collect_Filter_Query_Data($sPart, $groupByPart[$type], $helperTables[$type], $helperLinks[$type]);\r\n }\r\n $redisCache = new utils\\RedisCache($this->queryVars);\r\n $redisCache->requestHash = 'productAndMarketFilterData';\r\n $redisCache->setDataForStaticHash($selectPart);\r\n }\r\n\r\n foreach ($dataHelpers as $key => $account) {\r\n if($account != \"\")\r\n {\r\n $combineAccounts = explode(\"#\", $account);\r\n\r\n $tagNameAccountName = $this->settingVars->dataArray[$combineAccounts[0]]['NAME'];\r\n\r\n //IF 'NAME' FIELD CONTAINS SOME SYMBOLS THAT CAN'T PASS AS A VALID XML TAG , WE USE 'NAME_ALIASE' INSTEAD AS XML TAG\r\n //AND FOR THAT PARTICULAR REASON, WE ALWAYS SET 'NAME_ALIASE' SO THAT IT IS A VALID XML TAG\r\n $tagName = preg_match('/(,|\\)|\\()|\\./', $tagNameAccountName) == 1 ? $this->settingVars->dataArray[$combineAccounts[0]]['NAME_ALIASE'] : strtoupper($tagNameAccountName);\r\n\r\n if (isset($this->settingVars->dataArray[$combineAccounts[0]]['use_alias_as_tag']))\r\n {\r\n $tagName = ($this->settingVars->dataArray[$combineAccounts[0]]['use_alias_as_tag']) ? strtoupper($this->settingVars->dataArray[$combineAccounts[0]]['NAME_ALIASE']) : $tagName;\r\n \r\n if(isset($this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE']) && !empty($this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE']))\r\n $tagName .= \"_\". $this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE'];\r\n }\r\n\r\n $includeIdInLabel = false;\r\n if (isset($this->settingVars->dataArray[$combineAccounts[0]]['include_id_in_label']))\r\n $includeIdInLabel = ($this->settingVars->dataArray[$combineAccounts[0]]['include_id_in_label']) ? true : false;\r\n\r\n $tempId = key_exists('ID', $this->settingVars->dataArray[$combineAccounts[0]]) ? $this->settingVars->dataArray[$combineAccounts[0]]['ID'] : \"\";\r\n \r\n $nameAliase = $this->settingVars->dataArray[$combineAccounts[0]]['NAME_ALIASE'];\r\n $idAliase = isset($this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE']) ? $this->settingVars->dataArray[$combineAccounts[0]]['ID_ALIASE'] : \"\";\r\n\r\n $type = $this->settingVars->dataArray[$combineAccounts[0]]['TYPE'];\r\n\r\n if( !isset($this->jsonOutput['filters']) || !array_key_exists($tagName, $this->jsonOutput['filters']) )\r\n datahelper\\Product_And_Market_Filter_DataCollector::getFilterData( $nameAliase, $idAliase, $tempId, $resultData[$type], $tagName , $this->jsonOutput, $includeIdInLabel, $account);\r\n }\r\n }\r\n\r\n // NOTE: THIS IS FOR FETCHING PRODUCT AND MARKET WHEN USER CLICKS TAB. \r\n // TO FETCH TAB DATA SERVER BASED. TO AVOID BROWSER HANG. \r\n // WE FACE ISSUE IN MJN AS MANY FILTERS ENABLED FOR ITS PROJECTS\r\n if ($this->settingVars->fetchProductAndMarketFilterOnTabClick) {\r\n $redisCache = new utils\\RedisCache($this->queryVars);\r\n $redisCache->requestHash = 'productAndMarketFilterTabData';\r\n $redisCache->setDataForStaticHash($this->jsonOutput['filters']);\r\n }\r\n }\r\n }", "private function dataloop($set) {\n\n $data = array();\n\n while($row = mysql_fetch_assoc($set)) {\n\n $data[] = $row;\n\n foreach($this->url($row['site']) as $site) {\n\n $out = $this->type(trim($site))->monitor();\n\n $this->sysalert($row['email'], $out); \n\n }\n\n }\n\n return;\n\n }", "public function charts()\n {\n\n $male_chart_1 = Employee::where('gender', '=', 'M')->count();\n $female_chart_1 = Employee::where('gender', '=', 'F')->count();\n\n $emp_hire_date_1 = Employee::where('hire_date', 'like', '1987%')->count();\n $emp_hire_date_2 = Employee::where('hire_date', 'like', '1988%')->count();\n $emp_hire_date_3 = Employee::where('hire_date', 'like', '1989%')->count();\n $emp_hire_date_4 = Employee::where('hire_date', 'like', '1990%')->count();\n $emp_hire_date_5 = Employee::where('hire_date', 'like', '1991%')->count();\n $emp_hire_date_6 = Employee::where('hire_date', 'like', '1992%')->count();\n $emp_hire_date_7 = Employee::where('hire_date', 'like', '1993%')->count();\n $emp_hire_date_8 = Employee::where('hire_date', 'like', '1994%')->count();\n $emp_hire_date_9 = Employee::where('hire_date', 'like', '1995%')->count();\n $emp_hire_date_10 = Employee::where('hire_date', 'like', '1996%')->count();\n $emp_hire_date_11 = Employee::where('hire_date', 'like', '1997%')->count();\n $emp_hire_date_12 = Employee::where('hire_date', 'like', '1998%')->count();\n $emp_hire_date_13 = Employee::where('hire_date', 'like', '1999%')->count();\n $emp_hire_date_14 = Employee::where('hire_date', 'like', '1986%')->count();\n $emp_hire_date_15 = Employee::where('hire_date', 'like', '1985%')->count();\n\n $emp_dep_number_1 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Customer Service')->count();\n $emp_dep_number_2 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Development')->count();\n $emp_dep_number_3 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Finance')->count();\n $emp_dep_number_4 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Human Resources')->count();\n $emp_dep_number_5 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Marketing')->count();\n $emp_dep_number_6 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Production')->count();\n $emp_dep_number_7 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Quality Management')->count();\n $emp_dep_number_8 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Research')->count();\n $emp_dep_number_9 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Sales')->count();\n\n $emp_hire_date_female_1 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1985%')->count();\n $emp_hire_date_female_2 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1986%')->count();\n $emp_hire_date_female_3 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1987%')->count();\n $emp_hire_date_female_4 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1988%')->count();\n $emp_hire_date_female_5 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1989%')->count();\n $emp_hire_date_female_6 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1990%')->count();\n $emp_hire_date_female_7 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1991%')->count();\n $emp_hire_date_female_8 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1992%')->count();\n $emp_hire_date_female_9 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1993%')->count();\n $emp_hire_date_female_10 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1994%')->count();\n $emp_hire_date_female_11 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1995%')->count();\n $emp_hire_date_female_12 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1996%')->count();\n $emp_hire_date_female_13 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1997%')->count();\n $emp_hire_date_female_14 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1998%')->count();\n $emp_hire_date_female_15 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1999%')->count();\n\n $emp_hire_date_male_1 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1985%')->count();\n $emp_hire_date_male_2 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1986%')->count();\n $emp_hire_date_male_3 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1987%')->count();\n $emp_hire_date_male_4 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1988%')->count();\n $emp_hire_date_male_5 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1989%')->count();\n $emp_hire_date_male_6 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1990%')->count();\n $emp_hire_date_male_7 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1991%')->count();\n $emp_hire_date_male_8 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1992%')->count();\n $emp_hire_date_male_9 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1993%')->count();\n $emp_hire_date_male_10 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1994%')->count();\n $emp_hire_date_male_11 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1995%')->count();\n $emp_hire_date_male_12 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1996%')->count();\n $emp_hire_date_male_13 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1997%')->count();\n $emp_hire_date_male_14 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1998%')->count();\n $emp_hire_date_male_15 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1999%')->count();\n\n $dept_avg_salary_1 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Customer Service')->avg('salary');\n $dept_avg_salary_2 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Development')->avg('salary');\n $dept_avg_salary_3 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Finance')->avg('salary');\n $dept_avg_salary_4 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Human Resources')->avg('salary');\n $dept_avg_salary_5 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Marketing')->avg('salary');\n $dept_avg_salary_6 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Production')->avg('salary');\n $dept_avg_salary_7 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Quality Management')->avg('salary');\n $dept_avg_salary_8 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Research')->avg('salary');\n $dept_avg_salary_9 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Sales')->avg('salary');\n\n\n\n\n $array = array (\n 'male' => $male_chart_1,\n 'female' => $female_chart_1,\n 'emp_hire_date_1' => $emp_hire_date_1,\n 'emp_hire_date_2' => $emp_hire_date_2,\n 'emp_hire_date_3' => $emp_hire_date_3,\n 'emp_hire_date_4' => $emp_hire_date_4,\n 'emp_hire_date_5' => $emp_hire_date_5,\n 'emp_hire_date_6' => $emp_hire_date_6,\n 'emp_hire_date_7' => $emp_hire_date_7,\n 'emp_hire_date_8' => $emp_hire_date_8,\n 'emp_hire_date_9' => $emp_hire_date_9,\n 'emp_hire_date_10' => $emp_hire_date_10,\n 'emp_hire_date_11' => $emp_hire_date_11,\n 'emp_hire_date_12' => $emp_hire_date_12,\n 'emp_hire_date_13' => $emp_hire_date_13,\n 'emp_hire_date_15' => $emp_hire_date_14,\n 'emp_hire_date_14' => $emp_hire_date_15,\n 'emp_dep_number_1' => $emp_dep_number_1,\n 'emp_dep_number_2' => $emp_dep_number_2,\n 'emp_dep_number_3' => $emp_dep_number_3,\n 'emp_dep_number_4' => $emp_dep_number_4,\n 'emp_dep_number_5' => $emp_dep_number_5,\n 'emp_dep_number_6' => $emp_dep_number_6,\n 'emp_dep_number_7' => $emp_dep_number_7,\n 'emp_dep_number_8' => $emp_dep_number_8,\n 'emp_dep_number_9' => $emp_dep_number_9,\n 'emp_hire_date_female_1' =>$emp_hire_date_female_1,\n 'emp_hire_date_female_2' =>$emp_hire_date_female_2,\n 'emp_hire_date_female_3' =>$emp_hire_date_female_3,\n 'emp_hire_date_female_4' =>$emp_hire_date_female_4,\n 'emp_hire_date_female_5' =>$emp_hire_date_female_5,\n 'emp_hire_date_female_6' =>$emp_hire_date_female_6,\n 'emp_hire_date_female_7' =>$emp_hire_date_female_7,\n 'emp_hire_date_female_8' =>$emp_hire_date_female_8,\n 'emp_hire_date_female_9' =>$emp_hire_date_female_9,\n 'emp_hire_date_female_10' =>$emp_hire_date_female_10,\n 'emp_hire_date_female_11' =>$emp_hire_date_female_11,\n 'emp_hire_date_female_12' =>$emp_hire_date_female_12,\n 'emp_hire_date_female_13' =>$emp_hire_date_female_13,\n 'emp_hire_date_female_14' =>$emp_hire_date_female_14,\n 'emp_hire_date_female_15' =>$emp_hire_date_female_15,\n 'emp_hire_date_male_1' =>$emp_hire_date_male_1,\n 'emp_hire_date_male_2' =>$emp_hire_date_male_2,\n 'emp_hire_date_male_3' =>$emp_hire_date_male_3,\n 'emp_hire_date_male_4' =>$emp_hire_date_male_4,\n 'emp_hire_date_male_5' =>$emp_hire_date_male_5,\n 'emp_hire_date_male_6' =>$emp_hire_date_male_6,\n 'emp_hire_date_male_7' =>$emp_hire_date_male_7,\n 'emp_hire_date_male_8' =>$emp_hire_date_male_8,\n 'emp_hire_date_male_9' =>$emp_hire_date_male_9,\n 'emp_hire_date_male_10' =>$emp_hire_date_male_10,\n 'emp_hire_date_male_11' =>$emp_hire_date_male_11,\n 'emp_hire_date_male_12' =>$emp_hire_date_male_12,\n 'emp_hire_date_male_13' =>$emp_hire_date_male_13,\n 'emp_hire_date_male_14' =>$emp_hire_date_male_14,\n 'emp_hire_date_male_15' =>$emp_hire_date_male_15,\n 'dept_avg_salary_1' => $dept_avg_salary_1,\n 'dept_avg_salary_2' => $dept_avg_salary_2,\n 'dept_avg_salary_3' => $dept_avg_salary_3,\n 'dept_avg_salary_4' => $dept_avg_salary_4,\n 'dept_avg_salary_5' => $dept_avg_salary_5,\n 'dept_avg_salary_6' => $dept_avg_salary_6,\n 'dept_avg_salary_7' => $dept_avg_salary_7,\n 'dept_avg_salary_8' => $dept_avg_salary_8,\n 'dept_avg_salary_9' => $dept_avg_salary_9,\n );\n //dd($male);\n //dd($employeesChart);\n return view('chart_list', ['data' => $array]);\n }", "public function getDatasetsList() {\n return $this->_get(3);\n }", "public function getData()\n {\n if ($this->today == $this->first_day) {\n $data = $this->getAllData();\n }\n\n if (!empty($data)) {\n foreach ($data as $datum) {\n $this->handleData($datum);\n }\n }\n\n }", "protected function getDataSet()\n {\n return new \\PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/DataSet/base.yml');\n }", "function getSalesByCountryXML($intYear, $howMany, $addJSLinks, $forDataURL) {\n // Function to connect to the DB\n $link = connectToDB();\n\n $strSQL = \"SELECT c.Country, ROUND(SUM(d.Quantity*p.UnitPrice*(1-d.Discount)),0) As Total, SUM(d.Quantity) as Quantity FROM FC_Customers as c, FC_Products as p, FC_Orders as o, FC_OrderDetails as d WHERE YEAR(OrderDate)=\" . $intYear . \" and d.ProductID=p.ProductID and c.CustomerID=o.CustomerID and o.OrderID=d.OrderID GROUP BY c.Country ORDER BY Total DESC\";\n\tif ($howMany!=-1)\n\t\t$strSQL .= \" LIMIT \" . $howMany;\n\t\n $result = mysql_query($strSQL) or die(mysql_error());\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Amount'>\";\n\t$strQtyDS = \"<dataset seriesName='Quantity' parentYAxis='S'>\";\n\t\t\n\t//Iterate through each data row\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . escapeXML($ors['Country'],$forDataURL) . \"'/>\";\n\t\t\n //If JavaScript links are to be added\n if ($addJSLinks) {\n //Generate the link\n //TRICKY: We're having to escape the \" character using chr(34) character.\n //In HTML, the data is provided as chart.setXMLData(\" - so \" is already used and un-terminated\n //For each XML attribute, we use '. So ' is used in <set link='\n //Now, we//ve to pass Country Name to JavaScript function, so we've to use chr(34)\n $strLink = urlencode(\"javaScript:updateChart(\" . $intYear . \",\" . chr(34) . $ors['Country'] . chr(34) . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n }\n else\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n //Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "protected function getDataSet()\n {\n return $this->createXMLDataSet(FIXTURE . '/Xml/bookAndAuthor.xml');\n }", "public function getDataSet()\n {\n $originalXml = dirname(__FILE__).'/Flats/all-original-data.xml';\n return $this->createFlatXMLDataSet($originalXml);\n }", "public function getDataSet()\n {\n $originalXml = dirname(__FILE__).'/Flats/all-original-data.xml';\n return $this->createFlatXMLDataSet($originalXml);\n }", "public function sizeChartList($request_array)\n{\n \n $gender=$request_array['gender'];\n $bodytype=$request_array['body_type'];\n $target_top=$request_array['target_top'];\n $top_size=$request_array['top_size'];\n $target_bottom=$request_array['target_bottom']; \n $bottom_size=$request_array['bottom_size']; \n $target_dress=$request_array['target_dress']; \n $dress_size=$request_array['dress_size']; \n \n $neck=0;\n $bust=0;\n $chest=0;\n $waist=0;\n $sleeve=0;\n $inseam=0;\n $hip=0;\n $top_id=0;\n $bottom_id=0;\n $dress_id=0;\n $measurement= array(); \n if($target_top)\n { \n $sizechart_top = $this->repo->getSizeChartByBrandGenderBodyTypeTopSize($gender,$bodytype,$target_top,$top_size);\n if($sizechart_top){\n $bust=$sizechart_top[0]['top_bust'];\n $neck=$sizechart_top[0]['top_neck'];\n $chest=$sizechart_top[0]['top_chest'];\n $waist=$sizechart_top[0]['top_waist'];\n $top_id=$sizechart_top[0]['size_chart_id'];\n \n }\n \n \n }\n if($target_bottom)\n { \n $sizechart_bottom = $this->repo->getSizeChartByBrandGenderBodyTypeBottomSize($gender,$bodytype,$target_bottom,$bottom_size);\n if($sizechart_bottom)\n { \n $waist=$sizechart_bottom[0]['bottom_waist'];\n $hip=$sizechart_bottom[0]['bottom_hip'];\n $inseam=$sizechart_bottom[0]['bottom_inseam'];\n $bottom_id=$sizechart_bottom[0]['size_chart_id'];\n \n \n }\n \n }\n if($target_dress)\n { \n $size_chart_dress = $this->repo->getSizeChartByBrandGenderBodyTypeDressSize($gender, $bodytype, $target_dress, $dress_size);\n \n $bust_dress=0;\n $waist_dress=0;\n $hip_dress=0;\n $sleeve_dress=0;\n if($size_chart_dress){\n \n $bust_dress = $sizechart_dress[0]['dress_bust'];\n $waist_dress = $sizechart_dress[0]['dress_waist'];\n $hip_dress = $sizechart_dress[0]['dress_hip'];\n $sleeve_dress = $sizechart_dress[0]['dress_sleeve'];\n $dress_id=$sizechart_dress[0]['size_chart_id'];\n \n }\n \n #-----------------BUST AVERAGE-----------------------------------------------#\n if ($bust_dress == 0 && $bust > 0) {\n $bust = $bust;\n }\n if ($bust == 0 && $bust_dress) {\n $bust = $bust_dress;\n }\n if ($bust_dress > 0 && $bust > 0) {\n $bust = ($bust_dress + $bust) / 2;\n }\n\n #----------------- WAIST AVERAGE-----------------------------------------------#\n if ($waist_dress == 0 && $waist > 0) {\n $wasit = $waist;\n }\n if ($waist_dress > 0 && $waist == 0) {\n $wasit = $waist_dress;\n }\n if ($waist_dress > 0 && $waist > 0) {\n $wasit = ($waist_dress + $wasit) / 2;\n }\n #-------------------------------SLEEVE________________________________________________# \n if ($sleeve > 0 && $sleeve_dress == 0) {\n $sleeve = $sleeve;\n }\n if ($sleeve == 0 && $sleeve_dress > 0) {\n $sleeve = $sleeve_dress;\n }\n if ($sleeve > 0 && $sleeve_dress > 0) {\n $sleeve = ($sleeve + $sleeve_dress) / 2;\n }\n\n\n #--------------------------HIP-----------------#\n if ($hip > 0 && $hip_dress == 0) {\n $hip = $hip;\n }\n if ($hip == 0 && $hip_dress > 0) {\n $hip = $hip_dress;\n }\n if ($hip > 0 && $hip_dress > 0) {\n $hip = ($hip + $hip_dress) / 2;\n }\n } \n \n \n $measurement['neck']=$neck;\n $measurement['bust']=$bust;\n $measurement['chest']=$chest;\n $measurement['waist']=$waist;\n $measurement['hip']=$hip;\n $measurement['sleeve']=$sleeve;\n $measurement['inseam']=$inseam;\n \n \n if($top_id)\n {\n $measurement['sc_top_id']=$top_id; \n } \n else\n {\n $measurement['sc_top_id']=0;\n }\n if($bottom_id)\n {\n $measurement['sc_bottom_id']=$bottom_id; \n } \n else{\n $measurement['sc_bottom_id']=0;\n }\n if($dress_id)\n {\n $measurement['sc_dress_id']=$dress_id; \n }\n else {\n $measurement['sc_dress_id']=0;\n }\n \n if($measurement) \n {\n return $measurement;\n }\n \n \n}", "private function grab_data(){\n\t\t$y=0;\n\t\tfor($i=$this->startingmonth;$i>=0;$i--){\n\t\t\t$this->searchmonth = date(\"n\")-$i;\n\t\t\t$this->searchyear = date(\"Y\");\n\t\t\tif(0 >= $this->searchmonth){\n\t\t\t\twhile(0 >= $this->searchmonth){\n\t\t\t\t\t$this->searchmonth += 12;\n\t\t\t\t\t$this->searchyear--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->count_chrono_records();\n\t\t\t$this->monthlyrecordvolume[$i] = intval($this->volume_of_records_in_timerange);\n\t\t\tif(0==$this->max_month_value or $this->monthlyrecordvolume[$i] > $this->max_month_value){\n\t\t\t\t$this->max_month_value = $this->monthlyrecordvolume[$i];\n\t\t\t}\n\t\t\t$this->monthaggregator += $this->monthlyrecordvolume[$i];\n\t\t\t\n\t\t\t$this->count_months_recorded_this_year++;\n\t\t\tif(12 == $this->searchmonth or 0 == $i ){\n\t\t\t\t$this->ave_this_year[$y]['volume'] = intval($this->monthaggregator / $this->count_months_recorded_this_year);\n\t\t\t\t$this->ave_this_year[$y]['month'] = $i;\n\t\t\t\t$this->ave_this_year[$y]['year'] = $this->searchyear;\n\t\t\t\t$this->monthaggregator = 0;\n\t\t\t\t$this->count_months_recorded_this_year = 0;\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "protected function getDataSet()\n {\n return $this->getYamlDataSet('bookings.yml');\n }", "public function getDatasetsList() {\n return $this->_get(4);\n }", "public function index()\n {\n $feedbacks = array();\n $counts = array();\n $branch = ['INFT', 'CMPN', 'EXTC', 'ETRX', 'BIOM'];\n for($i=0; $i<sizeof($branch); $i++)\n {\n for($j=1; $j<=8; $j++)\n {\n $count = Feedback::where([\n ['branch', '=', $branch[$i]],\n ['sem', '=', $j],\n ])->count();\n array_push($counts, $count);\n }\n $feedbacks[$branch[$i]] = $counts;\n unset($counts);\n $counts = array();\n }\n //dd($feedbacks['INFT']);\n $events = Event::withCount('event_registration')->where('status', '=', 1)->take(5)->get();\n\n $placements =Placement::withCount('placement_registration')->where('status', '=', 1)->take(5)->latest()->get();\n\n $events_chart = Charts::create('bar', 'highcharts')\n ->title('Event registrations')\n ->elementLabel('No. of registrations')\n ->labels($events->pluck('name'))\n ->values($events->pluck('event_registration_count'))\n ->responsive(true)->legend(true);\n\n $placements_chart = Charts::create('pie', 'highcharts')\n ->title('Placement registrations')\n ->height(200)\n ->elementLabel('No. of registrations')\n ->labels($placements->pluck('head'))\n ->values($placements->pluck('placement_registration_count'))\n ->responsive(true)->legend(true);\n\n $feedbacks_chart = Charts::multi('area', 'highcharts')\n ->title('Feedbacks Stats')\n ->responsive(true)\n ->labels(['Sem 1', 'Sem 2', 'Sem 3', 'Sem 4', 'Sem 5', 'Sem 6', 'Sem 7', 'Sem 8'])\n ->dataset('INFT', $feedbacks['INFT'])\n ->dataset('CMPN', $feedbacks['CMPN'])\n ->dataset('EXTC', $feedbacks['EXTC'])\n ->dataset('ETRX', $feedbacks['ETRX'])\n ->dataset('BIOM', $feedbacks['BIOM']);\n\n $placement = Placement::withCount('placement_registration')->where('status', '=', 1)->latest()->first();\n $event = Event::withCount('event_registration')->where('status', '=', 1)->latest()->first();\n $user_event = User::find($event->issued_by);\n $user_placement = User::find($placement->issued_by);\n return view('/admin/home', ['events_chart' => $events_chart, 'placements_chart' => $placements_chart, 'feedbacks_chart' => $feedbacks_chart, ], compact('event', 'placement', 'user_event', 'user_placement'));\n }", "public function actionChartTest(){\t\n\t\t$dataParenCustomer1= new ArrayDataProvider([\n\t\t\t'key' => 'CUST_KD',\n\t\t\t//'allModels'=>Yii::$app->db_esm->createCommand(\"CALL DASHBOARD_ESM_SALES_custromer_ktg('ParentChildCountCustomer')\")->queryAll(),\n\t\t\t'allModels'=>Yii::$app->db_esm->cache(function ($db_esm) {\n\t\t\t\treturn $db_esm->createCommand(\"\n\t\t\t\t\tSELECT x1.label,x1.value\n\t\t\t\t\tFROM\n\t\t\t\t\t\t(SELECT #x1.CUST_KD,x1.CUST_GRP,\n\t\t\t\t\t\t\t\t x1.CUST_NM as label,\n\t\t\t\t\t\t\t\t(SELECT COUNT(x2.CUST_KD) FROM c0001 x2 WHERE x2.CUST_GRP=x1.CUST_KD LIMIT 1 ) as value\n\t\t\t\t\t\tFROM c0001 x1\n\t\t\t\t\t\tWHERE x1.CUST_KD=x1.CUST_GRP) x1 \n\t\t\t\t\tORDER BY x1.value DESC;\n\t\t\t\t\")->queryAll();\n\t\t\t}, 60),\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 200,\n\t\t\t]\n\t\t]);\t\t\n\t\t\t$chartdata='{\n\t\t\t\t\"chart\": {\n\t\t\t\t \"caption\":\"Summary Customers Category Detail\",\n\t\t\t\t \"xAxisName\":\"Category Name\",\n\t\t\t\t \"yAxisName\":\"Count \",\n\t\t\t\t \"theme\":\"fint\",\n\t\t\t\t \"is2D\":\"0\",\n\t\t\t\t \"showValues\":\"1\",\n\t\t\t\t \"palettecolors\":\"#583e78,#008ee4,#f8bd19,#e44a00,#6baa01,#ff2e2e\",\n\t\t\t\t \"bgColor\":\"#ffffff\",\n\t\t\t\t \"showBorder\":\"0\",\n\t\t\t\t \"showCanvasBorder\":\"0\"\n\t\t\t\t} , \n\t\t\t\t\"data\": '.json_encode($dataParenCustomer1->getModels()).'\t\n\t\t\t}';\n\t\t\n\t\t\n\t\t//return json_encode($dataParenCustomer1->getModels());\n\t\treturn $chartdata;\n\t}", "public static function prepareDatasetsForChart(array $statistics, array $dates) : array\n {\n $datasets = [];\n\n // Get checks for each day with this status code\n foreach ($statistics as $statusCode => $results) {\n $checks = [];\n\n foreach ($dates as $date) {\n $checks[] = $results[$date]['checks'] ?? 0;\n }\n\n // Merge data with chart color options\n $datasets[] = array_merge(\n [\n 'label' => $statusCode,\n 'data' => $checks,\n ],\n Url::getColorSchemeByStatusCode($statusCode)\n );\n }\n\n return $datasets;\n }", "protected function getDataSet()\n\t{\n\t\treturn $this->createXMLDataSet(dirname(__FILE__).'/_fixtures/DirectDeposit.fixture.xml');\n\t}", "protected function getData()\n {\n $occupancies = (new RoomOccupancyRepository)->withoutLabel(['tent', 'free'])->byNational($this->year);\n\n $spendings = (new BillRepository)->withoutResourceLabel(['tent', 'free'])->byMonthNational($this->year);\n\n foreach ($occupancies as $occupancy) {\n $this->occ_arr[$occupancy->country][$occupancy->mth] = $occupancy->counter;\n }\n\n foreach ($spendings as $spending) {\n $this->spend_arr[$spending->country][$spending->mth] = $spending->sum;\n }\n }", "private function showAllReportData($reportType){\n\n \t$sensorData = array();\n \t$reportList = array();\n \t$data = json_encode(0);\n \t$provinces = DB::table('tbl_provinces')->get();\n \t$landslides = DB::table('tbl_landslide')->get();\n \t$floods = DB::table('tbl_flood')->get();\n \t$roadNetworks = DB::table('tbl_roadnetworks')->get();\n\n \tswitch ($reportType) {\n\n \t\tcase '2':\n \t\t\t\n \t\t\tforeach ($landslides as $landslide) {\n\n \t\t\t\t$tempStr = strip_tags($landslide->description);\n\t\t\t\t\t$tempProvince = \"\";\n\n\t\t\t\t\tforeach ($provinces as $province) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($landslide->province_id == $province->id){\n\n\t\t\t\t\t\t\t$tempProvince = $province->name;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n \t\t\t\t$reportList[] = array(\"date_time\" => $landslide->date,\n \t\t\t\t\t\t\t\t\t \"province\" => $tempProvince,\n \t\t\t\t\t\t\t\t\t \"location\" => $landslide->location,\n \t\t\t\t\t\t\t\t\t \"description\" => $tempStr);\n\n\t\t\t\t}\n\n \t\t\tbreak;\n\n \t\tcase '3':\n \t\t\t\n \t\t\tforeach ($floods as $flood) {\n\n \t\t\t\t$tempStr = strip_tags($flood->description);\n \t\t\t\t$tempProvince = \"\";\n\n\t\t\t\t\tforeach ($provinces as $province) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($flood->province_id == $province->id){\n\n\t\t\t\t\t\t\t$tempProvince = $province->name;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\n\t\t\t\t\t$reportList[] = array(\"date_time\" => $flood->date,\n\t\t\t\t\t\t\t\t\t\t \"province\" => $tempProvince,\n \t\t\t\t\t\t\t\t\t \"location\" => $flood->location,\n \t\t\t\t\t\t\t\t\t \"description\" => $tempStr);\n\t\t\t\n\t\t\t\t}\n\n \t\t\tbreak;\n\n \t\tcase '4':\n \t\t\t\n \t\t\tforeach ($roadNetworks as $roadNetwork) {\n\n \t\t\t\t$tempStr = strip_tags($roadNetwork->description);\n\n\t\t\t\t\t$reportList[] = array(\"date_time\" => $roadNetwork->date,\n \t\t\t\t\t\t\t\t\t \"location\" => $roadNetwork->location,\n \t\t\t\t\t\t\t\t\t \"status\" => $roadNetwork->status,\n \t\t\t\t\t\t\t\t\t \"description\" => $tempStr);\n\t\t\t\n\t\t\t\t}\n\n \t\t\tbreak;\n \t\t\n \t}\n \t\n \t$data = json_encode($reportList);\n\t\treturn $data;\n\n }", "public function initChart()\r\n {\r\n $days = 6;\r\n $this->lastDaysStartDate = date('Y-m-d', strtotime(\"-$days days\"));\r\n for ($i = $days; $i > 0; $i--) {\r\n $this->lastDays[] = array(\r\n 'display' => date('D, M d', strtotime(\"-$i days\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\r\n )\r\n );\r\n }\r\n $this->lastDays[] = array(\r\n 'display' => date('D, M d') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"now\")) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"now\"))\r\n )\r\n );\r\n $days = 13;\r\n for ($i = $days; $i >= 7; $i--) {\r\n $this->lastDaysPrev[] = array(\r\n 'display' => date('M d, Y', strtotime(\"-$i days\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', strtotime(\"-$i days\")) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime(\"-$i days\"))\r\n )\r\n );\r\n }\r\n //# last weeks date settings\r\n $timestamp_end = strtotime('last Saturday');\r\n $weeks = 3;\r\n $this->lastWeeksStartDate = date('Y-m-d', $timestamp_end-((($weeks*7) -1) *24*3600));\r\n for ($i = $weeks; $i > 0; $i--) {\r\n $start = $timestamp_end-((($i*7) -1) *24*3600);\r\n $end = $start+(6*24*3600);\r\n $this->lastWeeks[] = array(\r\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', $start) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', $end) ,\r\n )\r\n );\r\n }\r\n $this->lastWeeks[] = array(\r\n 'display' => date('M d', $timestamp_end+24*3600) . ' - ' . date('M d') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', $timestamp_end+24*3600) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', strtotime('now'))\r\n )\r\n );\r\n $weeks = 7;\r\n for ($i = $weeks; $i > 3; $i--) {\r\n $start = $timestamp_end-((($i*7) -1) *24*3600);\r\n $end = $start+(6*24*3600);\r\n $this->lastWeeksPrev[] = array(\r\n 'display' => date('M d', $start) . ' - ' . date('M d', $end) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-d 00:00:00', $start) ,\r\n '#MODEL#.created <=' => date('Y-m-d 23:59:59', $end)\r\n )\r\n );\r\n }\r\n //# last months date settings\r\n $months = 2;\r\n $this->lastMonthsStartDate = date('Y-m-01', strtotime(\"-$months months\"));\r\n for ($i = $months; $i > 0; $i--) {\r\n $this->lastMonths[] = array(\r\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\r\n '#MODEL#.created <=' => date('Y-m-t', strtotime(\"-$i months\")) ,\r\n )\r\n );\r\n }\r\n $this->lastMonths[] = array(\r\n 'display' => date('M, Y') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-01', strtotime('now')) ,\r\n '#MODEL#.created <=' => date('Y-m-t', strtotime('now')) ,\r\n )\r\n );\r\n $months = 5;\r\n for ($i = $months; $i > 2; $i--) {\r\n $this->lastMonthsPrev[] = array(\r\n 'display' => date('M, Y', strtotime(\"-$i months\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-m-01', strtotime(\"-$i months\")) ,\r\n '#MODEL#.created <=' => date('Y-m-' . date('t', strtotime(\"-$i months\")) , strtotime(\"-$i months\"))\r\n )\r\n );\r\n }\r\n //# last years date settings\r\n $years = 2;\r\n $this->lastYearsStartDate = date('Y-01-01', strtotime(\"-$years years\"));\r\n for ($i = $years; $i > 0; $i--) {\r\n $this->lastYears[] = array(\r\n 'display' => date('Y', strtotime(\"-$i years\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\r\n '#MODEL#.created <=' => date('Y-12-31', strtotime(\"-$i years\")) ,\r\n )\r\n );\r\n }\r\n $this->lastYears[] = array(\r\n 'display' => date('Y') ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-01-01', strtotime('now')) ,\r\n '#MODEL#.created <=' => date('Y-12-31', strtotime('now')) ,\r\n )\r\n );\r\n $years = 5;\r\n for ($i = $years; $i > 2; $i--) {\r\n $this->lastYearsPrev[] = array(\r\n 'display' => date('Y', strtotime(\"-$i years\")) ,\r\n 'conditions' => array(\r\n '#MODEL#.created >=' => date('Y-01-01', strtotime(\"-$i years\")) ,\r\n '#MODEL#.created <=' => date('Y-12-' . date('t', strtotime(\"-$i years\")) , strtotime(\"-$i years\")) ,\r\n )\r\n );\r\n }\r\n $this->selectRanges = array(\r\n 'lastDays' => __l('Last 7 days') ,\r\n 'lastWeeks' => __l('Last 4 weeks') ,\r\n 'lastMonths' => __l('Last 3 months') ,\r\n 'lastYears' => __l('Last 3 years')\r\n );\r\n }", "function generateChartJs2($chartid, $sql){\n\t\tglobal $database;\n\t\t\n\t\t$res = $database->query($sql) or die(\"<div style='color:red'>{$database->error}</div>\");\n\t\tif (!$res || !$res->num_rows){\n\t\t\treturn \"//<div style='color:red'>Error generating this chart. Check your SQL.</div>\";\n\t\t} \n\n\t\t$row = $res->fetch_assoc();\n\t\t$cols = array_keys($row);\n\t\t\n\t\tif (!sizeof($cols) or sizeof($cols) < 2){\n\t\t\treturn \"//<div style='color:red'>sizeof cols is below expected number.</div>\";\n\t\t}\n\t\t\n\t\t// reset to first row\n\t\tmysqli_data_seek($res,0);\n\t\t\t\t\t \n\t\t$labels = [];\n\t\t$datasets = [];\n\n\t\twhile ($row = $res->fetch_assoc()){\n\t\t\tforeach ($cols as $key=>$val){\n\t\t\t\tswitch ($key){\n\t\t\t\t\tcase 0: /* first column should be your labels */\n\t\t\t\t\t\t$label = $row[$val];\n\t\t\t\t\t\t$labels[] = \"'$label'\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$data = $row[$val];\n\t\t\t\t\t\t$data = $data ? $data : 0; \n\t\t\t\t\t\t$datasets[$key-1][] = \"'$data'\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \n\t\t$max_data_cols = sizeof($datasets[0]);\n\t\tif (sizeof($labels))\n\t\t\t$labels = implode(\",\\n\", $labels);\n\t\telse \n\t\t\t$labels = \"\";\n\n\t\t$datasets_ = [];\n\t\t$types = [];\n\t\t\n\t\tforeach($datasets as $key=>$datas){ \n\t\t\t\t$data = implode(\",\",$datas);\n\t\t\t\t$label = $cols[$key+1]; // ignore the first column as it is our label\n\t\t\n\t\t\t\t$datasets_[] = \"['$label',\t$data]\";\n\t\t\t\t$types[] = \"'$label':'bar'\";\n\t\t}\n\t\n\t\tif (sizeof($datasets_)) \n\t\t\t$datasets = implode(\",\\n\", $datasets_);\n\t\telse\n\t\t\t$datasets = \"\";\n\n\t\tif (sizeof($types)) \n\t\t\t$types = implode(\",\\n\", $types);\n\t\telse\n\t\t\t$types = \"\";\n\n\t\t$chartdata = \"\\n$(window).load(function(){\n\t\t\t\t\t\t\t\tvar chart = c3.generate({\n\t\t\t\t\t\t\t\t\tbindto: '#$chartid',\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t columns: [\n\t\t\t\t\t\t\t\t\t\t\t$datasets\n\t\t\t\t\t\t\t\t\t ],\t\t \n\t\t\t\t\t\t\t\t\t axes: {\n\t\t\t\t\t\t\t\t\t\t data2: 'y2'\n\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t types: {\n\t\t\t\t\t\t\t\t\t\t\t$types\n\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},\n\t\t\t\t\t\t\t\t\t\taxis: {\n\t\t\t\t\t\t\t\t\t\t\t \tx: {\n\t\t\t\t\t\t\t\t\t\t\t\t \ttype: 'category',\n\t\t\t\t\t\t\t\t\t\t\t\t \tcategories: [$labels]\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\t\t\t\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\";\n\t\t\t\t\t\t\t\t\t\n\t\treturn $chartdata;\n}", "abstract public function extractReportDatas();", "public function getDashboardPanelRecords() {\n\t\t$isql=\"select i.item_name as prod_name, i.quantity as prod_qty from inventory i limit 5\";\t\t\n\t\t$iresult=$this->runQuery('getAll',$isql);\n\t\t\n\t\t$sosql=\"SELECT p.item_name as inv_name,so.customer_name,date(so.sell_date) as sell_date FROM sales_order so, inventory p where p.id = so.product_id limit 5\";\t\t\n\t\t$soresult=$this->runQuery('getAll',$sosql);\n\t\t\n\t\t$drsql=\"select count(prod_qty) as qty, date(sell_date) as date from sales_order group by sell_date\";\t\t\n\t\t$drresult=$this->runQuery('getAll',$drsql);\n\t\t\n\t\techo '[{\"topFiveInvList\":'.json_encode($iresult).',\"topFiveSalesList\":'.json_encode($soresult).',\"dailySalesGraph\":'.json_encode($drresult).'}]';\n\t}", "public function get_main_chart() {\n\n\t\tif ( empty( $this->product_ids ) ) {\n\t\t\t?>\n\t\t\t<div class=\"chart-container\">\n\t\t\t\t<p class=\"chart-prompt\"><?php _e( '&larr; Choose a product to view stats', 'woocommerce-cost-of-goods' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\treturn;\n\t\t}\n\n\t\t$data = $this->get_report_data();\n\n\t\t// prep data for charting\n\t\t$sales = $this->prepare_chart_data( $data->sales, 'post_date', 'order_item_amount', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$cogs = $this->prepare_chart_data( $data->cogs, 'post_date', 'order_item_total_cost', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$profits = $this->prepare_chart_data( $data->profits, 'post_date', 'order_item_profit', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$item_counts = $this->prepare_chart_data( $data->item_counts, 'post_date', 'order_item_count', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\n\t\t$chart_data = array(\n\t\t\t'sales' => array_values( $sales ),\n\t\t\t'cogs' => array_values( $cogs ),\n\t\t\t'profits' => array_values( $profits ),\n\t\t\t'item_counts' => array_values( $item_counts ),\n\t\t);\n\n\t\t?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo json_encode( $chart_data ); ?>' );\n\n\t\t\t\tvar drawGraph = function( highlight ) {\n\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Number of items sold', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.item_counts,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_items']; ?>',\n\t\t\t\t\t\t\tbars : { fillColor: '<?php echo $this->chart_colors['total_items']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable : false\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Sales amount', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.sales,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_sales']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Cost of Goods Sold', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.cogs,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_cogs']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Profit amount', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.profits,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_profit']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars ) {\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery( '.chart-placeholder.main' ),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgrid: {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tborderColor: 'transparent',\n\t\t\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\t\t\thoverable : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\txaxes: [ {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tposition : 'bottom',\n\t\t\t\t\t\t\t\ttickColor : 'transparent',\n\t\t\t\t\t\t\t\tmode : 'time',\n\t\t\t\t\t\t\t\ttimeformat : \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames : <?php echo json_encode( array_values( $GLOBALS['wp_locale']->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength : 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tcolor: '#aaa'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t\tyaxes: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\tminTickSize : 1,\n\t\t\t\t\t\t\t\t\ttickDecimals: 0,\n\t\t\t\t\t\t\t\t\tcolor : '#ecf0f1',\n\t\t\t\t\t\t\t\t\tfont : { color: '#aaa' }\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tposition : 'right',\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\ttickDecimals : 2,\n\t\t\t\t\t\t\t\t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t\t\t\tcolor : 'transparent',\n\t\t\t\t\t\t\t\t\tfont : { color: '#aaa' }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t\tjQuery( '.chart-placeholder' ).resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery( '.highlight_series' ).hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery( this ).data( 'series' ) );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function splitCalcDataProvider() {}", "public function getDataSet()\n {\n return $this->getConnection()->createDataSet();\n }", "private function bottomGridData() {\r\n\t\t\r\n $result = $this->getLatestPeriod();\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n $periodResult = array_column($result, \"period\");\r\n $query = \"SELECT \".$this->accountIdField.\" AS SKUID \" .\r\n \",MAX(\".$this->accountNameField.\") AS ACCOUNT \" .\r\n \",\".$this->settingVars->tesco_po_details.\".purchase_order_number AS PON \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".depot_number) AS DEPOT_NO \" .\r\n \",\".$this->settingVars->tesco_po_details.\".period AS PERIOD \" .\r\n \",MAX(\".$this->settingVars->tesco_po_details.\".delivered_on_time) AS DOT \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN total_placed_orders_Cases ELSE 0 END)) AS ORDERED \" .\r\n \",SUM((CASE WHEN period IN('\" . implode(\"','\", $periodResult) . \"') THEN delivered_on_time ELSE 0 END)) AS DELIVERED \" .\r\n \" FROM \".$this->settingVars->tesco_po_details.\", \".$this->settingVars->skutable.\" WHERE \".$this->settingVars->tesco_po_details.\".GID = \".$this->settingVars->skutable.\".GID AND \".$this->settingVars->tesco_po_details.\".skuID = \".$this->settingVars->skutable.\".PIN AND \".$this->settingVars->skutable.\".clientID = '\".$this->settingVars->clientID.\"' AND \".$this->settingVars->skutable.\".GID = \".$this->settingVars->GID.\" AND \".$this->settingVars->tesco_po_details.\".skuID = '\".$_REQUEST['selectedSKUID'].\"' AND \".$this->settingVars->tesco_po_details.\".period IN ('\".implode(\"','\", $periodResult).\"') AND \".$this->commonQueryPart.\" GROUP BY SKUID, PERIOD, PON ORDER BY PERIOD DESC\";\r\n //echo $query; exit;\r\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\r\n if ($redisOutput === false) {\r\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\r\n $this->redisCache->setDataForHash($result);\r\n } else {\r\n $result = $redisOutput;\r\n }\r\n \r\n if (is_array($result) && !empty($result))\r\n {\r\n foreach($result as $data)\r\n {\r\n $tmp = array();\r\n $tmp[\"SKUID\"] = $data[\"SKUID\"];\r\n $tmp[\"ACCOUNT\"] = $data[\"ACCOUNT\"];\r\n $tmp[\"PO\"] = (int)$data[\"PON\"];\r\n $tmp[\"DEPOT\"] = (int)$data[\"DEPOT_NO\"];\r\n $tmp[\"PERIOD\"] = (int)$data[\"PERIOD\"];\r\n $tmp[\"ORDERED\"] = (int)$data[\"ORDERED\"];\r\n $tmp[\"DOT\"] = (int)$data[\"DOT\"];\r\n $tmp[\"DOT_PER\"] = ($data[\"ORDERED\"] != 0) ? ($data[\"DELIVERED\"]/$data[\"ORDERED\"])*100 : 0;\r\n $tmp[\"DOT_PER\"] = (double)number_format($tmp[\"DOT_PER\"], 1, '.', '');\r\n $tmp[\"SHORT_CASES\"] = $data[\"ORDERED\"]-$data[\"DOT\"];\r\n $finalData[] = $tmp;\r\n }\r\n }\r\n $this->jsonOutput['bottomGridData'] = $finalData;\r\n }\r\n }", "protected function getGraphs()\n {\n // g2t table\n if (isset($this->dbConfig['db_table_prefix'])) {\n $g2t = $this->dbConfig['db_table_prefix'] . '_';\n } else {\n $g2t = '';\n }\n if (isset($this->dbConfig['store_name'])) {\n $g2t .= $this->dbConfig['store_name'] . '_';\n }\n $g2t .= 'g2t';\n\n // id2val table\n if (isset($this->dbConfig['db_table_prefix'])) {\n $id2val = $this->dbConfig['db_table_prefix'] . '_';\n } else {\n $id2val = '';\n }\n if (isset($this->dbConfig['store_name'])) {\n $id2val .= $this->dbConfig['store_name'] . '_';\n }\n $id2val .= 'id2val';\n\n // collects all values which have an ID (column g) in the g2t table.\n $query = 'SELECT id2val.val AS graphUri\n FROM '.$g2t.' g2t\n LEFT JOIN '.$id2val.' id2val ON g2t.g = id2val.id\n GROUP BY g';\n\n // send SQL query\n $list = $this->fixture->getDBObject()->fetchList($query);\n $graphs = [];\n\n // collect graph URI's\n foreach($list as $row) {\n $graphs[] = $row['graphUri'];\n }\n\n return $graphs;\n }", "public function load_ad_sets_by_pagination() {\n \n // Check if data was submitted\n if ($this->CI->input->post()) {\n \n // Add form validation\n $this->CI->form_validation->set_rules('url', 'Url', 'trim');\n \n // Get data\n $url = $this->CI->input->post('url');\n \n if ( $this->CI->form_validation->run() !== false ) {\n \n if ( !$url ) {\n \n // Get selected account\n $get_account = $this->CI->ads_account_model->get_account($this->CI->user_id, 'facebook');\n \n if ( $get_account ) {\n \n $response = $this->fb->get(\n '/' . $get_account[0]->net_id . '/adsets?fields=status,insights,name,campaign{name}&limit=10',\n $get_account[0]->token\n );\n \n $data = $response->getDecodedBody();\n \n if ( $data ) {\n \n $this->create_cache(MIDRUB_BASE_USER_APPS_FACEBOOK_ADS . 'cache/' . $get_account[0]->net_id . '-adsets.json', json_encode($data, JSON_PRETTY_PRINT));\n \n $previous = '';\n\n if ( isset($data['paging']['previous']) ) {\n $previous = $data['paging']['previous'];\n } \n\n $next = '';\n\n if ( isset($data['paging']['next']) ) {\n $next = $data['paging']['next'];\n }\n\n $array = array(\n 'success' => TRUE,\n 'adsets' => $data['data'],\n 'previous' => $previous,\n 'next' => $next\n );\n\n echo json_encode($array);\n exit();\n \n }\n \n }\n \n } else {\n\n $adsets = json_decode(get($url), true);\n\n if ( $adsets ) {\n\n $previous = '';\n\n if ( isset($adsets['paging']['previous']) ) {\n $previous = $adsets['paging']['previous'];\n } \n\n $next = '';\n\n if ( isset($adsets['paging']['next']) ) {\n $next = $adsets['paging']['next'];\n }\n\n $data = array(\n 'success' => TRUE,\n 'adsets' => $adsets['data'],\n 'previous' => $previous,\n 'next' => $next\n );\n\n echo json_encode($data);\n exit();\n\n }\n \n }\n \n }\n \n }\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('error_occurred')\n );\n\n echo json_encode($data); \n \n }", "public function getGraphsAndData() {\n return $this->graphsAndData;\n }", "private function addDataSet1(&$Chart, $parent, $chartType, $init = null, $args = null)\n\t{\n\t\t$retstr = '';\n\t\tfor ($i = 1; $i <= $Chart->SeriesCollection->Count(); $i++)\n\t\t{\n\t\t\tif ($Chart->SeriesCollection($i)->ChartType == $chartType)\n\t\t\t{\n\t\t\t\t$dataSetName = $Chart->SeriesCollection($i)->Name;\n\t\t\t\t// *** this will be used after implementation of dialogs ***\n\t\t\t\t$dataSetColor = FormatConvertor::RGBExcelToCD($Chart->SeriesCollection($i)->Interior->Color);\n\t\t\t\t$retstr .= '$dataSet_' . $i . ' = $' . $parent . '->addDataSet($this->Chart->SeriesCollection(' . $i . ')->Values, ' . $dataSetColor . ', \\'' . $dataSetName . '\\');' . \"\\n\";\n\t\t\t\tif ($Chart->SeriesCollection($i)->Border->LineStyle == Constants::xlSolid)\n\t\t\t\t\t$retstr .= '$dataSet_' . $i . '->setDataColor(' . $dataSetColor . ', ' . FormatConvertor::RGBExcelToCD($Chart->SeriesCollection($i)->Border->Color) . ');' . \"\\n\";\n\t\t\t\t// *** after implementation of dilogs this cod should be comented ***\n//\t\t\t\t$retstr .= '$dataSet_' . $i . ' = $' . $parent . '->addDataSet($this->Chart->SeriesCollection(' . $i . ')->Values, -1, \\'' . $dataSetName . '\\');' . \"\\n\";\n\t\t\t\t// ***\n\t\t\t}\n\t\t}\n\n\t\treturn $retstr;\n\t}", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "abstract protected function _generateDataCollection();", "public function run()\n {\n $dataSet = [\n ['name_en' => 'spacing-2', 'size_in_rems' => 0.5],\n ['name_en' => 'spacing-2.5', 'size_in_rems' => 0.625],\n ['name_en' => 'spacing-3', 'size_in_rems' => 0.75],\n ['name_en' => 'spacing-3.5', 'size_in_rems' => 0.875],\n ['name_en' => 'spacing-4', 'size_in_rems' => 1],\n ['name_en' => 'spacing-5', 'size_in_rems' => 1.25],\n ['name_en' => 'spacing-6', 'size_in_rems' => 1.5],\n ['name_en' => 'spacing-7', 'size_in_rems' => 1.75],\n ['name_en' => 'spacing-8', 'size_in_rems' => 2],\n ['name_en' => 'spacing-9', 'size_in_rems' => 2.25],\n ['name_en' => 'spacing-10', 'size_in_rems' => 2.5],\n ['name_en' => 'spacing-11', 'size_in_rems' => 2.75],\n ['name_en' => 'spacing-12', 'size_in_rems' => 3],\n ['name_en' => 'spacing-14', 'size_in_rems' => 3.5],\n ['name_en' => 'spacing-16', 'size_in_rems' => 4],\n ['name_en' => 'spacing-20', 'size_in_rems' => 5],\n ['name_en' => 'spacing-24', 'size_in_rems' => 6],\n ['name_en' => 'spacing-28', 'size_in_rems' => 7],\n ['name_en' => 'spacing-32', 'size_in_rems' => 8],\n ['name_en' => 'spacing-36', 'size_in_rems' => 9],\n ['name_en' => 'spacing-40', 'size_in_rems' => 10],\n ['name_en' => 'spacing-44', 'size_in_rems' => 11],\n ];\n $index = 1;\n foreach ($dataSet as &$item) {\n $item['name_nl'] = str_replace('spacing', 'spatiëring', $item['name_en']);\n $item['id'] = $index++;\n Spacing::updateOrCreateWithTranslations(['id' => $item['id']], $item);\n }\n }", "public function actionChartTest1(){\n\t\t\n\t $chartGrantData='{\n\t\t\"chart\": {\n \"subcaption\": \"Pilot Project Planned vs Actual\", \n \"dateformat\": \"dd/mm/yyyy\",\n \"outputdateformat\": \"ddds mns yy\",\n \"ganttwidthpercent\": \"70\",\n \"ganttPaneDuration\": \"50\",\n \"ganttPaneDurationUnit\": \"d\",\t\n\t\t\t\t\"height\":\"500%\",\n\t\t\t\t\"fontsize\": \"14\",\t\t\t\t\n \"plottooltext\": \"$processName{br} $label starting date $start{br}$label ending date $end\",\n \"theme\": \"fint\"\n },\n\t\t\"categories\": [\n\t\t\t{\n\t\t\t\t\"bgcolor\": \"#33bdda\",\n\t\t\t\t\"category\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/4/2014\",\n\t\t\t\t\t\t\"end\": \"30/6/2014\",\n\t\t\t\t\t\t\"label\": \"Months\",\n\t\t\t\t\t\t\"align\": \"middle\",\n\t\t\t\t\t\t\"fontcolor\": \"#ffffff\",\n\t\t\t\t\t\t\"fontsize\": \"14\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"bgcolor\": \"#33bdda\",\n\t\t\t\t\"align\": \"middle\",\n\t\t\t\t\"fontcolor\": \"#ffffff\",\n\t\t\t\t\"fontsize\": \"12\",\n\t\t\t\t\"category\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/4/2014\",\n\t\t\t\t\t\t\"end\": \"30/4/2014\",\n\t\t\t\t\t\t\"label\": \"April\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/5/2014\",\n\t\t\t\t\t\t\"end\": \"31/5/2014\",\n\t\t\t\t\t\t\"label\": \"May\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/6/2014\",\n\t\t\t\t\t\t\"end\": \"30/6/2014\",\n\t\t\t\t\t\t\"label\": \"June\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"bgcolor\": \"#ffffff\",\n\t\t\t\t\"fontcolor\": \"#1288dd\",\n\t\t\t\t\"fontsize\": \"10\",\n\t\t\t\t\"isbold\": \"1\",\n\t\t\t\t\"align\": \"center\",\n\t\t\t\t\"category\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/4/2014\",\n\t\t\t\t\t\t\"end\": \"5/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 1\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"6/4/2014\",\n\t\t\t\t\t\t\"end\": \"12/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"13/4/2014\",\n\t\t\t\t\t\t\"end\": \"19/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 3\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"20/4/2014\",\n\t\t\t\t\t\t\"end\": \"26/4/2014\",\n\t\t\t\t\t\t\"label\": \"Week 4\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"27/4/2014\",\n\t\t\t\t\t\t\"end\": \"3/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 5\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"4/5/2014\",\n\t\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 6\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"11/5/2014\",\n\t\t\t\t\t\t\"end\": \"17/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 7\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"18/5/2014\",\n\t\t\t\t\t\t\"end\": \"24/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 8\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"25/5/2014\",\n\t\t\t\t\t\t\"end\": \"31/5/2014\",\n\t\t\t\t\t\t\"label\": \"Week 9\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"1/6/2014\",\n\t\t\t\t\t\t\"end\": \"7/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 10\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"8/6/2014\",\n\t\t\t\t\t\t\"end\": \"14/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 11\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"15/6/2014\",\n\t\t\t\t\t\t\"end\": \"21/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 12\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"start\": \"22/6/2014\",\n\t\t\t\t\t\t\"end\": \"28/6/2014\",\n\t\t\t\t\t\t\"label\": \"Week 13\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\t\"datatable\": {\n \"headervalign\": \"bottom\",\n \"datacolumn\": [\n {\n \"headertext\": \"PIC\",\n \"fontcolor\": \"#000000\",\n\t\t\t\t\t\t\"fontsize\": \"10\",\n\t\t\t\t\t\t\"isanimated\": \"1\",\n\t\t\t\t\t\t\"bgcolor\": \"#6baa01\",\n\t\t\t\t\t\t\"headervalign\": \"middle\",\n\t\t\t\t\t\t\"headeralign\": \"center\",\n\t\t\t\t\t\t\"headerbgcolor\": \"#6baa01\",\n\t\t\t\t\t\t\"headerfontcolor\": \"#ffffff\",\n\t\t\t\t\t\t\"headerfontsize\": \"16\",\n\t\t\t\t\t\t\"width\":\"150\",\n\t\t\t\t\t\t\"align\": \"left\",\n\t\t\t\t\t\t\"isbold\": \"1\",\n\t\t\t\t\t\t\"bgalpha\": \"25\",\t\t\t\t\n \"text\": [\n {\n \"label\": \" \"\n },\n {\n \"label\": \"John\"\n },\n {\n \"label\": \"David\"\n },\n {\n \"label\": \"Mary\"\n },\n {\n \"label\": \"John\"\n },\n {\n \"label\": \"Andrew & Harry\"\n }, \n {\n \"label\": \"John & Harry\"\n },\n {\n \"label\": \" \"\n },\n {\n \"label\": \"Neil & Harry\"\n },\n {\n \"label\": \"Neil & Harry\"\n },\n {\n \"label\": \"Chris\"\n },\n {\n \"label\": \"John & Richard\"\n }\n ]\n }\n ]\n },\n\t\t\"processes\": {\n\t\t\t\"headertext\": \"Pilot Task\",\n\t\t\t\"fontsize\": \"12\",\n\t\t\t\"fontcolor\": \"#000000\",\n\t\t\t\"fontsize\": \"10\",\n\t\t\t\"isanimated\": \"1\",\n\t\t\t\"bgcolor\": \"#6baa01\",\n\t\t\t\"headervalign\": \"middle\",\n\t\t\t\"headeralign\": \"center\",\n\t\t\t\"headerbgcolor\": \"#6baa01\",\n\t\t\t\"headerfontcolor\": \"#ffffff\",\n\t\t\t\"headerfontsize\": \"16\",\n\t\t\t\"width\":\"200\",\n\t\t\t\"align\": \"left\",\n\t\t\t\"isbold\": \"1\",\n\t\t\t\"bgalpha\": \"25\",\n\t\t\t\"process\": [\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Clear site\",\n\t\t\t\t\t\"id\": \"1\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Excavate Foundation\",\n\t\t\t\t\t\"id\": \"2\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Concrete Foundation\",\n\t\t\t\t\t\"id\": \"3\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Footing to DPC\",\n\t\t\t\t\t\"id\": \"4\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Drainage Services\",\n\t\t\t\t\t\"id\": \"5\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Backfill\",\n\t\t\t\t\t\"id\": \"6\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Ground Floor\",\n\t\t\t\t\t\"id\": \"7\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Walls on First Floor\",\n\t\t\t\t\t\"id\": \"8\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"First Floor Carcass\",\n\t\t\t\t\t\"id\": \"9\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"First Floor Deck\",\n\t\t\t\t\t\"id\": \"10\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Roof Structure\",\n\t\t\t\t\t\"id\": \"11\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Roof Covering\",\n\t\t\t\t\t\"id\": \"12\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Rainwater Gear\",\n\t\t\t\t\t\"id\": \"13\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Windows\",\n\t\t\t\t\t\"id\": \"14\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"External Doors\",\n\t\t\t\t\t\"id\": \"15\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Connect Electricity\",\n\t\t\t\t\t\"id\": \"16\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Connect Water Supply\",\n\t\t\t\t\t\"id\": \"17\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Install Air Conditioning\",\n\t\t\t\t\t\"id\": \"18\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Interior Decoration\",\n\t\t\t\t\t\"id\": \"19\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Fencing And signs\",\n\t\t\t\t\t\"id\": \"20\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Exterior Decoration\",\n\t\t\t\t\t\"id\": \"21\",\n\t\t\t\t\t\"hoverbandcolor\": \"#e44a00\",\n\t\t\t\t\t\"hoverbandalpha\": \"40\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Setup racks\",\n\t\t\t\t\t\"id\": \"22\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\t\t\n\t\t\"tasks\": {\n\t\t\t\"task\": [\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"1\",\n\t\t\t\t\t\"start\": \"9/4/2014\",\n\t\t\t\t\t\"end\": \"12/4/2014\",\n\t\t\t\t\t\"id\": \"1-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"1\",\n\t\t\t\t\t\"start\": \"9/4/2014\",\n\t\t\t\t\t\"end\": \"12/4/2014\",\n\t\t\t\t\t\"id\": \"1\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"2\",\n\t\t\t\t\t\"start\": \"13/4/2014\",\n\t\t\t\t\t\"end\": \"23/4/2014\",\n\t\t\t\t\t\"id\": \"2-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"2\",\n\t\t\t\t\t\"start\": \"13/4/2014\",\n\t\t\t\t\t\"end\": \"25/4/2014\",\n\t\t\t\t\t\"id\": \"2\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"2\",\n\t\t\t\t\t\"start\": \"23/4/2014\",\n\t\t\t\t\t\"end\": \"25/4/2014\",\n\t\t\t\t\t\"id\": \"2-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 2 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"3\",\n\t\t\t\t\t\"start\": \"23/4/2014\",\n\t\t\t\t\t\"end\": \"30/4/2014\",\n\t\t\t\t\t\"id\": \"3-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"3\",\n\t\t\t\t\t\"start\": \"26/4/2014\",\n\t\t\t\t\t\"end\": \"4/5/2014\",\n\t\t\t\t\t\"id\": \"3\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"3\",\n\t\t\t\t\t\"start\": \"3/5/2014\",\n\t\t\t\t\t\"end\": \"4/5/2014\",\n\t\t\t\t\t\"id\": \"3-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 1 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"4\",\n\t\t\t\t\t\"start\": \"3/5/2014\",\n\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\"id\": \"4-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"4\",\n\t\t\t\t\t\"start\": \"4/5/2014\",\n\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\"id\": \"4\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"5\",\n\t\t\t\t\t\"start\": \"6/5/2014\",\n\t\t\t\t\t\"end\": \"11/5/2014\",\n\t\t\t\t\t\"id\": \"5-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"5\",\n\t\t\t\t\t\"start\": \"6/5/2014\",\n\t\t\t\t\t\"end\": \"10/5/2014\",\n\t\t\t\t\t\"id\": \"5\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"6\",\n\t\t\t\t\t\"start\": \"4/5/2014\",\n\t\t\t\t\t\"end\": \"7/5/2014\",\n\t\t\t\t\t\"id\": \"6-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"6\",\n\t\t\t\t\t\"start\": \"5/5/2014\",\n\t\t\t\t\t\"end\": \"11/5/2014\",\n\t\t\t\t\t\"id\": \"6\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"6\",\n\t\t\t\t\t\"start\": \"7/5/2014\",\n\t\t\t\t\t\"end\": \"11/5/2014\",\n\t\t\t\t\t\"id\": \"6-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 4 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"7\",\n\t\t\t\t\t\"start\": \"11/5/2014\",\n\t\t\t\t\t\"end\": \"14/5/2014\",\n\t\t\t\t\t\"id\": \"7-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"7\",\n\t\t\t\t\t\"start\": \"11/5/2014\",\n\t\t\t\t\t\"end\": \"14/5/2014\",\n\t\t\t\t\t\"id\": \"7\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"8\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"19/5/2014\",\n\t\t\t\t\t\"id\": \"8-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"8\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"19/5/2014\",\n\t\t\t\t\t\"id\": \"8\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"9\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"18/5/2014\",\n\t\t\t\t\t\"id\": \"9-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"9\",\n\t\t\t\t\t\"start\": \"16/5/2014\",\n\t\t\t\t\t\"end\": \"21/5/2014\",\n\t\t\t\t\t\"id\": \"9\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"9\",\n\t\t\t\t\t\"start\": \"18/5/2014\",\n\t\t\t\t\t\"end\": \"21/5/2014\",\n\t\t\t\t\t\"id\": \"9-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 3 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"10\",\n\t\t\t\t\t\"start\": \"20/5/2014\",\n\t\t\t\t\t\"end\": \"23/5/2014\",\n\t\t\t\t\t\"id\": \"10-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"10\",\n\t\t\t\t\t\"start\": \"21/5/2014\",\n\t\t\t\t\t\"end\": \"24/5/2014\",\n\t\t\t\t\t\"id\": \"10\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"10\",\n\t\t\t\t\t\"start\": \"23/5/2014\",\n\t\t\t\t\t\"end\": \"24/5/2014\",\n\t\t\t\t\t\"id\": \"10-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 1 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"11\",\n\t\t\t\t\t\"start\": \"25/5/2014\",\n\t\t\t\t\t\"end\": \"27/5/2014\",\n\t\t\t\t\t\"id\": \"11-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"11\",\n\t\t\t\t\t\"start\": \"25/5/2014\",\n\t\t\t\t\t\"end\": \"27/5/2014\",\n\t\t\t\t\t\"id\": \"11\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"12\",\n\t\t\t\t\t\"start\": \"28/5/2014\",\n\t\t\t\t\t\"end\": \"1/6/2014\",\n\t\t\t\t\t\"id\": \"12-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"12\",\n\t\t\t\t\t\"start\": \"28/5/2014\",\n\t\t\t\t\t\"end\": \"1/6/2014\",\n\t\t\t\t\t\"id\": \"12\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"13\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"6/6/2014\",\n\t\t\t\t\t\"id\": \"13-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"13\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"6/6/2014\",\n\t\t\t\t\t\"id\": \"13\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"14\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"14-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"14\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"14\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"15\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"15-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"15\",\n\t\t\t\t\t\"start\": \"4/6/2014\",\n\t\t\t\t\t\"end\": \"4/6/2014\",\n\t\t\t\t\t\"id\": \"15\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"16\",\n\t\t\t\t\t\"start\": \"2/6/2014\",\n\t\t\t\t\t\"end\": \"7/6/2014\",\n\t\t\t\t\t\"id\": \"16-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"16\",\n\t\t\t\t\t\"start\": \"2/6/2014\",\n\t\t\t\t\t\"end\": \"7/6/2014\",\n\t\t\t\t\t\"id\": \"16\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"17\",\n\t\t\t\t\t\"start\": \"5/6/2014\",\n\t\t\t\t\t\"end\": \"10/6/2014\",\n\t\t\t\t\t\"id\": \"17-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"17\",\n\t\t\t\t\t\"start\": \"5/6/2014\",\n\t\t\t\t\t\"end\": \"17/6/2014\",\n\t\t\t\t\t\"id\": \"17\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"17\",\n\t\t\t\t\t\"start\": \"10/6/2014\",\n\t\t\t\t\t\"end\": \"17/6/2014\",\n\t\t\t\t\t\"id\": \"17-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 7 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"18\",\n\t\t\t\t\t\"start\": \"10/6/2014\",\n\t\t\t\t\t\"end\": \"12/6/2014\",\n\t\t\t\t\t\"id\": \"18-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"18\",\n\t\t\t\t\t\"start\": \"18/6/2014\",\n\t\t\t\t\t\"end\": \"20/6/2014\",\n\t\t\t\t\t\"id\": \"18\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 8 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"19\",\n\t\t\t\t\t\"start\": \"15/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"19-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"19\",\n\t\t\t\t\t\"start\": \"16/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"19\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"20\",\n\t\t\t\t\t\"start\": \"23/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"20-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"20\",\n\t\t\t\t\t\"start\": \"23/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"20\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"21\",\n\t\t\t\t\t\"start\": \"18/6/2014\",\n\t\t\t\t\t\"end\": \"21/6/2014\",\n\t\t\t\t\t\"id\": \"21-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"21\",\n\t\t\t\t\t\"start\": \"18/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"21\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Delay\",\n\t\t\t\t\t\"processid\": \"21\",\n\t\t\t\t\t\"start\": \"21/6/2014\",\n\t\t\t\t\t\"end\": \"23/6/2014\",\n\t\t\t\t\t\"id\": \"21-2\",\n\t\t\t\t\t\"color\": \"#e44a00\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"tooltext\": \"Delayed by 2 days.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"processid\": \"22\",\n\t\t\t\t\t\"start\": \"24/6/2014\",\n\t\t\t\t\t\"end\": \"28/6/2014\",\n\t\t\t\t\t\"id\": \"22-1\",\n\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\"height\": \"32%\",\n\t\t\t\t\t\"toppadding\": \"12%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"processid\": \"22\",\n\t\t\t\t\t\"start\": \"25/6/2014\",\n\t\t\t\t\t\"end\": \"28/6/2014\",\n\t\t\t\t\t\"id\": \"22\",\n\t\t\t\t\t\"color\": \"#6baa01\",\n\t\t\t\t\t\"toppadding\": \"56%\",\n\t\t\t\t\t\"height\": \"32%\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"connectors\": [\n\t\t\t{\n\t\t\t\t\"connector\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"1\",\n\t\t\t\t\t\t\"totaskid\": \"2\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\",\n\t\t\t\t\t\t\"fromtaskconnectstart_\": \"1\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"2-2\",\n\t\t\t\t\t\t\"totaskid\": \"3\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"3-2\",\n\t\t\t\t\t\t\"totaskid\": \"4\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"3-2\",\n\t\t\t\t\t\t\"totaskid\": \"6\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"7\",\n\t\t\t\t\t\t\"totaskid\": \"8\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"7\",\n\t\t\t\t\t\t\"totaskid\": \"9\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"12\",\n\t\t\t\t\t\t\"totaskid\": \"16\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"12\",\n\t\t\t\t\t\t\"totaskid\": \"17\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"17-2\",\n\t\t\t\t\t\t\"totaskid\": \"18\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"fromtaskid\": \"19\",\n\t\t\t\t\t\t\"totaskid\": \"22\",\n\t\t\t\t\t\t\"color\": \"#008ee4\",\n\t\t\t\t\t\t\"thickness\": \"2\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\t\"milestones\": {\n\t\t\t\"milestone\": [\n\t\t\t\t{\n\t\t\t\t\t\"date\": \"2/6/2014\",\n\t\t\t\t\t\"taskid\": \"12\",\n\t\t\t\t\t\"color\": \"#f8bd19\",\n\t\t\t\t\t\"shape\": \"star\",\n\t\t\t\t\t\"tooltext\": \"Completion of Phase 1\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"legend\": {\n\t\t\t\"item\": [\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Planned\",\n\t\t\t\t\t\"color\": \"#008ee4\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Actual\",\n\t\t\t\t\t\"color\": \"#6baa01\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"label\": \"Slack (Delay)\",\n\t\t\t\t\t\"color\": \"#e44a00\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t }';\n\t\treturn $chartGrantData;\n\t\t\n\t}", "public function drillAcross(){\n $attendences = unserialize($_SESSION['attendences']);\n $hasteam = unserialize($_SESSION['hasteam']);\n $commonDimension = $_SESSION['commonDimension'];\n $commonTbl = explode('.',$commonDimension)[0];\n $measures1 = $_SESSION['measure'];\n $measures2 = $_SESSION['hasTeamMeasure'];\n $slices = $_SESSION['slice'];\n $mea2Col = explode('(',$measures2)[1];\n $mea2Col = explode(')',$mea2Col)[0];\n\n // Initialize query statement that will use in this function\n $select = 'SELECT DISTINCT ';\n $join = ' INNER JOIN ';\n $group = ' GROUP BY ';\n $on = ' ON ';\n $equal = ' = ';\n $apos = \"'\"; //apostrophe\n $from = \" FROM \";\n \n // start generate query by adding select statement\n $firstQuery = $select;\n $firstQuery .= ' * '.$from;\n $firstQuery .= $attendences->tblName.\" \";\n \n // If there is slice and dice\n if(!empty($slices)){\n // get all tableName for slice and dice\n foreach($slices as $key => $slice){\n $keyArr[] = $slice->dimension;\n }\n // get the unique table from key array\n $uniqueKey = array_unique($keyArr);\n foreach($uniqueKey as $ky){\n foreach($slices as $key => $slice){\n if($ky == $slice->dimension){\n $val[$ky][] = $slice->value;\n }\n }\n }\n // join the dimension for slice\n foreach($uniqueKey as $ky){\n $firstQuery .= $join;\n $refTbl = explode('.',$ky)[0];\n $firstQuery .= $refTbl;\n $firstQuery .= $on;\n $firstQuery .= $attendences->tblName . '.' . $attendences->reference[$refTbl];\n $firstQuery .= $equal;\n $firstQuery .= $refTbl .'.'.$attendences->dimension[$refTbl]->pkey.\" \";\n }\n\n // add where statement if there is slice\n // loop through all the value\n $firstQuery .= ' WHERE ';\n foreach($val as $dim => $values){\n $firstQuery .= $dim;\n $firstQuery .= ' IN (';\n foreach($values as $index=>$value){\n $firstQuery .= $apos.$value.$apos;\n if($value != end($values)){\n $firstQuery .= \",\";\n }\n }\n $firstQuery .= \")\";\n if($values != end($val)){\n $firstQuery .= \" AND \";\n }\n }\n }\n\n // Start generating outer query\n // outer query\n $secondQuery = 'SELECT ';\n\n // add measure from fact table 1\n if(!empty($measures1)){\n foreach($measures1 as $measure){\n $secondQuery .= $measure;\n if($measure != end($measures1)){\n $secondQuery .= \",\";\n }\n }\n }\n\n // add the selected common dimension and loop until the highest hierarchy\n $dimension = $attendences->dimension[$commonTbl];\n $cd = explode('.',$commonDimension)[1];\n $arrKey = array_keys($dimension->column);\n $index = array_search($cd,$arrKey);\n \n while($index != -1 ){\n $secondQuery.=',';\n $secondQuery .= $dimension->column[$arrKey[$index]].\" \";\n $index--;\n }\n\n // add measure from fact table 2\n if(!empty($measures2)){\n $secondQuery .= \",\";\n $secondQuery .= $measures2;\n\n }\n\n\n // concat the inner query to outer query\n $secondQuery .= $from;\n $secondQuery .= \"( \";\n $secondQuery .= $firstQuery;\n $secondQuery .= \") as tbl\";\n \n\n // join the unique table with second fact and common dimension\n $secondQuery .= $join;\n $secondQuery .= $hasteam->tblName . $on;\n $secondQuery .= 'tbl'.\".\";\n $secondQuery .= $attendences->reference[$commonTbl];\n $secondQuery .= $equal;\n $secondQuery .= $hasteam->tblName.\".\".$hasteam->reference[$commonTbl];\n\n $secondQuery .= $join;\n $secondQuery .= $commonTbl . $on;\n $secondQuery .= $hasteam->tblName.\".\".$hasteam->reference[$commonTbl];\n $secondQuery .= $equal;\n $secondQuery .= $commonTbl.\".\".$attendences->dimension[$commonTbl]->pkey;\n \n\n // add the group by statement by looping until highest hierarchy\n $secondQuery .= $group;\n $dimension = $attendences->dimension[$commonTbl];\n $cd = explode('.',$commonDimension)[1];\n $arrKey = array_keys($dimension->column);\n $index = array_search($cd,$arrKey);\n \n while($index != -1 ){\n $secondQuery .= $dimension->column[$arrKey[$index]].\" \";\n $index--;\n if($index != -1){\n $secondQuery.=',';\n }\n }\n\n // Display the result dynamically same as generatePivot()\n // Start PDO connection\n $pivotStmt = $this->connect()->prepare($secondQuery);\n $pivotStmt->execute();\n\n $ttlCol = $pivotStmt->columnCount();\n $column = array();\n\n for ($counter = 0; $counter < $ttlCol; $counter ++) {\n $meta = $pivotStmt->getColumnMeta($counter);\n $column[] = $meta['name'];\n }\n \n $result = array();\n\n if($pivotStmt->rowCount()){\n while($row = $pivotStmt->fetch()){\n foreach($column as $col){\n $result[$col][] = $row[$col];\n }\n }\n\n $rowCount = $pivotStmt->rowCount();\n print('<div class=\"container-fluid\">');\n print('<div class=\"table-responsive table-responsive-sm\">');\n print \"<table class='table table-striped table-hover'>\";\n print '<thead class=\"\"><tr>';\n print '<tr>';\n for($j=0;$j<2;$j++){\n print '<th>'.'</th>';\n }\n $colspan = $ttlCol - 1;\n print '</tr>';\n print(\"<th scope='row'> Count </th>\");\n foreach($column as $col){\n print '<th>'.$col.'</th>';\n }\n print '</tr>';\n print '</thead>';\n for($i=0; $i < $rowCount; $i++){\n print('<tr>');\n print(\"<td scope='row'>\".$i.\"</td>\");\n foreach($column as $col){\n print('<td>'.$result[$col][$i].'</td>');\n }\n print('</tr>');\n }\n print '</table>';\n print '</div>';\n print '</div>';\n\n } \n }", "protected function getDataSet()\n {\n //Dataset TokenTest.xml has the minimal data we need to perform our tests\n $classFile = str_replace('.php', '.xml', __FILE__);\n return $this->createFlatXMLDataSet($classFile);\n }", "protected function getDataSet()\n {\n return $this->createArrayDataSet([\n 'eventbus_event' => [\n [\n 'id' => '1',\n 'update_time' => '2017-11-20 17:12:59',\n 'create_time' => '2017-11-20 17:12:59',\n 'event_id' => '0115060e-cdd3-11e7-b85c-02427a6bfbd8',\n 'event_name' => 'open',\n 'topic' => 'merchant',\n 'payload' => '{\"merchant_id\":3333}',\n ],\n ],\n 'eventbus_subscriber' => [\n [\n 'id' => '1',\n 'update_time' => '2017-11-20 17:14:34',\n 'create_time' => '2017-11-20 17:14:34',\n 'topic' => 'merchant',\n 'notify_url' => 'http://localhost/event-bus/notification',\n 'enabled' => 1,\n ],\n ],\n 'eventbus_log' => [],\n ]);\n }", "protected function collectDataGroup()\n {\n $url = $this->getGroupURI();\n $this->collectDeals($url);\n }", "public function dashboard() {\n\t\t//populate data: tasks, forum discussions, timeline, burndown chart\n\t}", "public static function fetchAll() {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM pd_time_series';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute();\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $thePdSeries = new PdSeries($row);\n array_push($arr, $thePdSeries);\n }\n\n return $arr;\n }", "protected function obtainData()\n\t{\n\t\t$this->obtainDataReferences();\n\t\t$this->obtainDataOrders();\n\t}", "function get_all_series()\n {\n return $this->db->get('series')->result_array();\n }", "function section__plot(){\n $app =& Dataface_Application::getInstance();\n $record =& $app->getRecord();\n $sensors = df_get_records_array('sensors', array('id_station'=>$record->val('id_station'),\n 'type_station'=>$record->val('type_station')));\n \n $content = \"To view all related sensors of station \".$record->val('id_station').\"(\".$record->val('type_station').\")\".\n \" <a href='index.php?-table=sensors&id_station==\".$record->val('id_station').\"&type_station==\".\n $record->val('type_station').\"'>click here</a><br/><br/>\";\n /*create the content array*/\n $content .= \"<select onchange='window.location.href=this.options[this.selectedIndex].value'>\";\n $content .= \"<option>Select Sensor...</option>\";\n \n foreach ($sensors as $sensor){\n /* Only include entries with id_station and type_station corresponding to the application instance (LV - v.1.1.3*/\n if ($sensor->val('id_station') == $record->val('id_station') && $sensor->val('type_station') == $record->val('type_station')){\n $content .= \"<option value='index.php?-table=sensors&type_station==\".$sensor->val('type_station')\n .\"&id_station==\".$sensor->val('id_station')\n .\"&sensor==\".$sensor->val('sensor')\n .\"&type_timeseries==\".$sensor->val('type_timeseries').\"&-action=plot'>\"\n .$sensor->val('description').\" [aggregation-sensor: \".$sensor->val('sensor').\" | \".$sensor->val('sensortype').\"]</option>\"; \n }\n }\n $content .= \"</select><br>\"; \n $content .= \" Aggregation types are I (Instantenious), J (Daily) or M (Monthly)<br/>\";\n return array(\n 'content' => $content,\n 'class' => 'main',\n 'label' => 'Plot Timeseries',\n 'order' => 0\n );\n }", "public function testCanGetDatasetByTitleAndOptionallyByAccountAndProject() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n $topLevel = new DatasetInstanceSummary(\"Top Level Dataset\", \"test-json\");\n $topLevelId = $this->datasetService->saveDataSetInstance($topLevel, null, null);\n\n $account1 = new DatasetInstanceSummary(\"Account Dataset 1\", \"test-json\");\n $account1Id = $this->datasetService->saveDataSetInstance($account1, null, 1);\n\n $account2 = new DatasetInstanceSummary(\"Account Dataset 2\", \"test-json\");\n $account2Id = $this->datasetService->saveDataSetInstance($account2, null, 2);\n\n $project1 = new DatasetInstanceSummary(\"Project Dataset 1\", \"test-json\");\n $project1Id = $this->datasetService->saveDataSetInstance($project1, \"soapSuds\", 2);\n\n $project2 = new DatasetInstanceSummary(\"Project Dataset 2\", \"test-json\");\n $project2Id = $this->datasetService->saveDataSetInstance($project2, \"wiperBlades\", 2);\n\n $this->assertEquals($this->datasetService->getDataSetInstance($topLevelId), $this->datasetService->getDataSetInstanceByTitle(\"Top Level Dataset\", null, null));\n $this->assertEquals($this->datasetService->getDataSetInstance($account1Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 1\", null, 1));\n $this->assertEquals($this->datasetService->getDataSetInstance($account2Id), $this->datasetService->getDataSetInstanceByTitle(\"Account Dataset 2\", null, 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project1Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 1\", \"soapSuds\", 2));\n $this->assertEquals($this->datasetService->getDataSetInstance($project2Id), $this->datasetService->getDataSetInstanceByTitle(\"Project Dataset 2\", \"wiperBlades\", 2));\n\n\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "public function getData() {\r\n\r\n\t\t$sodexo_domain = 'http://www.sodexo.fi/';\r\n\t\t$path = 'ruokalistat/output/daily_json/';\r\n\r\n\t\tforeach ($this->id_arr as $key => $value) {\r\n\r\n\t\t\t$json_data = file_get_contents($sodexo_domain . $path . $value . '/' . $this->pvm .'/fi');\r\n\r\n\t\t\t$course_info = $this->toObjectArray($json_data);\r\n\t\t\t\r\n\t\t\t$this->id_arr[$key] = $course_info;\r\n\t\t}\r\n\t}", "function load_data()\n \t{\n \t\t\n \t\t$return=parent::load_data();\t\n \t\t$this->images_array=t3lib_div::trimExplode(',',$this->images);\n \t\t$this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages);\n \t\treturn $return;\n \t}", "private function collectAllData()\n {\n $this->getParsedHeader();\n $this->getServerConfig();\n $this->getPageTitle();\n $this->getLanguage();\n $this->getCharset();\n $this->getHeadingsCount();\n $this->getCanonicalLINKS();\n $this->getAllLinksData();\n }", "public function ajaxChart(Request $request) {\n if($request->duration == 'week')\n {\n $startWeek = Carbon::now()->startOfWeek();\n $endWeek = Carbon::now()->endOfWeek();\n // $startWeek = Carbon::create(2019,06,17,0,0,0);\n // $endWeek = Carbon::create(2019,06,23,0,0,0);\n }\n if($request->duration == 'month')\n {\n $startWeek = Carbon::now()->startOfMonth();\n $endWeek = Carbon::now()->endOfMonth();\n // $startWeek = Carbon::create(2019,06,01,0,0,0);\n // $endWeek = Carbon::create(2019,06,30,0,0,0);\n }\n // get data for listing enquery\n if($request->type == 'le')\n $graphArray = Helper::getLeadDatewise('business_post_enquiries',$startWeek,$endWeek);\n // get data for business post enquiries\n if($request->type == 'bae')\n $graphArray = Helper::getLeadDatewise('business_form_contents',$startWeek,$endWeek,['type'=>'banner-ad']);\n // get data for elast enquiries\n if($request->type == 'ebe')\n $graphArray = Helper::getLeadDatewise('business_form_contents',$startWeek,$endWeek,['type'=>'eblast']);\n // get data for e-commerce\n if($request->type == 'ecom')\n {\n $whereData = [\n ['is_old', 0],\n ['province_id', '!=', 1]\n ];\n $graphArray = Helper::getLeadDatewise('users',$startWeek,$endWeek,$whereData,'lis');\n }\n return $graphArray;\n }", "public static function dataProvider()\n\t{\n\t\treturn array(\n\t\t\tarray(1600, 'MONTHLY', 1600),\n\t\t\tarray(2800, 'FOUR_WEEKLY', 2800),\n\t\t\tarray(280, 'TWICE_MONTHLY', 140),\n\t\t\tarray(1400, 'BI_WEEKLY', 700),\n\t\t\tarray(500, 'WEEKLY', 125),\n\t\t\tarray(505, 'WEEKLY', 126),\n\t\t\tarray(503, 'WEEKLY', 125),\n\t\t\tarray(1600, 'WHATEVER', 0),\n\t\t);\t\t\n\t}", "public function getMultipleData()\n\t{\n\t\t$calculatedData = $this->getCalculatedData();\n\t\tif (!$calculatedData)\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\t$result = [];\n\t\tforeach ($calculatedData as $row)\n\t\t{\n\t\t\t$currentDate = $row['DATE'];\n\t\t\t$previousDate = $row['PREVIOUS_DATE'];\n\n\t\t\t$currentUrlParams = [];\n\t\t\t$previousUrlParams = [];\n\n\t\t\tif (!is_null($row['DATE']))\n\t\t\t{\n\t\t\t\t$currentDate = $this->getDateForUrl($currentDate);\n\t\t\t\t$currentUrlParams = $this->getUrlParams($currentDate['start'], $currentDate['finish']);\n\t\t\t}\n\n\t\t\tif (!is_null($row['PREVIOUS_DATE']))\n\t\t\t{\n\t\t\t\t$previousDate = $this->getDateForUrl($previousDate);\n\t\t\t\t$previousUrlParams = $this->getUrlParams($previousDate['start'], $previousDate['finish']);\n\t\t\t}\n\n\t\t\t$result[] = [\n\t\t\t\t'value' => [\n\t\t\t\t\t'CURRENT_DATE' => $currentDate['date'],\n\t\t\t\t\t'PREVIOUS_DATE' => $previousDate['date'],\n\t\t\t\t\t'CURRENT_DATE_FORMATTED' => $this->formatDateForGrid($currentDate['date']),\n\t\t\t\t\t'PREVIOUS_DATE_FORMATTED' => $this->formatDateForGrid($previousDate['date']),\n\t\t\t\t\t'CURRENT_VALUE' => $row['CALL_COUNT'],\n\t\t\t\t\t'PREVIOUS_VALUE' => $row['PREVIOUS_CALL_COUNT'],\n\t\t\t\t\t'DYNAMICS' => $this->formatPeriodCompare($row['CALL_COUNT_COMPARE']),\n\t\t\t\t],\n\t\t\t\t'url' => [\n\t\t\t\t\t'CURRENT_DATE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $currentUrlParams),\n\t\t\t\t\t'PREVIOUS_DATE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $previousUrlParams),\n\t\t\t\t\t'CURRENT_VALUE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $currentUrlParams),\n\t\t\t\t\t'PREVIOUS_VALUE' => $this->createUrl(self::TELEPHONY_DETAIL_URI, $previousUrlParams),\n\t\t\t\t]\n\t\t\t];\n\t\t}\n\n\t\treturn $result;\n\t}" ]
[ "0.6583141", "0.6382315", "0.6213798", "0.62028915", "0.61237514", "0.6050489", "0.60298604", "0.60298604", "0.594915", "0.59349006", "0.59054804", "0.59054804", "0.5855861", "0.58305234", "0.5792324", "0.5760454", "0.57527673", "0.5749921", "0.5749517", "0.5707264", "0.57039875", "0.56872106", "0.56383884", "0.56345105", "0.5629158", "0.56180745", "0.56128544", "0.55957365", "0.5567635", "0.55608934", "0.5544589", "0.55384636", "0.55312175", "0.55060047", "0.5480587", "0.5480353", "0.54747427", "0.54676336", "0.5451675", "0.54505265", "0.5437587", "0.5435567", "0.54181224", "0.54152036", "0.5413574", "0.54119295", "0.541114", "0.54063827", "0.5405502", "0.54008365", "0.53966314", "0.539595", "0.5392761", "0.538475", "0.53734386", "0.5366479", "0.5366479", "0.53547347", "0.53534293", "0.53516066", "0.53389287", "0.5334519", "0.5314343", "0.5313317", "0.5305577", "0.5299974", "0.52966434", "0.52918595", "0.5283955", "0.52673906", "0.5266656", "0.5264689", "0.52636415", "0.52403533", "0.52371085", "0.52209467", "0.5217895", "0.51984274", "0.5195834", "0.51642907", "0.51577103", "0.5156615", "0.5155735", "0.5152195", "0.5148173", "0.5145834", "0.51303965", "0.5122656", "0.5120289", "0.510702", "0.51031655", "0.50960475", "0.5090315", "0.50892556", "0.5070156", "0.5069349", "0.5068777", "0.5066701", "0.505603", "0.5051749" ]
0.5730689
19
Display a listing of the resource.
public function index() { $categories = Category::with('post')->latest()->get(); // return $categories->post->count(); return response()->json($categories, 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function 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() { // return view('admin.post.category.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) { // dd($request->all()); $this->validate($request, [ 'name' => 'required', ]); $category = Category::create([ 'name' => $request->name, 'slug' => Str::slug($request->name), ]); if($request->hasFile('image')){ $image = $request->image; $image_new_name = time() . '.' . $image->getClientOriginalExtension(); $image->move('storage/product/', $image_new_name); $category->image = '/storage/product/' . $image_new_name; $category->save(); } return response()->json($category, 200); }
{ "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(Category $category) { // }
{ "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(Category $category) { if($category){ return response()->json($category, 200); }else { return response()->json('failed', 404); } }
{ "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, Category $category) { $this->validate($request, [ 'name' => "required|unique:categories,name, $category->id" ]); $category->update([ 'name' => $request->name, 'slug' => Str::slug($request->name), ]); return response()->json('success', 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Category $category) { if($category){ $category->delete(); return response()->json('success', 200); }else { return response()->json('failed', 404); } }
{ "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
Parses an argument for this parameter to its value
public function parseArgument( ExtraParameter $parameter, array $config, array $parameterList, array $extraArguments ) { return $extraArguments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function parseArgument( $token )\n\t{\n\t\t$description = null;\n\n\t\tif ( Str::contains( $token, ' : ' ) )\n\t\t{\n\t\t\tlist( $token, $description ) = explode( ' : ', $token, 2 );\n\n\t\t\t$token = trim( $token );\n\n\t\t\t$description = trim( $description );\n\t\t}\n\n\t\tswitch ( true )\n\t\t{\n\t\t\tcase Str::endsWith( $token, '?*' ):\n\t\t\t\treturn new InputArgument( trim( $token, '?*' ), InputArgument::IS_ARRAY, $description );\n\t\t\tcase Str::endsWith( $token, '*' ):\n\t\t\t\treturn new InputArgument( trim( $token, '*' ), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description );\n\t\t\tcase Str::endsWith( $token, '?' ):\n\t\t\t\treturn new InputArgument( trim( $token, '?' ), InputArgument::OPTIONAL, $description );\n\t\t\tcase preg_match( '/(.+)\\=(.+)/', $token, $matches ):\n\t\t\t\treturn new InputArgument( $matches[1], InputArgument::OPTIONAL, $description, $matches[2] );\n\t\t\tdefault:\n\t\t\t\treturn new InputArgument( $token, InputArgument::REQUIRED, $description );\n\t\t}\n\t}", "public function parseValue();", "function rest_parse_request_arg($value, $request, $param)\n {\n }", "public function GetArgValue($_Arg)\r\n {\r\n return explode(':',$_Arg)[FIRST_ARG];\r\n }", "protected function parseParameter() {\n $reader = $this->reader; // alias in local\n\n $param = new Param;\n $param->name = $reader->getAttribute('name');\n $param->transfer = $reader->getAttribute('transfer-ownership');\n // get rid of \"floating\" transfer\n if($param->transfer == 'floating') {\n $param->transfer == 'none';\n }\n if($dir = $reader->getAttribute('direction')) {\n $param->direction = $dir;\n }\n\n do {\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'array') {\n $param->container = $reader->getAttribute('c:type');\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'type') {\n $param->nativeType = $reader->getAttribute('c:type');\n $param->type = $reader->getAttribute('name');\n $this->mapType($param);\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'doc') {\n $param->doc = $reader->readString();\n // this will ALWAYS stop our loop\n } elseif($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'parameter') {\n break;\n }\n } while($reader->read());\n\n return $param;\n }", "protected function parseArgument($arg)\n {\n $arg = ltrim($arg, '-');\n \n $key = $arg;\n $value = true;\n \n if (strpos($arg, '=') !== false) {\n $key = substr($arg, 0, strpos($arg, '='));\n $value = substr($arg, strpos($arg, '=') + 1);\n \n if (is_numeric($value)) {\n // Transform the value into the correct data type\n $value = $value * 1;\n }\n }\n \n return array($key, $value);\n }", "function parseValue($value);", "abstract public function parse($value);", "public function getArgument(string $name);", "public function getArgValue(string $name) {\n $argObj = $this->getArgument($name);\n\n if ($argObj === null) {\n return null;\n }\n\n $val = $this->getArgValFromRequest($name);\n\n if ($val === null) {\n $val = $this->getArgValFromTerminal($name);\n }\n\n\n\n if ($val === null) {\n $val = $argObj->getValue();\n }\n\n if ($val === null) {\n $val = $argObj->getDefault();\n }\n\n if ($val !== null) {\n $argObj->setValue($val);\n }\n\n return $val;\n }", "public function parseParams(string $param): self;", "public function parse($param)\n {\n }", "public function getArg(){\n return (string)$this->arg;\n }", "function processParameter($param) {\n if ($this->removeBoundingQuotes && strlen($param) >= 2 &&\n '\"' == $param[0] && '\"' == $param[strlen($param) - 1])\n {\n $param = substr($param, 1, -1);\n }\n\n $param = $this->decodeEscaped($param);\n\n if ($this->decodeUtf8) {\n $param = decodeUtf8($param);\n }\n\n if ($this->removeEscapingSlashes) {\n $param = str_replace('\\\\', '', $param);\n }\n\n return $param;\n }", "public function toValue ()\n\t{\n\t\t// Execute and get params\n\t\t$params = $this->parse();\n\n\t\t// Return params\n\t\treturn $params;\n\t}", "abstract public static function parse($value);", "public function getArgumentValue ($name) {\n if ($this->_arguments === NULL) {\n $this->getArguments();\n }\n\n if (array_key_exists($name, $this->_arguments) == FALSE) {\n throw new Argument_Exception(\"Argument '{$name}' does not exist\");\n }\n\n return $this->_arguments[$name];\n }", "function get_full_passed($argumento) { \n $findArg = $this->full_passed($argumento); \n\n if ($findArg) {\n return $this->parsed[$findArg][1];\n } \n\n return; \n }", "public function setArgument(string $name, $value);", "function parseValue($valueToken) {\n if ($this->isObject($valueToken)) {\n return $this->parseObject($valueToken);\n } elseif ($this->isArray($valueToken)) {\n return $this->parseArray($valueToken);\n }\n # it's the value itself\n return $this->processParameter($valueToken);\n }", "public function setArgument($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\StringValue::class);\n $this->argument = $var;\n\n return $this;\n }", "public function setArgument($name, $value);", "public function getNamedStringArgument($name);", "public function value($parameter);", "protected function compileArgument($argument)\n {\n $argumentDefinition = null;\n\n if (is_string($argument) && strpos($argument, Doppo::SERVICE_PREFIX) === 0) {\n\n $cleanArgument = preg_replace('#^' . Doppo::SERVICE_PREFIX . '{1}#', '', $argument);\n\n $argumentDefinition = $this->compileServiceArgument($cleanArgument);\n\n } elseif (is_string($argument) && strpos($argument, Doppo::PARAMETER_PREFIX) === 0) {\n\n $cleanArgument = preg_replace('#^' . Doppo::PARAMETER_PREFIX . '{1}#', '', $argument);\n\n $argumentDefinition = $this->compileParameterArgument($cleanArgument);\n } else {\n\n $argumentDefinition = $this->compileValueArgument($argument);\n }\n\n return $argumentDefinition;\n }", "public function parameter($par = null, $xss_clean = false)\n {\n $value = $this->_from_array($_POST, $par, $xss_clean);\n if(!$value) {\n return $this->_from_array($_GET, $par, $xss_clean);\n }\n return $value;\n }", "private static function tryParsePostRequestModifierParameter(string $command, ?string $argument, ?string &$parameterName = null, ?string &$parameterValue = null): void\n {\n if ($argument === null) {\n throw new ParseException('Missing argument: Missing parameter name and value for request modifier \"' . $command . '\".');\n }\n\n $argumentParts = explode('=', $argument, 2);\n\n $parameterName = trim($argumentParts[0]);\n if ($parameterName === '') {\n throw new ParseException('Missing argument: Missing parameter name for request modifier \"' . $command . '\".');\n }\n\n if (count($argumentParts) < 2) {\n throw new ParseException('Missing argument: Missing parameter value for request modifier \"' . $command . '\".');\n }\n\n $parameterValue = trim($argumentParts[1]);\n }", "function full_passed($argumento) { \n $findArg = $this->passed($argumento); \n if ($findArg) {\n if (count($this->parsed[$findArg]) > 1) {\n return $findArg; \n }\n }\n \n return 0; \n }", "public function parse(string $value);", "function parse_param_value($param_key, $data) {\n if ($this->parse_param_exists($param_key, $data)) {\n $chains = $this->parse_param_chain($param_key);\n\n switch (count($chains)) {\n case 1:\n return $data[$param_key];\n break;\n case 2:\n return\n $data\n [$chains[0]]\n [$chains[1]];\n break;\n case 3:\n return\n $data\n [$chains[0]]\n [$chains[1]]\n [$chains[2]];\n break;\n case 4:\n return\n $data\n [$chains[0]]\n [$chains[1]]\n [$chains[2]]\n [$chains[3]];\n break;\n }\n } else {\n \n }\n\n return null;\n }", "public function getArgument($path);", "public static function getParam() {\n\n\t}", "public final function parse($param_str) {\n $params = explode(\",\", $param_str);\n foreach ($params as $param_item) {\n $param_kv = explode(\"=\", $param_item);\n $param_key = trim($param_kv[0]);\n $param_value = trim($param_kv[1]);\n if ('\"' === substr($param_key, 0, 1) && '\"' === substr($param_key, -1, 1)) {\n $param_key = substr($param_key, 1, strlen($param_key) - 2);\n }\n if ('\"' === substr($param_value, 0, 1) && '\"' === substr($param_value, -1, 1)) {\n // This param_value is a string type, which could be set directly\n if (property_exists($this, $param_key)) {\n $this->$param_key = substr($param_value, 1, strlen($param_value) - 2);\n } else {\n // @TODO support special variables like from `@use`\n }\n }\n }\n }", "function param($name, $value = null)\n {\n if (func_num_args() > 1) {\n if ($this->property(\"param\") == null) $this->property(\"param\", array());\n $param = $this->property(\"param\");\n if (is_string($name) == false) throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>param($name,$value)</b>: Argument <b>$name</b> MUST BE of type String - <b style=\"color:red\">' . (is_object($name) ? get_class($name) : gettype($name)) . '</b> given!');\n // if String\n if (is_string($value)) {\n $param[$name] = $value;\n }\n // if TextField, TextArea\n elseif (($value instanceof Input) == true || ($value instanceof TextArea) == true) {\n $param[$name] = '\"+document.getElementById(\"' . $value->id() . '\").value+\"';\n }\n // else Not Supported\n else {\n throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>param($name,$value)</b>: Argument <b>$value</b> MUST BE of type String, S_TextField or S_TextArea - <b style=\"color:red\">' . (is_object($value) ? get_class($value) : gettype($value)) . '</b> given!');\n }\n $this->property(\"param\", $param);\n return $this;\n } else {\n if (is_string($name)) {\n if ($this->property(\"param\") == null) return null;\n $param = $this->property(\"param\");\n return (isset($param[$name]) == true) ? $param[$name] : null;\n } elseif (($name instanceof Input) == true || ($name instanceof TextArea) == true) {\n //s_alert($name->name());\n $param[$name->name()] = '\"+document.getElementById(\"' . $name->id() . '\").value+\"';\n $this->property(\"param\", $param);\n } else {\n throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>param($name)</b>: Argument <b>$name</b> MUST BE of type String, Input or TextArea - <b style=\"color:red\">' . (is_object($name) ? get_class($name) : gettype($name)) . '</b> given!');\n }\n return $this;\n }\n }", "protected function compileValueArgument($argumentValue)\n {\n return new ValueArgument($argumentValue);\n }", "private static function checkAssertArgument(string $command, ?string $argument, int $argumentType, ?string $argumentName = null, ?ValueParserInterface $valueParser = null, string|int|null &$argumentValue = null): void\n {\n if ($argumentType === self::ARGUMENT_TYPE_NONE) {\n if ($argument !== null) {\n throw new ParseException('Extra argument: \"' . $argument . '\". No arguments are allowed for assert \"' . $command . '\".');\n }\n\n return;\n }\n\n if ($argument === null) {\n throw new ParseException('Missing argument: Missing ' . $argumentName . ' argument for assert \"' . $command . '\".');\n }\n\n $argument = $valueParser->parseText($argument);\n $argumentValue = $argument;\n\n if ($argumentType === self::ARGUMENT_TYPE_INTEGER) {\n $argumentValue = intval($argument);\n\n if (strval($argumentValue) !== $argument) {\n throw new ParseException('Invalid argument: ' . ucfirst($argumentName) . ' \"' . $argument . '\" must be of type integer for assert \"' . $command . '\".');\n }\n }\n }", "public function parseValue($value)\n\t{\n\n\t\treturn $value;\n\n\t}", "public function getParam($param);", "private function parseRequestParameter()\n {\n \t$paramIndentifier = $this->getSettingParameter('identifier');\n \t$paramFileName = $this->getSettingParameter('fileName');\n \t$paramChunkedNumber = $this->getSettingParameter('chunkedNumber');\n \t$paramChunkedSize = $this->getSettingParameter('chunkedSize');\n \t$paramTotalFileSize = $this->getSettingParameter('totalFileSize');\n \t$paramTotalChunkOfFile = $this->getSettingParameter('numberChunkedOfFile');\n\n \t$this->indentifier = (string) $this->request->getParam($paramIndentifier);\n \t$this->fileName = (string) $this->request->getParam($paramFileName);\n \t$this->chunkedNumber = (int) $this->request->getParam($paramChunkedNumber);\n \t$this->chunkedSize = $this->request->getParam($paramChunkedSize);\n \t$this->totalFileSize = $this->request->getParam($paramTotalFileSize);\n \t$this->numberChunkedOfFile = (int) $this->request->getParam($paramTotalChunkOfFile);\n }", "protected function parseMountPointParameter() {}", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function value()\n {\n if ($args = func_get_args()) {\n $this->__value = $args[0];\n }\n return $this->__value;\n }", "public function parse($args){\n $param_double=[] ; // --param=value or --param value or --param\n $param_extra=null;\n $cont=0; \n foreach($args as $argument){\n $cont++;\n if(preg_match('/^--(\\w+)=(.*)$/', $argument, $match)){\n $parameter=$match[1];\n $value=$match[2];\n $param_double[$parameter]=$value ;\n }elseif(preg_match('/^--(\\w+)$/', $argument, $match)){\n $parameter=$match[1];\n $param_double[$parameter]=null;\n }elseif(preg_match('/^-(help|h)$/', $argument, $match)){\n //$parameter=$match[1];\n $param_extra='help';\n }elseif(preg_match('/^\\w+$/',$argument,$match) && $cont==1){\n //echo \"aca: \".print_r($match,1);\n $param_extra=$match[0] ;\n }\n }\n return [ $param_double , $param_extra ];\n }", "public function getParam($name);", "function _get_argument($name, $default = null) {\n $values = $this->_get_arguments($name);\n $len = count($values);\n if ( 0 < $len ) {\n return $values[$len - 1];\n }\n if (null == $default) {\n die(\"Missing argument $name\");\n }\n return $default;\n}", "public function testParsingSingleArgument()\n {\n $request = $this->parser->parse('foo bar');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals(['bar'], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }", "function parseMethodArg($data) {\n\t\tpreg_match('/(.*?)\\s*([^\\s\\*\\&]*)(\\s)*$/', $data, $data);\n\t\t$argType = NULL;\n\t\t$argName = NULL;\n\n\t\tif (in_array($data[2],$this->dataTypes)) {\n\t\t\t$argType = $data[0]; // Jen typ\n\t\t} else {\n\t\t\tif ((strpos($data[0], \"*\") || strpos($data[0], \"&\"))) {\n\t\t\t\tif (empty($data[2])) {\n\t\t\t\t\t$argType = $data[1]; // Typ + reference/dereference\n\n\t\t\t\t} else {\n\t\t\t\t\t$argType = $data[1];\n\t\t\t\t\t$argName = $data[2]; // Typ + promenna + */&\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!empty($data[0])) {\n\t\t\t\t$argType = $data[1]; // Typ + promenna\n\t\t\t\t$argName = $data[2];\n\t\t\t}\n\t\t}\n\n\t\t$argType = str_replace(\"*\", \" *\", $argType);\n\t\t$argType = preg_replace('/\\s+/', ' ', trim($argType));\n\t\treturn array($argType, trim($argName));\n\t}", "public function parameter(string $paramName, $paramValue);", "public function parseValue($value)\n {\n return $value;\n }", "public function getParameter();", "public function getParameter();", "public function argument(string $key) : ?string\n {\n return $this->input->getArgument($key) ;\n }", "public function resolve(...$params)\n\t{\n\t\treturn $this->value;\n\t}", "public function getArgumentUnwrapped()\n {\n return $this->readWrapperValue(\"argument\");\n }", "public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }", "public function parseValue($value, $attribute, $locale, $params, $entity)\n\t{\n\t\t// var_dump([$value, $params]);\n\t\t$inputs = $attribute->data->inputs;\n\t\t$value = $this->calculate($inputs, $locale, $params, $entity);\n\t\t$value = $this->getExpectedValue($value, $attribute);\n\t\treturn $value;\n\t}", "public function getParameter($name);", "public function getParameter($name);", "public function getParameter($name);", "function Value($a){\n return new Parser(function($s) use($a){return new Maybe(new Tuple($s, $a));});\n }", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "protected function convertArgument($argument)\n {\n if (is_string($argument)) {\n $argument = Argument::fromString($argument);\n }\n\n if (!$argument instanceof Argument) {\n throw new \\InvalidArgumentException('Invalid argument');\n }\n\n return $argument;\n }", "public function javaArgument($data = '')\n {\n if ($data == '') return $this->_javaArgument;\n $this->_javaArgument = $data;\n return $this;\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ParamName\",$param) and $param[\"ParamName\"] !== null) {\n $this->ParamName = $param[\"ParamName\"];\n }\n\n if (array_key_exists(\"ParamType\",$param) and $param[\"ParamType\"] !== null) {\n $this->ParamType = $param[\"ParamType\"];\n }\n\n if (array_key_exists(\"SupportFunc\",$param) and $param[\"SupportFunc\"] !== null) {\n $this->SupportFunc = $param[\"SupportFunc\"];\n }\n\n if (array_key_exists(\"Default\",$param) and $param[\"Default\"] !== null) {\n $this->Default = $param[\"Default\"];\n }\n\n if (array_key_exists(\"Description\",$param) and $param[\"Description\"] !== null) {\n $this->Description = $param[\"Description\"];\n }\n\n if (array_key_exists(\"CurrentValue\",$param) and $param[\"CurrentValue\"] !== null) {\n $this->CurrentValue = $param[\"CurrentValue\"];\n }\n\n if (array_key_exists(\"NeedReboot\",$param) and $param[\"NeedReboot\"] !== null) {\n $this->NeedReboot = $param[\"NeedReboot\"];\n }\n\n if (array_key_exists(\"Max\",$param) and $param[\"Max\"] !== null) {\n $this->Max = $param[\"Max\"];\n }\n\n if (array_key_exists(\"Min\",$param) and $param[\"Min\"] !== null) {\n $this->Min = $param[\"Min\"];\n }\n\n if (array_key_exists(\"EnumValue\",$param) and $param[\"EnumValue\"] !== null) {\n $this->EnumValue = $param[\"EnumValue\"];\n }\n\n if (array_key_exists(\"IsGlobal\",$param) and $param[\"IsGlobal\"] !== null) {\n $this->IsGlobal = $param[\"IsGlobal\"];\n }\n\n if (array_key_exists(\"MatchType\",$param) and $param[\"MatchType\"] !== null) {\n $this->MatchType = $param[\"MatchType\"];\n }\n\n if (array_key_exists(\"MatchValue\",$param) and $param[\"MatchValue\"] !== null) {\n $this->MatchValue = $param[\"MatchValue\"];\n }\n\n if (array_key_exists(\"IsFunc\",$param) and $param[\"IsFunc\"] !== null) {\n $this->IsFunc = $param[\"IsFunc\"];\n }\n\n if (array_key_exists(\"Func\",$param) and $param[\"Func\"] !== null) {\n $this->Func = $param[\"Func\"];\n }\n\n if (array_key_exists(\"ModifiableInfo\",$param) and $param[\"ModifiableInfo\"] !== null) {\n $this->ModifiableInfo = new ModifiableInfo();\n $this->ModifiableInfo->deserialize($param[\"ModifiableInfo\"]);\n }\n }", "public function resolve($paramValue);", "public function getParamDirect($name = \"\");", "public function testParseArgumentsCanParseRuleArguments()\n {\n $this->assertEquals(['min' => 10, 'max' => 100], $this->ruleParse->parseArguments('min=10,max=100'));\n $this->assertEquals([0 => 10, 1 => 100], $this->ruleParse->parseArguments('10,100'));\n }", "function getArgument($argumentName, $defaultArgumentValue = null, $prefixArgumentHeaderName = true, array $excludedSources = [])\n{\n $argumentValue = $defaultArgumentValue;\n\n if (in_array('headers', $excludedSources) === false) {\n // Look for argument in headers\n // Laravel auto-checks for blank or empty values and considers them equal to null\n $argumentHeaderName = $argumentName;\n if ($prefixArgumentHeaderName) {\n $argumentHeaderName = 'x-' . $argumentHeaderName;\n }\n $header = Request::header($argumentHeaderName);\n if ($header !== null) {\n $argumentValue = $header;\n }\n }\n\n if (in_array('input', $excludedSources) === false) {\n // Look for argument in form input (or JSON equivalent) or query string\n // Laravel auto-checks for blank or empty values and considers them equal to null\n if (Input::has($argumentName)) {\n $input = Input::get($argumentName);\n $argumentValue = $input;\n }\n }\n\n return $argumentValue;\n}", "public function getArg($name = '')\n {\n if (!isset($this->parsedArgs[$name])) {\n throw new \\PhpCli\\Exception(self::ERR_NO_ARG_BY_NAME);\n }\n\n return $this->parsedArgs[$name];\n }", "private function _readValue($token) {}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"Name\",$param) and $param[\"Name\"] !== null) {\n $this->Name = $param[\"Name\"];\n }\n\n if (array_key_exists(\"Type\",$param) and $param[\"Type\"] !== null) {\n $this->Type = $param[\"Type\"];\n }\n\n if (array_key_exists(\"ChoicesValue\",$param) and $param[\"ChoicesValue\"] !== null) {\n $this->ChoicesValue = $param[\"ChoicesValue\"];\n }\n\n if (array_key_exists(\"Min\",$param) and $param[\"Min\"] !== null) {\n $this->Min = $param[\"Min\"];\n }\n\n if (array_key_exists(\"Max\",$param) and $param[\"Max\"] !== null) {\n $this->Max = $param[\"Max\"];\n }\n\n if (array_key_exists(\"IsMultiple\",$param) and $param[\"IsMultiple\"] !== null) {\n $this->IsMultiple = $param[\"IsMultiple\"];\n }\n\n if (array_key_exists(\"IsAllowEmpty\",$param) and $param[\"IsAllowEmpty\"] !== null) {\n $this->IsAllowEmpty = $param[\"IsAllowEmpty\"];\n }\n\n if (array_key_exists(\"ExtraParameter\",$param) and $param[\"ExtraParameter\"] !== null) {\n $this->ExtraParameter = new RuleExtraParameter();\n $this->ExtraParameter->deserialize($param[\"ExtraParameter\"]);\n }\n }", "public function parseVal($str){\n if(method_exists($this->meta, \"sql_value\") && !is_null($str)){\n $str = $this->meta->sql_value($str);\n }\n return $str;\n }", "function var_identify($arg1){\n global $token;\n $error_val = False;\n\n get_token();\n if($token->type >= tokenType::f_gf && $token->type <= tokenType::f_tf){\n upper_scan($token->data, 0);\n $arg1->addAttribute('type', 'var');\n $arg1[0] = $token->data;\n get_token();\n if($token->type === tokenType::marker){\n $arg1[0] .= $token->data;\n get_token();\n if($token->type !== tokenType::identifier){\n if(!preg_match(\"/^[a-zA-Z_\\-\\$&%\\*!?][a-zA-Z_\\-\\$&%\\*!?0-9]*$/\", $token->data)){\n fwrite(STDERR,\"ERROR : LEX : detected lexical error in: $token->data\\n\");\n exit(23);\n }\n if(!is_keyword(tokenType::identifier)){\n $error_val = True;\n }\n }\n $arg1[0] .= $token->data;\n }\n else $error_val = True;\n }\n else $error_val = True;\n\n if($error_val){\n fwrite(STDERR, \"ERROR : SYNTAX : Variable <var> expected : last token: $token->data $token->type\\n\");\n exit(23);\n }\n }" ]
[ "0.6301748", "0.61587906", "0.614559", "0.6117186", "0.60960627", "0.6022314", "0.594936", "0.57881486", "0.5750537", "0.5749226", "0.5720557", "0.5698134", "0.56938004", "0.56660783", "0.55746335", "0.55615824", "0.55050695", "0.5498219", "0.54943395", "0.5478356", "0.5448498", "0.5437892", "0.5429028", "0.5427394", "0.5404395", "0.5363095", "0.530869", "0.52708477", "0.52681434", "0.52633196", "0.5235469", "0.5218899", "0.5208883", "0.5200342", "0.51987416", "0.51783013", "0.5175902", "0.5156083", "0.5154795", "0.5153314", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.51521605", "0.5140643", "0.51285976", "0.51146287", "0.51139355", "0.51137316", "0.5107907", "0.5106112", "0.5105455", "0.5105455", "0.5094876", "0.5094056", "0.50904465", "0.50825", "0.507874", "0.50768745", "0.50768745", "0.50768745", "0.5052874", "0.5018193", "0.5009533", "0.49958143", "0.49952158", "0.4990029", "0.49883494", "0.49787414", "0.4970382", "0.49670902", "0.49647516", "0.49621975", "0.49518397", "0.49476665" ]
0.0
-1
Validates an argument for this parameter
public function validateArgument(ExtraParameter $parameter, array $config) { // The extra arguments are untyped and optional, so they can never be invalid }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateArguments() {}", "public function cli_validateArgs() {}", "public function validateParameters(&$parameters);", "public function validate()\n\t{\n\t\tif(strlen($this->value) <= $this->argument)\n\t\t\treturn true;\n\n\t\t$this->addError('Please enter no more than ' . $this->argument . ' characters.');\n\t\treturn false;\n\t}", "private function validateInputParameters($data)\n {\n }", "public function validate()\n {\n $requiredArguments = $this->getRequiredArguments();\n \n foreach ($requiredArguments as $arg) {\n if ( ! isset($this->arguments[$arg])) {\n return false;\n }\n }\n \n return true;\n }", "public function validate($data, $param);", "protected function isValidArguments()\n {\n if (empty($this->inputFile))\n throw new MissingArgumentException(\"Input file is required.\");\n\n if (empty($this->outputFile))\n throw new MissingArgumentException(\"Output file is required.\");\n\n if (empty($this->beginTime))\n throw new MissingArgumentException(\"Begin time is required.\");\n\n if (empty($this->endTime))\n throw new MissingArgumentException(\"End time is required.\");\n\n return true;\n }", "protected function validateArguments($argData){\n foreach($argData as $argName => $argData){\n if(! $this->{$argData['function']}($argData['value']) ){\n throw new Exception(\"$argName expected a value of type {$argData['typeExpected']}\");\n }\n }\n }", "public function invalidArgument()\n {\n throw new \\InvalidArgumentException('Account has to be set an id or external identifier');\n }", "abstract public function validate();", "abstract public function validate();", "abstract protected function validateValue($value);", "public abstract function validation();", "protected function validateOrThrow() {}", "public function validate($input);", "abstract function validator();", "public function validateCallParameter() {\n if ($this->call_asset['parameter']) {\n // Validate parameters to a call.\n // Array, defining each parameter allowed in a call with the expected\n // data type of the value.\n $call_parameter = $this->call_parameter;\n // Parameters of the call request as seen in the request call.\n $call_request_parameter = $this->call_asset['parameter'];\n\n // Validate each parameter.\n foreach($call_request_parameter as $key => $value) {\n if (array_key_exists($key, $call_parameter)) {\n // Key in the request matches predefined parameter of the call.\n $is_valid = $this->matchDataType($value, $call_parameter[ $key ]);\n \n // Value should only match the enumerated value.\n if (is_array($call_parameter[ $key ])) {\n $call_parameter[ $key ] = 'one: ' . implode(',', $call_parameter[ $key ]) . ' - list';\n }\n\n if (!$is_valid) {\n // Data type mismatch.\n $response = [\n 'code' => 400, // Bad Request.\n 'message' => 'Call: Parameter ' . $key . ' expects ' . $call_parameter[ $key ] . ' type.'\n ];\n TripalWebServiceResponse::errorResponse($response);\n\n // Error will exit, but break here to be clear that loop should halt on error.\n break;\n }\n }\n else {\n // Undefined parameter to this call.\n $response = [\n 'code' => 400, // Bad Request.\n 'message' => 'Call: Parameter ' . $key . ' not expected for this call.'\n ];\n TripalWebServiceResponse::errorResponse($response);\n\n // Error will exit, but break here to be clear that loop should halt on error.\n break;\n }\n }\n }\n }", "protected function performValidation()\n {\n // no required arguments\n }", "protected function validateParameters($params) {\n return true;\n }", "function validate($validateThis) {}", "public function validateValue($value)\n {\n }", "private function validate()\n {\n if (! is_numeric($this->number)) {\n throw new \\InvalidArgumentException(\"Invalid numeric value provided ($this->number).\");\n }\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 }", "public static function validate() {}", "public function validate()\n {\n if ($this->taxableAmount === null) {\n throw new InvalidArgumentException('Missing taxable amount');\n }\n if ($this->taxAmount === null) {\n throw new InvalidArgumentException('Missing tax amount');\n }\n if ($this->taxCategory === null) {\n throw new InvalidArgumentException('Missing tax category');\n }\n }", "private function validateArgument($argument, $i)\n {\n $annotations = $this->annotations;\n if (!isset($annotations['param'][$i])) {\n throw new InvalidEventArgumentDefinitionException('Not all parameters have their own @param annotation at method ' . $this->method->getName() . '.');\n }\n $annotation = $annotations['param'][$i];\n return $this->convertToType($argument, $annotation);\n }", "abstract public function valid();", "public function validate($value);", "public function validate($value);", "function checkMandatoryArguments()\n \t{\n \t\tif($this->mStrAdGUID == \"\" || $this->mStrAdGUID == null)\n \t\t\treturn false;\n \t\telse if($this->mStrQuantity == \"\" || $this->mStrQuantity == null)\n \t\t\treturn false;\n \t\telse\n \t\t\treturn true;\n \t}", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "abstract public function checkValueType($arg_value);", "public function validate($input, $parameters);", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "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}", "protected function validateParameters()\n {\n if (empty($this->save_path)) {\n throw new \\Exception(\"The 'save_path' is not specified!\");\n }\n }", "abstract public function validate(&$params=array(), $flowId=null);", "abstract protected function validate($data);", "protected function validate()\n {\n $resolutionArguments = func_get_args();\n $inputArguments = array_get($resolutionArguments, 1, []);\n\n $argumentRules = $this->getRulesForArguments($this->args(), $inputArguments);\n $explicitRules = call_user_func_array([$this, 'rules'], $resolutionArguments);\n $argumentRules = array_merge($argumentRules, $explicitRules);\n\n foreach ($argumentRules as $key => $rules) {\n $resolvedRules[$key] = $this->resolveRules($rules, $resolutionArguments);\n }\n\n if (isset($resolvedRules)) {\n $validationErrorMessages = call_user_func_array([$this, 'validationErrorMessages'], $resolutionArguments);\n $validator = $this->getValidator($inputArguments, $resolvedRules, $validationErrorMessages);\n if ($validator->fails()) {\n throw (new ValidationError('validation'))->setValidator($validator);\n }\n }\n }", "public function Valid();", "abstract public function validateData();", "public function rules()\n {\n return [\n 'parameter' => 'required',\n ];\n }", "private function validate_input( $assoc_args, $grouping ) {\n\t\t// Check if valid arguments were passed.\n\t\t$arg_match = preg_grep( '/^set-(\\w+)/i', array_keys( $assoc_args ) );\n\n\t\t// Verify passed-arguments.\n\t\tif ( empty( $grouping ) && empty( $arg_match ) ) {\n\t\t\tWP_CLI::error( 'No valid arguments passed.' );\n\t\t}\n\n\t\t// Check whether passed arguments contain value or not.\n\t\t$assoc_arg_values = array_filter( array_intersect_key( $assoc_args, array_flip( $arg_match ) ) );\n\n\t\tif ( empty( $grouping ) && empty( $assoc_arg_values ) ) {\n\t\t\tWP_CLI::error( 'No value passed to arguments.' );\n\t\t}\n\t}", "private function validateValue($value)\n {\n if (is_null($value)) {\n throw new \\InvalidArgumentException(\"Value cannot be null\");\n }\n }", "public function validate()\n {\n if ($this->crop || $this->width || $this->height) {\n return;\n }\n\n throw new \\Exception(\n 'Slideshow expects a width or a height to be provided if crop is set to false.'\n );\n }", "public function required(): self{\n $args = func_get_args();\n foreach ($args as $arg){\n if(!array_key_exists($arg, $this->params)){\n $this->setError($arg, __FUNCTION__);\n }\n }\n return $this;\n }", "public static function validate($value);", "public function testArgumentValidateUserUid() {\n $view = Views::getView('test_view_argument_validate_user');\n $this->executeView($view);\n\n $this->assertTrue($view->argument['null']->validateArgument($this->account->id()));\n // Reset argument validation.\n $view->argument['null']->argument_validated = NULL;\n // Fail for a valid numeric, but for a user that doesn't exist\n $this->assertFalse($view->argument['null']->validateArgument(32));\n\n $form = [];\n $form_state = new FormState();\n $view->argument['null']->buildOptionsForm($form, $form_state);\n $sanitized_id = ArgumentPluginBase::encodeValidatorId('entity:user');\n $this->assertTrue($form['validate']['options'][$sanitized_id]['roles']['#states']['visible'][':input[name=\"options[validate][options][' . $sanitized_id . '][restrict_roles]\"]']['checked']);\n }", "public function validation();", "abstract public function validateData($data);", "abstract protected function validateFilterArguments($filters);", "protected function _validate() {\n\t}", "abstract function validate(): void;", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function validateRequest();", "protected function validate()\n {\n }", "public function isValidParam ($key)\n {\n if (in_array(strtoupper($key), $this->_validParamNames)) {\n return true;\n }\n return false;\n }", "public function invalidParameterTypesPassedToBindValueThrowsExceptionDataProvider() {}", "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 validate()\n {\n $this->validateRequiredParameters();\n\n if (!is_string($this->getType())) {\n throw new InvalidDocumentException(\"The type parameter must be a string\");\n }\n }", "protected function validateParams() {\r\n $user = $this->user;\r\n $userId = $this->userId;\r\n if ($user === NULL) {\r\n $lang = $this->getLanguage();\r\n $this->addErrorMessage($lang->getMessage('error.userNotFound', htmlspecialchars($userId)));\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "private function setArguments()\n {\n if (count($this->args) > 0) {\n foreach ($this->args as $arg) {\n return match($arg[1]) { /* match based on the argument type */\n 'required' => $this->addArgument($arg[0], InputArgument::REQUIRED, $arg[2]),\n 'optional' => $this->addArgument($arg[0], InputArgument::OPTIONAL, $arg[2]),\n 'array' => $this->addArgument($arg[0], InputArgument::IS_ARRAY, $arg[2]),\n default => throw new BaseInvalidArgumentException('Invalid input argument passed')\n };\n }\n }\n return false;\n }", "abstract function validate(mixed $value) : bool;", "public function verify($param)\n {\n }", "abstract protected function validate(): bool;", "public function validateParameter($fieldName, $value, $dataType, $required = true)\n {\n //if data is required throws exception\n if ($required == true and empty($value) == true) {\n $this->throwException(VALIDATE_PARAMETER_REQUIRED, $fieldName . \" parameter is required\");\n }\n\n switch ($dataType) {\n case PASSWORD:\n // min lenght is defined in settings.php\n if ( strlen($value) < PASSWORD_MIN_LENGTH ) {\n $this->throwException(PASSWORD_NOT_COMPLEX_ENOUGH, \"Password too short!\");\n }\n if ( !preg_match(\"#[0-9]+#\", $value) ) {\n $this->throwException(PASSWORD_NOT_COMPLEX_ENOUGH, \"Password not meeting complexity requirements!\");\n }\n if ( !preg_match(\"#[a-z]+#\", $value) ) {\n $this->throwException(PASSWORD_NOT_COMPLEX_ENOUGH, \"Password not meeting complexity requirements!\");\n }\n if ( !preg_match(\"#[A-Z]+#\", $value) ) {\n $this->throwException(PASSWORD_NOT_COMPLEX_ENOUGH, \"Password not meeting complexity requirements!\");\n }\n if ( !preg_match(\"#\\W+#\", $value) ) {\n $this->throwException(PASSWORD_NOT_COMPLEX_ENOUGH, \"Password not meeting complexity requirements!\");\n }\n break;\n case EMAIL:\n if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $this->throwException(VALIDATE_PARAMETER_EMAIL, \"Invalid email format for \" . $fieldName . \"\");\n }\n break;\n case EMAIL_DB:\n if ($this->user->checkEmail($value)) {\n $this->throwException(VALIDATE_PARAMETER_EMAIL, \"Email is already in use\");\n }\n break;\n case BOOLEAN:\n if (is_bool($value)) {\n $this->throwException(VALIDATE_PARAMETER_REQUIRED, \"Datatype is not valid for \" . $fieldName . \". It should be boolean.\");\n }\n break;\n case INTEGER:\n if (!is_numeric($value)) {\n $this->throwException(VALIDATE_PARAMETER_REQUIRED, \"Datatype is not valid for \" . $fieldName . \". It should be numeric.\");\n }\n break;\n case STRING:\n if (!is_string($value)) {\n $this->throwException(VALIDATE_PARAMETER_REQUIRED, \"Datatype is not valid for \" . $fieldName . \". It should be string.\");\n }\n break;\n default:\n $this->throwException(VALIDATE_PARAMETER_REQUIRED, \"Datatype is not valid for \" . $fieldName);\n break;\n }\n\n return $value;\n }", "public function validation()\n {\n $this->assertFalse($this->denyValidator->validate(123));\n $this->assertFalse($this->denyValidator->validate('1234'));\n $this->assertFalse($this->denyValidator->validate(true));\n $this->assertFalse($this->denyValidator->validate(null));\n $this->assertFalse($this->denyValidator->validate(new stdClass()));\n }", "public function validate()\n {\n }", "public function validate()\n {\n }", "function validate($data) {\n if (is_string($this->paramtype)) {\n if (preg_match($this->paramtype, $data)) {\n return true;\n } else {\n return get_string('validateerror', 'admin');\n }\n\n } else if ($this->paramtype === PARAM_RAW) {\n return true;\n\n } else {\n $cleaned = stripslashes(clean_param(addslashes($data), $this->paramtype));\n if (\"$data\" == \"$cleaned\") { // implicit conversion to string is needed to do exact comparison\n return true;\n } else {\n return get_string('validateerror', 'admin');\n }\n }\n }", "public function validate()\n {\n $this->httpRequest->request;\n foreach (func_get_args() as $key) {\n $value = $this->parameters->get($key);\n if (! isset($value)) {\n throw new InvalidRequestException(\"The $key parameter is required\");\n }\n }\n }", "public function is_valid()\n {\n }", "public function is_valid()\n {\n }", "public function hasValidNameArgument()\n {\n $name = $this->argument('name');\n\n if (! Str::contains($name, '/')) {\n $this->error(\"The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.\");\n\n return false;\n }\n\n return true;\n }", "public function valid(){ }", "public function hasArgument($name);", "public function hasArgument($name);", "public function validate(...$args)\n {\n $isValid = true;\n $invalids = [];\n\n $argExists = function($arg){\n return !is_null($this->parameters->get($arg));\n };\n\n $methodExists = function($arg){\n $exists = method_exists($this, $method = 'get'.ucfirst($arg));\n $hasValue = $exists && !is_null($this->$method());\n\n return $hasValue;\n };\n\n foreach ($args as $arg) {\n\n if( !$argExists($arg) || $methodExists($arg) ){\n $isValid = false;\n $invalids[] = $arg;\n }\n }\n\n if( !$isValid ) {\n $plural = count($invalids) > 1;\n throw new InvalidRequestException(sprintf('Parameter%s %s %s required',\n $plural ? 's' : '',\n implode(', ', $invalids),\n $plural ? 'are' : 'is')\n );\n }\n\n return true;\n }", "public function validateArgs(...$args) {\n\t\tif (!in_array($args[0], $this->models)) {\n\t\t\techo \"\\nError: Invalid Pay Model! Should be one of the '\" . implode(\"','\", $this->models) . \"' \\n\\n\";\n\t\t\texit;\n\t\t}\n\n\t\t$d = $this->convertDate($args[1], 'Y-m-d');\n\t\tif (!($d == $args[1])) {\n\t\t\techo \"\\nError: Invalid date !\\n\\n\";\n\t\t\texit;\n\t\t}\n\n\t\tif (!is_numeric($args[2]) || (int) $args[2] < 0) {\n\t\t\techo \"\\nError: Invalid count !\\n\\n\";\n\t\t\texit;\n\t\t}\n\t}", "public function validate(array $data = array())\n{ \n\n // Additional validation checks\n\n}" ]
[ "0.80795807", "0.7305308", "0.7007295", "0.69318384", "0.6798065", "0.67289656", "0.66621035", "0.656703", "0.65183586", "0.6517524", "0.64429903", "0.64429903", "0.64022076", "0.6365602", "0.63142824", "0.63104916", "0.63006973", "0.6253156", "0.62403464", "0.6235457", "0.6230539", "0.6222942", "0.6199611", "0.6184677", "0.6184677", "0.61618406", "0.6137338", "0.6131297", "0.6123018", "0.61208326", "0.61208326", "0.6119374", "0.61130095", "0.61049914", "0.610374", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.610259", "0.6101041", "0.6073665", "0.60705864", "0.6068319", "0.60572666", "0.602712", "0.5997346", "0.59880775", "0.5987968", "0.5979882", "0.5969935", "0.59516996", "0.5935793", "0.5935617", "0.59318876", "0.5931777", "0.5928742", "0.5928478", "0.59204954", "0.5913482", "0.5913482", "0.5913482", "0.5913482", "0.5913482", "0.5913482", "0.5913482", "0.5913482", "0.5910656", "0.59097546", "0.5907352", "0.5907066", "0.59068626", "0.58983487", "0.5890377", "0.5889847", "0.588949", "0.5887733", "0.58866423", "0.58792704", "0.5875657", "0.5873856", "0.5873856", "0.58627754", "0.58597755", "0.5855209", "0.5855018", "0.58361596", "0.58293587", "0.5820085", "0.5820085", "0.58193606", "0.58108443", "0.58039665" ]
0.69191647
4
For old style coders
function tnp_register_block($dir) { return TNP_Composer::register_block($dir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "public function helper()\n\t{\n\t\n\t}", "private function j() {\n }", "function fix() ;", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "final private function __construct() {}", "final private function __construct() {}", "abstract protected function mini(): string;", "private function __() {\n }", "private final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }", "public function nadar()\n {\n }", "public static function Parse837()\n\t{\n\n\t}", "protected function _getNextCode() {}", "private function __construct()\t{}", "public function custom()\n\t{\n\t}", "public function _strings_for_pot()\n {\n }", "public function getBobotNilai();", "public function aaa() {\n\t}", "final private function __construct(){\r\r\n\t}", "public function fix() {}", "public function fix() {}", "protected function __init__() { }", "protected final function __construct() {}", "function wp_iso_descrambler($subject)\n {\n }", "public function ex4()\n {\n }", "public function veriCode() {}", "public function oops () {\n }", "public function AggiornaPrezzi(){\n\t}", "protected function fixSelf() {}", "protected function fixSelf() {}", "final function getCode();", "public function boleta()\n\t{\n\t\t//\n\t}", "private function __construct () {}", "public function alterMeToo()\n {\n return \"fantabulous\";\n }", "function yy_r83(){return; }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function aFunc()\n {\n }", "function initialBasicFixes()\r\n{\r\n /**\r\n * bypass date & timezone-related warnings with php 5.1\r\n */\r\n if (function_exists('date_default_timezone_set')) {\r\n $tz= @date_default_timezone_get();\r\n date_default_timezone_set($tz);\r\n }\r\n\r\n ini_set('zend.ze1_compatibility_mode', 0);\r\n ini_set(\"pcre.backtrack_limit\", -1); # fix 5.2.0 prce bug with render_wiki\r\n if(function_exists('mb_internal_encoding')) {\r\n mb_internal_encoding(\"UTF-8\");\r\n }\r\n #ini_set(\"mbstring.func_overload\", 2);\r\n\r\n /**\r\n * add rough php-version check to at least avoid parsing errors.\r\n * fine version-check follows further down\r\n */\r\n if(phpversion() < \"5.0.0\") {\r\n echo \"Sorry, but Streber requires php5 or higher.\";\r\n exit();\r\n }\r\n}", "private function __construct() {}", "private function __construct() {}", "function init_code(&$code)\n\n{\n\n $code .= \"\\n\";\n\n \n\n // code not allowed to contain our special characters\n\n return ($code = strtr($code, array(\"\\x00\" => '', \"\\x01\" => '')));\n\n}" ]
[ "0.60211337", "0.57148826", "0.5556933", "0.55100113", "0.550473", "0.54043543", "0.54043543", "0.5394324", "0.5340534", "0.53277814", "0.5319343", "0.5319343", "0.5319343", "0.5295705", "0.5277329", "0.5277011", "0.52709806", "0.52470094", "0.5234191", "0.5231016", "0.5222721", "0.5205185", "0.51989496", "0.51681983", "0.51674736", "0.5157113", "0.5156803", "0.5152287", "0.51429546", "0.5131621", "0.5110798", "0.51083285", "0.5101971", "0.5101971", "0.51007617", "0.50976413", "0.50966", "0.5085361", "0.5080648", "0.5075819", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5074463", "0.5072066", "0.5071799", "0.50716466", "0.50716466", "0.50589097" ]
0.0
-1
Generates and HTML button for email using the values found on $options and prefixed by $prefix, with the standard syntax of NewsletterFields::button().
function tnpc_button($options, $prefix = 'button') { return TNP_Composer::button($options, $prefix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function button(array $options = []) : string;", "protected function _toHtml()\n {\n \tif (!$this->getTemplate() || $this->getTemplate() == 'newsletter/subscribe.phtml') {\n\t\t\t$this->setTemplate('martinnguyen/newsletterpopup/button.phtml');\n }\n\t\t\n return parent::_toHtml();\n }", "function it_exchange_authorizenet_addon_make_payment_button( $options ) {\n\t// Make sure we have items in the cart\n\tif ( 0 >= it_exchange_get_cart_total( false ) ) {\n\t\treturn;\n\t}\n\t// Use the ITExchange Purchase Dialog for CC fields\n\tif ( function_exists( 'it_exchange_generate_purchase_dialog' ) ) {\n\n\t\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t\treturn it_exchange_generate_purchase_dialog( 'authorizenet', array(\n\t\t\t'purchase-label' => $settings['authorizenet-purchase-button-label']\n\t\t) );\n\t}\n}", "function the_wpc_button( $args ) {\n\n if ( empty( $args['data'] ) || ( 'link' === $args['data']['link_type'] && empty( $args['data'][ $args['data']['link_type'] . '_link' ] ) ) ) {\n return;\n }\n\n $defaults = array(\n 'data' => null,\n 'classes' => [ 'btn' ]\n );\n\n $args = wp_parse_args( $args, $defaults );\n\n $href = get_the_wpc_button_link( $args['data'] );\n $label = get_the_wpc_button_label( $args['data'] );\n $classes = get_the_wpc_button_classes( $args['data'], $args['classes'] );\n $target = get_the_wpc_button_target( $args['data'] );\n ?>\n\n <a class=\"<?= implode( ' ', $classes ); ?>\"\n href=\"<?= $href; ?>\"\n title=\"<?= $label; ?>\"\n <?php if ( 'file' === $args['data']['link_type'] ) : ?>download<?php endif; ?>\n <?php if ( '_blank' === $target ) : ?>target=\"_blank\" rel=\"nofollow\"<?php endif; ?>>\n\n <?php if ( ! empty( $args['data']['icon'] ) ) : ?>\n <i class=\"<?= $args['data']['icon']; ?> mr-1\"></i>\n <?php endif; ?>\n\n <?= $label; ?>\n </a>\n <?php\n}", "function lbcb_print_option_buttons(){\n?>\n\t<input class=\"button-primary\" type=\"submit\" name=\"lbcb_options[save]\" id=\"lbcb_options[save]\" value=\"<?php _e( 'Save Options', 'lbcb_textdomain' ); ?>\"/>\n\t<input class=\"button-secondary\" type=\"submit\" name=\"lbcb_options[reset]\" id=\"lbcb_options[reset]\" value=\"<?php _e( 'Reset To Defaults', 'lbcb_textdomain' ); ?>\"/>\n\n<?php\n}", "protected function _addButtons()\r\n\t{\r\n\t\t$model = $this->getModel();\r\n\t\t$params\t= $model->getParams();\r\n\t\t$this->showEmail = $params->get('email', 0);\r\n\t\t$this->emailLink = '';\r\n\t\t$this->printLink = '';\r\n\t\t$this->pdfLink = '';\r\n\t\t$this->showPrint = $params->get('print', 0);\r\n\r\n\t\tif ($this->showPrint) {\r\n\t\t\t$text = JHTML::_('image.site', 'printButton.png', '/images/', NULL, NULL, JText::_('Print'));\r\n\t\t\t$this->printLink = '<a href=\"#\" onclick=\"window.print();return false;\">'.$text.'</a>';\r\n\t\t}\r\n\r\n\t\tif (JRequest::getVar('tmpl') != 'component') {\r\n\t\t\tif ($this->showEmail) {\r\n\t\t\t\t$this->emailLink = FabrikHelperHTML::emailIcon($model, $params);\r\n\t\t\t}\r\n\r\n\t\t\tif ($this->showPrint) {\r\n\t\t\t\t$this->printLink = FabrikHelperHTML::printIcon($model, $params, $model->_rowId);\r\n\t\t\t}\r\n\r\n\t\t\t$this->showPDF = $params->get('pdf', 0);\r\n\t\t\tif ($this->showPDF) {\r\n\t\t\t\t$this->pdfLink = FabrikHelperHTML::pdfIcon($model, $params, $model->_rowId);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$this->showPDF = false;\r\n\t\t}\r\n\t}", "public function getButtonHtml()\n {\n $button = $this->getLayout()->createBlock(Button::class);\n $button->setData('id', $this->getButtonId())\n ->setData('label', __('Verify keys and connect webhooks'));\n\n return $button->toHtml();\n }", "public function form()\n\t{\n\t\tglobal $L;\n\t\t$sentEmails = $this->getSentEmailsArray();\n\n\t\t$html = '<div class=\"alert alert-primary\" role=\"alert\">';\n\t\t$html .= $this->description();\n\t\t$html .= '</div>';\n\n\t\t$html .= '<div>';\n\t\t// API key\n\t\t$html .= '<label><strong>Buttondown API Key</strong></label>';\n\t\t$html .= '<input id=\"apiKey\" name=\"apiKey\" type=\"text\" value=\"'.$this->getValue('apiKey').'\">';\n\t\t$html .= '<span class=\"tip\">Copy your API key on https://buttondown.email/settings/programming </span>';\n\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('paused').'</label>';\n\t\t$html .= '<select id=\"paused\" name=\"paused\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('paused')===true?'selected':'').'>'.$L->get('is-paused').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('paused')===false?'selected':'').'>'.$L->get('is-active').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('paused-tip').'</span>';\n\n\t\t// Start date\n\t\t$html .= '<label>'.$L->get('send-after').'</label>';\n\t\t$html .= '<input id=\"startDate\" name=\"startDate\" type=\"text\" value=\"'.$this->getValue('startDate').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('send-after-tip').'</span>';\n\t\t// Subject Prefix\n\t\t$html .= '<label>'.$L->get('subject-prefix').'</label>';\n\t\t$html .= '<input id=\"subjectPrefix\" name=\"subjectPrefix\" type=\"text\" value=\"'.$this->getValue('subjectPrefix').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('subject-prefix-tip').'</span>';\n\t\t\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('include-cover').'</label>';\n\t\t$html .= '<select id=\"includeCover\" name=\"includeCover\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('includeCover')===true?'selected':'').'>'.$L->get('yes').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('includeCover')===false?'selected':'').'>'.$L->get('no').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('include-cover-tip').'</span>';\n\t\t$html .= '</div><hr>';\n\t\t// List of page keys for which mail was sent \n\t\t$html .= '<h4>'.$L->get('sent-list').'</h4>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('sent-list-tip').'</span>';\n\t\t$html .= '<div style=\"overflow-y: scroll; height:400px;\"><ul>';\n\t\tforeach ($sentEmails as $sentKey):\n\t\t\t$html .= '<li>'.$sentKey.'</li>';\n\t\tendforeach;\n\t\t$html .= '</ul></div>';\n\t\t$html .= '<div><a target=\"_blank\" rel=\"noopener\" href=\"https://buttondown.email/archive\">Buttondown Archive</a></div>';\n\t\treturn $html;\n\t}", "public function generate_buttons_HTML( ) {\n\t\t$follow_count_HTML = $this->get_count_html( $shape );\n\t\treturn\n<<<BUTTON\n<a target=\"_blank\" href=\"{$this->href}\">\n\t<div class=\"swfw-follow-button swfw_buttons_button swp-$this->key\">\n\t\t<div class='swfw-network-icon'>\n\t\t\t{$this->icon}\n\t\t</div>\n\n\t\t<div class=\"swfw-text\">\n\t\t\t<span class='swfw-cta'>$this->cta</span>\n\t\t\t{$follow_count_HTML}\n\t\t</div>\n\t</div>\n</a>\nBUTTON;\n\t}", "function backend_button($caption, $attributes = array(), $ajaxHandler=null, $ajaxParams = null, $formElement = null)\n\t{\n\t\treturn Backend_Html::button($caption, $attributes, $ajaxHandler, $ajaxParams, $formElement);\n\t}", "protected function generateButtons() {}", "function netfunktheme_contact_button_shortcode( $atts ){\n\t\n\textract( shortcode_atts( array(\n\t\t'text' => '',\n\t), $atts ) );\n\t\n\t$lb_contact_btn = '';\n\t\n\tif (!empty($atts['text'])) {\n\n\t\tif (get_page_by_title('Contact Us') || get_page_by_title('Contact') || get_page_by_title('contact')){ \n\t\t\t\t\t\n\t\t\t$lb_contact_btn = '<a href=\"' . home_url() . '/contact/\" class=\"button small radius\">';\n\t\t\t\n\t\t\t$lb_contact_btn .= $atts['text']; \n\t\t\t\n\t\t\t$lb_contact_btn .= '</a>';\n\t\t\n\t\t}\n\t\n\t}\n\t\n\treturn $lb_contact_btn;\n\t\n}", "function give_display_checkout_button( $form_id, $args ) {\n\n\t$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )\n\t\t? $args['display_style']\n\t\t: give_get_meta( $form_id, '_give_payment_display', true );\n\n\tif ( 'button' === $display_option ) {\n\t\tadd_action( 'give_post_form', 'give_add_button_open_form', 10, 2 );\n\t\treturn '';\n\t}\n\n\tif ( $display_option === 'onpage' ) {\n\t\treturn '';\n\t}\n\n\t$display_label_field = give_get_meta( $form_id, '_give_reveal_label', true );\n\t$display_label = ! empty( $args['continue_button_title'] ) ? $args['continue_button_title'] : ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );\n\n\t$output = '<button type=\"button\" class=\"give-btn give-btn-' . $display_option . '\">' . $display_label . '</button>';\n\n\t/**\n\t * filter the button html\n\t *\n\t * @param string $output Button HTML.\n\t * @param int $form_id Form ID.\n\t * @param array $args Shortcode argument\n\t */\n\techo apply_filters( 'give_display_checkout_button', $output, $form_id, $args );\n}", "function rt_ui_button($label, $target, $icon, $options = array())\n{\n $options['class'] = 'new ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary';\n $content = sprintf('<span class=\"ui-button-icon-primary ui-icon ui-icon-%s\"></span><span class=\"ui-button-text\">%s</span>', $icon, $label);\n return link_to($content, $target, $options);\n}", "function messaging_button( $args ) {\n\t\t$global_hide_pm_button = ! empty( $args['hide_pm_button'] ) ? $args['hide_pm_button'] : ! UM()->options()->get( 'show_pm_button' );\n\n\t\tif ( empty( $global_hide_pm_button ) ) { ?>\n\n\t\t\t<# if ( user.my_messages != '' ) { #>\n\t\t\t\t<div class=\"um-members-messaging-btn um-members-list-footer-button-wrapper\">\n\t\t\t\t\t<a href=\"{{{user.my_messages}}}\" class=\"um-message-abtn um-button\">\n\t\t\t\t\t\t<span><?php _e( 'My messages', 'um-messaging' ) ?></span>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t<# } else if ( user.message_button != '' ) { #>\n\t\t\t\t{{{user.message_button}}}\n\t\t\t<# } #>\n\n\t\t<?php }\n\t}", "function shortcode_insert_button()\n {\n $this->config['self_closing'] = 'yes';\n\n $this->config['name'] = __('Download Button', 'avia_framework');\n $this->config['tab'] = __('Content Elements', 'avia_framework');\n $this->config['icon'] = AviaBuilder::$path['imagesURL'] . \"sc-button.png\";\n $this->config['order'] = 1;\n $this->config['target'] = 'avia-target-insert';\n $this->config['shortcode'] = 'avia_download_button';\n $this->config['tooltip'] = __('Creates a download button', 'avia_framework');\n $this->config['tinyMCE'] = ['tiny_always' => true];\n $this->config['preview'] = true;\n }", "public function getPurchasedButton($options = [])\n {\n return a(t('Start lesson'), ['/profile/start', 'id' => $this->id], $options);\n }", "public function button($atts)\n {\n // attritbute setup\n $atts = shortcode_atts(array(\n 'label' => 'geef een label op!',\n 'link' => '#',\n 'target' => '_self',\n 'class' => '',\n ), $atts);\n $atts['link'] = str_replace('http://', '//', $atts['link']);\n $atts['link'] = str_replace('https://', '//', $atts['link']);\n\n return '<a class=\"btn btn-cta '.$atts['class'].'\" href=\"'.$atts['link'].'\" target=\"'.$atts['target'].'\">'.$atts['label'].'</a>';\n }", "function shortcode_insert_button()\n\t\t\t{\n\t\t\t\t$this->config['self_closing']\t=\t'no';\n\t\t\t\t\n\t\t\t\t$this->config['name']\t\t= __('Notification', 'avia_framework' );\n\t\t\t\t$this->config['tab']\t\t= __('Content Elements', 'avia_framework' );\n\t\t\t\t$this->config['icon']\t\t= AviaBuilder::$path['imagesURL'].\"sc-notification.png\";\n\t\t\t\t$this->config['order']\t\t= 80;\n\t\t\t\t$this->config['target']\t\t= 'avia-target-insert';\n\t\t\t\t$this->config['shortcode'] \t= 'av_notification';\n\t\t\t\t$this->config['tooltip'] \t= __('Creates a notification box to inform visitors', 'avia_framework' );\n\t\t\t\t$this->config['tinyMCE'] = array('tiny_always'=>true);\t\n\t\t\t\t$this->config['preview'] \t= true;\n\t\t\t}", "public function showButtonCustomizationPage($html='',$show_header=TRUE,$show_footer=TRUE) {\n\n\t\techo $this->getButtonCustomizationPage($html,$show_header,$show_footer);\n\t}", "public function init(){\n\t\t\n\t\tparent::init();\n\t\t\n\t\t$this->_html .= $this->get_label();\n\t\t\n\t\t$this->_html .= '<input type=\"submit\" ';\n\t\t\n\t\tif(isset($this->_options['id'])){\n\t\t\t$this->_html .= 'id=\"'.$this->_options['id'].'\" ';\n\t\t}\n\t\t\n\t\tif(isset($this->_options['class'])){\n\t\t\t$this->_html .= 'class=\"'.$this->_options['class'].'\" ';\n\t\t}\n\t\t\n\t\tif(isset($this->_options['value'])){\n\t\t\t$this->_html .= 'value=\"'.$this->_options['value'].'\" ';\n\t\t}\t\n\t\t\n\t\tif(isset($this->_options['name'])){\n\t\t\t$this->_html .= 'name=\"'.esc_attr($this->_options['name']).'\" ';\n\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t$this->_html .= ' />';\n\t}", "protected function generateButtons()\n {\n $arrButtons = array();\n\n // Add \"update cart\" button\n $arrButtons['update'] = array(\n 'type' => 'submit',\n 'name' => 'button_update',\n 'label' => $GLOBALS['TL_LANG']['MSC']['updateCartBT'],\n );\n\n // Add button to cart button (usually if not on the cart page)\n if ($this->iso_cart_jumpTo > 0) {\n $objJumpToCart = \\PageModel::findByPk($this->iso_cart_jumpTo);\n\n if (null !== $objJumpToCart) {\n $arrButtons['cart'] = array(\n 'type' => 'submit',\n 'name' => 'button_cart',\n 'label' => $GLOBALS['TL_LANG']['MSC']['cartBT'],\n 'href' => \\Controller::generateFrontendUrl($objJumpToCart->row()),\n );\n\n if (\\Input::post('FORM_SUBMIT') == $this->strFormId && \\Input::post('button_cart') != '') {\n $this->jumpToOrReload($this->iso_cart_jumpTo);\n }\n }\n }\n\n // Add button to checkout page\n if ($this->iso_checkout_jumpTo > 0 && !Isotope::getCart()->hasErrors()) {\n $objJumpToCheckout = \\PageModel::findByPk($this->iso_checkout_jumpTo);\n\n if (null !== $objJumpToCheckout) {\n $arrButtons['checkout'] = array(\n 'type' => 'submit',\n 'name' => 'button_checkout',\n 'label' => $GLOBALS['TL_LANG']['MSC']['checkoutBT'],\n 'href' => \\Controller::generateFrontendUrl($objJumpToCheckout->row()),\n );\n\n if (\\Input::post('FORM_SUBMIT') == $this->strFormId && \\Input::post('button_checkout') != '') {\n $this->jumpToOrReload($this->iso_checkout_jumpTo);\n }\n }\n }\n\n if ($this->iso_continueShopping && $this->Input->get('continue') != '') {\n $arrButtons['continue'] = array(\n 'type' => 'submit',\n 'name' => 'button_continue',\n 'label' => $GLOBALS['TL_LANG']['MSC']['continueShoppingBT'],\n 'href' => ampersand(base64_decode($this->Input->get('continue', true))),\n );\n\n if (\\Input::post('FORM_SUBMIT') == $this->strFormId && \\Input::post('button_continue') != '') {\n \\Controller::redirect($arrButtons['continue']['href']);\n }\n }\n\n return $arrButtons;\n }", "public function modalButton() {\n\n $postID = $this->postID;\n\n $button = false;\n\n\n if ( get_field( 'jumbotron_show_button', $postID ) === false ) {\n return $button;\n }\n\n $button_text = get_field( 'jumbotron_button_text', $postID );\n $target = get_field( 'jumbotron_link_target', $postID );\n\n if ( get_field( 'jumbotron_link_type', $postID ) === 'internal' ) {\n $link = get_field( 'jumbotron_internal_link', $postID );\n } else {\n $link = get_field( 'jumbotron_custom_link', $postID );\n }\n\n $button = sprintf( '<a href=\"%1$s\" class=\"btn btn-primary btn-lg\" target=\"%2$s\">%3$s</a>', $link, $target, $button_text );\n\n return $button;\n\n }", "public function fields( $prefix = null, $fields = null, $repeat = null ) {\n\t\t$_prefix = \"{$this->_option}_{$this->_clean_id}\";\n\t\t$has_edd = class_exists( 'Easy_Digital_Downloads' ) ? true : false;\n\t\t$has_woo = class_exists( 'WooCommerce' ) ? true : false;\n\t\t$has_popups = class_exists( 'md_popups' ) ? true : false;\n\t\t$repeat = isset( $repeat ) ? $repeat : '';\n\n\t\t$button_text = isset( $fields['button_text'] ) ? $fields['button_text'] : 'button_text';\n\t\t$button_link = isset( $fields['button_link'] ) ? $fields['button_link'] : 'button_link';\n\t?>\n\n\t\t<table class=\"form-table\">\n\t\t\t<tbody>\n\n\t\t\t\t<?php if ( $has_edd || $has_woo || $has_popups ) :\n\t\t\t\t\t$button_action = $this->fields->module( \"{$prefix}button_action\" );\n\t\t\t\t\t$actions = array_merge( array(\n\t\t\t\t\t\t'' => __( 'Select button action&hellip;', 'md' ),\n\t\t\t\t\t\t'link' => __( 'Custom link', 'md' ),\n\t\t\t\t\t), apply_filters( 'md_button_actions', array() ) );\n\t\t\t\t\tif ( $has_edd )\n\t\t\t\t\t\t$actions['edd_button'] = __( 'EDD Buy Now', 'md' );\n\t\t\t\t\tif ( $has_woo )\n\t\t\t\t\t\t$actions['woo_button'] = __( 'WooCommerce Buy Now', 'md' );\n\t\t\t\t\tif ( $has_popups )\n\t\t\t\t\t\t$actions['popup'] = __( 'MD Popup', 'md' );\n\t\t\t\t?>\n\n\t\t\t\t\t<!-- Button Action -->\n\n\t\t\t\t\t<tr>\n\n\t\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t\t<?php $this->label( \"{$prefix}button_action\", __( 'Button Action', 'md' ) ); ?>\n\t\t\t\t\t\t</th>\n\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php $this->field( 'select', \"{$prefix}button_action\", $actions, $repeat ); ?>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t</tr>\n\n\t\t\t\t<?php endif;\n\t\t\t\t\t$style = $has_edd || $has_popups ? 'style=\"display: ' . ( $button_action == 'link' ? 'table-row' : 'none' ) . ';\"' : '';\n\t\t\t\t?>\n\n\t\t\t\t<!-- Button Link -->\n\n\t\t\t\t<tr id=\"<?php echo \"{$_prefix}_{$prefix}button_link_row\"; ?>\"<?php echo $style; ?>>\n\n\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t<?php $this->label( \"{$prefix}$button_link\", __( 'Button Link', 'md' ) ); ?>\n\t\t\t\t\t</th>\n\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php $this->field( 'url', \"{$prefix}$button_link\", null, $repeat ); ?>\n\t\t\t\t\t</td>\n\n\t\t\t\t</tr>\n\n\t\t\t\t<?php if ( $has_edd ) :\n\t\t\t\t\t$edd_posts = $this->get_posts( 'Easy_Digital_Downloads', 'download', true );\n\t\t\t\t?>\n\n\t\t\t\t\t<!-- EDD -->\n\n\t\t\t\t\t<tr id=\"<?php echo \"{$_prefix}_{$prefix}edd_button_row\"; ?>\" style=\"display: <?php echo $button_action == 'edd_button' ? 'table-row' : 'none'; ?>\">\n\n\t\t\t\t\t\t<th scope=\"row\"><?php $this->label( \"{$prefix}edd_button\", __( 'EDD Buy Now Button', 'md' ) ); ?></th>\n\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php $this->field( 'select', \"{$prefix}edd_button\", $edd_posts, $repeat ); ?>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t</tr>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php if ( $has_woo ) :\n\t\t\t\t\t$woo_posts = $this->get_posts( 'WooCommerce', 'product', true );\n\t\t\t\t?>\n\n\t\t\t\t\t<!-- WooCommerce -->\n\n\t\t\t\t\t<tr id=\"<?php echo \"{$_prefix}_{$prefix}woo_button_row\"; ?>\" style=\"display: <?php echo $button_action == 'woo_button' ? 'table-row' : 'none'; ?>\">\n\n\t\t\t\t\t\t<th scope=\"row\"><?php $this->label( \"{$prefix}woo_button\", __( 'WooCommerce Buy Now Button', 'md' ) ); ?></th>\n\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php $this->field( 'select', \"{$prefix}woo_button\", $woo_posts, $repeat ); ?>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t</tr>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<?php if ( $has_popups ) :\n\t\t\t\t\t$md_popups = get_md( 'popups' );\n\t\t\t\t\t$popups = array();\n\t\t\t\t\tif ( ! empty( $md_popups['popups'] ) )\n\t\t\t\t\t\tforeach ( $md_popups['popups'] as $popup => $fields )\n\t\t\t\t\t\t\t$popups[$popup] = $fields['name'];\n\t\t\t\t\t$popups = array_merge( array( '' => __( 'Select a popup&hellip;', 'md' ) ), $popups );\n\t\t\t\t?>\n\n\t\t\t\t\t<!-- MD Popups -->\n\n\t\t\t\t\t<tr id=\"<?php echo \"{$_prefix}_{$prefix}button_popup_row\"; ?>\" style=\"display: <?php echo $button_action == 'popup' ? 'table-row' : 'none'; ?>\">\n\n\t\t\t\t\t\t<th scope=\"row\"><?php $this->label( \"{$prefix}button_popup\", __( 'MD Popup', 'md' ) ); ?></th>\n\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<?php if ( ! empty( $md_popups['popups'] ) ) : ?>\n\t\t\t\t\t\t\t\t<?php $this->field( 'select', \"{$prefix}button_popup\", $popups, $repeat ); ?>\n\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t<?php md_popup_connect_notice(); ?>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</td>\n\n\t\t\t\t\t</tr>\n\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\t<!-- Button Text -->\n\n\t\t\t\t<tr id=\"<?php echo \"{$_prefix}_{$prefix}button_text_row\"; ?>\">\n\t\t\t\t\t<th scope=\"row\">\n\t\t\t\t\t\t<?php $this->label( \"{$prefix}$button_text\", __( 'Button Text', 'md' ) ); ?>\n\t\t\t\t\t</th>\n\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<?php $this->field( 'text', \"{$prefix}$button_text\", null, $repeat ); ?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t</tbody>\n\t\t</table>\n\n\t\t<?php if ( $has_edd || $has_popups ) : ?>\n\n\t\t\t<script>\n\t\t\t\t( function() {\n\t\t\t\t\tdocument.getElementById( '<?php echo \"{$_prefix}_{$prefix}\"; ?>button_action' ).onchange = function() {\n\t\t\t\t\t\tdocument.getElementById( '<?php echo \"{$_prefix}_{$prefix}\"; ?>button_text_row' ).style.display = this.value != '' ? 'table-row' : 'none';\n\t\t\t\t\t\tdocument.getElementById( '<?php echo \"{$_prefix}_{$prefix}\"; ?>button_link_row' ).style.display = this.value == 'link' ? 'table-row' : 'none';\n\t\t\t\t\t\t<?php if ( $has_edd ) : ?>\n\t\t\t\t\t\t\tdocument.getElementById( '<?php echo \"{$_prefix}_{$prefix}\"; ?>edd_button_row' ).style.display = this.value == 'edd_button' ? 'table-row' : 'none';\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<?php if ( $has_woo ) : ?>\n\t\t\t\t\t\t\tdocument.getElementById( '<?php echo \"{$_prefix}_{$prefix}\"; ?>woo_button_row' ).style.display = this.value == 'woo_button' ? 'table-row' : 'none';\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<?php if ( $has_popups ) : ?>\n\t\t\t\t\t\t\tdocument.getElementById( '<?php echo \"{$_prefix}_{$prefix}\"; ?>button_popup_row' ).style.display = this.value == 'popup' ? 'table-row' : 'none';\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t</script>\n\n\t\t<?php endif; ?>\n\n\t<?php }", "public function makeLinkButton() {}", "public function buttonTag($name = NULL, $value = NULL, $options = NULL)\n {\n return \"<input type=\\\"button\\\" name=\\\"{$name}\\\" {$this->options2str($options)} value=\\\"{$value}\\\" />\";\n }", "function succulents_qodef_get_button_html( $params ) {\n\t\t$button_html = succulents_qodef_execute_shortcode( 'qodef_button', $params );\n\t\t$button_html = str_replace( \"\\n\", '', $button_html );\n\t\t\n\t\treturn $button_html;\n\t}", "public function getButtonLink()\n {\n return sprintf(\n 'mailto:?subject=%s&body=%s',\n Convert::raw2mailto($this->getSubject()),\n Convert::raw2mailto($this->getMessage())\n );\n }", "function shortcode_insert_button()\n\t\t{\n\t\t\t$this->config['name']\t\t= __('Job Submit Form', 'avia_framework' );\n\t\t\t$this->config['tab']\t\t= __('Plugin Additions', 'avia_framework' );\n\t\t\t$this->config['icon']\t\t= AviaBuilder::$path['imagesURL'].\"sc-comments.png\";\n\t\t\t$this->config['order']\t\t= 2;\n\t\t\t$this->config['target']\t\t= 'avia-target-insert';\n\t\t\t$this->config['shortcode'] \t= 'av_jobs_submit_form';\n\t\t\t$this->config['tooltip'] \t= __('Display the job submission form for WP Job Manager', 'avia_framework' );\n\t\t\t$this->config['drag-level'] = 3;\n\t\t}", "public function getFreeEnrolledButton($options = [])\n {\n return a(t('Start lesson'), ['/profile/start', 'id' => $this->id], $options);\n }", "function reply_button() {\n\t\t\n\t\treturn \" <input type=image name=submit src=\\\"images/reply.jpg\\\" \n\t\twidth=45 height=23 border=0 align=middle>\";\n}", "function protocol_button($element) {\n if (isset($element['#attributes']['class'])) {\n $element['#attributes']['class'] = 'form-' . $element['#button_type'] . ' ' . $element['#attributes']['class'];\n }\n else {\n $element['#attributes']['class'] = 'form-' . $element['#button_type'];\n }\n\n return '<div class=\"button-wrapper-outer\"><div class=\"button-wrapper\"><input type=\"submit\" ' . (empty($element['#name']) ? '' : 'name=\"' . $element['#name'] . '\" ') . 'id=\"' . $element['#id'] . '\" value=\"' . check_plain($element['#value']) . '\" ' . drupal_attributes($element['#attributes']) . \" /></div></div>\\n\";\n}", "public function print_button() {\n\t\tglobal $product;\n\n\t\tswitch ( get_locale() ) {\n\t\t\tcase 'pt_BR':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Número de parcelas',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'es_ES':\n\t\t\tcase 'es_CO':\n\t\t\tcase 'es_CL':\n\t\t\tcase 'es_PE':\n\t\t\tcase 'es_MX':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Meses sin intereses'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Number of installments',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$max_instalments = $this->gateway->fetch_acquirer_max_installments_for_price($product->price);\n\n\t\t$args = apply_filters( 'ebanx_template_args', array(\n\t\t\t\t'cards' => $this->cards,\n\t\t\t\t'cart_total' => $product->price,\n\t\t\t\t'max_installment' => min($this->gateway->configs->settings['credit_card_instalments'], $max_instalments),\n\t\t\t\t'installment_taxes' => $this->instalment_rates,\n\t\t\t\t'label' => __( 'Pay with one click', 'woocommerce-gateway-ebanx' ),\n\t\t\t\t'instalments' => $messages['instalments']\n\t\t\t) );\n\n\t\twc_get_template( 'one-click.php', $args, '', WC_EBANX::get_templates_path() . 'one-click/' );\n\t}", "function shortcode_insert_button()\n\t\t{\n\t\t\t$this->config['version']\t\t= '1.0';\n\t\t\t$this->config['is_fullwidth']\t= 'yes';\n\t\t\t$this->config['self_closing']\t= 'no';\n\t\t\t$this->config['base_element']\t= 'yes';\n\n\t\t\t$this->config['name']\t\t\t= __( 'Fullwidth Button', 'avia_framework' );\n\t\t\t$this->config['tab']\t\t\t= __( 'Content Elements', 'avia_framework' );\n\t\t\t$this->config['icon']\t\t\t= AviaBuilder::$path['imagesURL'] . 'sc-button.png';\n\t\t\t$this->config['order']\t\t\t= 84;\n\t\t\t$this->config['target']\t\t\t= 'avia-target-insert';\n\t\t\t$this->config['shortcode']\t\t= 'av_button_big';\n\t\t\t$this->config['tooltip']\t\t= __( 'Creates a colored button that stretches across the full width', 'avia_framework' );\n\t\t\t$this->config['tinyMCE']\t\t= array( 'tiny_always' => true );\n\t\t\t$this->config['preview']\t\t= true;\n\t\t\t$this->config['disabling_allowed'] = true;\n\t\t\t$this->config['id_name']\t\t= 'id';\n\t\t\t$this->config['id_show']\t\t= 'yes';\n\t\t}", "public function getButtonCustomizationPage($html='',$show_header=TRUE,$show_footer=TRUE){\n\t\t//if visual settings are submitted\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST' &&\n\t\t!empty($_POST['syc-visual-form'])) {\n\n\t\t\t//set the button declaration\n\t\t\t$this->setConfigValue(\"button_type\", $_POST['button_type']);\n\n\t\t\t//set the button skin\n\t\t\t$this->setConfigValue(\"button_skin\", $_POST['button_skin']);\n\n\t\t\t//set the button position\n\t\t\t$this->setConfigValue(\"button_position\", $_POST['button_position']);\n\t\t\t\n\t\t\t//set the button height\n\t\t\t$this->setConfigValue(\"dont_set_height\", empty($_POST['show_on_single_row']));\n\n\t\t\t//set the button html\n\t\t\t$this->setConfigValue(\"button_html\", rawurldecode($_POST['button_html']));\n\n\t\t\t//set the show\n\t\t\t$this->setConfigValue(\"hide_on_product\", empty($_POST['show_on_product']));\n\n\t\t\t//set the show'\n\t\t\t$this->setConfigValue(\"hide_on_checkout\", empty($_POST['show_on_checkout']));\n\t\t\t\n\t\t\t//set button position\n\t\t\t$this->setConfigValue(\"product_button_position\",$_POST['product_button_position']);\n\t\t\t$this->setConfigValue(\"cart_button_position\",$_POST['cart_button_position']);\n\n\t\t\tif($_FILES[\"button-img\"][\"name\"]!='') {\n\n\t\t\t\t$target_path = $this->getUploadDir();\n\t\t\t\tif(!SyC::endsWith($target_path,'/')) $target_path .= '/'; //make sure that the path has a / in it's end\n\t\t\t\t\n\t\t\t\t$target_path = $target_path . 'button-img.png';\n\n\t\t\t\tif(file_exists($target_path)) unlink($target_path);\n\t\t\t\t\n\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($_FILES['button-img']['tmp_name']);\n\t\t\t\t\n\t\t\t\tif (move_uploaded_file($_FILES['button-img']['tmp_name'], $target_path))\n\t\t\t\t{\n\t\t\t\t\t//set the button img\n\t\t\t\t\t$this->setConfigValue(\"btn-img\", $this->getUrl($target_path));\n\t\t\t\t\t$this->setConfigValue(\"btn-img-width\", $width);\n\t\t\t\t\t$this->setConfigValue(\"btn-img-height\", $height);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//upload failed, so notify the user\n\t\t\t\t\tthrow new Exception(SyC::t('sdk','Cannot upload image to directory {directory}. Check the permissions',array('{directory}',$this->getUploadDir())));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($_FILES[\"button-img-hover\"][\"name\"]!='') {\n\t\t\t\t$target_path = $this->getUploadDir();\n\t\t\t\tif(!SyC::endsWith($target_path,'/')) $target_path .= '/'; //make sure that the path has a / in it's end\n\n\t\t\t\t$target_path = $target_path . 'btn-img-hover.png';\n\n\t\t\t\tif(file_exists($target_path)) unlink($target_path);\n\t\t\t\t\n\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($_FILES['button-img-hover']['tmp_name']);\n\n\t\t\t\tif(move_uploaded_file($_FILES['button-img-hover']['tmp_name'], $target_path))\n\t\t\t\t{\n\t\t\t\t\t//set the show'\n\t\t\t\t\t$this->setConfigValue(\"btn-img-h\", $this->getUrl($target_path));\n\t\t\t\t\t$this->setConfigValue(\"btn-img-h-width\", $width);\n\t\t\t\t\t$this->setConfigValue(\"btn-img-h-height\", $height);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//upload failed, so notify the user\n\t\t\t\t\tthrow new Exception(SyC::t('sdk','Cannot upload image to directory {directory}. Check the permissions',array('{directory}',$this->getUploadDir())));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$status_message = SyC::t('sdk','Button settings successfully updated.');\n\t\t}\n\n\t\t//render the view\n\t\treturn $this->renderView('button-settings-page', array(\n\t\t\t'current_button_type' => $this->getConfigValue(\"button_type\"),\n\t\t\t'current_skin' => $this->getConfigValue(\"button_skin\"),\n\t\t\t'current_position' => $this->getConfigValue(\"button_position\"),\n\t\t\t'show_on_checkout' => !$this->getConfigValue(\"hide_on_checkout\"),\n\t\t\t'show_on_product' => !$this->getConfigValue(\"hide_on_product\"),\n\t\t\t'show_on_single_row' => !$this->getConfigValue(\"dont_set_height\"),\n\n\t\t\t'button_html' => $this->getConfigValue(\"button_html\"),\n\t\t\t'button_img' => $this->getUrl($this->getConfigValue(\"btn-img\")),\n\t\t\t'button_img_hover' => $this->getUrl($this->getConfigValue(\"btn-img-h\")),\n\t\t\t\n\t\t\t'html' => $html,\n\t\t\t'show_header' => $show_header,\n\t\t\t'show_footer' => $show_footer,\n\t\t\t'status_message' => @$status_message,\n\t\t));\n\t}", "function backend_ctr_button($caption, $button_class, $attributes = array(), $ajaxHandler=null, $ajaxParams = null, $formElement = null)\n\t{\n\t\treturn Backend_Html::ctr_button($caption, $button_class, $attributes, $ajaxHandler, $ajaxParams, $formElement);\n\t}", "function format_button_confirm($p_text, $p_action, $p_args, $p_msg, $p_msg_class = '', $p_icon = ''){\n\t$t_r = '';\n\n\t$t_args['confirm_btn'] = $p_text;\n\t$t_args['confirm_redirect'] = $p_action;\n\t$t_args['confirm_arg_keys'] = implode('|', array_keys($p_args));\n\t$t_args['confirm_arg_values'] = implode('|', array_values($p_args));\n\t$t_args['confirm_msg'] = $p_msg;\n\t$t_args['confirm_msg_class'] = $p_msg_class;\n\n\tif($p_icon != '')\n\t\t$t_r .= format_link($p_icon, helper_mantis_url('confirm.php'), $t_args, 'inline-page-link');\n\telse\n\t\t$t_r .= format_button_link($p_text, helper_mantis_url('confirm.php'), $t_args, 'inline-page-link');\n\n\treturn $t_r;\n}", "function form_button($data = '', $content = '', $extra = '')\n {\n $ci =& get_instance();\n $ci->load->library('user_agent');\n\n $defaults = array('name' => ((! is_array($data)) ? $data : ''), 'type' => 'submit');\n\n if (is_array($data) and isset($data['content'])) {\n $content = $data['content'];\n $data['value'] = $data['content'];\n unset($data['content']); // content is not an attribute\n }\n\n /*\n * if a user has IE 7, we need to show them an input tag instead of a button tag\n * because of the way IE 7 handles submitting multiple buttons (it send the\n * innerHTML instead of the value in the key=>value pair)\n */\n if ($ci->agent->browser() == 'Internet Explorer' && $ci->agent->version() < 8) {\n return \"<input \"._parse_form_attributes($data, $defaults).$extra.\" />\";\n } else {\n return \"<button \"._parse_form_attributes($data, $defaults).$extra.\"><span>\".$content.\"</span></button>\\n\";\n }\n }", "public function generateAction(Request $request)\n {\n $operator = $this->getOperator();\n\n $page = array(\n 'errors' => array(),\n );\n\n $this->getAssetManager()->attachJs('js/compiled/button_code.js');\n\n $image_locales_map = $this->getImageLocalesMap(MIBEW_FS_ROOT . '/locales');\n $image = $request->query->get('i', 'mibew');\n if (!isset($image_locales_map[$image])) {\n $page['errors'][] = 'Unknown image: ' . htmlspecialchars($image);\n $avail = array_keys($image_locales_map);\n $image = $avail[0];\n }\n $image_locales = $image_locales_map[$image];\n\n $style_list = ChatStyle::getAvailableStyles();\n $style_list[''] = getlocal('-from general settings-');\n $style = $request->query->get('style', '');\n if ($style && !in_array($style, $style_list)) {\n $style = '';\n }\n\n $invitation_style_list = InvitationStyle::getAvailableStyles();\n $invitation_style_list[''] = getlocal('-from general settings-');\n $invitation_style = $request->query->get('invitationstyle', '');\n if ($invitation_style && !in_array($invitation_style, $invitation_style_list)) {\n $invitation_style = '';\n }\n\n $locales_list = get_available_locales();\n\n $group_id = $request->query->getInt('group');\n if ($group_id && !group_by_id($group_id)) {\n $page['errors'][] = getlocal(\"No such group\");\n $group_id = false;\n }\n\n $show_host = $request->query->get('hostname') == 'on';\n $force_secure = $request->query->get('secure') == 'on';\n $mod_security = $request->query->get('modsecurity') == 'on';\n $force_windows = $request->query->get('forcewindows') == 'on';\n\n $disable_tracking = $request->query->get('disabletracking') == 'on';\n\n $silent_invitation = $request->query->get('silentinvitation') == 'on';\n\n $code_type = $request->query->get('codetype', 'button');\n if (!in_array($code_type, array('button', 'operator_code', 'text_link'))) {\n throw new BadRequestException('Wrong value of \"codetype\" param.');\n }\n\n $lang = $request->query->get('lang', '');\n if (!preg_match(\"/^[\\w-]{2,5}$/\", $lang)) {\n $lang = '';\n }\n\n $operator_code = ($code_type == 'operator_code');\n $generate_button = ($code_type == 'button');\n $button_generator_options = array(\n 'chat_style' => $style,\n 'group_id' => $group_id,\n 'show_host' => $show_host,\n 'force_secure' => $force_secure,\n 'mod_security' => $mod_security,\n 'prefer_iframe' => !$force_windows,\n 'invitation_style' => $invitation_style,\n 'disable_tracking' => $disable_tracking,\n 'silent_invitation' => $silent_invitation\n );\n\n if ($operator_code) {\n $button_generator = new OperatorCodeFieldGenerator(\n $this->getRouter(),\n $this->getAssetManager()->getUrlGenerator(),\n $button_generator_options\n );\n } elseif ($generate_button) {\n // Make sure locale exists\n if (!$lang || !in_array($lang, $image_locales)) {\n $lang = in_array(get_current_locale(), $image_locales)\n ? get_current_locale()\n : $image_locales[0];\n }\n\n $button_generator = new ImageButtonGenerator(\n $this->getRouter(),\n $this->getAssetManager()->getUrlGenerator(),\n $button_generator_options\n );\n\n // Set generator-specific options\n $button_generator->setOption('image', $image);\n } else {\n // Make sure locale exists\n if (!$lang || !in_array($lang, $locales_list)) {\n $lang = in_array(get_current_locale(), $locales_list)\n ? get_current_locale()\n : $locales_list[0];\n }\n\n $button_generator = new TextButtonGenerator(\n $this->getRouter(),\n $this->getAssetManager()->getUrlGenerator(),\n $button_generator_options\n );\n\n // Set generator-specific options\n $button_generator->setOption('caption', getlocal('Click to chat'));\n }\n\n // Set verified locale code to a button generator\n $button_generator->setOption('locale', $lang);\n\n $page['buttonCode'] = $button_generator->generate();\n $page['availableImages'] = array_keys($image_locales_map);\n $page['availableLocales'] = $generate_button ? $image_locales : $locales_list;\n $page['availableChatStyles'] = $style_list;\n $page['availableInvitationStyles'] = $invitation_style_list;\n $page['groups'] = $this->getGroupsList();\n\n $page['availableCodeTypes'] = array(\n 'button' => getlocal('button'),\n 'operator_code' => getlocal('operator code field'),\n 'text_link' => getlocal('text link')\n );\n\n $page['formgroup'] = $group_id;\n $page['formstyle'] = $style;\n $page['forminvitationstyle'] = $invitation_style;\n $page['formimage'] = $image;\n $page['formlang'] = $lang;\n $page['formhostname'] = $show_host;\n $page['formsecure'] = $force_secure;\n $page['formmodsecurity'] = $mod_security;\n $page['formcodetype'] = $code_type;\n $page['formforcewindows'] = $force_windows;\n $page['formdisabletracking'] = $disable_tracking;\n $page['formsilentinvitation'] = $silent_invitation;\n $page['enabletracking'] = Settings::get('enabletracking');\n $page['operator_code'] = $operator_code;\n $page['generateButton'] = $generate_button;\n\n $page['title'] = getlocal(\"Button HTML code generation\");\n $page['menuid'] = \"getcode\";\n\n $page = array_merge($page, prepare_menu($operator));\n\n return $this->render('button_code', $page);\n }", "public function renderButton(){\n\t\t\t$content = <<<ENDBUTTON\n\t<li><a id=\"btn-import-{$this->ID}\" href=\"#importerModal{$this->ID}\" data-toggle=\"modal\"><i class=\"{$this->icon}\"></i> From {$this->source}</a></li>\nENDBUTTON;\n\t\t\t\n\t\t\treturn $content;\n\t\t}", "function echotheme_button($a) {\n\textract(shortcode_atts(array(\n\t\t'label' \t=> 'Button Text',\n\t\t'id' \t=> '1',\n\t\t'url'\t=> '',\n\t\t'target' => '_parent',\t\t\n\t\t'size'\t=> '',\n\t\t'ptag'\t=> false\n\t), $a));\n\t\n\t$link = $url ? $url : get_permalink($id);\t\n\t\n\tif($ptag) :\n\t\treturn wpautop('<a href=\"'.$link.'\" target=\"'.$target.'\" class=\"button '.$size.'\">'.$label.'</a>');\n\telse :\n\t\treturn '<a href=\"'.$link.'\" target=\"'.$target.'\" class=\"button '.$size.'\">'.$label.'</a>';\n\tendif;\n\t\n}", "public function getHTML() : string\n {\n $strStyle = '';\n if ($this->oFlags->isSet(FormFlags::ALIGN_CENTER)) {\n $strStyle = 'text-align: center;';\n } else if ($this->oFlags->isSet(FormFlags::ALIGN_RIGHT)) {\n $strStyle = 'text-align: right;';\n }\n $strHTML = $this->buildContainerDiv($strStyle);\n\n $strHTML .= '<input type=\"button\" ';\n $strHTML .= $this->buildID();\n $strHTML .= $this->buildStyle();\n $strHTML .= $this->buildAttributes();\n $strHTML .= ' value=\"' . $this->strBtnText . '\"></div>' . PHP_EOL;\n\n return $strHTML;\n }", "public function getPrintLabelButton()\n {\n $data['id'] = $this->getRma()->getId();\n $url = $this->getUrl('adminhtml/rma/printLabel', $data);\n\n return $this->getLayout()->createBlock(\n \\Magento\\Backend\\Block\\Widget\\Button::class\n )->setData(\n ['label' => __('Print Shipping Label'), 'onclick' => 'setLocation(\\'' . $url . '\\')']\n )->toHtml();\n }", "private function createButton() {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf();\n\t$addButton = \"<A HREF='$phpSelf?action=crf'><button title='Create Row'>Create Row</button></A>\"; \n return $addButton; \n }", "function form_button($value, $js='', $name = '') {\n\n\tif (!$name) {\n\t\t$name = $value;\n\t}\n\n\t$override = NULL;\n\t$value = html_form_escape($value, $override);\n\n\treturn \"<input type=\\\"button\\\" name=\\\"$name\\\" value=\\\"$value\\\" $js />\";\n\n}", "public function generateShowModalButton($label=null, $options=[]) {\n\t\tHtml::addCssClass($options, 'btn-primary');\n\t\t$options['data']['toggle'] = 'modal';\n\t\t$options['data']['target'] = '#'.$this->modalId;\n\n\t\treturn Button::widget([\n\t\t\t'icon'=>'upload',\n\t\t\t'label'=>$label === null ? Yii::t('app', 'Upload attachment') : $label,\n\t\t\t'encodeLabel'=>false,\n\t\t\t'options'=>$options,\n\t\t]);\n\t}", "function cp_print_button($type,$value,$name){\r\n return '<span class=\"btn-wrapper\"><input type=\"'.$type.'\" class=\"btn\" value=\"'.$value.'\" name=\"'.$name.'\"></span>';\r\n}", "public static function Button($name,$value='',$option=array()) {\n $option['name']=$name;\n\t\t$option['type']='button';\n\t\t$option['value']=$value;\n\t return self::htmltag('input',$option);\n }", "function email_link_add_button($buttons) {\r\n\tarray_push($buttons, 'separator', 'email_link_name');\r\n\treturn $buttons;\r\n}", "public function addButtons()\n {\n if (!Mage::getSingleton('sheep_subscription/adminhtml_acl')->canEditSubscription()) {\n return;\n }\n\n /** @var Sheep_Subscription_Model_Subscription $subscription */\n $subscription = $this->_getModel();\n /** @var Sheep_Subscription_Model_Service $service */\n $service = Mage::getSingleton('sheep_subscription/service');\n\n if ($service->canBeCancelled($subscription)) {\n $this->addButton('cancel', array(\n 'label' => 'Cancel',\n 'onclick' => \"window.setLocation('{$this->getCancelUrl()}')\"\n ));\n }\n\n if ($service->canBePaused($subscription)) {\n $this->addButton('pause', array(\n 'label' => $this->__('Pause'),\n 'onclick' => \"window.setLocation('{$this->getPauseUrl()}')\"\n ));\n }\n\n if ($service->canBeResumed($subscription)) {\n $this->addButton('resume', array(\n 'label' => 'Resume',\n 'onclick' => \"window.setLocation('{$this->getResumeUrl()}')\"\n ));\n }\n }", "function krnEmit_button_editSubmit($caption, $value) {\n // used twice in set security\n // submit for editing - so all are consistent - (design choices:Edit button - caption - caption button that looks like link)\n //?????????? if report should not be coded as button ??????????????????????\n //$cellClass = empty($cellClass) ? '' : ' class=\"'.$class.'\"';\n return '<button type=\"submit\" class=\"kcmKrn-button-editLink\" name=\"submit\" value=\"'.$value.'\">' . $caption . '</button>';\n}", "public function btn($key) {\n return $this->msg('button', $key);\n }", "function eddwp_button( $atts, $content = null ) {\n\textract( shortcode_atts( array(\n\t\t\t'link' \t => '',\n\t\t\t'color' => 'blue',\n\t\t\t'target' => '_blank',\n\t\t\t'icon' => '',\n\t\t),\n\t\t$atts, 'eddwp_button' )\n\t);\n\n\tswitch ( $color ) :\n\t\tcase 'blue' :\n\t\t\t$color = 'blue';\n\t\t\tbreak;\n\t\tcase 'darkblue' :\n\t\t\t$color = 'darkblue';\n\t\t\tbreak;\n\t\tcase 'gray' :\n\t\t\t$color = 'gray';\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$color = 'blue';\n\tendswitch;\n\t\n\tif ( ! empty( $icon ) ) :\n\t\t$fontawesome = '<i class=\"fa fa-' . $icon . '\" aria-hidden=\"true\"></i>';\n\telse :\n\t\t$fontawesome = '';\n\tendif;\n\n\treturn '<p><a href=\"' . esc_url( $link ) . '\" target=\"' . esc_attr( $target ) . '\" class=\"edd-submit button ' . esc_attr( $color ) . '\">' . $fontawesome . $content . '</a></p>';\n}", "function tac_form_submit_button( $button, $form ) {\n\treturn \"<button id='gform_submit_button_{$form['id']}'>Submit form</button>\";\n}", "public function print_button() {\n\t\t\techo do_shortcode( \"[yith_wcwl_add_to_wishlist]\" );\n\t\t}", "function createEmptyCartButton(){\n return '<h2 class = \"ui horizontal divider\"><a class = \"ui red button\" href =\"shopping-cart.php?removeAllCart=1\"> Empty Cart</a></h2><br>';\n}", "function form_button($buttons = \"\") {\n\t\tif ($this->block == true)\n\t\t\t$buttons = \"fehler\";\n\n\t\t$btn['submit'] = \"<input accesskey='8' value=\\\"OK, Speichern\\\" class=\\\"submitbutton buttons\\\" type=\\\"submit\\\" />\";\n\t\t$btn['reset'] = \"<input accesskey='9' value=\\\"Eingaben l&ouml;schen\\\" class=\\\"resetbutton buttons\\\" type=\\\"reset\\\" />\";\n\t\t$btn['ex'] = \"<input accesskey='7' value=\\\"Beispiel..\\\" type=\\\"button\\\" class=\\\"examplebutton buttons\\\" onClick=\\\"set_examples();\\\" />\";\n\n\t\tswitch ($buttons) {\n\t\t\tdefault :\n\t\t\tcase 'ok_reset' :\n\t\t\t\t$r = \"<td colspan=\\\"3\\\" align=\\\"right\\\">\".$btn['submit'].\"&nbsp;\".$btn['reset'].\"</td>\";\n\t\t\t\tbreak;\n\t\t\tcase 'ex__ok_reset' :\n\t\t\t\t$r = \"<td>\".$btn['ex'].\"</td><td colspan=\\\"2\\\" align=\\\"right\\\">\".$btn['submit'].\"&nbsp;\".$btn['reset'].\"</td>\";\n\t\t\t\t$this->add_hidden_field(\"hiddenexample\", 0); // for examplebutton\n\t\t\t\t$this->special_form = \"onChange=\\\"document.myform.hiddenexample.value=0\\\"\";\n\t\t\t\tbreak;\n\t\t\tcase 'fehler' :\n\t\t\t\t$r = \"<td colspan=\\\"3\\\" align=\\\"center\\\" class=\\\"error\\\">Ich konnte notwendige Daten f&uuml;r dieses Formular nicht laden. <br />L&ouml;sung: \".$this->block.\"</td>\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn \"<tr>\".$r.\"</tr>\";\n\t}", "public function base_afterBody_handler($sender) {\r\n if (isMobile()) {\r\n $targetTheme = 'Mobile';\r\n } else {\r\n $targetTheme = 'Desktop';\r\n }\r\n // Text of button is \"ThemeToggleButton\", translated to a SVG picture.\r\n $link = anchor(\r\n t(\r\n 'ThemeToggleButton',\r\n '<svg width=\"24\" height=\"24\" xmlns=\"http://www.w3.org/2000/svg\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"><path d=\"M24 8.2c0-.318-.126-.623-.351-.849-.226-.225-.531-.351-.849-.351h-6.6c-.318 0-.623.126-.849.351-.225.226-.351.531-.351.849v13.6c0 .318.126.623.351.849.226.225.531.351.849.351h6.6c.318 0 .623-.126.849-.351.225-.226.351-.531.351-.849v-13.6zm-11 14.8h-8l2.599-3h5.401v3zm6.5-1c-.553 0-1-.448-1-1s.447-1 1-1c.552 0 .999.448.999 1s-.447 1-.999 1zm3.5-3v-9.024h-7v9.024h7zm-2-14h-2v-2h-17v13h11v2h-13v-17h21v4zm-.5 4c.276 0 .5-.224.5-.5s-.224-.5-.5-.5h-2c-.276 0-.5.224-.5.5s.224.5.5.5h2z\"/></svg>'\r\n ),\r\n 'plugin/themetoggle/'.$targetTheme,\r\n 'Button Hijack'\r\n );\r\n echo '<style>.ThemeToggle{position:fixed;right:0;bottom:2em;}</style>',\r\n '<div class=\"ThemeToggle\">'.$link.'</div>';\r\n }", "function add_email_link_fxn(){\n\tadd_menu_page( '', 'Send Email &rarr;', 'edit_pages', 'send_email', '', 'dashicons-email-alt', 5 );\n}", "private function renderButton()\n {\n $this->params = Json::encode([\n 'btnName' => $this->options['id'],\n 'cookieName' => $this->cookie['name'],\n 'cookieValue' => addslashes($this->getHashedCookieValue($this->cookie['value'])),\n 'cookieOptions' => isset($this->cookie['options']) ? $this->cookie['options'] : null,\n ]);\n\n if($this->cookie($this->cookie['name'])) {\n Html::addCssClass($this->options, 'active');\n }\n\n echo Button::widget([\n 'label' => $this->encodeLabel ? Html::encode($this->label) : $this->label,\n 'encodeLabel' => $this->encodeLabel,\n 'options' => ArrayHelper::merge(['data-toggle' => 'button'], $this->options),\n 'tagName' => $this->buttonTagName\n ]);\n }", "public function render()\n {\n $boton = '<button type=\"' . $this->_type . '\" value=\"' . $this->_value . '\"';\n if ($this->_form) {\n $boton .= ' form=\"' . $this->_form . '\" ';\n }\n if ($this->_name) {\n $boton .= ' name=\"' . $this->_name. '\" ';\n }\n if ($this->_autoFocus) {\n $boton .= ' autofocus=\"' . $this->_autoFocus. '\" ';\n }\n if ($this->_disabled) {\n $boton .= ' disabled ';\n }\n if ($this->getClass()) {\n $boton .= 'class=\"' . $this->getClass() . '\" ';\n }\n if ($this->_id) {\n $boton .= 'id=\"' . $this->_id . '\" ';\n }\n \n $boton .= '>' . $this->_value . '</button>' . \"\\n\";\n $boton = str_replace(\" \", \" \", $boton);\n return $boton;\n }", "private function show_connect_button() {\n\t\t?>\n\t\t<div class=\"text-center wp-core-ui rank-math-ui\" style=\"margin-top: 30px;\">\n\t\t\t<button type=\"submit\" class=\"button button-primary button-animated\" name=\"rank_math_activate\"><?php echo esc_attr__( 'Connect Your Account', 'rank-math' ); ?></button>\n\t\t</div>\n\t\t<?php\n\t}", "function createAccountButton(){\n\t\techo '<form name=\"accounts\" method=\"post\" action=\"CheckBook.php/:Add\">';\n\t\techo '<button type=\"submit\">Add an Account</button>';\n\t\techo '</form>';\n\t}", "function dapper_button($variables) {\n $element = $variables['element'];\n\n $element['#attributes']['type'] = 'submit';\n if ($element['#type'] == \"button\") {\n element_set_attributes($element, array('id', 'name', 'title'));\n return '<button' . drupal_attributes($element['#attributes']) . '>' . $element['#value'] . '</button>';\n\n } else {\n element_set_attributes($element, array('id', 'name', 'value'));\n\n $element['#attributes']['class'][] = 'form-' . $element['#button_type'];\n if (!empty($element['#attributes']['disabled'])) {\n $element['#attributes']['class'][] = 'form-button-disabled';\n }\n\n return '<input' . drupal_attributes($element['#attributes']) . ' />';\n\n }\n}", "public function getButtonsHtml()\n {\n $addButtonData = [\n 'label' => __('Add to Quote'),\n 'class' => 'action-default action-add action-secondary',\n 'disabled' => 'disabled'\n ];\n $addButtonDataAttribute = [\n 'mage-init' => '{\"Magento_NegotiableQuote/quote/actions/submit-form\":{\"formId\":\"sku-form\"}}',\n 'role' => 'add-to-quote'\n ];\n $html = $this->getLayout()->createBlock(\n \\Magento\\Backend\\Block\\Widget\\Button::class\n )->setData(\n $addButtonData\n )->setDataAttribute(\n $addButtonDataAttribute\n )->toHtml();\n\n $cancelButtonData = [\n 'label' => __('Cancel')\n ];\n $cancelButtonDataAttribute = [\n 'mage-init' => '{\"Magento_NegotiableQuote/js/quote/actions/toggle-show\": '\n . '{\"toggleBlockId\": \"order-additional_area\",'\n . ' \"showBlockId\": \"show-sku-form\"}}'\n ];\n $html .= $this->getLayout()->createBlock(\n \\Magento\\Backend\\Block\\Widget\\Button::class\n )->setData(\n $cancelButtonData\n )->setDataAttribute(\n $cancelButtonDataAttribute\n )->toHtml();\n\n return $html;\n }", "function optinpanda_subscription_services_options( $options ) {\r\n \r\n // mailchimp\r\n \r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-mailchimp-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'mailchimp_apikey',\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Key</a>', 'optinpanda' ), 'http://kb.mailchimp.com/accounts/management/about-api-keys#Finding-or-generating-your-API-key' ),\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'hint' => __( 'The API key of your MailChimp account.', 'optinpanda' ),\r\n ),\r\n array(\r\n 'type' => 'checkbox',\r\n 'way' => 'buttons',\r\n 'name' => 'mailchimp_welcome',\r\n 'title' => __( 'Send \"Welcome\" Email', 'optinpanda' ),\r\n 'default' => true,\r\n 'hint' => __( 'Sends the Welcome Email configured in your MailChimp account after subscription (works only if the Single Opt-In set).', 'optinpanda' )\r\n ) \r\n )\r\n );\r\n\r\n // aweber\r\n\r\n if( !get_option('opanda_aweber_consumer_key', false) ) {\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-aweber-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'html',\r\n 'html' => 'opanda_aweber_html'\r\n ),\r\n array(\r\n 'type' => 'textarea',\r\n 'name' => 'aweber_auth_code',\r\n 'title' => __( 'Authorization Code', 'optinpanda' ),\r\n 'hint' => __( 'The authorization code you will see after log in to your Aweber account.', 'optinpanda' )\r\n )\r\n )\r\n ); \r\n\r\n } else {\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-aweber-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'html',\r\n 'html' => 'opanda_aweber_html'\r\n ) \r\n )\r\n );\r\n }\r\n\r\n // getresponse\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-getresponse-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'getresponse_apikey',\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Key</a>', 'optinpanda' ), 'http://support.getresponse.com/faq/where-i-find-api-key' ),\r\n 'hint' => __( 'The API key of your GetResponse account.', 'optinpanda' ),\r\n )\r\n )\r\n );\r\n\r\n // mymail\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-mymail-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n\r\n array(\r\n 'type' => 'html',\r\n 'html' => 'opanda_show_mymail_html'\r\n ),\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'checkbox',\r\n 'way' => 'buttons',\r\n 'name' => 'mymail_redirect',\r\n 'title' => __( 'Redirect To Locker', 'optinpanda' ),\r\n 'hint' => sprintf( __( 'Set On to redirect the user after the email confirmation to the page where the locker located.<br />If Off, the MyMail will redirect the user to the page specified in the option <a href=\"%s\" target=\"_blank\">Newsletter Homepage</a>.', 'optinpanda' ), admin_url('options-general.php?page=newsletter-settings&settings-updated=true#frontend') )\r\n )\r\n )\r\n );\r\n\r\n // mailpoet\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-mailpoet-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'html',\r\n 'html' => 'opnada_show_mailpoet_html'\r\n ) \r\n )\r\n );\r\n\r\n // acumbamail\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-acumbamail-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'acumbamail_customer_id',\r\n 'title' => __( 'Customer ID', 'optinpanda' ),\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get ID & Token</a>', 'optinpanda' ), 'https://acumbamail.com/apidoc/' ),\r\n 'hint' => __( 'The customer ID of your Acumbamail account.', 'optinpanda' )\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'acumbamail_api_token',\r\n 'title' => __( 'API Token', 'optinpanda' ),\r\n 'hint' => __( 'The API token of your Acumbamail account.', 'optinpanda' )\r\n )\r\n )\r\n );\r\n\r\n // knews\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-knews-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'html',\r\n 'html' => 'opanda_show_knews_html'\r\n ),\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'checkbox',\r\n 'way' => 'buttons',\r\n 'name' => 'knews_redirect',\r\n 'title' => __( 'Redirect To Locker', 'optinpanda' ),\r\n 'hint' => __( 'Set On to redirect the user after the email confirmation to the page where the locker located.<br />If Off, the K-news will redirect the user to the home page.', 'optinpanda' )\r\n ) \r\n )\r\n ); \r\n\r\n // freshmail\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-freshmail-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'freshmail_apikey',\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Keys</a>', 'optinpanda' ), 'https://app.freshmail.com/en/settings/integration/' ),\r\n 'hint' => __( 'The API Key of your FreshMail account.', 'optinpanda' )\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'freshmail_apisecret',\r\n 'title' => __( 'API Secret', 'optinpanda' ),\r\n 'hint' => __( 'The API Sercret of your FreshMail account.', 'optinpanda' )\r\n )\r\n )\r\n );\r\n\r\n // sendy\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-sendy-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'sendy_apikey',\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'hint' => __( 'The API key of your Sendy application, available in Settings.', 'optinpanda' ),\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'sendy_url',\r\n 'title' => __( 'Installation', 'optinpanda' ),\r\n 'hint' => __( 'An URL for your Sendy installation, <strong>http://your_sendy_installation</strong>', 'optinpanda' ),\r\n )\r\n )\r\n );\r\n \r\n // smartemailing\r\n \r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-smartemailing-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'smartemailing_username',\r\n 'title' => __( 'Username', 'optinpanda' ),\r\n 'hint' => __( 'Enter your username on SmartEmailing. Usually it is a email.', 'optinpanda' ),\r\n ), \r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'smartemailing_apikey',\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Key</a>', 'optinpanda' ), 'https://app.smartemailing.cz/userinfo/show/api' ),\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'hint' => __( 'The API key of your SmartEmailing account.', 'optinpanda' ),\r\n )\r\n )\r\n );\r\n \r\n // sendinblue\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-sendinblue-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'sendinblue_apikey',\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Key</a>', 'optinpanda' ), 'https://my.sendinblue.com/advanced/apikey' ),\r\n 'hint' => __( 'The API Key (version 2.0) of your Sendinblue account.', 'optinpanda' )\r\n )\r\n )\r\n );\r\n \r\n // activecampaign\r\n\r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-activecampaign-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'activecampaign_apiurl',\r\n 'title' => __( 'API Url', 'optinpanda' ),\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Url</a>', 'optinpanda' ), 'http://www.activecampaign.com/help/using-the-api/' ),\r\n 'hint' => __( 'The API Url of your ActiveCampaign account.', 'optinpanda' )\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'activecampaign_apikey',\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Key</a>', 'optinpanda' ), 'http://www.activecampaign.com/help/using-the-api/' ),\r\n 'hint' => __( 'The API Key of your ActiveCampaign account.', 'optinpanda' )\r\n )\r\n )\r\n ); \r\n \r\n // sendgrid\r\n \r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-sendgrid-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'sendgrid_apikey',\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get API Key</a>', 'optinpanda' ), 'https://app.sendgrid.com/settings/api_keys' ),\r\n 'title' => __( 'API Key', 'optinpanda' ),\r\n 'hint' => __( 'Your SendGrid API key. Grant <strong>Full Access</strong> for <strong>Mail Send</strong> and <strong>Marketing Campaigns</strong> in settings of your API key.', 'optinpanda' ),\r\n ) \r\n )\r\n );\r\n \r\n // sg autorepondeur\r\n \r\n $options[] = array(\r\n 'type' => 'div',\r\n 'id' => 'opanda-sgautorepondeur-options',\r\n 'class' => 'opanda-mail-service-options opanda-hidden',\r\n 'items' => array(\r\n\r\n array(\r\n 'type' => 'separator'\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'sg_apikey',\r\n 'after' => sprintf( __( '<a href=\"%s\" class=\"btn btn-default\" target=\"_blank\">Get Code</a>', 'optinpanda' ), 'http://sg-autorepondeur.com/membre_v2/compte-options.php' ),\r\n 'title' => __( 'Activation Code', 'optinpanda' ),\r\n 'hint' => __( 'The Activation Code from your SG Autorepondeur account (<i>Mon compte -> Autres Options -> Informations administratives</i>).', 'optinpanda' ),\r\n ),\r\n array(\r\n 'type' => 'textbox',\r\n 'name' => 'sg_memberid',\r\n 'title' => __( 'Member ID', 'optinpanda' ),\r\n 'hint' => __( 'The Memeber ID of your SG Autorepondeur account (<i>available on the home page below the SG logo, for example, 9059</i>).', 'optinpanda' ),\r\n )\r\n )\r\n );\r\n\r\n return $options;\r\n}", "function tia_button($a) {\n\textract(shortcode_atts(array(\n\t\t'label' \t=> 'Button Text',\n\t\t'url'\t=> '',\n\t\t'id' \t=> '1',\t\t\n\t\t'target' => '',\t\t\n\t\t'size'\t=> ''\n\t), $a));\n\t\n\t$link = $url ? $url : get_permalink($id);\t\n\t\n\treturn '<a href=\"'.$link.'\"target=\"'.$target.'\" class=\"button '.$size.'\">'.$label.'</a>';\n\t\n}", "public function render()\n {\n $dataAttribs = $this->_retrieveFormattedDataAttributes();\n $href = $this->_getHref();\n $followButton = <<<HTML\n<a href=\"{$href}\" class=\"{$this->_buttonType} {$this->_extraClasses}\" {$dataAttribs}>@{$this->_twitterAccount}</a>\n<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>\nHTML;\n return $followButton;\n }", "function minorite_button($variables) {\n $element = $variables['element'];\n element_set_attributes($element, array('id', 'name', 'title', 'value'));\n\n if ($element['#type'] == 'submit') {\n $element['#attributes']['type'] = 'submit';\n }\n\n // Adds CSS selector on icon button.\n if (isset($element['#icon'])) {\n $element['#value'] = '<i></i>' . $element['#value'];\n $element['#attributes']['class'][] = $element['#icon'];\n }\n\n return '<button' . drupal_attributes($element['#attributes']) . '>' . $element['#value'] . '</button>';\n}", "function displayOptionsForm($buttonOptions, $style, $title) {\n global $addthis_addjs;\n ?>\n <?php if(!at_follow_is_pro_user()) { ?>\n <div class=\"updated addthis_setup_nag\">\n <p>AddThis Pro now available - start your trial at\n <a href=\"http://www.addthis.com\" target=\"_blank\">www.addthis.com</a>\n and get premium widgets, personalized content recommendations,\n advanced customization options and priority support.\n </p>\n </div><br/>\n <?php } ?>\n <?php echo $addthis_addjs->getAtPluginPromoText(); ?>\n <img alt='addthis' src=\"//cache.addthis.com/icons/v1/thumbs/32x32/more.png\" class=\"header-img\"/>\n <span class=\"addthis-title\">AddThis</span> <span class=\"addthis-plugin-name\">Follow</span>\n <form method=\"post\" action=\"options.php\">\n <?php\n settings_fields('addthis_follow_settings');\n\n echo '<table class=\"follow-container\">\n <tr>\n <td>\n <p><strong><label for=\"style\">' . __('Style:', 'addthis') . '</label></strong></p>\n <select id=\"style\" name=\"addthis_follow_settings[style]\">';\n foreach ($this->_followOptions->getStyles() as $c => $n) {\n $selected = ($style == $c) ? ' selected=\"selected\" ' : '';\n echo '<option ' . $selected . 'value=\"' . $c . '\">' . $n[0] . '</option>';\n }\n echo '</select>\n </td>\n <td style=\"text-align:right;padding-left:40px;\">\n <p>&nbsp;</p>\n <p><strong>' . __('AddThis Profile ID:', 'addthis') . '</strong>\n <input style=\"width:160px\" disabled=\"disabled\" class=\"widefat\" type=\"text\" value=\"' . $addthis_addjs->pubid . '\" />\n </p>\n </td>\n </tr>\n <tr>\n <td>\n <p><strong><label for=\"title\">' . __('Header:') . '</label></strong></p>\n <input style=\"width:160px\" class=\"widefat\" id=\"title\" name=\"addthis_follow_settings[title]\" type=\"text\" value=\"' . $title . '\" />\n </td><td>&nbsp;</td>\n </tr>\n <tr>\n<td>\n <p><strong>' . __('Buttons:') . '</strong></p>';\n ?>\n\n <table id=\"follow-table\" cellspacing=\"0\" cellpadding=\"0\">\n <?php\n $buttonCount = count($buttonOptions);\n $count = 0;\n\n foreach ($buttonOptions as $id => $button) {\n if ($id == \"linkedin-company\") {\n $source = \"http://cache.addthiscdn.com/icons/v1/thumbs/linkedin.gif\";\n } elseif ($id == \"youtube-channel\") {\n $source = \"http://cache.addthiscdn.com/icons/v1/thumbs/youtube.gif\";\n } else {\n $source = \"http://cache.addthiscdn.com/icons/v1/thumbs/$id.gif\";\n }\n $rowClass = '';\n if (++$count < $buttonCount) {\n $rowClass = ' class=\"follow-table-row\"';\n }\n echo '<tr' . $rowClass . '>\n <td>\n <img src=\"'.$source.'\" />\n <strong><label for=\"' . $id . '\">' . __($button['name'], 'addthis') . '</label></strong>\n </td>\n <td style=\"text-align:right\">\n ' . sprintf($button['input'], '<input class=\"follow-input\" id=\"' . $id . '\" name=\"addthis_follow_settings[' . $id . ']\" type=\"text\" value=\"' . $button['placeholder'] . '\">') . '\n </td>\n </tr>';\n }\n\n echo '</table>\n </td><td>&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"2\">\n <p><input class=\"button-secondary\" type=\"submit\" name=\"Submit\" value=\"';\n echo _e('Save');\n echo '\" /> </p></td> </tr> </table></form>';\n }", "function send_verification_mail($to, $title, $link){\r\n\r\n // body contains the mail body which will be send to user\r\n $body = \"<html>\r\n <body>\r\n Please Use Below Link To Subscribe With XKCD<br />\r\n <button><a target='_blank' href=$link>Click Here To Complete Verification</a></button>\r\n </body>\r\n </html>\";\r\n \r\n // headers are required to send mail\r\n // it is inbuilt content which id added as parameter with the mail method\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\r\n\r\n // PHP inbuilt method to send mail\r\n mail($to, $title, $body, $headers);\r\n}", "public function getToPlainButtonHtml()\n {\n return $this->getChildHtml('to_plain_button');\n }", "function addButton($context){\n\t\t$context .= '<a href=\"'.admin_url('admin.php?action=iframe_pagination_ssm&TB_iframe=1').'\" onclick=\"return false;\" class=\"thickbox\" title=\"' . __(\"Browse in shortcode manager\", 'ssm') . '\"><img src=\"'.SSM_URL . \"/images/shortcodes.png\".'\" alt=\"' . __(\"Insert a shortcode\", 'ssm') . '\" /></a>';\n\t\treturn $context;\n\t}", "public function getPrintButton()\n {\n $data['id'] = $this->getRma()->getId();\n return $this->getUrl('adminhtml/rma/printPackage', $data);\n }", "public function adminBSBButtonMaterialDesignFunction(array $args = []): string {\n return $this->adminBSBButton(ButtonFactory::parseMaterialDesignButton($args), ArrayHelper::get($args, \"icon\"), ArrayHelper::get($args, \"circle\", false));\n }", "public static function button($btn_type, $appform_id, $btn_text = \"\"){\r\n return '<button class=\"toolbar-btn '.$btn_type.'\" id=\"'.$appform_id.'-'.$btn_type.'\" title=\"'.Yii::t(\"sys_msg\", $btn_type).'\">'.$btn_text.'</button>';\r\n }", "public function button($title, $options = array())\n {\n $default = array('class' => 'btn btn-flat');\n if (isset($options['class']) && $options['class'] == \"\") {\n $default['class'] = \"\";\n }\n $options = array_merge_recursive($default, $options);\n\n return FormHelper::button($title, $options);\n }", "function techmarket_header_action_button() {\n\t\t\n\t\t$action_button_args = apply_filters( 'techmarket_header_action_button_args', array(\n\t\t\t'url'\t=> '#',\n\t\t\t'text' => esc_html__( 'Go to TechMarket Shop', 'techmarket' ),\n\t\t\t'icon'\t=> is_rtl() ? 'tm tm-long-arrow-left' : 'tm tm-long-arrow-right'\n\t\t) );\n\n\n\t\tif ( apply_filters( 'techmarket_show_header_action_button', true ) && ! empty( $action_button_args ) ) : ?>\n\t\t<a role=\"button\" class=\"header-action-btn\" href=\"<?php echo esc_url( $action_button_args['url'] );?>\">\n\t\t\t<?php echo esc_html( $action_button_args['text'] ); ?>\n\t\t\t<?php if( ! empty( $action_button_args['icon'] ) ) : ?>\n\t\t\t\t<i class=\"<?php echo esc_attr( $action_button_args['icon'] );?>\"></i>\n\t\t\t<?php endif; ?>\n\t\t</a>\n\t\t<?php endif;\n\t}", "public function cmsButton($name,$value = '#',$attribs = null,$options = null ){\n\t\t\n\t\t$iconDir = $attribs['iconDir'];\n\t\tif(empty($iconDir))$iconDir = \"images/toolbar/\";\n\t\n\t\t$icon = $attribs['icon'];\n\t\tif(empty($icon)) $icon = 'icon-32-default.png';\n\t\t\n\t\t$src = $iconDir . $icon;\n\t\t\n\t\t$link = $value;\n\t\tif($options['type'] == 'submit'){\n\t\t\t$link = \"javascript:onSubmitForm('\" . $options['name'] . \"','\" . $value . \"')\";\n\t\t}\n\t\t\t\t\n\t\t$xhtml = '<div class=\"toolbar-button\" >\n <a href=\"' . $link . '\">\n \t\t\t<img src=\"' . $src . '\"> \n <br>' . $name . '\n </a>\n </div>';\n\t\treturn $xhtml;\n\t}", "public function button($title, array $options = [])\n {\n $options = $this->addClass($options, $this->_class(__FUNCTION__));\n $options = $this->_getBtnClass($options);\n $options = $this->_getToolTipAttr($options);\n\n list($title, $options) = $this->_createIcon($this->Html, $title, $options);\n\n return parent::button($title, $options);\n }", "public function makeShortcutButton() {}", "function btnGoToResult( string $href ) : string\n {\n $button = '<p style=\"text-align: right;\">'\n . '<span class=\"badge badge-success\">'\n . '<a href=\"' . $href . '\">GO</a>'\n . '</span>'\n . '</p>';\n \n return $button;\n }", "function makeCommandButton( $command, $text )\r\n{\r\n\treturn \"<button name=commandButton id=btn_$command onclick=\\\"\" .\r\n\t\t\"rows = document.getElementsByName( 'commandButton' ); \" .\r\n\t\t\"for (i=0; i<rows.length; i++) rows[i].disabled = true; \" .\r\n\t\t\"sendCommand( '\" . urlencode( $command ) . \"', '', true ); \" .\r\n\t\t\"return false;\" .\r\n\t\t\"\\\" style=\\\"\\\">$text</button>\";\r\n}", "function shortcode_btn ( $atts, $content = \"\" ) {\n\t$a = shortcode_atts( array(\n\t\t'link' => \"#\",\n\t\t'type' => \"default\",\n\t\t'target' => \"\",\n\t\t'class' => \"\",\n\t\t'title' => \"\",\n\t), $atts );\n\t\n\treturn '<a class=\"btn btn-' . $a['type'] . ' ' . $a['class'] . '\" href=\"' . $a['link'] . '\" title=\"' . $a['title'] . '\" ' . (empty($a['target']) ? '' : 'target=\"' . $a['target'] . '\"') . '>' . do_shortcode( $content ) . '</a>';\n}", "private function generateLogoutButtonHTML() {\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p class=\"messagecss\" id=\"' . self::$messageId . '\">' . $this->message .'</p>\n\t\t\t\t<input class=\"navLogout\" type=\"submit\" name=\"' . self::$logout . '\" value=\"Logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "function displayCreateButton() {\r\n\t \t\r\n\t \techo \"<a href='create.php' class='btn btn-success'>Create a New Question!!</a><br />\";\r\n\t \t\r\n\t }", "function swpm_edit_pp_subscription_button() {\r\n\r\n $button_id = sanitize_text_field($_REQUEST['button_id']);\r\n $button_id = absint($button_id);\r\n $button_type = sanitize_text_field($_REQUEST['button_type']);\r\n\r\n $button = get_post($button_id); //Retrieve the CPT for this button\r\n\r\n $membership_level_id = get_post_meta($button_id, 'membership_level_id', true);\r\n //$payment_amount = get_post_meta($button_id, 'payment_amount', true);\r\n $payment_currency = get_post_meta($button_id, 'payment_currency', true);\r\n $return_url = get_post_meta($button_id, 'return_url', true);\r\n $paypal_email = get_post_meta($button_id, 'paypal_email', true);\r\n $button_image_url = get_post_meta($button_id, 'button_image_url', true);\r\n $checkout_logo_image_url = get_post_meta($button_id, 'checkout_logo_image_url', true);\r\n\r\n //Subscription billing details\r\n $billing_amount = get_post_meta($button_id, 'billing_amount', true);\r\n $billing_cycle = get_post_meta($button_id, 'billing_cycle', true);\r\n $billing_cycle_term = get_post_meta($button_id, 'billing_cycle_term', true);\r\n $billing_cycle_count = get_post_meta($button_id, 'billing_cycle_count', true);\r\n $billing_reattempt = get_post_meta($button_id, 'billing_reattempt', true);\r\n\r\n //Trial billing details\r\n $trial_billing_amount = get_post_meta($button_id, 'trial_billing_amount', true);\r\n $trial_billing_cycle = get_post_meta($button_id, 'trial_billing_cycle', true);\r\n $trial_billing_cycle_term = get_post_meta($button_id, 'trial_billing_cycle_term', true);\r\n ?>\r\n <form id=\"pp_button_config_form\" method=\"post\">\r\n\r\n <div class=\"postbox\">\r\n <h3 class=\"hndle\"><label for=\"title\"><?php echo SwpmUtils::_('PayPal Subscription Button Configuration'); ?></label></h3>\r\n <div class=\"inside\">\r\n\r\n <table class=\"form-table\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\">\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Button ID'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"10\" name=\"button_id\" value=\"<?php echo $button_id; ?>\" readonly required />\r\n <p class=\"description\">This is the ID of this payment button. It is automatically generated for you and it cannot be changed.</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Button Title'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"50\" name=\"button_name\" value=\"<?php echo $button->post_title; ?>\" required />\r\n <p class=\"description\">Give this membership payment button a name. Example: Gold membership payment</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Membership Level'); ?></th>\r\n <td>\r\n <select id=\"membership_level_id\" name=\"membership_level_id\">\r\n <?php echo SwpmUtils::membership_level_dropdown($membership_level_id); ?>\r\n </select>\r\n <p class=\"description\">Select the membership level this payment button is for.</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Payment Currency'); ?></th>\r\n <td> \r\n <select id=\"payment_currency\" name=\"payment_currency\">\r\n <option value=\"USD\" <?php echo ($payment_currency == 'USD') ? 'selected=\"selected\"' : ''; ?>>US Dollars ($)</option>\r\n <option value=\"EUR\" <?php echo ($payment_currency == 'EUR') ? 'selected=\"selected\"' : ''; ?>>Euros (€)</option>\r\n <option value=\"GBP\" <?php echo ($payment_currency == 'GBP') ? 'selected=\"selected\"' : ''; ?>>Pounds Sterling (£)</option>\r\n <option value=\"AUD\" <?php echo ($payment_currency == 'AUD') ? 'selected=\"selected\"' : ''; ?>>Australian Dollars ($)</option>\r\n <option value=\"BRL\" <?php echo ($payment_currency == 'BRL') ? 'selected=\"selected\"' : ''; ?>>Brazilian Real (R$)</option>\r\n <option value=\"CAD\" <?php echo ($payment_currency == 'CAD') ? 'selected=\"selected\"' : ''; ?>>Canadian Dollars ($)</option>\r\n <option value=\"CNY\" <?php echo ($payment_currency == 'CNY') ? 'selected=\"selected\"' : ''; ?>>Chinese Yuan</option>\r\n <option value=\"CZK\" <?php echo ($payment_currency == 'CZK') ? 'selected=\"selected\"' : ''; ?>>Czech Koruna</option>\r\n <option value=\"DKK\" <?php echo ($payment_currency == 'DKK') ? 'selected=\"selected\"' : ''; ?>>Danish Krone</option>\r\n <option value=\"HKD\" <?php echo ($payment_currency == 'HKD') ? 'selected=\"selected\"' : ''; ?>>Hong Kong Dollar ($)</option>\r\n <option value=\"HUF\" <?php echo ($payment_currency == 'HUF') ? 'selected=\"selected\"' : ''; ?>>Hungarian Forint</option>\r\n <option value=\"INR\" <?php echo ($payment_currency == 'INR') ? 'selected=\"selected\"' : ''; ?>>Indian Rupee</option>\r\n <option value=\"IDR\" <?php echo ($payment_currency == 'IDR') ? 'selected=\"selected\"' : ''; ?>>Indonesia Rupiah</option>\r\n <option value=\"ILS\" <?php echo ($payment_currency == 'ILS') ? 'selected=\"selected\"' : ''; ?>>Israeli Shekel</option>\r\n <option value=\"JPY\" <?php echo ($payment_currency == 'JPY') ? 'selected=\"selected\"' : ''; ?>>Japanese Yen (¥)</option>\r\n <option value=\"MYR\" <?php echo ($payment_currency == 'MYR') ? 'selected=\"selected\"' : ''; ?>>Malaysian Ringgits</option>\r\n <option value=\"MXN\" <?php echo ($payment_currency == 'MXN') ? 'selected=\"selected\"' : ''; ?>>Mexican Peso ($)</option>\r\n <option value=\"NZD\" <?php echo ($payment_currency == 'NZD') ? 'selected=\"selected\"' : ''; ?>>New Zealand Dollar ($)</option>\r\n <option value=\"NOK\" <?php echo ($payment_currency == 'NOK') ? 'selected=\"selected\"' : ''; ?>>Norwegian Krone</option>\r\n <option value=\"PHP\" <?php echo ($payment_currency == 'PHP') ? 'selected=\"selected\"' : ''; ?>>Philippine Pesos</option>\r\n <option value=\"PLN\" <?php echo ($payment_currency == 'PLN') ? 'selected=\"selected\"' : ''; ?>>Polish Zloty</option>\r\n <option value=\"RUB\" <?php echo ($payment_currency == 'RUB') ? 'selected=\"selected\"' : ''; ?>>Russian Ruble</option>\r\n <option value=\"SGD\" <?php echo ($payment_currency == 'SGD') ? 'selected=\"selected\"' : ''; ?>>Singapore Dollar ($)</option>\r\n <option value=\"ZAR\" <?php echo ($payment_currency == 'ZAR') ? 'selected=\"selected\"' : ''; ?>>South African Rand (R)</option>\r\n <option value=\"KRW\" <?php echo ($payment_currency == 'KRW') ? 'selected=\"selected\"' : ''; ?>>South Korean Won</option>\r\n <option value=\"SEK\" <?php echo ($payment_currency == 'SEK') ? 'selected=\"selected\"' : ''; ?>>Swedish Krona</option>\r\n <option value=\"CHF\" <?php echo ($payment_currency == 'CHF') ? 'selected=\"selected\"' : ''; ?>>Swiss Franc</option>\r\n <option value=\"TWD\" <?php echo ($payment_currency == 'TWD') ? 'selected=\"selected\"' : ''; ?>>Taiwan New Dollars</option>\r\n <option value=\"THB\" <?php echo ($payment_currency == 'THB') ? 'selected=\"selected\"' : ''; ?>>Thai Baht</option>\r\n <option value=\"TRY\" <?php echo ($payment_currency == 'TRY') ? 'selected=\"selected\"' : ''; ?>>Turkish Lira</option>\r\n <option value=\"VND\" <?php echo ($payment_currency == 'VND') ? 'selected=\"selected\"' : ''; ?>>Vietnamese Dong</option>\r\n </select>\r\n <p class=\"description\">Select the currency for this payment button.</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('PayPal Email'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"50\" name=\"paypal_email\" value=\"<?php echo $paypal_email; ?>\" required />\r\n <p class=\"description\">Enter your PayPal email address. The payment will go to this PayPal account.</p>\r\n </td>\r\n </tr> \r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Billing Amount Each Cycle'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"6\" name=\"billing_amount\" value=\"<?php echo $billing_amount; ?>\" required />\r\n <p class=\"description\">Amount to be charged on every billing cycle. If used with a trial period then this amount will be charged after the trial period is over. Example values: 10.00 or 19.50 or 299.95 etc (do not put currency symbol).</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Billing Cycle'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"4\" name=\"billing_cycle\" value=\"<?php echo $billing_cycle; ?>\" required />\r\n <select id=\"billing_cycle_term\" name=\"billing_cycle_term\">\r\n <option value=\"D\" <?php echo ($billing_cycle_term == 'D') ? 'selected=\"selected\"' : ''; ?>>Day(s)</option>\r\n <option value=\"M\" <?php echo ($billing_cycle_term == 'M') ? 'selected=\"selected\"' : ''; ?>>Month(s)</option>\r\n <option value=\"Y\" <?php echo ($billing_cycle_term == 'Y') ? 'selected=\"selected\"' : ''; ?>>Year(s)</option>\r\n </select>\r\n <p class=\"description\">Set the interval of the recurring payment. Example value: 1 Month (if you want to charge every month)</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Billing Cycle Count'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"6\" name=\"billing_cycle_count\" value=\"<?php echo $billing_cycle_count; ?>\" />\r\n <p class=\"description\">After how many cycles should billing stop. Leave this field empty (or enter 0) if you want the payment to continue until the subscription is canceled.</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Re-attempt on Failure'); ?></th>\r\n <td>\r\n <input type=\"checkbox\" name=\"billing_reattempt\" value=\"1\" <?php if ($billing_reattempt != '') {\r\n echo ' checked=\"checked\"';\r\n } ?> />\r\n <p class=\"description\">When checked, the payment will be re-attempted two more times if the payment fails. After the third failure, the subscription will be canceled..</p>\r\n </td>\r\n </tr>\r\n\r\n </table>\r\n\r\n </div>\r\n </div><!-- end of main button configuration box -->\r\n\r\n <div class=\"postbox\">\r\n <h3 class=\"hndle\"><label for=\"title\"><?php echo SwpmUtils::_('Trial Billing Details (Leave empty if you are not offering a trial period)'); ?></label></h3>\r\n <div class=\"inside\">\r\n\r\n <table class=\"form-table\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\">\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Trial Billing Amount'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"6\" name=\"trial_billing_amount\" value=\"<?php echo $trial_billing_amount; ?>\" />\r\n <p class=\"description\">Amount to be charged for the trial period. Enter 0 if you want to offer a free trial period.</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Trial Billing Period'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"4\" name=\"trial_billing_cycle\" value=\"<?php echo $trial_billing_cycle; ?>\" />\r\n <select id=\"billing_cycle_term\" name=\"trial_billing_cycle_term\">\r\n <option value=\"D\" <?php echo ($trial_billing_cycle_term == 'D') ? 'selected=\"selected\"' : ''; ?>>Day(s)</option>\r\n <option value=\"M\" <?php echo ($trial_billing_cycle_term == 'M') ? 'selected=\"selected\"' : ''; ?>>Month(s)</option>\r\n <option value=\"Y\" <?php echo ($trial_billing_cycle_term == 'Y') ? 'selected=\"selected\"' : ''; ?>>Year(s)</option>\r\n </select>\r\n <p class=\"description\">Length of the trial period</p>\r\n </td>\r\n </tr>\r\n\r\n </table>\r\n </div> \r\n </div><!-- end of trial billing details box --> \r\n\r\n <div class=\"postbox\">\r\n <h3 class=\"hndle\"><label for=\"title\"><?php echo SwpmUtils::_('Optional Details'); ?></label></h3>\r\n <div class=\"inside\">\r\n\r\n <table class=\"form-table\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\">\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Return URL'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"100\" name=\"return_url\" value=\"<?php echo $return_url; ?>\" />\r\n <p class=\"description\">This is the URL the user will be redirected to after a successful payment. Enter the URL of your Thank You page here.</p>\r\n </td>\r\n </tr>\r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Button Image URL'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"100\" name=\"button_image_url\" value=\"<?php echo $button_image_url; ?>\" />\r\n <p class=\"description\">If you want to customize the look of the button using an image then enter the URL of the image.</p>\r\n </td>\r\n </tr> \r\n\r\n <tr valign=\"top\">\r\n <th scope=\"row\"><?php echo SwpmUtils::_('Custom Checkout Page Logo Image'); ?></th>\r\n <td>\r\n <input type=\"text\" size=\"100\" name=\"checkout_logo_image_url\" value=\"<?php echo $checkout_logo_image_url; ?>\" />\r\n <p class=\"description\">Specify an image URL if you want to customize the paypal checkout page with a custom logo/image. The image URL must be a \"https\" URL.</p>\r\n </td>\r\n </tr>\r\n\r\n </table>\r\n </div> \r\n </div><!-- end of optional details box --> \r\n\r\n <p class=\"submit\">\r\n <input type=\"submit\" name=\"swpm_pp_subscription_save_submit\" class=\"button-primary\" value=\"<?php echo SwpmUtils::_('Save Payment Data'); ?>\" >\r\n </p>\r\n\r\n </form>\r\n\r\n <?php\r\n}", "function mailrelayForm($options, $apiKey) {\n $form = array();\n\n // info text\n $form['info'] = array(\n '#value' => t('This button will sync all users to Mailrelay.')\n );\n\n // placeholder for API key (we will pass it internally)\n $form['apiKey'] = array(\n '#type' => 'value',\n '#value' => $apiKey\n );\n\n // select with all the mailrelay groups\n $form['groups'] = array(\n '#title' => t('Select the groups you want to sync'),\n '#type' => 'select',\n '#multiple' => true,\n '#options' => $options\n );\n\n // submit button that starts the sync process\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Start sync process')\n );\n\n return $form;\n}", "private function provide_button_html($podcast_data, $button_styling, $data_attributes=\"\") {\n\t\t// Create data attributes for Button\n\t\tforeach ($button_styling as $attribute => $value) {\n\t\t\t$data_attributes .= 'data-' . $attribute . '=\"' . $value . '\" ';\n\t\t}\n\n\t\treturn\"\n\t\t\t<script>\n\t\t\t\tpodcastData\".$this->id . \" = \".json_encode($podcast_data).\"\n\t\t\t</script>\n\t\t\t<script\n\t\t\t\tclass=\\\"podlove-subscribe-button\\\"\n\t\t\t\tsrc=\\\"https://cdn.podlove.org/subscribe-button/javascripts/app.js\\\" \" . $data_attributes . \">\n\t\t\t</script>\n\t\t\";\n\t}", "function buttons($type='',$name='',$value='',$class='',$id='',$attrib='') {\n\t\t$button = '<input type=\"'.$type.'\" name=\"'.$name.'\" class=\"'.$class.'\" value=\"'.$value.'\" id=\"'.$id.'\" '.$attrib.'>';\n\t\techo $button;\n\t}", "function nav_buttons()\n\t{\n\t\t?>\n\t\t<input type=\"button\" value=\"Create New Preorder &gt;\" onclick=\"document.location='/admin/utilities/preorder.php?act=new'\" class=\"btn\">\n\t\t<p />\n\t\t<?php\n\t}", "public function getToHtmlButtonHtml()\n {\n return $this->getChildHtml('to_html_button');\n }", "public static function shortcodeUI()\n\t{\n\t\t// Shortcake required\n\t\tif ( ! function_exists( 'shortcode_ui_register_for_shortcode' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tshortcode_ui_register_for_shortcode(\n\t\t\tstatic::SHORTCODE_TAG,\n\t\t\tarray(\n\t\t\t\t'label' => esc_html( __( 'Follow Button', 'twitter' ) ),\n\t\t\t\t'listItemImage' => 'dashicons-twitter',\n\t\t\t\t'attrs' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'attr' => 'screen_name',\n\t\t\t\t\t\t'label' => esc_html( __( 'Twitter @username', 'twitter' ) ),\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'meta' => array(\n\t\t\t\t\t\t\t'placeholder' => 'WordPress',\n\t\t\t\t\t\t\t'pattern' => '[A-Za-z0-9_]{1,20}',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'attr' => 'size',\n\t\t\t\t\t\t'label' => esc_html( __( 'Button size:', 'twitter' ) ),\n\t\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'' => esc_html( _x( 'medium', 'medium size button', 'twitter' ) ),\n\t\t\t\t\t\t\t'large' => esc_html( _x( 'large', 'large size button', 'twitter' ) ),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "protected function buttonLabel()\n\t{\n\t\t$s = JString::strtoupper($this->buttonPrefix);\n\t\treturn JText::_('PLG_LIST_' . $s . '_' . $s);\n\t}", "public function ov_button($content){\n $args = func_get_args(); array_shift($args);\n $args[] = array('content' => $content);\n return $this->generate_input('button', '', null, false, $args);\n }", "function email_print_preview_button($courseid) {\n // Action is handled weird, put in a dummy hidden element\n // and then change its name to action when our button has\n // been clicked\n /*echo '<span id=\"print_preview\" class=\"print_preview\">\n <input type=\"submit\" value=\"'.get_string('printemails', 'block_email_list').'\" name=\"action\" onclick=\"return print_multiple_emails(document.sendmail.mail);\" />\n <input type=\"hidden\" value=\"print\" name=\"disabled\" id=\"printactionid\" />\n </span>';\n*/\n\techo '<span id=\"print_preview\" class=\"print_preview\">';\n email_print_to_popup_window ('button', '/blocks/email_list/email/print.php?courseid='.$courseid.'&amp;mailids=', get_string('printemails', 'block_email_list'),\n get_string('printemails', 'block_email_list'));\n echo '</span>';\n}", "function add_record_button($action_title, $file_name, $button_text)\n{\n ?>\n <p style=\"font-size:21px\"><?= ucwords($action_title) ?></p>\n <p>\n <a href=\"<?= $_SERVER['SCRIPT_NAME'] ?>?p=<?= $file_name ?>\" class=\"btn btn-primary\" role=\"button\">\n <span class=\"glyphicon glyphicon-plus-sign\"></span> Add <?= ucwords($button_text) ?></a>\n </p>\n <?php\n}", "function give_get_donation_form_submit_button( $form_id, $args = array() ) {\n\n\t$display_label_field = give_get_meta( $form_id, '_give_checkout_label', true );\n $display_label_field = apply_filters( 'give_donation_form_submit_button_text', $display_label_field, $form_id, $args );\n\t$display_label = ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );\n\tob_start();\n\t?>\n\t<div class=\"give-submit-button-wrap give-clearfix\">\n\t\t<input type=\"submit\" class=\"give-submit give-btn\" id=\"give-purchase-button\" name=\"give-purchase\"\n\t\t value=\"<?php echo $display_label; ?>\" data-before-validation-label=\"<?php echo $display_label; ?>\"/>\n\t\t<span class=\"give-loading-animation\"></span>\n\t</div>\n\t<?php\n\treturn apply_filters( 'give_donation_form_submit_button', ob_get_clean(), $form_id, $args );\n}", "private function render_gen_button(MJKGenToolsPage $page): void {\r\n $this->render_ajax_button($page, 'Generate now', 'gen');\r\n }", "function ofa_camptix_payment_buttons ( $payment_output, $total, $payment_methods, $selected_payment_method ) {\n // Since we aren't blowing away the original system anyway, let's use it. Only modify the output here if\n // we have a total > 0 ... otherwise the default solution works fine for us:\n if ( $total > 0 ) {\n $output = '';\n foreach ( $payment_methods as $payment_method_key => $payment_method ) {\n $key = esc_attr( $payment_method_key );\n $checkout = esc_attr__( 'Checkout with', 'camptix' );\n $method = esc_html( $payment_method['name'] );\n $output .= <<<EOHTML\n <button id=\"tix-pm-{$key}\" type=\"submit\" name=\"tix_payment_method\" value=\"{$key}\">\n {$checkout} {$method}\n </button>\nEOHTML;\n }\n return '<p class=\"tix-submit\">'.$output.'<br class=\"tix-clear\" /></p>';\n }\n\n // Else just return the original:\n return $payment_output;\n}" ]
[ "0.6947378", "0.6258293", "0.617673", "0.60319847", "0.6016347", "0.59989834", "0.5926521", "0.59219736", "0.58793485", "0.58420503", "0.5832637", "0.58174175", "0.5801321", "0.5790575", "0.57841015", "0.5774189", "0.57741743", "0.5773416", "0.57730615", "0.5760268", "0.5708769", "0.5707794", "0.5707535", "0.5693021", "0.5689879", "0.5653775", "0.56515604", "0.5650495", "0.56381655", "0.5635764", "0.56255615", "0.56237024", "0.5620399", "0.56139964", "0.56076545", "0.5587165", "0.5573414", "0.5564287", "0.5551314", "0.5549153", "0.55271286", "0.5510978", "0.5507908", "0.5481321", "0.5481056", "0.5474943", "0.5473999", "0.5473774", "0.5454949", "0.545293", "0.5443109", "0.5441238", "0.5440742", "0.54310805", "0.54203415", "0.54203176", "0.5419859", "0.54191995", "0.54185784", "0.54096997", "0.53986514", "0.53947645", "0.53897095", "0.53860223", "0.5385585", "0.5368744", "0.53682756", "0.53609693", "0.53567505", "0.5355792", "0.5355423", "0.53375065", "0.5325532", "0.5318411", "0.5312753", "0.5312552", "0.5312552", "0.5304438", "0.5303854", "0.5302836", "0.5292003", "0.5285799", "0.52846324", "0.52753973", "0.52710694", "0.5269291", "0.5269245", "0.52662766", "0.5254044", "0.52530944", "0.5252186", "0.5246093", "0.52418715", "0.52403116", "0.524004", "0.5239529", "0.5232816", "0.52319306", "0.52299535", "0.5221791" ]
0.7651278
0
Remove , and unnecessary envelopes for editing with composer
static function unwrap_email($html_email) { if (self::_has_markers($html_email)) { $html_email = self::unwrap_html_element($html_email); } else { //KEEP FOR OLD EMAIL COMPATIBILITY // Extracts only the body part $x = strpos($html_email, '<body'); if ($x) { $x = strpos($html_email, '>', $x); $y = strpos($html_email, '</body>'); $html_email = substr($html_email, $x + 1, $y - $x - 1); } /* Cleans up uncorrectly stored newsletter bodies */ $html_email = preg_replace('/<style\s+.*?>.*?<\\/style>/is', '', $html_email); $html_email = preg_replace('/<meta.*?>/', '', $html_email); $html_email = preg_replace('/<title\s+.*?>.*?<\\/title>/i', '', $html_email); $html_email = trim($html_email); } // Required since esc_html DOES NOT escape the HTML entities (apparently) $html_email = str_replace('&', '&amp;', $html_email); $html_email = str_replace('"', '&quot;', $html_email); $html_email = str_replace('<', '&lt;', $html_email); $html_email = str_replace('>', '&gt;', $html_email); return $html_email; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prop_clean() {\n\n remove_action('template_redirect', 'rest_output_link_header', 11);\n remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);\n\n add_filter( 'use_default_gallery_style', '__return_false' );\n\n // Emoji related\n remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\n}", "function remove_fields_pubtrans($confArr, $showitem)\n{\n if ($confArr['downgrade.']['enable.']['pubtrans'])\n {\n return $showitem;\n }\n $showitem = str_replace('pubtrans_embeddedcode,', null, $showitem);\n $showitem = str_replace('pubtrans_stop;;;richtext[]:rte_transform[mode=ts],', null, $showitem);\n $showitem = str_replace('pubtrans_url,', null, $showitem);\n $showitem = str_replace('citymap_url,', null, $showitem);\n $showitem = str_replace('citymap_embeddedcode,', null, $showitem);\n return $showitem;\n}", "private function handleEnvelopeTo ()\n {\n $hold = array();\n $holdcc = array();\n $holdbcc = array();\n $text = trim ($this->fileData['to']);\n\n $textcc = '';\n $textbcc = '';\n if ( isset ($this->fileData['cc']) && trim ($this->fileData['cc']) != '' )\n {\n $textcc = trim ($this->fileData['cc']);\n }\n\n if ( isset ($this->fileData['bcc']) && trim ($this->fileData['bcc']) != '' )\n {\n $textbcc = trim ($this->fileData['bcc']);\n }\n\n if ( false !== (strpos ($text, ',')) )\n {\n $hold = explode (',', $text);\n\n foreach ($hold as $val) {\n if ( strlen ($val) > 0 )\n {\n $this->fileData['envelope_to'][] = \"$val\";\n }\n }\n }\n elseif ( $text != '' )\n {\n $this->fileData['envelope_to'][] = \"$text\";\n }\n else\n {\n $this->fileData['envelope_to'] = array();\n }\n\n //CC\n if ( false !== (strpos ($textcc, ',')) )\n {\n $holdcc = explode (',', $textcc);\n\n foreach ($holdcc as $valcc) {\n if ( strlen ($valcc) > 0 )\n {\n $this->fileData['envelope_cc'][] = \"$valcc\";\n }\n }\n }\n elseif ( $textcc != '' )\n {\n $this->fileData['envelope_cc'][] = \"$textcc\";\n }\n else\n {\n $this->fileData['envelope_cc'] = array();\n }\n\n //BCC\n if ( false !== (strpos ($textbcc, ',')) )\n {\n $holdbcc = explode (',', $textbcc);\n\n foreach ($holdbcc as $valbcc) {\n if ( strlen ($valbcc) > 0 )\n {\n $this->fileData['envelope_bcc'][] = \"$valbcc\";\n }\n }\n }\n elseif ( $textbcc != '' )\n {\n $this->fileData['envelope_bcc'][] = \"$textbcc\";\n }\n else\n {\n $this->fileData['envelope_bcc'] = array();\n }\n }", "function meal_checkout_remove_fields( $fields ) {\n unset( $fields['billing']['billing_company'] );\n unset( $fields['billing']['billing_country'] );\n unset( $fields['billing']['billing_address_1'] );\n unset( $fields['billing']['billing_address_2'] );\n unset( $fields['billing']['billing_city'] );\n unset( $fields['billing']['billing_state'] );\n unset( $fields['billing']['billing_postcode'] ); \n\n // remove the shippig fields below\n unset( $fields['shipping']['shipping_first_name'] ); \n unset( $fields['shipping']['shipping_last_name'] ); \n unset( $fields['shipping']['shipping_company'] ); \n unset( $fields['shipping']['shipping_country'] ); \n unset( $fields['shipping']['shipping_address_1'] ); \n unset( $fields['shipping']['shipping_address_2'] ); \n unset( $fields['shipping']['shipping_city'] ); \n unset( $fields['shipping']['shipping_state'] ); \n unset( $fields['shipping']['shipping_postcode'] ); \n\n // remove order comments field\n unset( $woo_checkout_fields_array['order']['order_comments'] );\n\n \n \n return $fields;\n}", "function woo_remove_fields( $woo_checkout_fields_array ) {\n // unset( $woo_checkout_fields_array['billing']['billing_first_name'] );\n // unset( $woo_checkout_fields_array['billing']['billing_last_name'] );\n // unset( $woo_checkout_fields_array['billing']['billing_phone'] );\n // unset( $woo_checkout_fields_array['billing']['billing_email'] );\n // unset( $woo_checkout_fields_array['order']['order_comments'] ); // remove order notes\n \n // and to remove the billing fields below\n unset( $woo_checkout_fields_array['billing']['billing_company'] ); // remove company field\n unset( $woo_checkout_fields_array['billing']['billing_country'] );\n unset( $woo_checkout_fields_array['billing']['billing_address_1'] );\n unset( $woo_checkout_fields_array['billing']['billing_address_2'] );\n unset( $woo_checkout_fields_array['billing']['billing_city'] );\n unset( $woo_checkout_fields_array['billing']['billing_state'] ); // remove state field\n unset( $woo_checkout_fields_array['billing']['billing_postcode'] ); // remove zip code field\n \n return $woo_checkout_fields_array;\n}", "function convertizer_remove() {\ndelete_option('convertizer_data');\n}", "public function clearEmbargo();", "function bt_remove_order_notes( $fields ) {\n unset($fields['order']['order_comments']);\n return $fields;\n}", "function wooadmin_remove_contactmethods($contactmethods ) {\n\n unset($contactmethods['aim']);\n\n unset($contactmethods['website']);\n\n unset($contactmethods['yim']);\n\n unset($contactmethods['jabber']);\n\n unset($contactmethods['googleplus']);\n\n unset($contactmethods['twitter']);\n\n unset($contactmethods['url']);\n\n return $contactmethods;\n\n}", "function hankart_remove_fields( $woo_checkout_fields_array ) {\n\t// unset( $woo_checkout_fields_array['billing']['billing_first_name'] );\n\t// unset( $woo_checkout_fields_array['billing']['billing_last_name'] );\n\t// unset( $woo_checkout_fields_array['billing']['billing_phone'] );\n\t// unset( $woo_checkout_fields_array['billing']['billing_email'] );\n\t// unset( $woo_checkout_fields_array['order']['order_comments'] );\n\t// and to remove the fields below\n\tunset( $woo_checkout_fields_array['billing']['billing_company'] );\n\treturn $woo_checkout_fields_array;\n}", "function humcore_remove_meta_boxes() {\n\n\tremove_meta_box( 'humcore_deposit_subjectdiv', 'humcore_deposit', 'side' );\n\tremove_meta_box( 'tagsdiv-humcore_deposit_tag', 'humcore_deposit', 'side' );\n\n}", "function remove_company_validation($array) {\n foreach($array as $key => $form) {\n\n foreach($form as $index => $field) {\n if($field['field'] === 'Company') {\n unset($array[$key][$index]);\n }\n }\n\n }\n\n // Reset key numbers for both shipping and billing fields\n $shipping = array_values($array['shipping']);\n $billing = array_values($array['billing']);\n\n // Place reset array keys and values back into $array\n $array = ['billing' => $billing, 'shipping' => $shipping];\n return $array;\n}", "function ct_clean_bigcommerce( $css ) {\n return '';\n}", "private function changelog_unset_unneeded_values () {\n\t\t# remove ip address fields\n\t\tif($this->object_type == \"ip_addr\") {\n\t\t\tunset(\t$this->object_new['subnet'],\n\t\t\t\t\t$this->object_new['type'],\n\t\t\t\t\t$this->object_new['section'],\n\t\t\t\t\t$this->object_new['ip_addr_old'],\n\t\t\t\t\t$this->object_new['nostrict'],\n\t\t\t\t\t$this->object_new['start'],\n\t\t\t\t\t$this->object_new['stop'],\n\t\t\t\t\t$this->object_new['ip'],\n\t\t\t\t\t$this->object_new['subnetvlan'],\n\t\t\t\t\t$this->object_new['addressId']\n\t\t\t\t\t);\n\t\t\tunset(\t$this->object_old['subnet'],\n\t\t\t\t\t$this->object_old['type'],\n\t\t\t\t\t$this->object_old['section'],\n\t\t\t\t\t$this->object_old['ip_addr_old'],\n\t\t\t\t\t$this->object_old['nostrict'],\n\t\t\t\t\t$this->object_old['start'],\n\t\t\t\t\t$this->object_old['stop'],\n\t\t\t\t\t$this->object_old['ip'],\n\t\t\t\t\t$this->object_old['subnetvlan'],\n\t\t\t\t\t$this->object_old['addressId']\n\t\t\t\t\t);\n # remove mac\n if ($this->object_action==\"add\") {\n unset ($this->object_new['mac_old'], $this->object_new['addressId']);\n }\n\t\t\t# reformat ip\n\t\t\tif (isset($this->object_old['ip_addr']))\t{ $this->object_old['ip_addr'] = $this->Subnets->transform_address ($this->object_old['ip_addr'],\"dotted\"); }\n\t\t\tif (isset($this->object_new['ip_addr']))\t{ $this->object_new['ip_addr'] = $this->Subnets->transform_address ($this->object_new['ip_addr'],\"dotted\"); }\n\n\t\t}\n\t\t# remove subnet fields\n\t\telseif($this->object_type == \"subnet\")\t{\n\t\t\t// remove unneeded values\n\t\t\tunset(\t$this->object_new['subnetId'],\n\t\t\t\t\t$this->object_new['location'],\n\t\t\t\t\t$this->object_new['vrfIdOld'],\n\t\t\t\t\t$this->object_new['permissions'],\n\t\t\t\t\t$this->object_new['state'],\n\t\t\t\t\t$this->object_new['sectionId'],\n\t\t\t\t\t$this->object_new['ip']\n\t\t\t\t);\n\t\t\tunset(\t$this->object_old['subnetId'],\n\t\t\t\t\t$this->object_old['location'],\n\t\t\t\t\t$this->object_old['vrfIdOld'],\n\t\t\t\t\t$this->object_old['permissions'],\n\t\t\t\t\t$this->object_old['state'],\n\t\t\t\t\t$this->object_old['sectionId'],\n\t\t\t\t\t$this->object_old['ip']\n\t\t\t\t);\n\n\t\t\t# if section does not change\n\t\t\tif($this->object_new['sectionId']==$this->object_new['sectionIdNew']) {\n\t\t\t\tunset(\t$this->object_new['sectionIdNew'],\n\t\t\t\t\t\t$this->object_new['sectionId'],\n\t\t\t\t\t\t$this->object_old['sectionId']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->object_old['sectionIdNew'] = $this->object_old['sectionId'];\n\t\t\t}\n\n\t\t\t//transform subnet to IP address format\n\t\t\tif(strlen($this->object_new['subnet'])>0) \t{ $this->object_new['subnet'] = $this->Subnets->transform_address ($this->object_new['subnet'], \"dotted\");}\n\t\t\tif(strlen($this->object_old['subnet'])>0) \t{ $this->object_old['subnet'] = $this->Subnets->transform_address ($this->object_old['subnet'], \"dotted\");}\n\n\t\t\t//remove subnet/mask for folders\n\t\t\tif (@$this->object_new['isFolder']==\"1\")\t{ unset($this->object_new['subnet'], $this->object_new['mask']); }\n\t\t\tif (@$this->object_old['isFolder']==\"1\")\t{ unset($this->object_old['subnet'], $this->object_old['mask']); }\n\t\t}\n\t\t# remove order fields\n\t\telseif($this->object_type == \"section\") {\n\t\t\tunset($this->object_old['order']);\n\t\t}\n\n\t\t# common\n\t\tunset($this->object_new['action']);\n\t\tunset($this->object_new['editDate'], $this->object_old['editDate']);\n\t\tunset($this->object_new['csrf_cookie']);\n\t}", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "function complete_version_removal() { return ''; }", "public static function additionalCleaning() {\n \n }", "public function get_company_all_invoice_for_remove() \n {\n $matches = array();\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $company = $this->input->post('company');\n \n $paid = $this->input->post('paid');\n $result = $this->classtraineemodel->get_company_notpaid_invoices_list($this->tenant_id,$company);\n if ($result) \n {\n foreach ($result as $row) \n {\n $matches[] = array(\n 'key' => $row->invoice_id.'#'.$row->pymnt_due_id.'#'.$row->course_id.'#'.$row->class_id.'#'.$row->company_id.'#'.$row->company_name.'#'.$row->crse_name.'#'.$row->class_name,\n 'label' => $row->invoice_id . ' (Class: ' . $row->class_name . ')',\n 'value' => $row->invoice_id,\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "function remove_fields_embeddedcode($confArr, $showitem)\n{\n if ($confArr['downgrade.']['enable.']['embeddedcode'])\n {\n return $showitem;\n }\n $showitem = str_replace('_embeddedcode,', '_tmp1234,', $showitem);\n $showitem = str_replace('embeddedcode,', null, $showitem);\n $showitem = str_replace('_tmp1234,', '_embeddedcode,', $showitem);\n //$showitem = str_replace('_ ', '_embeddedcode, ', null, $showitem);\n return $showitem;\n}", "function cleanup_reformat($change) {\n\t\tif (!array_key_exists('add_lines', $change) && !array_key_exists('remove_lines', $change))\n\t\t\treturn $change;\n\t\t\n\t\tif (array_key_exists('remove_lines', $change))\n\t\tforeach($change['remove_lines'] as $key => $removed) {\n\t\t\t$removed = cleanup_line_reformat($removed);\n\t\t\t$found = empty($removed);\n\t\t\tif (!$found && array_key_exists('add_lines', $change)) {\n\t\t\t\tforeach($change['add_lines'] as $key2 => $added) {\n\t\t\t\t\t$added = cleanup_line_reformat($added);\n\t\t\t\t\tif (empty($added)) {\n\t\t\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($removed == $added) {\n\t\t\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($found) unset($change['remove_lines'][$key]);\n\t\t}\n\t\t\n\t\t// Clean empty added lines\n\t\tif (array_key_exists('add_lines', $change))\n\t\tforeach($change['add_lines'] as $key2 => $added) {\n\t\t\t$added = cleanup_line_reformat($added);\n\t\t\tif (empty($added))\n\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t}\n\t\treturn $change;\n\t}", "function clear_bcc () {\n $this->sendbcc = array();\n $this->all_emails = array();\n }", "function custom_override_checkout_fields( $fields ) {\n /*unset($fields['billing']['billing_first_name']);*/\n unset($fields['billing']['billing_last_name']);\n unset($fields['billing']['billing_company']);\n unset($fields['billing']['billing_address_1']);\n unset($fields['billing']['billing_address_2']);\n //unset($fields['billing']['billing_city']); // necesario para que no pete\n //unset($fields['billing']['billing_postcode']); // necesari para que no pete\n //unset($fields['billing']['billing_country']); // necesari para que no pete\n\t//unset($fields['billing']['billing_state']); // necesario para que no se pete\n\tunset($fields['billing']['billing_phone']); \n\tunset($fields['order']['order_comments']); \n unset($fields['billing']['billing_email']);\n return $fields;\n}", "public function disableRemoveLineBreaksFromTemplate() {}", "public function fixObject(){\n\t\t//Ex : cadre et texte d'entete\n\t}", "function image_features_override_export_render_deletion($alter, $element) {\n $code = array();\n if (isset($alter['keys'])) {\n $component_start = \"\\$data['$element']\";\n $code_line = features_override_export_keys($alter['keys']);\n $code[] = \"\";\n $code[] = \" if (\" . $component_start . \"['storage'] == IMAGE_STORAGE_DEFAULT) {\";\n $code[] = ' unset(' . $component_start . $code_line . ');';\n $code[] = \" }\";\n }\n return $code;\n}", "function cor_remove_personal_options( $subject ) {\n\n $subject = preg_replace( '#<h3>Personal Options</h3>.+?/table>#s', '', $subject, 1 );\n\n return $subject;\n\n }", "public function unsetAdditionalRecipients(): void\n {\n $this->additionalRecipients = [];\n }", "function cleanupMediaobjectUsage()\n\t{\n\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t$completecontent = \"\";\n\t\tforeach ($this->getAllRTEContent() as $content)\n\t\t{\n\t\t\t$completecontent .= $content;\n\t\t}\n\t\tilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . \":html\",\n\t\t\t$this->getId());\n\t}", "function jigoshop_upgrade_145() {\n\t\n\tJigoshop_Base::get_options()->delete_option( 'jigoshop_paypal_send_shipping' );\n\tdelete_option( 'jigoshop_paypal_send_shipping' );\n\tJigoshop_Base::get_options()->delete_option( 'jigoshop_display_totals_tax' );\n\tdelete_option( 'jigoshop_display_totals_tax' );\n\t\n}", "function bt_custom_billing_fields( $fields = array() ) {\n unset($fields['billing_company']);\n // unset($fields['billing_address_1']);\n // unset($fields['billing_address_2']);\n // unset($fields['billing_state']);\n // unset($fields['billing_city']);\n // unset($fields['billing_phone']);\n // unset($fields['billing_postcode']);\n // unset($fields['billing_country']);\n return $fields;\n}", "public function remove_license_data() {\r\n\t$license_data = $this->get_license_options();\r\n\tforeach($license_data as $key => $value) {\r\n\t\t//delete_site_option($this->plugin_config['plugin_prefix'].'_'.$key);\r\n\t\t$this->remove_license_option($key);\r\n\t}\r\n}", "function remove_metaboxes(){\n // remove_meta_box( 'tagsdiv-keywords', 'ticket', 'side' );\n remove_meta_box( 'versiondiv', 'ticket', 'side' );\n remove_meta_box( 'milestonediv', 'ticket', 'side' );\n remove_meta_box( 'componentdiv', 'ticket', 'side' );\n remove_meta_box( 'prioritydiv', 'ticket', 'side' );\n remove_meta_box( 'severitydiv', 'ticket', 'side' );\n remove_meta_box( 'ticket_typediv', 'ticket', 'side' );\n remove_meta_box( 'resolutiondiv', 'ticket', 'side' );\n //remove_meta_box( 'severitydiv', 'ticket', 'side' );\n //remove_meta_box( 'severitydiv', 'ticket', 'side' );\n }", "function clean_data($string) {\r\n\tif (get_magic_quotes_gpc()) {\r\n\t\t$string = stripslashes($string);\r\n\t}\r\n\t$headers = array(\r\n \t\"/to\\:/i\",\r\n \t\"/from\\:/i\",\r\n \t\"/bcc\\:/i\",\r\n \t\"/cc\\:/i\",\r\n \t\"/Content\\-Transfer\\-Encoding\\:/i\",\r\n \t\"/Content\\-Type\\:/i\",\r\n \t\"/Mime\\-Version\\:/i\" \r\n \t); \r\n \t$string = preg_replace($headers, '', $string);\r\n \r\n\treturn strip_tags($string);\r\n}", "function removeLicense($extrainfo = array ())\n\t{\n\t\t// clean from old values\n\t\t$this->dao->cleanArchive(null, null, $extrainfo['module']);\n\n\t\treturn $extrainfo;\n\t}", "public function cleanup() {\n\t\tforeach ( array(\n\t\t\t'leadin_portal_domain',\n\t\t\t'leadin_portalId',\n\t\t\t'leadin_pluginVersion',\n\t\t\t'hubspot_affiliate_code',\n\t\t\t'hubspot_acquisition_attribution',\n\t\t) as $option_name\n\t\t) {\n\t\t\tif ( get_option( $option_name ) ) {\n\t\t\t\tdelete_option( $option_name );\n\t\t\t}\n\t\t}\n\t}", "function remove_generators() {\n\treturn '';\n}", "private function cleanAggregations()\n {\n if (!$this->aggregationStatus->isEnabled()) {\n $this->requestData['aggregations'] = [];\n } else {\n if (array_key_exists('aggregations', $this->requestData) && is_array($this->requestData['aggregations'])) {\n foreach ($this->requestData['aggregations'] as $aggregationName => $aggregationValue) {\n switch ($aggregationValue['type']) {\n case 'dynamicBucket':\n if (is_string($aggregationValue['method'])\n && preg_match('/^\\$(.+)\\$$/si', $aggregationValue['method'])\n ) {\n unset($this->requestData['aggregations'][$aggregationName]);\n }\n }\n }\n }\n }\n }", "function delete_format($text, $etiquetas_permitidas = NULL)\n{\n return strip_tags($text, $etiquetas_permitidas);\n}", "function cs_supprime_notes($texte) {\r\n\treturn preg_replace(', *\\[\\[(.*?)\\]\\],msS', '', $texte);\r\n}", "function advanced_settings_fields_filter1($fields) {\n $model_config = WYSIJA::get('config', 'model');\n if ($model_config->getValue('premium_key')) {\n unset($fields['bounce_email']);\n }\n return $fields;\n }", "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }", "function first_edition_deregister_styles() {\n\tif ( '' != get_option( 'first_edition_font_pair' ) ) {\n\t\twp_dequeue_style( 'quattrocento' );\n\t\twp_dequeue_style( 'quattrocento-sans' );\n\t}\n}", "function bt_custom_shipping_fields( $fields = array() ) {\n unset($fields['shipping_company']);\n // unset($fields['shipping_address_1']);\n // unset($fields['shipping_address_2']);\n // unset($fields['shipping_state']);\n // unset($fields['shipping_city']);\n // unset($fields['shipping_phone']);\n // unset($fields['shipping_postcode']);\n // unset($fields['shipping_country']);\n return $fields;\n}", "function remove_sl(){\n\t\t\n\t}", "function js_remove_checkout_fields( $fields ) {\n if( ! is_checkout() ) return $fields;\n $cart = WC()->cart->get_cart();\n $total_price = 0;\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 $total_price += $price;\n }\n // if any cart items are greater than 0 end loop the rest of the function is dunzo\n if ($total_price > 0){\n return $fields;\n } \n\n // Billing fields\n unset( $fields['billing']['billing_company'] );\n unset( $fields['billing']['billing_phone'] );\n unset( $fields['billing']['billing_state'] );\n unset( $fields['billing']['billing_address_1'] );\n unset( $fields['billing']['billing_address_2'] );\n unset( $fields['billing']['billing_city'] );\n unset( $fields['billing']['billing_postcode'] );\n\n // Shipping fields\n unset( $fields['shipping']['shipping_company'] );\n unset( $fields['shipping']['shipping_phone'] );\n unset( $fields['shipping']['shipping_state'] );\n unset( $fields['shipping']['shipping_first_name'] );\n unset( $fields['shipping']['shipping_last_name'] );\n unset( $fields['shipping']['shipping_address_1'] );\n unset( $fields['shipping']['shipping_address_2'] );\n unset( $fields['shipping']['shipping_city'] );\n unset( $fields['shipping']['shipping_postcode'] );\n\n // Order fields\n unset( $fields['order']['order_comments'] );\n \n return $fields;\n}", "function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n\n return $types;\n}", "function clear_all () {\n $this->clear_to();\n $this->clear_cc();\n $this->clear_bcc();\n $this->all_emails = array();\n }", "function _ut_remove_default_vc_templates( $data ) {\r\n \r\n $data = array();\r\n \r\n return $data;\r\n \r\n}", "function remove_editor_styles()\n {\n }", "function remove_autop_template_content( $init, $editor_id ) {\r\n $init['apply_source_formatting'] = true;\r\n $init['wpautop'] = false;\r\n $init['remove_linebreaks'] = false;\r\n return $init;\r\n }", "public function getRemoveLineBreaksFromTemplate() {}", "function tiny_mce_remove_unused_formats($init) {\n $init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Address=address;Pre=pre';\n return $init;\n}", "function custom_override_checkout_fields( $fields ) {\n unset($fields['billing']['billing_phone']);\n\n // REMOVING BILLING COMPANY\n unset($fields['billing']['billing_company']);\n\n // REMOVING ADDITIONAL INFORMATION FIELD\n unset($fields['order']['order_comments']);\n\n return $fields;\n}", "function ab_removeEnts($s){ // reformat all entities so WP won't screw with them\n\treturn preg_replace('|&([0-9a-zA-Z#]{1,5});|', '__abENT__$1;', $s);\n}", "private function deleteTranslations()\n {\n $sql = \"DELETE FROM s_core_snippets WHERE namespace in ('frontend/\". $this->getPaymentController() .\"/form/cp',\"\n . \"'frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 'frontend/\". $this->getPaymentController() .\"/result', \"\n . \"'frontend/\". $this->getPaymentController() .\"/confirmation', \"\n . \"'frontend/payment_information/information', 'frontend/payment_information/form/register_cp',\"\n . \"'frontend/payment_information/form/change_cp', 'frontend/payment_information/delete',\n 'frontend/\". $this->getPaymentController() .\"/form/response_redirect')\";\n Shopware()->Db()->query($sql);\n $sql = \"DELETE FROM s_core_snippets WHERE namespace in ('frontend/checkout/shipping_payment',\"\n . \"'sidebar', 'frontend/account/sidebar', 'backend/error/index', \"\n . \"'frontend/account/payment', 'backend/order/main') \"\n . \"AND name IN ('FRONTEND_PM_CC','FRONTEND_PM_CCSAVED','FRONTEND_PM_DC','FRONTEND_PM_DD',\"\n . \"'FRONTEND_PM_DDSAVED','FRONTEND_PM_EPS','FRONTEND_PM_GIROPAY','FRONTEND_PM_IDEAL',\"\n . \"'FRONTEND_PM_KLARNAPAYLATER','FRONTEND_PM_EASYCREDIT',\"\n . \"'FRONTEND_PM_KLARNASLICEIT','FRONTEND_PM_MASTERPASS',\"\n . \"'FRONTEND_PM_PAYPAL','FRONTEND_PM_PAYPALSAVED','FRONTEND_PM_PAYDIREKT','FRONTEND_PM_KLARNAOBT',\"\n . \"'FRONTEND_PM_SWISSPOSTFINANCE','FRONTEND_MC_INFO',\"\n . \"'MODULE_PAYMENT_VRPAYECOMMERCE_EASYCREDIT_TEXT_ERROR_CREDENTIALS', 'ERROR_EASYCREDIT_FUTURE_DOB',\"\n . \"'ERROR_EASYCREDIT_PARAMETER_DOB','ERROR_MESSAGE_EASYCREDIT_PARAMETER_GENDER','ERROR_CAPTURE_BACKEND',\"\n . \"'ERROR_MESSAGE_EASYCREDIT_AMOUNT_NOTALLOWED','ERROR_EASYCREDIT_BILLING_NOTEQUAL_SHIPPING',\"\n . \"'ERROR_REFUND_BACKEND','ERROR_REORDER_BACKEND', 'ERROR_RECEIPT_BACKEND', 'SUCCESS_IN_REVIEW',\"\n .\"'FRONTEND_EASYCREDIT_TERMS')\";\n Shopware()->Db()->query($sql);\n $sql = \"DELETE FROM s_core_snippets WHERE namespace in ('confirm') \"\n . \"AND name IN ('FRONTEND_EASYCREDIT_CONFIRM_BUTTON')\";\n Shopware()->Db()->query($sql);\n }", "public function removeNamespaceDeclarations() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_NAMESPACE_DECLARATION, '', $this->processedClassCode);\n\t}", "function UnsetRequest()\n {\n \n unset($_REQUEST[\"mco_proveedores__PVE_ID\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_NOMBRE\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_DIRECCION\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_TELEFONO\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_CELULAR\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_EMAIL\"]);\n }", "public function cleanup() {\n $this->object->removeLock();\n $this->clearCache();\n\n $returnArray = $this->object->get(array_diff(array_keys($this->object->_fields), array('content','ta','introtext','description','link_attributes','pagetitle','longtitle','menutitle','properties')));\n foreach ($returnArray as $k => $v) {\n if (strpos($k,'tv') === 0) {\n unset($returnArray[$k]);\n }\n }\n\t\t\n\t\t// Remove translations fields\n\t\t$translations = $this->getTranslatedFields();\n\t\tforeach($translations as $lang => $fields){\n\t\t\tforeach($fields as $key => $val){\n\t\t\t\tif(isset($returnArray[$key.$lang])){\n\t\t\t\t\tunset($returnArray[$key.$lang]);\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t\t\n\t\t$this->modx->log(1,print_r($returnArray,true));\n\n\t\t\n $returnArray['class_key'] = $this->object->get('class_key');\n $this->workingContext->prepare(true);\n $returnArray['preview_url'] = $this->modx->makeUrl($this->object->get('id'), $this->object->get('context_key'), '', 'full');\n return $this->success('',$returnArray);\n }", "function remove_fields_print($confArr, $showitem)\n{\n if ($confArr['downgrade.']['enable.']['print'])\n {\n return $showitem;\n }\n $showitem = str_replace('print,', null, $showitem);\n $showitem = str_replace('printcaption,', null, $showitem);\n $showitem = str_replace('printseo,', null, $showitem);\n return $showitem;\n}", "function wp_oembed_remove_provider($format)\n {\n }", "private function removeProjections()\n {\n //I mustn't make assumption about the underlying table structure\n $this->entityManager->getConnection()->query('TRUNCATE product')->execute();\n }", "function tags_tinymce_fix( $init )\n{\n // html elements being stripped\n $init['extended_valid_elements'] = 'i[*],span[*]';\n // don't remove line breaks\n $init['remove_linebreaks'] = false;\n // convert newline characters to BR\n $init['convert_newlines_to_brs'] = true;\n // don't remove redundant BR\n $init['remove_redundant_brs'] = false;\n // pass back to wordpress\n return $init;\n}", "function resetMailer(){\r\n\tglobal $mailer;\r\n\t$mailer->ClearAllRecipients();\r\n\t$mailer->ClearAttachments();\r\n\t$mailer->ClearCustomHeaders();\r\n}", "public function removeAllExtras()\n {\n $extras = $this->getPricing()->getAllExtras();\n foreach ($extras as $extraCode => $extra) {\n if ($this->getPricing()->removeExtra($extraCode)) {\n // Remove the extra via an api request\n $extra = \\tabs\\api\\client\\ApiClient::getApi()->delete(\n \"/booking/{$this->getBookingId()}/extra/{$extraCode}\"\n );\n }\n }\n\n // Update the current object\n return $this->_setBookingData();\n }", "public function enableRemoveLineBreaksFromTemplate() {}", "public abstract function resetComposer();", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "function edd_pup_get_email_templates() {\r\n\r\n\t$templates = edd_get_email_templates();\r\n\t$eddpdfi_email_templates = array(\r\n\t\t'invoice_default',\r\n\t\t'blue_stripe',\r\n\t\t'lines',\r\n\t\t'minimal',\r\n\t\t'traditional',\r\n\t\t'invoice_blue',\r\n\t\t'invoice_green',\r\n\t\t'invoice_orange',\r\n\t\t'invoice_pink',\r\n\t\t'invoice_purple',\r\n\t\t'invoice_red',\r\n\t\t'invoice_yellow'\r\n\t);\r\n\r\n\tforeach ( $eddpdfi_email_templates as $pdftemplate ) {\r\n\t\tif ( array_key_exists( $pdftemplate, $templates ) ) {\r\n\t\t\tunset( $templates[$pdftemplate] );\r\n\t\t}\r\n\t}\r\n\r\n\treturn $templates;\r\n}", "function tags_tinymce_fix( $init )\n{\n // html elements being stripped\n $init['extended_valid_elements'] = 'div[*],article[*]';\n // don't remove line breaks\n $init['remove_linebreaks'] = false;\n // convert newline characters to BR\n $init['convert_newlines_to_brs'] = true;\n // don't remove redundant BR\n $init['remove_redundant_brs'] = false;\n // pass back to wordpress\n return $init;\n}", "function pramble_remove_version(){\n\t\t\t\treturn '';\n\t\t\t}", "function clean_extraneous_inline() {\r\n\t}", "function hook_commerce_adyen_payment_types_alter(array &$payment_types) {\n unset($payment_types['openinvoice']);\n}", "public function cleanup()\n {\n // Remove old parts without binaries \n $this->removePartsWithoutBinary();\n \n // Remove parts where the binary is missing\n $this->removePartsWithMissingBinary();\n \n // Remove binaries without parts\n $this->removeBinariesWithoutParts();\n }", "function remove_versao_wp() { return ''; }", "function remove_versao_wp() { return ''; }", "function cust_note_purge(){\r\n\t}", "public function htheme_remove_default_elements(){\r\n\r\n\t\t/*vc_remove_element(\"vc_row\");*/\r\n\t\tvc_remove_element(\"vc_cta_button2\");\r\n\t\tvc_remove_element(\"vc_button2\");\r\n\t\tvc_remove_element(\"vc_masonry_media_grid\");\r\n\t\tvc_remove_element(\"vc_masonry_grid\");\r\n\t\tvc_remove_element(\"vc_masonry_grid\");\r\n\t\tvc_remove_element(\"vc_media_grid\");\r\n\t\tvc_remove_element(\"vc_basic_grid\");\r\n\t\tvc_remove_element(\"vc_cta\");\r\n\t\tvc_remove_element(\"vc_btn\");\r\n\t\tvc_remove_element(\"vc_custom_heading\");\r\n\t\tvc_remove_element(\"vc_empty_space\");\r\n\t\tvc_remove_element(\"vc_line_chart\");\r\n\t\tvc_remove_element(\"vc_round_chart\");\r\n\t\tvc_remove_element(\"vc_pie\");\r\n\t\tvc_remove_element(\"vc_raw_js\");\r\n\t\tvc_remove_element(\"vc_raw_html\");\r\n\t\tvc_remove_element(\"vc_video\");\r\n\t\tvc_remove_element(\"vc_widget_sidebar\");\r\n\t\tvc_remove_element(\"vc_tta_pageable\");\r\n\t\tvc_remove_element(\"vc_tta_accordion\");\r\n\t\tvc_remove_element(\"vc_tta_tour\");\r\n\t\tvc_remove_element(\"vc_tta_tabs\");\r\n\t\tvc_remove_element(\"vc_gallery\");\r\n\t\tvc_remove_element(\"vc_gallery\");\r\n\t\tvc_remove_element(\"vc_text_separator\");\r\n\t\t//vc_remove_element(\"vc_icon\");\r\n\t\t//vc_remove_element(\"vc_column_text\");\r\n\t\tvc_remove_element(\"vc_button\");\r\n\t\tvc_remove_element(\"vc_posts_slider\");\r\n\t\tvc_remove_element(\"vc_gmaps\");\r\n\t\tvc_remove_element(\"vc_teaser_grid\");\r\n\t\tvc_remove_element(\"vc_progress_bar\");\r\n\t\tvc_remove_element(\"vc_facebook\");\r\n\t\tvc_remove_element(\"vc_tweetmeme\");\r\n\t\tvc_remove_element(\"vc_googleplus\");\r\n\t\tvc_remove_element(\"vc_facebook\");\r\n\t\tvc_remove_element(\"vc_pinterest\");\r\n\t\tvc_remove_element(\"vc_message\");\r\n\t\tvc_remove_element(\"vc_posts_grid\");\r\n\t\tvc_remove_element(\"vc_carousel\");\r\n\t\tvc_remove_element(\"vc_flickr\");\r\n\t\tvc_remove_element(\"vc_tour\");\r\n\t\tvc_remove_element(\"vc_separator\");\r\n\t\tvc_remove_element(\"vc_single_image\");\r\n\t\tvc_remove_element(\"vc_cta_button\");\r\n\t\tvc_remove_element(\"vc_accordion\");\r\n\t\tvc_remove_element(\"vc_accordion_tab\");\r\n\t\tvc_remove_element(\"vc_toggle\");\r\n\t\tvc_remove_element(\"vc_tabs\");\r\n\t\tvc_remove_element(\"vc_tab\");\r\n\t\tvc_remove_element(\"vc_images_carousel\");\r\n\t\tvc_remove_element(\"vc_wp_archives\");\r\n\t\tvc_remove_element(\"vc_wp_calendar\");\r\n\t\tvc_remove_element(\"vc_wp_categories\");\r\n\t\tvc_remove_element(\"vc_wp_custommenu\");\r\n\t\tvc_remove_element(\"vc_wp_links\");\r\n\t\tvc_remove_element(\"vc_wp_meta\");\r\n\t\tvc_remove_element(\"vc_wp_pages\");\r\n\t\tvc_remove_element(\"vc_wp_posts\");\r\n\t\tvc_remove_element(\"vc_wp_recentcomments\");\r\n\t\tvc_remove_element(\"vc_wp_rss\");\r\n\t\tvc_remove_element(\"vc_wp_search\");\r\n\t\tvc_remove_element(\"vc_wp_tagcloud\");\r\n\t\tvc_remove_element(\"vc_wp_text\");\r\n\t\tvc_remove_element(\"woocommerce_cart\");\r\n\t\tvc_remove_element(\"woocommerce_checkout\");\r\n\t\tvc_remove_element(\"woocommerce_order_tracking\");\r\n\t\tvc_remove_element(\"woocommerce_my_account\");\r\n\t\tvc_remove_element(\"recent_products\");\r\n\t\tvc_remove_element(\"featured_products\");\r\n\t\tvc_remove_element(\"product\");\r\n\t\tvc_remove_element(\"products\");\r\n\t\tvc_remove_element(\"add_to_cart\");\r\n\t\tvc_remove_element(\"add_to_cart_url\");\r\n\t\tvc_remove_element(\"product_page\");\r\n\t\tvc_remove_element(\"product_category\");\r\n\t\tvc_remove_element(\"product_categories\");\r\n\t\tvc_remove_element(\"sale_products\");\r\n\t\tvc_remove_element(\"best_selling_products\");\r\n\t\tvc_remove_element(\"top_rated_products\");\r\n\t\tvc_remove_element(\"product_attribute\");/**/\r\n\t}", "function remove_additional_information_heading() {\n\treturn '';\n}", "private function removeGoogleServiceTags($body)\n {\n return str_replace('<wbr>', '', $body);\n }", "private function cleanProperties(&$properties) {\r\n unset($properties['identifier'],\r\n $properties['geometry'],\r\n $properties['_geometry'], \r\n $properties['metadata'], \r\n $properties['metadataMimeType'],\r\n $properties['wms'],\r\n $properties['resource'],\r\n $properties['resourceMimeType'],\r\n $properties['resourceSize'],\r\n $properties['resourceChecksum'],\r\n $properties['bbox3857'],\r\n $properties['bbox4326'],\r\n $properties['visibility']\r\n );\r\n \r\n }", "function wpb_remove_version() {\nreturn '';\n}", "public function clean()\n {\n $this->file = '';\n $this->vars = array();\n $this->headers = array();\n $this->metas = array();\n $this->jses = array();\n $this->javascript = array();\n $this->attachments = array();\n $this->csses = array();\n }", "function cleanVerseEndsInXml(&$bookContents) \r\n{\r\n foreach($bookContents as $mainElement)\r\n {\r\n if ( ! $mainElement or ! is_array($mainElement)) { continue; }\r\n \r\n foreach($mainElement as $psType=>$pContents) \r\n { \r\n if ($psType == 'p' && is_array($pContents) && $pContents) {\r\n cleanXmlForOneP($pContents);\r\n }\r\n }\r\n }\r\n}", "public function cleanMarkings()\n\t{\n\t\t$cleanMarkings=\"\";\n\t\tfor ($i=0;$i<count($this->tokens);++$i)\n\t\t{\n\t\t\t$c=$this->tokens[$i]['type'][0];\n\t\t\tif ($this->tokens[$i]['type']=='symbol')\n\t\t\t\t$c=\"@\";\n\t\t\t$cleanMarkings.=str_repeat($c, strlen($this->tokens[$i]['clean'])).\" \";\n\t\t\tif ($c=='c') //single line comment\n\t\t\t\t$cleanMarkings=substr($cleanMarkings,0,-1).\"\\n \";\n\t\t}\n\t\treturn $cleanMarkings;\n\t}", "public static function clean()\n {\n try {\n Mage::getModel('hackathon_ordertransaction/mongo')->clean();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }", "function kpl_user_bio_visual_editor_unfiltered() {\r\n\tremove_all_filters('pre_user_description');\r\n}", "function serendipity_removeObsoleteVars() {\nglobal $serendipity;\n\n $config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);\n foreach($config as $category) {\n foreach($category['items'] as $item) {\n /* Remove trash */\n if (!serendipity_checkConfigItemFlags($item, 'remove')) {\n serendipity_remove_config_var($item['var'], 0);\n }\n }\n }\n}", "public function cleanHeaders()\n {\n /* @codeCoverageIgnoreStart() */\n @header_remove();\n /* @codeCoverageIgnoreEnd */\n }", "protected function clean_properties(){\n\t\tglobal $database;\n\t\t$clean_properties = array();\n\t\tforeach($this->properties() as $key => $value){\n\t\t\t$clean_properties[$key]=$database->escape_string($value);\t\n\t\t}\n\t\treturn $clean_properties;\t\n\t}", "function endLineCharDelete()\n {\n $newArray = [];\n $array = $this->prepMethods;\n for ($i = 0; $i < count($array); $i++) {\n $new_element = str_replace($this->endLinePHP, $this->endLineSwift, $array[$i]);\n array_push($newArray, $new_element);\n }\n $this->prepMethods = $newArray;\n }", "function pmproex_pmpro_email_filter($email)\r\n{\r\n\tglobal $wpdb;\r\n \t\r\n\t//only update admin confirmation emails\r\n\tif(strpos($email->template, \"checkout\") !== false && strpos($email->template, \"_admin\") !== false)\r\n\t{\r\n\t\t//get the user_id from the email\r\n\t\t$order_id = $email->data['invoice_id'];\r\n\t\tif(!empty($order_id))\r\n\t\t{\r\n\t\t\t$order = new MemberOrder($order_id);\r\n\t\t\t\t\t\t\r\n\t\t\t//add to bottom of email\r\n\t\t\tif(!empty($order->notes))\r\n\t\t\t{\r\n\t\t\t\t$email->body .= \"<p>Order Notes</p><hr /><p>\" . $order->notes . \"</p>\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\t\r\n\treturn $email;\r\n}", "protected function cleanValidationMessages(){\n\t\tValidation::cleanValidationMessages();\n\t}", "public function clear() {\n $this->_documentBoost = FALSE;\n\n $this->_fields = array();\n $this->_fieldBoosts = array();\n }", "function remove() {\n $keys = \"\";\n $keys_array = $this->keys();\n for ($i = 0; $i < sizeof($keys_array); $i ++) {\n $keys .= \"'\" . $keys_array[$i] . \"',\";\n }\n $keys = substr($keys, 0, - 1);\n \n if (MODULE_PAYMENT_CGP_DROP_TABLE === 'True') {\n tep_db_query(\"DROP TABLE IF EXISTS `CGP_orders_table`\");\n }\n \n tep_db_query(\"DELETE FROM \" . TABLE_CONFIGURATION . \" WHERE configuration_key IN (\" . $keys . \")\");\n }", "public function clearBCCs()\n {\n }", "public function clearPurchaseOrderDetailReceivings()\n {\n $this->collPurchaseOrderDetailReceivings = null; // important to set this to NULL since that means it is uninitialized\n }", "function pnh_remove_invoice_in_packed_list()\r\n\t{\r\n\t\t$user=$this->auth(ADMINISTRATOR_ROLE);\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t$invoices=$this->input->post('invoice_nos');\r\n\t\t\r\n\t\tif($invoices)\r\n\t\t{\r\n\t\t\t$inv=implode(',',$invoices);\r\n\t\t\t\r\n\t\t\t$this->db->query(\"update shipment_batch_process_invoice_link set tray_id=0,packed_by=0,packed_on=0,packed=0 where invoice_no in ($inv) limit 1\");\r\n\t\t\t\r\n\t\t\tif($this->db->affected_rows())\r\n\t\t\t{\r\n\t\t\t\t$tray_territory_id=array();\r\n\t\t\t\t$cur_datetime=cur_datetime();\r\n\t\t\t\tforeach ($invoices as $invno)\r\n\t\t\t\t{\r\n\t\t\t\t\t$tray_inv_status=2;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// remove shipments/invoice from tray\r\n\t\t\t\t\t$tray_inv_link = $this->db->query(\"select tray_inv_id,tray_terr_id from pnh_t_tray_invoice_link where invoice_no = ? and status = 1 order by tray_inv_id desc limit 1 \",$invno)->row_array();\r\n\t\t\t\t\r\n\t\t\t\t\t// update tray invoice status = 2 for invno\r\n\t\t\t\t\t$this->db->query(\"update pnh_t_tray_invoice_link set status = $tray_inv_status,modified_on=?,modified_by=? where status = 1 and tray_inv_id = ? \",array($cur_datetime,$user['userid'],$tray_inv_link['tray_inv_id']));\r\n\t\t\t\t\t$tray_territory_id[]=$tray_inv_link['tray_terr_id'];\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tforeach($tray_territory_id as $id)\r\n\t\t\t\t{\r\n\t\t\t\t\t$tray_inv_link = $this->db->query(\"select tray_inv_id,tray_terr_id,invoice_no from pnh_t_tray_invoice_link where tray_terr_id=? and status = 1 order by tray_inv_id desc limit 1 \",$id);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($tray_inv_link->num_rows())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$this->db->query(\"update pnh_t_tray_territory_link set is_active = 0,modified_on=?,modified_by=? where is_active = 1 and tray_terr_id = ? \",array($cur_datetime,$user['userid'],$id));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Selected invoices removed in packed list\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tredirect($_SERVER['HTTP_REFERER']);;\r\n\t}", "function clean_out_dictionary_data () {\n\n\t$delete_taxonomies = $_POST['delete_taxonomies'];\n\n\t//deletes the xhtml file, if still there because import didn't get completed\n\t$import = new sil_pathway_xhtml_Import();\n\t$file = $import->get_latest_xhtmlfile();\n\tif(isset($file->ID))\n\t{\n\t\twp_delete_attachment( $file->ID );\n\t}\n\n\t// Remove all the old dictionary entries.\n\tremove_entries();\n\n\t// Uninstall the custom table(s) and taxonomies.\n\tif ($delete_taxonomies == 1)\n\t\tunregister_custom_taxonomies();\n\tuninstall_custom_tables();\n\n\t// Reinstall custom table(s) and taxonomies.\n\tcreate_search_tables();\n\tif ($delete_taxonomies == 1) {\n\t\tregister_semantic_domains_taxonomy();\n\t\tregister_part_of_speech_taxonomy();\n\t\tregister_language_taxonomy();\n\t}\n }", "protected function clean_proporties(){\n\t\tglobal $database;\n\n\n\t\t$clean_proporties= array();\n\n\t\tforeach ($this->proporties() as $key => $value) {\n\t\t\t$clean_proporties[$key]=$database->escape_string($value);\n\t\t}\n\n\t\treturn $clean_proporties;\n\t}", "function wpex_clean_shortcodes($content){ \n\t$array = array (\n\t\t'<p>[' => '[', \n\t\t']</p>' => ']', \n\t\t']<br />' => ']'\n\t);\n\t$content = strtr($content, $array);\n\treturn $content;\n}", "function wpex_clean_shortcodes($content){ \n$array = array (\n '<p>[' => '[', \n ']</p>' => ']', \n ']<br />' => ']'\n);\n$content = strtr($content, $array);\nreturn $content;\n}" ]
[ "0.5374431", "0.5211265", "0.5177234", "0.5147618", "0.5061221", "0.5061033", "0.5046138", "0.50120616", "0.49839824", "0.49648798", "0.49617448", "0.49410087", "0.4927653", "0.4914775", "0.4904754", "0.48957354", "0.48872977", "0.48815513", "0.48759353", "0.48601872", "0.4850342", "0.4820711", "0.48089495", "0.47978655", "0.4782771", "0.47794202", "0.47732306", "0.476762", "0.47588056", "0.474439", "0.47333342", "0.4716706", "0.47153297", "0.471309", "0.4711537", "0.47053903", "0.47053692", "0.46900138", "0.4679158", "0.4669954", "0.46676752", "0.4654144", "0.4653132", "0.4652513", "0.4651207", "0.4645015", "0.46378052", "0.46376032", "0.4634339", "0.46341038", "0.4630351", "0.4629362", "0.46263534", "0.46219993", "0.46192092", "0.4611084", "0.4608233", "0.46071464", "0.4603376", "0.45908955", "0.45906958", "0.45905766", "0.45869946", "0.45834157", "0.45775148", "0.45768014", "0.45724255", "0.45678332", "0.45606843", "0.45603412", "0.45601404", "0.4555755", "0.4552932", "0.4552208", "0.4552208", "0.4549453", "0.45482862", "0.45425576", "0.45401776", "0.4536807", "0.45344114", "0.45342207", "0.45279872", "0.45236263", "0.45228937", "0.4517662", "0.45134702", "0.45063055", "0.45047724", "0.45028707", "0.4497898", "0.44952953", "0.44951695", "0.44928142", "0.4489245", "0.44840983", "0.4482181", "0.4481279", "0.44785404", "0.4471095", "0.44703758" ]
0.0
-1
Using the data collected inside $controls (and submitted by a form containing the composer fields), updates the email. The message body is completed with doctype, head, style and the main wrapper.
static function update_email($email, $controls) { if (isset($controls->data['subject'])) { $email->subject = $controls->data['subject']; } // They should be only composer options foreach ($controls->data as $name => $value) { if (strpos($name, 'options_') === 0) { $email->options[substr($name, 8)] = $value; } } $email->editor = NewsletterEmails::EDITOR_COMPOSER; $email->message = self::get_html_open($email) . self::get_main_wrapper_open($email) . $controls->data['message'] . self::get_main_wrapper_close($email) . self::get_html_close($email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function form()\n\t{\n\t\tglobal $L;\n\t\t$sentEmails = $this->getSentEmailsArray();\n\n\t\t$html = '<div class=\"alert alert-primary\" role=\"alert\">';\n\t\t$html .= $this->description();\n\t\t$html .= '</div>';\n\n\t\t$html .= '<div>';\n\t\t// API key\n\t\t$html .= '<label><strong>Buttondown API Key</strong></label>';\n\t\t$html .= '<input id=\"apiKey\" name=\"apiKey\" type=\"text\" value=\"'.$this->getValue('apiKey').'\">';\n\t\t$html .= '<span class=\"tip\">Copy your API key on https://buttondown.email/settings/programming </span>';\n\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('paused').'</label>';\n\t\t$html .= '<select id=\"paused\" name=\"paused\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('paused')===true?'selected':'').'>'.$L->get('is-paused').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('paused')===false?'selected':'').'>'.$L->get('is-active').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('paused-tip').'</span>';\n\n\t\t// Start date\n\t\t$html .= '<label>'.$L->get('send-after').'</label>';\n\t\t$html .= '<input id=\"startDate\" name=\"startDate\" type=\"text\" value=\"'.$this->getValue('startDate').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('send-after-tip').'</span>';\n\t\t// Subject Prefix\n\t\t$html .= '<label>'.$L->get('subject-prefix').'</label>';\n\t\t$html .= '<input id=\"subjectPrefix\" name=\"subjectPrefix\" type=\"text\" value=\"'.$this->getValue('subjectPrefix').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('subject-prefix-tip').'</span>';\n\t\t\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('include-cover').'</label>';\n\t\t$html .= '<select id=\"includeCover\" name=\"includeCover\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('includeCover')===true?'selected':'').'>'.$L->get('yes').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('includeCover')===false?'selected':'').'>'.$L->get('no').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('include-cover-tip').'</span>';\n\t\t$html .= '</div><hr>';\n\t\t// List of page keys for which mail was sent \n\t\t$html .= '<h4>'.$L->get('sent-list').'</h4>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('sent-list-tip').'</span>';\n\t\t$html .= '<div style=\"overflow-y: scroll; height:400px;\"><ul>';\n\t\tforeach ($sentEmails as $sentKey):\n\t\t\t$html .= '<li>'.$sentKey.'</li>';\n\t\tendforeach;\n\t\t$html .= '</ul></div>';\n\t\t$html .= '<div><a target=\"_blank\" rel=\"noopener\" href=\"https://buttondown.email/archive\">Buttondown Archive</a></div>';\n\t\treturn $html;\n\t}", "public function presentBody() {\r\n $system = $this->getSystem();\r\n $enigma = $system->getEnigma();\r\n\r\n $rotor1 = $enigma->getRotorSetting(1);\r\n $rotor2 = $enigma->getRotorSetting(2);\r\n $rotor3 = $enigma->getRotorSetting(3);\r\n\r\n $dec = $system->getDecoded();\r\n $enc = $system->getEncoded();\r\n\r\n $html=<<<HTML\r\n <div class=\"body\">\r\n<form method=\"post\" action=\"post/receive.php\">\r\n<div class=\"dialog\">\r\nHTML;\r\n\r\n\r\n $html .= $this->rotor(1);\r\n $html .= $this->rotor(2);\r\n $html .= $this->rotor(3);\r\n\r\n $html .= <<<HTML\r\n<p><input type=\"submit\" name=\"set\" value=\"Set\"> <input type=\"submit\" name=\"cancel\" value=\"Cancel\"></p>\r\nHTML;\r\n\r\n $html .= $this->presentMessage();\r\n $html .= <<<HTML\r\n</div> \r\nHTML;\r\n\r\n if($this->session[\"message_number\"]!=\"0\"){\r\n $dec = $this->session['receive_dec'];\r\n\r\n\r\n $my_message=$this->messages->get($this->session[\"message_number\"]);\r\n $my_code=$my_message->getCode();\r\n $content=$my_message->getContent();\r\n $html.=<<<HTML\r\n\r\n\r\n<div class=\"encoder dialog\">\r\n<p class=\"code\">Code: $my_code</p>\r\n<p><textarea disabled name=\"from\">$dec</textarea> <textarea disabled name=\"to\">$content</textarea></p>\r\n<input type=\"hidden\" name=\"content\" value=\"$content\">\r\n<input type=\"hidden\" name=\"code\" value=\"$my_code\">\r\nHTML;\r\n $html.=<<<HTML\r\n\r\n</div>\r\nHTML;\r\n }\r\n\r\n\r\n\r\n\r\n\r\n $html.=<<<HTML\r\n \r\n<div class=\"dialog\"><table class=\"receive\">\r\n<tr><th>Select</th><th>Time</th><th>Sender</th></tr>\r\nHTML;\r\n\r\n $users=$this->users;\r\n $receive_messages=$this->messages->receiveMessage($this->user_id);\r\n $mes_number=$this->session[\"message_number\"];\r\n\r\n foreach ($receive_messages as $message){\r\n $mes_id=$message->getId();\r\n $date=$message->getDate();\r\n $date=strtotime($date);\r\n $date=date(\"M d, Y h:ia\",$date);\r\n $sender=$message->getSender();\r\n $user=$users->get($sender);\r\n $sender_name=$user->getName();\r\n\r\n if($mes_id==$mes_number){\r\n $html.=<<<HTML\r\n<tr><td><input value=\"$mes_id\" type=\"radio\" name=\"message\" checked></td><td>$date</td><td>$sender_name</td></tr>\r\nHTML;\r\n }\r\n else{\r\n\r\n\r\n $html.=<<<HTML\r\n<tr><td><input value=\"$mes_id\" type=\"radio\" name=\"message\"></td><td>$date</td><td>$sender_name</td></tr>\r\nHTML;\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n$html.=<<<HTML\r\n\r\n</table><p><input type=\"submit\" value=\"View\" name=\"view\"></p>$this->error_mes</div></form>\r\n</div>\r\nHTML;\r\n\r\n\r\n return $html;\r\n }", "private function emailTemplate($data) {\n $body = array_reduce($data, function($prevInput, $curInput) {\n return $prevInput . '<p style=\"font-family:sans-serif;font-size:14px;font-weight:normal;margin:0;Margin-bottom:2px;\">' . $curInput['name'] . ': ' . $curInput['value'] . '</p>' . PHP_EOL;\n });\n\n $email = '<!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <title>New Online Donation</title>\n <style type=\"text/css\">\n @media only screen and (max-width: 620px) {\n table[class=body] h1 {\n font-size: 28px !important;\n margin-bottom: 10px !important; }\n table[class=body] p,\n table[class=body] ul,\n table[class=body] ol,\n table[class=body] td,\n table[class=body] span,\n table[class=body] a {\n font-size: 16px !important; }\n table[class=body] .wrapper,\n table[class=body] .article {\n padding: 10px !important; }\n table[class=body] .content {\n padding: 0 !important; }\n table[class=body] .container {\n padding: 0 !important;\n width: 100% !important; }\n table[class=body] .main {\n border-left-width: 0 !important;\n border-radius: 0 !important;\n border-right-width: 0 !important; }\n table[class=body] .btn table {\n width: 100% !important; }\n table[class=body] .btn a {\n width: 100% !important; }\n table[class=body] .img-responsive {\n height: auto !important;\n max-width: 100% !important;\n width: auto !important; }}\n @media all {\n .ExternalClass {\n width: 100%; }\n .ExternalClass,\n .ExternalClass p,\n .ExternalClass span,\n .ExternalClass font,\n .ExternalClass td,\n .ExternalClass div {\n line-height: 100%; }\n .apple-link a {\n color: inherit !important;\n font-family: inherit !important;\n font-size: inherit !important;\n font-weight: inherit !important;\n line-height: inherit !important;\n text-decoration: none !important; }\n .btn-primary table td:hover {\n background-color: #34495e !important; }\n .btn-primary a:hover {\n background-color: #34495e !important;\n border-color: #34495e !important; } }\n </style>\n </head>\n <body class=\"\" style=\"background-color:#f6f6f6;font-family:sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.4;margin:0;padding:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"body\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background-color:#f6f6f6;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n <td class=\"container\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;display:block;max-width:960px;padding:10px;width:100%;Margin:0 auto !important;\">\n <div class=\"content\" style=\"box-sizing:border-box;display:block;Margin:0 auto;max-width:100%;padding:10px;\">\n <span class=\"preheader\" style=\"color:transparent;display:none;height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all;visibility:hidden;width:0;\">New Form Submission</span>\n <table class=\"main\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;background:#fff;border-radius:3px;width:100%;\">\n <tr>\n <td class=\"wrapper\" style=\"font-family:sans-serif;font-size:14px;vertical-align:top;box-sizing:border-box;padding:20px;\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse:separate;mso-table-lspace:0pt;mso-table-rspace:0pt;width:100%;\">\n <tr>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">\n <p style=\"font-family:sans-serif;font-size:24px;font-weight:normal;margin:0;Margin-bottom:24px;\">Here are the details:</p>\n ' . $body . '\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n </td>\n <td style=\"font-family:sans-serif;font-size:14px;vertical-align:top;\">&nbsp;</td>\n </tr>\n </table>\n </body>\n </html>';\n \n return $email;\n }", "public function buildBody() {\r\n\t//Generate the absolute URL to the directory where the images in the email can be found\r\n\t\t$directory = \"http://\" . $_SERVER['HTTP_HOST'] . str_replace(\"ajax/purchase.php\", \"\", $_SERVER['PHP_SELF']) . \"images/email-assets/\";\r\n\t\t\r\n\t//Clean the URL to the book cover\r\n\t\t$cleanURL = $this->imageURL;\r\n\t\t\r\n\t\tif (substr($cleanURL, 0, 7) == \"http://\" || substr($cleanURL, 0, 8) == \"https://\") {\r\n\t\t\t//Good!\r\n\t\t} else {\r\n\t\t\t$cleanURL = \"http://\" . $cleanURL;\r\n\t\t}\r\n\t\t\r\n\t//Generate the HTML version of the email\r\n\t\t$this->HTMLBody = \"<!DOCTYPE html>\r\n<html lang=\\\"en-US\\\">\r\n<head>\r\n<meta charset=\\\"utf-8\\\">\r\n<title>\" . $this->subject . \"</title>\r\n</head>\r\n\r\n<body>\r\n<table cellpadding=\\\"none\\\" style=\\\"border-collapse:collapse; border-top: 5px solid #000000;\\\" width=\\\"660\\\">\r\n<tbody>\r\n<tr>\r\n<td align=\\\"center\\\" background=\\\"\" . $directory . \"header-buyer.jpg\\\" height=\\\"647\\\" valign=\\\"top\\\" style=\\\"border-left: 1px solid #000000; border-right: 1px solid #000000;\\\" width=\\\"660\\\">\r\n<!--[if gte mso 9]>\r\n<v:rect xmlns:v=\\\"urn:schemas-microsoft-com:vml\\\" fill=\\\"true\\\" stroke=\\\"false\\\" style=\\\"height: 647px; width: 660px;\\\">\r\n<v:fill src=\\\"\" . $directory . \"header-buyer.jpg\\\" type=\\\"frame\\\" />\r\n<![endif]-->\r\n<table cellpadding=\\\"none\\\" style=\\\"border-collapse: collapse;\\\" width=\\\"640\\\">\r\n<tbody>\r\n<tr>\r\n<td height=\\\"208\\\"></td>\r\n</tr>\r\n\r\n<tr>\r\n<td align=\\\"center\\\" height=\\\"355\\\">\r\n<img alt=\\\"\" . htmlentities($this->title) . \" Book Cover\\\" height=\\\"355\\\" src=\\\"\" . $cleanURL . \"\\\" width=\\\"275\\\" />\r\n<p style=\\\"font-size: 17px; margin: 0px;\\\">&nbsp;</p>\r\n<p align=\\\"center\\\" style=\\\"color: #FFFFFF; font-family: Arial,sans-serif; font-size: 16px; margin: 0px;\\\">\\$\" . $this->price . \".00</p>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<!--[if gte mso 9]>\r\n</v:rect>\r\n<![endif]-->\r\n</td>\r\n</tr>\r\n\r\n<tr>\r\n<td style=\\\"border-left: 1px solid #000000; border-right: 1px solid #000000;\\\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td width=\\\"25\\\"></td>\r\n<td align=\\\"center\\\">\r\n<p align=\\\"center\\\" style=\\\"font-family: Arial,sans-serif; font-size: 16px;\\\">Congratulations! You've just requested <strong>\" . $this->title . \"</strong> from <strong>\" . $this->merchant . \"</strong>. You're only three steps away from obtaining your book!</p>\r\n</td>\r\n<td width=\\\"25\\\"></td>\r\n</tr>\r\n\r\n<tr height=\\\"30\\\">\r\n<td colspan=\\\"3\\\"></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n\r\n<img alt=\\\"Content Divider\\\" height=\\\"28\\\" src=\\\"\" . $directory . \"divider.jpg\\\" width=\\\"660\\\" />\r\n</td>\r\n</tr>\r\n\r\n<tr>\r\n<td style=\\\"border-left: 1px solid #000000; border-right: 1px solid #000000;\\\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td colspan=\\\"5\\\" height=\\\"10\\\"></td>\r\n</tr>\r\n\r\n<tr>\r\n<td align=\\\"center\\\" colspan=\\\"5\\\" height=\\\"25\\\">\r\n<h2 style=\\\"font-family: Arial,sans-serif; font-size: 24px; font-weight: 100; margin: 5px 0px 0px 0px; text-align: center;\\\">Next Steps</h2>\r\n</td>\r\n</tr>\r\n\r\n<tr>\r\n<td colspan=\\\"5\\\" height=\\\"25\\\"></td>\r\n</tr>\r\n\r\n<tr>\r\n<td width=\\\"35\\\"></td>\r\n<td>\r\n<img alt=\\\"Step Numbers\\\" height=\\\"232\\\" src=\\\"\" . $directory . \"numbers.jpg\\\" width=\\\"69\\\" />\r\n</td>\r\n<td width=\\\"25\\\"></td>\r\n<td>\r\n<table height=\\\"245\\\">\r\n<tbody>\r\n<tr>\r\n<td height=\\\"80\\\" valign=\\\"middle\\\"><p style=\\\"font-family: Arial,sans-serif; font-size: 16px;\\\">Ensure that you <strong>have \\$\" . $this->price . \".00</strong> on hand.</p></td>\r\n</tr>\r\n\r\n<tr>\r\n<td height=\\\"80\\\" valign=\\\"middle\\\"><p style=\\\"font-family: Arial,sans-serif; font-size: 16px;\\\">Wait for an <strong>email from \" . $this->merchant . \"</strong> with a propsed <strong>time and location</strong> to meet in person to exchange the book and funds.</p></td>\r\n</tr>\r\n\r\n<tr>\r\n<td height=\\\"80\\\" valign=\\\"middle\\\"><p style=\\\"font-family: Arial,sans-serif; font-size: 16px;\\\"><strong>Meet \" . $this->merchantFirstName . \"</strong> at the agreed-upon time and location to obtain your book!</p></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n<td width=\\\"35\\\"></td>\r\n</tr>\r\n\r\n<tr height=\\\"30\\\">\r\n<td colspan=\\\"5\\\"></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n\r\n<tr>\r\n<td align=\\\"center\\\" bgcolor=\\\"#181818\\\" height=\\\"45\\\" style=\\\"border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000;\\\" valign=\\\"middle\\\">\r\n<img alt=\\\"Small SGA Logo\\\" height=\\\"32\\\" src=\\\"\" . $directory . \"logo.jpg\\\" width=\\\"64\\\" />\r\n</td>\r\n</tr>\r\n\r\n<tr>\r\n<td><img alt=\\\"Shadow\\\" height=\\\"28\\\" src=\\\"\" . $directory . \"shadow.jpg\\\" width=\\\"660\\\" /></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</body>\r\n</html>\";\r\n\r\n\t//Generate the plain-text version of the email\r\n\t\t$this->textBody = \"Congratulations! You've just requested \" . $this->title . \" from \" . $this->merchant . \". You're only three steps away from obtaining your book!\r\n\t\r\n*** Book Information ***\r\n\r\n Title: \" . $this->title . \"\r\n Price: \\$\" . $this->price . \"\r\n\r\n*** Next Steps ***\r\n \r\n 1. Ensure that you have \\$\" . $this->price . \".00 on hand.\r\n 2. Wait for an email from \" . $this->merchant . \" with a propsed time and location to meet in person to exchange the book and funds.\r\n 3. Meet \" . $this->merchantFirstName . \" at the agreed-upon time and location to obtain your book!\r\n\r\n~ The Student Government Association\";\r\n\t}", "function m_emailBuilder()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_TOPMSG_BLK\", \"topmsg_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_SELECT_BLK\", \"select_blk\");\n\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_BTN_BLK\", \"btn_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_TESTMAIL_BLK\", \"testmail_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_TESTMAIL_BLK\",\"TPL_SENDMAIL_BLK\", \"sendmail_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_TESTMAIL_BLK\",\"TPL_SENTMSG_BLK\", \"sentmsg_blk\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\n\t\t#INTIALIZING\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"\");\n\t\t$this->ObTpl->set_var(\"btn_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"topmsg_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"testmail_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"sendmail_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"sentmsg_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"select_blk\",\"\");\n\n\t\t$emailRs[0]->vSubject =\"\";\n\t\t$emailRs[0]->vSid =\"\";\n\t\t$emailRs[0]->tHtmlMail =\"\";\n\t\t$emailRs[0]->tTextMail =\"\";\n\t\t$emailRs[0]->tmSentDate=\"\";\n\t\t$emailRs[0]->vUserList=$this->libFunc->ifSet($this->request,\"leadid\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ADMIN\",$_SESSION['uname']);\n\t\t#DISPLAYING MESSAGES\n\t\tif(isset($this->request['msg']) && $this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_UPDATED);\n\t\t\t$this->ObTpl->parse(\"topmsg_blk\",\"TPL_TOPMSG_BLK\");\n\t\t}\n\t\t\n\t\tif($this->err==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$this->errMsg);\n\t\t\t$this->ObTpl->parse(\"topmsg_blk\",\"TPL_TOPMSG_BLK\");\n\t\t}\n\n\t\t\n\t\tif(isset($_POST))\n\t\t{\n\t\t\tif(isset($this->request['subject']))\n\t\t\t\t$emailRs[0]->vSubject =$this->request['subject'];\n\t\t\tif(isset($this->request['sid']))\n\t\t\t\t$emailRs[0]->vSid=$this->request['sid'];\n\t\t\tif(isset($this->request['html_mail']))\n\t\t\t\t$emailRs[0]->tHtmlMail=$this->request['html_mail'];\n\t\t\tif(isset($this->request['text_mail']))\n\t\t\t\t$emailRs[0]->tTextMail=$this->request['text_mail'];\n\t\t\tif(isset($this->request['user_list']))\n\t\t\t\t$emailRs[0]->vUserList = $this->request['user_list'];\n\t\t}\n\n\n\t\tif(isset($this->request['id']) && !empty($this->request['id']) && is_numeric($this->request['id']))\n\t\t{\n\t\t\tif($this->err==0)\n\t\t\t{\n\t\t\t\t#DATABASE QUERY\n\t\t\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS.\" WHERE iMailid_PK='\".$this->request['id'].\"'\";\n\t\t\t\t$emailRs = $this->obDb->fetchQuery();\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$this->libFunc->dateFormat2($emailRs[0]->tmSentDate));\n\t\t\t\tif(empty($emailRs[0]->tmSentDate))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->parse(\"sendmail_blk\",\"TPL_SENDMAIL_BLK\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->parse(\"sentmsg_blk\",\"TPL_SENTMSG_BLK\");\n\t\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"testmail_blk\",\"TPL_TESTMAIL_BLK\");\t\n\t\t\t\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MODE\",\"edit\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$this->request['id']);\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BTNLBL\",LBL_EDITCAMPAIGN_BTN);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MODE\",\"add\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BTNLBL\",LBL_ADDCAMPAIGN_BTN);\n\t\t}\n\n\n\t\t$this->ObTpl->parse(\"btn_blk\",\"TPL_BTN_BLK\");\n\n\t\t$this->obDb->query = \"SELECT count(*) as cntCustomer FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n\t\t$custCnt = $this->obDb->fetchQuery();\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CUSTCNT\",$custCnt[0]->cntCustomer);\n\n\t\tif(isset($emailRs[0]->vVisitorList)){\n\t\t\tif($emailRs[0]->vVisitorList == \"0\"){\n\t\t\t\t$this->ObTpl->set_var(\"TPL_MAILN_VISITORS\",\"selected='selected'\");\t\n\t\t\t}else{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_MAILY_VISITORS\",\"selected='selected'\");\t\n\t\t\t}\n\t\t}\n\n\t\t$this->obDb->query = \"SELECT count(*) as cntVisitor FROM \".NEWSLETTERS;\n\t\t$cntVisitor = $this->obDb->fetchQuery();\n\t\t$this->ObTpl->set_var(\"TPL_VAR_VISITORCNT\",$cntVisitor[0]->cntVisitor);\n\n\t\t$this->obDb->query = \"SELECT * FROM \".LEADS.\" WHERE vdescription!=' '\";\n\t\t$leadRs = $this->obDb->fetchQuery();\n\t\t$recordCount1=$this->obDb->record_count;\n\t\tif($recordCount1>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$recordCount1;$j++)\n\t\t\t{\t\t\n\t\t\t\tif (isset($this->request['leadid']))\n {\n $emailRs[0]->vUserList = $this->request['leadid'];\n }\n \n if($emailRs[0]->vUserList==$leadRs[$j]->iLeadid_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SELECTED\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SELECTED\",\"\");\n\t\t\t\t}\n \n \n\t\t\t\t$this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $leadRs[$j]->iLeadid_PK.\"'\";\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_COUNT\",$qryRs[0]->cnt);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_LEADID\",$leadRs[$j]->iLeadid_PK);\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_NAME\",$this->libFunc->m_displayContent($leadRs[$j]->vdescription));\n\n\t\t\t\t$this->ObTpl->parse(\"select_blk\",\"TPL_SELECT_BLK\",true);\n\t\t\t}\n\t\t}\t\n\n\t\t//******************************************\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($emailRs[0]->vSubject));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($emailRs[0]->vSid));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_HTMLMSG\",$this->libFunc->m_displayContent($emailRs[0]->tHtmlMail));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PLAINMSG\",$this->libFunc->m_displayContent($emailRs[0]->tTextMail));\t\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "static function prepare_controls($controls, $email) {\n foreach ($email->options as $name => $value) {\n if (strpos($name, 'composer_') === 0) {\n $controls->data['options_' . $name] = $value;\n }\n }\n\n $controls->data['message'] = TNP_Composer::unwrap_email($email->message);\n $controls->data['subject'] = $email->subject;\n }", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "private function _updateInternalMessage()\n {\n $from = trim($this->_generalSettings->getFrom());\n $from_name = trim($this->_generalSettings->getFromName());\n $reply_to = trim($this->_generalSettings->getReplyTo());\n $categories = explode(',', $this->_generalSettings->getCategories());\n $template = trim($this->_generalSettings->getTemplateID());\n $asm_group_id = trim($this->_generalSettings->getAsmGroupId());\n\n $xsmtpapi_header['category'] = [ 'magento2_sendgrid_plugin' ];\n foreach ($categories as $category) {\n $xsmtpapi_header['category'][] = trim($category);\n }\n\n if (! empty($template)) {\n $xsmtpapi_header['filters']['templates']['settings']['enable'] = 1;\n $xsmtpapi_header['filters']['templates']['settings']['template_id'] = $template;\n }\n\n // asm group id\n if ($asm_group_id != false and $asm_group_id != 0) {\n $xsmtpapi_header['asm_group_id'] = intval($asm_group_id);\n }\n\n if (! empty($from)) {\n $this->_message->setFrom($from);\n }\n\n if (! empty($from_name) and ! empty($from)) {\n $this->_message->setFrom($from, $from_name);\n }\n\n if (! empty($from_name) and empty($from)) {\n $initial_from = $this->_message->getFrom();\n $this->_message->setFrom($initial_from, $from_name);\n }\n\n if (! empty($reply_to)) {\n $this->_message->setReplyTo($reply_to);\n }\n }", "private function sendMessage() {\r\n $data = $this->_contactform->getValues();\r\n\r\n $viewParam = array(\r\n 'name' => $data['contactform_name'],\r\n 'email' => $data['contactform_email'],\r\n 'message' => nl2br(htmlentities($data['contactform_message'])),\r\n 'ip' => $_SERVER['REMOTE_ADDR']\r\n );\r\n\r\n $registry = Zend_Registry::getInstance();\r\n $contactInfo = $registry->get('contactinfo');\r\n $email = $contactInfo['email'];\r\n $name = $contactInfo['name'];\r\n\r\n $mail = new Portfolio_HtmlTemplateMailer();\r\n $mail->setSubject($data['contactform_subject'])\r\n ->setFrom($data['contactform_email'], $data['contactform_name'])\r\n ->setReplyTo($data['contactform_email'], $data['contactform_name'])\r\n ->addTo($email, $name)\r\n ->setViewParam($viewParam)\r\n ->sendHtmlTemplate('contact.phtml');\r\n }", "function toHTML(){\n\t\t$objEmailAddressInput = new Input(\"strEmailAddress\", \"strEmailAddressID\");\n\t\t$objEmailAddressInput->setClass(\"box\");\n\t\t$objEmailAddressInput->setValue(\"\");\n\t\t\n\t\t// Create the sender input box\n\t\t$objSenderInput = new Input(\"strSender\", \"strSenderID\");\n\t\t$objSenderInput->setClass(\"box\");\n\t\t$objSenderInput->setValue(\"\");\n\t\t\n\t\t// Create the text message input box\n\t\t$objEmailTextArea = new textArea(\"strEmailText\",\"strEmailTextID\");\n\t\t$objEmailTextArea->setClass(\"box\");\n\t\t$objEmailTextArea->setValue(\"\");\n\t\t\n\t\t// Create the email button input box\n\t\t$objSendEmailButton = new Button(\"strSendEmail\", \"strSendEmailID\");\n\t\t$objSendEmailButton->setValue(\"Send\");\n\t\t$objSendEmailButton->setAction(\"main.php\");\n\t\t\n\t\t// Determine if there are any error messages to be displayed\n\t\t$errorEmailAddress = get_error_message('strEmailAddress.err');\n\t\t$errorSender = get_error_message('strSender.err');\n\t\t$errorText = get_error_message('strEmailText.err');\n\t\t\n\t\t// Reload the email address, sender, or message session if it exists\n\t\tif(array_key_exists('strEmailAddress', $_SESSION))\n\t\t\t$objEmailAddressInput->setValue($_SESSION['strEmailAddress']);\n\t\tif(array_key_exists('strSender', $_SESSION))\n\t\t\t$objSenderInput->setValue($_SESSION['strSender']);\n\t\tif(array_key_exists('strEmailText', $_SESSION))\n\t\t\t$objEmailTextArea->setValue($_SESSION['strEmailText']);\n\t\t\n\t\t// Display the form in html\n\t\t$strHTML = \"<h2>Contact Us</h2>\n\t\t\t\t\t<p>\" . $this->_strText . \"</p>\". \n\t\t\t\t\t\"<form action=\\\"verifyEmail.php\\\" method=\\\"POST\\\">\n\t\t\t\t\t\t<div class=\\\"outerbox\\\"><br/>\n\t\t\t\t\t\t\tYour email address:<br/>\". \n\t\t\t\t\t\t\t\t$objEmailAddressInput->toHTML() . $errorEmailAddress . \"<br/>\". \n\t\t\t\t\t\t\t\"Name:<br/>\". \n\t\t\t\t\t\t\t\t$objSenderInput->toHTML() . $errorSender . \"<br/>\" . \n\t\t\t\t\t\t\t\"Message:<br/>\". \n\t\t\t\t\t\t\t\t$objEmailTextArea->toHTML() . $errorText . \"<br/>\". \n\t\t\t\t\t\t\t\"<br/><div class=\\\"toright\\\">\" . \n\t\t\t\t\t\t\t$objSendEmailButton->toHTML() . \n\t\t\t\t\t\t\"</div>\n\t\t\t\t\t</form></div>\";\n\t\t\t\t\t\t\t\n\t\treturn $strHTML;\n\t}", "function set_post_content($entry, $form){\r\n\t //Custom Form Submitted via PHP will go here\r\n\t // Get the IDs of the relevant fields and prepare an email message\r\n\t $message = print_r($entry, true);\r\n\t \r\n\t // Wrap test if any lines are larger than 70 characters\r\n\t $message = wordwrap($message, 70);\r\n\t \r\n\t// Send me an email for debugging\r\n\t// mail('[email protected]', 'Getting the Gravity Form Field IDs', $message);\r\n \r\n\t// Post the form to a specific URL to the desired CRM, in this case DebtPayPro\r\n\tfunction post_to_url($url, $data) {\r\n\t\t$fields = '';\r\n\t\tforeach($data as $key => $value) {\r\n\t\t\t$fields .= $key . '=' . $value . '&';\r\n\t\t}\r\n \r\n\t\trtrim($fields, '&');\r\n\t\t$post = curl_init();\r\n \r\n\t\t curl_setopt($post, CURLOPT_URL, $url);\r\n\t\t curl_setopt($post, CURLOPT_POST, count($data));\r\n\t\t curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\r\n\t\t curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $result = curl_exec($post);\r\n\t\t curl_close($post);\r\n\t}\r\n\t\r\n\t// Handle the form differently based on form ID\r\n\tif($form[\"id\"] == 1) { //FORM 1\r\n\t\tif (($entry[\"6\"]) == 'Private') {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 1.1\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t} else {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 1.2\"\r\n\t\t\t);\r\n\tpost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t}\r\n\t\r\n\t\r\n\t\r\n\t} elseif($form[\"id\"] == 2) { //FORM 2 \r\n\t\tif (($entry[\"6\"]) == 'Private') {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 2.1\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t} else {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 2.2\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t}\r\n\t\r\n\t\t\r\n}elseif($form[\"id\"] == 3) { //FORM 3\r\n\t\tif (($entry[\"6\"]) == 'Private') {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 3.1\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t} else {\r\n\t\t\t$data = array(\r\n\t\t\t\t\"loan_amount\"\t\t=>\t$entry[\"7\"],\r\n\t\t\t\t\"loan_status_f\"\t\t=>\t$entry[\"4\"],\r\n\t\t\t\t\"loan_type\"\t\t=>\t$entry[\"6\"],\r\n\t\t\t\t\"first_name\" \t\t=> \t$entry[\"1.3\"],\r\n\t\t\t\t\"last_name\" \t\t=> \t$entry[\"1.6\"],\r\n\t\t\t\t\"phone\" \t\t=> \t$entry[\"2\"],\r\n\t\t\t\t\"email\" \t\t=>\t$entry[\"3\"],\r\n\t\t\t\t\"lead_source\" \t\t=> \t\"Campaign 3.2\"\r\n\t\t\t);\r\npost_to_url(\"<ENTER POST URL HERE>\", $data);\r\n\t\t}\r\n\t\t}\r\n else { //Do nothing since there are no other forms\r\n}\r\n}", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $msg = html_div(\"ft_form_msg\") ;\r\n $msg->add(html_p(html_b(\"Processing the SDIF Queue requires\r\n processing swimmers, swim meets, and/or swim teams which are\r\n not currently stored in the database. Specify how unknown\r\n data should be processed.\"), html_br())) ;\r\n\r\n $td = html_td(null, null, $msg) ;\r\n $td->set_tag_attribute(\"colspan\", \"2\") ;\r\n $table->add_row($td) ;\r\n $table->add_row($this->element_label(\"Swimmers\"), $this->element_form(\"Swimmers\")) ;\r\n $table->add_row($this->element_label(\"Swim Meets\"), $this->element_form(\"Swim Meets\")) ;\r\n $table->add_row($this->element_label(\"Swim Teams\"), $this->element_form(\"Swim Teams\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "public function ShowForm()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$GLOBALS['AddonId'] = $this->GetId();\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t\t$this->ParseTemplate('emailchange.form');\n\t\t}", "public function outputSetupForm()\n {\n $this->_directFormHtml('iContact');\n }", "function saveReceptionistNotices($connection,$noticeFor,$noticeDate,$noticeSubject,$noticeText,$receptionistId,$userRole,$userEmailss,$noticeAction,$hiddenNoticeEditId){\n $noticeDate = date('Y-m-d',strtotime($noticeDate));\n if ($noticeAction == \"add\") {\n\n /*\n * Send emails also\n */\n $to = \"[email protected],\" . $userEmailss;\n $subject = \"Notice Board\";\n // Set content-type header for sending HTML email\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n // Additional headers\n $headers .= 'From: Allen Forum<[email protected]>' . \"\\r\\n\";\n $headers .= 'Cc: [email protected]' . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n $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\" 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 <title>Receptionist | Allenhouse</title>\n </head>\n <body style=\"-webkit-text-size-adjust: none; box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; height: 100%; line-height: 1.4; margin: 0; width: 100% !important;\" bgcolor=\"#F2F4F6\"><style type=\"text/css\">\nbody {\nwidth: 100% !important; height: 100%; margin: 0; line-height: 1.4; background-color: #F2F4F6; color: #74787E; -webkit-text-size-adjust: none;\n}\n@media only screen and (max-width: 600px) {\n .email-body_inner {\n width: 100% !important;\n }\n .email-footer {\n width: 100% !important;\n }\n}\n@media only screen and (max-width: 500px) {\n .button {\n width: 100% !important;\n }\n}\n</style>\n <span class=\"preheader\" style=\"box-sizing: border-box; display: none !important; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 1px; line-height: 1px; max-height: 0; max-width: 0; mso-hide: all; opacity: 0; overflow: hidden; visibility: hidden;\">Reception,Allenhouse Institute of Technology informs you that a new Notice shared with you.</span>\n <table class=\"email-wrapper\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%;\" bgcolor=\"#F2F4F6\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table class=\"email-content\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td class=\"email-masthead\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 25px 0; word-break: break-word;\" align=\"center\">\n <a href=\"http://allenforum.cubersindia.com\" class=\"email-masthead_name\" style=\"box-sizing: border-box; color: #bbbfc3; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; font-weight: bold; text-decoration: none; text-shadow: 0 1px 0 white;\">\n Notice Board </a>\n </td>\n </tr>\n <tr>\n <td class=\"email-body\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"-premailer-cellpadding: 0; -premailer-cellspacing: 0; border-bottom-color: #EDEFF2; border-bottom-style: solid; border-bottom-width: 1px; border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0; padding: 0; width: 100%; word-break: break-word;\" bgcolor=\"#FFFFFF\">\n <table class=\"email-body_inner\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 0 auto; padding: 0; width: 570px;\" bgcolor=\"#FFFFFF\">\n <tr>\n <td class=\"content-cell\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 35px; word-break: break-word;\">\n <h1 style=\"box-sizing: border-box; color: #2F3133; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 19px; font-weight: bold; margin-top: 0;\" align=\"left\">Hi, Allenits!</h1>\n <p style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Greetings of the Day,<br/>\n We hope you actively participating in Allenforum discussion,to resolve doubts of each other. Its a duty to inform you that an important ntoice has been shared with you\n </p> <p>for checking about it login to your <b>Allenforum accunt</b></p>\n <table class=\"body-action\" align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin: 30px auto; padding: 0; text-align: center; width: 100%;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif;\">\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <a href=\"http://allenforum.cubersindia.com\" class=\"button button--\" target=\"_blank\" style=\"-webkit-text-size-adjust: none; background: #ee5d42; border-color: #ee5d42; border-radius: 3px; border-style: solid; border-width: 10px 18px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16); box-sizing: border-box; color: #FFF; display: inline-block; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; text-decoration: none;\">Check</a>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n <p style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 16px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Regards\n <br />Allenforum Team</p>\n <img src=\"http://allenforum.cubersindia.com/home/ownImages/other/allenoverflow.png\" alt=\"allenforum\" width=\"200\" height=\"40\"/>\n <table class=\"body-sub\" style=\"border-top-color: #EDEFF2; border-top-style: solid; border-top-width: 1px; box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; margin-top: 25px; padding-top: 25px;\">\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <p class=\"sub\" style=\"box-sizing: border-box; color: #74787E; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"left\">Please do not reply to this email</p>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n <tr>\n <td style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; word-break: break-word;\">\n <table class=\"email-footer\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; 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: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; padding: 35px; word-break: break-word;\">\n <p class=\"sub align-center\" style=\"box-sizing: border-box; color: #AEAEAE; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"center\">© 2018 Allenforum. All rights reserved.</p>\n <p class=\"sub align-center\" style=\"box-sizing: border-box; color: #AEAEAE; font-family: Arial, \\'Helvetica Neue\\', Helvetica, sans-serif; font-size: 12px; line-height: 1.5em; margin-top: 0;\" align=\"center\">\n <a href=\"https://cubersindia.com\" target=\"_blank\">Cubersindia</a>\n <br />[email protected]\n <br />Kanpur-208021\n </p>\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\n // Send email\n @mail($to, $subject, $message, $headers);\n $query = \"INSERT INTO forum_notices SET notice_subject='$noticeSubject',notice='$noticeText',permission='$noticeFor',postedBy='$receptionistId',postedByUserType='$userRole',date_time='$noticeDate' \";\n } else if ($noticeAction == \"edit\"){\n if ($hiddenNoticeEditId) {\n $query = \"UPDATE forum_notices SET notice_subject='$noticeSubject',notice='$noticeText',permission='$noticeFor',postedBy='$receptionistId',postedByUserType='$userRole',date_time='$noticeDate' WHERE notice_id='$hiddenNoticeEditId'\";\n }\n\n }\n\n $result = $connection->query($query);\n return $result;\n }", "static private function submitEmail()\n {\n $id = $_POST['formid'];\n\n // Initiates new form handling instance\n $f = new FormHandling;\n\n // Gets the client email list (to, bcc, cc)\n $clientEmailList = $f->getClientEmail($id);\n\n // Gets the customer email (if set)\n $customerEmail = $f->getCustomerEmail($_POST);\n\n // dd($customerEmail);\n\n // Checks if in sandbox mode before sending email\n if(FALSE == submissionHandling::sandbox){\n\n // New email instance\n $e = new emailHandling();\n\n // render and send client email(s)\n if($clientEmailList['to']){\n $e->sendEmail($id,'client',$clientEmailList['to'],'Enquiry received','Hi',$clientEmailList['headers']);\n }\n\n // render and send customer email\n if($customerEmail){\n $e->sendEmail($id,'customer',$customerEmail,'Thanks for getting in touch','We will be in touch soon');\n }\n\n }\n }", "function accouk_contact_form_handler() {\n\n if(isset($_POST['message'])):\n\n $ini = parse_ini_file('forms/contact-form.ini');\n\n $name = $_POST['your_name'];\n $email = $_POST['email'];\n $message = $_POST['message'];\n $to = $ini['TO_EMAIL'];\n $recaptcha_secret = $ini['RECAPTCHA_SECRET'];\n\n //Check recaptcha is OK\n if( ! reCaptchaOk($recaptcha_secret, $_POST['g-recaptcha-response']) ) {\n $prompt = \"<p class='error'>Sorry, you're a very lovely ROBOT. Please try again.</p>\";\n include_once('forms/contact-form.php');\n return;\n }\n\n ob_start();\n include_once('templates/email/contact.php');\n $html = ob_get_contents();\n ob_end_clean();\n\n $to = \"[email protected]\";\n $subject = \"AndrewChart.co.uk Contact Form\";\n $headers = \"From: $name <$email>\" . \"\\r\\n\";\n $headers .= \"Reply-To: $name <$email>\" . \"\\r\\n\";\n $headers .= 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\n $mailsent = wp_mail($to, $subject, $html, $headers);\n\n if(!$mailsent) {\n $prompt = \"<p class='error'>Sorry, your email couldn't be sent. Please try again.</p>\";\n include_once('forms/contact-form.php');\n } else {\n echo \"<p class='success'>Thank you! Speak soon.</p>\";\n }\n\n return;\n\n endif;\n\n $name; $email; $message;\n $prompt = \"<p>I'd love to hear from you! Please get in touch below.</p>\";\n include_once('forms/contact-form.php');\n\n}", "function aform($setup,$subject,$to,$cc,$bcc,$from) {\n\t\t\n\t\tif (isset($_POST[\"Submit\"])) {\n\t\t\t\n\t\t\t// Compile all POST info\n\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t$$key = $value;\t\t\t\t\t\t\t\t\n\t\t\t\tif ($key != \"require\" && $key != \"Submit\" && $key != \"verify\" && $key != \"birthday\") {\n\t\t\t\t\t$message .= \"<span style='text-transform: capitalize; font-weight: 700;'>\".$key.\"</span> \".$value.\"<br /><br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//If \"Verify\" is set, then check to see if correct\n\t\t\tif ($birthday != \"\") {\n\t\t\t\tif ($birthday != $verify) {\n\t\t\t\t\t$error .= \"Invalid Verification Code<br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Check for \"required\" fields\n\t\t\tif ($require != \"\") {\n\t\t\t\t$dcheck = explode(\",\", $require);\n\t\t\t\t\n\t\t\t\twhile(list($check) = each($dcheck)) {\n\t\t\t\t\tif(!$$dcheck[$check]) {\n\t\t\t\t\t\t$error .= \"The <b>$dcheck[$check]</b> field is required.<br />\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Check the Email Address\n\t\t\t$checkEmail = validEmail($_POST[\"email\"]);\n\t\t\tif ($checkEmail != \"1\") {\n\t\t\t\t$error .= \"Your email is not valid. Please correct.<br />\";\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t\n\n\t\t/* Let's start by building the form */\n\t\t$form .= '\n\t\t<form method=\"post\" enctype=\"multipart/form-data\" class=\"form\">';\n\t\t$form .= \"\\n\";\n\t\t\t\t\t\t\t\t\n\t\t// let's loop the PIPES \"|\" and breakdown the UNDERSCORES \"_\" then use this data to build the form\n\t\t\t\t\t\n\t\t$formchunk = explode(\"|\", $setup);\n\t\t\t\t\t\n\t\tforeach ($formchunk as $key => $value) {\n\t\t\t$entrychunk = explode(\"_\", $value);\n\t\t\t$formalname = $entrychunk[0];\n\t\t\t$name = $entrychunk[1];\n\t\t\t$type = $entrychunk[2];\n\t\t\t\n\t\t\tif ($entrychunk[3] == \"required\") {\n\t\t\t\t$required = $entrychunk[3]; // this is an optional field for making it REQUIRED and may not be set\n\t\t\t\t$values = $entrychunk[4]; // this is an optional field for the VALUE and may not be set (most commonly used for \"select\" and \"radio\"\n\t\t\t} else {\n\t\t\t\t$values = $entrychunk[3]; // this is an optional field for the VALUE and may not be set (most commonly used for \"select\" and \"radio\"\n\t\t\t\t$required = $entrychunk[4]; // this is an optional field for making it REQUIRED and may not be set\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$form .= '\t\t\t\t\t\t<div>\n\t\t\t<label>'.$formalname.'</label>';\n\t\t\t$form .= \"\\n\";\n\t\t\tif ($_POST[$name]) {\n\t\t\t\t$valueDisplay = $_POST[$name];\n\t\t\t} else {\n\t\t\t\t$valueDisplay = $values;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($type) {\n\t\t\t\tcase \"text\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input name=\"'.$name.'\" type=\"text\" class=\"text\" id=\"'.$name.'\" value=\"'.$valueDisplay.'\">';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"password\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input name=\"'.$name.'\" type=\"password\" class=\"text\" id=\"'.$name.'\" value=\"'.$valueDisplay.'\">';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak; \n\t\t\t\tcase \"radio\":\n\t\t\t\t\t$form .= '<div class=\"radios\">';\n\t\t\t\t\t$valuechunk = explode(\"-\", $values);\n\t\t\t\t\tforeach ($valuechunk as $keey => $subvalue) {\n\t\t\t\t\t\tif ($subvalue == $valueDisplay) { $active = \" checked\"; }\n\t\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input type=\"radio\" name=\"'.$name.'\" value=\"'.$subvalue.'\" class=\"text radio\"'.$active.'> '.$subvalue.'<br />';\n\t\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t\t$active = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$form .= \"</div>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"checkbox\":\n\t\t\t\t\t$form .= '<div class=\"radios\">';\n\t\t\t\t\t$valuechunk = explode(\"-\", $values);\n\t\t\t\t\tforeach ($valuechunk as $keey => $subvalue) {\n\t\t\t\t\t\tif ($subvalue == $valueDisplay) { $active = \" checked\"; }\n\t\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"'.$name.'\" value=\"'.$subvalue.'\" class=\"text radio\"'.$active.'> '.$subvalue.'<br />';\n\t\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t\t$active = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$form .= \"</div>\";\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tcase \"select\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<select name=\"'.$name.'\" class=\"text select\">';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t\t<option value=\"\"></option>';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t$valuechunk = explode(\"-\", $values);\n\t\t\t\t\tforeach ($valuechunk as $keey => $subvalue) {\n\t\t\t\t\t\tif ($subvalue == $valueDisplay) { $active = \" selected\"; }\n\t\t\t\t\t\t$form .= '\t\t\t\t\t\t\t\t<option value=\"'.$subvalue.'\"'.$active.'>'.$subvalue.'</option>';\n\t\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\t\t$active = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t</select>';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"textarea\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<textarea name=\"'.$name.'\" class=\"text textarea\" id=\"'.$name.'\">'.$valueDisplay.'</textarea>';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"file\":\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input name=\"file\" class=\"text\" id=\"'.$name.'\" type=\"file\" />';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$verification = rand(1111, 9999);\n\t\t\t\t\t$form .= '\t\t\t\t\t\t\t<input type=\"hidden\" value=\"'.$verification.'\" name=\"birthday\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"verifytext\">'.$verification.'</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" value=\"\" name=\"verify\" class=\"text verify\" />';\n\t\t\t\t\t$form .= \"\\n\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$form .= '\t\t \t\t\t\t\t<div class=\"clear\"></div>';\n\t\t\t$form .= \"\\n\";\n\t\t\t$form .= '\t\t\t\t\t\t</div>';\n\t\t\t$form .= \"\\n\";\n\t\t\t$form .= \"\\n\";\n\t\t\t\t\n\t\t\tif ($required != \"\") {\n\t\t\t\t$requireding = $name;\n\t\t\t\tif ($req != \"\") {\n\t\t\t\t\t$req .= ','.$requireding;\n\t\t\t\t} else {\n\t\t\t\t\t$req .= $requireding;\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t$form .= '\n\t\t<div>\n\t\t\t<label><input type=\"hidden\" name=\"require\" value=\"'.$req.'\" />&nbsp;</label>\n\t\t\t<input type=\"submit\" name=\"Submit\" value=\"Submit\" class=\"submit\">\n\t\t\t<div class=\"clear\"></div>\n\t\t</div>\n\t\t</form>';\n\n\t\t\n\t\tif (isset($_POST[\"Submit\"])) {\n\n\n\t\t\tif ($_FILES['file']['tmp_name'] != \"\") {\n\n\t\t\t\t/* Attachment */\n\t\t\t\t$uploadto = $GLOBALS[\"uploadfolder\"];\n\t\t\t\t$docroot = $GLOBALS[\"documentroot\"];\n\t\t\t\t\n\t\t\t\t// Check Entension\n\t\t\t\t$extension = pathinfo($_FILES['file']['name']);\n\t\t\t\t$extension = $extension[extension];\n\t\t\t\t$allowed_paths = explode(\", \", $GLOBALS[\"allowed_ext\"]);\t\t\t\t\t\t\n\t\t\t\tfor($i = 0; $i < count($allowed_paths); $i++) {\n\t\t\t\t\tif ($allowed_paths[$i] == \"$extension\") {\n\t\t\t\t\t\t$ok = \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// Check File Size\n\t\t\t\tif ($ok == \"1\") {\n\t\t\t\t\tif($_FILES['file']['size'] > $GLOBALS[\"max_size\"]) {\n\t\t\t\t\t\t$error .= \"File size is too big!<br />\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ok = \"2\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\n\t\t\tif($error != \"\") {\n\t\t\t\t$fullmessage .= \"<p>\".$error.\"</p>\";\n\t\t\t\t$fullmessage .= $form;\n\t\t\t\treturn $fullmessage;\n\t\t\t} else { \n\t\t\t\t//success!\n\t\t\t\t\n\t\t\t\tif ($_FILES['file']['tmp_name'] == \"\") {\n\t\t\t\t\t/* No Attachment */\n\t\t\t\t\t$send_to = $to;\n\t\t\t\t\t$send_cc = $cc;\n\t\t\t\t\t$send_bcc = $bcc;\n\t\t\t\t\t$send_from = $from;\n\t\t\t\t\t$send_subject = $subject;\n\t\t\t\t\t$message .= \"IP Address: \".$_SERVER['REMOTE_ADDR']; \n\t\t\t\t\tamail($send_to,$send_cc,$send_bcc,$send_from,$send_subject,$message);\t\n\t\t\t\t\treturn \"<p>\".$GLOBALS[\"success\"].\"</p>\";\n\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\tif ($ok == \"2\") {\n\t\t\t\t\t\t@move_uploaded_file($_FILES['file']['tmp_name'], $uploadto.$_FILES['file']['name']);\n\t\t\t\t\t\t// how to use\n\t\t\t\t\t\t$my_file = $_FILES['file']['name'];\n\t\t\t\t\t\t$my_path = $doc.$uploadto;\n\t\t\t\t\t\t$my_name = $from;\n\t\t\t\t\t\t$my_mail = $from;\n\t\t\t\t\t\t$send_cc = $cc;\n\t\t\t\t\t\t$send_bcc = $bcc;\n\t\t\t\t\t\t$my_replyto = $from;\n\t\t\t\t\t\t$my_to = $to;\n\t\t\t\t\t\t$my_subject = $subject;\n\t\t\t\t\t\t$message .= \" IP Address: \".$_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\tmail_attachment($my_file, $my_path, $my_to, $my_mail, $my_name, $my_replyto, $my_subject, $message, $cc, $bcc);\t\t\t\t\t\t\t\n\t\t\t\t\t\treturn \"<p>\".$GLOBALS[\"success\"].\"</p>\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t} else {\n\t\t\treturn $form;\n\t\t}\n\t}", "private function sendCopy() {\r\n $data = $this->_contactform->getValues();\r\n\r\n $viewParam = array(\r\n 'domain' => $_SERVER['SERVER_NAME'],\r\n 'email' => $data['contactform_email'],\r\n 'subject' => $data['contactform_subject'],\r\n 'message' => nl2br(htmlentities($data['contactform_message']))\r\n );\r\n\r\n $mail = new Portfolio_HtmlTemplateMailer();\r\n $mail->setSubject($data['contactform_subject'])\r\n ->addTo($data['contactform_email'], $data['contactform_name'])\r\n ->setViewParam($viewParam)\r\n ->sendHtmlTemplate('contact_copy.phtml');\r\n }", "function progressive_webform_email($variables) {\r\n _form_set_class($variables['element'], array('form-control'));\r\n return theme_webform_email($variables);\r\n}", "protected function buildContatBody(array $data)\n {\n $info = $this->getWpSiteInformation();\n\n $input = [];\n foreach ($data as $field => $value) {\n if ('message' == $field) {\n $value = strip_tags(stripcslashes($value));\n }\n\n $input[$field] = htmlspecialchars($value);\n }\n\n $html = '<p>New message from '.$input['fullName'].' sent via the contact form on <a href=\"'.$info['url'].'\">'.$info['name'].'</a>!</p>';\n $html .= '<b>Full Name:</b> '.$input['fullName'].'<br>';\n $html .= '<b>Email:</b> <a href=\"mailto:'.$input['email'].'\">'.$input['email'].'</a><br>';\n $html .= '<b>Phone:</b> '.$input['phone'].'<br>';\n $html .= '<b>Message</b> '.$input['message'].'<br>';\n $html .= '<br><hr><p><em>This message was sent from '.$_SERVER['REMOTE_ADDR'].'.</em></p>';\n\n return $html;\n }", "private function getFormItBuilderOutput(){\n\t\t$s_submitVar = 'submitVar_'.$this->_id;\n\t\t$b_customSubmitVar=false;\n\t\tif(empty($this->_submitVar)===false){\n\t\t\t$s_submitVar = $this->_submitVar;\n\t\t\t$b_customSubmitVar=true;\n\t\t}\n\t\t$s_recaptchaJS='';\n\t\t$b_posted = false;\n\t\tif(isset($_REQUEST[$s_submitVar])===true){\n\t\t\t$b_posted=true;\n\t\t}\n\t\t$nl=\"\\r\\n\";\n\n\t\t//process and add form rules\n\t\t$a_fieldProps=array();\n\t\t$a_fieldProps_jqValidate=array();\n\t\t$a_fieldProps_jqValidateGroups=array();\n\t\t$a_fieldProps_errstringFormIt=array();\n\t\t$a_fieldProps_errstringJq=array();\n\t\t\n\t\t$a_formProps=array();\n\t\t$a_formProps_custValidate=array();\n\t\t$a_formPropsFormItErrorStrings=array();\n\n\t\tforeach($this->_rules as $rule){\n\t\t\t$o_elFull = $rule->getElement();\n\t\t\tif(is_array($o_elFull)===true){\n\t\t\t\t$o_el = $o_elFull[0];\n\t\t\t}else{\n\t\t\t\t$o_el = $o_elFull;\n\t\t\t}\n\t\t\t$elId = $o_el->getId();\n\t\t\t$elName = $o_el->getName();\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps[$elId])===false){\n\t\t\t\t$a_fieldProps[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_jqValidate[$elId])===false){\n\t\t\t\t$a_fieldProps_jqValidate[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringFormIt[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringFormIt[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_fieldProps_errstringJq[$elId])===false){\n\t\t\t\t$a_fieldProps_errstringJq[$elId]=array();\n\t\t\t}\n\t\t\tif(isset($a_formProps_custValidate[$elId])===false){\n\t\t\t\t$a_formProps_custValidate[$elId]=array();\n\t\t\t}\n\t\t\t\n\t\t\t$s_validationMessage=$rule->getValidationMessage();\n\t\t\tswitch($rule->getType()){\n\t\t\t\tcase FormRuleType::email:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'email';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextEmailInvalid=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'email:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'email:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::fieldMatch:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'password_confirm=^'.$o_elFull[1]->getId().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextPasswordConfirm=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'equalTo:\"#'.$o_elFull[1]->getId().'\"';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'equalTo:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','maxLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'maxLength=^'.$rule->getValue().'^';\n\t\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t}\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'maxlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'maxlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::maximumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'maxValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMaxValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'max:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'max:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumLength:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementCheckboxGroup')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'checkboxGroup','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','minLength'=>$rule->getValue(),'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t}\n\t\t\t\t\t//Made own validation rule cause FormIt doesnt behave with required.\n\t\t\t\t\t//$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinLength=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'minlength:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'minlength:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::minimumValue:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'minValue=^'.$rule->getValue().'^';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextMinValue=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'min:'.$rule->getValue();\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'min:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::numeric:\n\t\t\t\t\t$a_fieldProps[$elId][] = 'isNumber';\n\t\t\t\t\t$a_fieldProps_errstringFormIt[$elId][] = 'vTextIsNumber=`'.$s_validationMessage.'`';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'digits:true';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'digits:\"'.$s_validationMessage.'\"';\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::required:\n\t\t\t\t\tif(is_a($o_el, 'FormItBuilder_elementMatrix')){\n\t\t\t\t\t\t$s_type=$o_el->getType();\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementMatrix_'.$s_type,'required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_rows = $o_el->getRows();\n\t\t\t\t\t\t$a_columns = $o_el->getColumns();\n\t\t\t\t\t\t$a_namesForGroup=array();\n\t\t\t\t\t\tswitch($s_type){\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\tfor($col_cnt=0; $col_cnt<count($a_columns); $col_cnt++){\n\t\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt.'_'.$col_cnt;\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt.'_'.$col_cnt][] = 'required:\"'.$s_validationMessage.'\"';\n\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\tbreak;\n\t\t\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$elName.'_'.$row_cnt;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_'.$row_cnt][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_'.$row_cnt][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'check':\n\t\t\t\t\t\t\t\tfor($row_cnt=0; $row_cnt<count($a_rows);$row_cnt++){\n\t\t\t\t\t\t\t\t\t$s_fieldName = $elName.'_'.$row_cnt.'[]';\n\t\t\t\t\t\t\t\t\t$a_namesForGroup[]=$s_fieldName;\n\t\t\t\t\t\t\t\t\t$a_fieldProps_jqValidate[$s_fieldName][] = 'required:true';\n\t\t\t\t\t\t\t\t\t$a_fieldProps_errstringJq[$s_fieldName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$a_fieldProps_jqValidateGroups[$elName]=implode(' ',$a_namesForGroup);\n\t\t\t\t\t}else if(is_a($o_el, 'FormItBuilder_elementDate')){\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'elementDate','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName.'_0'][] = 'required:true,dateElementRequired:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName.'_0'][] = 'required:\"'.$s_validationMessage.'\",dateElementRequired:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'textfield','required'=>true,'errorMessage'=>$s_validationMessage);\n\t\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'required:true';\n\t\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'required:\"'.$s_validationMessage.'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase FormRuleType::date:\n\t\t\t\t\t$s_thisVal = $rule->getValue();\n\t\t\t\t\t$s_thisErrorMsg = str_replace('===dateformat===',$s_thisVal,$s_validationMessage);\n\t\t\t\t\t$a_formProps_custValidate[$elId][]=array('type'=>'date','fieldFormat'=>$s_thisVal,'errorMessage'=>$s_thisErrorMsg);\n\t\t\t\t\t$a_fieldProps[$elId][] = 'FormItBuilder_customValidation';\n\t\t\t\t\t$a_fieldProps_jqValidate[$elName][] = 'dateFormat:\\''.$s_thisVal.'\\'';\n\t\t\t\t\t$a_fieldProps_errstringJq[$elName][] = 'dateFormat:\"'.$s_thisErrorMsg.'\"';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//if some custom validation options were found (date etc) then add formItBuilder custom validate snippet to the list\n\t\tif(count($a_formProps_custValidate)>0){\n\t\t\t$GLOBALS['FormItBuilder_customValidation']=$a_formProps_custValidate;\n\t\t\tif(empty($this->_customValidators)===false){\n\t\t\t\t$this->_customValidators.=',';\n\t\t\t}\n\t\t\t$this->_customValidators.='FormItBuilder_customValidation';\n\t\t}\n\t\t\n\t\t//build inner form html\n\t\t$b_attachmentIncluded=false;\n\t\t$s_form='<div>'.$nl\n\t\t.$nl.'<div class=\"process_errors_wrap\"><div class=\"process_errors\">[[!+fi.error_message:notempty=`[[!+fi.error_message]]`]]</div></div>'\n\t\t.$nl.($b_customSubmitVar===false?'<input type=\"hidden\" name=\"'.$s_submitVar.'\" value=\"1\" />':'')\n\t\t.$nl.'<input type=\"hidden\" name=\"fke'.date('Y').'Sp'.date('m').'Blk:blank\" value=\"\" /><!-- additional crude spam block. If this field ends up with data it will fail to submit -->'\n\t\t.$nl;\n\t\tforeach($this->_formElements as $o_el){\n\t\t\t$s_elClass=get_class($o_el);\n\t\t\tif($s_elClass=='FormItBuilder_elementFile'){\n\t\t\t\t$b_attachmentIncluded=true;\n\t\t\t}\n\t\t\tif(is_a($o_el,'FormItBuilder_elementHidden')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else if(is_a($o_el,'FormItBuilder_htmlBlock')){\n\t\t\t\t$s_form.=$o_el->outputHTML();\n\t\t\t}else{\n\t\t\t\t$s_typeClass = substr($s_elClass,14,strlen($s_elClass)-14);\n\t\t\t\t$forId=$o_el->getId();\n\t\t\t\tif(\n\t\t\t\t\tis_a($o_el,'FormItBuilder_elementRadioGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementCheckboxGroup')===true\n\t\t\t\t\t|| is_a($o_el,'FormItBuilder_elementDate')===true\n\t\t\t\t){\n\t\t\t\t\t$forId=$o_el->getId().'_0';\n\t\t\t\t}else if(is_a($o_el,'FormItBuilder_elementMatrix')){\n\t\t\t\t\t$forId=$o_el->getId().'_0_0';\n\t\t\t\t}\n\t\t\t\t$s_forStr = ' for=\"'.htmlspecialchars($forId).'\"';\n\t\t\t\t\n\t\t\t\tif(is_a($o_el,'FormItBuilder_elementReCaptcha')===true){\n\t\t\t\t\t$s_forStr = ''; // dont use for attrib for Recaptcha (as it is an external program outside control of formitbuilder\n\t\t\t\t\t$s_recaptchaJS=$o_el->getJsonConfig();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$s_extraClasses='';\n\t\t\t\t$a_exClasses=$o_el->getExtraClasses();\n\t\t\t\tif(count($a_exClasses)>0){\n\t\t\t\t\t$s_extraClasses = ' '.implode(' ',$o_el->getExtraClasses());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$b_required = $o_el->isRequired();\n\t\t\t\t$s_form.='<div title=\"'.$o_el->getLabel().'\" class=\"formSegWrap formSegWrap_'.htmlspecialchars($o_el->getId()).' '.$s_typeClass.($b_required===true?' required':'').$s_extraClasses.'\">';\n\t\t\t\t\t$s_labelHTML='';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_desc=$o_el->getDescription();\n\t\t\t\t\t\tif(empty($s_desc)===false){\n\t\t\t\t\t\t\t$s_desc='<span class=\"description\">'.$s_desc.'</span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$s_labelHTML='<label class=\"mainElLabel\"'.$s_forStr.'><span class=\"before\"></span><span class=\"mainLabel\">'.$o_el->getLabel().'</span>'.$s_desc.'<span class=\"after\"></span></label>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$s_element='<div class=\"elWrap\">'.$nl.' <span class=\"before\"></span>'.$o_el->outputHTML().'<span class=\"after\"></span>';\n\t\t\t\t\tif($o_el->showLabel()===true){\n\t\t\t\t\t\t$s_element.='<div class=\"errorContainer\"><label class=\"formiterror\" '.$s_forStr.'>[[+fi.error.'.htmlspecialchars($o_el->getId()).']]</label></div>';\n\t\t\t\t\t}\n\t\t\t\t\t$s_element.='</div>';\n\t\t\t\t\t\n\t\t\t\t\tif($o_el->getLabelAfterElement()===true){\n\t\t\t\t\t\t$s_form.=$s_element.$s_labelHTML;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$s_form.=$s_labelHTML.$s_element;\n\t\t\t\t\t}\n\t\t\t\t$s_form.=$nl.'</div>'.$nl;\n\t\t\t}\n\t\t}\n\t\t$s_form.=$nl.'</div>';\n\n\t\t//wrap form elements in form tags\n\t\t$s_form='<form action=\"'.$this->_formAction.'\" method=\"'.htmlspecialchars($this->_method).'\"'.($b_attachmentIncluded?' enctype=\"multipart/form-data\"':'').' class=\"form\" id=\"'.htmlspecialchars($this->_id).'\">'.$nl\n\t\t.$s_form.$nl\n\t\t.'</form>';\n\t\t\n\t\t//add all formit validation rules together in one array for easy implode\n\t\t$a_formItCmds=array();\n\t\t$a_formItErrorMessage=array();\n\t\tforeach($a_fieldProps as $fieldID=>$a_fieldProp){\n\t\t\tif(count($a_fieldProp)>0){\n\t\t\t\t$a_formItCmds[]=$fieldID.':'.implode(':',$a_fieldProp);\n\t\t\t}\n\t\t}\n\t\t//add formIT error messages\n\t\tforeach($a_fieldProps_errstringFormIt as $fieldID=>$msgArray){\n\t\t\tforeach($msgArray as $msg){\n\t\t\t\t$a_formItErrorMessage[]='&'.$fieldID.'.'.$msg;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor($i=0; $i<count($a_formProps); $i++){\n\t\t\t$a_formItCmds[]=$a_formProps[$i];\n\t\t\tif(empty($a_formPropsFormItErrorStrings[$i])===false){\n\t\t\t\t$a_formItErrorMessage[]=$a_formPropsFormItErrorStrings[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if using database table then add call to final hook\n\t\t$b_addFinalHooks=false;\n\t\t$GLOBALS['FormItBuilder_hookCommands']=array('formObj'=>&$this,'commands'=>array());\n\t\tif(empty($this->_databaseTableObjectName)===false){\n\t\t\t$GLOBALS['FormItBuilder_hookCommands']['commands'][]=array('name'=>'dbEntry','value'=>array('tableObj'=>$this->_databaseTableObjectName,'mapping'=>$this->_databaseTableFieldMapping));\n\t\t\t$b_addFinalHooks=true;\n\t\t}\n\t\tif($b_addFinalHooks===true){\n\t\t\t$this->_hooks[]='FormItBuilder_hooks';\n\t\t}\n\t\t\n\t\t//rebuild hooks system\n\t\t$s_hooksStr = '';\n\t\tif(empty($this->_postHookName)===false){\n\t\t $s_hooksStr.=$this->_postHookName;\n\t\t}\n\t\tif(count($this->_hooks)>0){\n\t\t if(empty($this->_postHookName)===false){\n\t\t\t$s_hooksStr.=',';\n\t\t }\n\t\t $s_hooksStr.=implode(',',$this->_hooks);\n\t\t}\n\t\t$s_fullHooksParam='';\n\t\tif(empty($s_hooksStr)===false){\n\t\t $s_fullHooksParam=$nl.'&hooks=`'.$s_hooksStr.'`';\n\t\t}\n\t\t\n\t\t$s_formItCmd='[[!FormIt?'\n\t\t.$s_fullHooksParam\t\t\t\t\n\t\t.(empty($s_recaptchaJS)===false?$nl.'&recaptchaJs=`'.$s_recaptchaJS.'`':'')\n\t\t.(empty($this->_customValidators)===false?$nl.'&customValidators=`'.$this->_customValidators.'`':'')\n\t\t\t\n\t\t.(empty($this->_emailTpl)===false?$nl.'&emailTpl=`'.$this->_emailTpl.'`':'')\n\t\t.(empty($this->_emailToAddress)===false?$nl.'&emailTo=`'.$this->_emailToAddress.'`':'')\n\t\t.(empty($this->_emailToName)===false?$nl.'&emailToName=`'.$this->_emailToName.'`':'')\n\t\t.(empty($this->_emailFromAddress)===false?$nl.'&emailFrom=`'.$this->_emailFromAddress.'`':'')\n\t\t.(empty($this->_emailFromName)===false?$nl.'&emailFromName=`'.$this->_emailFromName.'`':'')\n\t\t.(empty($this->_emailReplyToAddress)===false?$nl.'&emailReplyTo=`'.$this->_emailReplyToAddress.'`':'')\n\t\t.(empty($this->_emailReplyToName)===false?$nl.'&emailReplyToName=`'.$this->_emailReplyToName.'`':'')\n\t\t.(empty($this->_emailCCAddress)===false?$nl.'&emailCC=`'.$this->_emailCCAddress.'`':'')\n\t\t.(empty($this->_emailCCName)===false?$nl.'&emailCCName=`'.$this->_emailCCName.'`':'')\n\t\t.(empty($this->_emailBCCAddress)===false?$nl.'&emailBCC=`'.$this->_emailBCCAddress.'`':'')\n\t\t.(empty($this->_emailBCCName)===false?$nl.'&emailBCCName=`'.$this->_emailBCCName.'`':'')\n\t\t\n\t\t.(empty($this->_autoResponderTpl)===false?$nl.'&fiarTpl=`'.$this->_autoResponderTpl.'`':'')\n\t\t.(empty($this->_autoResponderSubject)===false?$nl.'&fiarSubject=`'.$this->_autoResponderSubject.'`':'')\n\t\t.(empty($this->_autoResponderToAddressField)===false?$nl.'&fiarToField=`'.$this->_autoResponderToAddressField.'`':'')\n\t\t.(empty($this->_autoResponderFromAddress)===false?$nl.'&fiarFrom=`'.$this->_autoResponderFromAddress.'`':'')\n\t\t.(empty($this->_autoResponderFromName)===false?$nl.'&fiarFromName=`'.$this->_autoResponderFromName.'`':'')\n\t\t.(empty($this->_autoResponderReplyTo)===false?$nl.'&fiarReplyTo=`'.$this->_autoResponderReplyTo.'`':'')\n\t\t.(empty($this->_autoResponderReplyToName)===false?$nl.'&fiarReplyToName=`'.$this->_autoResponderReplyToName.'`':'')\n\t\t.(empty($this->_autoResponderCC)===false?$nl.'&fiarCC=`'.$this->_autoResponderCC.'`':'')\n\t\t.(empty($this->_autoResponderCCName)===false?$nl.'&fiarCCName=`'.$this->_autoResponderCCName.'`':'')\n\t\t.(empty($this->_autoResponderBCC)===false?$nl.'&fiarBCC=`'.$this->_autoResponderBCC.'`':'')\n\t\t.(empty($this->_autoResponderBCCName)===false?$nl.'&fiarBCCName=`'.$this->_autoResponderBCCName.'`':'')\n\t\t.$nl.'&fiarHtml=`'.($this->_autoResponderHtml===false?'0':'1').'`'\t\t\t\t\n\t\t\t\t\n\t\t.$nl.'&emailSubject=`'.$this->_emailSubject.'`'\n\t\t.$nl.'&emailUseFieldForSubject=`1`'\n\t\t.$nl.'&redirectTo=`'.$this->_redirectDocument.'`'\n\t\t.(empty($this->_redirectParams)===false?$nl.'&redirectParams=`'.$this->_redirectParams.'`':'')\n\t\t.$nl.'&store=`'.($this->_store===true?'1':'0').'`'\n\t\t.$nl.'&submitVar=`'.$s_submitVar.'`'\n\t\t.$nl.implode($nl,$a_formItErrorMessage)\n\t\t.$nl.'&validate=`'.(isset($this->_validate)?$this->_validate.',':'').implode(','.$nl.' ',$a_formItCmds).','.$nl.'`]]'.$nl;\n\t\t\n\t\tif($this->_jqueryValidation===true){\n\t\t\t$s_js='\t\n$().ready(function() {\n\njQuery.validator.addMethod(\"dateFormat\", function(value, element, format) {\n\tvar b_retStatus=false;\n\tvar s_retValue=\"\";\n\tvar n_retTimestamp=0;\n\tif(value.length==format.length){\n\t\tvar separator_only = format;\n\t\tvar testDate;\n\t\tif(format.toLowerCase()==\"yyyy\"){\n\t\t\t//allow just yyyy\n\t\t\ttestDate = new Date(value, 1, 1);\n\t\t\tif(testDate.getFullYear()==value){\n\t\t\t\tb_retStatus=true;\n\t\t\t}\n\t\t}else{\n\t\t\tseparator_only = separator_only.replace(/m|d|y/g,\"\");\n\t\t\tvar separator = separator_only.charAt(0)\n\n\t\t\tif(separator && separator_only.length==2){\n\t\t\t\tvar dayPos; var day; var monthPos; var month; var yearPos; var year;\n\t\t\t\tvar s_testYear;\n\t\t\t\tvar newStr = format;\n\n\t\t\t\tdayPos = format.indexOf(\"dd\");\n\t\t\t\tday = parseInt(value.substr(dayPos,2),10)+\"\";\n\t\t\t\tif(day.length==1){day=\"0\"+day;}\n\t\t\t\tnewStr=newStr.replace(\"dd\",day);\n\n\t\t\t\tmonthPos = format.indexOf(\"mm\");\n\t\t\t\tmonth = parseInt(value.substr(monthPos,2),10)+\"\";\n\t\t\t\tif(month.length==1){month=\"0\"+month;}\n\t\t\t\tnewStr=newStr.replace(\"mm\",month);\n\n\t\t\t\tyearPos = format.indexOf(\"yyyy\");\n\t\t\t\tyear = parseInt(value.substr(yearPos,4),10);\n\t\t\t\tnewStr=newStr.replace(\"yyyy\",year);\n\n\t\t\t\ttestDate = new Date(year, month-1, day);\n\n\t\t\t\tvar testDateDay=(testDate.getDate())+\"\";\n\t\t\t\tif(testDateDay.length==1){testDateDay=\"0\"+testDateDay;}\n\n\t\t\t\tvar testDateMonth=(testDate.getMonth()+1)+\"\";\n\t\t\t\tif(testDateMonth.length==1){testDateMonth=\"0\"+testDateMonth;}\n\n\t\t\t\tif (testDateDay==day && testDateMonth==month && testDate.getFullYear()==year) {\n\t\t\t\t\tb_retStatus = true;\n\t\t\t\t\t$(element).val(newStr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Please enter a valid date.\");\n\njQuery.validator.addMethod(\"dateElementRequired\", function(value, element, format) {\n\tvar el=element;\n\tb_retStatus=true;\n\tvar elBaseId=element.id.substr(0,element.id.length-2);\n\tif($(\"#\"+elBaseId+\"_0\").val()==\"\" || $(\"#\"+elBaseId+\"_1\").val()==\"\" || $(\"#\"+elBaseId+\"_2\").val()==\"\"){\n\t\tb_retStatus=false;\n\t}\n\treturn this.optional(element) || b_retStatus;\n}, \"Date element is required.\");\n\n//Main validate call\nvar thisFormEl=$(\"#'.$this->_id.'\");\nthisFormEl.validate({errorPlacement:function(error, element) {\n\tvar labelEl = element.parents(\".formSegWrap\").find(\".errorContainer\");\n\terror.appendTo( labelEl );\n},success: function(element) {\n\telement.addClass(\"valid\");\n\tvar formSegWrapEl = element.parents(\".formSegWrap\");\n\tformSegWrapEl.children(\".mainElLabel\").removeClass(\"mainLabelError\");\n},highlight: function(el, errorClass, validClass) {\n\tvar element= $(el);\n\telement.addClass(errorClass).removeClass(validClass);\n\telement.parents(\".formSegWrap\").children(\".mainElLabel\").addClass(\"mainLabelError\");\n},invalidHandler: function(form, validator){\n\t//make nice little animation to scroll to the first invalid element instead of an instant jump\n\tvar jumpEl = $(\"#\"+validator.errorList[0].element.id).parents(\".formSegWrap\");\n\t$(\"html,body\").animate({scrollTop: jumpEl.offset().top});\n if(FormItBuilderInvalidCallback){FormItBuilderInvalidCallback();}\n},ignore:\":hidden\",'.\n\t\t\t\t\t\n$this->jqueryValidateJSON(\n\t$a_fieldProps_jqValidate,\n\t$a_fieldProps_errstringJq,\n\t$a_fieldProps_jqValidateGroups\n).'});\n\t\n'.\n//Force validation on load if already posted\n($b_posted===true?'thisFormEl.valid();':'')\n.'\n\t\n});\n';\n\t\t}\n\t\t\n\t\t//Allows output of the javascript into a paceholder so in can be inserted elsewhere in html (head etc)\n\t\tif(empty($this->_placeholderJavascript)===false){\n\t\t\t$this->modx->setPlaceholder($this->_placeholderJavascript,$s_js);\n\t\t\treturn $s_formItCmd.$s_form;\n\t\t}else{\n\t\t\treturn $s_formItCmd.$s_form.\n'<script type=\"text/javascript\">\n// <![CDATA[\n'.$s_js.'\n// ]]>\n</script>';\n\t\t}\n\t}", "public function output_setup_form() {\n\t\t$related_api = Thrive_Dash_List_Manager::connection_instance( 'mandrill' );\n\t\tif ( $related_api->is_connected() ) {\n\t\t\t$credentials = $related_api->get_credentials();\n\t\t\t$this->set_param( 'email', $credentials['email'] );\n\t\t\t$this->set_param( 'mandrill-key', $credentials['key'] );\n\t\t}\n\n\t\t$this->output_controls_html( 'mailchimp' );\n\t}", "function form($action=null,$submit='Submit',$rows=null,$taction=null,$editmode=null) {\n\t //print_r($_POST);\n\t global $sFromErr;\n\t\t $taction = 'cpsubloadhtmlmail';//templates\n\t\t $iaction = 'cpsubloadimage';//add images (embed)\t\t \n\t\t $daction = 'cpsubattach';//add attachments\t\t \n\t\t \n\t\t $activebatch = $this->load_saved_batch();\n \n\t\t $sendto = GetParam('to')?GetParam('to'):$this->to;\n\t\t $sendcc = GetParam('cc')?GetParam('cc'):null;\t\t \n\t\t $sendbcc = GetParam('bcc')?GetParam('bcc'):null;\t\t\t \n\t\t \n\t\t $mailuser = $this->mailuser?$this->mailuser:$this->from;\t//echo '>',$mailname;\n\t $mymail = GetParam('from')?GetParam('from'):$mailuser;\t\t// echo '>',$mymail;\n\t\t\n\t\t \n\t\t if (!$submit)\n\t\t $submit = localize('_SUBMIT',getlocal());\n \n if (!$rows)\n\t\t $rows = 16;\n \n if ($action)\n\t\t $myaction = seturl(\"t=\".$action.\"&editmode=\".GetReq('editmode')); \n\t\t else \n $myaction = seturl(\"t=cmail\".\"&editmode=\".GetReq('editmode')); \n\t\t \n\t\t //in case of activebatch ..go directly to batch num\n\t\t if (($activebatch) && ($this->bypass_method==false))\n\t\t $myaction .= '&batchid=' . $activebatch; \n\t\t \t\t \n $out .= \"<FORM action=\". \"$myaction\" . \" method=post>\"; \t\n\t \t \n //error message\n $out .= setError($sFormErr);\t\t \n\t \n $from[] = \"<B>\" . localize('_FROM',getlocal()) . \":</B>\";\n $fromattr[] = \"right;20;\";\n\t\t $from[] = \"<input type=\\\"text\\\" name=\\\"from\\\" maxlenght=\\\"40\\\" readonly =\\\"readonly\\\" value=\\\"\".$mymail.\"\\\">&nbsp;\" . $this->mailname;\n\t $fromattr[] = \"left;80%;\";\t\t\n\n\t $fwin = new window('',$from,$fromattr);\n\t $winout .= $fwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($fwin);\t \n\t \n //TO..\n $to[] = \"<B>\" . localize('_TO',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $to[] = \"<input type=\\\"text\\\" name=\\\"to\\\" maxlenght=\\\"40\\\" value=\\\"$sendto\\\">&nbsp;\" . $this->toname;\t\n\t\t $toattr[] = \"left;80%;\";\n\t $twin = new window('',$to,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t \n\t\t \n //CC..\n if ((SMTP_PHPMAILER=='true') || (SENDMAIL_PHPMAILER=='true')) {\t\t\t \t\t\t \n $cc[] = \"<B>\" . localize('_CC',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $cc[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"cc\\\" maxlenght=\\\"80\\\" value=\\\"$sendcc\\\">\";\n\t\t $toattr[] = \"left;80%;\";\t\t \n\t $twin = new window('',$cc,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t\n\t\t \n $bcc[] = \"<B>\" . localize('_BCC',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $bcc[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"bcc\\\" maxlenght=\\\"80\\\" value=\\\"$sendbcc\\\">\";\n\t\t $toattr[] = \"left;80%;\";\t\t \n\t $twin = new window('',$bcc,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t\t \n\t\t } \t\t\t \n \n\t //SUBJECT..\n\t\t $sbj = $subject?$subject:GetParam('subject');\n $subt[] = \"<B>\" . localize('_SUBJECT',getlocal()) . \":</B>\";\n \t $subattr[] = \"right;20%;\";\t \n $subt[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"subject\\\" maxlenght=\\\"30\\\" value=\\\"\".$sbj.\"\\\">\"; \n \t $subattr[] = \"left;80%;\";\n\t $swin = new window('',$subt,$subattr);\n\t $winout .= $swin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($swin);\t \n\t\t \n\t\t //OPTIONS \n $opt[] = \"&nbsp;\";\n \t $toattr[] = \"right;20%;\";\t\n\t\t $check1 = $activebatch?'checked':null; \t\t \n\t $options = \"<B>\" . localize('_INCLSUBS',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"includesubs\\\" $check1>\";\t\t\n $options .= \"<B>\" . localize('_INCLALL',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"includeall\\\" ><br>\";\t\t\t\t \n if ((SMTP_PHPMAILER=='true') || (SENDMAIL_PHPMAILER=='true')) {\t\n\t\t $check2 = $this->ishtml?'checked':null;\n $options .= \"<B>\" . localize('_ISHTML',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"ishtml\\\" $check2><br>\";\t\t \n\t\t }\t\n\t\t else\n\t\t $options .= \"<B>\" . localize('_SMTPDEBUG',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"smtpdebug\\\"><br>\";//debug smtp\n\t\t \t \n\t $opt[] = $options;\n \t $toattr[] = \"left;80%;\";\t\n\t $twin = new window('',$opt,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t \n\t \t \n\t //MAIL BODY..\t\t \n $mb[] = \"&nbsp;\";//\"<B>\" . localize('_MESSAGE',getlocal()) . \":</B>\";\n \t $mbattr[] = \"right;1%;\";\t\n\t\t \n\t\t if (GetReq('t')=='cpsubloadhtmlmail') { //LOAS A NEW TEMPLATE\n\t\t $path = $this->urlpath.$this->infolder.$this->newsletter_path;//GetGlobal('controller')->calldpc_var('rctedit.htmlpath');\t\t \n\t\t //echo $path; print_r($_POST);\n\t\t if ($template = GetParam('template')) {\n\t\t $data = GetGlobal('controller')->calldpc_method('rctedit.loadfromfile use '.$template.'+'.$path);\n\t\t }\n\t\t else \n\t\t $data = null;\n\t\t\t \n\t\t $conditions = $this->spam_conditions_text($this->antispamlink,0,$this->ishtml);\n\t\t $this->mailbody = $data . $conditions; //str_replace('</html>',$conditions.'</html>',$data);\n\t\t \n\t\t //$this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t //$mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$data . $conditions);\n\t\t $mbody = $this->render_textarea($data . $conditions, $rows);\n\t\t \n\t\t $this->template = $this->url . $this->infolder . $this->newsletter_path . $template; \n\n\t\t $this->ishtml = true;\t\n\t\t SetSessionParam('template',$this->template);\n\t\t SetSessionParam('mailbody',$this->mailbody);\t\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t \n\t\t }\n\t\t elseif (GetReq('t')=='cpsubloadimage') {//..OR ADD EMBEDED IMAGE\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }*/\n\t\t $mbody = $this->render_textarea($mailbody,$rows);\t \n\t\t \t\n\t\t if ($img = GetParam('image'))\n\t $this->images[] = $img;\t\n\t\t //echo '>',GetParam('image');\t \n\t SetSessionParam('images',serialize($this->images));\t\t \t\t \n\t\t }\t\t\n\t\t elseif (GetReq('t')=='cpsubattach') {//..OR ATTACH A FILE\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }\t*/\t\n\t\t \n\t\t $mbody = $this->render_textarea($mailbody,$rows);\n\t\t \n\t\t if ($attachedfile = GetParam('attachment'))\t\t \n\t $this->attachments[] = $attachedfile;\t\n\t\t //echo '>',GetParam('attachment');\t \n\t SetSessionParam('attachments',serialize($this->attachments));\t\t \t\t \n\t\t }\t\t\n\t\t elseif (GetReq('t')=='cpsubsend') {//..OR SEND A MAIL\n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }\t*/\n\t\t \n\t\t $mbody = $this->render_textarea($mailbody,$rows);\t\t \n\t\t } \t \n\t\t elseif ($this->ishtml = true) {//..OR JUST SHOW NEW HTML MAIL ..\n\t\t //$this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mbody = $this->mailbody;\n\t\t else {\n\t\t $mbody = GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\n $mbody .= $this->spam_conditions_text($this->antispamlink,0,$this->ishtml);\t\t\t \n \t\t $this->mailbody = $mbody;\n\t\t\t SetSessionParam('mailbody',$mbody);\n\t\t }\t \n\t\t\t \t\t \n\t\t //$mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mbody);\n\t\t \n\t\t $mbody = $this->render_textarea($mbody,$rows);\n\t\t \n\t\t //reset arrays\n\t\t SetSessionParam('template',null);\t\n\t\t SetSessionParam('mailbody',null);\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t\t \t\t \t\t \n\t\t }\t \n\t\t else { //OR IN TEXT MODE\n\t\t \n\t\t $this->mailbody = null;\n\t\t \n //$mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\n\t\t if ($this->mailbody) \n\t\t $mbody .= $this->mailbody;\n\t\t else {\n\t\t $mbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t \n $mbody .= $this->spam_conditions_text($this->antispamlink,0,0);\n\t\t }\t \n\t\t \n //$mbody .= \"</TEXTAREA></DIV>\";\n\t\t \n\t\t $mbody = $this->render_textarea($mbody,$rows);\n\t\t \n\t\t $this->ishtml = false;\t\n\t\t SetSessionParam('template',null);\t\n\t\t SetSessionParam('mailbody',null);\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t\t \t\t \t \n\t\t }\t \n\t\t \n\t $mb[] = $mbody;\n\t $mbattr[] = \"left;99%\";\n\t $mbwin = new window('',$mb,$mbattr);\n\t $winout .= $mbwin->render(\"center::100%::0::group_win_body::left::0::0::\");\t\n\t unset ($mbwin);\t \n\t \n\t \n\t\t //alternate text body\n\t\t if (!$editmode) {\n\t\t \n\t\t if (GetParam('alttext')) {\n\t\t $defaulttext = GetParam('alttext');\n\t\t }\n\t\t else {\n\t\t $defaulttext = localize('_NOTVIEW',0);\n\t\t $defaulttext .= localize('_NOTVIEW',1);\t\t \n\t\t $defaulttext .= $this->template ? $this->template :'Alternate Text message for non html viewers';\n\t\t $defaulttext .= $this->spam_conditions_text($this->antispamlink,0,0);\t\t \n\t\t } \n\t\t \n $alttext = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"alttext\\\" ROWS=5 cols=60 wrap=\\\"virtual\\\">\";\n\t\t $alttext .= $defaulttext;\n\t\t $alttext .= \"</TEXTAREA></DIV>\";;\t\t \n\t $alt[] = $alttext;\n \t $toattr[] = \"left;80%;\";\t\n\t $twin = new window('',$alt,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\n\t\t \n\t\t }//editmode\t\n\t\t \t \n\t //main window\n\t $mywin = new window('',$winout);\n\t $out .= $mywin->render();\t\n\t unset ($mywin);\t \n\t \n\t \n\t //batch num restored\n\t\t if ($activebatch) {\n\t\t $cmd = \"Previous campaign has stoped at batch num (reset or bypass)\";\n\t\t $cm = ($activebatch-1) * $this->batch; \n\t\t $cmd .= \"<br>Campaign stopped at \" . $cm . \" mails from \" . $this->subs_no . ' subscribers!<br>'; \n\t\t \n\t\t if ($this->bypass_method==true)\t\t\t \n\t\t $cmd .= \"<input style=\\\"width:30\\\" type=\\\"text\\\" name=\\\"batchrestore\\\" maxlenght=\\\"4\\\" value=\\\"\".($activebatch-1) .\"\\\">\"; \t \n\t\t //$cmd .= \"<br>\";\n\t\t }\n\t\t else\n\t\t $cmd = $this->subs_no . ' subscribers!<br>';\n\t \n\t //BUTTONS\n\t\t if ($action) {\n $cmd .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendCMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"\" . $submit . \"\\\">&nbsp;\"; \n $cmd .= \"<INPUT type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"\" . $action . \"\\\">\";\t\t\t \n\t\t }\n\t\t else {\n $cmd .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendCMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"\" . localize('_SENDCMAIL',getlocal()) . \"\\\">&nbsp;\"; \n $cmd .= \"<INPUT type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"\" . \"sendcmail\" . \"\\\">\";\t \n\t\t } \n\t\t \n\t $but[] = $cmd;\n\t $battr[] = \"left\";\n\t $bwin = new window('',$but,$battr);\n\t $out .= $bwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($bwin);\n\t \t \n $out .= \"</FORM>\"; \n\t\t \n\t if (defined('RCTEDIT_DPC')) {\n\t\t //html\n\t\t $out1_title = \"<B>\" . localize('_HTMLTEMPLATE',getlocal()) . \":</B>&nbsp;\" . $this->template;\n\t $out1 = GetGlobal('controller')->calldpc_method('rctedit.show_files use template+Load Newsletter+'.$taction.'+'.$this->newsletter_path.'+'.implode(',',$this->templatetypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out1 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploadtemplate+/'.$this->newsletter_path.'+++'.$this->maxsize); \n\t\t\t \n\t $awin = new window($out1_title,$out1);\n\t $out .= $awin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($awin);\t\n\t\t \t\t\t \n\t\t //embeded images\n\t\t if ((is_array($this->images)) && (!empty($this->images))) {\n\t\t //print_r($this->images);\n\t\t $myimages = implode(',',$this->images);\n\t\t }\t \n\t\t else\n\t\t $myimages = 'none';\t \n\t\t $out2_title = \"<B>\" . localize('_ADDIMAGES',getlocal()) . \":</B>&nbsp;\" . '<'.$myimages.'>';\n\t $out2 = GetGlobal('controller')->calldpc_method('rctedit.show_files use image+Embed Image+'.$iaction.'+'.$this->imgpath.'+'.implode(',',$this->imgtypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out2 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploadimage+/'.$this->imgpath.'+++'.$this->maxsize);\t\t \n\t\t\t \n\t $bwin = new window($out2_title,$out2);\n\t $out .= $bwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($bwin);\t\t\t \n\t\t\t \n\t\t //attachments\n\t\t if ((is_array($this->attachments)) && (!empty($this->attachments))) {\n\t\t //print_r($this->images);\n\t\t $mydocs = implode(',',$this->attachments);\n\t\t }\t \n\t\t else\n\t\t $mydocs = 'none';\t\t \n\t\t $out3_title = \"<B>\" . localize('_ATTACHMENTS',getlocal()) . \":</B>&nbsp;\" . '<'.$mydocs.'>';\n\t $out3 = GetGlobal('controller')->calldpc_method('rctedit.show_files use attachment+Attach File+'.$daction.'+'.$this->docpath.'+'.implode(',',$this->doctypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out3 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploaddocument+/'.$this->docpath.'+++'.$this->maxsize);\t\n\t\t\t \n\t $cwin = new window($out3_title,$out3);\n\t $out .= $cwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($cwin);\t\t\t\t \n\t\t } \t\t \n\t\t \n\t $mywin = new window(localize('_SMTPSENDFORM',getlocal()) . ' ['.GetParam('id').']',$out);\n\t $wout = $mywin->render();\t\n\t unset ($mywin);\t\t \n\t\t \n\t\t return ($wout); \n }", "function send_preview_ajax() {\r\n\r\n require_once( $this->plugin_dir . \"email-newsletter-files/phpmailer/class.phpmailer.php\" );\r\n\r\n $mail = new PHPMailer();\r\n\r\n $mail->CharSet = 'UTF-8';\r\n\r\n //Set Sending Method\r\n switch( $this->settings['outbound_type'] ) {\r\n case 'smtp':\r\n $mail->IsSMTP();\r\n $mail->Host = $this->settings['smtp_host'];\r\n $mail->SMTPAuth = ( strlen( $this->settings['smtp_user'] ) > 0 );\r\n if( $mail->SMTPAuth ){\r\n $mail->Username = $this->settings['smtp_user'];\r\n $mail->Password = $this->settings['smtp_pass'];\r\n }\r\n break;\r\n\r\n case 'mail':\r\n $mail->IsMail();\r\n break;\r\n\r\n case 'sendmail':\r\n $mail->IsSendmail();\r\n break;\r\n }\r\n\r\n //open template file\r\n $filename = $this->plugin_dir . \"email-newsletter-files/templates/\" . $_REQUEST['template'] . \"/template.html\";\r\n $handle = fopen( $filename, \"r\" );\r\n $contents = fread( $handle, filesize( $filename ) );\r\n fclose( $handle );\r\n\r\n //Replace content of template\r\n $content = base64_decode( str_replace( \"-\", \"+\", $_REQUEST['content'] ) );\r\n $contact_info = base64_decode( str_replace( \"-\", \"+\", $_REQUEST['contact_info'] ) );\r\n\r\n $contents = str_replace( \"{EMAIL_BODY}\", $content, $contents );\r\n $contents = str_replace( \"{EMAIL_SUBJECT}\", stripslashes ( $_REQUEST['subject'] ), $contents );\r\n $contents = str_replace( \"{FROM_NAME}\", stripslashes ( $_REQUEST['from_name'] ), $contents );\r\n $contents = str_replace( \"{FROM_EMAIL}\", $_REQUEST['from_email'], $contents );\r\n $contents = str_replace( \"{CONTACT_INFO}\", $contact_info, $contents );\r\n $contents = str_replace( \"images/\", $this->plugin_url . \"email-newsletter-files/templates/\" . $_REQUEST['template'] . \"/images/\", $contents );\r\n\r\n $mail->From = $_REQUEST['from_email'];\r\n $mail->FromName = stripslashes ( $_REQUEST['from_name'] );\r\n $mail->Subject = stripslashes ( $_REQUEST[\"subject\"] );\r\n\r\n $mail->MsgHTML( $contents );\r\n\r\n $mail->AddAddress( $_REQUEST[\"preview_email\"] );\r\n\r\n if( $this->settings['bounce_email'] ) {\r\n $mail->Sender = $this->settings['bounce_email'];\r\n }\r\n\r\n if( ! $mail->Send() )\r\n die( \"Mailer Error: \" . $mail->ErrorInfo );\r\n else\r\n die( \"Test Email was sent\" );\r\n }", "public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}", "function pexeto_contact_form() {\r\n\t\t$html='<div class=\"widget-contact-form\">\r\n\t\t\t<form action=\"'.get_template_directory_uri().'/includes/send-email.php\" method=\"post\" \r\n\t\t\tid=\"submit-form\" class=\"pexeto-contact-form\">\r\n\t\t\t<div class=\"error-box error-message\"></div>\r\n\t\t\t<div class=\"info-box sent-message\"></div>\r\n\t\t\t<input type=\"text\" name=\"name\" class=\"required placeholder\" id=\"name_text_box\" \r\n\t\t\tplaceholder=\"'.pexeto_text( 'name_text' ).'\" />\r\n\t\t\t<input type=\"text\" name=\"email\" class=\"required placeholder email\" \r\n\t\t\tid=\"email_text_box\" placeholder=\"'.pexeto_text( 'your_email_text' ).'\" />\r\n\t\t\t<textarea name=\"question\" rows=\"\" cols=\"\" class=\"required\"\r\n\t\t\tid=\"question_text_area\"></textarea>\r\n\t\t\t<input type=\"hidden\" name=\"widget\" value=\"true\" />\r\n\r\n\t\t\t<a class=\"button send-button\"><span>'.pexeto_text( 'send_text' ).'</span></a>\r\n\t\t\t<div class=\"contact-loader\"></div><div class=\"check\"></div>\r\n\r\n\t\t\t</form><div class=\"clear\"></div></div>';\r\n\t\treturn $html;\r\n\t}", "public static function fp_rac_edit_mail_update_data() {\n\n check_ajax_referer('update-guest-email', 'rac_security');\n if (isset($_POST['id']) && $_POST['email']) {\n $row_id = $_POST['id'];\n $email_value = $_POST['email'];\n $cart_details = maybe_unserialize(get_post_meta($row_id, 'rac_cart_details', true));\n $cart_details[\"visitor_mail\"] = $email_value;\n $details = maybe_serialize($cart_details);\n update_post_meta($row_id, 'rac_cart_details', $details);\n }\n exit();\n }", "public function run()\n {\n if ($this->allowOverride) {\n $to = $this->arg('to');\n $cc = $this->arg('cc');\n $bcc = $this->arg('bcc');\n $subject = $this->arg('subject');\n\n /* if class vars is defined, dont override it */\n if ($to) {\n $this->email->to($to);\n }\n\n if ($cc) {\n $this->email->cc($cc);\n }\n\n if ($bcc) {\n $this->email->bcc($bcc);\n }\n\n if ($subject) {\n $this->email->subject($subject);\n }\n\n $content = $this->arg('content');\n if (! $content) {\n $content = $this->getContent();\n }\n\n if ($this->contentType == \"html\") {\n $this->email->html($content);\n } else {\n $this->email->text($content);\n }\n } else {\n $this->extractFieldsFromThis();\n }\n\n return $this->send();\n }", "function PrintHTML(){ if(isset($_SESSION['form_msg'])) {\r\n $html = \"<div class=\\\"wrapper wrapper-content msg-form\\\">\";\r\n $html .= \" <div class=\\\"alert alert-success\\\" role=\\\"alert\\\">\" . $_SESSION['form_msg'] . \"</div>\";\r\n $html .= \"</div>\";\r\n $this->html .= $html;\r\n unset($_SESSION['form_msg']);\r\n }\r\n\r\n\r\n //Tem mensagem pra exibir?\r\n if(isset($_SESSION['form_msg_error'])) {\r\n $html = \"<div class=\\\"wrapper wrapper-content msg-form\\\">\";\r\n $html .= \" <div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\" . $_SESSION['form_msg_error'] . \"</div>\";\r\n $html .= \"</div>\";\r\n $this->html .= $html;\r\n unset($_SESSION['form_msg_error']);\r\n }\r\n\r\n\r\n // Content..\r\n $html = \"<div class=\\\"wrapper wrapper-content animated fadeInRight\\\">\";\r\n $html .= \" <div class=\\\"row\\\">\";\r\n $html .= \" <form method=\\\"post\\\" class=\\\"$this->class form-horizontal\\\" action=\\\"\" . get_config('SITE_URL') . \"/script/\" . $this->script_action . \"\\\">\";\r\n\r\n //Se for edição, adiciona campo oculto com ID\r\n if(isset($this->reg->ID)){\r\n $html .= \"<input name=\\\"id\\\" value=\\\"\" . $this->reg->ID . \"\\\" type=\\\"hidden\\\">\";\r\n }\r\n\r\n // BOXES\r\n foreach($this->boxes as $box){\r\n $html .= $box->GetHTML();\r\n }\r\n\r\n\r\n //Ações\r\n $html .= \"<div class=\\\"clearboth\\\"></div>\";\r\n $html .= \"<!-- ACTIONS -->\";\r\n $html .= \"<div class=\\\"col-lg-12\\\">\";\r\n $html .= \" <div class=\\\"form-group\\\">\";\r\n $html .= \" <div class=\\\"pull-right btn-actions\\\">\";\r\n\r\n if(GetParam(GetParamsCount()-2) == 'edit'){\r\n\r\n if(empty($this->linkNovo))\r\n $this->linkNovo = GetLink(GetPage()) . '/add';\r\n\r\n $html .= \" <a href=\\\"\" . $this->linkNovo . \"\\\" class=\\\"btn btn-info btn-xs\\\" type=\\\"submit\\\">Adicionar novo</a>\";\r\n }\r\n\r\n if(empty($this->linkVoltar))\r\n $this->linkVoltar = GetLink(GetPage());\r\n\r\n $html .= \" <a href=\\\"\" . $this->linkVoltar . \"\\\" class=\\\"btn btn-white\\\" type=\\\"submit\\\">Voltar</a>\";\r\n $html .= \" <button class=\\\"btn btn-primary\\\" type=\\\"submit\\\">\" . ( (GetParam(GetParamsCount()-1) == 'add')?'Adicionar':'Atualizar' ) . \"</button>\";\r\n $html .= \" </div>\";\r\n $html .= \" </div>\";\r\n $html .= \"</div>\";\r\n\r\n\r\n $html .= \" </form>\";\r\n $html .= \" </div>\";\r\n $html .= \"</div>\";\r\n $this->html .= $html;\r\n\r\n echo($this->html);\r\n }", "function saveEvent(&$req, &$t) {\n\t\tif ( $this->isTrustFailure() ) {\n\t\t\tCgn_ErrorStack::throwError('Your message was not sent because it was not trusted by the server.', '601', 'sec');\n\t\t\t$this->mainEvent($req, $t);\n\t\t\t$myTemplate = Cgn_ObjectStore::getObject(\"object://defaultOutputHandler\");\n\t\t\t$myTemplate->contentTpl = 'userform_main';\n\t\t\t$this->eventName = 'main';\n\t\t\treturn;\n\t\t}\n\n\t\t$commentField = '';\n\t\tforeach ($req->postvars as $k=>$v) {\n\t\t\tif (strlen($k) == 18) {$commentField = $k;}continue;\n\t\t}\n\n\t\tif ( $commentField == '' || !($content = $req->cleanString($commentField))) {\n\t\t\tCgn_ErrorStack::throwError('Your message was not sent because you did not enter a comment.', '601', 'sec');\n\t\t\t$this->mainEvent($req, $t);\n\t\t\t$myTemplate = Cgn_ObjectStore::getObject(\"object://defaultOutputHandler\");\n\t\t\t$myTemplate->contentTpl = 'userform_main';\n\t\t\t$this->eventName = 'main';\n\t\t\treturn;\n\t\t}\n\n\t\tinclude_once(CGN_LIB_PATH.'/mxq/lib_cgn_mxq.php');\n\t\t//Cgn_ObjectStore::debug('config://email/default/contactus');\n\t\t$from = Cgn_ObjectStore::getConfig('config://default/email/contactus');\n\t\t$to = Cgn_ObjectStore::getConfig('config://default/email/contactus');\n\t\t$mail = new Cgn_Mxq_Message_Email();\n\t\t$mail->envelopeFrom = $from;\n\t\t$mail->envelopeTo = $to;\n\n\t\t$siteName = Cgn_ObjectStore::getString(\"config://template/site/name\");\n\t\t$name = trim($req->cleanString('name'));\n\t\tif ($name == '') {\n\t\t\t$name = trim($req->cleanString('contact_name'));\n\t\t}\n\t\t//save other random postvars\n\t\t$postVars = '';\n\t\t$skipVars = array('name', 'contact_name', 'email', 'phone', 'contactus_01_submit');\n\t\tforeach ($req->postvars as $k=>$v) {\n\t\t\tif (in_array($k, $skipVars)) continue;\n\t\t\tif (strlen($k) == 18) {$commentField = $k;continue;}\n\t\t\t$postVars .= $k.': '.trim($v).\"\\n\";\n\t\t}\n\n\t\t$mail->dataItem->msg_name = 'Message from contact us form from '.$siteName;\n\t\t$mail->dataItem->msg = 'Message from contact us form from '.$siteName.\"\\n\\n\";\n\t\t$mail->dataItem->msg .= 'Name: '.$name.\"\\n\";\n\t\t$mail->dataItem->msg .= 'Email: '.trim($req->cleanString('email')).\"\\n\";\n\t\t$mail->dataItem->msg .= 'Phone: '.trim($req->cleanString('phone')).\"\\n\";\n\t\t$mail->dataItem->msg .= $postVars.\"\\n\";\n\t\tif ($content = $req->cleanMultiLine($commentField)) {\n\t\t\t$mail->dataItem->msg .= trim($content).\"\\n\";\n\t\t}\n\t\t$mail->sendEmail();\n\n\t\t$this->presenter = 'redirect';\n\t\t$t['url'] = cgn_appurl('main', 'userform');\n\t\t$u = $req->getUser();\n\t\t$u->addSessionMessage(\"Thank you. Your message has been sent.\");\n\t}", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "public function admin_email_design() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'Email Design', 'visual-form-builder-pro' ); ?></h2>\n<?php\n\t\t$design = new VisualFormBuilder_Pro_Designer();\n\t\t$design->design_options();\n?>\n\t</div>\n<?php\n\t}", "function do_contact_client_form($adata, $aerr_entry, $aret_flag=0) {\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Some HTML Strings (reduce text)\n\t\t$_td_str_left_vtop\t= '<td class=\"TP1SML_NR\" width=\"30%\" valign=\"top\">';\n\t\t$_td_str_left\t\t= '<td class=\"TP1SML_NR\" width=\"30%\">';\n\t\t$_td_str_right\t\t= '<td class=\"TP1SML_NL\" width=\"70%\">';\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr .= $_CCFG['_PKG_NAME_SHORT'].$_sp.$_LANG['_MAIL']['Contact_Client_Form'].$_sp.'('.$_LANG['_MAIL']['all_fields_required'].')';\n\n\t# Do data entry error string check and build\n\t\tIF ($aerr_entry['flag']) {\n\t\t \t$err_str = $_LANG['_MAIL']['CC_FORM_ERR_HDR1'].'<br>'.$_LANG['_MAIL']['CC_FORM_ERR_HDR2'].'<br>'.$_nl;\n\n\t \t\tIF ($aerr_entry['cc_cl_id']) \t{$err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR01']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_mc_id']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR02']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_subj']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR03']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_msg']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR04']; $err_prv = 1;}\n\n\t \t\t$_cstr .= '<p align=\"center\"><b>'.$err_str.'</b>'.$_nl;\n\t\t}\n\n\t# Formatting tweak for spacing\n\t\tIF ($aerr_entry['flag']) {$_cstr .= '<br><br>'.$_nl;}\n\n\t\t$_cstr .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\t\t$_cstr .= '<tr><td align=\"center\">'.$_nl;\n\t\t$_cstr .= '<form action=\"mod.php\" method=\"post\" name=\"client\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mod\" value=\"mail\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mode\" value=\"client\">'.$_nl;\n\t\t$_cstr .= '<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_To_Client'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_clients('cc_cl_id', $adata['cc_cl_id'], '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_From'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_mail_contacts('cc_mc_id', $adata['cc_mc_id']);\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Subject'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= '<INPUT class=\"PSML_NL\" TYPE=TEXT name=\"cc_subj\" size=\"30\" maxlength=\"50\" value=\"'.htmlspecialchars($adata['cc_subj']).'\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left_vtop.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Message'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\tIF ($_CCFG['WYSIWYG_OPEN']) {$_cols = 120;} ELSE {$_cols = 80;}\n\t\t$_cstr .= '<TEXTAREA class=\"PSML_NL\" NAME=\"cc_msg\" COLS=\"'.$_cols.'\" ROWS=\"15\">'.$adata['cc_msg'].'</TEXTAREA>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<INPUT TYPE=hidden name=\"stage\" value=\"1\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_email', 'SUBMIT', $_LANG['_MAIL']['B_Send_Email'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_reset', 'RESET', $_LANG['_MAIL']['B_Reset'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= '</tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</form>'.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr \t\t= ''.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return / Echo Final Output\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "function uc_order_view_update_form($form, &$form_state, $order) {\n $form['order_comment_field'] = array(\n '#type' => 'fieldset',\n '#title' => t('Add an order comment'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['order_comment_field']['order_comment'] = array(\n '#type' => 'textarea',\n '#description' => t('Order comments are used primarily to communicate with the customer.'),\n );\n\n $form['admin_comment_field'] = array(\n '#type' => 'fieldset',\n '#title' => t('Add an admin comment'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['admin_comment_field']['admin_comment'] = array(\n '#type' => 'textarea',\n '#description' => t('Admin comments are only seen by store administrators.'),\n );\n\n $form['current_status'] = array(\n '#type' => 'hidden',\n '#value' => $order->order_status,\n );\n\n $form['order_id'] = array(\n '#type' => 'hidden',\n '#value' => $order->order_id,\n );\n\n $form['controls'] = array(\n '#type' => 'container',\n '#attributes' => array('class' => array('uc-inline-form', 'clearfix')),\n '#weight' => 10,\n );\n\n foreach (uc_order_status_list() as $status) {\n $options[$status['id']] = $status['title'];\n }\n $form['controls']['status'] = array(\n '#type' => 'select',\n '#title' => t('Order status'),\n '#default_value' => $order->order_status,\n '#options' => $options,\n );\n\n $form['controls']['notify'] = array(\n '#type' => 'checkbox',\n '#title' => t('Send e-mail notification on update.'),\n );\n\n $form['controls']['actions'] = array('#type' => 'actions');\n $form['controls']['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Update'),\n );\n\n return $form;\n}", "private function displayForm()\n {\n // Preparation des paramètres du mail.\n $data['headerTitle'] = 'Contact';\n $data['headerDescription'] = 'Page de contact';\n $data['title'] = 'Contact';\n\n // Affichage du formulaire.\n $this->load->view('templates/header', $data);\n $this->load->view('templates/alert', $data);\n $this->load->view('contact/index', $data);\n $this->load->view('templates/footer', $data);\n }", "function event_formprocessing($formvariables) {\r\r\n\tglobal $glbl_companyname, $glbl_sendformsfromemailaddress, $glbl_sendformstoemailaddress,\r\r\n\t $glbl_physicalwebrootlocation;\r\r\n\t$outputtype = 'simple';\r\r\n\t// Security validation 'ctcd'\r\r\n\tif (!pingToken($formvariables['citycode']))\r\r\n\t\treturn '// invalid: press the browser [back] button;';\r\r\n\t// When using a custom template for output\r\r\n\tif (isset($formvariables['emailtemplate'])){\r\r\n\t\t$loc = $glbl_physicalwebrootlocation . $formvariables['emailtemplate'];\r\r\n\t\tif (file_exists($loc)){ \r\r\n\t\t\t$file = fopen($loc, 'r'); // Read template page\r\r\n\t\t\t$formstring = fread($file, filesize($loc));\r\r\n\t\t\tfclose($file);\r\r\n\t\t\tif (trim($formstring) != '')\r\r\n\t\t\t\t$outputtype = 'custom';\r\r\n\t\t}\r\r\n\t}\r\r\n\t// When using simple output\r\r\n\tif ($outputtype == 'simple')\r\r\n\t\t$formstring = 'A form was submitted for: ' . $glbl_companyname . '<br><br>';\r\r\n\t// Loop over form variables\r\r\n\tforeach (explode(',', $formvariables['fieldlist']) as $formfield) {\r\r\n\t\t$formfieldvalue = '';\r\r\n\t\tif (isset($formvariables[$formfield]))\r\r\n\t\t\t$formfieldvalue = $formvariables[$formfield];\r\r\n\t\tif (strtolower($formfield) == 'email')\r\r\n\t\t\t$formfieldvalue = '<a href=\"mailto:' . $formfieldvalue . '\">' . $formfieldvalue . '</a>';\r\r\n\t\tif ($outputtype == 'simple')\r\r\n\t\t\t$formstring .= str_replace('_', ' ', $formfield) . ': ' . str_replace('\\\\', '', $formfieldvalue) . '<br>';\r\r\n\t\telse\r\r\n\t\t\t$formstring = str_replace('<!-- {$' . $formfield . '$} -->', $formfieldvalue, $formstring);\r\r\n\t}\r\r\n\t// Add datetimestamp\r\r\n\tif ($outputtype == 'simple')\t\r\r\n\t\t$formstring .= '<br>Date: ' . date(\"m/d/Y\") . ' - ' . date(\"h:i:s A\");\r\r\n\telse\r\r\n\t\t$formstring = str_replace('<!-- {$datetimestamp$} -->',\r\r\n\t\t\t\t\t\t\t\t (date(\"m/d/Y\") . ' - ' . date(\"h:i:s A\")), $formstring);\t\r\r\n\t// Send via email\r\r\n\trequire_once(\"htmlMimeMail5/htmlMimeMail5.php\"); // htmlMimeMail5 class\r\r\n $mail = new htmlMimeMail5(); // Instantiate a new HTML Mime Mail object\r\r\n $mail->setFrom($glbl_sendformsfromemailaddress);\r\r\n $mail->setReturnPath($glbl_sendformsfromemailaddress); \r\r\n $mail->setSubject('web form | ' . $glbl_companyname);\r\r\n $mail->setText(str_replace('<br>', '\\r\\n', $formstring));\r\r\n $mail->setHTML($formstring);\r\r\n\t// Attach uploaded image, if any\r\r\n\tif (isset($_FILES['imagefile']['name']))\r\r\n\t\tif ($_FILES['imagefile']['type'] == \"image/gif\" || $_FILES['imagefile']['type'] == \"image/jpg\" ||\r\r\n\t\t\t$_FILES['imagefile']['type'] == \"image/jpeg\" || $_FILES['imagefile']['type'] == \"image/pjpeg\" ||\r\r\n\t\t\t$_FILES['imagefile']['type'] == \"image/png\")\r\r\n\t\t\t$mail->addAttachment(new fileAttachment($_FILES['imagefile']['tmp_name'], $_FILES['imagefile']['type']));\r\r\n\t// Send the email!\r\r\n\t$mail->send(array($glbl_sendformstoemailaddress), 'smtp');\r\r\n\t// User defined function hook\r\r\n\texecUserDefinedFunction('USRDFNDafter_event_formprocessing');\r\r\n\t// Point to page\r\r\n\theader('Location: ' . $formvariables['afterpage']);\r\r\n}", "public function send_contact_message() {\n if ($listing_id = wpbdp_getv($_REQUEST, 'listing_id', 0)) {\n $current_user = is_user_logged_in() ? wp_get_current_user() : null;\n\n $author_name = htmlspecialchars(trim(wpbdp_getv($_POST, 'commentauthorname', $current_user ? $current_user->data->user_login : '')));\n $author_email = trim(wpbdp_getv($_POST, 'commentauthoremail', $current_user ? $current_user->data->user_email : ''));\n $message = trim(wp_kses(stripslashes(wpbdp_getv($_POST, 'commentauthormessage', '')), array()));\n\n $validation_errors = array();\n\n if (!$author_name)\n $validation_errors[] = _x(\"Please enter your name.\", 'contact-message', \"WPBDM\");\n\n if ( !wpbdp_validate_value( $author_email, 'email' ) )\n $validation_errors[] = _x(\"Please enter a valid email.\", 'contact-message', \"WPBDM\");\n\n if (!$message)\n $validation_errors[] = _x('You did not enter a message.', 'contact-message', 'WPBDM');\n\n if (wpbdp_get_option('recaptcha-on')) {\n if ($private_key = wpbdp_get_option('recaptcha-private-key')) {\n if ( !function_exists( 'recaptcha_get_html' ) )\n require_once(WPBDP_PATH . 'libs/recaptcha/recaptchalib.php');\n\n $resp = recaptcha_check_answer($private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);\n if (!$resp->is_valid)\n $validation_errors[] = _x(\"The reCAPTCHA wasn't entered correctly.\", 'contact-message', 'WPBDM');\n }\n }\n\n if (!$validation_errors) {\n $headers = \"MIME-Version: 1.0\\n\" .\n \"From: $author_name <$author_email>\\n\" .\n \"Reply-To: $author_email\\n\" .\n \"Content-Type: text/plain; charset=\\\"\" . get_option('blog_charset') . \"\\\"\\n\";\n\n $subject = \"[\" . get_option( 'blogname' ) . \"] \" . sprintf(_x('Contact via \"%s\"', 'contact email', 'WPBDM'), wp_kses( get_the_title($listing_id), array() ));\n $wpbdmsendtoemail=wpbusdirman_get_the_business_email($listing_id);\n $time = date_i18n( __('l F j, Y \\a\\t g:i a'), current_time( 'timestamp' ) );\n\n $body = wpbdp_render_page(WPBDP_PATH . 'templates/email/contact.tpl.php', array(\n 'listing_url' => get_permalink($listing_id),\n 'name' => $author_name,\n 'email' => $author_email,\n 'message' => $message,\n 'time' => $time\n ), false);\n\n $html = '';\n\n // TODO: should use WPBDP_Email instead\n if(wp_mail( $wpbdmsendtoemail, $subject, $body, $headers )) {\n $html .= \"<p>\" . _x(\"Your message has been sent.\", 'contact-message', \"WPBDM\") . \"</p>\";\n } else {\n $html .= \"<p>\" . _x(\"There was a problem encountered. Your message has not been sent\", 'contact-message', \"WPBDM\") . \"</p>\";\n }\n\n $html .= sprintf('<p><a href=\"%s\">%s</a></p>', get_permalink($listing_id), _x('Return to listing.', 'contact-message', \"WPBDM\"));\n\n return $html;\n } else {\n return wpbdp_listing_contact_form( $listing_id, $validation_errors );\n }\n }\n }", "function AfterEdit(&$values, $where, &$oldvalues, &$keys, $inline, &$pageObject)\n{\n\n\t\t\n\nglobal $conn;\n$cid=$values['cid'];\n$userID=$values['userID'];\n$sql_up= \"UPDATE participate SET confirm ='Yes' WHERE userID='$userID' AND cid='$cid'\";\n$query_up=db_exec($sql_up,$conn);\n\n$itemID=$values['itemID'];\n\n$payStatus=$values['payStatus'];\n\nif($payStatus!=$oldvalues['payStatus']){\n\n if($payStatus='Completed'){\n\n$sql_company= \"SELECT `coid`, `cname`, `creg`, `caddress`, `ccity`, `cstate`, `ccountry`, `ctel`, `cfax`, `cemail` FROM `company` WHERE `coid`=1\";\n$query_company=db_query($sql_company,$conn);\n$company=db_fetch_array($query_company);\n\n$footer=\"<p> $company[cname]</p><p> $company[caddress],$company[ccity],$company[cstate],$company[ccountry]</p>\nFax: $company[cfax] Tel: $company[ctel]</p><br><br>\";\n\n$sDate=date('d', strtotime($row[sDate]));\n$eDate=date('d M Y', strtotime($row[eDate])) ;\n\n\n //send official inviation letter\n\t\t\t$to2=$values['email'];\n\t\t\t$subject2 =\"Thank you for your payment- $values[cnameShort] - Ref [$itemID]\";\n\t\t\t$headers2 = \"From: \" . $company['cemail'] . \"\\r\\n\";\n\t\t\t$headers2 .= \"Content-type: text/html\" .\"\\r\\n\";\n\n//content table \ninclude('emailHead.php');\t\n\t\n$contentEmail1='<table width=\"90%\" border=\"0\" align=\"center\" cellpadding=\"50\" cellspacing=\"0\" style=\"font-size:14px\">\n <tr><td bgcolor=\"#E4E4E4\" scope=\"col\">';\n$contentEmail2=' </td></tr></table>';\n\n$contentEmail='\n<h2 style=\"color:#036\">Thank You </h2>\n<hr style=\"color: #666; height: 1px; background: #666; border: none ; margin-bottom:10px;\" />\n<p> Dear '.$values['fullName'].', </p>\nThank you for your payment!\n\nThe details are as follows:-<br/><br/>\n<b>Fee\t\t\t\t\t\t\t:</b> '.$values['currency'].$values['amount'].'<br/><br/>\n<b>Item/Type\t\t\t\t:</b> '.$values['item'].'<br/><br/>\n<b>Conference\t\t\t:</b> '.$values['cname'].'<br/><br/>\n<b>Date of Payment\t:</b> '.$values['payDate'].'<br/><br/>\n<b>Mode of Payment\t:</b> '.$values['mode'].'<br/><br/>\n<b>Receipt No\t\t\t:</b> '.$values['receiptNo'].' <br/><br/>\n\n \nWe look forward to your participation and hope you will enjoy the sessions. <br/><br/>\t\n \nShould you have questions, please do not hesitate to contact us via email. <br/>'\n;\n\n$message2 =$letterhead.$contentEmail1.$contentEmail.$contentEmail2.$footerEmail;\t\t\n$mailto=mail($to2, $subject2, $message2, $headers2);\n};\n\n};\n;\t\t\n}", "protected function loadFormData()\n {\n $presetTargetData = $this->mailer->getPresetTargetData();\n if ($this->request->isPost()) {\n $requestData = $this->request->getPost();\n foreach($requestData as $key=>$value) {\n if (!is_array($value)) {\n $this->formData[$key] = htmlspecialchars($value);\n } else {\n $this->formData[$key] = array_map('htmlspecialchars', $value);\n }\n }\n }\n\n if (empty($this->formData['preview']) && !isset($this->formData['send'])) {\n if (isset($this->formData['select_template']) && !empty($this->formData['select_template'])) {\n\n if ($template = $this->mailer->getTemplate($this->formData['select_template'])) {\n $this->formData['subject'] = $template['gctt_subject'];\n $this->formData['mailBody'] = $template['gctt_body'];\n }\n }\n }\n\n $this->formData['available_fields'] = $this->mailElements->displayMailFields($this->mailer->getMailFields());\n\n if (!empty($this->formData['subject']) || !empty($this->formData['mailBody'])) {\n $content = '[b]';\n $content .= $this->_('Subject:');\n $content .= '[/b] [i]';\n $content .= $this->mailer->applyFields($this->formData['subject']);\n $content .= \"[/i]\\n\\n\";\n $content .= $this->mailer->applyFields($this->formData['mailBody']);\n } else {\n $content = ' ';\n }\n $htmlView = \\MUtil_Html::create()->div();\n $textView = \\MUtil_Html::create()->div();\n\n $htmlView->div(array('class' => 'mailpreview'))->raw(\\MUtil_Markup::render($content, 'Bbcode', 'Html'));\n $textView->pre(array('class' => 'mailpreview'))->raw(\\MUtil_Markup::render($content, 'Bbcode', 'Text'));\n\n $this->formData['preview_html'] = $htmlView;\n $this->formData['preview_text'] = $textView;\n\n $this->formData = array_merge($this->formData, $presetTargetData);\n }", "private function compile_email_body_html($form_input)\n {\n // Set up array in which to build message body\n $email_body = array();\n \n // Change carriage returns to <br /> tags for HTML version\n $form_message_breaks = nl2br($form_input['form_message']);\n \n // Set boundary for multipart emails (i.e. plain text and HTML combined)\n $email_body[] = \"--\" . $this->boundary;\n $email_body[] = \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\n /*\n * Change these lines for HTML emails.\n */\n $email_body[] = \"<html><body>\";\n $email_body[] = \"<h2>You have received a new message from your website contact form.</h2>\";\n $email_body[] = \"<p>Here are the details:</p>\";\n $email_body[] = \"<h3>Message from: \" . $form_input['form_name'] . \"</h3>\";\n $email_body[] = \"<p>Email address: \" . $form_input['form_email'] . \"</p>\";\n $email_body[] = \"<p>\" . $form_message_breaks . \"</p>\";\n $email_body[] = \"</html></body>\";\n \n // implode array with line breaks to split each entry\n $compiled_body = implode(\"\\r\\n\", $email_body);\n return $compiled_body;\n }", "public function load_email_form() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_load_popup_email_settings\" );\n\n\t\t$html = forminator_template( 'settings/popup/edit-email-content' );\n\n\t\twp_send_json_success( $html );\n\t}", "function bab_pm_formsend()\n{\n $bab_pm_PrefsTable = safe_pfx('bab_pm_list_prefs');\n $bab_pm_SubscribersTable = safe_pfx('bab_pm_subscribers');\n\n $bab_pm_radio = ps('bab_pm_radio'); // this is whether to mail or not, or test\n\n if ($bab_pm_radio == 'Send to Test') {\n $bab_pm_radio = 2;\n }\n\n if ($bab_pm_radio == 'Send to List') {\n $bab_pm_radio = 1;\n }\n\n if ($bab_pm_radio != 0) { // if we have a request to send, start the ball rolling....\n // email from override\n $sendFrom = gps('sendFrom');\n\n $listToEmail = (!empty($_REQUEST['listToEmail'])) ? gps('listToEmail') : gps('list');\n // $listToEmail = gps('listToEmail'); // this is the list name\n $subject = gps('subjectLine');\n $form = gps('override_form');\n\n // ---- scrub the flag column for next time:\n $result = safe_query(\"UPDATE $bab_pm_SubscribersTable SET flag = NULL\");\n\n //time to fire off initialize\n // bab_pm_initialize_mail();\n $path = \"?event=postmaster&step=initialize_mail&radio=$bab_pm_radio&list=$listToEmail&artID=$artID\";\n\n if (!empty($sendFrom)) {\n $path .= \"&sendFrom=\" . urlencode($sendFrom);\n }\n\n if (!empty($subject)) {\n $path .= \"&subjectLine=\" . urlencode($subject);\n }\n\n if ($_POST['use_override'] && !empty($form)) {\n $path .= \"&override_form=$form&use_override=1\";\n }\n\n header(\"HTTP/1.x 301 Moved Permanently\");\n header(\"Status: 301\");\n header(\"Location: \".$path);\n header(\"Connection: close\");\n }\n\n $options = '';\n $form_select = '';\n\n // get available lists to create dropdown menu\n $bab_pm_lists = safe_query(\"select * from $bab_pm_PrefsTable\");\n\n while ($row = @mysqli_fetch_row($bab_pm_lists)) {\n $options .= \"<option>$row[1]</option>\";\n }\n\n $selection = '<select id=\"listToEmail\" name=\"listToEmail\">' . $options . '</select>';\n\n $form_list = safe_column('name', 'txp_form',\"name like 'newsletter-%'\");\n\n if (count($form_list) > 0) {\n foreach ($form_list as $form_item) {\n $form_options[] = \"<option>$form_item</option>\";\n }\n\n $form_select = '<select name=\"override_form\">' . join($form_options,\"\\n\") . '</select>';\n $form_select .= checkbox('use_override', '1', '').'Use override?';\n }\n\n if (isset($form_select) && !empty($form_select)) {\n $form_select = <<<END\n <div style=\"margin-top:5px\">\n Override form [optional]: $form_select\n </div>\nEND;\n }\n echo <<<END\n<form action=\"\" method=\"post\" accept-charset=\"utf-8\">\n <fieldset id=\"bab_pm_formsend\">\n <legend><span class=\"bab_pm_underhed\">Form-based Send</span></legend>\n <div style=\"margin-top:5px\">\n <label for=\"listToEmail\" class=\"listToEmail\">Select list:</label> $selection\n </div>\n $form_select\n <label for=\"sendFrom\" class=\"sendFrom\">Send From:</label><input type=\"text\" name=\"sendFrom\" value=\"\" id=\"sendFrom\" /><br />\n <label for=\"subjectLine\" class=\"subjectLine\">Subject Line:</label><input type=\"text\" name=\"subjectLine\" value=\"\" id=\"subjectLine\" /><br />\n\n <p><input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to Test\" class=\"publish\" />\n &nbsp;&nbsp;\n <input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to List\" class=\"publish\" /></p>\n </fieldset>\n</form>\nEND;\n}", "protected function prepareMessage() {\n\n\t\tif (empty($this->messageTemplate)) {\n\t\t\tthrow new \\RuntimeException('Messenger: message template was not defined', 1354536584);\n\t\t}\n\n\t\tif (empty($this->to)) {\n\t\t\tthrow new \\RuntimeException('Messenger: no recipient was defined', 1354536585);\n\t\t}\n\n\t\t// Substitute markers\n\t\t$subject = $this->getContentRenderer()->render($this->messageTemplate->getSubject(), $this->markers);\n\t\t$body = $this->getContentRenderer()->render($this->messageTemplate->getBody(), $this->markers);\n\n\t\t// Parse Markdown only if necessary\n\t\tif ($this->messageTemplate->getTemplateEngine() === TemplateEngine::FLUID_AND_MARKDOWN) {\n\t\t\t$body = Markdown::defaultTransform($body);\n\t\t}\n\n\t\t$this->getMailMessage()->setTo($this->getTo())\n\t\t\t->setCc($this->getCc())\n\t\t\t->setBcc($this->getBcc())\n\t\t\t->setFrom($this->getSender())\n\t\t\t->setReplyTo($this->getReplyTo())\n\t\t\t->setSubject($subject)\n\t\t\t->setBody($body, 'text/html');\n\n\t\t// Attach plain text version if HTML tags are found in body\n\t\tif ($this->hasHtml($body)) {\n\t\t\t$text = Html2Text::getInstance()->convert($body);\n\t\t\t$this->getMailMessage()->addPart($text, 'text/plain');\n\t\t}\n\n\t\t// Handle attachment\n\t\tforeach ($this->attachments as $attachment) {\n\t\t\t$this->getMailMessage()->attach($attachment);\n\t\t}\n\t}", "private function _build_mail () {\n if (empty($this->sendto) && (empty($this->body) && empty($this->htmlbody))) {\n throw new Exception(\"Cannot send, need more information\");\n }\n\n // build the headers\n $this->headers = \"\";\n\n $this->xheaders['To'] = implode(',', $this->sendto);\n\n $cc_header_name = ($this->apply_windows_bugfix) ? 'cc': 'Cc';\n if (!empty($this->sendcc)) $this->xheaders[$cc_header_name] = implode(',', $this->sendcc);\n if (!empty($this->sendbcc)) $this->xheaders['Bcc'] = implode(',', $this->sendbcc);\n\n if($this->receipt) {\n if(isset($this->xheaders['Reply-To'])) {\n $this->xheaders['Disposition-Notification-To'] = $this->xheaders['Reply-To'];\n }\n elseif (isset($this->xheaders['From'])) {\n $this->xheaders['Disposition-Notification-To'] = $this->xheaders['From'];\n }\n }\n\n if($this->charset != '') {\n $this->xheaders['Mime-Version'] = '1.0';\n $this->xheaders['Content-Type'] = 'text/plain; charset='.$this->charset;\n $this->xheaders['Content-Transfer-Encoding'] = $this->ctencoding;\n }\n\n if (!$this->xheaders['X-Mailer']) {\n $this->xheaders['X-Mailer'] = 'King-Fu MimeMail';\n }\n\n // setup the body ready for sending\n $this->_set_body();\n\n foreach ($this->xheaders as $head => $value) {\n $rgx = ($this->apply_windows_bugfix) ? 'Subject' : 'Subject|To'; // don't strip out To header for bugfix\n if (!preg_match('/^'.$rgx.'$/i', $head)) $this->headers .= $head.': '.strtr($value, \"\\r\\n\", ' ').\"\\n\";\n }\n }", "function bab_pm_makeform()\n{\n global $prefs;\n\n $bab_hidden_input = '';\n $event = gps('event');\n $step = gps('step');\n\n if (!$event) {\n $event = 'postmaster';\n }\n\n if (!$step) {\n $step = 'subscribers';\n }\n\n if ($step == 'subscribers') {\n $bab_columns = array(\n 'subscriberFirstName',\n 'subscriberLastName',\n 'subscriberEmail',\n 'subscriberLists',\n );\n\n for ($i = 1; $i <= BAB_CUSTOM_FIELD_COUNT; $i++) {\n $bab_columns[] = \"subscriberCustom{$i}\";\n }\n\n $bab_submit_value = 'Add Subscriber';\n $bab_prefix = 'new';\n $subscriberToEdit = gps('subscriber');\n\n if ($subscriberToEdit) {\n $bab_hidden_input = '<input type=\"hidden\" name=\"editSubscriberId\" value=\"' . doSpecial($subscriberToEdit) . '\">';\n $bab_prefix = 'edit';\n $bab_submit_value = 'Update Subscriber Information';\n\n $row = safe_row('*', 'bab_pm_subscribers', \"subscriberID=\" . doSlash($subscriberToEdit));\n $subscriber_lists = safe_rows('*', 'bab_pm_subscribers_list', \"subscriber_id = \" . doSlash($row['subscriberID']));\n $fname = doSpecial($row['subscriberFirstName']);\n $lname = doSpecial($row['subscriberLastName']);\n echo \"<fieldset id=bab_pm_edit><legend><span class=bab_pm_underhed>Editing Subscriber: $fname $lname</span></legend>\";\n } else {\n $subscriber_lists = array();\n }\n\n $lists = safe_rows('*', 'bab_pm_list_prefs', '1=1 order by listName');\n }\n\n if ($step == 'lists') {\n $bab_columns = array('listName', 'listAdminEmail','listDescription','listUnsubscribeUrl','listEmailForm','listSubjectLine');\n $bab_submit_value = 'Add List';\n $bab_prefix = 'new';\n\n if ($listToEdit = gps('list')) {\n $bab_hidden_input = '<input type=\"hidden\" name=\"editListID\" value=\"' . $listToEdit . '\">';\n $bab_prefix = 'edit';\n $bab_submit_value = 'Update List Information';\n $bab_prefix = 'edit';\n\n $row = safe_row('*', 'bab_pm_list_prefs', \"listID=\" . doSlash($listToEdit));\n echo \"<fieldset id=bab_pm_edit><legend>Editing List: $row[listName]</legend>\";\n }\n\n $form_prefix = $prefs[_bab_prefix_key('form_select_prefix')];\n\n $forms = safe_column('name', 'txp_form',\"name LIKE '\". doSlash($form_prefix) . \"%'\");\n $form_select = selectInput($bab_prefix.ucfirst('listEmailForm'), $forms, @$row['listEmailForm']);\n // replace class\n $form_select = str_replace('class=\"list\"', 'class=\"bab_pm_input\"', $form_select);\n }\n\n // build form\n\n echo '<form method=\"POST\" id=\"subscriber_edit_form\">';\n\n foreach ($bab_columns as $column) {\n echo '<dl class=\"bab_pm_form_input\"><dt>'.bab_pm_preferences($column).'</dt><dd>';\n $bab_input_name = $bab_prefix . ucfirst($column);\n\n switch ($column) {\n case 'listEmailForm':\n echo $form_select;\n break;\n case 'listSubjectLine':\n $checkbox_text = 'Use Article Title for Subject';\n case 'listUnsubscribeUrl':\n if (empty($checkbox_text)) {\n $checkbox_text = 'Use Default';\n }\n\n $checked = empty($row[$column]) ? 'checked=\"checked\" ' : '';\n $js = <<<eojs\n<script>\n$(document).ready(function () {\n $('#{$column}_checkbox').change(function(){\n if ($(this).is(':checked')) {\n $('input[name={$bab_input_name}]').attr('disabled', true).val('');\n }\n else {\n $('input[name={$bab_input_name}]').attr('disabled', false);\n }\n });\n});\n</script>\n\neojs;\n\n echo $js . '<input id=\"'.$column.'_checkbox\" type=\"checkbox\" class=\"bab_pm_input\" ' . $checked . '/>'.$checkbox_text.'</dd><dd>' .\n '<input type=\"text\" name=\"' . $bab_input_name . '\" value=\"' . doSpecial(@$row[$column]) . '\"' .\n (!empty($checked) ? ' disabled=\"disabled\"' : '') . ' />' .\n '</dd>';\n break;\n case 'subscriberLists':\n foreach ($lists as $list) {\n $checked = '';\n\n foreach ($subscriber_lists as $slist) {\n if ($list['listID'] == $slist['list_id']) {\n $checked = 'checked=\"checked\" ';\n break;\n }\n }\n\n echo '<input type=\"checkbox\" name=\"'. $bab_input_name .'[]\" value=\"'.$list['listID'].'\"' . $checked . '/>'\n . doSpecial($list['listName']) . \"<br>\";\n }\n break;\n default:\n echo '<input type=\"text\" name=\"' . $bab_input_name . '\" value=\"' . doSpecial(@$row[$column]) . '\" class=\"bab_pm_input\">';\n break;\n }\n\n echo '</dd></dl>';\n }\n\n echo $bab_hidden_input;\n echo '<input type=\"submit\" value=\"' . doSpecial($bab_submit_value) . '\" class=\"publish\">';\n echo '</form>';\n}", "public function actual()\n {\n $name = post_param_string('name');\n $message = post_param_string('message');\n $recommender_email_address = post_param_string('recommender_email_address');\n\n $invite = false;\n\n if (addon_installed('captcha')) {\n require_code('captcha');\n enforce_captcha();\n }\n\n require_code('type_sanitisation');\n\n $email_adrs_to_send = array();\n $names_to_send = array();\n\n foreach ($_POST as $key => $email_address) {\n if (substr($key, 0, 14) != 'email_address_') {\n continue;\n }\n if ($email_address == '') {\n continue;\n }\n\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n if (!is_email_address($email_address)) {\n attach_message(do_lang_tempcode('INVALID_EMAIL_ADDRESS'), 'warn');\n return $this->gui();\n } else {\n $email_adrs_to_send[] = $email_address;\n $names_to_send[] = $email_address;\n }\n\n if (is_guest()) {\n break;\n }\n }\n\n $adrbook_emails = array();\n $adrbook_names = array();\n $adrbook_use_these = array();\n foreach ($_POST as $key => $email_address) {\n if (preg_match('#details_email_|details_name_|^use_details_#', $key) == 0) {\n continue;\n }\n if (preg_match('#details_email_#', $key) != 0) {\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n if (is_email_address($email_address)) {\n $curr_num = intval(preg_replace('#details_email_#', '', $key));\n $adrbook_emails[$curr_num] = $email_address;\n }\n }\n\n if (preg_match('#details_name_#', $key)) {\n $curr_num = intval(preg_replace('#details_name_#', '', $key));\n $adrbook_names[$curr_num] = $email_address;\n }\n\n if (preg_match('#^use_details_#', $key)) {\n $curr_num = intval(preg_replace('#use_details_#', '', $key));\n $adrbook_use_these[$curr_num] = $curr_num;\n }\n }\n\n // Add emails from address book file\n foreach ($adrbook_use_these as $key => $value) {\n $cur_email = (array_key_exists($key, $adrbook_emails) && strlen($adrbook_emails[$key]) > 0) ? $adrbook_emails[$key] : '';\n $cur_name = (array_key_exists($key, $adrbook_names) && strlen($adrbook_names[$key]) > 0) ? $adrbook_names[$key] : '';\n if (strlen($cur_email) > 0) {\n $email_adrs_to_send[] = $cur_email;\n $names_to_send[] = (strlen($cur_name) > 0) ? $cur_name : $cur_email;\n }\n }\n\n if (count($email_adrs_to_send) == 0) {\n warn_exit(do_lang_tempcode('ERROR_NO_CONTACTS_SELECTED'));\n }\n\n foreach ($email_adrs_to_send as $key => $email_address) {\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n if (post_param_integer('wrap_message', 0) == 1) {\n $referring_username = is_guest() ? null : get_member();\n $_url = (post_param_integer('invite', 0) == 1) ? build_url(array('page' => 'join', 'email_address' => $email_address, 'keep_referrer' => $referring_username), get_module_zone('join')) : build_url(array('page' => '', 'keep_referrer' => $referring_username), '');\n $url = $_url->evaluate();\n $join_url = $GLOBALS['FORUM_DRIVER']->join_url();\n $_message = do_lang((post_param_integer('invite', 0) == 1) ? 'INVITE_MEMBER_MESSAGE' : 'RECOMMEND_MEMBER_MESSAGE', $name, $url, array(get_site_name(), $join_url)) . $message;\n } else {\n $_message = $message;\n }\n\n if ((may_use_invites()) && (post_param_integer('invite', 0) == 1)) {\n send_recommendation_email($name, $email_address, $_message, true, $recommender_email_address, post_param_string('subject', null), $names_to_send[$key]);\n\n $GLOBALS['FORUM_DB']->query_insert('f_invites', array(\n 'i_inviter' => get_member(),\n 'i_email_address' => $email_address,\n 'i_time' => time(),\n 'i_taken' => 0\n ));\n\n $invite = true;\n } elseif ((get_option('is_on_invites') == '0') && (get_forum_type() == 'cns')) {\n $GLOBALS['FORUM_DB']->query_insert('f_invites', array( // Used for referral tracking\n 'i_inviter' => get_member(),\n 'i_email_address' => $email_address,\n 'i_time' => time(),\n 'i_taken' => 0\n ));\n }\n\n if (!$invite) {\n send_recommendation_email($name, $email_address, $_message, false, $recommender_email_address, post_param_string('subject', null), $names_to_send[$key]);\n }\n }\n\n require_code('autosave');\n clear_cms_autosave();\n\n return inform_screen($this->title, do_lang_tempcode('RECOMMENDATION_MADE', escape_html(get_site_name())));\n }", "private function _set_body () {\n // do we need to encode??\n $encode = (empty($this->htmlbody) && empty($this->attachments)) ? false : true;\n\n if ($encode) {\n $this->full_body = \"This is a multi-part message in MIME format.\\n\\n\";\n $this->full_body .= '--'.$this->boundary.\"\\nContent-Type: multipart/alternative;\\n\\tboundary=\\\"\".$this->boundary_alt.\"\\\"\\n\\n\\n\";\n $body_boundary = $this->boundary_alt;\n $this->xheaders['Content-Type'] = \"multipart/mixed;\\n\\tboundary=\\\"\".$this->boundary.'\"';\n\n if (!empty($this->body)) {\n $this->full_body .= '--'.$body_boundary.\"\\nContent-Type: text/plain; charset=\".$this->charset.\"\\nContent-Transfer-Encoding: \".$this->ctencoding.\"\\n\\n\".$this->body.\"\\n\\n\";\n }\n if (!empty($this->htmlbody)) {\n $this->full_body .= '--'.$body_boundary.\"\\nContent-Type: text/html; charset=\".$this->charset.\"\\nContent-Transfer-Encoding: \".$this->ctencoding.\"\\n\\n\".$this->htmlbody.\"\\n\\n\";\n }\n\n $this->full_body .= '--'.$body_boundary.\"--\\n\\n\";\n\n if (!empty($this->attachments)) {\n $this->_build_attachments();\n }\n $this->full_body .= '--'.$this->boundary.'--'; // ends the last boundary\n }\n // else we just send plain text.\n else {\n if (!empty($this->body)) {\n $this->full_body = $this->body;\n }\n else {\n throw new Exception(\"Cannot send, no body\");\n }\n }\n }", "function cap_byline_activate() {\n /**\n * Create the Gravity Form contact form for bios\n */\n if ( function_exists('gform_notification') ) {\n $form = Array (\n 'labelPlacement' => 'top_label',\n 'useCurrentUserAsAuthor' => 1,\n 'title' => __('Contact Author', 'cap-byline'),\n 'description' => __('Fill out the form below to contact this author', 'cap-byline'),\n 'descriptionPlacement' => 'below',\n 'button' => Array ( 'type' => 'text', 'text' => __('Submit', 'cap-byline') ),\n 'fields' => Array (\n '0' => Array (\n 'id' => '1',\n 'isRequired' => '1',\n 'size' => 'medium',\n 'type' => 'name',\n 'label' => __('Name', 'cap-byline'),\n 'inputs' =>Array (\n '0' => Array ( 'id' => '1.3', 'label' => __('First', 'cap-byline') ),\n '1' => Array ( 'id' => '1.6', 'label' => __('Last', 'cap-byline') )\n ),\n 'formId' => '2',\n 'pageNumber' => '1',\n 'descriptionPlacement' => 'below',\n ),\n '1' => Array (\n 'id' => '2',\n 'isRequired' => '1',\n 'size' => 'medium',\n 'type' => 'email',\n 'label' => __('Email', 'cap-byline'),\n 'formId' => '2',\n 'pageNumber' => '1',\n 'descriptionPlacement' => 'below',\n ),\n '2' => Array (\n 'id' => '3',\n 'isRequired' => '1',\n 'size' => 'medium',\n 'type' => 'textarea',\n 'label' => __('Message', 'cap-byline'),\n 'formId' => '2',\n 'pageNumber' => '1',\n 'descriptionPlacement' => 'below',\n ),\n '3' => Array (\n 'allowsPrepopulate' => 1,\n 'id' => 4,\n 'size' => 'medium',\n 'type' => 'hidden',\n 'inputName' => 'author_contact_email',\n 'label' => __('To', 'cap-byline'),\n 'formId' => 2,\n 'pageNumber' => 1,\n 'descriptionPlacement' => 'below'\n )\n ),\n 'enableHoneypot' => '1',\n 'enableAnimation' => '1',\n 'id' => '2',\n 'notifications' => Array (\n '53a057ebea107' => Array (\n 'id' => '53a057ebea107',\n 'to' => '{admin_email}',\n 'name' => __('Admin Notification', 'cap-byline'),\n 'event' => 'form_submission',\n 'toType' => 'email',\n 'subject' => sprintf(__('You have received a message from %s', 'cap-byline'), get_bloginfo('name')),\n 'message' => '{all_fields}'\n ),\n ),\n 'confirmations' => Array (\n '53a057ebeadd6' => Array (\n 'id' => '53a057ebeadd6',\n 'isDefault' => '1',\n 'type' => 'message',\n 'name' => __('Default Confirmation', 'cap-byline'),\n 'message' => __('Thank you for contacting me.', 'cap-byline'),\n 'disableAutoformat' => null,\n 'pageId' => null,\n 'url' => null,\n 'queryString' => null,\n 'conditionalLogic' => Array ( ),\n )\n ),\n 'is_active' => '1',\n 'date_created' => '2014-06-17 15:17:18',\n 'is_trash' => '0',\n );\n $form_id = GFAPI::add_form($form);\n }\n}", "function clsRecordemails2()\r\n\r\n {\r\n\r\n\r\n\r\n global $FileName;\r\n\r\n $this->Visible = true;\r\n\r\n $this->Errors = new clsErrors();\r\n\r\n $this->ds = new clsemails2DataSource();\r\n\r\n $this->UpdateAllowed = false;\r\n\r\n $this->DeleteAllowed = false;\r\n\r\n if($this->Visible)\r\n\r\n {\r\n\r\n $this->ComponentName = \"emails2\";\r\n\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n\r\n $this->subject = new clsControl(ccsTextBox, \"subject\", \"Subject\", ccsText, \"\", CCGetRequestParam(\"subject\", $Method));\r\n\r\n $this->subject->Required = true;\r\n\r\n $this->message = new clsControl(ccsTextArea, \"message\", \"Message\", ccsMemo, \"\", CCGetRequestParam(\"message\", $Method));\r\n\r\n $this->Insert = new clsButton(\"Insert\");\r\n\r\n $this->Cancel = new clsButton(\"Cancel\");\r\n\r\n $this->to_user_id = new clsControl(ccsHidden, \"to_user_id\", \"To User Id\", ccsInteger, \"\", CCGetRequestParam(\"to_user_id\", $Method));\r\n\r\n $this->from_user_id = new clsControl(ccsHidden, \"from_user_id\", \"From User Id\", ccsInteger, \"\", CCGetRequestParam(\"from_user_id\", $Method));\r\n\r\n $this->emaildate = new clsControl(ccsHidden, \"emaildate\", \"date\", ccsInteger, \"\", CCGetRequestParam(\"emaildate\", $Method));\r\n\r\n $this->been_read = new clsControl(ccsHidden, \"been_read\", \"Been Read\", ccsInteger, \"\", CCGetRequestParam(\"been_read\", $Method));\r\n\r\n }\r\n\r\n }", "public function emailAction() {\n\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_email');\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_Email();\n\n //check if comments should be displayed or not\n $show_comments = Engine_Api::_()->sitestore()->displayCommentInsights();\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n $taskstable = Engine_Api::_()->getDbtable('tasks', 'core');\n $rtasksName = $taskstable->info('name');\n $taskstable_result = $taskstable->select()\n ->from($rtasksName, array('processes', 'timeout'))\n ->where('title = ?', 'Sitestore Insight Mail')\n ->where('plugin = ?', 'Sitestore_Plugin_Task_InsightNotification')\n ->limit(1);\n $prefields = $taskstable->fetchRow($taskstable_result);\n\n //populate form\n// $form->populate(array(\n// 'sitestore_insightemail' => $prefields->processes,\n// ));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {\n $values = $form->getValues();\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_insightemail', $values['sitestore_insightemail']);\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n if(empty($sitemailtemplates)) {\n\t\t\t\tEngine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_bg_color', $values['sitestore_bg_color']);\n }\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n if ($values['sitestore_demo'] == 1 && $values['sitestore_insightemail'] == 1) {\n\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n $site_title = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.site.title', Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.site.title', 1));\n\n $insights_string = '';\n\t\t\t\t$template_header = \"\";\n\t\t\t\t$template_footer = \"\";\n if(!$sitemailtemplates) {\n\t\t\t\t\t$site_title_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.title.color', \"#ffffff\");\n\t\t\t\t\t$site_header_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.header.color', \"#79b4d4\");\n\n\t\t\t\t\t//GET SITE \"Email Body Outer Background\" COLOR\n\t\t\t\t\t$site_bg_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.bg.color', \"#f7f7f7\");\n\t\t\t\t\t$insights_string.= \"<table cellpadding='2'><tr><td><table cellpadding='2'><tr><td><span style='font-size: 14px; font-weight: bold;'>\" . $view->translate(\"Sample Store\") . \"</span></td></tr>\";\n\n\t\t\t\t\t$template_header.= \"<table width='98%' cellspacing='0' border='0'><tr><td width='100%' bgcolor='$site_bg_color' style='font-family:arial,tahoma,verdana,sans-serif;padding:40px;'><table width='620' cellspacing='0' cellpadding='0' border='0'>\";\n\t\t\t\t\t$template_header.= \"<tr><td style='background:\" . $site_header_color . \"; color:$site_title_color;font-weight:bold;font-family:arial,tahoma,verdana,sans-serif; padding: 4px 8px;vertical-align:middle;font-size:16px;text-align: left;' nowrap='nowrap'>\" . $site_title . \"</td></tr><tr><td valign='top' style='background-color:#fff; border-bottom: 1px solid #ccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-family:arial,tahoma,verdana,sans-serif; padding: 15px;padding-top:0;' colspan='2'><table width='100%'><tr><td colspan='2'>\";\n\n $template_footer.= \"</td></tr></table></td></tr></td></table></td></tr></table>\";\n }\n\n if ($values['sitestore_insightmail_options'] == 1) {\n $vals['days_string'] = $view->translate('week');\n } elseif ($values['sitestore_insightmail_options'] == 2) {\n $vals['days_string'] = $view->translate('month');\n }\n $path = 'http://' . $_SERVER['HTTP_HOST'] . $view->baseUrl();\n $insight_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Visit your Insights Store') . \"</a>\";\n $update_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Send an update to people who like this') . \"</a>\";\n\n //check if Communityad Plugin is enabled\n $sitestorecommunityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n $adversion = null;\n if ($sitestorecommunityadEnabled) {\n $communityadmodulemodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('communityad');\n $adversion = $communityadmodulemodule->version;\n if ($adversion >= '4.1.5') {\n $promote_Ad_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Promote with %s Ads', $site_title) . \"</a>\";\n }\n }\n\n $insights_string.= \"<table><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $vals['days_string'] . $view->translate(array('ly active user', 'ly active users', 2), 2) . \"</span></td></tr><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('person likes this', 'people like this', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n if (!empty($show_comments)) {\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('comment', 'comments', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n }\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '10' . \"</span>\\t <span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('visit', 'visits', 2), 2) . \"</span>&nbsp;<span style='font-size: 18px; font-family: arial;' >\" . '5' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr></table><table><tr><td>\" . \"<ul style=' padding-left: 5px;'><li>\" . $insight_link . \"</li><li>\" . $update_link;\n\n //check if Communityad Plugin is enabled\n if ($sitestorecommunityadEnabled && $adversion >= '4.1.5') {\n $insights_string.= \"</li><li>\" . $promote_Ad_link;\n }\n $insights_string.= \"</li></ul></td></tr></table>\";\n $days_string = ucfirst($vals['days_string']);\n $owner_name = Engine_Api::_()->user()->getViewer()->getTitle();\n $email = Engine_Api::_()->getApi('settings', 'core')->core_mail_from;\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($values['sitestore_admin'], 'SITESTORE_INSIGHTS_EMAIL_NOTIFICATION', array(\n 'recipient_title' => $owner_name,\n 'template_header' => $template_header,\n 'message' => $insights_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'days' => $days_string,\n 'email' => $email,\n 'queue' => true));\n }\n }\n }", "public function beforeSendToClient($cname)\n\t{\n\t\t$form_name = self::form_name($cname, $this->id);\n\n\t\tif (($templated_path = self::templateImagePath($this->attrs['image_path'])) != $this->attrs['image_path'])\n\t\t{\n\t\t\tself::setElementAttribute($form_name, 'image_path', $this->attrs['image_path'] = $templated_path);\n\t\t\t//error_log(__METHOD__.\"() setting templated image-path for $form_name: $templated_path\");\n\t\t}\n\n\t\tif (!is_array(self::$request->sel_options[$form_name])) self::$request->sel_options[$form_name] = array();\n\t\tif ($this->attrs['type'])\n\t\t{\n\t\t\t// += to keep further options set by app code\n\t\t\tself::$request->sel_options[$form_name] += self::typeOptions($this->attrs['type'], $this->attrs['options'],\n\t\t\t\t$no_lang=null, $this->attrs['readonly'], self::get_array(self::$request->content, $form_name));\n\n\t\t\t// if no_lang was modified, forward modification to the client\n\t\t\tif ($no_lang != $this->attr['no_lang'])\n\t\t\t{\n\t\t\t\tself::setElementAttribute($form_name, 'no_lang', $no_lang);\n\t\t\t}\n\t\t}\n\n\t\t// Make sure &nbsp;s, etc. are properly encoded when sent, and not double-encoded\n\t\tforeach(self::$request->sel_options[$form_name] as &$label)\n\t\t{\n\t\t\tif(!is_array($label))\n\t\t\t{\n\t\t\t\t$label = html_entity_decode($label, ENT_NOQUOTES,'utf-8');\n\t\t\t}\n\t\t\telseif($label['label'])\n\t\t\t{\n\t\t\t\t$label['label'] = html_entity_decode($label['label'], ENT_NOQUOTES,'utf-8');\n\t\t\t}\n\t\t}\n\n\t}", "private function render_settings() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php esc_html_e( 'Network Mail', 'simple-smtp' ); ?></h1>\n\t\t\t<form action='edit.php?action=wpsimplesmtpms' method='post'>\t\n\t\t\t\t<?php\n\t\t\t\twp_nonce_field( 'simple-smtp-ms' );\n\t\t\t\tdo_settings_sections( 'wpsimplesmtp_smtp_ms' );\n\t\t\t\tsubmit_button();\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\t}", "private function updater() {\n\n\t\t\\add_action(\n\t\t\t'wpforms_updater',\n\t\t\tfunction ( $key ) {\n\t\t\t\tnew \\WPForms_Updater(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'plugin_name' => 'WPForms Conversational Forms',\n\t\t\t\t\t\t'plugin_slug' => 'wpforms-conversational-forms',\n\t\t\t\t\t\t'plugin_path' => \\plugin_basename( \\WPFORMS_CONVERSATIONAL_FORMS_FILE ),\n\t\t\t\t\t\t'plugin_url' => \\trailingslashit( $this->url ),\n\t\t\t\t\t\t'remote_url' => \\WPFORMS_UPDATER_API,\n\t\t\t\t\t\t'version' => \\WPFORMS_CONVERSATIONAL_FORMS_VERSION,\n\t\t\t\t\t\t'key' => $key,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t}", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "function wcfmu_seller_verification_html() {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\r\n\t\tif( isset( $_POST['messageid'] ) && isset($_POST['vendorid']) ) {\r\n\t\t\t$message_id = absint( $_POST['messageid'] );\r\n\t\t\t$vendor_id = absint( $_POST['vendorid'] );\r\n\r\n\t\t\tif( $vendor_id && $message_id ) {\r\n\r\n\t\t\t\t$vendor_verification_data = (array) get_user_meta( $vendor_id, 'wcfm_vendor_verification_data', true );\r\n\t\t\t\t$identity_types = $this->get_identity_types();\r\n\r\n\t\t\t\t$address = isset( $vendor_verification_data['address']['street_1'] ) ? $vendor_verification_data['address']['street_1'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['street_2'] ) ? ' ' . $vendor_verification_data['address']['street_2'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['city'] ) ? '<br />' . $vendor_verification_data['address']['city'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['zip'] ) ? ' ' . $vendor_verification_data['address']['zip'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['country'] ) ? '<br />' . $vendor_verification_data['address']['country'] : '';\r\n\t\t\t\t$address .= isset( $vendor_verification_data['address']['state'] ) ? ', ' . $vendor_verification_data['address']['state'] : '';\r\n\r\n\t\t\t\t$verification_note = isset( $vendor_verification_data['verification_note'] ) ? $vendor_verification_data['verification_note'] : '';\r\n\r\n\t\t\t\t?>\r\n\t\t\t\t<form id=\"wcfm_verification_response_form\">\r\n\t\t\t\t\t<table>\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t <?php\r\n\t\t\t\t\t\t if( !empty( $identity_types ) ) {\r\n\t\t\t\t\t\t\t\tforeach( $identity_types as $identity_type => $identity_type_label ) {\r\n\t\t\t\t\t\t\t\t\t$identity_type_value = '';\r\n\t\t\t\t\t\t\t\t\tif( !empty( $vendor_verification_data ) && isset( $vendor_verification_data['identity'] ) && isset( $vendor_verification_data['identity'][$identity_type] ) ) $identity_type_value = $vendor_verification_data['identity'][$identity_type];\r\n\t\t\t\t\t\t\t\t\tif( $identity_type_value ) {\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<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php echo $identity_type_label; ?></td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<td><a class=\"wcfm-wp-fields-uploader\" target=\"_blank\" style=\"width: 32px; height: 32px;\" href=\"<?php echo $identity_type_value; ?>\"><span style=\"width: 32px; height: 32px; display: inline-block;\" class=\"placeHolderDocs\"></span></a></td>\r\n\t\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t<?php\r\n\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}\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php _e( 'Address', 'wc-frontend-manager-ultimate' ); ?></td>\r\n\t\t\t\t\t\t\t\t<td><?php echo $address; ?></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php _e( 'Note to Vendor', 'wc-frontend-manager-ultimate' ); ?></td>\r\n\t\t\t\t\t\t\t\t<td><textarea class=\"wcfm-textarea\" name=\"wcfm_verification_response_note\"></textarea></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td class=\"wcfm_verification_response_form_label\"><?php _e( 'Status Update', 'wc-frontend-manager-ultimate' ); ?></td>\r\n\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t <label for=\"wcfm_verification_response_status_approve\"><input type=\"radio\" id=\"wcfm_verification_response_status_approve\" name=\"wcfm_verification_response_status\" value=\"approve\" checked /><?php _e( 'Approve', 'wc-frontend-manager-ultimate' ); ?></label>\r\n\t\t\t\t\t\t\t\t <label for=\"wcfm_verification_response_status_reject\"><input type=\"radio\" id=\"wcfm_verification_response_status_reject\" name=\"wcfm_verification_response_status\" value=\"reject\" /><?php _e( 'Reject', 'wc-frontend-manager-ultimate' ); ?></label>\r\n\t\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</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"wcfm_verification_vendor_id\" value=\"<?php echo $vendor_id; ?>\" />\r\n\t\t\t\t\t<input type=\"hidden\" name=\"wcfm_verification_message_id\" value=\"<?php echo $message_id; ?>\" />\r\n\t\t\t\t\t<div class=\"wcfm-message\" tabindex=\"-1\"></div>\r\n\t\t\t\t\t<input type=\"button\" class=\"wcfm_verification_response_button wcfm_submit_button\" id=\"wcfm_verification_response_button\" value=\"<?php _e( 'Update', 'wc-frontend-manager-ultimate' ); ?>\" />\r\n\t\t\t\t</form>\r\n\t\t\t\t<?php\r\n\t\t\t}\r\n\t\t}\r\n\t\tdie;\r\n\t}", "function parse_form($array) {\n// build reserved keyword array\n//Anything put in here will not show up in your email when form is processed\n $reserved_keys[] = \"MAX_FILE_SIZE\";\n $reserved_keys[] = \"required\";\n $reserved_keys[] = \"redirect\";\n //$reserved_keys[] = \"email\";\n $reserved_keys[] = \"require\";\n $reserved_keys[] = \"path_to_file\";\n $reserved_keys[] = \"recipient\";\n $reserved_keys[] = \"subject\";\n $reserved_keys[] = \"bgcolor\";\n $reserved_keys[] = \"text_color\";\n $reserved_keys[] = \"link_color\";\n $reserved_keys[] = \"vlink_color\";\n $reserved_keys[] = \"alink_color\";\n $reserved_keys[] = \"title\";\n $reserved_keys[] = \"missing_fields_redirect\";\n $reserved_keys[] = \"env_report\";\n $reserved_keys[] = \"Submit\";\n $reserved_keys[] = \"submit\";\n //$reserved_keys[] = \"name\";\n $reserved_keys[] = \"Name\";\n $reserved_keys[] = \"submit_x\";\n $reserved_keys[] = \"submit_y\";\n $reserved_keys[] = \"sendit\";\n if (count($array)) {\n while (list($key, $val) = each($array)) {\n//check for email injection\n\t\tif(!has_no_emailheaders($val)){\n\t\t\tprint_error(\"Please don't spam\");\n\t\t}\n\t\t\n// exclude reserved keywords\n $reserved_violation = 0;\n for ($ri=0; $ri<count($reserved_keys); $ri++) {\n if ($key == $reserved_keys[$ri]) $reserved_violation = 1;\n }\n// prepare content\n if ($reserved_violation != 1) {\n\t// let's check to see if they are check boxes\n if (is_array($val)) {\n for ($z=0; $z<count($val); $z++) {\n $nn=$z+1;\n $content .= \"$key #$nn: $val[$z]\\n\";\n }\n }\n\t // if the values contains nothing do nothing then\n\t // don't add it to the content)\n elseif($val != \"\") $content .= \"$key: $val\\n\";\n }\n } // end of while\nreturn $content;\n }\n}", "function process($data, $form) {\n\t\t// submitted form object\n\t\t$submittedForm = new SubmittedForm();\n\t\t$submittedForm->SubmittedByID = ($id = Member::currentUserID()) ? $id : 0;\n\t\t$submittedForm->ParentID = $this->ID;\n\t\t$submittedForm->Recipient = $this->EmailTo;\n\t\tif(!$this->DisableSaveSubmissions) $submittedForm->write();\n\t\t\n\t\t// email values\n\t\t$values = array();\n\t\t$recipientAddresses = array();\n\t\t$sendCopy = false;\n $attachments = array();\n\n\t\t$submittedFields = new DataObjectSet();\n\t\t\n\t\tforeach($this->Fields() as $field) {\n\t\t\t// don't show fields that shouldn't be shown\n\t\t\tif(!$field->showInReports()) continue;\n\t\t\t\n\t\t\t$submittedField = $field->getSubmittedFormField();\n\t\t\t$submittedField->ParentID = $submittedForm->ID;\n\t\t\t$submittedField->Name = $field->Name;\n\t\t\t$submittedField->Title = $field->Title;\n\t\t\t\t\t\n\t\t\tif($field->hasMethod('getValueFromData')) {\n\t\t\t\t$submittedField->Value = $field->getValueFromData($data);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(isset($data[$field->Name])) $submittedField->Value = $data[$field->Name];\n\t\t\t}\n\n\t\t\tif(!empty($data[$field->Name])){\n\t\t\t\tif(in_array(\"EditableFileField\", $field->getClassAncestry())) {\n\t\t\t\t\tif(isset($_FILES[$field->Name])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// create the file from post data\n\t\t\t\t\t\t$upload = new Upload();\n\t\t\t\t\t\t$file = new File();\n\t\t\t\t\t\t$upload->loadIntoFile($_FILES[$field->Name], $file);\n\n\t\t\t\t\t\t// write file to form field\n\t\t\t\t\t\t$submittedField->UploadedFileID = $file->ID;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Attach the file if its less than 1MB, provide a link if its over.\n\t\t\t\t\t\tif($file->getAbsoluteSize() < 1024*1024*1){\n\t\t\t\t\t\t\t$attachments[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$this->DisableSaveSubmissions) $submittedField->write();\n\t\t\t\n\t\t\t$submittedFields->push($submittedField);\n\t\t}\t\n\t\t$emailData = array(\n\t\t\t\"Sender\" => Member::currentUser(),\n\t\t\t\"Fields\" => $submittedFields\n\t\t);\n\n\t\t// email users on submit. All have their own custom options. \n\t\tif($this->EmailRecipients()) {\n\t\t\t$email = new UserDefinedForm_SubmittedFormEmail($submittedFields); \n\t\t\t$email->populateTemplate($emailData);\n\t\t\tif($attachments){\n\t\t\t\tforeach($attachments as $file){\n\t\t\t\t\t// bug with double decorated fields, valid ones should have an ID.\n\t\t\t\t\tif($file->ID != 0) {\n\t\t\t\t\t\t$email->attachFile($file->Filename,$file->Filename, $file->getFileType());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->EmailRecipients() as $recipient) {\n\t\t\t\t$email->populateTemplate($recipient);\n\t\t\t\t$email->populateTemplate($emailData);\n\t\t\t\t$email->setFrom($recipient->EmailFrom);\n\t\t\t\t$email->setBody($recipient->EmailBody);\n\t\t\t\t$email->setSubject($recipient->EmailSubject);\n\t\t\t\t$email->setTo($recipient->EmailAddress);\n\t\t\t\t\n\t\t\t\t// check to see if they are a dynamic sender. eg based on a email field a user selected\n\t\t\t\tif($recipient->SendEmailFromField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailFromField()->Name);\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setFrom($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// check to see if they are a dynamic reciever eg based on a dropdown field a user selected\n\t\t\t\tif($recipient->SendEmailToField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailToField()->Name);\n\t\t\t\t\t\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setTo($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($recipient->SendPlain) {\n\t\t\t\t\t$body = strip_tags($recipient->EmailBody) . \"\\n \";\n\t\t\t\t\tif(isset($emailData['Fields']) && !$recipient->HideFormData) {\n\t\t\t\t\t\tforeach($emailData['Fields'] as $Field) {\n\t\t\t\t\t\t\t$body .= $Field->Title .' - '. $Field->Value .' \\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$email->setBody($body);\n\t\t\t\t\t$email->sendPlain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$email->send();\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn Director::redirect($this->Link() . 'finished?referrer=' . urlencode($data['Referrer']));\n\t}", "public function createContactForm()\n {\n $email_icon = '<i class=\"fa fa-envelope\" aria-hidden=\"true\"></i>';\n $phone_icon = '<i class=\"fa fa-phone\" aria-hidden=\"true\"></i>';\n $send_icon = '<i class=\"fa fa-envelope append\" aria-hidden=\"true\"></i>';\n $user_icon = '<i class=\"fa fa-user\" aria-hidden=\"true\" aria-hidden=\"true\"></i>';\n if ($this->framework == 'bs3') {\n $email_icon = '<span class=\"glyphicon glyphicon-envelope\" aria-hidden=\"true\"></span>';\n $phone_icon = '<span class=\"glyphicon glyphicon-earphone\" aria-hidden=\"true\"></span>';\n $send_icon = '<span class=\"glyphicon glyphicon-envelope append\"></span>';\n $user_icon = '<span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span>';\n } elseif ($this->framework == 'foundation') {\n $email_icon = '<i class=\"input-group-label fi-mail\" aria-hidden=\"true\"></i>';\n $phone_icon = '<i class=\"input-group-label fi-telephone\" aria-hidden=\"true\"></i>';\n $send_icon = '<i class=\"fi-mail append\"></i>';\n $user_icon = '<i class=\"input-group-label fi-torso\" aria-hidden=\"true\"></i>';\n } elseif ($this->framework == 'material' && !in_array('materialize', $this->js_plugins)) {\n $email_icon = '<i class=\"material-icons\" aria-hidden=\"true\">alternate_email</i>';\n $phone_icon = '<i class=\"material-icons\" aria-hidden=\"true\">phone</i>';\n $send_icon = '<i class=\"material-icons right\">email</i>';\n $user_icon = '<i class=\"material-icons\" aria-hidden=\"true\">person</i>';\n }\n\n $this->startFieldset('Please fill in this form to contact us');\n $this->addHtml('<p class=\"text-warning\">All fields are required</p>');\n $this->groupInputs('user-name', 'user-first-name');\n $this->setCols(0, 6);\n $this->addIcon('user-name', $user_icon, 'before');\n $this->addInput('text', 'user-name', '', '', 'class=input-group-field, placeholder=Name, required');\n $this->addIcon('user-first-name', $user_icon, 'before');\n $this->addInput('text', 'user-first-name', '', '', 'class=input-group-field, placeholder=First Name, required');\n $this->setCols(0, 12);\n $this->addIcon('user-email', $email_icon, 'before');\n $this->addInput('email', 'user-email', '', '', 'class=input-group-field, placeholder=Email, required');\n $this->addIcon('user-phone', $phone_icon, 'before');\n $this->addInput('text', 'user-phone', '', '', 'class=input-group-field, placeholder=Phone, required');\n if ($this->framework == 'material') {\n $this->addTextarea('message', '', 'Your message', 'cols=30, rows=4, required');\n } else {\n $this->addTextarea('message', '', '', 'cols=30, rows=4, required, placeholder=Message');\n }\n $this->addPlugin('word-character-count', '#message', 'default', array('%maxAuthorized%' => 100));\n $this->addCheckbox('newsletter', 'Suscribe to Newsletter', 1, 'checked=checked');\n $this->printCheckboxGroup('newsletter', '');\n $this->setCols(3, 9);\n $this->addInput('text', 'captcha', '', 'Type the following characters :', 'size=15');\n $this->addPlugin('captcha', '#captcha');\n $this->setCols(0, 12);\n $this->centerButtons(true);\n $this->addBtn('submit', 'submit-btn', 1, 'Send ' . $send_icon, 'class=btn btn-lg btn-success success button');\n $this->endFieldset();\n\n // Custom radio & checkbox css\n if ($this->framework != 'material') {\n $this->addPlugin('nice-check', 'form', 'default', ['%skin%' => 'green']);\n }\n\n // jQuery validation\n $this->addPlugin('formvalidation', '#' . $this->form_ID);\n\n return $this;\n }", "function genContactFormMsgBody($email, $subject, $name, $msg) {\n $message = \"\";\n\n $message .=\"<div style='display:grid; justify-content: center'>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>Form details below.</p>\n <br>\n <p>Name:&nbsp;&nbsp;$name</p>\n <p>Email:&nbsp;&nbsp;$email</p>\n <p>Subject:&nbsp;&nbsp;$subject</p>\n <p>Message:&nbsp;&nbsp;$msg</p>\n </div>\";\n return $message;\n}", "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}", "protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n $error =\"\";\n if(isset($_POST['add'])) {\n if(!empty($_POST['naam'])){\n if(!empty($_POST['email'])){\n if(!empty($_POST['bericht'])){\n require('dbconnect.php');\n function safe($waarde){\n $waarde = trim($waarde);\n $waarde = stripslashes($waarde);\n $waarde = htmlspecialchars($waarde);\n return $waarde;\n }\n \n $naam = safe($_POST['naam']);\n $naam = $conn->real_escape_string($naam);\n $email = safe($_POST['email']);\n $email = $conn->real_escape_string($email);\n $bericht = safe($_POST['bericht']);\n $bericht = $conn->real_escape_string($bericht);\n $today = date('Y-m-d H:i:s');\n \n $sql = \"INSERT INTO mFD13_comments\n (comment_ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id) \n VALUES (NULL, '5463', '$naam', '$email', '', '', '$today', '$today', '$bericht', '0', '0', '', 'comment', '0', '0')\";\n \n if($conn->query($sql)){\n $error =\"<br><div style='border-radius:10px; border:3px solid green; margin-top:2vh; margin-bottom:2vh; display:flex; align-items:center; '><p style='margin:0; font-size:2rem; line-height:2; display:flex; align-items:center;'>reactie is binnen, het moet wel nog verwerkt worden.</p></div <br>\";\n \n \n \n $mail = new PHPMailer(true);\n\n // Settings\n $mail->IsSMTP();\n $mail->CharSet = 'UTF-8';\n\n $mail->Host = \"mail02.compleet.it\"; \n $mail->SMTPAuth = true; \n $mail->SMTPSecure = \"ssl\";\n $mail->Port = 465; \n $mail->Username = \"[email protected]\"; \n $mail->Password = $SMTPWW; \n $mail->setFrom('[email protected]','Speeltuinwesterkwartier');\n $mail->addAddress('[email protected]');\n\n // Content\n $mail->isHTML(true); \n $mail->Subject = 'Reactie van '.$naam;\n $mail->Body = $naam.' heeft een reactie geplaats op speeltuinwesterkwartier.nl<br>Met email: '.$email.'<br><br>Het bericht: '.$bericht;\n $mail->AltBody = $naam.' heeft een reactie geplaats op speeltuinwesterkwartier.nl<br><br>Het bericht: '.$bericht;\n\n $mail->send();\n }\n else{\n $error =\"<br><div style='border-radius:10px; border:3px solid red; margin-top:2vh; margin-bottom:2vh; display:flex; align-items:center;'><p style='margin:0; font-size:2rem; line-height:2; display:flex; align-items:center;'>Er is iets fout gegaan</p></div> <br>\";\n } \n }else{\n $error=\"<br><div style='border-radius:10px; border:3px solid orange; margin-top:2vh; margin-bottom:2vh; display:flex; align-items:center;'><p style='margin:0; font-size:2rem; line-height:2; display:flex; align-items:center;'>Bericht is niet ingevult</p></div><br>\";\n }\n }else{\n $error=\"<br><div style='border-radius:10px; border:3px solid orange; margin-top:2vh; margin-bottom:2vh; display:flex; align-items:center;'><p style='margin:0; font-size:2rem; line-height:2; display:flex; align-items:center;'>Email is niet ingevult</p></div><br>\";\n }\n }else{\n $error=\"<br><div style='border-radius:10px; border:3px solid orange; margin-top:2vh; margin-bottom:2vh; display:flex; align-items:center;'><p style='margin:0; font-size:2rem; line-height:2; display:flex; align-items:center;'>Naam is niet ingevult</p></div><br>\";\n }\n }\n ?>\n <form method=post style=\"color:black;\">\n <label style='font-size:2rem;'>Uw naam*</label><input style=\"border-radius:10px; font-size:2rem;\" type=text name=naam /> <br>\n <label style='font-size:2rem;'>Uw e-mailadres*</label><input style=\"border-radius:10px; font-size:2rem;\" type=email name=email /> <br>\n <label style='font-size:2rem;'>Uw bericht*</label><textarea style=\"border-radius:10px; font-size:2rem; width:100%; height:25vh; border-radius:10xpx;\" name=bericht> </textarea><br>\n <input type=submit name=add style=\"border-radius:10px; color:white; background-color:#004020; font-size:2rem;\" value=\"Reactie plaatsen\"/>\n <?php echo $error; ?>\n </form>\n <?php\n\t}", "public function definition_after_data() {\n global $DB;\n\n $mform = $this->_form;\n\n // Check that we are updating a current customcert.\n if ($this->id) {\n // Get the pages for this customcert.\n if ($pages = $DB->get_records('customcert_pages', array('customcertid' => $this->id))) {\n // Loop through the pages.\n foreach ($pages as $p) {\n // Set the width.\n $element = $mform->getElement('pagewidth_' . $p->id);\n $element->setValue($p->width);\n // Set the height.\n $element = $mform->getElement('pageheight_' . $p->id);\n $element->setValue($p->height);\n // Set the margin.\n $element = $mform->getElement('pagemargin_' . $p->id);\n $element->setValue($p->margin);\n }\n }\n }\n }", "public function init_form_fields()\n {\n\n // Get available placeholders for this email\n $placeholder_text = sprintf(__('Available placeholders: %s', 'subscriptio'), '<code>' . esc_html(implode('</code>, <code>', array_keys($this->placeholders))) . '</code>');\n\n // Define form fields\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __('Enable/Disable', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Enable this email notification', 'subscriptio'),\n 'default' => 'yes',\n ),\n 'send_to_admin' => array(\n 'title' => __('Send to admin', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Send BCC copy to admin', 'subscriptio'),\n 'default' => 'no',\n ),\n 'subject' => array(\n 'title' => __('Subject', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __('Email heading', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'additional_content' => array(\n 'title' => __('Additional content', 'subscriptio'),\n 'description' => __( 'Text to appear to appear below the main email content.', 'subscriptio' ) . ' ' . $placeholder_text,\n 'css' => 'width: 400px; height: 75px;',\n 'placeholder' => __('N/A', 'subscriptio'),\n 'type' => 'textarea',\n 'default' => $this->get_default_additional_content(),\n 'desc_tip' => true,\n ),\n 'email_type' => array(\n 'title' => __('Email type', 'subscriptio'),\n 'type' => 'select',\n 'description' => __('Choose which format of email to send.', 'subscriptio'),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "function Form_Mail()\n {\n /**\n * Form_Mail();\n */\n\n $this->referers_array = array($_SERVER[\"HTTP_HOST\"]);\n /**\n * Leave AS IS to only allow posting from same host that script resides on.\n * List individual hosts to create list of hosts that can post to this script:\n * EXAMPLE: $referer_array = array ('example.com','www.example.com','192.168.0.1');\n */\n\n /* proccess form */\n $this->set_arrays();\n $this->check_referer();\n $this->check_recipient();\n $this->check_required_fields();\n $this->send_form();\n $this->display_thankyou();\n }", "function buildEmailBody($parts, $preview=NULL, $unsubscribe=FALSE) {\n $ci = &get_instance();\n return $ci->load->view('email_view', array(\n 'parts' => $parts,\n 'preview' => $preview,\n 'unsubscribe' => $unsubscribe\n ), TRUE);\n }", "public function resend_email()\n\t{\t\n\t\t// figure out how to compose the body\n\t\tif ($this->that->HTML!='')\n\t\t{\n\t\t\t$body = (isset($this->that->HTML_rewritten)) ? $this->that->HTML_rewritten : $this->that->HTML;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$body = (isset($this->that->PLAIN_rewritten)) ? $this->that->PLAIN_rewritten : $this->that->PLAIN;\n\t\t}\n\n\t\t$is_not_html = $this->that->has_PLAIN_not_HTML();\n\n\t\t// get the attachment filenames\n\t\t$file_array = $this->that->get_file_name_array();\n\t\t\n\t\t// this function is in the email_send_helper\n\t\t// and requires a modified email library\n\t\t// settings for using google as the smtp machine are\n\t\t// embedded in the helper\n\t\t// you can replace this with a simpler email sender\n\t\tsend_email_by_google($this->get_list_address(),\n\t\t\t$this->get_resend_to(),\n\t\t\t$this->get_resend_cc(), \n\t\t\t$this->that->get_address_from(),\n\t\t\t$this->that->get_personal_from(),\n\t\t\t$this->that->get_subject(),\n\t\t\t$body, $is_not_html, $file_array);\n\t}", "public function actionIndex()\n {\n\t\t$dataHtml =$this->renderPartial('Data');\n\t\t\n\t\t/* $form = ActiveForm::begin();\n\t\t$model = new DynamicModel([\n\t\t\t'TextBody', 'Subject'\n\t\t]);\n\t\t $model->addRule(['TextBody', 'Subject'], 'required');\n\t\t$ok='Test LG ERP FROM HOME .... GOOD NIGHT ALL, SEE U LATER ';\n\t\t\n\t\t $form->field($model, 'Subject')->textInput();\n\t\t ActiveForm::end(); */\n\t\t Yii::$app->mailer->compose()\n\t\t ->setFrom(['[email protected]' => 'LG-ERP-POSTMAN'])\n\t\t //->setTo(['[email protected]'])\n\t\t //->setTo(['[email protected]'])\n\t\t ->setTo(['[email protected]'])\n\t\t ->setSubject('ERP TEST EMAIL')\n\t\t ->setHtmlBody($dataHtml)\n\t\t ->send();\n\t\t \n\t\t\n }", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n )\n );\n \n $this->setForm($form);\n $fieldset = $form->addFieldset('message_form', array('legend'=>Mage::helper('orderprocessing')->__('Message')));\n $fieldset->addField('id', 'hidden', array(\n 'name' => 'id',\n )\n );\n $fieldset->addField('created_at', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Created_at'),\n 'name' => 'created_at',\n ));\n $fieldset->addField('message_type', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Message type'),\n 'name' => 'message_type',\n ));\n $fieldset->addField('shop_order_id', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Order Id'),\n 'name' => 'shop_order_id',\n ));\n $fieldset->addField('processed_at', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Processed at'),\n 'name' => 'processed_at',\n ));\n $fieldset->addField('exception_log', 'textarea', array(\n 'label' => Mage::helper('orderprocessing')->__('Exception log'),\n 'style' => 'width: 1000px;',\n 'name' => 'exception_log',\n #'disabled' => true,\n ));\n $fieldset->addField('status_xml', 'select', array(\n 'label' => Mage::helper('orderprocessing')->__('Status'),\n 'name' => 'status_xml',\n 'values' => array(\n array(\n 'value' => 'open',\n 'label' => Mage::helper('orderprocessing')->__('open'),\n ),\n array(\n 'value' => 'complete',\n 'label' => Mage::helper('orderprocessing')->__('complete'),\n ),\n array(\n 'value' => 'error',\n 'label' => Mage::helper('orderprocessing')->__('error'),\n ),\n ),\n 'value' => 1,\n ));\n \n #$form->setAction($this->getUrl('*/adminhtml_brands/save'));\n #$form->setMethod('post');\n $form->setUseContainer(true);\n #$form->setId('edit_form');\n\n if($this->getRequest()->getParam('id')) {\n $id = $this->getRequest()->getParam('id');\n $data = Mage::getModel('orderprocessing/message')->load($id);\n $form->setValues($data->getData());\n \n }\n return parent::_prepareForm();\n }", "public function main() {\n \t\n \t$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;\n \n $content = '<h2>Converting old plugin configuration to flexforms</h2>';\n \n if (t3lib_div::GPvar('action') == 'doit') {\n foreach ($this->selectContentRowsToConvert() as $row){\n $content .= 'Updating uid '.$row['uid'].' on page '.$row['pid'].'<br />';\n $this->updateRow($row['uid'], $this->convertRowToFlexForm($row)); \n }\n } else {\n foreach ($this->selectContentRowsToConvert() as $row){\n $content .= 'Found uid '.$row['uid'].' on page '.$row['pid'].'<br />';\n }\n }\n \n $content .= '<h2>Filling column \"tx_ptgsashop_orders_addresses.irreParentTable\" with data</h2>';\n \n \tif (t3lib_div::GPvar('action') == 'doit') {\n \t\t$table = 'tx_ptgsashop_orders_addresses';\n \t\t\n \t$updateFieldsArr = array ('irreParentTable' => 'tx_ptgsashop_orders'); \n \t$where = 'deliveries_id = 0';\n \t $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $updateFieldsArr);\n \t #tx_pttools_assert::isMySQLRessource($res);\n \t $content .= 'Updating billing addresses... done.<br />';\n \t \n \t$updateFieldsArr = array ('irreParentTable' => 'tx_ptgsashop_orders_deliveries'); \n \t$where = 'deliveries_id != 0';\n \t $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, $where, $updateFieldsArr);\n \t #tx_pttools_assert::isMySQLRessource($res);\n \t $content .= 'Updating delivery addresses... done.<br />';\n } else {\n\t\t\t$select = 'count(*) as c';\n \t$from = 'tx_ptgsashop_orders_addresses';\n \t$where = 'irreParentTable = \"\"';\n \n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n\t #tx_pttools_assert::isMySQLRessource($res);\n\t $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t $content .= 'Found \"'. (empty($row['c']) ? '0' : $row['c']) . '\" records without data in irreParentTable column<br />';\n }\n \n if (t3lib_div::GPvar('action') != 'doit') {\n \t$content .= '<br><a href=\"index.php?&id=0&CMD[showExt]=pt_gsashop&SET[singleDetails]=updateModule&action=doit\"><b>Start updating!</b></a>';\n }\n \n return $content;\n }", "public function frontend_render(): string\n {\n $all_settings = $this->get_settings();\n $current_lang = LanguageHelper::user_lang_slug();\n $padding_top = SanitizeInput::esc_html($all_settings['padding_top']);\n $padding_bottom = SanitizeInput::esc_html($all_settings['padding_bottom']);\n $custom_form_id = SanitizeInput::esc_html($all_settings['custom_form_id']);\n $title = SanitizeInput::esc_html($all_settings['title_'.$current_lang]);\n\n\n\n $output = '<div class=\"lawyer-contact-area\" data-padding-top=\"'.$padding_top.'\" data-padding-bottom=\"'.$padding_bottom.'\">';\n\n $output .='<div class=\"container\">';\n $output .= '<div class=\"row\">';\n\n $output .= '<div class=\"col-lg-6\"><div class=\"left-contnet-wrap\">\n <ul class=\"lawyer-contact-list\">';\n $this->args['settings'] = RepeaterField::remove_default_fields($all_settings);\n foreach ($this->args['settings'] as $key => $setting){\n if (is_array($setting)){\n $this->args['repeater'] = $setting;\n $array_lang_item = $setting[array_key_last($setting)];\n if (!empty($array_lang_item) && is_array($array_lang_item) && count($array_lang_item) > 0) {\n foreach ($array_lang_item as $index => $value) {\n\n $output .= $this->render_slider_markup($index); // for multiple array index\n }\n } else {\n $output .= $this->render_slider_markup(); // for only one index of array\n }\n }\n }\n\n $output .= '</ul></div></div>'; //contact info column wrap\n\n if (!empty($custom_form_id)){\n $output .= '<div class=\"col-lg-6\"> <div class=\"right-content-wrap\"><h3 class=\"title\">'.$title.'</h3>';\n $form_details = FormBuilder::find($custom_form_id);\n $output .= FormBuilderCustom::render_form(optional($form_details)->id,null,null,'boxed-btn');\n $output .= '</div></div>';\n }\n\n $output .= ' </div> </div></div>';\n return $output;\n }", "function process_footer_subscriber_acquisition_form()\n{\n\t/* Initialize variables */\n\t$error = array();\n\t$subscriber_acquisition_email = isset($_POST[\"footerSubscriberAcquisitionEmail\"]) ? $_POST[\"footerSubscriberAcquisitionEmail\"] : '';\n\n\t/* Clean email address */\n\tif(strlen($subscriber_acquisition_email) <= 0){\n\t\t$error[] = \"Please enter your email.\";\n\t}else{\n\t\tif(!preg_match(\"/^([a-z0-9_]\\.?)*[a-z0-9_]+@([a-z0-9-_]+\\.)+[a-z]{2,3}$/i\", stripslashes(trim($subscriber_acquisition_email)))) {$error[] = \"Please enter a valid e-mail address.\";}\n\t}\n\n\t/* Return errors found or writes the subscriber specific info to the master capture file. */\n\tif(sizeof($error) > 0)\n\t{\n\t\t$size = sizeof($error);\n\t\t$error_message = '<div class=\"form-errors-container\">';\n\n\t\tfor ($i=0; $i < $size; $i++)\n\t\t{\n\t\t\tif($i == 0)\n\t\t\t\t$error_message .= '<h3 class=\"form-error-title\">Form Errors</h3>';\n\n\t\t\t$error_message .= '<p class=\"form-error\">- '.$error[$i].'</p>';\n\t\t}\n\n\t\t$error_message .= '</div>';\n\n\t\techo display_footer_subscriber_acquisition_form($error_message);\n\t}\n\telse\n\t{\n\n\t\t/* process_capture arguments: $captured_email, $captured_name, $capture_type, $capture_id */\n\t\t/* process_capture is in global functions file */\n\t\tprocess_capture($subscriber_acquisition_email, null, 'footer-subscriber-acquisition', null);\n\n\t\techo '\n\t\t\t<section class=\"footer-subscriber-acquisition\">\n\t\t\t\t<div class=\"inner-container\">\n\t\t\t\t\t<h3 class=\\\"title\\\">Thanks for signing up!</h3>\n\t\t\t\t\t<p class=\\\"subtitle\\\">Sam\\'s emails will come from <a href=\"mailto:[email protected]\">[email protected]</a>.</p>\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t';\n\n\t}\n}", "public function send()\n {\n if (!isset($this->properties['mail_recipients'])) {\n $this->properties['mail_recipients'] = false;\n }\n\n // CHECK IF THERE IS AT LEAST ONE MAIL ADDRESS\n if (!isset($this->properties['mail_bcc'])) {\n $this->properties['mail_bcc'] = false;\n }\n\n // EXIT IF NO EMAIL ADDRESSES ARE SET\n if (!$this->checkEmailSettings()) {\n return;\n }\n\n // CUSTOM TEMPLATE\n $template = $this->getTemplate();\n\n // SET DEFAULT EMAIL DATA ARRAY\n $this->data = [\n 'id' => $this->record->id,\n 'data' => $this->post,\n 'ip' => $this->record->ip,\n 'date' => $this->record->created_at\n ];\n\n // CHECK FOR CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $this->prepareCustomSubject();\n }\n\n // SEND NOTIFICATION EMAIL\n Mail::sendTo($this->properties['mail_recipients'], $template, $this->data, function ($message) {\n // SEND BLIND CARBON COPY\n if (!empty($this->properties['mail_bcc']) && is_array($this->properties['mail_bcc'])) {\n $message->bcc($this->properties['mail_bcc']);\n }\n\n // USE CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $message->subject($this->properties['mail_subject']);\n }\n\n // ADD REPLY TO ADDRESS\n if (!empty($this->properties['mail_replyto'])) {\n $message->replyTo($this->properties['mail_replyto']);\n }\n\n // ADD UPLOADS\n if (!empty($this->properties['mail_uploads']) && !empty($this->files)) {\n foreach ($this->files as $file) {\n $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);\n }\n }\n });\n }", "public function save_builder() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforminator_validate_ajax( \"forminator_save_builder_fields\" );\n\n\t\t$submitted_data = $this->get_post_data();\n\t\t$form_data = $submitted_data['data'];\n\t\t$form_data = json_decode( stripslashes( $form_data ), true );\n\t\t$fields = array();\n\t\t$notifications = array();\n\t\t$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;\n\t\t$id = intval( $id );\n\t\t$title = sanitize_text_field( $submitted_data['formName'] );\n\t\t$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';\n\t\t$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';\n\t\t$action = false;\n\n\t\tif ( is_null( $id ) || $id <= 0 ) {\n\t\t\t$form_model = new Forminator_Custom_Form_Model();\n\t\t\t$action = 'create';\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = Forminator_Custom_Form_Model::STATUS_PUBLISH;\n\t\t\t}\n\t\t} else {\n\t\t\t$form_model = Forminator_Custom_Form_Model::model()->load( $id );\n\t\t\t$action = 'update';\n\n\t\t\tif ( ! is_object( $form_model ) ) {\n\t\t\t\twp_send_json_error( __( \"Form model doesn't exist\", Forminator::DOMAIN ) );\n\t\t\t}\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = $form_model->status;\n\t\t\t}\n\n\t\t\t//we need to empty fields cause we will send new data\n\t\t\t$form_model->clear_fields();\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data, 'forminator_sanitize_field' );\n\n\t\t// Build the fields\n\t\tif ( isset( $form_data ) ) {\n\t\t\t$fields = $form_data['wrappers'];\n\t\t\tunset( $form_data['wrappers'] );\n\t\t}\n\n\t\tforeach ( $fields as $row ) {\n\t\t\tforeach ( $row['fields'] as $f ) {\n\t\t\t\t$field = new Forminator_Form_Field_Model();\n\t\t\t\t$field->form_id = $row['wrapper_id'];\n\t\t\t\t$field->slug = $f['element_id'];\n\t\t\t\tunset( $f['element_id'] );\n\t\t\t\t$field->import( $f );\n\t\t\t\t$form_model->add_field( $field );\n\t\t\t}\n\t\t}\n\n\t\t// Sanitize settings\n\t\t$settings = forminator_sanitize_field( $form_data['settings'] );\n\n\t\t// Sanitize custom css\n\t\tif ( isset( $form_data['settings']['custom_css'] ) ) {\n\t\t\t$settings['custom_css'] = sanitize_textarea_field( $form_data['settings']['custom_css'] );\n\t\t}\n\n\t\t// Sanitize thank you message\n\t\tif ( isset( $form_data['settings']['thankyou-message'] ) ) {\n\t\t\t$settings['thankyou-message'] = $form_data['settings']['thankyou-message'];\n\t\t}\n\n\t\t// Sanitize user email message\n\t\tif ( isset( $form_data['settings']['user-email-editor'] ) ) {\n\t\t\t$settings['user-email-editor'] = $form_data['settings']['user-email-editor'];\n\t\t}\n\n\t\t// Sanitize admin email message\n\t\tif ( isset( $form_data['settings']['admin-email-editor'] ) ) {\n\t\t\t$settings['admin-email-editor'] = $form_data['settings']['admin-email-editor'];\n\t\t}\n\n\t\tif ( isset( $form_data['notifications'] ) ) {\n\t\t\t$notifications = forminator_sanitize_field( $form_data['notifications'] );\n\n\t\t\t$count = 0;\n\t\t\tforeach( $notifications as $notification ) {\n\t\t\t\tif( isset( $notification['email-editor'] ) ) {\n\t\t\t\t\t$notifications[ $count ]['email-editor'] = $form_data['notifications'][ $count ]['email-editor'];\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data );\n\n\t\t// Handle quiz questions\n\t\t$form_model->notifications = $notifications;\n\n\t\t$settings['formName'] = $title;\n\n\t\t$settings['version'] = $version;\n\t\t$form_model->settings = $settings;\n\n\t\t// status\n\t\t$form_model->status = $status;\n\n\t\t// Save data\n\t\t$id = $form_model->save();\n\n\t\t/**\n\t\t * Action called after form saved to database\n\t\t *\n\t\t * @since 1.11\n\t\t *\n\t\t * @param int $id - form id\n\t\t * @param string $title - form title\n\t\t * @param string $status - form status\n\t\t * @param array $fields - form fields\n\t\t * @param array $settings - form settings\n\t\t *\n\t\t */\n\t\tdo_action( 'forminator_custom_form_action_' . $action, $id, $title, $status, $fields, $settings );\n\n\t\t// add privacy settings to global option\n\t\t$override_privacy = false;\n\t\tif ( isset( $settings['enable-submissions-retention'] ) ) {\n\t\t\t$override_privacy = filter_var( $settings['enable-submissions-retention'], FILTER_VALIDATE_BOOLEAN );\n\t\t}\n\t\t$retention_number = null;\n\t\t$retention_unit = null;\n\t\tif ( $override_privacy ) {\n\t\t\t$retention_number = 0;\n\t\t\t$retention_unit = 'days';\n\t\t\tif ( isset( $settings['submissions-retention-number'] ) ) {\n\t\t\t\t$retention_number = (int) $settings['submissions-retention-number'];\n\t\t\t}\n\t\t\tif ( isset( $settings['submissions-retention-unit'] ) ) {\n\t\t\t\t$retention_unit = $settings['submissions-retention-unit'];\n\t\t\t}\n\t\t}\n\n\t\tforminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );\n\n\t\twp_send_json_success( $id );\n\t}", "function maplesyrupweb_email_template()\n{\n\t$info = '<!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 http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>Maple Syrup Web</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>\n </head>';\n\n $info .= '<body style=\"margin: 0; padding: 0px 0px 150px 0px; background-color:#e7e7e7;\">';\n\n $info .= '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color:#e7e7e7; width:775px; max-width:90%; margin:0 auto;\" >';\n\n $info .= '<tr><td style=\"padding: 20px 0px 20px 0px;\">';\n \n //your logo here\n $info .= 'Maple Syryp Web <img src=\"\" width=\"100px\" height=\"100px\" />';\n $info .= '</td></tr>';\n\n $info .= '<tr><td style=\"padding: 60px 30px 60px 30px; background-color:#FFFFFF; text-align:left; font-size:14px; color:#656565;\">';\n //email message is here\n $info .= '[message]';\n $info .= '</td></tr>';\n\n $info .= '<tr><td style=\"text-align:center; font-size:10px; padding:30px 0px 0px 0px; color:#656565;\">';\n\n\n $info .= '&copy; '.date(\"Y\").' Maple Syrup Web';\n \n $info .= '</td></tr>';\n $info .= '<tr><td style=\"text-align:center; font-size:10px; padding:10px 0px 0px 0px; color:#656565;\">';\n \n // If you have social media links, include them below\n // $info .= 'Social media links';\n\n $info .= '</td></tr>';\n\n $info .= '</table>';\n\n\n $info .= '</body></html>';\n\n return $info;\n}", "function viaggio_deliver_mail() {\n\tif ( isset( $_POST['cf-submitted'] ) ) {\n\n\t\t// sanitize form values\n\t\t$name = sanitize_text_field( $_POST[\"cf-name\"] );\n\t\t$email = sanitize_email( $_POST[\"cf-email\"] );\n\t\t$subject = sanitize_text_field( $_POST[\"cf-subject\"] );\n\t\t$message = esc_textarea( $_POST[\"cf-message\"] );\n\n\t\t// get the blog administrator's email address\n\t\t$to = get_option( 'admin_email' );\n\n\t\t$headers = \"From: $name <$email>\" . \"\\r\\n\";\n\n\t\t// If email has been process for sending, display a success message\n\t\tif ( wp_mail( $to, $subject, $message, $headers ) ) {\n\t\t\techo '<div>';\n\t\t\techo '<p>'.esc_html__('Thanks for contacting me, expect a response soon.' , 'viaggio').'</p>';\n\t\t\techo '</div>';\n\t\t} else {\n\t\t\techo esc_html__('An unexpected error occurred.' , 'viaggio');\n\t\t}\n\t}\n}", "function m_dspemails()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_EMAIL_BLK\", \"email_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MSG_BLK1\", \"msg_blk1\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING ***\n\t\t$this->ObTpl->set_var(\"email_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk1\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk2\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$campaigncount = $this->obDb->record_count;\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\n\t\tif($campaigncount>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$campaigncount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iMailid_PK);\n\t\t\t\tif ($queryResult[$j]->vUserList==\"All\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n }else{ \n $this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->vUserList.\"'\";\n }\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\tif ($queryResult[$j]->vVisitorList==\"1\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".NEWSLETTERS;\n\t\t\t\t $qryVs = $this->obDb->fetchQuery();\n\t\t\t\t $qryRs[0]->cnt = $qryRs[0]->cnt + $qryVs[0]->cnt;\n }\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USERCOUNT\",$qryRs[0]->cnt);\n \n $this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($queryResult[$j]->vSubject));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($queryResult[$j]->vSid));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t$sentDate=$this->libFunc->dateFormat2($queryResult[$j]->tmSentDate);\n\t\t\t\tif(empty($sentDate))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"Send now\");\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View/Sent\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$sentDate);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"email_blk\",\"TPL_EMAIL_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$campaigncount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOEMAILS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}", "public static function smtp_inner () \n { \n $html = null;\n\n $top = __( 'SMTP Send : Message', 'default-message' );\n $inner = self::smtp_inner_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'smtp', $top, $inner, $bottom );\n\n return $html;\n }", "function mpc_shortcode(){\n ob_start();\n deliver_mail();\n mpc_html_form_code();\n}", "public function updateAction()\n {\n // _POST values.\n $request = $this->container->get(\"request\");\n\n // Get the restaurant service.\n $emailTemplatesService = $this->container->get('dft_foapi.email_templates');\n\n // Update settings.\n $emailTemplatesService->updateEmailTemplates(\n $this->container->get('dft_foapi.login')->getAuthenticatedUserId(),\n $request->get('order_accepted_email_subject'),\n $request->get('order_accepted_email_content'),\n $request->get('order_rejected_email_subject'),\n $request->get('order_rejected_email_content')\n );\n\n return $this->render('dftFoapiBundle:Common:success.json.twig');\n }", "function Render()\n\t{\n\t\tif(DBO()->ChangeAdvertisement->Error->Value)\n\t\t{\n\n\t\t\techo \"<h2 class='CustomerGroup'>There was an error with the upload.</h2>\\n\";\n\t\t\techo \"<div class='GroupedContent'>\\n\";\n\t\t\techo \"\n\t\t\t<TABLE>\n\t\t\t<TR>\n\t\t\t\t<TD width=\\\"200\\\">Error Message: </TD>\n\t\t\t\t<TD>\" . DBO()->ChangeAdvertisement->Error->Value . \"</TD>\n\t\t\t</TR>\n\t\t\t<TR>\n\t\t\t\t<TD></TD>\n\t\t\t\t<TD></TD>\n\t\t\t</TR>\n\t\t\t</TABLE>\n\t\t\t</div>\";\n\t\t}\n\t\telse if(!DBO()->ChangeAdvertisement->Error->Value && array_key_exists('CustomerGroup_Id', $_POST))\n\t\t{\n\t\t\t$mixRedirectLink = Href()->ViewCustomerGroup($_POST['CustomerGroup_Id']);\n\t\t\tif($_POST['CustomerGroup_Id'] == \"\")\n\t\t\t{\n\t\t\t\t$mixRedirectLink = \"./flex.php/CustomerGroup/ViewAll/\";\n\t\t\t}\n\t\t\t$strFileName = $_FILES['userfile']['name'];\n\t\t\t$strFileType = $_FILES['userfile']['type'];\n\n\t\t\techo \"<h2 class='CustomerGroup'>The advertisement has now been updated.</h2>\\n\";\n\t\t\techo \"<div class='GroupedContent'>\\n\";\n\t\t\techo \"\n\t\t\t<TABLE>\n\t\t\t<TR>\n\t\t\t\t<TD width=\\\"200\\\">File Name: </TD>\n\t\t\t\t<TD>$strFileName</TD>\n\t\t\t</TR>\n\t\t\t<TR>\n\t\t\t\t<TD>File Type: </TD>\n\t\t\t\t<TD>$strFileType</TD>\n\t\t\t</TR>\n\t\t\t<TR>\n\t\t\t\t<TD></TD>\n\t\t\t\t<TD></TD>\n\t\t\t</TR>\n\t\t\t</TABLE>\n\t\t\t</div><br/><br/>\n\t\t\t<A HREF=$mixRedirectLink>Continue Editing Customer Group</A>\";\n\t\t\n\t\t\n\t\t}\n\n\t}", "public function parse_body()\n\t{\n\t\tforeach ($this->vars AS $key => $value)\n\t\t{\n\t\t\t$this->body = str_replace('{' . $key . '}', $value, $this->body);\n\t\t}\n\n\t\t// Pas de HTML pour MSN / Jabber\n\t\tif ($this->method == NOTIFY_MSN || $this->method == NOTIFY_JABBER)\n\t\t{\n\t\t\t$this->body = preg_replace('#</?[^>]+?>#si', '', $this->body);\n\t\t\t$this->body = str_replace(array(\"\\r\\n\", \"\\r\"), array(\"\\n\", \"\\n\"), $this->body);\n\t\t\t$this->body = str_replace(\"\\n\", \"\\r\\n\", $this->body);\n\n\t\t\tif ($this->method == NOTIFY_JABBER)\n\t\t\t{\n\t\t\t\t$this->body = htmlspecialchars($this->body);\n\t\t\t}\n\t\t}\n\t}", "function mpc_html_form_code() {\n echo '<form action=\"' .esc_url( $_SERVER['REQUEST_URI'] ) . '\" method=\"post\">';\n echo '<p>';\n echo 'Il tuo Nome <br>';\n echo '<input type=\"text\" name=\"mpc-name\" pattern=\"[a-zA-Z0-9]+\" value=\"' . ( isset($_POST[\"mpc-name\"]) ? esc_attr( $_POST[\"mpc-name\"]) : '' ) . '\" size=40></p>';\n echo '<p>La tua email <br>';\n echo '<input type=\"email\" name=\"mpc-email\" value=\"' . ( isset($_POST[\"mpc-email\"]) ? esc_attr( $_POST[\"mpc-email\"]) : '' ) . '\" size=40></p>';\n echo 'Oggetto <br/>';\n\techo '<input type=\"text\" name=\"mpc-subject\" pattern=\"[a-zA-Z ]+\" value=\"' . ( isset( $_POST[\"mpc-subject\"] ) ? esc_attr( $_POST[\"mpc-subject\"] ) : '' ) . '\" size=\"40\" />';\n\techo '</p>';\n\techo '<p>Il tuo messaggio <br/>';\n\techo '<textarea rows=\"10\" cols=\"35\" name=\"mpc-message\">' . ( isset( $_POST[\"mpc-message\"] ) ? esc_attr( $_POST[\"mpc-message\"] ) : '' ) . '</textarea>';\n\techo '</p>';\n\techo '<p><input type=\"submit\" name=\"mpc-submitted\" value=\"Invia\"></p>';\n\techo '</form>';\n}", "function calsteams_buildform_cb($post){\n\n global $mbox, $post;//bring in these variables from global scope\n\n $mbox_data = get_post_custom($post->ID); //get array containing metabox custom fields\n\n logit($mbox_data,'$mbox_data: ');\n\n wp_nonce_field( 'calsteams_update_field', 'calsteams_nonce');\n\n echo '<table class=\"form-table\">';\n\n foreach ($mbox['fields'] as $field) {\n\n $meta = get_post_meta($post->ID,$field['id'],true); //get meta-box data for current field\n\n echo '<tr>',\n '<th style=\"width:20%\"><label for=\"', $field['id'], '\">', $field['name'], '</label></th>',\n '<td>';\n\n switch ($field['type']) {\n case 'text':\n echo '<input type=\"text\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />', '<br />', $field['desc'];\n break;\n\n default:\n echo 'uh oh, default case!';\n }\n\n echo '</td>',\n '</tr>';\n }\n echo '</table>';\n}", "function display_footer_subscriber_acquisition_form($pre_form_content = '')\n{\n\n\t$acquisition_copy = '<h3>Stay inspired.</h3><p>Weekly motivating thoughts and ideas to help you keep your team engaged.</p>';\n\n\t/* Build the form and set it to the form_string variable. */\n\t$form_output_string = '\n\t\t<section class=\"footer-subscriber-acquisition\">\n\t\t\t<div class=\"inner-container\">\n\t\t\t\t'. $pre_form_content .'\n\t\t\t\t'. $acquisition_copy .'\n\t\t\t\t<form action=\"'. $_SERVER['REQUEST_URI'] .'\" method=\"post\" name=\"footerSubscriberAcquisitionForm\" class=\"single-input-form\" id=\"footer-subscriber-acquisition-form\">\n\t\t\t\t\t<input name=\"footerSubscriberAcquisitionEmail\" type=\"text\" placeholder=\"Enter your email here\">\n\t\t\t\t\t<input name=\"footerSubscriberAcquisitionSubmit\" type=\"submit\" value=\"Sign me up!\">\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</section>';\n\n\techo $form_output_string;\n}", "function emailHTML($QuoteID, $fields, $course, $students, $days, $days_old, $estimate, $students_old, $name, $logo, $logoW, $logoH, $phone, $fax, $url) {\r\n\t\tif($students_old > 0) {\r\n\t\t\tif($students_old = 1) {\r\n\t\t\t\t$students_old = \"You specified \" . $students_old . \" student.\";\r\n\t\t\t} else {\r\n\t\t\t\t$students_old = \"You specified \" . $students_old . \" students.\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$students_old = \"\";\r\n\t\t}\r\n\t\tif($days > 1) {\r\n\t\t\tif($days_old = 1) {\r\n\t\t\t\t$days_old = \"You specified \" . $days_old . \" day.\";\r\n\t\t\t} else {\r\n\t\t\t\t$days_old = \"You specified \" . $days_old . \" days.\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$days_old = \"\";\r\n\t\t}\r\n $body = \"<html lang='en'>\r\n<head>\r\n\t<meta charset='utf-8' />\r\n\t<title></title>\r\n</head>\r\n<body>\r\n\t\t<table style='width:600px;'>\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<td style='width:300px;'>\r\n\t\t\t\t\t<img src='\" . $url . \"img/\" . $logo . \"' style='margin-left:85px;' width='\" . $logoW . \"' height='\" . $logoH . \"' alt='\" . $name . \" - Safety Training | Certification Classes for OSHA, MSHA, DOT, EPA & Marcellus Shale' />\r\n\t\t\t\t</td>\r\n\t\t\t\t<td style='vertical-align:top;'>\r\n\t\t\t\t\t<b>Your \" . $name . \" Online Quote:</b><br>\r\n\t\t\t\t\tQuote ID: \" . $QuoteID . \"\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td style='vertical-align:top;'>\r\n\t\t\t\t\t<b>Attn:</b> \" . $fields['name'] . \"<br>\r\n\t\t\t\t\t<b>Phone:</b> \" . $fields['phone'] . \"<br>\r\n\t\t\t\t\t<b>Email:</b> <a href='mailto:\" . $fields['email'] . \"'>\" . $fields['email'] . \"</a><br>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td style='vertical-align:top;'>\r\n\t\t\t\t\t<b>Date:</b> \" . DATE(\"m/d/Y\") . \"\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tfoot>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2' style='text-align:justify;padding-top:15px;font-size:12px;'>\r\n\t\t\t\t\t<b>NOTICE:</b> Price is valid for day of quote only. Confirmation must be received on the same day \r\n\t\t\t\t\tthat the quote is generated. Quoted cost shall include all travel, labor, course materials and \r\n\t\t\t\t\tcertificates of completion. Additional students will be charged at $135/student/day.\r\n\t\t\t\t\t<br><br>\r\n\t\t\t\t\tWhen your authorized company representative affixes their signature to this proposal, the proposal \r\n\t\t\t\t\tbecomes a binding contract between \" . $name . \", Inc. and your firm for schedule and delivery of service. \r\n\t\t\t\t\tIf you have any questions, please feel free to contact \" . $name . \" at \" . $phone . \". Please fax proposal \r\n\t\t\t\t\tto \" . $name . \" at \" . $fax . \".\r\n\t\t\t\t\t<br><br>\r\n\t\t\t\t\tPayment is due prior to delivery of services.\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2'>\r\n\t\t\t\t\t<td style='min-height: 40px;height: 40px;'>&nbsp;</td>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<div style='width: 300px;font-size: 11px;text-align: right;margin: 0 75px 20px auto;border-top: 1px solid #000;'>Authorized Company Representative</div>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td>\r\n\t\t\t\t\t<div style='width: 150px;font-size: 11px;text-align: right;margin: 0 75px 20px auto;border-top: 1px solid #000;'>Date</div>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tfoot>\r\n\t\t<tbody>\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2' style='padding-top:15px;'>\r\n\t\t\t\t\t<table style='border:1px solid #000;border-collapse:collapse;width:95%;margin:10px auto;'>\r\n\t\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t\t<tr style='background-color:#3399FF;'>\r\n\t\t\t\t\t\t\t\t<th style='border:1px solid #000;padding:3px;width:40%;'>Product</th>\r\n\t\t\t\t\t\t\t\t<th style='border:1px solid #000;padding:3px;width:15%;'>Course No.</th>\r\n\t\t\t\t\t\t\t\t<th style='border:1px solid #000;padding:3px;width:10%;'>Days</th>\r\n\t\t\t\t\t\t\t\t<th style='border:1px solid #000;padding:3px;width:20%;'>Student Qty.</th>\r\n\t\t\t\t\t\t\t\t<th style='border:1px solid #000;padding:3px;width:15%;'>Location</th>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</thead>\r\n\t\t\t\t\t\t<tbody>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'>\" . $course . \"</td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;text-align:center;'>\" . $fields['class_title'] . \"</td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;text-align:center;'>\" . $days . \"</td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;text-align:center;'>\" . $fields['students'] . \"</td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;text-align:center;'>\" . $fields['location'] . \"</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'><br></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'><br></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;'></td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;text-align:right;'>Total:</td>\r\n\t\t\t\t\t\t\t\t<td style='border:1px solid #000;padding:3px;text-align:center;'>$\" . $estimate . \"</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</tbody>\r\n\t\t\t\t\t</table>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\";\r\n\t\tif($students) {\r\n\t\t\t$body .= \"\r\n\t\t\t<tr>\r\n\t\t\t\t<td colspan='2' style='color:#ff0000;text-align:justify;padding-top:15px;font-style:italic;font-weight:bold;font-size:12px;'>\r\n\t\t\t\t\tPlease Note: \" . $students_old . \" The minimum number of students required for \r\n\t\t\t\t\tthis class is \" . MINIMUMSTUDENTS . \". An adjustment has been made to increase the number of students attending this class \r\n\t\t\t\t\tto meet the minimum requirement.\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\";\r\n\t\t}\r\n\t\tif($days > 1) {\r\n\t\t\t$body .= \"<tr>\r\n\t\t\t\t<td colspan='2' style='color:#ff0000;text-align:justify;padding-top:15px;font-style:italic;font-weight:bold;font-size:12px;'>\r\n\t\t\t\t\tPlease Note: \" . $days_old . \" The number of days required for this class as set \r\n\t\t\t\t\tby OSHA is \" . $days . \" days. An adjustment has been made to the number of days you have chosen to comply with the standard.\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\";\r\n\t\t}\r\n\t\t$body .= \"\r\n\t\t</tbody>\r\n\t</table>\r\n</body>\r\n</html>\";\r\n\r\n return $body;\r\n }", "public function admin_form(&$qa_content)\n\t{\n\t\t$ok = null;\n\t\tif (qa_clicked('qa_auto_pmsg_save')) {\n\t\t\tqa_opt('qa_auto_pmsg_from_handle', qa_post_text('qa_auto_pmsg_from_handle'));\n\t\t\tqa_opt('qa_auto_pmsg_message_for_posted', qa_post_text('qa_auto_pmsg_message_for_posted'));\n\t\t\tqa_opt('qa_auto_pmsg_message_for_no_posted', qa_post_text('qa_auto_pmsg_message_for_no_posted'));\n\t\t\t$ok = qa_lang('admin/options_saved');\n\t\t}\n\n\t\t// form fields to display frontend for admin\n\t\t$fields = array();\n\n\t\t$fields[] = array(\n\t\t\t'label' => qa_lang_html('qa_apmsg_lang/from_handle'),\n\t\t\t'tags' => 'NAME=\"qa_auto_pmsg_from_handle\"',\n\t\t\t'value' => qa_opt('qa_auto_pmsg_from_handle'),\n\t\t\t'type' => 'text'\n\t\t);\n\t\t\n\t\t$fields[] = array(\n\t\t\t'label' => qa_lang_html('qa_apmsg_lang/to_posted_user'),\n\t\t\t'tags' => 'name=\"qa_auto_pmsg_message_for_posted\"',\n\t\t\t'value' => qa_opt('qa_auto_pmsg_message_for_posted'),\n\t\t\t'type' => 'textarea',\n\t\t);\n\t\t\n\t\t$fields[] = array(\n\t\t\t'label' => qa_lang_html('qa_apmsg_lang/to_no_posted_user'),\n\t\t\t'tags' => 'name=\"qa_auto_pmsg_message_for_no_posted\"',\n\t\t\t'value' => qa_opt('qa_auto_pmsg_message_for_no_posted'),\n\t\t\t'type' => 'textarea',\n\t\t);\n\n\t\treturn array(\n\t\t\t'ok' => ($ok && !isset($error)) ? $ok : null,\n\t\t\t'fields' => $fields,\n\t\t\t'buttons' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'label' => qa_lang_html('main/save_button'),\n\t\t\t\t\t'tags' => 'name=\"qa_auto_pmsg_save\"',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "function uc_file_build_email_form($form, &$form_state, $settings, $token_filters) {\n $form['from'] = array(\n '#type' => 'textfield',\n '#title' => t('Sender'),\n '#default_value' => $settings['from'],\n '#description' => t('The \"From\" address.'),\n '#required' => TRUE,\n );\n $form['addresses'] = array(\n '#type' => 'textarea',\n '#title' => t('Recipients'),\n '#default_value' => $settings['addresses'],\n '#description' => t('Enter the email addresses to receive the notifications, one on each line. You may use order tokens for dynamic email addresses.'),\n '#required' => TRUE,\n );\n $form['subject'] = array(\n '#type' => 'textfield',\n '#title' => t('Subject'),\n '#default_value' => $settings['subject'],\n '#required' => TRUE,\n );\n $form['message'] = array(\n '#type' => 'textarea',\n '#title' => t('Message'),\n '#default_value' => $settings['message'],\n '#text_format' => $settings['format'],\n );\n\n $form['token_help'] = array(\n '#type' => 'fieldset',\n '#title' => t('Replacement patterns'),\n '#description' => t('You can make use of the replacement patterns in the recipients field, the subject, and the message body.'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n foreach ($token_filters as $name) {\n $form['token_help'][$name] = array(\n '#type' => 'fieldset',\n '#title' => t('@name replacement patterns', array('@name' => drupal_ucfirst($name))),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n }\n\n return $form;\n}", "public function getContent()\r\n {\r\n \r\n if (Tools::isSubmit('patch' . $this->name)) {\r\n self::checkForClass('OmnivaPatcher');\r\n\r\n $patcher = new OmnivaPatcher();\r\n $this->runPatcher($patcher);\r\n }\r\n\r\n $output = null;\r\n\r\n if (Tools::isSubmit('submit' . $this->name)) {\r\n $fields = array('omnivalt_map', 'omnivalt_api_url', 'omnivalt_api_user', 'omnivalt_api_pass', 'omnivalt_send_off', 'omnivalt_cod', 'omnivalt_print_type', 'omnivalt_bank_account', 'omnivalt_company', 'omnivalt_address', 'omnivalt_city', 'omnivalt_postcode', 'omnivalt_countrycode', 'omnivalt_phone', 'omnivalt_pick_up_time_start', 'omnivalt_pick_up_time_finish');\r\n $values = array();\r\n $all_filled = true;\r\n foreach ($fields as $field) {\r\n $values[$field] = strval(Tools::getValue($field));\r\n if ($values[$field] == '') {\r\n $all_filled = false;\r\n }\r\n }\r\n\r\n if (!$all_filled)\r\n $output .= $this->displayError($this->l('All fields required'));\r\n else {\r\n foreach ($values as $key => $val)\r\n Configuration::updateValue($key, $val);\r\n $output .= $this->displayConfirmation($this->l('Settings updated'));\r\n }\r\n }\r\n return $output . $this->displayForm();\r\n }", "public function modalContent() {\n\n $fields = array( __( 'Template Rule Settings', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ) => array() );\n $sKey = key( $fields );\n\n //------------------------------------------------------------------\n // GENERIC PARAM\n //------------------------------------------------------------------\n\n $helpContent = $this->helpContent( __( 'Choose the value of this generic param.', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ),\n __( 'Choose the value of this generic param. It is set only for process flowing, and it is not used anywhere in your WordPress environment.', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ) );\n\n $fields[$sKey][] = array(\n array(\n 'type' => WPDKUIControlType::CUSTOM,\n 'content' => $helpContent\n )\n );\n\n $fields[$sKey][] = array(\n array(\n 'type' => WPDKUIControlType::TEXT,\n 'name' => $this->_model->id() . '-generic-param',\n 'value' => $this->_model->genericParam(),\n 'label' => array(\n 'value' => __( 'Generic Param', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN ),\n 'data' => array( 'placement' => 'right' )\n ),\n 'size' => 24,\n 'title' => __( 'Enter the value of this generic param. It is set only for process flowing, and it is not used anywhere in your WordPress environment.', WPXDEFLECTOREXTENSIONTEMPLATE_TEXTDOMAIN )\n )\n );\n\n $layout = new WPDKUIControlsLayout( $fields );\n\n // Build output buffer\n $outputBuffer = '<form name=\"' . $this->_model->id() . '-form\" method=\"POST\" action=\"\">' .\n $layout->html() .\n '</form>';\n\n return $outputBuffer;\n\n }", "function _sp_custom_box_contact_form_messages( $post ) {\n\twp_nonce_field( '_sp_process_meta_contact_form_messages', '_sp_meta_contact_form_messages_nonce' );\n\n\t// get saved settings\n\t$header_text\t\t\t= get_post_meta( $post->ID, '_sp_contact_form_header_text', true );\n\t$submit_button_text\t\t= get_post_meta( $post->ID, '_sp_contact_form_submit_button_text', true );\n\t$reset_button_text\t\t= get_post_meta( $post->ID, '_sp_contact_form_reset_button_text', true );\n\t$success_message\t\t= get_post_meta( $post->ID, '_sp_contact_form_success_message', true );\n\t$failure_message\t\t= get_post_meta( $post->ID, '_sp_contact_form_failure_message', true );\n\t$required_field_text\t= get_post_meta( $post->ID, '_sp_contact_form_required_field_text', true );\n\t$email_template\t\t\t= get_post_meta( $post->ID, '_sp_contact_form_email_template', true );\n\n\t// set defaults\n\n\tif ( ! isset( $submit_button_text ) || empty( $submit_button_text ) )\n\t\t$submit_button_text = __( 'Submit', 'sp-theme' );\n\n\tif ( ! isset( $reset_button_text ) || empty( $reset_button_text ) )\n\t\t$reset_button_text = __( 'Reset Form', 'sp-theme' );\n\n\tif ( ! isset( $success_message ) || empty( $success_message ) )\n\t\t$success_message = __( 'The form was successfully submitted. Thanks!', 'sp-theme' );\n\n\tif ( ! isset( $failure_message ) || empty( $failure_message ) )\n\t\t$failure_message = __( 'Sorry! We are not able to submit your form. Please try later.', 'sp-theme' );\n\n\tif ( ! isset( $from_email ) || empty( $from_email ) )\n\t\t$from_email = get_option( 'admin_email' );\n\n\t$output = '';\n\n\t$output .= '<table class=\"contact-form-tables\">' . PHP_EOL;\n\t\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Form Header Text', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><input type=\"text\" name=\"contact_form_header_text\" value=\"' . esc_attr( $header_text ) . '\" class=\"widefat\" /></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'Enter the text for your form header.', 'sp-theme' ) . '</p></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Submit Button Text', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><input type=\"text\" name=\"contact_form_submit_button_text\" value=\"' . esc_attr( $submit_button_text ) . '\" class=\"widefat\" /></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'Enter the text to show for your submit button.', 'sp-theme' ) . '</p></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Reset Button Text', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><input type=\"text\" name=\"contact_form_reset_button_text\" value=\"' . esc_attr( $reset_button_text ) . '\" class=\"widefat\" /></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'Enter the text to show for your reset button.', 'sp-theme' ) . '</p></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Success Message', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><input type=\"text\" name=\"contact_form_success_message\" value=\"' . esc_attr( $success_message ) . '\" class=\"widefat\" /></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'Enter the message you would like to show when the form was successfully submitted.', 'sp-theme' ) . '</p></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Failure Message', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><input type=\"text\" name=\"contact_form_failure_message\" value=\"' . esc_attr( $failure_message ) . '\" class=\"widefat\" /></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'Enter the message you would like to show when the form fails to submit.', 'sp-theme' ) . '</p></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Required Field Text', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><input type=\"text\" name=\"contact_form_required_field_text\" value=\"' . esc_attr( $required_field_text ) . '\" class=\"widefat\" /></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'Enter the text you would like to show when a field is required.', 'sp-theme' ) . '</p></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '<tr>' . PHP_EOL;\n\t$output .= '<td class=\"col1\">' . __( 'Email Template', 'sp-theme' ) . ':</td>' . PHP_EOL;\n\t$output .= '<td class=\"col2\"><textarea name=\"contact_form_email_template\" class=\"widefat\" rows=\"20\">' . esc_html( $email_template ) . '</textarea></td>' . PHP_EOL;\n\t$output .= '<td class=\"col3\"><p class=\"howto\">' . __( 'This is the email template you will see as the admin when someone contacts you with this form. You can modify it to your liking. Use the unique tag names to pull in the entered data from the form. For example \"First Name:[firstname]\". This will replace the firstname in between the brackets with the data people entered.', 'sp-theme' ) . '</p><br /><a href=\"#\" title=\"' . esc_attr__( 'Do it for me', 'sp-theme' ) . '\" class=\"populate-template button\">' . __( 'Do it for me!', 'sp-theme' ) . '</a></td>' . PHP_EOL;\n\t$output .= '</tr>' . PHP_EOL;\n\n\t$output .= '</table>' . PHP_EOL;\n\n\n\techo $output;\n}", "function clsRecordemails()\r\n\r\n {\r\n\r\n\r\n\r\n global $FileName;\r\n\r\n $this->Visible = true;\r\n\r\n $this->Errors = new clsErrors();\r\n\r\n $this->ds = new clsemailsDataSource();\r\n\r\n $this->InsertAllowed = false;\r\n\r\n $this->UpdateAllowed = false;\r\n\r\n if($this->Visible)\r\n\r\n {\r\n\r\n $this->ComponentName = \"emails\";\r\n\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n\r\n $this->from_user_id = new clsControl(ccsLabel, \"from_user_id\", \"From User Id\", ccsText, \"\", CCGetRequestParam(\"from_user_id\", $Method));\r\n\r\n $this->emaildate = new clsControl(ccsLabel, \"emaildate\", \"date\", ccsText, \"\", CCGetRequestParam(\"emaildate\", $Method));\r\n\r\n $this->subject = new clsControl(ccsLabel, \"subject\", \"Subject\", ccsText, \"\", CCGetRequestParam(\"subject\", $Method));\r\n\r\n $this->message = new clsControl(ccsLabel, \"message\", \"Message\", ccsMemo, \"\", CCGetRequestParam(\"message\", $Method));\r\n\r\n $this->message->HTML = true;\r\n\r\n $this->Delete = new clsButton(\"Delete\");\r\n\r\n $this->cancel = new clsButton(\"cancel\");\r\n\r\n }\r\n\r\n }", "protected function outputHTML() {\r\n echo new \\view\\components\\ErrorMessage(array(\r\n \"errorMessage\" => $this->errorMessage\r\n ));\r\n echo new \\view\\components\\ResultMessage(array(\r\n \"resultMessage\" => $this->resultMessage\r\n ));\r\n\t\t\r\n\t\techo new \\view\\components\\ObjavaForm(array(\r\n\t\t\t\"postAction\" => \\route\\Route::get('d3')->generate(array(\r\n\t\t\t\t\"controller\" => 'ozsn',\r\n\t\t\t\t\"action\" => 'modifyObjava'\r\n\t\t\t)) . \"?id=\" . $this->objava->idObjave,\r\n\t\t\t\"submitButtonText\" => \"Spremi promjene\",\r\n\t\t\t\"elektrijade\" => $this->elektrijade,\r\n\t\t\t\"mediji\" => $this->mediji,\r\n\t\t\t\"objava\" => $this->objava,\r\n\t\t\t\"objaveOElektrijadi\" => $this->objaveOElektrijadi\r\n\t\t));\r\n }", "public function sendEmail() {\n\t\treturn Yii::$app->mailer->compose ( [\n\t\t\t\t// 'html' => '@app/mail/layouts/example',\n\t\t\t\t// 'text' => '@app/mail/layouts/text'\n\t\t\t\t'html' => $this->emailHtml,\n\t\t\t\t//'text' => $templateText \n\t\t], $this->params )->setFrom ( $this->from )->setTo ( $this->to )->setSubject ( $this->subject )->send ();\n\t}", "function pmpro_send_html( $phpmailer ) {\n\t\n\t//to check if we should wpautop later\n\t$original_body = $phpmailer->Body;\n\t\n\t// Set the original plain text message\n\t$phpmailer->AltBody = wp_specialchars_decode($phpmailer->Body, ENT_QUOTES);\n\t// Clean < and > around text links in WP 3.1\n\t$phpmailer->Body = preg_replace('#<(https?://[^*]+)>#', '$1', $phpmailer->Body);\t\n\t\n\t// If there is no HTML, run through wpautop\t\n\tif($phpmailer->Body == strip_tags($phpmailer->Body))\n\t\t$phpmailer->Body = wpautop($phpmailer->Body);\n\t\n\t// Convert line breaks & make links clickable\n\t$phpmailer->Body = make_clickable ($phpmailer->Body);\n\t\t\n\t// Get header for message if found\n\tif(file_exists(get_stylesheet_directory() . \"/email_header.html\"))\n\t\t$header = file_get_contents(get_stylesheet_directory() . \"/email_header.html\");\n\telseif(file_exists(get_template_directory() . \"/email_header.html\"))\n\t\t$header = file_get_contents(get_template_directory() . \"/email_header.html\");\n\telse\n\t\t$header = \"\";\n\t\n\t//wpautop header if needed\n\tif(!empty($header) && $header == strip_tags($header))\n\t\t$header = wpautop($header);\n\t\n\t// Get footer for message if found\n\tif(file_exists(get_stylesheet_directory() . \"/email_footer.html\"))\n\t\t$footer = file_get_contents(get_stylesheet_directory() . \"/email_footer.html\");\n\telseif(file_exists(get_template_directory() . \"/email_footer.html\"))\n\t\t$footer = file_get_contents(get_template_directory() . \"/email_footer.html\");\n\telse\n\t\t$footer = \"\";\n\t\n\t//wpautop header if needed\n\tif(!empty($footer) && $footer == strip_tags($footer))\n\t\t$footer = wpautop($footer);\n\t\n\t// Add header/footer to the email\n\tif(!empty($header))\n\t\t$phpmailer->Body = $header . \"\\n\" . $phpmailer->Body;\n\tif(!empty($footer))\n\t\t$phpmailer->Body = $phpmailer->Body . \"\\n\" . $footer;\n\t\n\t// Replace variables in email\n\tglobal $current_user;\n\t$data = array(\n\t\t\t\t\"name\" => $current_user->display_name,\n\t\t\t\t\"sitename\" => get_option(\"blogname\"),\n\t\t\t\t\"login_link\" => pmpro_url(\"account\"),\n\t\t\t\t\"display_name\" => $current_user->display_name,\n\t\t\t\t\"user_email\" => $current_user->user_email,\n\t\t\t\t\"subject\" => $phpmailer->Subject\n\t\t\t);\n\tforeach($data as $key => $value)\n\t{\n\t\t$phpmailer->Body = str_replace(\"!!\" . $key . \"!!\", $value, $phpmailer->Body);\n\t}\t\n\t\t\n\tdo_action(\"pmpro_after_phpmailer_init\", $phpmailer);\n\tdo_action(\"pmpro_after_pmpmailer_init\", $phpmailer);\t//typo left in for backwards compatibility\n}", "function m_dspSignupForm()\n\t{\n\t\t#INTIALIZING TEMPLATES\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_USER_FILE\", $this->userTemplate);\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_NEWSLETTER_BLK\",\"news_blk\");\n\t//\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"DSPMSG_BLK\", \"msg_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_CAPTCHA_BLK\",\"captcha_blk\");\n\t\t$this->ObTpl->set_var(\"captcha_blk\",\"\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"countryblk\",\"countryblks\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"BillCountry\",\"nBillCountry\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"stateblk\",\"stateblks\");\n\t\t$this->ObTpl->set_var(\"TPL_USERURL\",SITE_URL.\"user/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CPASS\",\"\");\n\t\t$this->ObTpl->set_var(\"news_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK1\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK2\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK3\",\"\");\n\n\t\t#INTIALIZING\n\t\t$row_customer[0]->vFirstName = \"\";\n\t\t$row_customer[0]->vLastName =\"\";\n\t\t$row_customer[0]->vEmail = \"\";\n\t\t$row_customer[0]->vPassword = \"\";\n\t\t$row_customer[0]->vPhone = \"\";\n\t\t$row_customer[0]->vCompany = \"\";\n\t\t$row_customer[0]->vAddress1 = \"\";\n\t\t$row_customer[0]->vAddress2 = \"\";\n\t\t$row_customer[0]->vState =\"\";\n\t\t$row_customer[0]->vStateName=\"\";\n\t\t$row_customer[0]->vCity = \"\";\n\t\t$row_customer[0]->vCountry = \"\";\t\n\t\t$row_customer[0]->vZip = \"\";\t\n\t\t$row_customer[0]->vHomePage = \"\";\t\n\t\t$row_customer[0]->fMemberPoints = \"\";\n\t\t$row_customer[0]->iMailList = \"1\";\n\t\t$row_customer[0]->iStatus = \"1\";\n\n\n\t\t/*CHECKING FOR POST VARIABLES\n\t\tIF VARIABLES ARE SET THEN ASSIGNING THEIR VALUE TO VARIABLE SAMEVARIABLE\n\t\tAS USED WHEN RETURNED FROM DATABASE\n\t\tTHIS THING IS USED TO REMOVE REDUNDANCY AND USE SAME FORM FOR EDIT AND INSERT*/\n\n\t\tif(count($_POST) > 0)\n\t\t{\n\t\t\tif(isset($this->request[\"first_name\"]))\n\t\t\t\t$row_customer[0]->vFirstName = $this->request[\"first_name\"];\n\t\t\tif(isset($this->request[\"password\"]))\n\t\t\t\t$row_customer[0]->vPassword = $this->request[\"password\"];\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CPASS\", $this->libFunc->m_displayContent($this->request[\"verify_pw\"]));\n\t\t\tif(isset($this->request[\"last_name\"]))\n\t\t\t\t$row_customer[0]->vLastName = $this->request[\"last_name\"];\n\t\n\t\t\tif(isset($this->request[\"company\"]))\n\t\t\t\t$row_customer[0]->vCompany = $this->request[\"company\"];\n\t\t\tif(isset($this->request[\"txtemail\"]))\n\t\t\t\t$row_customer[0]->vEmail = $this->request[\"txtemail\"];\n\t\t\tif(isset($this->request[\"address1\"]))\n\t\t\t\t$row_customer[0]->vAddress1 = $this->request[\"address1\"];\n\t\t\tif(isset($this->request[\"address2\"]))\n\t\t\t\t$row_customer[0]->vAddress2 = $this->request[\"address2\"];\n\t\t\tif(isset($this->request[\"city\"]))\n\t\t\t\t$row_customer[0]->vCity = $this->request[\"city\"];\n\t\t\tif(isset($this->request[\"bill_state_id\"]))\n\t\t\t\t$row_customer[0]->vState = $this->request[\"bill_state_id\"];\t\n\t\t\tif(isset($this->request[\"bill_state\"]))\n\t\t\t\t$row_customer[0]->vStateName = $this->request[\"bill_state\"];\t\n\t\t\tif(isset($this->request[\"zip\"]))\n\t\t\t\t$row_customer[0]->vZip = $this->request[\"zip\"];\t\n\t\t\tif(isset($this->request[\"bill_country_id\"]))\n\t\t\t\t$row_customer[0]->vCountry = $this->request[\"bill_country_id\"];\t\n\t\t\tif(isset($this->request[\"phone\"]))\n\t\t\t\t$row_customer[0]->vPhone = $this->request[\"phone\"];\t\n\t\t\tif(isset($this->request[\"homepage\"]))\n\t\t\t\t$row_customer[0]->vHomePage = $this->request[\"homepage\"];\t\n\t\t\tif(isset($this->request[\"mail_list\"]))\n\t\t\t\t$row_customer[0]->iMailList = $this->request[\"mail_list\"];\t\n\t\t\tif(isset($this->request[\"member_points\"]))\n\t\t\t\t$row_customer[0]->fMemberPoints = $this->request[\"member_points\"];\t\n\t\t\tif(isset($this->request[\"iStatus\"]))\n\t\t\t\t$row_customer[0]->iStatus = $this->request[\"status\"];\t\n\t\t\telse\n\t\t\t\t$row_customer[0]->iStatus = \"\";\n\t\t}\n\t\n\t\t#DISPLAYING MESSAGES\n\t\tif($this->err==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$this->errMsg);\n\t\t}\n\n\n\t\t#IF EDIT MODE SELECTED\n\n\t\t#ASSIGNING FORM ACTION\t\t\t\t\t\t\n\t\t$this->ObTpl->set_var(\"FORM_URL\", SITE_URL.\"user/adminindex.php?action=user.updateUser\");\n\t\t\n\t\t$this->obDb->query = \"SELECT iStateId_PK, vStateName FROM \".STATES.\" ORDER BY vStateName\";\n\t\t$row_state = $this->obDb->fetchQuery();\n\t\t$row_state_count = $this->obDb->record_count;\n\t\t\n\t\t$this->obDb->query = \"SELECT iCountryId_PK, vCountryName, vShortName FROM \".COUNTRY.\" ORDER BY iSortFlag,vCountryName\";\n\t\t$row_country = $this->obDb->fetchQuery();\n\t\t$row_country_count = $this->obDb->record_count;\n\n\t\t# Loading billing country list\t\t\n\t\tfor($i=0;$i<$row_country_count;$i++)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"k\", $row_country[$i]->iCountryId_PK);\n\t\t\t$this->ObTpl->parse('countryblks','countryblk',true);\n\t\t\t$this->ObTpl->set_var(\"TPL_COUNTRY_VALUE\", $row_country[$i]->iCountryId_PK);\n\t\t\t\n\t\t\t\n\t\t\tif($row_customer[0]->vCountry> 0)\n\t\t\t{\n\t\t\t\tif($row_customer[0]->vCountry == $row_country[$i]->iCountryId_PK)\n\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"selected=\\\"selected\\\"\");\n\t\t\t\telse\n\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$row_customer[0]->vCountry = SELECTED_COUNTRY;\n\t\t\t\t\t//echo SELECTED_COUNTRY;\n\n\t\t\t\t\tif($row_country[$i]->iCountryId_PK==$row_customer[0]->vCountry)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\",\"selected=\\\"selected\\\"\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"\");\n\t\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t$this->ObTpl->set_var(\"TPL_COUNTRY_NAME\",$this->libFunc->m_displayContent($row_country[$i]->vCountryName));\n\t\t\t$this->ObTpl->parse(\"nBillCountry\",\"BillCountry\",true);\n\t\t}\n\t\t\n\t\tif(isset($row_customer[0]->vCountry) && $row_customer[0]->vCountry != '')\t\n\t\t\t$this->ObTpl->set_var('selbillcountid',$row_customer[0]->vCountry);\n\t\telse\n\t\t\t$this->ObTpl->set_var('selbillcountid',\"251\");\n\n\n\t\tif(isset($row_customer[0]->vState) && $row_customer[0]->vState != '')\n\t\t\t$this->ObTpl->set_var('selbillstateid',$row_customer[0]->vState);\n\t\telse\n\t\t\t$this->ObTpl->set_var('selbillstateid',0);\n\t\t\n\t\t\t\n\t\t\n\t\t# Loading the state list here\n\t\t$this->obDb->query = \"SELECT C.iCountryId_PK as cid,S.iStateId_PK as sid,S.vStateName as statename FROM \".COUNTRY.\" C,\".STATES.\" S WHERE S.iCountryId_FK=C.iCountryId_PK ORDER BY C.vCountryName,S.vStateName\";\n\t\t$cRes = $this->obDb->fetchQuery();\n\t\t$country_count = $this->obDb->record_count;\n\n\t\tif($country_count == 0)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"countryblks\", \"\");\n\t\t\t$this->ObTpl->set_var(\"stateblks\", \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t$loopid=0;\n\t\t\tfor($i=0;$i<$country_count;$i++)\n\t\t\t{\n\t\t\t\tif($cRes[$i]->cid==$loopid)\n\t\t\t\t{\n\t\t\t\t\t$stateCnt++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loopid=$cRes[$i]->cid;\n\t\t\t\t\t$stateCnt=0;\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->set_var(\"i\", $cRes[$i]->cid);\n\t\t\t\t$this->ObTpl->set_var(\"j\", $stateCnt);\n\t\t\t\t$this->ObTpl->set_var(\"stateName\",$cRes[$i]->statename);\n\t\t\t\t$this->ObTpl->set_var(\"stateVal\",$cRes[$i]->sid);\n\t\t\t\t$this->ObTpl->parse('stateblks','stateblk',true);\n\t\t\t}\n\t\t}\n\n\n\t\t#ASSIGNING FORM VARAIABLES\n\n\t\t$this->ObTpl->set_var(\"TPL_VAR_FNAME\", $this->libFunc->m_displayContent($row_customer[0]->vFirstName));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_LNAME\", $this->libFunc->m_displayContent($row_customer[0]->vLastName));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_EMAIL\", $this->libFunc->m_displayContent($row_customer[0]->vEmail));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PASS\", $this->libFunc->m_displayContent($row_customer[0]->vPassword));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ADDRESS1\", $this->libFunc->m_displayContent($row_customer[0]->vAddress1 ));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ADDRESS2\", $this->libFunc->m_displayContent($row_customer[0]->vAddress2 ));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CITY\", $this->libFunc->m_displayContent($row_customer[0]->vCity));\n\n\t\t$this->ObTpl->set_var(\"TPL_VAR_STATE\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vState ));\n\t\tif($row_customer[0]->vState>1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"BILL_STATE\",\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"BILL_STATE\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vStateName));\n\t\t\t}\n\t\t$this->ObTpl->set_var(\"TPL_VAR_COUNTRY\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vCountry ));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ZIP\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vZip));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_COMPANY\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vCompany));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PHONE\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vPhone));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_HOMEPAGE\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vHomePage));\n\t\t\n\t\tif(CAPTCHA_REGISTRATION){\n\t\t\t$this->ObTpl->parse(\"captcha_blk\",\"TPL_CAPTCHA_BLK\",true);\n\t\t}\n\n\t\tif(MAIL_LIST==1)\n\t\t{\n\t\t\tif($row_customer[0]->iMailList==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK1\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\telseif($row_customer[0]->iMailList==2)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK2\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK3\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\t$this->ObTpl->parse('news_blk','TPL_NEWSLETTER_BLK');\n\t\t}\n\t\t\n\t\treturn $this->ObTpl->parse(\"return\",\"TPL_USER_FILE\");\n\t}", "function displayClientInsertForm($errorMessages, $missingFields, $client, $contact) {\n\tif ($errorMessages) {\n\t\tforeach($errorMessages as $errorMessage) {\n\t\t\techo $errorMessage;\n\t\t}\n\t}\n\t\n\t\n\t\t\t\n?>\n\t<section class=\"content\">\n <!--added because we need the information to be submitted in a form-->\n <form action=\"<?php echo htmlentities( $_SERVER['PHP_SELF'] ); ?>\" method=\"post\" style=\"margin-bottom:50px;\" enctype=\"multipart/form-data\">\n <input type=\"hidden\" name=\"action\" value=\"client-add\"/>\n <!--end add-->\n\t\t<figure class=\"client-logo l-col-20\">\n\t\t\t<img class=\"client-logo-img small\" src=\" <?php echo \"images/default.jpg\"?>\" title=\"Client/Company name logo\" alt=\"Client/Company name logo\" />\n\t\t\t<fieldset class=\"client-logo-upload\">\n\t\t\t\t<legend class=\"client-logo-title\">Upload Client Logo</legend>\n\t\t\t\t<header class=\"client-logo-header\">\n\t\t\t\t\t<h1 class=\"client-logo-title\">Upload Client Logo</h1>\n\t\t\t\t</header>\n\t\t\t\t<input id=\"client-logo-file\" name=\"client-logo-file\" class=\"client-logo-file\" type=\"file\" value=\"Browse\" />\n\t\t\t\t<input id=\"client-logo-upload-btn\" name=\"client-logo-upload-btn\" class=\"client-logo-upload-btn\" type=\"button\" value=\"Upload\" /> or <a class=\"\" href=\"#\">Cancel</a>\n\t\t\t</fieldset>\n\t\t</figure>\n\t\t<section class=\"client-detail l-col-80\">\n \t<fieldset class=\"client-details-entry\">\n\t\t\t\t<legend class=\"client-details-title\">Enter client details:</legend>\n\t\t\t\t<header class=\"client-details-header\">\n\t\t\t\t\t<h1 class=\"client-details-title\">Enter client details:</h1>\n\t\t\t\t\t<h4 class=\"required\">= Required</h4>\n\t\t\t\t</header>\n\t\t\t\t<ul class=\"details-list client-details-list\">\n\t\t \t\t\t<li class=\"client-details-item name\">\n\t\t\t\t\t\t<label for=\"client-name\" <?php validateField(\"client_name\", $missingFields)?> class=\"client-details-label\">Client's name:</label>\n\t\t\t\t\t\t<input id=\"client-name\" name=\"client-name\" class=\"client-name-input\" type=\"text\" tabindex=\"1\" value=\"<?php echo $client->getValueEncoded(\"client_name\")?>\" /><br />\n\t\t\t\t\t\t<label for=\"contact-info-sync\" class=\"client-details-label\">Client and contact the same:</label>\n\t\t\t\t\t\t<input id=\"contact-info-sync\" name=\"contact-info-sync\" class=\"contact-info-sync-input\" type=\"checkbox\" tabindex=\"11\" value=\"info-sync\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item phoneNum\">\n\t\t\t\t\t\t<label for=\"client-phone\" class=\"client-details-label\">Phone number:</label>\n\t\t\t\t\t\t<input id=\"client-phone\" name=\"client-phone\" class=\"client-phone-input\" type=\"text\" tabindex=\"2\" value=\"<?php echo $client->getValueEncoded(\"client_phone\")?>\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item email\">\n\t\t\t\t\t\t<label for=\"client-email\" <?php validateField(\"client_email\", $missingFields)?> class=\"client-details-label\">Email address:</label>\n\t\t\t\t\t\t<input id=\"client-email\" name=\"client-email\" class=\"client-email-input\" type=\"text\" tabindex=\"3\" value=\"<?php echo $client->getValueEncoded(\"client_email\")?>\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item fax\">\n\t\t\t\t\t\t<label for=\"client-fax\" class=\"client-details-label\">Fax number:</label>\n\t\t\t\t\t\t<input id=\"client-fax\" name=\"client-fax\" class=\"client-fax-input\" type=\"text\" tabindex=\"4\" value=\"\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item address\">\n\t\t\t\t\t\t<label for=\"client-streetAddress\" <?php validateField(\"client_address\", $missingFields)?> class=\"client-details-label\">Street Address:</label>\n\t\t\t\t\t\t<textarea id=\"client-streetAddress\" name=\"client-streetAddress\" class=\"client-streetAddress-input\" tabindex=\"5\"><?php echo $client->getValueEncoded(\"client_address\")?></textarea><br />\n\t\t\t\t\t\t<label for=\"client-city\" <?php validateField(\"client_city\", $missingFields)?> class=\"client-details-label\">City:</label>\n\t\t\t\t\t\t<input id=\"client-city\" name=\"client-city\" class=\"client-city-input\" type=\"text\" tabindex=\"6\" value=\"<?php echo $client->getValueEncoded(\"client_city\")?>\" /><br />\n\t\t\t\t\t\t<label for=\"client-state\" <?php validateField(\"client_state\", $missingFields)?> class=\"client-details-label\">State:</label>\n\t\t\t\t\t\t<select id=\"client-state\" name=\"client-state\" class=\"client-state-select\" tabindex=\"7\">\n\t\t\t\t\t\t\t<option selected=\"selected\" value=\"default\">Select state</option>\n\t\t\t\t\t\t\t<option value=\"AL\">Alabama</option>\n\t\t\t\t\t\t\t<option value=\"AK\">Alaska</option>\n\t\t\t\t\t\t\t<option value=\"AZ\">Arizona</option>\n\t\t\t\t\t\t\t<option value=\"AR\">Arkansas</option>\n\t\t\t\t\t\t\t<option value=\"CA\">California</option>\n\t\t\t\t\t\t\t<option value=\"CO\">Colorado</option>\n\t\t\t\t\t\t\t<option value=\"CT\">Connecticut</option>\n\t\t\t\t\t\t\t<option value=\"DE\">Delaware</option>\n\t\t\t\t\t\t\t<option value=\"FL\">Florida</option>\n\t\t\t\t\t\t\t<option value=\"GA\">Georgia</option>\n\t\t\t\t\t\t\t<option value=\"HI\">Hawaii</option>\n\t\t\t\t\t\t\t<option value=\"ID\">Idaho</option>\n\t\t\t\t\t\t\t<option value=\"IL\">Illinois</option>\n\t\t\t\t\t\t\t<option value=\"IN\">Indiana</option>\n\t\t\t\t\t\t\t<option value=\"IA\">Iowa</option>\n\t\t\t\t\t\t\t<option value=\"KS\">Kansas</option>\n\t\t\t\t\t\t\t<option value=\"KY\">Kentucky</option>\n\t\t\t\t\t\t\t<option value=\"LA\">Louisiana</option>\n\t\t\t\t\t\t\t<option value=\"ME\">Maine</option>\n\t\t\t\t\t\t\t<option value=\"MD\">Maryland</option>\n\t\t\t\t\t\t\t<option value=\"MA\">Massachusetts</option>\n\t\t\t\t\t\t\t<option value=\"MI\">Michigan</option>\n\t\t\t\t\t\t\t<option value=\"MN\">Minnesota</option>\n\t\t\t\t\t\t\t<option value=\"MS\">Mississippi</option>\n\t\t\t\t\t\t\t<option value=\"MO\">Missouri</option>\n\t\t\t\t\t\t\t<option value=\"MT\">Montana</option>\n\t\t\t\t\t\t\t<option value=\"NE\">Nebraska</option>\n\t\t\t\t\t\t\t<option value=\"NV\">Nevada</option>\n\t\t\t\t\t\t\t<option value=\"NH\">New Hampshire</option>\n\t\t\t\t\t\t\t<option value=\"NJ\">New Jersey</option>\n\t\t\t\t\t\t\t<option value=\"NM\">New Mexico</option>\n\t\t\t\t\t\t\t<option value=\"NY\">New York</option>\n\t\t\t\t\t\t\t<option value=\"NC\">North Carolina</option>\n\t\t\t\t\t\t\t<option value=\"ND\">North Dakota</option>\n\t\t\t\t\t\t\t<option value=\"OH\">Ohio</option>\n\t\t\t\t\t\t\t<option value=\"OK\">Oklahoma</option>\n\t\t\t\t\t\t\t<option value=\"OR\">Oregon</option>\n\t\t\t\t\t\t\t<option value=\"PA\">Pennsylvania</option>\n\t\t\t\t\t\t\t<option value=\"RI\">Rhode Island</option>\n\t\t\t\t\t\t\t<option value=\"SC\">South Carolina</option>\n\t\t\t\t\t\t\t<option value=\"SD\">South Dakota</option>\n\t\t\t\t\t\t\t<option value=\"TN\">Tennessee</option>\n\t\t\t\t\t\t\t<option value=\"TX\">Texas</option>\n\t\t\t\t\t\t\t<option value=\"UT\">Utah</option>\n\t\t\t\t\t\t\t<option value=\"VT\">Vermont</option>\n\t\t\t\t\t\t\t<option value=\"VA\">Virginia</option>\n\t\t\t\t\t\t\t<option value=\"WA\">Washington</option>\n\t\t\t\t\t\t\t<option value=\"WV\">West Virginia</option>\n\t\t\t\t\t\t\t<option value=\"WI\">Wisconsin</option>\n\t\t\t\t\t\t\t<option value=\"WY\">Wyoming</option>\n\t\t\t\t\t\t\t<option value=\"DC\">Washington DC</option>\n\t\t\t\t\t\t\t<option value=\"PR\">Puerto Rico</option>\n\t\t\t\t\t\t\t<option value=\"VI\">U.S. Virgin Islands</option>\n\t\t\t\t\t\t\t<option value=\"AS\">American Samoa</option>\n\t\t\t\t\t\t\t<option value=\"GU\">Guam</option>\n\t\t\t\t\t\t\t<option value=\"MP\">Northern Mariana Islands</option>\n\t\t\t\t\t\t</select><br />\n\t\t\t\t\t\t<label for=\"client-zip\" <?php validateField(\"client_zip\", $missingFields)?> class=\"client-details-label\">Zip code:</label>\n\t\t\t\t\t\t<input id=\"client-zip\" name=\"client-zip\" class=\"client-zip-input\" type=\"text\" tabindex=\"8\" value=\"<?php echo $client->getValueEncoded(\"client_zip\")?>\" /><br />\n\t\t\t\t\t\t<label for=\"client-country\" class=\"client-details-label\">Client's country:</label>\n\t\t\t\t\t\t<select id=\"client-country\" name=\"client-country\" class=\"client-country-select\" tabindex=\"9\">\n\t\t\t\t\t\t\t<option value=\"\">Select client's country...</option>\n\t\t\t\t\t\t\t<option selected=\"selected\" value=\"US\">United States of America</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</li>\n <?php \n\t\t\t\t\t\t//get the currencies out to populate the drop down.\n\t\t\t\t\t\t$currency = Client::getCurrency();\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"client-details-item currency\">\n\t\t\t\t\t\t<label for=\"client-currency\" class=\"client-details-label\">Preferred currency:</label>\n <select name=\"client_currency_index\" id=\"client_currency_index\" size=\"1\"> \n\t\t\t\t\t\t<?php foreach ($currency as $currencies) { ?>\n \t\t\t\t\t\t\t<option value=\"<?php echo $currencies[\"client_currency_index\"] ?>\"<?php setSelected($client, \"client_currency_index\", $currencies[\"client_currency_index\"]) ?>><?php echo $currencies[\"client_preferred_currency\"]?></option>\n \t\t\t\t\t<?php } ?>\n </select><br />\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</fieldset>\n\t\t\t<fieldset class=\"contact-details-entry\">\n\t\t\t\t<legend class=\"contact-details-title\">Enter contact details:</legend>\n\t\t\t\t<h4 class=\"required\">= Required</h4>\n\t\t\t\t<ul class=\"details-list client-details-list\">\n\t\t\t\t\t<li class=\"client-details-item name\">\n\t\t\t\t\t\t<label for=\"contact-name\" <?php validateField(\"contact_name\", $missingFields)?> class=\"client-details-label\">Your contact's name:</label>\n\t\t\t\t\t\t<input id=\"contact-name\" name=\"contact-name\" class=\"contact-contact-info-input\" type=\"text\" tabindex=\"12\" value=\"<?php echo $contact->getValueEncoded(\"contact_name\")?>\" /><br />\n\t\t\t\t\t\t<label for=\"contact-primary\" class=\"client-details-label\">This the primary contact: </label>\n\t\t\t\t\t\t<input id=\"contact-primary\" name=\"contact-primary\" class=\"contact-info-input\" type=\"checkbox\" checked=\"checked\" tabindex=\"13\" value=\"1\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item phoneNum\">\n\t\t\t\t\t\t<label for=\"contact-officePhone\" class=\"client-details-label\">Office phone:</label>\n\t\t\t\t\t\t<input id=\"contact-officePhone\" name=\"contact-officePhone\" class=\"contact-contact-info-input\" type=\"text\" tabindex=\"14\" value=\"\" /><br />\n\t\t\t\t\t\t<label for=\"contact-mobilePhone\" class=\"client-details-label\">Mobile phone:</label>\n\t\t\t\t\t\t<input id=\"contact-mobilePhone\" name=\"contact-mobilePhone\" class=\"contact-info-input\" type=\"text\" tabindex=\"15\" value=\"\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item email\">\n\t\t\t\t\t\t<label for=\"contact-email\" class=\"client-details-label\">Email:</label>\n\t\t\t\t\t\t<input id=\"contact-email\" name=\"contact-email\" class=\"contact-contact-info-input\" type=\"text\" tabindex=\"16\" value=\"\" />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li class=\"client-details-item fax\">\n\t\t\t\t\t\t<label for=\"contact-fax\" class=\"client-details-label\">Fax:</label>\n\t\t\t\t\t\t<input id=\"contact-fax\" name=\"contact-fax\" class=\"contact-contact-info-input\" type=\"text\" tabindex=\"17\" value=\"\" />\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</fieldset>\n\t\t\t<fieldset class=\"client-details-entry\">\n\t\t\t\t<ul class=\"details-list client-details-submit\">\n\t\t\t\t\t<li class=\"client-details-item submit-client\">\n\t\t\t\t\t\t<label for=\"client-add-btn\" class=\"client-details-label\">All done?</label>\n\t\t\t\t\t\t<!--modified field to be of type submit instead of button-->\n <input id=\"client-add-btn\" name=\"client-add-btn\" class=\"client-add-btn\" type=\"submit\" value=\"+ Add Client\" tabindex=\"11\"/> \n\t\t\t\t\t\t<!--input id=\"client-add-btn\" name=\"client-add-btn\" class=\"client-add-btn\" type=\"button\" value=\"+Add Client\" tabindex=\"11\" /-->\n\t\t\t\t\t\t<!--end change--> \n\t\t\t\t\t\t or <a class=\"\" href=\"#\" tabindex=\"11\">Cancel</a>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</fieldset>\n\t\t</section>\n\t</section>\n</section>\n</form>\n<?php }", "function student_crm_webform_send_email_form() {\n $case = menu_get_object('crm_case', 2);\n \n $fields = field_info_instances();\n $fields = $fields['crm_case'][$case->type];\n $form_fields = array();\n $field_settings = array();\n if(!$fields) {\n return null;\n }\n foreach ($fields as $field_name => $field) {\n if ($field['settings']['webform']) {\n $form_fields[$field_name] = $field['label'];\n $field_settings[$field_name] = $field['settings']['email_address'];\n }\n }\n if (!count($form_fields)) {\n \n return array('message' => array('#markup' => \n '<div class=\"empty\">' . t('No forms for this item') . '</div>'));\n }\n drupal_add_js(drupal_get_path('module', 'student_crm_webform') . '/js/student_crm_webform.send_form.js');\n drupal_add_js(array('studentCRMWebformSettings' => $field_settings), 'setting');\n $form = array();\n \n $form['case'] = array(\n '#type' => 'hidden',\n '#value' => $case->cid,\n );\n \n $form['field'] = array(\n '#type' => 'select',\n '#title' => 'Select the type of form to send',\n '#options' => $form_fields,\n );\n \n $form['manual-email'] = array(\n '#type' => 'textfield',\n '#title' => 'Email address',\n );\n \n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Send form',\n );\n \n return $form;\n}", "private function _getBody()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$doc\t=\tdunloader( 'document', true );\r\n\t\t$db\t\t=\tdunloader( 'database', true );\r\n\t\t$form\t=\tdunloader( 'form', true );\r\n\t\t$data\t= null;\r\n\t\t\r\n\t\tswitch ( $action ) {\r\n\t\t\t\r\n\t\t\tcase 'themes' :\r\n\t\t\t\t\r\n\t\t\t\t$task\t= ( array_key_exists( 'task', $whmcs->input ) ? $whmcs->input['task'] : null );\r\n\t\t\t\t\r\n\t\t\t\tswitch ( $task ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Edit a specific theme\r\n\t\t\t\t\tcase 'edittheme':\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$tid\t= $whmcs->input['tid'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Pull all the themes from the database\r\n\t\t\t\t\t\t$db->setQuery( \"SELECT * FROM `mod_themer_themes` WHERE `id` = '{$tid}'\" );\r\n\t\t\t\t\t\t$theme\t= $db->loadObject();\r\n\t\t\t\t\t\t$params\t= json_decode( $theme->params, true );\r\n\t\t\t\t\t\tforeach ( $params as $k => $v ) $theme->$k = $v;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$fields\t= $form->setValues( $theme, 'themer.theme' );\r\n\t\t\t\t\t\t$render\t= $this->_renderForm( $fields, array() );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$data\t.=\t'<form action=\"addonmodules.php?module=themer&task=edittheme&action=themes\" class=\"form-horizontal\" method=\"post\">'\r\n\t\t\t\t\t\t\t\t.\t$render\r\n\t\t\t\t\t\t\t\t.\t'<div class=\"form-actions\"> '\r\n\t\t\t\t\t\t\t\t.\t$form->getButton( 'submit', array( 'class' => 'btn btn-primary btn-large span2', 'value' => t( 'themer.form.apply' ), 'name' => 'save' ) ) . ' '\r\n\t\t\t\t\t\t\t\t.\t$form->getButton( 'submit', array( 'class' => 'btn btn-large btn-inverse span2', 'value' => t( 'themer.form.saveandclose' ), 'name' => 'saveandclose' ) ) . ' '\r\n\t\t\t\t\t\t\t\t.\t'<a href=\"addonmodules.php?module=themer&action=themes\" class=\"btn btn-large span2 pull-right\"> ' . t( 'themer.form.close' ) . '</a>'\r\n\t\t\t\t\t\t\t\t.\t'</div>'\r\n\t\t\t\t\t\t\t\t.\t'<input type=\"hidden\" name=\"tid\" value=\"' . $theme->id . '\" />'\r\n\t\t\t\t\t\t\t\t.\t'<input type=\"hidden\" name=\"submit\" value=\"1\" />'\r\n\t\t\t\t\t\t\t\t.\t'</form>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t// The default action to take\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Get the current theme being used on the front end\r\n\t\t\t\t\t\t$db->setQuery( \"SELECT `value` FROM `mod_themer_settings` WHERE `key` = 'usetheme'\" );\r\n\t\t\t\t\t\t$tid\t= $db->loadResult();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Build the Add New Theme form\r\n\t\t\t\t\t\t$data\t.=\t'<div class=\"pull-right\">'\r\n\t\t\t\t\t\t\t\t.\t'\t<form action=\"addonmodules.php?module=themer&action=themes\" class=\"form-inline\" method=\"post\">'\r\n\t\t\t\t\t\t\t\t.\t'\t\t<input name=\"name\" type=\"text\" placeholder=\"' . t( 'themer.admin.themer.form.theme.placeholder.name' ) . '\"> '\r\n\t\t\t\t\t\t\t\t.\t'\t\t\t<button type=\"submit\" class=\"btn btn-success\">' . t( 'themer.admin.themer.form.theme.button.addnew' ) . '</button>'\r\n\t\t\t\t\t\t\t\t.\t'\t\t\t<input name=\"submit\" value=\"1\" type=\"hidden\" /><input type=\"hidden\" name=\"task\" value=\"addnew\" />'\r\n\t\t\t\t\t\t\t\t.\t'\t</form>'\r\n\t\t\t\t\t\t\t\t.\t'</div>'\r\n\t\t\t\t\t\t\t\t.\t'<div style=\"clear: both; \"> </div>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Pull all the themes from the database\r\n\t\t\t\t\t\t$db->setQuery( \"SELECT * FROM `mod_themer_themes` ORDER BY `name`\" );\r\n\t\t\t\t\t\t$items\t= $db->loadObjectList();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Cycle through the themes\r\n\t\t\t\t\t\tforeach ( $items as $item ) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$data\t.=\t'<div class=\"row-fluid well well-small\">'\r\n\t\t\t\t\t\t\t\t\t.\t'\t<div class=\"span12\">'\r\n\t\t\t\t\t\t\t\t\t.\t( $item->id != '1'\r\n\t\t\t\t\t\t\t\t\t?\t'\t\t<h3><a href=\"addonmodules.php?module=themer&action=themes&task=edittheme&tid=' . $item->id . '\">' . $item->name . '</a></h3>'\r\n\t\t\t\t\t\t\t\t\t:\t'\t\t<h3>' . $item->name . '</h3>' )\r\n\t\t\t\t\t\t\t\t\t.\t'\t</div>'\r\n\t\t\t\t\t\t\t\t\t.\t'\t<div class=\"span12\">'\r\n\t\t\t\t\t\t\t\t\t.\t'\t\t<p>' . $item->description . '</p>'\r\n\t\t\t\t\t\t\t\t\t.\t'\t</div>'\r\n\t\t\t\t\t\t\t\t\t.\t'\t<div class=\"span12\">'\r\n\t\t\t\t\t\t\t\t\t.\t'\t\t<a href=\"addonmodules.php?module=themer&action=themes&submit=1&task=makedefault&tid=' . $item->id . '\" class=\"btn btn-inverse span2 '\r\n\t\t\t\t\t\t\t\t\t.\t( $item->id == $tid\r\n\t\t\t\t\t\t\t\t\t?\t'disabled\">' . t( 'themer.admin.themer.form.theme.isselected.theme' )\r\n\t\t\t\t\t\t\t\t\t:\t'\">' . t ( 'themer.admin.themer.form.theme.button.makedefault' ) )\r\n\t\t\t\t\t\t\t\t\t. '</a> '\r\n\t\t\t\t\t\t\t\t\t.\t'\t\t<a href=\"addonmodules.php?module=themer&action=themes&submit=1&task=copytheme&tid=' . $item->id . '\" class=\"btn btn-inverse span2\">' . t( 'themer.admin.themer.form.theme.button.copytheme' ) . '</a>'\r\n\t\t\t\t\t\t\t\t\t.\t( $item->id != '1' \r\n\t\t\t\t\t\t\t\t\t?\t'<a href=\"addonmodules.php?module=themer&action=themes&task=edittheme&tid=' . $item->id . '\" class=\"btn btn-primary span1\">' . t( 'themer.form.edit' ) . '</a>'\r\n\t\t\t\t\t\t\t\t\t:\t'' )\r\n\t\t\t\t\t\t\t\t\t.\t(! in_array( $item->id, array( '1', $tid ) )\r\n\t\t\t\t\t\t\t\t\t?\t'<a href=\"addonmodules.php?module=themer&action=themes&submit=1&task=delete&tid=' . $item->id . '\" class=\"btn btn-danger span1\">' . t( 'themer.form.delete' ) . '</a>'\r\n\t\t\t\t\t\t\t\t\t: '' )\r\n\t\t\t\t\t\t\t\t\t.\t'\t</div>'\r\n\t\t\t\t\t\t\t\t\t.\t'</div>';\r\n\t\t\t\t\t\t}\t// End Task Switch\r\n\t\t\t\t} // End Theme Action Switch\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'config' :\r\n\t\t\t\t\r\n\t\t\t\t$db->setQuery( \"SELECT * FROM mod_themer_settings\" );\r\n\t\t\t\t$results\t= $db->loadObjectList();\r\n\t\t\t\t$values\t\t= array();\r\n\t\t\t\t\r\n\t\t\t\t// Set the values up\r\n\t\t\t\tforeach ( $results as $result ) $values[$result->key] = $result->value;\r\n\t\t\t\t$fields = $form->setValues( $values, 'themer.config' );\r\n\t\t\t\t\r\n\t\t\t\t$data\t=\t'<form action=\"addonmodules.php?module=themer&action=config\" class=\"form-horizontal\" method=\"post\">'\r\n\t\t\t\t\t\t.\t\t$this->_renderForm( $fields )\r\n\t\t\t\t\t\t.\t\t'<div class=\"form-actions\">'\r\n\t\t\t\t\t\t.\t\t\t$form->getButton( 'submit', array( 'class' => 'btn btn-primary', 'value' => t( 'themer.form.submit' ), 'name' => 'submit' ) )\r\n\t\t\t\t\t\t.\t\t\t$form->getButton( 'reset', array( 'class' => 'btn', 'value' => t( 'themer.form.cancel' ) ) )\r\n\t\t\t\t\t\t.\t\t'</div>'\r\n\t\t\t\t\t\t.\t'</form>';\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'license' :\r\n\t\t\t\t\r\n\t\t\t\t$lic\t= dunloader( 'license', 'themer' );\r\n\t\t\t\t$parts\t= $lic->getItems();\r\n\t\t\t\t\r\n\t\t\t\t// Set license\r\n\t\t\t\t$config\t= dunloader( 'config', 'themer' );\r\n\t\t\t\t$config->refresh();\r\n\t\t\t\t$form->setValue( 'license', $config->get( 'license' ), 'themer.license' );\r\n\t\t\t\t\r\n\t\t\t\t// Set status\r\n\t\t\t\tif (! array_key_exists( 'supnextdue', $parts ) ) {\r\n\t\t\t\t\t$state = 'important';\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$state\t= ( strtotime( $parts['supnextdue'] ) >= strtotime( date(\"Ymd\") ) ? 'success' : ( $parts['status'] == 'Invalid' ? 'important' : 'warning' ) );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$sttxt\t= ( $state == 'success' ? 'Active' : ( $state == 'important' ? 'Invalid License' : 'Expired' ) );\r\n\t\t\t\t$form->setValue( 'status', '<span class=\"label label-' . $state . '\"> ' . $sttxt . ' </span>', 'themer.license' );\r\n\t\t\t\t\r\n\t\t\t\t// Set Branding\r\n\t\t\t\t$form->setValue( 'branding', t( 'themer.admin.themer.form.config.branding.' . ( $lic->isBranded() ? 'branded' : 'nobrand' ) ), 'themer.license' );\r\n\t\t\t\t\r\n\t\t\t\t// Set information\r\n\t\t\t\t$info\t= array();\r\n\t\t\t\tif ( $state != 'important' ) {\r\n\t\t\t\t\t$use\t= array( 'registeredname', 'companyname', 'regdate', 'supnextdue' );\r\n\t\t\t\t\tforeach ( $use as $i ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Check to see if we have the item\r\n\t\t\t\t\t\tif (! array_key_exists( $i, $parts ) ) continue;\r\n\t\t\t\t\t\t$info[]\t= ( $i != 'supnextdue' ? t( 'themer.admin.themer.form.config.info.' . $i, $parts[$i] ) : t( 'themer.admin.themer.form.config.info.supnextdue', $state, $parts[$i] ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (! isset( $parts['message'] ) ) {\r\n\t\t\t\t\t\t$info[]\t= t( 'themer.admin.themer.form.config.info.invalidkey' );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$info[]\t= t( 'themer.admin.themer.form.config.info.invalidmsg', $parts['message'] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$form->setValue( 'info', $info, 'themer.license' );\r\n\t\t\t\t\r\n\t\t\t\t// Grab the fields\r\n\t\t\t\t$fields = $form->loadForm( 'license', 'themer' );\r\n\t\t\t\t\r\n\t\t\t\t$data\t=\t'<form action=\"addonmodules.php?module=themer&action=license\" class=\"form-horizontal\" method=\"post\">'\r\n\t\t\t\t\t\t.\t\t$this->_renderForm( $fields )\r\n\t\t\t\t\t\t.\t\t'<div class=\"form-actions\">'\r\n\t\t\t\t\t\t.\t\t\t$form->getButton( 'submit', array( 'class' => 'btn btn-primary', 'value' => t( 'themer.form.submit' ), 'name' => 'submit' ) )\r\n\t\t\t\t\t\t.\t\t\t$form->getButton( 'reset', array( 'class' => 'btn', 'value' => t( 'themer.form.cancel' ) ) )\r\n\t\t\t\t\t\t.\t\t'</div>'\r\n\t\t\t\t\t\t.\t'</form>';\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "public static function activate()\n\t{\n\t\tif (get_option('magic_form')) {\n\t\t\treturn;\n\t\t}\n\t\t$emailSystem = array(\n\t\t\t\"selectedSystem\" => \"smtp\"\n\t\t);\n\t\tadd_option(\"magicform_email_system\", json_encode($emailSystem));\n\n\t\t/**\n\t\t * Create Database Tables\n\t\t * There are two tables that we use.\n\t\t * %prefix%_magicform_forms for forms\n\t\t * %prefix%_magicform_submissions for submissions\n\t\t */\n\t\t\n\t\trequire_once(ABSPATH . '/wp-admin/includes/upgrade.php');\n\t\t\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$table_name = $wpdb->prefix . 'magicform_forms';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$table_name.\" (\n id int(11) NOT NULL AUTO_INCREMENT,\n form_name varchar(150) NOT NULL,\n create_date datetime NOT NULL,\n form_data mediumtext NULL,\n preview_form_data mediumtext NULL,\n short_code varchar(100) NOT NULL,\n status int(1) NOT NULL,\n views int(11) NOT NULL,\n owner_id mediumint(9) NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta($sql);\n \n $fieldTypeSql = \"SHOW FIELDS FROM \". $table_name .\" WHERE Field ='form_data'\";\n $result = $wpdb->get_results($fieldTypeSql)[0];\n if($result->Type != \"mediumtext\"){\n $sql = \"ALTER TABLE \". $table_name .\" MODIFY COLUMN \n `preview_form_data` MEDIUMTEXT , MODIFY COLUMN `form_data` MEDIUMTEXT\";\n $wpdb->get_results($sql);\n }\n\n\t\t$charset_collate = $wpdb->get_charset_collate();\n $submission_table_name = $wpdb->prefix . 'magicform_submissions';\n \n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$submission_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n form_id mediumint(9) NOT NULL,\n create_date datetime NOT NULL,\n data text NOT NULL,\n ip varchar(50) NULL,\n user_agent varchar(255) NULL,\n os varchar(50) NULL,\n browser varchar(50) NULL,\n device varchar(50) NULL,\n user_id int(11) NULL,\n user_username varchar(50) NULL,\n user_email varchar(200) NULL,\n gdpr int(1) NULL,\n page_title varchar(500) NOT NULL,\n page_url varchar (500) NOT NULL,\n read_status int(1) NOT NULL,\n payment_status int(1) NULL,\n total_amount varchar(200) NULL,\n payment_error varchar(500) NULL, \n PRIMARY KEY (id)\n ) $charset_collate;\";\n\t\tdbDelta($sql);\n\n $fieldTypeSql = \"SHOW FIELDS FROM \". $submission_table_name .\" WHERE Field ='ip'\";\n $result = $wpdb->get_results($fieldTypeSql)[0];\n if($result->Type != \"varchar(50)\"){\n $sql = \"ALTER TABLE \". $submission_table_name .\" MODIFY COLUMN \n `ip` varchar(50)\";\n $wpdb->get_results($sql);\n }\n\n $payment_fields = \"SHOW FIELDS FROM \". $submission_table_name .\" LIKE 'id'\";\n $result = $wpdb->get_results($payment_fields, ARRAY_A);\n if(count($result)>0){\n $payment_sql = \"ALTER TABLE \". $submission_table_name .\"\n ADD payment_status int(1) NULL,\n ADD total_amount varchar(200) NULL,\n ADD payment_error varchar(500) NULL\";\n $wpdb->get_results($payment_sql);\n }\n\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$notifications_table_name = $wpdb->prefix . 'magicform_notifications';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$notifications_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n form_id mediumint(9) NOT NULL,\n create_date datetime NOT NULL,\n title varchar(255) NOT NULL,\n data text NOT NULL,\n read_status int(1) NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta($sql);\n \n $charset_collate = $wpdb->get_charset_collate();\n\t\t$products_table_name = $wpdb->prefix . 'magicform_products';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$products_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n product_name varchar(255) NOT NULL,\n product text NOT NULL,\n status int(1) NOT NULL,\n create_date datetime NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n\t\tdbDelta($sql);\n\t}" ]
[ "0.6052312", "0.60283047", "0.5928493", "0.58293337", "0.58062065", "0.5803905", "0.5777098", "0.5752027", "0.57078296", "0.57052904", "0.5568365", "0.5546885", "0.5503471", "0.5498037", "0.5494546", "0.549446", "0.5491722", "0.54830974", "0.5482551", "0.54522985", "0.54304975", "0.5427626", "0.54224694", "0.5403144", "0.5393229", "0.5389851", "0.53841764", "0.53710395", "0.53541785", "0.53484696", "0.5338763", "0.5338283", "0.5334006", "0.5325098", "0.53178304", "0.53144395", "0.5312447", "0.5311115", "0.5304976", "0.53035825", "0.53025246", "0.530202", "0.5294772", "0.5286344", "0.5279433", "0.5277569", "0.52722603", "0.5271645", "0.5268026", "0.526537", "0.52648205", "0.525267", "0.5247815", "0.52428555", "0.5240751", "0.5238555", "0.52284443", "0.52275693", "0.5225614", "0.52237445", "0.5223709", "0.5222234", "0.5220028", "0.52148086", "0.5208715", "0.5199585", "0.51945853", "0.51922584", "0.519192", "0.51900834", "0.517782", "0.5172879", "0.5171306", "0.51619184", "0.5158988", "0.51565605", "0.51540077", "0.5150833", "0.51498896", "0.5147502", "0.5144833", "0.5143312", "0.5143172", "0.5140321", "0.5136988", "0.51363504", "0.5135687", "0.5135419", "0.5128719", "0.5121874", "0.51215506", "0.5120527", "0.5109859", "0.5107516", "0.5104978", "0.51042527", "0.510355", "0.5097649", "0.5097459", "0.5097062" ]
0.7134969
0
Prepares a controls object injecting the relevant fields from an email which cannot be directly used by controls.
static function prepare_controls($controls, $email) { foreach ($email->options as $name => $value) { if (strpos($name, 'composer_') === 0) { $controls->data['options_' . $name] = $value; } } $controls->data['message'] = TNP_Composer::unwrap_email($email->message); $controls->data['subject'] = $email->subject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepare_controls()\n {\n }", "static function update_email($email, $controls) {\n if (isset($controls->data['subject'])) {\n $email->subject = $controls->data['subject'];\n }\n\n // They should be only composer options\n foreach ($controls->data as $name => $value) {\n if (strpos($name, 'options_') === 0) {\n $email->options[substr($name, 8)] = $value;\n }\n }\n\n $email->editor = NewsletterEmails::EDITOR_COMPOSER;\n\n $email->message = self::get_html_open($email) . self::get_main_wrapper_open($email) .\n $controls->data['message'] . self::get_main_wrapper_close($email) . self::get_html_close($email);\n }", "public function init_form_fields()\n {\n\n // Get available placeholders for this email\n $placeholder_text = sprintf(__('Available placeholders: %s', 'subscriptio'), '<code>' . esc_html(implode('</code>, <code>', array_keys($this->placeholders))) . '</code>');\n\n // Define form fields\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __('Enable/Disable', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Enable this email notification', 'subscriptio'),\n 'default' => 'yes',\n ),\n 'send_to_admin' => array(\n 'title' => __('Send to admin', 'subscriptio'),\n 'type' => 'checkbox',\n 'label' => __('Send BCC copy to admin', 'subscriptio'),\n 'default' => 'no',\n ),\n 'subject' => array(\n 'title' => __('Subject', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __('Email heading', 'subscriptio'),\n 'type' => 'text',\n 'desc_tip' => true,\n 'description' => $placeholder_text,\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'additional_content' => array(\n 'title' => __('Additional content', 'subscriptio'),\n 'description' => __( 'Text to appear to appear below the main email content.', 'subscriptio' ) . ' ' . $placeholder_text,\n 'css' => 'width: 400px; height: 75px;',\n 'placeholder' => __('N/A', 'subscriptio'),\n 'type' => 'textarea',\n 'default' => $this->get_default_additional_content(),\n 'desc_tip' => true,\n ),\n 'email_type' => array(\n 'title' => __('Email type', 'subscriptio'),\n 'type' => 'select',\n 'description' => __('Choose which format of email to send.', 'subscriptio'),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "protected function prepare_fields()\n {\n }", "protected function createFormFields() {\n\t}", "public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "public function prepareElements()\n\t{\n\t\t// or a specification, from which the appropriate object\n\t\t// will be built.\n\n $this->add(array(\n 'name' => 'email',\n 'options' => array(\n 'label' => 'E-mail',\n ),\n 'attributes' => array(\n 'type' => 'text',\n \t'autocomplete' => 'off',\n ),\n ));\n\n $this->add(array(\n 'name' => 'password',\n 'options' => array(\n 'label' => 'Password',\n ),\n 'attributes' => array(\n 'type' => 'text',\n 'autocomplete' => 'off',\n ),\n ));\n\n $this->add(array(\n 'name' => 'role',\n 'options' => array(\n 'label' => 'Role',\n\n ),\n \t'type' => 'Select',\n \t'attributes' => array(\n \t\t'options' => array(\n \t\t\t'test' => 'Hi, Im a test!',\n \t\t\t'Foo' => 'Bar',\n \t\t),\n \t),\n ));\n\n $this->add(array(\n 'name' => 'submit',\n 'attributes' => array(\n 'value' => 'Save new user',\n 'type' => 'submit'\n ),\n ));\n\n\t\t// We could also define the input filter here, or\n\t\t// lazy-create it in the getInputFilter() method.\n\t}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }", "public function setup() {\n\t\t$this->fields = array( 'First Name', 'Last Name', 'Email 2', 'Address', 'Address2', 'City', 'State', 'Zipcode', 'Telephone', 'Phone' );\n\t\t\n\t\t// Add trap to comment form\n\t\tadd_filter( 'comment_form_defaults', array( $this, 'add_comment_trap' ) );\n\t\tadd_action( 'pre_comment_on_post', array( $this, 'unhash_comment_fields' ) );\n\t\tadd_action( 'comment_post', array( $this, 'check_comment_trap' ) );\n\t\t\n\t\t// Add trap to login form\n\t\tadd_action( 'login_form', array( $this, 'add_login_trap' ) );\n\t\tadd_filter( 'authenticate', array( $this, 'check_login_trap' ), 10, 3 );\n\t\t\n\t\t// Add trap to registration form\n\t\tadd_action( 'register_form', array( $this, 'add_login_trap' ) );\n\t\tadd_filter( 'registration_errors', array( $this, 'check_login_trap' ) );\n\t\t\n\t\t// Add inline style to hide fields\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'add_hide_css' ) );\n\t\tadd_action( 'login_enqueue_scripts', array( $this, 'add_hide_css' ) );\n\t}", "public function BuildControls() {\n\n $this->EncType= $this->GetOption('EncType');\n\n // convert array of arrays into array of objects\n foreach($this->Controls as $Name=>&$Control) {\n // skip already builded controls\n if (is_object($Control)) {\n continue;\n }\n // find classname\n if (!isset($Control['Type'])) {\n $Control += array('Type'=>'text', 'Attributes'=>array('UNKNOWNTYPE'=>'YES'));\n }\n if (strpos($Control['Type'], '\\\\') === false) { // short name, ex.: \"select\"\n $Type= ucfirst($Control['Type']);\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\'.$Type.'Control';\n } else { // it is fully qualified class name\n $Class= $Control['Type'];\n }\n if (!class_exists($Class)) {\n $this->Error('Class \"'.$Class.'\" not found.');\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\TextControl'; // fallback to any primitive control\n }\n // copy this array into $Options and append few more items\n // and append common options to allow usage of services\n $Options= $Control + array(\n 'Name'=> $Name,\n 'Form'=> $this,\n 'Book'=> $this->GetOption('Book')\n ) + $this->GetCommonOptions();\n $Control= new $Class($Options);\n // switch to multipart encoding if any control require that\n if ($Control->GetMultipartEncoding()) {\n $this->EncType= 'multipart/form-data';\n }\n }\n $this->Builded= true;\n }", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'settings-xendit.php' );\n\t}", "protected function prepareValidations() {}", "public function prepareVars()\n {\n if ($this->formField->disabled) {\n $this->previewMode = true;\n }\n\n $permissionsData = $this->formField->getValueFromData($this->model);\n if (!is_array($permissionsData)) {\n $permissionsData = [];\n }\n\n $this->vars['checkboxMode'] = $this->getControlMode() === 'checkbox';\n $this->vars['permissions'] = $this->getFilteredPermissions();\n $this->vars['baseFieldName'] = $this->getFieldName();\n $this->vars['permissionsData'] = $permissionsData;\n $this->vars['field'] = $this->formField;\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }", "public function set_fields() {\n $this->fields = apply_filters('wpucommentmetas_fields', $this->fields);\n foreach ($this->fields as $id => $field) {\n if (!is_array($field)) {\n $this->fields[$id] = array();\n }\n if (!isset($field['label'])) {\n $this->fields[$id]['label'] = ucfirst($id);\n }\n if (!isset($field['admin_label'])) {\n $this->fields[$id]['admin_label'] = $this->fields[$id]['label'];\n }\n if (!isset($field['type'])) {\n $this->fields[$id]['type'] = 'text';\n }\n if (!isset($field['help'])) {\n $this->fields[$id]['help'] = '';\n }\n if (!isset($field['required'])) {\n $this->fields[$id]['required'] = false;\n }\n if (!isset($field['admin_visible'])) {\n $this->fields[$id]['admin_visible'] = true;\n }\n if (!isset($field['admin_column'])) {\n $this->fields[$id]['admin_column'] = false;\n }\n if (!isset($field['admin_list_visible'])) {\n $this->fields[$id]['admin_list_visible'] = false;\n }\n if (!isset($field['display_hooks'])) {\n $this->fields[$id]['display_hooks'] = array(\n 'comment_form_logged_in_after',\n 'comment_form_after_fields'\n );\n }\n if (!is_array($this->fields[$id]['display_hooks'])) {\n $this->fields[$id]['display_hooks'] = array($this->fields[$id]['display_hooks']);\n }\n }\n }", "public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'dokan' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'dokan' ),\n 'default' => 'yes',\n ),\n 'subject' => array(\n 'title' => __( 'Subject', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{site_name},{amount},{seller_name},{order_id},{status}</code>' ),\n 'placeholder' => $this->get_default_subject(),\n 'default' => '',\n ),\n 'heading' => array(\n 'title' => __( 'Email heading', 'dokan' ),\n 'type' => 'text',\n 'desc_tip' => true,\n /* translators: %s: list of placeholders */\n 'description' => sprintf( __( 'Available placeholders: %s', 'dokan' ), '<code>{site_name},{amount},{seller_name},{order_id},{status}</code>' ),\n 'placeholder' => $this->get_default_heading(),\n 'default' => '',\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'dokan' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'dokan' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options(),\n 'desc_tip' => true,\n ),\n );\n }", "function prepare() {\n $this->addChild(new fapitng_FormHidden('form_build_id', array(\n 'value' => $this->build_id,\n )));\n $this->addChild(new fapitng_FormHidden('form_id', array(\n 'value' => $this->id,\n )));\n if ($this->token) {\n $this->addChild(new fapitng_FormHidden('form_token', array(\n 'value' => $this->token,\n )));\n }\n }", "public function prepareElements()\n {\n // or a specification, from which the appropriate object\n // will be built.\n\n \n\n // We could also define the input filter here, or\n // lazy-create it in the getInputFilter() method.\n }", "protected function prepareForValidation()\n {\n if($this->name != null) {\n $this->merge([\n 'name' => filter_var($this->name, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->email != null) {\n $this->merge([\n 'email' => filter_var(trim($this->email), FILTER_SANITIZE_EMAIL),\n ]);\n }\n\n if($this->leader != null) {\n $this->merge([\n 'leader' => filter_var($this->leader, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->gruplac != null) {\n $this->merge([\n 'gruplac' => filter_var(trim($this->gruplac), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->minciencias_code != null) {\n $this->merge([\n 'minciencias_code' => filter_var(trim($this->minciencias_code), FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->minciencias_category != null) {\n $this->merge([\n 'minciencias_category' => filter_var($this->minciencias_category, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->website != null) {\n $this->merge([\n 'website' => filter_var(trim($this->website), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->educational_institution_id != null) {\n $this->merge([\n 'educational_institution_id' => (integer) filter_var($this->educational_institution_id, FILTER_SANITIZE_NUMBER_INT),\n ]);\n }\n }", "protected function prepareForValidation() {\n parent::prepareForValidation();\n $this->merge(['feedback_contents_template' => json_decode($this->get('feedback_contents_template'), true)]);\n }", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'data/data-settings.php' );\n\t}", "public function init_form_fields() {\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', 'woocommerce' ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable this email notification', 'woocommerce' ),\n 'default' => 'yes'\n ),\n 'subject' => array(\n 'title' => __( 'Email Subject', 'woocommerce' ),\n 'type' => 'text',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->subject ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'heading' => array(\n 'title' => __( 'Email Heading', 'woocommerce' ),\n 'type' => 'text',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->heading ),\n 'placeholder' => '',\n 'default' => ''\n ),\n 'custom_message' => array(\n 'title' => __( 'Custom Message', 'yith-woocommerce-membership' ),\n 'type' => 'textarea',\n 'description' => sprintf( __( 'Defaults to <code>%s</code>', 'woocommerce' ), $this->custom_message ),\n 'placeholder' => '',\n 'default' => __( 'Dear Customer {firstname} {lastname}, your membership {membership_name} is cancelled.', 'yith-woocommerce-membership' )\n ),\n 'email_type' => array(\n 'title' => __( 'Email type', 'woocommerce' ),\n 'type' => 'select',\n 'description' => __( 'Choose which format of email to send.', 'woocommerce' ),\n 'default' => 'html',\n 'class' => 'email_type wc-enhanced-select',\n 'options' => $this->get_email_type_options()\n )\n );\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "protected function initHtmlElements()\n {\n $this->htmlElement = new Html_Element('input');\n $this->htmlElementLabel = new Html_Element('label');\n $this->htmlElementValidaionLabel = clone $this->containerElement;\n $this->htmlElementSubLabel = clone $this->containerElement;\n }", "public function init_form_fields() {\n\t\t$this->form_fields = [\n\t\t\t'enabled' => [\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => 'Enable this email digest',\n\t\t\t\t'default' => 'no'\n\t\t\t],\n\t\t\t'recipient' => [\n\t\t\t\t'title' => 'Recipient(s)',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'Enter recipients (comma separated) for this email. Defaults to ' . get_option( 'admin_email' ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t],\n\t\t\t'schedule' => [\n\t\t\t\t'type' => 'select',\n\t\t\t\t'title' => 'Scheduled Frequency',\n\t\t\t\t'description' => 'Weekly emails will be sent on Mondays. All emails are sent at 7:00am.',\n\t\t\t\t'options' => [\n\t\t\t\t\t'daily' => 'Daily',\n\t\t\t\t\t'weekly' => 'Weekly'\n\t\t\t\t],\n\t\t\t\t'default' => 'daily'\n\t\t\t],\n\t\t\t'email_type' => [\n\t\t\t\t'title' => 'Email type',\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => 'Choose which format of email to send.',\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type wc-enhanced-select',\n\t\t\t\t'options' => $this->get_email_type_options(),\n\t\t\t\t'desc_tip' => true,\n\t\t\t],\n\t\t\t'send_now' => [\n\t\t\t\t'title' => 'Send now?',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => 'Yes, send the email digest on save',\n\t\t\t\t'default' => 'no'\n\t\t\t]\n\t\t];\n\t}", "public function createPresenters()\n {\n parent::createPresenters();\n\n $this->addPresenters(\n new TextBox( 'username' ),\n new Password( 'password' )\n );\n\n foreach( $this->presenters as $presenter )\n {\n if( $presenter instanceof TextBox )\n {\n $presenter->addCssClassName( 'form-control' );\n }\n }\n }", "public function init()\n {\n\n //recipient\n $this->add(\n array(\n 'name' => self::FIELD_REJECT_REASON,\n 'type' => 'Zend\\Form\\Element\\Textarea',\n 'options' => array(\n 'label' => $this->translate('Reject Reason').\":\",\n ),\n )\n );\n\n $this->add($this->getButtonFieldSet());\n }", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }", "protected function setupFields()\n {\n }", "public function injectFields()\n\t{\n\t\t$GLOBALS['TL_DCA']['tl_module']['palettes']['personalData'] = str_replace('newsletters;', 'newsletters,newsalerts;', $GLOBALS['TL_DCA']['tl_module']['palettes']['personalData']);\n\t\t$GLOBALS['TL_DCA']['tl_module']['palettes']['registration'] = str_replace('newsletters;', 'newsletters,newsalerts;', $GLOBALS['TL_DCA']['tl_module']['palettes']['registration']);\n\t}", "protected function composeFields()\n {\n $this->fields = $this->authorization->get();\n }", "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }", "protected function _prepareForm() {\r\n\t $form = new Varien_Data_Form();\r\n\t $this->setForm($form);\r\n\t $fieldset = $form->addFieldset(\"reason_form\", array(\"legend\" => Mage::helper(\"mprmasystem\")->__(\"RMA Reason\")));\r\n\r\n\t\t\t$fieldset->addField(\"reason\", \"textarea\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Reason Provided\"),\r\n\t\t\t\t\"name\" => \"reason\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$fieldset->addField(\"status\", \"select\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Status\"),\r\n\t\t\t\t\"name\" \t\t=> \"status\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true,\r\n\t\t\t\t\"values\"\t=> array(\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Please Select\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"1\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Enable\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"0\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Disable\"))\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t));\r\n\t\t\t\r\n\t if(Mage::registry(\"mprmareason_data\"))\r\n\t $form->setValues(Mage::registry(\"mprmareason_data\")->getData());\t\t\t\r\n\t return parent::_prepareForm();\r\n\t }", "public function customize_controls_init()\n {\n }", "public function init_form_fields(){\n \n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'label' => 'Enable Vortex Gateway',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'description' => '',\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => 'Title',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'This controls the title which the user sees during checkout.',\n\t\t\t\t'default' => 'Vortex Payment',\n\t\t\t\t'desc_tip' => true,\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => 'Description',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'description' => 'This controls the description which the user sees during checkout.',\n\t\t\t\t'default' => 'Paga con Vortex Payment.',\n\t\t\t),\n\t\t\t'BID' => array(\n\t\t\t\t'title' => 'Business ID',\n\t\t\t\t'type' => 'text'\n\t\t\t)\n\n\t\t\t);\n \n\t \t}", "private function resetFormData()\r\n {\r\n $_charset = $this->config->getModuleVar('common', 'charset');\r\n\r\n $this->viewVar['cauthor'] = htmlentities($this->strip($this->cauthor), ENT_COMPAT, $_charset);\r\n $this->viewVar['cemail'] = htmlentities($this->strip($this->cemail), ENT_COMPAT, $_charset);\r\n $this->viewVar['cbody'] = htmlentities($this->strip($this->cbody), ENT_COMPAT, $_charset);\r\n }", "public function init_form_fields() {\n\n\t\t$this->form_fields = array(\n\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable this email notification', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'default' => 'yes',\n\t\t\t),\n\n\t\t\t'subject' => array(\n\t\t\t\t'title' => __( 'Subject', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->subject ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'subject_multiple' => array(\n\t\t\t\t'title' => __( 'Subject Multiple', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the email subject line when the email contains more than one voucher. Leave blank to use the default subject: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->subject_multiple ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'heading' => array(\n\t\t\t\t'title' => __( 'Email Heading', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->heading ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'heading_multiple' => array(\n\t\t\t\t'title' => __( 'Email Heading Multiple', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the main heading contained within the email notification when the email contains more than one voucher. Leave blank to use the default heading: <code>%s</code>.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ), $this->heading_multiple ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => '',\n\t\t\t),\n\n\t\t\t'email_type' => array(\n\t\t\t\t'title' => __( 'Email type', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Choose which format of email to send.', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'plain' => __( 'Plain text', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t\t'html' => __( 'HTML', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t\t'multipart' => __( 'Multipart', WC_PDF_Product_Vouchers::TEXT_DOMAIN ),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "private function resetInputFields()\n {\n $this->name = '';\n $this->code = '';\n $this->agency_id = '';\n\n $this->phone = '';\n $this->fax = '';\n\n $this->email = '';\n $this->address = '';\n $this->country = '';\n }", "public function init()\n {\n $request = new Zend_Controller_Request_Http();\n $domain = $request->getCookie('domain');\n $defaultBehaviors = array(\n '' => '--',\n 'Discarded' => 'Discard Email',\n 'Rejected' => 'Reject Email',\n 'Rerouted to' => 'Forward to this address:',\n 'Accepted and Bounced' => 'Accept and Bounce'\n );\n\n\n $this->addElement('text', 'domain', array(\n 'label' => 'Domain Name',\n 'readonly' => true,\n 'value' => $domain,\n 'validators' => array(\n array('NotEmpty', true),\n\n ),\n ));\n\n $this->addElement('select', 'MailToUnknown', array(\n 'label' => 'Set Default Behavior',\n 'multiOptions' => $defaultBehaviors,\n // 'required' => true,\n ));\n\n $this->addElement('text', 'MailRerouteAddress', array(\n 'label' => 'Address to forward to',\n ));\n\n $this->populate($this->getSettings());\n\n $this->addControlButtons(array(\n 'cancelLink' => pm_Context::getBaseUrl(),\n ));\n }", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "function get_fields()\n\t{\n\t\t$fields=new ocp_tempcode();\n\t\t$fields->attach(form_input_line(do_lang_tempcode('MAIL_DOMAIN'),do_lang_tempcode('DESCRIPTION_MAIL_DOMAIN'),'dpop3','',true));\n\t\t$fields->attach(form_input_integer(do_lang_tempcode('MAIL_COST'),do_lang_tempcode('_DESCRIPTION_MAIL_COST'),'pop3',NULL,true));\n\t\treturn $fields;\n\t}", "public function init()\n {\n $this->setField(\n 'form',\n array(\n 'validators' => array(\n 'is_string',\n 'cmp' => array(\n array(\n 'eq' => 'advanced',\n ),\n ),\n ),\n )\n );\n\n $this->setField(\n 'action',\n array(\n 'validators' => array(\n 'is_string',\n 'cmp' => array(\n array(\n 'eq' => 'laterpay_advanced',\n ),\n ),\n ),\n )\n );\n\n $this->setField(\n '_wpnonce',\n array(\n 'validators' => array(\n 'is_string',\n 'cmp' => array(\n array(\n 'ne' => null,\n ),\n ),\n ),\n )\n );\n\n $this->setField(\n 'main_color',\n array(\n 'validators' => array(\n 'is_string',\n ),\n 'filters' => array(\n 'to_string',\n ),\n )\n );\n\n $this->setField(\n 'hover_color',\n array(\n 'validators' => array(\n 'is_string',\n ),\n 'filters' => array(\n 'to_string',\n ),\n )\n );\n\n $this->setField(\n 'debugger_enabled',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_bool',\n ),\n )\n );\n\n $this->setField(\n 'debugger_addresses',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_string',\n ),\n )\n );\n\n $this->setField(\n 'caching_compatibility',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_bool',\n ),\n )\n );\n\n $this->setField(\n 'enabled_post_types',\n array(\n 'validators' => array(\n 'is_array',\n ),\n )\n );\n\n $this->setField(\n 'show_time_passes_widget_on_free_posts',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_bool',\n ),\n )\n );\n\n $this->setField(\n 'require_login',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_bool',\n ),\n )\n );\n\n $this->setField(\n 'maximum_redemptions_per_gift_code',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_int',\n ),\n )\n );\n\n $this->setField(\n 'teaser_content_word_count',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_int',\n ),\n )\n );\n\n $this->setField(\n 'preview_excerpt_percentage_of_content',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_int',\n ),\n )\n );\n\n $this->setField(\n 'preview_excerpt_word_count_min',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_int',\n ),\n )\n );\n\n $this->setField(\n 'preview_excerpt_word_count_max',\n array(\n 'validators' => array(),\n 'filters' => array(\n 'to_int',\n ),\n )\n );\n\n $this->setField(\n 'unlimited_access',\n array(\n 'validators' => array(\n 'is_array',\n ),\n 'can_be_null' => true,\n )\n );\n\n $this->setField(\n 'api_enabled_on_homepage',\n array(\n 'filters' => array(\n 'to_bool',\n ),\n )\n );\n\n $this->setField(\n 'api_fallback_behavior',\n array(\n 'validators' => array(\n 'in_array' => array(0, 1, 2),\n ),\n 'filters' => array(\n 'to_int',\n ),\n )\n );\n\n $this->setField(\n 'pro_merchant',\n array(\n 'filters' => array(\n 'to_bool',\n ),\n )\n );\n\n $this->setField(\n 'business_model',\n array(\n 'validators' => array(\n 'in_array' => array(\n 'paid',\n 'donation',\n 'contribution'\n ),\n ),\n 'filters' => array(\n 'to_string',\n ),\n )\n );\n }", "public function prepareForm() {\n $fieldFactory = FieldFactory::getInstance();\n $translator = I18n::getInstance()->getTranslator();\n\n $profileList = array();\n $profiles = $this->wizard->getInstaller()->getProfiles();\n foreach ($profiles as $profileName => $profile) {\n $profileList[$profileName] = $profile->getName($translator) . '<span>' . $profile->getDescription($translator) . '</span>';\n }\n\n $profile = $this->wizard->getProfile();\n\n $profileField = $fieldFactory->createField(FieldFactory::TYPE_OPTION, self::FIELD_PROFILE, $profile);\n $profileField->setOptions($profileList);\n $profileField->addValidator(new RequiredValidator());\n\n $this->wizard->addField($profileField);\n }", "function issues_prepare_form_vars($issue = null, \n $item_guid = 0, \n $referrer = null, \n $description = null) {\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'start_date' => '',\n\t\t'end_date' => '',\n\t\t'issue_type' => '',\n\t\t'issue_number' => '',\n\t\t'status' => '',\n\t\t'assigned_to' => '',\n\t\t'percent_done' => '',\n\t\t'work_remaining' => '',\n\t\t'aspect' => 'issue',\n 'referrer' => $referrer,\n 'description' => $description,\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'write_access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $issue,\n\t\t'item_guid' => $item_guid,\n\t);\n\n\tif ($issue) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($issue->$field)) {\n\t\t\t\t$values[$field] = $issue->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('jot')) {\n\t\t$sticky_values = elgg_get_sticky_values('jot');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n//\telgg_clear_sticky_form('jot');\n\n\treturn $values;\n}", "function init_form_fields()\n\t{\n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => __( 'Enable/Disable', 'topgroupshops' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable this email notification', 'topgroupshops' ),\n\t\t\t\t'default' => 'yes'\n\t\t\t),\n\t\t\t'subject' => array(\n\t\t\t\t'title' => __( 'Subject', 'topgroupshops' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'topgroupshops' ), $this->subject ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'heading' => array(\n\t\t\t\t'title' => __( 'Email Heading', 'topgroupshops' ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'topgroupshops' ), $this->heading ),\n\t\t\t\t'placeholder' => '',\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'email_type' => array(\n\t\t\t\t'title' => __( 'Email type', 'topgroupshops' ),\n\t\t\t\t'type' => 'select',\n\t\t\t\t'description' => __( 'Choose which format of email to send.', 'topgroupshops' ),\n\t\t\t\t'default' => 'html',\n\t\t\t\t'class' => 'email_type',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'plain' => __( 'Plain text', 'topgroupshops' ),\n\t\t\t\t\t'html' => __( 'HTML', 'topgroupshops' ),\n\t\t\t\t\t'multipart' => __( 'Multipart', 'topgroupshops' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n\n $path = explode('\\\\', get_class($this->model));\n\n $this->vars['task_id'] = array_pop($path) . '-' . $this->model->{$this->taskKey};\n $this->vars['task_name'] = $this->model->{$this->taskName};\n\n $this->vars['app_name'] = HarvestSettings::get('app_name', 'Harvest');\n $this->vars['app_url'] = Request::url();\n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'emails' => $this->extractEmailAddresses($this->emails),\n ]);\n }", "public function setPreComponent()\n {\n $this->component\t=\tnew PreComponent;\n $draftsObj\t=\tnew ProfileDrafts($this->contactHandler->getViewer());\n $privilegeObj=$this->contactHandler->getPrivilegeObj();\n $this->component->drafts=$draftsObj->getAcceptDrafts();\n }", "function _prepareForm() {\n\t\t\t$this->getFieldset( );\n\t\t\t$fieldset = parent::_prepareForm( );\n\n\t\t\tif ($fieldset) {\n\t\t\t\t$this->getTextHelper( );\n\t\t\t\t$model = $helper = $this->getModel( );\n\t\t\t\t$isElementDisabled = !$this->isSaveAllowed( );\n\t\t\t\t$fieldset->addField( 'country_id', 'select', array( 'name' => 'country_id', 'label' => $helper->__( 'Country' ), 'title' => $helper->__( 'Country' ), 'required' => false, 'value' => $model->getCountryId( ), 'default' => '0', 'values' => $this->getCountryValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'region_id', 'select', array( 'name' => 'region_id', 'label' => $helper->__( 'Region/State' ), 'title' => $helper->__( 'Region/State' ), 'required' => false, 'value' => $model->getRegionId( ), 'default' => '0', 'values' => $this->getRegionValues( ), 'disabled' => $isElementDisabled ) );\n\t\t\t\t$fieldset->addField( 'zip', 'text', array( 'name' => 'zip', 'label' => $helper->__( 'Zip/Postal Code' ), 'title' => $helper->__( 'Zip/Postal Code' ), 'note' => $helper->__( '* or blank - matches any' ), 'required' => false, 'value' => $this->getZipValue( ), 'default' => '', 'disabled' => $isElementDisabled ) );\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "public function prepareVars()\n {\n $this->vars['searchBox'] = $this;\n $this->vars['cssClasses'] = implode(' ', $this->cssClasses);\n $this->vars['placeholder'] = lang($this->prompt);\n $this->vars['value'] = $this->getActiveTerm();\n }", "function prepare_form_vars($recipient_guids = null, $message_type = null, $entity = null) {\n\n\tif (!$message_type) {\n\t\t$message_type = Message::TYPE_PRIVATE;\n\t}\n\n\t$recipient_guids = Group::create($recipient_guids)->guids();\n\t\n\t$policy = new Config();\n\t$ruleset = $policy->getRuleset($message_type);\n\n\t$values = array(\n\t\t'entity' => $entity,\n\t\t'multiple' => $ruleset->allowsMultipleRecipients(),\n\t\t'has_subject' => $ruleset->hasSubject(),\n\t\t'allows_attachments' => $ruleset->allowsAttachments(),\n\t\t'subject' => ($entity) ? \"Re: $entity->title\" : '',\n\t\t'body' => '',\n\t\t'recipient_guids' => $recipient_guids,\n\t\t'message_type' => $message_type,\n\t);\n\n\tif (elgg_is_sticky_form('messages')) {\n\t\t$sticky = elgg_get_sticky_values('messages');\n\t\tforeach ($sticky as $field => $value) {\n\t\t\tif ($field == 'recipient_guids' && is_string($value)) {\n\t\t\t\t$value = string_to_tag_array($value);\n\t\t\t}\n\t\t\t$values[$field] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('messages');\n\treturn $values;\n}", "public function getCMSFields_forPopup() {\n\t\t\n\t\t$fields = new FieldSet(\n\t\t\tnew TextField('EmailSubject', _t('UserDefinedForm.EMAILSUBJECT', 'Email Subject')),\n\t\t\tnew TextField('EmailFrom', _t('UserDefinedForm.FROMADDRESS','Send Email From')),\n\t\t\tnew TextField('EmailAddress', _t('UserDefinedForm.SENDEMAILTO','Send Email To')),\n\t\t\tnew CheckboxField('HideFormData', _t('UserDefinedForm.HIDEFORMDATA', 'Hide Form Data from Email')),\n\t\t\tnew CheckboxField('SendPlain', _t('UserDefinedForm.SENDPLAIN', 'Send Email as Plain Text (HTML will be stripped)')),\n\t\t\tnew TextareaField('EmailBody', 'Body')\n\t\t);\n\t\t\n\t\tif($this->Form()) {\n\t\t\t$validEmailFields = DataObject::get(\"EditableEmailField\", \"\\\"ParentID\\\" = '$this->FormID'\");\n\t\t\t$multiOptionFields = DataObject::get(\"EditableMultipleOptionField\", \"\\\"ParentID\\\" = '$this->FormID'\");\n\t\t\t\n\t\t\t// if they have email fields then we could send from it\n\t\t\tif($validEmailFields) {\n\t\t\t\t$fields->insertAfter(new DropdownField('SendEmailFromFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASFROM', '.. or Select a Form Field to use as the From Address'), $validEmailFields->toDropdownMap('ID', 'Title'), '', null,\"\"), 'EmailFrom');\n\t\t\t}\n\t\t\t\n\t\t\t// if they have multiple options\n\t\t\tif($multiOptionFields || $validEmailFields) {\n\t\t\t\tif($multiOptionFields && $validEmailFields) {\n\t\t\t\t\t$multiOptionFields->merge($validEmailFields);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif(!$multiOptionFields) {\n\t\t\t\t\t$multiOptionFields = $validEmailFields;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$multiOptionFields = $multiOptionFields->toDropdownMap('ID', 'Title');\n\t\t\t\t$fields->insertAfter(new DropdownField('SendEmailToFieldID', _t('UserDefinedForm.ORSELECTAFIELDTOUSEASTO', '.. or Select a Field to use as the To Address'), $multiOptionFields, '', null, \"\"), 'EmailAddress');\n\t\t\t}\n\t\t}\n\n\t\treturn $fields;\n\t}", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "public function init() {\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_phone',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Phone Number', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_email',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Email Address', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_budget',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Desired Budget', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextArea( [\n\t\t\t'name' => DWSLGF_PREFIX . '_message',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Message', [ $this->post_type ] );\n\n\t\t$fm = new Fieldmanager_TextField( [\n\t\t\t'name' => DWSLGF_PREFIX . '_submission_datetime',\n\t\t] );\n\t\t$fm->add_meta_box( 'Customer Posted Date/Time', $this->post_type );\n\t}", "protected function initCreatingFields() : void\n\t{\n\n\t\t$this->creating_fields = ['text', 'user_id', 'parent_id'];\n\n\t}", "public function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Custom Payment', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title which the user sees during checkout.', $this->domain ),\n 'default' => __( 'Cartão de Crédito', $this->domain ),\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select',\n 'description' => __( 'Choose whether status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses()\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __('Informação do método de pagamento', $this->domain),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '',\n 'desc_tip' => true,\n ),\n );\n }", "public function registerControlsUI(){\n\t//\techo \"<br/>\".__METHOD__;\n \t$this->registerControlUI(ExjUI::NewTextField('ApplicationName', 'App'));\n \t$this->registerControlUI(ExjUI::NewTextField('type', 'Tipo'));\n \t\n \t$id_persona = ExjRequest::GetParamInt('id_persona', 0);\n \tif ($id_persona === 0) {\n \t\t$this->addBrokenRuler(\"No se ha enviado el parámetro id!\");\n \t\treturn false;\n \t}\n \t\n// \tExjTransferCharacters::decodeUTF8ToISO($id_persona);\n \t \t\n \t\n \tglobal $exj;\n \t\n \t// $exj->includeDataCustom('sys_users');\n \t\n \t$infoPerson = AppSysUsersData::getInfoPerson($id_persona);\n\n \tif (!$this->_sendMail($infoPerson)) {\n \t\treturn false;\n \t}\n\n \t\n \t$this->registerControlUI(ExjUI::NewTextField('source', 'Fuente'));\n \t\n \t\n \t$this->registerControlUI(ExjUI::NewTextArea('desc_sol_comun', 'Descripción', '99%', 210));\n\t}", "protected function prepareForValidation()\n {\n\n $attrs = $this->all();\n $attrs['day'] = ucfirst($attrs['day']);\n $hours = $this->transformHoursAndMinutes();\n $attrs['time_start'] = $hours[0];\n $attrs['time_end'] = $hours[1];\n $this->replace($attrs);\n }", "public function init()\n {\n parent::init();\n \n $this->addCssFile(\"/css/library/Account/Form/activate-accounts.css\");\n $this->addJsFile(\"/js/library/Account/Form/activate-accounts.js\");\n \n //add js file to do cool input masking\n $this->addJsFile(\"/js/jquery.maskedinput-1.3.js\");\n \n $this->setDecorators(self::$_formDecorators);\n \n foreach ($this->order->order_configurations as $config) {\n $subform = new \\Account_Form_ActivateAccountsSubForm($config->id);\n $this->addSubForm($subform, \"orderConfiguration_\" . $config->id);\n }\n \n $emailEveryone = new Zend_Form_Element_Checkbox(\"emailEveryone\");\n $emailEveryone->setLabel(\"Send email to account holders with their login information.\")\n ->setDecorators(self::$checkboxDecorators)\n ->setValue(1);\n $this->addElement($emailEveryone);\n \n $orderId = new Zend_Form_Element_Hidden(\"orderId\");\n $orderId->setDecorators(array('ViewHelper'));\n $this->addElement($orderId);\n\n $saveButton = new Fisdap_Form_Element_SaveButton(\"saveButton\");\n $saveButton->setLabel(\"Save\")\n ->setDecorators(self::$buttonDecorators);\n $this->addElement($saveButton);\n \n if ($this->order->id) {\n $this->setDefaults(array(\n 'orderId' => $this->order->id,\n ));\n }\n }", "function tidypics_prepare_form_vars($entity = null) {\n\t// input names => defaults\n\t$values = array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'access_id' => ACCESS_DEFAULT,\n\t\t'tags' => '',\n\t\t'container_guid' => elgg_get_page_owner_guid(),\n\t\t'guid' => null,\n\t\t'entity' => $entity,\n\t);\n\n\tif ($entity) {\n\t\tforeach (array_keys($values) as $field) {\n\t\t\tif (isset($entity->$field)) {\n\t\t\t\t$values[$field] = $entity->$field;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (elgg_is_sticky_form('tidypics')) {\n\t\t$sticky_values = elgg_get_sticky_values('tidypics');\n\t\tforeach ($sticky_values as $key => $value) {\n\t\t\t$values[$key] = $value;\n\t\t}\n\t}\n\n\telgg_clear_sticky_form('tidypics');\n\n\treturn $values;\n}", "protected function _prepareForm()\n {\n $model = Mage::registry('navision_customermapping');\n\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post'\n ));\n\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('checkout')->__('Customer Information'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', array(\n 'name' => 'id',\n ));\n }\n\n $fieldset->addField('customeremail', 'text', array(\n 'name' => 'customeremail',\n 'label' => Mage::helper('checkout')->__('Customer Email'),\n 'title' => Mage::helper('checkout')->__('Customer Email'),\n 'required' => true,\n ));\n\n $fieldset->addField('magentocustomerid', 'text', array(\n 'name' => 'magentocustomerid',\n 'label' => Mage::helper('checkout')->__('Magento Customer ID'),\n 'title' => Mage::helper('checkout')->__('Magento Customer ID'),\n 'required' => true,\n ));\n $fieldset->addField('navisioncustomerid', 'text', array(\n 'name' => 'navisioncustomerid',\n 'label' => Mage::helper('checkout')->__('Navision Customer ID'),\n 'title' => Mage::helper('checkout')->__('Navision Customer ID'),\n 'required' => true,\n ));\n\n$fieldset->addField('createdby', 'text', array(\n 'name' => 'createdby',\n 'label' => Mage::helper('checkout')->__('Created By'),\n 'title' => Mage::helper('checkout')->__('Created By'),\n 'required' => true,\n ));\n\n $fieldset->addField('needsync', 'checkbox', array(\n \n\n 'name' => 'needsync',\n 'label' => Mage::helper('checkout')->__('Need Sync'),\n\t\t'onclick' => 'this.value = this.checked ? 1 : 0;',\n 'title' => Mage::helper('checkout')->__('Need Sync'),\n 'required' => true,\n ));\n\n\n $form->setValues($model->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n\n return parent::_prepareForm();\n }", "protected function prepareFields($fields)\n {\n \t$fields = array_merge([\n Select::make(__('State'), 'state_id')->options(function() {\n return State::newModel()->get()->keyBy->getKey()->map->name->sort()->all();\n })\n ->required()\n ->rules('required')\n ->onlyOnForms(), \n\n ChildSelect::make(__('City'), 'city_id')->options(function ($state) { \n return City::newModel()->whereHas('state', function($query) use ($state) {\n $query->whereKey($state);\n })->get()->keyBy->getKey()->map->name->sort()->all();\n })\n ->parent('state_id')\n ->required()\n ->rules('required')\n ->onlyOnForms(),\n\n ChildSelect::make(__('Property zone'), 'zone_id')->options(function ($city) { \n return Zone::newModel()->whereHas('city', function($query) use ($city) {\n $query->whereKey($city);\n })->get()->keyBy->getKey()->map->name->sort()->all();\n })\n ->parent('city_id')\n ->required()\n ->rules('required')\n ->onlyOnForms(),\n\n BelongsTo::make(__('State'), 'state', State::class)\n ->onlyOnDetail(),\n\n BelongsTo::make(__('City'), 'city', City::class)\n ->onlyOnDetail(),\n\n BelongsTo::make(__('Zone'), 'zone', Zone::class)\n ->onlyOnDetail(),\n\n Targomaan::make([\n Text::make(__('Property Address'), 'address')\n ->nullable()\n ->rules('nullable', 'max:250'),\n ]), \n\n MapMarker::make(__('Google Location'), 'location')\n ->defaultZoom(16)\n ->defaultLatitude(29.609043426461)\n ->defaultLongitude(52.519180021444)\n ->latitude('lat')\n ->longitude('long')\n ->centerCircle(10, 'red', 1, .5),\n ], $fields);\n\n return parent::prepareFields($fields);\n }", "protected function prepareForValidation()\n {\n $input = array_filter(\n $this->all(['voucher-start', 'voucher-end', 'centre', 'date-sent']),\n 'strlen'\n );\n\n foreach ($input as $key => $value) {\n if (in_array($key, ['voucher-start', 'voucher-end'])) {\n $clean = Voucher::cleanCodes((array)$value);\n $input[$key] = strtoupper((array_shift($clean)));\n }\n }\n // replace old input with new input\n $this->replace($input);\n }", "public function init() {\n\t\t$this->setMethod ( 'post' );\n\n $decorator = array(\n 'ViewHelper',\n 'Errors',\n array(array('data' => 'HtmlTag'), array('tag' => 'span', 'class' => 'data')),\n array('Label', array('tag' => 'div'),\n array(array('row' => 'HtmlTag'), array('tag' => 'span')),\n ));\n\n\t\t$this->addElement ( 'text', 'emailforgot', array ('decorators' => $decorator, 'label' => 'Enter your Email:', 'required' => true, 'filters' => array ('StringTrim' ), 'validators' => array ('EmailAddress' ) ) );\n\n \n\t\t// add the submit button\n\t\t$this->addElement ( 'submit', 'submit', \n array ('label' => 'Send'\n ,'class'=>'btn-red')\n );\n\t}", "public function cfields_setup_restore()\r\n {\r\n $this->fields = self::custom_fields();\r\n }", "protected function regenerateFormControls()\n\t{\n\t\t$form = $this->getForm();\n\n\t\t// regenerate checker's checkbox controls\n\t\tif ($this->hasOperations()) {\n\t\t\t$values = $form->getValues();\n\n\t\t\t$form->removeComponent($form['checker']);\n\t\t\t$sub = $form->addContainer('checker');\n\t\t\tforeach ($this->getRows() as $row) {\n\t\t\t\t$sub->addCheckbox($row[$this->keyName], $row[$this->keyName]);\n\t\t\t}\n\n\t\t\tif (!empty($values['checker'])) {\n\t\t\t\t$form->setDefaults(array('checker' => $values['checker']));\n\t\t\t}\n\t\t}\n\n\t\t// for selectbox filter controls update values if was filtered over column\n\t\tif ($this->hasFilters()) {\n\t\t\tparse_str($this->filters, $list);\n\n\t\t\tforeach ($this->getFilters() as $filter) {\n\t\t\t\tif ($filter instanceof SelectboxFilter) {\n\t\t\t\t\t$filter->generateItems();\n\t\t\t\t}\n\n\t\t\t\tif ($this->filters === $this->defaultFilters && ($filter->value !== NULL || $filter->value !== '')) {\n\t\t\t\t\tif (!in_array($filter->getName(), array_keys($list))) $filter->value = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// page input & items selectbox\n\t\t$form['page']->setValue($this->paginator->page); // intentionally page from paginator\n\t\t$form['items']->setValue($this->paginator->itemsPerPage);\n\t}", "public function _prepareLayout()\n {\n $this->setTemplate('authorizenetcim/form/cc.phtml');\n }", "public function txtEmail_Create($strControlId = null) {\n\t\t\t$this->txtEmail = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtEmail->Name = QApplication::Translate('Email');\n\t\t\t$this->txtEmail->Text = $this->objClassifiedPost->Email;\n\t\t\t$this->txtEmail->MaxLength = ClassifiedPost::EmailMaxLength;\n\t\t\treturn $this->txtEmail;\n\t\t}", "abstract function setupform();", "function customize_controls_init()\n {\n }", "public function addMetaFields()\n {\n // Get some help :-)\n $helper = Metabox::get('lbwp-nl');\n\n // Metabox for settings\n $boxId = 'newsletter-settings';\n $helper->addMetabox($boxId, 'Einstellungen');\n $helper->addInputText('mailSubject', $boxId, 'Betreff', array('required' => true));\n $helper->addInputText('mailSender', $boxId, 'E-Mail Absender', array('required' => true));\n $helper->addInputText('mailSenderName', $boxId, 'Absender-Name', array('required' => true));\n\n // Template selection\n $boxId = 'newsletter-template';\n $helper->addMetabox($boxId, 'Newsletter Design');\n $helper->addField(\n 'templateId',\n $boxId,\n array(),\n array($this, 'displayNewsletterTemplates'),\n array($this, 'saveNewsletterTemplate')\n );\n\n // Metabox for post assignation\n $boxId = 'newsletter-items';\n $helper->addMetabox($boxId, 'Beiträge auswählen');\n $helper->addAssignPostsField('newsletterItems', $boxId, $this->sourceTypes);\n\n // Info box because we schedule sendings at xx:31 with cron\n $boxId = 'newsletter-sendinfo';\n $helper->addMetabox($boxId, 'Versand Information', 'side');\n\n $helper->addField(\n 'sendInfo',\n $boxId,\n array(),\n array($this, 'displaySendInfo'),\n '__return_false'\n );\n\n $boxId = 'newsletter-sendtest';\n $helper->addMetabox($boxId, 'Test-Versand', 'side');\n // Box to mail the current newsletter as a test to an email\n $helper->addField(\n 'sendTest',\n $boxId,\n array(),\n array($this, 'displayTestForm'),\n '__return_false'\n );\n }", "function campos_formulario( $fields) {\n\n //Variables necesarias básicas como que el email es obligatorio\n $commenter = wp_get_current_commenter();\n $req = get_option( 'require_name_email' );\n\t$aria_req = ( $req ? \" aria-required='true'\" : '' );\n\t\n // campos por defecto del formulario que vamos a introducir con nuestros cambios\n $fields = array(\n\t\t\n // NOMBRE\n 'author' =>\n\t'<input id=\"author\" placeholder=\"Nombre\" \n\tclass=\"nombre\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) . \n\t'\" size=\"30\"' . $aria_req . ' />',\n\n // EMAIL\n 'email' =>\n\t'<input id=\"email\" placeholder=\"Email\" \n\tclass=\"email\" name=\"email\" type=\"email\" value=\"' . esc_attr( $commenter['comment_author_email'] ) . '\" size=\"30\"' . $aria_req . ' />',\n\t);\n\t\n\treturn $fields;\n }", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "protected function _prepareForm()\n\t{\n\t\tparent::_prepareForm();\n\n\t\t$oMainTab = $this->getTab('main');\n\t\t$oAdditionalTab = $this->getTab('additional');\n\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\t$oMainTab\n\t\t\t->add(Admin_Form_Entity::factory('Div')->class('row')\n\t\t\t\t->add($oDivLeft = Admin_Form_Entity::factory('Div')->class('col-xs-12 col-md-6 col-lg-7 left-block'))\n\t\t\t\t->add($oDivRight = Admin_Form_Entity::factory('Div')->class('col-xs-12 col-md-6 col-lg-5 right-block'))\n\t\t\t);\n\n\t\t\t$oMainTab\n\t\t\t->add(Admin_Form_Entity::factory('Script')\n\t\t\t\t->value('\n\t\t\t\t\t$(function(){\n\t\t\t\t\t\tvar timer = setInterval(function(){\n\t\t\t\t\t\t\tif ($(\"#' . $windowId . ' .left-block\").height())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tclearInterval(timer);\n\n\t\t\t\t\t\t\t\t$(\"#' . $windowId . ' .right-block\").find(\"#' . $windowId . '_notes\").slimscroll({\n\t\t\t\t\t\t\t\t\theight: $(\"#' . $windowId . ' .left-block\").height() - 75,\n\t\t\t\t\t\t\t\t\tcolor: \"rgba(0, 0, 0, 0.3)\",\n\t\t\t\t\t\t\t\t\tsize: \"5px\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t});\n\t\t\t\t'));\n\n\t\t$oDivLeft\n\t\t\t->add($oMainRow1 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow2 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow3 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t->add($oMainRow4 = Admin_Form_Entity::factory('Div')->class('row'))\n\t\t\t;\n\n\t\t$oDivRight\n\t\t\t->add($oMainRowRight1 = Admin_Form_Entity::factory('Div')->class('row'));\n\n\t\t$sColorValue = ($this->_object->id && $this->getField('color')->value)\n\t\t\t? $this->getField('color')->value\n\t\t\t: '#aebec4';\n\n\t\t$this->getField('color')\n\t\t\t->colorpicker(TRUE)\n\t\t\t->value($sColorValue);\n\n\t\t$oMainTab\n\t\t\t->move($this->getField('name')->divAttr(array('class' => 'form-group col-xs-12')), $oMainRow1)\n\t\t\t->move($this->getField('description')->divAttr(array('class' => 'form-group col-xs-12'))->rows(10), $oMainRow2)\n\t\t\t->move($this->getField('datetime')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6')), $oMainRow3)\n\t\t\t->move($this->getField('deadline')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6')), $oMainRow3)\n\t\t\t->move($this->getField('color')->set('data-control', 'hue')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6')), $oMainRow4)\n\t\t\t->move($this->getField('completed')->divAttr(array('class' => 'form-group col-xs-12 col-sm-6 col-md-4 col-lg-6 margin-top-21')), $oMainRow4);\n\n\t\t$windowId = $this->_Admin_Form_Controller->getWindowId();\n\n\t\t$countNotes = $this->_object->Crm_Notes->getCount()\n\t\t\t? '<span class=\"badge badge-palegreen\">' . $this->_object->Crm_Notes->getCount() . '</span>'\n\t\t\t: '';\n\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"tabbable\">\n\t\t\t<ul class=\"nav nav-tabs tabs-flat\" id=\"crmProjectTabs\">\n\t\t\t\t<li class=\"active\">\n\t\t\t\t\t<a data-toggle=\"tab\" href=\"#<?php echo $windowId?>_notes\" data-path=\"/admin/crm/project/note/index.php\" data-window-id=\"<?php echo $windowId?>_notes\" data-additional=\"crm_project_id=<?php echo $this->_object->id?>\">\n\t\t\t\t\t\t<?php echo Core::_(\"Crm_Project.tabNotes\")?> <?php echo $countNotes?>\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<div class=\"tab-content tabs-flat\">\n\t\t\t\t<div id=\"<?php echo $windowId?>_notes\" class=\"tab-pane in active\">\n\t\t\t\t\t<?php\n\t\t\t\t\tAdmin_Form_Entity::factory('Div')\n\t\t\t\t\t\t->controller($this->_Admin_Form_Controller)\n\t\t\t\t\t\t->id(\"crm-project-notes\")\n\t\t\t\t\t\t->add(\n\t\t\t\t\t\t\t$this->_object->id\n\t\t\t\t\t\t\t\t? $this->_addNotes()\n\t\t\t\t\t\t\t\t: Admin_Form_Entity::factory('Code')->html(\n\t\t\t\t\t\t\t\t\tCore_Message::get(Core::_('Crm_Project.enable_after_save'), 'warning')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t->execute();\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t$oMainRowRight1->add(Admin_Form_Entity::factory('Div')\n\t\t\t->class('form-group col-xs-12 margin-top-20')\n\t\t\t->add(\n\t\t\t\tAdmin_Form_Entity::factory('Code')\n\t\t\t\t\t->html(ob_get_clean())\n\t\t\t)\n\t\t);\n\n\t\t$this->title($this->_object->id\n\t\t\t? Core::_('Crm_Project.edit_title', $this->_object->name, FALSE)\n\t\t\t: Core::_('Crm_Project.add_title')\n\t\t);\n\n\t\treturn $this;\n\t}", "private function setupFieldsAttributes() {\n\n\t\tforeach ( $this->form as $field ) {\n\n\t\t\tif ( ! $field->hasAttribute( 'id' ) ) {\n\t\t\t\t$field->setAttribute( 'id', esc_attr( sanitize_title( $field->getName() ) ) );\n\t\t\t}\n\t\t}\n\n\t}", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'api_key' => array(\n\t\t\t\t'title' => __( 'API Key', PLUGIN_TXT ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Enter with your API Key. You can find this in \"User Profile\" drop-down (top right corner) > API Keys.', PLUGIN_TXT ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug Log', PLUGIN_TXT ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable logging', PLUGIN_TXT ),\n\t\t\t\t'default' => 'no',\n\t\t\t\t'description' => __( 'Log events such as API requests', PLUGIN_TXT ),\n\t\t\t),\n\t\t);\n\t}", "private function resetInputFields()\n {\n $this->agency_id = '';\n $this->state_id = '';\n $this->name = '';\n $this->logo = '';\n $this->email = '';\n $this->phone = '';\n $this->fax = '';\n $this->address = '';\n $this->facebook = '';\n $this->instagram = '';\n $this->youtube = '';\n $this->viber = '';\n $this->whatsapp = '';\n $this->url = '';\n }", "protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }", "public function prepareVars()\n {\n $this->vars['posts'] = $this->prepareHtml();\n $this->vars['model'] = $this->model;\n }", "function BeforeShowEdit(&$xt, &$templatefile, $values, &$pageObject)\n{\n\n\t\t$att = $xt->fetchVar(\"Approved_editcontrol\");\n$att = str_replace(\">\",\" DISABLED=DISABLED>\",$att);\n$xt->assign(\"Approved_editcontrol\",$att);\n\n\n$attz = $xt->fetchVar(\"Approvedby_editcontrol\");\n$attz = str_replace(\">\",\" DISABLED=DISABLED>\",$attz);\n$xt->assign(\"Approvedby_editcontrol\",$attz);\n\n$at1 = $xt->fetchVar(\"EmployeeID_editcontrol\");\n$at1 = str_replace(\">\",\" DISABLED=DISABLED>\",$at1);\n$xt->assign(\"EmployeeID_editcontrol\",$at1);\n\n//$at2 = $xt->fetchVar(\"Superior_editcontrol\");\n//$at2 = str_replace(\">\",\" DISABLED=DISABLED>\",$at2);\n//$xt->assign(\"Superior_editcontrol\",$at2);\n\n\n$at3 = $xt->fetchVar(\"Locked_editcontrol\");\n$at3 = str_replace(\">\",\" DISABLED=DISABLED>\",$at3);\n$xt->assign(\"Locked_editcontrol\",$at3);\n\n$at4 = $xt->fetchVar(\"Posted_editcontrol\");\n$at4 = str_replace(\">\",\" DISABLED=DISABLED>\",$at4);\n$xt->assign(\"Posted_editcontrol\",$at4);\n\n\n $attr = $xt->fetchVar(\"Superior_editcontrol\");\n $attr = str_replace(\">\",\" READONLY=READONLY>\",$attr);\n $xt->assign(\"Superior_editcontrol\",$attr);\n\n\n $att5 = $xt->fetchVar(\"Superior2_editcontrol\");\n $att5 = str_replace(\">\",\" READONLY=READONLY>\",$att5);\n $xt->assign(\"Superior2_editcontrol\",$att5);\n\n\n $att6 = $xt->fetchVar(\"1stApproval_editcontrol\");\n $att6 = str_replace(\">\",\" DISABLED=DISABLED>\",$att6);\n $xt->assign(\"1stApproval_editcontrol\",$att6);\n\n $att7 = $xt->fetchVar(\"2ndApproval_editcontrol\");\n $att7 = str_replace(\">\",\" DISABLED=DISABLED>\",$att7);\n $xt->assign(\"2ndApproval_editcontrol\",$att7);\n\n\n\n\n\n\n\n\n;\t\t\n}", "public function SetCustomVars()\n\t{\n\t\t$this->_variables['displayname'] = array(\"name\" => GetLang('NabDisplayName'),\n\t\t \"type\" => \"textbox\",\n\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t \"default\" => $this->GetName(),\n\t\t \"required\" => true\n\t\t);\n\n\t\t$this->_variables['vendor_name'] = array(\"name\" => GetLang('NabVendorName'),\n\t\t \"type\" => \"textbox\",\n\t\t \"help\" => GetLang('NabVendorNameHelp'),\n\t\t \"default\" => \"\",\n\t\t \"required\" => true\n\t\t);\n\n\t\t$this->_variables['email'] = array(\"name\" => GetLang('NabPaymentEmail'),\n\t\t \"type\" => \"textbox\",\n\t\t \"help\" => GetLang('NabPaymentAlertHelp'),\n\t\t \"default\" => \"\",\n\t\t \"required\" => true\n\t\t);\n\n\t\t$this->_variables['testmode'] = array(\"name\" => GetLang('NabTestMode'),\n\t\t \"type\" => \"dropdown\",\n\t\t \"help\" => GetLang(\"NabTestModeHelp\"),\n\t\t \"default\" => \"no\",\n\t\t \"required\" => true,\n\t\t \"options\" => array(GetLang(\"NabTestModeNo\") => \"NO\",\n\t\t\t\t\t\t GetLang(\"NabTestModeYes\") => \"YES\"\n\t\t\t),\n\t\t\t\"multiselect\" => false\n\t\t);\n\t}", "public function init_form_fields()\n {\n $this->log(' [Info] Entered init_form_fields()...');\n $log_file = 'btcpay-' . sanitize_file_name( wp_hash( 'btcpay' ) ) . '-log';\n $logs_href = get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wc-status&tab=logs&log_file=' . $log_file;\n\n $this->form_fields = array(\n 'title' => array(\n 'title' => __('Title', 'btcpay-for-woocommerce'),\n 'type' => 'text',\n 'description' => __('Controls the name of this payment method as displayed to the customer during checkout.', 'btcpay-for-woocommerce'),\n 'default' => __('Bitcoin', 'btcpay-for-woocommerce'),\n 'desc_tip' => true,\n ),\n 'description' => array(\n 'title' => __('Customer Message', 'btcpay-for-woocommerce'),\n 'type' => 'textarea',\n 'description' => __('Message to explain how the customer will be paying for the purchase.', 'btcpay-for-woocommerce'),\n 'default' => 'You will be redirected to BTCPay to complete your purchase.',\n 'desc_tip' => true,\n ),\n 'api_token' => array(\n 'type' => 'api_token'\n ),\n 'transaction_speed' => array(\n 'title' => __('Invoice pass to \"confirmed\" state after', 'btcpay-for-woocommerce'),\n 'type' => 'select',\n 'description' => 'An invoice becomes confirmed after the payment has...',\n 'options' => array(\n 'default' => 'Keep store level configuration',\n 'high' => '0 confirmation on-chain',\n 'medium' => '1 confirmation on-chain',\n 'low-medium' => '2 confirmations on-chain',\n 'low' => '6 confirmations on-chain',\n ),\n 'default' => 'default',\n 'desc_tip' => true,\n ),\n 'order_states' => array(\n 'type' => 'order_states'\n ),\n 'debug' => array(\n 'title' => __('Debug Log', 'btcpay-for-woocommerce'),\n 'type' => 'checkbox',\n 'label' => sprintf(__('Enable logging <a href=\"%s\" class=\"button\">View Logs</a>', 'btcpay-for-woocommerce'), $logs_href),\n 'default' => 'no',\n 'description' => sprintf(__('Log BTCPay events, such as IPN requests, inside <code>%s</code>', 'btcpay-for-woocommerce'), wc_get_log_file_path('btcpay')),\n 'desc_tip' => true,\n ),\n 'notification_url' => array(\n 'title' => __('Notification URL', 'btcpay-for-woocommerce'),\n 'type' => 'url',\n 'description' => __('BTCPay will send IPNs for orders to this URL with the BTCPay invoice data', 'btcpay-for-woocommerce'),\n 'default' => '',\n 'placeholder' => WC()->api_request_url('WC_Gateway_BtcPay'),\n 'desc_tip' => true,\n ),\n 'redirect_url' => array(\n 'title' => __('Redirect URL', 'btcpay-for-woocommerce'),\n 'type' => 'url',\n 'description' => __('After paying the BTCPay invoice, users will be redirected back to this URL', 'btcpay-for-woocommerce'),\n 'default' => '',\n 'placeholder' => $this->get_return_url(),\n 'desc_tip' => true,\n ),\n 'additional_tokens' => array(\n 'title' => __('Additional token configuration', 'btcpay-for-woocommerce'),\n 'type' => 'textarea',\n 'description' => __('You can configure additional tokens here, one per line. e.g. \"HAT;Hat Token;promotion\" See documentation for details. Each one will be available as their own payment method.', 'btcpay-for-woocommerce'),\n 'default' => '',\n 'desc_tip' => true,\n ),\n\t\t\t 'additional_tokens_limit_payment' => array(\n\t\t\t\t\t'title' => __('Additional tokens: Enforce payment tokens', 'btcpay-for-woocommerce'),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'label' => __('Limit default payment methods to listed \"payment\" tokens.', 'btcpay-for-woocommerce'),\n\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t'value' => 'yes',\n\t\t\t\t\t'description' => __('This will override the default btcpay payment method (defaults to all supported by BTCPay Server) and enforce to tokens of type \"payment\". This is useful if you want full control on what is available on BTCPay Server payment page.', 'btcpay-for-woocommerce'),\n\t\t\t\t\t'desc_tip' => true,\n\t\t\t ),\n 'support_details' => array(\n 'title' => __( 'Plugin & Support Information', 'btcpay' ),\n 'type' => 'title',\n 'description' => sprintf(__('This plugin version is %s and your PHP version is %s. If you need assistance, please come on our chat https://chat.btcpayserver.org. Thank you for using BTCPay!', 'btcpay-for-woocommerce'), constant(\"BTCPAY_VERSION\"), PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION),\n ),\n );\n\n $this->log(' [Info] Initialized form fields: ' . var_export($this->form_fields, true));\n $this->log(' [Info] Leaving init_form_fields()...');\n }", "protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }", "public function init()\n {\n \n $control_decorator = Application_Form_Helper::$control_decorator;\n $btn_decorator = Application_Form_Helper::$btn_decorator;\n \n $body = new Zend_Form_Element_Textarea('body');\n $body->setLabel('Comment')\n ->addFilter(new Zend_Filter_StripTags)\n ->setRequired()\n ->setDescription('Write a comment')\n ->setDecorators($control_decorator)\n ->setAttrib('class', 'form-control');\n \n $submit = new Zend_Form_Element_Submit('submit');\n $submit->setAttrib('class', 'btn btn-primary pull-right')\n ->setDecorators($btn_decorator)\n ->setLabel('Send');\n \n $this->addElements(array($body,$submit));\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 }", "function prepareTemplateVars() {\n\t\t$calcModel = KenedoModel::getModel('ConfigboxModelAdmincalculations');\n\t\t$this->calculations = $calcModel->getRecords(array('admincalculations.product_id'=>$this->productId));\n\n\t\t$this->addViewCssClasses();\n\n\t}", "private function _initAddAccountPageDynamicData()\n {\n $this->_loadSepaCountryFields();\n $this->_loadNonSepaCountryFields();\n $this->_loadLocalizedCountryFields(); //loaded in the end to override any prior functions definitions\n $this->_loadOtherCountryFields();\n $this->_addAccountfields['others'] = ['account_name', 'bank_name', 'swift_code', 'branch_address', 'account_number'];\n\n $this->_loadAccountNumberRules();\n $this->_groupFieldCountries();\n }", "function BeforeShowAdd(&$xt, &$templatefile, &$pageObject)\n{\n\n\t\t$att = $xt->fetchVar(\"Approved_editcontrol\");\n$att = str_replace(\">\",\" DISABLED=DISABLED>\",$att);\n$xt->assign(\"Approved_editcontrol\",$att);\n\n\n$attz = $xt->fetchVar(\"Approvedby_editcontrol\");\n$attz = str_replace(\">\",\" DISABLED=DISABLED>\",$attz);\n$xt->assign(\"Approvedby_editcontrol\",$attz);\n\n$at1 = $xt->fetchVar(\"EmployeeID_editcontrol\");\n$at1 = str_replace(\">\",\" DISABLED=DISABLED>\",$at1);\n$xt->assign(\"EmployeeID_editcontrol\",$at1);\n\n\n$at3 = $xt->fetchVar(\"Locked_editcontrol\");\n$at3 = str_replace(\">\",\" DISABLED=DISABLED>\",$at3);\n$xt->assign(\"Locked_editcontrol\",$at3);\n\n$at4 = $xt->fetchVar(\"Posted_editcontrol\");\n$at4 = str_replace(\">\",\" DISABLED=DISABLED>\",$at4);\n$xt->assign(\"Posted_editcontrol\",$at4);\n\n\n $attr = $xt->fetchVar(\"Superior_editcontrol\");\n $attr = str_replace(\">\",\" READONLY=READONLY>\",$attr);\n $xt->assign(\"Superior_editcontrol\",$attr);\n\n $att5 = $xt->fetchVar(\"Superior2_editcontrol\");\n $att5 = str_replace(\">\",\" READONLY=READONLY>\",$att5);\n $xt->assign(\"Superior2_editcontrol\",$att5);\n\n\n $att6 = $xt->fetchVar(\"1stApproval_editcontrol\");\n $att6 = str_replace(\">\",\" READONLY=READONLY>\",$att6);\n $xt->assign(\"1stApproval_editcontrol\",$att6);\n\n $att7 = $xt->fetchVar(\"2ndApproval_editcontrol\");\n $att7 = str_replace(\">\",\" READONLY=READONLY>\",$att7);\n $xt->assign(\"2ndApproval_editcontrol\",$att7);\n\n\n\n\n\n\n\n;\t\t\n}", "public function beforeSendToClient($cname)\n\t{\n\t\t$form_name = self::form_name($cname, $this->id);\n\n\t\tif (($templated_path = self::templateImagePath($this->attrs['image_path'])) != $this->attrs['image_path'])\n\t\t{\n\t\t\tself::setElementAttribute($form_name, 'image_path', $this->attrs['image_path'] = $templated_path);\n\t\t\t//error_log(__METHOD__.\"() setting templated image-path for $form_name: $templated_path\");\n\t\t}\n\n\t\tif (!is_array(self::$request->sel_options[$form_name])) self::$request->sel_options[$form_name] = array();\n\t\tif ($this->attrs['type'])\n\t\t{\n\t\t\t// += to keep further options set by app code\n\t\t\tself::$request->sel_options[$form_name] += self::typeOptions($this->attrs['type'], $this->attrs['options'],\n\t\t\t\t$no_lang=null, $this->attrs['readonly'], self::get_array(self::$request->content, $form_name));\n\n\t\t\t// if no_lang was modified, forward modification to the client\n\t\t\tif ($no_lang != $this->attr['no_lang'])\n\t\t\t{\n\t\t\t\tself::setElementAttribute($form_name, 'no_lang', $no_lang);\n\t\t\t}\n\t\t}\n\n\t\t// Make sure &nbsp;s, etc. are properly encoded when sent, and not double-encoded\n\t\tforeach(self::$request->sel_options[$form_name] as &$label)\n\t\t{\n\t\t\tif(!is_array($label))\n\t\t\t{\n\t\t\t\t$label = html_entity_decode($label, ENT_NOQUOTES,'utf-8');\n\t\t\t}\n\t\t\telseif($label['label'])\n\t\t\t{\n\t\t\t\t$label['label'] = html_entity_decode($label['label'], ENT_NOQUOTES,'utf-8');\n\t\t\t}\n\t\t}\n\n\t}", "public function init() {\n $dcpr_id_processo_digital = new Zend_Form_Element_Hidden('DCPR_ID_PROCESSO_DIGITAL');\n $dcpr_id_processo_digital->setRequired(true)\n ->addValidator('StringLength', false, array(0, 5));\n\n $dcpr_id_documento = new Zend_Form_Element_Hidden('DCPR_ID_DOCUMENTO');\n $dcpr_id_documento->setRequired(true)\n ->addValidator('StringLength', false, array(0, 20));\n\n $dcpr_id_tp_vinculacao = new Zend_Form_Element_Select('DCPR_ID_TP_VINCULACAO');\n $dcpr_id_tp_vinculacao->setRequired(true)\n ->setLabel('Selecione o tipo de juntada:');\n\n $dcpr_dh_vinculacao_doc = new Zend_Form_Element_Text('DCPR_DH_VINCULACAO_DOC');\n $dcpr_dh_vinculacao_doc->setRequired(true)\n ->setLabel('Data e Hora da juntada:');\n\n $dcpr_ic_ativo = new Zend_Form_Element_Checkbox('DCPR_IC_ATIVO');\n $dcpr_ic_ativo->setRequired(true)\n ->setLabel('Ativo:')\n ->setOptions(array('S' => 'Sim', 'N' => 'Não'))\n ->setCheckedValue('S')\n ->setUncheckedValue('N');\n\n $this->addElements(array($dcpr_id_processo_digital\n , $dcpr_id_documento\n , $dcpr_id_tp_vinculacao\n , $dcpr_dh_vinculacao_doc\n , $dcpr_ic_ativo));\n }", "protected function prepareForValidation()\n {\n \n //Filling uncaught parameters to blank default value\n foreach($this->columns_rules as $column => $rules){\n if(empty($this->get($column))) {\n $this->request->add([$column => '']); \n }\n }\n\n }", "function createFieldForm($arrLang)\n{\n\n $arrFields = array(\"conference_name\" => array(\"LABEL\" => $arrLang['Conference Name'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:300px;\"),\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_owner\" => array(\"LABEL\" => $arrLang['Conference Owner'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_number\" => array(\"LABEL\" => $arrLang['Conference Number'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_pin\" => array(\"LABEL\" => $arrLang['Moderator PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_1\" => array(\"LABEL\" => $arrLang['Moderator Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_pin\" => array(\"LABEL\" => $arrLang['User PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_1\" => array(\"LABEL\" => $arrLang['User Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_3\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"start_time\" => array(\"LABEL\" => $arrLang['Start Time (PST/PDT)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"DATE\",\n \"INPUT_EXTRA_PARAM\" => array(\"TIME\" => true, \"FORMAT\" => \"%Y-%m-%d %H:%M\",\"TIMEFORMAT\" => \"12\"),\n \"VALIDATION_TYPE\" => \"ereg\",\n \"VALIDATION_EXTRA_PARAM\" => \"^(([1-2][0,9][0-9][0-9])-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))) (([0-1][0-9]|2[0-3]):[0-5][0-9])$\"),\n \"duration\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"duration_min\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n/*\n \"recurs\" => array(\"LABEL\" => $arrLang['Recurs'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"reoccurs_period\" => array(\"LABEL\" => $arrLang[\"Reoccurs\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_period,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n \"reoccurs_days\" => array(\"LABEL\" => $arrLang[\"for\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_days,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n*/\n \"max_participants\" => array(\"LABEL\" => $arrLang['Max Participants'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:50px;\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n );\n return $arrFields;\n}", "public function prepareFieldset();", "private function initMailOptionsForm()\n\t{\n\t\tglobal $ilCtrl, $ilSetting, $lng, $ilUser;\t\n\t\t\n\t\tinclude_once 'Services/Form/classes/class.ilPropertyFormGUI.php';\n\t\t$this->form = new ilPropertyFormGUI();\n\t\t\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));\n\t\t$this->form->setTitle($lng->txt('mail_settings'));\n\t\t\t\n\t\t// BEGIN INCOMING\n\t\tinclude_once 'Services/Mail/classes/class.ilMailOptions.php';\n\t\tif($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')\n\t\t{\n\t\t\t$options = array(\n\t\t\t\tIL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'), \n\t\t\t\tIL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),\n\t\t\t\tIL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')\n\t\t\t);\n\t\t\t$si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');\n\t\t\t$si->setOptions($options);\n\t\t\tif(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||\n\t\t\t $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')\n\t\t\t{\n\t\t\t\t$si->setDisabled(true);\t\n\t\t\t}\n\t\t\t$this->form->addItem($si);\n\t\t}\n\t\t\n\t\t// BEGIN LINEBREAK_OPTIONS\n\t\t$options = array();\n\t\tfor($i = 50; $i <= 80; $i++)\n\t\t{\n\t\t\t$options[$i] = $i; \n\t\t}\t\n\t\t$si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');\n\t\t$si->setOptions($options);\t\t\t\n\t\t$this->form->addItem($si);\n\t\t\n\t\t// BEGIN SIGNATURE\n\t\t$ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');\n\t\t$ta->setRows(10);\n\t\t$ta->setCols(60);\t\t\t\n\t\t$this->form->addItem($ta);\n\t\t\n\t\t// BEGIN CRONJOB NOTIFICATION\n\t\tif($ilSetting->get('mail_notification'))\n\t\t{\n\t\t\t$cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');\t\t\t\n\t\t\t$cb->setInfo($lng->txt('mail_cronjob_notification_info'));\n\t\t\t$cb->setValue(1);\n\t\t\t$this->form->addItem($cb);\n\t\t}\t\t\n\t\t\n\t\t$this->form->addCommandButton('saveMailOptions', $lng->txt('save'));\n\t}", "public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.\"DisplayName\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['MerchantId'] = array(\"name\" => GetLang($this->_languagePrefix.\"MerchantId\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'MerchantIdHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['MerchantEmail'] = array(\"name\" => GetLang($this->_languagePrefix.\"MerchantEmail\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'MerchantEmailHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['CallbackId'] = array(\"name\" => GetLang($this->_languagePrefix.\"CallbackId\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'CallbackIdHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['SecretWord'] = array(\"name\" => GetLang($this->_languagePrefix.\"SecretWord\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SecretWordHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}" ]
[ "0.6435319", "0.5890746", "0.57895124", "0.575633", "0.5721004", "0.56931305", "0.5650958", "0.56425107", "0.56009173", "0.5596319", "0.5580474", "0.5560698", "0.55598474", "0.55520916", "0.55364007", "0.55305016", "0.55261236", "0.55088216", "0.5484315", "0.5448508", "0.54434055", "0.5406592", "0.5319136", "0.5312322", "0.53102374", "0.5302933", "0.5280859", "0.5276606", "0.52712923", "0.5243951", "0.52263206", "0.52261466", "0.5222673", "0.5221781", "0.52190965", "0.5215818", "0.5215122", "0.520834", "0.5198094", "0.51977766", "0.5194369", "0.5183361", "0.5182847", "0.51802534", "0.5179101", "0.5151609", "0.51481134", "0.5145305", "0.5142281", "0.5141854", "0.51220876", "0.5118419", "0.51146406", "0.5107736", "0.5102242", "0.5099542", "0.50921786", "0.50901914", "0.5089809", "0.50726354", "0.5068581", "0.50650734", "0.5064813", "0.5063841", "0.5061427", "0.5057528", "0.505178", "0.50513464", "0.5046409", "0.50394917", "0.50362396", "0.50350416", "0.5034135", "0.50268143", "0.5026198", "0.50226927", "0.5020164", "0.5016609", "0.50094974", "0.5008709", "0.5007227", "0.50027746", "0.49992028", "0.49987394", "0.49953878", "0.49900603", "0.49804926", "0.4979717", "0.49787295", "0.49750412", "0.49709645", "0.49690953", "0.4967214", "0.49668792", "0.4950734", "0.49497145", "0.4948079", "0.49478376", "0.49473864", "0.49436164" ]
0.7891424
0
Extract inline edited post field from inline_edit_list[]
static function get_edited_inline_post_field($inline_edit_list, $field_type, $post_id) { foreach ($inline_edit_list as $edit) { if ($edit['type'] == $field_type && $edit['post_id'] == $post_id) { return $edit['content']; } } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function is_post_field_edited_inline($inline_edit_list, $field_type, $post_id) {\n foreach ($inline_edit_list as $edit) {\n if ($edit['type'] == $field_type && $edit['post_id'] == $post_id) {\n return true;\n }\n }\n\n return false;\n }", "function media_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function media_post_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function get_attachment_fields_to_edit($post, $errors = \\null)\n {\n }", "public function inline_edit()\n {\n }", "public function inline_edit()\n {\n }", "function image_attachment_fields_to_edit($form_fields, $post)\n {\n }", "public function get_editentries() {\n return $this->_editentries;\n }", "function get_inline_data($post)\n {\n }", "function get_post_to_edit($id)\n {\n }", "public static function get_input_fields() {\n\t\treturn array_merge(\n\t\t\tMediaItemCreate::get_input_fields(),\n\t\t\t[\n\t\t\t\t'id' => [\n\t\t\t\t\t'type' => [\n\t\t\t\t\t\t'non_null' => 'ID',\n\t\t\t\t\t],\n\t\t\t\t\t// translators: the placeholder is the name of the type of post object being updated\n\t\t\t\t\t'description' => sprintf( __( 'The ID of the %1$s object', 'wp-graphql' ), get_post_type_object( 'attachment' )->graphql_single_name ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t}", "function wp_idolondemand_edit_post()\n{\n}", "public function register_edit_fields( $fields, $post ) {\n\t\tforeach ( $this->attachment_fields as $field ) {\n\t\t\t$fid = $field['id'];\n\t\t\t$value = get_post_meta( $post->ID, $fid, true );\n\t\t\t$fields[ $fid ] = array(\n\t\t\t\t'show_in_rest' => true,\n\t\t\t\t'label' => $field['label'],\n\t\t\t\t'input' => $field['input'],\n\t\t\t\t'value' => $value,\n\t\t\t\t'helps' => $field['helps'],\n\t\t\t);\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function getEditFields(): array\n\t{\n\t\t$fields = [];\n\t\t$editFields = ['name'];\n\t\t$editFields[] = 'icon';\n\t\tif ($this->fieldModel->getModule()->isEntityModule()) {\n\t\t\tif (!$this->getId()) {\n\t\t\t\t$editFields[] = 'roles';\n\t\t\t}\n\t\t\t$editFields[] = 'description';\n\t\t\t$editFields[] = 'prefix';\n\t\t\tif ($this->fieldModel->getFieldParams()['isProcessStatusField'] ?? false) {\n\t\t\t\tif (\\App\\Db::getInstance()->getTableSchema($this->getTableName())->getColumn('time_counting')) {\n\t\t\t\t\t$editFields[] = 'time_counting';\n\t\t\t\t}\n\t\t\t\t$editFields[] = 'record_state';\n\t\t\t}\n\t\t\tif (15 === $this->fieldModel->getUIType()) {\n\t\t\t\t$editFields[] = 'close_state';\n\t\t\t}\n\t\t}\n\n\t\tforeach ($editFields as $fieldName) {\n\t\t\t$propertyModel = $this->getFieldInstanceByName($fieldName);\n\t\t\tif (null !== $this->get($fieldName)) {\n\t\t\t\t$propertyModel->set('fieldvalue', $this->get($fieldName));\n\t\t\t} elseif (($defaultValue = $propertyModel->get('defaultvalue')) !== null) {\n\t\t\t\t$propertyModel->set('fieldvalue', $defaultValue);\n\t\t\t}\n\t\t\t$fields[$fieldName] = $propertyModel;\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function hook_before_edit(&$arr,$id) {\n\n }", "function wppb_fields_list_update( $meta, $id, $array_after_update, $element_id ){\r\n\tif ( $meta == 'wppb_manage_fields' ){\r\n\t\t$all_fields = get_option ( $meta );\r\n\t\t$array_before_update = $all_fields[$element_id];\r\n\t\t\r\n\t\tif ( ( trim( $array_before_update['field'] ) != trim( $array_after_update['field'] ) ) || ( trim( $array_before_update['field-title'] ) != trim( $array_after_update['field-title'] ) ) ){\r\n\t\t\t$ep_r_posts = get_posts( array( 'posts_per_page' => -1, 'post_status' => apply_filters ( 'wppb_get_ep_r_posts', array( 'publish', 'pending', 'draft', 'future', 'private', 'trash' ) ), 'post_type' => array( 'wppb-epf-cpt', 'wppb-rf-cpt' ) ) );\r\n\t\t\t\r\n\t\t\twppb_check_epf_rf_cptpms_update( $ep_r_posts, 'wppb-rf-cpt', 'wppb_rf_fields', $array_before_update['id'], $array_after_update );\r\n\t\t\twppb_check_epf_rf_cptpms_update( $ep_r_posts, 'wppb-epf-cpt', 'wppb_epf_fields', $array_after_update['id'], $array_after_update );\r\n\t\t}\r\n\t}\r\n}", "function getCustomFields( $entity, $id, $cache_values = true, $editable_by = '' )\n\t{\n\t\tTienda::load( 'TiendaModelEavAttributes', 'models.eavattributes' );\n\t\tTienda::load( 'TiendaHelperEav', 'helpers.eav' );\n\t\t\n\t\t$eavs = TiendaHelperEav::getAttributes( $entity, $id, false, $editable_by );\n\t\t\n\t\t$fields = array( );\n\t\tforeach ( @$eavs as $eav )\n\t\t{\n\t\t\t$key = $eav->eavattribute_alias;\n\n\t\t\t$value = TiendaHelperEav::getAttributeValue( $eav, $entity, $id, false, $cache_values );\n\t\t\t\n\t\t\t$fields[] = array(\n\t\t\t\t'attribute' => $eav, 'value' => $value\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $fields;\n\t}", "function acf_get_field_group_edit_link($post_id)\n{\n}", "function my_attachment_fields_edit($form_fields,$post){\n $html = \"<input type='hidden' name='attachments[\".$post->ID.\"][url]' value=''/>\";\n\n $form_fields['url']['html'] = $html; //Replace html\n $form_fields['url']['label'] = ''; //Remove label\n $form_fields['url']['helps'] ='';//Remove help text\n\n return $form_fields;\n}", "function get_editable_field($role_id,$table)\n {\n // LEFT JOIN TBM_EDITFIELD a ON a.fieldname = b.COLUMN_NAME AND a.role_id = '\".$role_id.\"'\n // WHERE b.TABLE_NAME ='\".$table.\"' \";\n $sql = \" SELECT DISTINCT UPPER(b.COLUMN_NAME) AS fieldname, a.editable FROM INFORMATION_SCHEMA.COLUMNS b\n LEFT JOIN TBM_EDITFIELD a ON a.fieldname = b.COLUMN_NAME AND a.role_id = '\".$role_id.\"'\n WHERE b.TABLE_NAME IN (\".$table.\") \";\n\n Debugbar::info($sql);\n $data = DB::SELECT($sql);\n\n if(!empty($data))\n {\n foreach($data as $k => $v)\n {\n //echo \"1<pre>\"; print_r($v);\n $result[$v->fieldname]= $v->editable;\n }\n }\n\n return $result;\n }", "function acf_preview_value($value, $post_id, $field)\n{\n}", "function attachfield($list, $extra = \"\") {\n\tglobal $isadmin;\n\t$out = \"\";\n\tforeach ($list as $k => $x) {\n\t\tif (!isset($x['imgprev'])) $x['imgprev'] = NULL; // and this, which is only passed on post previews\n\t\t\n\t\tif ($x['is_image']) { // An image\n\t\t\t$thumb = isset($x['imgprev']) ? $x['imgprev'] : attachment_name($x['id'], true);\n\t\t} else { // Not an image\n\t\t\t$thumb = \"images/defaultthumb.png\";\n\t\t}\n\t\t\n\t\t// id 0 is a magic value used for post previews\n\t\t$w = $x['id'] ? 'a' : 'b';\n\t\t\n\t\t$out .= \"\n\t\t<table class='attachment-box'>\n\t\t\t<tr>\n\t\t\t\t<td class='attachment-box-thumb' rowspan='2'>\n\t\t\t\t\t<$w href='download.php?id={$x['id']}{$extra}'><img src='{$thumb}'></$w>\n\t\t\t\t</td>\n\t\t\t\t<td class='attachment-box-text fonts'>\n\t\t\t\t\t<div><$w href='download.php?id={$x['id']}{$extra}'>\".htmlspecialchars($x['filename']).\"</$w></div>\n\t\t\t\t\t<div>Size:<span style='float: right'>\".sizeunits($x['size']).\"</span></div>\n\t\t\t\t\t<div>Views:<span style='float: right'>{$x['views']}</span></div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='attachment-box-controls fonts right'>\n\t\t\t\t\".($isadmin ? \"\n\t\t\t\t\t<a href='admin-attachments.php?id={$x['id']}&r=1&action=edit'>Edit</a> - \n\t\t\t\t\t<a href='admin-attachments.php?id={$x['id']}&r=1&action=delete'>Delete</a>\n\t\t\t\t\" : \"\").\"\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\";\n\t}\n\treturn \"<br/><br/><fieldset><legend>Attachments</legend>{$out}</fieldset>\";\n}", "function get_editor_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T121zN1cd48f4',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_N121z7Ocd48f1',\n\t\t\t'label' => 'Content editor',\n\t\t\t'name' => 'editor',\n\t\t\t'type' => 'wysiwyg',\n\t\t\t'required' => '',\n\t\t\t'tabs' => 'all',\n\t\t\t'toolbar' => 'full',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T421zN1cd48f3',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T4MtzN1cd48f3',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t);\n}", "public function getAddEditFieldInfo($editId=\"\",$defaultArray=array())\n{\n $returnArray=array();\n $table=$this->tableName;\n \n if (isset($this->tableStructure)) {\n $returnArray=$this->tableStructure; \n }\n \n //if editId is set - then get data and put in return array.\n if ($editId !== \"\" || count($defaultArray)) {\n if (count($defaultArray)) {\n $dataRow=$defaultArray; \n }\n else {\n $fieldsToInclude=$this->getFieldsOnTable();\n $fieldList=implode(\",\", $fieldsToInclude);\n $sql=\"select $fieldList from $table where id=$editId\";\n $dataRow=$this->getTableData($sql,true,true);\n } \n //if row returned - then loop thru returnArray and set value. \n if (count($dataRow)) {\n foreach ($returnArray as $index=>$val) {\n $columnName=$returnArray[$index]['columnName'];\n if (isset($dataRow[$columnName]) && $dataRow[$columnName] !== null) {\n $returnArray[$index]['value']=$dataRow[$columnName]; \n }\n }\n } \n }\n \n return $returnArray; \n}", "public function getEditRaw();", "protected function get_edit_media_item_args()\n {\n }", "function get_field_list()\r\n\t{\r\n\t\t$fields = array();\r\n\r\n\t\tif (Authority::can('edit', 'admin/item/definition'))\r\n\t\t{\r\n\t\t\t$id_definition = $this->input->post('id_item_definition');\r\n\r\n\t\t\t$fields = $this->extend_field_model->get_lang_list(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'parent' => 'item',\r\n\t\t\t\t\t'id_parent' => $id_definition\r\n\t\t\t\t),\r\n\t\t\t\tSettings::get_lang('default')\r\n\t\t\t);\r\n\r\n\t\t\t// Set type names\r\n\t\t\tforeach($fields as &$field)\r\n\t\t\t{\r\n\t\t\t\t$field['type_name'] = self::$_TYPE_NAMES[$field['type']];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//\r\n\t\t$this->template['id_item_definition'] = $id_definition;\r\n\t\t$this->template['fields'] = $fields;\r\n\r\n\t\t$this->output('item/definition/fields');\r\n\t}", "public function getEditais()\n {\n return $this->editais;\n }", "function wp_preview_post_fields($fields)\n {\n }", "function attachment_fields_to_edit( $form_fields, $post ) {\n\t\t// Display only for images\n\t\tif ( ! wp_attachment_is_image( $post->ID ) )\n\t\t\treturn $form_fields;\n\n\t\t// Display only for nav menu items\n\t\tif ( 'nav_menu_item' != get_post_type( $post->post_parent ) )\n\t\t\treturn $form_fields;\n\n\t\t// Load translations\n\t\t$this->load_textdomain();\n\n\t\t// Add \"hover\" checkbox\n\t\t$parent_hover_id = get_post_meta( $post->post_parent, '_nmi_hover', true );\n\t\t$is_hover = ( $parent_hover_id == $post->ID ) ? true : false;\n\t\t$is_hover_checked = checked( $is_hover, true, false );\n\n\t\t$form_fields['nmihover'] = array(\n\t\t\t'label' => __( 'Used on hover?', 'nmi' ),\n\t\t\t'input' => 'html',\n\t\t\t'html' => \"<input type='checkbox' class='nmi-hover-checkbox' {$is_hover_checked} name='attachments[{$post->ID}][nmihover]' id='attachments[{$post->ID}][nmihover]' data-parent='{$post->post_parent}' data-checked='{$is_hover}' />\",\n\t\t\t'value' => $is_hover,\n\t\t\t'helps' => __( 'Should this image be used on hover', 'nmi' ),\n\t\t\t'show_in_edit' => false\n\t\t);\n\n\t\t// Add \"active\" checkbox\n\t\t$parent_active_id = get_post_meta( $post->post_parent, '_nmi_active', true );\n\t\t$is_active = ( $parent_active_id == $post->ID ) ? true : false;\n\t\t$is_active_checked = checked( $is_active, true, false );\n\n\t\t$form_fields['nmiactive'] = array(\n\t\t\t'label' => __( 'Used when active?', 'nmi' ),\n\t\t\t'input' => 'html',\n\t\t\t'html' => \"<input type='checkbox' class='nmi-active-checkbox' {$is_active_checked} name='attachments[{$post->ID}][nmiactive]' id='attachments[{$post->ID}][nmiactive]' data-parent='{$post->post_parent}' data-checked='{$is_active}' />\",\n\t\t\t'value' => $is_active,\n\t\t\t'helps' => __( 'Should this image be used when menu item is active', 'nmi' ),\n\t\t\t'show_in_edit' => false\n\t\t);\n\n\t\t// Filter returned HTML output\n\t\treturn apply_filters( 'nmi_attachment_fields_to_edit', $form_fields, $post );\n\t}", "function fed_display_dashboard_edit_post_by_id( $post ) {\n\t$post_table = fed_fetch_rows_by_table( BC_FED_POST_DB );\n\t$post_meta = get_post_meta( $post->ID );\n\t$post_settings = fed_get_post_settings_by_type( $post->post_type );\n\n\t$html = '';\n\t$html .= '\n<div class=\"row\">\n\t<div class=\"col-md-5\">\n\t\t<form method=\"post\"\n\t\t\t class=\"fed_dashboard_show_post_list_request\"\n\t\t\t action=\" ' . admin_url( 'admin-ajax.php?action=fed_dashboard_show_post_list_request' ) . '\">';\n\t$html .= fed_wp_nonce_field( 'fed_dashboard_show_post_list_request', 'fed_dashboard_show_post_list_request', '',\n\t\tfalse );\n\n\t$html .= fed_get_input_details( array(\n\t\t'input_type' => 'hidden',\n\t\t'input_meta' => 'fed_post_type',\n\t\t'user_value' => $post->post_type\n\t) );\n\n\t$html .= '\n\t\t\t<button class=\"btn btn-primary\"\n\t\t\t\t\ttype=\"submit\">\n\t\t\t\t<i class=\"fa fa-mail-reply\"></i>\n\t\t\t\tBack to ' . strtoupper( $post->post_type ) . '\n\t\t\t</button>\n\t\t</form>\n\t</div>\n</div>';\n\n\t$html .= '\n<form method=\"post\"\n\t class=\"fed_dashboard_process_edit_post_request\"\n\t action=\"' . admin_url( 'admin-ajax.php?action=fed_dashboard_process_edit_post_request' ) . '\">';\n\n\t$html .= fed_wp_nonce_field( \"fed_dashboard_process_edit_post_request\", \"fed_dashboard_process_edit_post_request\", true,\n\t\tfalse );\n\n\t$html .= fed_input_box( 'ID', array( 'value' => (int) $post->ID ), 'hidden' );\n\n\t$html .= '\n\t<input type=\"hidden\"\n\t\t name=\"fed_post_type\"\n\t\t value=\"' . $post->post_type . '\">\n\t';\n\n\t$html .= '\n\t<input type=\"hidden\"\n\t\t name=\"post_type\"\n\t\t value=\"' . $post->post_type . '\">\n\t';\n\t/**\n\t * Post Title\n\t */\n\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Title' ) . '</div>\n\t\t\t' . fed_input_box( 'post_title', array(\n\t\t\t'value' => esc_attr( $post->post_title ),\n\t\t\t'placeholder' => 'Post Title'\n\t\t), 'single_line' ) . '\n\t\t</div>\n\n\t</div>\n\t';\n\t/**\n\t * Post Content\n\t */\n\tif ( ! isset( $post_settings['dashboard']['post_content'] ) ) {\n\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Content' ) . '</div>\n\t\t\t' . fed_get_wp_editor( $post->post_content, 'post_content', array(\n\t\t\t\t'quicktags' => true\n\t\t\t) ) . '\n\t\t</div>\n\n\t</div>\n\t';\n\t}\n\t$html .= fed_show_category_tag_post_format( $post, $post_settings );\n\n\t/**\n\t * Featured Image\n\t * _thumbnail_id\n\t */\n\tif ( ! isset( $post_settings['dashboard']['featured_image'] ) ) {\n\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Featured Image' ) . '</div>\n\t\t\t' . fed_input_box( '_thumbnail_id', array( 'value' => (int) $post_meta['_thumbnail_id'][0] ), 'file' ) .\n\t\t '\n\t\t</div>\n\t</div>\n\t';\n\t}\n\n\t/**\n\t * Comment Status\n\t */\n\tif ( ! isset( $post_settings['dashboard']['allow_comments'] ) ) {\n\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Allow Comments' ) . '</div>\n\t\t\t' . fed_input_box( 'comment_status', array(\n\t\t\t\t'default_value' => 'open',\n\t\t\t\t'value' => esc_attr( $post->comment_status ),\n\t\t\t), 'checkbox' ) . '\n\t\t</div>\n\t</div>\n\t';\n\t}\n\t/**\n\t * Extra Fields\n\t */\n\tforeach ( $post_table as $item ) {\n\t\t$temp = $item;\n\t\t$temp['user_value'] = $post_meta[ $item['input_meta'] ][0];\n\t\tif ( $post->post_type === $item['post_type'] ) {\n\t\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-9\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( $item['label_name'] ) . '</div>\n\t\t\t' . fed_get_input_details( $temp ) . '\n\t\t</div>\n\t</div>\n\t';\n\t\t}\n\t}\n\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-3 col-md-offset-4\">\n\t\t\t<button class=\"btn btn-primary\"\n\t\t\t\t\ttype=\"submit\">\n\t\t\t\t<i class=\"fa fa-floppy-o\"></i>\n\t\t\t\t'.__( 'Save', 'frontend-dashboard' ).'\n\t\t\t</button>\n\t\t</div>\n\t</div>\n\t';\n\n\t$html .= '\n</form>';\n\n\treturn $html;\n}", "function get_row_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_5821e71cd49fd',\n\t\t\t'label' => 'Row Type',\n\t\t\t'name' => 'Row_Type_tab_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821e72dd49fe',\n\t\t\t'label' => 'Row type',\n\t\t\t'name' => 'row-type',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'content' => 'Content',\n\t\t\t\t'blog' => 'Blog posts',\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 20\n\t\t\t),\n\t\t\t'default_value' => 'content',\n\t\t),\n\n\t\t// Blog fields\n\t\tarray (\n\t\t\t'key' => $id . '_5821e772d49ff',\n\t\t\t'label' => 'Show posts',\n\t\t\t'name' => 'posts_count',\n\t\t\t'type' => 'number',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e72dd49fe',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'blog',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'default_value' => 1,\n\t\t\t'min' => 1,\n\t\t\t'step' => 1,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 15\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821e332d49aa',\n\t\t\t'label' => 'Style',\n\t\t\t'name' => 'blog-style',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e72dd49fe',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'blog',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'choices' => array( 'style-one' => 'Style one' ),\n\t\t\t'default_value' => 'style-one',\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 15\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821e799d4a00',\n\t\t\t'label' => 'Show Info',\n\t\t\t'name' => 'blog-show',\n\t\t\t'type' => 'checkbox',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e72dd49fe',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'blog',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'image' => 'Thumbnail',\n\t\t\t\t'date' => 'Date',\n\t\t\t\t'excerpt' => 'Excerpt',\n\t\t\t\t'button' => 'Button'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'image',\n\t\t\t),\n\t\t\t'layout' => 'horizontal',\n\t\t\t'toggle' => 0,\n\t\t),\n\n\t\t// Content\n\t\tarray (\n\t\t\t'key' => $id . '_5821f6a6269db',\n\t\t\t'label' => 'Columns',\n\t\t\t'name' => 'columns',\n\t\t\t'type' => 'flexible_content',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e72dd49fe',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'content',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'button_label' => 'Add Column',\n\t\t\t'layouts' => array (\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_21126955f123',\n\t\t\t\t\t'name' => 'contentcard',\n\t\t\t\t\t'label' => 'Content card',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_content_local_field( $id )\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_21126946d214',\n\t\t\t\t\t'name' => 'flexicard',\n\t\t\t\t\t'label' => 'Flexi Card',\n\t\t\t\t\t'display' => 'block',\n\t\t\t\t\t'sub_fields' => get_flexi_local_field( $id )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\n\t\t// Options\n\t\tarray (\n\t\t\t'key' => $id . '_5821e2e1f659b',\n\t\t\t'label' => 'Options',\n\t\t\t'name' => 'taboptions',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_0014mn5CO4n1',\n\t\t\t'label' => 'Columns per line',\n\t\t\t'name' => 'cols-count',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'placeholder' => 'Columns per line',\n\t\t\t'choices' => array(\n\t\t\t\t1 => 'Just one',\n\t\t\t\t2 => 'Two',\n\t\t\t\t3 => 'Three',\n\t\t\t\t4 => 'Four',\n\t\t\t\t5 => 'Five',\n\t\t\t\t6 => 'Six'\n\t\t\t),\n\t\t\t'default_values' => array( 0 => 1 )\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821e6f3d49fc',\n\t\t\t'label' => 'Layout',\n\t\t\t'name' => 'layout',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'grid' => 'Grid',\n\t\t\t\t'carousel' => 'Carousel',\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'grid',\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821e2fcf659c',\n\t\t\t'label' => 'Columns\\' margins',\n\t\t\t'name' => 'cols-margins',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'none' => 'None',\n\t\t\t\t'normal' => 'Normal',\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'none',\n\t\t\t)\n\t\t),\t\t\t\t\t\t\n\t\tarray (\n\t\t\t'key' => $id . '_5821e359f659d',\n\t\t\t'label' => 'Width',\n\t\t\t'name' => 'width',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'full' => 'Full',\n\t\t\t\t'four-five' => '4/5',\n\t\t\t\t'three-four' => '3/4',\n\t\t\t\t'one-two' => '1/2',\n\t\t\t),\n\t\t\t'default_value' => 'full',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821eelementali34',\n\t\t\t'label' => 'Position',\n\t\t\t'name' => 'position',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'center' => 'Center',\n\t\t\t\t'right' => 'Right',\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'center',\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5821e44ff659f',\n\t\t\t'label' => 'Vertical row placement',\n\t\t\t'name' => 'vertical-placement',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'stretch' => 'Stretch',\n\t\t\t\t'top' => 'Top',\n\t\t\t\t'middle' => 'Middle',\n\t\t\t\t'bottom' => 'Bottom',\n\t\t\t),\n\t\t\t'default_value' => array( 'middle' )\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_5c21c44ff659c',\n\t\t\t'label' => 'Columns placement',\n\t\t\t'name' => 'cols-placement',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'stretch' => 'Stretch',\n\t\t\t\t'top' => 'Top',\n\t\t\t\t'middle' => 'Middle',\n\t\t\t\t'bottom' => 'Bottom',\n\t\t\t),\n\t\t\t'default_value' => array( 'middle' )\n\t\t),\t\t\t\t\t\t\t\t\n\t\tarray (\n\t\t\t'key' => $id . '_18212372d49ff',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\n\t\t// Grid settings\n\t\tarray (\n\t\t\t'key' => $id . '_5821E2e1f659b',\n\t\t\t'label' => 'Grid settings',\n\t\t\t'name' => 'tabopt1ons',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'grid'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_cePuha1234',\n\t\t\t'label' => 'Columns align',\n\t\t\t'name' => 'cols-align',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'grid'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'left' => 'Left',\n\t\t\t\t'center' => 'Center',\n\t\t\t\t'right' => 'Right',\n\t\t\t\t'space-around' => 'Space Around',\n\t\t\t\t'space-between' => 'Space Between'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'left',\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_co1231era9ti5od',\n\t\t\t'label' => 'The ratio of rows',\n\t\t\t'name' => 'cols-ratio',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 33\n\t\t\t),\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_0014mn5CO4n1',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => '2',\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'grid'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'equal' => 'Equal width',\n\t\t\t\t'left' => 'Two thirds left',\n\t\t\t\t'right' => 'Two thirds right',\n\t\t\t),\n\t\t\t'default_value' => 'equal',\n\t\t),\n\n\t\t// Carousel settings\n\t\tarray (\n\t\t\t'key' => $id . '_5821Q2e1f659b',\n\t\t\t'label' => 'Carousel settings',\n\t\t\t'name' => 'tabopt2Cans',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top',\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t),\t\t\t\t\t\t\t\t\n\t\tarray (\n\t\t\t'key' => $id . '_1822e772d49ff',\n\t\t\t'label' => 'How many slides to scroll',\n\t\t\t'name' => 'slides_scroll',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'1' => 'One',\n\t\t\t\t'2' => 'Two',\n\t\t\t\t'3' => 'Three',\n\t\t\t\t'4' => 'Four',\n\t\t\t\t'5' => 'Five',\n\t\t\t\t'6' => 'Six',\n\t\t\t),\n\t\t\t'default_value' => '1',\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 33\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_arr28oo659a',\n\t\t\t'label' => 'Show dots?',\n\t\t\t'name' => 'show_dots',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'false' => 'None',\n\t\t\t\t'true' => 'Yes, show'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'false',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_arr28ff659a',\n\t\t\t'label' => 'Arrows type',\n\t\t\t'name' => 'arrows_type',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'none' => 'None',\n\t\t\t\t'custom' => 'Custom'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'auto',\n\t\t\t),\n\t\t\t'readonly' => 1,\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_arsis1ize9a',\n\t\t\t'label' => 'Arrows size',\n\t\t\t'name' => 'arrows_size',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_arr28ff659a',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33',\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'small' => 'Small',\n\t\t\t\t'medium' => 'Medium',\n\t\t\t\t'large' => 'Large'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'medium',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_arrwe09a',\n\t\t\t'label' => 'Arrows weight',\n\t\t\t'name' => 'arrows_weight',\n\t\t\t'type' => 'select',\n\t\t\t'instructions' => '',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_arr28ff659a',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'thin' => 'Thin',\n\t\t\t\t'normal' => 'Normal',\n\t\t\t\t'bold' => 'Bold'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'normal',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_1olor9azza',\n\t\t\t'label' => 'Arrows Position',\n\t\t\t'name' => 'arrows_position',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_arr28ff659a',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'choices' => array (\n\t\t\t\t'within' => 'Within Row',\n\t\t\t\t'out' => 'Out of Row'\n\t\t\t),\n\t\t\t'default_value' => array (\n\t\t\t\t0 => 'within',\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_lor8a49e2',\n\t\t\t'label' => 'Arrows Color',\n\t\t\t'name' => 'arrows_color',\n\t\t\t'type' => 'rgba_color',\n\t\t\t'required' => 0,\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_5821e6f3d49fc',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'carousel'\n\t\t\t\t\t),\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_arr28ff659a',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'custom'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t),\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '33'\n\t\t\t),\n\t\t\t'rgba' => 'rgba(255,255,255,1)',\n\t\t\t'return_value' => 0\n\t\t),\n\n\n\t\tarray (\n\t\t\t'key' => $id . '_4821d6ba6de39',\n\t\t\t'label' => 'Background',\n\t\t\t'name' => 'Background_Options_0',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_4821t6ba6ze48',\n\t\t\t'label' => 'Background',\n\t\t\t'name' => 'background',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'bgrd_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t),\n\t);\n}", "public function get_media_edit_input()\n {\n }", "public function getEditableFields() {\n\t\t$fieldsList = array(\n\t\t\tarray('name' => 'presence',\t\t\t'label' => 'Presence',\t\t\t'type' => 'radio'),\n\t\t);\n\n\t\t$fieldModelsList = array();\n\t\tforeach ($fieldsList as $fieldInfo) {\n\t\t\t$fieldModelsList[$fieldInfo['name']] = Settings_Joomlahosts_Field_Model::getInstanceByRow($fieldInfo);\n\t\t}\n\t\treturn $fieldModelsList;\n\t}", "public function get_custom_fields_for_list( $list_id ) {\n\n\t\t$extract = array();\n\n\t\tif ( empty( $list_id ) ) {\n\t\t\treturn $extract;\n\t\t}\n\n\t\t// Needed custom fields type\n\t\t$allowed_types = array(\n\t\t\t'text',\n\t\t\t'url',\n\t\t);\n\t\t$custom_fields = $this->getCustomFields( $list_id );\n\n\t\tif ( is_array( $custom_fields ) ) {\n\t\t\tforeach ( $custom_fields as $field ) {\n\t\t\t\t$field = (object) $field; // just making sure we work with objects [APIs can change the structure]\n\n\t\t\t\tif ( ! empty( $field->type ) && 1 === (int) $field->public && in_array( $field->type, $allowed_types, true ) ) {\n\t\t\t\t\t$extract[] = $this->normalize_custom_field( $field );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $extract;\n\t}", "function save_admin_fields( $post_id, $post ){\r\n\r\n\t\t// Handle featured image being added/removed from admin\r\n\t\t$fi_id = get_post_thumbnail_id( $post_id );\r\n\t\tif ( $fi_id ) {\r\n\t\t\t$fi_url = wp_get_attachment_url( $fi_id );\r\n\t\t\tupdate_post_meta( $post_id, '_featured_image', $fi_url );\r\n\t\t} else {\r\n\t\t\tdelete_post_thumbnail( $post_id );\r\n\t\t\tdelete_post_meta( $post_id, '_featured_image' );\r\n\t\t}\r\n\r\n\t\treturn $post_id;\r\n\r\n\t}", "function edit_form_image_editor($post)\n {\n }", "public function attachment_fields_to_edit( $form_fields, $post ) {\n\t\t$form_fields['pm_attachment_credit'] = array(\n\t\t 'label' => 'Credit',\n\t\t\t'input' => 'text',\n\t\t 'value' => get_post_meta( $post->ID, '_pm_attachment_credit', true )\n\t\t);\n\n\t\treturn $form_fields;\n\t}", "public function getEditableField()\n {\n return $this->Parent()->Parent()->Fields()->filter([\n 'Name' => $this->Name\n ])->First();\n }", "function get_edit_post_link($post = 0, $context = 'display')\n {\n }", "function bulk_edit_posts($post_data = \\null)\n {\n }", "function get_icons_list_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T9X5HrLiip2h67',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_TRX5HrLiip2h67',\n\t\t\t'label' => 'Icons list',\n\t\t\t'name' => 'icons-list',\n\t\t\t'type' => 'repeater',\n\t\t\t'required' => 0,\n\t\t\t'layout' => 'block',\n\t\t\t'collapsed' => $id . '_A2982bc694Cd62',\n\t\t\t'sub_fields' => array (\n\t\t\t\tarray(\n\t\t\t\t\t'key' => $id . '_A2982bc694Cd61',\n\t\t\t\t\t'name' => 'icon-type',\n\t\t\t\t\t'label' => 'Icon type',\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'choices' => array(\n\t\t\t\t\t\t'checklist' => 'Checklist icon',\n\t\t\t\t\t\t'custom' => 'Custom'\n\t\t\t\t\t),\n\t\t\t\t\t'default_value' => 'checklist',\n\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t'width' => 33\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_A2982bc694Cd63',\n\t\t\t\t\t'label' => 'Icon',\n\t\t\t\t\t'name' => 'icon',\n\t\t\t\t\t'type' => 'font-awesome',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t'width' => '33',\n\t\t\t\t\t),\n\t\t\t\t\t'save_format' => 'class',\n\t\t\t\t\t'conditional_logic' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'field' => $id . '_A2982bc694Cd61',\n\t\t\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t\t\t'value' => 'custom'\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'fa_live_preview' => false\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_A2981bc664cd61',\n\t\t\t\t\t'label' => 'Icon size',\n\t\t\t\t\t'name' => 'size',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'conditional_logic' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'field' => $id . '_A2982bc694Cd61',\n\t\t\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t\t\t'value' => 'custom'\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'wrapper' => array (\n\t\t\t\t\t\t'width' => '33',\n\t\t\t\t\t),\n\t\t\t\t\t'placeholder' => 'inhreit',\n\t\t\t\t\t'append' => 'px',\n\t\t\t\t\t'step' => 1,\n\t\t\t\t),\n\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_594905dcbef94',\n\t\t\t\t\t'label' => '',\n\t\t\t\t\t'name' => 'separator_1',\n\t\t\t\t\t'type' => 'message',\n\t\t\t\t\t'instructions' => '',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'conditional_logic' => 0,\n\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t'width' => '',\n\t\t\t\t\t\t'class' => '',\n\t\t\t\t\t\t'id' => '',\n\t\t\t\t\t),\n\t\t\t\t\t'message' => '<hr />',\n\t\t\t\t\t'new_lines' => '',\n\t\t\t\t\t'esc_html' => 0,\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_A2982bc694Cd62',\n\t\t\t\t\t'label' => 'Textarea',\n\t\t\t\t\t'name' => 'textarea',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'conditional_logic' => 0,\n\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t'width' => '33',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_A2982bc188C124',\n\t\t\t\t\t'label' => 'Url',\n\t\t\t\t\t'name' => 'url',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'conditional_logic' => 0,\n\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t'width' => '33',\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray (\n\t\t\t\t\t'key' => $id . '_A2981bc664cD50',\n\t\t\t\t\t'label' => 'Font size',\n\t\t\t\t\t'name' => 'font-size',\n\t\t\t\t\t'type' => 'number',\n\t\t\t\t\t'required' => 0,\n\t\t\t\t\t'wrapper' => array (\n\t\t\t\t\t\t'width' => '33',\n\t\t\t\t\t),\n\t\t\t\t\t'placeholder' => '20',\n\t\t\t\t\t'append' => 'px',\n\t\t\t\t\t'step' => 1,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n \n\n\t\tarray (\n\t\t\t'key' => $id . '_T9H5zULiip28f3',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T9HLiiU2ch48f3',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t\tarray(\n\t\t\t'key' => $id . '_A298lbc694Cd94',\n\t\t\t'name' => 'layout',\n\t\t\t'label' => 'Layout',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array(\n\t\t\t\t'cols-1' => 'Single column',\n\t\t\t\t'cols-2' => 'Two columns',\n\t\t\t\t'cols-3' => 'Three columns',\n\t\t\t\t'cols-4' => 'Four columns',\n\t\t\t),\n\t\t\t'default_value' => 'cols-3',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => 25\n\t\t\t)\n\t\t),\n\t\tarray(\n\t\t\t'key' => $id . '_A298lbc694Dc85',\n\t\t\t'name' => 'align',\n\t\t\t'label' => 'Align',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array(\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'center' => 'Center',\n\t\t\t),\n\t\t\t'default_value' => 'auto',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => 25\n\t\t\t),\n\t\t\t'conditional_logic' => array (\n\t\t\t\tarray (\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'field' => $id . '_A298lbc694Cd94',\n\t\t\t\t\t\t'operator' => '==',\n\t\t\t\t\t\t'value' => 'cols-1'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t\tarray(\n\t\t\t'key' => $id . '_A298lbc694Fd76',\n\t\t\t'name' => 'vertical',\n\t\t\t'label' => 'Vertical align',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array(\n\t\t\t\t'baseline' => 'Auto',\n\t\t\t\t'center' => 'Center',\n\t\t\t),\n\t\t\t'default_value' => 'baseline',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => 25\n\t\t\t)\n\t\t),\n\t);\n}", "function manage_wp_posts_using_bulk_quick_edit_save_post( $post_id, $post ) {\n\tif ( empty( $_POST ) )\n\t\treturn $post_id;\n\t\t\n\t// verify quick edit nonce\n\tif ( isset( $_POST[ '_inline_edit' ] ) && ! wp_verify_nonce( $_POST[ '_inline_edit' ], 'inlineeditnonce' ) )\n\t\treturn $post_id;\n\t\t\t\n\t// don't save for autosave\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\treturn $post_id;\n\t\t\n\t// dont save for revisions\n\tif ( isset( $post->post_type ) && $post->post_type == 'revision' )\n\t\treturn $post_id;\n\t\t\n\tswitch( $post->post_type ) {\n\t\n\t\tcase 'movies':\n\t\t\n\t\t\t/**\n\t\t\t * Because this action is run in several places, checking for the array key\n\t\t\t * keeps WordPress from editing data that wasn't in the form, i.e. if you had\n\t\t\t * this post meta on your \"Quick Edit\" but didn't have it on the \"Edit Post\" screen.\n\t\t\t */\n\t\t\t$custom_fields = array( 'release_date', 'coming_soon', 'film_rating' );\n\t\t\t\n\t\t\tforeach( $custom_fields as $field ) {\n\t\t\t\n\t\t\t\tif ( array_key_exists( $field, $_POST ) )\n\t\t\t\t\tupdate_post_meta( $post_id, $field, $_POST[ $field ] );\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t}\n\t\n}", "function affiliatepressx_edit_callback() {\n\t$id = $_POST['id'];\n\t$data = $_POST;\n\n\t// Convert Array To Object\n\t$object = affiliatepressx_array_to_object($data);\n\n\t// Update Option Field:\n\tupdate_option('affiliatepressx_campaign_'. $id, $object);\n\n\t// Show Object For Testing:\n\t// echo $object;\n\t\n}", "public function hook_before_edit(&$postdata,$id) { \n\t //Your code here\n\n\t }", "public function hook_before_edit(&$postdata,$id) { \n\t //Your code here\n\n\t }", "public function _editField() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$field_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$field_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->get ( ( int ) $field_id );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t\n\t\t$this->setView ( 'edit_field' );\n\t\n\t}", "public function getDetailFieldsInline()\n {\n if ($this->owner->config()->detail_fields_inline) {\n return true;\n }\n \n return Config::inst()->get(static::class, 'default_detail_fields_inline');\n }", "public function get_edit_link() {\n return get_edit_post_link( $this->get_id() );\n }", "function acf_get_field_group_edit_link( $post_id ) {\n\treturn acf_get_internal_post_type_edit_link( $post_id, 'acf-field-group' );\n}", "public function wpe_bsp_inline_post_box( $post ) {\n\t?>\n\t\t<p>Add CSS styles inline for this specific page.</p>\n\t\t<p>\n\t\t<div class=\"css-horizontal\">\n\t\t<div id=\"bsp-css-inline\" style=\"width: 98%;height:300px;border: 1px solid #111;font-size: 16px;font-weight: 400;\"> </div>\t\t\n\t\t<textarea id=\"<?php echo $this->css_inline_key; ?>\" name=\"<?php echo $this->css_inline_key; ?>\" hidden=\"hidden\"><?php\n\t\t echo stripslashes( get_post_meta( get_the_ID(), $this->css_inline_key, true ) ); \n\t\t ?></textarea>\n\t\t</div>\n\t\t<br>\n\t\t</p>\n\t<script>\n\tjQuery( document ).ready(function($) {\n\t\n\t\tace.require(\"ace/ext/language_tools\");\n\t\tvar editor = ace.edit(\"bsp-css-inline\");\n\t\teditor.setTheme(\"ace/theme/custom\");\n\t\teditor.setOptions({\n\t\t\tenableBasicAutocompletion: true,\n\t\t\tenableSnippets: true,\n\t\t\tenableLiveAutocompletion: true\n\t\t});\n\t\teditor.getSession().setMode(\"ace/mode/less\");\n\t\tvar dataTabs = {\n\t\t\tconfig : \"\" \n\t\t};\n\t\tvar textArea = '#<?php echo $this->css_inline_key; ?>';\n\t\teditor.getSession().setValue($(textArea).text());\n\t\teditor.on('change', function() {\n\t\t\t$(textArea).text(editor.getSession().getValue());\n \t\t });\n\t});\n\t</script>\n\t<?php\n\t}", "function gg_save_excerpt_meta( $post_id, $post ) {\n \n if ( ! current_user_can( 'edit_post', $post_id ) ) {\n return $post_id;\n }\n \n if ( ! isset( $_POST['singleExcerpt'] ) || ! wp_verify_nonce( $_POST['single_excerpt'], basename(__FILE__) ) ) {\n return $post_id;\n }\n\n $events_meta['singleExcerpt'] = esc_textarea( $_POST['singleExcerpt'] );\n foreach ( $events_meta as $key => $value ) :\n if ( 'revision' === $post->post_type ) {\n return;\n }\n if ( get_post_meta( $post_id, $key, false ) ) {\n update_post_meta( $post_id, $key, $value );\n } else {\n add_post_meta( $post_id, $key, $value);\n }\n if ( ! $value ) {\n delete_post_meta( $post_id, $key );\n }\n endforeach;\n }", "function manage_wp_posts_using_bulk_quick_save_bulk_edit() {\n\t$post_ids = ( isset( $_POST[ 'post_ids' ] ) && !empty( $_POST[ 'post_ids' ] ) ) ? $_POST[ 'post_ids' ] : NULL;\n\t\t\n\t// if we have post IDs\n\tif ( ! empty( $post_ids ) && is_array( $post_ids ) ) {\n\t\n\t\t// get the custom fields\n\t\t$custom_fields = array( 'release_date', 'coming_soon', 'film_rating' );\n\t\t\n\t\tforeach( $custom_fields as $field ) {\n\t\t\t\n\t\t\t// if it has a value, doesn't update if empty on bulk\n\t\t\tif ( isset( $_POST[ $field ] ) && !empty( $_POST[ $field ] ) ) {\n\t\t\t\n\t\t\t\t// update for each post ID\n\t\t\t\tforeach( $post_ids as $post_id ) {\n\t\t\t\t\tupdate_post_meta( $post_id, $field, $_POST[ $field ] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n}", "function add_image_attachment_fields_to_edit( $form_fields, $post ) {\n\n\t// Add a size\n\t$form_fields['size_width'] = array(\n\t\t\"label\" => __(\"Bredde (cm)\"),\n \"input\" => \"html\",\n\t\t\"html\" => \"<input type='number' name='attachments[{$post->ID}][size_width]' id='attachments[{$post->ID}][size_width]' min='0' value='\".get_post_meta($post->ID, '_size_width', true).\"'>\", // this is default if \"input\" is omitted\n\t);\n\n // Add a size\n $form_fields['size_height'] = array(\n \"label\" => __(\"Højde (cm)\"),\n \"input\" => \"html\",\n \"html\" => \"<input type='number' name='attachments[{$post->ID}][size_height]' id='attachments[{$post->ID}][size_height]' min='0' value='\".get_post_meta($post->ID, '_size_height', true).\"'>\",\n );\n\n\treturn $form_fields;\n}", "function wppb_check_epf_rf_cptpms_update( $ep_r_posts, $cpt, $cpt_meta, $internal_id, $array_after_update ){\r\n\tforeach ( $ep_r_posts as $key => $value ){\r\n\t\tif ( $value->post_type == $cpt ){\r\n\t\t\t$post_meta = get_post_meta( $value->ID, $cpt_meta, true );\r\n\r\n\t\t\tif ( !empty( $post_meta ) ){\r\n\t\t\t\tforeach ( $post_meta as $this_post_meta_key => $this_post_meta_value ){\r\n\t\t\t\t\tif ( $this_post_meta_value['id'] == $internal_id ){\r\n\t\t\t\t\t\t$post_meta[$this_post_meta_key]['field'] = wppb_field_format( $array_after_update['field-title'], $array_after_update['field'] );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $value->ID, $cpt_meta, $post_meta );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function get_content_testimonial_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T9X5zN1Ad48f9',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_Nj1a271cd48f1',\n\t\t\t'label' => 'Testimonials',\n\t\t\t'name' => 'testimonials',\n\t\t\t'type' => 'post_object',\n\t\t\t'required' => 0,\n\t\t\t'post_type' => array (\n\t\t\t\t'testimonial'\n\t\t\t),\n\t\t\t'multiple' => 1,\n\t\t\t'return_format' => 'object',\n\t\t\t'ui' => 1,\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_T9a3zN1cd48f6',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T9A2zN6cd48f7',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t);\n}", "function metabox_media_highlights($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 $is_media_highlights = sanitize_text_field($_POST['_is_media_highlights']);\n\n update_post_meta($post->ID, '_is_media_highlights', $is_media_highlights);\n\n }", "public function getEditMeta(string $idOrKey, bool $overrideEditableFlag = false, bool $overrideScreenSecurity = false): array\n {\n $queryParam = '?'.http_build_query([\n 'overrideEditableFlag' => $overrideEditableFlag,\n 'overrideScreenSecurity' => $overrideScreenSecurity,\n ]);\n\n $uri = sprintf('%s/%s/editmeta', $this->uri, $idOrKey).$queryParam;\n\n $ret = $this->exec($uri, null);\n\n $metas = json_decode($ret, true);\n\n // extract only custom field(startWith customefield_XXXXX)\n $cfs = array_filter($metas['fields'], function ($key) {\n $pos = strpos($key, 'customfield');\n\n return $pos !== false;\n }, ARRAY_FILTER_USE_KEY);\n\n return $cfs;\n }", "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 get_image_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T721ZN1cd48f3',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_Content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_NImGz71cd48f2',\n\t\t\t'label' => 'Attach image',\n\t\t\t'name' => 'image',\n\t\t\t'type' => 'image',\n\t\t\t'required' => 0,\n\t\t\t'return_format' => 'id',\n\t\t\t'preview_size' => 'rpwe-thumbnail',\n\t\t\t'library' => 'all',\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_T721zN1cd48f3',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T7MtzN1cd48f3',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_NImGz71cd48f3',\n\t\t\t'label' => 'Shape',\n\t\t\t'name' => 'shape',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'circle' => 'Circle',\n\t\t\t\t'square' => 'Square'\n\t\t\t),\n\t\t\t'default_value' => 'auto',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_NImGz71cd48f4',\n\t\t\t'label' => 'Url',\n\t\t\t'name' => 'url',\n\t\t\t'type' => 'text',\n\t\t\t'required' => 0,\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t\t'placeholder' => 'http://example.com',\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_NImGz71cd48f5',\n\t\t\t'label' => 'New window',\n\t\t\t'name' => 'target',\n\t\t\t'type' => 'true_false',\n\t\t\t'required' => '',\n\t\t\t'message' => 'Yes, open there',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25'\n\t\t\t),\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_NImGz71cd48f6',\n\t\t\t'label' => 'Size',\n\t\t\t'name' => 'size',\n\t\t\t'type' => 'number',\n\t\t\t'required' => '',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t\t'default_value' => '100',\n\t\t\t'placeholder' => '100',\n\t\t\t'append' => '%',\n\t\t\t'min' => '1',\n\t\t\t'max' => '100'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_NImGW71cd481w',\n\t\t\t'label' => 'Width',\n\t\t\t'name' => 'width',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'full' => 'Full'\n\t\t\t),\n\t\t\t'default_value' => 'auto',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t),\n\t);\n}", "function wp_parse_id_list($input_list)\n {\n }", "function thd_re_post_meta_box_fields() {\n\t$prefix = 're_';\n\n\t$fields = array(\n\t\tarray( // Post ID select box\n\t\t\t'label'\t=> 'Associated Issue', // <label>\n\t\t\t'id'\t=> $prefix.'assoc_issue_id', // field id and name\n\t\t\t'type'\t=> 'post_list', // type of field\n\t\t\t'post_type' => array('issue') // post types to display, options are prefixed with their post type\n\t\t),\n\t\t\n\t\tarray( // Repeatable & Sortable Text inputs\n\t\t\t'label'\t=> 'References', // <label>\n\t\t\t'desc'\t=> 'Click + to add multiple references', // description\n\t\t\t'id'\t=> $prefix.'repeatable', // field id and name\n\t\t\t'type'\t=> 'repeatable' // type of field\n\t\t),\n\t\t\n\t\tarray( // Single checkbox\n\t\t\t'label'\t=> 'Show Author Bio', // <label>\n\t\t\t'desc'\t=> 'Tick to show author bio', // description\n\t\t\t'id'\t=> $prefix.'show_author', // field id and name\n\t\t\t'type'\t=> 'checkbox' // type of field\n\t\t),\n\t\t\n\t\tarray( // Image ID field\n\t\t\t'label'\t=> 'Author Thumbnail', // <label>\n\t\t\t'desc'\t=> 'Upload author thumbnail image, 100px x 100px', // description\n\t\t\t'id'\t=> $prefix.'author_thumb', // field id and name\n\t\t\t'type'\t=> 'image' // type of field\n\t\t),\n\t\t\n\t\tarray( // Text Input\n\t\t\t'label'\t=> 'Author Name', // <label>\n\t\t\t'desc'\t=> 'Insert author name here', // description\n\t\t\t'id'\t=> $prefix.'author_name', // field id and name\n\t\t\t'type'\t=> 'text' // type of field\n\t\t),\n\t\t\n\t\tarray( // Text Input\n\t\t\t'label'\t=> 'Author Url', // <label>\n\t\t\t'desc'\t=> 'Insert author url here', // description\n\t\t\t'id'\t=> $prefix.'author_url', // field id and name\n\t\t\t'type'\t=> 'text' // type of field\n\t\t),\n\t\t\n\t\tarray( // Textarea\n\t\t\t'label'\t=> 'Author Bio', // <label>\n\t\t\t'desc'\t=> 'A short bio for the author', // description\n\t\t\t'id'\t=> $prefix.'author_bio', // field id and name\n\t\t\t'type'\t=> 'textarea' // type of field\n\t\t)\n\t);\n\n\treturn $fields;\n}", "protected function computeModerationFieldItemList() {\n // Compute the value of the moderation state.\n $index = 0;\n if (!isset($this->list[$index]) || $this->list[$index]->isEmpty()) {\n\n $moderation_state = $this->getModerationStateId();\n // Do not store NULL values in the static cache.\n if ($moderation_state) {\n $this->list[$index] = $this->createItem($index, $moderation_state);\n }\n }\n }", "function acf_get_raw_field($id = 0)\n{\n}", "function wp_preview_post_fields( $fields ) {\n\n\t\t\t// bail early if not previewing a post\n\t\t\tif ( acf_maybe_get_POST( 'wp-preview' ) !== 'dopreview' ) {\n\t\t\t\treturn $fields;\n\t\t\t}\n\n\t\t\t// add to fields if ACF has changed\n\t\t\tif ( acf_maybe_get_POST( '_acf_changed' ) ) {\n\n\t\t\t\t$fields['_acf_changed'] = 'different than 1';\n\n\t\t\t}\n\n\t\t\t// return\n\t\t\treturn $fields;\n\n\t\t}", "function _load_edit_functions(){\r\n\r\n add_action( 'restrict_manage_posts', '_filter_by_page_parent' );\r\n add_action( 'pre_get_posts', '_load_edit_function_query' );\r\n\r\n}", "function acf_get_field_reference($field_name, $post_id)\n{\n}", "public function getMemberFields()\n\t{\n\t\t$this->loadLanguageFile('tl_member');\n\t\t$this->loadDataContainer('tl_member');\n\t\t$extensions = array();\n\t\tforeach ($GLOBALS['TL_DCA']['tl_member']['fields'] as $fieldname => $field)\n\t\t{\n\t\t\tif (is_array($field['eval']) && array_key_exists('feEditable', $field['eval']))\n\t\t\t$extensions[$fieldname] = $field['label'][0];\n\t\t}\n\t\treturn $extensions;\n\t}", "function eman_post_editable( $post )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\n\t// Settings area always editable\n\tif ( emanager_post::is_settings($post) ) return true;\n\n\t$status = emanager_post::status($post, 'slug');\n\n\t// If no status yet or is in draft or revise, it is editable\n\tif ( 'draft' == $status || 'revise' == $status ) return true;\n\n\treturn false;\n}", "function my_acf_prepare_field4( $field ) {\n \n if( isset($_GET['post']) ){\n $post_id = $_GET['post'];\n \n $field['value'] = $post_id->post_parent;\n }\n \n return $field;\n \n}", "public function edit_field_html( array $raw_properties = array() ) {\r\n\t\t\t// {@link bp_the_profile_field_options()}.\r\n\t\t\tif ( isset( $raw_properties['user_id'] ) ) {\r\n\t\t\t\t$user_id = (int) $raw_properties['user_id'];\r\n\t\t\t\tunset( $raw_properties['user_id'] );\r\n\t\t\t} else {\r\n\t\t\t\t$user_id = bp_displayed_user_id();\r\n\t\t\t}\r\n\t\r\n\t\t\t$r = bp_parse_args( $raw_properties, array(\r\n\t\t\t\t'multiple' => 'multiple',\r\n\t\t\t\t'id' => bp_get_the_profile_field_input_name() . '[]',\r\n\t\t\t\t'name' => bp_get_the_profile_field_input_name() . '[]',\r\n\t\t\t) ); \r\n\t\t\t$r['class'] = $r['class'] . ' form-control';\r\n\t\t\t?>\r\n\t\r\n\t\t\t<div class=\"form-group\">\r\n\t\t\t\t<label class=\"control-label col-sm-3\" for=\"<?php bp_the_profile_field_input_name(); ?>[]\"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'firmasite' ); ?><?php endif; ?></label>\r\n\t\t\t\t<div class=\"col-sm-9\">\r\n\t\t\t\t\t<?php do_action( bp_get_the_profile_field_errors_action() ); ?>\r\n\t\t\t\r\n\t\t\t\t\t<select <?php echo $this->get_edit_field_html_elements( $r ); ?>>\r\n\t\t\t\t\t\t<?php bp_the_profile_field_options( array(\r\n\t\t\t\t\t\t\t'user_id' => $user_id\r\n\t\t\t\t\t\t) ); ?>\r\n\t\t\t\t\t</select>\r\n\t\t\t\r\n\t\t\t\t\t<?php if ( ! bp_get_the_profile_field_is_required() ) : ?>\r\n\t\t\t\r\n\t\t\t\t\t\t<a class=\"clear-value\" href=\"javascript:clear( '<?php echo esc_js( bp_get_the_profile_field_input_name() ); ?>[]' );\">\r\n\t\t\t\t\t\t\t<?php esc_html_e( 'Clear', 'firmasite' ); ?>\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\r\n\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t<?php\r\n\t\t}", "function acf_get_field_post($id = 0)\n{\n}", "public function getEditInput();", "function fed_get_admin_up_input_meta( $row ) {\n\t?>\n\t<div class=\"form-group col-md-6\">\n\t\t<label for=\"\"><?php _e( 'Input Meta * [Alpha Numeric and underscore only]', 'frontend-dashboard' ) ?></label>\n\t\t<?php\n\t\tif ( fed_check_field_is_belongs_to_extra( $row['input_meta'] ) ) {\n\t\t\techo fed_input_box( 'input_meta', array(\n\t\t\t\t'class' => 'fed_admin_input_meta form-control',\n\t\t\t\t'value' => $row['input_meta'],\n\t\t\t\t'readonly' => true,\n\t\t\t), 'single_line' );\n\n\t\t\techo fed_input_box( 'fed_extra', array(\n\t\t\t\t'value' => $row['input_meta'],\n\t\t\t), 'hidden' );\n\t\t} else {\n\t\t\techo fed_input_box( 'input_meta', array(\n\t\t\t\t'class' => 'fed_admin_input_meta form-control',\n\t\t\t\t'value' => $row['input_meta']\n\t\t\t), 'single_line' );\n\t\t}\n\t\t?>\n\t</div>\n\t<?php\n}", "public function get_editor_fields() {\n return array('cloudpoodll' => get_string('pluginname', constants::M_COMPONENT));\n }", "function getExtraFieldDataText() {\n\t\t// First we get the list of extra fields and the data\n\t\t// associated to the fields\n\t\t$efs = $this->ArtifactType->getExtraFields();\n\t\t$efd = $this->getExtraFieldData();\n\n\t\t$return = array();\n\n\t\tforeach ($efs as $efid => $ef) {\n\t\t\t$name = $ef[\"field_name\"];\n\t\t\t$type = $ef[\"field_type\"];\n\n\t\t\t// Get the value according to the type\n\t\t\tswitch ($type) {\n\n\t\t\t\t// for these types, the associated value comes straight\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_TEXT:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_RELATION:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_INTEGER:\n\t\t\t\t\tif (isset($efd[$efid])) {\n\t\t\t\t\t\t$value = $efd[$efid];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// the other types have and ID or an array of IDs associated to them\n\t\t\t\tdefault:\n\t\t\t\t\tif (isset($efd[$efid])) {\n\t\t\t\t\t\t$value = $this->ArtifactType->getElementName($efd[$efid]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = 'None';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t$return[$efid] = array(\"name\" => $name, \"value\" => $value, 'type' => $type);\n\t\t}\n\n\t\treturn $return;\n\t}", "public function inline_custom_data(){}", "private function edit(): array {\n return [\n 'title' => $this->t('Edit Team Member'),\n ];\n }", "function acf_get_raw_fields($id = 0)\n{\n}", "private function getPreviewFields() \r\n\t{\r\n\t\t$sql = \"select field1, field2, field3, field4, field5 \r\n\t\t\t\tfrom redcap_ddp_preview_fields where project_id = \" . $this->project_id;\r\n\t\t$q = db_query($sql);\r\n\t\tif (db_num_rows($q)) {\r\n\t\t\t// Remove all blank instances\r\n\t\t\t$preview_fields = db_fetch_assoc($q);\r\n\t\t\tforeach ($preview_fields as $key=>$field) {\r\n\t\t\t\tif ($field == '') unset($preview_fields[$key]);\r\n\t\t\t}\r\n\t\t\treturn array_values($preview_fields);\r\n\t\t} else {\r\n\t\t\treturn array();\r\n\t\t}\r\n\t}", "function get_product_section_local_field( $id = '1234QWERasdf' ) {\n\treturn array(\n\n\t\t// Headline\n\t\tarray (\n\t\t\t'key' => $id . '_N121zN1cd48f3',\n\t\t\t'name' => 'headline',\n\t\t\t'label' => 'Headline',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_headline_local_field( $id ),\n\t\t),\n\n\t\t// Editor\n\t\tarray (\n\t\t\t'key' => $id . '_N121z7Ocd48f2',\n\t\t\t'name' => 'editor',\n\t\t\t'label' => 'Editor',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_editor_local_field( $id ),\n\t\t),\n\n\t\t// Horizontal line\n\t\tarray (\n\t\t\t'key' => $id . '_N1Viz71cHe8f0',\n\t\t\t'name' => 'line',\n\t\t\t'label' => 'Horizontal Line',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_hr_local_field( $id ),\n\t\t),\n\n\t\t// Testimonial\n\t\tarray (\n\t\t\t'key' => $id . '_Nj2j271cd48f0',\n\t\t\t'name' => 'testimonials',\n\t\t\t'label' => 'Testimonials',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_content_testimonial_local_field( $id ),\n\t\t),\n\n\t\t// Gallery\n\t\tarray (\n\t\t\t'key' => $id . '_Nj43251cd48f0',\n\t\t\t'name' => 'gallery',\n\t\t\t'label' => 'Gallery',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_gallery_local_field( $id ),\n\t\t),\n\n\t\t// Image card\n\t\tarray (\n\t\t\t'key' => $id . '_ICD3251cd48f0',\n\t\t\t'name' => 'image-card',\n\t\t\t'label' => 'Image Card',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_image_card_local_field( $id ),\n\t\t),\n\n\t\t// Video\n\t\tarray (\n\t\t\t'key' => $id . '_N1Viz71cd48f0',\n\t\t\t'name' => 'oembed',\n\t\t\t'label' => 'oEmbed Video',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_oembed_local_field( $id ),\n\t\t),\n\n\t\t// Trip details\n\t\tarray (\n\t\t\t'key' => $id . '_DRViip71cd48f0',\n\t\t\t'name' => 'trip-details',\n\t\t\t'label' => 'Trip Details',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_trip_details_local_field( $id ),\n\t\t),\n\n\t\t// Accordion\n\t\tarray (\n\t\t\t'key' => $id . '_HRhiip71cd48f1',\n\t\t\t'name' => 'accordion',\n\t\t\t'label' => 'Accordion',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_accordion_local_field( $id )\n\t\t),\n\n\t\t// Icons list\n\t\tarray (\n\t\t\t'key' => $id . '_HRhiip71cd48f0',\n\t\t\t'name' => 'icons-list',\n\t\t\t'label' => 'Icons list',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_icons_list_local_field( $id ),\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_A2982bc6o4CF73',\n\t\t\t'label' => 'Form',\n\t\t\t'name' => 'form',\n\t\t\t'display' => 'block',\n\t\t\t'sub_fields' => get_gform_local_field( $id )\n\t\t)\n\t);\n}", "function feed_formatter_web_format_feed_item_field($variables) {\r\n $feed_item = $variables['#feed_item'];\r\n $feed_item_field = $variables['#feed_item_field'];\r\n \r\n $content = array();\r\n $content['#title'] = $feed_item_field->name;\r\n $content['feed_item_field_values'] = $variables['#content'];\r\n \r\n return $content;\r\n}", "public function getEditingField(DataObject $wikiPage) {\n\t\treturn MarkItUpField::create('Content', '', 'markdown', 30, 20);\n\t}", "public function getEditSteps()\n {\n return isset($this->source['edit_steps']) ? $this->source['edit_steps'] : [];\n }", "function wp_post_revision_fields( $fields, $post = null ) {\n\n\t\t\t// validate page\n\t\t\tif ( acf_is_screen( 'revision' ) || acf_is_ajax( 'get-revision-diffs' ) ) {\n\n\t\t\t\t// bail early if is restoring\n\t\t\t\tif ( acf_maybe_get_GET( 'action' ) === 'restore' ) {\n\t\t\t\t\treturn $fields;\n\t\t\t\t}\n\n\t\t\t\t// allow\n\n\t\t\t} else {\n\n\t\t\t\t// bail early (most likely saving a post)\n\t\t\t\treturn $fields;\n\n\t\t\t}\n\n\t\t\t// vars\n\t\t\t$append = array();\n\t\t\t$order = array();\n\t\t\t$post_id = acf_maybe_get( $post, 'ID' );\n\n\t\t\t// compatibility with WP < 4.5 (test)\n\t\t\tif ( ! $post_id ) {\n\n\t\t\t\tglobal $post;\n\t\t\t\t$post_id = $post->ID;\n\n\t\t\t}\n\n\t\t\t// get all postmeta\n\t\t\t$meta = get_post_meta( $post_id );\n\n\t\t\t// bail early if no meta\n\t\t\tif ( ! $meta ) {\n\t\t\t\treturn $fields;\n\t\t\t}\n\n\t\t\t// loop\n\t\t\tforeach ( $meta as $name => $value ) {\n\n\t\t\t\t// attempt to find key value\n\t\t\t\t$key = acf_maybe_get( $meta, '_' . $name );\n\n\t\t\t\t// bail early if no key\n\t\t\t\tif ( ! $key ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// update vars\n\t\t\t\t$value = $value[0];\n\t\t\t\t$key = $key[0];\n\n\t\t\t\t// Load field.\n\t\t\t\t$field = acf_get_field( $key );\n\t\t\t\tif ( ! $field ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// get field\n\t\t\t\t$field_title = $field['label'] . ' (' . $name . ')';\n\t\t\t\t$field_order = $field['menu_order'];\n\t\t\t\t$ancestors = acf_get_field_ancestors( $field );\n\n\t\t\t\t// ancestors\n\t\t\t\tif ( ! empty( $ancestors ) ) {\n\n\t\t\t\t\t// vars\n\t\t\t\t\t$count = count( $ancestors );\n\t\t\t\t\t$oldest = acf_get_field( $ancestors[ $count - 1 ] );\n\n\t\t\t\t\t// update vars\n\t\t\t\t\t$field_title = str_repeat( '- ', $count ) . $field_title;\n\t\t\t\t\t$field_order = $oldest['menu_order'] . '.1';\n\n\t\t\t\t}\n\n\t\t\t\t// append\n\t\t\t\t$append[ $name ] = $field_title;\n\t\t\t\t$order[ $name ] = $field_order;\n\n\t\t\t\t// hook into specific revision field filter and return local value\n\t\t\t\tadd_filter( \"_wp_post_revision_field_{$name}\", array( $this, 'wp_post_revision_field' ), 10, 4 );\n\n\t\t\t}\n\n\t\t\t// append\n\t\t\tif ( ! empty( $append ) ) {\n\n\t\t\t\t// vars\n\t\t\t\t$prefix = '_';\n\n\t\t\t\t// add prefix\n\t\t\t\t$append = acf_add_array_key_prefix( $append, $prefix );\n\t\t\t\t$order = acf_add_array_key_prefix( $order, $prefix );\n\n\t\t\t\t// sort by name (orders sub field values correctly)\n\t\t\t\tarray_multisort( $order, $append );\n\n\t\t\t\t// remove prefix\n\t\t\t\t$append = acf_remove_array_key_prefix( $append, $prefix );\n\n\t\t\t\t// append\n\t\t\t\t$fields = $fields + $append;\n\n\t\t\t}\n\n\t\t\t// return\n\t\t\treturn $fields;\n\n\t\t}", "protected function getFieldsFromShowItem() {}", "function save_post_callback($post_id, $post, $update){\n updatePostContentFieldWithACFContentBlocks($post);\n}", "function acf_get_reference($field_name, $post_id)\n{\n}", "public function getCustomFields() {\n return Doctrine::getTable('ArticleCustomFieldValue')->getCustomFields($this);\n }", "function manage_wp_posts_using_bulk_quick_edit_enqueue_admin_scripts() {\n\t//wp_enqueue_script( 'manage-wp-posts-using-bulk-quick-edit', trailingslashit( get_bloginfo( 'stylesheet_directory' ) ) . 'bulk_quick_edit.js', array( 'jquery', 'inline-edit-post' ), '', true );\n\t\n\t// if using code as plugin\n\twp_enqueue_script( 'manage-wp-posts-using-bulk-quick-edit', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'bulk_quick_edit.js', array( 'jquery', 'inline-edit-post' ), '', true );\n\t\n}", "public function getFrontendFields();", "private function extractFields(array $post)\n\t{\n\t\tforeach ($this->rules['fields'] as $field) {\n\t\t\t\t// $post['login']\n\t\t\tif (!isset($post[$field]) || trim($post[$field]) === '') {\n\t\t\t\t$this->fields[$field] = null;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->fields[$field] = htmlspecialchars(trim($post[$field]));\n\t\t}\n\t}", "function get_oembed_local_field( $id = '1234QWERasdf' ) {\n\treturn array (\n\t\tarray (\n\t\t\t'key' => $id . '_T9X1zN1cd48f3',\n\t\t\t'label' => 'Content',\n\t\t\t'name' => 'tab_content',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_N1Viz71cd48f1',\n\t\t\t'label' => 'Video',\n\t\t\t'name' => 'video',\n\t\t\t'type' => 'oembed',\n\t\t\t'required' => ''\n\t\t),\n\n\t\tarray (\n\t\t\t'key' => $id . '_T9X5zN1cd48f3',\n\t\t\t'label' => 'Settings',\n\t\t\t'name' => 'tab_settings',\n\t\t\t'type' => 'tab',\n\t\t\t'required' => 0,\n\t\t\t'placement' => 'top'\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T9X1zN6cd48f3',\n\t\t\t'label' => 'Margins',\n\t\t\t'name' => 'margins',\n\t\t\t'type' => 'clone',\n\t\t\t'required' => 0,\n\t\t\t'clone' => array (\n\t\t\t\t0 => 'marg_59930ca194830',\n\t\t\t),\n\t\t\t'display' => 'group',\n\t\t\t'layout' => 'block',\n\t\t\t'prefix_label' => 0,\n\t\t\t'prefix_name' => 0,\n\t\t\t'wrapper' => array(\n\t\t\t\t'width' => 50\n\t\t\t)\n\t\t),\n\t\tarray (\n\t\t\t'key' => $id . '_T9XSzD1cd47f4',\n\t\t\t'label' => 'Width',\n\t\t\t'name' => 'width',\n\t\t\t'type' => 'select',\n\t\t\t'required' => 0,\n\t\t\t'choices' => array (\n\t\t\t\t'auto' => 'Auto',\n\t\t\t\t'full' => 'Full'\n\t\t\t),\n\t\t\t'default_value' => 'auto',\n\t\t\t'wrapper' => array (\n\t\t\t\t'width' => '25',\n\t\t\t),\n\t\t),\n\t);\n}", "function yz_filter_exported_field_value( $value, $field ) {\n\n if ( ! isset( $field['type'] ) ) {\n return $value;\n }\n\n switch ( $field['type'] ) {\n\n case 'options':\n\n return implode( ', ', $value );\n\n case 'images':\n case 'image':\n\n global $YZ_upload_url;\n\n foreach ( $value as $key => $val ) {\n\n if ( empty( $val ) ) continue;\n\n if ( $key == 'original' ) {\n $key = __( 'Original', 'youzer' );\n } elseif ( $key == 'thumbnail' ) {\n $key = __( 'Thumbnail', 'youzer' );\n }\n\n // Get Url.\n $url = $YZ_upload_url . $val;\n\n // Get Content.\n $content .='<strong>' . $key . '</strong> : <a href=\"' . $url . '\">' . $url . '</a><br>';\n\n }\n\n return $content;\n\n default:\n return $value;\n break;\n }\n\n}", "function wpml_is_original($post_id = 0, $type = 'post_post'){\n global $post, $sitepress;\n \n $output = array();\n \n // use current post if post_id is not provided\n $p_ID = $post_id == 0 ? $post->ID : $post_id;\n \n $el_trid = $sitepress->get_element_trid($p_ID, $type);\n $el_translations = $sitepress->get_element_translations($el_trid, $type);\n \n if(!empty($el_translations)){\n $is_original = FALSE;\n $original_ID = 0;\n foreach($el_translations as $lang => $details){\n if($details->original == 1 && $details->element_id == $p_ID){\n $is_original = TRUE;\n }\n if($details->original == 1){\n $original_ID = $details->element_id;\n }\n }\n $output['is_original'] = $is_original;\n $output['original_ID'] = $original_ID;\n }\nreturn $output;\n}", "public function blockPhotoAdminField(){\n $editableField=new VV_admin_field();\n $editableField->init($this->block->getContent(),\"photo\");\n return $editableField;\n }", "function alter_comment_form_fields($fields){\n \n $fields = array(\n 'author' =>\n '<div class=\"row\"><div class=\"col-md-6 comment-form-author \"><div class=\"action-wrapper\">' . \n '<input id=\"author\" name=\"author\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author'] ) .\n '\" size=\"30\"' . $aria_req . ' />' . \n '<label for=\"author\">' . __( 'Name', 'domainreference' ) . '</label> ' .\n '</div></div>',\n\n 'email' =>\n '<div class=\"col-md-6 comment-form-email\"><div class=\"action-wrapper\">' . \n '<input id=\"email\" name=\"email\" type=\"text\" value=\"' . esc_attr( $commenter['comment_author_email'] ) .\n '\" size=\"30\"' . $aria_req . ' />' . \n '<label for=\"email\">' . __( 'Email', 'domainreference' ) . '</label> ' .\n '</div></div></div>',\n\n 'url' => '',\n );\n\n return $fields;\n}", "function modify_list_row_actions( $actions, $post ) {\n\t\tif ( $post->post_type == BF_Episode::POST_TYPE ) {\n\n\n\t\t\t$status = get_post_meta( $post->ID, Unity3_Audio_Transcription::PM_STATUS, true );\n\t\t\t$has_transcription = $status === 'COMPLETED';\n\t\t\t$visibility = get_post_meta( $post->ID, Unity3_Audio_Transcription::PM_VISIBILITY, true );\n\t\t\t$str_visibility = 'public' === $visibility ? 'Public' : 'Private';\n\n\t\t\t$actions = array(\n\t\t\t\t'transcription' => sprintf( '<a href=\"%1$s\">%2$s</a>',\n\t\t\t\t\t$has_transcription ? esc_url( admin_url('admin.php?page=aht-transcription&aht_post_id=' . $post->ID) ) : '#',\n\t\t\t\t\t( $has_transcription ? ( 'Edit Transcription - ' . $str_visibility ) : 'No Transcription' )\n\t\t\t));\n//\t\t\tunset( $actions['trash'] );\n//\t\t\tunset( $actions['inline hide-if-no-js'] );\n//\t\t\tunset( $actions['view'] );\n\t\t}\n\n\t\treturn $actions;\n\t}", "public function getEdit($data)\n {\n return array(\n 'Currency.name' => array('type' => 'text', 'label' => __(\"Name\")),\n 'Currency.code' => array('type' => 'text', 'label' => __(\"Code\")),\n 'Currency.rate' => array('type' => 'text', 'label' => __(\"Rate\"))\n );\n }", "public function onEditField()\n {\n $name = post('code');\n $selection = FieldManager::findField($name);\n return $this->makePartial('update_field_form', ['selection' => $selection]);\n }" ]
[ "0.70608294", "0.5977684", "0.59186184", "0.5879091", "0.57823694", "0.5780671", "0.56916124", "0.5690589", "0.5638213", "0.55081767", "0.54104", "0.53583044", "0.53208625", "0.530993", "0.52849996", "0.5247236", "0.5229231", "0.52051777", "0.5203668", "0.51988834", "0.5176834", "0.5125731", "0.51240915", "0.51236326", "0.51134366", "0.5036597", "0.49937016", "0.49908313", "0.49714538", "0.4955064", "0.4917798", "0.4872619", "0.4871608", "0.48563704", "0.48559457", "0.48459387", "0.4814383", "0.48132807", "0.48012143", "0.4797604", "0.47937733", "0.47898495", "0.47843337", "0.47820145", "0.47789687", "0.47789687", "0.47760057", "0.4763752", "0.47620898", "0.4743962", "0.47359526", "0.47300395", "0.4716928", "0.47143528", "0.4701965", "0.47018656", "0.4692052", "0.46893364", "0.46789977", "0.4678888", "0.4676631", "0.46719122", "0.46683413", "0.46675545", "0.46607932", "0.4658568", "0.46561545", "0.46544427", "0.4650094", "0.4646759", "0.46406317", "0.46395075", "0.46364307", "0.46342745", "0.46295804", "0.46258444", "0.46229228", "0.46215433", "0.46121588", "0.46100837", "0.46071544", "0.45842734", "0.45842096", "0.45783207", "0.45772758", "0.45744148", "0.45653525", "0.45647404", "0.45568535", "0.45551872", "0.45525572", "0.45473075", "0.45460245", "0.4544968", "0.45443514", "0.45417762", "0.4540994", "0.45374838", "0.4537224", "0.45314676" ]
0.8068537
0
Check if inline_edit_list[] have inline edit field for specific post
static function is_post_field_edited_inline($inline_edit_list, $field_type, $post_id) { foreach ($inline_edit_list as $edit) { if ($edit['type'] == $field_type && $edit['post_id'] == $post_id) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function get_edited_inline_post_field($inline_edit_list, $field_type, $post_id) {\n\n foreach ($inline_edit_list as $edit) {\n if ($edit['type'] == $field_type && $edit['post_id'] == $post_id) {\n return $edit['content'];\n }\n }\n\n return '';\n }", "function eman_post_editable( $post )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\n\t// Settings area always editable\n\tif ( emanager_post::is_settings($post) ) return true;\n\n\t$status = emanager_post::status($post, 'slug');\n\n\t// If no status yet or is in draft or revise, it is editable\n\tif ( 'draft' == $status || 'revise' == $status ) return true;\n\n\treturn false;\n}", "public static function can_edit_posts( $request ) {\n\t\treturn current_user_can( 'edit_post', $request->get_param( 'id' ) );\n\t}", "public function inline_edit()\n {\n }", "public function inline_edit()\n {\n }", "public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function canEditPost(Post $post) {\n return ($this->isAdmin() || ($this->id == $post->getCreatorId()));\n }", "public function isFrontendEditingActive() {}", "public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}", "function eman_can_edit( $post, $user_id=false )\n{\n\t/**\n\t * If you can't view this post, then you can't edit it...\n\t */\n\tif ( ! eman_can_view($post, $user_id) ) return false;\n\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\tif ( ! $user_id ) $user_id = get_current_user_id();\n\t$user = get_user_by('id', $user_id);\n\t$status = emanager_post::status($post, 'slug');\n\t$bic_userlogin = emanager_bic::get_bic($post, 'user_login');\n\n\t/**\n\t * Test if user has capability to edit\n\t */\n\n\t// Issues have different criteria\n\tif ( 'em_issue' == $post->post_type )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) || emanager_post::same_company_as_post($post) || eman_check_role('turner') ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// PCO Request exception for allowances. Allow user to edit if in their court and status is before sent to owner.\n\tif ( 'em_noc' == $post->post_type )\n\t{\n\t\tif (($bic_userlogin === $user->user_login) && in_array($status, array('draft','manager','ready'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (eman_check_role('turner') && in_array($status, array('draft'))) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// If the post is editable\n\tif ( eman_post_editable($post) )\n\t{\n\t\t// Original author\n\t\tif ( emanager_post::is_author($post) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// Same company as original author\n\t\telseif ( emanager_post::same_company_as_post($post) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "public function getDetailFieldsInline()\n {\n if ($this->owner->config()->detail_fields_inline) {\n return true;\n }\n \n return Config::inst()->get(static::class, 'default_detail_fields_inline');\n }", "function can_do_bulkedit() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "function is_edit_page($new_edit = null){\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) return false;\n\n\n if($new_edit == \"edit\")\n return in_array( $pagenow, array( 'post.php', ) );\n elseif($new_edit == \"new\") //check for new post page\n return in_array( $pagenow, array( 'post-new.php' ) );\n else //check for either new or edit\n return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n}", "function is_edit_page($new_edit = null)\n{\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) return false;\n\n\n if ($new_edit == \"edit\")\n return in_array($pagenow, array('post.php',));\n elseif ($new_edit == \"new\") //check for new post page\n return in_array($pagenow, array('post-new.php'));\n else //check for either new or edit\n return in_array($pagenow, array('post.php', 'post-new.php'));\n}", "protected function isFrontendEditActive() {}", "protected function isFrontendEditActive() {}", "protected function canEdit() {}", "function portfolio_web_is_edit_page() {\r\n\t//make sure we are on the backend\r\n\tif ( !is_admin() ){\r\n\t\treturn false;\r\n\t}\r\n\tglobal $pagenow;\r\n\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\r\n}", "function fusion_should_add_fe_edit_link() {\n\tif ( 0 === fusion_library()->get_page_id() || false === fusion_library()->get_page_id() || '0-archive' === fusion_library()->get_page_id() || is_preview_only() ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function inlineImageExists()\n {\n foreach ($this->attachment as $attachment) {\n if ($attachment[6] == 'inline') {\n return true;\n }\n }\n return false;\n }", "public function isEditFormShown() {}", "public function is_inline()\r\n\t{\r\n\t\treturn $this->is_inline;\r\n\t}", "function is_episode_edit_screen()\n{\n $screen = get_current_screen();\n\n return in_array($screen->base, ['edit', 'post']) && $screen->post_type == 'podcast';\n}", "public function isEditable()\n {\n // Need to be able to save the DataObject if this is being called during PublishTargetJob.\n if ($this->owner->getIsPublishJobRunning()) {\n return true;\n }\n\n // Need to be able to save the DataObject if this is being called during UnPublishTargetJob.\n if ($this->owner->getIsUnPublishJobRunning()) {\n return true;\n }\n\n if ($this->owner->config()->get('allow_embargoed_editing')) {\n return true;\n }\n\n if ($this->owner->getIsPublishScheduled()) {\n return false;\n }\n\n $embargoRecordIsEditable = $this->owner->invokeWithExtensions('embargoRecordIsEditable');\n if (in_array(false, $embargoRecordIsEditable)) {\n return false;\n }\n\n return true;\n }", "function media_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function CheckEditListAccess($item=array())\n {\n return $this->CheckShowListAccess();\n }", "private function is_form_has_entry_preview_field( $form_data ) {\n\n\t\tif ( empty( $form_data['fields'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $form_data['fields'] as $field ) {\n\t\t\tif ( ! empty( $field['type'] ) && $field['type'] === $this->type ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function InlineImageExists() {\n\t foreach($this->attachment as $attachment) {\n\t if ($attachment[6] == 'inline') {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function media_post_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "protected function is_edit_page() {\n\t\treturn false;\n\t}", "function metabox_media_highlights($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 $is_media_highlights = sanitize_text_field($_POST['_is_media_highlights']);\n\n update_post_meta($post->ID, '_is_media_highlights', $is_media_highlights);\n\n }", "public function checkInlineFileTypeAccessForFieldFiletypesSetRecordTypeInListReturnsTrue() {}", "public function isEditAction() {}", "public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function can_edit() {\n return true;\n }", "public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}", "function CheckForEditableFields($ScreenName){\n $Screen = &$this->getScreen($ScreenName);\n //$Screen = &$this->Screens[$ScreenName];\n $nEditableFields = 0;\n foreach($Screen->Fields as $sf){\n if ($sf->isEditable()){\n $nEditableFields += 1;\n }\n }\n if ($nEditableFields > 0){\n return true;\n } else {\n return false;\n }\n }", "public function isInline()\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->isInline();\n }\n\n return false;\n }", "function get_attachment_fields_to_edit($post, $errors = \\null)\n {\n }", "public function isInline() : bool\n {\n return $this->getDisposition() == 'inline';\n }", "private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}", "function is_edit_page( $new_edit = null ) {\n\tglobal $pagenow;\n\tif ( !is_admin() ) return false;\n\tif ( $new_edit == \"edit\" )\n\t\treturn in_array( $pagenow, array( 'post.php', ) );\n\telseif ($new_edit == \"new\")\n\t\treturn in_array( $pagenow, array( 'post-new.php' ) );\n\telse\n\t\treturn in_array( $pagenow, array( 'post.php', 'post-new.php' ) );\n}", "function wppb_fields_list_update( $meta, $id, $array_after_update, $element_id ){\r\n\tif ( $meta == 'wppb_manage_fields' ){\r\n\t\t$all_fields = get_option ( $meta );\r\n\t\t$array_before_update = $all_fields[$element_id];\r\n\t\t\r\n\t\tif ( ( trim( $array_before_update['field'] ) != trim( $array_after_update['field'] ) ) || ( trim( $array_before_update['field-title'] ) != trim( $array_after_update['field-title'] ) ) ){\r\n\t\t\t$ep_r_posts = get_posts( array( 'posts_per_page' => -1, 'post_status' => apply_filters ( 'wppb_get_ep_r_posts', array( 'publish', 'pending', 'draft', 'future', 'private', 'trash' ) ), 'post_type' => array( 'wppb-epf-cpt', 'wppb-rf-cpt' ) ) );\r\n\t\t\t\r\n\t\t\twppb_check_epf_rf_cptpms_update( $ep_r_posts, 'wppb-rf-cpt', 'wppb_rf_fields', $array_before_update['id'], $array_after_update );\r\n\t\t\twppb_check_epf_rf_cptpms_update( $ep_r_posts, 'wppb-epf-cpt', 'wppb_epf_fields', $array_after_update['id'], $array_after_update );\r\n\t\t}\r\n\t}\r\n}", "public function canEditCaption()\n {\n return in_array('edit_caption', $this->actions);\n }", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "function _load_edit_functions(){\r\n\r\n add_action( 'restrict_manage_posts', '_filter_by_page_parent' );\r\n add_action( 'pre_get_posts', '_load_edit_function_query' );\r\n\r\n}", "function it_check_save_action( $id, $post_type = 'post', $no_inline_save = true ) {\n // to do anything\n if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n return false;\n }\n\n if ( ! isset( $_POST['post_type'] ) ) {\n return false;\n }\n\n if ( $no_inline_save ) {\n if ( isset( $_POST['action'] ) && ( 'inline-save' == $_POST['action'] ) ) {\n return false;\n }\n }\n\n // Check permissions\n if ( $post_type == $_POST['post_type'] ) {\n\n if ( $post_type == 'page' ) {\n if ( ! current_user_can( 'edit_page', $id ) ) {\n return false;\n }\n } else {\n if ( ! current_user_can( 'edit_post', $id ) ) {\n return false;\n }\n }\n\n } else {\n // it's not our post type, we are good to go.\n return $post_id;\n }\n\n return true;\n\n }", "protected function allowEdit($data = array(), $key = 'a_id')\n\t{\n\t\treturn true;\n\t}", "function CheckEditAccess($item=array())\n {\n return $this->CheckShowAccess($item);\n }", "public function get_editentries() {\n return $this->_editentries;\n }", "function canEditPage(Page $page) {\n return ($this->isAdmin() || ($this->id == $page->getCreatorId()));\n }", "static function has_edit_screen(): bool { return true; }", "public function canEdit()\n {\n return true;\n }", "function attachment_fields_to_edit( $form_fields, $post ) {\n\t\t// Display only for images\n\t\tif ( ! wp_attachment_is_image( $post->ID ) )\n\t\t\treturn $form_fields;\n\n\t\t// Display only for nav menu items\n\t\tif ( 'nav_menu_item' != get_post_type( $post->post_parent ) )\n\t\t\treturn $form_fields;\n\n\t\t// Load translations\n\t\t$this->load_textdomain();\n\n\t\t// Add \"hover\" checkbox\n\t\t$parent_hover_id = get_post_meta( $post->post_parent, '_nmi_hover', true );\n\t\t$is_hover = ( $parent_hover_id == $post->ID ) ? true : false;\n\t\t$is_hover_checked = checked( $is_hover, true, false );\n\n\t\t$form_fields['nmihover'] = array(\n\t\t\t'label' => __( 'Used on hover?', 'nmi' ),\n\t\t\t'input' => 'html',\n\t\t\t'html' => \"<input type='checkbox' class='nmi-hover-checkbox' {$is_hover_checked} name='attachments[{$post->ID}][nmihover]' id='attachments[{$post->ID}][nmihover]' data-parent='{$post->post_parent}' data-checked='{$is_hover}' />\",\n\t\t\t'value' => $is_hover,\n\t\t\t'helps' => __( 'Should this image be used on hover', 'nmi' ),\n\t\t\t'show_in_edit' => false\n\t\t);\n\n\t\t// Add \"active\" checkbox\n\t\t$parent_active_id = get_post_meta( $post->post_parent, '_nmi_active', true );\n\t\t$is_active = ( $parent_active_id == $post->ID ) ? true : false;\n\t\t$is_active_checked = checked( $is_active, true, false );\n\n\t\t$form_fields['nmiactive'] = array(\n\t\t\t'label' => __( 'Used when active?', 'nmi' ),\n\t\t\t'input' => 'html',\n\t\t\t'html' => \"<input type='checkbox' class='nmi-active-checkbox' {$is_active_checked} name='attachments[{$post->ID}][nmiactive]' id='attachments[{$post->ID}][nmiactive]' data-parent='{$post->post_parent}' data-checked='{$is_active}' />\",\n\t\t\t'value' => $is_active,\n\t\t\t'helps' => __( 'Should this image be used when menu item is active', 'nmi' ),\n\t\t\t'show_in_edit' => false\n\t\t);\n\n\t\t// Filter returned HTML output\n\t\treturn apply_filters( 'nmi_attachment_fields_to_edit', $form_fields, $post );\n\t}", "function eman_post_reviewable( $post )\n{\n\t// Get current post status\n\t$status = emanager_post::status($post, 'slug');\n\tif ( $status && ! in_array($status, array('void','approved','approve','draft','revise','executed')) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function hook_before_edit(&$postdata,$id) { \n\t\t\t//Your code here\t\t\t\n\t\t\t// pr($_POST,1);\n\t\t\tunset($postdata['get_item_from']);\n\t\t\tunset($postdata['purchase_order_number']);\n\n\t\t\t$cek = DB::table('purchase_invoices')->where('id',$id)->first(['status']);\n\t\t\t// pr($cek,1);\n\t\t\tif($cek->status != 'draft'){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif($_POST['submit'] == 'Submit'){\n\t\t\t\t$postdata['status'] = 'submited';\n\t\t\t}\n\t\t\t// pr($postdata);\n\t\t\t// pr($_POST,1);\n\t }", "function user_can_edit_post($user_id, $post_id, $blog_id = 1)\n {\n }", "function can_do_edit() {\n // ends\n $association_id = $this->required_param('association_id', PARAM_INT);\n $record = new clustertrack($association_id);\n $clusterid = $record->clusterid;\n $trackid = $record->trackid;\n\n return clusterpage::_has_capability('block/curr_admin:associate', $clusterid)\n && trackpage::_has_capability('block/curr_admin:associate', $trackid);\n }", "public static function isEditPage($type = null)\n {\n global $pagenow;\n //make sure we are on the backend\n if (!is_admin()) {\n return false;\n }\n\n if (is_null($type)) {\n return in_array($pagenow, array('post.php', 'post-new.php'));\n } elseif (is_array($type)) {\n return in_array($pagenow, array_map(function ($item) {\n return $item . '.php';\n }, $type));\n } else {\n return in_array($pagenow, array($type . '.php'));\n }\n }", "public function editPost(User $user, Post $post)\n {\n return $user->id === $post->user_id;\n }", "private function shouldIndexPost($post)\n {\n return in_array($post->post_type, $this->getConfig()->allowedPostTypes()) && !empty($post->post_title);\n }", "function inspiry_is_edit_property() {\n\t\tif ( isset( $_GET['edit_property'] ) && ! empty( $_GET['edit_property'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isInline(): bool\n\t{\n\t\treturn $this->disposition === self::DISPOSITION_INLINE;\n\t}", "function get_inline_data($post)\n {\n }", "protected function allowEdit($data = array(), $key = 'id')\n {\n return true;\n }", "function wp_idolondemand_edit_post()\n{\n}", "function image_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function vcex_vc_is_inline() {\n\tif ( function_exists( 'vc_is_inline' ) ) {\n\t\treturn vc_is_inline();\n\t}\n\treturn false;\n}", "public function edit(User $user)\n {\n return $user->role->can_edit_post == 1;\n }", "public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }", "function is_edit_page( $new_edit = null )\n {\n global $pagenow;\n\n if ( ! is_admin() ) {\n return false;\n } elseif ( $new_edit === 'edit' ) {\n return in_array( $pagenow, [ 'post.php' ] );\n } elseif ( $new_edit === 'new' ) {\n /** Check for new post page */\n return in_array( $pagenow, [ 'post-new.php' ] );\n } else {\n /** Check for either new or edit */\n return in_array( $pagenow, [ 'post.php', 'post-new.php' ] );\n }\n }", "public function isEditOnlyMode();", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "public function hook_before_edit(&$arr,$id) {\n\n }", "public function isEditable() {}", "public function hasEmbeddedField()\n {\n return $this->get(self::EMBEDDED_FIELD) !== null;\n }", "function fa_is_preview(){\n\tif( isset( $_GET['fa_slider_preview'] ) ){\n\t\tif( current_user_can('edit_fa_items') ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\t\n}", "public function canBeEdited() {}", "function canEdit() {\n\t\t\treturn true;\n\t\t}", "function manage_wp_posts_using_bulk_quick_edit_save_post( $post_id, $post ) {\n\tif ( empty( $_POST ) )\n\t\treturn $post_id;\n\t\t\n\t// verify quick edit nonce\n\tif ( isset( $_POST[ '_inline_edit' ] ) && ! wp_verify_nonce( $_POST[ '_inline_edit' ], 'inlineeditnonce' ) )\n\t\treturn $post_id;\n\t\t\t\n\t// don't save for autosave\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )\n\t\treturn $post_id;\n\t\t\n\t// dont save for revisions\n\tif ( isset( $post->post_type ) && $post->post_type == 'revision' )\n\t\treturn $post_id;\n\t\t\n\tswitch( $post->post_type ) {\n\t\n\t\tcase 'movies':\n\t\t\n\t\t\t/**\n\t\t\t * Because this action is run in several places, checking for the array key\n\t\t\t * keeps WordPress from editing data that wasn't in the form, i.e. if you had\n\t\t\t * this post meta on your \"Quick Edit\" but didn't have it on the \"Edit Post\" screen.\n\t\t\t */\n\t\t\t$custom_fields = array( 'release_date', 'coming_soon', 'film_rating' );\n\t\t\t\n\t\t\tforeach( $custom_fields as $field ) {\n\t\t\t\n\t\t\t\tif ( array_key_exists( $field, $_POST ) )\n\t\t\t\t\tupdate_post_meta( $post_id, $field, $_POST[ $field ] );\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t}\n\t\n}", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "private function is_page_has_entry_preview( $forms ) {\n\n\t\tif ( ! empty( wpforms()->get( 'process' )->form_data ) && $this->is_form_has_entry_preview_confirmation( wpforms()->get( 'process' )->form_data ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ( $forms as $form_data ) {\n\t\t\tif (\n\t\t\t\t$this->is_form_has_entry_preview_confirmation( $form_data )\n\t\t\t\t|| $this->is_form_has_entry_preview_field( $form_data )\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public static function is_admin_editor_request() {\n\n return (\n isset($_SERVER['REQUEST_URI']) &&\n (\n strpos( $_SERVER['REQUEST_URI'], 'wp-json/wp/v2/block-renderer' ) !== false ||\n strpos( $_SERVER['REQUEST_URI'], '?rest_route=%2Fwp%2Fv2%2Fblock-renderer' ) !== false\n )\n );\n }", "function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function field_edit($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $rightArray = right::get_field($name);\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($rightArray[edit]) return($userRight & $rightArray[edit]);\r\n else return(false); // default no edit\r\n }", "public function current_user_can_edit( $post_id, $post_type = '' ) {\n\n\t\tif ( empty( $post_type ) ) {\n\t\t\t$post_type = get_post_type( $post_id );\n\t\t}\n\n\t\tswitch ( $post_type ) {\n\n\t\t\tcase 'page':\n\t\t\t\treturn current_user_can( 'edit_page', $post_id );\n\n\t\t\tcase 'post':\n\t\t\t\treturn current_user_can( 'edit_post', $post_id );\n\n\t\t\tdefault:\n\n\t\t\t\t// All post types\n\t\t\t\t$post_types = (array) get_post_types(\n\t\t\t\t\tarray(),\n\t\t\t\t\t'objects'\n\t\t\t\t);\n\n\t\t\t\treturn isset( $post_types[ $post_type ]->cap->edit_post ) &&\n\t\t\t\t current_user_can( $post_types[ $post_type ]->cap->edit_post, $post_id );\n\n\t\t}\n\n\t}", "function bulk_edit_posts($post_data = \\null)\n {\n }", "function acf_is_block_editor()\n{\n}", "function get_post_to_edit($id)\n {\n }", "protected function isPageEditable()\n {\n if ($this->getBackendUser()->isAdmin()) {\n return true;\n }\n return !$this->pageinfo['editlock'] && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::PAGE_EDIT);\n }", "function can_edit() {\n\n if ( ! strpos( $_SERVER['REQUEST_URI'], 'index.php') ) return false;\n\n $what = isset($_GET['what']) ? $_GET['what'] : false;\n $add = isset($_GET['add']) ? $_GET['add'] : false;\n\n // this is the rule for add posts\n return $what === 'bryndzoveHalusky' && $add == 1;\n}", "public function is_admin_editor_page() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\t\tglobal $pagenow, $wp_version;\n\t\t$allowed_pagenow_array = array( 'post.php', 'post-new.php', 'term.php', 'user-new.php', 'user-edit.php', 'profile.php' );\n\t\t$allowed_page_array = array( 'views-editor', 'ct-editor', 'view-archives-editor', 'dd_layouts_edit' );\n\t\t// @todo maybe add a filter here for future Toolset admin pages...\n\t\tif (\n\t\t\tin_array( $pagenow, $allowed_pagenow_array )\n\t\t\t|| (\n\t\t\t\t$pagenow == 'admin.php'\n\t\t\t\t&& isset( $_GET['page'] )\n\t\t\t\t&& in_array( $_GET['page'], $allowed_page_array )\n\t\t\t)\n\t\t\t|| (\n\t\t\t\t// In WordPress < 4.5, the edit tag admin page is edit-tags.php?action=edit&taxonomy=category&tag_ID=X\n\t\t\t\tversion_compare( $wp_version, '4.5', '<' )\n\t\t\t\t&& $pagenow == 'edit-tags.php'\n\t\t\t\t&& isset( $_GET['action'] )\n\t\t\t\t&& $_GET['action'] == 'edit'\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function is_elementor_editor()\n {\n if ((isset($_REQUEST['action']) && 'elementor' == $_REQUEST['action']) ||\n isset($_REQUEST['elementor-preview'])\n ) {\n return true;\n }\n\n return false;\n }", "function rich_edit_exists()\n {\n }", "public function hook_before_edit(&$postdata,$id) { \n\t //Your code here\n\n\t }", "public function hook_before_edit(&$postdata,$id) { \n\t //Your code here\n\n\t }", "function fed_display_dashboard_edit_post_by_id( $post ) {\n\t$post_table = fed_fetch_rows_by_table( BC_FED_POST_DB );\n\t$post_meta = get_post_meta( $post->ID );\n\t$post_settings = fed_get_post_settings_by_type( $post->post_type );\n\n\t$html = '';\n\t$html .= '\n<div class=\"row\">\n\t<div class=\"col-md-5\">\n\t\t<form method=\"post\"\n\t\t\t class=\"fed_dashboard_show_post_list_request\"\n\t\t\t action=\" ' . admin_url( 'admin-ajax.php?action=fed_dashboard_show_post_list_request' ) . '\">';\n\t$html .= fed_wp_nonce_field( 'fed_dashboard_show_post_list_request', 'fed_dashboard_show_post_list_request', '',\n\t\tfalse );\n\n\t$html .= fed_get_input_details( array(\n\t\t'input_type' => 'hidden',\n\t\t'input_meta' => 'fed_post_type',\n\t\t'user_value' => $post->post_type\n\t) );\n\n\t$html .= '\n\t\t\t<button class=\"btn btn-primary\"\n\t\t\t\t\ttype=\"submit\">\n\t\t\t\t<i class=\"fa fa-mail-reply\"></i>\n\t\t\t\tBack to ' . strtoupper( $post->post_type ) . '\n\t\t\t</button>\n\t\t</form>\n\t</div>\n</div>';\n\n\t$html .= '\n<form method=\"post\"\n\t class=\"fed_dashboard_process_edit_post_request\"\n\t action=\"' . admin_url( 'admin-ajax.php?action=fed_dashboard_process_edit_post_request' ) . '\">';\n\n\t$html .= fed_wp_nonce_field( \"fed_dashboard_process_edit_post_request\", \"fed_dashboard_process_edit_post_request\", true,\n\t\tfalse );\n\n\t$html .= fed_input_box( 'ID', array( 'value' => (int) $post->ID ), 'hidden' );\n\n\t$html .= '\n\t<input type=\"hidden\"\n\t\t name=\"fed_post_type\"\n\t\t value=\"' . $post->post_type . '\">\n\t';\n\n\t$html .= '\n\t<input type=\"hidden\"\n\t\t name=\"post_type\"\n\t\t value=\"' . $post->post_type . '\">\n\t';\n\t/**\n\t * Post Title\n\t */\n\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Title' ) . '</div>\n\t\t\t' . fed_input_box( 'post_title', array(\n\t\t\t'value' => esc_attr( $post->post_title ),\n\t\t\t'placeholder' => 'Post Title'\n\t\t), 'single_line' ) . '\n\t\t</div>\n\n\t</div>\n\t';\n\t/**\n\t * Post Content\n\t */\n\tif ( ! isset( $post_settings['dashboard']['post_content'] ) ) {\n\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Content' ) . '</div>\n\t\t\t' . fed_get_wp_editor( $post->post_content, 'post_content', array(\n\t\t\t\t'quicktags' => true\n\t\t\t) ) . '\n\t\t</div>\n\n\t</div>\n\t';\n\t}\n\t$html .= fed_show_category_tag_post_format( $post, $post_settings );\n\n\t/**\n\t * Featured Image\n\t * _thumbnail_id\n\t */\n\tif ( ! isset( $post_settings['dashboard']['featured_image'] ) ) {\n\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Featured Image' ) . '</div>\n\t\t\t' . fed_input_box( '_thumbnail_id', array( 'value' => (int) $post_meta['_thumbnail_id'][0] ), 'file' ) .\n\t\t '\n\t\t</div>\n\t</div>\n\t';\n\t}\n\n\t/**\n\t * Comment Status\n\t */\n\tif ( ! isset( $post_settings['dashboard']['allow_comments'] ) ) {\n\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-12\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( 'Allow Comments' ) . '</div>\n\t\t\t' . fed_input_box( 'comment_status', array(\n\t\t\t\t'default_value' => 'open',\n\t\t\t\t'value' => esc_attr( $post->comment_status ),\n\t\t\t), 'checkbox' ) . '\n\t\t</div>\n\t</div>\n\t';\n\t}\n\t/**\n\t * Extra Fields\n\t */\n\tforeach ( $post_table as $item ) {\n\t\t$temp = $item;\n\t\t$temp['user_value'] = $post_meta[ $item['input_meta'] ][0];\n\t\tif ( $post->post_type === $item['post_type'] ) {\n\t\t\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-9\">\n\t\t\t<div class=\"fed_header_font_color\">' . __( $item['label_name'] ) . '</div>\n\t\t\t' . fed_get_input_details( $temp ) . '\n\t\t</div>\n\t</div>\n\t';\n\t\t}\n\t}\n\t$html .= '\n\t<div class=\"row fed_dashboard_item_field\">\n\t\t<div class=\"col-md-3 col-md-offset-4\">\n\t\t\t<button class=\"btn btn-primary\"\n\t\t\t\t\ttype=\"submit\">\n\t\t\t\t<i class=\"fa fa-floppy-o\"></i>\n\t\t\t\t'.__( 'Save', 'frontend-dashboard' ).'\n\t\t\t</button>\n\t\t</div>\n\t</div>\n\t';\n\n\t$html .= '\n</form>';\n\n\treturn $html;\n}", "function fa_is_theme_edit_preview(){\n\tif( fa_is_preview() ){\n\t\tif( isset( $_GET['action'] ) && 'theme_edit' == $_GET['action'] ){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\treturn false;\n}" ]
[ "0.685388", "0.6232993", "0.6057414", "0.5977679", "0.59762985", "0.5965489", "0.59087825", "0.5879176", "0.58344877", "0.58215564", "0.5776176", "0.5743525", "0.5676874", "0.56654924", "0.56471366", "0.56471366", "0.56378657", "0.5586207", "0.5572153", "0.5572007", "0.55332035", "0.55256045", "0.55156946", "0.5499361", "0.54991287", "0.54929185", "0.54796284", "0.5471962", "0.5465586", "0.5443835", "0.5437792", "0.54089075", "0.5398645", "0.5379232", "0.5371969", "0.5371173", "0.5363581", "0.5359498", "0.53577644", "0.5335974", "0.5335124", "0.53053623", "0.53023964", "0.529891", "0.5298285", "0.5297577", "0.5292863", "0.52891046", "0.5272819", "0.526513", "0.52632093", "0.52626956", "0.52591187", "0.5255844", "0.52542365", "0.5254168", "0.52504945", "0.52360195", "0.52348334", "0.5229554", "0.5222777", "0.5218888", "0.5218378", "0.52139693", "0.52117944", "0.5206651", "0.52034074", "0.51887506", "0.5188104", "0.5183471", "0.5177993", "0.5167475", "0.51644903", "0.51633286", "0.51527333", "0.514542", "0.5143084", "0.5140163", "0.5140067", "0.51351523", "0.51286954", "0.5126803", "0.5124517", "0.51206034", "0.51156", "0.51113194", "0.5101709", "0.5101406", "0.50920576", "0.50775206", "0.5077352", "0.50750846", "0.5061703", "0.5056469", "0.5049142", "0.5042704", "0.50351334", "0.50351334", "0.5031571", "0.5029475" ]
0.8528106
0
Check whether the data is serializable or not
public function isSerializable($data = null) { if (is_object($data) || is_array($data)) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isSerialized($data) {\n return (@unserialize($data) !== false);\n }", "function is_serialized($data, $strict = \\true)\n {\n }", "function is_serialized_string($data)\n {\n }", "public function isSerialized()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n if (\n $this->str === 'b:0;'\n ||\n @unserialize($this->str) !== false\n ) {\n return true;\n } else {\n return false;\n }\n }", "abstract public function getIsSerializedAttribute() : bool;", "abstract protected function serializeData();", "public static function isSerialized($str) {}", "private function shouldSerialize()\n {\n $serialize = Common::getRequestVar('serialize', 0, 'int', $this->request);\n\n return !empty($serialize);\n }", "function maybe_serialize($data)\n {\n }", "private function supportData()\n {\n $dataClass = $this->type->getDataClass();\n\n return $this->data instanceof $dataClass || $dataClass === get_class($this->data);\n }", "function maybe_unserialize($data)\n {\n }", "public function testInvalidSerializedData()\n {\n $someData = 12;\n\n $serializer = ArrayObject::DEFAULT_SERIALIZER;\n $serializer = new $serializer;\n\n $data = new ArrayObject;\n $data->unserialize($serializer->serialize($someData));\n }", "abstract protected function serializeData($unSerializedData);", "function is_serialized($data) {\n if (!is_string($data))\n return false;\n $data = trim($data);\n if ('N;' == $data)\n return true;\n if (!preg_match('/^([adObis]):/', $data, $badions))\n return false;\n switch ($badions[1]) {\n case 'a' :\n case 'O' :\n case 's' :\n if (preg_match(\"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data))\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if (preg_match(\"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data))\n return true;\n break;\n }\n return false;\n }", "function is_serialized( $data ) {\n if ( !is_string( $data ) )\n return false;\n $data = trim( $data );\n if ( 'N;' == $data )\n return true;\n if ( !preg_match( '/^([adObis]):/', $data, $badions ) )\n return false;\n switch ( $badions[1] ) {\n case 'a' :\n case 'O' :\n case 's' :\n if ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\n return true;\n break;\n case 'b' :\n case 'i' :\n case 'd' :\n if ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\n return true;\n break;\n }\n return false;\n }", "abstract public function serialize($data);", "public function isDataValid(): bool;", "public function serialize($data)\n {\n }", "public static function is_serialized( $data ) {\r\n\t\t// if it isn't a string, it isn't serialized\r\n\t\tif ( !is_string( $data ) )\r\n\t\t\treturn false;\r\n\r\n\t\t$data = trim( $data );\r\n\r\n\t\tif ( 'N;' == $data )\r\n\t\t\treturn true;\r\n\r\n\t\tif ( !preg_match( '/^([adObis]):/', $data, $badions ) )\r\n\t\t\treturn false;\r\n\r\n\t\tswitch ( $badions[1] ) {\r\n\t\t\tcase 'a':\r\n\t\t\tcase 'O':\r\n\t\t\tcase 's':\r\n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) )\r\n\t\t\t\t\treturn true;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'b':\r\n\t\t\tcase 'i':\r\n\t\t\tcase 'd':\r\n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) )\r\n\t\t\t\t\treturn true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "function is_serialized_string($data) {\n\t\tif (!is_string($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t$data = trim($data);\n\t\tif (strlen($data) < 4) {\n\t\t\treturn false;\n\t\t} elseif (':' !== $data[1]) {\n\t\t\treturn false;\n\t\t} elseif (';' !== substr($data, -1)) {\n\t\t\treturn false;\n\t\t} elseif ($data[0] !== 's') {\n\t\t\treturn false;\n\t\t} elseif ('\"' !== substr($data, -2, 1)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public static function isSerializedArray($data)\n {\n return $data === null || (is_string($data) && preg_match('/^a:[0-9]+:{.*;}$/s', $data));\n }", "public function isSavable(): bool\n {\n return true;\n }", "private function isSerialized($value)\n {\n $data = @unserialize($value);\n if ($value === 'b:0;' || $data !== false) {\n return true;\n } else {\n return false;\n }\n }", "public function serialize($data);", "function is_serial($string) {\n return (@unserialize($string) !== false);\n}", "function isDataValid() \n {\n return true;\n }", "function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}", "static function serialized( $data ) {\n\t\tif(empty($data)) return false;\n\t\tif ( !is_string( $data ) ) \n\t\t\treturn false; \n\t\t$data = trim( $data ); \n\t\tif ( 'N;' == $data ) \n\t\t\treturn true; \n\t\tif ( !preg_match( '/^([adObis]):/', $data, $badions ) ) \n\t\t\treturn false; \n\t\tswitch ( $badions[1] ) { \n\t\t\tcase 'a' : \n\t\t\tcase 'O' : \n\t\t\tcase 's' : \n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9]+:.*[;}]\\$/s\", $data ) ) \n\t\t\t\t\treturn true; \n\t\t\t\tbreak; \n\t\t\tcase 'b' : \n\t\t\tcase 'i' : \n\t\t\tcase 'd' : \n\t\t\t\tif ( preg_match( \"/^{$badions[1]}:[0-9.E-]+;\\$/\", $data ) ) \n\t\t\t\t\treturn true; \n\t\t\t\tbreak; \n\t\t} \n\t\treturn false; \n\t}", "public function is_user_object_data() {\n return false;\n }", "protected function isColumnSerializable($name) {\n\t\tif (!empty($this->visible)) {\n\t\t\tif (!in_array($name, $this->visible)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if (!empty($this->hidden)) {\n\t\t\tif (in_array($name, $this->hidden)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function getSerializedData()\n {\n if ($this->_serializedData == null) {\n return $this->raiseError('No serialized data available. '\n . 'Use XML_Serializer::serialize() first.',\n XML_SERIALIZER_ERROR_NO_SERIALIZATION);\n }\n return $this->_serializedData;\n }", "public function hasData() : bool;", "static function checkObj(&$data) \n\t{\n\t\tif(!$data)\n\t\t\treturn false;\n\t\tif(preg_match('/((?![\\x20-\\x7E]).)/', $data)){\n\t\t\t//todo:now just int\n\t\t\t$data = unpack('I',$data);\n\t\t\t$data = $data[1];\n\t\t\treturn false;\n\t\t}\n\t\tif(substr_compare($data,'{',0,1)==0){\n\t\t\t$ndata = json_decode($data,true);\n\t\t\tif($ndata){\n\t\t\t\t$data = $ndata;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "public function testSerialize()\n {\n $data = $this->getDB()->get('SELECT * FROM grps');\n json_encode($data);\n $this->assertEquals(true, strlen(serialize($data)) > 0);\n }", "abstract public function serialize();", "abstract public function serialize();", "public abstract function serialize();", "public function unserialize($data) {}", "protected function has_data()\n {\n }", "public function serialize($value) : bool\n {\n }", "public function hasData(): bool {\n return is_array($this->data);\n }", "public function loaded()\n {\n return is_array($this->data);\n }", "public function has_data()\n {\n }", "private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}", "#[\\ReturnTypeWillChange]\n public function unserialize($data)\n {\n }", "#[\\ReturnTypeWillChange]\n public function valid()\n {\n return key($this->_data) !== null;\n }", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function serialize() {}", "public function hasData() {\n try {\n $res = TRUE;\n }\n catch (\\Exception $e) {\n $res = FALSE;\n }\n\n return $res;\n }", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "public function testSerialization(): void\n {\n $items = new ArrayObject([\n 'a' => 1,\n 'b' => 2,\n 'c' => 3,\n ]);\n $expected = (array)$items;\n\n $iterator = new BufferedIterator($items);\n\n $serialized = serialize($iterator);\n $outcome = unserialize($serialized);\n $this->assertEquals($expected, $outcome->toArray());\n }", "public function testSerialize() {\n $index = Phish_Index::load();\n $str = serialize($index);\n $indexRestored = unserialize($str);\n $this->assertEquals($index, $indexRestored);\n }", "function parcelcheckout_serialize_hasInjection($mData)\n\t{\n\t\tif(is_array($mData) || is_object($mData))\n\t\t{\n\t\t\tforeach($mData as $k => $v)\n\t\t\t{\n\t\t\t\tif(parcelcheckout_serialize_hasInjection($v) || parcelcheckout_serialize_hasInjection($k))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telseif(is_string($mData) && strpos($mData, ':'))\n\t\t{\n\t\t\tif(preg_match('/([aAoOsS]:[0-9]+:[\\{\"])/', $mData))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasStructuredData() {\n\t\treturn ! empty( $this->data );\n\t}", "function allowserialize($propname)\r\n {\r\n return(true);\r\n }", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "public static function serialized(string $name): bool\n {\n return static::$serialize;\n }", "protected function isRawData() {\n return $this->rawData;\n }", "public function jsonSerialize():mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "protected function get_is_serial(): bool\n\t{\n\t\treturn $this->type == self::TYPE_INTEGER && !$this->null && $this->auto_increment && $this->primary;\n\t}", "public function isStorable()\n {\n return ((int)$this->storable === 1);\n }", "public function shouldSerialize($fieldKey);", "function valid()\n {\n try {\n return (bool)$this->data();\n } catch (Exception $e) {\n return false;\n }\n }", "abstract protected function unSerializeData();", "public final function hasData()\n {\n return $this->data == false ? false : true;\n }", "function stringToObject( $data, $namespace='' ) {\n\t\treturn true;\n\t}", "function stringToObject( $data, $namespace='' ) {\n\t\treturn true;\n\t}", "private function isSerialized($string)\n {\n if ($string === 'b:0;' or @unserialize($string) !== false)\n {\n return true;\n }\n\n return false;\n }", "abstract protected function isValid(\\stdClass $data): bool;", "public function serialize();", "public function serialize();", "public function serialize();", "private function convertSerializedData()\n {\n $layoutUpdateQueryModifier = $this->queryModifierFactory->create(\n 'like',\n [\n 'values' => [\n 'xml' => '%conditions_encoded%'\n ]\n ]\n );\n $this->aggregatedFieldDataConverter->convert(\n [\n new FieldToConvert(\n SerializedToJson::class,\n $this->moduleDataSetup->getTable('widget_instance'),\n 'instance_id',\n 'widget_parameters'\n ),\n new FieldToConvert(\n LayoutUpdateConverter::class,\n $this->moduleDataSetup->getTable('layout_update'),\n 'layout_update_id',\n 'xml',\n $layoutUpdateQueryModifier\n ),\n ],\n $this->moduleDataSetup->getConnection()\n );\n }", "public static function isData($input)\n {\n if (is_object($input)) {\n return ($input instanceof self);\n }\n\n return (is_string($input) && (strpos($input, 'data:') === 0));\n }", "public function isObject()\n {\n return \\is_object($this->value);\n }", "public function serialize()\n {\n }", "public function serialize()\n {\n }", "public static function data_is_set() {\r\n\t\treturn self::$page_data instanceof PageData;\r\n\t}", "public static function is_serialized(string $str)\n {\n $array = @unserialize($str);\n return ! ($array === false and $str !== 'b:0;');\n }", "public function testSerializationCapabilities()\n {\n $generator = $this->getTokenGeneratorForTesting();\n\n $tmp = serialize($generator);\n $tmp = unserialize($tmp);\n\n $this->assertEquals($generator, $tmp);\n $this->assertNotEmpty($tmp->getTokenString(10));\n\n unset($tmp);\n $this->assertNotNull($generator);\n }", "public function serialize(){ }", "public function test_serialized_data() {\n\t\t$key = rand_str();\n\t\t$value = array(\n\t\t\t'foo' => true,\n\t\t\t'bar' => true,\n\t\t);\n\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value ) );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\n\t\t$value = (object) $value;\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, $value ) );\n\t\t$this->assertEquals( $value, WP_Temporary::get_site( $key ) );\n\t\t$this->assertTrue( WP_Temporary::delete_site( $key ) );\n\t}", "public function __invoke($data): bool\n {\n return is_string($data);\n }", "public function isHydrated() {\n\t\treturn !empty($this->originalData);\t\t\n\t}", "public function supportsNormalization($data, $format = null)\n {\n return $data instanceof \\Exception;\n }", "public function decode(ISerializable $Object, $Data, $flags = ISerializer::SERIALIZER_FLAGS)\n {\n\n // Unserizlize properties\n $Properties = unserialize($Data);\n\n // Check results\n if (is_array($Properties)) {\n\n // Restore properties\n $this->import($Object, $Properties);\n\n // Return true\n return true;\n }\n\n // No properties, return false\n return false;\n }", "public function hasData(){\n return $this->_has(1);\n }", "abstract public function validateData();", "public function serialize(){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "public function jsonSerialize(): mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize(): mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function __invoke($data): bool\n {\n return !(is_object($data))\n || count(get_object_vars($data)) >= $this->minimum;\n }", "public static function safeSerialize($toSerialize)\n\t{\n\t\t$serialized = serialize($toSerialize);\n\n\t\tif (self::serializedContainsObject($serialized))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(\"Serialized value contains an object and this is not allowed\");\n\t\t}\n\n\t\treturn $serialized;\n\t}", "#[\\ReturnTypeWillChange]\n public function __unserialize($data)\n {\n }" ]
[ "0.7251814", "0.6986257", "0.6944731", "0.6689575", "0.6643805", "0.6622851", "0.6622601", "0.6601618", "0.6488359", "0.64727515", "0.6439636", "0.64279", "0.6388403", "0.6353341", "0.6348609", "0.6313539", "0.62057614", "0.6202001", "0.616561", "0.6144393", "0.6041641", "0.6033718", "0.6010465", "0.59946084", "0.5988446", "0.5973522", "0.5928713", "0.589279", "0.5876295", "0.5846793", "0.5841294", "0.5824919", "0.5824261", "0.5804527", "0.57874537", "0.57874537", "0.57746613", "0.5754339", "0.5727727", "0.57238066", "0.57154655", "0.5707857", "0.5692435", "0.56870073", "0.5675495", "0.5653471", "0.56279624", "0.56279624", "0.5626938", "0.5626938", "0.5626938", "0.5626938", "0.5626938", "0.5626938", "0.56190646", "0.5614591", "0.5612801", "0.5609347", "0.5590478", "0.5581601", "0.55781275", "0.55701053", "0.5567395", "0.5556042", "0.55438924", "0.5512871", "0.5507686", "0.5477925", "0.54715437", "0.54692996", "0.54682803", "0.5467505", "0.5467505", "0.54634464", "0.54567367", "0.5449337", "0.5449337", "0.5449337", "0.5441242", "0.54407334", "0.5437752", "0.54252535", "0.54252535", "0.5387382", "0.53849065", "0.537964", "0.5359359", "0.53435487", "0.53283477", "0.5328261", "0.5321538", "0.53170377", "0.5315199", "0.5313464", "0.5299239", "0.5296706", "0.5296706", "0.52953905", "0.5292488", "0.52905303" ]
0.7611586
0
Auto generated seed file
public function run() { \DB::table('users')->delete(); \DB::table('users')->insert(array ( 0 => array ( 'id' => 1, 'name' => 'superuser', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$KU2uThD7.sb7mCIKXkTY.ez.Bq5wHPekdTjr.N84M/TzKbfc4XnBe', 'remember_token' => 'vGs10gTq0QumuxKgi2ErlsZvvtndR2zzabpjbImLm6gxJ3h8PJqEwuHW8cF1', 'created_at' => '2018-09-27 10:17:35', 'updated_at' => '2019-04-12 10:56:04', 'title' => 'Staff', ), 1 => array ( 'id' => 2, 'name' => 'Washington Mwamburi', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$wgvDkgTaVzXmzVs.PMmNwunoCgn0C2SyRHQU6/dcc.LpJAF6M/Twa', 'remember_token' => 'vrYDzB9SIp3eOBg5g6M8JOnLEQM6YgiVOOUbRxdixPZHK8oH1O3JFQtEuKWL', 'created_at' => '2018-04-23 11:45:37', 'updated_at' => '2019-02-12 14:17:23', 'title' => 'HOD', ), 2 => array ( 'id' => 3, 'name' => 'Grace Mpoya', 'department_id' => 2, 'email' => '[email protected]', 'password' => '$2y$10$Al4dBAnLLmXp.halAGG72O.4MQkKBiJNPXYism3bDY8IUr/iYhriO', 'remember_token' => 'ephEcdUlcA8asfP5m7ySa3iEa2ocxI3YBg52j3dZwvxGDSS6cr6bEkBb6Add', 'created_at' => '2018-05-02 08:04:05', 'updated_at' => '2018-09-14 12:54:41', 'title' => 'Customer Service Executive', ), 3 => array ( 'id' => 4, 'name' => 'Joseph Matheka', 'department_id' => 5, 'email' => '[email protected]', 'password' => '$2y$10$7grY8tX53yllocXNpF3yMuG43YboYWhP5oUj5Wb6YC2JohswoxKTK', 'remember_token' => 'yfWFEZCBtZr4TVM5WChMENSOrHX5XrnpdnxRaJxUAW5CfIA4aU2TzgzQuVKy', 'created_at' => '2018-05-02 14:47:12', 'updated_at' => '2019-10-28 07:03:42', 'title' => 'RF SURVEY', ), 4 => array ( 'id' => 5, 'name' => 'Salim Sulubu', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$dOuZ4e4rqs90f4egpZ7Eue3VCgXPbZtqcGfYknUAXnu1/6Rjx8cyW', 'remember_token' => NULL, 'created_at' => '2018-05-02 14:48:33', 'updated_at' => '2018-09-14 12:28:58', 'title' => 'Declaration Officer', ), 5 => array ( 'id' => 7, 'name' => 'Maurine Atieno Opiyo', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$2tAxloO02.836.EKX.PxCu5yWQibF46mWet9dKHK4JpqRaOEqzN2O', 'remember_token' => 'VMh5fLhyn5OmCBByiDgeizuC05HIQwguQ6AgXRLZvVYN2eD5SRabgxjHahR3', 'created_at' => '2018-06-19 17:32:50', 'updated_at' => '2019-04-12 11:18:39', 'title' => 'MR', ), 6 => array ( 'id' => 8, 'name' => 'Evans Ngala', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$WPASZ1XPNOZnN9hBcO4jWu5Gj3fid/g.cNqLacIWu7Oa70vLtHKHG', 'remember_token' => 'oriZpuqa4nbGWw5LP7FzHlEMUkdFxFeNQjjuc065AUsrBfRehKETVBb6t9af', 'created_at' => '2018-06-23 02:51:59', 'updated_at' => '2018-10-03 08:06:58', 'title' => 'IT Manager', ), 7 => array ( 'id' => 9, 'name' => 'marvin', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$6Ylu/QG6LTGMmlFqVZ7hRO4QLS1GqB6B04JaS8NAWgHymFpeEtS3q', 'remember_token' => 'MNAcuq2f9T1FKHum36mLKWnpKhtKICYdY0U6rlmRdFUDszTjFzM0rlEQLt8W', 'created_at' => '2018-07-24 07:36:05', 'updated_at' => '2018-07-24 07:36:05', 'title' => 'Staff', ), 8 => array ( 'id' => 10, 'name' => 'Laura Mwamkita', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$GEQ4GTdqheGCLQelMgjgHuWUrDitetLUWHBGji4XSJq6zkkehFWna', 'remember_token' => '2Nsl4yoPGhzQO8c5vD39OxHiqwhFizbxOocPwMgAdka2zhcjpfkP6uMFzFjt', 'created_at' => '2018-09-14 12:33:33', 'updated_at' => '2018-09-14 13:13:51', 'title' => 'Declaration oficer', ), 9 => array ( 'id' => 11, 'name' => 'Jackline Waweru', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$RFIKhw5Wxtv3IxUBSeIWZem.L4ElA1imZLDEvKgnG259CNM2gyETS', 'remember_token' => 'WGvAaEIw1WirVD0nqIGm08TpMNI5jfUEJqVnX7z7fslz3kqTUoHFaL8pNnq2', 'created_at' => '2018-09-14 12:35:39', 'updated_at' => '2018-09-14 12:35:39', 'title' => 'Operations Intern', ), 10 => array ( 'id' => 12, 'name' => 'Lawrence Amenya', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$N2GEG05EwmomJQIRwLBJju.Lb7XGFa/ShB.7c5F6oeRBBzMeMwuxK', 'remember_token' => NULL, 'created_at' => '2018-09-14 14:05:41', 'updated_at' => '2018-09-14 14:05:41', 'title' => 'Forwarding Officer', ), 11 => array ( 'id' => 13, 'name' => 'Marvin Collins', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$qGODpspTsxZ35Ha8fZizM.hp/P1y0ecCfHCFfHy.PFV/T.lMyvV0S', 'remember_token' => NULL, 'created_at' => '2018-10-03 08:04:47', 'updated_at' => '2018-10-03 08:04:47', 'title' => 'Staff', ), 12 => array ( 'id' => 14, 'name' => 'Martin Karani', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$i9pZWmVHAb6R/tsi3mkZce/.p5vH5JHQQd7/adpZErkA7Z5EvCuIm', 'remember_token' => NULL, 'created_at' => '2018-10-11 07:21:04', 'updated_at' => '2018-10-11 07:21:04', 'title' => 'GCFO', ), 13 => array ( 'id' => 15, 'name' => 'John Lagat', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$i8Z1RGyHHEWNx60Dugg3Tu1MvVwsHY5UdPdf.5nvoEVaId3yvIvwW', 'remember_token' => 'Zb5YtVLHCmP3tar8aVZ8PfAuso7c29LHMsg2jqQzWQKpxGMjhTKsLJ1ydSVj', 'created_at' => '2018-10-11 07:25:29', 'updated_at' => '2018-10-18 07:56:54', 'title' => 'ICT', ), 14 => array ( 'id' => 16, 'name' => 'Catherine Thuo', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$znu4Cp8imsNCd.pDUHDQjOaDVhtX2TECFO4IwBC85Vd0kBi/THvzW', 'remember_token' => '0qi0ep8aX6rInyfQQyZ68SRLZqGs5bO61WXbax5jsO6ciRtMKMmg2WaCshpy', 'created_at' => '2018-11-02 11:08:22', 'updated_at' => '2019-02-01 06:08:02', 'title' => 'Customer Service Executive', ), 15 => array ( 'id' => 17, 'name' => 'Christine Gema', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$BaRJqQ8IXDPZdSvHN7eWUeyCbZZSL2gGS33Ltteez1MccqKq3QdeK', 'remember_token' => NULL, 'created_at' => '2018-11-02 11:09:47', 'updated_at' => '2018-11-02 11:09:47', 'title' => 'Operations Supervisor', ), 16 => array ( 'id' => 18, 'name' => 'Joseph Kirimo', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$cSyOp40TppiW4Ae/H2iovue7jqqAeaguHaTgggphZVayXD0iHgSBO', 'remember_token' => '8mttn63xPlesVqjszGiQWkPn0GlBAfyBIdbBA5i2oNfLPpwBrSZiYAWmTxRB', 'created_at' => '2018-11-06 11:41:53', 'updated_at' => '2018-11-06 11:41:53', 'title' => 'Operations Intern', ), 17 => array ( 'id' => 19, 'name' => 'Erick Osinya', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$L26pwvh9kEKcFffmVk6sX.qKO1sumWipTJdBBjpUsSu8omQxBeK.2', 'remember_token' => NULL, 'created_at' => '2018-11-07 10:14:06', 'updated_at' => '2018-11-07 10:14:06', 'title' => 'Transport Officer', ), 18 => array ( 'id' => 20, 'name' => 'Jesinta Njeri', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$oILKuHDLpwgpYSmNR5pkMemhZU3Ql7eyc4q136NhU7V66enCxDUSq', 'remember_token' => '7PF4VwIc8479lEfnSt7ZrZIqGnNAq4Mt2ky7z76t0J3cJfGdkR1Q32fPGJ7x', 'created_at' => '2018-11-07 10:34:08', 'updated_at' => '2018-11-07 10:34:08', 'title' => 'Customer Service Executive', ), 19 => array ( 'id' => 21, 'name' => 'Rachael Munyao', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$tx.GRmkyP3xbS9TGxThI3u/OCjTLc3jDVk9.2KUqYYF3EQhs7N/Vq', 'remember_token' => NULL, 'created_at' => '2019-01-24 13:58:47', 'updated_at' => '2019-01-24 13:58:47', 'title' => 'Forwarding Officer', ), 20 => array ( 'id' => 22, 'name' => 'Zack', 'department_id' => 1, 'email' => '[email protected]', 'password' => '$2y$10$Db8cVCFr5QGv.z4m5c4grOhJozP4QoctXp.tzaojAIt6LcFIjPII2', 'remember_token' => 'dkDcUGljVCFZM4fxWYeb6A6fS4cQNruKTwc1RIfSPiZJFv3FZlL8FuZIpydS', 'created_at' => '2019-07-25 14:55:41', 'updated_at' => '2019-07-25 14:55:41', 'title' => 'Admin', ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function seed();", "protected function seed()\n {\n }", "public function seed() {\n }", "public function run()\n {\n $faker= \\Faker\\Factory::create();\n for ($i=0; $i < 20; $i++)\n {\n \tHuongDanVien::create([\n \t\t'tenhdv'=> $faker->name,\n \t\t'phai'=> $faker->word,\n \t\t'diachi'=> $faker->word,\n \t\t'sdt'=> $faker->number_format(0122000000),\n \t\t]);\n }\n }", "public function actionGenerate()\n {\n \\bariew\\yii2Tools\\tests\\FixtureManager::init();\n }", "public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "public function run()\n {\n \t$faker = Faker\\Factory::create();; \n foreach (range(1, 55) as $key => $value) {\n \tApp\\Student::create([\n \t\t 'name' => $faker->name,\n 'father_name' => $faker->name('male'),\n 'mother_name' => $faker->name('female'),\n 'phone_number' => $faker->phoneNumber,\n 'home_number' => $faker->phoneNumber,\n 'email' => $faker->unique()->safeEmail,\n 'gender' => 'male',\n 'roll_number' => $faker->randomNumber(),\n 'reg_number' => $faker->randomNumber(),\n 'department_id' => $faker->randomNumber(1),\n 'shift' => 'second',\n 'semester' => 'eight',\n 'present_address' => $faker->address,\n 'permanent_address' => $faker->address,\n \t]);\n }\n }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('ms_MY');\n ini_set('memory_limit', '50G');\n \\Eloquent::reguard();\n $this->command->info('User Seed');\n\n for ($i = 0; $i < 5; $i++) {\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'participant',\n 'isLead' => 0,\n 'totalPoints' => rand(1,100),\n ]);\n \n }\n\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'participant',\n 'isLead' => 1,\n 'totalPoints' => rand(1,100),\n ]);\n\n $name = $faker->name;\n $temp = explode(' ', trim($name));\n $nickname = $temp[0];\n\n\n $user = \\App\\User::updateOrCreate([\n 'email' => $nickname. '@dell.com',\n ], [\n 'name' => $name,\n 'password' => bcrypt('secret'),\n 'role' => 'program manager',\n 'isLead' => 0,\n 'totalPoints' => 0,\n ]);\n \n }", "public function getSeed();", "public function run()\n {\n //Cmd: php artisan db:seed --class=\"UsersTableSeeder\"\n \n $faker = Faker\\Factory::create(\"ja_JP\");\n \n for( $i=0; $i<10; $i++ ){\n\n App\\User::create([\n\t\t\t\t\"name\" => $faker->name(),\n\t\t\t\t\"name_mei\" => $faker->name(),\n\t\t\t\t\"kana_sei\" => $faker->word(),\n\t\t\t\t\"kana_mei\" => $faker->word(),\n\t\t\t\t\"email\" => $faker->safeEmail(),\n\t\t\t\t\"password\" => $faker->password(),\n\t\t\t\t\"phone\" => $faker->word(),\n\t\t\t\t\"address\" => $faker->address(),\n\t\t\t\t\"birthday\" => $faker->date().\" \".$faker->time(),\n\t\t\t\t\"language\" => $faker->languageCode(),\n\t\t\t\t\"licence\" => $faker->word(),\n\t\t\t\t\"school\" => $faker->word(),\n\t\t\t\t\"school_dept\" => $faker->word(),\n\t\t\t\t\"school_subject\" => $faker->word(),\n\t\t\t\t\"gender\" => $faker->word(),\n\t\t\t\t\"salary\" => $faker->randomDigit(),\n\t\t\t\t\"image_url\" => $faker->uuid(),\n\t\t\t\t\"back_image_url\" => $faker->uuid(),\n\t\t\t\t\"remember_token\" => $faker->sha1(),\n\t\t\t\t\"user_role_id\" => $faker->randomDigit(),\n\t\t\t\t\"created_at\" => $faker->dateTime(\"now\"),\n\t\t\t\t\"updated_at\" => $faker->dateTime(\"now\")\n\n ]);\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 // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $title = $faker->sentence(rand(3,6));\n Article::create([\n 'title'=>$title,\n 'slug'=>Str::slug($title,'-'),\n 'description'=>$faker->text(rand(100,300)),\n 'content'=>$faker->realText(rand(1000,2000))\n ]);\n }", "public function seed()\n\t{\n\t\t$this->createDataType();\n\t\t$this->createDataRowForColumns();\n\t}", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n $limit = 100;\n\n for ($i = 0; $i < $limit; $i++){\n \t\\App\\Models\\Member::create([\n 'code' => $faker->name,\n 'name' => $faker->name,\n 'sns_link' => $faker->name,\n 'is_block' => $faker->numberBetween(0, 1),\n 'phone' => $faker->name,\n 'amount' => $faker->numberBetween(1000, 9000),\n //{{SEEDER_NOT_DELETE_THIS_LINE}}\n\t\t\t]);\n\t\t}\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $kelamin = \"laki-laki\";\n foreach (range(1, 100) as $i) {\n \tKajian::create([\n \t\t'waktu'\t\t\t\t=> $faker->dateTimeThisCentury($max = 'now', $timezone = date_default_timezone_get()), \n\n \t\t'tema'\t\t\t\t=> $faker->sentence($nbWords = 6, $variableNbWords = true), \n \t\t'pemateri'\t\t\t=> $faker->name($gender = null|'male'|'female'), \n \t\t'alamat'\t\t\t=> $faker->streetAddress, \n \t\t'deskripsi'\t\t\t=> $faker->paragraph($nbSentences = 3, $variableNbSentences = true), \n \t\t'jenis_peserta'\t\t=> $kelamin, \n \t\t'latitude'\t\t\t=> $faker->latitude, \n \t\t'longitude'\t\t\t=> $faker->longitude,\n 'isRutin' => $faker->boolean\n \t]);\n }\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n /* Curso::factory(8)->create(); */\n /* $this->call(CidepartamentoSeeder::class);\n $this->call(CategoriaSeeder::class);\n $this->call(GeneroSeeder::class); */\n\n /* $this->call(UserSeeder::class); */\n\n\n /* Estudiante::factory(20)->create(); */\n\n /* Profesore::factory(12)->create(); */\n\n\n /* $this->call(EstudianteSeeder::class); */\n /* $this->call(CursoSeeder::class); */\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n for ($i = 100; $i < 120; $i++) {\n university::insert([\n 'name' => $faker->name(),\n 'code' => $i,\n 'contact' => '1234567' . $i,\n 'address' => 'Bhavnagar',\n 'user_id' => 2\n ]);\n\n }\n }", "public function run(): void\n {\n $faker = Factory::create();\n \\App\\User::query()->insert($this->gen($faker));\n }", "public function run()\n {\n $faker = Faker::create();\n\n Umrah::Create([\n 'user_id' => User::all()->random()->id,\n 'deceased_id' => Deceased::all()->random()->id,\n 'umrah_status_id' => UmrahStatus::all()->random()->id,\n ]);\n }", "function migrate_seed(){\n\n // Pull in Seed Service Provider\n // Loop in the contents of the file specified in the Service provider\n // Run Insert query.\n\n $seedFiles = require BASEPATH.\"/migration/SeedServiceProvider.php\";\n\n //Loop the files\n foreach ( $seedFiles as $file ){\n\n $seeds = require BASEPATH . \"/migration/seed/{$file}.php\";\n\n //Loop In table for insertion\n foreach( $seeds as $table_name => $data ){\n\n insert( $table_name, $data );\n\n }\n\n }\n\n}", "public function run()\n {\n // App\\UserRentCompactDisc::delete();\n (new Faker\\Generator)->seed(100);\n factory(App\\UserRentCompactDisc::class, 30)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n //echo $faker->word();die();\n //var_dump($faker);die();\n\n for($i=0; $i<100; $i++) \n {\n Maker::create\n ([\n 'name' => $faker->unique()->company(),\n 'phone' => $faker->phoneNumber()\n ]);\n }\n }", "public function run()\n {\n\n $faker =Faker\\Factory::create();\n foreach (range(1,10) as $index) {\n Member::create([\n 'memberNo' => $faker->text(5),\n 'name' => $faker->text($min=5,$max=10),\n 'email' => $faker->email(),\n 'lastConnect' => $faker->dateTime()\n ]);\n }\n }", "public function run()\n\t{\n\n $faker=Faker::create();\n\n for($i = 0; $i < 20; $i++)\n {\n \n \n \n $id= \\DB::table('users')->insertGetId(array(\n 'name' => $faker->firstName,\n 'email' => $faker->unique()->email,\n 'password' => \\Hash::make('bebe'),\n 'type' => $faker->randomElement(['member','admin']),\n \n\n\t\t\t));\n\n\n\n }\n\t\n\t}", "public function run()\n {\n //\\App\\Models\\User::factory(400)->create();\n //\\App\\Models\\Ship::factory(10000)->create();\n //\\App\\Models\\City::factory(1000)->create();\n //\\App\\Models\\Offer::factory(2000)->create();\n\n /* $this->call([\n CountrySeeder::class,\n ]);*/\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 $faker = Faker::create();\n DB::table('userroles')->insert([\n 'role_name' => 'Subper Admin',\n 'role_status' => 1,\n 'read' => $faker->paragraph(2),\n 'write' => $faker->paragraph(2),\n 'country_nationality' => $faker->paragraph(2)\n ]);\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class,15)->create();\n\n\n $regcouncils = fopen('C:\\practocsv\\regcouncil.csv', 'r');\n $degrees = fopen('C:\\practocsv\\degree.csv', 'r');\n $cities = fopen('C:\\practocsv\\city.csv', 'r');\n $specializations = fopen('C:\\practocsv\\specialization.csv', 'r');\n $colleges = fopen('C:\\practocsv\\college.csv', 'r');\n\n $categories = fopen('C:\\practocsv\\category.csv', 'r');\n $subcategories = fopen('C:\\practocsv\\subcategory.csv', 'r');\n $manufacturers = fopen('C:\\practocsv\\manufacture.csv', 'r');\n $ingredients = fopen('C:\\practocsv\\ingredients.csv', 'r');\n $products = fopen('C:\\practocsv\\product.csv', 'r');\n\n $faker = \\Faker\\Factory::create();\n\n $regcouncil_id = 0;\n $city_id = 0;\n $degree_id = 0;\n $specialization_id = 0;\n $college_id = 0;\n\n Type::create([\n 'name'=>'video'\n ]);\n Type::create([\n 'name'=>'chat'\n ]);\n $type = Type::create([\n 'name'=>'clinic'\n ]);\n\n while(($reg = fgetcsv($regcouncils)) !== FALSE){\n $regcouncil = Regcouncil::create([\n 'name'=>$reg[0]\n ]);\n $regcouncil_id = $regcouncil->id;\n }\n\n while(($deg = fgetcsv($degrees)) !== FALSE){\n $degree = Degree::create([\n 'name'=>$deg[0]\n ]);\n $degree_id = $degree->id;\n }\n\n while(($cit = fgetcsv($cities)) !== FALSE){\n $city = City::create([\n 'name'=>$cit[0]\n ]);\n $city_id = $city->id;\n }\n\n while(($reg = fgetcsv($specializations)) !== FALSE){\n $speciality = Speciality::create([\n 'name'=>$reg[0]\n ]);\n $specialization_id = $speciality->id;\n }\n\n while(($clg = fgetcsv($colleges)) !== FALSE){\n $college = College::create([\n 'name'=>$clg[0]\n ]);\n $college_id = $college->id;\n }\n\n for($i=0 ; $i<50 ; $i++){\n $doctor = Doctor::create([\n 'fullname' => $faker->name,\n 'description' => $faker->sentence(rand(5,6)),\n 'fees' => rand(1000,10000),\n 'phone_no' => rand(1000000000,9999999999),\n 'password' => '$2y$10$ckpf//racepEDB9TGR2ZLu3JkVrPKUlaXorZIiWF4eZf87O83lPX2',\n 'email'=> $faker->unique()->safeEmail,\n 'city_id' => rand(1,$city_id),\n 'address' => $faker->sentence(rand(5,6)),\n 'gender' => 'male',\n 'country_code' => '+91',\n 'years_of_exp' => rand(5,20),\n 'slot_duration' => 15,\n 'speciality_id' => rand(1,$specialization_id),\n 'reg_no' => rand(1,200000),\n 'regcouncil_id' => rand(1,$regcouncil_id),\n 'degree_id' => rand(1,$degree_id),\n 'college_id' => rand(1,$college_id),\n 'establishment_name' => $faker->word,\n 'establishment_address' => $faker->sentence(rand(5,6)),\n 'establishment_city_id' => rand(1,$city_id),\n 'establishment_pincode' => rand(1000,999999),\n ]);\n\n $user = User::create([\n 'name' => $doctor->fullname,\n 'email' => $doctor->email,\n 'email_verified_at' => now(),\n 'password' => '$2y$10$ckpf//racepEDB9TGR2ZLu3JkVrPKUlaXorZIiWF4eZf87O83lPX2' , // password\n 'gender'=> $doctor->gender,\n 'role'=>'doctor',\n 'age'=>rand(20,50),\n 'phone_no'=> $doctor->phone_no,\n 'remember_token' => Str::random(10),\n 'doctor_id'=>$doctor->id\n ]);\n $doctor->type()->attach(rand(1,$type->id));\n }\n\n while(($cat = fgetcsv($categories)) !== FALSE){\n $category = Category::create([\n 'name'=>$cat[0]\n ]);\n $category_id = $category->id;\n }\n\n while(($subcat = fgetcsv($subcategories)) !== FALSE){\n $subcategory = Subcategory::create([\n 'name'=>$subcat[0],\n 'category_id'=>rand(1,$category_id),\n ]);\n $subcategory_id = $subcategory->id;\n }\n\n // $i=1;\n // while($i<15){\n // $i++;\n // $manufacturer = Manufacturer::create([\n // 'name'=>$faker->name,\n // 'user_id'=>$i\n // ]);\n // $manufacture_id = $manufacturer->id;\n // }\n\n\n $manufacturer = Manufacturer::create([\n 'name'=>\"John Doe\",\n 'user_id'=>1,\n \n ]);\n\n $manufacture_id = 1;\n\n\n // while(($ing = fgetcsv($ingredients)) !== FALSE){\n // $ingredient = Ingredient::create([\n // 'name'=>$ing[0]\n // ]);\n // $ingredient_id = $ingredient->id;\n // }\n\n while(($pro = fgetcsv($products)) !== FALSE){\n $product = Product::create([\n 'name'=>$pro[0],\n 'price'=>rand(100,1000),\n 'size'=>\"200 ml\",\n 'quantity'=>rand(20,50),\n 'category_id'=>rand(1,$category_id),\n 'subcategory_id'=>rand(1,$subcategory_id),\n 'description'=>$faker->sentence(rand(3,4)),\n 'how_to_use'=>$faker->sentence(rand(2,3)),\n 'benefits'=>$faker->sentence(rand(2,3)),\n 'highlights'=>$faker->sentence(rand(1,2)),\n 'manufacturer_id'=>rand(1,$manufacture_id),\n 'prescription_required'=>rand(0,1),\n ]);\n $product_id = $product->id;\n }\n\n $products = fopen('C:\\practocsv\\product.csv', 'r');\n while(($pro = fgetcsv($products)) !== FALSE){\n $product = Product::create([\n 'name'=>$pro[0],\n 'price'=>rand(100,1000),\n 'size'=>\"200 ml\",\n 'quantity'=>rand(20,50),\n 'category_id'=>rand(1,$category_id),\n 'subcategory_id'=>rand(1,$subcategory_id),\n 'description'=>$faker->sentence(rand(3,4)),\n 'how_to_use'=>$faker->sentence(rand(2,3)),\n 'benefits'=>$faker->sentence(rand(2,3)),\n 'highlights'=>$faker->sentence(rand(1,2)),\n 'manufacturer_id'=>rand(1,$manufacture_id),\n 'prescription_required'=>rand(0,1),\n ]);\n $product_id = $product->id;\n }\n\n Notification_type::create([\n 'name' => 'appointment-made',\n 'message' => 'You have Received a new appointment!'\n ]);\n\n Notification_type::create([\n 'name' => 'appointment-accepted',\n 'message' => 'Your appointment is confirmed!'\n ]);\n\n Notification_type::create([\n 'name' => 'appointment-rejected',\n 'message' => 'Sorry, your appointment is rejected'\n ]);\n\n Notification_type::create([\n 'name' => 'feedback',\n 'message' => 'you have received a new feedback'\n ]);\n\n Notification_type::create([\n 'name' => 'report',\n 'message' => 'Your report has been generated'\n ]);\n\n Notification_type::create([\n 'name' => 'manufacturer-request',\n 'message' => 'you have a new manufacturer registration'\n ]);\n\n Notification_type::create([\n 'name' => 'product-request',\n 'message' => 'you have a new product request'\n ]);\n\n Notification_type::create([\n 'name' => 'product-accept',\n 'message' => 'Your product is now approved'\n ]);\n\n Notification_type::create([\n 'name' => 'prescription',\n 'message' => 'You have received a prescription'\n ]);\n\n\n fclose($specializations);\n fclose($cities);\n fclose($degrees);\n fclose($regcouncils);\n fclose($colleges);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n $this->call(Tipo_DocumentoSeeder::class);\n\n $this->call(RolSeeder::class);\n\n $this->call(GeneroSeeder::class);\n\n $this->call(MaterialSeeder::class);\n\n $this->call(CategoriaSeeder::class);\n\n $this->call(ClasificacionSeeder::class);\n\n $this->call(UsuarioSeeder::class);\n\n $this->call(TallaSeeder::class);\n\n $this->call(ProductoSeeder::class);\n\n $this->call(ContactoSeeder::class);\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $data = [];\n for ($i = 0; $i < 100; $i++) {\n $data[] = [\n 'email' => $faker->email,\n 'password' => password_hash($faker->password, PASSWORD_DEFAULT),\n 'name' => $faker->name,\n 'is_verified' => $faker->boolean(),\n\n 'phone' => $faker->optional(0.9)->phoneNumber,\n 'photo_url' => $faker->imageUrl(),\n 'hobbies' => $faker->words(3, true),\n 'passion' => $faker->optional()->words(1, true),\n 'fav_quote' => $faker->optional()->sentence(6, true),\n 'fav_quote_author' => $faker->optional()->name,\n\n 'whatsapp' => $faker->optional(0.9)->phoneNumber,\n 'facebook' => $faker->optional(0.7)->userName,\n 'twitter' => $faker->optional(0.5)->userName,\n 'linkedin' => $faker->optional(0.3)->url,\n 'instagram' => $faker->optional(0.6)->userName,\n 'snapchat' => $faker->optional(0.5)->userName,\n 'website' => $faker->optional(0.4)->url,\n 'blog' => $faker->optional(0.4)->url,\n\n 'created_at' => $faker->dateTimeBetween(\"-2 years\", \"-1 year\")->format('Y-m-d H:i:s'),\n 'updated_at' => rand(0, 2) ? $faker->dateTimeThisYear->format('Y-m-d H:i:s') : null,\n ];\n }\n\n $this->insert('classmates', $data);\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 $faker = \\Faker\\Factory::create('zh_TW');\n\n foreach (range(1, 100) as $index) {\n $updatedAt = now()->subDays(rand(0, 500));\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'password' => Hash::make($faker->password),\n 'phone' => $faker->phoneNumber,\n 'description' => $faker->realText(rand(10, 100)),\n 'sex' => ($index % 2 == 0) ? '男' : '女',\n 'address' => $faker->address,\n 'birth' => now()->subDays(rand(5840, 36500)),\n 'created_at' => $updatedAt->subDays(rand(1, 3000)),\n 'updated_at' => $updatedAt,\n ]);\n }\n\n }", "public function run()\n {\n _Log::system(_Log::$INFO, 'seeding educations');\n $ed1 = new Education(['name'=>'TK']);$ed1->save();\n $ed2 = new Education(['name'=>'SD']);$ed2->save();\n $ed3 = new Education(['name'=>'SMP']);$ed3->save();\n $ed4 = new Education(['name'=>'SMU']);$ed4->save();\n $ed5 = new Education(['name'=>'Diploma']);$ed5->save();\n $ed6 = new Education(['name'=>'Sarjana']);$ed6->save();\n $ed7 = new Education(['name'=>'Magister']);$ed7->save();\n $ed8 = new Education(['name'=>'Doktor']);$ed8->save();\n $ed9 = new Education(['name'=>'Tidak Ada']);$ed9->save();\n _Log::system(_Log::$SUCCESS, 'seeding educations success');\n }", "public function run()\n {\n $faker = $this->fakerFactory->create();\n\n for ($i = 0; $i < 10; $i++) {\n $this->database->table(\"authors\")->insert([\n \"name\" => $faker->unique()->name,\n \"created_at\" => $faker->dateTimeThisYear,\n \"updated_at\" => $faker->dateTimeThisYear\n ]);\n }\n\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 // 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 // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 1000; $i++) {\n App\\TestData::create([\n 'username' => $faker->userName,\n 'name' => $faker->name,\n \n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // Let's make sure everyone has the same password and\n // let's hash it before the loop, or else our seeder\n // will be too slow.\n $password = Hash::make('password');\n\n User::create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n\n // And now let's generate a few dozen users for our app:\n for ($i = 0; $i < 10; $i++) {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'password' => $password,\n 'country' => $faker->country,\n 'gender' => 'male',\n 'number' => $faker->phoneNumber,\n 'username' => $faker->userName,\n 'birth_date' => $faker->date($format = 'Y-m-d' , $max = 'now'),\n 'institution_type' => $faker->word,\n 'institution_name' => $faker->company,\n 'department' => $faker->domainword,\n 'faculty' => $faker->colorName,\n 'education_level' => $faker->numberBetween($min = 100 , $max = 700),\n\n ]);\n }\n }", "public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\r\n {\r\n $this->seed('MnaraTableSeeder');\r\n\r\n }", "public function run()\n {\n\n $faker = Faker::create();\n foreach(range(1,100)as$index){\n\n \n DB::table('usuarios')->insert([\n 'nombre' => $faker->name(5),\n 'equipo' => $faker->state(4),\n 'nacionalidad'=> $faker->country(4)\n ]);}\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //$this->call(RolesAndPermissionsSeeder::class);\n //$this->call(CMSTableSeeder::class);\n //$this->call(IncidentTypesSeeder::class);\n //$this->call(RegistrarsSeeder::class);\n\n /*\n factory(App\\Incident::class, 50)->create();\n\n factory(\\App\\Inquiry::class, 10)\n ->create()\n ->each(function ($inq){\n $inq->incidents()->attach(\\App\\Incident::inRandomOrder()->take(random_int(1,5))->get());\n });\n */\n //$this->call(InquiryStatusSeeder::class);\n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function generate() {}", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1,100) as $index) {\n \\DB::table('modulos')->insert([\n 'descricao' => $faker->words(3,true),\n 'ativo' => $faker->boolean\n ]);\n }\n }", "public function run()\n {\n Site::factory(config('seeder.site_count'))\n ->has(Distribution::factory(2))\n ->has(SitedStock::factory(config('seeder.sitedstock_count')))\n ->create();\n \n DB::table('sites')->insert([\n 'radar_name'=>'DWSR-2501C',\n 'image'=>'027ce6f5bc035a08d207f0de97b23965.png',\n 'station_id'=>'Banjarmasin'\n ]);\n DB::table('sites')->insert([\n 'radar_name'=>'DWSR-3501C',\n 'image'=>'027ce6f5bc035a08d207f0de97b23965.png',\n 'station_id'=>'Cengkareng'\n ]);\n }", "public function run()\n {\n \t// php artisan db:seed --class=Chuckbe\\\\ChuckcmsTemplateFrankfurt\\\\seeds\\\\ChuckcmsTemplateFrankfurtTableSeeder\n $fonts = [];\n $fonts['raw'] = 'Roboto:100,300,400,400italic,700|Patua+One:100,300,400,400italic,700|Lato:400,400italic,700,700italic,900|Roboto:100,300,400,400italic,500,700,700italic|Montserrat:100,300,400,400italic,500,700,700italic';\n \n $css = [];\n $css['global']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/global.css';\n $css['global']['asset'] = 'true';\n\n $css['structure']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/structure.css';\n $css['structure']['asset'] = 'true';\n\n $css['frankfurt']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/frankfurt.css';\n $css['frankfurt']['asset'] = 'true';\n\n $css['custom']['href'] = 'chuckbe/chuckcms-template-frankfurt/css/custom.css';\n $css['custom']['asset'] = 'true';\n \n $js = []; \n $js['jquery']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery-2.1.4.min.js';\n $js['jquery']['asset'] = 'true';\n\n $js['mfnmenu']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/mfn.menu.js';\n $js['mfnmenu']['asset'] = 'true';\n\n $js['jqueryplugins']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery.plugins.js';\n $js['jqueryplugins']['asset'] = 'true';\n\n $js['jqueryjplayer']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/jquery.jplayer.min.js';\n $js['jqueryjplayer']['asset'] = 'true';\n\n $js['animations']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/animations/animations.js';\n $js['animations']['asset'] = 'true';\n\n $js['translate3d']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/translate3d.js';\n $js['translate3d']['asset'] = 'true';\n\n $js['scripts']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/scripts.js';\n $js['scripts']['asset'] = 'true';\n\n $js['email']['href'] = 'chuckbe/chuckcms-template-frankfurt/js/email.js';\n $js['email']['asset'] = 'true';\n\n $json = [];\n\n // create template\n Template::updateOrCreate(\n ['slug' => 'chuckcms-template-frankfurt'],\n ['name' => 'ChuckCMS Template Frankfurt',\n 'hintpath' => 'chuckcms-template-frankfurt',\n 'path' => 'chuckbe/chuckcms-template-frankfurt',\n 'type' => 'default',\n 'version' => '0.1',\n 'author' => 'Karel Brijs ([email protected])',\n 'fonts' => $fonts,\n 'css' => $css,\n 'js' => $js,\n 'json' => $json,\n 'active' => 1]\n );\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n foreach (range(1,50) as $index) {\n $data = [\n 'id' => $faker->id,\n 'txt_protocolo' => $faker->unique()->txt_protocolo,\n ];\n Protocolo::create($data);\n }\n }", "public function run()\n {\n // *****Data Using Manually*********\n // $student = [\n // [\n // 'name'=>'Jogi',\n // 'lastname'=>'Singh',\n // ],\n // [\n // 'name'=>'Jonty',\n // 'lastname'=>'Singh',\n // ],\n // [\n // 'name'=>'Harsh',\n // 'lastname'=>'Srivastav',\n // ],\n \n // ];\n\n // foreach ($student as $key => $value) {\n // Student::create($value);\n // }\n // *******End Data Manually*************\n // *****************Data Dump Using Faker*******************\n $faker = Faker::create();\n foreach (range(1,100) as $key => $value) {\n Student::create(\n [\n 'name'=>$faker->name,\n 'lastname'=>$faker->lastname\n ]\n );\n }\n\n }", "public function run()\n\n {\n\n DB::table('user')->insert([\n 'name'=> 'Admin',\n 'phonenumber'=>'01694844753',\n 'password'=>hash('ripemd160','123456'),\n 'avatar'=>'/img/unknowavatar.png',\n ]);\n $faker = Faker\\Factory::create();\n\n for($i=0; $i<5; $i++){\n \n DB::table('user')->insert([\n 'name'=> $faker->name,\n 'phonenumber'=>$faker->phoneNumber,\n 'password'=> Str::random(10),\n 'avatar'=>$faker->image,\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// $this->seedTestForms($faker);\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 // \\App\\Models\\User::factory(10)->create();\n \n //لازم المودل يكون عامل \n //has Facroty عشان اقدر استعملو \n //لتنفيذ الفاكتوري\n // Category::factory(19)->create();\n\n Product::factory(199)->create();\n //Tag::factory(15)->create();\n\n //هنا بستدعي السيدر عشان انفذو\n // $this->call(CategoriesTableSeeder::class);\n\n /*\n Category::factory(10)\n ->has(Category::factory(5)\n ->has(Product::factory(15),'products')\n ,'children')\n ->create();\n*/\n\n }", "public function run()\n {\n factory(\\App\\Models\\Discusse::class,config('other.seeder_count'))->create([\n 'is_better' => 0\n ]);\n factory(\\App\\Models\\Discusse::class,config('other.seeder_count'))->create([\n 'is_better' => 1\n ]);\n }", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1,50) as $index) {\n DB::table('empleado')->insert([\n 'dni' => $faker->numberBetween(20000000, 43000000),\n 'apellidonombre' => $faker->firstName(). \" \" . $faker->lastName(),\n 'idempleadocapataz' => rand(1, 50),\n 'especialidad' => $faker->jobTitle(),\n ]);\n }\n }", "public function run()\n {\n $count = Regency::count();\n if($count == 0) {\n return $this->command->alert(\n 'Seed Error !! Silahkan Seed Regency Terlebih Dahulu'\n );\n }\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n District::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n $data = array_map('str_getcsv', file(base_path().\"/storage/districts.csv\"));\n foreach ($data as $x) {\n $prov = new District();\n $prov->id = $x[0];\n $prov->regency_id = $x[1];\n $prov->name = $x[2];\n $prov->save();\n }\n }", "public function run()\n {\n $faker=Faker::create();\n foreach (range(1,20) as $i){\n DB::table('personas')->insert([\t \n 'nombre' => $faker->name(),\n 'apellido' => $faker->lastName(),\n 'correo' => $faker->email(),\n 'edad'=>$faker->randomNumber(2),\n ]);\n }\n // factory(personas::class, 99)->create();\n }", "public function run()\n {\n //\n $faker = Faker::create();\n\n for ($i = 0; $i < 100; $i++) {\n $data = [\n 'pelanggan' => $faker->name,\n 'alamat' => $faker->address,\n 'telp' => $faker->phoneNumber,\n ];\n\n Pelanggan::create($data);\n }\n }", "public function run()\n {\n DB::table('users')->delete();\n $json = File::get(\"database/seederfile/users.json\");\n $data = json_decode($json);\n foreach($data as $obj)\n { User::create(array(\n \t'id' => $obj -> id,\n \t'role_id' => $obj -> role_id,\n \t'username' => $obj -> username,\n \t'name' => $obj -> name,\n \t'email' => $obj -> email,\n #'password' => Hash::make('admin1')]);\n \t'password' => Hash::make($obj -> password),\n\t\t\t'remember_token' => $obj -> remember_token,\n \t'created_at' => $obj -> created_at,\n\t\t\t'updated_at' => $obj -> updated_at\n ));\n\t\t}\n }", "public function run()\n {\n //\n// factory(\\App\\Bill::class,10)->create();\n \\App\\Helpers\\FactoryHelper::force_seed(\\App\\Bill::class,4);\n }", "public function run()\n {\n\t\t// Let's truncate our existing records to start from scratch.\n File::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 File::create([\n 'name' => $faker->name,\n\t\t\t\t'user_id' => User::first()->id,\n ]);\n }\n }", "public function run()\n {\n // Create my personal user\n $email = env('ADMIN_USER_EMAIL', false);\n $password = env('ADMIN_USER_PASSWORD', false);\n if (!$email || !$password) {\n throw new \\Exception('You must set admin credentials in .env before seeding');\n }\n $jakob = factory(App\\User::class)->create([\n 'name' => 'Jakob Buis',\n 'email' => $email,\n 'password' => bcrypt($password),\n ]);\n\n // Create the frontend as password-grant client\n $client = (new \\Laravel\\Passport\\Client)->forceFill([\n 'user_id' => $jakob->id,\n 'name' => 'librorum-frontend',\n 'secret' => str_random(40),\n 'redirect' => env('APP_URL'),\n 'personal_access_client' => false,\n 'password_client' => true,\n 'revoked' => false,\n ]);\n $client->save();\n\n // Create the content\n $tags = factory(\\App\\Tag::class, 5)->create(['user_id' => $jakob->id]);\n\n // Create 5 notebooks, each with 3 pages\n // each linked to 2 randomly selected tags\n $notebooks = factory(\\App\\Notebook::class, 5)->create(['user_id' => $jakob->id]);\n $notebooks->each(function($notebook) use ($tags) {\n\n $pages = factory(\\App\\Page::class, 3)->create([\n 'notebook_id' => $notebook->id,\n ]);\n\n $pages->each(function($page) use ($tags) {\n $page->tags()->attach($tags->random(2));\n });\n });\n }", "public function run()\n {\n $faker = Faker\\Factory::create('en_US');\n\n foreach(range(1, 10) as $index) {\n Institute::create([\n 'inst_profile_guid' => $faker->uuid,\n 'user_id' => rand(1, 20),\n 'institute_code' => $faker->postcode,\n 'institute_name' => $faker->company,\n 'institute_description' => $faker->sentence,\n 'contact' => $faker->phoneNumber,\n 'address' => $faker->address,\n 'city' => $faker->city,\n 'postal_code' => $faker->postcode,\n 'country' => $faker->country\n ]);\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('App\\Meet');\n\n for($i = 1; $i <= 20; $i ++){\n \tDB::table('meets')->insert([\n \t\t'user_id' => $faker->numberBetween($min = 1, $max = 20),\n \t\t'title' => $faker->sentence(),\n \t\t'meet_date' => $faker->dateTimeThisYear($max = 'now', $timezone = date_default_timezone_get()),\n \t\t'location' => $faker->streetName,\n \t\t'lat' => $faker->latitude($min = -90, $max = 90),\n \t\t'lng' => $faker->longitude($min = -180, $max = 180),\n \t\t'description' => implode($faker->paragraphs(5)),\n \t\t'deleted' => 0,\n \t\t'updated_at' => \\Carbon\\Carbon::now(),\n \t\t'created_at' => \\Carbon\\Carbon::now(),\n \t\t]);\n }\n\n\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(AttributesSeeder::class);\n\n File::factory()->count(10)->create();\n\n // Get all the attributes attaching up to 3 random attributes to each file\n $attributes = Attribute::all();\n\n // Populate the pivot table\n File::all()->each(function ($file) use ($attributes) {\n $file->attributes()->attach(\n $attributes->random(rand(1, 5))->pluck('id')->toArray(),\n [\n 'order' => rand(1, 5)\n ]\n );\n });\n\n Model::reguard();\n }", "public function run()\n {\n // DB::table('users')->truncate(); //elimina la bd cada vez que realizo el seed\n\n \n\n \n\n\n factory(App\\User::class,10)->create();\n\n factory(App\\User::class)->create([\n 'name' =>'Administrador',\n 'email' =>'[email protected]',\n 'role' =>'admin',\n 'password'=>bcrypt('secret')\n\n ]);\n\n\n factory(App\\hotel::class,1)->create();\n \n \n\n }", "public function run()\n {\n //$this->call(SectionSeeder::class);\n $this->call(AdminSeeder::class);\n //$this->call(ClientSeeder::class);\n \n \n\n\n\n //DB::table('users')->insert([\n // 'name' => 'Harry Han',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // 'contractorLastname' => 'Han',\n // 'contractorCompany' => 'test-company' ,\n // 'contractorContactNumber' => '0600000000',\n // 'contractorStatus' => 'active'\n //]);\n }", "public function run()\n {\n $seeds = [\n [\n 'id'=>1,\n 'user_id'=>'1',\n 'firstname'=>'Jonas',\n 'lastname'=>'Jonaitis',\n 'position'=>'Administratorius',\n 'email'=>'[email protected]',\n 'phone'=>'Nėra',\n 'birthday'=>'2017-04-05',\n 'photo'=>'150x150.png',\n ],\n ];\n\n foreach ($seeds as $seed) {\n \\App\\Profile::create($seed);\n }\n }", "public function run()\n {\n \t$faker = Factory::create();\n \tfor ($i=0; $i <99 ; $i++) { \n \t\tKontak::create([\n \t\t\t'nama'=>$faker->name,\n \t\t\t'email'=>$faker->email,\n \t\t\t'foto'=>$faker->text\n \t\t]);\n \t}\n }", "public function run()\n\t{\n\n $faker = \\Faker\\Factory::create();\n\n // Let's make sure everyone has the same password and \n // let's hash it before the loop, or else our seeder \n // will be too slow.\n $password = Hash::make('aa2016aa');\n\n User::create([\n 'type' => '1',\n 'fname' => 'artiom',\n 'lname' => 'live',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n\n User::create([\n 'type' => '0',\n 'fname' => 'artiom',\n 'lname' => 'demo',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n // Admin Acount Seeding\n $add = new User;\n $add->name = 'karim';\n $add->email= '[email protected]';\n $add->password = Hash::make(123456);\n $add->phone = '01126878406';\n $add->prefix = 'karim';\n $add->level = 'admin';\n $add->save();\n\n //Language Seeding\n $language = new Languages;\n $language->language = \"English\";\n $language->prefix = \"en\";\n $language->direction = \"ltr\";\n $language->save();\n\n //Setting Seeding\n $appSetting = new Setting;\n $appSetting->sitename = \"Cure2Us\";\n $appSetting->email = \"[email protected]\";\n $appSetting->save();\n }", "public function run()\n {\n //\n \t$fake = \\Faker\\Factory::create();\n \\DB::table('users')->insert([\n 'name' => 'Nguyễn Văn Hiệp',\n 'email' => '[email protected]',\n 'is_admin' => '1',\n 'password'=> bcrypt('12345678')\n ]);\n for ($i=0; $i < 20; $i++) {\n \\DB::table('users')->insert([\n 'name' => $fake->name,\n 'email' => $fake->email,\n 'password'=> bcrypt('12345678')\n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++)\n {\n $gender = array_rand(['Men', 'Women'], 1);\n\n User::create([\n 'id' => ($i + 1),\n 'first_name' => $faker->firstName($gender == 0 ? 'male' : 'female'),\n 'last_name' => $faker->lastName,\n 'sex' => ($gender == 0 ? 'Men' : 'Women'),\n 'birthday' => $faker->date('Y-m-d', 'now'),\n 'email' => $faker->email,\n 'address' => $faker->address,\n 'telephone' => rand(1111111111,9999999999)\n ]);\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create('fr_FR');\n\n for($i=0; $i<5; $i++){\n\n $data = [\n [\n 'pseudo' => $faker->userName,\n 'email' => $faker->unique()->email,\n 'firstname' => $faker->firstName,\n 'lastname' => $faker->lastName,\n 'password' => $faker->password,\n 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'nbateam_id' => 1,\n ]\n ];\n User::insert($data);\n\n }\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n foreach (range(1, 20) as $value) {\n User::create([\n 'name' => $faker->text('20'),\n 'email' => $faker->email,\n 'dob'=> $faker->date(),\n 'password' => bcrypt('anhvit12'),\n ]);\n\n }\n }", "public function run()\n {\n if (!File::exists(public_path('uploads/faker/heritage'))) {\n File::makeDirectory(public_path('uploads/faker/heritage'), 777, true);\n }\n $faker = Faker\\Factory::create();\n for ($i = 0; $i < 16; $i++) {\n $data = [\n 'title' => $faker->sentence(),\n 'description' => theExcerpt($faker->paragraph, 255),\n 'content' => $faker->text(2000),\n 'thumbnail' => 'uploads/faker/heritage/' . $faker->image(public_path('uploads/faker/heritage'), 420, 236, null, false),\n 'cover' => 'uploads/faker/heritage/' . $faker->image(public_path('uploads/faker/heritage'), 1170, 150, null, false),\n 'province_id' => rand(1, 63),\n 'area_id' => rand(63, 70),\n 'user_id' => rand(1, 10),\n 'lang' => 'en',\n 'parent_id' => 0,\n 'status' => STATUS_ACTIVATED\n ];\n \\App\\IZee\\Heritages\\Heritage::create($data);\n }\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n $gender = $faker->randomElement(['L', 'P']);\n $religion = $faker->randomElement(['Kristen', 'Islam', 'Budha']);\n\n for ($i=0; $i < 20; $i++) { \n DB::table('siswa')->insert([\n 'nama_depan' => $faker->firstName,\n 'nama_belakang' => $faker->lastName,\n 'jenis_kelamin' => $gender,\n 'agama' => $religion,\n 'alamat' => $faker->address\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n\n foreach(range(1, 10) as $index)\n {\n User::create([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'username' => $faker->userName,\n 'password' => $faker->password,\n 'location' => $faker->text,\n 'profile_picture' => $faker->imageUrl($width = 550, $height = 550)\n ]);\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $samples_temp = [];\n\n for($i = 0; $i < 100; $i++)\n {\n $samples_temp[] = [\n 'nombre' => $faker->name,\n 'email'=> $faker->email\n\n ];\n }\n Correo::insert($samples_temp);\n\n\n }", "public function run()\n {\n $faker = $faker = Faker\\Factory::create();\n foreach (range(1,250) as $index) {\n DB::table('employee')->insert([\n 'employee_first_name' => $faker->name,\n 'employee_last_name' => $faker->name,\n 'employee_ref_number' => 00000,\n 'employee_phone_number' => rand(0,5),\n 'employee_address' => $faker->name,\n 'employee_address_two' => $faker->name,\n 'employee_country' => $faker->name,\n 'employee_state' => $faker->state,\n 'employee_city' => $faker->city,\n 'employee_email' => $faker->email,\n 'employee_pin_code' => rand(0,5),\n 'employee_reference' => $faker->name,\n 'employee_unique_identy' => $faker->name,\n ]);\n }\n }", "public function run()\n {\n $facker = app(Faker\\Generator::class);\n\n $avatars = [\n 'https://avatars3.githubusercontent.com/u/41312704?s=460&v=4',\n 'https://cdn.learnku.com/uploads/avatars/24327_1530087651.jpeg!/both/200x200',\n ];\n\n $users = factory(User::class)\n ->times(10)\n ->make()\n ->each(function ($user, $index) use ($facker, $avatars) {\n $user->avatar = $facker->randomElement($avatars);\n });\n $user_array = $users->makeVisible(['password', 'remember_token'])->toArray();\n User::insert($user_array);\n\n $user = User::find(1);\n $user->name = '十步';\n $user->email = '[email protected]';\n $user->avatar = 'https://avatars3.githubusercontent.com/u/41312704?s=460&v=4';\n $user->save();\n\n // 初始化用户角色,将1号用户设置为站长\n $user->assignRole('Founder');\n $user = User::find(2);\n $user->assignRole('Maintainer');\n }", "public function run()\n {\n User::create ( [\n 'username' => 'anh.tuan',\n 'first_name' => 'Tuan',\n 'last_name' => 'Nguyen',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n 'password' => bcrypt('123456')\n ]);\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Faker::create();\n User::create ( [\n 'username' => $faker->userName,\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName ,\n 'email' => $faker->email,\n 'is_admin' => 0,\n 'password' => bcrypt('123456')\n ]);\n }\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n for($i =0; $i<20; $i++){\n \\App\\Organisation::create([\n 'name' => $faker->company,\n 'business_type_id' => $faker->numberBetween(1, 3),\n 'logo'=>$faker->imageUrl($width = 200, $height = 200, 'abstract',true),\n 'address' => $faker->address,\n 'email' => $faker->companyEmail,\n 'mobile' => $faker->numberBetween(263772000000,263779999999),\n 'telephone'=>$faker->numberBetween(240291,29999)\n ]);\n }\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\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 {\n $faker = Faker::create();\n\n for($i = 0; $i < 50; $i++){\n $uid = DB::table('users')->select('id')->inRandomOrder()->first();\n $student = new Student([\n 'first_name' => $faker->firstName,\n 'last_name' => $faker->lastName,\n 'teacher_id' => $uid->id,\n 'code' => $faker->bothify('**********')\n ]);\n\n $student->save();\n }\n }", "public function run()\n {\n $faker = Faker::create();\n $preUach = PreUach::all();\n $samples_temp = [];\n\n foreach ($preUach as $item)\n {\n\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'persona_matricula'=> $faker->lastName.' '. $faker->firstName,\n 'fecha_matricula'=>$faker->dateTimeBetween($startDate = '-5 months', $endDate = 'now')\n ]; \t\n }\n\n Declaracion::insert($samples_temp);\n \n }" ]
[ "0.741271", "0.72163844", "0.71867263", "0.7150963", "0.7011614", "0.6992453", "0.6889081", "0.6877449", "0.68096465", "0.679051", "0.67819595", "0.6763185", "0.6725394", "0.67226577", "0.67199546", "0.67100257", "0.6709864", "0.67040205", "0.6703833", "0.66986066", "0.66848785", "0.66676813", "0.6664289", "0.66619146", "0.6658433", "0.6657409", "0.66464853", "0.66320693", "0.6631319", "0.66305304", "0.66290253", "0.66284007", "0.6624839", "0.6623553", "0.6619334", "0.6618539", "0.6608564", "0.65820485", "0.65815806", "0.65786946", "0.65776837", "0.65724593", "0.65712655", "0.6568998", "0.6564165", "0.65635526", "0.65632516", "0.6561539", "0.65603864", "0.6557867", "0.6557867", "0.6557841", "0.6557841", "0.6557841", "0.6557841", "0.6557841", "0.6556947", "0.6555183", "0.6549153", "0.65489244", "0.654778", "0.6542256", "0.6541639", "0.6536023", "0.65329695", "0.6532951", "0.6532415", "0.65314263", "0.65287995", "0.6528459", "0.65275294", "0.6521118", "0.6521097", "0.6520966", "0.6520696", "0.65203667", "0.6519488", "0.6513222", "0.651225", "0.6512065", "0.6511974", "0.6510938", "0.6509229", "0.6507844", "0.65072274", "0.6500883", "0.65005153", "0.64961535", "0.6495031", "0.6491838", "0.6490735", "0.6488336", "0.64861405", "0.6485924", "0.6479967", "0.6479224", "0.6478154", "0.6477599", "0.6476717", "0.64762294", "0.64754003" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id,true); $criteria->compare('calendardata',$this->calendardata,true); $criteria->compare('uri',$this->uri,true); $criteria->compare('calendarid',$this->calendarid,true); $criteria->compare('lastmodified',$this->lastmodified,true); $criteria->compare('etag',$this->etag,true); $criteria->compare('size',$this->size,true); $criteria->compare('componenttype',$this->componenttype,true); $criteria->compare('firstoccurence',$this->firstoccurence,true); $criteria->compare('lastoccurence',$this->lastoccurence,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('model_id',$this->model_id,true);\n $criteria->compare('color',$this->color,true);\n $criteria->compare('is_in_pare',$this->is_in_pare);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('generator_id',$this->generator_id,true);\n\t\t$criteria->compare('serial_number',$this->serial_number,true);\n\t\t$criteria->compare('model_number',$this->model_number,true);\n\t\t$criteria->compare('manufacturer_name',$this->manufacturer_name,true);\n\t\t$criteria->compare('manufacture_date',$this->manufacture_date,true);\n\t\t$criteria->compare('supplier_name',$this->supplier_name,true);\n\t\t$criteria->compare('date_of_purchase',$this->date_of_purchase,true);\n\t\t$criteria->compare('date_of_first_use',$this->date_of_first_use,true);\n\t\t$criteria->compare('kva_capacity',$this->kva_capacity);\n\t\t$criteria->compare('current_run_hours',$this->current_run_hours);\n\t\t$criteria->compare('last_serviced_date',$this->last_serviced_date,true);\n\t\t$criteria->compare('engine_make',$this->engine_make,true);\n\t\t$criteria->compare('engine_model',$this->engine_model,true);\n\t\t$criteria->compare('fuel_tank_capacity',$this->fuel_tank_capacity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('idmodel',$this->idmodel);\n\t\t$criteria->compare('usuario_anterior',$this->usuario_anterior);\n\t\t$criteria->compare('usuario_nuevo',$this->usuario_nuevo);\n\t\t$criteria->compare('estado_anterior',$this->estado_anterior,true);\n\t\t$criteria->compare('estado_nuevo',$this->estado_nuevo,true);\n\t\t$criteria->compare('fecha',$this->fecha,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('car',$this->car,true);\n\t\t$criteria->compare('source_id',$this->source_id,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('client_type_id',$this->client_type_id,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('other',$this->other,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t// $criteria->compare('text',$this->text,true);\n\t\t// $criteria->compare('record',$this->record,true);\n\t\t$criteria->compare('user',$this->user,true);\n\t\t$criteria->compare('createdBy',$this->createdBy,true);\n\t\t$criteria->compare('viewed',$this->viewed);\n\t\t$criteria->compare('createDate',$this->createDate,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('comparison',$this->comparison,true);\n\t\t// $criteria->compare('value',$this->value,true);\n\t\t$criteria->compare('modelType',$this->modelType,true);\n\t\t$criteria->compare('modelId',$this->modelId,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('Currency_ID',$this->Currency_ID);\n\t\t$criteria->compare('CurrencyNo',$this->CurrencyNo,true);\n\t\t$criteria->compare('ExchangeVND',$this->ExchangeVND,true);\n\t\t$criteria->compare('AppliedDate',$this->AppliedDate,true);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('firm',$this->firm,true);\n\t\t$criteria->compare('change_date',$this->change_date,true);\n\t\t$criteria->compare('item_id',$this->item_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('availability',$this->availability,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('bonus',$this->bonus,true);\n\t\t$criteria->compare('shipping_cost',$this->shipping_cost,true);\n\t\t$criteria->compare('product_page',$this->product_page,true);\n\t\t$criteria->compare('sourse_page',$this->sourse_page,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('column_id',$this->column_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('condition',$this->condition,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('industry',$this->industry,true);\n\t\t$criteria->compare('industry_sub',$this->industry_sub,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('province',$this->province,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('contact_name',$this->contact_name,true);\n\t\t$criteria->compare('contact_tel',$this->contact_tel,true);\n\t\t$criteria->compare('ip',$this->ip,true);\n\t\t$criteria->compare('source',$this->source,true);\n $criteria->compare('status',$this->status);\n\t\t$criteria->compare('update_time',$this->update_time);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('notes',$this->notes);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('university',$this->university,true);\n\t\t$criteria->compare('major',$this->major,true);\n\t\t$criteria->compare('gpa',$this->gpa,true);\n\t\t$criteria->compare('appl_term',$this->appl_term);\n\t\t$criteria->compare('toefl',$this->toefl);\n\t\t$criteria->compare('gre',$this->gre);\n\t\t$criteria->compare('appl_major',$this->appl_major,true);\n\t\t$criteria->compare('appl_degree',$this->appl_degree,true);\n\t\t$criteria->compare('appl_country',$this->appl_country,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('goods_code',$this->goods_code,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('brand_id',$this->brand_id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('size',$this->size,true);\n\t\t$criteria->compare('material',$this->material,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('purchase_price',$this->purchase_price,true);\n\t\t$criteria->compare('selling_price',$this->selling_price,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ContractsDetailID',$this->ContractsDetailID,true);\n\t\t$criteria->compare('ContractID',$this->ContractID,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\t\t$criteria->compare('CustomerID',$this->CustomerID,true);\n\t\t$criteria->compare('Share',$this->Share);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('meta_title',$this->meta_title,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria = $this->criteriaSearch();\r\n\t\t$criteria->limit = 10;\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('organizationName',$this->organizationName,true);\n\t\t$criteria->compare('contactNo',$this->contactNo,true);\n\t\t$criteria->compare('partnerType',$this->partnerType);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('emailId',$this->emailId,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('firstName',$this->firstName,true);\n\t\t$criteria->compare('lastName',$this->lastName,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_ID,$this->{Globals::FLD_NAME_ACTIVITY_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_TASK_ID,$this->{Globals::FLD_NAME_TASK_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_BY_USER_ID,$this->{Globals::FLD_NAME_BY_USER_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_TYPE,$this->{Globals::FLD_NAME_ACTIVITY_TYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_SUBTYPE,$this->{Globals::FLD_NAME_ACTIVITY_SUBTYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_COMMENTS,$this->{Globals::FLD_NAME_COMMENTS},true);\n\t\t$criteria->compare(Globals::FLD_NAME_CREATED_AT,$this->{Globals::FLD_NAME_CREATED_AT},true);\n\t\t$criteria->compare(Globals::FLD_NAME_SOURCE_APP,$this->{Globals::FLD_NAME_SOURCE_APP},true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('manufacturers_image',$this->manufacturers_image,true);\n\t\t$criteria->compare('date_added',$this->date_added);\n\t\t$criteria->compare('last_modified',$this->last_modified);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_clicked',$this->url_clicked);\n\t\t$criteria->compare('date_last_click',$this->date_last_click);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('date',$this->date);\n\t\t$criteria->compare('del',$this->del);\n\t\t$criteria->compare('action_id',$this->action_id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('catalog',$this->catalog,true);\n\t\t$criteria->compare('is_new',$this->is_new);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('case',$this->case);\n\t\t$criteria->compare('basis_doc',$this->basis_doc);\n\t\t$criteria->compare('calc_group',$this->calc_group);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('competition',$this->competition);\n\t\t$criteria->compare('partner',$this->partner);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('website',$this->website,true);\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('data_attributes_fields',$this->data_attributes_fields,true);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('created',$this->created,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('skill_id',$this->skill_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('account_id',$this->account_id);\n\t\t$criteria->compare('field_name',$this->field_name);\n\t\t$criteria->compare('content',$this->content);\n\t\t$criteria->compare('old_data',$this->old_data,true);\n\t\t$criteria->compare('new_data',$this->new_data,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_updated',$this->date_updated,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('company_id',$this->company_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('validator',$this->validator,true);\n\t\t$criteria->compare('position',$this->position);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n $criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('display_name',$this->display_name,true);\n $criteria->compare('actionPrice',$this->actionPrice);\n\t\t$criteria->compare('translit',$this->translit,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('display_description',$this->display_description,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\t\t$criteria->compare('editing',$this->editing);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n\t\t));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('BrandID', $this->BrandID);\n $criteria->compare('BrandName', $this->BrandName, true);\n $criteria->compare('Pinyin', $this->Pinyin, true);\n $criteria->compare('Remarks', $this->Remarks, true);\n $criteria->compare('OrganID', $this->OrganID);\n $criteria->compare('UserID', $this->UserID);\n $criteria->compare('CreateTime', $this->CreateTime);\n $criteria->compare('UpdateTime', $this->UpdateTime);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('componente_id',$this->componente_id);\n\t\t$criteria->compare('tipo_dato',$this->tipo_dato,true);\n\t\t$criteria->compare('descripcion',$this->descripcion,true);\n\t\t$criteria->compare('cruce_automatico',$this->cruce_automatico,true);\n\t\t$criteria->compare('sw_obligatorio',$this->sw_obligatorio,true);\n\t\t$criteria->compare('orden',$this->orden);\n\t\t$criteria->compare('sw_puntaje',$this->sw_puntaje,true);\n\t\t$criteria->compare('sw_estado',$this->sw_estado,true);\n\t\t$criteria->compare('todos_obligatorios',$this->todos_obligatorios,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('real_name',$this->real_name,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('zip_code',$this->zip_code,true);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('district_id',$this->district_id);\n\t\t$criteria->compare('district_address',$this->district_address,true);\n\t\t$criteria->compare('street_address',$this->street_address,true);\n\t\t$criteria->compare('is_default',$this->is_default);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('update_time',$this->update_time);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('EMCE_ID',$this->EMCE_ID);\n\t\t$criteria->compare('MOOR_ID',$this->MOOR_ID);\n\t\t$criteria->compare('EVCR_ID',$this->EVCR_ID);\n\t\t$criteria->compare('EVES_ID',$this->EVES_ID);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('customerName',$this->customerName,true);\n\t\t$criteria->compare('agencyHead',$this->agencyHead,true);\n\t\t$criteria->compare('region_id',$this->region_id);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('municipalityCity_id',$this->municipalityCity_id);\n\t\t$criteria->compare('barangay_id',$this->barangay_id);\n\t\t$criteria->compare('houseNumber',$this->houseNumber,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('nature_id',$this->nature_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('created_by',$this->created_by);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->name,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('state',$this->address,true);\n\t\t$criteria->compare('country',$this->address,true);\n\t\t$criteria->compare('contact_number',$this->contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('is_deleted',$this->is_deleted);\n\t\t$criteria->compare('deleted_by',$this->deleted_by,true);\n\t\t$criteria->compare('created_at',$this->created_at,true);\n\t\t$criteria->compare('updated_at',$this->updated_at,true);\n\t\tif(YII::app()->user->getState(\"role\") == \"admin\") {\n\t\t\t$criteria->condition = 'is_deleted = 0';\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('professional_status_id',$this->professional_status);\n\t\t$criteria->compare('birthday',$this->birthday);\n\t\t$criteria->compare('location',$this->location);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\r\n\t{\r\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\r\n\r\r\n\t\t$criteria=new CDbCriteria;\r\r\n\r\r\n\t\t$criteria->compare('id',$this->id);\r\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\r\n\t\t$criteria->compare('adds',$this->adds);\r\r\n\t\t$criteria->compare('edits',$this->edits);\r\r\n\t\t$criteria->compare('deletes',$this->deletes);\r\r\n\t\t$criteria->compare('view',$this->view);\r\r\n\t\t$criteria->compare('lists',$this->lists);\r\r\n\t\t$criteria->compare('searches',$this->searches);\r\r\n\t\t$criteria->compare('prints',$this->prints);\r\r\n\r\r\n\t\treturn new CActiveDataProvider($this, array(\r\r\n\t\t\t'criteria'=>$criteria,\r\r\n\t\t));\r\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('applyId',$this->applyId);\n\t\t$criteria->compare('stuId',$this->stuId);\n\t\t$criteria->compare('stuName',$this->stuName,true);\n\t\t$criteria->compare('specification',$this->specification,true);\n\t\t$criteria->compare('assetName',$this->assetName,true);\n\t\t$criteria->compare('applyTime',$this->applyTime,true);\n\t\t$criteria->compare('loanTime',$this->loanTime,true);\n\t\t$criteria->compare('returnTime',$this->returnTime,true);\n\t\t$criteria->compare('RFID',$this->RFID,true);\n\t\t$criteria->compare('stuTelNum',$this->stuTelNum,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('itemcode', $this->itemcode, true);\n $criteria->compare('product_id', $this->product_id, true);\n $criteria->compare('delete_flag', $this->delete_flag);\n $criteria->compare('status', $this->status);\n $criteria->compare('expire', $this->expire, true);\n $criteria->compare('date_input', $this->date_input, true);\n $criteria->compare('d_update', $this->d_update, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('verid',$this->verid);\n\t\t$criteria->compare('appversion',$this->appversion,true);\n\t\t$criteria->compare('appfeatures',$this->appfeatures,true);\n\t\t$criteria->compare('createtime',$this->createtime,true);\n\t\t$criteria->compare('baseNum',$this->baseNum);\n\t\t$criteria->compare('slave1Num',$this->slave1Num);\n\t\t$criteria->compare('packagename',$this->packagename,true);\n\t\t$criteria->compare('ostype',$this->ostype);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('client_id',$this->client_id,true);\n\t\t$criteria->compare('extension',$this->extension,true);\n\t\t$criteria->compare('rel_type',$this->rel_type,true);\n\t\t$criteria->compare('rel_id',$this->rel_id,true);\n\t\t$criteria->compare('meta_key',$this->meta_key,true);\n\t\t$criteria->compare('meta_value',$this->meta_value,true);\n\t\t$criteria->compare('date_entry',$this->date_entry,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('column_id',$this->column_id,true);\n\t\t$criteria->compare('research_title',$this->research_title,true);\n\t\t$criteria->compare('research_url',$this->research_url,true);\n\t\t$criteria->compare('column_type',$this->column_type);\n\t\t$criteria->compare('filiale_id',$this->filiale_id,true);\n\t\t$criteria->compare('area_name',$this->area_name,true);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('trigger_config',$this->trigger_config);\n\t\t$criteria->compare('status',$this->status);\n $criteria->compare('terminal_type',$this->terminal_type);\n\t\t$criteria->compare('start_time',$this->start_time,true);\n\t\t$criteria->compare('end_time',$this->end_time,true);\n\t\t$criteria->compare('explain',$this->explain,true);\n\t\t$criteria->compare('_delete',$this->_delete);\n\t\t$criteria->compare('_create_time',$this->_create_time,true);\n\t\t$criteria->compare('_update_time',$this->_update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('birthday',$this->birthday,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('is_get_news',$this->is_get_news);\n\t\t$criteria->compare('user_id',$this->user_id);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('order_id',$this->order_id);\n\t\t$criteria->compare('device_id',$this->device_id,true);\n\t\t$criteria->compare('money',$this->money,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('add_time',$this->add_time);\n\t\t$criteria->compare('recharge_type',$this->recharge_type);\n\t\t$criteria->compare('channel',$this->channel,true);\n\t\t$criteria->compare('version_name',$this->version_name,true);\n\t\t$criteria->compare('pay_channel',$this->pay_channel);\n\t\t$criteria->compare('chanel_bid',$this->chanel_bid);\n\t\t$criteria->compare('chanel_sid',$this->chanel_sid);\n\t\t$criteria->compare('versionid',$this->versionid);\n\t\t$criteria->compare('chanel_web',$this->chanel_web);\n\t\t$criteria->compare('dem_num',$this->dem_num);\n\t\t$criteria->compare('last_watching',$this->last_watching,true);\n\t\t$criteria->compare('pay_type',$this->pay_type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n {\r\n // @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n $criteria = new CDbCriteria;\r\n\r\n $criteria->compare('id', $this->id);\r\n $criteria->compare('country_id', $this->country_id);\r\n $criteria->compare('user_id', $this->user_id);\r\n $criteria->compare('vat', $this->vat);\r\n $criteria->compare('manager_coef', $this->manager_coef);\r\n $criteria->compare('curator_coef', $this->curator_coef);\r\n $criteria->compare('admin_coef', $this->admin_coef);\r\n $criteria->compare('status', $this->status);\r\n\r\n return new CActiveDataProvider($this, array(\r\n 'criteria' => $criteria,\r\n ));\r\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('purchase_price',$this->purchase_price);\n\t\t$criteria->compare('sell_price',$this->sell_price);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('measurement',$this->measurement,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\t\t$criteria->compare('date_out',$this->date_out,true);\n\t\t$criteria->compare('date_in',$this->date_in,true);\n\t\t$criteria->compare('firma_id',$this->firma_id,true);\n\t\t$criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('instock',$this->instock);\n\t\t$criteria->compare('user_id',$this->user_id);\n $criteria->compare('warning_amount',$this->warning_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('fname',$this->fname,true);\n\t\t$criteria->compare('mname',$this->mname,true);\n\t\t$criteria->compare('lname',$this->lname,true);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('date_of_birth',$this->date_of_birth,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('landline',$this->landline,true);\n\t\t$criteria->compare('em_contact_name',$this->em_contact_name,true);\n\t\t$criteria->compare('em_contact_relation',$this->em_contact_relation,true);\n\t\t$criteria->compare('em_contact_number',$this->em_contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('created_date',$this->created_date,true);\n\n return new CActiveDataProvider( $this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState( 'pageSize', Yii::app()->params[ 'defaultPageSize' ] ),\n ),\n ) );\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('COMPETITOR_ID',$this->COMPETITOR_ID);\n\t\t$criteria->compare('WSDC_NO',$this->WSDC_NO);\n\t\t$criteria->compare('FIRST_NAME',$this->FIRST_NAME,true);\n\t\t$criteria->compare('LAST_NAME',$this->LAST_NAME,true);\n\t\t$criteria->compare('COMPETITOR_LEVEL',$this->COMPETITOR_LEVEL);\n\t\t$criteria->compare('REMOVED',$this->REMOVED);\n\t\t$criteria->compare('ADDRESS',$this->ADDRESS,true);\n\t\t$criteria->compare('CITY',$this->CITY,true);\n\t\t$criteria->compare('STATE',$this->STATE,true);\n\t\t$criteria->compare('POSTCODE',$this->POSTCODE);\n\t\t$criteria->compare('COUNTRY',$this->COUNTRY,true);\n\t\t$criteria->compare('PHONE',$this->PHONE,true);\n\t\t$criteria->compare('MOBILE',$this->MOBILE,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('LEADER',$this->LEADER);\n\t\t$criteria->compare('REGISTERED',$this->REGISTERED);\n\t\t$criteria->compare('BIB_STATUS',$this->BIB_STATUS);\n\t\t$criteria->compare('BIB_NUMBER',$this->BIB_NUMBER);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sys_name',$this->sys_name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('CustomerId',$this->CustomerId,true);\n\t\t$criteria->compare('AddressId',$this->AddressId,true);\n\t\t$criteria->compare('CustomerStatusId',$this->CustomerStatusId,true);\n\t\t$criteria->compare('DateMasterId',$this->DateMasterId,true);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('CustomerPhoto',$this->CustomerPhoto,true);\n\t\t$criteria->compare('CustomerCode',$this->CustomerCode);\n\t\t$criteria->compare('Telephone',$this->Telephone,true);\n\t\t$criteria->compare('Mobile',$this->Mobile,true);\n\t\t$criteria->compare('EmailId',$this->EmailId,true);\n\t\t$criteria->compare('Status',$this->Status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$parameters = array('limit'=>ceil(Profile::getResultsPerPage()));\n\t\t$criteria->scopes = array('findAll'=>array($parameters));\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('itemId',$this->itemId);\n\t\t$criteria->compare('changedBy',$this->changedBy,true);\n\t\t$criteria->compare('recordName',$this->recordName,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\t\t$criteria->compare('oldValue',$this->oldValue,true);\n\t\t$criteria->compare('newValue',$this->newValue,true);\n\t\t$criteria->compare('diff',$this->diff,true);\n\t\t$criteria->compare('timestamp',$this->timestamp);\n\n\t\treturn new SmartActiveDataProvider(get_class($this), array(\n\t\t\t'sort'=>array(\n\t\t\t\t'defaultOrder'=>'timestamp DESC',\n\t\t\t),\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>Profile::getResultsPerPage(),\n\t\t\t),\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('company_id', $this->company_id);\n\t\t$criteria->compare('productId', $this->productId);\n\t\t$criteria->compare('upTo', $this->upTo);\n\t\t$criteria->compare('fixPrice', $this->fixPrice);\n\t\t$criteria->compare('isActive', $this->isActive);\n\t\t$criteria->order = 'company_id';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('locality',$this->locality,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\n\t\t$criteria->compare('mem_type',$this->mem_type);\r\n\t\t$criteria->compare('business_type',$this->business_type);\r\n\t\t$criteria->compare('product_name',$this->product_name,true);\r\n\t\t$criteria->compare('panit',$this->panit,true);\r\n\t\t$criteria->compare('sex',$this->sex);\r\n\t\t$criteria->compare('tname',$this->tname);\r\n\t\t$criteria->compare('ftname',$this->ftname,true);\r\n\t\t$criteria->compare('ltname',$this->ltname,true);\r\n\t\t$criteria->compare('etname',$this->etname);\r\n\t\t$criteria->compare('fename',$this->fename,true);\r\n\t\t$criteria->compare('lename',$this->lename,true);\r\n\t\t$criteria->compare('birth',$this->birth,true);\r\n\t\t$criteria->compare('email',$this->email,true);\r\n\t\t$criteria->compare('facebook',$this->facebook,true);\r\n\t\t$criteria->compare('twitter',$this->twitter,true);\r\n\t\t$criteria->compare('address',$this->address,true);\r\n\t\t$criteria->compare('province',$this->province);\r\n\t\t$criteria->compare('prefecture',$this->prefecture);\r\n\t\t$criteria->compare('district',$this->district);\r\n\t\t$criteria->compare('postcode',$this->postcode,true);\r\n\t\t$criteria->compare('tel',$this->tel,true);\r\n\t\t$criteria->compare('mobile',$this->mobile,true);\r\n\t\t$criteria->compare('fax',$this->fax,true);\r\n\t\t$criteria->compare('high_education',$this->high_education);\r\n\t\t$criteria->compare('career',$this->career);\r\n\t\t$criteria->compare('skill_com',$this->skill_com);\r\n\t\t$criteria->compare('receive_news',$this->receive_news,true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('table_id',$this->table_id);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cou_id',$this->cou_id);\n\t\t$criteria->compare('thm_id',$this->thm_id);\n\t\t$criteria->compare('cou_nom',$this->cou_nom,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idempleo',$this->idempleo);\n\t\t$criteria->compare('administrativo',$this->administrativo,true);\n\t\t$criteria->compare('comercial',$this->comercial,true);\n\t\t$criteria->compare('artes',$this->artes,true);\n\t\t$criteria->compare('informatica',$this->informatica,true);\n\t\t$criteria->compare('salud',$this->salud,true);\n\t\t$criteria->compare('marketing',$this->marketing,true);\n\t\t$criteria->compare('servicio_domestico',$this->servicio_domestico,true);\n\t\t$criteria->compare('construccion',$this->construccion,true);\n\t\t$criteria->compare('agricultura',$this->agricultura,true);\n\t\t$criteria->compare('ganaderia',$this->ganaderia,true);\n\t\t$criteria->compare('telecomunicaciones',$this->telecomunicaciones,true);\n\t\t$criteria->compare('atencion_cliente',$this->atencion_cliente,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID_VALOR',$this->ID_VALOR);\n\t\t$criteria->compare('ID_UBICACION',$this->ID_UBICACION);\n\t\t$criteria->compare('ID_VISITA',$this->ID_VISITA);\n\t\t$criteria->compare('VALOR',$this->VALOR);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t\n\t\t$criteria->compare('id_aspecto',$this->id_aspecto,true);\n\t\t$criteria->compare('tbl_Programa_id_programa',$this->tbl_Programa_id_programa,true);\n\t\t$criteria->compare('tbl_Factor_id_factor',$this->tbl_Factor_id_factor);\n\t\t$criteria->compare('tbl_caracteristica_id_caracteristica',$this->tbl_caracteristica_id_caracteristica,true);\n\t\t$criteria->compare('num_aspecto',$this->num_aspecto,true);\n\t\t$criteria->compare('aspecto',$this->aspecto,true);\n\t\t$criteria->compare('instrumento',$this->instrumento,true);\n\t\t$criteria->compare('fuente',$this->fuente,true);\n\t\t$criteria->compare('documento',$this->documento,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('Observaciones',$this->Observaciones,true);\n\t\t$criteria->compare('cumple',$this->cumple,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('website_url',$this->website_url,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('user_name',$this->user_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('created_datetime',$this->created_datetime,true);\n\t\t$criteria->compare('icon_src',$this->icon_src,true);\n\t\t$criteria->compare('show_r18',$this->show_r18);\n\t\t$criteria->compare('show_bl',$this->show_bl);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('creationDate',$this->creationDate,true);\n\t\t$criteria->compare('year',$this->year);\n\t\t$criteria->compare('term',$this->term,true);\n\t\t$criteria->compare('activated',$this->activated);\n\t\t$criteria->compare('startingDate',$this->startingDate,true);\n\t\t$criteria->compare('activation_userId',$this->activation_userId);\n\t\t$criteria->compare('parent_catalogId',$this->parent_catalogId);\n $criteria->compare('isProspective', $this->isProspective);\n $criteria->compare('creatorId', $this->creatorId);\n $criteria->compare('isProposed', $this->isProposed);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('location',$this->location);\n\t\t$criteria->compare('theripiest',$this->theripiest);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('dob',$this->dob,true);\n\t\t$criteria->compare('inurancecompany',$this->inurancecompany,true);\n\t\t$criteria->compare('injurydate',$this->injurydate,true);\n\t\t$criteria->compare('therapy_start_date',$this->therapy_start_date,true);\n\t\t$criteria->compare('ASIA',$this->ASIA,true);\n\t\t$criteria->compare('injury',$this->injury,true);\n\t\t$criteria->compare('medication',$this->medication,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search () {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('formId', $this->formId, true);\n\t\t$criteria->compare('data', $this->data, true);\n\t\t$criteria->compare('ctime', $this->ctime);\n\t\t$criteria->compare('mtime', $this->mtime);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('imputetype_id',$this->imputetype_id);\n\t\t$criteria->compare('project_id',$this->project_id);\n\n\t\treturn new ActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('category_id',$this->category_id);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('price_z',$this->price_z);\n\t\t$criteria->compare('price_s',$this->price_s);\n\t\t$criteria->compare('price_m',$this->price_m);\n\t\t$criteria->compare('dependence',$this->dependence,true);\n\t\t$criteria->compare('barcode',$this->barcode,true);\n\t\t$criteria->compare('unit',$this->unit,true);\n\t\t$criteria->compare('minimal_amount',$this->minimal_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 100),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email_admin',$this->email_admin,true);\n\t\t$criteria->compare('password_api',$this->password_api,true);\n\t\t$criteria->compare('url_result_api',$this->url_result_api,true);\n\t\t$criteria->compare('id_currency_2',$this->id_currency_2);\n\t\t$criteria->compare('id_currency_1',$this->id_currency_1,true);\n\t\t$criteria->compare('is_test_mode',$this->is_test_mode);\n\t\t$criteria->compare('is_commission_shop',$this->is_commission_shop);\n\t\t$criteria->compare('commission',$this->commission);\n\t\t$criteria->compare('is_enable',$this->is_enable);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('mod_date',$this->mod_date,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('image',$this->image,true);\n\t\t$criteria->compare('manager',$this->manager);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('realname',$this->realname,true);\n\t\t$criteria->compare('identity',$this->identity,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('bussiness_license',$this->bussiness_license,true);\n\t\t$criteria->compare('bankcode',$this->bankcode,true);\n\t\t$criteria->compare('banktype',$this->banktype,true);\n\t\t$criteria->compare('is_open',$this->is_open,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('images_str',$this->images_str,true);\n\t\t$criteria->compare('gmt_created',$this->gmt_created,true);\n\t\t$criteria->compare('gmt_modified',$this->gmt_modified,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID,true);\n\t\t$criteria->compare('userID',$this->userID,true);\n\t\t$criteria->compare('mtID',$this->mtID,true);\n\t\t$criteria->compare('fxType',$this->fxType);\n\t\t$criteria->compare('leverage',$this->leverage);\n\t\t$criteria->compare('amount',$this->amount,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('surname',$this->surname,true);\n\t\t$criteria->compare('comany_name',$this->comany_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('uuid',$this->uuid,true);\n\t\t$criteria->compare('is_admin',$this->is_admin);\n\t\t$criteria->compare('paid_period_start',$this->paid_period_start,true);\n\t\t$criteria->compare('ftp_pass',$this->ftp_pass,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('price',$this->price,true);\n\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('breed',$this->breed,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_birthday',$this->date_birthday,true);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('tattoo',$this->tattoo,true);\n\t\t$criteria->compare('sire',$this->sire,true);\n\t\t$criteria->compare('dame',$this->dame,true);\n\t\t$criteria->compare('owner_type',$this->owner_type,true);\n\t\t$criteria->compare('honors',$this->honors,true);\n\t\t$criteria->compare('photo_preview',$this->photo_preview,true);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('pet_status',$this->pet_status,true);\n\t\t$criteria->compare('about',$this->about,true);\n\t\t$criteria->compare('uid',$this->uid);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('veterinary',$this->veterinary,true);\n\t\t$criteria->compare('vaccinations',$this->vaccinations,true);\n\t\t$criteria->compare('show_class',$this->show_class,true);\n\t\t$criteria->compare('certificate',$this->certificate,true);\n $criteria->compare('neutered_spayed',$this->certificate,true);\n \n\n $criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('city',$this->city,true);\n\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('HISTORY',$this->HISTORY,true);\n\t\t$criteria->compare('WELCOME_MESSAGE',$this->WELCOME_MESSAGE,true);\n\t\t$criteria->compare('LOCATION',$this->LOCATION,true);\n\t\t$criteria->compare('PHONES',$this->PHONES,true);\n\t\t$criteria->compare('FAX',$this->FAX,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('MISSION',$this->MISSION,true);\n\t\t$criteria->compare('VISION',$this->VISION,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('orgName',$this->orgName,true);\n\t\t$criteria->compare('noEmp',$this->noEmp);\n\t\t$criteria->compare('phone',$this->phone);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('addr1',$this->addr1,true);\n\t\t$criteria->compare('addr2',$this->addr2,true);\n\t\t$criteria->compare('state',$this->state,true);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('orgType',$this->orgType,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('fax',$this->fax);\n\t\t$criteria->compare('orgId',$this->orgId,true);\n\t\t$criteria->compare('validity',$this->validity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('sortorder',$this->sortorder,true);\n\t\t$criteria->compare('fullname',$this->fullname,true);\n\t\t$criteria->compare('shortname',$this->shortname,true);\n\t\t$criteria->compare('idnumber',$this->idnumber,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('summaryformat',$this->summaryformat);\n\t\t$criteria->compare('format',$this->format,true);\n\t\t$criteria->compare('showgrades',$this->showgrades);\n\t\t$criteria->compare('sectioncache',$this->sectioncache,true);\n\t\t$criteria->compare('modinfo',$this->modinfo,true);\n\t\t$criteria->compare('newsitems',$this->newsitems);\n\t\t$criteria->compare('startdate',$this->startdate,true);\n\t\t$criteria->compare('marker',$this->marker,true);\n\t\t$criteria->compare('maxbytes',$this->maxbytes,true);\n\t\t$criteria->compare('legacyfiles',$this->legacyfiles);\n\t\t$criteria->compare('showreports',$this->showreports);\n\t\t$criteria->compare('visible',$this->visible);\n\t\t$criteria->compare('visibleold',$this->visibleold);\n\t\t$criteria->compare('groupmode',$this->groupmode);\n\t\t$criteria->compare('groupmodeforce',$this->groupmodeforce);\n\t\t$criteria->compare('defaultgroupingid',$this->defaultgroupingid,true);\n\t\t$criteria->compare('lang',$this->lang,true);\n\t\t$criteria->compare('theme',$this->theme,true);\n\t\t$criteria->compare('timecreated',$this->timecreated,true);\n\t\t$criteria->compare('timemodified',$this->timemodified,true);\n\t\t$criteria->compare('requested',$this->requested);\n\t\t$criteria->compare('enablecompletion',$this->enablecompletion);\n\t\t$criteria->compare('completionnotify',$this->completionnotify);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('zipcode',$this->zipcode,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('role',$this->role,true);\n\t\t$criteria->compare('active',$this->active);\n\t\t$criteria->compare('camaras',$this->camaras);\n\t\t$criteria->compare('freidoras',$this->freidoras);\n\t\t$criteria->compare('cebos',$this->cebos);\n\t\t$criteria->compare('trampas',$this->trampas);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cod_venda',$this->cod_venda,true);\n\t\t$criteria->compare('filial_cod_filial',$this->filial_cod_filial,true);\n\t\t$criteria->compare('funcionario_cod_funcionario',$this->funcionario_cod_funcionario,true);\n\t\t$criteria->compare('cliente_cod_cliente',$this->cliente_cod_cliente,true);\n\t\t$criteria->compare('data_2',$this->data_2,true);\n\t\t$criteria->compare('valor_total',$this->valor_total);\n\t\t$criteria->compare('forma_pagamento',$this->forma_pagamento,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('attribute',$this->attribute,true);\n\t\t$criteria->compare('displayName',$this->displayName,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('value_type',$this->value_type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->buscar,'OR');\n\t\t$criteria->compare('fecha',$this->buscar,true,'OR');\n\t\t$criteria->compare('fechaUpdate',$this->buscar,true,'OR');\n\t\t$criteria->compare('idProfesional',$this->buscar,'OR');\n\t\t$criteria->compare('importe',$this->buscar,'OR');\n\t\t$criteria->compare('idObraSocial',$this->buscar,'OR');\n\t\t$criteria->compare('estado',$this->buscar,true,'OR');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('codop',$this->codop,true);\n\t\t$criteria->compare('codcatval',$this->codcatval,true);\n\t\t$criteria->compare('cuentadebe',$this->cuentadebe,true);\n\t\t$criteria->compare('cuentahaber',$this->cuentahaber,true);\n\t\t$criteria->compare('desop',$this->desop,true);\n\t\t$criteria->compare('descat',$this->descat,true);\n\t\t$criteria->compare('debe',$this->debe,true);\n\t\t$criteria->compare('haber',$this->haber,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pagesize'=>100),\n\t\t));\n\t}" ]
[ "0.7213065", "0.7136468", "0.70935595", "0.709325", "0.69852537", "0.6960952", "0.69483596", "0.6941926", "0.69339824", "0.6924484", "0.6910969", "0.6903515", "0.689855", "0.6898346", "0.68928593", "0.68829066", "0.688", "0.6874386", "0.6849385", "0.68492174", "0.6835468", "0.68260294", "0.68158656", "0.6807265", "0.6803965", "0.6797832", "0.6796707", "0.6796092", "0.67958903", "0.67939544", "0.6789988", "0.678589", "0.67852676", "0.67843693", "0.67814165", "0.6781002", "0.6778943", "0.677769", "0.6776881", "0.67766523", "0.67754287", "0.67754287", "0.67754287", "0.67754287", "0.67754287", "0.67754287", "0.67754287", "0.67754287", "0.67730945", "0.67688257", "0.67676544", "0.67657626", "0.67627615", "0.67624676", "0.67610735", "0.6760343", "0.67591995", "0.675868", "0.67534935", "0.6753398", "0.6752194", "0.6748479", "0.6747931", "0.6746537", "0.67455685", "0.6745013", "0.6744799", "0.6744267", "0.6744261", "0.6744259", "0.67424554", "0.6741157", "0.6740027", "0.67393184", "0.673748", "0.6737121", "0.6735014", "0.6732556", "0.673172", "0.6725259", "0.67233384", "0.67229337", "0.67224807", "0.6713223", "0.6713112", "0.6711287", "0.67090654", "0.6706832", "0.6706266", "0.67058635", "0.67039824", "0.6702915", "0.67004186", "0.6698902", "0.6696994", "0.6695745", "0.6695667", "0.66937417", "0.66935295", "0.66931415", "0.6691898" ]
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.7574381", "0.7529001", "0.72717786", "0.7270387", "0.7262305", "0.7214525", "0.7213965", "0.71321", "0.7129096", "0.7129096", "0.710298", "0.710298", "0.71026886", "0.7074855", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005", "0.70645005" ]
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle(Spreadsheet $spreadsheet) { $urls = $this->getURLs(); if ($urls->count() === 0) return; $filePath = storage_path(sprintf("app/not_found_links__%s.xlsx", now()->format('Y-m-d--H-i-s'))); $spreadsheet->setActiveSheetIndex(0) ->setCellValue('A1', 'ID') ->setCellValue('B1', 'URL') ->setCellValue('C1', 'REFERER') ->setCellValue('D1', 'User Agent') ->setCellValue('E1', 'Дата и время'); foreach ($urls as $i => $url) { $row = $i+2; $spreadsheet->setActiveSheetIndex(0) ->setCellValue("A{$row}", $url->id) ->setCellValue("B{$row}", $url->url) ->setCellValue("C{$row}", $url->referer) ->setCellValue("D{$row}", $url->user_agent) ->setCellValue("E{$row}", $url->date); } (new Xlsx($spreadsheet))->save($filePath); try { Mail::to(config('mail.send_404'))->send(new NotFoundPages($urls->count(), $filePath)); } finally { @unlink($filePath); } $this->info(sprintf('sending %s links', $urls->count())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
creates a new controller based on the default route
public function connect(Application $app) { $controller = $app['controllers_factory']; // la ruta "/aptos/list" $controller->get('/list', function() use($app) { // obtiene el nombre de apartamento de la sesión $user = $app['session']->get('user'); $apartamentos = ApartamentosQuery::create()->find(); if (!isset($aptos)) { $apto = array(); } foreach ($apartamentos as $apartamento) { $ide = $apartamento->getId(); $n = $apartamento->getNombre(); $d = $apartamento->getDescripcion(); $p = $apartamento->getPrecio(); $la = $apartamento->getLatitud(); $lo = $apartamento->getLongitud(); $ti = $apartamento->getTipos(); $aptos[] = array( 'id' => $ide, 'nombre' => $n, 'descripcion' => $d, 'precio' => $p, 'latitud' => $la, 'longitud' => $lo, 'tipo' => $ti ); } // ya ingreso un apartamento ? if (isset($user) && $user != '') { // muestra la plantilla return $app['twig']->render('Apartamentos/apartamentos.list.html.twig', array( 'user' => $user, 'aptos' => $aptos )); } else { // redirige el navegador a "/login" return $app->redirect($app['url_generator']->generate('login')); } // hace un bind })->bind('aptos-list'); // la ruta "/aptos/new" $controller->get('/new', function() use($app) { // obtiene el nombre de apartamento de la sesión $user = $app['session']->get('user'); // ya ingreso un apartamento ? if ( isset( $user ) && $user != '' ) { // muestra la plantilla return $app['twig']->render('Apartamentos/apartamentos.edit.html.twig', array( 'user' => $user, 'index' => '', 'apto_to_edit' => array( 'id' => '', 'nombre' => '', 'descripcion' => '', 'precio' => '', 'latitud' => '', 'longitud' => '', 'tipo' => '' ) )); } else { // redirige el navegador a "/login" return $app->redirect( $app['url_generator']->generate('login')); } // hace un bind })->bind('aptos-new'); // la ruta "/aptos/edit" $controller->get('/edit/{index}', function($index) use($app) { // obtiene el nombre de apartamento de la sesión $user = $app['session']->get('user'); // obtiene los apartamentos de la sesión $aptos = $app['session']->get('aptos'); if (!isset($aptos)) { $aptos = array(); } $apto = ApartamentosQuery::create()->findPK($index); // no ha ingresado el apartamento (no ha hecho login) ? if (!isset($user) || $user == '') { // redirige el navegador a "/login" return $app->redirect($app['url_generator']->generate('login')); // no existe un apartamento en esa posición ? } else if ($apto == NULL) { // muestra el formulario de nuevo apartamento return $app->redirect($app['url_generator']->generate('aptos-new')); } else { // muestra la plantilla return $app['twig']->render('Apartamentos/apartamentos.edit.html.twig', array( 'user' => $user, 'index' => $index, 'apto_to_edit' => $apto )); } // hace un bind })->bind('aptos-edit'); $controller->post('/save', function( Request $request ) use ( $app ) { $aptos = $app['session']->get('aptos'); if (!isset($aptos)) { $aptos = array(); } // index no está incluido en la petición $index = $request->get('index'); if (!isset($index) || $index == '') { // agrega el nuevo apartamento $aptos2 = array( id => $request->get('id'), nombre => $request->get('nombre'), descripcion => $request->get('descripcion'), precio => $request->get('precio'), latitud => $request->get('latitud'), longitud => $request->get('longitud'), tipo => $request->get('tipo') ); $tip = new Tipos(); $tip->setNombre($aptos2['tipo']); $apto = new Apartamentos(); $apto->setNombre($aptos2['nombre']); $apto->setDescripcion($aptos2['descripcion']); $apto->setPrecio($aptos2['precio']); $apto->setLatitud($aptos2['latitud']); $apto->setLongitud($aptos2['longitud']); $apto->setTipos($tip); $apto->save(); } else { // modifica el apartamento en la posición $index $aptos[$index] = array( id => $request->get('id'), nombre => $request->get('nombre'), descripcion => $request->get('descripcion'), precio => $request->get('precio'), latitud => $request->get('latitud'), longitud => $request->get('longitud'), tipo => $request->get('tipo') ); $apto = ApartamentosQuery::create()->findOneById($index); $apto->setNombre($aptos2['nombre']); $apto->setDescripcion($aptos2['descripcion']); $apto->setPrecio($aptos2['precio']); $apto->setLatitud($aptos2['latitud']); $apto->setLongitud($aptos2['longitud']); $apto->save(); } // actualiza los datos en sesión $app['session']->set('aptos', $aptos); // muestra la lista de apartamentos return $app->redirect($app['url_generator']->generate('aptos-list')); })->bind('aptos-save'); $controller->get('/delete/{index}', function($index) use ($app) { // obtiene el apartamento $apto = ApartamentosQuery::create()->findPK($index); $apto->delete(); // muestra la lista de apartamentos return $app->redirect($app['url_generator']->generate('aptos-list')); })->bind('aptos-delete'); return $controller; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function defaultRoute() {\n $this->controllerClass = new IndexController();\n $this->controllerClass->setUp();\n $method = strtolower($this->controllerName);\n if (method_exists($this->controllerClass, $method)) {\n $this->controllerClass->$method();\n } else {\n $this->controllerClass->loadIndex();\n }\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public function createController( $route )\n\t{\n\t\tif( ( $controller = \\Yii::$app->createControllerByID( $this->id ) ) && $controller->createAction( $route ) ) {\n\t\t\treturn [ $controller, $route ];\n\t\t}\n\t\t\n\t\t/**\n\t\t * /module/controller/action (standart)\n\t\t */\n\t\telse if( $controller = parent::createController( $route ) ) {\n\t\t\treturn $controller;\n\t\t}\n\t\t\n\t\t/**\n\t\t * /module[/action] -> /module/controllers/DefaultController[/action]\n\t\t *\n\t\t */\n\t\telse if( $controller = parent::createController( $this->defaultRoute . '/' . trim( $route, '/' ) ) ) {\n\t\t\treturn $controller;\n\t\t}\n\t\t\n\t\t/**\n\t\t * /module/subfolder -> /module/controllers/subfolder/DefaultController/DefaultAction [index]\n\t\t * /ysell/product -> ysell/product/default/index\n\t\t * module has subfolders with default controllers\n\t\t */\n\t\telse if( $controller = parent::createController( trim( $route, '/' ) . '/' . $this->defaultRoute ) ) {\n\t\t\treturn $controller;\n\t\t}\n\t\t\n\t\t/**\n\t\t * /module/subfolder/action -> /module/controllers/subfolder/DefaultController/action\n\t\t * /ysell/product/search -> ysell/product/default/search\n\t\t * insert defaultRoute instead of last '/'\n\t\t */\n\t\telse if( ( $testRoute = preg_replace( '/\\/(?=[a-zA-Z]+[\\w-]+(?:\\?|$))/', \"/{$this->defaultRoute}/\", $route ) )\n\t\t\t&& $controller = parent::createController( $testRoute )\n\t\t) {\n\t\t\treturn $controller;\n\t\t}\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public function getDefaultController();", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "private function _loadDefaultController(){\n\t\trequire $this->_controllerPath . $this->_defaultFile;\n\t\t$this->_controller = new Index();\n\t\t$this->_controller->index();\n\t}", "private function setDefaultController()\n {\n if ($this->default_controller === false) {\n throw new FlyException(Fly::t('fly', \"Unable to determine what should be displayed. A default route has not been specified in the routing file.\"));\n }\n\n // Is the method being specified?\n if (strpos($this->default_controller, '/') !== false) {\n $x = explode('/', $this->default_controller);\n $this->setClass($x[0]);\n $this->setMethod($x[1]);\n $this->setRequest($x);\n } else {\n $this->setClass($this->default_controller);\n $this->setMethod('index');\n $this->setRequest(array($this->default_controller, 'index'));\n }\n\n // re-index the routed segments array so it starts with 1 rather than 0\n $this->uri->reindexSegments();\n\n Fly::log('debug', \"No URI present. Default controller set.\");\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "private function _loadDefaultController()\n\t{\n\t\trequire $this->_controllerPath . $this->_defaultFile;\n\t\t$this->_controller = new IndexController();\n\t\t$this->_controller->index();\n\t}", "protected function initDefaultController() {\n\t\tif (!class_exists(\"HomeController\")) return;\n\t\t$this->controller = new HomeController();\n\t}", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "private function getDefaultController(): Controller {\n\t\t$default_controller_class = $this->controller_namespace . self::DEFAULT_CONTROLLER;\n\n\t\treturn $this->instanceController( $default_controller_class );\n\t}", "public function routeController()\n\t{\n\t\t$action = \"actionIndex\";\n\n\t\tif (isset($_GET[\"p\"]))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$params = array_filter(explode(\"/\", $_GET[\"p\"]));\n\n\t\t\tif (count($params) != 1)\n\t\t\t{\n\t\t\t\t$action = \"action\";\n\n\t\t\t\tfor ($i = 1; $i < count($params); $i++)\n\t\t\t\t{\n\t\t\t\t\t$action .= ucwords($params[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$controller = \"Controller_\" . ucwords($params[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcall_user_func(array(new Controller_Index(), $action));\n\t\t\texit();\n\t\t}\n\n\t\tif (isset($controller) && class_exists($controller))\n\t\t{\n\t\t\tif (method_exists(new $controller(), $action))\n\t\t\t{\n\t\t\t\tcall_user_func(array(new $controller(), $action));\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\texit();\n\t\t}\n\t}", "private function _loadDefaultController()\r\n {\r\n require $this->_controller_path. $this->_default_file;\r\n $this->_controller = new Home();\r\n $this->_controller->index();\r\n }", "protected function createController()\n {\n $this->createClass('controller');\n }", "private function defineRoute(){\n if($this->route_path === '/'){\n //go to home\n $controller_name = ucfirst($this->config->getLandingPageControllerName().\"Controller\");\n }\n elseif (array_key_exists($this->route_path[1],$this->nameRoutes())){\n $name_route = $this->nameRoutes()[$this->route_path[1]];\n $controller_name = !empty($name_route[0])?ucfirst($name_route[0]):'';\n $this->route_path[2] = $name_route[1];\n }\n else{\n $controller_name = !empty($this->route_path[1])?ucfirst($this->route_path[1].\"Controller\"):'';\n }\n $method_name = !empty($this->route_path[2])?$this->route_path[2]:'index';\n $parameters = is_array($this->route_path)?array_slice($this->route_path, 3):'';\n\n $file_path = ROOT_DIR.\"/src/Controllers/{$controller_name}.php\";\n if(file_exists($file_path)){\n $controller_name_with_namespace = 'App\\Controllers\\\\'.$controller_name;\n $controller_object = new $controller_name_with_namespace();\n if(method_exists($controller_object,$method_name)){\n $controller_object->$method_name($parameters);\n }else{\n exit('Wrong Method');\n }\n\n }else{\n exit('Wrong Controller');\n }\n }", "private function route() {\n if (class_exists($this->controllerName . $this->postfix)) {\n $fullName = $this->controllerName . $this->postfix;\n $this->controllerClass = new $fullName;\n $this->controllerClass->setUp();\n if (count($this->args > 1)) { // Pass args that are not controller class\n $this->controllerClass->setArgs($this->args);\n }\n\n // Second arg in url is our \"action\", try that as a method-call\n $method = strtolower($this->args[0]); // method names are case-insensitive. Might as well take advantage of it.\n if (isset($method) && method_exists($this->controllerClass, $method)) {\n $this->controllerClass->{$this->args[0]}();\n }\n \n } else { // No such class. Use our default\n $this->defaultRoute();\n }\n }", "public function createController( ezcMvcRequest $request );", "public function withController($controller): Route;", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "function route(Request $request){\n //Separate path by / and remove ending /\n $paths = explode('/', rtrim($request->getUrl()->getPath(), '/')); \n //Determines the default\n $controllerFolder = $paths[0] ? $paths[0] : \"main\";\n //Non main folder uses FolderMain as the default controller\n if($controllerFolder === \"main\"){\n $controllerName = $paths[1] ? $paths[1] : \"main\"; \n }else{\n $controllerName = $paths[1] ? $paths[1] : $controllerFolder.\"main\";\n }\n $methodName = $paths[2] ? $paths[2] : \"main\";\n $args = array_slice($paths, 3);\n \n if(file_exists(FOLDER_CONTROLLERS.S.$controllerFolder.S.$controllerName.\".php\")){\n $controller = new $controllerName($request); \n if(method_exists($controller,$methodName)){\n $controller->{$methodName}($args);\n }else{\n header(\"location: \".REDIRECT_ERROR002);\n }\n }else{\n header(\"location: \".REDIRECT_ERROR001);\n }\n \n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function getControllerToRun()\n {\n $routing = $this->getRouting();\n $module = strtolower($this->urlParams[self::PARAM_CONTROLLER]);\n \n $module = strtr($module, '-', '_');\n \n // Check if we have routing to this module\n if (isset($routing[$this->apiType][$module])) {\n $controllerName = $routing[$this->apiType][$module];\n } else {\n // Call default controller\n $controllerName = $routing[$this->apiType][self::DEFAULT_CONTROLLER_ROUTE_NAME];\n }\n \n if (class_exists($controllerName)) {\n return new $controllerName();\n }\n \n self::debug(\"Fatal error: Controller ({$controllerName}) not found\");\n }", "public function routeController()\n { }", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "public function getController( );", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "private function loadDefaultController() {\r\n\t\trequire CONTROLLERS_PATH . 'IndexController.php';\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$controller = new IndexController();\r\n\t\t\t\r\n\t\t} catch (Exception $e) { //Any error.\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$controller->index();\r\n\t\t\t\r\n\t\t} catch (QueryException $e) {\r\n\t\t\t$this->error($e->getMessage() . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t\t\t\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t}", "public function getRoute(){\n // load default controller if none specified\n if (!$this->url_controller) {\n\n $this->url_controller = 'controller\\home';\n $this->url_action = 'index';\n\n // check if specified controller file exists\n } elseif (file_exists(APP . 'controller/' . $this->url_controller . '.php')) {\n\n $this->url_controller = 'controller\\\\' . $this->url_controller;\n $this->url_action = (strlen($this->url_action) == 0 ? 'index' : $this->url_action);\n\n // perhaps specified controller is located in subdirectory?\n } elseif (strlen($this->url_action) != 0 AND file_exists(APP . 'controller/' . $this->url_controller . '/' . $this->url_action . '.php')) {\n\n $this->url_controller = 'controller\\\\' . $this->url_controller . '\\\\' . $this->url_action;\n if (isset($this->action_params[0]) AND strlen($this->action_params[0]) != 0) {\n $this->url_action = $this->action_params[0];\n unset($this->action_params[0]);\n array_values($this->action_params);\n } else {\n $this->url_action = 'index';\n }\n\n // or maybe there's a default controller in directory?\n } elseif (file_exists(APP . 'controller/' . $this->url_controller . '/home.php')) {\n\n $this->url_controller = 'controller\\\\' . $this->url_controller . '\\\\home';\n $this->url_action = (strlen($this->url_action) == 0 ? 'index' : $this->url_action);\n\n // if not, load default controller with params\n } elseif ($this->url_controller) {\n\n $this->action_params = array($this->url_controller);\n $this->url_controller = 'controller\\home';\n $this->url_action = 'index';\n\n // if none of the above pass, reset controller param\n } else {\n $this->url_controller = null;\n }\n }", "protected function autoRegisterController()\n {\n $controllerInfo = $this->getController();\n if ($controllerInfo) {\n $uri = WingedLib::clearPath(static::$parentUri);\n $baseUri = '';\n if (!$uri) {\n $baseUri = './';\n } else {\n $uri = explode('/', $uri);\n if (isset($uri[0])) {\n $baseUri = './' . $uri[0] . '/';\n }\n if (isset($uri[1])) {\n $baseUri .= $uri[1] . '/';\n } else {\n $baseUri .= 'index/';\n }\n }\n if (!empty($controllerInfo['params'])) {\n foreach ($controllerInfo['params'] as $paramName => $optional) {\n if ($optional) {\n $baseUri .= '{$' . $paramName . '?}/';\n } else {\n $baseUri .= '{$' . $paramName . '}/';\n }\n }\n }\n Route::raw($baseUri, static::$controllerName . '@' . static::$controllerAction)->addResponseMiddleware(new ResponseMiddleware(function ($response) {\n if (is_array($response)) {\n /**\n * @var $this ResponseMiddleware\n */\n $self = &$this;\n if ($self->getRoute()->request()->isAcceptableType('application/json')) {\n $self->getRoute()->forceJson();\n } else if ($self->getRoute()->request()->isAcceptableType('application/xml')) {\n $self->getRoute()->forceXml();\n } else if ($self->getRoute()->request()->isAcceptableType('application/yaml')) {\n $self->getRoute()->forceYaml();\n }\n }\n }));\n }\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function route()\n {\n $request = '';\n if (isset($_GET['q']))\n {\n $request = $_GET['q'];\n }\n \n $this->request = $request;\n $this->rebuildGet();\n \n //get controller\n $found = false;\n \n if ($request == '')\n {\n $request = 'index';\n }\n \n $segments = explode('/', $request);\n $dir = APP_PATH.'controllers/';\n foreach ($segments as $index => $segment)\n {\n $segment = str_replace('-', '_', $segment);\n if (file_exists($dir.$segment.'.php'))\n {\n //load controller\n $found = true;\n $this->params = array_slice($segments, $index+1);\n require($dir.$segment.'.php');\n break;\n }\n else\n {\n $dir .= $segment.'/';\n }\n }\n \n if (!$found)\n {\n //try index controller\n if (file_exists($dir.'index.php'))\n {\n //load controller\n $found = true;\n $this->params = array();\n require($dir.'index.php');\n }\n }\n \n if (!$found)\n {\n $this->notFound();\n }\n \n $this->completeRequest();\n }", "public function frontControllerRoute()\n\t{\n\t\t#step 1\n\t\t#take current url and separate to controller, method and parameters\n\t\t$this->request = new CRequest($this->config['url_type']);\n\t\t$this->request->init($this->config['base_url'], $this->config['routing']);\n\t\t\n\t\t$controller \t= $this->request->controller;\n\t\t$method \t= $this->request->method;\n\t\t$args \t\t= $this->request->args;\n\t\n\t\t\n\t\t#step 2\n\t\t#Check if there is a method in the controller classs\n\t\t$controllerExists\t= isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled \t= false;\n\t\t$className \t= false;\n\t\t$classExists \t= false;\n\t\t\n\t\tif($controllerExists) {\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\t\t\n\t\tif($controllerExists && $controllerEnabled && $classExists)\n\t\t{\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')) \n\t\t\t{\n\t\t\t\t$formattedMethod = str_replace(array('_', '-'), '', $method);\n\t\t\t\tif($rc->hasMethod($formattedMethod)) \n\t\t\t\t{\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($formattedMethod);\n\t\t\t\t\tif($methodObj->isPublic()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $args);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller method not public.'); \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\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{ \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\t\t\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "private function loadCurrentController() {\r\n\t\t$controller_name = ucfirst($this->url[0]) . CONTROLLER_SUFFIX;\r\n\t\t$controller_path = CONTROLLERS_PATH . $controller_name . '.php';\r\n\t\t\r\n\t\tif (file_exists($controller_path)) {\r\n\t\t\trequire $controller_path;\r\n\t\t} else { //Controller not found.\r\n\t\t\t$this->error(); \r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$this->controller = new $controller_name;\r\n\t\t} catch (Exception $e) { //Any error.\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t}", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function route()\n\t{\n\t\t$this->request = $this->getRequest();\n\n\t\t$controller_name = 'app\\controllers\\Controller' . ucfirst($this->request->getController());\n\t\t$action_name = 'Action'.ucfirst($this->request->getAction());\n\n\t\tif(!class_exists($controller_name)){\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\n\t\t$controller = new $controller_name;\n\n\t\tif(method_exists($controller, $action_name)){\n\t\t\t$response = $controller->$action_name();\n\t\t\treturn $response ? $response : static::app()->response;\n\t\t} else {\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\t}", "public static function route($uri)\n {\n // get controller name\n $controller_name = (isset($uri[0]) && $uri[0] !== '') ? ucwords($uri[0]) : DEFAULT_CONTROLLER;\n array_shift($uri);\n\n // get method of the controller to call\n $action = (isset($uri[0]) && $uri[0] !== '') ? $uri[0] : 'index';\n array_shift($uri);\n\n // get controller\n $controller = 'App\\Controller\\\\' . $controller_name;\n // dnd($controller);\n \n // instantiate Controller if exists, otherwise give 404 error\n if (method_exists($controller, $action)) {\n $dispatch = new $controller();\n call_user_func_array([$dispatch, $action], $uri);\n } else {\n echo '404 Page not found';\n }\n }", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "public function carregar()\n {\n if (file_exists('app/sts/Controllers/' . $this->UrlController . '.php')) {\n $classe = \"\\\\Sts\\\\Controllers\\\\\" . $this->UrlController;\n } else {\n $classe = \"\\\\Sts\\\\Controllers\\\\Erro404\";\n }\n \n $classeCarregar = new $classe; \n $classeCarregar->index();\n }", "public function testRouterAddController()\n {\n $router = new Router();\n\n $router->addController(null, \"Anax\\Route\\MockHandlerController\");\n\n $res = $router->handle(\"create\");\n $this->assertEquals(\"createAction\", $res);\n\n $routes = $router->getAll();\n $this->assertEquals(1, count($routes));\n }", "function loadMVC() {\r\n if(!empty($_REQUEST['url'])) {\r\n $urlArray = explode('/', $_REQUEST['url']);\r\n $controller = array_shift($urlArray);\r\n $action = array_shift($urlArray); \r\n }\r\n $url['controller'] = !empty($controller) ? $controller.'Controller' : 'baseController';\r\n $url['action'] = !empty($action) ? $action : 'index';\r\n controllerFactory::createControllerObject($url);\r\n}", "public function getController();", "public function getController();", "public function getController();", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function defaultController()\n {\n $config = App::instance()->config();\n\n if (isset($config['view'])) {\n $viewConfig = $config['view'];\n if (isset($viewConfig['default_controller'])) {\n return $viewConfig['default_controller'];\n }\n }\n\n return 'charcoal/app/template/generic';\n }", "function routeController($prefix,$controller,$namespace=NULL) { \n\n $prefix = trim($prefix,'/').'/';\n\n $namespace = ($namespace)?:'App\\Http\\Controllers';\n\n try{\n \tRoute::get($prefix,['uses'=>$controller.'@getIndex','as'=>$controller.'GetIndex']);\n\n $controller_class = new \\ReflectionClass($namespace.'\\\\'.$controller); \n $controller_methods = $controller_class->getMethods(\\ReflectionMethod::IS_PUBLIC);\n $wildcards = '/{one?}/{two?}/{three?}/{four?}/{five?}'; \n foreach($controller_methods as $method) {\t \n\n if ($method->class != 'Illuminate\\Routing\\Controller' && $method->name != 'getIndex') { \n if(substr($method->name, 0, 3) == 'get') {\n $method_name = substr($method->name, 3);\n $slug = array_filter(preg_split('/(?=[A-Z])/',$method_name)); \n $slug = strtolower(implode('-',$slug));\n $slug = ($slug == 'index')?'':$slug;\n Route::get($prefix.$slug.$wildcards,['uses'=>$controller.'@'.$method->name,'as'=>$controller.'Get'.$method_name] );\n }elseif(substr($method->name, 0, 4) == 'post') {\n $method_name = substr($method->name, 4);\n $slug = array_filter(preg_split('/(?=[A-Z])/',$method_name)); \n Route::post($prefix.strtolower(implode('-',$slug)).$wildcards,['uses'=>$controller.'@'.$method->name,'as'=>$controller.'Post'.$method_name] );\n }\n } \n }\n }catch(\\Exception $e) {\n\n } \n}", "private function getController() {\n\n $controller = 'index';\n $action = 'index';\n\n if ($this->route) {\n\n /**\n * Get the controller and/or action from the route.\n *\n * 0: Controller\n * 1: Action\n * 2+: Additional params\n */\n $controller = request::getRoute(0);\n if(request::getRoute(1)) {\n $action = request::getRoute(1);\n }\n\n /**\n * Loop through and gather any params that\n * might be accompanying the route.\n */\n $done = false;\n $index = 2;\n while (!$done) {\n if (request::getRoute($index)) {\n array_push($this->params, request::getRoute($index));\n $index++;\n } else {\n $done = true;\n }\n }\n\n }\n\n // Set the controller and action.\n $this->controller = $controller;\n $this->action = $action;\n\n // set the file path\n $this->file = $this->path .'/'. $this->controller . '.php';\n }", "public function GetDefaultControllerIfHasAction ($actionName);", "public function FrontControllerRoute() {\n\t\t// Step 1\n\t\t// Take current url and divide it in controller, method and parameters\n\t\t$this->request = new CRequest($this->config['base_url']);\n\t\t$this->request->Init();\n\t\t$controller = $this->request->controller;\n\t\t$method = $this->request->method;\n\t\t$arguments = $this->request->arguments;\n\n\t\t$controllerExists = isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled = false;\n\t\t$className = false;\n\t\t$classExists = false;\n\n\t\tif($controllerExists){\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\n\n\n\t\t// Step 2\n\t\t// Check if there is a callable method in the controller class, if then call it\n\n\t\tif($controllerExists && $controllerEnabled && $classExists){\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')){\n\t\t\t\tif($rc->hasMethod($method)){\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($method);\n\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $arguments);\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t } else {\n\t \tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t\t}\n\t\t} else { \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\n\n\n\t\t$this->data['debug'] = \"REQUEST_URI - {$_SERVER['REQUEST_URI']}\\n\";\n\t\t$this->data['debug'] .= \"SCRIPT_NAME - {$_SERVER['SCRIPT_NAME']}\\n\";\n\t}", "public function getDefaultController()\n {\n return Config::getInstance()->get('defaultController');\n }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "public function route() {\n\t\t$file = $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\tif(\\mfw\\helpers\\FileHelper::fileExists($file)) {\n\t\t\tinclude $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\t\t$controller = new $this->controller($this->controller, $this->app_directory);\n\t\t\tcall_user_func_array(array($controller, $this->method), $this->arguments);\n\t\t} else {\n\t\t\tif(defined('DOC_ROOT')) {\n\t\t\t\tinclude DOC_ROOT . '/404.php';\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"404 Page not found\");\n\t\t\t}\n\t\t}\n\t}", "public function route($uri)\n {\n \n //Link Routing und jeweiligen Controller zurück geben\n switch ($uri) {\n case '/':\n return new FrontPageController();\n default:\n echo 'error';\n }\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "public function create()\n {\n //\n return response()->route('home');\n }", "function create_initial_rest_routes()\n {\n }", "public static function factory($ctrl, $action)\n {\n $router = new self();\n return $router->generate($ctrl, $action);\n }", "public static function getRoute($default = DEFAULT_CONTROLLER) {\r\n\r\n $uri = current(explode('?', $_SERVER['REQUEST_URI']));\r\n\r\n $retVal = new stdClass;\r\n $retVal->controller = DEFAULT_CONTROLLER;\r\n $retVal->route = [];\r\n\r\n if ($uri !== '/') {\r\n\r\n // Seperate out any actual GET parameters that may have been passed along and store appropriately\r\n if (strpos($_SERVER['REQUEST_URI'], '?') !== false) {\r\n $uri = explode('?', $_SERVER['REQUEST_URI']);\r\n $get = $uri[1];\r\n $_SERVER['QUERY_STRING'] = $get;\r\n $uri = $uri[0];\r\n $get = explode('&', $get);\r\n foreach ($get as $param) {\r\n $p = explode('=', $param);\r\n $_GET[$p[0]] = count($p) === 2 ? urldecode($p[1]) : true;\r\n }\r\n }\r\n\r\n $path = self::getHostPath();\r\n $uri = str_replace(substr($path, 0, strlen($path) - 1), '', $uri);\r\n if ($uri{0} == '/') {\r\n $uri = substr($uri, 1);\r\n }\r\n\r\n if (strlen($uri)) {\r\n $uri = explode('/', $uri);\r\n $retVal->controller = array_shift($uri);\r\n $retVal->route = $uri;\r\n }\r\n\r\n }\r\n\r\n return $retVal;\r\n\r\n }", "public function load_controller(){\n\n\t\t// return array\n\t\treturn array(\n\n\t\t\t\t\"default_controller\"\t=> \"index\",\n\n\t\t\t\t\"force_https\"\t\t\t=> false\n\n\t\t\t);\n\t}", "public function getController(): Controller {\n\t\t$action = Check::key( $this->request->get( 'action' ), '' );\n\n\t\tif ( !$action ) {\n\t\t\treturn $this->getDefaultController();\n\t\t}\n\n\t\t$controller_class = $this->controller_namespace . $action;\n\n\t\tif ( !\\class_exists( $controller_class ) ) {\n\t\t\treturn $this->getDefaultController();\n\t\t}\n\n\t\treturn $this->instanceController( $controller_class );\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "public function getDefaultController() {\r\n\t\treturn $this->defaultController;\r\n\t}", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "private function resolve_controller() {\n $match = false;\n foreach ($this->controller_patterns as $controller=>$patterns) {\n if ($match) break;\n foreach ($patterns as $pattern) {\n if ($match) break;\n $pattern_string = '';\n \n foreach ($pattern as $pattern_key=>$pattern_value) {\n \n $pattern_needle = '~'.$pattern_value;\n if (strpos($pattern_needle, '{') && strpos($pattern_needle, '}')) {\n \n $stripped_pattern = str_replace(array('{', '}'), '', $pattern_value);\n $param_options = explode('||', $stripped_pattern);\n $param_match = false;\n \n if (isset($this->url_parts[$pattern_key])) {\n foreach ($param_options as $param_option) {\n $data = explode(':', $param_option);\n if ($data[0]($this->url_parts[$pattern_key])) { \n $this->url_params[$data[1]] = $this->url_parts[$pattern_key];\n $param_match = true;\n break;\n }\n }\n }\n if ($param_match) $pattern_string .= $this->url_parts[$pattern_key];\n } else {\n $pattern_string .= $pattern_value;\n }\n if ($pattern_key != (sizeof($pattern)-1)) $pattern_string .= '/';\n }\n \n // if url pattern matches controller pattern, set match=true & the controller to be rendered\n if ($pattern_string == $this->url_parts_string) { \n $match = true;\n $this->controller = new $controller($this->url_parts, $this->url_params, $this->payload);\n break;\n \n // else set url_params to null and let the default controller be returned\n } else { \n $this->url_params = null;\n }\n }\n }\n \n // if not controller resolved handle result\n if (empty($this->controller)) {\n // if url is a subset of /api return API 404 controller\n if ($this->url_parts[0] == 'api') {\n $this->controller = new API_404_Controller($this->url_parts, $this->url_params, $this->payload);\n // else redirect the user to the front page\n } else {\n redirect('/'); \n }\n }\n \n return true;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function getControllerFromPath($path = NULL, ResourceInterface $resource = NULL);", "public function getControllerAction()\n {\n $router = $this->serviceManager->get('router');\n $request = $this->serviceManager->get('request');\n $routeMatch = $this->serviceManager->get('Application')->getMvcEvent()->getRouteMatch();\n $routeMatch = $router->match($request);\n if (!is_null($routeMatch)) {\n //echo $routeMatch->getMatchedRouteName();\n $controller = strtolower($routeMatch->getParam('controller'));\n $action = strtolower($routeMatch->getParam('action'));\n $this->controller_action = sprintf(\"%s_%s\", strtolower($controller), strtolower($action));\n } else {\n $this->controller_action = 'application_index';\n }\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "public function __construct(){\n\t\t$url = $this->processUrl();\n\n\t\t//this if statement unsets the defaultController so we can use the one that is being talked to.\n\t\tif(file_exists('../app/controllers/'.$url[0].'.php')){\n\t\t\t$this->defaultController = $url[0];\n\t\t\tunset($url[0]);\n\t\t}\n\n\t\trequire_once('../app/controllers/' .$this->defaultController.'.php');\n\n\t\t$this->defaultController = new $this->defaultController;//instantiate and make it an object\n\n\t\tif(isset($url[1])){\n\t\t\tif(method_exists($this->defaultController,$url[1])){\n\t\t\t$this->defaultMethod = $url[1];\n\t\t\tunset($url[1]);\n\t\t\t}\t\n\t\t}\n\n\t\t\n\t\t$this->parameters = $url ? array_values($url):[];\n\t\t// print_r($this->parameters);\n\n\t\tcall_user_func_array([$this->defaultController,$this->defaultMethod],$this->parameters);\n\t}", "function getController($context) {\n\t\t$uri=$context->getURI();\n\t\t$path=$uri->getPart();\n\t\tswitch ($path) {\n\t\t\tcase 'admin':\n\t\t\t\treturn getAdminController($context);\n\t\t\tcase '':\n\t\t\t\t$uri->prependPart('home');\n\t\t\t\treturn 'Static';\n\t\t\tcase 'static':\n\t\t\t\treturn 'Static';\n\t\t\tcase 'login':\n\t\t\t\treturn 'Login';\n\t\t\tcase 'logout':\n\t\t\t\treturn 'Logout';\n\t\t\tcase \"checkout\":\n\t\t\t\treturn \"Checkout\";\n\t\t\tcase \"myShoppingCart\":\n\t\t\t return \"ShoppingCart\";\n\t\t\tdefault:\n\t\t\t\tthrow new InvalidRequestException (\"No such page \");\n\t\t}\n\t}", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public static function controller()\n\t{\n\t\treturn self::$router->getController();\n\t}", "protected function createDefault() :void\n {\n $path = app_path('Resources/Default');\n Storage::makeDirectory($path, true);\n\n DefaultRoutes::create('routes', $path);\n }", "public function initBaseController();", "public function & GetController ();", "public function buildController(Resource $resource);", "public function getDefaultController()\n {\n return $this->getConfig('defaultController');\n }", "public function GetController ();", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function _createRouter(){\n\t\treturn new SimpleRouter();\n\t}", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "static function start()\n {\n $controller_name = 'Main';\n $action_name = 'Index';\n\n $routes = explode('/', $_SERVER['REQUEST_URI']);\n\n // get the name of the controller\n if (!empty($routes[1])) {\n $controller_name = ucfirst($routes[1]);\n }\n\n // get the name of the action\n if (!empty($routes[2])) {\n $action_name = ucfirst($routes[2]);\n }\n\n // add prefixes\n $controller_name = 'Controller' . $controller_name;\n $action_name = 'action' . $action_name;\n\n // take file with controller class\n $controller_file = $controller_name . '.php';\n $controller_path = \"../app/controllers/\" . $controller_file;\n\n try {\n if (!file_exists($controller_path)) {\n throw new \\Exception('Could not find file');\n }\n include \"../app/controllers/\" . $controller_file;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n // create a controller\n $controller_name = \"App\\\\Controllers\\\\\" . $controller_name;\n $controller = new $controller_name();\n $action = $action_name;\n\n try {\n if (!method_exists($controller, $action)) {\n throw new \\Exception('Could not find method');\n }\n // call the controller action\n $controller->$action();\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }" ]
[ "0.7532251", "0.7308779", "0.72074556", "0.718768", "0.70499915", "0.6821785", "0.6719813", "0.6698703", "0.66509897", "0.6611736", "0.6593473", "0.6575393", "0.6574831", "0.65747076", "0.65632564", "0.6556623", "0.65434456", "0.6516485", "0.6485568", "0.6443361", "0.64056623", "0.64014226", "0.63942", "0.63934225", "0.6374811", "0.6372271", "0.63550663", "0.63502765", "0.63274634", "0.6325303", "0.6282793", "0.6282379", "0.62705296", "0.62085277", "0.6200998", "0.61914545", "0.6181579", "0.61694556", "0.61602527", "0.6139183", "0.6137413", "0.6127855", "0.6097332", "0.6090912", "0.605129", "0.6049064", "0.6029798", "0.6006343", "0.6003389", "0.5997579", "0.5990588", "0.59862673", "0.59825855", "0.59540004", "0.594229", "0.5923979", "0.59219027", "0.59219027", "0.59219027", "0.5917943", "0.5901678", "0.5900909", "0.5897143", "0.5896143", "0.5883741", "0.5877697", "0.58743596", "0.5855138", "0.5847835", "0.5840886", "0.583427", "0.58330274", "0.58181936", "0.5815917", "0.5810537", "0.5798052", "0.57976764", "0.57948947", "0.57927173", "0.5787682", "0.5782261", "0.5781717", "0.57800233", "0.57762206", "0.5772483", "0.5766206", "0.5757339", "0.5751663", "0.5746906", "0.57382745", "0.57345957", "0.5732646", "0.5719429", "0.5710025", "0.56999254", "0.5697501", "0.5679637", "0.5679255", "0.5677495", "0.5672214", "0.5665945" ]
0.0
-1
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) { //instantiate a new object from class Category $category = new Category; //set the property values of the newly instantiated object accordingly $category->name = $request->name ; //save the newly instantiated oject, doing so will store it as an entry in its corresponding table in the DB $category->save(); $request->session()->flash('message', "The category " .$request->name . " has been added"); //and return the products return redirect('products/create'); }
{ "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(Category $category) { //no need to use find($id), as resource already does it for us and is put in $category $products = $category->products; //to get the items related to the category, we use the products property of the category, this only works if there is an established relationship in the model. return view('products.catalog', compact('products')); }
{ "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(Category $category) { // }
{ "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, Category $category) { // }
{ "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(Category $category) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Display a listing of the resource.
public function index() { return PostShort::collection( BlogPost::orderByRaw('(CASE WHEN publication = 0 THEN id END) DESC') ->orderBy('publication_date', 'desc') ->paginate(20) ); }
{ "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
Store a newly created resource in storage.
public function store(Request $request) { $validator = Validator::make($request->all(), [ 'title' => 'sometimes|required|min:3|max:150', 'content' => 'sometimes|required|min:3' ]); if($validator->fails()) { return [ "status" => "error", "message" => "ValidateError", "errors" => $validator->messages()->all() ]; } $post = BlogPost::add($request->all()); if($post) return ["status" => "ok"]; return [ "status" => "error", "message" => "SaveError", "errors" => $post->errors() ]; }
{ "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
Update the specified resource in storage.
public function update(Request $request, $id) { $BlogPost = BlogPost::find($id); $validator = Validator::make($request->all(), [ 'title' => 'sometimes|required|min:3|max:150', 'content' => 'sometimes|required|min:3', 'publication' => 'sometimes|required|numeric', 'commenting' => 'sometimes|required|numeric' ]); if($validator->fails()) { return [ "status" => "error", "message" => "ValidateError", "errors" => $validator->messages()->all() ]; } $BlogPost->edit($request->all()); return [ "status" => "ok" ]; }
{ "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) { BlogPost::find($id)->remove(); return [ "status" => "ok" ]; }
{ "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
Define the model's default state.
public function definition() { return [ 'kingdom_id' => null, 'game_unit_id' => null, 'amount' => 1000, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultState()\r\n\t{\r\n\t}", "static function get_default_state();", "public function getDefaultUserState();", "private function setDefaultStates(): void\n {\n foreach ($this->arr_attributes as $strParamName) {\n $this->states[$strParamName] = $this->params->get($strParamName, 0);\n }\n }", "abstract protected function getDefaultModel();", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "protected function getDefaultModelObject() : void\n {\n return;\n }", "public function applyDefaultValues()\n {\n $this->active = false;\n }", "protected function makeDefault()\n {\n $this->options = [];\n $this->menuSource = MenuSource::STATIC_SOURCE;\n $this->action = new Action(ActionType::MENU(), 'Default menu name', 'Default menu text');\n }", "public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }", "public function __default()\n\t{\n\n\t}", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "function getDefaultState(){\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('is_default'=>true));\r\n\t\t$recordSet = $this->db->get(TBL_MST_STATES);\r\n\t\t$data=$recordSet->result() ;\r\n\t\treturn $data[0]->id;\r\n\t}", "public function setValueDefault()\n {\n $this->isActive = true;\n $this->createdAt = new \\DateTime();\n }", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function getDefaultStateName() {\n return $this->values->get('DefaultStateName');\n }", "public function default() {\n \n $this->data = ModuleConfig::settings();\n // [Module_Data]\n }", "public static function bootStateMachine()\n {\n static::creating(function ($model) {\n $fieldState = $model->getFieldState();\n if (empty($model->$fieldState)) {\n $model->$fieldState = $model->getInitialState();\n }\n $model->beforeTransition($model->fromTransition, $model->toTransition);\n $model->setStateChangeAt();\n });\n static::created(function ($model) {\n $model->afterTransition($model->fromTransition, $model->toTransition);\n });\n static::saving(function ($model) {\n $model->beforeTransition($model->fromTransition, $model->toTransition);\n $model->setStateChangeAt();\n });\n static::saved(function ($model) {\n $model->afterTransition($model->fromTransition, $model->toTransition);\n });\n }", "function _setModelState()\r\n {\r\n $state = parent::_setModelState(); \r\n $app = JFactory::getApplication();\r\n $model = $this->getModel( $this->get('suffix') );\r\n $ns = $this->getNamespace();\r\n\r\n $state['filter_id_from'] = $app->getUserStateFromRequest($ns.'id_from', 'filter_id_from', '', '');\r\n $state['filter_id_to'] = $app->getUserStateFromRequest($ns.'id_to', 'filter_id_to', '', '');\r\n $state['filter_name'] = $app->getUserStateFromRequest($ns.'name', 'filter_name', '', '');\r\n $state['filter_enabled'] = $app->getUserStateFromRequest($ns.'enabled', 'filter_enabled', '', '');\r\n $state['filter_taxclass'] = $app->getUserStateFromRequest($ns.'taxclass', 'filter_taxclass', '', '');\r\n $state['filter_shippingtype'] = $app->getUserStateFromRequest($ns.'shippingtype', 'filter_shippingtype', '', '');\r\n \r\n foreach (@$state as $key=>$value)\r\n {\r\n $model->setState( $key, $value ); \r\n }\r\n return $state;\r\n }", "public function getInitialState(): StateContract\n {\n return $this->newState(['value' => 1]);\n }", "public function state();", "public function setUserDefaultStatus($userDefaultStatus);", "public function setStateModel($stateModel) {}", "public function getBaseState() {}", "public function init()\r\n {\r\n $this->_helper->db->setDefaultModelName('DefaultMetadataValue');\r\n }", "public function set_to_default()\n\t{\n\t\t// SimpleDB requires a value for every attribue...\n\t\t$this->_name = NULL;\n\t\t$this->_contextid = NULL;\n\t\t$this->_userid = NULL;\n $this->_deleted = 0;\n\t\t$this->_lastmodified = 0;\t\n\t}", "public function create_default() {\n if (!$this->model->has_default()) {\n $default_data = [\n 'id' => 1,\n 'name' => 'Beregu',\n 'desc' => 'team vs team',\n ];\n $this->model->create_default($default_data);\n\n $default_data = [\n 'id' => 2,\n 'name' => 'Individu',\n 'desc' => 'individu vs individu',\n ];\n $this->model->create_default($default_data);\n }\n }", "public function __construct(State $model)\n\t{\n\t\t$this->model = $model;\n\t}", "public function getStateModel() {}", "public function set_default_data() {\n\t\t$this->button_text_color = '#FFFFFF';\n\t\t$this->button_background_color = '#6699CC';\n\n\t\t$this->header_text_color = '#FFFFFF';\n\t\t$this->header_background_color = '#6699CC';\n\n\t\t$this->button_text = 'Do Not Sell My Data';\n\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\n\t\t$this->ot_logo = '';\n\t\t$this->display_position = 'right';\n\t\t$this->floating_button\t= '';\n\t\t$this->isLinkEnabled \t= 'textlink';\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "public function initializeDefaults()\n {\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function setDefaultAttribute($value){\n $this->attributes['default'] = ($value === 'true' || $value ? true : false);\n}", "private function _set_default()\r\n\t{\r\n\t\tif($this->input->post('default'))\r\n\t\t{\r\n\t\t\t$this->db->update('showcases',array('default' => 0));\r\n\t\t\t$this->db->where('id', $this->input->post('default'));\r\n\t\t\t$this->db->update('showcases',array('default' => 1));\r\n\t\t\t\r\n\t\t\t$this->set_message('success', 'Vetrina predefinita aggiornata con successo!');\r\n\t\t\tredirect($this->list);\r\n\t\t}\r\n\t}", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "public function __default()\r\n \t{\r\n \t if( self::isArg( 'notifwindow') )\r\n \t {\r\n $this->view = \"common_notifwindow\";\r\n \t $this->viewArgs['table'] = self::getArg( \"table\", AT_posint, true );\r\n \t }\r\n \t else\r\n \t {\r\n $this->view = \"dummygame_dummygame\";\r\n self::trace( \"Complete reinitialization of board game\" );\r\n }\r\n \t}", "private function _load_default_model(){\n\n\t\t$default_model_name = strtolower(get_class($this)) . '_model';\n\n\t\tif(file_exists(APPPATH . 'models/' . $default_model_name . '.php')){\n\n\t\t\t$this->load->model($default_model_name, strtolower(get_class($this)));\n\t\t\t$this->_default_model = strtolower(get_class($this));\n\t\t}\n\n\t}", "public function model()\n {\n return State::class;\n }", "public function model()\n {\n return State::class;\n }", "public function getDefault();", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "protected function initialiseModel()\n {\n parent::initialiseModel();\n\n $this->SelectedTab = 0;\n }", "final protected function _defaults(){\n if(! $this->_defaults) return;\n foreach($this->_defaults as $conf => $default_value){\n if(! self::inform($conf)) self::define($conf, $default_value);\n }\n }", "public function useDefaults()\n\t{\n\t\t$this->use_defaults = true;\n\t}", "public function set_behaviors_default_data() {\n\n\t\t$this->is_google_personalize_enabled = 'checked';\n\t\t$this->google_confirmation_title = 'Personalized advertisements';\n\t\t$this->google_confirmation_message = 'Turning this off will opt you out of personalized advertisements delivered from Google on this website.';\n\t\t$this->confirmbutton = 'Confirm';\n\t\t$this->is_email_enabled = 'checked';\n\t\t$this->email_address = '';\n\t\t$this->popup_main_title = 'Do Not Sell My Personal Information';\n\t\t$this->link_text = 'Privacy Policy';\n\t\t$this->link_url = '';\n\t\t$this->privacy_policy_message = 'Exercise your consumer rights by contacting us below';\n\t\t$this->is_phone_enabled = 'checked';\n\t\t$this->phone_number = '';\n\t\t$this->form_link_text = 'Exercise Your Rights';\n\t\t$this->form_link_url = '';\n\t\t$this->form_enable = 'checked';\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\t\t$this->selectuseroption\t\t\t\t = 'All';\n\t\t$this->isIABEnabled \t\t\t\t = 'checked';\n\t\t$this->isLSPAenable \t\t\t\t = '';\n\t}", "public function makeDefault() {\n $this->update([\n 'color' => null,\n 'size' => null\n ]);\n }", "public function applyDefaultData()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $config = $objectManager->get('\\Magento\\Framework\\App\\Config\\ScopeConfigInterface');\n\n $this->setsup_is_active(1);\n $this->setsup_locale($config->getValue('general/locale/code'));\n $this->setsup_currency($config->getValue('currency/options/base'));\n $this->setsup_country($config->getValue('general/country/default'));\n\n return $this;\n }", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "public function setDefaultStateName($stateName) {\n $this->values->put('DefaultStateName', $stateName);\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "function init() {\n $this->options['selected'] = isset($this->options['value']) ?\n true : @(bool)$this->options['default'];\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function init() {\n\t\t// use this method to initialize default values.\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "protected function cliModelInit()\n {\n }", "function getDefaultValue() \n {\n return $this->getValueByFieldName( 'statevar_default' );\n }", "public function __default()\r\n {\r\n if( self::isArg( 'notifwindow') ) {\r\n $this->view = \"common_notifwindow\";\r\n $this->viewArgs['table'] = self::getArg( \"table\", AT_posint, true );\r\n } else {\r\n $this->view = \"thecrew_thecrew\";\r\n self::trace( \"Complete reinitialization of board game\" );\r\n }\r\n }", "public function toggleDefault()\n {\n $this->language->default = ! $this->language->default;\n }", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "function post_model_init($from_cache = FALSE)\n {\n }", "public static function preModel(){\n\t\t\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "protected function get_default() {\n\t\treturn false;\n\t}", "protected function setDefaultTemplate(): void\n {\n $this->setDefaultData(function(Generator $faker) {\n return [\n 'password' => 'xx',\n 'username' => $faker->email,\n 'modified' => time(),\n // set the model's default values\n // For example:\n // 'name' => $faker->lastName\n ];\n });\n }", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "public function __default()\r\n {\r\n if (self::isArg('notifwindow')) {\r\n $this->view = \"common_notifwindow\";\r\n $this->viewArgs['table'] = self::getArg(\"table\", AT_posint, true);\r\n } else {\r\n $this->view = \"lettertycoon_lettertycoon\";\r\n self::trace(\"Complete reinitialization of board game\");\r\n }\r\n }", "protected function setDefaults()\n {\n return;\n }", "public function defaultData();", "public function getStatesModel()\n\t{\n\t\treturn $this->statesModel = new StatesModel();\n\t}", "public function getDefaultValue();", "public function getDefaultValue();", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "public function applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}", "private function getStateDefaultStatus($state)\n {\n\t\tif(\\Cart2Quote\\License\\Model\\License::getInstance()->isValid()) {\n\t\t\t$status = false;\n $stateNode = $this->_getState($state);\n if ($stateNode) {\n $status = $this->quoteStatusFactory->create()->loadDefaultByState($state);\n $status = $status->getStatus();\n }\n return $status;\n\t\t}\n\t}" ]
[ "0.77757794", "0.72255844", "0.6857964", "0.67950636", "0.67661", "0.6433752", "0.64074224", "0.63712305", "0.61876214", "0.61864567", "0.6159088", "0.61543477", "0.6153316", "0.61428887", "0.6116904", "0.61084956", "0.6106097", "0.60391295", "0.60389197", "0.6019848", "0.5986674", "0.59860927", "0.5976762", "0.59668744", "0.59477085", "0.5901205", "0.58822954", "0.5878731", "0.5871747", "0.5848243", "0.58415335", "0.58413815", "0.5833248", "0.5825086", "0.58250594", "0.5806455", "0.58058864", "0.58041453", "0.58029646", "0.57660234", "0.57429475", "0.57429475", "0.57427984", "0.57279396", "0.5711024", "0.5692638", "0.5673827", "0.566948", "0.5664214", "0.5660662", "0.56602883", "0.5649529", "0.56371003", "0.56371003", "0.56371003", "0.56371003", "0.56371003", "0.56371003", "0.56371003", "0.56371003", "0.56371003", "0.5635351", "0.5633597", "0.5625998", "0.5625998", "0.5625998", "0.5625998", "0.5625998", "0.56185526", "0.5617039", "0.5617039", "0.5617039", "0.559846", "0.5595863", "0.5588903", "0.5571013", "0.5570181", "0.55631495", "0.55542296", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.5544705", "0.55306304", "0.5529163", "0.55278975", "0.5527834", "0.55129236", "0.55105746", "0.5509279", "0.5508973", "0.5508973", "0.5507722", "0.55054384", "0.5486495" ]
0.0
-1