query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Gets the 'claroline.core_bundle.validator.constraints.workspace_unique_code_validator' service. This service is shared. This method always returns the same instance of the service. | protected function getClaroline_CoreBundle_Validator_Constraints_WorkspaceUniqueCodeValidatorService()
{
$this->services['claroline.core_bundle.validator.constraints.workspace_unique_code_validator'] = $instance = new \Claroline\CoreBundle\Validator\Constraints\WorkspaceUniqueCodeValidator();
$instance->setEntityManager($this->get('doctrine.orm.default_entity_manager'));
return $instance;
} | [
"protected function getApiPlatform_ValidatorService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/api-platform/core/src/Validator/ValidatorInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/api-platform/core/src/Bridge/Symfony/Validator/Validator.php';\n\n return $this->privates['api_platform.validator'] = new \\ApiPlatform\\Core\\Bridge\\Symfony\\Validator\\Validator(($this->services['validator'] ?? $this->getValidatorService()), $this);\n }",
"protected function getDoctrine_Orm_Validator_UniqueService()\n {\n return $this->services['doctrine.orm.validator.unique'] = new \\Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntityValidator($this->get('doctrine'));\n }",
"protected function getValidatorService()\n {\n return $this->services['validator'] = new \\Symfony\\Component\\Validator\\Validator($this->get('validator.mapping.class_metadata_factory'), new \\Symfony\\Bundle\\FrameworkBundle\\Validator\\ConstraintValidatorFactory($this, array('doctrine.orm.validator.unique' => 'doctrine.orm.validator.unique')), $this->get('translator.default'), 'validators', array(0 => $this->get('doctrine.orm.validator_initializer')));\n }",
"protected function getValidatorService()\n {\n return $this->services['validator'] = $this->get('validator.builder')->getValidator();\n }",
"protected function getValidatorService()\n {\n return $this->services['validator'] = ${($_ = isset($this->services['validator.builder']) ? $this->services['validator.builder'] : $this->get('validator.builder')) && false ?: '_'}->getValidator();\n }",
"protected function getDoctrine_Orm_Validator_UniqueService()\n {\n return $this->services['doctrine.orm.validator.unique'] = new \\Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntityValidator(${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine')) && false ?: '_'});\n }",
"public function getValidator()\n {\n return $this->getService('symfony.component.validator.validator');\n }",
"protected function getValidatorService()\n {\n return $this->services['validator'] = ($this->privates['validator.builder'] ?? $this->getValidator_BuilderService())->getValidator();\n }",
"protected function getOroForm_Extension_ClientValidationService()\n {\n return $this->services['oro_form.extension.client_validation'] = new \\Oro\\Bundle\\FormBundle\\Form\\Extension\\ClientValidationExtension();\n }",
"protected function getValidatorService()\n {\n return $this->services['validator'] = new \\Symfony\\Component\\Validator\\Validator\\TraceableValidator(($this->privates['validator.builder'] ?? $this->getValidator_BuilderService())->getValidator());\n }",
"public static function getValidator() {\n\t\treturn static::$validator;\n\t}",
"protected function getValidation_ConstraintService()\n {\n return $this->services['validation.constraint'] = new \\Drupal\\Core\\Validation\\ConstraintManager($this->get('container.namespaces'), $this->get('cache.discovery'), $this->get('module_handler'));\n }",
"function & getValidator()\n {\n $validator = $this->calendar->getValidator();\n return $validator;\n }",
"protected function getValidatorInstance()\n {\n return $this->validator();\n }",
"function GetValidator()\n\t\t{\n\t\t\tif (empty($this->validator))\n\t\t\t{\n\t\t\t\tif (strcasecmp(get_parent_class($this), \"Object\") == 0) $object_name = get_class($this);\n\t\t\t\telse $object_name = get_parent_class($this);\n\t\t\t\t$object_name = ucwords($object_name) . \"Validator\";\n\t\t\t\t\n\t\t\t\t$this->validator = new $object_name();\n\t\t\t}\n\t\t\treturn $this->validator;\n\t\t}",
"protected function getThemeValidatorService()\n {\n return $this->services['theme_validator'] = new \\PrestaShop\\PrestaShop\\Core\\Addon\\Theme\\ThemeValidator();\n }",
"protected function getValidator()\n {\n if ($this->validator === null) {\n $this->validator = new FinnishSocialSecurityNumberValidateGeneric();\n }\n \n return $this->validator;\n }",
"protected static function validator() {\n\t\tif (empty(self::$validate)) {\n\t\t\tself::$validate = new MpoValidator();\n\t\t}\n\t\treturn self::$validate;\n\t}",
"protected function getForm_TypeExtension_Form_ValidatorService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\FormTypeExtensionInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\AbstractTypeExtension.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\Extension\\\\Validator\\\\Type\\\\BaseValidatorExtension.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\form\\\\Extension\\\\Validator\\\\Type\\\\FormTypeValidatorExtension.php';\n\n return $this->privates['form.type_extension.form.validator'] = new \\Symfony\\Component\\Form\\Extension\\Validator\\Type\\FormTypeValidatorExtension(($this->services['validator'] ?? $this->getValidatorService()));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is to initiate a direct download $file is the name of the file to be downloaded with the full path (e.g. 'image/popup.jpg') $ext is the name of the file extension e.g. 'jpg' | Public Function InitiateDownload($file,$ext){
$fp = fopen($file, "r");
header("Content-Type:application/$ext");
header("Content-Disposition:attachment;
filename=$file");
fpassthru($fp);} | [
"public function downloadFile();",
"function doDownloadFile() {\n\t\t$this->db = xn(\"db\");\n\t\t$this->collection = xn(\"collection\");\n\t\t$this->id = xn(\"id\");\n\t\t$db = $this->_mongo->selectDB($this->db);\n\t\t$prefix = substr($this->collection, 0, strrpos($this->collection, \".\"));\n\t\t$file = $db->getGridFS()->findOne(array(\"_id\" => rock_real_id($this->id)));\n\t\t$fileinfo = pathinfo($file->getFilename());\n\t\t$extension = strtolower($fileinfo[\"extension\"]);\n\t\timport(\"lib.mime.types\", false);\n\t\tob_end_clean();\n\t\tif (isset($mime_types[$extension])) {\n\t\t\theader(\"Content-Type:\" . $mime_types[$extension]);\n\t\t}\n\t\telse {\n\t\t\theader(\"Content-Type:text/plain\");\n\t\t}\n\t\theader(\"Content-Disposition: attachment; filename=\" . $fileinfo[\"basename\"]);\n\t\theader(\"Content-Length:\" . $file->getSize());\n\t\techo $file->getBytes();\n\t\texit;\n\t}",
"public function doDownloadFile() {\n\t\t$this->db = xn(\"db\");\n\t\t$this->collection = xn(\"collection\");\n\t\t$this->id = xn(\"id\");\n\t\t$db = $this->_mongo->selectDB($this->db);\n\t\t$prefix = substr($this->collection, 0, strrpos($this->collection, \".\"));\n\t\t$file = $db->getGridFS($prefix)->findOne(array(\"_id\" => rock_real_id($this->id)));\n\t\t$fileinfo = pathinfo($file->getFilename());\n\t\t$extension = strtolower($fileinfo[\"extension\"]);\n\t\timport(\"lib.mime.types\", false);\n\t\tob_end_clean();\n\t\tif (isset($GLOBALS[\"mime_types\"][$extension])) {\n\t\t\theader(\"Content-Type:\" . $GLOBALS[\"mime_types\"][$extension]);\n\t\t}\n\t\telse {\n\t\t\theader(\"Content-Type:text/plain\");\n\t\t}\n\t\theader(\"Content-Disposition: attachment; filename=\" . $fileinfo[\"basename\"]);\n\t\theader(\"Content-Length:\" . $file->getSize());\n\t\techo $file->getBytes();\n\t\texit;\n\t}",
"function fileDownload()\n{\n\tglobal $ajax;\n\tglobal $files;\n\tglobal $moduleFilename;\n\n\t$basePath = getBasePath();\n\t$currentPath = getCurrentPath();\n\t$selectedItem = getSelectedItem();\n\t$url = $files->fileDownloadUrl($basePath, $currentPath,\n\t\t$selectedItem, html::getBaseUrl(), '/application/' .\n\t\t$moduleFilename);\n\t$ajax->sendCommand(46, $url);\n}",
"abstract public function sendToBrowserDownload($filename);",
"function file_download() {\n if (!$this->active_file) {\n $this->httpError(HTTP_BAD_REQUEST);\n } // if\n \n if(!$this->active_repository->canView($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n $file_source = implode(\"\\n\", $this->repository_engine->cat($this->active_revision, $this->active_file, $this->request->get('peg')));\n download_contents($file_source, 'application/octet-stream', $this->active_file_basename, true);\n }",
"function download() {\n $down_img = $this->input->get('file');\n $file_name = 'needbiznow-seller.jpg';\n $file_path = $this->template->get_frontend_image($down_img, true);\n $mime = 'application/force-download';\n header('Pragma: public');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Cache-Control: private', false);\n header('Content-Type: ' . $mime);\n header('Content-Disposition: attachment; filename=\"' . $file_name . '\"');\n header('Content-Transfer-Encoding: binary');\n header('Connection: close');\n readfile($file_path); // relative path to file \n exit();\n }",
"function projectdocumentDownload()\r\n\t {\r\n\t\t$file = $_GET['fileName'];//print_r($file);die;\r\n\t\t$filePath= 'tenderFile/'.$file;\r\n\t\theader(\"Content-Disposition: attachment;filename=$file\");\r\n\t\treadfile($filePath);\r\n\t\t\t \r\n\t }",
"public static function output_file_download($file, $name, $mime_type=''){\n\t\t if(!is_readable($file)) die('File not found or inaccessible!');\n\t\t \n\t\t $size = filesize($file);\n\t\t //$name = rawurldecode($name);\n\t\t \n\t\t /* Figure out the MIME type (if not specified) */\n\t\t $known_mime_types=array(\n\t\t \t\"pdf\" => \"application/pdf\",\n\t\t \t\"txt\" => \"text/plain\",\n\t\t \t\"html\" => \"text/html\",\n\t\t \t\"htm\" => \"text/html\",\n\t\t\t\"exe\" => \"application/octet-stream\",\n\t\t\t\"zip\" => \"application/zip\",\n\t\t\t\"doc\" => \"application/msword\",\n\t\t\t\"xls\" => \"application/vnd.ms-excel\",\n\t\t\t\"ppt\" => \"application/vnd.ms-powerpoint\",\n\t\t\t\"gif\" => \"image/gif\",\n\t\t\t\"png\" => \"image/png\",\n\t\t\t\"jpeg\"=> \"image/jpg\",\n\t\t\t\"jpg\" => \"image/jpg\"\n\t\t );\n\n\t\t if($mime_type==''){\n\t\t\t //$file_extension = strtolower(substr(strrchr($file,\".\"),1));\n\t\t\t $vaFile \t\t\t= pathinfo($file) ;\n\t\t\t $file_extension\t= $vaFile['extension'] ; \n\t\t\t if(array_key_exists($file_extension, $known_mime_types)){\n\t\t\t\t$mime_type=$known_mime_types[$file_extension];\n\t\t\t } else {\n\t\t\t\t$mime_type=\"application/force-download\";\n\t\t\t };\n\n\t\t }; \n\t\t \n\t\t @ob_end_clean(); //turn off output buffering to decrease cpu usage\n\t\t \n\t\t // required for IE, otherwise Content-Disposition may be ignored\n\t\t if(ini_get('zlib.output_compression'))\n\t\t ini_set('zlib.output_compression', 'Off');\n\t\t \n\t\t header('Content-Type: ' . $mime_type);\n\t\t header('Content-Disposition: attachment; filename=\"'.$name.'.'.$file_extension.'\"');\n\t\t header(\"Content-Transfer-Encoding: binary\");\n\t\t header('Accept-Ranges: bytes');\n\t\t \n\t\t /* The three lines below basically make the \n\t\t download non-cacheable */\n\t\t header(\"Cache-control: private\");\n\t\t header('Pragma: private');\n\t\t header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t \n\t\t // multipart-download and download resuming support\n\t\t if(isset($_SERVER['HTTP_RANGE'])){\n\t\t\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n\t\t\tlist($range) = explode(\",\",$range,2);\n\t\t\tlist($range, $range_end) = explode(\"-\", $range);\n\t\t\t$range=intval($range);\n\t\t\tif(!$range_end) {\n\t\t\t\t$range_end=$size-1;\n\t\t\t} else {\n\t\t\t\t$range_end=intval($range_end);\n\t\t\t}\n\t\t \n\t\t\t$new_length = $range_end-$range+1;\n\t\t\theader(\"HTTP/1.1 206 Partial Content\");\n\t\t\theader(\"Content-Length:\" . $new_length);\n\t\t\theader(\"Content-Range: bytes \" . $range-$range_end/$size);\n\t\t } else {\n\t\t\t$new_length=$size;\n\t\t\theader(\"Content-Length: \".$size);\n\t\t }\n\t\t \n\t\t /* output the file itself */\n\t\t $chunksize = 1*(1024*1024); //you may want to change this\n\t\t $bytes_send = 0;\n\t\t if ($file = fopen($file, 'r')){\n\t\t\tif(isset($_SERVER['HTTP_RANGE']))\n\t\t\tfseek($file, $range);\n\t\t \n\t\t\twhile(!feof($file) && \n\t\t\t\t(!connection_aborted()) && \n\t\t\t\t($bytes_send<$new_length)\n\t\t\t ){\n\t\t\t\t$buffer = fread($file, $chunksize);\n\t\t\t\tprint($buffer); //echo($buffer); // is also possible\n\t\t\t\tflush();\n\t\t\t\t$bytes_send += strlen($buffer);\n\t\t\t}\n\t\t fclose($file);\n\t\t}else die('Error - can not open file.');\n\t\t \n\t\tdie();\n\t}",
"public function forceDownload()\n {\n\n\n if ($this->type == \"jpg\")\n\n {\n $this->toJpg();\n\n } elseif ($this->type == \"png\") {\n\n $this->toPng();\n\n } elseif ($this->type == \"gif\") {\n\n $this->toGif();\n }\n\n header('Content-Description: File Transfer');\n header(\"Content-Type: application/octet-stream\");\n header('Content-Length: ' . filesize($this->path));\n header('Content-Disposition: attachment; filename=\"' . basename($this->path.'\"'));\n readfile($this->path);\n\n //remove the temp file\n unlink($this->path);\n\n }",
"public function viewFile() {\n $array = explode('.', $this->name);\n $extension = end($array);\n $attrDownload = \"\";\n if (in_array('.'.$extension, listExtensions(true))) {\n if($this->getInfo('BASEURL')) {\n $link = $this->getInfo('BASEURL');\n } else {\n $link = $this->getInfo('URL');\n }\n } else {\n $link = $_SERVER['REQUEST_URI'].str_replace(CWDIR, '', $this->rawPath);\n $attrDownload = 'download=\"'.cleanFilename($this->name).'\"';\n }\n echo '<a class=\"item\" href=\"'.$link.'\" target=\"_blank\" title=\"'.$link.'\" '.$attrDownload.'/><span>'.cleanFilename($this->name).'</span></a>';\n }",
"function downloadFile()\n\t{\n\t\tglobal $ilAccess, $ilias, $lng;\n\t\t\n\t\tif (!$ilAccess->checkAccess(\"read\", \"\", $_GET[\"ref_id\"]))\n\t\t{\n\t\t\t$ilias->raiseError($lng->txt(\"permission_denied\"),$ilias->error_obj->MESSAGE);\n\t\t}\n\n\t\t$file = explode(\"_\", $_GET[\"file_id\"]);\n\t\tinclude_once(\"./Modules/File/classes/class.ilObjFile.php\");\n\t\t$fileObj =& new ilObjFile($file[count($file) - 1], false);\n\t\t$fileObj->sendFile();\n\t\texit;\n\t}",
"public function download() {\t\t}",
"public function download(){\r\n\t\tdownload($this->arquivo_nome);\r\n\t}",
"function download_file($file) {\n\tglobal $camp_link; \n\n\t// restrict downloaded files to .Group and .Mission files\n\t$allowedExts = array(\"Group\", \"group\", \"Mission\", \"mission\");\n\n\t$DownloadDir = \"downloads/\";\n\n\t$path = \"$DownloadDir\".\"$file\";\n//\techo \"\\$path: $path<br />\\n\";\n\n\tif (file_exists($path)) {\n\n\t\t$tmp = explode(\".\", $path);\n\t\t$extension = end($tmp);\n//\t\techo \"\\$extension: $extension<br />\\n\";\n\n\t\tif (in_array($extension, $allowedExts)) {\n \t\theader('Content-Description: File Transfer');\n\t\t header('Content-Type: application/octet-stream');\n\t\t header('Content-Disposition: attachment; filename='.basename($path));\n\t\t header('Content-Transfer-Encoding: binary');\n\t\t header('Expires: 0');\n\t\t header('Cache-Control: must-revalidate');\n\t\t header('Pragma: public');\n\t\t header('Content-Length: ' . filesize($path));\n\t\t ob_clean();\n\t\t flush();\n\t\t readfile($path);\n\t\t\treturn(true); \n\t\t} else {\n\t\t\techo \".$extension is not an allowed extension<br />\\n\";\n\t\t\treturn(false); \n\t\t}\n\t} else {\n\t\techo \"$path does not exist or is unreadable<br />\\n\"; \n\t\treturn(false); \n\t}\n}",
"public function actionDownload()\r\n {\r\n $path = $_SERVER['DOCUMENT_ROOT']; // change the path to fit your websites document structure\r\n $fullPath = $path . $_GET['download_file'];\r\n if ($fd = fopen($fullPath, \"r\")) {\r\n $fsize = filesize($fullPath);\r\n $path_parts = pathinfo($fullPath);\r\n $ext = strtolower($path_parts[\"extension\"]);\r\n switch ($ext) {\r\n case \"pdf\":\r\n header(\"Content-type: application/pdf\"); // add here more headers for diff. extensions\r\n header(\"Content-Disposition: attachment; filename=\\\"\" . $path_parts[\"basename\"] . \"\\\"\"); // use 'attachment' to force a download\r\n break;\r\n default;\r\n header(\"Content-type: application/octet-stream\");\r\n header(\"Content-Disposition: filename=\\\"\" . $path_parts[\"basename\"] . \"\\\"\");\r\n }\r\n header(\"Content-length: $fsize\");\r\n header(\"Cache-control: private\"); //use this to open files directly\r\n while (!feof($fd)) {\r\n $buffer = fread($fd, 2048);\r\n echo $buffer;\r\n }\r\n }\r\n fclose($fd);\r\n exit;\r\n }",
"private function output_file($file, $name, $mime_type='') \n {\n //print_r($file);\n if (!is_readable($file))\n die('File not found or inaccessible!');\n\n $size = filesize($file);\n $name = rawurldecode($name);\n\n /* Figure out the MIME type (if not specified) */\n $known_mime_types = array(\n \"pdf\" => \"application/pdf\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\" => \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n );\n\n if ($mime_type == '') {\n $file_extension = strtolower(substr(strrchr($file, \".\"), 1));\n if (array_key_exists($file_extension, $known_mime_types)) {\n $mime_type = $known_mime_types[$file_extension];\n } else {\n $mime_type = \"application/force-download\";\n };\n };\n\n @ob_end_clean(); //turn off output buffering to decrease cpu usage\n // required for IE, otherwise Content-Disposition may be ignored\n if (ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n\n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"' . $name . '\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n\n /* The three lines below basically make the\n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\n // multipart-download and download resuming support\n if (isset($_SERVER['HTTP_RANGE'])) {\n list($a, $range) = explode(\"=\", $_SERVER['HTTP_RANGE'], 2);\n list($range) = explode(\",\", $range, 2);\n list($range, $range_end) = explode(\"-\", $range);\n $range = intval($range);\n if (!$range_end) {\n $range_end = $size - 1;\n } else {\n $range_end = intval($range_end);\n }\n\n $new_length = $range_end - $range + 1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n } else {\n $new_length = $size;\n header(\"Content-Length: \" . $size);\n }\n\n /* output the file itself */\n $chunksize = 1 * (1024 * 1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r')) {\n if (isset($_SERVER['HTTP_RANGE']))\n fseek($file, $range);\n\n while (!feof($file) &&\n (!connection_aborted()) &&\n ($bytes_send < $new_length)\n ) {\n $buffer = fread($file, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\n fclose($file);\n } else\n die('Error - can not open file.');\n\n die();\n }",
"function downloadFile($file)\n {\n $this->load->helper('download');\n $name = $file;\n $data = file_get_contents('./uploads/' . $file);\n force_download($name, $data);\n redirect('kegiatan');\n }",
"public function download($file)\n{\n\tif(!$this->ion_auth->in_group($this->config->item('uploadGroup')))\n\t{\n\t\t$this->sprite_class->load('master/access_denied');\n\t}\n\t\n\t$this->load->helper('download');\n\t\n\t$sprite = $this->sprites_model->get_sprite_data($file);\n\t$name = url_title($sprite['name'], 'dash', TRUE);\n\t$link = $sprite['filename'];\n\t$fixedname = $name.\".\".$sprite['vt_version'].\".\".$sprite['submission_version'].\".zspr\"; \n\n\tif(is_file(\"files/$link\"))\n\t\t{\n\t\t\t$location = file_get_contents('./files/'.$link);\n\t\t\tforce_download($fixedname, $location); \n\t\t\tredirect('sprites/index','refresh');\n\t\t}\n\telse\n\t\t{\n\t\t$data['error'] = 'The file for that Sprite does not exist!';\n\t\t$data['sprites'] = $this->sprites_model->get_all_sprites();\n\t\t$data['adminArray'] = $data;\n\t\t$this->sprite_class->load('sprites/index', $data); // Loads the index\n\t\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a TAG_LONG node. tagLong(string $name, int $value) : Node | public static function tagLong($name, $value)
{
return self::simpleTag(self::TAG_LONG, $name, $value);
} | [
"function to_long_xml($longVal)\r\n{\r\n return '<long>' . $longVal . '</long>';\r\n}",
"public function setLong($identifier, $value);",
"public function writeLong($value);",
"public function setLongValue($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Int64Value::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function getLongValueUnwrapped()\n {\n return $this->readWrapperValue(\"long_value\");\n }",
"public function getLong()\n {\n return $this->long;\n }",
"public function getLong();",
"public function setLong($longVal) : void\n {\n $this->type = ClassWriter::$LONG;\n $this->longVal = $longVal;\n $this->hashCode = (0x7FFFFFFF & (($this->type + $longVal)));\n }",
"public function setPropertyLong( $name, $l ) {\n\t\t$this->properties[$name] = strval( $l );\n\t\t$this->updateProperties();\n\t}",
"public function getLongVersion(): string\n {\n return sprintf('%s <info>%s</info>', $this->getName(), $this->getVersion());\n }",
"public function getLongVersion(): string\n {\n return sprintf('%s <info>v%s</info>', $this->getName(), $this->getVersion());\n }",
"public function bigInt($name,$length = 20){\n\t\t$this->name = $name;\n\t\t$this->type = 'bigint';\n\t\t$this->length = $length;\n\t\treturn $this;\n\t}",
"public function readLong()\n {\n $bin = [];\n for ($i = 0; $i < 8; $i ++) {\n $bin[$i] = $this->in->readByte();\n }\n $tmp = unpack('N2', implode('', $bin));\n $long = $tmp[1] << 32 | $tmp[2];\n return $long;\n }",
"public function long() {\n return $this->lng();\n }",
"public function longText($name)\n {\n $this->columns[] = $column = new $this->modelColumnClass('longtext', $name);\n return $column;\n }",
"public static function bigInteger($name, $length) {\n\t\treturn new ColumnDefinition('BIGINT', $name, array($length));\n\t}",
"public function isLong(): bool\n {\n return $this->type == self::ST_LONG;\n }",
"public function longRange(string $name, array $params = [])\n {\n $this->validateField(\"longRange\", $name, $params);\n\n $this->mapping[$name] = $params;\n $this->mapping[$name][\"type\"] = \"longRange\";\n\n return $this;\n }",
"public function readLong()\n {\n return $this->readInt();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: format sequence string usage: formatSEQ(seq string,line num) | function formatSEQ($seq,$num)
{
$newseq = str_split($seq,$num);
$line = count($newseq);
$colnum = $num;
$rownum = $line + 1;
echo "<textarea rows=\"$rownum\" cols=\"$colnum\" readonly=\"readonly\" class=\"seq\">\n";
foreach($newseq as $pseq)
{
echo $pseq , "\n";
}
echo "</textarea>\n";
} | [
"function print_seq(){\n global $seq; # no time-consuming argument passing for us! :)\n if($seq != ''){\n echo wordwrap( strrev( strtr(strtoupper($seq), SRC, DST) ),\n LINE_LENGTH, \"\\n\", true ), \"\\n\";\n }\n $seq = '';\n}",
"public function pretty_sequence()\r\n {\r\n if (preg_match('/^[0-9]+.*/', $this->secuence))\r\n return \"#\".$this->sequence;\r\n else\r\n return '\"'.$this->sequence.'\"';\r\n }",
"function print_seq(&$seq){\r\n if ( $seq !== '' ) {\r\n echo chunk_split( strrev( strtr($seq, 'ACBDGHKMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDMKNSYAAWBRTGVHCDMKNSYAAWBR') ),\r\n\t\t60, \"\\n\");\r\n }\r\n $seq = '';\r\n}",
"function pretty_sequence() {\n # Pool sequence must start with a number.\n return '#'.$this->sequence;\n }",
"public function getSequenceAsString()\n {\n return $this->formatDependency('sequence', $this->getSequence());\n }",
"function format(): string\n\t{\n\t\t$args = func_get_args();\n\n\t\tif (is_array($args[0]))\n\t\t\t$args = $args[0];\n\n\t\treturn vsprintf($args[0], array_slice($args, 1));\n\t}",
"public function format($lines);",
"function format($format);",
"function get_sequence_name($sequence)\n {\n // return sequence name if configured\n $config_key = 'db_sequence_'.$sequence;\n $opt = cmail::get_instance()->config->get($config_key);\n\n if (!empty($opt))\n return $opt;\n \n return $sequence;\n }",
"function appendFormat($format) : IString;",
"public function format($specifier){}",
"function convert_sequence( $seq, $start ) {\n//echo \"SEQ: $seq<br>START $start<br>\\n\";\n $rc = array();\n $seqtmp = str_split( preg_replace( \"/\\s+/\", \"\", $seq ) );\n//echo \"SEQ: $seq<br>START $start<br>\\n\";\n foreach( $seqtmp as $s ) {\n\t$rc[$start] = $s;\n//echo \"rc[ $start ] = $s<br>\\n\";\n\t$start++;\n }\n return $rc;\n}",
"function prependFormat($format) : IString;",
"public function writeFormat() {\n\t\t$args = func_get_args();\n\t\t$str = call_user_func_array('sprintf', $args);\n\n\t\treturn $this->write($str);\n\t}",
"public function format()\n {\n return sprintf('%s-%s-%s', substr($this->number, 0, 2), ltrim(substr($this->number, 2, 6), '0'), substr($this->number, 8));\n }",
"function createLineNumbersFormatString($lineNumbersShow, $lineNumbersLeadingZeroes, $lineNumbersFieldWidth)\n{\n\t$lineNumbersFormatString = \"\";\n\n\tif(!$lineNumbersShow)\n\t{\n\t\treturn $lineNumbersFormatString; \n\t}\n\n\t$lineNumbersFormatString = \"%\";\n\t\n\tif($lineNumbersLeadingZeroes)\n\t{\n\t\t$lineNumbersFormatString .= \"0\";\n\t}\n\n\tif($lineNumbersFieldWidth >= 1)\n\t{\n\t\t$lineNumbersFormatString .= sprintf(\"%d\", $lineNumbersFieldWidth);\n\t}\n\n\t$lineNumbersFormatString .= \"d: \";\n\n\treturn \t$lineNumbersFormatString;\n}",
"function rt($seq)\r\n\t{\r\n\t\tarray_shift($seq);\r\n\t\treturn $seq;\r\n\t}",
"function setSeq($seq) {\n\t\t$this->_seq = $seq;\n\t}",
"function format_cell($cell): string\n{\n return preg_replace('#(\\d{3})(\\d{3})(\\d{4})#', '($1) $2-$3', $cell);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the mtt annee. | public function getMttAnnee() {
return $this->mttAnnee;
} | [
"public function getTpMoisAnnee() {\n return $this->tpMoisAnnee;\n }",
"public function getAnnee()\n {\n return $this->annee;\n }",
"public function getTpMoisAnnee(): ?string {\n return $this->tpMoisAnnee;\n }",
"public function getMttTaux() {\n return $this->mttTaux;\n }",
"public function getEtat()\n {\n return $this->etat;\n }",
"public function getAnneObtention()\n {\n return $this->anneObtention;\n }",
"public function get_temoin_t()\n {\n return $this->_temoin_t;\n }",
"public function getTdsAnnee() {\n return $this->tdsAnnee;\n }",
"public function getNAttestAem() {\n return $this->nAttestAem;\n }",
"public function getOtMuka()\n {\n\n return $this->ot_muka;\n }",
"public function getTaefecha()\n\t{\n\t\treturn $this->taefecha;\n\t}",
"public function getNAttestAemx() {\n return $this->nAttestAemx;\n }",
"public function getNoEt() {\n return $this->noEt;\n }",
"public function getAEmettre() {\n return $this->aEmettre;\n }",
"public function getNAttestAemedi() {\n return $this->nAttestAemedi;\n }",
"public function getTaverne()\n {\n return $this->taverne;\n }",
"public function getMontant()\n {\n return $this->Montant;\n }",
"public function getEtunimi(){\n return $this->etunimi;\n }",
"public function getTe()\n {\n return $this->te;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'buildsIndividualTestersCreateToManyRelationship' | protected function buildsIndividualTestersCreateToManyRelationshipRequest($id, $build_individual_testers_linkages_request)
{
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling buildsIndividualTestersCreateToManyRelationship'
);
}
// verify the required parameter 'build_individual_testers_linkages_request' is set
if ($build_individual_testers_linkages_request === null || (is_array($build_individual_testers_linkages_request) && count($build_individual_testers_linkages_request) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $build_individual_testers_linkages_request when calling buildsIndividualTestersCreateToManyRelationship'
);
}
$resourcePath = '/v1/builds/{id}/relationships/individualTesters';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($id !== null) {
$resourcePath = str_replace(
'{' . 'id' . '}',
ObjectSerializer::toPathValue($id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($build_individual_testers_linkages_request)) {
$_tempBody = $build_individual_testers_linkages_request;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires Bearer (JWT) authentication (access token)
if ($this->config->getAccessToken() !== null) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function testBuildsIndividualTestersCreateToManyRelationship()\n {\n }",
"protected function buildsIndividualTestersDeleteToManyRelationshipRequest($id, $build_individual_testers_linkages_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling buildsIndividualTestersDeleteToManyRelationship'\n );\n }\n // verify the required parameter 'build_individual_testers_linkages_request' is set\n if ($build_individual_testers_linkages_request === null || (is_array($build_individual_testers_linkages_request) && count($build_individual_testers_linkages_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $build_individual_testers_linkages_request when calling buildsIndividualTestersDeleteToManyRelationship'\n );\n }\n\n $resourcePath = '/v1/builds/{id}/relationships/individualTesters';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($build_individual_testers_linkages_request)) {\n $_tempBody = $build_individual_testers_linkages_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testBetaGroupsBuildsCreateToManyRelationship()\n {\n }",
"public function testBetaGroupsBetaTestersGetToManyRelationship()\n {\n }",
"protected function betaTestersBuildsGetToManyRelationshipRequest($id, $limit = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling betaTestersBuildsGetToManyRelationship'\n );\n }\n if ($limit !== null && $limit > 200) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling BetaTestersApi.betaTestersBuildsGetToManyRelationship, must be smaller than or equal to 200.');\n }\n\n\n $resourcePath = '/v1/betaTesters/{id}/relationships/builds';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCreateOrUpdateMany()\n {\n $postFields = [\n 'resources' =>\n [\n ['foo' => 'test body'],\n ['foo2' => 'test body 2'],\n ['foo3' => 'test body3']\n ]\n ];\n\n $this->assertEndpointCalled(\n function () use ($postFields) {\n $this->dummyResource->createOrUpdateMany($postFields);\n },\n 'dummy_resource/create_or_update_many.json',\n 'POST',\n ['postFields' => ['dummies' => $postFields]]\n );\n }",
"public function testBetaGroupsBuildsGetToManyRelated()\n {\n }",
"public function createMany(array $data) {\n\t\t$this->request = array(\n\t\t\t'uri' => array(\n\t\t\t\t'path' => 'create_many.json'\n\t\t\t),\n\t\t\t'method' => 'POST',\n\t\t\t'body' => array('organizations' => $data) // users must be plural here\n\t\t\t);\n\n\t\treturn $this->update($data);\n\t}",
"protected function betaGroupsBuildsCreateToManyRelationshipRequest($id, $beta_group_builds_linkages_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling betaGroupsBuildsCreateToManyRelationship'\n );\n }\n // verify the required parameter 'beta_group_builds_linkages_request' is set\n if ($beta_group_builds_linkages_request === null || (is_array($beta_group_builds_linkages_request) && count($beta_group_builds_linkages_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $beta_group_builds_linkages_request when calling betaGroupsBuildsCreateToManyRelationship'\n );\n }\n\n $resourcePath = '/v1/betaGroups/{id}/relationships/builds';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($beta_group_builds_linkages_request)) {\n $_tempBody = $beta_group_builds_linkages_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function betaGroupsBetaTestersGetToManyRelationshipRequest($id, $limit = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling betaGroupsBetaTestersGetToManyRelationship'\n );\n }\n if ($limit !== null && $limit > 200) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling BetaGroupsApi.betaGroupsBetaTestersGetToManyRelationship, must be smaller than or equal to 200.');\n }\n\n\n $resourcePath = '/v1/betaGroups/{id}/relationships/betaTesters';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function betaGroupsBetaTestersGetToManyRelatedRequest($id, $fields_beta_testers = null, $limit = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling betaGroupsBetaTestersGetToManyRelated'\n );\n }\n if ($limit !== null && $limit > 200) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling BetaGroupsApi.betaGroupsBetaTestersGetToManyRelated, must be smaller than or equal to 200.');\n }\n\n\n $resourcePath = '/v1/betaGroups/{id}/betaTesters';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($fields_beta_testers)) {\n $fields_beta_testers = ObjectSerializer::serializeCollection($fields_beta_testers, 'csv', true);\n }\n if ($fields_beta_testers !== null) {\n $queryParams['fields[betaTesters]'] = ObjectSerializer::toQueryValue($fields_beta_testers);\n }\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function betaTestersAppsDeleteToManyRelationshipRequest($id, $beta_tester_apps_linkages_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling betaTestersAppsDeleteToManyRelationship'\n );\n }\n // verify the required parameter 'beta_tester_apps_linkages_request' is set\n if ($beta_tester_apps_linkages_request === null || (is_array($beta_tester_apps_linkages_request) && count($beta_tester_apps_linkages_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $beta_tester_apps_linkages_request when calling betaTestersAppsDeleteToManyRelationship'\n );\n }\n\n $resourcePath = '/v1/betaTesters/{id}/relationships/apps';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($beta_tester_apps_linkages_request)) {\n $_tempBody = $beta_tester_apps_linkages_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCreate() {\n $one = new OneToManyEntity();\n $one->setName('One');\n\n $many = Array();\n for ($i = 1; $i <= 10; $i++) {\n $o = new OneToManyRhs();\n $o->setName(\"Entity$i\");\n $many[] = $o;\n }\n $one->setMany($many);\n $id = $this->persister->create($one);\n $this->assertNotNull($id);\n $this->assertEquals($id, $one->getId());\n\n foreach ($one->getMany() AS $o) {\n $this->assertNotNull($o);\n $this->assertInstanceOf('zpt\\orm\\test\\mock\\OneToManyRhs', $o);\n $this->assertNotNull($o->getId());\n }\n }",
"public function testAppsBetaTestersDeleteToManyRelationship()\n {\n }",
"protected function buildsBetaGroupsCreateToManyRelationshipRequest($id, $build_beta_groups_linkages_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling buildsBetaGroupsCreateToManyRelationship'\n );\n }\n // verify the required parameter 'build_beta_groups_linkages_request' is set\n if ($build_beta_groups_linkages_request === null || (is_array($build_beta_groups_linkages_request) && count($build_beta_groups_linkages_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $build_beta_groups_linkages_request when calling buildsBetaGroupsCreateToManyRelationship'\n );\n }\n\n $resourcePath = '/v1/builds/{id}/relationships/betaGroups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($build_beta_groups_linkages_request)) {\n $_tempBody = $build_beta_groups_linkages_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testAppsPreReleaseVersionsGetToManyRelated()\n {\n }",
"public function build(): BulkCreateTeamMembersRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"public function testSaveRelatedHasManyShouldBeIndexed() {\n\t\t\n\t\t$this->ApiResource->forModel($this->test_model);\n\t\t\n\t\t$this->ApiResource->withId();\n\t\t\n\t\t$this->ApiResource->withData(array(\n\t\t\t$this->test_model => array(\n\t\t\t\t'username' => 'username'\n\t\t\t),\n\t\t\t'Form' => array(\n\t\t\t\t'id' => 1,\n\t\t\t\t'name' => 'Name'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('attributes')\n\t\t\t->will($this->returnValue(array(\n\t\t\t\t'id',\n\t\t\t\t'username'\n\t\t\t)));\n\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('isRelationSaveable')\n\t\t\t->with($this->equalTo('Form'))\n\t\t\t->will($this->returnValue(true));\n\t\t\t\n\t\t$this->ApiResource->Permissions\n\t\t\t->expects($this->any())\n\t\t\t->method('withParentModel')\n\t\t\t->will($this->returnValue($this->ApiResource->Permissions));\n\t\t\n\t\t$this->ApiResource->Permissions\n\t\t\t->expects($this->any())\n\t\t\t->method('forModel')\n\t\t\t->will($this->returnValue($this->ApiResource->Permissions));\n\t\t\n\t\t$this->ApiResource->Permissions\n\t\t\t->expects($this->any())\n\t\t\t->method('withAttributes')\n\t\t\t->will($this->returnValue($this->ApiResource->Permissions));\n\t\t\n\t\t$this->ApiResource->Permissions\n\t\t\t->expects($this->any())\n\t\t\t->method('on')\n\t\t\t->will($this->returnValue($this->ApiResource->Permissions));\n\t\t\n\t\t$this->ApiResource->Permissions\n\t\t\t->expects($this->any())\n\t\t\t->method('allowAttributes')\n\t\t\t->will($this->returnValue(array(\n\t\t\t\t'id',\n\t\t\t\t'username'\n\t\t\t)));\n\t\t\n\t\t$this->ApiResource->Permissions\n\t\t\t->expects($this->any())\n\t\t\t->method('canCreate')\n\t\t\t->will($this->returnValue(true));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('getFieldMap')\n\t\t\t->will($this->returnValue(array(\n\t\t\t\t'id' => 'id',\n\t\t\t\t'username' => 'username'\n\t\t\t)));\n\t\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->once())\n\t\t\t->method('validates')\n\t\t\t->will($this->returnValue(true));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->once())\n\t\t\t->method('save')\n\t\t\t->will($this->returnValue(true));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('getAssociated')\n\t\t\t->will($this->returnValue(array(\n\t\t\t\t'ApiResourceComponentStuff' => 'hasOne',\n\t\t\t\t'Form' => 'hasMany'\n\t\t\t)));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}->Form = $this->getMock('Form');\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}->Form\n\t\t\t->expects($this->any())\n\t\t\t->method('attributes')\n\t\t\t->will($this->returnValue(array(\n\t\t\t\t'id',\n\t\t\t\t'name'\n\t\t\t)));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}\n\t\t\t->expects($this->any())\n\t\t\t->method('getFieldMap')\n\t\t\t->will($this->returnValue(array(\n\t\t\t\t'id' => 'id',\n\t\t\t\t'name' => 'name'\n\t\t\t)));\n\t\t\n\t\t$this->ApiResource->Controller->{$this->test_model}->Form\n\t\t\t->expects($this->never())\n\t\t\t->method('save');\n\t\t\n\t\t$this->ApiResource->Api\n\t\t\t->expects($this->once())\n\t\t\t->method('setResponseCode')\n\t\t\t->with($this->equalTo(4009));\n\t\t\n\t\t$test = $this->ApiResource->save();\n\t\t\n\t\t$this->assertFalse($test);\n\t\t\n\t\t// Test for Validation Error\n\t\t\n\t}",
"public function testPUTResourceWithManyManyRequest()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$data = '{\n\t\t\t\"id\": \"1\",\n\t\t\t\"name\": \"cat1\",\n\t\t\t\"posts\": [\n\t\t\t\t{\n\t\t\t\t\t\"author_id\": \"1\",\n\t\t\t\t\t\"content\": \"content1_UPDATED\",\n\t\t\t\t\t\"create_time\": \"2013-08-07 10:09:41\",\n\t\t\t\t\t\"id\": \"1\",\n\t\t\t\t\t\"title\": \"title1\"\n\t\t\t\t}, {\n\t\t\t\t\t\"author_id\": \"1\",\n\t\t\t\t\t\"content\": \"content7\",\n\t\t\t\t\t\"create_time\": \"2013-08-07 10:09:47\",\n\t\t\t\t\t\"title\": \"title1\"\n\t\t\t\t}\n\t\t\t]\n\t\t}';\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/category/1',\n\t\t\t'type'\t\t=> 'PUT',\n\t\t\t'data'\t\t=> $data,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\t\t\n\t\t$request->addEvent(ERestEvent::MODEL_WITH_RELATIONS, function() {\n\t\t\treturn ['posts'];\n\t\t});\n\n\t\t$expected_data = CJSON::decode($data);\n\t\t$expected_data['posts'][1]['id'] = 7;\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record Updated\",\"data\":{\"totalCount\":1,\"category\":' . CJSON::encode($expected_data) . '}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only select tasks with the given DelegationState. | public function taskDelegationState(?string $delegationState): TaskQueryInterface; | [
"private function filterNonSelectedTasks(): bool\n {\n // noting to do if task-filter is empty\n if (empty($this->tasksToRun)) {\n return true;\n }\n\n // collect task-ids to remove\n $tasksToRemove = [];\n foreach ($this->tasksToRun as $taskId => $taskEnabled) {\n if ((int)$taskEnabled === 1) {\n continue;\n }\n array_push($tasksToRemove, $taskId);\n }\n\n // remove tasks\n foreach ($this->data['tasks'] as $i => $task) {\n if (in_array($task['id'], $tasksToRemove)) {\n unset($this->data['tasks'][$i]);\n }\n }\n array_merge($this->data['tasks'], []);\n return true;\n }",
"public function excludeSubtasks(): TaskQueryInterface;",
"function findConsultationsByState( $state )\n {\n }",
"protected function filter_excluded_state($state) {\n\t\tif ($this->st_is_service && isset($this->options['service_filter_status'][$state]))\n\t\t\treturn $this->options['service_filter_status'][$state];\n\t\telse if (!$this->st_is_service && isset($this->options['host_filter_status'][$state]))\n\t\t\treturn $this->options['host_filter_status'][$state];\n\t\treturn $state;\n\t}",
"public function selectByState( Inx_Api_List_ListContext $listContext, Inx_Api_TriggerMailing_StateFilter $stateFilter, \r\n\t\t\tInx_Api_TriggerMailing_TriggerMailingAttribute $orderAttribute = null, $iOrderType = null, $sFilter = null );",
"public function getAllPostcodesByState($state_id) {\n \t$state_id = $this->conn->real_escape_string($state_id);\n $stmt = $this->conn->prepare(\"SELECT p.*,s.state_id,s.state_name,c.country_id,c.country_name FROM postcodes p INNER JOIN states s ON p.state_id=s.state_id INNER JOIN countries c ON c.country_id = s.country_id WHERE s.state_id=? OR s.state_name=?\");\n\t\t$stmt->bind_param(\"is\", $state_id, $state_id);\n $stmt->execute();\n $tasks = $stmt->get_result();\n $stmt->close();\n return $tasks;\n }",
"public function getStateQuery($state)\n {\n\t\t$sql = $this->getQueryContent('SuggestStateQuery');\n\t\t$params = $this->getQueryParams('SuggestStateQuery');\n\t\t$sql = $this->bindSqlParams($sql,$params,$state);\n\t\treturn $this->db->fireSqlFetchAll($sql,'SuggestStateQuery');\n\t}",
"public function canLearnTask($taskId);",
"public function setSkipBookingFlowStaffSelection(?bool $skipBookingFlowStaffSelection): void\n {\n $this->skipBookingFlowStaffSelection['value'] = $skipBookingFlowStaffSelection;\n }",
"public function getStatesForSelect();",
"public function pendingTasks()\n {\n return $this->hasMany(Task::class, 'assigned_user_id')->where('status', TaskStatus::whereIn('name', [config('seed_data.task_statuses')[0], config('seed_data.task_statuses')[1]])->first()->id);\n }",
"public abstract function getNextState($taskid);",
"public function get_keep_completed_task_list()\n {\n }",
"public function testTaskWorkGetDefaultSelect()\n {\n }",
"public function processingTasks()\n {\n return $this->hasMany(Task::class)->where('state', 1);\n }",
"public function findByQueueAndState($queue, $state);",
"public function read_person_tasks_in_progress($id)\n {\n // subquery and a parameter in a query\n $sql = 'SELECT s.task_name, s.id ' .\n 'FROM task AS s ' .\n 'INNER JOIN task_person AS p ON p.task_id = s.id ' .\n 'WHERE p.person_id = ? ' .\n 'AND s.status_id = 2 ';\n \n $query = $this->db->query($sql, array($id));\n return $query->result_array();\n }",
"public function getAllDelegatedTask($userId)\n\t{\n return $this->getFilterType('me', $userId)->get();\n\t}",
"public function pendingTasks()\n {\n return $this->hasMany(Task::class)->where('state', 0);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the cached WordPress core hashes. | public static function get_cached_core_hashes( $version, $locale ) {
$all_hashes = self::get_setting( 'core_hashes', array() );
if ( ! isset( $all_hashes["{$version}-{$locale}"] ) ) {
return false;
}
$hashes = $all_hashes["{$version}-{$locale}"]['hashes'];
$checked_at = $all_hashes["{$version}-{$locale}"]['checked_at'];
if (
( empty( $hashes ) && $checked_at + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt() ) ||
$checked_at + WEEK_IN_SECONDS < ITSEC_Core::get_current_time_gmt()
) {
ITSEC_Core::get_scheduler()->schedule_soon( 'preload-core-hashes', compact( 'version', 'locale' ) );
}
return $hashes;
} | [
"public static function get_current_core_hashes() {\n\t\treturn self::get_core_hashes( $GLOBALS['wp_version'], get_locale() );\n\t}",
"public function get_content_hash() {\r\n\t\tif ( function_exists( 'w3tc_dbcache_flush' ) ) {\r\n\t\t\tw3tc_dbcache_flush();\r\n\t\t\tw3tc_objectcache_flush();\r\n\t\t\tw3tc_pgcache_flush();\r\n\t\t}\r\n\t\t$my_theme = wp_get_theme();\r\n\t\t$content = $my_theme->get( 'Version' );\r\n\t\t//get slides\r\n\t\tdefine( 'WP_USE_THEMES', false );\r\n\t\tglobal $wp_query;\r\n\t\tquery_posts( 'post_status=publish&posts_per_page=-1' );\r\n\t\tob_start();\r\n\t\tget_template_part( 'slides' );\r\n\t\t$content .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\t//get sidebar\r\n\t\tob_start();\r\n\t\tdynamic_sidebar( 'home-right' );\r\n\t\t$content .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\t//get footer\r\n\t\tob_start();\r\n\t\tdynamic_sidebar( 'footer' );\r\n\t\t$content .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\t$content .= serialize( get_theme_mods() );\r\n\r\n\t\treturn md5( $content );\r\n\t}",
"private function calculate_hash() {\n\t\t$hash = array(\n\t\t\t'theme_mods' => md5( json_encode( get_option( 'theme_mods_' . $this->slug ) ) ),\n\t\t\t'post_meta' => md5( json_encode( get_post_meta( $this->setting_page ) ) ),\n\t\t);\n\n\t\treturn $hash;\n\t}",
"function get_git_hash()\n {\n $value = Cache::rememberForever('git_hash', function () {\n exec('git rev-parse --verify HEAD 2> /dev/null', $output);\n\n return $output[0];\n });\n\n return $value;\n }",
"public static function get_cached_wporg_plugin_hashes( $slug, $version ) {\n\n\t\t$all_hashes = self::get_setting( 'wporg_plugin_hashes', array() );\n\n\t\tif ( ! isset( $all_hashes[ $slug ][ $version ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$hashes = $all_hashes[ $slug ][ $version ]['hashes'];\n\t\t$checked_at = $all_hashes[ $slug ][ $version ]['checked_at'];\n\n\t\t// If the hashes are expired, schedule a background update. If no hashes were found, we check sooner.\n\t\tif (\n\t\t\t( empty( $hashes ) && $checked_at + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt() ) ||\n\t\t\t$checked_at + WEEK_IN_SECONDS < ITSEC_Core::get_current_time_gmt()\n\t\t) {\n\t\t\tITSEC_Core::get_scheduler()->schedule_soon( 'preload-plugin-hashes', compact( 'slug', 'version' ) );\n\t\t}\n\n\t\treturn $hashes;\n\t}",
"public function getHashes() {\n return $this->URL_HASHES;\n }",
"function getHash() {\n\t\treturn $this->_Hash;\n\t}",
"public function getHash()\n {\n if (null === $this->hash) {\n $this->generateHash();\n }\n\n return $this->hash;\n }",
"public static function getSiteHash() {\n // Copied from apachesolr_site_hash().\n if (!($hash = \\Drupal::state()->get('search_api_solr.site_hash', FALSE))) {\n global $base_url;\n $hash = substr(base_convert(hash('sha256', uniqid($base_url, TRUE)), 16, 36), 0, 6);\n \\Drupal::state()->set('search_api_solr.site_hash', $hash);\n }\n return $hash;\n }",
"public function getMainHash()\n {\n return $this->mainHash;\n }",
"public function get_remote_hashes() {\n\n\t\t$remote_hashes = array();\n\n\t\t$plugins = $this->get_plugin_hashes();\n\n\t\tif ( is_array( $plugins ) ) {\n\n\t\t\tforeach ( $plugins as $plugin ) {\n\t\t\t\t$remote_hashes = array_merge( $remote_hashes, $plugin['h'] );\n\t\t\t}\n\n\t\t}\n\n\t\t$themes = $this->get_theme_hashes();\n\n\t\tif ( is_array( $themes ) ) {\n\n\t\t\tforeach ( $themes as $theme ) {\n\t\t\t\t$remote_hashes = array_merge( $remote_hashes, $theme['h'] );\n\t\t\t}\n\n\t\t}\n\n\t\t$core_hashes = $this->get_core_hashes();\n\n\t\tif ( is_array( $core_hashes ) ) {\n\t\t\t$remote_hashes = array_merge( $remote_hashes, $core_hashes );\n\t\t}\n\n\t\treturn $remote_hashes;\n\n\t}",
"public static function get_version_hash() {\n global $CFG;\n\n $versions = array();\n\n // main version first\n $version = null;\n include($CFG->dirroot.'/version.php');\n $versions['core'] = $version;\n\n // modules\n $mods = get_plugin_list('mod');\n ksort($mods);\n foreach ($mods as $mod => $fullmod) {\n $module = new stdClass();\n $module->version = null;\n include($fullmod.'/version.php');\n $versions[$mod] = $module->version;\n }\n\n // now the rest of plugins\n $plugintypes = get_plugin_types();\n unset($plugintypes['mod']);\n ksort($plugintypes);\n foreach ($plugintypes as $type=>$unused) {\n $plugs = get_plugin_list($type);\n ksort($plugs);\n foreach ($plugs as $plug=>$fullplug) {\n $plugin = new stdClass();\n $plugin->version = null;\n @include($fullplug.'/version.php');\n $versions[$plug] = $plugin->version;\n }\n }\n\n $hash = sha1(serialize($versions));\n\n return $hash;\n }",
"public function getHashes() { return hash_algos(); }",
"public function getFileHash()\n {\n return $this->file_hash;\n }",
"public function getHash()\n {\n\tif ( !$this->hash )\n\t{\n\t $this->hash= md5($this->getSize().'|'.parent::getHash());\n\t}\n\treturn $this->hash;\n }",
"public function getLockHash() {}",
"public static function getHashes()\n {\n return array(\n 'library/Jrahmy/DeferJs/Defer.php' => 'c012b8dd6d359e268b6e60a0d4de2690',\n 'library/Jrahmy/DeferJs/Listener.php' => '8e2781624cf1286cb3c52a68563931a7',\n\n\t\t);\n }",
"public function getHash()\n {\n return $this->user_hash;\n }",
"function getHash()\n\t{\n\t\tif( $this->hash == 0 )\n\t\t\t$this->hash = Hash::hashOfString($this->s);\n\t\treturn $this->hash;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method handles DoAddItem event | function OnDoAddItem(){
if (! $this->error) {
$this->_data = $this->GetFieldsData();
//validate form
$this->ValidateBeforeAdd();
if ($this->listSettings->HasItem("MAIN", "UNIQUE_FIELDS")) {
$this->checkForDuplicateUnique();
}
if ($this->disabled_add) {
if (strlen($this->host_library_ID)) {
$this->library_ID = $this->host_library_ID;
}
$this->AfterSubmitRedirect("?".($this->Package!="" ? "package=".$this->Package."&" : "")."page=" . $this->listHandler . "&" . $this->library_ID . "_start=" . $this->start . "&" . $this->library_ID . "_order_by=" . $this->order_by . "&library=" . $this->library_ID . "&" . $this->library_ID . "_parent_id=" . $this->parent_id . "&MESSAGE[]=LIBRARY_DISABLED_ADD" . "&" . $this->restore);
}
if (empty($this->validator->formerr_arr)) {
if (strlen($this->host_library_ID)) {
$this->library_ID = $this->host_library_ID;
}
//do method before add
$this->OnBeforeAdd();
//if not set custom error
if (! $this->custom_error) {
$this->UpdateRadioFields();
$_status = $this->Storage->Insert($this->_data);
//$_status = 1;
if ($_status) {
//--update _priority field, if defined
if (! $this->disabled_move) {
if ($this->key_field != $this->move_field) {
$data = array(
$this->key_field => $this->Storage->getInsertId() ,
$this->move_field => $this->Storage->getInsertId());
}
if (! $this->_data['_priority']) {
$this->Storage->Update($data);
}
}
$this->InsertNotOrdinaryFields($this->_data);
//do method after add
$this->OnAfterAdd($this->_data);
if ($this->is_context_frame)
$url = "?package=context&page=contextframe&event=refresh&MESSAGE[]=EDIT_ITEM_CREATED";
else
$url = "?".($this->Package!="" ? "package=".$this->Package."&" : "")."page=" . $this->listHandler . "&" . $this->library_ID . "_start=" . $this->start . "&" . $this->library_ID . "_order_by=" . $this->order_by . "&library=" . $this->library_ID . "&" . $this->library_ID . "_parent_id=" . $this->parent_id . "&" . $this->restore;
//redirect after add
$this->AfterSubmitRedirect($url);
}
}
}
else {
$this->event = "AddItem";
}
if (is_object($this->Controls["ItemsEdit"])) {
$this->OnBeforeCreateEditControl();
$this->InitItemsEditControl();
}
}
} | [
"function addItems();",
"function ajaxAddItem(){\r\n\t\tif(!$this->HasPermission(\"LootTable\"))\r\n\t\t\treturn $this->setAjaxResult(false, \"You do not have permission to edit loot tables.\");\r\n\t\tif($this->loottable->guild != $this->guild->id)\r\n\t\t\treturn $this->setAjaxResult(false, \"You can not edit someone elses loot table\");\r\n\r\n\t\t$name = strip_tags(util::getData(\"name\"));\r\n\t\t$cost = util::getData(\"cost\");\r\n\t\t$section = util::getData(\"section\");\r\n\r\n\t\t$entry = new dkpLootTableEntry();\r\n\t\t$entry->name = $name;\r\n\t\t$entry->cost = $cost;\r\n\t\t$entry->section = $section;\r\n\t\t$entry->loottable = $this->loottable->id;\r\n\t\t$entry->saveNew();\r\n\r\n\t\t$entry->loadFromDatabase($entry->id);\r\n\r\n\t\t//$temp = array(true,\"Item Added!\", $entry->id);\r\n\t\t$this->setAjaxResult(true,\"Item Added!\", $entry);\r\n\t}",
"function action_additem() {\n global $manager, $CONF;\n\n $manager->loadClass('ITEM');\n\n $result = ITEM::createFromRequest();\n\n if ($result['status'] == 'error')\n $this->error($result['message']);\n\n $blogid = getBlogIDFromItemID($result['itemid']);\n $blog =& $manager->getBlog($blogid);\n $btimestamp = $blog->getCorrectTime();\n $item = $manager->getItem(intval($result['itemid']), 1, 1);\n\n if ($result['status'] == 'newcategory') {\n $distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=itemList&blogid=' . intval($blogid));\n $this->action_categoryedit($result['catid'], $blogid, $distURI);\n } else {\n $methodName = 'action_itemList';\n call_user_func(array($this, $methodName), $blogid);\n }\n }",
"public function beforeItemAdd($item)\n {\n }",
"public function add_list_item() {\n check_ajax_referer( 'option_tree', 'nonce' );\n ot_list_item_view( $_REQUEST['name'], $_REQUEST['count'], array(), $_REQUEST['post_id'], $_REQUEST['get_option'], unserialize( ot_decode( $_REQUEST['settings'] ) ), $_REQUEST['type'] );\n die();\n }",
"function AddFormItem() {\n }",
"public function addItem()\n {\n // simple message to show where you are\n //echo 'Message from Controller: You are in the Controller: entities, using the method addItem().';\n\n // if we have POST data to create a new item entry\n if (isset($_POST[\"submit\"]) && !empty($_POST[\"item\"]) ) {\n // load model, perform an action on the model\n $items_model = $this->loadModel('ItemModel');\n $items_model->addItem($_POST[\"item\"], $_POST['groupOption']);\n }\n \n\n // where to go after item has been added\n header('location: ' . URL . 'item/index');\n }",
"function OnItemAdded($strEntity,$strNewItemIndex,$arrayItem)\n\t\t{\n\t\t\t$this->GetWebsite()->SendMailToAdmin(\n\t\t\t\t\"A new $$$EntityName$$$ has been added!\",\n\t\t\t\t\"The new item's id is $strNewItemIndex.\");\n\n\t\t\tparent::OnItemAdded($strEntity,$strNewItemIndex,$arrayItem);\n\t\t}",
"public function add( $item );",
"public function addItem(Item $item);",
"function addItem() {\n\t\t\n\t\t$item = iconv(\"UTF-8\", \"Windows-1251\", $_POST['item']);\n\t\t$price = $_POST['price'];\n\t\t$qty = $_POST['quantity'];\n\t\t\n\t\ttry {\n\t\t\t$data = $this->cr->addItem($item, ' ', 'А', '+', $price, $qty);\n\t\t\t$this->saveStatus();\n\t\t\t// var_dump( $data ); // Example of returned data\n\t\t\t// die();\n\t\t} catch (Exception $e) {\n\t\t\theader('Location: index.php?error='.urlencode($e->getMessage())); die();\n\t\t}\n\t}",
"public function processAddItemForm(Form $form)\r\n\t{\r\n\t\t$values = $form->values;\r\n\r\n\t\t$item = new Item;\r\n\t\t$item->assign($values, array('title', 'price', 'remaining'));\r\n\t\t$item->user = $this->user->getLoggedUser();\r\n\r\n\t\t$images = array();\r\n\t\t$images[] = new Image($values->image->getTemporaryFile(), null, $values->image->getName());\r\n\r\n\t\t$this->shop->addItem($item, $images);\r\n\t}",
"function MenuItem_Adding(&$Item) {\n\n\t//var_dump($Item);\n\t// Return FALSE if menu item not allowed\n\n\treturn TRUE;\n}",
"function OnDoEditItem(){\n if (! $this->error) {\n $this->_data = $this->GetFieldsData();\n $this->_data[$this->key_field] = $this->item_id;\n\n $this->ValidateBeforeAdd();\n\n $item = $this->Storage->{$this->GetItemMethod}(array(\n $this->key_field => $this->item_id));\n //set system fields\n $this->setItemSystemFields($this->_data, $item);\n\n //check for unique fields\n if ($this->listSettings->HasItem(\"MAIN\", \"UNIQUE_FIELDS\")) {\n $this->checkForDuplicateUnique();\n }\n\n if ($this->disabled_edit) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n }\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=LIBRARY_DISABLED_EDIT\" . \"&\" . $this->restore);\n }\n if (empty($this->validator->formerr_arr) && ! $this->child_error) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n $this->parent_id = $this->Request->ToNumber(\"custom_val\", 0);\n }\n //before edit event handler call\n $this->OnBeforeEdit();\n $this->UpdateRadioFields();\n $_result = $this->Storage->Update($this->_data);\n if ($_result){\n $this->InsertNotOrdinaryFields($this->_data);\n //after edit event handler call\n $this->OnAfterEdit();\n if ($this->is_context_frame)\n \t$url = \"?package=context&page=contextframe&event=refresh&MESSAGE[]=EDIT_ITEM_SAVED\";\n else\n \t$url = \"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=EDIT_ITEM_SAVED\" . \"&\" . $this->restore;\n\n $this->AfterSubmitRedirect($url);\n }\n }\n else {\n $this->event = \"EditItem\";\n }\n $this->OnBeforeCreateEditControl();\n $this->InitItemsEditControl();\n }\n }",
"public function testAddItem()\n {\n $container = new Formagic_Item_Container('test', array(\n 'rules' => array('mandatory'),\n 'filters' => array('trim')\n ));\n\n $mockItemName = 'test';\n $mockItemName2 = 'test2';\n\n // create and add by parameters\n $result = $container->addItem('Mock_MockItem', $mockItemName);\n $this->assertSame($container, $result);\n\n $addedItem = $container->getItem($mockItemName);\n $this->assertInstanceOf('Formagic_Item_Mock_MockItem', $addedItem);\n $this->assertEquals($addedItem->getName(), $mockItemName);\n\n // create new object with \"new\" operator, then add\n $item = new Formagic_Item_Mock_MockItem($mockItemName2);\n $container->addItem($item);\n $addedItem = $container->getItem($mockItemName2);\n\n $this->assertInstanceOf('Formagic_Item_Mock_MockItem', $item);\n $this->assertSame($item, $addedItem);\n }",
"public function addInventory() {\n\t\t//where does image go????\n\t\t$this->lending->addItem($this->input->post());\n\t}",
"abstract public function addItemById($id);",
"public function addItem($item, $value);",
"function SpecialItemAdd($listName, $tformNo, $itemToAdd){\n\t\n\t// get the current list contents first\n\t$qry = mysql_query(\"SELECT specialItems FROM makerlistinfo WHERE listName = '$listName' AND tformNo = '$tformNo'\");\n\n\twhile ($row = mysql_fetch_assoc($qry)){\n\t\t$rows = $row[\"specialItems\"];\n\t}\n\t// -----------------------------------\n\tif($rows != \"\"){\n\t\t\n\t\t// If there are items already in the list explode it and push in the new one\n\t\t$explodeIt = explode(\",\", $rows); // explode the rows\n\t\tarray_push($explodeIt, $itemToAdd); // join with the item to add\n\t\t$implodedInsert = implode(',', $explodeIt); // implode the list for insert\n\t\t$query = \"UPDATE `makerlistinfo` SET `specialItems` = '$implodedInsert' WHERE `tformNo` = '$tformNo' && `listName` = '$listName'\";\n\t\t\n\t} else {\n\t\t\n\t\t// if no current set add it singularly\n\t\t$query = \"UPDATE `makerlistinfo` SET `specialItems` = '$itemToAdd' WHERE `tformNo` = '$tformNo' && `listName` = '$listName'\";\n\t\t\n\t}\n\t\n\t// run the query\n\tmysql_query($query) or die(mysql_error());\n\n\techo json_encode(\"OK!!\");\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ TITULO: FG_Mi_Ubicacion FUNCION: Descifrar desde que sede estoy entrando a la aplicacion RETORNO: Sede en la que me encuentro DESAROLLADO POR: SERGIO COVA | function FG_Mi_Ubicacion(){
$NombreCliente = gethostname();
$IpCliente = gethostbyname($NombreCliente);
$Octeto = explode(".", $IpCliente);
switch ($Octeto[2]) {
//INICIO BLOQUE DE FTN
case '1':
return 'FTN';
break;
case '2':
return 'FTN';
break;
//FIN BLOQUE DE FTN
//INICIO BLOQUE DE FLL
case '7':
return 'FLL';
break;
//FIN BLOQUE DE FLL
//INICIO BLOQUE DE FAU
case '12':
if($IpCliente == "192.168.12.36" || $IpCliente == "192.168.12.40"){
return 'DBs';
}else if($IpCliente == "192.168.12.30"){
return 'GP';
}else{
return 'FAU';
}
break;
//FIN BLOQUE DE FAU
//INICIO BLOQUE DE KDI
case '15':
return 'KDI';
break;
//FIN BLOQUE DE KDI
//INICIO BLOQUE DE FSM
case '18':
return 'FSM';
break;
//FIN BLOQUE DE FSM
//INICIO BLOQUE DE FEC
case '20':
return 'FEC';
break;
//FIN BLOQUE DE FEC
//INICIO BLOQUE DE KD73
case '60':
return 'KD73';
break;
//FIN BLOQUE DE KD73
default:
return 'ARG';
//return ''.$Octeto[2];
break;
}
} | [
"function enviarcorreo_interno($destinatario,$destinatario2,$cc,$cc2,$pagos,$fec_pag,$t_nombres,$t_apellido1,$t_apellido2,$rut,$t_fec_nac,$email,$telefono,$telefono2,$direccion,$comuna,$cod_plan,$estado,$nom_plan,$num_benef,$valor_plan_benef,$cod_pago,$tipo_pago,$cant_descuento,$valor_plan,$token,$buyorder,$authorizationcode,$creditcardtype,$last4carddigits,$tbkuser,$username,$fecha_tbk,$payment_type_code,$fec_fac,$clase,$observa,$responsecode,$campania,$camp_nombre){\n \n /* Estado del Cliente */\n if($estado == 'S'){\n $titulo = 'Transacción Exitosa';\n }elseif($estado == 'R'){\n $titulo = 'Rechaza Cobro';\n }elseif($estado == 'T'){\n $titulo = 'Rechazo TBK';\n }elseif($estado == 'I'){\n $titulo = 'Nueva Suscripción'; \n }else{\n $titulo = '';\n }\n /* Tipo de Cliente */\n if($clase == 'A'){\n $tipo_clase = '(A) Autocontratados';\n }elseif($clase == 'B'){\n $tipo_clase = '(B) Inscripción y Cobro';\n }elseif($clase == 'C'){\n $tipo_clase = '(C) Solo Inscripción'; \n }else{\n $tipo_clase = '';\n }\n /* Tipo de Error Clientes antiguos*/\n if($responsecode == '0'){\n $obs_error = ''; \n }elseif($responsecode == '-97'){\n $obs_error = '-97 máximo monto diario de pago excedido';\n }elseif($responsecode == '-98'){\n $obs_error = '-98 máximo monto de pago excedido';\n }elseif($responsecode == '-99'){\n $obs_error = '-99 máxima cantidad de pagos diarios excedido'; \n }elseif(substr($responsecode,0, 1) != 'i' && substr($responsecode,0, 1) != 'c'){\n if($responsecode < 0 && $responsecode > -9){\n $obs_error = 'Rechazo TBK'; \n }\n }\n /* Tipo de Error COBRO */\n elseif($responsecode == 'c-97'){\n $obs_error = '-97 máximo monto diario de pago excedido';\n }elseif($responsecode == 'c-98'){\n $obs_error = '-98 máximo monto de pago excedido';\n }elseif($responsecode == 'c-99'){\n $obs_error = '-99 máxima cantidad de pagos diarios excedido'; \n }elseif(substr($responsecode,0, 1) == 'c'){\n if(substr($responsecode,1) < 0 && substr($responsecode,1) > -9){\n $obs_error = 'Rechazo TBK'; \n } \n }\n /* Tipo de Error INSCRIPCION */\n elseif($responsecode == 'i-1'){\n $obs_error = '-1 máximo monto diario de pago excedido';\n }elseif($responsecode == 'i-2'){\n $obs_error = '-2 máximo monto de pago excedido';\n }elseif($responsecode == 'i-3'){\n $obs_error = '-3 máxima cantidad de pagos diarios excedido'; \n }elseif($responsecode == 'i-4'){\n $obs_error = '-4 máxima cantidad de pagos diarios excedido'; \n }elseif($responsecode == 'i-5'){\n $obs_error = '-5 Rechazo - Posible Fraude (Transacción con riesgo de posible fraude)'; \n }else{\n $obs_error = 'No especifica';\n }\n \n //FORMATO FECHA TBK\n $newDate_tbk = date(\"d-m-Y H:i:s\", strtotime($fecha_tbk));\n \n $mensaje = \"CODIGO: {$pagos}, FECHA REGISTRO: {$fec_pag}, NOMBRE TITULAR: {$t_nombres} {$t_apellido1} {$t_apellido2}, RUT: {$rut}, FECHA NAC: {$t_fec_nac}, EMAIL: {$email}, TELEFONO: {$telefono}, TELEFONO 2: {$telefono2}, DIRECCION: {$direccion}, COMUNA: {$comuna}, CODIGO PLAN: {$cod_plan}, NOMBRE PLAN: {$nom_plan}, CANT BENEFICIARIOS: {$num_benef}, VALOR PLAN: {$valor_plan_benef}, COD PAGO: {$cod_pago}, TIPO PAGO: {$tipo_pago}, DESCUENTO: {$cant_descuento}, VALOR FINAL: {$valor_plan}, ESTADO: {$titulo}, TOKEN: {$token}, ORDEN DE COMPRA: {$buyorder}, CODIGO AUTORIZACION TBK: {$authorizationcode}, TIPO DE TARJETA: {$creditcardtype}, ULTIMOS 4 DIGITOS: {$last4carddigits}, USUARIO TBK: {$username}, COD USUARIO TBK: {$tbkuser}, FECHA TBK: {$newDate_tbk}, COD TIPO DE PAGO: {$payment_type_code}, FECHA FACTURACION: {$fec_fac}, CODIGO CAMPAÑA: {$campania}, NOMBRE CAMPAÑA: {$camp_nombre} , OBSERVACION ERROR: {$obs_error}, TIPO DE CLIENTE: {$tipo_clase}, COMENTARIO: {$observa} \";\n \n $fechahoy = date(\"Y-m-d\");\n $asunto = $titulo.\" en Pagina Web el \".$fechahoy.\" Cliente \".$t_nombres.\" \".$t_apellido1.\" \".$t_apellido2.\" Tipo de cliente \".$clase.\" Rut \".$rut. \".\";\n\n // Datos de la cuenta de correo utilizada para enviar vía SMTP\n $smtpHost = \"pyme91.pymedns.net\"; // Dominio alternativo brindado en el email de alta \n $smtpUsuario = \"autocontrato@rest911.cl\"; // Mi cuenta de correo\n $smtpClave = \"%&auto&%web2020\"; // Mi contraseña\n $correo = ('autocontrato@rest911.cl'); // Email desde donde se envia el correo\n $nombre = \"REST911 WEB\";\n\n\n $mail = new PHPMailer();\n $mail->IsSMTP();\n $mail->SMTPAuth = true;\n $mail->Port = 465; \n $mail->IsHTML(true); \n $mail->CharSet = \"utf-8\";\n $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail\n\n // VALORES A MODIFICAR //\n $mail->Host = $smtpHost; \n $mail->Username = $smtpUsuario; \n $mail->Password = $smtpClave;\n \n //DEBUG\n //$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only\n //$mail->SMTPDebug = 2;\n //$mail->Debugoutput = 'html';\n\n $mail->From = ($correo); // Email desde donde envío el correo.\n $mail->FromName = $nombre;\n $mail->AddAddress($destinatario); // Esta es la dirección a donde enviamos los datos del formulario\n $mail->AddAddress($destinatario2);\n $mail->addCC($cc); // Dirección de copia\n $mail->addCC($cc2); // Dirección de copia 2\n\n\n $mail->Subject = $asunto; // Este es el titulo del email.\n $mensajeHtml = nl2br($mensaje);\n $mail->Body = \"\n <html> \n\n <body> \n <TABLE BORDER=1;>\n <TR>\n <TD>CODIGO:</TD>\n <TD>{$pagos}</TD>\n </TR>\n <TR>\n <TD>FECHA REGISTRO:</TD>\n <TD>{$fec_pag}</TD>\n </TR>\n <TR>\n <TD>NOMBRE TITULAR:</TD>\n <TD>{$t_nombres} {$t_apellido1} {$t_apellido2}</TD>\n </TR>\n <TR>\n <TD>RUT:</TD>\n <TD>{$rut}</TD>\n </TR>\n <TR>\n <TD>FECHA NACIMIENTO:</TD>\n <TD>{$t_fec_nac}</TD>\n </TR>\n <TR>\n <TD>EMAIL:</TD>\n <TD>{$email}</TD>\n </TR>\n <TR>\n <TD>TELEFONO:</TD>\n <TD>{$telefono}</TD>\n </TR>\n <TR>\n <TD>TELEFONO 2:</TD>\n <TD>{$telefono2}</TD>\n </TR>\n <TR>\n <TD>DIRECCION:</TD>\n <TD>{$direccion}</TD>\n </TR>\n <TR>\n <TD>COMUNA:</TD>\n <TD>{$comuna}</TD>\n </TR>\n <TR>\n <TD>CODIGO PLAN:</TD>\n <TD>{$cod_plan}</TD>\n </TR>\n <TR>\n <TD>NOMBRE PLAN:</TD>\n <TD>{$nom_plan}</TD>\n </TR>\n <TR>\n <TD>CANT BENEFICIARIOS:</TD>\n <TD>{$num_benef}</TD>\n </TR>\n <TR>\n <TD>VALOR PLAN:</TD>\n <TD>{$valor_plan_benef}</TD>\n </TR>\n <TR>\n <TD>COD PAGO:</TD>\n <TD>{$cod_pago}</TD>\n </TR>\n <TD>TIPO PAGO:</TD>\n <TD>{$tipo_pago}</TD>\n </TR>\n <TR>\n <TD>DESCUENTO:</TD>\n <TD>{$cant_descuento}</TD>\n </TR>\n <TR>\n <TD>VALOR FINAL:</TD>\n <TD>{$valor_plan}</TD>\n </TR>\n <TR>\n <TD>ESTADO:</TD>\n <TD>{$titulo}</TD>\n </TR>\n <TR>\n <TD>TOKEN:</TD>\n <TD>{$token}</TD>\n </TR>\n <TR>\n <TD>ORDEN DE COMPRA:</TD>\n <TD>{$buyorder}</TD>\n </TR>\n <TR>\n <TD>CODIGO AUTORIZACION TBK:</TD>\n <TD>{$authorizationcode}</TD>\n </TR>\n <TR>\n <TD>TIPO DE TARJETA:</TD>\n <TD>{$creditcardtype}</TD>\n </TR>\n <TR>\n <TD>ULTIMOS 4 DIGITOS:</TD>\n <TD>{$last4carddigits}</TD>\n </TR>\n <TR>\n <TD>USUARIO TBK:</TD>\n <TD>{$username}</TD>\n </TR>\n <TR>\n <TD>COD USUARIO TBK:</TD>\n <TD>{$tbkuser}</TD>\n </TR>\n <TR>\n <TD>FECHA TBK:</TD>\n <TD>{$newDate_tbk}</TD>\n </TR>\n <TR>\n <TD>COD TIPO DE PAGO:</TD>\n <TD>{$payment_type_code}</TD>\n </TR>\n <TR>\n <TD>FECHA FACTURACION:</TD>\n <TD>{$fec_fac}</TD>\n </TR>\n <TR>\n <TD>OBSERVACION ERROR:</TD>\n <TD>{$obs_error}</TD>\n </TR>\n <TR>\n <TD>TIPO DE CLIENTE:</TD>\n <TD>{$tipo_clase}</TD>\n </TR>\n <TR>\n <TD>CODIGO CAMPAÑA:</TD>\n <TD>{$campania}</TD>\n </TR>\n <TR>\n <TD>NOMBRE CAMPAÑA:</TD>\n <TD>{$camp_nombre}</TD>\n </TR>\n <TR>\n <TD>COMENTARIO:</TD>\n <TD>{$observa}</TD>\n </TR>\n\n </TABLE>\n\n </body> \n\n </html>\n\n <br />\"; // Texto del email en formato HTML\n $mail->AltBody = \"{$mensaje} \\n\\n \"; // Texto sin formato HTML\n // FIN - VALORES A MODIFICAR //\n\n $mail->SMTPOptions = array(\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n )\n );\n\n return($mail->Send()); \n \n}",
"public function AplicaOfertaEnJuegos(){\r\n \r\n }",
"function seguimiento_usuario() {\n\t\t// si los datos han sido enviados por post se sobre escribe la variable $edo\n\t\tif ($_POST) {\n\t\t\t$edo = $this -> input -> post('estado');\n\t\t} else {\n\t\t\t$edo = 'pendientes';\n\t\t}\n\t\t$datos['selec'] = $edo;\n\n\t\t// se obtiene el listado\n\t\t$datos['consulta'] = $this -> conformidades_model -> get_conformidades_usuario($edo);\n\n\t\t// variables necesarias para la página\n\t\t$datos['titulo'] = 'Seguimiento de No Conformidades ';\n\t\t$datos['secciones'] = $this -> Inicio_model -> get_secciones();\n\t\t$datos['identidad'] = $this -> Inicio_model -> get_identidad();\n\t\t$datos['usuario'] = $this -> Inicio_model -> get_usuario();\n\t\t$this -> Inicio_model -> set_sort(15);\n\t\t$datos['sort_tabla'] = $this -> Inicio_model -> get_sort();\n\t\t$datos['selec'] = $edo;\n\n\t\t// estructura de la página\n\t\t$this -> load -> view('_estructura/header', $datos);\n\t\t$this -> load -> view('_estructura/top', $datos);\n\t\t$this -> load -> view('procesos/conformidades/seguimiento_usuario', $datos);\n\t\t$this -> load -> view('_estructura/right');\n\t\t$this -> load -> view('_estructura/footer');\n\t}",
"function cierraGestionInterno()\n\t{\n\t\t//echo \"<error>1</error>\";\n\t\t$this->validapwdtecleadoope();\n\t\t$wlidpersonarecibe=$this->argumentos[\"wl_idpersona_recibe\"];\n\t\t$wlusuarioalta=$this->argumentos[\"wl_usuario_alta\"];\n\t\t$wlusuarioactual=$_SESSION[\"parametro1\"];\n\t\t$wlfolio=$this->argumentos[\"wl_folioconsecutivo\"];\n\n\t\t/*$sql = \t\" select id_persona from contra.cat_personas where usename='\".$wlusuarioactual.\"';\";\n\t\t$sql_result = pg_exec($this->connection,$sql);\n\t\t$this->hayerrorsql($this->connection,\"cierraGestion\",$sql);\n\t\tif (strlen(pg_last_error($this->connection))>0) { echo \"<error>Error en libera \".$sql.\" error \".pg_last_error($this->connection).\"</error>\"; }\n\t\t$row = pg_fetch_array($sql_result, 0);\n\t\t$wlidusuarioactual=$row[\"id_persona\"];\n\t\tif ($wlidpersonarecibe==$wlidusuarioactual || $wlusuarioalta==$wlusuarioactual)\n\t\t{\techo \"<__eventocontinua>true</__eventocontinua>\";\t}\n\t\telse\n\t\t{\techo \"<error>El usuario actual no puede cerrar el tramite</error>\";\t}*/\n\t\t\n\t\t$sql = \t\"\tselect ctt.respuesta\t\".\n\t\t\t\t\"\tfrom contra.ope_turnados_interno as t\t\".\n\t\t\t\t\"\tleft join contra.cat_tipo_tramite as ctt on ctt.id_tipotra=t.id_tipotra\t\".\n\t\t\t\t\"\twhere folioconsecutivo=\".$wlfolio.\"\t\".\n\t\t\t\t\"\tand id_persona =(select id_persona from contra.cat_personas where usename=current_user)\t\".\n\t\t\t\t\"\torder by t.fecha_alta desc\t\".\n\t\t\t\t\"\tlimit 1\t\";\n\t\t$sql_result = pg_exec($this->connection,$sql);\n\t\tif (strlen(pg_last_error($this->connection))>0) { echo \"<error>\".pg_last_error($this->connection).\"</error>\"; }\n\t\t$row = pg_fetch_array($sql_result, 0);\n\t\t$reg=$row['respuesta'];\n\t\tif ($reg=='t') { echo \"<error>El ultimo turno requiere seguimiento</error>\";\t}\n\t\t\n\t\t$sql = \t\" select estatus from contra.gestion_interno where folioconsecutivo=$wlfolio;\";\n\t\t$sql_result = pg_exec($this->connection,$sql);\t\t\n\t\t$row = pg_fetch_array($sql_result, 0);\n\t\t$wlestatus=$row[\"estatus\"];\n\t\tif ($wlestatus==3) { echo \"<error>El tramite ya fue cerrado</error>\";\t}\n\t\t\n\t\t$sql = \t\" select count (*) from contra.ope_archivos_interno where folioconsecutivo=$wlfolio;\";\n\t\t$sql_result = pg_exec($this->connection,$sql);\t\t\n\t\t$row = pg_fetch_array($sql_result, 0);\n\t\t$count=$row[\"count\"];\n\t\tif ($count==0) { echo \"<error>Imposible cerrar, el tramite no tiene archivos adjuntos!</error>\";\t}\n\t\t\n\t}",
"public function procesarComandoSala($comando) {\n\n //self::$automata->cargarEstado();\n /*\n * Pulsan el interruptor de la entrada de la sala\n */\n //Si la luz de la sala esta apagada y pulsan el interruptor\n if((strcmp($comando,self::$ARGIA)==0)&&(self::$automata->isLuz()==0)) {\n //Si las luces no estan bloqueadas (interruptor=0)\n if ($this->isLucesBloqueadas() ==0) {\n //encender la luz del suelo\n $this->encender();\n //encender la luz del techo\n AccesoControladoresDispositivos::$ctrlLuzTecho->encenderLucesTecho();\n echo \"\\nSe a pulsado el interruptor de la sala, las luces estan encendidas\\n\";\n } else {//Si las luces estan bloqueadas (interruptor=1)\n echo \"La luz de sala ya esta encendida\";\n }\n //Si la luz de la sala esta encendida y pulsan el interruptor\n } else if((strcmp($comando,self::$ARGIA)==0)&&(self::$automata->isLuz()==1)) {\n //Si las luces no estan bloqueadas (interruptor=0)\n if ($this->isLucesBloqueadas() ==0) {\n //apagar la luz del suelo\n $this->apagarLuzSala();\n //apagar la luz del techo\n AccesoControladoresDispositivos::$ctrlLuzTecho->apagarLucesTecho();\n echo \"\\nSe a pulsado el interruptor de la sala, las luces estan apagadas\";\n } else {//Si las luces estan bloqueadas (interruptor=1)\n echo \"No se puede apagar la luz: En la sala hay un acto\";\n }\n }\n /*\n * Pulsan el interruptor del microfono 1 de la presidencia.\n */\n else if(strcmp(self::$MICPRESI_1, $comando)==0) {\n\n if ($this->isMicrofonoOn(\"M1\") ==0) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarMicPresidencia(\"M1\");\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLedMicrofono(\"M1\");\n AccesoGui::$guiSonido->activarMicroPresidencia(\"M1\");\n\n } else if ($this->isMicrofonoOn(\"M1\") == 1) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M1\");\n AccesoControladoresDispositivos::$ctrlAutomata->apagarLedMicrofono(\"M1\");\n AccesoGui::$guiSonido->desactivarMicroPresidencia(\"M1\");\n\n }\n }\n /*\n * Pulsan el interruptor del microfono 2 de la presidencia\n */\n else if(strcmp(self::$MICPRESI_2, $comando)==0) {\n if ($this->isMicrofonoOn(\"M2\") == 0) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarMicPresidencia(\"M2\");\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLedMicrofono(\"M2\");\n AccesoGui::$guiSonido->activarMicroPresidencia(\"M2\");\n\n } else if ($this->isMicrofonoOn(\"M2\") == 1) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M2\");\n AccesoControladoresDispositivos::$ctrlAutomata->apagarLedMicrofono(\"M2\");\n AccesoGui::$guiSonido->desactivarMicroPresidencia(\"M2\");\n\n }\n }\n /*\n * Pulsan el interruptor del microfono 3 de la presidencia\n */\n else if(strcmp(self::$MICPRESI_3, $comando)==0) {\n if ($this->isMicrofonoOn(\"M3\") == 0) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarMicPresidencia(\"M3\");\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLedMicrofono(\"M3\");\n AccesoGui::$guiSonido->activarMicroPresidencia(\"M3\");\n\n } else if ($this->isMicrofonoOn(\"M3\") == 1) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M3\");\n AccesoControladoresDispositivos::$ctrlAutomata->apagarLedMicrofono(\"M3\");\n AccesoGui::$guiSonido->desactivarMicroPresidencia(\"M3\");\n\n }\n }\n /*\n * Pulsan el interruptor del microfono 4 de la presidencia\n */\n else if(strcmp(self::$MICPRESI_4, $comando)==0) {\n if ($this->isMicrofonoOn(\"M4\") == 0) {\n\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarMicPresidencia(\"M4\");\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLedMicrofono(\"M4\");\n AccesoGui::$guiSonido->activarMicroPresidencia(\"M4\");\n } else if ($this->isMicrofonoOn(\"M4\") == 1) {\n \n AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M4\");\n AccesoControladoresDispositivos::$ctrlAutomata->apagarLedMicrofono(\"M4\");\n AccesoGui::$guiSonido->desactivarMicroPresidencia(\"M4\");\n }\n }\n /*\n * Pulsan el interruptor del microfono del atril1\n */\n\n else if(strcmp(self::$MICATRIL, $comando)==0) {\n if ($this->isMicrofonoOn(\"M5\") == 0) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarMicPresidencia(\"M5\");\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLedMicrofono(\"M5\");\n AccesoGui::$guiSonido->activarMicroPresidencia(\"M5\");\n } else if ($this->isMicrofonoOn(\"M5\") == 1) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M5\");\n AccesoControladoresDispositivos::$ctrlAutomata->apagarLedMicrofono(\"M5\");\n AccesoGui::$guiSonido->desactivarMicroPresidencia(\"M5\");\n }\n }\n /*\n * Pulsan el interruptor del microfono del atril2\n */\n\n\n else if(strcmp(self::$MICATRIL2, $comando)==0) {\n if ($this->isMicrofonoOn(\"M6\") == 0) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->activarMicPresidencia(\"M6\");\n AccesoControladoresDispositivos::$ctrlAutomata->encenderLedMicrofono(\"M6\");\n AccesoGui::$guiSonido->activarMicroPresidencia(\"M6\");\n } else if ($this->isMicrofonoOn(\"M6\") == 1) {\n AccesoControladoresDispositivos::$ctrlMesaMezclas->desactivarMicPresidencia(\"M6\");\n AccesoControladoresDispositivos::$ctrlAutomata->apagarLedMicrofono(\"M6\");\n AccesoGui::$guiSonido->desactivarMicroPresidencia(\"M6\");\n }\n }\n\n /*\n * Pulsan el interruptor de la pizarra\n */\n\n else if(strcmp($comando,self::$SHOWMEPIZARRA)==0) {\n if ($this->isPizarraShow() == 0) {\n echo \"\\npizarra show\\n\";\n $this->showPizarra();\n } else if ($this->isPizarraShow() == 1) {\n echo \"\\npizarra apagar\\n\";\n $this->showPizarraApagar();\n\n }\n }\n }",
"public function Totalizar_Carrito_Aplicacion_Puntos_Comisiones_Cupon() {\n // Aplición de descuentos por concepto de puntos y comisiones pendientes por pagar\n // Si el pedido se realiza para un amigo, no se aplican descuentos de comisiones y puntos\n Session::Set('Vr_Usado_Cupon_Descuento', 0);\n Session::Set('Puntos_Utilizados', 0 );\n Session::Set('Comisiones_Utilizadas', 0 );\n\n $Vr_Usado_Cupon_Descuento = 0;\n $Puntos_Utilizados = 0;\n $Comisiones_Utilizadas = 0;\n //Debug::Mostrar( 'Comisiones_punto ' . $this->Vr_Total_Pedido_Ocasional );\n\n $Pedido_Para_Amigo = Session::Get('Generando_Pedido_Amigo');\n $Aplicacion_Puntos_Comisiones = Session::Get('Aplicacion_Puntos_Comisiones');\n $VrRealPedido = 0;\n $NoDescontar = 0;\n\n // (isset($Pedido_Para_Amigo) == TRUE && $Pedido_Para_Amigo = FALSE ) ||\n\n if ( ( isset($Aplicacion_Puntos_Comisiones ) && $Aplicacion_Puntos_Comisiones == TRUE ) ){\n $Vr_Usado_Cupon_Descuento = 0;\n $Puntos_Utilizados = 0;\n $Comisiones_Utilizadas = 0;\n $this->Terceros->Consultar_Saldos_Comisiones_Puntos_x_Idtercero();\n //Session::Set('Vr_Usado_Cupon_Descuento', $Vr_Usado_Cupon_Descuento );\n $this->Saldo_Puntos_Cantidad = Session::Get('saldo_puntos_cantidad');\n $this->Saldo_Comisiones = Session::Get('saldo_comisiones');\n $this->Vr_Cupon_Descuento = Session::Get('vr_cupon_descuento');\n\n\n if ( $this->Saldo_Puntos_Cantidad > 0 ) {\n if ( $this->Vr_Total_Pedido_Real > 0 ){\n if ( $this->Saldo_Puntos_Cantidad >= $this->Vr_Total_Pedido_Real ){\n $Puntos_Utilizados = $this->Vr_Total_Pedido_Real;\n $this->Vr_Total_Pedido_Real = 0;\n $this->Vr_Total_Pedido_Ocasional = 0;\n $this->Vr_Total_Pedido_Amigos = 0;\n }else{\n //Para que si se descuentan puntos pueda pagar el pedido\n $VrRealPedido = $this->Vr_Total_Pedido_Real - $this->Saldo_Puntos_Cantidad;\n if ( $VrRealPedido < 20000 ){\n $NoDescontar = 20000 - $VrRealPedido;\n $this->Saldo_Puntos_Cantidad = $this->Saldo_Puntos_Cantidad - $NoDescontar;\n }\n\n $this->Vr_Total_Pedido_Real = $this->Vr_Total_Pedido_Real - $this->Saldo_Puntos_Cantidad;\n $this->Vr_Total_Pedido_Ocasional = $this->Vr_Total_Pedido_Ocasional - $this->Saldo_Puntos_Cantidad;\n $this->Vr_Total_Pedido_Amigos = $this->Vr_Total_Pedido_Amigos - $this->Saldo_Puntos_Cantidad;\n $Puntos_Utilizados = $this->Saldo_Puntos_Cantidad ;\n }\n }\n }\n\n if ( $this->Saldo_Comisiones > 0) {\n if ( $this->Vr_Total_Pedido_Real > 0 ){\n if ( $this->Saldo_Comisiones >= $this->Vr_Total_Pedido_Real ){\n $Comisiones_Utilizadas = $this->Vr_Total_Pedido_Real;\n $this->Vr_Total_Pedido_Real = 0;\n $this->Vr_Total_Pedido_Ocasional = 0;\n $this->Vr_Total_Pedido_Amigos = 0;\n }else{\n\n //Para que si se descuentan comisiones pueda pagar el pedido\n $VrRealPedido = $this->Vr_Total_Pedido_Real - $this->Saldo_Comisiones;\n if ( $VrRealPedido < 20000 ){\n $NoDescontar = 20000 - $VrRealPedido;\n $this->Saldo_Comisiones = $this->Saldo_Comisiones - $NoDescontar;\n }\n\n\n $this->Vr_Total_Pedido_Real = $this->Vr_Total_Pedido_Real - $this->Saldo_Comisiones;\n $this->Vr_Total_Pedido_Ocasional = $this->Vr_Total_Pedido_Ocasional - $this->Saldo_Comisiones;\n $this->Vr_Total_Pedido_Amigos = $this->Vr_Total_Pedido_Amigos - $this->Saldo_Comisiones;\n $Comisiones_Utilizadas = $this->Saldo_Comisiones;\n }\n }\n }\n }\n\n Session::Set('Vr_Usado_Cupon_Descuento', $Vr_Usado_Cupon_Descuento );\n Session::Set('Puntos_Utilizados', $Puntos_Utilizados );\n Session::Set('Comisiones_Utilizadas', $Comisiones_Utilizadas );\n\n}",
"public function padre_horario_ciclo_actual_alumno()\n {\n $codigo = $_SESSION[\"Codigo\"];\n $codigo_alumno = ee()->TMPL->fetch_param('codigo_alumno');\n //$token = $_SESSION[\"Token\"];\n \n $codigo = $_COOKIE[$this->services->get_fuzzy_name(\"Codigo\")];\n $this->services->set_cookie(\"Codigo\",$codigo, time() + (1800), \"/\");\n\n ee()->db->select('*');\n ee()->db->where('codigo',$codigo);\n $query_modelo_result = ee()->db->get('exp_user_upc_data');\n\n foreach($query_modelo_result->result() as $row){\n $token = $row->token;\n }\n\n\n $url = 'HorarioPadre/?Codigo='.$codigo.'&CodAlumno='.$codigo_alumno.'&Token='.$token;\n //$url = 'Horario/?CodAlumno='.$codigo.'&Token='.$token;\n // var_dump($url);\n\n $result=$this->services->curl_url($url);\n // var_dump($result);\n $json = json_decode($result, true);\n \n $error = $json['CodError'];\n $error_mensaje = $json['MsgError'];\n $error_result = $this->error_eval($error);\n if ($error_result != '0' && $error_result != '1') {\n $site_url = ee()->config->item('site_url');\n $this->EE->functions->redirect($site_url.\"general/session-expired\");\n return;\n }\n //limpio la variable para reutilizarla\n $result = '';\n \n //genera el tamano del array\n $tamano = count($json['HorarioDia']); \n \n for ($i=0; $i<$tamano; $i++) {\n $result .= '<div>';\n $result .= '<span class=\"zizou-16\">';\n if ($json['HorarioDia'][$i]['CodDia'] == 1) {\n $result .= 'Lunes';\n }\n if ($json['HorarioDia'][$i]['CodDia'] == 2) {\n $result .= 'Martes';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 3) {\n $result .= 'Miércoles';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 4) {\n $result .= 'Jueves';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 5) {\n $result .= 'Viernes';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 6) {\n $result .= 'Sábado';\n } \n $result .= '</span>';\n\n $result .= '</div>'; \n $result .= '<div class=\"panel-body red-line mb-7\">';\n $result .= '<div class=\"panel-body-head-table\">'; \n $result .= '<ul class=\"tr table-border\">'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 hidden-xs\">'; \n $result .= '<div><span>Inicio</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 hidden-xs\">'; \n $result .= '<div><span>Fin</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-2-5 col-md-2 hidden-sm hidden-md hidden-lg\">'; \n $result .= '<div><span>Inicio - Fin</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-4-5 col-md-4-5 col-xs-4\">'; \n $result .= '<div><span>Clase</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-2\">'; \n $result .= '<div><span>Campus</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-1-5\">'; \n $result .= '<div><span>Sección</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-2 br-xs-no\">'; \n $result .= '<div><span>Aula</span></div>'; \n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>'; \n \n //genera el tamano del array\n $tamano_int = count($json['HorarioDia'][$i]['Clases']); \n \n for ($b=0; $b<$tamano_int; $b++) {\n $result .= '<div class=\"panel-table\">'; \n $result .= '<ul class=\"tr\" table-border>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-2 hidden-xs\">'; \n $result .= '<div class=\"text-center\"><span class=\"helvetica-14\">';\n $HoraInicio = substr($json['HorarioDia'][$i]['Clases'][$b]['HoraInicio'], 0, 2);\n $HoraInicio = ltrim($HoraInicio,'0');\n $result .= $HoraInicio.':00';\n $result .='</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-2 hidden-xs \">'; \n $result .= '<div class=\"text-center\"><span class=\"helvetica-14\">';\n $HoraFin = substr($json['HorarioDia'][$i]['Clases'][$b]['HoraFin'], 0, 2);\n $HoraFin = ltrim($HoraFin,'0');\n $result .= $HoraFin.':00'; \n $result .='</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-2-5 col-md-2 hidden-sm hidden-md hidden-lg\">'; \n $result .= '<div><span>'.$HoraInicio.':00 - '.$HoraFin.':00</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-4-5 col-md-4-5 col-xs-4\">'; \n $result .= '<div class=\"text-center\"><span class=\"helvetica-14\">';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['CursoNombre'];\n $result .= '</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-2 \">'; \n $result .= '<div class=\"text-center\"><span class=\"helvetica-14\">';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['Sede'];\n $result .= '</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-1-5 \">'; \n $result .= '<div class=\"text-center\"><span class=\"helvetica-14\">';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['Seccion'];\n $result .= '</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-md-2 col-xs-2 br-xs-no\">'; \n $result .= '<div class=\"text-center\"><span class=\"helvetica-14\">';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['Salon'];\n $result .= '</span></div'; \n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>'; \n } \n $result .= '</div>';\n }\n\n //Control de errores\n if ($error!='00000') {\n $result = '';\n $result .= '<div>';\n $result .= '<div class=\"panel-body mb-35\">';\n $result .= '<div class=\"panel-table\">';\n $result .= '<ul class=\"tr\">';\n $result .= '<li class=\"col-xs-12\">';\n $result .= '<span>'.$error_mensaje.'</span>';\n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>';\n $result .= '</div>'; \n $result .= '</div>'; \n } \n \n return $result; \n }",
"static public function ctrCrearUnidad(){\n\n\t\tif($_POST[\"accion\"]==\"NuevoUnidad\"){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"descripcion\"])){\n\n\t\t\t\t$ruta=\"\";\n\n\t\t\t\t$resp = ModeloProfesor::MdlMostrarProfesor(\"profesor\", \"id_usuario\", $_SESSION[\"id\"]);\n\t\t\t\t\n\t\t\t\t$id_profesor = $resp[\"id_profesor\"];\n\n\t\t\t\t$tabla = \"unidad\";\n\n\t\t\t\t$datos = array(\"descripcion\" => $_POST[\"descripcion\"],\"competencias\"=>$_POST[\"competencias\"],\"capacidades\"=>$_POST[\"capacidades\"],\"numero\"=>$_POST[\"numero\"],\"duracion\"=>$_POST[\"duracion\"],\"semestre\"=>$_POST[\"semestre\"],\"id_profesor\"=>$id_profesor);\n\n\t\t\t\t$respuesta = ModeloUnidad::mdlIngresarUnidad($tabla, $datos);\n\t\t\t\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\t$tabla = \"unidad\";\n\n\t\t\t\t\t$resp = ModeloUnidad::MdlMostrarUnidad($tabla, \"descripcion\", $_POST[\"descripcion\"]);\n\t\t\t\t\tforeach ($resp as $key => $value){\n\t\t\t\t\t\t$id_unidad = $value[\"id_unidad\"];\n\t\t\t\t\t}\n\n\t\t\t\t\t$tabla = \"tema\";\n\n\t\t\t\t\t$datos = array(\"nombre\" => $_POST[\"tema\"],\"id_unidad\" => $id_unidad);\n\n\t\t\t\t\t$respuesta = ModeloTema::mdlIngresarTema($tabla, $datos);\n\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡La Unidad ha sido guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"unidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\n\t\t\t\t}\t\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡La Unidad no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\tcloseOnConfirm:false\n\n\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"unidad\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t</script>';\n\n\t\t\t}\n\n\n\t\t}\n\n\n\t}",
"function correos(){\n\t\t//VERIFICAR SI EL FOR[RENTAS/SERVICIOS] TIENE UN VALOR\n\t\tif(isset($_GET[\"for\"])){ \n\t\t\t$for = $_GET[\"for\"]; \n\t } else { \n\t\t\t$for = \"\"; \n\t\t}\t\n\t\t//VERIFICAR SI EL ARCHIVES[TRUE/FALSE] TIENE UN VALOR\n\t\tif(isset($_GET[\"is_archived\"])){ \n\t\t\t$is_archived = $_GET[\"is_archived\"]; \n\t\t} else { \n\t\t\t$is_archived = \"true\"; \n\t\t}\n\t\t//VERIFICAR LA CLAVE UNICA DE [RENTAS/SERVICIOS] TIENE UN VALOR POR MEDIO DE UNA VARIABLE DE SESSION\n\t\tif(isset($_SESSION[\"idclaveUnica\"])){\n\t\t//if(isset($_GET[\"clave_unica\"])){\n\t\t\t$id=$_GET[\"clave_unica\"];\n $_SESSION[\"idclaveUnica\"] = $id;\n\t\t\t$email_info = VentasModel::getEmailsByUk($_GET[\"clave_unica\"],$_GET[\"for\"]);\n\t\t\t//echo '<script> location.reload(); </script>';\t\n\t\t\t//$email_info = DataBase::speed_crud(' SELECT c.CorreoElectronico FROM clientes as c, orden_rentas as q WHERE clave_unica='.$id.' AND c.IdCliente=q.IdCliente');\n\t\t\techo $email_info[1];\n\t\t}\n\n\n\t}",
"function cambiocontrasena(){\n\t$row=$this->extraer_registro($this->exeQryFile(\"../../class/sql/usuario/cambio_contrasena.sql\", $_GET));\n return $row[0];\t\t\n }",
"function enviar_contacto(){\n\t\t$this->mostrar_config(1);\n\t\t$this->asignar_ingreso();\n\t\t$cuerpo =\"<img src='http://tibisayhotelboutique.com/imagenes/logon.png' /><br /><br />\n\t\t<u>DATOS INGRESADOS:</u><br />\";\n\t\t$cuerpo .=\"<br />\";\n\t\t$cuerpo .= \"<strong>Nombre: </strong>\".$this->nombre.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Teléfono: </strong>\".$this->telefono.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>E-mail: </strong>\".$this->email.\"<br />\" ;\n\t\t$cuerpo .= \"<strong>Comentarios: </strong>\".$this->comentario.\"<br />\";\n\t\t$cuerpo .= \"<br />\";\n\t\t$cuerpo .= \"---- FIN DATOS ----\";\n\t\t$cuerpo .= \"<br />\";\n\t\t$subject= \"Contacto \".$this->empresa;\n\t\t$subject2= \"Contacto desde Web \".$this->empresa;\n\t\t$basemailfor=$this->correo;\n\t\t$basemailfor2=\"ventas@tibisayhotelboutique.com\";\n\t\t$basemailfrom = $this->email;\n\t\t$respuesta =\"<img src='http://tibisay.diazcreativos.net.ve/imagenes/logon.png' /><br /><br />\n\n\t\t<strong>Estimado(a) \".$this->nombre.\"</strong>,<br /><br />\n\n\t\tHemos recibido satisfactoriamente su solicitud y será procesada a la brevedad. Durante las próximas horas uno de nuestros representantes se comunicará con usted para atender directamente su petición.<br /><br />\n\n\t\t¡Gracias por contactarnos!<br /><br />\n\n\t\tAtentamente,<br />\n\t\tDirección de Ventas \".$this->empresa.\"<br />\n\t\tTeléfonos: (+58) 0295-500.07.00 Ext -2017 Ext -2010 <br />\n\t\tFacebook: <a href='https://www.facebook.com/tibisayhotelboutique'>Tibisay Hotel Boutique</a><br />\n\t\tTwitter: <a href='https://twitter.com/TibisayHotel'>@TibisayHotel</a><br />\n\t\tInstagram: <a href='https://www.instagram.com/tibisayhotelboutique/'>tibisayhotelboutique</a>\";\n\t\t$this->mensaje=\"Su mensaje ha sido enviado satisfactoriamente!\";\n\n\t\t$mail = new PHPMailer(true);\n\t\t$mail->From = $basemailfrom;\n\t\t$mail->FromName = utf8_decode(\"Contacto desde Web \".$this->empresa);\n\t\t$mail->AddAddress($basemailfor2, $this->nombre);\n\t\t$mail->Subject = utf8_decode(\"Contacto desde Web \".$this->empresa);\n\t\t$mail->Body = $cuerpo;\n\t\t$mail->AltBody = $cuerpo;\n\t\t$exito = $mail->Send();\n\n\t\t$mail2 = new PHPMailer(true);\n\t\t$mail2->From = $basemailfor2;\n\t\t$mail2->FromName = utf8_decode($subject2);\n\t\t$mail2->AddAddress($basemailfrom, $this->nombre.\" \".$this->apellido);\n\t\t$mail2->Subject = utf8_decode($subject2);\n\t\t$mail2->Body = $respuesta;\n\t\t$mail2->AltBody = $respuesta;\n\t\t$mail2->Send();\n\t\t\n\t\t$_SESSION['mensajeContacto']= \"Su solicitud fue enviada.\";\n\t\theader(\"location: /#CONTACTO\");\n\t\texit();\n\t\t//if(mail (\"$basemailfor\", \"$subject2\", \"$cuerpo\", \"From: $basemailfrom\\nContent-Type: text/html\" )){\n\t\t //mail (\"$basemailfrom\", \"$subject\", \"$respuesta\", \"From: $basemailfor\\nContent-Type: text/html\" );\n\t\t //mail (\"$basemailfor2\", \"$subject2\", \"$cuerpo\", \"From: $basemailfrom\\nContent-Type: text/html\" );\n\n\t\t//}\n\t}",
"function nombre_modulo_services_resources_confirm_objetivo(){\n\t\t$post = file_get_contents(\"php://input\");\n\t\t$post_dec = json_decode($post);\n\t\t$idUser = $post_dec->idUser;\n\t\t\n\t\tif(!isset($idUser)){\n\t\t\t//si no envía el id de usuario\n\t\t\treturn array('status' => 0, 'message' => 'Debes enviar el ID del usuario');\n\t\t}\t\n\n\t\t$userdata = user_load($idUser);\n\n\t\tif (!isset($userdata->field_jefe['und'][0]['target_id'])) {\n\t\t\treturn 'colaborador no tiene asignado jefe';\n\t\t}\n\n\t\t$nodoid = $post_dec->nodoid;\n\n\t\tif(!isset($nodoid)){\n\t\t\t//si no envía el id de usuario\n\t\t\treturn array('status' => 0, 'message' => 'Debes enviar el ID del nodo');\n\t\t}\n\n\t\t$evaluacion = node_load($nodoid);\n\t\t\t\t$evaluacion->field_estado_ingreso_objetivo['und'][0]['value'] = 1;\n\t\tnode_save($evaluacion);\n\n\t\t$key = 'objetivo_finalizado';\t\t\n\n\t\treturn nombre_modulo_services_resources_send_objetivos($idUser, $key);\n\t\t//return 'notificacion enviada';\n\t}",
"function comentar_accion() {\n\t\tif( !$this->sesion->usuario )\n\t\t\t$this->json->res = 1;\n\t\telseif( !$this->post->comentario )\n\t\t\t$this->json->res = 2;\n\t\telseif( !$this->getFoto($this->post->id_foto) )\n\t\t\t$this->json->res = 3;\n\t\telse {\n\t\t\t// Obtener la fecha de inseción\n\t\t\t$fecha = new Fexem_Fecha();\n\t\t\t\n\t\t\t// Agregar a la base de datos\n\t\t\t$id_comentario = self::_db()->insertar('comentarios',array(\n\t\t\t\t'usuario_id'\t\t\t=> $this->sesion->usuario->id,\n\t\t\t\t'foto_id'\t\t\t\t=> $this->post->id_foto,\n\t\t\t\t'comentario_comentario'\t=> $this->post->comentario,\n\t\t\t\t'comentario_fecha'\t\t=> $fecha\n\t\t\t));\n\t\t\t\n\t\t\t// Resultado correcto, comentario agregado correctamente\n\t\t\t$this->json->res = 777;\n\t\t\t$this->json->comentario = array(\n\t\t\t\t'id'\t\t\t=> $id_comentario,\n\t\t\t\t'texto'\t\t\t=> $this->post->comentario,\n\t\t\t\t'fecha'\t\t\t=> $fecha,\n\t\t\t\t'fecha_partes'\t=> array(\n\t\t\t\t\t'dia'\t=> $fecha->getDia(),\n\t\t\t\t\t'mes'\t=> $fecha->getMes(),\n\t\t\t\t\t'ano'\t=> $fecha->getAno(),\n\t\t\t\t\t'hora'\t=> $fecha->getHora(),\n\t\t\t\t\t'minuto'=> $fecha->getMinuto()\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$this->usuario = self::_db()->crearConsulta()\n\t\t\t\t->seleccionar('usuario.*')->limite(1)\n\t\t\t\t->de('usuarios usuario')\n\t\t\t\t->donde('usuario.usuario_id = ?', $this->foto->usuario_id)\n\t\t\t\t->leerModelo();\n\t\t\t\n\t\t\t// Enviamos un correo al dueño de la foto\n\t\t\tmail($this->usuario->usuario_email,\n\t\t\t\t\"Comentaron tu foto\",\n\t\t\t\t\"<strong>{$this->sesion->usuario->usuario}</strong> \".\n\t\t\t\t\"comentó tu publicación <strong>{$this->foto->foto_titulo}</strong>:<br><br><blockquote>\".\n\t\t\t\tstr_replace(array('<','>'),array('<','>'), $this->post->comentario) . '</blockquote>'\n\t\t\t\t.'<h5>Enlace a la publicación</h5>'\n\t\t\t\t.\"<a href=\\\"https://flogeek.com/{$this->usuario->usuario_usuario}/{$this->foto->foto_id}\\\">\"\n\t\t\t\t.\"https://flogeek.com/{$this->usuario->usuario_usuario}/{$this->foto->foto_id}\"\n\t\t\t\t.\"</a><hr />\"\n\t\t\t\t.\"<emphasis>Este correo fue generado a través de flogeek.com\"\n\t\t\t\t.\" con la debida autorización del usuario al momento de registrarse</emphasis>\",\n\t\t\t\t\"From: Flogeek<notif@flogeek.com>\\r\\n\".\n\t\t\t\t\"Content-Type: text/html; charset=utf-8\\r\\n\".\n\t\t\t\t\"MIME-Version: 1.0\\r\\n\",\n\t\t\t\t\"-odb\");\n\t\t\t\n\t\t\t// Incrementar el contador de comentarios de la foto\n\t\t\tmysql_query(\"\n\t\t\t\tUPDATE fotos\n\t\t\t\tSET foto_comentarios = foto_comentarios + 1\n\t\t\t\tWHERE foto_id = {$this->post->id_foto}\n\t\t\t\");\n\t\t\n\t\t}\n\t}",
"function tcapturando($curso){\n\t\t\tif(Session::get_data('tipousuario')!=\"PROFESOR\"){\n\t\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t\t//ELIMINAR CONTENIDO DE LAS VARIABLES QUE PERTENECERÁN A LA CLASE\n\t\t\tunset($this -> excel);\n\t\t\tunset($this -> alumnado);\n\t\t\tunset($this -> registro);\n\t\t\tunset($this -> nombre);\n\t\t\tunset($this -> curso);\n\t\t\tunset($this -> materia);\n\t\t\tunset($this -> clave);\n\t\t\tunset($this -> situacion);\n\t\t\tunset($this -> especialidad);\n\t\t\tunset($this -> profesor);\n\t\t\tunset($this -> periodo);\n\t\t\tunset($this -> nomina);\n\t\t\tunset($this -> parcial);\n\t\t\tunset($this -> idcapturaesp);\n\n\t\t\t$maestros = new Maestros();\n\t\t\t$id = Session::get_data('registro');\n\t\t\t$this -> nomina = $id;\n\t\t\t$profesor = $maestros -> find_first(\"nomina=\".$this -> nomina.\"\");\n\t\t\t$this -> profesor = $profesor -> nombre;\n\n\t\t\t$periodo = $this -> actual;\n\n\t\t\t$xcursos = new Xtcursos();\n\t\t\t$pertenece = $xcursos -> count(\"clavecurso='\".$curso.\"' AND nomina=\".$id.\" AND periodo='\".$periodo.\"'\");\n\n\t\t\tif($pertenece<1){\n\t\t\t\t$log = new Xtlogcalificacion();\n\t\t\t\t$log -> clavecurso = $curso;\n\t\t\t\t$log -> nomina = Session::get_data('registro');\n\t\t\t\t$log -> accion = \"INTENTANDO MODIFICAR UNA CALIFICACION QUE NO LE CORRESPONDE\";\n\t\t\t\t$log -> ip = $this -> getIP();;\n\t\t\t\t$log -> fecha = time();\n\t\t\t\t$log -> save();\n\n\t\t\t\t$this->redirect('profesor/captura');\n\t\t\t}\n\n\n\t\t\t$Xccursos = new Xtcursos();\n\t\t\t$maestros = new Maestros();\n\t\t\t$materias = new Materia();\n\t\t\t$xtalumnocursos = new Xtalumnocursos();\n\t\t\t$alumnos = new Alumnos();\n\t\t\t$especialidades = new Especialidades();\n\n\n\t\t\t$xccursos = $Xccursos -> find_first(\"clavecurso='\".$curso.\"'\");\n\t\t\tif( $this -> post(\"tparcial\") == \"\" ){\n\t\t\t\t$this->redirect('profesor/captura');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tswitch($this -> post(\"tparcial\")){\n\t\t\t\t\tcase 1: $this -> horas = $xccursos -> horas1; break;\n\t\t\t\t\tcase 2: $this -> horas = $xccursos -> horas2; break;\n\t\t\t\t\tcase 3: $this -> horas = $xccursos -> horas3; break;\n\t\t\t}\n\n\t\t\t$this -> horas1 = $xccursos -> horas1;\n\t\t\t$this -> horas2 = $xccursos -> horas2;\n\t\t\t$this -> horas3 = $xccursos -> horas3;\n\n\t\t\tif($this -> horas==0){\n\t\t\t\t\t$this -> horas = \"\";\n\t\t\t}\n\n\t\t\tif($this -> horas1==0){\n\t\t\t\t\t$this -> horas1 = \"-\";\n\t\t\t}\n\n\t\t\tif($this -> horas2==0){\n\t\t\t\t\t$this -> horas2 = \"-\";\n\t\t\t}\n\n\t\t\tif($this -> horas3==0){\n\t\t\t\t\t$this -> horas3 = \"-\";\n\t\t\t}\n\t\t\t\n\t\t\tswitch($this -> post(\"tparcial\")){\n\t\t\t\t\tcase 1: $this -> avance = $xccursos -> avance1; break;\n\t\t\t\t\tcase 2: $this -> avance = $xccursos -> avance2; break;\n\t\t\t\t\tcase 3: $this -> avance = $xccursos -> avance3; break;\n\t\t\t}\n\n\t\t\t$this -> avance1 = $xccursos -> avance1;\n\t\t\t$this -> avance2 = $xccursos -> avance2;\n\t\t\t$this -> avance3 = $xccursos -> avance3;\n\n\t\t\tif($this -> avance==0){\n\t\t\t\t\t$this -> avance = \"\";\n\t\t\t}\n\n\t\t\tif($this -> avance1==0){\n\t\t\t\t\t$this -> avance1 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance1 .= \"%\";\n\t\t\t}\n\n\t\t\tif($this -> avance2==0){\n\t\t\t\t\t$this -> avance2 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance2 .= \"%\";\n\t\t\t}\n\n\t\t\tif($this -> avance3==0){\n\t\t\t\t\t$this -> avance3 = \"-\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t$this -> avance3 .= \"%\";\n\t\t\t}\n\t\t\t$total = 0;\n\n\t\t\t$xpermcapturaesp\t= new Xpermisoscapturaesp();\n\t\t\t$xpermcapturaespdet\t= new XpermisoscapturaespDetalle();\n\t\t\t\n\t\t\t$day = date (\"d\");\n\t\t\t$month = date (\"m\");\n\t\t\t$year = date (\"Y\");\n\t\t\t$hour = date (\"H\");\n\t\t\t$minute = date (\"i\");\n\t\t\t$second = date (\"s\");\n\t\t\t\n\t\t\t$fecha = mktime( $hour, $minute, $second, $month, $day, $year );\n\t\t\t\n\t\t\t$aux = 0;\n\t\t\t$aux5 = 0;\n\t\t\tforeach( $xpermcapturaesp -> find_all_by_sql\n\t\t\t\t\t( \"select * from xpermisoscapturaesp\n\t\t\t\t\t\twhere clavecurso = '\".$curso.\"'\n\t\t\t\t\t\tand parcial = \".$this -> post(\"tparcial\").\"\n\t\t\t\t\t\tand fin > \".$fecha.\"\n\t\t\t\t\t\tand captura = 0\n\t\t\t\t\t\torder by id desc\n\t\t\t\t\t\tlimit 1\" ) as $xpcapesp ){\n\t\t\t\t$aux5 = 1;\n\t\t\t\t// Para checar los permisosdecapturasespeciales\n\t\t\t\tif( $xpermcapturaespdet -> find_first\n\t\t\t\t\t\t( \"xpermisoscapturaesp_id = \".$xpcapesp -> id ) ){\n\t\t\t\t\t$aux ++;\n\t\t\t\t}\n\t\t\t\t$this -> idcapturaesp = $xpcapesp -> id;\n\t\t\t\tif( $aux == 1 ){\n\t\t\t\t\tforeach( $xpermcapturaespdet -> find\n\t\t\t\t\t\t\t( \"xpermisoscapturaesp_id = \".$xpcapesp -> id ) as $xpdetalle ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($xtalumnocursos -> find\n\t\t\t\t\t\t\t\t(\"curso_id='\".$xccursos->id.\"' \n\t\t\t\t\t\t\t\tand registro = \".$xpdetalle -> registro.\"\n\t\t\t\t\t\t\t\tORDER BY registro\") as $alumno){\n\t\t\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$total++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tforeach($xtalumnocursos -> find(\"curso_id='\".$xccursos->id.\"' ORDER BY registro\") as $alumno){\n\t\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$total++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( $aux5 == 0 ){\n foreach($xtalumnocursos -> find(\"curso_id='\".$xccursos->id.\"' ORDER BY registro\") as $alumno){\n\t\t\t\t\t$this -> registro = $alumno -> registro;\n\t\t\t\t\t$this -> alumnado[$total][\"id\"] = $alumno -> id;\n\t\t\t\t\t$this -> curso = $curso;\n\t\t\t\t\t$this -> materia = $this -> post(\"tmateria\");\n\t\t\t\t\t$this -> clave = $this -> post(\"tclave\");\n\n\t\t\t\t\t$parcial = $this -> post(\"tparcial\");\n\t\t\t\t\t$this -> parcialito = $parcial;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> parcial = \"PRIMER PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 2: $this -> parcial = \"SEGUNDO PARCIAL\"; break;\n\t\t\t\t\t\t\tcase 3: $this -> parcial = \"TERCER PARCIAL\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($alumnos -> find(\"miReg=\".$alumno->registro) as $a){\n\t\t\t\t\t\t\t$this -> nombre = $a -> vcNomAlu;\n\t\t\t\t\t\t\t$this -> nombre = iconv(\"latin1\", \"ISO-8859-1\", $this -> nombre);\n\t\t\t\t\t\t\t$situacion = $a -> enTipo;\n\t\t\t\t\t\t\t$especialidad = $a -> idtiEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch($situacion){\n\t\t\t\t\t\t\tcase 'R': $this -> situacion = \"REGULAR\"; break;\n\t\t\t\t\t\t\tcase 'I': $this -> situacion = \"IRREGULAR\"; break;\n\t\t\t\t\t\t\tcase 'P': $this -> situacion = \"PROCESO DE REGULARIZACION\"; break;\n\t\t\t\t\t\t\tcase 'C': $this -> situacion = \"CONDICIONADO\"; break;\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($especialidades -> find(\"idtiEsp=\".$especialidad) as $e){\n\t\t\t\t\t\t\t$this -> especialidad = $e -> siNumEsp;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this -> alumnado[$total][\"registro\"] = $this -> registro;\n\t\t\t\t\t$this -> alumnado[$total][\"nombre\"] = $this -> nombre;\n\t\t\t\t\t$this -> alumnado[$total][\"especialidad\"] = $this -> especialidad;\n\t\t\t\t\t$this -> alumnado[$total][\"situacion\"] = $this -> situacion;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"faltas\"] = $alumno -> faltas3;break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"] = $alumno -> faltas1;\n\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"] = $alumno -> faltas2;\n\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"] = $alumno -> faltas3;\n\n\t\t\t\t\tswitch($parcial){\n\t\t\t\t\t\t\tcase 1: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion1;break;\n\t\t\t\t\t\t\tcase 2: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion2;break;\n\t\t\t\t\t\t\tcase 3: $this -> alumnado[$total][\"calificacion\"] = $alumno -> calificacion3;break;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"] = $alumno -> calificacion1;\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"] = $alumno -> calificacion2;\n\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"] = $alumno -> calificacion3;\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas\"]=\"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas1\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas2\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==300){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"-\";\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"faltas3\"]=\"-\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==999){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"NP\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion1\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion1\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion2\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion2\"]=\"PD\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this -> alumnado[$total][\"calificacion3\"]==500){\n\t\t\t\t\t\t\t$this -> alumnado[$total][\"calificacion3\"]=\"PD\";\n\t\t\t\t\t}\n\t\t\t\t\t$total++;\n }\n\t\t\t}\n }",
"function cam_modificar(campeonato $campeonato) {\n\techo 'VAmos a MODIFICAR el campeonato';\n \t//Realizar las validaciones de los datos del nuevo campeonato\n\t$objActMen = new actionMensajes();\n \n\t$objActMen = validarFormulario($campeonato);\n \n \t//Realizar las validaciones de los datos contra la informacion de la base de datos\n\t$objCampeonatoLN = new campeonatosLN();\n \tif (!$objActMen->getHayErrores()) {\n\t\t$objActMen = $objCampeonatoLN->verificarCampeonatoNombre($campeonato->getCamNombre());\t\t\n\t} else {\n\t\t$campeonatoRet = NULL;\n\t}\n \n \t//Comprobar resultados de validaciones \n \tif (!$objActMen->getHayErrores()) {\n\t\t$campeonatoRet = $objCampeonatoLN->actualizarCampeonato($campeonato);\n\t\t$objActMen->setHayMensajes(TRUE);\n\t\t$objActMen->addMensaje('El campeonato ha sido modificado con éxito en la aplicación');\t\n\t} else {\n\t\t$campeonatoRet = NULL;\n\t}\n\n\n\tif ($objActMen->getHayErrores()) {\n\t\t$_SESSION[MensajesErro] = $objActMen;\t \n\t }\n\t \n \tif ($objActMen->getHayMensajes()) {\n\t\t$_SESSION[MensajesInfo] = $objActMen;\t \n\t }\n\n\treturn $campeonatoRet; \n }",
"public function DA_ConsultarPrefacturaUfeg();",
"public function lucesTechoPresidenciaBajar( ) {\n\n self::$luz->bajarIntensidad(LuzTecho::$PRESIDENCIA);\n\n }",
"function actualizaOficio() \n\t{\n \t$wlidcontestacion=$this->argumentos[\"wl_idcontestacion\"];\n\t\t$sql = \t\"\tselect referencia_c from contra.gestion_contestacion idcontestacion\".$wlidcontestacion.\";\";\n\t\t$sql_result = pg_exec($this->connection,$sql);\n\t\tif (strlen(pg_last_error($this->connection))>0) { echo \"<error>\".pg_last_error($this->connection).\"</error>\"; }\n\t\t$row = pg_fetch_array($sql_result, 0);\n\t\t$reg=$row['referencia_c'];\n\t\techo \"<enviavalor>$reg</enviavalor>\";\n\t\techo \"<__eventocontinua>true</__eventocontinua>\";\n\t}",
"public function actualizar_gasto_controlador(){\r\n\t\t\t// Recibiendo el ID\r\n\r\n\t\t\t\r\n\t\t\t$id=mainModel::decryption($_POST['gasto_id_up']);\r\n\t\t\t$id=mainModel::limpiar_cadena($id);\r\n \t\t\t\r\n\t\t\t/* Comprobando gasto en la base de datos */\t\r\n\t\t\t$check_gasto=mainModel::ejecutar_consulta_simple(\"SELECT * FROM gasto WHERE gasto_id='$id'\");\r\n\t\t\tif ($check_gasto->rowCount()<=0) {\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"limpiar\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"No se encontro la gasto en el sistema\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit(); \r\n\t\t\t}else{\r\n\t\t\t\t$campos=$check_gasto->fetch();\r\n\t\t\t}\r\n\r\n\t\t\t$estado=mainModel::limpiar_cadena($_POST['gasto_estado_up']);\r\n\t\t\t$observacion=mainModel::limpiar_cadena($_POST['gasto_observacion_up']);\r\n\t\t\t\r\n\r\n\t\t\t/*== comprobar campos vacios ==*/\r\n\t\t\tif( $estado==\"\" || $observacion==\"\" ){\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"Debes llenar el estado y la observación para poder actualizar la gasto\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($estado!=\"Aprobado\" && $estado!=\"Cancelado\"){\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"El estado no coincide con el formato solicitado\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\t\t\tif(mainModel::verificar_datos(\"[a-zA-z0-9áéíóúÁÉÍÓÚñÑ#() ]{8,400}\",$observacion)){\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"La observación no coincide con el formato solicitado\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t\t// Comprobando Privilegios\r\n\t\t\tsession_start(['name'=>'SPM']);\r\n\t\t\tif ($_SESSION['privilegio_spm']<1 || $_SESSION['privilegio_spm']>2) {\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\"Texto\"=>\"No tienes permisos necesarios para hacer la operacion\",\r\n\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t];\r\n\t\t\t\techo json_encode($alerta);\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\t\t\t/*== Preparando datos para enviarlos al modelo ==*/\r\n\t\t\t$datos_gasto_up=[\r\n\t\t\t\t\r\n\t\t\t\t\"Estado\"=>$estado,\r\n\t\t\t\t\"Observacion\"=>$observacion,\r\n\t\t\t\t\"ID\"=>$id\r\n\t\t\t];\r\n\r\n\t\t\tif (gastoModelo::actualizar_gasto_modelo($datos_gasto_up)) {\r\n\t\t\t\t$alerta=[\r\n\t\t \t\t\t\t\"Alerta\"=>\"recargar\",\r\n\t\t\t\t\t\t\"Titulo\"=>\"Datos Actualizados\",\r\n\t\t\t\t\t\t\"Texto\"=>\"Los datos fueron actualizados correctamente\",\r\n\t\t\t\t\t\t\"Tipo\"=>\"success\"\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t$alerta=[\r\n\t\t\t\t\t\t\"Alerta\"=>\"simple\",\r\n\t\t\t\t\t\t\"Titulo\"=>\"Ocurrió un error inesperado\",\r\n\t\t\t\t\t\t\"Texto\"=>\"Los datos no fueron actualizados, intente nuevamente\",\r\n\t\t\t\t\t\t\"Tipo\"=>\"error\"\r\n\t\t\t\t\t\t];\r\n\t\t\t\t\t\t \r\n\t\t\t}\r\n\t\t\techo json_encode($alerta);\r\n\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of delete_exercise method Create new exercise | public function new_exercise(){
//Exercise data array
$data= array(
'exercise' => $this->db->escape_str($this->input->post('exercise')),
'details' => $this->db->escape_str($this->input->post('details')),
'video' => $this->db->escape_str($this->input->post('video')),
'group_id' => $this->db->escape_str($this->input->post('muscle_id'))
);
//Insert user into database
return $this->db->insert('exercises', $data);
} | [
"public function testExerciseAdding()\n {\n\n // give this test admin user access\n $this->asAdmin();\n\n $input = [\n 'ex_title' => 'Test title',\n 'ex_content' => 'Test content',\n 'ex_author' => 'Test author',\n 'ex_hint' => 'Test hint',\n 'ex_solution' => 'Test solution',\n 'category' => 'matemaatika',\n 'age_group' => 'avastaja',\n 'difficulty' => 'raske',\n 'answer_count' => '1',\n 'answer_1' => 'Test answer'\n ];\n\n $this->call('POST', '/admin/exercise/create/1', $input);\n $this->assertRedirectedTo('/admin/exercise');\n\n\n $this->assertCount(1, Exercise::all());\n $this->assertCount(1, Answer::all());\n }",
"public function create() {\n require_once \"../ressources/views/exercises/create.php\";\n }",
"public function actionCreate()\n {\n $user = $this->getCurrentUser();\n $group = $this->groups->findOrThrow($this->getRequest()->getPost(\"groupId\"));\n if (!$this->groupAcl->canCreateExercise($group)) {\n throw new ForbiddenRequestException();\n }\n\n // create default score configuration without tests\n $calculator = $this->calculators->getDefaultCalculator();\n $scoreConfig = new ExerciseScoreConfig($calculator->getId(), $calculator->getDefaultConfig([]));\n\n // create exercise and fill some predefined details\n $exercise = Exercise::create($user, $group, $scoreConfig, $this->exercisesConfigParams);\n $localizedExercise = new LocalizedExercise(\n $user->getSettings()->getDefaultLanguage(),\n \"Exercise by \" . $user->getName(),\n \"\",\n \"\",\n null\n );\n $this->exercises->persist($localizedExercise, false);\n $exercise->addLocalizedText($localizedExercise);\n\n // create and store basic exercise configuration\n $exerciseConfig = new ExerciseConfig((string)new \\App\\Helpers\\ExerciseConfig\\ExerciseConfig(), $user);\n $exercise->setExerciseConfig($exerciseConfig);\n\n // and finally make changes to database\n $this->exercises->persist($exercise);\n\n $this->configChecker->check($exercise);\n $this->exercises->flush();\n\n $this->sendSuccessResponse($this->exerciseViewFactory->getExercise($exercise));\n }",
"public function addExercise($exercise)\n {\n $this->exercises[] = $exercise;\n }",
"public function addExercise(array $exercise){\n if (self::$db == null){\n self::$db = new DBHelper();\n }\n $db = self::$db;\n // Create a new valid exercise\n $newExercise = array();\n foreach($exercise as $part => $value){\n $newExercise[$part] = $exercise[$part];\n }\n \n // Set the variables to write in the DB\n $name = $newExercise[\"name\"];\n $repetition = $newExercise[\"repetition\"];\n $day = $newExercise[\"day\"];\n \n array_push($this->exercises, $newExercise);\n \n $userId = $this->user->getUserId();\n $programId = $this->getProgramId();\n \n $dbTable = self::$dbTableProgramDetails;\n \n $currentTime = self::$currentTime;\n \n // Generate query to store the exercise in the DB\n $query = \"INSERT INTO $dbTable (name, program_id, repetition, day, user_id, created_at, updated_at) \";\n $query .= \"VALUES (\";\n $query .= \"'$name', \n '$programId', \n '$repetition', \n '$day', \n '$userId',\n $currentTime,\n $currentTime\";\n $query .= \")\";\n \n //Update the database\n $db -> query($query);\n \n }",
"public function create()\n {\n return view('exercises.create');\n }",
"function insert_exercise($id)\n{\n\tlist($order) = mysql_fetch_array(db_query(\"SELECT MAX(`order`) FROM unit_resources WHERE unit_id=$id\"));\n\t\n\tforeach ($_POST['exercise'] as $exercise_id) {\n\t\t$order++;\n\t\t$exercise = mysql_fetch_array(db_query(\"SELECT * FROM exercices\n\t\t\tWHERE id =\" . intval($exercise_id), $GLOBALS['currentCourseID']), MYSQL_ASSOC);\n\t\tif ($exercise['active'] == '0') {\n\t\t\t $visibility = 'i';\n\t\t} else {\n\t\t\t$visibility = 'v';\n\t\t}\n\t\tdb_query(\"INSERT INTO unit_resources SET unit_id=$id, type='exercise', title=\" .\n\t\t\tquote($exercise['titre']) . \", comments=\" . quote($exercise['description']) .\n\t\t\t\", visibility='$visibility', `order`=$order, `date`=NOW(), res_id=$exercise[id]\",\n\t\t\t$GLOBALS['mysqlMainDb']); \n\t}\n\theader('Location: index.php?id=' . $id);\n\texit;\n}",
"function save()\r\n\t{\r\n\t\t$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);\r\n\t\t$TBL_EXERCICES_EXAMS = Database::get_course_table(TABLE_QUIZ_TEST_EXAM);\r\n $TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);\r\n\r\n\t\t$id=$this->id;\r\n\t\t$exercise=addslashes($this->exercise);\r\n\t\t$description=addslashes($this->description);\r\n\t\t$sound=addslashes($this->sound);\r\n\t\t$type=$this->type;\r\n\t\t$random=$this->random;\r\n\t\t$active=$this->active;\r\n\t\t$results_disabled = intval($this->results_disabled);\r\n\r\n\t\t//campos propios de un examen\r\n\t\t$intentos=$this->intentos;\r\n\t\t$minimo=$this->minimo;\r\n\r\n\t\t// exercise already exists\r\n\t\tif($id)\r\n\t\t{\r\n\t\t\t$sql=\"UPDATE $TBL_EXERCICES SET title='$exercise',description='$description',sound='$sound',type='$type',random='$random',active='$active',results_disabled='$results_disabled' WHERE id='$id'\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\r\n\t\t\t$sql=\"UPDATE $TBL_EXERCICES_EXAMS SET intentos='$intentos', minimo='$minimo' WHERE id='$id'\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t}\r\n\t\t// creates a new exercise\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO $TBL_EXERCICES(title,description,sound,type,random,active, results_disabled) VALUES('$exercise','$description','$sound','$type','$random','$active',$results_disabled)\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\r\n\t\t\t$this->id=mysql_insert_id();\r\n\r\n\t\t\t$sql=\"INSERT INTO $TBL_EXERCICES_EXAMS(id, intentos, minimo) VALUES('$this->id','$intentos','$minimo')\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t}\r\n\r\n\t\t// updates the question position\r\n\t\tforeach($this->questionList as $position=>$questionId)\r\n\t\t{\r\n\t\t\t$sql=\"UPDATE $TBL_QUESTIONS SET position='$position' WHERE id='$questionId'\";\r\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\r\n\t\t}\r\n\t}",
"public function save($exercise) {\r\n\t\t$stmt = $this->db->prepare(\"INSERT INTO exercises (nombre, tipo, descripcion, url) values (?,?,?,?)\");\r\n\t\t$stmt->execute(array($exercise->getExerName(), $exercise->getExerTipo(), $exercise->getDescripcion(), $exercise->getUrl()));\r\n\t}",
"public function add_exercise_action() {\n\t\t//echo \"<pre>\";\n\t\t//print_r($_POST);\n\t\t//echo \"</pre>\";\n\t\t//echo 'count($_POST [lab_content]) : '.count_chars($_POST['summernote-text']).\"<br>\";\n\t\t$this->load->model('lab_model');\n\t\t$this->lab_model->add_lab($_POST);\n\n\t\t$this->show_lab_exercise();\n\t\t//$this->load->view('supervisor/head');\n\t\t//$this->load->view('supervisor/nav_fixtop');\n\t\t//$this->load->view('supervisor/nav_sideleft');\n\t\t//$this->load->view('supervisor/add_exercise');\n\t\t//$this->load->view('supervisor/footer');\n\t\t//$this->load->view('test_summernote-02');\n\t}",
"function delete_exercise($exerciseId) {\n\n\t\t/* Load models necessary for this method */\n\t\t$this->load->model('exercise');\n\n\t\t$exercise = $this->exercise->getById($exerciseId);\n\t\t$plan = $exercise->getPlan();\n\t\t$client = $plan->getClient();\n\t\t$user = $this->user->getById(activeUser()->id);\n\n\t\t/* Make sure the logged in user is trainer and the client belongs to him */\n\t\tif (!$this->verifyTrainer($user, $client->id)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!$exercise->delete()) {\n\t\t\techo 'Something went wrong while deleting exercise';\n\t\t\treturn;\n\t\t}\n\t\tredirect('/my/clients/' . $client->id . '/plans/' . $plan->id);\n\t}",
"public function create(array $exercise): PDOStatement\n {\n extract($exercise);\n\n $query = '\n INSERT INTO ' . $this->tablename . ' (user_id, description, solution, title, category, subcategory, difficulty)\n VALUES (:user_id, :description, :solution, :title, :category, :subcategory, :difficulty);\n ';\n\n $stmt = $this->connection->prepare($query);\n\n $stmt->bindParam(\":user_id\", $user_id);\n $stmt->bindParam(\":description\", $description);\n $stmt->bindParam(\":solution\", $solution);\n $stmt->bindParam(\":title\", $title);\n $stmt->bindParam(\":category\", $category);\n $stmt->bindParam(\":subcategory\", $subcategory);\n $stmt->bindParam(\":difficulty\", $difficulty);\n\n $stmt->execute();\n\n $id = $this->connection->prepare('SELECT LAST_INSERT_ID() as \"id\";');\n $id->execute();\n return $id;\n }",
"private function generateExerciseForEditContent($id) \n {\n $exercisesDb = new Exercises();\n $exercise = $exercisesDb->findByPrimary($id);\n $previewPicture = '/images/content/dynamisch/exercises/' . $exercise->offsetGet('exercise_id') . '/' .\n $exercise->offsetGet('exercise_preview_picture');\n $previewPictureSource = '/images/content/statisch/grafiken/kein_bild.png';\n $count = $this->getParam('counter');\n\n if (is_file(getcwd() . '/' . $previewPicture)\n && is_readable(getcwd() . '/' . $previewPicture)\n ) {\n $thumbnailService = new Thumbnail();\n $thumbnailService->setThumbWidth(1024);\n $thumbnailService->setThumbHeight(768);\n $thumbnailService->setSourceFilePathName(getcwd() . '/' . $previewPicture);\n $previewPictureSource = $thumbnailService->generateImageString();\n }\n $this->view->assign($exercise->toArray());\n $this->view->assign('previewSource', $previewPictureSource);\n $this->view->assign('exercise_description', $exercise->offsetGet('exercise_description'));\n\n $deviceOptionsService = new DeviceOptionsViewGenerator($this->view);\n $deviceOptionsService->setExerciseId($id);\n\n if (isset($exercise['device_option_id'])) {\n $deviceOptionsService->setOptionId($exercise['device_option_id']);\n }\n if (isset($exercise['device_id'])) {\n $deviceOptionsService->setDeviceId($exercise['device_id']);\n }\n $deviceOptionsService->setForceGenerateEmptyInput(true);\n $deviceOptionsService->setShowDelete(true);\n $this->view->assign('deviceOptionContent', $deviceOptionsService->generate());\n\n $exerciseOptionsService = new ExerciseOptionsViewGenerator($this->view);\n $exerciseOptionsService->setExerciseId($id);\n\n if (isset($exercise['device_option_id'])) {\n $exerciseOptionsService->setOptionId($exercise['exercise_option_id']);\n }\n $exerciseOptionsService->setForceGenerateEmptyInput(true);\n $exerciseOptionsService->setShowDelete(true);\n\n $this->view->assign('exerciseOptionContent', $exerciseOptionsService->generate());\n\n $deviceOptionsService->setShowDelete(false);\n $this->view->assign('deviceOptionsSelectContent', $deviceOptionsService->generateDeviceOptionsSelectContent());\n $exerciseOptionsService->setShowDelete(false);\n $this->view->assign('exerciseOptionsSelectContent', $exerciseOptionsService->generateExerciseOptionsSelectContent());\n\n $this->view->assign('count', $count);\n $this->view->assign('muscleRatingContent', $this->generateMuscleRatingContent($exercise));\n\n return $this->view->render('loops/training-plan-exercise-edit.phtml');\n }",
"public static function addExercise($id, $status=2){\n $section = Auth::getCurrentUser()->getSection();\n require_once('Database.php');\n $db = Database::getDb();\n \n $sth = $db->prepare(\"INSERT INTO SectionMP\n VALUES(NULL,:section,:id,:status)\");\n $sth->execute(array(':section' => $section, ':id' => $id, ':status' => $status));\n }",
"private function createQuiz() {\n\n $newQuiz = new Quiz();\n $newQuiz->difficulty_level_id = $this->difficulty;\n $newQuiz->num_of_questions = $this->length;\n $newQuiz->save();\n\n $this->quizId = $newQuiz->id;\n }",
"public function add_exercise( $userID, $name, $description, $is_cardio ) {\r\n\t\t\t$data = array(\r\n\t\t\t 'users_id' => $userID ,\r\n\t\t\t 'name' => $name ,\r\n\t\t\t 'description' => $description,\r\n\t\t\t 'type' => $is_cardio\r\n\t\t\t);\r\n\r\n\t\t\t$this->db->insert('exercises', $data); \r\n\t\t}",
"function deleteExercise($id) {\r\n $select = 'DELETE FROM exercises WHERE exercise_id=:id';\r\n\r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':id', $id, PDO::PARAM_INT);\r\n $statement->execute();\r\n }",
"public function removeExercise($exercise)\n {\n $next_exercise = $this->nextExercise($exercise->id);\n\n if(!is_null($next_exercise)){\n $next_exercise->previous_exercise_id = $exercise->previous_exercise_id;\n $next_exercise->save();\n }\n }",
"public function deleteExercise($exid) {\n\t\t$where = array();\n\t\t$where['exid'] = $exid;\n\t\t\t\t\n\t\t$db = new DB();\n\t\t$db->connect();\n\t\t$result = $db->delete(\"exercise\", $where);\n\t\t$db->disconnect();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the list of communities in which I am member. | public function myCommunitiesAction()
{
$user= $this->get('security.context')->getToken()->getUser();
$communities = $this->getDoctrine()
->getRepository('MbyCommunityBundle:Community')
->findAllUserCommunities($user);
return $this->render('MbyCommunityBundle:Membership:myCommunities.html.twig', array(
'communities' => $communities,
));
} | [
"public function index(Request $request)\n {\n return $request->user()->communities;\n }",
"public function getCommunities() {\n\t\treturn $this->communities;\n\t}",
"function community(){\n\t\t$layoutTitle = 'StudyBuddy :: Community';\n $this->viewBuilder()->layout('innerPage');\n\t\t$this->loadModel('Pages');\n\t\t$slug = 'community';\n\t\t$pages = $this->Pages->find()->where(['Pages.status' => '1', 'Pages.slug' => $slug])->first();\n\t\t$this->set(compact('pages', 'layoutTitle'));\n\t\t\n\t\t$this->loadModel('Users');\n\t\t$stateList = $this->Users->find('list', ['keyField' => 'id', 'valueField' => 'state'])\n\t\t\t\t\t\t\t->where(['Users.role' => 'INSTITUTIONS'])\n\t\t\t\t\t\t\t->order(['Users.state'=>'ASC'])\n\t\t\t\t\t\t\t->group('state')->toArray();\n\t\t\t\t\t\t\t//pr($stateList); die;\n\t\t$states = $this->Users->find()\n\t\t\t\t\t\t->where(['Users.role' => 'INSTITUTIONS', 'Users.status' => 1, 'Users.state IN'=> $stateList])\n\t\t\t\t\t\t->order(['state' => 'asc'])\n\t\t\t\t\t\t->toArray();\n\t\t//pr($states); die('DD');\n\t\t$this->set(compact('states', 'stateList'));\n\t}",
"public function communities()\n {\n return $this->belongsToMany('App\\Community', 'community_member', 'id_user', 'id_community')->withPivot([]);\n }",
"public function index()\n {\n $communities = Community::OrderBy('community_name', 'asc')->paginate(10);\n\n return view('backend.community.index', compact('communities'));\n }",
"public function getAllCommunities(){\n $stmt = $this->con->prepare(\"SELECT * FROM communities ORDER BY LOWER(name)\");\n $stmt->execute();\n $communities = $stmt->get_result();\n $stmt->close();\n return $communities;\n }",
"public function myIndexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $communities = $em->getRepository('CabBundle:Community')->findAll();\n\n return $this->render('community/myIndex.html.twig', array(\n 'communities' => $communities,\n ));\n }",
"function gi2m_displayMembers()\n {\n include('admin/gi2m_membersView.php');\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $communities = $em->getRepository('CabBundle:Community')->findAll();\n $trips = $em->getRepository('CabBundle:Trip')->findAll();\n\n return $this->render('community/index.html.twig', array(\n 'communities' => $communities,\n 'trips' => $trips,\n ));\n }",
"function getCommunityList()\n\t{\n\t\t$sql = \" SELECT * FROM `communities` order by country, community \";\n\t\t\n\t\t$sql .= \" /*get community list*/ \";\n\t\t\n\t\t$query = $this->db->query($sql);\n\t\t\n\t\t//echo $str = $this->db->last_query();\n\t\t$results = array();\n\t\t\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$results = $query->result_array();\t\t\t\n\t\t}\n\t\t\n\t\t$query->free_result();\n\t\n\t\t\n\t\treturn $results;\n\t\t\n\t}",
"public function communityList(){\n\t\t\n\t\ttry{\n \t\t\t$query = $this->entityManager->createQueryBuilder()\n\t\t\t->select('dm.id','dm.name as itemName','dm.icon')\n\t\t\t->from('App\\Entities\\DropDownMaster', 'dm')\n\t\t\t->Where('dm.type=:type')->setParameter('type', 'community');\n\t\t\t\n\t\t\t$query = $query->getQuery();\n\t\t\t\n\t\t\t$community = $query->getArrayResult();\n\t\t\treturn array('result'=>'success','data' => $community);\n\t\t}catch(Exception $e) {\n\t\t\treturn array('result'=>'fail','errorDescription'=>$e->getMessage());\n\t\t}\n\t}",
"public function communities() {\n return $this->belongsToMany(Community::class, 'user_community_permissions');\n }",
"private function listClubMembers() {\n $memberList = $this->connect()->query(\"SELECT * FROM club_members\");\n echo \"\n <div class='dbContent'>\n <table class='dbList'>\n <caption><strong>Club Members List</strong></caption>\n <thead>\n <tr>\n <th abbr='ID' scope='col' title='ID'>Member ID</th>\n <th abbr='First Name' scope='col' title='First Name'>First Name</th>\n <th abbr='Last Name' scope='col' title='Last Name'>Last Name</th>\n <th abbr='Email' scope='col' title='Email'>Email</th>\n <th abbr='Availability' scope='col' title='Availability'>Availability</th>\n <th abbr='Receive Email' scope='col' title='Receive Email'>Receive Email</th>\n <th abbr='Become Leader' scope='col' title='Become Leader'>Become Leader</th>\n </tr>\n </thead>\n <tbody>\";\n while ($row = $memberList->fetch()) {\n echo \"\n <tr>\n <td>$row[id]</td>\n <td>$row[first_name]</td>\n <td>$row[last_name]</td>\n <td>$row[email]</td>\n <td>$row[availability]</td>\n <td>$row[receive_email]</td>\n <td>$row[become_leader]</td>\n </tr>\";\n }\n echo \"\n </tbody>\n </table>\n </div>\";\n }",
"public function memberlist(){\n $members = Membership::paginate(16);\n return view('membership.members-list')->with(compact('members'));\n }",
"public function displayMembers()\n\t\t\t{\n\t\t\t global $LANG_LIST_ARR;\n\t\t\t\t$usersPerRow = $this->CFG['admin']['members_list']['cols'];\n\t\t\t\t$count = 0;\n\t\t\t\t$found = false;\n\t\t\t\t$browse = $this->getFormField('browse');\n\t\t\t\t$tagSearch = $this->getFormField('tags');\n\t\t\t\t$tagSearch = (!empty($tagSearch));\n\t\t\t\t$this->listDetails = true;//((strcmp($browse, 'viewAllMembers')==0) OR $tagSearch);\n\t\t\t\t$this->friendsCount = true;//(strcmp($browse, 'maleMostFriends')==0 OR strcmp($browse, 'femaleMostFriends')==0);\n\t\t\t\t$this->profileHits = (strcmp($browse, 'maleMostViewed')==0 OR strcmp($browse, 'femaleMostViewed')==0);\n\t\t\t\t$videoCount = chkAllowedModule(array('video'));\n\n\t\t\t\t$showVideoIcon = $this->CFG['admin']['members_listing']['video_icon'];\n\t\t\t\t$query_tag = $this->_parse_tags_member(strtolower($this->fields_arr['tags']));\n\t\t\t\t$showOnlineIcon = $this->CFG['admin']['members_listing']['online_icon'];\n\t\t\t\t$showOnlineStatus = $this->CFG['admin']['members_listing']['online_status'];\n\t\t\t\t$rank = $this->fields_arr['start']+1;\n\n\t\t\t\t$member_list_arr = array();\n\t\t\t\t$inc = 0;\n\t\t\t\twhile($row = $this->fetchResultRecord())\n\t\t\t\t {\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tif(isMember())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$member_list_arr[$inc]['friend'] = '';\n\t\t\t\t\t\t\t\t$sql = 'SELECT 1 FROM '.$this->CFG['db']['tbl']['friends_list'].\n\t\t\t\t\t\t\t\t\t\t' WHERE (friend_id='.$this->dbObj->Param('friend_id1').\n\t\t\t\t\t\t\t\t\t\t' AND owner_id='.$this->dbObj->Param('owner_id1').')';\n\t\t\t\t\t\t\t\t$fields_val_arr = array($row['user_id'], $this->CFG['user']['user_id']);\n\n\t\t\t\t\t\t\t\t$stmt = $this->dbObj->Prepare($sql);\n\t\t\t\t\t\t\t\t$rs = $this->dbObj->Execute($stmt, $fields_val_arr);\n\t\t\t\t\t\t\t\tif (!$rs)\n\t\t\t\t\t\t\t\t\ttrigger_db_error($this->dbObj);\n\n\t\t\t\t\t\t\t\tif ($rs->PO_RecordCount())\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['friend'] = 'yes';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$member_list_arr[$inc]['memberProfileUrl'] = getMemberProfileUrl($row['user_id'], $row['user_name']);\n\t\t\t\t\t\t$joined = 0;\n\t\t\t\t\t\t$member_list_arr[$inc]['profileIcon']= getMemberAvatarDetails($row['user_id']);\n\t\t\t\t\t\t$member_list_arr[$inc]['online'] = $this->CFG['admin']['members']['offline_anchor_attributes'];\n\t\t\t\t\t\t$member_list_arr[$inc]['currentStatus'] = $this->LANG['members_list_offline_status_default'];\n\t\t\t\t\t\t$member_list_arr[$inc]['onlineStatusClass'] = 'memListUserStatusOffline';\n\t\t\t\t\t\t$member_list_arr[$inc]['open_tr'] = false;\n\t\t\t\t\t\tif ($showOnlineIcon AND $row['logged_in_currently'])\n\t\t\t\t\t\t {\n\t\t\t\t\t\t $member_list_arr[$inc]['currentStatus'] = $this->getCurrentUserOnlineStatus($row['privacy'], $row['status_msg_id']);\n\t\t\t\t\t\t\t\t$onlineAnchorAttr = $this->CFG['admin']['members']['online_anchor_attributes'];\n\t\t\t\t\t\t\t\t$member_list_arr[$inc]['online'] = str_replace('{online_status}', $member_list_arr[$inc]['currentStatus'], $onlineAnchorAttr);\n\t\t\t\t\t\t\t\tif($member_list_arr[$inc]['currentStatus']!='Offline')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['onlineStatusClass'] = 'memListUserStatusOnline';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\tif ($count%$usersPerRow==0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \t$member_list_arr[$inc]['open_tr'] = true;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t$member_list_arr[$inc]['userLink']= '';\n\t\t\t\t\t\t//To display stats in images\n\t\t\t\t\t\tforeach ($this->CFG['site']['modules_arr'] as $key=>$value)\n\t\t\t\t\t \t{\n\t\t\t\t\t \t\t$member_list_arr[$inc][$value.'ListUrl'] = '';\n\t\t\t\t\t\t\t\tif(chkAllowedModule(array(strtolower($value))))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$image_url1 = $this->CFG['site']['project_path'].'design/templates/'.$this->CFG['html']['template']['default'].'/images/'.$value.'_icon_mini.jpg';\n\t\t\t\t\t\t\t\t\t\t$image_url2 = $this->CFG['site']['project_path'].'design/templates/'.$this->CFG['html']['template']['default'].'/images/'.$value.'_no_icon_mini.jpg';\n\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'_image1_exists'] = false;\n\t\t\t\t\t\t\t\t\t\tif(is_file($image_url1))\n\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'_image1_exists'] = true;\n\n\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'_image2_exists'] = false;\n\t\t\t\t\t\t\t\t\t\tif(is_file($image_url2))\n\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'_image2_exists'] = true;\n\t\t\t\t\t\t\t\t\t\t\tif ($value == 'blog') {\n\t\t\t\t\t\t\t\t\t\t\t\t$function_name = 'getTotalUsersPosts';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$function_name = 'getTotalUsers'.ucfirst($value).'s';\n\t\t\t\t\t\t\t\t\t\tif(function_exists($function_name))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$stats = $function_name($row['user_id'],1);\n\t\t\t\t\t\t\t\t\t\t\t\t$member_fulldetails_arr[$inc]['total_'.strtolower($value).'s'] = $stats;\n\t\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['total_'.strtolower($value).'s'] = $stats;\n\t\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'_icon_title'] = sprintf($this->CFG['admin']['members'][$value.'_icon_title'], $stats);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($value == 'discussions') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'ListUrl'] = getUrl($value,'?pg=user'.$value.'list&user_id='.$row['user_id'], 'user'.$value.'list/?user_id='.$row['user_id'],'',$value);\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\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc][$value.'ListUrl'] = getUrl($value.'list','?pg=user'.$value.'list&user_id='.$row['user_id'], 'user'.$value.'list/?user_id='.$row['user_id'],'',$value);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$member_list_arr[$inc]['record'] = $row;\n\t\t\t\t\t\t//To display stats in text\n\t\t\t\t\t\tif($this->stats_display_as_text && $this->CFG['admin']['members_list']['stats_display_as_text'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//uses home page setting variable\n\t\t\t\t\t\t\t\t$stats_module = $this->CFG['admin']['site_home_page'];\n\t\t\t\t\t\t\t\t$member_list_arr[$inc]['stats_text_val'] = false;\n\t\t\t\t\t\t\t\tif(chkAllowedModule(array($stats_module)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['stats_text_val'] = true;\n\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['stats_text'] = array();\n\t\t\t\t\t\t\t\t\t\t$default_text_function_name = 'getTotal'.ucfirst($stats_module).'s';\n\t\t\t\t\t\t\t\t\t\t$total_stats = 0;\n\t\t\t\t\t\t\t\t\t\tif(function_exists($default_text_function_name))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$total_stats = $default_text_function_name($row['user_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['stats_text']['total_stats'] = $total_stats;\n\t\t\t\t\t\t\t\t \t$member_list_arr[$inc]['stats_text']['lang_list'] = $this->LANG['profile_list_'.$stats_module.'s'];\n\t\t\t\t\t\t\t\t \t$member_list_arr[$inc]['stats_text']['list_url'] = '';\n\t\t\t\t\t\t\t\t \t$member_list_arr[$inc]['stats_text']['icon_title'] = '';\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\tif ($total_stats > 0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$member_list_arr[$inc]['stats_text']['icon_title'] = sprintf($this->CFG['admin']['members'][$stats_module.'_icon_title'], $total_stats);\n\t\t\t\t\t\t \tif ($value == 'discussions')\n\t\t\t\t\t\t \t\t$member_list_arr[$inc]['stats_text']['list_url'] = getUrl($stats_module,'?pg=user'.$stats_module.'list&user_id='.$row['user_id'], 'user'.$stats_module.'list/?user_id='.$row['user_id'], '' ,$stats_module);\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t \t$member_list_arr[$inc]['stats_text']['list_url'] = getUrl($stats_module.'list','?pg=user'.$stats_module.'list&user_id='.$row['user_id'], 'user'.$stats_module.'list/?user_id='.$row['user_id'], '' ,$stats_module);\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$member_list_arr[$inc]['about_me'] = wordWrap_mb_ManualWithSpace(strip_tags($row['about_me']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CFG['admin']['members_list']['about_me_length'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CFG['admin']['members_list']['about_me_total_length']);\n\t\t\t\t\t\t$member_list_arr[$inc]['friend_icon_title'] = sprintf($this->CFG['admin']['members']['friend_icon_title'], $row['total_friends']);\n\t\t\t\t\t\t$member_list_arr[$inc]['viewfriendsUrl'] = getUrl('viewfriends','?user='.$row['user_name'], $row['user_name'].'/');\n\t\t\t\t\t\t$member_list_arr[$inc]['mailComposeUrl'] = getUrl('mailcompose','?mcomp='.$row['user_name'],'?mcomp='.$row['user_name'], 'members');\n\t\t\t\t\t\t$member_list_arr[$inc]['friendAddUrl'] = getUrl('friendadd','?friend='.$row['user_id'],'?friend='.$row['user_id'], 'members');\n\t\t\t\t\t\t$member_list_arr[$inc]['friendAddUrlLinkId'] = 'friendadd'.$row['user_id'];\n\t\t\t\t\t\t$member_list_arr[$inc]['mailComposeUrlLinkId'] = 'mailcompose'.$row['user_id'];\n\t\t\t\t\t\t$member_list_arr[$inc]['country'] = isset($LANG_LIST_ARR['countries'][$row['country']])?$LANG_LIST_ARR['countries'][$row['country']]:'';\n\t\t\t\t\t\t$member_list_arr[$inc]['last_logged'] =($row['last_logged']!='')?$row['last_logged']:$this->LANG['members_list_member_first_login'];\n\n\t\t\t\t\t\t$member_list_arr[$inc]['mostActiveUsers'] = false;\n\t\t\t\t\t\tif($this->fields_arr['browse']=='mostActiveUsers' and chkAllowedModule(array('video')))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t $member_list_arr[$inc]['mostActiveUsers'] = true;\n\t\t\t\t\t\t\t $member_list_arr[$inc]['percentage']=round($row['percentage'], 2);\n\t\t\t\t\t\t\t $member_list_arr[$inc]['rank']=$rank;\n\t\t\t\t\t\t\t $rank++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$member_list_arr[$inc]['viewedusers'] = false;\n\t\t\t\t\t\tif($this->fields_arr['browse']=='viewedusers')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t $member_list_arr[$inc]['viewedusers'] = true;\n\t\t\t\t\t\t\t $member_list_arr[$inc]['total_viewed_str']=str_replace('VAR_TOTAL_VIEWS', $row['total_views'], $this->LANG['members_profile_hits_msg']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$member_list_arr[$inc]['UserProfileTag_arr']=$this->getUserProfileTagSet($row['profile_tags'], $query_tag);\n\t\t\t\t\t\t$member_list_arr[$inc]['end_tr'] = false;\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t\tif ($count%$usersPerRow==0)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t\t\t\t$member_list_arr[$inc]['end_tr'] = true;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t$inc++;\n\t\t\t\t\t}// while\n\t\t\t\t$this->last_tr_close = false;\n\t\t\t\tif ($found and $count and $count<$usersPerRow)\n\t\t\t\t\t{\n\t\t\t\t\t \t$this->last_tr_close = true;\n\t\t\t\t\t \t$this->user_per_row=$usersPerRow-$count;\n\t\t\t\t\t}\n\t\t\t\treturn $member_list_arr;\n\t\t\t}",
"public function listCommunities($userId, $optParams = array())\n {\n $params = array('userId' => $userId);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), 'Google\\Service\\Orkut\\CommunityList');\n }",
"public function discoverDataOfCommunity()\n {\n Session::put('menu_item_parent', 'content');\n Session::put('menu_item_child', 'communities');\n Session::put('menu_item_child_child', '');\n $communitiesData = CommunityDiscover::with(['community:communityIdx,communityName', 'offer:offerIdx,offerTitle,providerIdx'])->orderby('created_at', 'desc')\n ->get();\n \n \n $data = array('communitiesData');\n\n return view('admin.communities.discover_community_data', compact($data));\n }",
"function showCrowdList()\n {\n global $wgOut;\n\n $user = vfUser()->getUserVO();\n $crowds = $this->crowddao->getCrowdsOfUser($user->userID);\n $wgOut->setPageTitle(\"Crowd management\");\n $out = '';\n\n if(count($crowds))\n {\n $out .= \"== My Crowd ==\\nYou are member of:\\n\";\n $out .= \"{| class=\\\"wikitable sortable\\\" style=\\\"width: 100%\\\"\\n! Crowd Name !! Members !! Join Date || class=\\\"unsortable\\\" | \\n\";\n\n\n foreach($crowds as $crowd)\n {\n /* @var $crowd CrowdVO */\n $out .= \"|-\\n\";\n $out .= \"| [[Special:Crowd/{$crowd->name}|{$crowd->name}]] <br />{$crowd->description} || {$crowd->no_members} || {$crowd->date_added} ||\";\n if($crowd->isManager)\n $out .= \"Manager\";\n $out .= \"\\n\";\n }\n $out .= '|}';\n }\n $wgOut->addWikiText($out);\n }",
"public function actionIndex() {\n $searchModel = new CommunicationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $page = 1;\n $limit = 20 * $page;\n $CgetList = \\Communication::items($limit, \\Communication::$allw);\n $AgetList = \\Ads::items($limit, \\Ads::$allw);\n $CommentList = \\COMMENTS::items($limit, \\Ads::$hide);\n $users = [];\n $users_d = array_merge($CgetList['users'], $AgetList['users'], $CommentList['users']);\n foreach ($users_d as $vol) {\n $users[$vol['id']] = $vol;\n }\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'users' => $users,\n 'CgetList' => $CgetList,\n 'AgetList' => $AgetList,\n 'CommentList' => $CommentList\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stores the association mapping. | protected function _storeAssociationMapping(AssociationMapping $assocMapping): void
{
$sourceFieldName = $assocMapping['fieldName'];
$this->assertFieldNotMapped($sourceFieldName);
$this->associationMappings[$sourceFieldName] = $assocMapping;
} | [
"protected function _storeAssociationMapping(array $assocMapping)\n {\n $sourceFieldName = $assocMapping['fieldName'];\n\n $this->assertFieldNotMapped($sourceFieldName);\n\n $this->associationMappings[$sourceFieldName] = $assocMapping;\n }",
"public function save()\n {\n if ($this->isLoaded()) {\n $baseModel = $this->getModel();\n $assocModel = $this->getObject();\n $fkName = $this->getFkName();\n $pkName = $this->getPkName();\n\n // save associated object\n $assocModel->save();\n $baseModel->writeAttribute($fkName, $assocModel->$pkName);\n }\n }",
"protected function save_associated()\n {\n foreach(static::association_names() as $assoc_name)\n {\n if (isset($this->$assoc_name))\n {\n $assoc = static::association($assoc_name);\n \n switch($assoc['type'])\n {\n case 'has_one':\n $primary_key = static::primary_key();\n $this->$assoc_name->{$assoc['foreign_key']} = $this->$primary_key;\n break;\n case 'has_many': break;\n case 'has_and_belongs_to_many': break;\n case 'belongs_to': continue;\n }\n \n if (!$this->$assoc_name->save()) {\n return false;\n }\n }\n }\n return true;\n }",
"public function writeAssociationSets();",
"public function save() {\n\t\tparent::save();\n\t\tif ($this->_domains) {\n\t\t\t$this->_domains->save();\n\t\t\tforeach ($this->_domains as $domain) {\n\t\t\t\t$map = new Study_TagDomainMap();\n\t\t\t\t$map->tag_id = $this->getId();\n\t\t\t\t$map->domain_id = $domain->getId();\n\t\t\t\t$map->save();\n\t\t\t}\n\t\t}\n\t}",
"final protected function save_has_and_belongs_to_many() {\n\t\tforeach ($this->_has_and_belongs_to_many as $relation => $options) {\n\t\t\tif (is_numeric($relation))\n\t\t\t\t$relation = $options;\n\n\t\t\tif (isset($this->_attributes[$relation]))\n\t\t\t\t$this->add_has_and_belongs_to_many($relation, $this->_attributes[$relation]);\n\t\t}\n\t}",
"function save() {\n\t\tparent::save();\n\t\tif (null !== $this->_relation && null !== ($relation = $this->_storage->getInstance($this->_relation)))\n\t\t\t$relation->save();\n\t}",
"public function getMapping()\n {\n return $this->association;\n }",
"private function ormCascadeSave()\n {\n foreach ($this->orm['relations'] as $class => $relDetail)\n {\t \n\t // Make sure the related object is available. It should always be.\n\t if (!isset($this->$class))\n\t {\n\t continue;\n\t }\n\t \n\t // $ref will be a pointer to the related object.\t \n\t $ref = $this->$class;\n\n\t if ($ref->isDirty() || $relDetail['type'] == ORM_HAS_ONE || $relDetail['type'] == ORM_BELONGS_TO)\n\t {\n // Is key in format of localkey:foreignKey?\n if (strpos($relDetail['key'], \":\", 1))\n {\n list($localKey, $foreignKey) = explode(\":\", $relDetail['key']);\n\t }\n\t // Otherwise we assume the srting represents the key variable on both objects.\n\t else\n\t {\n\t $localKey = $foreignKey = $relDetail['key']; \n\t }\n\t \n\t // Get value of local key, and set foreign key with this value. Sync the related object to the db.\n\t $ref->set($foreignKey, $this->get($localKey));\n\t $ref->ormSave(); \n\t }\n } \n }",
"public static function getAssociationMap() : array;",
"protected function associate()\n {\n if (is_array($this->members))\n {\n $assocRow = $this->findById($this->getClassName(get_class($this)), $this->members)[0];\n\n foreach ($this->members as $member)\n {\n $this->$member = $assocRow[$member];\n }\n }\n }",
"final protected function save_has_many() {\n\t\tforeach ($this->_has_many as $relation => $options) {\n\t\t\tif (is_numeric($relation))\n\t\t\t\t$relation = $options;\n\t\t\tif (isset($this->_attributes[$relation]))\n\t\t\t\t$this->add_has_many($relation, $this->_attributes[$relation]);\n\t\t}\n\t}",
"protected function _loadAssociations()\n {\n foreach ($this->Model->associations()->getIterator() as $association => $assocData) {\n $this->set(Inflector::variable($assocData->alias()), $this->Model->{$association}->find('list')->toArray());\n }\n }",
"abstract public function store(Entity $oMappedEntity);",
"abstract public function persist_properties();",
"public function saveMapping($data)\n\t{\n\t\t//Save Shipping Mapping\n\t\t$this->saveShippingMapping($data);\t\t\n\t\t\n\t\t//Save Payment Mapping\n\t\t$this->savePaymentMapping($data);\n\t}",
"abstract protected function getAssociationMapping($association);",
"abstract public function storeAssociation( $url, $association );",
"private function _writeMap() {\n $this->Connection->set($this->_encode($this->_mapNamespace), $this->_map, MEMCACHE_COMPRESSED, $this->_mapExpirationTime);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new report definition | public function create()
{
return new PollsReporting_ReportDefinition();
} | [
"public function makeReport()\n {\n }",
"public function testCreateReport()\n {\n }",
"public function createReportTask() {\n $this->type = \"report\";\n return $this->createTask();\n }",
"public function create(Report &$report)\n {\n $data = $report->exportData();\n $endpoint = 'reports.json';\n $response = $this->request(\n $endpoint, 'POST', array(\n 'report' => $data\n )\n );\n $report->setData($response['report']);\n }",
"protected abstract function generateReport();",
"public function createReport()\n {\n $model = Report::create([\n 'name' => 'Hotline ' . date('d.m.y H:i')\n ]);\n return $model->id;\n }",
"public function generateReport()\n {\n }",
"public function createSimpleProjectReport($projectId);",
"public function create()\n\t{\n\t\treturn view('tutorialreports.create');\n\t}",
"function create_report_graph($reportgraph) {\n return $this->insert_record(\"block_ilp_report_graph\",$reportgraph);\n }",
"function create_report_field($reportfield) {\n return $this->insert_record(\"block_ilp_report_field\",$reportfield);\n }",
"public static function createReport($title = \"\")\n {\n assert(is_string($title), 'Wrong type for argument 1. String expected');\n $content = \"\";\n if (!empty($title)) {\n $content = \"<title>$title</title>\";\n }\n return new self(\"<report>$content</report>\");\n }",
"public function createReportObject($className);",
"public function createReport ()\n {\n $user = auth()->user();\n\n $paid = $this->paid ? 'Yes' : 'No';\n\n $imageFileName = str_replace('storage//', '', $this->trip->image);\n $imagePath = storage_path('app/public') . '/' . $imageFileName;\n\n $template = new TemplateProcessor('template.docx');\n\n $template->setValue('name', $user->name);\n $template->setValue('surname', $user->surname);\n $template->setValue('orderId', $this->id);\n $template->setValue('hotelName', $this->trip->hotel->name);\n $template->setValue('hotelCountry', $this->trip->hotel->country);\n $template->setValue('dateIn', $this->trip->date_in);\n $template->setValue('dateOut', $this->trip->date_out);\n $template->setValue('orderCreatedAt', $this->created_at);\n $template->setValue('price', $this->price);\n $template->setValue('paid', $paid);\n $template->setImageValue('image', $imagePath);\n\n $filename = \"dummy_order_{$user->name}_{$user->surname}_{$this->id}_\" . Carbon::now()->format('Y-m-d_H-i-s');\n $dir = storage_path('app\\public\\ordersReports');\n $fileFullPath = $dir . '\\\\' . $filename . '.docx';\n $template->saveAs($fileFullPath);\n return $fileFullPath;\n }",
"public function create()\n {\n return view('report_types.create');\n }",
"function createFromDefaults($filename){\n\n $addingReportRecord = true;\n $noOutput = true;\n\n include_once(\"report/report_class.php\");\n\n include($filename);\n\n if(!isset($reportClass))\n $error = new appError(200, \"Report file is missing reportClass definition\", \"Report File Error\");\n else\n $report = new $reportClass($this->db, $this->reportUUID, \"tbld:d595ef42-db9d-2233-1b9b-11dfd0db9cbb\");\n\n $settings = $report->addingRecordDefaultSettings();\n\n $startInsertStatement = \"\n INSERT INTO\n `reportsettings`\n (\n `reportuuid`,\n `name`,\n `value`,\n `type`,\n `required`,\n `defaultvalue`,\n `description`\n ) VALUES (\n '\".$this->reportUUID.\"',\";\n\n foreach($settings as $setting){\n\n $insertstatement = $startInsertStatement;\n $insertstatement .= \"'\".$setting[\"name\"].\"', \" ;\n $insertstatement .= \"'\".$setting[\"defaultValue\"].\"', \" ;\n $insertstatement .= \"'\".$setting[\"type\"].\"', \" ;\n $insertstatement .= ((int) $setting[\"required\"]).\", \" ;\n $insertstatement .= \"'\".$setting[\"defaultValue\"].\"', \" ;\n $insertstatement .= \"'\".$setting[\"description\"].\"')\" ;\n\n $this->db->query($insertstatement);\n\n }//endforeach\n\n }",
"public function actionCreate()\n {\n $model = new report();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->report_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createAction()\n {\n $post_id = filter_var($this->route_params['isbn'], FILTER_SANITIZE_NUMBER_INT);\n if($post_id)\n {\n if($post = Post::getPostByID($post_id))\n {\n $text = filter_input(INPUT_POST, 'text', FILTER_SANITIZE_STRING);\n if($text)\n {\n if(Report::addReport($text, $post->id))\n {\n Flash::addMessage('Report was submitted', Flash::SUCCESS);\n $this->redirect('/');\n }\n else\n {\n Flash::addMessage('Error in report submission!', Flash::DANGER);\n $this->redirect('/');\n }\n }\n else\n {\n Flash::addMessage('Post text was not found', Flash::DANGER);\n $this->redirect('/');\n }\n }\n else\n {\n Flash::addMessage('Post was not found', Flash::DANGER);\n $this->redirect('/');\n }\n }\n else\n {\n Flash::addMessage('Post ID was not found', Flash::DANGER);\n $this->redirect('/');\n }\n }",
"function save_report()\n\t{\n\t\t$content='<? $report_fields=Array(';\n\t\tfor($i=0; $i<count($this->report_fields); $i++)\n\t\t{\t\t\t\t\t\n\t\t\t//get number of elements\n\t\t\t$total=count($this->report_fields[$i]);\n\t\t\t$counter=0;\n\n\t\t\t$content.='Array(';\n\t\t\tforeach($this->report_fields[$i] as $report_field => $value) \n\t\t\t{\n\t\t\t\t$counter++;\n\n\t\t\t\tif($total!=$counter)\n\t\t\t\t{\n\t\t\t\t\t$content.='\"'.$report_field.'\" => \"'.$value.'\", ';\n\t\t\t\t} \n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$content.='\"'.$report_field.'\" => \"'.$value.'\"';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(($i+1)==count($this->report_fields)) \n\t\t\t{\n\t\t\t\t$content.=')';\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\t$content.='), ';\n\t\t\t}\n\t\t}\n\t\t$content.=');'; \n\t\t\n\t\t$content.='$order_by=\"'.$this->order_by.'\";';\n\t\t$content.='$report_name=\"'.$this->report_name.'\"; ?>';\n\t\t\n\t\t//Create directory if specified one does not already exist\n\t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$this->path))\n\t\t{ \n\t\t\tmkdir($_SERVER['DOCUMENT_ROOT'].$this->path);\n\t\t}\n\n\t\t$file_name = $this->report_name.\".php\"; \n\t\t$handle = fopen($_SERVER['DOCUMENT_ROOT'].$this->path.$file_name, 'w');\n\t\tfwrite($handle, $content);\n\t\tfclose($handle); \n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register processing callback to this RecordSet. It has to be static method, which gets record's data as array in first argument and mode in second. | public function register_processing_callback($callback) {
Utils_RecordBrowserCommon::register_processing_callback($this->tab, $callback);
} | [
"public function setFieldProcessorCallback(callable $callback): self {\n\t\t$this->_fieldProcessorCallback = $callback;\n\t\treturn $this;\n\t}",
"public function registerOutputBufferCallback($callback);",
"public function process(RecordInterface &$record);",
"public function processData();",
"public function addProcessor(callable $processor);",
"function setProcessing($processing) {\n $this->_processing = $processing;\n }",
"protected function processRecord(&$record) {}",
"function xml_set_processing_instruction_handler ($parser, $handler) {}",
"protected function addCustomStyleHandler(string $attrib, callable $process)\n {\n $this->styles[$attrib] = $process;\n }",
"public function process()\n\t{\n\t\tforeach($this->filters as $field => $filters)\n\t\t{\n\t\t\tforeach($filters as $callback)\n\t\t\t{\n\t\t\t\t$params = array_merge(array($this->input[$field]), $callback['params']);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$this->input[$field] = call_user_func_array($callback['function'], $params);\n\t\t\t}\n\t\t}\n\t}",
"static public function registerRecordSetMethod($method, $callback)\n\t{\n\t\tif (is_string($callback) && strpos($callback, '::') !== FALSE) {\n\t\t\t$callback = explode('::', $callback);\n\t\t}\n\t\tself::$record_set_method_callbacks[$method] = $callback;\n\t}",
"public function setBatchCallback(\\Closure $callback = null)\n {\n $this->onBatchLoaded = $callback;\n }",
"function attachParseRule($callback)\n\t{\n\t\t$this->_rules['parse'][] = $callback;\n\t}",
"public function setUpProcess($callback)\n {\n $this->setUpProcessCallbacks[] = $callback;\n }",
"public function addProcessor(array $processor);",
"public function AddCallback($callback)\n {\n $this->rowcallback = $callback;\n }",
"function SetDataCallback($handler,$method)\n\t{\n\t\t$this->DataCallback = array($handler,$method);\n\t\treturn $this;\n\t}",
"public function callback($buffer) {\n\t\t// Do something...\n\t}",
"protected function AddTransformData(array $definition,array $where,$callback){\n\t\t$this->transforms[]=[$definition,$where,$callback];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register Instagram Feed Gutenberg block on the backend. | public function register_block() {
wp_register_style(
'sbi-blocks-styles',
trailingslashit( SBI_PLUGIN_URL ) . 'css/sb-blocks.css',
array( 'wp-edit-blocks' ),
SBIVER
);
$attributes = array(
'shortcodeSettings' => array(
'type' => 'string',
),
'noNewChanges' => array(
'type' => 'boolean',
)
);
register_block_type(
'sbi/sbi-feed-block',
array(
'attributes' => $attributes,
'render_callback' => array( $this, 'get_feed_html' ),
)
);
} | [
"function register_dynamic_block()\n{\n // Only load if Gutenberg is available.\n if (!function_exists('register_block_type')) {\n return;\n }\n // Hook server side rendering into render callback\n register_block_type('asif/dynamic-block', [\n 'attributes' => [\n 'posts' => [\n 'type' => 'number',\n ],\n ],\n 'render_callback' => 'render_dynamic_block',\n ]);\n}",
"public function register_gutenberg_block() {\n\t\tAssetsManager::localize_gutenberg();\n\t\tregister_block_type(\n\t\t\t'leadin/leadin-forms',\n\t\t\tarray(\n\t\t\t\t'editor_script' => AssetsManager::GUTENBERG,\n\t\t\t)\n\t\t);\n\t}",
"function register_block()\n{\n register_block_type(\n 'pcc/recent-content',\n [\n 'editor_script' => 'platform-coop-blocks-js',\n 'render_callback' => '\\\\PCCFramework\\\\Blocks\\\\RecentContent\\\\render_callback',\n 'attributes' => [\n 'className' => [ 'type' => 'string' ],\n ]\n ]\n );\n}",
"public static function registerBlockType()\n {\n wp_enqueue_script(\n 'amelia_booking_gutenberg_block',\n AMELIA_URL . 'public/js/gutenberg/amelia-booking/amelia-booking-gutenberg.js',\n array( 'wp-blocks', 'wp-components', 'wp-element', 'wp-editor')\n );\n\n wp_localize_script(\n 'amelia_booking_gutenberg_block',\n 'wpAmeliaLabels',\n array_merge(\n BackendStrings::getCommonStrings(),\n BackendStrings::getWordPressStrings(),\n self::getEntitiesData()\n )\n );\n\n register_block_type(\n 'amelia/booking-gutenberg-block',\n array('editor_script' => 'amelia_booking_gutenberg_block')\n );\n }",
"public function register_acf_block() {\n\t\tif ( function_exists( 'acf_register_block' ) ) {\n\t\t\t// register a block\n\t\t\tacf_register_block( array(\n\t\t\t\t'name' => 'p4-gpch-block-magazine-articles',\n\t\t\t\t'title' => __( 'Magazine Articles', 'planet4-gpch-plugin-blocks' ),\n\t\t\t\t'description' => __( 'Magazine Articles', 'planet4-gpch-plugin-blocks' ),\n\t\t\t\t'render_callback' => array( $this, 'render_block' ),\n\t\t\t\t'category' => 'gpch',\n\t\t\t\t'icon' => 'book',\n\t\t\t\t'keywords' => array( 'magazine', 'articles' ),\n\t\t\t) );\n\t\t}\n\t}",
"public function register_block() {\n\t\t\twp_add_inline_script( 'wp-blocks', $this->block() );\n\t\t\tif ( class_exists( 'SiteOrigin_Panels' ) ) {\n\t\t\t\twp_add_inline_script( 'wp-blocks', $this->siteorigin_js() );\n\t\t\t}\n\t\t}",
"public function acf_init_register_gutenberg_blocks() {\n \n if( function_exists('acf_register_block') ) {\n \n foreach($this->get_all_blocks_saved() as $block) {\n\n acf_register_block([\n 'name'\t\t\t\t=> $block->post_name,\n 'title'\t\t\t\t=> $block->post_title,\n 'description'\t\t=> $block->post_excerpt,\n 'render_callback'\t=> array($this, 'acf_gutenberg_block_render_callback'),\n 'category'\t\t\t=> $this->get_category_block($block->ID)['slug'],\n 'icon'\t\t\t\t=> get_field('icon_gutenberg_block', $block->ID),\n 'keywords'\t\t\t=> [],\n 'mode'\t => 'auto'\n ]);\n }\n }\n }",
"function register_block( $name ) {\n\t\n\t\t\tacf_register_block( array(\n\t\t\t\t'name' => str_replace('-', ' ', $name),\n\t\t\t\t'title' => __( str_replace('-', ' ', ucwords( $name, '-' )), 'genlite' ),\n\t\t\t\t'description' => __( str_replace('-', ' ', ucwords( $name, '-' )) . ' block.', 'genlite' ),\n\t\t\t\t'render_callback' => function( $block, $content = '', $is_preview = false ) {\n\t\t\t\t\t$context = Timber::context();\n\t\t\t\t\n\t\t\t\t\t// Store block values.\n\t\t\t\t\t$context['block'] = $block;\n\t\t\t\t\n\t\t\t\t\t// Store field values.\n\t\t\t\t\t$context['fields'] = get_fields();\n\t\t\t\t\n\t\t\t\t\t// Store $is_preview value.\n\t\t\t\t\t$context['is_preview'] = $is_preview;\n\n\t\t\t\t\t// Render the block.\n\t\t\t\t\tTimber::render( 'templates/blocks/' . str_replace(' ', '-', strtolower( $block['title'] )) . '.twig', $context );\n\t\t\t\t},\n\t\t\t\t'category' => 'genlite-blocks',\n\t\t\t\t'icon' => '',\n\t\t\t\t'keywords' => array( $name ),\n\t\t\t\t'mode' \t\t\t => 'edit'\n\t\t\t) );\t\n\t\t}",
"protected function register_block() {\n\t\t$dir = dirname( __FILE__ );\n\n\t\t$script_asset_path = \"$dir/build/index.asset.php\";\n\t\tif ( ! file_exists( $script_asset_path ) ) {\n\t\t\tthrow new Error(\n\t\t\t\t'You need to run `npm start` or `npm run build` for the \"sudar/wp-plugin-review-block\" block first.'\n\t\t\t);\n\t\t}\n\t\t$index_js = 'build/index.js';\n\t\t$script_asset = require( $script_asset_path );\n\t\twp_register_script(\n\t\t\t'wp-plugin-review-block-editor',\n\t\t\tplugins_url( $index_js, __FILE__ ),\n\t\t\t$script_asset['dependencies'],\n\t\t\t$script_asset['version']\n\t\t);\n\t\twp_set_script_translations( 'wp-plugin-review-block-editor', 'wp-plugin-reviews' );\n\n\t\t$editor_css = 'build/index.css';\n\t\twp_register_style(\n\t\t\t'wp-plugin-review-block-editor',\n\t\t\tplugins_url( $editor_css, __FILE__ ),\n\t\t\tarray(),\n\t\t\tfilemtime( \"$dir/$editor_css\" )\n\t\t);\n\n\t\t$style_css = 'build/style-index.css';\n\t\twp_register_style(\n\t\t\t'create-block-review-block-block',\n\t\t\tplugins_url( $style_css, __FILE__ ),\n\t\t\tarray(),\n\t\t\tfilemtime( \"$dir/$style_css\" )\n\t\t);\n\n\t\tregister_block_type( 'sudar/wp-plugin-review-block', array(\n\t\t\t'editor_script' => 'wp-plugin-review-block-editor',\n\t\t\t'editor_style' => 'wp-plugin-review-block-editor',\n\t\t\t'style' => 'wp-plugin-review-block',\n\t\t\t'render_callback' => [ $this, 'get_plugin_reviews_render_callback' ]\n\t\t) );\n\t}",
"public function co_profile_link_block_register(): void {\n\n\t\twp_register_script(\n\t\t\t'co_profile_link_block_editor_script',\n\t\t\t$this->plugin_url . 'dist/editor-output.js',\n\t\t\tarray( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor', 'wp-components','wp-edit-post', 'wp-plugins' )\n\t\t);\n\n\t\tregister_block_type(\n\t\t\t'co/profile-link',\n\t\t\tarray(\n\t\t\t\t'editor_script' => 'co_profile_link_block_editor_script'\n\t\t\t)\n\t\t);\n\n\t}",
"function gutenberg_examples_01_register_block()\r\n{\r\n wp_register_script('gutenberg-examples-01', get_stylesheet_directory_uri('/js/block.js', __FILE__), array(\r\n 'wp-blocks',\r\n 'wp-element',\r\n ));\r\n\r\n register_block_type('gutenberg-examples/example-01-basic', array(\r\n 'editor_script' => 'gutenberg-examples-01',\r\n ));\r\n}",
"function gutenberg_register_block_widget() {\n\tglobal $pagenow;\n\n\tregister_widget( 'WP_Widget_Block' );\n\n\t// By default every widget on widgets.php is wrapped with a <form>. This\n\t// means that you can sometimes end up with invalid HTML, e.g. when one of\n\t// the widgets is a Search block. To fix the problem, let's add a filter\n\t// that moves the form below the actual widget content.\n\tif ( 'widgets.php' === $pagenow ) {\n\t\tadd_filter(\n\t\t\t'dynamic_sidebar_params',\n\t\t\t'gutenberg_override_sidebar_params_for_block_widget'\n\t\t);\n\t}\n}",
"protected function registerBlocks()\n {\n $this->app->make('streams.addon.manager')->register('block');\n }",
"function acf_handle_json_block_registration($settings, $metadata)\n{\n}",
"public function saveFeedBlock()\n\t{\n\t\t$this->initFormFeedBlock(IL_FORM_CREATE);\n\t\tif ($this->form_gui->checkInput())\n\t\t{\n\t\t\t$this->external_feed_block = new ilExternalFeedBlock();\n\t\t\t$this->external_feed_block->setTitle($this->form_gui->getInput(\"block_title\"));\n\t\t\t$this->external_feed_block->setFeedUrl($this->form_gui->getInput(\"block_feed_url\"));\n\t\t\t$this->prepareSaveFeedBlock($this->external_feed_block);\n\t\t\t$this->external_feed_block->create();\n\t\t\t$this->exitSaveFeedBlock();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_gui->setValuesByPost();\n\t\t\treturn $this->form_gui->getHtml();\n\t\t}\n\n\t}",
"private function register_block($block_name)\n {\n }",
"function wfBlockCacheInsert( $block, $tag ) {\n\tglobal $wgBlockCache;\n\t$wgBlockCache->insert( $block );\n}",
"abstract public static function register_block_type(): void;",
"public function registerBlockPattern(): void\n\t{\n\t\t\\register_block_pattern(\n\t\t\t$this->getName(),\n\t\t\t[\n\t\t\t\t'title' => $this->getTitle(),\n\t\t\t\t'description' => $this->getDescription(),\n\t\t\t\t'content' => $this->getContent(),\n\t\t\t\t'categories' => $this->getCategories(),\n\t\t\t\t'keywords' => $this->getKeywords(),\n\t\t\t]\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pdfcrowd constructor. $username your username at Pdfcrowd $apikey your API key $hostname API hostname, defaults to pdfcrowd.com | function __construct($username, $apikey, $hostname=null){
if ($hostname)
$this->hostname = $hostname;
else
$this->hostname = self::$api_host;
$this->useSSL(false);
$this->fields = array(
'username' => $username,
'key' => $apikey,
'pdf_scaling_factor' => 1,
'html_zoom' => 200);
$this->proxy_name = null;
$this->proxy_port = null;
$this->proxy_username = "";
$this->proxy_password = "";
$this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";
} | [
"public function __construct() {\n\t\t//Set up cURL.\n\t\t$this->setupCURL();\n\n\t\t//Login.\n\t\t$this->login();\n\t}",
"public function __construct($username){\n\t\t$data = $this->person_getData($username);\n\t\t$this->person_setData($data);\n\t}",
"function __construct($api_key)\n {\n \\Tinify\\setKey($api_key);\n }",
"function __construct($api_user, $api_pass, $api_url = \"\", $sender_fax = null, $sender_email = null){\n $this->api_user = $api_user;\n $this->api_pass = $api_pass;\n if(!empty($api_url)) {\n $this->api_url = $api_url;\n } else {\n $this->api_url = 'https://www.srfax.com/SRF_SecWebSvc.php';\n }\n $this->sender_fax = $sender_fax;\n $this->sender_email = $sender_email;\n }",
"public function __construct()\n\t{\n\t\t$this->apiObject = new CurlController();\n\t}",
"public function __construct() {\n $this->key = config('indodax.api_key');\n $this->secret = config('indodax.secret_key');\n $this->url = config('indodax.private_api_url');\n $this->curl = curl_init();\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this->curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; INDODAXCOM PHP client;' . php_uname('s') . '; PHP/' . phpversion() . ')');\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n }",
"public function __construct($username, $password)\n {\n $this->client = new SWORDClient();\n $this->username = $username;\n $this->password = $password;\n }",
"function __construct($subdomain, $api_key) {\n $this -> api_key = $api_key;\n $this -> curl = curl_init();\n #nurodom autentifikacijos buda\n curl_setopt($this -> curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n #autentifikacijos duomenys\n curl_setopt($this -> curl, CURLOPT_USERPWD, $subdomain . \":\" . $this -> api_key);\n #paprasom, kad su rezultatu grazintu ir headerius. Testavimo sumetimais.\n curl_setopt($this -> curl, CURLOPT_HEADER, false);\n #su uzklausa siunciam ir siokius tokius duomenis apie save. Bendrinei statistikai\n curl_setopt($this -> curl, CURLOPT_USERAGENT, \"PHP\".phpversion().\"/Dezutes \".$this -> version);\n #paprasom, kad geriau rezultata grazintu, o ne tik ji atspausdintu\n curl_setopt($this -> curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this -> curl, CURLOPT_CONNECTTIMEOUT, 10);\n }",
"private function initPdf()\n {\n if ( is_object( $this->pdf ) )\n {\n return;\n }\n\n $path2lib = t3lib_extMgm::extPath( 'caddy' ) . 'Resources/Private/Lib/';\n\n require_once( $path2lib . 'pdf/class.tx_caddy_pdf.php' );\n $this->pdf = t3lib_div::makeInstance( 'tx_caddy_pdf' );\n\n // DRS\n if ( $this->drs->drsSession || $this->drsUserfunc )\n {\n $this->pdf->drsUserfunc = true;\n $prompt = __METHOD__ . ': PDF object is initiated.';\n t3lib_div::devlog( '[INFO/USERFUNC] ' . $prompt, $this->extKey, 0 );\n }\n // DRS\n }",
"public function init()\n {\n $this->curl = (new Curl())->setOption(\n CURLOPT_HTTPHEADER, [\n 'Authorization: Basic ' . $this->apiKey,\n 'Content-Type: application/json'\n ]\n );\n }",
"public function __construct($username = false,$password = false)\n\t{\n\t\tif ($username !== false && $password !== false) {\n\t\t\t$this->ClientLogin($username,$password);\n\t\t}\n\t}",
"function __construct() {\n\t\t$this->cookie_file = dirname(__FILE__).DIRECTORY_SEPARATOR.'curl_cookie.txt';\n\t\t$this->user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'Curl/PHP '.PHP_VERSION.' (http://github.com/shuber/curl)';\n\t}",
"function ContinusecClient($account, $apiKey, $baseUrl=\"https://api.continusec.com\") {\n\t\t$this->account = $account;\n\t\t$this->apiKey = $apiKey;\n\t\t$this->baseUrl = $baseUrl;\n\t}",
"public function __construct()\n {\n $this->url = config('ipboard.api_url');\n $this->key = config('ipboard.api_key');\n $this->reference = config('ipboard.api_reference_name');\n\n $this->httpRequest = new HttpClient([\n 'base_uri' => $this->url,\n 'timeout' => 2.0,\n 'defaults' => [\n 'auth' => [$this->key, ''],\n ],\n 'auth' => [$this->key, ''],\n ]);\n }",
"public function __construct()\n\t{\n\t\trequire_once Kohana::find_file('vendor', 'autoload');\n\t\t$config = Kohana::$config->load('recaptcha');\n\t\t$this->_public_key = $config['public_key'];\n\t\t$this->_private_key = $config['private_key'];\n\t}",
"public function __construct($username,$password,$orgname){\r\n\t\t//Note the orgname should be whatever the LegalServer subdomain is xxxx.legalserver.org\r\n\t\t$this->username = $username;\r\n\t\t$this->password = $password;\r\n\t\t$this->orgname = $orgname;\r\n\t}",
"protected function initDocInfo()\n {\n $pdf = $this->getPdf();\n \n $pdf->SetTitle('IRC Certificate');\n $pdf->SetSubject('IRC Education Certificate');\n $pdf->SetAuthor('IRC Education Management System');\n $pdf->SetKeywords('x, y, z');\n }",
"public function __construct($username, $password,\n $version = \"v1\",\n $endpoint = \"https://api.icecharge.com\") {\n\n $this->AccountID = $username;\n $this->APIKey = $password;\n $this->APIVersion = $version;\n $this->EndPoint = $endpoint;\n }",
"protected function __construct()\n {\n // First things first, if the framework user has specified a default realm to use,\n // we should use it.\n if(is_string(c('default_realm')))\n {\n $this->realm = c('default_realm');\n }\n // Grab all the data we can from PHP_AUTH_DIGEST.\n // Two things could be happening here; the user might or might not be logged in right now.\n if(empty($_SERVER['PHP_AUTH_DIGEST']))\n {\n // Nope, the user has not logged in yet. Do nothing.\n return;\n }\n $this->data = $this->_parse($_SERVER['PHP_AUTH_DIGEST']);\n if(is_array($this->data) && isset($this->data['username']))\n {\n $this->user = $this->data['username'];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes the traslation microsopts translation api using SoapClient | public function Translate(){
$this->client = new SoapClient("http://api.microsofttranslator.com/V2/SOAP.svc");
$this->params = array();
$this->params['appId'] = 'EB9252F60397E993D55440BE38379FAC7721ADB4';
} | [
"public function initTranslations();",
"function __construct(){\n\t\t\t$this->clientNuSoap = new nusoap_client(static::uriWsdl,'wsdl','','','','');\n\t\t\t$this->clientNuSoap->soap_defencoding = 'UTF-8';\n\t\t\t$this->clientNuSoap->decode_utf8 = FALSE;\n\t\t\t/* 2 . Client con SoapClient nativo php */\n\t\t\t$this->clientSoap = new SoapClient(static::uriWsdl);\n\t\t}",
"function __construct() {\r\n\t\t$this->serviceSetting =& new TranslationServiceSetting();\r\n\t}",
"private function _setupClient()\n {\n $this->_client = new Client([\n 'base_uri' => 'https://sms.bitnet.hu/api/v1/'\n ]);\n }",
"protected function __construct() { \n\t\t$this->wsdl = \t\"https://www.crcind.com/csp/samples/SOAP.Demo.CLS?WSDL\";\n\t\t$this->client = \tnew SoapClient($this->wsdl, array('trace'=>1)); \n\t}",
"protected function _initTranlate(){\n //Zend_Registry::set('trans', $translate);\n $locale = new Zend_Locale('pt_BR');\n Zend_Registry::set('Zend_Locale',$locale);\n \n \n }",
"public function __construct(){\n\t\t$this->client = new SoapClient(null, array(\t'location' \t=> ORWELL_BANKSEARCH_URL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'uri'\t\t=> ORWELL_PROTOCOL.'://'.ORWELL_DOMAIN.'/axis/services/OrwellInputAssistantV1_2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'style'\t\t=> 'document',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'use' \t\t=> 'literal' ));\n\t}",
"public static function initialize() {\n\t\tself::$instance = new Translate();\n\t}",
"public function _initTranslate()\n {\n $translate = new Zend_Translate(array(\n 'adapter' => 'gettext',\n 'content' => APPLICATION_PATH . '/translations/',\n 'scan' => Zend_Translate::LOCALE_FILENAME,\n 'disableNotices'=> true\n ));\n \n // load in registry\n Zend_Registry::set('Zend_Translate', $translate);\n }",
"public function _initTranslate() {\n// $translator = new Zend_Translate(array('adapter' => 'array', 'content' => '../library/translate', 'locale' => 'pt_BR', 'scan' => Zend_Translate::LOCALE_DIRECTORY));\n// Zend_Validate_Abstract::setDefaultTranslator($translator);\n }",
"public function __construct(){\n $this->client = new Twilio\\Rest\\Client($this->sid,$this->token);\n }",
"private function init() {\n if(is_object($this->client)) return;\n try {\n // Подключаемся к серверу\n $this->client = new SoapClient(self::SERVICE_LINK);\n\n //Авторизируемся на сервере для получения данных авторизации\n $this->client->Auth(array('login'=>self::SERVICE_LOGIN, 'password'=>self::SERVICE_PASSWORD));\n\n // Получаем количество доступных кредитов\n $result = $this->client->GetCreditBalance();\n\n // Записываем количество кредитов на текущий момент\n $this->credits = intval($result->GetCreditBalanceResult);\n\n } catch (SoapFault $fault) {\n trigger_error(\"SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})\", E_USER_ERROR);\n }\n }",
"function translate() {\n $this->load->library('svc_system', NULL, 'svc');\n $this->svc->run();\n exit;\n }",
"public function __construct()\n {\n $this->translations = new ArrayCollection();\n }",
"protected function getWordproofTranslationsService()\n {\n }",
"public function load_translations()\n\t{\n\t\t$this->translations\n\t\t\t->configure(ext::TITANIA_TRANSLATION, $this->revision_id)\n\t\t\t->load()\n\t\t;\n\t}",
"function fetch_transcribeclient() {\n global $CFG;\n\n if (!$this->transcribeclient) {\n $config = array();\n $config['region'] = $this->region;\n $config['version'] = '2017-10-26';\n $config['credentials'] = array('key' => $this->accesskey, 'secret' => $this->secretkey);\n //add proxy settings if necessary\n if (!empty($CFG->proxyhost)) {\n $proxy = $CFG->proxytype . '://' . $CFG->proxyhost;\n if ($CFG->proxyport > 0) {\n $proxy = $proxy . ':' . $CFG->proxyport;\n }\n if (!empty($CFG->proxyuser)) {\n $proxy = $CFG->proxyuser . ':' . $CFG->proxypassword . '@' . $proxy;\n }\n $config['http'] = array('proxy' => $proxy);\n\n }\n\n $this->transcribeclient = TranscribeServiceClient::factory($config);\n }\n return $this->transcribeclient;\n }",
"public function __construct() {\r\n\t\t/* initialize framework */\r\n\t\ttx_auxo::bootstrap($this);\t\t\r\n\t}",
"private function loadTranslations()\n {\n $key = $this->getKeyFilters();\n\n $adapter = $this->_translator->getAdapterFor(static::class);\n $options = isset($adapter['options']) ? $adapter['options'] : null;\n $class = $adapter['manager'];\n $this->__translations = $class::retrieve($this, $key, $options);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test simple clear assign | public function testClearAssign()
{
$this->smarty->error_reporting = error_reporting() & ~(E_NOTICE|E_USER_NOTICE);
$this->smarty->clearAssign('blar');
$this->assertEquals('foobar', $this->smarty->fetch('eval:{$foo}{$bar}{$blar}'));
} | [
"public function testClear()\n {\n $this->object->clear();\n }",
"public function testObjectAssignmentsDelete()\n {\n }",
"abstract public function clearAssignments();",
"function clear_all_assign() {\n\n $this->values = array();\n\n }",
"public function testRemoveAll()\n {\n \t$this->object->removeAll($this->object);\n }",
"public function testAcquisitionAssignmentsUndelete()\n {\n }",
"public function testUnsetExists()\n\t\t{\n\t\t\t$data = $this->getData();\n\t\t\tunset($data->test2);\n\t\t\t$this->assertEquals(NULL, $data->test2);\n\t\t}",
"public function testUnassignStoreFromChannel()\n {\n }",
"function clear(){ $this->__val = array();}",
"public function testOffsetSetUnset()\n {\n $assignment = new Assignment($this->tester_salt);\n $this->assertFalse(isset($assignment->foo));\n $assignment->foo = 5;\n $this->assertTrue(isset($assignment->foo));\n unset($assignment->foo);\n $this->assertFalse(isset($assignment->foo));\n }",
"function ClearAssign($tpl_var)\n {\n $this->_smarty->clear_assign( $tpl_var );\n }",
"function clear_assign($tpl_var)\n {\n $this->smarty->clearAssign( $tpl_var );\n }",
"public function _clear(){\n foreach($this as $key => $val) $this->{$key} = null;\n }",
"public function test_can_clear_collection(): void {\n\t\t$initial_data = array( 1, 2, 3, 4 );\n\t\t$collection = Collection::from( $initial_data );\n\t\t$this->assertEquals( 4, $collection->count() );\n\t\t$collection->clear();\n\t\t$this->assertEmpty( $collection );\n\t}",
"public function testProjectAssignmentsUndelete()\n {\n }",
"public function testUnassignCallingPlan()\n {\n }",
"public function testStorageClean()\n {\n $this->assertTrue($this->oInstance->cleanStore());\n $this->assertFalse($this->oInstance->store('sampleVar'));\n }",
"public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}",
"public function unAssign()\n {\n $this->fileHandle = null;\n $this->columns = null;\n $this->isInitialized = false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal CrossReference function for all VOID, REFUND, COLLECTION transaction types | private function _runCrossReferenceTransaction(Varien_Object $payment, $szTransactionType, $amount = false)
{
$error = false;
$boTransactionProcessed = false;
$PaymentProcessorFullDomain;
$rgeplRequestGatewayEntryPointList;
$crtCrossReferenceTransaction;
$crtrCrossReferenceTransactionResult;
$todTransactionOutputData;
$szMerchantID = $this->getConfigData('merchantid');
$szPassword = $this->getConfigData('password');
//
$iclISOCurrencyList = PYS_ISOCurrencies::getISOCurrencyList();
$szAmount;
$nAmount;
$szCurrencyShort;
$iclISOCurrencyList;
$power;
$nDecimalAmount;
$szNewCrossReference;
$order = $payment->getOrder();
$szOrderID = $order->getRealOrderId();;
//$szCrossReference = $payment->getLastTransId();
$additionalInformation = $payment->getAdditionalInformation();
$szCrossReference = $additionalInformation["CrossReference"];
$szCrossReference = $payment->getLastTransId();
// check the CrossRference and TransactionType parameters
if(!$szCrossReference)
{
$error = 'Error occurred for '.$szTransactionType.': Missing Cross Reference';
}
if(!$szTransactionType)
{
$error = 'Error occurred for '.$szTransactionType.': Missing Transaction Type';
}
if($error === false)
{
$PaymentProcessorFullDomain = $this->_getPaymentProcessorFullDomain();
$rgeplRequestGatewayEntryPointList = new PYS_RequestGatewayEntryPointList();
$rgeplRequestGatewayEntryPointList->add("https://gw1.".$PaymentProcessorFullDomain, 100, 2);
$rgeplRequestGatewayEntryPointList->add("https://gw2.".$PaymentProcessorFullDomain, 200, 2);
$rgeplRequestGatewayEntryPointList->add("https://gw3.".$PaymentProcessorFullDomain, 300, 2);
$crtCrossReferenceTransaction = new PYS_CrossReferenceTransaction($rgeplRequestGatewayEntryPointList);
$crtCrossReferenceTransaction->getMerchantAuthentication()->setMerchantID($szMerchantID);
$crtCrossReferenceTransaction->getMerchantAuthentication()->setPassword($szPassword);
// if no amount is specified get the grand total amount
if($amount === false)
{
$nAmount = $order->getBaseGrandTotal();
}
else
{
$nAmount = $amount;
}
$szCurrencyShort = $order->getOrderCurrency()->getCurrencyCode();
if ($szCurrencyShort != '' &&
$iclISOCurrencyList->getISOCurrency($szCurrencyShort, $icISOCurrency))
{
$nCurrencyCode = new PYS_NullableInt($icISOCurrency->getISOCode());
$crtCrossReferenceTransaction->getTransactionDetails()->getCurrencyCode()->setValue($icISOCurrency->getISOCode());
}
// round the amount before use
$nAmount = round($nAmount, $icISOCurrency->getExponent());
$power = pow(10, $icISOCurrency->getExponent());
$nDecimalAmount = $nAmount * $power;
$crtCrossReferenceTransaction->getTransactionDetails()->setOrderID($szOrderID);
$crtCrossReferenceTransaction->getTransactionDetails()->getAmount()->setValue($nDecimalAmount);
$crtCrossReferenceTransaction->getTransactionDetails()->getMessageDetails()->setCrossReference($szCrossReference);
$crtCrossReferenceTransaction->getTransactionDetails()->getMessageDetails()->setTransactionType($szTransactionType);
try
{
$boTransactionProcessed = $crtCrossReferenceTransaction->processTransaction($crtrCrossReferenceTransactionResult, $todTransactionOutputData);
}
catch (Exception $exc)
{
Mage::log("exception: ".$exc->getMessage());
}
if ($boTransactionProcessed == false)
{
// could not communicate with the payment gateway
$error = "Couldn't complete ".$szTransactionType." transaction. Details: ".$crtCrossReferenceTransaction->getLastException();
$szLogMessage = $error;
}
else
{
switch($crtrCrossReferenceTransactionResult->getStatusCode())
{
case 0:
$error = false;
$szNewCrossReference = $todTransactionOutputData->getCrossReference();
$szLogMessage = $szTransactionType . " CrossReference transaction successfully completed. Response object: ";
$payment->setTransactionId($szNewCrossReference)
->setParentTransactionId($szCrossReference)
->setIsTransactionClosed(1);
$payment->save();
break;
default:
$szLogMessage = $crtrCrossReferenceTransactionResult->getMessage();
if ($crtrCrossReferenceTransactionResult->getErrorMessages()->getCount() > 0)
{
$szLogMessage = $szLogMessage.".";
for ($LoopIndex = 0; $LoopIndex < $crtrCrossReferenceTransactionResult->getErrorMessages()->getCount(); $LoopIndex++)
{
$szLogMessage = $szLogMessage.$crtrCrossReferenceTransactionResult->getErrorMessages()->getAt($LoopIndex).";";
}
$szLogMessage = $szLogMessage." ";
}
$error = "Couldn't complete ".$szTransactionType." transaction for CrossReference: " . $szCrossReference . ". Payment Response: ".$szLogMessage;
$szLogMessage = $szTransactionType . " CrossReference transaction failed. Response object: ";
break;
}
$szLogMessage = $szLogMessage.print_r($crtrCrossReferenceTransactionResult, 1);
}
Mage::log($szLogMessage);
}
return $error;
} | [
"function fn_return_state_committed($return_info, $order_info,$status_from)\n{\n\n $AvaTaxDocumentStatus = fn_get_avatax_return_status();\n $TaxHistoryReturnValue = fn_avatax_tax_calculation_avatax_gettax_history($order_info);\n if (trim($AvaTaxDocumentStatus[$status_from]) == \"Committed\") {\n //1. Call CancelTax with CancelCode = Voided\n $DocVoidedReturn = fn_avatax_tax_calculation_avatax_canceltax($return_info['avatax_return_document_code'], \"DocVoided\", \"ReturnInvoice\");\n\n if($DocVoidedReturn == 'Success'){\n //2. Call CancelTax with CancelCode = DocDeleted\n $DocDeletedReturn = fn_avatax_tax_calculation_avatax_canceltax($return_info['avatax_return_document_code'], \"DocDeleted\", \"ReturnInvoice\");\n\n //3. Call GetTax with Commit = False\n $DocCommittedReturn = fn_avatax_tax_calculation_avatax_return_invoice($return_info, $order_info, $TaxHistoryReturnValue);\n }\n } else if (trim($AvaTaxDocumentStatus[$status_from]) == \"Voided\") {\n //1. Call CancelTax with CancelCode = DocDeleted\n $DocDeletedReturn = fn_avatax_tax_calculation_avatax_canceltax($return_info['avatax_return_document_code'], \"DocDeleted\", \"ReturnInvoice\");\n\n if($DocDeletedReturn == 'Success'){\n //2. Call GetTax with Commit = False\n $DocCommittedReturn = fn_avatax_tax_calculation_avatax_return_invoice($return_info, $order_info, $TaxHistoryReturnValue);\n }\n } else if (trim($AvaTaxDocumentStatus[$status_from]) == \"Uncommitted\") {\n //1. Call GetTax with Commit = True\n $DocCommittedReturn = fn_avatax_tax_calculation_avatax_return_invoice($return_info, $order_info, $TaxHistoryReturnValue);\n \n \n }\n}",
"public function testRefundMultiDocumentTransaction()\n {\n }",
"abstract function supportsTransactions();",
"public function supports_transactions ();",
"public function testVoidMultiDocumentTransaction()\n {\n }",
"function transactionTypes() {\r\n\t\treturn array(\t'1'\t=> 'Plan Purchase',\r\n\t\t\t\t\t\t'2' => 'Plan Renewal Auto Payment',\r\n\t\t\t\t\t\t'3' => 'Subscriptions' );\r\n\t}",
"public function callDoReferenceTransaction()\n {\n $request = $this->_exportToRequest($this->_doReferenceTransactionRequest);\n $this->_exportLineItems($request);\n $response = $this->call('DoReferenceTransaction', $request);\n $this->_importFromResponse($this->_doReferenceTransactionResponse, $response);\n }",
"public function testFetchRefundedVouchers()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function testTrxsIdTrxNullificationGet()\n {\n }",
"public function getTransactionReference()\n {\n $reference = array();\n $reference['VendorTxCode'] = $this->getRequest()->getTransactionId();\n\n foreach (array('SecurityKey', 'TxAuthNo', 'VPSTxId') as $key) {\n $value = $this->{'get' . $key}();\n if ($value !== null) {\n $reference[$key] = $value;\n }\n }\n\n ksort($reference);\n\n return json_encode($reference);\n }",
"function dataDefinitionIgnoredInTransactions(){\r\n\t\tdie('Not implemented');\r\n\t}",
"public function canRefund()\n {\n }",
"public function isUnderTransaction(){ }",
"function transactionResult() {\n }",
"function add_bank_transaction($trans_type, $from_account, $items, $date_,\n\t$person_type_id, $person_id, $person_detail_id,\t$ref, $memo_, $use_transaction=true)\n{\n\tglobal $Refs;\n\n\t// we can only handle type 1 (payment)and type 2 (deposit)\n\tif ($trans_type != ST_BANKPAYMENT && $trans_type != ST_BANKDEPOSIT)\n\t\tdisplay_db_error(\"Invalid type ($trans_type) sent to add_bank_transaction\");\n\n\t$do_exchange_variance = false;\n\t\n\tif ($use_transaction)\n\t\tbegin_transaction();\n\n\t$currency = get_bank_account_currency($from_account);\n\t$bank_gl_account = get_bank_gl_account($from_account);\n\n\t// the gl items are already inversed/negated for type 2 (deposit)\n\t$total_amount = $items->gl_items_total();\n\n if ($person_type_id == PT_CUSTOMER)\n {\n \t// we need to add a customer transaction record\n\n\t\t// convert to customer currency\n\t\t$cust_amount = exchange_from_to($total_amount, $currency, get_customer_currency($person_id), $date_);\n\t\t// we need to negate it too\n\t\t$cust_amount = -$cust_amount;\n\n\t\t$trans_no = write_customer_trans($trans_type, 0, $person_id, $person_detail_id, $date_,\n \t$ref, $cust_amount);\n\n }\n elseif ($person_type_id == PT_SUPPLIER)\n {\n \t// we need to add a supplier transaction record\n\t\t// convert to supp currency\n\t\t$supp_amount = exchange_from_to($total_amount, $currency, get_supplier_currency($person_id), $date_);\n\n\t\t// we need to negate it too\n\t\t$supp_amount = -$supp_amount;\n\n\t\t$trans_no = add_supp_trans($trans_type, $person_id, $date_, '',\n \t\t$ref, \"\", $supp_amount, 0, 0);\n\n }\n else\n {\n \t$trans_no = get_next_trans_no($trans_type);\n \t$do_exchange_variance = true;\n }\n\n\t// do the source account postings\n\n add_bank_trans($trans_type, $trans_no, $from_account, $ref,\n \t$date_, -$total_amount,\n \t$person_type_id, $person_id,\n \t$currency,\n \t\"Cannot insert a source bank transaction\");\n\t$total = 0;\n\tforeach ($items->gl_items as $gl_item)\n\t{\n\t\t$is_bank_to = is_bank_account($gl_item->code_id);\n\n\t\tif ($trans_type == ST_BANKPAYMENT AND $is_bank_to)\n\t\t{\n\t\t\t// we don't allow payments to go to a bank account. use transfer for this !\n\t\t\tdisplay_db_error(\"invalid payment entered. Cannot pay to another bank account\", \"\");\n\t\t}\n\n \t// do the destination account postings\n \t$total += add_gl_trans($trans_type, $trans_no, $date_, $gl_item->code_id,\n \t\t$gl_item->dimension_id, $gl_item->dimension2_id, $gl_item->reference,\n \t\t$gl_item->amount, $currency, $person_type_id, $person_id);\n\n \tif ($is_bank_to)\n \t{\n \t\tadd_bank_trans($trans_type, $trans_no, $is_bank_to, $ref,\n \t\t\t$date_, $gl_item->amount,\n \t\t\t$person_type_id, $person_id, $currency,\n \t\t\t\"Cannot insert a destination bank transaction\");\n \t\tif ($do_exchange_variance)\n \t\t\tadd_exchange_variation($trans_type, $trans_no, $date_, $is_bank_to, $gl_item->code_id, \n \t\t\t\t$currency, $person_type_id, $person_id);\n \t}\n\t\t// store tax details if the gl account is a tax account\n\n\t\t$amount = $gl_item->amount;\n\t\t$ex_rate = get_exchange_rate_from_home_currency($currency, $date_);\n\t\t\t\n\t\tadd_gl_tax_details($gl_item->code_id, $trans_type, $trans_no, -$amount,\n\t\t\t$ex_rate, $date_, $memo_);\n\t}\n\n\t// do the source account postings\n add_gl_trans($trans_type, $trans_no, $date_, $bank_gl_account, 0, 0, $memo_,\n \t-$total, null, $person_type_id, $person_id);\n\n if ($do_exchange_variance)\n \tadd_exchange_variation($trans_type, $trans_no, $date_, $from_account, $bank_gl_account, \n \t\t$currency, $person_type_id, $person_id);\n\n\tadd_comments($trans_type, $trans_no, $date_, $memo_);\n\n\t$Refs->save($trans_type, $trans_no, $ref);\n\tadd_audit_trail($trans_type, $trans_no, $date_);\n\n\tif ($use_transaction)\n\t\tcommit_transaction();\n\n\treturn array($trans_type, $trans_no);\n}",
"private function getCrossReferenceTable() {\n\t\treturn $this->crossReference;\n\t}",
"public function testAccountTransactionsGet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function refund($paymentInfo)\n {\n }",
"function braintreeRefund($tnx_id){\r\n\r\n $id =$tnx_id;\r\n $sqlRefund = \"select * from estejmam_booking where `transaction_id`=\".$tnx_id;\r\n $queryRefund = mysqli_query($link, $sqlRefund);\r\n $bookRefund = mysqli_fetch_array($queryRefund);\r\n\r\n $transaction = Braintree_Transaction::refund($bookRefund['transaction_id'],$bookRefund['total_price']);\r\n\r\n if($transaction->success){\r\n $refundStatus = 1;\r\n }else {\r\n $refundStatus = 0;\r\n }\r\n\r\n return $refundStatus;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Must be implemented function : escape the entity name | abstract function escapeEntity($name); | [
"private function entityName() {\n $entity = $this->match('&') . $this->matchWord();\n if (strlen($entity) === 1) {\n // Invalid entity, escape &\n return htmlspecialchars($entity);\n }\n if ($this->look() === ';') {\n $entity .= $this->match(';');\n } else {\n $entity .= ';';\n }\n return $entity;\n }",
"public function getEntityName();",
"public function entityTitle();",
"private function entityToString($entity)\n {\n return str_replace('&', '', str_replace(';', '', $entity));\n }",
"public function entityName() {\n $name = get_class($this);\n return str_replace([\"_Entity\", \"_Core\"], \"\", $name);\n }",
"function systemEntityName(): string;",
"function entstr($entname, $filename)\r\n{\r\n // If we have no file, than this is not a system entity\r\n if ($filename == \"\") {\r\n return sprintf(\"<!ENTITY %-28s ''>\\n\", $entname);\r\n } else {\r\n return sprintf(\"<!ENTITY %-28s SYSTEM '%s'>\\n\", $entname, strip_cygdrive($filename));\r\n }\r\n}",
"private function repositoryName($entity) {\n return str_replace(array('\\\\', 'Entity'), array('', ':'), $entity);\n }",
"public function getEntityName(): string\n {\n return $this->entityName;\n }",
"public function getTransformEntityName();",
"abstract protected function getEntityNameSingular();",
"protected function getEntityName()\n {\n if ($this->entityName) {\n return $this->entityName;\n }\n\n $class = $this->getClass();\n\n return $this->entityName = substr($class, strrpos($class, '\\\\') + 1);\n }",
"abstract public function getEntityShortcutName();",
"function to_entity()\n {\n }",
"private function entityHex() {\n $entity = $this->matches('&#x', true);\n $entity .= $this->matchHexNumber();\n $len = strlen($entity);\n if ($len <= 3 || $len > 7) {\n // Invalid entity, escape &\n return htmlspecialchars($entity);\n }\n if ($this->look() === ';') {\n $entity .= $this->match(';');\n } else {\n $entity .= ';';\n }\n return $entity;\n }",
"protected function generateAliasFromEntityName()\n {\n if (null !== $this->alias) {\n return $this->alias;\n }\n\n if (false === ($pos = strrpos($this->_entityName, '\\\\'))) {\n return '';\n }\n\n $words = preg_split('/(?=[A-Z])/', substr($this->_entityName, $pos + 1), -1, PREG_SPLIT_NO_EMPTY);\n $alias = '';\n\n foreach ($words as $word) {\n $alias .= strtolower(substr($word, 0, 1));\n }\n\n return $this->alias = $alias;\n }",
"public function getEntityName()\n {\n return $this->entityName;\n }",
"protected function buildEntityName()\n {\n $repositoryClassName = explode( \"\\\\\", get_class( $this ) );\n $entityName = $this->mapperNamespace . str_replace( \"Repository\", \"\", end( $repositoryClassName ) );\n \n // Set entity name\n $this->setEntityName( $entityName );\n }",
"abstract public static function getRelatedEntityName(): string;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return lib of CANCEL button in confirmation popin | public function getConfirmationBtnCancelLib()
{
return $this->_confirmationBtnCancelLib;
} | [
"public function backAndConfirm() {\n $this->getSession()->back();\n $this->iConfirmTheDialog();\n }",
"public function getConfirmText() {\n return $this->t('Delete Credential');\n }",
"public function confirmCancelRequest()\n\t{\n\t\t$ajax \t= Foundry::ajax();\n\n\t\t$id \t= JRequest::getInt( 'id' );\n\n\t\t$theme \t\t= Foundry::themes();\n\t\t$theme->set( 'id' , $id );\n\t\t$contents \t= $theme->output( 'site/profile/dialog.friends.cancel' );\n\n\t\treturn $ajax->resolve( $contents );\n\t}",
"public function getConfirmationMessage();",
"function OKCancelButtons($okValue=' Ok ',$cancelValue='Cancel',$onClick='')\n\t{ \tglobal $oldPage;\n\t\t$svrName=$_SERVER['SERVER_ADDR'];\n\t\t$oldPage=\"http://$svrName\".$oldPage;\n\t\techo \"<tr>\";\n\t\techo \"\t<td></td>\";\n\t\techo \"\t<td>\";\n\t\t//echo \"<input type=submit value=' $okValue '> <input type=submit value='$cancelValue' onClick='history.back(); return false;'>\";\n\t\techo \"<input type=submit value=' $okValue ' onClick='$onClick;'> <input type=button value='$cancelValue' onClick=\\\"window.open('$oldPage','_self')\\\">\";\n\t\techo \"\t</td>\";\n\t\techo \"</tr>\";\n\t}",
"function apply_cancel_button($con,$seeker_id,$ad_no,$company_registration_number,$page_number){\n\n\t\t$connection = $con;\n\n\t\t$button_query = \"SELECT * FROM job_apply WHERE seeker_id = '{$seeker_id}' AND ad_no='{$ad_no}' LIMIT 1\";\n\n\t\t$button_result = mysqli_query($connection,$button_query);\n\n\t\tif ($button_result) {\n\t\t\tif (mysqli_num_rows($button_result)==1) {\n\t\t\t\techo \"<form action=\\\"seekerdashboard-vjob.php?ad-no=$ad_no&p=$page_number\\\" method=\\\"POST\\\" >\";\n\t\t\t\techo \"<input type=\\\"text\\\" name=\\\"ad_no\\\" value=\\\"{$ad_no}\\\" hidden>\";\n\t\t\t\techo \"<a><button id='button' class=\\\"cancel\\\" name='cancel' onclick=\\\"return confirm('Remove Job Application?')\\\"><i class='far fa-meh'></i>Cancel</button></a>\";\n\t\t\t\techo \"</form>\";\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\techo \"<a href=\\\"seekerdashboard-apply-ad.php?ad-no={$ad_no}&crn={$company_registration_number}&p={$page_number}\\\" ><button id='button' onclick=\\\"return confirm('Apply For A Job?')\\\"><i class='far fa-paper-plane'></i>Apply</button></a>\";\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tprintf(mysqli_error($connection));\n\t\t}\n \t}",
"protected function getCancelReturn()\n {\n return $this->cancel_return;\n }",
"public function dialog_confirm(){\n\t\t// for confirmative dialog box\n\t\tif($this -> btn2 == 'close'){\n\t\t\t$text = '$( this ).dialog( \"close\" );';\n\t\t}\n\t\telse{\n\t\t\t$text = $this -> btn2;\n\t\t}\n\t\t?>\n\t\t<div class=\"dialog_confirm\" title=\"<?php echo $this -> title; ?>\">\n\t\t\t<p><?php echo $this -> message; ?></p>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\t\t\t$('.dialog_confirm').dialog({\n\t\t\t\tresizable: false,\n\t\t\t\theight: \"auto\",\n\t\t\t\twidth: 500,\n\t\t\t\tmodal: true,\n\t\t\t\tbuttons: {\n\t\t\t\t\t\"<?php echo $this -> btn1['btn_name'];?>\": function() {\n\t\t\t\t\t\t<?php echo $this -> btn1['btn_function']; ?>\n\t\t\t\t\t},\n\t\t\t\t\t\"<?php echo $this -> btn2;?>\": function() {\n\t\t\t\t\t\t<?php echo $text; ?>\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 cancel()\n\t{\n\t\t$msg = JText::_('COM_JGIVE_PAYMENT_CANCEL_MSG');\n\t\t$link = 'index.php?option=com_jgive&view=donations&layout=my';\n\t\t$this->setRedirect($link, $msg);\n\t}",
"function confirmation() {\n\t\n\n\n}",
"function getCancelButton($action) {\n include_once(\"uifc/CancelButton.php\");\n return new CancelButton($this->page, $action);\n }",
"public function getConfirmInput();",
"public function confirm()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n $issue_id = $this->request->getIntegerParam('issue_id', 0);\n $issue = $this->issueModel->getIssueById($issue_id);\n\n $this->response->html($this->template->render('status:issue/delete', array(\n 'title' => t('Remove issue'),\n 'project_id' => $project['id'],\n 'recovery_plan_id' => $recovery_plan_id,\n 'values' => array('id' => $issue_id),\n 'issue' => $issue\n )));\n }",
"public static function jqueryCancelTrigger($button_id, $cancel_url, $cancel_message=\"\", $config=\"\")\n {\n if ($cancel_message==\"\")\n $cancel_message = \"Are you sure you wish to cancel and return to previous page? (No changes will be saved)\";\n\t\t\t\n if ((isset($config[\"continue_js\"])) && ($config[\"continue_js\"]!=\"\"))\t\n $continue_js = $config[\"continue_js\"];\n else $continue_js = \"window.location = '\".$cancel_url.\"';\\n\";\t\n\t\t\t\n $js_func = \"var confirmCancel = confirm(\\\"\".$cancel_message.\"\\\");\\n\".\n\t\t\t \"if (confirmCancel==true)\\n\".\n\t\t\t \"{\\n\".\n\t\t\t $continue_js.\n\t\t\t \"return false;\\n\".\n\t\t\t \"}\\n\".\n\t\t\t \"else\\n\". \n\t\t\t \"{\\n\".\n\t\t\t \"alert(\\\"Cancel request aborted.\\\");\\n\".\n\t\t\t \"return true;\\n\".\n\t\t\t \"}\\n\".\n\t\t\t \"return true;\\n\";\n\t\t\t\t \n return self::jqueryFunction($button_id, \"click\", $js_func, \"#\");\n }",
"public function clickDialogBoxConfirm() {\n if ($this->getJeedomVersion() == 3)\n $this->waitElemIsClickable(By::xpath(\"//button[@data-bb-handler='confirm']\"))->click();\n else\n $this->waitElemIsClickable(By::xpath(\"//button[contains(@class,'bootbox-accept')]\"))->click(); \n }",
"function fusion_confirm_exit() {\n OutputHandler::addToJQuery(\"\n $('form').change(function() {\n window.onbeforeunload = function() {\n return true;\n }\n $(':button').bind('click', function() {\n window.onbeforeunload = null;\n });\n });\n \");\n }",
"function on_btnClose_clicked(){\n\t\t\t$this->cancel = true;\n\t\t\t$this->dialog_export->destroy();\n\t\t}",
"public static function on_buttonCancel_Clicked(&$sender, &$eventArgs)\n {\n }",
"public function requestaCanceladmin()\n\t{\n\t\t$datas = self::$data;\n\t\t$this->create_history($this->input->post('contract_id'), 7, 'BY ADMIN : ' . html_escape($this->input->post('messagetoBuyer', true)), '');\n\t\t$this->change_contract_status($this->input->post('contract_id'), 7);\n\t\t$invoice_id \t= $this->database->_get_single_data('tbl_contracts', array('contract_id' => $contract_id), 'invoice_id');\n\t\t$this->_change_invoice_status($invoice_id, 3);\n\t\t$this->database->_update_to_table('tbl_disputes', array('status' => 1), array('contract_id' => $this->input->post('contract_id')));\n\t\tif ($datas['settings'][0]['email_notifications'] === '1') {\n\t\t\t$this->email_op->_user_email_notification('accept-cancel', $this->input->post('contract_id'));\n\t\t}\n\t\tredirect($this->session->userdata('url'));\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does the passed data contain valid converttonumeric data? | public function convertToNumericDataIsValid(array $data)
{
$validTypes = array_keys($this->getNumericDataTypes());
return (
isset($data['numeric_convert']['property'])
&& is_numeric($data['numeric_convert']['property'])
&& isset($data['numeric_convert']['type'])
&& in_array($data['numeric_convert']['type'], $validTypes)
);
} | [
"private function isValidData($data) {\n\t\tif (!is_string($data) && !is_int($data) && !is_float($data) && !is_array($data)) {\n\t\t\tthrow new FlintstoneException('Invalid data type');\n\t\t}\n\t\treturn true;\n\t}",
"public function isNumericData($data)\n { \n $errFlag = 1;\n if(preg_match('/^\\d+$/',$data))\n $errFlag = 0;\n return $errFlag;\n }",
"protected function canConvert($data)\n\t{\n\t\treturn is_null($data)\n\t\t\t|| is_string($data)\n\t\t\t|| is_bool($data)\n\t\t\t|| is_float($data)\n\t\t\t|| is_int($data)\n\t\t\t|| is_object($data) && in_array('__toString', get_class_methods($data));\n\t}",
"function isDataValid()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"function ValidateNumber($data)\n\t{\n\t\tif(is_numeric($data))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"private function is_valid_number($data) {\n $data = trim($data);\n if(is_numeric($data)) {\n return $data;\n } else {\n return false;\n }\n }",
"function isValidExpression($data) {\n\t$result = false;\n\tif (preg_match(\"/^\\d+.?\\d*$/\", $data)) {\n\t\t$result = true;\n\t}\n\treturn $result;\n}",
"private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t'id_gastos_iniciales' => 1,\n\t\t\t'id_factura_pagos' => 1,\n\t\t\t'valor' => 1,\n\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}",
"function isValidType($data);",
"function isValidNmea ($data)\n{\n\tif ($data['type'] == 'GPRMC' && $data['status'] == 'V')\n\t{\n\t\treturn False; // Invalid GPRMC\n\t}\n\tif ($data['type'] == 'GPGGA' && $data['fix'] == '0')\n\t{\n\t\treturn False; // Invalid GPGGA\n\t}\n\treturn True;\n}",
"function validarNumber($elDato)\r\n{\r\n\t$val = FALSE;\r\n\t$dato = numberNotAdmited();\r\n\t\r\n\tfor($i = 0; $i < count($dato); $i++)\r\n\t{\r\n\t\t$posicion = strpos(strval($elDato), strval($dato[$i]));\r\n\t\t\r\n\t\tif($posicion !== FALSE)\r\n\t\t\t$val = TRUE;\r\n\t}\r\n\t\r\n\treturn $val;\r\n}",
"public function validateISO() {\n return $this->_valid['mti'] && $this->_valid['bitmap'] && $this->_valid['data'];\n }",
"public function isCharData($data)\n\t{\t\n\t\t$errFlag\t\t= 1;\n\t\tif(preg_match('/^[a-zA-Z.,-\\s]+$/i',$data))\n\t\t $errFlag\t\t= 0;\n\t\treturn $errFlag;\n\t}",
"function isInt($data){\n return (preg_match(\"/^-?\\d+$/\",$data));\n }",
"function validaDataSimplesBR($data) {\n $dataex = explode(\"-\", $data);\n $dDia = $dataex[0];\n $dMes = $dataex[1];\n $dAno = $dataex[2];\n\n //echo $dataex[0]\n\n if (checkdate($dMes, $dDia, $dAno) == \"1\") {\n return true;\n } else {\n return false;\n }\n}",
"function validateData() {}",
"function checkSpecialRateValidate($data)\r\n {\r\n if(isset($data['BankID'])&&!unsigned($data['BankID'])) return 13065;\r\n if(isset($data['StockID'])&&!unsigned($data['StockID'])) return 13072;\r\n if(isset($data['FromValue'])&&(strlen($data['FromValue'])>0)&&!numeric($data['FromValue'])) return 13066;\r\n if(isset($data['ToValue'])&&(strlen($data['ToValue'])>0)&&!numeric($data['ToValue'])) return 13067;\r\n if(isset($data['FromValue']) && (isset($data['ToValue'])) && ($data['FromValue']>$data['ToValue'])) return 13073;\r\n if(isset($data['PercentRate'])&&(strlen($data['PercentRate'])>0)&&!numeric($data['PercentRate'])) return 13068;\r\n if(isset($data['UseMarketPrice'])&&(strlen($data['UseMarketPrice'])>0)&&!numeric($data['UseMarketPrice'])) return 13069;\r\n if(isset($data['CreatedBy']) &&!required($data['CreatedBy'])) return 13070;\r\n if(isset($data['UpdatedBy']) &&!required($data['UpdatedBy'])) return 13071;\r\n return 0;\r\n }",
"function isValidPhoneFormat($data) {\n\n $phone_no = isset($data['vc_cell_no2']) ? $data['vc_cell_no2'] : isset($data['vc_cell_no']) ? $data['vc_cell_no'] : '';\n\n $errors = array();\n\n if (empty($phone_no)) {\n\n $errors [] = \"Please enter Phone Number\";\n } else if (!preg_match('/^[(]{0,1}[0-9]{3}[)]{0,1}[-\\s.]{0,1}[0-9]{3}[-\\s.]{0,1}[0-9]{4}$/', $phone_no)) {\n $errors [] = \"Please enter valid Phone Number\";\n }\n\n if (!empty($errors))\n return implode(\"\\n\", $errors);\n\n return true;\n }",
"public function isValid()\n {\n return ((!empty($this->hex) && ctype_xdigit($this->hex)) && (!empty($this->dec) && ctype_digit($this->dec)));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ save the user data in cookie. | function storeInCookie($user_profile_data){
global $cookie;
$cookie->login_radius_data =serialize($user_profile_data);
} | [
"function user_save_profile()\r\n{\r\n global $CONFIG, $USER, $HTTP_SERVER_VARS;\r\n\r\n $data = base64_encode(serialize($USER));\r\n setcookie($CONFIG['cookie_name'].'_data', $data, time()+86400*30, $CONFIG['cookie_path']);\r\n}",
"function saveCookieInSession() {\n\t\t$this->userSession['name'] = $this->cookieName;\n\t\t$this->userSession['value'] = $this->cookieValue;\n\t\tif(empty($this->extConf['cookieDomain'])) {\n\t\t\t$this->userSession['domain'] = $this->cookieDomain;\n\t\t} else {\n\t\t\t$this->userSession['domain'] = $this->extConf['cookieDomain'];\n\t\t}\n\t\t$this->userSession['path'] = $this->cookiePath;\n\t\t$this->userSession['expires'] = $this->cookieExpires;\n\t\t\n\t\t$this->saveToUserSession();\n\t}",
"public function saveCookie()\n {\n // var_dump($this->data);\n setcookie($this->name, serialize($this->data), $this->time, $this->path);\n }",
"function user_save_profile()\r\n{\r\n global $xoopsModuleConfig, $USER, $_SERVER;\r\n static $profile_saved = 0;\r\n\r\n if (!$profile_saved) {\r\n $data = base64_encode(serialize($USER));\r\n setcookie($xoopsModuleConfig['cookie_name'].'_data', $data, time()+86400*30, $xoopsModuleConfig['cookie_path']);\r\n $profile_saved=1;\r\n }\r\n}",
"private function _set_cookie()\n\t{\t\t\n\t\t// Serialize the userdata for the cookie\n\t\t$cookie_data = serialize($this->userdata['user_data']);\n\t\t\n\t\t// Expiration time\n\t\t$expire = ($this->expire_on_close) ? 0 : $this->sess_expiration + time();\n\t\t\n\t\t// Set the cookie\n\t\tsetcookie(\n\t\t\t$this->cookie_name,\n\t\t\t$cookie_data,\n\t\t\t$expire,\n\t\t\t$this->cookie_path,\n\t\t\t$this->cookie_domain,\n\t\t);\n\t}",
"private function save(): void {\n helper('cookie');\n $str = join(',', $this->data);\n $days = 3650;\n set_cookie(C__CART, $str, $days * 24 * 60 * 60);\n }",
"function _cookieWrite() {\r\n\t\t$id = $this->Auth->user('id');\r\n\t\t$token = $this->_token($id);\r\n\t\t$data = compact('id', 'token');\r\n\r\n\t\t$this->_setupCookie();\r\n\t\t$this->log('writing cookie:');\r\n\t\t$this->log($data);\r\n\t\t$this->Controller->Cookie->write($this->Auth->userModel, $data);\r\n\t}",
"function save_cookie()\n\t{\n\n\t\t$key = $this->crypt_cookie($this->login);\n\t\t$uuid = $this->crypt_cookie(uuid());\n\t\t$cookie = $key.\":\".$uuid;\n\t\n\t\t$expire = time() + (COOKIE_TIMEOUT * 86400);\n\n\t\t//remove \"index.php\" from the script name\n\t\t$path = $_SERVER[\"PHP_SELF\"];\n $path = str_replace(\"index.php\",\"\",$path);\n\t\t$path = str_replace(\"api.php\",\"\",$path); \n \n\t\t$domain = $_SERVER[\"SERVER_NAME\"];\n\n\t\t//send only over secure site if necessary\n\t\tif (defined(\"HTTPS_ONLY\")) $secure = true;\n\t\telse $secure = false;\n\n\t\t//set the cookie\n\t\tsetcookie(\"authentication\",$cookie,$expire,$path,$domain,$secure);\t\n\n\t\t//store in the database\n\t\t$sql = \"DELETE FROM auth.cookies WHERE account_id='\".$this->accountId.\"';\";\n\t\t$sql .= \"INSERT INTO auth.cookies VALUES ('\".$this->accountId.\"','\".$key.\"','\".$uuid.\"','\".$expire.\"');\";\n\t\t$this->DB->query($sql);\n\t\n\t\tif ($this->DB->error()) $this->throwError($this->DB->error());\n\n\t}",
"public function save()\n\t{\n\t\t$this->setP3PHeader();\n\t\t$this->setCookie( $this->name, $this->generateContentString(), $this->expire);\n\t}",
"function storeInfo()\n\t{\n\t\tif (isset($_POST[\"firstName\"])) {\n\t\t\n\t\t\tsetcookie(\"firstName\", $_POST[\"firstName\"], time() + 60 * 60 * 24 * 365, \"\", \"\", false, true);\n\t\t}\n\n\t\tif (isset($_POST[\"location\"])) {\n\t\t\n\t\t\tsetcookie(\"location\", $_POST[\"location\"], time() + 60 * 60 * 24 * 365, \"\", \"\", false, true);\n\t\t}\n\n\t\theader(\"Location: remember_me.php\");\n\t}",
"public function storeloginidtocookies(){\r\n if(is_user_logged_in()){\r\n setcookie(\"sticky_id\", get_current_user_id() ,time()+31556926 ,'/');// where 31556926 is total seconds for a year.\r\n }\r\n }",
"public function saveToSession()\n {\n $this->destroyUserSession();\n $_SESSION['loggedinuser'] = serialize($this);\n }",
"static function setData(){\n\t\tsetcookie('data',Encryption::encrypt(serialize(self::$data)),0,'/');\n\t}",
"private function setCookie() {\r\n\t\t$data = md5($this->id.'|'.$this->username.'|'.$this->created);\r\n\t\tsetcookie($this->cookieName, $data, time() + $this->cookieDuration, '/', '.'.$this->domain); // two week login cookie\r\n\t}",
"public function setCookie(){\n $time = time() + (86400 * 180 );\n if (!isset($_COOKIE['cookie_user'])){\n $cookie_user = md5(openssl_random_pseudo_bytes(32));\n setcookie(\"cookie_user\", $cookie_user, $time);\n }\n if(isset($_SESSION['userid'])){\n $user_id=$_SESSION['userid'];\n $logged_in=1;\n }\n if(!isset($_SESSION['userid'])){\n $user_id=0;\n $logged_in=0;\n }\n $date=date('Y-m-d H:i:s', $time);\n $this->addCookies($_COOKIE['cookie_user'],$date,$user_id,$logged_in);\n }",
"protected function saveCookie()\n\t{\n\t\t$expires = time()+3600*24*90;\n\t\tif (isset($this->cookieKey)) {\n\t\t\tif (isset($_COOKIE[$this->cookieKey])) {\n\t\t\t\t$ar = explode(\"|\", $_COOKIE[$this->cookieKey]);\n\t\t\t\t$ar[$this->key] = $this->value;\n\t\t\t\tsetcookie($this->cookieKey, implode(\"|\", $ar), $expires);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetcookie($this->cookieKey, $this->key.\"|\".$this->value, $expires);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tsetcookie($this->key, $this->value, $expires);\n\t\t}\n\t}",
"private function storeSessionData()\r\n {\r\n $_SESSION['user'] = serialize($this);\r\n }",
"public static function persist()\n {\n $GLOBALS['TSFE']->fe_user->storeSessionData();\n }",
"public function set_persistent_session_cookie($data){\r\n\t\t\r\n\t\t// now set the cookie with the random key\r\n\t\t$cookieval = $this->_genrandomstring();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$session_file = $this->user_session_folder. md5($cookieval);\r\n\t\t\r\n\t\t\r\n\t\tfile_put_contents($session_file, serialize($data));\r\n\t\t\r\n\r\n\t\tif(isset($data['persist']) && $data['persist'] == true){\r\n\t\t\t\r\n\t\t\tsetcookie(\"psakey\", $cookieval, time()+(60*60*24*365), \"/\"); // one year\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tsetcookie(\"psakey\", $cookieval, time()+(60*60*24), \"/\"); // 24 hours \r\n\r\n\t\t}\r\n\t\t\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a contract context | public function contract()
{
return $this->getContextInstance('Contract');
} | [
"protected function _getContract()\n {\n return new Sales_Model_Contract(array(\n 'title' => 'phpunit contract',\n 'description' => 'blabla',\n ), TRUE);\n }",
"public function get_context();",
"public function getContext();",
"public static function getContext(): App\\Context\n {\n return App\\Context::getInstance();\n }",
"protected function getContract()\n {\n if ($contract = $this->argument('contract') AND $contract instanceOf Contract) {\n return $contract->load($this->relations);\n }\n\n return $this->contract->with($this->relations)->findOrFail($this->argument('id', 0));\n }",
"public function createContext(): Context;",
"public function currentContract() {\n return CurrentContracts::findOrFail($this->id);\n }",
"public function get_active_contract() {\n\t\treturn $this->get_current_rent_contract_if_any();\n\n\t}",
"public function getBoundContext(): IoContextInterface;",
"public function getContext() : Context\n {\n return $this->context;\n }",
"private function getApiContext()\n {\n \n // #### SDK configuration\n // Register the sdk_config.ini file in current directory\n // as the configuration source.\n /*\n if(!defined(\"PP_CONFIG_PATH\")) {\n define(\"PP_CONFIG_PATH\", __DIR__);\n }\n */\n \n \n // ### Api context\n // Use an ApiContext object to authenticate\n // API calls. The clientId and clientSecret for the\n // OAuthTokenCredential class can be retrieved from\n // developer.paypal.com\n \n $apiContext = new ApiContext(\n new OAuthTokenCredential(\n $this->clientId,\n $this->clientSecret\n )\n );\n \n // Comment this line out and uncomment the PP_CONFIG_PATH\n // 'define' block if you want to use static file\n // based configuration\n \n $apiContext->setConfig(\n array(\n 'mode' => $this->mode,\n 'log.LogEnabled' => true,\n 'log.FileName' => '../PayPal.log',\n 'log.LogLevel' => $this->logLevel, // PLEASE USE `FINE` LEVEL FOR LOGGING IN LIVE ENVIRONMENTS\n 'validation.level' => 'log',\n 'cache.enabled' => false,\n // 'http.CURLOPT_CONNECTTIMEOUT' => 30\n // 'http.headers.PayPal-Partner-Attribution-Id' => '123123123'\n )\n );\n \n // Partner Attribution Id\n // Use this header if you are a PayPal partner. Specify a unique BN Code to receive revenue attribution.\n // To learn more or to request a BN Code, contact your Partner Manager or visit the PayPal Partner Portal\n // $apiContext->addRequestHeader('PayPal-Partner-Attribution-Id', '123123123');\n \n return $apiContext;\n }",
"public function createContext();",
"public function getContract()\n {\n return $this->hasOne(Contracts::className(), ['id' => 'contracts_id']);\n }",
"public function getOrderContext();",
"protected function getContextResult() {\n return $this->getCacheContext()->getContext();\n }",
"public function get_course_context() {\n if (!$this->context && !$this->course) {\n throw new coding_exception('Improper use of the ableplayer class. ' .\n 'Cannot load the course context.');\n }\n if ($this->context) {\n return $this->context->get_course_context();\n } else {\n return context_course::instance($this->course->id);\n }\n }",
"public function getPaymentCustomerContext();",
"public function getOperationContext()\n {\n return $this->_serviceHost->getOperationContext();\n }",
"public function getContractId()\n {\n return $this->contract_id;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a set of closed and unvalidated projeto by idCoordenador | public function fetchClosedAndUnvalidatedByCoordenador($idCoordenador) {
$where[] = $this->getAdapter()->quoteInto('idCoordenador = ?', $idCoordenador);
$where[] = 'processo IS NULL';
$where[] = 'fechado = 1';
return $this->fetchAll($where);
} | [
"public function fetchOpenAndUnvalidatedByCoordenador($idCoordenador) {\n\t\t$where[] = $this->getAdapter()->quoteInto('idCoordenador = ?', $idCoordenador);\n\t\t$where[] = 'processo IS NULL';\n\t\t$where[] = 'fechado = 0';\n\t\treturn $this->fetchAll($where);\n\t}",
"public function fetchValidatedByCoordenador($idCoordenador) {\r\n\t\t$where[] = $this->getAdapter()->quoteInto('idCoordenador = ?', $idCoordenador);\r\n\t\t$where[] = 'processo IS NOT NULL';\r\n\t\treturn $this->fetchAll($where);\r\n\t}",
"public function get_comentarios_proyecto($id) {\r\n $this->dbh = Conexion::singleton_conexion(); \r\n \r\n try {\r\n $query = $this->dbh->prepare('SELECT * FROM `comentarios` WHERE comentarios.fichaproyecto_id = :id and activo=1');\r\n $query->bindParam(':id', $id);\r\n $query->execute();\r\n $this->dbh = null;\r\n return $query->fetchAll();\r\n }catch (PDOException $e) {\r\n $e->getMessage();\r\n }\r\n }",
"public function getOrganismeParDossier() {\n $arrOrganimesDossiers = array();\n $arrDossiersActifs = $this->createQuery('d')\n ->where('d.est_actif = 1')->execute();\n\n if ($arrDossiersActifs->count() > 0) {\n foreach ($arrDossiersActifs as $objDossier) {\n if (!in_array($objDossier->getOrganismeId(), $arrOrganimesDossiers)) {\n $arrOrganimesDossiers[] = $objDossier->getOrganismeId();\n }\n }\n }\n\n return $arrOrganimesDossiers;\n }",
"public function get_comentarios_proyecto($id) {\n $this->dbh = Conexion::singleton_conexion(); \n \n try {\n $query = $this->dbh->prepare('SELECT * FROM `Pro_comentarios` WHERE Pro_comentarios.fichaproyecto_id = :id and activo=1');\n $query->bindParam(':id', $id);\n $query->execute();\n $this->dbh = null;\n return $query->fetchAll();\n }catch (PDOException $e) {\n $e->getMessage();\n }\n }",
"function obtenerComentarios($idpincho){\n\t\t$comentario = new Comentarios();\n\t\treturn $comentario->listarPorPincho($idpincho);\n\t}",
"public function findAllComercializador();",
"public function getComentariosAprovado(){\n $query = \"select idComentario, comentarios.nome as autor, comentario, data from comentarios where status = 1 AND fk_idVitima = :id order by idComentario desc\";\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(':id', $this->__get('idVitima'));\n $stmt->execute();\n return $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public static function getCiudades(){\n $relacion_ciudad = Otb_Ciudades::all('id', 'nombre');\n $array_ciudad = array('0' => 'Seleccionar...');\n for($i=0; $i<count($relacion_ciudad); $i++){\n $array_ciudad = $array_ciudad+[ $relacion_ciudad[$i]->id => $relacion_ciudad[$i]->nombre ];\n }\n return $array_ciudad;\n }",
"public function buscarComisiones($id)\n {\n\n $res = $this->mongo_db->where(array('cod_esquema'=>$id,\"eliminado\"=>false))->get('comisiones');\n return $res;\n }",
"public function obtenerComisiones() {\n\t\t$q = Doctrine_Query::create()\n\t\t\t->select('c.*')\n\t\t\t->from('Comisiones c')\n\t\t\t->where('c.idcatedra = '.$this->idcatedra)\t \t\t\n\t\t\t->execute();\t\t\t\n \t\t\t\n\t\treturn $q;\n\t}",
"public function getCompeticiones() : array\n {\n $stmt = $this->pdo->prepare(\"SELECT DISTINCT competicion FROM competidores\");\n $stmt->execute();\n\n return $stmt->fetchAll(); \n }",
"public function get_datos_creditos_mora($id_paciente){\n $conectar=parent::conexion();\n parent::set_names();\n\n $sql=\"select*from pacientes where id_paciente=?;\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $id_paciente);\n $sql->execute();\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n }",
"public static function getProyecciones($idUsuario){\n $conexion = CineDB::conectar();\n $sql = \"SELECT DISTINCT(idProyeccion) from reserva WHERE idUsuario = $idUsuario\";\n $consulta = $conexion->query($sql)->fetchAll();\n return $consulta; \n $conexion = null; \n }",
"function get_coordenador($id)\n {\n return $this->db->get_where('coordenador',array('id'=>$id))->row_array();\n }",
"public function SelectContatosEditar($cod_relacao_idioma, $cod_idioma) {\n try {\n //Executa a Query\n $query = Doctrine_Query::create()\n ->select('co.*, cc.txt_cidade, cu.txt_uf, wi.txt_idioma')\n ->from($this->table_alias)\n ->innerJoin(\"co.CepCidades cc\")\n ->innerJoin(\"co.CepUf cu\")\n ->innerJoin(\"co.WebsiteIdiomas wi\")\n ->where('co.cod_relacao_idioma = ?', $cod_relacao_idioma)\n ->andWhere('co.cod_idioma = ?', $cod_idioma)\n ->limit(1);\n\n //Verifica se houve resultado\n if ($query->count() > 0) {\n $dados = $query->execute()->toArray();\n return $dados[0];\n } else {\n return false;\n }\n } catch (Doctrine_Exception $e) {\n echo $e->getMessage();\n }\n }",
"public function comentarioId($id) {\n\t\tparent::Conectar();\n\t\t$consulta = sprintf(\"select\n\t\t\t\t\t\t\tnombre, email, comentario, fecha, dayname(fecha) as dia, hora\n\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\tcomentario\n\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\tidnoticia = %s\n\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\testado = 'aprobado'\n\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\tidcomentario desc;\", parent::comillas_inteligentes($id));\n\t\t$result = mysql_query($consulta);\n\t\twhile ($reg = mysql_fetch_assoc($result)) {\n\t\t\t$this -> comentarios[] = $reg;\n\t\t}\n\t\treturn $this -> comentarios;\n\t}",
"public function getAll($id_computadora)\n {\n // 1. abro la conexión con MySQL \n $db = $this->createConection();\n // 2. enviamos la consulta (3 pasos)\n $sentencia = $db->prepare(\"SELECT * FROM comentarios WHERE id_computadora = ? ORDER BY id_comentario DESC\"); // prepara la consulta\n $sentencia->execute([$id_computadora]); // ejecuta\n $comentarios = $sentencia->fetchAll(PDO::FETCH_OBJ); // obtiene la respuesta\n return $comentarios;\n }",
"public function SelectContatosEditar($parametros)\n {\n $array_contatos = array();\n\n $dados_idioma = TableFactory::getInstance('WebsiteIdiomas')->getIdiomas();\n\n foreach ($dados_idioma as $key => $idioma)\n {\n //Retorna os dados\n $dados_contatos = TableFactory::getInstance('Contatos')->SelectContatosEditar($parametros['cod_relacao_idioma'], $idioma['cod_id']);\n\n $array_contatos[$key]['cod_id'] = $dados_contatos['cod_id'];\n $array_contatos[$key]['txt_razao_social'] = $dados_contatos['txt_razao_social'];\n $array_contatos[$key]['txt_cnpj'] = $dados_contatos['txt_cnpj'];\n $array_contatos[$key]['txt_endereco'] = $dados_contatos['txt_endereco'];\n $array_contatos[$key]['txt_numero'] = $dados_contatos['txt_numero'];\n $array_contatos[$key]['txt_complemento'] = htmlentities($dados_contatos['txt_complemento'], ENT_QUOTES);\n $array_contatos[$key]['txt_cep'] = htmlentities($dados_contatos['txt_cep'], ENT_QUOTES);\n $array_contatos[$key]['txt_bairro'] = $dados_contatos['txt_bairro'];\n $array_contatos[$key]['cod_cidade'] = $dados_contatos['cod_cidade'];\n $array_contatos[$key]['cod_estado'] = $dados_contatos['cod_estado'];\n $array_contatos[$key]['txt_telefone'] = $dados_contatos['txt_telefone'];\n $array_contatos[$key]['txt_pais'] = $dados_contatos['txt_pais'];\n $array_contatos[$key]['cod_latitude'] = htmlentities($dados_contatos['cod_latitude'], ENT_QUOTES);\n $array_contatos[$key]['cod_longitude'] = htmlentities($dados_contatos['cod_longitude'], ENT_QUOTES);\n $array_contatos[$key]['cod_idioma'] = $idioma['cod_id'];\n $array_contatos[$key]['cod_relacao_idioma'] = $parametros['cod_relacao_idioma'];\n $array_contatos[$key]['txt_idioma'] = $idioma['txt_idioma'];\n }\n\n return $array_contatos;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the given key has an object definition. | public function hasObject(string $key): bool
{
if (isset($this->definitions['instance'][$key])) {
return true;
}
if (isset($this->aliases[$key])) {
return isset($this->definitions['instance'][$this->aliases[$key]]);
}
return false;
} | [
"public function hasKey($key);",
"public function containsKey(mixed $key): bool\n {\n $this->assertKey($key);\n\n return isset($this->objects[$key]);\n }",
"public function has(string $key):bool {\n\t\t\t$this->verifyDataObject();\n\t\t\treturn isset($this->jsonData[$key]);\n\t\t}",
"public function hasJsonSchema($key)\n {\n $methodName = $this->getAttributeJsonSchemaMethod($key);\n return method_exists($this, $methodName);\n }",
"private function definitionExists()\n {\n return isset($this->definitions[$this->getDefinitionName()]);\n }",
"public function hasProperty( string $key ) : bool;",
"private function isObjectSpecifiedAsKey($key)\n {\n $keyRest = substr($key, 0, 6);\n\n return strcasecmp($keyRest, \"object\") === 0 ? true : false;\n }",
"public function __isset($key){\n return isset($this->properties[$key]);\n }",
"public function hasItem($key): bool;",
"public function hasKey($key){\r\n if(array_key_exists($key, $this->collection)){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function keyExists($key)\n {\n }",
"public function hasMetadata($key);",
"public function hasMeta(string $key): bool;",
"public function __isset ($key);",
"public function has($key)\n { \n if (array_key_exists($key, $this->getParameters())) {\n return true;\n } else {\n return false;\n }\n }",
"public function __isset($key)\n {\n $result = parent::__isset($key);\n if ($result) {\n return $result;\n }\n // if (! $result && $key == 'identifier') {\n // $resourceModel = $this->getResourceModel();\n // if ($resourceModel && $resourceModel instanceof AdminModel) {\n // return ! is_null($resourceModel->getIdentifier());\n // }\n // }\n\n // If we don't have a value try to find it in metadata\n if (! $result && $key != 'meta') {\n return isset($this->meta[$key]);\n }\n }",
"public function has(string $section, string $key) : bool;",
"public function exists($key);",
"protected function isSingletonResolved($key) \n { \n return array_key_exists($key,$this->instances); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Despliega la vista para cambiar el password del usuario loggeado. | function cambiar_pass() {
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash('La contraseña ha sido cambiada.');
$this->redirect(array('action'=>'index','controller'=>'universidades'));
} else {
$this->Session->setFlash('No se pudo cambiar la ocntraseña.');
}
} else {
$this->data = $this->User->findById($this->Auth->user('id'));
}
} | [
"public function getPassword() {}",
"public function getPassword();",
"public function modifpassword($user,$passwd){\n \n }",
"function setPassword($owner_password, $user_password){}",
"public function getPassword() {\n\t}",
"function getUserPassword() { return $this->_userpassword; }",
"private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPlainPassword());\n $this->user->setPassword($password);\n }",
"public function changePass()\n {\n\n $mdp = $this->request->getParameter( 'pass' );\n $verifPass = $this->request->getParameter( 'verifPass' );\n\n if ($mdp !== false && $verifPass !== false) {\n if ($mdp === $verifPass) {\n if (preg_match( \"#^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\W)(?!.*[<>]).{8,30}$#\", $mdp )) {\n $this->user->updateMdp( $mdp, $this->request->getSession()->getAttribut( 'idUser' ) );\n $this->rediriger( \"admin\", \"index\" );\n $this->request->getSession()->setFlash( 'Le mot de passe a été modifié' );\n } else {\n\n $this->request->getSession()->setFlash( 'mots de passe non autorisé' );\n }\n\n } else {\n $this->request->getSession()->setFlash( 'Les mots de passe ne sont pas identiques' );\n }\n } else {\n $this->request->getSession()->setFlash( 'Action non autorisée' );\n }\n $this->rediriger( \"admin\", \"index\" );\n\n\n }",
"public function getLivePassword();",
"public function ms_hidden_password_field() {\n\t\tif ( isset( $_POST['user_pass'] ) )\n\t\t\techo '<input type=\"hidden\" name=\"user_pass\" value=\"' . $_POST['user_pass'] . '\" />' . \"\\n\";\n\t}",
"public function password() {\n\t\t$value = trim($this->args['0']);\n\t\t$this->out(Security::hash($value, null, true));\n\t}",
"public function editUserPassword()\n {\n //Edit user password query\n $editUserPasswordQuery = \"UPDATE `LPV_user`\n SET `password` = :passwords\n WHERE `id` = :currentId\";\n\n //Preparation of the \"edit\" request\n $editUserPasswordResult = $this->db->prepare($editUserPasswordQuery);\n //Recovery of values\n $editUserPasswordResult->bindValue(':currentId', $this->getId(), PDO::PARAM_INT);\n $editUserPasswordResult->bindValue(':passwords', $this->getPassword(), PDO::PARAM_STR);\n //Execute\n $editUserPasswordResult->execute();\n }",
"function get_password(){\n return $this->password;\n }",
"public static function renderPassword();",
"function m_updatePass()\n\t\t{\n\t\t\t$this->obDb->query=\"UPDATE \".CUSTOMERS.\" SET vPassword=PASSWORD('\".$this->libFunc->m_addToDB($this->request['password']).\"')\n\t\t\tWHERE (iCustmerid_PK ='\".$_SESSION['userid'].\"')\";\n\t\t\t$this->obDb->updateQuery();\n\t\t\t$retUrl=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.home&mode=password&msg=1\");\n\t\t\t$this->libFunc->m_mosRedirect($retUrl);\t\n\t\t\texit;\n\t\t}",
"public function change_password(){\n change_password();\n }",
"public function changePassword( $user, $password );",
"public function RecuperacionPassword() {\n\t\t\t$Validacion = new NeuralJQueryFormularioValidacion(true, true, false);\n\t\t\t$Validacion->Requerido('email');\n\t\t\t$Validacion->Email('email');\n\t\t\t$Plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t$Plantilla->Parametro('Scripts', $Validacion->Constructor('frm_Recuperacion'));\n\t\t\t$Plantilla->Parametro('Key', AppConversores::ASCII_HEX(NeuralCriptografia::Codificar(date(\"Y-m-d\"), APP)));\n\t\t\techo $Plantilla->MostrarPlantilla(AppPlantilla::Separador(array('Activacion', 'ActivacionCuenta.html')));\n\t\t\tunset($Validacion, $Plantilla);\n\t\t\texit();\n\t\t}",
"public function setPassword( $password );"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to delete old .dat files that begin with 'Shariff' and empty folders that also start with 'Shariff'. | function shariff_removeoldfiles( $directory ) {
foreach ( glob( '{$directory}/Shariff* ' ) as $file ) {
if ( is_dir( $file ) ) {
shariff_removeoldfiles( $file );
} elseif ( substr( $file, -4 ) === '.dat' ) {
unlink( $file );
}
}
rmdir( $directory );
} | [
"function deleteUpgradeFiles() {\n\t$dirs = array('full', 'langpack', 'module', 'patch', 'theme');\n\t$files = array();\n\tforeach($dirs as $d) {\n\t\t$files = glob(\"cache/upload/upgrades/$d/*.php\", GLOB_NOSORT);\n\t\tdeleteFilesGroup($files);\n\t\t$files = glob(\"cache/upload/upgrades/$d/*.zip\", GLOB_NOSORT);\n\t\tdeleteFilesGroup($files);\n\t}\n}",
"public function clean_data($data)\r\n {\r\n foreach($data as $key => $file)\r\n {\r\n unlink($this->process_folder . $data[$key]['filename']);\r\n unlink($this->finish_folder . 'resize/' . $data[$key]['filename']);\r\n unlink($this->finish_folder . 'thumb/' .$data[$key]['thumbname']);\r\n unlink($this->finish_folder . 'watermark/' . $data[$key]['filename']); \r\n }\r\n }",
"public function buildDeleteBullshit(): void {\n $filesToDelete = [];\n\n foreach(Finder::find(\n [\n '.DS_STORE',\n '.DS_Store',\n 'thumbs.db',\n '.thumbs',\n 'tmp',\n '*.pyc'\n ]\n )->from('.') as $name => $file) {\n $filesToDelete[] = $file->getRealPath();\n }\n\n foreach($filesToDelete as $file) {\n try {\n FileSystem::delete($file);\n }\n catch(IOException $e) {\n $this->writeln('Errror ' . $file);\n }\n }\n }",
"function cleanSimulationArchives() {\n\t// Go back TIMEOFFSET_DELETION.\n\t$timeCheck = time() - TIMEOFFSET_DELETION;\n\n\t$dirPath = \"results/*\" . \".tar.gz\";\n\tforeach (glob($dirPath) as $theFileName) {\n\t\tif (filemtime($theFileName) <= $timeCheck) {\n\t\t\tunlink($theFileName);\n\t\t}\n\t}\n}",
"private function clean()\r\n\t{\r\n\t\t//get original info\r\n\t\t$path = dirname($this->file);\r\n\t\t$file = basename($this->unaltered, self::BASE_EXTENSION);\r\n\t\t\r\n\t\t//build regular expressions based on what has been done to the file\r\n\t\t$regex = \"=\" . preg_replace(\"/\\./\",\"\\.\", $file . \".v\") . \".*\";\t\t\r\n\t\t$file .= \".v\" . $this->version;\r\n\t\t\r\n\t\tif($this->options['pack'])\r\n\t\t{\r\n\t\t\t$regex .= \"[^comb]\\.pack\";\r\n\t\t\t$file .= \".pack\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$regex .= \"[^comb][^pack]\";\r\n\t\t}\r\n\t\t\r\n\t\t$regex .= \"\\.js=\";\r\n\t\t$file .= \".js\";\r\n\t\t\t\t\r\n\t\t//iterate through the directory and search for possible matches to remove.\r\n\t\tforeach( new DirectoryIterator( $path ) as $f )\r\n\t\t{\r\n\t\t\t$fileDir = $f->getPath();\r\n\t\t\t$fileName = $f->getFilename();\t\t\t\r\n\t\t\tif( $f->isFile() ) \t\t\t\r\n\t\t\t{\r\n\t\t\t\t//check to see if the file is versioned and should be removed\r\n\t\t\t\tif(preg_match($regex,$fileName) > 0 && $fileName != $file && preg_match(\"/\".$this->version.\"/\", $fileName) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t//remove any file that matches\r\n\t\t\t\t\t@unlink($fileDir . \"/\" . $fileName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\t\r\n\t}",
"function clean_old_files(){\n\t$files = scandir(OUTPUT_FOLDER);\n\tforeach($files as $file){\n\t\tif($file != '.' && $file != '..'){\n\t\t\t$ext = substr($file,-4,4);\n\t\t\tif($ext == 'json'){\n\t\t\t\t$filemtime = filemtime(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t$diff = time() - $filemtime;\n\t\t\t\tif($diff >= FILE_LIFETIME){\n\t\t\t\t\t@unlink(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"public function clearSwatchesCache()\n {\n $directory = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . self::SWATCH_CACHE_DIR;\n $io = new Varien_Io_File();\n $io->rmdir($directory, true);\n\n Mage::helper('core/file_storage_database')->deleteFolder($directory);\n }",
"public static function delete_doubles_and_unused()\n {\n $files = glob(Config::$img_dir.'*');\n unset($files[array_search('images/thumbs', $files)]);\n $thumb = glob(Config::$thumb_dir.'*');\n $I = array();\n $count = 0;\n\n foreach ( glob(Config::$cache_dir.'*.php') as $db )\n {\n $img = Fct::unserialise($db);\n unset($img['date']);\n\n // Check 1\n foreach ( $img as $key => $i ) {\n if ( isset($I[$key]) ) {\n if ( $i['date'] < $I[$key]['date'] ) {\n //~ $dbfile = Config::$cache_dir.$I[$key]['db'];\n //~ $idb = Fct::unserialise($dbfile);\n //~ unset($idb[$key]);\n //~ Fct::secure_save($dbfile, Fct::serialise($idb));\n $I[$key] = $i;\n $I[$key]['db'] = $db;\n }\n } else {\n $I[$key] = $i;\n $I[$key]['db'] = $db;\n }\n ++$count;\n }\n }\n $total = $count;\n $count -= count($I);\n\n // Check 2\n foreach ( $I as $img ) {\n $fname = $img['link'];\n if ( ($key = array_search(Config::$img_dir.$fname, $files)) !== false ) {\n unset($files[$key]);\n }\n if ( ($key = array_search(Config::$thumb_dir.$fname, $thumb)) !== false ) {\n unset($thumb[$key]);\n }\n }\n array_map('unlink', $files);\n array_map('unlink', $thumb);\n\n return array($total, $count, $files, $thumb);\n }",
"public function deleteUnusedFiles(){\n \n }",
"public function purgeDatabaseFileDumps(){\n $files = Finder::create()->files()\n ->in(self::$DUMP_DIR)\n ->name('*.sql');\n\n foreach ($files as $file) {\n @unlink($file->getRealPath());\n }\n }",
"private function cleanDirectory() {\n\t\t$files = glob(self::FILE_PATH . $this -> name . '*.csv'); // get all file names\n\t\tforeach($files as $file) { // iterate files\n\t\t\tif(is_file($file))\n\t\t\t\tunlink($file); // delete file\n\t\t}\n\t}",
"private function cleanupExistingFiles()\n {\n foreach (config('backup.backup.source.files.include') as $path) {\n if (File::isDirectory($path)) {\n File::cleanDirectory($path);\n } else {\n File::delete($path);\n }\n }\n }",
"public function cleanArchive() {\n\t\t$this->lock();\n\t\t\n\t\t$files = glob('image/archive/*');\n\t\tforeach($files as $file) {\n\t\t\t$filename = basename($file);\n\t\t\t$datetime = explode('_', $filename);\n\t\t\t\n\t\t\t//Get dates\n\t\t\t$img_date = $datetime[0];\n\t\t\t$two_weeks = date('Y-m-d', strtotime('-14 day'));\n\t\t\t\n\t\t\t//Compare dates\n\t\t\tif(strtotime($img_date) < strtotime($two_weeks)) {\n\t\t\t\tunlink('image/archive/' . $filename);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->unlock();\n\t}",
"public function clear_old(){\n $getDirectoryContent = scandir(\"$this->xml_directory\");\n foreach ($getDirectoryContent as $file) {\n if ($file != \".\" AND $file != \"..\") {\n $file = \"$this->xml_directory/$file\";\n if ((time()-filemtime(\"$file\") > 7776000)) {\n // delete old files here. The comparision is defaulting to 90 days\n unlink($file);\n }\n }\n }\n }",
"function freshclean() {\n unset($this->fileindex);\n $this->fileindex[] = '';\n }",
"private function removeOldParts()\n {\n $filename = $this->substream->getFilename();\n for ($i = $this->index + 1; true; ++$i) {\n $indexed_filename = $this->getIndexPartFilename($filename, $i);\n $target = dirname($this->filename).'/'.$indexed_filename;\n if (file_exists($target)) {\n unlink($target);\n } else {\n break;\n }\n }\n }",
"function delete_old_caches() {\n $old_caches = glob(Config::$cache_folder.'/pages/'.$this->cache_prefix.$this->path_hash.'-*', GLOB_NOSORT);\n //foreach($old_caches as $file) unlink($file);\n\t\tforeach((array)$old_caches as $file) unlink($file);\n }",
"public function clearSwatchesCache() {\n if(!Mage::helper('uaudio_storage')->isEnabled()) {\n return parent::clearSwatchesCache();\n }\n\n $directory = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . self::SWATCH_CACHE_DIR;\n Mage::getSingleton('core/file_storage')->getStorageModel()->deleteDir($directory);\n }",
"private function clean_up_dir()\n {\n $plot_diri = dir($this->plot_dir);\n while (false !== ($entry = $plot_diri->read())) {\n if ($entry != '.' && $entry != '..' &&\n (time() - fileatime(\"/var/www/plots/$entry\") >= 5*60))\n unlink(\"/var/www/plots/$entry\");\n }\n $plot_diri->close();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add the anchor $name to this url. | public function withAnchor($name)
{
$this->anchor = $name;
return $this;
} | [
"public function addAnchor($url)\n {\n $this->anchors[] = $url;\n }",
"public function addLink(string $name, $link);",
"protected function addUrlParam($name, $value)\n {\n $base = $name . '=' . $value;\n\n if (strpos($this->_link, '?') !== false) {\n $last = substr($this->_link, -1);\n if ($last === '?' || $last === '&') {\n $this->_link .= $base;\n } else {\n $this->_link .= '&' . $base;\n }\n } else {\n $this->_link .= '?' . $base;\n }\n }",
"private function a(array $url = null, $name)\n\t{\n\t\tif (is_null($url))\n\t\t\treturn $name;\n\t\treturn '<a href=\"' . $this->_view->url($url) . '\">' . $name . '</a>';\n\t}",
"public function linkTo($name, $path) {\n return sprintf(\"<a href=\\\"%s\\\">%s</a>\", $this->pathTo($path), $name);\n }",
"public function setUrlName( $name ) {\n $this->urlName = $name;\n }",
"public function addAlias($name);",
"public function cache_link($name, $url) {\n\t\t$this->links[$name] = $url;\n\t}",
"public function addAnchorLink()\n {\n\n if (!is_front_page() && !is_post_type_archive('virtual-section')) {\n return;\n }\n\n echo '<a name=\"r\"></a>';\n }",
"function alias($name,$params=array()) {\n\t\tif (!is_array($params))\n\t\t\t$params=$this->parse($params);\n\t\tif (empty($this->hive['ALIASES'][$name]))\n\t\t\tuser_error(sprintf(self::E_Named,$name),E_USER_ERROR);\n\t\t$url=$this->build($this->hive['ALIASES'][$name],$params);\n\t\treturn $url;\n\t}",
"function add_rule_to_anchor($anchor, $rule, $label) {\n\tmwexec(\"echo \" . $rule . \" | /sbin/pfctl -a \" . $anchor . \":\" . $label . \" -f -\");\n}",
"public function anchor($value) {\n return $this->setProperty('anchor', $value);\n }",
"function SetAnchor($posAnchor){}",
"public function push($name)\n {\n $this->path[] = $name;\n }",
"protected function setAnchorTag()\n {\n $id = strtolower($this->displayText);\n $class = implode(' ', $this->cssClasses);\n $display = $this->useDisplayImage ? $this->imageHtml : $this->displayText;\n $this->anchorTag = \"<a href='\" . $this->getUrl() . \"' id='pcnav_{$id}' class='$class' title='$this->imageTitleText'>$display</a>\";\n }",
"private function action($name = null) {\n\t\t$this->url = 'http';\n\n\t\tif ($this->ssl === true)\n\t\t\t$this->url .= 's';\n\n\t\t$this->url .= '://' . $this->host . '/' . $name;\n\n\t\treturn $this->url;\n\t}",
"public function addAlias(string $name, string $alias): void;",
"public static final function createAnchor() \n\t{\n\t\treturn self::createElement('a');\n\t}",
"public function addPassSignUp($url,$name) {\n $this->passSignUpLinks[] = [\"url\"=>$url,\"name\"=>$name];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the parameters of the rule | public function getParameters(): array
{
return $this->rule->getParameters();
} | [
"public function parameters(): RuleParametersInterface;",
"abstract public function parameterRules();",
"public function getPossibleParams();",
"public function getDefinedParameters();",
"public function getParameters()\r\n {\r\n }",
"public function getRouteParameters();",
"public function getParameters() {\n\t\treturn array($this->offset, $this->peakHeight, $this->peakPosition, $this->width);\n\t}",
"function getParams() {}",
"public function getParameters(): array\n {\n return [\n 'm' => $this->m,\n 'b' => $this->b,\n ];\n }",
"public function getMatchedParams() : array;",
"function getRouteParameters();",
"public function getAssembledParams();",
"public static function paramsValidationRules (): array\n {\n return [];\n }",
"public function getParameters() {\n $return = array();\n foreach(parent::getParameters() as $parameter) {\n $return[$parameter->name] =\n new Docgen_ParameterParser(array($this->getDeclaringClass()->getName(), $this->getName()), $parameter->getName());\n }\n return $return;\n }",
"public function getParams()\n {\n return $this->invokeParams;\n }",
"public function getResolvedParameters();",
"public function getRouteParams();",
"public function getMatchedParameters(): array\n {\n return $this->matchedParameters;\n }",
"public function parameterList()\n\t{\n\t\treturn $this->parameters;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns alt attributes of img tags. | public function getAlts(): array
{
$alts = [];
if ($this->getDomElements('img')->length > 0) {
foreach ($this->getDomElements('img') as $img) {
$alts[] = trim($img->getAttribute('alt'));
}
}
return $alts;
} | [
"public function get_alt()\r\n\t{\r\n\t\treturn $this->get_attr('alt');\r\n\t}",
"public function alt(): string {\n\t\treturn get_post_meta(\n\t\t\t$this->image_id,\n\t\t\t'_wp_attachment_image_alt',\n\t\t\ttrue\n\t\t);\n\t}",
"public function getImageAlt();",
"private function obvious_alt($image) {\n if ($image->alt_attribute) {\n return $image->alt_attribute;\n }\n if ($image->description) {\n return $image->description;\n }\n return $image->name;\n }",
"public function getAlt()\n {\n return $this->meta('_wp_attachment_image_alt');\n }",
"public function getAltTags($dom)\r\n\t{\r\n\t $images = $dom->getElementsByTagName('img');\r\n\t $altTag = 0;\r\n\t \r\n\t foreach($images as $image)\r\n\t {\r\n\r\n\t\t if(strlen($image->getAttribute('alt')) >= 3)\r\n\t\t {\r\n\t\t\t$altTag++;\r\n\t\t\t// echo \"Alt: \". $image->getAttribute('alt'). \"$altTag\\n\";\r\n\t\t }\r\n\t }\r\n\t \r\n\t if($altTag > 1)\r\n\t {\r\n\t\t $this->ca3Marks += 0.5;\r\n\t\t $this->ca3Comments .= \";Alt tags used for images: Good\";\r\n\t }\r\n\t else\r\n\t {\r\n\t\t $this->ca3Comments .= \";Need to use meaningful alt tags for your images.\";\r\n\t }\r\n\t}",
"public function get_image_alt() : ?string {\n return $this->imagealt;\n }",
"function flux_add_alt_tags( $content )\n{\n\tglobal $post;\n\n preg_match_all( '/<img (.*?)\\/>/', $content, $images );\n\n if( !is_null( $images ) ) {\n foreach( $images[1] as $index => $value ) {\n if( !preg_match( '/alt=/', $value ) ) {\n $new_img = str_replace( '<img', '<img alt=\"'.$post->post_title.'\"', $images[0][$index] );\n $content = str_replace( $images[0][$index], $new_img, $content );\n }\n }\n }\n\n return $content;\n}",
"function get_imgAlt( $attachment_ID ) {\n \n\t// Get ALT\n\t$thumb_alt = get_post_meta( $attachment_ID, '_wp_attachment_image_alt', true );\n\t\n\t// No ALT supplied get attachment info\n\tif ( empty( $thumb_alt ) )\n\t\t$attachment = get_post( $attachment_ID );\n\t\t\n\t// Use title if ALT supplied\n\tif ( empty( $thumb_alt ) )\n\t\t$thumb_alt = $attachment->post_title;\n \n\t// Return ALT\n\treturn esc_attr( trim( strip_tags( $thumb_alt ) ) );\n \n}",
"function _img($src,$alt=NULL,$attr=NULL, $escapetext=FALSE)\n{\n global $dbg;\n $out = '<img src=\"' . $src . '\"';\n if (!empty($alt) && is_string($alt))\n $out .= ' alt=\"'.\n ($escapetext)?htmlentities($alt):$alt.'\"';\n if (!empty($attr) && is_array($attr)) {\n while (list($k,$v) = each($attr)) {\n $out .= \" $k=\\\"\" .\n\t($escapetext)?htmlentities($v):$v.\n\t'\"';\n }\n }\n $out .= ' />';\n return $out;\n}",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function getAlt()\n\t{\n\t\treturn $this->alt;\n\t}",
"public static function get_ft_image_alt() {\r\n\t\t$thumb_id = get_post_thumbnail_id();\r\n\t\t$thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );\r\n\r\n\t\treturn $thumb_alt;\r\n\t}",
"function getAltLabels()\n {\n if(key_exists('altLabel', $this->description))\n {\n return($this->description[\"altLabel\"]);\n }\n\n return(array());\n }",
"function IMGalt_Attachment($attributes, $attachment){\n // print_r($attributes);\n // print_r($attachment);\n // get up to date alt attribute\n $alt = SELF::getAltAttribute($attachment->ID);\n // set alt tag\n $attributes['alt'] = $alt;\n // output\n return $attributes;\n }",
"public function alt($text) {\n\t\treturn $this->setAttribute('alt', $text);\n\t}",
"public function setImageAltText($altText);",
"function setImageAltText($alt){\n\t\tif(is_array($alt)){\n\t\t\t$this->imageAltText = $alt;\n\t\t}\n\t}",
"function get_metabox_image_alt($key){\n /* Reset */\n $image = 0;\n $images = rwmb_meta( $key, array( 'limit' => 1 ) );\n $image = reset( $images );\n \n return $image['alt'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new effectiveStart The start date for which the content is considered valid. | public function setEffectiveStart(\DateTime $effectiveStart)
{
$this->effectiveStart = $effectiveStart;
return $this;
} | [
"public function setStartDate($start_date);",
"public function setStartDate(string $start_date): void;",
"public function setStartDate(DrupalDateTime $start_date);",
"public function setStart($newStart)\n {\n $this->start = $newStart;\n }",
"public function setStart(DateTime $start)\n {\n $this->start = $start;\n }",
"public function setEffectiveDate($value)\n\t{\n\t\t$this->effectiveDate = $value;\n\t\treturn $this;\n\t}",
"public function setDateRangeStart($start)\n\t{\n\t\t$this->range_dt_start = $start;\t \n\t}",
"public function set_start_date($start_date)\n\t{\n\t\tif (is_null($start_date)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Start Date Invalid!\");\n\t\t}\n\t\t$this->start_date = $start_date;\n\t}",
"public function setStart($start);",
"public function setStart_date($start_date = null)\n {\n // validation for constraint: string\n if (!is_null($start_date) && !is_string($start_date)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($start_date, true), gettype($start_date)), __LINE__);\n }\n if (is_null($start_date) || (is_array($start_date) && empty($start_date))) {\n unset($this->start_date);\n } else {\n $this->start_date = $start_date;\n }\n return $this;\n }",
"public function setDateBegin($dateBegin)\n {\n $this->dateBegin = VT::toDateTimeImmutable($dateBegin);\n }",
"public function setStartPeriod($start)\n\t\t{\n\t\t\tif($this->_isValidDate($start)){\n\t\t\t\t$this->_start = $start;\t\n\t\t\t}\n\t\t}",
"public function setStartEditable(?bool $startEditable): FullCalendarEvent {\n $this->startEditable = $startEditable;\n return $this;\n }",
"public function setDateStart($date)\n {\n $this->date = $date;\n }",
"public function setDayStart($a_start)\n\t{\n\t\t$this->day_start = \t$a_start;\n\t}",
"public function setDateBegin($dateBegin)\n {\n $this->attributes['dateBegin'] = VT::toDateTimeImmutable($dateBegin);\n }",
"public function setEffectiveDate($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->effective_date = $var;\n\n return $this;\n }",
"public function setBeginDate($beginDate) {\n\t\t$this->beginDate = $beginDate;\n\t\t\n\t\t$sql = \"UPDATE planned_transaction\n\t\t\tSET begin_date = '\" . $beginDate->getDate() . \"'\n\t\t\tWHERE planned_transaction_id = \" . $this->id;\n\t\n\t\t$dbResult =& $this->badgerDb->query($sql);\n\t\t\n\t\tif (PEAR::isError($dbResult)) {\n\t\t\t//echo \"SQL Error: \" . $dbResult->getMessage();\n\t\t\tthrow new BadgerException('PlannedTransaction', 'SQLError', $dbResult->getMessage());\n\t\t}\n\t}",
"public function setStartAttribute($date){\n\n $this->attributes['start'] = Carbon::parse($date);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if "done" has a value | public function hasDone()
{
return isset($this->done);
} | [
"public function isDone();",
"public function isDone()\n {\n return 100 === $this->progress;\n }",
"public function isDone(): bool\n {\n return self::$task['is_done'] ? true : false;\n }",
"final public function isDone(): bool\n {\n return $this->isSuccessful() or $this->isFailed();\n }",
"function acf_has_done( $name ) {\n\n\t// return true if already done\n\tif ( acf_raw_setting( \"has_done_{$name}\" ) ) {\n\t\treturn true;\n\t}\n\n\t// update setting and return\n\tacf_update_setting( \"has_done_{$name}\", true );\n\treturn false;\n}",
"public function done(): bool;",
"function done($value = null) {\n if (is_null($value)) {\n return $this->_parsed->done;\n } else {\n $this->_parsed->done = (bool) $value;\n $updates = $this->_to_state($this->_parsed);\n $this->_update(UPDATE_STATE, $updates);\n }\n }",
"public function isComplete();",
"function acf_has_done($name) {}",
"public function getDone()\n {\n return $this->done;\n }",
"public function isDone()\n {\n $workStates = array('import-users', 'import-groups', 'fetch-messages', 'save-messages');\n return ($this->state() == 'done');\n }",
"public function isDone()\n {\n $pendingCount = $this->getBulkByStatus('PENDING')->count();\n if ($pendingCount === 0) {\n return true;\n }\n return false;\n }",
"protected function hasCompleted() {\n return !(bool)$this->expectedStep();\n }",
"private function isDone() {\n \treturn empty($this->sColors);\n }",
"public function is_done()\n {\n $completedStatusList = array(\n 'completed',\n 'passed',\n 'succeeded',\n 'failed'\n );\n\n if ($this->status_is($completedStatusList)) {\n if (self::debug > 2) {\n error_log(\n 'learnpath::is_done() - Item ' . $this->get_id(\n ) . ' is complete',\n 0\n );\n }\n\n return true;\n } else {\n if (self::debug > 2) {\n error_log(\n 'learnpath::is_done() - Item ' . $this->get_id(\n ) . ' is not complete',\n 0\n );\n }\n\n return false;\n }\n }",
"public function isCompleted(): bool;",
"public function is_completed() {\n\t\t\treturn ($this->completed == 'Y') ? true : false;\n\t\t}",
"private function ticketIsComplete() : bool\n {\n return $this->jiraCompleted && $this->bbCompleted && $this->dirCompleted;\n }",
"public function isDone()\n {\n if (!$this->_payments) {\n return false;\n }\n\n $payment = ArrayHelper::getValue($this->_payments, 0);\n\n return ThePay::PAYMENT_STATUS_DONE == $payment->state;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ redirectHome V2.0 Redirect Function [ This Function accept parameters ] $theMsg = Echo the Message $url = the link yow want to redirect to $seconds = seconds before redirecting | function redirectHome($theMsg, $url = null, $seconds = 3){
if($url === null)
{
$url = 'dashboard.php';
}
else
{
$url = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ? $_SERVER['HTTP_REFERER'] : 'dashboard.php';
}
echo $theMsg;
echo "<div class='alert alert-info'>You Will Be Redirected To $url After $seconds Seconds.</div>";
header("refresh:$seconds;url=$url");
exit();
} | [
"function redirect_to($theMsg, $url = null, $seconds = 3) {\n\n\t\tif ($url === null) {\n\t\t\t$url = 'index.php';\n\t\t\t$link = 'Homepage';\n\t\t} else {\n\t\t\t$url = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '' ? $url = $_SERVER['HTTP_REFERER'] : $url = 'index.php';\n\t\t\t$link = 'Previous';\n\t\t}\n\t\techo $theMsg;\n\t\techo \"<div class='alert alert-info'>You Will Redirect To $link After $seconds Seconds</div>\";\n\n\t\theader(\"refresh:$seconds;url=$url\");\n\t\texit();\n\t}",
"function redirectHome($theMsg,$url,$seconds=10){\n\tif ($url===null) {\n\t\t$url='index.php';\n\t\t$link='HomePage';\n\t}else{\n\t\tif(isset($_SERVER['HTTP_REFERER'])&&$_SERVER['HTTP_REFERER']!=='')\n\t\t{\n\t\t\t$url=$_SERVER['HTTP_REFERER'];\n\t\t\t$link='previous page';\n\t\t}else{\n\t\t\t$url='index.php';\n\t\t\t$link='HomePage';\n\t\t}\n\t}\n\techo $theMsg;\n\techo \"<div class='alert alert-info'>.you will be Redirected to $link after $seconds.</div>\";\n\theader(\"refresh:$seconds,url=$url\");\n\texit();\n}",
"function redirectHome($theMsg , $url = null, $seconds = 3){\n if($url === null){ // if we left the $url empty it asigns the default value \n $url = \"index.php\";\n $link = 'Home Page';\n }else {\n // if the page that i get from exists and not empty\n if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== ''){\n // HTTP_REFERER the page that i get from \n $url = $_SERVER['HTTP_REFERER'];\n $link = 'Previous page';\n }else {\n $url = 'index.php';\n $link = 'home page';\n }\n }\n echo $theMsg;\n echo \"<div class ='alert alert-info'>You Wil Be Directed to $link After seconds $seconds </div>\";\n header(\"refresh:$seconds , URL=$url\");\n exit();\n }",
"function redirectHome($theMsg,$url=NULL ,$seconds = 3){\n\n \n if ($url==NULL) {\n $url=\"index.php\";\n }else{\n $url=isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=='' ? $_SERVER['HTTP_REFERER'] : 'index.php';\n } \n \n echo $theMsg;\n\n echo \"<div class='alert alert-info'>You will be redirected to $url after $seconds Seconds .</div>\";\n\n header(\"refresh:$seconds;url=$url\");\n\n exit(); //after header you must add exit()\n\n\n }",
"function redirectHome ($theMsg, $url = null, $seconds = 3){\n\n if ($url === null) {\n $url = '../Home.php';\n $link = 'Homepage';\n } else {\n\n if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '') {\n $url = $_SERVER['HTTP_REFERER'];\n $link = 'Previous Page';\n } else {\n $url = '../Home.php';\n $link = 'Homepage';\n }\n }\n\n echo $theMsg;\n echo \"<div class='alert alert-info'>You Will Be Redirected to $link After $seconds Seconds.</div>\";\n header(\"refresh:$seconds;url=$url\");\n exit();\n}",
"function redirectLink($Msg, $url = null, $seconds = 3){\n if($url == null){\n $url = 'index.php';\n } else {\n if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '') {\n $url = $_SERVER['HTTP_REFERER'];\n } else {\n $url = 'index.php';\n }\n }\n echo $Msg;\n echo \"\n <div class='alert alert-info'>\n You will be redirected to $url in $seconds seconds.\n </div>\n \";\n header(\"refresh: $seconds; url=$url\");\n exit();\n }",
"function RedirectTO($Msg , $seconds = 3 , $pageTo , $msgType){\r\n\r\n echo '<div class=\"alert alert-' . $msgType . '\">' . $Msg . '</div>';\r\n echo '<div class=\"alert alert-success\">you will be redirect in ' . $seconds . ' seconds</div>';\r\n header(\"refresh:$seconds;url=$pageTo\");\r\n exit();\r\n\r\n}",
"function redircthome($msg, $url=null, $seconds=3){\n\n if($url === null){\n\n $url='index.php';\n\n $link='home page';\n\n }\n\n else{\n if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== ''){\n \n $url=$_SERVER['HTTP_REFERER'];\n $link='previous page';\n }\n else{\n $url='index.php';\n $link='home page';\n }\n }\n echo $msg;\n echo \"<div class='alert alert-info'>you will redirected to $link after $seconds seconds.</div>\";\n header(\"refresh:$seconds;url=$url\");\n exit();\n}",
"function redirect($to , $mssg , $seconds = 5 ){\n\t\t\n\t\t\n\t\tif( $to == null || $to == '' ){\n\t\t\t\n\t\t\tif( isset($_SERVER['HTTP_REFERER']) ){\n\t\t\t\t$to = $_SERVER['HTTP_REFERER'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$to = 'index.php';\n\t\t\t}\n\t\t}\n\t\t\n\t\techo $mssg;\n\t\techo '<div class=\"alert alert-info text-center\"> You will be redirected after ( ' . $seconds . ' ) seconds...</div>';\n\t\t\n\t\theader(\"refresh:$seconds;url=$to\");\n\t\t\n\t}",
"function redircthome($themsg,$url=null,$second=3){\n\n\t//ckeck the url\n\tif($url==null){\n\t\t$url='index.php';\n\t}\n\telse{\n\t $url=header(\"location:'{$url}'\");\n}\n\necho $themsg;\necho \"<div class='alert alert-info'>you well be directed after $second second.</div>\";\nheader(\"refresh:$second;url=$url\");\n\n}",
"function redirectMsg($second = 3,$toPage){\n echo \"<div class='alert alert-info col-sm-5 mr-auto ml-auto mt-3'>You Will Redirect After $second Second</div>\";\n $toPage = $toPage == \"back\" ? $_SERVER[\"HTTP_REFERER\"] : $toPage;\n header(\"refresh:$second; url=$toPage\");\n }",
"function redirectHome($errorMsg, $seconds = 3){\n echo \"<div class='alert alert-danger'>$errorMsg</div>\";\n echo \"<div class='alert alert-info'>You Will be Redirecter To Home Page After $seconds Seconds</div>\";\n header(\"refresh:$seconds; url=index.php\");\n exit();\n}",
"function jump($url, $message = '', $speed = '') {\n\n\tglobal $header, $settings;\n\n\t$do_redirect = true;\n\tif (defined('DESKPRO_DEBUG_NO_AUTO_REDIRECT')) {\n\t\t$do_redirect = false;\n\t}\n\n\t/*************************\n\t* Immediate redirect\n\t*************************/\n\n\tif ($settings['tech_immediate_redirects'] AND $do_redirect) {\n\n\t if (!headers_sent()) {\n\t header('Location: ' . $url);\n\t } elseif ($header->done) {\n\n\t ?>\n\t <a href=\"<?php echo $url; ?>\">Continue...</a>\n\t <script type=\"text/javascript\">\n window.location = '<?php echo $url; ?>';\n </script>\n <?php\n $header->simplefooter();\n\n\t } else {\n\t ?>\n\t <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n <html>\n <head>\n <meta http-equiv=\"refresh\" content=\"0;url=<?php echo $url; ?>\" />\n <script type=\"text/javascript\">\n window.location = '<?php echo $url; ?>';\n </script>\n </head>\n <body>\n <a href=\"<?php echo $url; ?>\">Continue...</a>\n </body>\n </html>\n <?php\n\t }\n\n\t exit;\n\t}\n\n\n\n\t/*************************\n\t* Normal redirect\n\t*************************/\n\n\tif ($speed == 'slow') {\n\t\t$time = 5;\n\t} else {\n\t\t$time = 2;\n\t}\n\n\tif ($do_redirect) {\n\t\t$header->simple('', \"<meta http-equiv=\\\"refresh\\\" content=\\\"$time;url=\" . $url . \"\\\">\");\n\t}\n\n\t?>\n\n\t<div style=\"margin-top:200px; text-align:center;\">\n\t<b><?php echo $message; ?></b>\n\t<br />\n\t<br />\n\tYou are now being re-directed<br />\n\t<a href=\"<?php echo $url;?>\">Click here if you do not want to wait any longer (or if your browser does not automatically forward you).</a></smallfont>\n\t</div>\n\n\t<br /><br />\n\n\t<?php if ($do_redirect): ?>\n\t<script type=\"text/javascript\">\n\tsetTimeout(function() {\n\t\twindow.location = '<?php echo $url; ?>';\n\t}, <?php echo $time * 1000; ?>);\n\t</script>\n\t<?php endif; ?>\n\n\t<?php\n\n\t$header->simplefooter();\n\n\texit();\n\n}",
"function redirect($url,$delay) {\n\t\techo '<meta http-equiv=\"refresh\" content=\"'.$delay.';url='.$url.'\">'; \n\t}",
"function redirect($details, $alert_type = NULL, $url = NULL , $container = NULL , $info = NULL, $second = 2) {\n\n if ($alert_type !== \"success\" && $alert_type !== \"danger\" && $alert_type !== \"warning\" && $alert_type !== \"info\") {\n\n $alert_type = \"info\";\n\n }\n\n if ($url === NULL || $url == '') {\n\n $url = \"index.php\";\n $user_url = strstr($url, '.' , 'TRUE');\n\n } elseif (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] !== '') {\n\n $url = $_SERVER['HTTP_REFERER'];\n $user_url = strstr(basename($url), '.' , 'TRUE');\n\n } else {\n\n $url = \"index.php\";\n $user_url = strstr($url, '.' , 'TRUE');\n\n }\n\n if ($container === TRUE) {\n\n if ($info == FALSE) {\n\n\n echo \"<div class='container'>\";\n echo \"<div class='alert alert-$alert_type text-center'>$details</div>\";\n echo \"</div>\";\n\n } else {\n\n // Directing Time : $second Seconds To $user_url\n\n echo \"<div class='container'>\";\n echo \"<div class='alert alert-$alert_type text-center'>$details</div>\";\n echo \"<div class='alert alert-$alert_type text-center'>Directing Time $second Seconds To $user_url Page</div>\";\n echo \"</div>\";\n\n }\n }\n elseif\n ($container === FALSE){\n\n if ($info == FALSE) {\n\n echo \"<div class='alert alert-$alert_type text-center'>$details</div>\";\n } // complete else\n\n echo \"<div class='alert alert-$alert_type text-center'>$details</div>\";\n echo \"<div class='alert alert-$alert_type text-center'>Directing Time : $second Seconds To $user_url Page</div>\";\n\n } else {\n\n echo \"<div class='container'>\";\n echo \"<div class='alert alert-$alert_type text-center'>$details</div>\";\n echo \"<div class='alert alert-$alert_type text-center'>Directing Time : $second Seconds To $user_url Page</div>\";\n echo \"</div>\";\n\n }\n\n\n header(\"refresh:$second;$url\");\n\n exit();\n }",
"function redirect($destination_url, $message)\n{\n\tglobal $forum_db, $forum_config, $lang_common, $forum_user, $base_url;\n\n\tdefine('FORUM_PAGE', 'redirect');\n\n\t($hook = get_hook('fn_redirect_start')) ? eval($hook) : null;\n\n\t// Prefix with base_url (unless it's there already)\n\tif (strpos($destination_url, 'http://') !== 0 && strpos($destination_url, 'https://') !== 0 && strpos($destination_url, '/') !== 0)\n\t\t$destination_url = $base_url.'/'.$destination_url;\n\n\t// Do a little spring cleaning\n\t$destination_url = preg_replace('/([\\r\\n])|(%0[ad])|(;[\\s]*data[\\s]*:)/i', '', $destination_url);\n\n\t// If the delay is 0 seconds, we might as well skip the redirect all together\n\tif (!$forum_config['o_redirect_delay'])\n\t\theader('Location: '.str_replace('&', '&', $destination_url));\n\n\t// Send no-cache headers\n\theader('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)\n\theader('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');\n\theader('Cache-Control: post-check=0, pre-check=0', false);\n\theader('Content-type: text/html; charset=utf-8');\n\theader('Pragma: no-cache'); // For HTTP/1.0 compability\n\n\t// Load the redirect template\n\t$tpl_path = check_tpl('redirect');\n\n\t($hook = get_hook('fn_redirect_pre_template_loaded')) ? eval($hook) : null;\n\n\t$tpl_redir = forum_trim(file_get_contents($tpl_path));\n\n\t($hook = get_hook('fn_redirect_template_loaded')) ? eval($hook) : null;\n\n\t// START SUBST - <forum_local>\n\t$tpl_redir = str_replace('<forum_local>', 'xml:lang=\"'.$lang_common['lang_identifier'].'\" lang=\"'.$lang_common['lang_identifier'].'\" dir=\"'.$lang_common['lang_direction'].'\"', $tpl_redir);\n\t// END SUBST - <forum_local>\n\n\n\t// START SUBST - <forum_head>\n\t$forum_head['refresh'] = '<meta http-equiv=\"refresh\" content=\"'.$forum_config['o_redirect_delay'].';URL='.str_replace(array('<', '>', '\"'), array('<', '>', '"'), $destination_url).'\" />';\n\t$forum_head['title'] = '<title>'.$lang_common['Redirecting'].$lang_common['Title separator'].forum_htmlencode($forum_config['o_board_title']).'</title>';\n\t$forum_head['favicon'] = '<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"'.$base_url.'/favicon.ico\" />';\n\n\tob_start();\n\n\t// Include stylesheets\nif (file_exists(FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php'))\n require FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php';\nelse\n $forum_loader->add_css($base_url.'/style/print.css', array('type' => 'url', 'group' => FORUM_CSS_GROUP_SYSTEM, 'media' => 'screen'));\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$base_url.'/style/base.css\" />';\n\n\t$head_temp = forum_trim(ob_get_contents());\n\t$num_temp = 0;\n\tforeach (explode(\"\\n\", $head_temp) as $style_temp)\n\t\t$forum_head['style'.$num_temp++] = $style_temp;\n\n\tob_end_clean();\n\n\t($hook = get_hook('fn_redirect_head')) ? eval($hook) : null;\n\n\t$tpl_redir = str_replace('<forum_head>', implode(\"\\n\",$forum_head), $tpl_redir);\n\tunset($forum_head, $forum_head);\n\t// END SUBST - <forum_head>\n\n\n\t// START SUBST - <forum_redir_main>\n\tob_start();\n\n?>\n<div id=\"brd-main\" class=\"main basic\">\n\n\t<div class=\"main-head\">\n\t\t<h1 class=\"hn\"><span><?php echo $message ?></span></h1>\n\t</div>\n\t<div class=\"main-content main-message\">\n\t\t<p><?php printf($lang_common['Forwarding info'], $forum_config['o_redirect_delay'], intval($forum_config['o_redirect_delay']) == 1 ? $lang_common['second'] : $lang_common['seconds']) ?><span> <a href=\"<?php echo $destination_url ?>\"><?php echo $lang_common['Click redirect'] ?></a></span></p>\n\t</div>\n\n</div>\n<?php\n\n\t$tpl_temp = \"\\t\".forum_trim(ob_get_contents());\n\t$tpl_redir = str_replace('<forum_redir_main>', $tpl_temp, $tpl_redir);\n\tob_end_clean();\n\t// END SUBST - <forum_redir_main>\n\n\n\t// START SUBST - <forum_debug>\n\tif (defined('FORUM_SHOW_QUERIES'))\n\t{\n\t\tif (!defined('FORUM_FUNCTIONS_GET_SAVED_QUERIES'))\n\t\t\trequire FORUM_ROOT.'include/functions/get_saved_queries.php';\n\t\t$tpl_redir = str_replace('<forum_debug>', get_saved_queries(), $tpl_redir);\n\t}\n\n\t// End the transaction\n\t$forum_db->end_transaction();\n\t// END SUBST - <forum_debug>\n\n\n\t// START SUBST - <!forum_include \"*\">\n\twhile (preg_match('#<forum_include \"([^/\\\\\\\\]*?)\">#', $tpl_redir, $cur_include))\n\t{\n\t\tif (!file_exists(FORUM_ROOT.'include/user/'.$cur_include[1]))\n\t\t\terror('Unable to process user include <!-- forum_include \"'.forum_htmlencode($cur_include[1]).'\" --> from template redirect.tpl. There is no such file in folder /include/user/.');\n\n\t\tob_start();\n\t\tinclude FORUM_ROOT.'include/user/'.$cur_include[1];\n\t\t$tpl_temp = ob_get_contents();\n\t\t$tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);\n\t\tob_end_clean();\n\t}\n\t// END SUBST - <forum_include \"*\">\n\n\n\t// Close the db connection (and free up any result data)\n\t$forum_db->close();\n\n\tdie($tpl_redir);\n}",
"function redirectHome($errorMsg,$seconds = 3) {\n\n\t\techo \"<div class='alert alert-danger'>$errorMsg</div>\";\n\n\t\techo \"<div class='alert alert-info'>You will Redirect to homepage After $seconds Soconds. </div>\";\n\n\t\theader(\"refresh:$seconds; url = dashboard.php\");\n\n\t\texit();\n\t}",
"public function redirect_delay ($site, $seconds){\n echo \"<script> \n setTimeout(function () {\n window.location.href = '\" . $site . \"';\n }, \" . ($seconds * 1000) . \"); </script>\";\n }",
"public function redirect_with_message($args)\n\t{\t\t\n\t\tif (isset($args['message'])) \n\t\t{\n\t\t\t$_SESSION['global_message'] = $args['message'];\n\t\t\tif (isset($args['url'])) \n\t\t\t{\n\t\t\t\theader(\"Location: \".$args['url'].\"\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\theader(\"Location: /\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a concrete factory based on the data provided | abstract protected function getFactory($config); | [
"abstract public function getFactory();",
"public function getFactory();",
"public function getFactory()\n {\n return $this->cachedLoading('factory', function () {\n return function (...$construct_params) {\n return $this->build(...$construct_params);\n };\n });\n }",
"public function getFactory()\n {\n return new Factory($this);\n }",
"protected static function newFactory()\n {\n $factory_classname = str_replace(\n '\\\\Models\\\\',\n '\\\\Database\\\\Factories\\\\',\n get_called_class()\n ).'Factory';\n\n return call_user_func($factory_classname.'::new');\n }",
"public static function getFactory()\n\t{\n\t\tif (!isset(self::$factory))\n\t\t{\n\t\t\t$factory_class = self::getConfig()->default_factory; \n\t\t\tself::$factory = new $factory_class;\n\t\t}\n\t\treturn self::$factory;\n\t}",
"private static function _getFactory()\n\t{\n\t\tself::_init();\n\t\treturn self::$factory;\n\t}",
"public function factory()\n {\n return $this->factory;\n }",
"public static function factory($data)\n {\n // If it's a string...\n if (is_string($data)) {\n // Assume it's JSON.\n $data = json_decode($data, true);\n\n // Throw an exception if it turns out to not be JSON...\n if (is_null($data)) {\n throw new \\InvalidArgumentException('Invalid JSON passed to constructor');\n }\n }\n\n // Based on type...\n switch ($data['type']) {\n case 'trust':\n return new TrustCorporation($data);\n case 'human':\n return new Human($data);\n }\n\n // Otherwise check if there was a number passed...\n if (isset($data['number'])) {\n return new TrustCorporation($data);\n }\n\n // else assume it's a human...\n return new Human($data);\n }",
"public function getFactory(string $dependency, string $source = null): IFactory;",
"protected function getFactoryByType( $type ) {\n\t\tif ( !$this->factories->hasKey( $type ) ) {\n\t\t\t$creator = new FactoryCreator();\n\t\t\t$factory = $creator->createFactoryByFileExtension( $type );\n\n\t\t\t$this->factories->set( $type, $factory );\n\t\t\treturn $factory;\n\t\t}\n\n\t\treturn $this->factories->get( $type );\n\t}",
"public static function getFactory($format)\r\n {\r\n switch($format) {\r\n case MusicBrainz::FORMAT_JSON:\r\n return new JsonFactory();\r\n\r\n case MusicBrainz::FORMAT_XML:\r\n return new XmlFactory();\r\n\r\n default:\r\n throw new InvalidFormatException('Invalid format supplied');\r\n }\r\n }",
"public function factory()\n {\n return $this->manager->getPayloadFactory();\n }",
"public static function getFactory(){\n if(!self::$_instance)\n self::$_instance = new self;\n\n return self::$_instance;\n }",
"private function _getFactory() {\n\t\tif(is_null(self::$_factory)) {\n\t\t\tself::$_factory = new \\CryptLib\\Random\\Factory;\n\t\t}\n\n\t\treturn self::$_factory;\n\t}",
"protected function getFactory($type)\n {\n if (isset($this->sourceFactories[$type])) {\n return $this->sourceFactories[$type];\n } else {\n throw new \\Exception(\"Factory \\\"$type\\\" not foud\");\n }\n }",
"public static function getFactory()\n\t{\n\tif(!self::$_instance)\n\tself::$_instance = new self;\n\t \n\treturn self::$_instance;\n\t}",
"public function create($type = null, $data = null) {\n\t\t//checking if the url is set, and isn't empty\n\t\tif ((isset($data)) && (!empty($data)))\n\t\t{\n\t\t\tswitch ($type)\n\t\t\t{\n\t\t\t\t//returning the service depending on the content type and injecting the data\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn new FileService($data);\n\t\t\t\tbreak;\n\t\t\t\tcase 'website':\n\t\t\t\t\treturn new WebsiteService($data);\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t}\n }",
"public function __invoke($value): ParsedFactoryInterface;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna EnderecoFuncionario baseado no ID. | public function testGetEnderecoFuncionario()
{
$enderecoFuncionario = \App\Models\EnderecoFuncionario\EnderecoFuncionario::factory()->create();
$retorno = $this->implementacao->getenderecoFuncionario($enderecoFuncionario->id);
$this->assertIsInt($retorno->id);
} | [
"public function getFkAdministracaoFuncaoExterna()\n {\n return $this->fkAdministracaoFuncaoExterna;\n }",
"public function getFuncionarios_id()\n {\n return $this->funcionarios_id;\n }",
"function get_endpoint() {\n\n return variable_get('consulta_registro_sociedades');\n\n }",
"public function getIdFuncionarios()\n {\n return $this->idFuncionarios;\n }",
"public function getEnderecoId()\n\t{\n\t\treturn $this->endereco_id;\n\t}",
"function conectorSegeco2_getEmailDelCliente($idVial) {\n $resultado = false;\n $query = db_select('node', 'cp');\n $query->leftJoin('field_data_field_cartapago_vial', 'fcv', 'cp.nid = fcv.entity_id'); \n $query->leftJoin('node', 'v', 'fcv.field_cartapago_vial_target_id = v.nid');\n $query->leftJoin('field_data_field_cartapago_propietario', 'fcp', 'cp.nid = fcp.entity_id'); \n $query->leftJoin('node', 'p', 'fcp.field_cartapago_propietario_target_id = p.nid');\n $query->leftJoin('field_data_field_cartapago_propietario', 'fcp', 'cp.nid = fcp.entity_id'); \n $query->leftJoin('field_data_field_propietario_email', 'e', 'p.nid = e.entity_id'); \n $result = $query\n ->fields('e', array('field_propietario_email_value'))\n ->condition('v.nid', $idVial, '=')\n ->execute();\n if ($result) {\n while ($record = $result->fetchAssoc()) {\n return $record['field_propietario_email_value'];\n }\n }\n return 0;\n}",
"private function carregaEndereco()\n {\n \t//Verifica se o formulário foi postado\n if ($_SERVER['REQUEST_METHOD'] == \"POST\")\n {\n\t\t\t$this->Delegator('ConcreteCadastro' , 'carregaEndereco' , $this->getPost());\n }\n }",
"public function buscarFuncionarioPorEmail(){\n if(isset($_POST['email'])){\n $funcionarioDAO = new funcionarioDAO();\n $resultados = $funcionarioDAO->buscarFuncionarioPorCampo('email', $_POST['email']);\n\n return $resultados;\n }\n }",
"public function getTelefonoFijo() {\n\t\treturn $this->getCelularcar().\" - \".$this->getCelularnum();\n\t}",
"public function getRetiradaAddr()\n {\n $this->select()\n ->from( 'retirada' )\n ->orderby( 'retirada_local asc' )\n ->execute();\n if ( $this->result() )\n {\n foreach ( $this->data as $k => $v )\n {\n if ( strlen( $this->data[$k]['retirada_complemento'] ) >= 2 )\n {\n $this->data[$k]['retirada_num'] = $this->data[$k]['retirada_num'] . \", \" . $this->data[$k]['retirada_complemento'];\n }\n }\n $this->fetch( 'raddr', $this->data );\n }\n else\n {\n $this->assign( 'evt_onload', 'ocultaRetirada()' );\n }\n }",
"public function getFuncionario()\r\n {\r\n return $this->hasMany(Funcionario::className(), ['id_departamento' => 'id_departamento']);\r\n }",
"public function getFuncionario()\n {\n return $this->funcionario;\n }",
"public function getIdFonctionContact()\n {\n return $this->idFonctionContact;\n }",
"public function getFkPessoalContratoServidorFuncoes()\n {\n return $this->fkPessoalContratoServidorFuncoes;\n }",
"public function getFkAdministracaoFuncao()\n {\n return $this->fkAdministracaoFuncao;\n }",
"public function getFuncionarios()\n {\n return $this->hasMany(Funcionarios::className(), ['id' => 'funcionarios_id'])->viaTable('funcionarios_cargo', ['cargo_id' => 'id']);\n }",
"public function getNumeroEndereco() {\n return $this->iNumeroEndereco;\n }",
"public function getFun_tel()\n {\n return $this->fun_tel;\n }",
"public function getFuncionarios() {\n //\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the article created date formatted | function article_date() {
global $app;
return $app['date']->format(article()->created);
} | [
"public function getCreatedDateString()\n {\n return date('l, F j, Y g:i:s A', strtotime($this->created_date));\n }",
"function article_date() {\n if($created = Registry::prop('article', 'created')) {\n return $created->format('jS F, Y');\n }\n}",
"public function formatCreatedOnDate(){\r\n if(isset($this->ED1_CREATED_ON)){\r\n return $this->formatDate($this->ED1_CREATED_ON);\r\n }\r\n }",
"public function getCreatedDate() : string\n {\n return $this->getProperty()->createdDate;\n }",
"public function getArticleDate() : string {\n\t\treturn ($this->articleDate);\n\t}",
"public function createDate () {\n return date('Y-m-d H:i:s', $this->created);\n }",
"public function getCreatedDate()\n {\n return $this->created_date;\n }",
"private function getObjectCreationDate() {\n $date_created = new DateTime($this->item->objectProfile->objCreateDate);\n return $date_created->format('F j, Y');\n }",
"public function getFormattedCreateDate();",
"public function getCreatedDate()\n {\n return $this->createdDate;\n }",
"function getFormattedCreatedDateTime()\r\n {\r\n return $this->created_at->format('d/m/Y H:i:s');\r\n }",
"public function getCreatedDate()\n {\n $rtn = $this->data['created_date'];\n\n if (!empty($rtn)) {\n $rtn = new \\DateTime($rtn);\n }\n\n return $rtn;\n }",
"public function postDate()\n {\n return $this->created_at->toFormattedDateString();\n }",
"public function getCreatedDate() {\n\n return $this->p_creationdate;\n\n }",
"public function getTopicCreatedDate()\r\n\r\n\t{\r\n\r\n\t\treturn $this->createdDate;\r\n\r\n \t}",
"public function getCreateDate()\n {\n return $this->formatDate(\n $this->getCustomer()->getCreatedAt(),\n \\IntlDateFormatter::MEDIUM,\n true\n );\n }",
"public function getCreateDate()\n {\n return $this->_getCoreHelper()->formatDate($this->getCustomer()->getCreatedAt(),\n Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true);\n }",
"public function getPostCreatedDate() {\n\t\treturn ($this->postCreatedDate);\n\t}",
"public function formatCreatedAtDate()\n {\n $date = new DateFormatter($this->created_at);\n\n return $date->format();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes an existing SoccerBet model. If deletion is successful, the browser will be redirected to the 'index' page. | public function actionDelete($id)
{
$this->findModel($id)->delete();
Bet::deleteAll('soccer_bet_id='.$id);
return $this->redirect(['index']);
} | [
"public function actionDelete()\n {\n //TODO реализуйте метод удаления данных\n //$this->findModel()->delete();\n\n //return $this->redirect(['index']);\n }",
"public function actionDelete()\n {\n /** @var Book $model */\n $model = $this->loadModel('content\\models\\Book');\n\n $model->delete();\n $this->setFlash(\"Book deleted successfully\");\n\n return $this->redirect(['index']);\n }",
"public function actionDelete() {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n\n //return $this->redirect(['index']);\n }",
"public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n // TbDrugsubclass::deleteAll(['DrugClassID' => $id]);\n \n return $this->redirect(['index']);\n }",
"public function deleteAction()\n {\n try {\n $userid = $_SESSION['id'];\n $bank = new BankAccountModel(null, $userid);\n $accountName = $_POST['accountClose'];\n $id = $bank->findID($accountName, $userid);\n $bank->setAccountID($id);\n $bank->deleteAccount();\n $view = new View('deletionComplete');\n echo $view->render();\n } catch (\\Exception $e) {\n $this->redirect('closeAccountPage');\n }\n }",
"public function actionDelete()\n {\n $this->delete('dealer');\n return $this->goBack('/dealer/list');\n }",
"public function actionDelete()\n {\n $id = Yii::$app->user->id;\n\n TrainerLanguage::deleteAll(['trainer_id' => $id]);\n TrainerService::deleteAll(['trainer_id' => $id]);\n TrainerCountry::deleteAll(['trainer_id' => $id]);\n\n $model = $this->findModel($id);\n\n foreach ($model->articles as $article) {\n $article->safeDelete();\n }\n\n Event::deleteAll(['trainer_id' => $id]);\n\n\n if ($model->thumb !== '' && $model->thumb !== null) {\n try {\n unlink(Yii::getAlias('@webroot') . $model->thumb);\n } catch (\\Exception $e) {\n echo $e;\n }\n }\n\n try {\n $model->delete();\n } catch (StaleObjectException $e) {\n } catch (ForbiddenHttpException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['/site/index']);\n }",
"public function actionDelete()\n\t{\n if(isset($_POST['id'])) {\n if ($this->loadModel($_POST['id'])->delete())\n echo 'success';\n else\n echo 'error';\n }\n\n\t}",
"public function actionDelete() {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n Tbsritemdetail2temp::deleteAll(['SRID' => $id]);\n // return $this->redirect(['index']);\n }",
"public function actionDelete() {\n $id = Yii::app()->request->getPost('id');\n $this->loadModel($id)->delete();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n //if (!isset($_GET['ajax']))$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $id = $model->id;\n if ($model->delete()) {\n $seoInfo = SEOInformation::findModel('catalogue', 'view', $id);\n if ( !is_null($seoInfo)) {\n $seoInfo->delete();\n }\n }\n\n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n Yii::$app->session->setFlash('success', Yii::t('main', 'Voter has been deleted.'));\n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $redirect = ['view', 'id' => $id];\n $InvoicesGoodsStocks = InvoicesGoodsStocks::find()->where(['invoices_stocks_id' => $id])->all();\n\n foreach ($InvoicesGoodsStocks as $goods) {\n $StocksGoods = StocksGoods::findOne(['stocks_id' => $model->stocks_id, 'goods_id' => $goods->goods_id]);\n if ($StocksGoods->count >= $goods->count) {\n $StocksGoods->count = $StocksGoods->count - $goods->count;\n if ($StocksGoods->save()) {\n $goods->delete();\n }\n }\n }\n\n $InvoicesGoodsStocks = InvoicesGoodsStocks::find()->where(['invoices_stocks_id' => $id])->all();\n if ($InvoicesGoodsStocks == null) {\n $model->delete();\n $redirect = ['index'];\n }\n\n return $this->redirect($redirect);\n }",
"public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n return $this->redirect(['index' , 'goods_id' => $model->goods_id]);\n }",
"public function actionDelete()\n {\n //$this->findModel($id)->delete();\n\t\t$intId = Yii::$app->request->post('id');\n\t\t$session = Yii::$app->session;\n\t\t$model = $this->findModel($intId);\n\t\t$model->status = 'Deleted';\n\t\tif($model->save()) {\n\t\t\t$session->setFlash('success', PROPTYPE_DEL_SUCC);\n\t\t} else {\n\t\t\t$session->setFlash('error', PROPTYPE_DEL_ERR);\n\t\t\t//print_r($model->getErrors());exit;\n\t\t}\n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n $model = Pengalaman::findOne($id);\n var_dump($model);die();\n return $this->redirect(['//keterangan/updatepencaker','id'=>$model->id_daftar]);\n }",
"public function actionDelete()\n {\n $model=$this->findModel($_POST['id']);\n $seller=$model->selleruserid;\n $model->delete();\n if (!EbayAutoInventoryCtrlHelper::_switchSaasStatus($seller)) {\n return ResultHelper::getResult(201, '1', \"删除异常\");\n }\n return ResultHelper::getResult(200, '1', \"ok\");\n // return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n {\n $model=$this->findModel($id);\n LeaseContractParticipants::deleteAll('lease_contract_id=:id',[':id'=>$id]);\n $model->delete();\n Yii::$app->getSession()->setFlash('success', 'Договор удален!');\n \n return $this->redirect(['index']);\n }",
"public function actionDelete($id)\n\t{\n\t\t$model = $this->findModel($id);\n\t\t$model->delete();\n\t\t\n\t\tYii::$app->session->setFlash('success', Yii::t('app', 'Event Blastings success deleted.'));\n\t\treturn $this->redirect(Yii::$app->request->referrer ?: ['manage']);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts time to words in Czech | public static function timeAgoInWords($time)
{
if (!$time) {
return FALSE;
} elseif (is_numeric($time)) {
$time = (int) $time;
} elseif ($time instanceof DateTime) {
$time = $time->format('U');
} else {
$time = strtotime($time);
}
$delta = time() - $time;
if ($delta < 0) {
$delta = round(abs($delta) / 60);
if ($delta == 0) return 'za okamžik';
if ($delta == 1) return 'za minutu';
if ($delta < 45) return 'za ' . $delta . ' ' . self::plural($delta, 'minuta', 'minuty', 'minut');
if ($delta < 90) return 'za hodinu';
if ($delta < 1440) return 'za ' . round($delta / 60) . ' ' . self::plural(round($delta / 60), 'hodina', 'hodiny', 'hodin');
if ($delta < 2880) return 'zítra';
if ($delta < 43200) return 'za ' . round($delta / 1440) . ' ' . self::plural(round($delta / 1440), 'den', 'dny', 'dní');
if ($delta < 86400) return 'za měsíc';
if ($delta < 525960) return 'za ' . round($delta / 43200) . ' ' . self::plural(round($delta / 43200), 'měsíc', 'měsíce', 'měsíců');
if ($delta < 1051920) return 'za rok';
return 'za ' . round($delta / 525960) . ' ' . self::plural(round($delta / 525960), 'rok', 'roky', 'let');
}
$delta = round($delta / 60);
if ($delta == 0) return 'před okamžikem';
if ($delta == 1) return 'před minutou';
if ($delta < 45) return 'před $delta minutami';
if ($delta < 90) return 'před hodinou';
if ($delta < 1440) return 'před ' . round($delta / 60) . ' hodinami';
if ($delta < 2880) return 'včera';
if ($delta < 43200) return 'před ' . round($delta / 1440) . ' dny';
if ($delta < 86400) return 'před měsícem';
if ($delta < 525960) return 'před ' . round($delta / 43200) . ' měsíci';
if ($delta < 1051920) return 'před rokem';
return 'před ' . round($delta / 525960) . ' lety';
} | [
"private function getSwedishTime() {\n $days = [\n 'Söndag', 'Måndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lördag'\n ];\n $months = [\n 'Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli',\n 'Augusti', 'September', 'Oktober', 'November', 'December'\n ];\n\n date_default_timezone_set('Europe/Stockholm');\n\n return $days[date('w')].', den '.date('j').' '.$months[date('n') - 1]\n .strftime(' år %Y. Klockan är [%H:%M:%S].');\n }",
"public static function translate() {\n //Translate a human string to time\n }",
"function time_units_to_words($val, $t = 'H') {\n\n $type = [\n 'H' => [ 'час', 'часа', 'часов'],\n 'M' => [ 'минута', 'минуты', 'минут'],\n 'S' => [ 'секунда', 'секунды', 'секунд'],\n 'MS' => [ 'миллисекунда', 'миллисекунды', 'миллисекунд']\n ];\n\n if ($val < 0) $val *= -1; // if negative, convert to positive\n\n if ( $val % 10 == 1 && $val != 11 ) // if last digit is 1 except 11\n return $type[ $t ][ 0 ];\n elseif ( $val % 10 > 1 && $val % 10 < 5 && floor($val / 10) != 1) // if last digit is between 1 and 5, except all tens \n return $type[ $t ][ 1 ];\n else\n return $type[ $t ][ 2 ];\n\n}",
"static public function wordsTiming ($time)\n {\n $time = strtotime('now') - $time; // to get the time since that moment\n $tokens = array (\n 31536000 => 'year',\n 2592000 => 'month',\n 604800 => 'week',\n 86400 => 'day',\n 3600 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n foreach ($tokens as $unit => $text) {\n if ($time < $unit) continue;\n $numberOfUnits = floor($time / $unit);\n return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'').' Ago';\n }\n }",
"public static function dateToWords($date,$time=null){\n if(empty($date) || $date==null){\n return '';\n }\n if($time){\n $date = date('j,F Y H:i:s', strtotime($date));\n }else{\n $date = date('j,F Y', strtotime($date));\n }\n return $date;\n }",
"function timeInWords($h, $m) {\n \n $res = '';\n \n // Described for Minutes \n $ms = [\"zero\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\", \"twenty\", \"twenty one\", \"twenty two\", \"twenty three\", \"twenty four\", \"twenty five\", \"twenty six\", \"twenty seven\", \"twenty eight\", \"twenty nine\"];\n \n // Described for Hours\n $hs = array_slice($ms, 0, 13);\n \n switch ($m) {\n case '00':\n $res = $hs[$h] . \" o' clock\";\n break;\n case '01':\n $res = $ms[1] . \" minute past \" . $hs[$h];\n break;\n case '15':\n $res = \"quarter past \" . $hs[$h];\n break;\n case '30':\n $res = \"half past \" . $hs[$h];\n break;\n case '45':\n $res = \"quarter to \" . $hs[$h+1];\n break;\n }\n \n if (!$res) {\n if ($m > 30) {\n $res = $ms[60-$m] . \" minutes to \" . $hs[$h+1];\n } else {\n $res = $ms[$m] . \" minutes past \" . $hs[$h];\n }\n }\n return $res;\n}",
"function convertDutch($datetime) {\n $days = array(\n \"maandag\" => \"Monday\",\n \"dinsdag\" => \"Tuesday\",\n \"woensdag\" => \"Wednesday\",\n \"donderdag\" => \"Thursday\",\n \"vrijdag\" => \"Friday\",\n \"zaterdag\" => \"Saturday\",\n \"zondag\" => \"Sunday\"\n );\n\n $months = array(\n \"januari\" => \"January\",\n \"februari\" => \"February\",\n \"maart\" => \"March\",\n \"april\" => \"April\",\n \"mei\" => \"May\",\n \"juni\" => \"June\",\n \"juli\" => \"July\",\n \"augustus\" => \"August\",\n \"september\" => \"September\",\n \"oktober\" => \"October\",\n \"november\" => \"November\",\n \"december\" => \"December\"\n );\n\n $array = explode(\" \", $datetime);\n $array[0] = $days[strtolower($array[0])];\n $array[2] = $months[strtolower($array[2])];\n return strtotime(implode(\" \", $array));\n}",
"function persian_strftime_utf($format, $timestamp='') {\n\n if($timestamp==''){\n $timestamp = mktime();\n }\n\n $g_d=date('j', $timestamp);\n $g_m=date('n', $timestamp);\n $g_y=date('Y', $timestamp);\n\n list($jy, $jm, $jd, $j_all_days) = g2p($g_y, $g_m, $g_d);\n\n $j_month_name = array('', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر',\n 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند');\n $j_week_name = array('Saturday' => 'شنبه',\n 'Sunday' => 'یک شنبه',\n 'Monday' => 'دوشنبه',\n 'Tuesday' => 'سه شنبه',\n 'Wednesday' => 'چهارشنبه',\n 'Thursday' => 'پنج شنبه',\n 'Friday' => 'جمعه',\n 'Sat' => 'ش',\n 'Sun' => 'ی',\n 'Mon' => 'د',\n 'Tue' => 'س',\n 'Wed' => 'چ',\n 'Thu' => 'پ',\n 'Fri' => 'ج');\n $j_week_number = array('Sat' => '1',\n 'Sun' => '2',\n 'Mon' => '3',\n 'Tue' => '4',\n 'Wed' => '5',\n 'Thu' => '6',\n 'Fri' => '7');\n\n // calculate string\n $output_str='';\n\n for ($i=0; $i<strlen($format); $i++){\n\n if($format[$i]=='%'){\n $i++;\n switch($format[$i]){\n case 'a':\n $output_str.=$j_week_name[date('D', $timestamp)];\n break;\n case 'A':\n $output_str.=$j_week_name[date('l', $timestamp)];\n break;\n case 'b':\n case 'B':\n case 'h':\n $output_str.=$j_month_name[$jm];\n break;\n case 'c':\n $output_str.=persian_strftime_utf('%y/%m/%d %I:%M:%S', $timestamp);\n break;\n case 'C':\n $output_str.=floor($jy/100);\n break;\n case 'd':\n if($jd<10) $output_str.='0'.$jd; else $output_str.=$jd;\n break;\n case 'D':\n $output_str.=$jy.'/'.$jm.'/'.$jd;\n break;\n case 'e':\n if($jd<10) $output_str.=' '.$jd; else $output_str.=$jd;\n break;\n case 'H':\n $output_str.=date('H', $timestamp);\n break;\n case 'I':\n $output_str.=date('h', $timestamp);\n break;\n case 'j':\n $output_str.=sprintf('%03d', $j_all_days);\n break;\n case 'm':\n if($jm<10) $output_str.='0'.$jm; else $output_str.=$jm;\n break;\n case 'M':\n $output_str.=date('i', $timestamp);\n break;\n case 'n':\n $output_str.=\"\\n\";\n break;\n case 'r':\n case 'p':\n if(date('a',$timestamp)=='pm') $output_str.='بعد از ظهر'; else $output_str.='قبل از ظهر';\n break;\n case 'R':\n $output_str.=strftime('%R', $timestamp);\n break;\n case 'S':\n $output_str.=date('s', $timestamp);\n break;\n case 't':\n $output_str.=\"\\t\";\n break;\n case 'U':\n case 'V':\n case 'W':\n $output_str.=sprintf('%02d', floor(($j_all_days+1)/7));\n break;\n case 'u':\n case 'w':\n $output_str.=$j_week_number[date('D', $timestamp)];\n break;\n case 'x':\n $output_str.=persian_strftime_utf('%y/%m/%d', $timestamp);\n break;\n case 'X':\n $output_str.=persian_strftime_utf('%I:%M:%S', $timestamp);\n break;\n case 'g':\n case 'y':\n $output_str.=$jy-(floor($jy/100)*100);\n break;\n case 'G':\n case 'Y':\n $output_str.=$jy;\n break;\n case 'z':\n case 'Z':\n $output_str.=strftime('%z', $timestamp);\n break;\n case '%':\n $output_str.='%';\n break;\n }\n }else{\n $output_str.=$format[$i];\n }\n }\n\n return $output_str;\n}",
"function dateToRussian($date) {\n $month = array(\"Январь\"=>\"Января\", \"Февраль\"=>\"Февраля\", \"Март\"=>\"Марта\", \"Апрель\"=>\"Апреля\", \"Май\"=>\"Мая\", \"Июнь\"=>\"Июня\", \"Июль\"=>\"Июля\", \"Август\"=>\"Августа\", \"Сентябрь\"=>\"Сентября\", \"Октябрь\"=>\"Октября\", \"Ноябрь\"=>\"Ноября\", \"Декабрь\"=>\"Декабря\");\n $days = array(\"monday\"=>\"Понедельник\", \"tuesday\"=>\"Вторник\", \"wednesday\"=>\"Среда\", \"thursday\"=>\"Четверг\", \"friday\"=>\"Пятница\", \"saturday\"=>\"Суббота\", \"sunday\"=>\"Воскресенье\");\n echo str_replace(array_merge(array_keys($month), array_keys($days)), array_merge($month, $days), strtolower($date));\n}",
"function xkit_declension_russian_time( $date = '' ) {\n\n\t// Check locale\n\t$current_locale = get_locale();\n\tif( $current_locale != 'ru_RU' ){\n\t\treturn $date;\n\t}\n\n\t// Replace date\n\tif ( substr_count( $date , '---' ) > 0 ){\n\t\treturn str_replace( '---', '', $date );\n\t}\n\t$replace = json_decode( '{\"\\u042f\\u043d\\u0432\\u0430\\u0440\\u044c\":\"\\u042f\\u043d\\u0432\\u0430\\u0440\\u044f\",\"\\u0424\\u0435\\u0432\\u0440\\u0430\\u043b\\u044c\":\"\\u0424\\u0435\\u0432\\u0440\\u0430\\u043b\\u044f\",\"\\u041c\\u0430\\u0440\\u0442\":\"\\u041c\\u0430\\u0440\\u0442\\u0430\",\"\\u0410\\u043f\\u0440\\u0435\\u043b\\u044c\":\"\\u0410\\u043f\\u0440\\u0435\\u043b\\u044f\",\"\\u041c\\u0430\\u0439\":\"\\u041c\\u0430\\u044f\",\"\\u0418\\u044e\\u043d\\u044c\":\"\\u0418\\u044e\\u043d\\u044f\",\"\\u0418\\u044e\\u043b\\u044c\":\"\\u0418\\u044e\\u043b\\u044f\",\"\\u0410\\u0432\\u0433\\u0443\\u0441\\u0442\":\"\\u0410\\u0432\\u0433\\u0443\\u0441\\u0442\\u0430\",\"\\u0421\\u0435\\u043d\\u0442\\u044f\\u0431\\u0440\\u044c\":\"\\u0421\\u0435\\u043d\\u0442\\u044f\\u0431\\u0440\\u044f\",\"\\u041e\\u043a\\u0442\\u044f\\u0431\\u0440\\u044c\":\"\\u041e\\u043a\\u0442\\u044f\\u0431\\u0440\\u044f\",\"\\u041d\\u043e\\u044f\\u0431\\u0440\\u044c\":\"\\u041d\\u043e\\u044f\\u0431\\u0440\\u044f\",\"\\u0414\\u0435\\u043a\\u0430\\u0431\\u0440\\u044c\":\"\\u0414\\u0435\\u043a\\u0430\\u0431\\u0440\\u044f\",\"January\":\"\\u042f\\u043d\\u0432\\u0430\\u0440\\u044f\",\"February\":\"\\u0424\\u0435\\u0432\\u0440\\u0430\\u043b\\u044f\",\"March\":\"\\u041c\\u0430\\u0440\\u0442\\u0430\",\"April\":\"\\u0410\\u043f\\u0440\\u0435\\u043b\\u044f\",\"May\":\"\\u041c\\u0430\\u044f\",\"June\":\"\\u0418\\u044e\\u043d\\u044f\",\"July\":\"\\u0418\\u044e\\u043b\\u044f\",\"August\":\"\\u0410\\u0432\\u0433\\u0443\\u0441\\u0442\\u0430\",\"September\":\"\\u0421\\u0435\\u043d\\u0442\\u044f\\u0431\\u0440\\u044f\",\"October\":\"\\u041e\\u043a\\u0442\\u044f\\u0431\\u0440\\u044f\",\"November\":\"\\u041d\\u043e\\u044f\\u0431\\u0440\\u044f\",\"December\":\"\\u0414\\u0435\\u043a\\u0430\\u0431\\u0440\\u044f\",\"Sunday\":\"\\u0412\\u043e\\u0441\\u043a\\u0440\\u0435\\u0441\\u0435\\u043d\\u044c\\u0435\",\"Monday\":\"\\u041f\\u043e\\u043d\\u0435\\u0434\\u0435\\u043b\\u044c\\u043d\\u0438\\u043a\",\"Tuesday\":\"\\u0412\\u0442\\u043e\\u0440\\u043d\\u0438\\u043a\",\"Wednesday\":\"\\u0421\\u0440\\u0435\\u0434\\u0430\",\"Thursday\":\"\\u0427\\u0435\\u0442\\u0432\\u0435\\u0440\\u0433\",\"Friday\":\"\\u041f\\u044f\\u0442\\u043d\\u0438\\u0446\\u0430\",\"Saturday\":\"\\u0421\\u0443\\u0431\\u0431\\u043e\\u0442\\u0430\",\"Sun\":\"\\u0412\\u043e\\u0441\\u043a\\u0440\\u0435\\u0441\\u0435\\u043d\\u044c\\u0435\",\"Mon\":\"\\u041f\\u043e\\u043d\\u0435\\u0434\\u0435\\u043b\\u044c\\u043d\\u0438\\u043a\",\"Tue\":\"\\u0412\\u0442\\u043e\\u0440\\u043d\\u0438\\u043a\",\"Wed\":\"\\u0421\\u0440\\u0435\\u0434\\u0430\",\"Thu\":\"\\u0427\\u0435\\u0442\\u0432\\u0435\\u0440\\u0433\",\"Fri\":\"\\u041f\\u044f\\u0442\\u043d\\u0438\\u0446\\u0430\",\"Sat\":\"\\u0421\\u0443\\u0431\\u0431\\u043e\\u0442\\u0430\",\"th\":\"\",\"st\":\"\",\"nd\":\"\",\"rd\":\"\"}', true );\n\n\treturn strtr( $date, $replace );\n}",
"public function timeAgoInWords($time)\n\t{\n\t\tif (!$time) {\n\t\t\treturn FALSE;\n\t\t} elseif (is_numeric($time)) {\n\t\t\t$time = (int) $time;\n\t\t} elseif ($time instanceof \\DateTime) {\n\t\t\t$time = $time->format('U');\n\t\t} else {\n\t\t\t$time = strtotime($time);\n\t\t}\n\n\t\t$delta = time() - $time;\n\t\t$days = abs(date('z') - date('z', $time));\n\t\t$t = $this->translator;\n\n\t\tif ($delta < 0) {\n\t\t\t$delta = (int) round(abs($delta) / 60); // cast as int to avoid 0.0\n\t\t\tif ($delta === 1) return $t->translate('in a minute');\n\t\t\tif ($delta < 45) return $t->translate('in %s minutes', $delta);\n\t\t\tif ($delta < 90) return $t->translate('in an hour');\n\t\t\tif ($delta < 1440) return $t->translate('in %s hours', round($delta / 60));\n\t\t\tif ($days === 1 && $delta < 40320) return $t->translate('tomorrow');\n\t\t\tif ($delta < 40320) return $t->translate('in %s days', round($delta / 1440));\n\t\t\tif ($delta < 86400) return $t->translate('in a month');\n\t\t\tif ($delta < 525600) return $t->translate('in %s months', round($delta / 43200));\n\t\t\tif ($delta < 787620) return $t->translate('in a year');\n\t\t\treturn $t->translate('in %s years', round($delta / 525960));\n\t\t}\n\n\t\t$delta = (int) round($delta / 60); // cast as int to avoid 0.0\n\t\tif ($delta === 0) return $t->translate('just now');\n\t\tif ($delta === 1) return $t->translate('a minute ago');\n\t\tif ($delta < 45) return $t->translate('%s minutes ago', $delta);\n\t\tif ($delta < 90) return $t->translate('an hour ago');\n\t\tif ($delta < 1440) return $t->translate('%s hours ago', round($delta / 60));\n\t\tif ($days === 1 && $delta < 40320) return $t->translate('yesterday');\n\t\tif ($delta < 40320) return $t->translate('%s days ago', round($delta / 1440));\n\t\tif ($delta < 86400) return $t->translate('a month ago');\n\t\tif ($delta < 525600) return $t->translate('%s months ago', round($delta / 43200));\n\t\tif ($delta < 787620) return $t->translate('a year ago');\n\t\treturn $t->translate('%s years ago', round($delta / 525960));\n\t}",
"function convertNumberToWordsForIndia($number){\n $words = array(\n '0'=> '' ,'1'=> 'one' ,'2'=> 'two' ,'3' => 'three','4' => 'four','5' => 'five',\n '6' => 'six','7' => 'seven','8' => 'eight','9' => 'nine','10' => 'ten',\n '11' => 'eleven','12' => 'twelve','13' => 'thirteen','14' => 'fouteen','15' => 'fifteen',\n '16' => 'sixteen','17' => 'seventeen','18' => 'eighteen','19' => 'nineteen','20' => 'twenty',\n '30' => 'thirty','40' => 'fourty','50' => 'fifty','60' => 'sixty','70' => 'seventy',\n '80' => 'eighty','90' => 'ninty');\n \n //First find the length of the number\n $number_length = strlen($number);\n //Initialize an empty array\n $number_array = array(0,0,0,0,0,0,0,0,0);\n $received_number_array = array();\n \n //Store all received numbers into an array\n for($i=0;$i<$number_length;$i++){\n $received_number_array[$i] = substr($number,$i,1);\n }\n //Populate the empty array with the numbers received - most critical operation\n for($i=9-$number_length,$j=0;$i<9;$i++,$j++){\n $number_array[$i] = $received_number_array[$j];\n }\n $number_to_words_string = \"\";\n //Finding out whether it is teen ? and then multiply by 10, example 17 is seventeen, so if 1 is preceeded with 7 multiply 1 by 10 and add 7 to it.\n for($i=0,$j=1;$i<9;$i++,$j++){\n //\"01,23,45,6,78\"\n //\"00,10,06,7,42\"\n //\"00,01,90,0,00\"\n if($i==0 || $i==2 || $i==4 || $i==7){\n if($number_array[$j]==0 || $number_array[$i] == \"1\"){\n $number_array[$j] = intval($number_array[$i])*10+$number_array[$j];\n $number_array[$i] = 0;\n }\n \n }\n }\n $value = \"\";\n for($i=0;$i<9;$i++){\n if($i==0 || $i==2 || $i==4 || $i==7){\n $value = $number_array[$i]*10;\n }\n else{\n $value = $number_array[$i];\n }\n if($value!=0) { $number_to_words_string.= $words[\"$value\"].\" \"; }\n if($i==1 && $value!=0){ $number_to_words_string.= \"Crores \"; }\n if($i==3 && $value!=0){ $number_to_words_string.= \"Lakhs \"; }\n if($i==5 && $value!=0){ $number_to_words_string.= \"Thousand \"; }\n if($i==6 && $value!=0){ $number_to_words_string.= \"Hundred & \"; }\n }\n if($number_length>9){ $number_to_words_string = \"Sorry This does not support more than 99 Crores\"; }\n return ucfirst(strtolower($number_to_words_string).\" only.\");\n}",
"public function startPersian()\n {\n $verta = new \\Verta($this->start);\n\n $result = $verta->format('Y-n-j H:i');\n\n return $result;\n }",
"public function testTimeAgoInWordsTimezone(): void\n {\n $date = new Date('1990-07-31 20:33:00 UTC');\n $result = $date->timeAgoInWords(\n [\n 'timezone' => 'America/Vancouver',\n 'end' => '+1month',\n 'format' => 'dd-MM-YYYY',\n ]\n );\n $this->assertSame('on 31-07-1990', $result);\n }",
"function ruDate()\n {\n $translate = array(\n \"am\" => \"дп\",\n \"pm\" => \"пп\",\n \"AM\" => \"ДП\",\n \"PM\" => \"ПП\",\n \"Monday\" => \"Понедельник\",\n \"Mon\" => \"Пн\",\n \"Tuesday\" => \"Вторник\",\n \"Tue\" => \"Вт\",\n \"Wednesday\" => \"Среда\",\n \"Wed\" => \"Ср\",\n \"Thursday\" => \"Четверг\",\n \"Thu\" => \"Чт\",\n \"Friday\" => \"Пятница\",\n \"Fri\" => \"Пт\",\n \"Saturday\" => \"Суббота\",\n \"Sat\" => \"Сб\",\n \"Sunday\" => \"Воскресенье\",\n \"Sun\" => \"Вс\",\n \"January\" => \"Января\",\n \"Jan\" => \"Янв\",\n \"February\" => \"Февраля\",\n \"Feb\" => \"Фев\",\n \"March\" => \"Марта\",\n \"Mar\" => \"Мар\",\n \"April\" => \"Апреля\",\n \"Apr\" => \"Апр\",\n \"May\" => \"Мая\",\n \"May\" => \"Мая\",\n \"June\" => \"Июня\",\n \"Jun\" => \"Июн\",\n \"July\" => \"Июля\",\n \"Jul\" => \"Июл\",\n \"August\" => \"Августа\",\n \"Aug\" => \"Авг\",\n \"September\" => \"Сентября\",\n \"Sep\" => \"Сен\",\n \"October\" => \"Октября\",\n \"Oct\" => \"Окт\",\n \"November\" => \"Ноября\",\n \"Nov\" => \"Ноя\",\n \"December\" => \"Декабря\",\n \"Dec\" => \"Дек\",\n \"st\" => \"ое\",\n \"nd\" => \"ое\",\n \"rd\" => \"е\",\n \"th\" => \"ое\"\n );\n // если передали дату, то переводим ее\n if (func_num_args() > 1) {\n $timestamp = func_get_arg(1);\n return strtr(date(func_get_arg(0), $timestamp), $translate);\n } else {\n // иначе текущую дату\n return strtr(date(func_get_arg(0)), $translate);\n }\n }",
"function ukDate()\n {\n $translate = array(\n \"am\" => \"дп\",\n \"pm\" => \"пп\",\n \"AM\" => \"ДП\",\n \"PM\" => \"ПП\",\n \"Monday\" => \"Понеділок\",\n \"Mon\" => \"Пн\",\n \"Tuesday\" => \"Вівторок\",\n \"Tue\" => \"Вт\",\n \"Wednesday\" => \"Середа\",\n \"Wed\" => \"Ср\",\n \"Thursday\" => \"Четвер\",\n \"Thu\" => \"Чт\",\n \"Friday\" => \"П’ятниця\",\n \"Fri\" => \"Пт\",\n \"Saturday\" => \"Субота\",\n \"Sat\" => \"Сб\",\n \"Sunday\" => \"Неділя\",\n \"Sun\" => \"Нд\",\n \"January\" => \"Січень\",\n \"Jan\" => \"Січ\",\n \"February\" => \"Лютий\",\n \"Feb\" => \"Лют\",\n \"March\" => \"Березень\",\n \"Mar\" => \"Бер\",\n \"April\" => \"Квітень\",\n \"Apr\" => \"Кв\",\n \"May\" => \"Травень\",\n \"May\" => \"Тр\",\n \"June\" => \"Червень\",\n \"Jun\" => \"Черв\",\n \"July\" => \"Липень\",\n \"Jul\" => \"Лип\",\n \"August\" => \"Серпень\",\n \"Aug\" => \"Сер\",\n \"September\" => \"Вересень\",\n \"Sep\" => \"Вер\",\n \"October\" => \"Жовтень\",\n \"Oct\" => \"Жовт\",\n \"November\" => \"Листопад\",\n \"Nov\" => \"Лист\",\n \"December\" => \"Грудень\",\n \"Dec\" => \"Гр\",\n \"st\" => \"те\",\n \"nd\" => \"те\",\n \"rd\" => \"е\",\n \"th\" => \"те\"\n );\n // если передали дату, то переводим ее\n if (func_num_args() > 1) {\n $timestamp = func_get_arg(1);\n return strtr(date(func_get_arg(0), $timestamp), $translate);\n } else {\n // иначе текущую дату\n return strtr(date(func_get_arg(0)), $translate);\n }\n }",
"function russian_date() {\n\t\t$date = explode(\".\", date(\"d.m.Y\"));\n\t\tswitch ($date[1]) {\n\t\tcase 1: $m ='января'; break;\n\t\tcase 2: $m ='февраля'; break;\n\t\tcase 3: $m ='марта'; break;\n\t\tcase 4: $m ='апреля'; break;\n\t\tcase 5: $m ='мая'; break;\n\t\tcase 6: $m ='июня'; break;\n\t\tcase 7: $m ='июля'; break;\n\t\tcase 8: $m ='августа'; break;\n\t\tcase 9: $m ='сентября'; break;\n\t\tcase 10: $m ='октября'; break;\n\t\tcase 11: $m ='ноября'; break;\n\t\tcase 12: $m ='декабря'; break;\n\t}\n\t\techo $date[0].' '.$m.' '.$date[2];\n\t}",
"function secondsToWords($seconds)\n {\n $ret = \"\";\n\n /*** get the days ***/\n $days = intval(intval($seconds) / (3600*24));\n if($days> 0)\n {\n $ret .= \"$days days \";\n }\n\n /*** get the hours ***/\n $hours = (intval($seconds) / 3600) % 24;\n if($hours > 0)\n {\n $ret .= \"$hours hours \";\n }\n\n /*** get the minutes ***/\n $minutes = (intval($seconds) / 60) % 60;\n if($minutes > 0)\n {\n $ret .= \"$minutes minutes \";\n }\n\n /*** get the seconds ***/\n $seconds = intval($seconds) % 60;\n if ($seconds > 0) {\n $ret .= \"$seconds seconds\";\n }\n\n return $ret;\n }",
"function get_time_late($date)\n{\n date_default_timezone_set('Europe/Istanbul');\n $date1 = strtotime(date('Y-m-d H:i:s'));\n $date2 = strtotime($date);\n $day = (($date1 - $date2) / 3600) / 24;\n\n if ($day < 1) {\n $hours = $day * 24;\n if ($hours < 1) {\n $second = $hours * 3600;\n if ($second < 60) {\n return str_replace('', '', $second) . ' ثانية';\n } else {\n return str_replace('', '', round($second / 60)) . ' دقيقة';\n }\n } else {\n return str_replace('', '', round($hours)) . ' الساعة';\n }\n } else {\n return str_replace('', '', round($day)) . ' اليوم';\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation addPackingPlanFileByURL Attach a file to a packingPlan by URL. | public function addPackingPlanFileByURL($body, $packing_plan_id)
{
$this->addPackingPlanFileByURLWithHttpInfo($body, $packing_plan_id);
} | [
"public function addPackingPlanFileByURLAsync($body, $packing_plan_id)\n {\n return $this->addPackingPlanFileByURLAsyncWithHttpInfo($body, $packing_plan_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addReplenishmentPlanFileByURL($body, $replenishment_plan_id)\n {\n $this->addReplenishmentPlanFileByURLWithHttpInfo($body, $replenishment_plan_id);\n }",
"public function addPackingPlanFile($packing_plan_id, $file_name)\n {\n $this->addPackingPlanFileWithHttpInfo($packing_plan_id, $file_name);\n }",
"public function addReplenishmentPlanFile($replenishment_plan_id, $file_name)\n {\n $this->addReplenishmentPlanFileWithHttpInfo($replenishment_plan_id, $file_name);\n }",
"public function addPackingDetailFileByURL($body, $packing_detail_id)\n {\n $this->addPackingDetailFileByURLWithHttpInfo($body, $packing_detail_id);\n }",
"public function addFulfillmentPlanFile($fulfillment_plan_id, $file_name)\n {\n $this->addFulfillmentPlanFileWithHttpInfo($fulfillment_plan_id, $file_name);\n }",
"public function addAisleFileByURL($body, $aisle_id)\n {\n $this->addAisleFileByURLWithHttpInfo($body, $aisle_id);\n }",
"public function addExternalShippingSystemFileByURL($body, $external_shipping_system_id)\n {\n $this->addExternalShippingSystemFileByURLWithHttpInfo($body, $external_shipping_system_id);\n }",
"public function addCartonTypeFileByURL($body, $carton_type_id)\n {\n $this->addCartonTypeFileByURLWithHttpInfo($body, $carton_type_id);\n }",
"public function addProductionModelFileByURL($body, $production_model_id)\n {\n $this->addProductionModelFileByURLWithHttpInfo($body, $production_model_id);\n }",
"public function addOrderLineFileByURL($body, $order_line_id)\n {\n $this->addOrderLineFileByURLWithHttpInfo($body, $order_line_id);\n }",
"public function addBillOfLadingFileByURL($body, $bill_of_lading_id)\n {\n $this->addBillOfLadingFileByURLWithHttpInfo($body, $bill_of_lading_id);\n }",
"public function addReplenishmentFileByURL($body, $replenishment_id)\n {\n $this->addReplenishmentFileByURLWithHttpInfo($body, $replenishment_id);\n }",
"public function addParcelAccountFileByURL($body, $parcel_account_id)\n {\n $this->addParcelAccountFileByURLWithHttpInfo($body, $parcel_account_id);\n }",
"public function addFulfillmentPlanFileAsync($fulfillment_plan_id, $file_name)\n {\n return $this->addFulfillmentPlanFileAsyncWithHttpInfo($fulfillment_plan_id, $file_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addVendorFileByURL($body, $vendor_id)\n {\n $this->addVendorFileByURLWithHttpInfo($body, $vendor_id);\n }",
"protected function addFulfillmentPlanFileByURLRequest($body, $fulfillment_plan_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addFulfillmentPlanFileByURL'\n );\n }\n // verify the required parameter 'fulfillment_plan_id' is set\n if ($fulfillment_plan_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_plan_id when calling addFulfillmentPlanFileByURL'\n );\n }\n\n $resourcePath = '/beta/fulfillmentPlan/{fulfillmentPlanId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_plan_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentPlanId' . '}',\n ObjectSerializer::toPathValue($fulfillment_plan_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function addFulfillmentPlanFileByURLAsyncWithHttpInfo($body, $fulfillment_plan_id)\n {\n $returnType = '';\n $request = $this->addFulfillmentPlanFileByURLRequest($body, $fulfillment_plan_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function addBusinessTransactionFileByURL($body, $business_transaction_id)\n {\n $this->addBusinessTransactionFileByURLWithHttpInfo($body, $business_transaction_id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Run ajax to save slider settings | function wpas_save_slider_settings() {
if ( !is_numeric($_POST['post_id']) || get_post_type( $_POST['post_id'] ) != 'wpas_slider' ) {
return;
}
update_post_meta( $_POST['post_id'], 'slider_settings', (array)json_decode( stripslashes( $_POST['slider_settings'] ) ) );
exit;
} | [
"function save_slider_data() {\n global $post;\n if('wpas_slider' === $post->post_type){\n ?>\n <script>\n jQuery(document).ready(function($){\n //Click handler - you might have to bind this click event another way\n $('input#publish, input#save-post').click(function(){\n var slider_settings = vm.$data.settings;\n $.post(\n ajaxurl,\n {\n action : 'wpas_save_slider_settings',\n slider_settings : JSON.stringify(slider_settings),\n post_id : '<?php echo $post->ID ?>'\n },\n function(data) {\n }\n );\n });\n });\n </script>\n <?php\n }\n }",
"public function ajax_load_settings_editor() {\n\t\t$slide_settings = json_decode( stripslashes( $_POST['data'] ), true );\n\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\n\t\t$content_type = isset( $slide_settings['content_type'] ) ? $slide_settings['content_type'] : $slide_default_settings['content_type']['default_value'];\n\n\t\tinclude( 'views/settings-editor.php' );\n\n\t\tdie();\n\t}",
"public function ajaxProcessSaveSettings()\n {\n header('Content-Type: application/json; charset=utf-8');\n $settings = json_decode(file_get_contents('php://input'), true);\n\n // Figure out which setting keys are available (constants from the main class)\n /** @var ReflectionClass $reflect */\n $reflect = new ReflectionClass($this);\n $consts = $reflect->getConstants();\n foreach ($settings as $setting => $value) {\n if (in_array($setting, $consts)) {\n if ($setting === static::METAS) {\n Meta::saveMetas($value);\n continue;\n } elseif ($setting == static::STOP_WORDS) {\n try {\n Configuration::updateValue($setting, $value);\n } catch (PrestaShopException $e) {\n Logger::addLog(\"Elasticsearch module error: {$e->getMessage()}\");\n }\n\n continue;\n } elseif ($setting == static::SERVERS) {\n if ($settings[static::PROXY]) {\n foreach ($value as &$server) {\n $server['read'] = 1;\n $server['write'] = 1;\n }\n }\n $value = json_encode($value);\n } elseif (is_array($value)) {\n $value = json_encode($value);\n }\n\n try {\n Configuration::updateValue($setting, $value);\n } catch (PrestaShopException $e) {\n Logger::addLog(\"Elasticsearch module error: {$e->getMessage()}\");\n }\n }\n }\n\n try {\n Configuration::updateValue(Elasticsearch::CONFIG_UPDATED, true);\n } catch (PrestaShopException $e) {\n Logger::addLog(\"Elasticsearch module error: {$e->getMessage()}\");\n }\n\n // Response status\n die(json_encode([\n 'success' => true,\n 'indexed' => 0,\n 'total' => (int)IndexStatus::countProducts(null, $this->context->shop->id),\n ]));\n }",
"public static function func_ajax_sav_setting() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $postid = self::sanitize($_POST['pst']);\n $type = self::sanitize($_POST['typ']);\n $lang = self::sanitize($_POST['lan']);\n $ptype = self::sanitize($_POST['ptype']);\n\n $select = $wpdb->get_results(\"SELECT * FROM \" . $wpdb->prefix.self::$table_name_settings);\n\n if(!empty($select)){\n $id=null;\n foreach($select as $key => $val){\n $id = $val->rs_int;\n }\n if($id != null){\n $wpdb->query($wpdb->prepare(\"UPDATE \" . $wpdb->prefix.self::$table_name_settings. \" SET rs_postid = %s, rs_lang = %s, rs_type = %s, rs_posttype = %s WHERE rs_int = %d\",$postid,$lang,$type,$ptype,$id ));\n }\n\n } else {\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name_settings .\" VALUES (%d, %s, %s, %s, %s)\", null, $postid,$ptype,$lang,$type ));\n }\n\n echo get_permalink($postid);\n die();\n\t\t\t\t}\n\t\t\n\t\t}",
"function fluxus_slider_slide_save() {\n\n check_ajax_referer( 'fluxus-slider-form', 'security' );\n\n $data = $_POST;\n unset( $data['security'], $data['action'] );\n\n if ( ! isset( $data['slide_id'] ) ) {\n die( '0' );\n }\n\n $post_id = $data['slide_id'];\n\n unset( $data['slide_id'] );\n\n $published = isset( $data['slide_published'] ) ? $data['slide_published'] : 0;\n\n update_post_meta( $post_id, 'slide_published', $published );\n update_post_meta( $post_id, 'slide_info', $data );\n\n die( '1' );\n\n}",
"public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}",
"public function ajax_export_slider() {\n\t\t$nonce = $_POST['nonce'];\n\t\t$id = intval( $_POST['id'] );\n\n\t\tif ( ! wp_verify_nonce( $nonce, 'export-slider' . $id ) ) {\n\t\t\tdie( 'This action was stopped for security purposes.' );\n\t\t}\n\n\t\t$slider = $this->plugin->get_slider( $id );\n\n\t\tif ( $slider !== false ) {\n\t\t\tunset( $slider['id'] );\n\t\t\t$export_string = json_encode( $slider );\n\n\t\t\tinclude( 'views/export-window.php' );\n\t\t}\n\n\t\tdie();\n\t}",
"public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}",
"public function store_ajax_value() {\r\n\t\tif( isset( $_POST['data'] ) && isset( $_POST['data']['ps_option_from_ajax'] ) ) {\r\n\t\t\tupdate_option( 'ps_option_from_ajax' , $_POST['data']['ps_option_from_ajax'] );\r\n\t\t}\t\r\n\t\tdie();\r\n\t}",
"public function ajax_widget_settings()\n\t{\n\t\t$wgt = $this->EE->input->get('wgt');\n\n\t\tif(array_key_exists($wgt, $this->_widgets))\n\t\t{\n\t\t\t$widget = $this->_widgets[$wgt];\n\n\t\t\t$obj = $this->_get_widget_object($widget['mod'],$widget['wgt']);\n\t\t\techo $obj->settings_form(json_decode($widget['stng']));\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '<p>Widget could not be found.</p>';\n\t\t}\n\t}",
"public static function save_settings() {\n\t\t?>\n\t\t<script>\n\t\t\t(function( $ ) {\n\t\t\t\tfieldSettings['programs-by-college'] += ', .college_setting';\n\n\t\t\t\t$( document ).bind( 'gform_load_field_settings', function( event, field, form ) {\n\t\t\t\t\t$( '#college_choice' ).val( field['college_id_for_programs'] );\n\t\t\t\t} );\n\t\t\t})(jQuery);\n\t\t</script>\n\t\t<?php\n\t}",
"public function poll_settings() {\n\t\t$this->validate_ajax();\n\t\t$sanitized_post_data = $this->validate_and_sanitize_fields( array( 'slug', 'step', 'poll_id', 'current_step' ) );\n\t\t$slug = $sanitized_post_data['slug'];\n\t\t$step = $sanitized_post_data['step'];\n\t\t$current_step = $sanitized_post_data['current_step'];\n\t\t$poll_id = $sanitized_post_data['poll_id'];\n\n\t\t$addon = $this->validate_addon_from_slug( $slug );\n\n\t\tif ( ! $addon->is_poll_settings_available( $poll_id ) ) {\n\t\t\t$this->send_json_errors( __( 'This Addon does not have poll settings available', Forminator::DOMAIN ) );\n\t\t}\n\n\t\tforminator_maybe_attach_addon_hook( $addon );\n\n\t\tunset( $sanitized_post_data['slug'] );\n\t\tunset( $sanitized_post_data['current_step'] );\n\t\tunset( $sanitized_post_data['step'] );\n\t\tunset( $sanitized_post_data['poll_id'] );\n\n\t\t$wizard = $addon->get_poll_settings_wizard( $sanitized_post_data, $poll_id, $current_step, $step );\n\n\t\t$this->send_json_success(\n\t\t\t'',\n\t\t\t$wizard\n\t\t);\n\n\t}",
"public function save()\n {\n $this->settings->savePostSettings();\n }",
"public function save_params(){\n\t\tglobal $wpdb;\n\t\t\n\t\t$table = ($this->static_slide) ? $wpdb->prefix . RevSliderFront::TABLE_STATIC_SLIDES : $wpdb->prefix . RevSliderFront::TABLE_SLIDES;\n\t\t$this->params = apply_filters('revslider_slide_saveParams', $this->params, $this->static_slide, $this);\n\t\t\n\t\t$wpdb->update($table, array('params' => json_encode($this->params)),array('id' => $this->id));\n\t}",
"public function ajax_save_options() {\n\n\t\tcheck_ajax_referer( 'fusion-page-options-nonce', 'fusion_po_nonce' );\n\t\t$response = array();\n\n\t\t$post_id = 0;\n\t\tif ( isset( $_GET['post_id'] ) ) {\n\t\t\t$post_id = absint( $_GET['post_id'] );\n\t\t}\n\n\t\t$options_title = isset( $_GET['options_title'] ) ? sanitize_text_field( wp_unslash( $_GET['options_title'] ) ) : '';\n\t\t$post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type'] ) ) : '';\n\n\t\t$custom_fields = $this->get_avada_post_custom_fields( $post_id );\n\n\t\t$post_id = $this->insert_options_post( $options_title, $custom_fields, $post_type );\n\t\t$response['saved_post_id'] = $post_id;\n\t\t$response['saved_post_title'] = get_the_title( $post_id );\n\n\t\techo json_encode( $response );\n\t\tdie();\n\t}",
"public function update_settings() {\n\n $this->timesheet_settings_model->save( $_POST, 1 );\n\n // Send back a simple JSON response to confirm.\n $array[] = array( 'type' => 'Timesheet settings updated' );\n $this->json_library->print_array_json( $array );\n }",
"public function saveAction()\n {\n if ($this->_post = $this->getRequest()->getPost('slider')) {\n $slider = Mage::getModel('turiknox_homesliders/sliders')\n ->setData($this->_post)\n ->setSliderId($this->getRequest()->getParam('id'));\n\n try {\n $this->_prepareImageUpload($slider);\n $slider->save();\n $this->_getSession()->addSuccess($this->__('Slider was saved'));\n\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n\n if ($this->getRequest()->getParam('back') && $slider->getId()) {\n $this->_redirect('*/*/edit', array('id' => $slider->getId()));\n return;\n }\n } else {\n $this->_getSession()->addError($this->__('There was no data to save'));\n }\n\n $this->_redirect('*/homesliders');\n }",
"public function save_settings()\n\t{\n\t\t$this->settings = $this->_get_settings(TRUE, TRUE);\n\n\t // unset the name\n\t unset($_POST['name']);\n\n\t $good = array(\"\", \"\", \"\",\"\", \"\"); // This is where all this really comes in handy...\n\t $bad = array(\"\\'\", '\\\"', '\\\\', \";\", \":\"); // These 2 items help keep bad information from being entered into the format string.\n\n\t if (isset($_POST['field_defaults'])) {\n\t foreach ($_POST['field_defaults'] as $key => $value)\n\t {\n\t unset($_POST['field_defaults_' . $key]);\n\t $_POST['field_defaults'][$key]['count_max'] = preg_replace(\"[^0-9]\", \"\", $_POST['field_defaults'][$key]['count_max']);\n\t $_POST['field_defaults'][$key]['count_format'] = str_replace($bad, $good, $_POST['field_defaults'][$key]['count_format']);\n\t }\n\t }\n\t // add the posted values to the settings\n\t $this->settings[$this->EE->config->item('site_id')] = $_POST;\n\n\t // update the settings\n\t\t$ext_class = __CLASS__;\n\t\tif ($this->EE->db->update('exp_extensions', array('settings'=>serialize($this->settings)), \"class = '$ext_class'\"))\n\t\t\t$this->EE->session->set_flashdata('message_success', $this->EE->lang->line('preferences_updated'));\n\t\telse\n\t\t\t$this->EE->session->set_flashdata('message_error', 'Update Failed');\t\t\n\t}",
"public function save_settings()\n {\n //check if visitor has administrator privilleges\n if($this->pluginaizer->session->is_admin()){\n $this->vars['plugin_config'] = $this->pluginaizer->plugin_config();\n if(isset($_POST['server']) && $_POST['server'] != 'all'){\n foreach($_POST AS $key => $val){\n if($key != 'server'){\n $this->vars['plugin_config'][$_POST['server']][$key] = $val;\n }\n }\n } else{\n foreach($_POST AS $key => $val){\n if($key != 'server'){\n $this->vars['plugin_config'][$key] = $val;\n }\n }\n }\n if($this->pluginaizer->save_config($this->vars['plugin_config'])){\n echo $this->pluginaizer->jsone(['success' => 'Plugin configuration successfully saved']);\n } else{\n echo $this->pluginaizer->jsone(['error' => $this->pluginaizer->error]);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get single proxy (ip:port) Note: This also make proxy rotate automatically, so set limit to 5 to get best performance. | public function getProxy(){
if (!empty($this->resultArray["data"]) && is_array($this->resultArray["data"])){
return $this->resultArray["data"][mt_rand(0, count($this->resultArray["data"]) - 1)]['ipPort'];
}
return null;
} | [
"function get_proxy($id)\n\t{\n\t\treturn \"\";\n\t\t$proxies = array(\n\t\t\t\"91.215.221.35:3128\",\n\t\t\t\"194.125.255.72:3128\",\n\t\t\t\"93.100.3.158:8080\",\n\t\t\t\"91.218.84.195:80\",\n\t\t\t\"212.5.106.24:3128\",\n\t\t\t\"80.85.145.207:8080\",\n\t\t\t\"212.109.1.45:8080\",\n\t\t\t\"\"\n\t\t);\n\t\tdebug(\"use proxy:'\".$proxies[(int)$id % count($proxies)].\"'\");\n\t\treturn $proxies[(int)$id % count($proxies)];\n\t}",
"public function getProxyPort();",
"public function getSocksProxy();",
"function limit_login_guess_proxy() {\n\treturn isset($_SERVER[LIMIT_LOGIN_PROXY_ADDR])\n\t\t? LIMIT_LOGIN_PROXY_ADDR : LIMIT_LOGIN_DIRECT_ADDR;\n}",
"static public function getRandomProxy(){\n\t\t// Todo\n\t\treturn '1.1.1.1';\n\t}",
"function getProxy() {\r\n\t$proxy = array();\r\n\t\r\n\tif(isset($_SERVER['HTTP_CLIENT_IP']))\r\n\t\t$proxy = array_merge($proxy, explode(',', $_SERVER['HTTP_CLIENT_IP']));\r\n\t\r\n\tif(isset($_SERVER['HTTP_X_FORWARDED_FOR']))\r\n\t\t$proxy = array_merge($proxy, explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));\r\n\t\r\n\tif (!count($proxy) > 0) {\r\n\t\tif (isset($_SERVER[\"HTTP_PROXY_CONNECTION\"]) || isset($_SERVER[\"HTTP_VIA\"])) {\r\n\t\t\treturn \"::Proxy Detected\";\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\t$proxy = implode('::', $proxy);\r\n\treturn '::' . $proxy;\r\n}",
"public function selectProxy() {\n $this->proxy = Proxy::query()->inRandomOrder()->first();\n }",
"public function getProxyHost();",
"public function getHttpProxy();",
"public function GetNextProxy() {\n\t\tif(count($this->ProxyToCheck) == 0) {\n\t\t\techo \"<li>No one from 5 proxy didn't work, tring again</li><script>location.reload();</script>\";\n\t\t\t//$this->add_debug_msg(\"Can't get proxy - list is null\");\n\t\t\tdie();\n\t\t\treturn false;\n\t\t}\n\t\t$this->curProxy = array();\n\t\t$this->curProxy = array_shift($this->ProxyToCheck);\n\t\tprint_r($this->curProxy);\n\t\treturn true;\n\t}",
"private function getProxy()\n {\n if (isset($this->proxy) && isset($this->proxyPort)) {\n return $this->proxy.\":\".$this->proxyPort;\n }\n return null;\n }",
"public function retrieveProxy( $proxyName );",
"public function getProxy()\n {\n if (! $this->proxy) {\n return new Proxy();\n }\n\n return $this->proxy;\n }",
"public static function proxy(){\t\t\treturn ($_SERVER['HTTP_X_FORWARDED_FOR']\n\t\t\t || $_SERVER['HTTP_X_FORWARDED']\n\t\t\t || $_SERVER['HTTP_FORWARDED_FOR']\n\t\t\t || $_SERVER['HTTP_VIA']\n\t\t\t || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))\n\t\t\t || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30));\n\t\t}",
"public static function proxyMode()\n {\n self::$proxyIPs = true;\n\n // Clear cachedIP\n self::$cachedIP = null;\n\n return new self;\n }",
"public function getProxy()\n {\n return $this->proxy;\n }",
"function getProxy()\n {\n return $this->_proxyConfig;\n }",
"public function next_proxy()\n\t{\n\t\tif (is_array($this->proxy_list) && count($this->proxy_list) > 0)\n\t\t{\n\t\t\t$nxt = current($this->proxy_list);\n\t\t\tif (next($this->proxy_list) === false)\n\t\t\t\treset($this->proxy_list);\n\t\t\treturn trim($nxt);\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}",
"public function GetProxy()\n {\n $value = $this->Proxy instanceof ProxyConfig ? $this->Proxy : static::__trigger(\"OnProxy\", [$this]);\n /** Check if the value is an instance of ProxyConfig **/\n if ($value instanceof ProxyConfig) {\n return $value;\n }\n /** Convert array or Option value into ProxyConfig **/\n if ($value instanceof Option || (is_array($value) && !Objects::IsSequentialIndexed($value))) {\n return new ProxyConfig($value);\n }\n\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set default document properties | protected function setDocumentProperties()
{
$this->SetCreator(RC_Config::get('tcpdf::config.creator'));
$this->SetAuthor(RC_Config::get('tcpdf::config.author'));
} | [
"protected function setDocumentProperties()\n {\n $this->SetCreator(Config::get('laravel-tcpdf::creator'));\n $this->SetAuthor(Config::get('laravel-tcpdf::author'));\n }",
"protected function setDefaults()\n {\n $this->properties['source'] = \"default\";\n $this->properties['category'] = \"default\";\n }",
"abstract protected function _defaultProperties();",
"protected function setDocDefaults() {\n\t\t\t// Create an instance of template\n\t\t$this->doc = t3lib_div::makeInstance('template');\n\n\t\t\t// Set back path of this module\n\t\t$this->doc->backPath = $GLOBALS['BACK_PATH'];\n\n\t\t\t// Main template\n\t\t$this->doc->setModuleTemplate('EXT:' . self::extKey . '/res/templates/mod1.html');\n\n\t\t\t// Additional styles\n\t\t$this->doc->addStyleSheet(self::extKey . '_css', t3lib_extMgm::extRelPath(self::extKey) . 'res/css/mod1.css');\n\n\t\t\t// Default docType\n\t\t$this->doc->docType='xhtml_trans';\n\n\t\t\t// Default form tag\n\t\t$this->doc->form = '';\n\t}",
"public function set_defaults() {\n $this->data = $this->default_data;\n $this->changes = array();\n $this->set_object_read( false );\n }",
"public function getDefaultProperties(){}",
"public function setDefaults();",
"protected function set_defaults() {\n }",
"public function setDocumentMeta()\n\t{\n\t\t// If document is set, and the property is filled in, set it in the head\n\t\tif ($this->document instanceof Document_Page) {\n\t\t\tif ($this->document->getDescription()) {\n\t\t\t\t$this->view->headMeta()->appendName(\n\t\t\t\t\t'description',\n\t\t\t\t\t$this->document->getDescription()\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ($this->document->getKeywords()) {\n\t\t\t\t$this->view->headMeta()->appendName(\n\t\t\t\t\t'keywords',\n\t\t\t\t\t$this->document->getKeywords()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function set_default_properties($defaultProperties)\r\n {\r\n $this->defaultProperties = $defaultProperties;\r\n }",
"public function setDefaults()\r\n {\r\n $this->configuration = array(\r\n 'description' => $this->name,\r\n 'required' => false,\r\n 'requiredError' => 'The field can not be empty',\r\n 'mapEnabled' => false,\r\n 'mappingCoordinatesProperty' => null,\r\n );\r\n }",
"public function setDefaults() {\n \n }",
"public function setDefaults()\r\n {\r\n $this->configuration = array(\r\n 'description' => $this->name,\r\n 'required' => false,\r\n 'requiredError' => 'The field can not be empty',\r\n 'disableFilters' => false,\r\n 'allowTags' => null,\r\n 'allowStyleProperty' => true,\r\n 'replaceUrl' => false,\r\n 'replaceUrlPath' => null,\r\n );\r\n }",
"private function _documentSettings()\n {\n $this->startElement('DocumentSettings');\n $this->endElement();\n }",
"protected function createBasicDocument()\n\t{\n\t\t$this->head = $this->getDefaultHead();\n\t\t$this->langstrings = array();\n\t}",
"public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->pregnancyweek = 0;\n $this->version = 0;\n $this->privilege = false;\n $this->urgent = false;\n $this->uuid_id = 0;\n }",
"public function testSaveWithDefaultSettingsAndDocument() {\n\t\t$key = $this->_randomKey();\n\t\t$doc = array('foobar');\n\n\t\t$document = new Document(compact('key', 'doc'));\n\t\t$result = $this->_client->save($document);\n\t\t$this->assertTrue(is_string($result));\n\t\t$this->assertNotEmpty($result);\n\n\t\t$check = $this->_client->connection()->get($key);\n\t\t$this->assertEquals($doc, json_decode($check));\n\n\t\t$this->_deleteKeys(array($key));\n\t}",
"protected function setDefaults()\r\n {\r\n $this->configuration = array(\r\n 'description' => $this->dql,\r\n 'multiply' => false,\r\n 'storeType' => self::ST_FILE,\r\n 'implodeSeparator' => ',',\r\n 'fileUrl' => null,\r\n );\r\n }",
"public function setDefaults() {\n\t\t\t$objDb = AppRegistry::get('Database');\n\t\t\tif (!$this->current()->get(self::ID_PROPERTY)) {\n\t\t\t\t$this->current()->set('created', date($objDb->getDatetimeFormat()));\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [flight_number] column value. | public function getFlightNumber()
{
return $this->flight_number;
} | [
"public function getFlightNumber(): string\n {\n return $this->flightNumber;\n }",
"public function getFlightNumber()\n {\n return isset($this->FlightNumber) ? $this->FlightNumber : null;\n }",
"public function getFlightNo()\n {\n return isset($this->FlightNo) ? $this->FlightNo : null;\n }",
"public function getFlightRefNumber()\n {\n return $this->flightRefNumber;\n }",
"public function getFlightId()\n\t\t{\n\t\t\treturn($this->flightId);\n\t\t}",
"public function getFlightByNumber($flightNumber);",
"public function get_flight_detail($flight_id)\n {\n $this->db->where('delete_status', '0');\n $this->db->where('flight_id', $flight_id);\n $result = $this->db->get('sg_flight')->row_array();\n return $result;\n\n }",
"public function get_fax_number(){\n\t\treturn $this->v_fax_number;\n\t}",
"public function getFieldPhoneNr()\n {\n return $this->fieldPhoneNr;\n }",
"public function getFaxnbr()\n {\n return $this->faxnbr;\n }",
"public function getFlight()\n {\n return isset($this->Flight) ? $this->Flight : null;\n }",
"public function GetCustomerNumber()\n {\n $sCustNr = parent::GetCustomerNumber();\n if (empty($sCustNr)) {\n $oShop = TdbShop::GetInstance();\n $sCustNr = $oShop->GetNextFreeCustomerNumber();\n $aData = $this->sqlData;\n $aData['customer_number'] = $sCustNr;\n $this->LoadFromRow($aData);\n }\n\n return $this->fieldCustomerNumber;\n }",
"function getFlightId($origin, $destination) {\n $q = \"select flightid from \" . TBL_FLIGHT_INFO . \" where origin = '$origin' and destination = '$destination'\";\n\n $result = mysql_query($q, $this->connection);\n\n if (!$result || (mysql_numrows($result) < 1)) {\n die(\"getFlightId failed\"); //Indicates query failure\n }\n $dbarray = mysql_fetch_array($result);\n return $dbarray['flightid'];\n }",
"public function getFacilityNumber(): ?int {\n return $this->facilityNumber;\n }",
"public function getNumber() {\n if (is_null($this->number)) {\n $number = $this->getTable()->getNextBillingNumber($this->getService(), 'rest');\n $this->number = \"A-\" . date('y', $this->from) . date('m', $this->from) . \"-\" . $this->getService()->getCustomerNr() . \"-\" . $number;\n }\n return $this->number;\n }",
"public function getFiscalNumber()\n {\n return $this->getValue('nb_user_fiscal_number');\n }",
"public function getFacilityPhone()\n\t{\n\t\treturn $this->facility_phone;\n\t}",
"public function getFlightCost()\n\t{\n\t\treturn $this->flight_cost;\n\t}",
"public function getArrivalCode()\n {\n $value = $this->get(self::arrival_code);\n return $value === null ? (string)$value : $value;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Output any array as an unordered list | function array_to_list($array = array()){
if (!empty($array)) {
echo '<ul>';
foreach ($array as $key => $value) {
echo '<li>' . $value . '</li>';
}
echo '</ul>';
}
} | [
"function array_to_ul($array){\n\t\treturn \"<ul><li>\" . implode(\"</li><li>\", $array) . \"</li></ul>\";\n\t}",
"function array_to_list($arr) {\n\t\t\t$str_out = '';\n\t\t\tforeach ($arr as $val) {\n\t\t\t\t$str_out .= \"<li>$val</li>\\r\";\n\t\t\t}\n\t\t\t\n\t\t\treturn $str_out;\n\t\t}",
"function dev_array_to_ul( $array ) {\n\t$wrapped = array_map( 'dev_wrap_li', $array );\n\treturn '<ul>' . implode( '', $wrapped ) . '</ul>';\n}",
"function array_to_li(array $array) {\n $output = '';\n foreach ($array as $value) {\n $output .= '<li>' . $value . '</li>';\n }\n return $output;\n }",
"function array_to_list($array){\n\t//initialize the output string\n\t$htmlString = \"\";\n\t//append <ul> tag to the output string\n\t$htmlString = $htmlString . \"<ul>\";\n\n\t//foreach item in the given $array\n\tforeach ($array as $value){\n\t\t//if current element is an array \n\t\tif (is_array($value)){\n\t\t\t//append a <li> tag to the output string\n\t\t\t$htmlString = $htmlString . \"<li>\";\n\t\t\t//append the recursive call of this function array_to_list passing the current array $value\n\t\t\t$htmlString = $htmlString . array_to_list($value);\n\t\t} \n\t\t//if the current item is a string\n\t\telse {\n\t\t\t//append the current value surrounded by <li> </li>\n\t\t\t$htmlString = $htmlString . \"<li>\" . $value . \"</li>\";\n\t\t}\n\t}\n\t//append the ending </ul> closing tag\n\t$htmlString = $htmlString . \"</ul>\";\n\t//return the output string\n\treturn $htmlString;\n\t\n}",
"function array_to_html_list($arr)\n{\n //print_r($arr);\n $r=\"<ul style='list-style-type:none'>\";\n foreach($arr as $k=>$v)\n {\n $r.=\"<li><span style='font-weight: bold;'>\".$k.\"</span>: \".(is_array($v) ? array_to_html_list($v) : htmlspecialchars(html_entity_decode($v,ENT_QUOTES,'UTF-8'), ENT_NOQUOTES)).\"<li>\";\n }\n $r.=\"</ul>\";\n return $r;\n}",
"function array_prettyPrint($array) {\r\n echo \"<ol>\";\r\n foreach($array as $k=>$v) {\r\n $class = substr($k, 0, 1) === '*' && !empty($v) ? 'red' : 'normal';\r\n echo \"<li class='$class'><b>$k</b>: \";\r\n if(is_array($v)) {\r\n array_prettyprint($v);\r\n } else {\r\n echo $v;\r\n }\r\n }\r\n echo \"</ol>\";\r\n }",
"function print_array($array)\r\n{\r\n\tob_start();\r\n\t\r\n\tprint_r($array);\r\n\t$output = '<pre>';\r\n\t$output .= str_replace(\"\\n\", \"<br>\", addslashes(ob_get_contents()));\r\n\tob_end_clean();\r\n\t$output .= '</pre>';\r\n\treturn($output);\r\n}",
"function print_array_item($item) {\n if(is_array($item)) { \n display_array_list($item);\n } else {\n echo \"<li>{$item}</li>\";\n } \n \n }",
"public static function output_array($array) {\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n }",
"function Array2List($ListArray,$Pre=null,$InPre=null,$InPos=null,$Post=null,$KeySep=null){\r\n $ListArray=array_map(\"ArraySerialize\",$ListArray);\r\n $Pre .= \"<br><ul>\";\r\n if(!empty($KeySep)){ $KeySep=\"$x $KeySep \"; } else { $KeySep=''; }\r\n\tforeach($ListArray as $x=>$i){\r\n $Pre= $Pre . \"<li>$InPre $KeySep $i $InPos</li>\";\r\n }\r\n if(!empty($_SESSION['DeFlea'])){ mark($Pre . \"</ul><br> $Post\",__FUNCTION__ .\"Returned \"); }\r\n return $Pre . \"</ul><br> $Post\";\r\n}",
"function print_lists($array1) {\n\techo '<ul>';\n\tfor($i = 0; $i < count($array1); $i++) {\n\t\techo '<li>' . $array1[$i] . '</li>';\n\t}\n\techo '</ul>';\n}",
"function PrintArr($a,$type){\n\tif($type==1)\n\t\techo \"<hr>\". implode(\"<br>\", $a);\n\telse {\n\t\tfor($i = 0; $i<count($a); $i++){\n\t\t\tfor($j = 0; $j<count($a[$i]); $j++){\n\t\t\t\techo \"<br> a[$i][$j]\". $a[$i][$j];\n\t\t\t}\n\t\t}\t\t\n\t}\n}",
"function array2ul($asData, $ssCustomUlClass = \"\", $ssCustomLiClass = \"\")\n {\n $ssHtml = \"<ol $ssCustomUlClass>\";\n foreach ($asData as $key => $elem)\n {\n if (!is_array($elem))\n {\n $ssHtml = $ssHtml . \"<li $ssCustomLiClass>$elem</li>\";\n }\n else\n $ssHtml = $ssHtml . \"<li $ssCustomLiClass>\" . array2ul($elem) . \"</li>\";\n }\n $ssHtml = $ssHtml . \"</ol>\";\n return $ssHtml;\n }",
"static public function arrayToList($tree)\n {\n\n $out = '<ul>';\n foreach($tree as $key => $docs)\n {\n $out.= '<li>'.$key;\n if (is_array($docs))\n {\n $out .= self::arrayToDocumentList($docs);\n }\n\n $out.= '</li>';\n }\n $out.= '</ul>';\n\n return $out;\n }",
"function listArr($array)\n {\n $st = \"\";\n for($i=0;$i<count($array);$i++)\n {\n /**\n * check the condition and add the data in the particular index array using linkedlist\n * as per the hashtable data can be print from top to bottom &\n * within the slot from right to left \n */\n if($array[$i]->getString1()!=null)\n $st = $st.$array[$i]->getString1().\" \";\n }\n return substr($st,0,-1).\"\\n\";\n }",
"function printarray($arr) {\n\techo \"<pre>\" . print_r($arr) . \"</pre>\";\n}",
"function list_contents($array,$break=\"<br>\",$tab=\" \",$indent=0) { \r\n\t\twhile(list($key, $value) = each($array)) {\r\n\t\t\tfor($i=0; $i<$indent; $i++) $current .= $tab;\r\n\t\t\t\tif (is_array($value)) {\r\n\t\t\t\t\t$reveal .= \"$current$key : Array: \" . $break . \"$current{\" . $break . \"\";\r\n\t\t\t\t\t$reveal .= LIST_CONTENTS($value,$tab,$indent+1).\"$current}\" . $break . \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse $reveal .= \"$current$key => $value\" . $break . \"\";\r\n\t\t\t\t$current = NULL;\r\n\t\t\t}\r\n\t\treturn $reveal;\r\n\t}",
"function showarray($array) {\n\t\techo \"<br><pre>\\n\";\n\t\tvar_dump($array);\n\t\techo \"</pre><br>\\n\";\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare project search form | public function createComponentProjectSearchForm()
{
return new ProjectSearchForm();
} | [
"public function actionProjects() {\n $projects = new SimpleProjectSearchForm();\n $projects->unsetAttributes(); // clear any default values\n if (isset($_GET['SimpleProjectSearchForm']))\n $projects->attributes = $_GET['SimpleProjectSearchForm'];\n\n $this->renderPartial('_projects', array('projects' => $projects));\n }",
"public static function searchForm() {}",
"public function search()\n\t{\n\t\t$term = $this->input->get('term');\n\t\t$results = Auto_Modeler_ORM::factory('project')->search($term);\n\t\t$this->view->results = $results;\n\t}",
"function tpl_searchform()\n {\n\tglobal $ID;\n\tglobal $INPUT;\n\tglobal $conf;\n\n\t$query = $INPUT->str('selectsearch_query');\n\t$namespace = $INPUT->str('selectsearch_namespace');\n\n\t// build namespace dropdown (optional)\n\t$namespaces = array();\n\t$nslist = explode(PHP_EOL, trim($this->getConf('searchnamespaces')));\n\tif ($nslist)\n\t{\n\t foreach ($nslist as $ns)\n\t {\n\t\tlist($ns, $text) = explode(\"|\", $ns);\n\t\t$ns = trim($ns);\n\t\t$text = trim($text);\n\n\t\t// replace macro @NS@ with current namespace\n\t\tif ($ns == '@NS@')\n\t\t{\n\t\t if ($ID == $conf['start']) {\n\t\t\tcontinue;\n\t\t }\n\t\t $ns_start = '@' . getNS($ID);\n\t\t $ns = getNS($ID);\n\t\t if ($ns) {\n\t\t\t$ns = '@' . $ns;\n\t\t }\n\t\t $pt = p_get_first_heading($ns . ':' . $conf['start']);\n\t\t if (strlen($pt) > 15) {\n\t\t\t$pt = substr($pt,0,15) . '...'; # shorten displaytext\n\t\t }\n\t\t $text = str_replace('@TITLE@', $pt, $text);\n\t\t}\n\t\t$namespaces[$ns] = $text;\n\t }\n\t}\n\n #$html = '<form id=\"dw__selectsearch\" class=\"search\" method=\"post\" accept-charset=\"utf-8\" action=\"\">';\n $html = '<form id=\"dw__selectsearch\" class=\"search\" method=\"get\" accept-charset=\"utf-8\" action=\"\">';\n $html .= '<div class=\"no\">';\n $html .= '<input type=\"hidden\" name=\"do\" value=\"search\" />';\n $html .= '<input type=\"hidden\" name=\"id\" value=\"'.$ID.'\" />';\n $html .= '<input type=\"hidden\" id=\"selectsearch__curpage\" name=\"selectsearch_curpage\" value=\"1\" />';\n\tif ($namespaces)\n\t{\n\t $html .= '<select class=\"selectsearch_namespace\" name=\"selectsearch_namespace\">';\n\t foreach ($namespaces as $ns => $text){\n\t\t$html .= '<option value=\"' . hsc($ns) . '\"';\n\t\tif ($ns == $namespace) {\n\t\t $html .= ' selected=\"selected\"';\n\t\t}\n\t\t$html .= '>' . hsc($text) . '</option>';\n\t }\n\t $html .= '</select>';\n\t}\n $html .= '<input type=\"hidden\" id=\"qsearch__in\"/>';\n\t$html .= '<input class=\"edit\" id=\"selectsearch__input\" type=\"text\" name=\"selectsearch_query\" autocomplete=\"off\" title=\"[F]\" value=\"'.hsc(preg_replace('/ ?[\\^@]\\S+/','',$query)).'\" accesskey=\"f\" />';\n $html .= '<input class=\"button\" type=\"submit\" title=\"Search\" value=\"Search\">';\n# $html .= '<div id=\"qsearch__out\" class=\"ajax_qsearch JSpopup\" style=\"display: none;\"></div>';\n $html .= '</div>';\n $html .= '</form>';\n\treturn $html;\n }",
"function generateSearchView() {\n\t\t//Parameter werden gelesen\n\t\t$parameter = t3lib_div::_GET($this->prefixId);\n $url=$this->pi_getPageLink($GLOBALS['TSFE']->id); //Seitenid wird in url gespeichert\n\t\t\n\t\t\n\t\t//Überprüfung ob Parameter übergeben wurde\n\t\tif($parameter == NULL){\n\t\t\t$all = array( $this->prefixId => array( 'mode' => 'all', 'suche' => $this->piVars['search'], 'feld' => $this->piVars['field']));\n\t\t\t$publication = array( $this->prefixId => array( 'mode' => 'publ', 'suche' => $this->piVars['search'], 'feld' => $this->piVars['field']));\n\t\t\t$researcher = array( $this->prefixId => array( 'mode' => 'researcher', 'suche' => $this->piVars['search'], 'feld' => $this->piVars['field']));\n\t\t\t$projects = array( $this->prefixId => array( 'mode' => 'projects', 'suche' => $this->piVars['search'], 'feld' => $this->piVars['field']));\n\t\t}\n\t\telse{\n\t\t\t$all = array( $this->prefixId => array( 'mode' => 'all', 'suche' => $parameter['suche'], 'feld' => $parameter['feld']));\n\t\t\t$publication = array( $this->prefixId => array( 'mode' => 'publ', 'suche' => $parameter['suche'], 'feld' => $parameter['feld']));\n\t\t\t$researcher = array( $this->prefixId => array( 'mode' => 'researcher', 'suche' => $parameter['suche'], 'feld' => $parameter['feld']));\n\t\t\t$projects = array( $this->prefixId => array( 'mode' => 'projects', 'suche' => $parameter['suche'], 'feld' => $parameter['feld']));\n\t\t}\t\t\n\t\t \n\t\t \n\t\tdebug($parameter,'Parameter:');\n\t\t//debug($this->piVars['search'],'Suche:');\n\t\t// Template laden\n \n if (isset($this->conf[\"templateFile\"]))\n $template = $this->cObj->fileResource($this->conf[\"templateFile\"]);\n else\n\t\t\t$template = $this->cObj->fileResource($this->standardTemplate);\n\n\t\t\t\n\t\t// Subpart aus Template laden\n\t\t$subpart = $this->cObj->getSubpart($template,\"###SEARCH_TEMPLATE###\");\n\t\n\t // set marker replacements -- Suchformular wird erstellt\n\t\t\n\t\t$markerARRAY['###SEARCH_TITLE###'] = $this->pi_getLL('search');\n\t\t$markerARRAY['###SEARCH_BEGIN_FORM###']= '<form method=\"POST\" action=\"'.$url.'\">';\n\t\t$markerARRAY['###SEARCH_SEARCH_FOR_DESC###'] = $this->pi_getLL('search.searchfor');\n\t\t$markerARRAY['###SEARCH_SEARCH_WHAT_DESC###'] = $this->pi_getLL('search.searchwhat');\n\t\t//$markerARRAY['###SEARCH_SEARCH_IN_DESC###'] = $this->pi_getLL('search.infield'); \n\t\t$markerARRAY['###SEARCH_SEARCH_NAME_DESC###'] = $this->pi_getLL('search.inname'); \n\t\t$markerARRAY['###SEARCH_SEARCH_FB_DESC###'] = $this->pi_getLL('search.infb'); \n\t\t$markerARRAY['###SEARCH_SEARCH_FSP_DESC###'] = $this->pi_getLL('search.infsp'); \n\t\t$markerARRAY['###SEARCH_SEARCH_YEAR_DESC###'] = $this->pi_getLL('search.inyear');\n\t\t\n\t\t\t\n\n\t\t$markerARRAY['###SEARCH_SEARCH_FOR_FIELD###'] = '<input name=\"'.$this->prefixId.'[search]\" type=\"text\" />';\n\t\t$markerARRAY['###SEARCH_SEARCH_ALL_FIELD###'] = $this->pi_linkToPage($this->pi_getLL('search.all'),$GLOBALS['TSFE']->id,'',$all);\n\t\t$markerARRAY['###SEARCH_SEARCH_RESEARCHER_FIELD###'] = $this->pi_linkToPage($this->pi_getLL('search.researcher'),$GLOBALS['TSFE']->id,'',$researcher);\n\t\t$markerARRAY['###SEARCH_SEARCH_PROJECTS_FIELD###'] = $this->pi_linkToPage($this->pi_getLL('search.projects'),$GLOBALS['TSFE']->id,'',$projects);\n\t\t$markerARRAY['###SEARCH_SEARCH_PUBLICATIONS_FIELD###'] = $this->pi_linkToPage($this->pi_getLL('search.publications'),$GLOBALS['TSFE']->id,'',$publication); \n\t\t\n\t\t\n\t\t$resultnamen = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,name','tx_foportal_profile','name!=\"\" AND deleted=\"0\"','','name');\n\t\t$resultfb = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,fachbereich','tx_foportal_fachbereiche','fachbereich!=\"\" AND deleted=\"0\"','','fachbereich');\n\t\t$resultfsp = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,forschungsschwerpunkt','tx_foportal_forschungsschwerpunkte','forschungsschwerpunkt!=\"\" AND deleted=\"0\"','','forschungsschwerpunkt');\n\t\t\n\t\t//Die Jahreszahlen zum Filtern werden aus den Projekten und Publikationen ermittelt und über \"UNION\" zusammengefasst.\n\t\t$sqlJahr1 = 'SELECT DISTINCT tx_foportal_publikationen.jahr FROM tx_foportal_publikationen';\n\t\t$sqlJahr2 = 'SELECT DISTINCT tx_foportal_projekte.jahr FROM tx_foportal_projekte';\n\t\t$sqlJahrAll = '(' . $sqlJahr1 . ') UNION (' . $sqlJahr2 . ')';\n\t\t$sqlJahrAll .= 'ORDER BY Jahr DESC' ;\n\t\t$resultjahr = $GLOBALS['TYPO3_DB']->sql_query($sqlJahrAll);\n\t\t\n\t\t\n\n\t\t\n\t\t$markerARRAY['###SEARCH_SEARCH_NAME_FIELD###'] = '<select name=\"'.$this->prefixId.'[name]\" >'.\n '<option value=\"0\">'.$this->pi_getLL('search.allname').'</option>';\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultnamen)) {\n $markerARRAY['###SEARCH_SEARCH_NAME_FIELD###'].='<option value=\"'.$row['name'].'\">'.$row['name'].'</option>';\n }\n\t\t$markerARRAY['###SEARCH_SEARCH_NAME_FIELD###'].='</select>';\n\t\t\n\t\t$markerARRAY['###SEARCH_SEARCH_FB_FIELD###'] = '<select name=\"'.$this->prefixId.'[fb]\" >'.\n '<option value=\"0\">'.$this->pi_getLL('search.allname').'</option>';\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultfb)) {\n $markerARRAY['###SEARCH_SEARCH_FB_FIELD###'].='<option value=\"'.$row['fachbereich'].'\">'.$row['fachbereich'].'</option>';\n }\n\t\t$markerARRAY['###SEARCH_SEARCH_FB_FIELD###'].='</select>';\n\t\t\n\t\t$markerARRAY['###SEARCH_SEARCH_YEAR_FIELD###'] = '<select name=\"'.$this->prefixId.'[year]\" >'.\n '<option value=\"0\">'.$this->pi_getLL('search.allyear').'</option>';\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultjahr)) {\n\t\t\t$i = 1;\n $markerARRAY['###SEARCH_SEARCH_YEAR_FIELD###'].='<option value=\"'.$row['jahr'].'\">'.$row['jahr'].'</option>';\n\t\t\t$i += 1;\n }\n\t\t$markerARRAY['###SEARCH_SEARCH_YEAR_FIELD###'].='</select>';\n\t\t\n\t\t$markerARRAY['###SEARCH_SEARCH_FSP_FIELD###'] = '<select name=\"'.$this->prefixId.'[fsp]\" >'.\n '<option value=\"0\">'.$this->pi_getLL('search.allname').'</option>';\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resultfsp)) {\n $markerARRAY['###SEARCH_SEARCH_FSP_FIELD###'].='<option value=\"'.$row['forschungsschwerpunkt'].'\">'.$row['forschungsschwerpunkt'].'</option>';\n }\n\t\t$markerARRAY['###SEARCH_SEARCH_FSP_FIELD###'].='</select>';\n\t\t\n\t\t$markerARRAY['###SEARCH_SUBMIT###'] = '<input type=\"submit\" value=\"'.$this->pi_getLL('search.submit').'\"/>';\n\t\t$markerARRAY['###SEARCH_END_FORM###'] = '</form>';\n\t\t\n\t\t//subsitute\n\t\t$content .= $this->cObj->substituteMarkerArray($subpart,$markerARRAY);\n\t\n\t\n \n \n return $content;\n\n\t}",
"function search_form() {\n global $CFG;\n return new search_form(\"$CFG->wwwroot/blocks/helpdesk/search.php\", null, 'post');\n }",
"public function initStandardSearchForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\t\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\n\t\t// search term\n\t\t$ti = new ilTextInputGUI($lng->txt(\"search_search_term\"), \"term\");\n\t\t$ti->setMaxLength(200);\n\t\t$ti->setSize(30);\n\t\t$ti->setValue($this->getString());\n\t\t$dsSchema = array(\"resultsList\" => 'response.results',\n\t\t\t\"fields\" => array('term'));\n\t\t$ti->setDataSource($ilCtrl->getLinkTarget($this, \"autoComplete\", \"\", false, false));\n\t\t$ti->setDataSourceSchema($dsSchema);\n\t\t$ti->setDataSourceResultFormat($dsFormatCallback);\n\t\t$ti->setDataSourceDelimiter($dsDelimiter);\n\t\t$this->form->addItem($ti);\n\t\t\n\t\t// term combination \n\t\t$radg = new ilRadioGroupInputGUI($lng->txt(\"search_term_combination\"),\n\t\t\t\"combination\");\n\t\t$radg->setValue(($this->getCombination() == SEARCH_AND) ? \"and\" : \"or\");\n\t\t$op1 = new ilRadioOption($lng->txt(\"search_any_word\"), \"or\");\n\t\t$radg->addOption($op1);\n\t\t$op2 = new ilRadioOption($lng->txt(\"search_all_words\"), \"and\");\n\t\t$radg->addOption($op2);\n\t\t$this->form->addItem($radg);\n\t\t\n\t\t// search area\n\t\tinclude_once(\"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php\");\n\t\t$ti = new ilRepositorySelectorInputGUI($lng->txt(\"search_area\"), \"area\");\n\t\t$ti->setSelectText($lng->txt(\"search_select_search_area\"));\n\t\t$this->form->addItem($ti);\n\t\t$ti->readFromSession();\n\t\t\n\t\t// search type\n\t\t$radg = new ilRadioGroupInputGUI($lng->txt(\"search_type\"), \"type\");\n\t\t$radg->setValue($this->getType() == SEARCH_FAST ? SEARCH_FAST : SEARCH_DETAILS);\n\t\t$op1 = new ilRadioOption($lng->txt(\"search_fast_info\"), SEARCH_FAST);\n\t\t$radg->addOption($op1);\n\t\t$op2 = new ilRadioOption($lng->txt(\"search_details_info\"), SEARCH_DETAILS);\n\t\t\n\t\t\t// resource types\n\t\t\t$details = $this->getDetails();\n\t\t\treset($this->obj_types);\n\t\t\tforeach ($this->obj_types as $k => $t)\n\t\t\t{\n\t\t\t\t$cb = new ilCheckboxInputGUI($t, $k);\n\t\t\t\t$cb->setChecked($details[$k]);\n\t\t\t\t$op2->addSubItem($cb);\n\t\t\t}\n\t\t\t\n\t\t$radg->addOption($op2);\n\t\t$this->form->addItem($radg);\n\t\t\n\t\t\n\t\t// search command\n\t\t$this->form->addCommandButton(\"performSearch\", $lng->txt(\"search\"));\n\t \n\t\t$this->form->setTitle($lng->txt(\"search\"));\n\t\t$this->form->setFormAction($ilCtrl->getFormAction($this,'performSearch'));\n\t \n\t}",
"function searchBox() {\n\t\tglobal $wgUseTwoButtonsSearchForm; ?>\n\t\t<form action=\"<?php $this->text('wgScript'); ?>\" class=\"searchform\">\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchInput(array('id' => 'searchInput', 'class' => 'form-control')); ?>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchButton('go', array( 'class' => 'btn btn-primary' )); ?>\n\t\t\t</div>\n\t\t</form><?php\n\t}",
"function SearchForm() {\n error_log(\"Show search form\");\n\n // show search term or empty text\n $searchText = isset($this->Query) ? $this->Query : '';\n\n $tf = new TextField(\"Search\", \"\", $searchText);\n $tf->addExtraClass('span6');\n\n\n \n $fields = new FieldSet(\n $tf\n );\n\n $fa = new FormAction('results', _t('SearchPage.SEARCH', 'Search'));\n\n // for bootstrap\n $fa->useButtonTag = true;\n $fa->addExtraClass('btn');\n $fa->addExtraClass('btn-primary');\n \n $actions = new FieldSet(\n $fa\n );\n\n\n $requiredFields = new RequiredFields(); \n $requiredFields->set_javascript_validation_handler('none');\n\n \n $form = new SearchForm($this, \"SearchForm\", $fields, $actions, $requiredFields);\n $form->setTemplate('HorizontalForm');\n\n $form->addExtraClass('form-inline');\n\n $form->Horizontal = true;\n\n return $form;\n }",
"private function build_simple_search_form()\n {\n $this->renderer->setElementTemplate('<div style=\"vertical-align: middle; float: left;\">{element}</div>');\n $this->addElement(\n 'text',\n self::PARAM_SIMPLE_SEARCH_QUERY,\n Translation::get('Search', null, Utilities::COMMON_LIBRARIES),\n 'size=\"20\" class=\"search_query\"');\n\n $this->addElement('style_submit_button', 'submit', null, array('class' => 'search'));\n\n if ($this->get_query())\n {\n $this->addElement('style_submit_button', 'clear', null, array('class' => 'clear', 'value' => 'clear'));\n }\n }",
"public function postProjectSearch(Request $request){\n\n $keyword=$request['keyWords'];\n $filter=$request['filter'];\n $projects=Project::all();\n $resultProjects=new Collection();\n foreach($projects as $project){\n\n if( (strpos($filter, 'id') !== false) and Str::equals(Str::lower($project->id),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n foreach($projects as $project){\n if($resultProjects->contains($project)){\n continue;\n }\n if((strpos($filter, 'client') !== false) and Str::contains(Str::lower($project->client_name),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n if((strpos($filter, 'title') !== false) and Str::contains(Str::lower($project->title),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n else if((strpos($filter, 'date') !== false) and Str::contains(Str::lower($project->date),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n return View::make('/project_management/search_results')->with('resultProjects',$resultProjects);\n }",
"private function _form_search_box() {\n $this->CI->form->init();\n $this->CI->form->set_name('search');\n $this->CI->form->set_uri($this->properties['uri']);\n $this->CI->form->open();\n $this->CI->form->hidden(array('name' => 'crud_action', 'value' => 'search'));\n $this->CI->form->dropdown(array('name' => 'form_search_field', 'options' => $this->fields['search'], 'selected' => $this->CI->input->post('form_search_field')));\n $this->CI->form->input(array('name' => 'form_search_content', 'value' => $this->CI->input->post('form_search_content')));\n $this->CI->form->submit(array('value' => 'Search', 'class' => 'crud_button'));\n $this->CI->form->close();\n $form = $this->CI->form->render();\n $returns = '<div id=\"form_search_box\">';\n $returns .= $form;\n $returns .= '</div>';\n return $returns;\n }",
"function property_search_form( $formwidth, $inputclass, $fullwidth, $halfwidth, $halfwidthmargin, $buttonwidth ) \n\n{\n\t\t$search_page = esc_url( get_bloginfo( 'url' )).\"/property-search-results/\"; \n\t\t\n\t\techo '<form method=\"get\" id=\"search-form\" class=\"'.$formwidth.'\" action=\"'.$search_page.'\" >';\n\n\t\t( isset( $_GET['sort'] ) && $_GET['sort'] ) ? $sort = $_GET['sort'] : $sort = '';\n\t\techo '<input type=\"hidden\" name=\"sort\" value=\"'.$sort.'\">';\n\n//\t\t( isset( $_GET['price_sort'] ) && $_GET['price_sort'] ) ? $price_sort = $_GET['price_sort'] : $price_sort = '';\n//\t\techo '<input type=\"hidden\" name=\"price_sort\" value=\"'.$price_sort.'\">';\n\n\n\t\t// Location Label\n\t\techo '<div class=\"'.$inputclass.' '.$fullwidth.'\">';\n\t\t\techo '<label>Ubicación</label>';\n\t\t\t\t( isset( $_GET['location'] ) && $_GET['location'] ) ? $location = $_GET['location'] : $location = '';\n\t\t\t// Location input\n\t\t\techo '<input id=\"location\" name=\"location\" value=\"'.$location.'\">';\n\t\techo '</div>';\n\n\n\t\t// Property Type Label\n//\t\t$property_default_types = array('select', 'flat', 'house', 'mansion');\n\n//\techo '<pre>';\n//\tvar_dump(get_field_object('field_5669c4b43e76f'));\n//\techo '</pre>';\n\t$property_default_types = array('Seleccionar');\n\tforeach(@get_field_object('field_5669c4b43e76f')['choices'] as $meta_k => $meta_v) {\n\t\t$property_default_types[] = $meta_k;\n\t}\n\t\techo '<div class=\"'.$inputclass.' '.$fullwidth.'\">';\n\t\t\techo '<label>Tipo de Propiedad</label>';\n\t\t\t// Property Type Dropdown\n\t\t\techo '<select name=\"type\" id=\"type\">';\n\t\t\t\tforeach( $property_default_types as $type ) {\n\t\t\t\t\tif( isset($_GET['type']) && $_GET['type'] == $type ) {\n\t\t\t\t\t\techo '<option selected=\"selected\" value=\"'.$_GET['type'].'\">'.ucfirst( $_GET['type'] ).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo '<option value=\"'.$type.'\">'.ucfirst($type).'</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\techo '</select>';\n\t\techo '</div>';\n\n\n\t\t// Buy or Rent Label\n\t\t$buy_rent_defaults = array('Seleccionar', 'Comprar', 'Rentar');\n\t\techo '<div class=\"'.$inputclass.' '.$fullwidth.'\">';\n\t\t\techo '<label>Venta o Renta</label>';\n\t\t\t// By or Rent Dropdown \n\t\t\techo '<select name=\"buyrent\" id=\"buyrent\">';\n\t\t\t\tforeach($buy_rent_defaults as $type_buy_rent) {\n\t\t\t\t\tif( isset( $_GET['buyrent'] ) && $_GET['buyrent'] == $type_buy_rent ) {\n\t\t\t\t\t\techo '<option selected=\"selected\" value=\"'.$_GET['buyrent'].'\">'.ucfirst($_GET['buyrent']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo '<option value=\"'.$type_buy_rent.'\">'.ucfirst($type_buy_rent).'</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\techo '</select>';\n\t\techo '</div>';\n\n\n\t\t // Number of Bedrooms Label\n\t\techo '<div class=\"'.$inputclass.' '.$fullwidth.'\">';\n\t\t\techo '<label>Recámaras</label>';\n\t\t\t// Number of Bedrooms Dropdown\n\t\t\techo '<div class=\"'.$halfwidth.' no-margin \">';\t\t\t\n\t\t\t\t\troomsDropdown('room_no_min',1,10,1,$_GET['room_no_min'],'class=\"smalldropdown-first\" ');\n\t\t\t\techo '</div>';\t\t\t\n\t\t\techo '<div class=\"'.$halfwidth.' no-margin \">';\t\n\t\t\t\t\troomsDropdown('room_no_max',1,10,1,$_GET['room_no_max'],'class=\"smalldropdown\" ');\n\t\t\t\techo '</div>';\n\t\techo '</div>';\n\n\n\t\t // Price or Rent\n\t\techo '<div class=\"'.$inputclass.' '.$fullwidth.'\">';\t\t\n\t\t\techo '<label>Precio/Renta</label>';\n\t\t\t // Dropdown for Price\n\t\t\techo '<div id=\"rsbuy\">';\n\t\t\t\techo '<div class=\"'.$halfwidth.' no-margin \">';\n\t\t\t\t\t\t\tpriceDropdown('min_val_buy',\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['buy_min_price'],\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['buy_max_price'],\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['buy_increments'],\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['currency'],\n\t\t\t\t\t\t\t\t$_GET['min_val_buy'],\n\t\t\t\t\t\t\t\t'class=\"smalldropdown-first\" ');\n\t\t\t\techo '</div>';\n\t\t\t\techo '<div class=\"'.$halfwidth.' no-margin \">';\n\t\t\t\t\t\t\tpriceDropdown('max_val_buy',\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['buy_min_price'],\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['buy_max_price'],\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['buy_increments'],\n\t\t\t\t\t\t\t\t$GLOBALS['theme_settings']['currency'],\n\t\t\t\t\t\t\t\t$_GET['max_val_buy'],\n\t\t\t\t\t\t\t\t'class=\"smalldropdown\" ');\n\t\t\t\techo '</div>';\n\t\t\techo '</div>';\n\t\techo '</div>';\n\n\n\t\t// Dropdown for Rent\n\t\techo '<div id=\"rsrent\">';\n\t\t\techo '<div class=\"'.$halfwidth.'\">';\t\n\t\t\t\t\tpriceDropdownRent('min_val_rent',\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rent_min'],\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rent_max'],\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rent_increments'],\n\t\t\t\t\t\t$GLOBALS['theme_settings']['currency'],\n\t\t\t\t\t\t$_GET['min_val_rent'],\n\t\t\t\t\t\t'class=\"smalldropdown-first\" ',\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rental_period']);\n\t\t\techo '</div>';\n\n\t\t\techo '<div class=\"'.$halfwidth.'\">';\t\n\t\t\t\t\tpriceDropdownRent('max_val_rent',\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rent_min'],\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rent_max'],\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rent_increments'],\n\t\t\t\t\t\t$GLOBALS['theme_settings']['currency'],\n\t\t\t\t\t\t$_GET['max_val_rent'],\n\t\t\t\t\t\t'class=\"smalldropdown\" ',\n\t\t\t\t\t\t$GLOBALS['theme_settings']['rental_period']);\t\t\n\t\t\techo '</div>';\n\t\techo '</div>';\n\n\n\t\t// Submit Button\n\t\techo '<div class=\"'.$buttonwidth.'\">';\t\t\n\t\t\techo '<button type=\"submit\" class=\"search-button\">Buscar</button> ';\n\t\techo '</div>';\n\n\t\techo '</form>';\n}",
"public function getSearchForm()\n {\n $data = [];\n $options = ['pid' => $this->options['pid']];\n\n $this->setFilterValue('searchword', $this->showFreeTextSearchForm(\n $data['search'],\n $this->getSearcherId().'Search',\n $options\n ));\n\n $this->setFilterValue(self::KEY_SHOWHIDDEN, $this->showHiddenSelector(\n $data['hidden'],\n $options\n ));\n\n $this->addMoreFields($data, $options);\n if ($updateButton = $this->getSearchButton()) {\n $data['updatebutton'] = [\n 'label' => '',\n 'button' => $updateButton,\n ];\n }\n\n $out = $this->buildFilterTable($data);\n\n return $out;\n }",
"public function searchAction() {\n\t\t$form = $this->getForm ( '/admin/tickets/searchprocess' );\n\t\t$form->getElement ( 'save' )->setName ( 'search' );\n\t\t\n\t\t$this->view->form = $form;\n\t\t$this->render ( 'searchform' );\n\t}",
"function search_form() {\n $form = '';\n locate_template('/components/form/search.php', true, false);\n return $form;\n }",
"function buildSearchPanel() \r\n\t{\r\n\t\tif( !$this->permis[ $this->tName ]['search'] )\r\n\t\t\treturn;\r\n\t\t\r\n\t\t$params = array();\r\n\t\t$params['pageObj'] = &$this;\r\n\t\t$params['panelSearchFields'] = $this->panelSearchFields;\r\n\t\t$this->searchPanel = new SearchPanelLookup($params);\r\n\t\t$this->searchPanel->buildSearchPanel();\r\n\t}",
"public function buildForm();",
"public function widget_search()\n {\n $search_form = new Form_Backend_SearchProducts();\n\n $search_form->set_defaults(array(\n 'search_text' => URL::decode($this->request->param('search_text')),\n 'active' => $this->request->param('active')\n ));\n\n if ($search_form->is_submitted())\n {\n $params = $search_form->get_values();\n $params['search_text'] = URL::encode($params['search_text']);\n\n $this->request->redirect(URL::uri_self($params));\n }\n\n return $search_form;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change data from 0 or '' to null. | private static function _changeEmptyToNull(array $data)
{
// If the field is not set in form, the value is empty string.
// We want the value of field which is not set to be null.
foreach($data as $key=>$value)
{
if(empty($value))
{
$data[$key] = null;
}
}
return $data;
} | [
"private function setNull() {\n foreach ($this->data as $Key => $Value):\n $this->data[$Key] = ($Value == \"\" ? null : $Value);\n endforeach;\n }",
"public function setNullData();",
"public function setZeroPointsToNull() {\n\t\tforeach ($this->Data as $series => $data) {\n\t\t\t$this->Data[$series]['data'] = array_map(\"PLOT__setZeroToNullMapper\", $data['data']);\n\t\t}\n\t}",
"public function null()\n {\n $this->dataFields[$this->current] .= \" NULL\";\n }",
"protected function _setEmptyFieldsToNull(array &$data) {\n array_walk($data, array('Ticketevolution_Db_Table_Abstract', '_emptyFieldsToNull'));\n }",
"function nullTester($data){\n\t\tif($data == null || $data == \"NULL\"){\n\t\t\treturn \"none\";\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function reset_data() {\n\t\t$this->data = null;\n\t}",
"function nulltoo($arr){\n if($arr !== null){\n if(is_array($arr)){\n if(!empty($arr)){\n foreach($arr as $key => $value){\n if($value === null){\n $arr[$key] = '0';\n }else{\n $arr[$key] = $this->nulltostr($value);\n }\n }\n }else{ $arr = '0'; }\n }else{\n if($arr === null){ $arr = '0'; }\n }\n }else{ $arr = '0'; }\n return $arr;\n }",
"function setNullIfBlancOrZero($value)\n{\n if (strlen($value) > 0 and $value != '0' and $value != 0){\n return $value;\n }\n return null;\n}",
"public function uncast() {\n\t\tif ($this->value === false) { // force boolean false to 0 instead of ''\n\t\t\t$this->value = '0';\n\t\t}\n\t\telse {\n\t\t\tsettype($this->value, 'string');\n\t\t}\n\t}",
"protected function parseNull()\n {\n $this->null = ($this->column->Null == 'YES');\n }",
"public function setNullWhenEmpty($flag);",
"public function testConvertTokensNull() {\n $value = $this->plugin->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');\n $this->assertEquals('', $value);\n }",
"function null_val_zero($val)\n{\n\n\treturn $val == \"\" ? 0 : $val;\n\n}",
"function setBlankValues() {\n $this->id = self::NULL;\n $this->dt= $_SERVER['REQUEST_TIME'];\n $fields = $this->getFields();\n }",
"private function resetData()\n {\n $this->originalKeyVal = null;\n\n $this->data = null;\n }",
"function null_zero($v)\n\t{\n\t\tif($v == \"\")\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn $v;\n\t}",
"function strtoo($arr){\n if($arr !== \" \"){\n if(is_array($arr)){\n if(!empty($arr)){\n foreach($arr as $key => $value){\n if($value === \" \"){\n $arr[$key] = '0';\n }else{\n $arr[$key] = nulltostr($value);\n }\n }\n }else{ $arr = '0'; }\n }else{\n if($arr === \" \"){ $arr = '0'; }\n }\n }else{ $arr = '0'; }\n return $arr;\n}",
"function undef2null($value)\r\n{\r\n\tif ($value == -9999)\r\n\t\treturn 'NULL';\r\n\treturn $value;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna o valor do parametro navDel do Grid | public function getNavDel() {
return $this->_getGridParam('navDel');
} | [
"function get_eliminar_pagina($vals,$args){\n\textract($vals);\n\textract($args);\n\treturn \"<a href=eliminar_pagina.php?contenido={$record['modpag_id']}><i class='fa fa-trash-o text-bg text-danger'></i></a>\";\n}",
"protected function dammiValoreParametroLink($param)\n\t\t{\n\t\tif ($this->daSql())\n\t\t\t{\n\t\t\t$indiceCampo = $this->righeDB->indiceCampo($param);\n\t\t\t$valore = isset($indiceCampo) ? $this->record->valore($param) : $param;\n\t\t\t}\n\t\telse\n\t\t\t$valore = array_key_exists($param, $this->record) ? \n\t\t\t\t\t\t$this->record[$param] : $param;\n\t\t\t\n\t\treturn $valore;\n\t\t}",
"function get_eliminar_modulo($vals,$args){\n\textract($vals);\n\textract($args);\n\t\n\t$do_modulo = DB_DataObject::factory('modulo');\n\t$do_modulo -> mod_id = $record[$id];\n\t$do_modulo -> mod_baja = '0';\n\tif ($do_modulo -> find(true)){\n\t\treturn \"<a href=eliminar_modulo.php?contenido={$record['mod_id']}><i class='fa fa-trash-o text-bg text-danger'></i></a>\";\n\t}\n}",
"private function _getGridParam($key) {\n $grid = $this->getJQueryParam('grid');\n return $grid[$key];\n }",
"function get_eliminar_puesto($vals,$args){\n\textract($vals);\n\textract($args);\n\t\n\t$do_puesto = DB_DataObject::factory('puesto');\n\t$do_puesto -> puesto_id = $record[$id];\n\t$do_puesto -> puesto_baja = '0';\n\tif ($do_puesto -> find(true)){\n\t\treturn \"<a href=eliminar_puesto.php?contenido={$record[$id]}><i class='fa fa-trash-o text-bg text-danger'></i></a>\";\n\t}\n}",
"function get_eliminar_provincia($vals,$args){\n\textract($vals);\n\textract($args);\n\t\n\t$do_provincia = DB_DataObject::factory('provincia');\n\t$do_provincia -> provincia_id = $record[$id];\n\t$do_provincia -> provincia_baja = '0';\n\tif ($do_provincia -> find(true)){\n\t\treturn \"<a href=eliminar_provincia.php?contenido={$record[$id]}><i class='fa fa-trash-o text-bg text-danger'></i></a>\";\n\t}\n}",
"public function getGridUrl(){\n\t\treturn $this->getUrl('*/*/grid', array('_current'=>true));\n\t}",
"public function getGridUrl(){\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }",
"public function onDeleteCommand($param)\n\t{\n\t\t$this->raiseEvent('OnDeleteCommand',$this,$param);\n\t}",
"public function getDelIndex ()\n {\n return $this->del_index;\n }",
"public function delete_accessor($param, $post_params) {\n\t\t\n\t\t//define tags for parent tags and child tag\n\t\t$parent_tag = 'results'; $child_tag = 'result';\n\t\t\n\t\t//handle authentication\n\t\t\n\t\t//initalizing and set default for params\n\t\t$statement = ''; $param[0] = set_default($param[0], '');\n\t\t\n\t\t//handle $param parsing\t\n\t\tif(is_ready($param[0]) == false) { //delete all records\n\t\t\tWriter::write(501, 'Method not implemented.', Constants::get('error_tag'), parent::get_route()->get_return_type());\n\t\t} else if(count($param) == 1) { \n\t\t\tif (is_numeric($param[0])) { //delete record based on the id\n\t\t\t\t$statement = 'DELETE FROM accessor WHERE _id = ' .$param[0];\n\t\t\t} else if(is_string($param[0])) { //delete record based on the search term on all columns\n\t\t\t\t\n\t\t\t}\n\t\t} else if(count($param) == 2) { //delete record based on the search term on a row column\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public function getDeleteUrl()\n {\n return $this->getUrl(\n 'adminhtml/*/delete',\n [\n $this->_objectId => $this->getRequest()->getParam($this->_objectId),\n 'type' => $this->_coreRegistry->registry('current_operation')->getOperationType()\n ]\n );\n }",
"public function getDelIndex ()\n {\n\n return $this->del_index;\n }",
"function get_eliminar_area($vals,$args){\n\textract($vals);\n\textract($args);\n\t\n\t$do_area = DB_DataObject::factory('area');\n\t$do_area -> area_id = $record[$id];\n\t$do_area -> area_baja = '0';\n\tif ($do_area -> find(true)){\n\t\treturn \"<a href=eliminar_area.php?contenido={$record[$id]}><i class='fa fa-trash-o text-bg text-danger'></i></a>\";\n\t}\n}",
"function get_nombre_pagina($vals,$args){\n\textract($vals);\n\textract($args);\n\t\n\t$do_paginas = DB_DataObject::factory('modulo_paginas');\n\t$do_paginas -> modpag_id = $record['modpag_id'];\n\tif ($do_paginas -> find(true)){\n\t\t$modulo_id = $do_paginas -> modpag_mod_id;\n\t\t\n\t\t$do_modulo = DB_DataObject::factory('modulo');\n\t\t$do_modulo -> mod_id = $modulo_id;\n\t\tif ($do_modulo -> find(true)){\n\t\t\t$nombre = $do_modulo -> mod_nombre;\n\t\t}\n\t}\t\n\treturn $nombre;\n}",
"public function deleted(TipoParcela $tipoParcela)\n {\n //\n }",
"public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', array('_current'=>true));\n }",
"public function getGridUrl()\n {\n return $this->getUrl('*/*/grid', ['_current'=>true]);\n }",
"public function getGridUrl()\n {\n return $this->getUrl('boleto/returns/view', ['_current' => true]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unset any variables instantiated as a result of register_globals being enabled | function forum_unregister_globals()
{
$register_globals = ini_get('register_globals');
if ($register_globals === '' || $register_globals === '0' || strtolower($register_globals) === 'off')
return;
// Prevent script.php?GLOBALS[foo]=bar
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
exit('I\'ll have a steak sandwich and... a steak sandwich.');
// Variables that shouldn't be unset
$no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
// Remove elements in $GLOBALS that are present in any of the superglobals
$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
foreach ($input as $k => $v)
{
if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
{
unset($GLOBALS[$k]);
unset($GLOBALS[$k]); // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
}
}
} | [
"function unregister_globals()\n{\n\t$register_globals = @ini_get('register_globals');\n\tif ($register_globals === \"\" || $register_globals === \"0\" || strtolower($register_globals === \"off\"))\n\t\treturn;\n\n\t// Prevent script.php?GLOBALS[foo]=bar\n\tif (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))\n\t\texit('I\\'ll have a steak sandwich and... a steak sandwich.');\n\t\n\t// Variables that shouldn't be unset\n\t$no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');\n\n\t// Remove elements in $GLOBALS that are present in any of the superglobals\n\t$input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());\n\tforeach ($input as $k => $v)\n\t{\n\t\tif (!in_array($k, $no_unset) && isset($GLOBALS[$k]))\n\t\t{\n\t\t\tunset($GLOBALS[$k]);\n\t\t\tunset($GLOBALS[$k]);\t// Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4\n\t\t}\n\t}\n}",
"function drupal_unset_globals() {\n if (ini_get('register_globals')) {\n $allowed = array('_ENV' => 1, '_GET' => 1, '_POST' => 1, '_COOKIE' => 1, '_FILES' => 1, '_SERVER' => 1, '_REQUEST' => 1, 'access_check' => 1, 'GLOBALS' => 1);\n foreach ($GLOBALS as $key => $value) {\n if (!isset($allowed[$key])) {\n unset($GLOBALS[$key]);\n }\n }\n }\n}",
"public function unsetReservedGlobalVariables() {}",
"public static function unsetReservedGlobalVariables() {}",
"function deregister_globals()\n\t{\n\t\t$not_unset = array(\n\t\t\t'GLOBALS' => true,\n\t\t\t'_GET' => true,\n\t\t\t'_POST' => true,\n\t\t\t'_COOKIE' => true,\n\t\t\t'_REQUEST' => true,\n\t\t\t'_SERVER' => true,\n\t\t\t'_SESSION' => true,\n\t\t\t'_ENV' => true,\n\t\t\t'_FILES' => true,\n\t\t);\n\n\t\t// Not only will array_merge and array_keys give a warning if\n\t\t// a parameter is not an array, array_merge will actually fail.\n\t\t// So we check if _SESSION has been initialised.\n\t\tif (!isset($_SESSION) || !is_array($_SESSION))\n\t\t{\n\t\t\t$_SESSION = array();\n\t\t}\n\n\t\t// Merge all into one extremely huge array; unset this later\n\t\t$input = array_merge(\n\t\t\tarray_keys($_GET),\n\t\t\tarray_keys($_POST),\n\t\t\tarray_keys($_COOKIE),\n\t\t\tarray_keys($_SERVER),\n\t\t\tarray_keys($_SESSION),\n\t\t\tarray_keys($_ENV),\n\t\t\tarray_keys($_FILES)\n\t\t);\n\n\t\tforeach ($input as $varname)\n\t\t{\n\t\t\tif (isset($not_unset[$varname]))\n\t\t\t{\n\t\t\t\t// Hacking attempt. No point in continuing unless it's a COOKIE\n\t\t\t\tif ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))\n\t\t\t\t{\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cookie = &$_COOKIE;\n\t\t\t\t\twhile (isset($cookie['GLOBALS']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($cookie['GLOBALS'] as $registered_var => $value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!isset($not_unset[$registered_var]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($GLOBALS[$registered_var]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cookie = &$cookie['GLOBALS'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($GLOBALS[$varname]);\n\t\t}\n\n\t\tunset($input);\n\t}",
"function tpl_clear_vars()\n{\n unset($GLOBALS['vars']);\n unset($GLOBALS['no_eval_vars']);\n}",
"public static function cleanGlobals()\n {\n $list = array(\n 'GLOBALS',\n '_POST',\n '_GET',\n '_COOKIE',\n '_REQUEST',\n '_SERVER',\n '_ENV',\n '_FILES',\n );\n \n // Create a list of all of the keys from the super-global values.\n // Use array_keys() here to preserve key integrity.\n $keys = array_merge(\n array_keys($_ENV),\n array_keys($_GET),\n array_keys($_POST),\n array_keys($_COOKIE),\n array_keys($_SERVER),\n array_keys($_FILES),\n // $_SESSION is null if you have not started the session yet.\n // This insures that a check is performed regardless.\n isset($_SESSION) && is_array($_SESSION) ? array_keys($_SESSION) : array()\n );\n \n // Unset the globals.\n foreach ($keys as $key) {\n if (isset($GLOBALS[$key]) && ! in_array($key, $list)) {\n unset($GLOBALS[$key]);\n }\n }\n }",
"private function revert_register_globals()\n\t{\n\t\tif(isset($_REQUEST['GLOBALS']) OR isset($_FILES['GLOBALS']))\n\t\t{\n\t\t\texit(1); // Malicious attack detected, exit\n\t\t}\n\t\t\n\t\t$global_variables = array_diff(array_keys($GLOBALS), array(\n\t\t\t'_COOKIE',\n\t\t\t'_ENV',\n\t\t\t'_GET',\n\t\t\t'_FILES',\n\t\t\t'_POST',\n\t\t\t'_REQUEST',\n\t\t\t'_SERVER',\n\t\t\t'_SESSION',\n\t\t\t'GLOBALS',\n\t\t));\n\n\t\tforeach ($global_variables as $name)\n\t\t{\n\t\t\tunset($GLOBALS[$name]);\n\t\t}\n\t}",
"function unregisterGlobals() {\n if (ini_get('register_globals')) \n\t{\n $array = array('_SESSION', '_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');\n foreach ($array as $value) \n\t\t{\n foreach ($GLOBALS[$value] as $key => $var) \n\t\t\t{\n if ($var === $GLOBALS[$key]) \n\t\t\t\t{\n unset($GLOBALS[$key]);\n }\n }\n }\n }\n}",
"function unregisterGlobals() {\n\t if (ini_get('register_globals')) {\n\t $array = array('_SESSION', '_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');\n\t foreach ($array as $value) {\n\t foreach ($GLOBALS[$value] as $key => $var) {\n\t if ($var === $GLOBALS[$key]) {\n\t unset($GLOBALS[$key]);\n\t }\n\t }\n\t }\n\t }\n\t}",
"function unregisterGlobals() {\r\n /* if (ini_get('register_globals')) {\r\n $array = array('_SESSION', '_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');\r\n foreach ($array as $value) {\r\n foreach ($GLOBALS[$value] as $key => $var) {\r\n if ($var === $GLOBALS[$key]) {\r\n unset($GLOBALS[$key]);\r\n }\r\n }\r\n }\r\n } */\r\n}",
"function unregisterGlobals() \n\t{\n\t\tif (ini_get('register_globals')) \n\t\t{\n\t\t\t$array = array('_SESSION', '_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');\n\t\t\tforeach ($array as $value) \n\t\t\t{\n\t\t\t\tforeach ($GLOBALS[$value] as $key => $var) \n\t\t\t\t{\n\t\t\t\t\tif ($var === $GLOBALS[$key]) \n\t\t\t\t\t{\n\t\t\t\t\t\tunset($GLOBALS[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function disable_register_globals() {\n if (ini_get(\"register_globals\") === false) { // if register_globals is disabled in php.ini,\n return; // everything's fine :-)\n }\n \n $inputVars = array($_GET, $_POST, $_COOKIE);\n foreach($inputVars as $inputVar) {\n foreach($inputVar as $key => $value) {\n // check if var has been set as global and has the 'right' value\n if (isset($GLOBALS[$key]) && $GLOBALS[$key] == value) \n unset($GLOBALS[$key]); // ... then unset it!\n }\n }\n }",
"public function unsetGlobals()\n {\n unset($_GET);\n unset($_POST);\n }",
"protected function clearGlobals()\n {\n if (false === config('app.globals',false))\n {\n $_SERVER = [];\n $_ENV = [];\n }\n }",
"function _sanitize_globals()\n\t{\n\t\t// Would kind of be \"wrong\" to unset any of these GLOBALS\n\t\t$protected = array('_SERVER', '_GET', '_POST', '_FILES', '_REQUEST', '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA',\n\t\t\t\t\t\t\t'system_folder', 'application_folder', 'BM', 'EXT', 'CFG', 'URI', 'RTR', 'OUT', 'IN');\n\n\t\t// Unset globals for security.\n\t\t// This is effectively the same as register_globals = off\n\t\tforeach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global)\n\t\t{\n\t\t\tif ( ! is_array($global))\n\t\t\t{\n\t\t\t\tif ( ! in_array($global, $protected))\n\t\t\t\t{\n\t\t\t\t\tunset($GLOBALS[$global]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($global as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif ( ! in_array($key, $protected))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($GLOBALS[$key]);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (is_array($val))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($val as $k => $v)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( ! in_array($k, $protected))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($GLOBALS[$k]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Is $_GET data allowed? If not we'll set the $_GET to an empty array\n\t\tif ($this->_allow_get_array == FALSE)\n\t\t{\n\t\t\t$_GET = array();\n\t\t}\n\t\telse\n\t\t{\n\n\n if (is_array($_GET) AND count($_GET) > 0)\n {\n foreach($_GET as $key => $val)\n {\n $_GET[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);\n }\n }\n\n\t\t}\n\n\t\t// Clean $_POST Data\n\t\t$_POST = $this->_clean_input_data($_POST);\n\n\t\t// Clean $_COOKIE Data\n\t\t// Also get rid of specially treated cookies that might be set by a server\n\t\t// or silly application, that are of no use to a CI application anyway\n\t\t// but that when present will trip our 'Disallowed Key Characters' alarm\n\t\t// http://www.ietf.org/rfc/rfc2109.txt\n\t\t// note that the key names below are single quoted strings, and are not PHP variables\n\t\tunset($_COOKIE['$Version']);\n\t\tunset($_COOKIE['$Path']);\n\t\tunset($_COOKIE['$Domain']);\n\t\t$_COOKIE = $this->_clean_input_data($_COOKIE);\n\n\t\tlog_message('debug', \"Global POST and COOKIE data sanitized\");\n\t}",
"static public function cleanGlobals() {\n\t\tself::_unsetGlobals();\n\n\t\tself::_clean($_GET);\n\t\tself::_clean($_POST);\n\t\tself::_clean($_COOKIE);\n\t\tself::_clean($_REQUEST);\n\t}",
"public function clearvars()\n {\n $x = explode(\",\", EMPS_VARS);\n while (list($name, $value) = each($x)) {\n if ($value == 'lang') {\n continue;\n }\n $GLOBALS[$value] = \"\";\n }\n }",
"function checkRegisterGlobals() {\n if (ini_get('register_globals')) {\n# $array = array('_SESSION', '_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');\n# foreach ($array as $value) {\n# foreach ($GLOBALS[$value] as $key => $var) {\n# if ($var === $GLOBALS[$key]) {\n# unset($GLOBALS[$key]);\n# }\n# }\n# }\n\tthrow new SystemException(\"Register Globals must be turned off!!!\");\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of validators contained in this instance | public function getValidators ()
{
return $this->validators;
} | [
"public function getValidators(): array\n {\n return get_validators($this);\n }",
"public function getValidators()\n {\n return $this->validators;\n }",
"public function getValidators()\n {\n return $this->_validators;\n }",
"public function getValidators() {\n\t\treturn $this->validator->getValidators();\n\t}",
"public function getValidators() {\n $validators = array();\n foreach ($this->fields as $fieldName => $field) {\n $validators[$fieldName] = $field->getValidators();\n }\n\n return $validators;\n }",
"public function getValidators();",
"public function getValidatorList()\n {\n if (isset($this->validatorList)) {\n return $this->validatorList;\n }\n\n $this->validatorList = array();\n $this->initValidatorRules();\n\n return $this->validatorList;\n }",
"protected function getValidators()\n {\n $validators = [];\n\n if (!empty($this->max) || !empty($this->min)) {\n $validators[] = [\n 'name' => \\Laminas\\Validator\\StringLength::class,\n 'options' => array_filter(\n [\n 'min' => $this->min,\n 'max' => $this->max,\n ]\n ),\n ];\n }\n\n if ($this->isAllowEmpty === true) {\n $validators[] = [\n 'name' => \\Laminas\\Validator\\NotEmpty::class,\n 'options' => [\n 'type' => \\Laminas\\Validator\\NotEmpty::PHP,\n ],\n ];\n }\n\n return $validators;\n }",
"public function getValidators()\n {\n $validators = array();\n $configParts = explode('/', self::CONFIG_XML_PATH_VALIDATOR);\n $configNodes = Mage::getConfig()->getNode($configParts[0], 'default');\n foreach ($configNodes->children() as $validatorNode) {\n $className = $validatorNode->class;\n $model = Mage::getModel($className);\n if ($model) {\n $validators[]= $model;\n }\n }\n\n return $validators;\n }",
"public static function listFormValidators()\n {\n return [];\n }",
"protected function getValidators()\n {\n return $this->container->getValidatorsByResourceType($this->getResourceType());\n }",
"public function getValidators()\n {\n return $this->getTaggedServices('validator.constraint_validator');\n }",
"public function getInstanceValidators() {\n return $this->containerService->getInstancesImplementing(\"Harmony\\\\Validator\\\\ValidatorInterface\");\n }",
"public static function getValidators()\n {\n if (isset(static::$validators)) {\n return static::$validators;\n }\n\n // To match the route, we will use a chain of responsibility pattern with the\n // validator implementations. We will spin through each one making sure it\n // passes and then we will know if the route as a whole matches request.\n return static::$validators = [\n new UriValidator, new MethodValidator,\n new SchemeValidator, new HostValidator,\n ];\n }",
"public static function getValidators() {\n if (isset(static::$validators)) {\n return static::$validators;\n }\n\n // To match the route, we will use a chain of responsibility pattern with the\n // validator implementations. We will spin through each one making sure it\n // passes and then we will know if the route as a whole matches request.\n return static::$validators = [\n new UriValidator, new MethodValidator,\n new SchemeValidator, new HostValidator,\n ];\n }",
"public function getValidators()\n {\n if ($this->_validators === null) {\n $this->setValidators($this->defaultValidators());\n }\n if (!is_array($this->_validators)) {\n throw new InvalidConfigException('Method '.get_class($this).'::defaultValidators() must return an array.');\n }\n return $this->_validators;\n }",
"final protected function getFormValidators()\n {\n // Not sure how form validators wouldn't be set, but leaving in place for now\n if (!isset($this->formValidators)) {\n $this->formValidators = $this->generateFormValidators();\n }\n\n return $this->formValidators;\n }",
"public static function getValidators()\n {\n $validators = parent::getValidators();\n\n foreach ($validators as $key => $validator) {\n if ($validator instanceof UriValidator) {\n break;\n }\n }\n\n $validators[] = new AlexaValidator;\n\n return $validators;\n }",
"public function getClassValidators()\n {\n return $this->reflectionService->getClassesImplementing(\"Harmony\\\\Validator\\\\StaticValidatorInterface\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a subscription for a given project and user. The user will be notified for new issues for the project. | public function subscribeProject($id, $user)
{
$values = array(
'item_id' => $id,
'user_id' => $user,
);
$query = $this->db->getQuery(true);
$query->insert('#__monitor_subscriptions_projects')
->set(MonitorHelper::sqlValues($values, $query));
return $this->db->setQuery($query)->execute();
} | [
"protected function subscribe(User $user)\n {\n $user->newSubscription(config('app.membership_name'), config('app.membership_plan'))\n ->create('tok_ie');\n }",
"public function createSubscriptions($user)\n {\n }",
"public static function subscribeTo($event, $user_id = null)\n {\n if(is_null($user_id)) {\n $user_id = static::getLoggedInUserId();\n }\n\n DB::table('polynotice_subs')->insert([\n 'event' => $event,\n 'user_id' => $user_id\n ]);\n \n }",
"function add_subscription($data)\n\t{\n\t\t$this->path = \"/api/subscriptions/add\";\n\t\treturn $this->_send_request($data);\n\t}",
"abstract public function add_subscription( Payment_Subscription $subscription );",
"public function createSubscription()\n {\n $this->validate($this->request, [\n 'plan_id' => 'required|integer|exists:billing_plans,id',\n 'start_date' => 'string'\n ]);\n\n /** @var User $user */\n $user = $this->request->user();\n $plan = $this->billingPlan->findOrFail($this->request->get('plan_id'));\n\n $sub = $this->authorizenet->subscriptions()->create($plan, $user, $this->request->get('start_date'));\n $user->subscribe('authorizenet', $sub['reference'], $plan);\n\n return $this->success(['user' => $user]);\n }",
"private function add_subscriber ($user)\n\t{\n\t\tfile_put_contents($this->subscribers_file, \"$user\\n\", FILE_APPEND);\n\t}",
"public function subscribe($user = null)\n {\n if (null === $user) {\n $user = auth()->user();\n }\n\n // Don't subscribe owner\n if ($this->user_id === $user->id) {\n return false;\n }\n\n return $this->subscriptions()->firstOrCreate(['user_id' => $user->id]);\n }",
"function subscribeUser($usr_id, $issue_id, $subscriber_usr_id, $actions, $add_history = TRUE)\n {\n $issue_id = Misc::escapeInteger($issue_id);\n $prj_id = Issue::getProjectID($issue_id);\n $subscriber_usr_id = Misc::escapeInteger($subscriber_usr_id);\n\n // call workflow to modify actions or cancel adding this user.\n $email = '';\n $workflow = Workflow::handleSubscription($prj_id, $issue_id, $subscriber_usr_id, $email, $actions);\n if ($workflow === false) {\n // cancel subscribing the user\n return -2;\n }\n if ($subscriber_usr_id == APP_SYSTEM_USER_ID) {\n return -2;\n }\n\n $stmt = \"SELECT\n COUNT(sub_id)\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"subscription\n WHERE\n sub_iss_id=$issue_id AND\n sub_usr_id=$subscriber_usr_id\";\n $total = DB_Helper::getInstance()->getOne($stmt);\n if ($total > 0) {\n return -1;\n }\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"subscription\n (\n sub_iss_id,\n sub_usr_id,\n sub_created_date,\n sub_level,\n sub_email\n ) VALUES (\n $issue_id,\n $subscriber_usr_id,\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n 'issue',\n ''\n )\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n } else {\n $sub_id = DB_Helper::get_last_insert_id();\n for ($i = 0; $i < count($actions); $i++) {\n self::addType($sub_id, $actions[$i]);\n }\n // need to mark the issue as updated\n Issue::markAsUpdated($issue_id);\n // need to save a history entry for this\n if ($add_history) {\n History::add($issue_id, $usr_id, History::getTypeID('notification_added'),\n ev_gettext('Notification list entry (%1$s) added by %2$s', User::getFromHeader($subscriber_usr_id), User::getFullName($usr_id)));\n }\n return 1;\n }\n }",
"private function subscribeUser()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['subscribed_to']) || $request['subscribed_to']==\"\" )\n throw_error_msg(\"subscribed to not provided\");\n\n if( !is_numeric($request['subscribed_to']) )\n throw_error_msg(\"invalid subscribed to\");\n\n global $userquery;\n $userquery->subscribe_user($request['subscribed_to']);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'subscribed successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"function afww_subscriptions_create( $appid, $authtoken, $sub )\n{\n return afww_curl_api_post( \"/installedapps/$appid/subscriptions\", $authtoken, $sub );\n}",
"public function subscribe(UserInterface $user, SubscriptionListInterface $list)\n {\n $params = [\n 'email' => ['email' => $user->getEmail()],\n 'id' => $list->getId(),\n 'merge_vars' => [ 'FNAME' => $user->getFirstName(), 'LNAME' => $user->getLastName(), 'OPTIN_TIME' => gmdate('Y-m-d H:i:s') ]\n ];\n\n return $this->doExecuteCommand('subscribe', $params, function() {\n return true;\n });\n }",
"public function subscribe(UserInterface $user, SubscriptionListInterface $list)\n {\n return $this->doExecuteCommand(\n 'subscribe',\n ['rid' => [$list->getId()], 'lead_name' => $user->getName(), 'lead_email' => $user->getEmail()],\n function() {\n return true;\n }\n );\n }",
"function subscribe() {\n if(!$this->active_object->canSubscribe($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN, null, true, $this->request->isApiCall());\n } // if\n \n $user_id = $this->request->getId('user_id');\n if($user_id) {\n $user = Users::findById($user_id);\n if(!instance_of($user, 'User')) {\n $this->httpError(HTTP_ERR_NOT_FOUND); // user ID provided, but no user found\n } // if\n } else {\n $user = $this->logged_user;\n } // if\n \n if(isset($_GET['async']) && $_GET['async']) {\n if($this->request->isSubmitted()) {\n db_begin_work();\n $action = $this->active_object->subscribe($user);\n if($action && !is_error($action)) {\n db_commit();\n } else {\n db_rollback();\n } // if\n } // if\n \n require_once RESOURCES_MODULE_PATH . '/helpers/function.object_subscription.php';\n print smarty_function_object_subscription(array(\n 'object' => $this->active_object,\n 'user' => $user,\n 'render_wrapper' => false\n ), $this->smarty);\n die();\n } else {\n $this->executeOnActiveObject('subscribe', array($user), \n lang('You are subscribed to \":name\" :type now', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName())), \n lang('Failed to subscribe you to \":name\" :type', array('type' => $this->active_object->getVerboseType(true), 'name' => $this->active_object->getName()))\n );\n } // if\n }",
"function subscribe() {\n if($this->request->isSubmitted() && ($this->request->isAsyncCall() || $this->request->isApiCall())) {\n\t if($this->active_object->subscriptions()->canSubscribe($this->logged_user)) {\n try {\n $this->active_object->subscriptions()->subscribe($this->active_user);\n\n $this->response->respondWithData($this->active_object, array(\n 'as' => $this->active_object->getBaseTypeName(),\n 'detailed' => true,\n ));\n } catch(Exception $e) {\n $this->response->exception($e);\n } // try\n } else {\n\t $this->response->forbidden();\n\t } // if\n } else {\n $this->response->badRequest();\n } // if\n }",
"public function createSubscription($request);",
"private function _triggerNewSubscriptionEvent(\n \\Pley\\User\\NewSubscriptionResult $newSubsResult, \\Pley\\Entity\\User\\User $user)\n {\n $eventDataMap = [\n 'user' => $user,\n 'newSubscriptionResult' => $newSubsResult,\n ];\n if (isset($referralToken)) {\n $eventDataMap['referralToken'] = $referralToken;\n }\n\n \\Event::fire(\\Pley\\Enum\\EventEnum::SUBSCRIPTION_CREATE, $eventDataMap);\n }",
"public function subscribe()\n {\n if ($this->isSubscribed) {\n return;\n }\n\n $this->thread->subscribers()->attach($this->user->id);\n $this->isSubscribed = !$this->isSubscribed;\n }",
"public function defaultSubscription($user){\n\n $subscription = $user->subscriptions()->create([\n 'subscription_category_id' => SubscriptionCategory::where('subscription_category', 2)->first()->id,\n 'subscription_status_id' => SubscriptionStatus::where('status_code', 1)->first()->id\n ]);\n\n $this->setSubscriptionDetails($subscription);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
utf8_range( ) Create an array containing a range of UTF8 characters | function utf8_range($var1, $var2)
{
if (ctype_digit((string) $var1))
{
$start = (int) $var1;
}
else if (!($start = (int) utf8_hex_to_int($var1)))
{
//if not u+0000 style codepoint
if (!($start = utf8_ord($var1)))
{
//if not a valid utf8 character
return array();
}
}
if (ctype_digit((string) $var2))
{
$end = (int) $var2;
}
else if (!($end = (int) utf8_hex_to_int($var2)))
{
//if not u+0000 style codepoint
if (!($end = utf8_ord($var1)))
{
//if not a valid utf8 character
return array();
}
}
return array_map('utf8_chr', range($start, $end));
} | [
"function mb_range($start, $end)\n {\n // if start and end are the same, well, there's nothing to do\n if ($start == $end) {\n return [$start];\n }\n\n $_result = [];\n // get unicodes of start and end\n list(, $_start, $_end) = unpack(\"N*\", mb_convert_encoding($start . $end, \"UTF-32BE\", \"UTF-8\"));\n // determine movement direction\n $_offset = $_start < $_end ? 1 : -1;\n $_current = $_start;\n while ($_current != $_end) {\n $_result[] = mb_convert_encoding(pack(\"N*\", $_current), \"UTF-8\", \"UTF-32BE\");\n $_current += $_offset;\n }\n $_result[] = $end;\n\n return $_result;\n }",
"function UTF8_to_unicode_array( $utf8_text )\n{\n\t// Create an array to receive the unicode character numbers output\n\t$output = array( );\n\n\t// Cycle through the characters in the UTF-8 string\n\tfor ( $pos = 0; $pos < strlen( $utf8_text ); $pos++ )\n\t{\n\t\t// Retreive the current numerical character value\n\t\t$chval = ord($utf8_text{$pos});\n\n\t\t// Check what the first character is - it will tell us how many bytes the\n\t\t// Unicode value covers\n\n\t\tif ( ( $chval >= 0x00 ) && ( $chval <= 0x7F ) )\n\t\t{\n\t\t\t// 1 Byte UTF-8 Unicode (7-Bit ASCII) Character\n\t\t\t$bytes = 1;\n\t\t\t$outputval = $chval; // Since 7-bit ASCII is unaffected, the output equals the input\n\t\t}\n\t\telse if ( ( $chval >= 0xC0 ) && ( $chval <= 0xDF ) )\n\t\t{\n\t\t\t// 2 Byte UTF-8 Unicode\n\t\t\t$bytes = 2;\n\t\t\t$outputval = $chval & 0x1F; // The first byte is bitwise ANDed with 0x1F to remove the leading 110b\n\t\t}\n\t\telse if ( ( $chval >= 0xE0 ) && ( $chval <= 0xEF ) )\n\t\t{\n\t\t\t// 3 Byte UTF-8 Unicode\n\t\t\t$bytes = 3;\n\t\t\t$outputval = $chval & 0x0F; // The first byte is bitwise ANDed with 0x0F to remove the leading 1110b\n\t\t}\n\t\telse if ( ( $chval >= 0xF0 ) && ( $chval <= 0xF7 ) )\n\t\t{\n\t\t\t// 4 Byte UTF-8 Unicode\n\t\t\t$bytes = 4;\n\t\t\t$outputval = $chval & 0x07; // The first byte is bitwise ANDed with 0x07 to remove the leading 11110b\n\t\t}\n\t\telse if ( ( $chval >= 0xF8 ) && ( $chval <= 0xFB ) )\n\t\t{\n\t\t\t// 5 Byte UTF-8 Unicode\n\t\t\t$bytes = 5;\n\t\t\t$outputval = $chval & 0x03; // The first byte is bitwise ANDed with 0x03 to remove the leading 111110b\n\t\t}\n\t\telse if ( ( $chval >= 0xFC ) && ( $chval <= 0xFD ) )\n\t\t{\n\t\t\t// 6 Byte UTF-8 Unicode\n\t\t\t$bytes = 6;\n\t\t\t$outputval = $chval & 0x01; // The first byte is bitwise ANDed with 0x01 to remove the leading 1111110b\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Invalid Code - do nothing\n\t\t\t$bytes = 0;\n\t\t}\n\n\t\t// Check if the byte was valid\n\t\tif ( $bytes !== 0 )\n\t\t{\n\t\t\t// The byte was valid\n\n\t\t\t// Check if there is enough data left in the UTF-8 string to allow the\n\t\t\t// retrieval of the remainder of this unicode character\n\t\t\tif ( $pos + $bytes - 1 < strlen( $utf8_text ) )\n\t\t\t{\n\t\t\t\t// The UTF-8 string is long enough\n\n\t\t\t\t// Cycle through the number of bytes required,\n\t\t\t\t// minus the first one which has already been done\n\t\t\t\twhile ( $bytes > 1 )\n\t\t\t\t{\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$bytes--;\n\n\t\t\t\t\t// Each remaining byte is coded with 6 bits of data and 10b on the high\n\t\t\t\t\t// order bits. Hence we need to shift left by 6 bits (0x40) then add the\n\t\t\t\t\t// current characer after it has been bitwise ANDed with 0x3F to remove the\n\t\t\t\t\t// highest two bits.\n\t\t\t\t\t$outputval = $outputval*0x40 + ( (ord($utf8_text{$pos})) & 0x3F );\n\t\t\t\t}\n\n\t\t\t\t// Add the calculated Unicode number to the output array\n\t\t\t\t$output[] = $outputval;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// Return the resulting array\n\treturn $output;\n}",
"function utf8toCodePointsArray(&$text)\n {\n $length = mb_strlen($text, '8bit'); // http://www.php.net/manual/en/function.mb-strlen.php#77040\n $unicode = array(); // array containing unicode values\n $bytes = array(); // array containing single character byte sequences\n $numbytes = 1; // number of octets needed to represent the UTF-8 character\n\n for ($i = 0; $i < $length; $i++) {\n $c = ord($text[$i]); // get one string character at time\n if (count($bytes) === 0) { // get starting octect\n if ($c <= 0x7F) {\n $unicode[] = $c; // use the character \"as is\" because is ASCII\n $numbytes = 1;\n } elseif (($c >> 0x05) === 0x06) { // 2 bytes character (0x06 = 110 BIN)\n $bytes[] = ($c - 0xC0) << 0x06;\n $numbytes = 2;\n } elseif (($c >> 0x04) === 0x0E) { // 3 bytes character (0x0E = 1110 BIN)\n $bytes[] = ($c - 0xE0) << 0x0C;\n $numbytes = 3;\n } elseif (($c >> 0x03) === 0x1E) { // 4 bytes character (0x1E = 11110 BIN)\n $bytes[] = ($c - 0xF0) << 0x12;\n $numbytes = 4;\n } else {\n // use replacement character for other invalid sequences\n $unicode[] = 0xFFFD;\n $bytes = array();\n $numbytes = 1;\n }\n } elseif (($c >> 0x06) === 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN\n $bytes[] = $c - 0x80;\n if (count($bytes) === $numbytes) {\n // compose UTF-8 bytes to a single unicode value\n $c = $bytes[0];\n for ($j = 1; $j < $numbytes; $j++) {\n $c += ($bytes[$j] << (($numbytes - $j - 1) * 0x06));\n }\n if ((($c >= 0xD800) AND ($c <= 0xDFFF)) OR ($c >= 0x10FFFF)) {\n // The definition of UTF-8 prohibits encoding character numbers between\n // U+D800 and U+DFFF, which are reserved for use with the UTF-16\n // encoding form (as surrogate pairs) and do not directly represent\n // characters.\n $unicode[] = 0xFFFD; // use replacement character\n } else {\n $unicode[] = $c; // add char to array\n }\n // reset data for next char\n $bytes = array();\n $numbytes = 1;\n }\n } else {\n // use replacement character for other invalid sequences\n $unicode[] = 0xFFFD;\n $bytes = array();\n $numbytes = 1;\n }\n }\n\n return $unicode;\n }",
"protected static function utf8Chars($text)\n {\n $chars = array();\n for ($i = 0, $len = strlen($text); $i < $len; $i++) {\n $char = ord($text[$i]);\n if ($char <= 0x7F) {\n // 00000000 - 01111111\n // ASCII\n $chars[] = $text[$i];\n } elseif ($char <= 0xBF) {\n // 10000000 - 10111111\n // Not the first byte. Do nothing.\n $chars[count($chars) - 1] = $text[$i];\n } elseif ($char <= 0xFD) {\n // 11000000 - 11111101\n\n // 11000000 - 11011111\n $temp = $text[$i];\n $temp .= $text[++$i];\n // 11100000 - 11101111\n if ($char > 0xDF) {\n $temp .= $text[++$i];\n }\n // 11110000 - 11110111\n if ($char > 0xEF) {\n $temp .= $text[++$i];\n }\n // 11111000 - 11111011\n if ($char > 0xF7) {\n $temp .= $text[++$i];\n }\n // 11111100 - 11111101\n if ($char > 0xFB) {\n $temp .= $text[++$i];\n }\n $chars[] = $temp;\n } else {\n // Unexpected first byte of UTF-8 character\n }\n }\n return $chars;\n }",
"public function getCodePageRange1() {}",
"private static function utf8_to_unicode( &$str )\n {\n $unicode = array();\n $values = array();\n $looking_for = 1;\n\n for ($i = 0; $i < strlen( $str ); $i++ ) {\n $this_value = ord( $str[ $i ] );\n if ( $this_value < 128 ) $unicode[] = $this_value;\n else {\n if ( count( $values ) == 0 ) $looking_for = ( $this_value < 224 ) ? 2 : 3;\n $values[] = $this_value;\n if ( count( $values ) == $looking_for ) {\n $number = ( $looking_for == 3 ) ?\n ( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ):\n ( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );\n $unicode[] = $number;\n $values = array();\n $looking_for = 1;\n }\n }\n }\n return $unicode;\n }",
"function utf8ToUnicode( $str ) {\n $unicode = array();\n $values = array();\n $lookingFor = 1;\n\n for ($i = 0; $i < strlen( $str ); $i++ ) {\n $thisValue = ord( $str[ $i ] );\n if ( $thisValue < 128 ) $unicode[] = $thisValue;\n else {\n if ( count( $values ) == 0 ) $lookingFor = ( $thisValue < 224 ) ? 2 : 3;\n $values[] = $thisValue;\n if ( count( $values ) == $lookingFor ) {\n $number = ( $lookingFor == 3 ) ?\n ( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ):\n ( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );\n\n $unicode[] = $number;\n $values = array();\n $lookingFor = 1;\n }\n }\n }\n\n return $unicode;\n }",
"public static function utf8_to_unicode( &$str )\n {\n $unicode = array();\n $values = array();\n $looking_for = 1;\n for ($i = 0; $i < strlen( $str ); $i++ ) {\n $this_value = ord( $str[ $i ] );\n if ( $this_value < 128 ) $unicode[] = $this_value;\n else {\n if ( count( $values ) == 0 ) $looking_for = ( $this_value < 224 ) ? 2 : 3;\n $values[] = $this_value;\n if ( count( $values ) == $looking_for ) {\n $number = ( $looking_for == 3 ) ?\n ( ( $values[0] % 16 ) * 4096 ) + ( ( $values[1] % 64 ) * 64 ) + ( $values[2] % 64 ):\n ( ( $values[0] % 32 ) * 64 ) + ( $values[1] % 64 );\n $unicode[] = $number;\n $values = array();\n $looking_for = 1;\n }\n }\n }\n return $unicode;\n }",
"public static function UTF8ArrToLatin1Arr($unicode) {\n\t\t$outarr = array(); // array to be returned\n\t\tforeach ($unicode as $char) {\n\t\t\tif ($char < 256) {\n\t\t\t\t$outarr[] = $char;\n\t\t\t} elseif (array_key_exists($char, TCPDF_FONT_DATA::$uni_utf8tolatin)) {\n\t\t\t\t// map from UTF-8\n\t\t\t\t$outarr[] = TCPDF_FONT_DATA::$uni_utf8tolatin[$char];\n\t\t\t} elseif ($char == 0xFFFD) {\n\t\t\t\t// skip\n\t\t\t} else {\n\t\t\t\t$outarr[] = 63; // '?' character\n\t\t\t}\n\t\t}\n\t\treturn $outarr;\n\t}",
"public function range(): array;",
"public function find_ranges($str) {\n $length = $str->length();\n if ($length < 1) {\n return false;\n }\n $result = array();\n $rangestart = 0;\n $prevcode = -1;\n $state = self::FIRST_CHAR;\n for ($i = 0; $i < $length; $i++) {\n $curcode = core_text::utf8ord($str[$i]);\n if ($state == self::FIRST_CHAR) {\n $state = self::OUT_OF_RANGE;\n } else if ($state == self::INTO_RANGE) {\n if ($curcode - 1 != $prevcode) {\n $state = self::OUT_OF_RANGE;\n $result[] = array($rangestart, $prevcode);\n }\n } else if ($state == self::OUT_OF_RANGE) {\n if ($curcode - 1 == $prevcode) {\n $state = self::INTO_RANGE;\n $rangestart = $prevcode;\n } else {\n $result[] = $prevcode;\n }\n }\n $prevcode = $curcode;\n }\n if ($state == self::INTO_RANGE) {\n $result[] = array($rangestart, $prevcode);\n } else { // hence $state == OUT_OF_RANGE\n $result[] = $prevcode;\n }\n return $result;\n }",
"public function getCoveredCharacters()\n {\n $characterCodes = array();\n for ($i = 0; $i < $this->segCountX2 / 2; $i++) {\n for ($code = $this->startCount[$i]; $code <= $this->endCount[$i]; $code++) {\n $characterCodes[] = $code;\n }\n }\n return $characterCodes;\n }",
"function utf8_chr_size_list( $str )\n {\n return array_map( 'strlen' , utf8_split( $str ) );\n }",
"private function multi_byte_string_to_array()\n {\n $this->strings = array_values(\n array_filter(\n preg_split(\"//u\",$this->string),\n \"strlen\"\n )\n );\n }",
"public function toCharArray(){\n\t\t\n\t\t$arr = array();\n\t\t\n\t\tfor($i = 0, $l = $this->count(); $i < $l; ++$i){\n\t\t\t$arr[] = \\mb_substr($this->_Value, $i, 1, $this->_Encoding);\n\t\t}\n\t\t\n\t\treturn $arr;\n\t\t\n\t}",
"public function characters() : array\n {\n return static::createMany(preg_split('//u', $this->string, -1, PREG_SPLIT_NO_EMPTY));\n }",
"function parse_range(string $str, Database $db) {\n $set = [];\n $junks = preg_split('/\\s*(?:,\\s*)+/', trim($str));\n foreach ($junks as $j) {\n $ranges = preg_split('/\\s*(?:-|\\.\\.|:)\\s*/', $j);\n switch (count($ranges)) {\n case 0:\n break;\n case 1:\n $tmp = parse_codepoint($ranges[0], true);\n if (is_int($tmp)) {\n $set[] = get_codepoint($tmp, $db);\n }\n break;\n case 2:\n $low = parse_codepoint($ranges[0], true);\n $high = parse_codepoint($ranges[1], true);\n if (is_int($low) && is_int($high)) {\n $set[] = new Range([\n 'first' => min($low, $high),\n 'last' => max($high, $low)], $db);\n }\n break;\n default:\n /* the strange case of U+1234..U+4567..U+7890. We try to handle\n * it gracefully. */\n $max = -1;\n $min = 0x110000;\n foreach ($ranges as $r) {\n $tmp = parse_codepoint($r, true);\n if (is_int($tmp) && $tmp > $max) {\n $max = $tmp;\n }\n if (is_int($tmp) && $tmp < $min) {\n $min = $tmp;\n }\n }\n if ($min < 0x110000 && $max > -1) {\n $set[] = new Range([\n 'first' => min($min, $max),\n 'last' => max($max, $min)], $db);\n }\n }\n }\n return $set;\n}",
"function getRange($start, $end)\r\n{\r\n $outputarray = array();\r\n\r\n for($i=$start; $i<=$end; ++$i)\r\n {\r\n $outputarray[]=$i;\r\n }\r\n return $outputarray;\r\n}",
"function utf8_to_codepoints(&$txt) {\n $l = strlen($txt);\n $out = array();\n for ($i = 0; $i < $l; ++$i) {\n $c = ord($txt{$i});\n // ASCII\n if ($c < 0x80) {\n $out[] = ord($txt{$i});\n }\n // Lost continuation byte\n else if ($c < 0xC0) {\n $out[] = 0xFFFD;\n continue;\n }\n // Multibyte sequence leading byte\n else {\n if ($c < 0xE0) {\n $s = 2;\n }\n else if ($c < 0xF0) {\n $s = 3;\n }\n else if ($c < 0xF8) {\n $s = 4;\n }\n // 5/6 byte sequences not possible for Unicode.\n else {\n $out[] = 0xFFFD;\n while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; }\n continue;\n }\n \n $q = array($c);\n // Fetch rest of sequence\n while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); }\n \n // Check length\n if (count($q) != $s) {\n $out[] = 0xFFFD;\n continue;\n }\n \n switch ($s) {\n case 2:\n $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);\n // Overlong sequence\n if ($cp < 0x80) {\n $out[] = 0xFFFD;\n }\n else {\n $out[] = $cp;\n }\n continue;\n\n case 3:\n $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);\n // Overlong sequence\n if ($cp < 0x800) {\n $out[] = 0xFFFD;\n }\n // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)\n else if ($c > 0xD800 && $c < 0xDFFF) {\n $out[] = 0xFFFD;\n }\n else {\n $out[] = $cp;\n }\n continue;\n\n case 4:\n $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);\n // Overlong sequence\n if ($cp < 0x10000) {\n $out[] = 0xFFFD;\n }\n // Outside of the Unicode range\n else if ($cp >= 0x10FFFF) {\n $out[] = 0xFFFD;\n }\n else {\n $out[] = $cp;\n }\n continue;\n }\n }\n }\n return $out;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the notification's title value | function getNotificationTitle(&$notification) {
$type = $notification->getType();
assert(isset($type));
switch ($type) {
case NOTIFICATION_TYPE_FORM_ERROR:
return __('form.errorsOccurred');
default:
return __('notification.notification');
}
} | [
"public function get_title()\n\t{\n\t\t$username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile');\n\n\t\treturn $this->user->lang('NOTIFICATION_PM', $username);\n\t}",
"public function getTitle() {\r\n\t\tif (array_key_exists ( 'title', $this->data )) {\r\n\t\t\treturn $this->data ['title'];\r\n\t\t}\r\n\t\t\r\n\t\t$title = $this->getExtension ( 'Atom' )->getTitle ();\r\n\t\t\r\n\t\t$this->data ['title'] = $title;\r\n\t\t\r\n\t\treturn $this->data ['title'];\r\n\t}",
"function getApprovalNoticeTitle() {\r\n\t\treturn $this->getData('title');\r\n\t}",
"public function get_title(){\n if (is_wp_error( $this->feed ))\n return $this->error_msg;\n\n return $this->feed_item->get_title();\n }",
"public function getTitle()\n {\n return $this->event_title;\n }",
"public function getTitle(): string\n {\n return self::$task['title'];\n }",
"public function getTitle() {\n if ( empty($this->_title) ) {\n return $this->app->getInfos()->getTitle();\n } else {\n return $this->_title;\n }\n }",
"public function getTitle() {\n\t\treturn $this->meetingsession->Title;\n\t}",
"protected function getTitle() {\r\n\t\treturn $this->newsItem->getTitle();\r\n\t}",
"protected function getActionTitle()\n {\n return config('health.notifications.action-title');\n }",
"public function getTitle()\n {\n return $this->get('DialogTitle');\n }",
"function getTitle() {\n\t\treturn $this->getResource()->getDataValue('title');\n\t}",
"public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }",
"function getTitle()\n {\n return $this->activityTitle;\n }",
"public function getAlertTitle()\n {\n return $this->alertTitle;\n }",
"public function getStrTitle()\n {\n return $this->get(self::STRTITLE);\n }",
"public function getTitle() {\r\n\t\treturn $this->getAtributo(\"title\");\r\n\t}",
"public function getTitle()\n {\n return $this->data['fields']['title'];\n }",
"public function getEventTitle() : string {\n\t\treturn($this->eventTitle);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert group concatenated order_product_status_names and order_product_status_classes to array | private function tokenizeUniqueOrderProductStatuses($results)
{
$returnedResults = array();
foreach($results as $key => $result){
$orderProductStatusNames = explode(',',$result['order_product_status_names']);
$orderProductStatusClasses = explode(',',$result['order_product_status_classes']);
$orderProductStatuses = array();
foreach($orderProductStatusNames as $statuskey => $statusName){
$orderProductStatuses[$statusName] = array(
'name' => $statusName,
'class' => strlen($orderProductStatusClasses[$statuskey]) ?
$orderProductStatusClasses[$statuskey] : OrderProductStatus::DEFAULT_CLASS,
);
}
unset($result['order_product_status_names']);
unset($result['order_product_status_classes']);
$result['unique_order_product_statuses'] = array_values($orderProductStatuses);
$returnedResults[$key] = $result;
}
return $returnedResults;
} | [
"public function resultToGroups($raw) {\n $ret = array();\n \n // Convert the raw string back to an XML object\n $attrs = simplexml_load_string($raw);\n \n foreach(array_keys($this->groupAttrs) as $gAttr) {\n if(!empty($attrs->$gAttr)) {\n $ret[$gAttr][] = array('value' => (string)$attrs->$gAttr);\n }\n }\n \n // Also check Events, if not empty\n if(!empty($attrs->Events->EventProductCode)) {\n foreach((array)$attrs->Events->EventProductCode as $v) {\n $ret['EventProductCode'][] = array('value' => (string)$v);\n }\n }\n \n // Also check Committees, if not empty\n if(!empty($attrs->Committees->CommitteeName)) {\n foreach((array)$attrs->Committees->CommitteeName as $v) {\n $ret['CommitteeName'][] = array('value' => (string)$v);\n }\n }\n \n return $ret;\n }",
"public function resultToGroups($raw) {\n return array();\n }",
"public function getOrders2($order_ids) {\n $return_array = array();\n if ($order_ids) {\n $order_list = implode(\", \", $order_ids);\n\n $sql = \"SELECT so.*, ss.name as order_status_name FROM sps_order so INNER JOIN sps_order_status ss ON ss.order_status_id = so.order_status_id WHERE so.order_id IN (\" . $order_list . \")\";\n $query = $this->db->query($sql);\n foreach ($query->rows as $r) {\n $return_array[] = $r;\n }\n }\n return $return_array;\n }",
"public static function getOrderStatusList()\n {\n $array = array(\n Order::STATUS_PENDING => _(Order::STATUS_PENDING),\n Order::STATUS_PROCESSED => _(Order::STATUS_PROCESSED),\n Order::STATUS_SHIPPED => _(Order::STATUS_SHIPPED),\n Order::STATUS_COMPLETE => _(Order::STATUS_COMPLETE),\n Order::STATUS_REFUNDED => _(Order::STATUS_REFUNDED),\n Order::STATUS_VOIDED => _(Order::STATUS_VOIDED),\n// Order::STATUS_CANCELED => _(Order::STATUS_CANCELED),\n// Order::STATUS_CANCELED_REVERSAL => _(Order::STATUS_CANCELED_REVERSAL),\n// Order::STATUS_COMPLETE => _(Order::STATUS_COMPLETE),\n// Order::STATUS_FAILED => _(Order::STATUS_FAILED),\n// Order::STATUS_PROCESSING => _(Order::STATUS_PROCESSING),\n// Order::STATUS_INITIALIZED => _(Order::STATUS_INITIALIZED)\n );\n\n\n return $array;\n }",
"public function resultToGroups($raw) {\n $this->readFieldConfig();\n \n $ret = array();\n \n // Decode the json arrawy\n $attrs = json_decode($raw, true);\n \n // Get the set of groupable attributes\n $grAttrs = $this->groupableAttributes();\n \n foreach($grAttrs as $col => $label) {\n if(!empty($attrs[$col])) {\n // Find the raw value for the specified column\n $ret[$col][] = array('value' => $attrs[$col]);\n }\n }\n \n return $ret;\n }",
"public static function get_order_status_labels()\n {\n }",
"public function get_all_order_statuses() {\n\t \n\t if( version_compare( WOOCOMMERCE_VERSION, '2.2.0' ) >= 0 ) {\n\t\t\t$wm_order_statuses = array();\n\t\t\t$order_statuses_wc = wc_get_order_statuses();\n\t\t\tforeach ($order_statuses_wc as $order_status_key_wc => $order_status_name_wc )\n\t\t\t\t$wm_order_statuses[] = str_replace( 'wc-', '', $order_status_key_wc );\n\t\t\treturn $wm_order_statuses;\n\t\t} else {\n\t\t\t$args = array('fields' => 'names', 'hide_empty' => 0);\n \t\treturn get_terms('shop_order_status', $args);\n\t\t}\t\n }",
"public static function getStatusesToArray()\n {\n $temp = array();\n foreach(self::$statusOptions as $value => $key){\n $temp[] = array('label' => $key, 'value' => $value);\n }\n return $temp;\n }",
"public function getProductsToPurchaseByReqGroups($product = null)\n {\n $product = $this->getProduct($product);\n if ($this->isComposite($product)) {\n return array();\n }\n return array(array($product));\n }",
"public function prepareOrderDetailsGroupedByCustomer($orderDetails): array\n {\n $preparedOrderDetails = [];\n foreach ($orderDetails as $orderDetail) {\n $key = $orderDetail->id_customer;\n $preparedOrderDetails[$key]['sum_price'] = $orderDetail->sum_price;\n $preparedOrderDetails[$key]['sum_amount'] = $orderDetail->sum_amount;\n $preparedOrderDetails[$key]['sum_deposit'] = $orderDetail->sum_deposit;\n $preparedOrderDetails[$key]['order_detail_count'] = $orderDetail->order_detail_count;\n $preparedOrderDetails[$key]['customer_id'] = $key;\n $preparedOrderDetails[$key]['name'] = Configure::read('app.htmlHelper')->getNameRespectingIsDeleted($orderDetail->customer);\n $preparedOrderDetails[$key]['email'] = '';\n if ($orderDetail->customer) {\n $preparedOrderDetails[$key]['email'] = $orderDetail->customer->email;\n }\n $productsPickedUp = false;\n if (!empty($orderDetail->pickup_day_entity)) {\n $preparedOrderDetails[$key]['comment'] = $orderDetail->pickup_day_entity->comment;\n $preparedOrderDetails[$key]['products_picked_up_tmp'] = $orderDetail->pickup_day_entity->products_picked_up;\n }\n if (!isset($preparedOrderDetails[$key]['timebased_currency_order_detail_seconds_sum'])) {\n $preparedOrderDetails[$key]['timebased_currency_order_detail_seconds_sum'] = 0;\n }\n $preparedOrderDetails[$key]['timebased_currency_order_detail_seconds_sum'] = $orderDetail->timebased_currency_order_detail_seconds_sum;\n if (isset($preparedOrderDetails[$key]['products_picked_up_tmp']) && $preparedOrderDetails[$key]['products_picked_up_tmp']) {\n $productsPickedUp = true;\n $preparedOrderDetails[$key]['row_class'] = ['selected'];\n }\n $preparedOrderDetails[$key]['products_picked_up'] = $productsPickedUp;\n unset($preparedOrderDetails[$key]['products_picked_up_tmp']);\n }\n\n foreach($preparedOrderDetails as &$orderDetail) {\n $orderDetail['different_pickup_day_count'] = $this->getDifferentPickupDayCountByCustomerId($orderDetail['customer_id']);\n }\n return $preparedOrderDetails;\n }",
"private function makeGroupArray( $group ) {\n\t\tif ( $group === '' ) {\n\t\t\t$group = [];\n\t\t} elseif ( is_string( $group ) ) {\n\t\t\t$group = array_map( 'trim', explode( ',', $group ) );\n\t\t}\n\t\treturn $group;\n\t}",
"public static function order_status() {\n\n $statusmsgs = array(\n 'Ordered',\n 'Picked up',\n 'Processing',\n 'Ready',\n 'Delivered',\n 'Payment pending',\n 'Cancelled'\n );\n\n return $statusmsgs;\n }",
"public static function getProductStatusList() {\n return Product::getStatusTitleArray();\n }",
"function bibdk_openuserstatus_get_group_elements($user_status, $group, $element) {\n $items = array();\n foreach ($user_status as $agencyId => $agency_data) {\n if (is_object($agency_data)) {\n $resp = $agency_data->getResponse();\n if (isset($resp[$group][$element])) {\n foreach ($resp[$group][$element] as $item) {\n $item['agencyId'] = $agencyId;\n $items[] = $item;\n }\n }\n }\n }\n\n return $items;\n}",
"private function _getFeaturesGroupArray() {\n $feature = $this->_helper->getServiceLayer('features','group');\n $default = $feature->getMapper()->findAll()->toKeyValueArray('id', 'title');\n $result = array('' => $this->view->translate('Выберите...'));\n foreach ($default as $key => $value) {\n $result[$key] = $value;\n }\n return array('features_group_id'=>$result);\n }",
"public function getAllProductAttributeGroups(){\n\t\t$terms = ProductAttributeGroup::all();\n\t\t$product_attribute_group = [];\n\n\t\tif(empty($terms)){\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach($terms as $term){\n\t\t\t$group = [];\n\t\t\t$group['group'] = $term;\n\t\t\t$group['attributes'] = [];\n\t\t\t$product_attribute_grouping = ProductAttributeGrouping::where('productattrgroup_id', $term->term_id)->orderBy('attr_order')->get();\n\t\t\tif($product_attribute_grouping){\n\t\t\t\tforeach($product_attribute_grouping as $attribute){\n\t\t\t\t\t$group['attributes'][] = get_taxonomy($attribute->productattr_name);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$product_attribute_group[] = $group;\n\t\t}\n\n\t\t$attr_groups = ProductAttribute::all();\n\t\t$attr_groups_array = [];\n\t\tforeach($attr_groups as $attr){\n\t\t\t$taxonomy = get_taxonomy($attr->name);\n\t\t\t$product_attribute_grouping = ProductAttributeGrouping::where('productattr_name', $attr->name)->first();\n\t\t\tif(!$product_attribute_grouping){\n\t\t\t\t$attr_groups_array[] = $taxonomy;\n\t\t\t}\n\t\t}\n\n\t\treturn json_encode(['groups' => $product_attribute_group, 'product_attributes' => $attr_groups_array]);\n\t}",
"function list_status_product()\n{\n return [\n Product::STATUS_ACTIVE => \"Ativo\",\n Product::STATUS_BLOCK => \"Bloqueado\"\n ];\n}",
"public function getValidSubstitutionGroupAttributes():array\n {\n return [\n 'Prefix (absent) and bound to default namespace' => [\n 'element_substitutionGroup_0009.xsd', \n [\n '' => 'http://example.org', \n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n 'http://example.org', \n 'foo', \n ], \n 'Prefix and local part (starts with _)' => [\n 'element_substitutionGroup_0010.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n '_foo', \n ], \n 'Prefix and local part (starts with letter)' => [\n 'element_substitutionGroup_0011.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f', \n ], \n 'Prefix and local part (contains letter)' => [\n 'element_substitutionGroup_0012.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'foo', \n ], \n 'Prefix and local part (contains digit)' => [\n 'element_substitutionGroup_0013.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f00', \n ], \n 'Prefix and local part (contains .)' => [\n 'element_substitutionGroup_0014.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f.bar', \n ], \n 'Prefix and local part (contains -)' => [\n 'element_substitutionGroup_0015.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f-bar', \n ], \n 'Prefix and local part (contains _)' => [\n 'element_substitutionGroup_0016.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'baz' => 'http://example.org/baz', \n ], \n 'http://example.org/baz', \n 'f_bar', \n ], \n 'Prefix (starts with _) and local part' => [\n 'element_substitutionGroup_0017.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n '_foo' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (starts with letter) and local part' => [\n 'element_substitutionGroup_0018.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains letter) and local part' => [\n 'element_substitutionGroup_0019.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'foo' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains digit) and local part' => [\n 'element_substitutionGroup_0020.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f00' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains .) and local part' => [\n 'element_substitutionGroup_0021.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f.bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains -) and local part' => [\n 'element_substitutionGroup_0022.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f-bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n 'Prefix (contains _) and local part' => [\n 'element_substitutionGroup_0023.xsd', \n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n 'f_bar' => 'http://example.org', \n ], \n 'http://example.org', \n 'baz', \n ], \n ];\n }",
"protected function get_order_statuses() {\n\t\t$subscription_statuses = array();\n\n\t\tforeach ( array_keys( wcs_get_subscription_statuses() ) as $status ) {\n\t\t\t$subscription_statuses[] = str_replace( 'wc-', '', $status );\n\t\t}\n\t\treturn $subscription_statuses;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a language for the specified participant | public function add_submit($participant_id)
{
// Run validation
if (!$this->validate_language())
{
// Show form again with error messages
flashdata(validation_errors(), FALSE, 'language_message');
redirect($this->agent->referrer(), 'refresh');
}
else
{
// If succeeded, insert data into database
$language = $this->post_language($participant_id);
$this->languageModel->add_language($language);
flashdata(lang('language_added'), TRUE, 'language_message');
redirect($this->agent->referrer(), 'refresh');
}
} | [
"public function add(Language $language);",
"function addLanguage() {\n $data = array(\n 'lng_short' => empty($this->params['lng_short']) ? '' : $this->params['lng_short'],\n 'lng_ident' => empty($this->params['lng_ident']) ? '' : $this->params['lng_ident'],\n 'lng_title' => empty($this->params['lng_title']) ? '' : $this->params['lng_title'],\n 'lng_glyph' => empty($this->params['lng_glyph']) ? '' : $this->params['lng_glyph'],\n 'is_interface_lng' => empty($this->params['is_interface_lng'])\n ? 0 : (int)$this->params['is_interface_lng'],\n 'is_content_lng' => empty($this->params['is_content_lng'])\n ? 0 : (int)$this->params['is_content_lng']\n );\n return $this->databaseInsertRecord($this->tableLanguage, 'lng_id', $data);\n }",
"public function add(LanguageInformationInterface $language);",
"public function createLanguage($name);",
"public function addLanguage($language)\n {\n array_push($this->array, $language);\n }",
"public static function register_language($name) {\n self::$languages[] = $name;\n }",
"function addLangItem() {\n\t\tglobal $bw, $langtype;\n\t\t\n\t\t// Set language item object values\n\t\t$this->language->setValue ( array ('pageTitle' => $bw->input ['moduleName'], 'main_title' => $bw->input ['moduleName'] ) );\n\t\t$this->language->setId ( $bw->input ['langId'] );\n\t\t$this->language->setModule ( $bw->input ['moduleName'] );\n\t\t$bw->input [3] = $bw->input ['langtype'];\n\t\t$langtype = $bw->input ['langtype'];\n\t\t$this->langtype = $bw->input [3];\n\t\t\n\t\tif ($this->language->getModule () == \"\")\n\t\t\t$this->result ['message'] .= \"Module can't be blank!<br>\";\n\t\telseif ($this->langtype == '')\n\t\t\t$this->result ['message'] .= \"Folder Type lang is not define!<br>\";\n\t\telse\n\t\t\t$this->writeItemToFile ();\n\t\t\n\t\t$this->getLangItemList ( $this->result ['message'] );\n\t}",
"function language($language)\n {\n $GLOBALS[\"config_language\"][] = $language;\n }",
"function setLanguage(/*...*/);",
"public function testUpdatePersonLanguage()\n {\n $personId = $this->user->id;\n $response = $this->putPerson($this->user, ['languages' => 'sumarian,19th century victorian burner']);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas(\n 'person_language',\n [\n 'person_id' => $personId,\n 'language_name' => 'sumarian',\n ]\n );\n $this->assertDatabaseHas(\n 'person_language',\n [\n 'person_id' => $personId,\n 'language_name' => '19th century victorian burner',\n ]\n );\n }",
"public function setLanguage();",
"public static function userProfileAddLanguage()\n {\n $addLang = function ($user)\n {\n $c = new BackendController();\n echo $c->getRenderLanguage($user->ID);\n };\n add_action('show_user_profile', $addLang);\n add_action('edit_user_profile', $addLang);\n\n $updateLang = function ($user_ID)\n {\n if (current_user_can('edit_user', $user_ID)) {\n $user = User::find($user_ID);\n $user->setLang($_POST[User::KEY_LANGUAGE]);\n }\n };\n add_action('personal_options_update', $updateLang);\n add_action('edit_user_profile_update', $updateLang);\n }",
"public function testAddAndUseNewLanguage()\n {\n $newLang = new \\stdClass;\n $newLang->id = 'de';\n $newLang->name = new \\stdClass;\n $newLang->name->en = 'German';\n\n $client = static::createRestClient();\n $client->post('/i18n/language/', $newLang);\n $response = $client->getResponse();\n\n $client = static::createRestClient();\n $client->request('GET', $response->headers->get('Location'));\n $response = $client->getResponse();\n $results = $client->getResults();\n\n $this->assertResponseSchemaRel(self::SCHEMA_URL . 'item', $response);\n $this->assertEquals('de', $results->id);\n $this->assertEquals('de, en', $response->headers->get('Content-Language'));\n\n $client = static::createRestClient();\n $client->request('GET', '/i18n/language/', [], [], array('HTTP_ACCEPT_LANGUAGE' => 'en,de'));\n $this->assertEquals('de, en', $client->getResponse()->headers->get('Content-Language'));\n\n $client = static::createRestClient();\n $client->request('GET', '/i18n/language/en', [], [], array('HTTP_ACCEPT_LANGUAGE' => 'en,de'));\n $results = $client->getResults();\n\n $this->assertEquals('English', $results->name->en);\n $this->assertEquals('Englisch', $results->name->de);\n }",
"private function addLangToUrl()\n\t{\n\t\tif ($this->currentLanguage !== $this->defaultLanguage){\n\t\t\t$this->url = '/' . $this->currentLanguage . $this->url;\n\t\t}\n\t}",
"public static function addLanguage($langKey, $langName='') {\r\n self::$_langs[$langKey] = ($langName) ? $langName : $langKey;\r\n }",
"public function language($name);",
"protected function installLanguage()\n {\n $oWebRequest = new WebRequest();\n $oWebRequest->setPublicKey($this->credential->getApiPublic());\n $oWebRequest->setSecretKey($this->credential->getApiSecret());\n $oWebRequest->setApiRoot($this->credential->getApiRoot());\n $oWebRequest->setApiResource('/api/rest/v1/languages/');\n\n #We'll be creating Pirate language.\n $oLanguage = new \\stdClass();\n $oLanguage->label = \"Pirate\";\n $oLanguage->base_language = \"en\";\n $oLanguage->flag_icon = \"pi\";\n\n $oWebRequest->setData($oLanguage);\n try {\n $sOutput = $oWebRequest->post();\n $oPirateLanguage = Json\\JsonSerializer::deSerialize($sOutput);\n } catch (InvalidApiResponse $e) {\n return false;\n }\n\n //Now we can add the translation. $aPirate includes all keys and translations.\n $aPirate = [];\n include_once('Data/Pirate.php');\n\n $oWebRequest = new WebRequest();\n $oWebRequest->setPublicKey($this->credential->getApiPublic());\n $oWebRequest->setSecretKey($this->credential->getApiSecret());\n $oWebRequest->setApiRoot($this->credential->getApiRoot());\n $oWebRequest->setApiResource('/api/rest/v1/translations/');\n $oWebRequest->setAcceptLanguage($oPirateLanguage->iso_code);\n\n $i = 0;\n $oObject = new \\stdClass();\n $oObject->translations = [];\n foreach ($aPirate as $sKey => $sValue) {\n\n $oTranslation = new \\stdClass();\n $oTranslation->key = $sKey;\n $oTranslation->value = $sValue;\n\n $oObject->translations[] = $oTranslation;\n\n if ($i > 100) {\n $oWebRequest->setData($oObject);\n $oWebRequest->put();\n\n $oObject->translations = [];\n $i = 0;\n }\n $i++;\n }\n if (!empty($oObject->translations)) {\n $oWebRequest->setData($oObject);\n $oWebRequest->put();\n }\n return true;\n }",
"private function registerLanguage()\n {\n $App = $this->getContainer('application');\n if ($App->getConfig()->exists('language')) {\n $app_language = $App->getConfig()->get('language');\n $language_identifier = 'language:'.$App->getName().'.'.$app_language.'.com_'.$this->component;\n if (!$App->Text->loadLanguageIdentifier($language_identifier)) {\n $language_identifier = 'components:'.$this->component.'.'.$App->getName().'.language.'.$app_language.'.com_'.$this->component;\n $App->Text->loadLanguageIdentifier($language_identifier);\n }\n }\n }",
"public function testCreateLanguage() {\n $this->objFromFixture('Member', 'admin')->login(); //Login admin\n \n \n //Test creating a language\n $response=$this->getAMFResponse('Administration.createLanguage', array(\n 'language'=>'API Language',\n 'fileExtension'=>'api'\n ));\n \n \n //Validate the response\n $this->assertEquals('HELO', $response['status'], 'Response status should have been HELO');\n \n \n //Test creating a duplicate language\n $response=$this->getAMFResponse('Administration.createLanguage', array(\n 'language'=>'API Language',\n 'fileExtension'=>'api'\n ));\n \n \n //Validate the response\n $this->assertEquals('EROR', $response['status'], 'Response status should have been EROR');\n $this->assertEquals(_t('CodeBankAPI.LANGUAGE_EXISTS', '_Language already exists'), $response['message'], 'Response message should have been that the language already exists');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/QUIZ CUSTOM POST TYPE /meta boxes for quizzes | function quiz_add_meta_boxes( $post ){
add_meta_box( 'quiz_meta_box', __( 'Quiz settings', 'random-timed-quiz' ), 'build_meta_box', 'random-timed-quiz', 'normal', 'high' );
} | [
"public function question_type_page_box( $post ) {\n\t\t\tglobal $learndash_question_types;\n\n\t\t\tif ( ( $this->pro_question_edit ) && is_a( $this->pro_question_edit, 'WpProQuiz_Model_Question' ) ) {\n\t\t\t\t$question_type = $this->pro_question_edit->getAnswerType();\n\t\t\t} else {\n\t\t\t\t$question_type = 'single';\n\t\t\t}\n\t\t\t?>\n\t\t\t<fieldset>\n\t\t\t\t<legend class=\"screen-reader-text\"><?php esc_html__( 'Answer Type', 'learndash' ); ?></legend>\n\t\t\t\t<ul>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $learndash_question_types as $q_type => $q_label ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<li><input id=\"learndash-question-type-<?php echo $q_type; ?>\" type=\"radio\" name=\"answerType\" value=\"<?php echo $q_type; ?>\" <?php checked( $q_type, $question_type ); ?> />\n\t\t\t\t\t<label for=\"learndash-question-type-<?php echo $q_type; ?>\" ><?php echo esc_attr( $q_label ); ?></label></li>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t</fieldset>\n\t\t\t<?php\n\t\t}",
"function add_meta_boxes() {\n\n\t$screen = get_current_screen();\n\n\tif ( 'sfwd-quiz' !== get_post_type( get_the_ID() ) &&\n\t\t'sfwd-quiz_page_quizzes-builder' !== $screen->id ) {\n\t\treturn;\n\t}\n\n\tadd_meta_box(\n\t\t'sfwd-quiz-questions',\n\t\tsprintf( '%s', \\LearnDash_Custom_Label::get_label( 'questions' ) ),\n\t\t'LearnDash\\Quiz\\Metaboxes\\meta_box_questions_callback',\n\t\tnull,\n\t\t'side'\n\t);\n\n/*\n\tadd_meta_box(\n\t\t'learndash_admin_quiz_navigation',\n\t\tsprintf(\n\t\t\t// translators: placeholders: Quiz, Questions.\n\t\t\tesc_html_x( '%1$s %2$s', 'placeholders: Quiz, Questions', 'learndash' ),\n\t\t\t\\LearnDash_Custom_Label::get_label( 'quiz' ), \\LearnDash_Custom_Label::get_label( 'questions' )\n\t\t),\n\t\t'learndash_quiz_navigation_admin_box_content',\n\t\tnull,\n\t\t'side'\n\t);\n*/\n}",
"function quiz_metaboxes_add() {\n add_meta_box( 'quizmeta_box_', 'Answers', 'quiz_metaboxes', 'quizbook_Quizzes', 'normal', 'high', null );\n}",
"function pb_meta_box()\n{\n\tforeach( unserialize( PB_POSTTYPES ) as $screen ) {\n\n\t\t// Show the PageBuilder boxes\n\t\tadd_meta_box( 'pb_meta', 'PageBuilder', 'pb_meta_content', $screen, 'normal', 'high' );\n\t\tadd_meta_box( 'pb_meta_preview', 'PageBuilder Preview', 'pb_meta_preview_content', $screen, 'normal', 'high' );\n\t}\n}",
"function esb_tm_meta_box() {\n\n add_meta_box( 'esb_tm_testimonial_meta', __( 'Testimonial Options', 'esbtm' ), 'esb_tm_testimonial_meta_options_page', ESB_TM_POST_TYPE, 'normal', 'high' );\n \n}",
"function skudo_create_meta_testimonials_box() {\n\tif ( function_exists('add_meta_box') && defined('SKUDO_TESTIMONIALS_POST_TYPE')) {\n\t\tadd_meta_box( 'new-meta-testimonials-boxes', '<div class=\"icon-small\"></div> '.\"Skudo\".' TESTIMONIALS ITEM SETTINGS', 'skudo_new_meta_testimonials_boxes', SKUDO_TESTIMONIALS_POST_TYPE, 'normal', 'high' );\n\t}\n}",
"function wpcampus_add_meta_boxes( $post_type, $post ) {\n\tadd_meta_box(\n\t\t'wpcampus-podcast-guide',\n\t\t'WPCampus Podcast Guide',\n\t\t'wpcampus_print_meta_boxes',\n\t\t'podcast',\n\t\t'side',\n\t\t'high'\n\t);\n\n}",
"function pricing_post_meta(){\n\t\tadd_meta_box(\n\t\t\t'pricing_meta',\n\t\t\t'Pricing metaBox',\n\t\t\t'pricing_meta_callback',\n\t\t\t'pricing',\n\t\t\t'normal',\n\t\t\t'high'\n\t\t);\n\t}",
"function add_post_meta_box() {\n\n\t\t$supported_post_types = $this->get_post_types_for_module( $this->module );\n\t\tforeach ( $supported_post_types as $post_type )\n\t\t\tadd_meta_box('edit-flow-editorial-comments', __('Editorial Comments', 'edit-flow'), array($this, 'editorial_comments_meta_box'), $post_type, 'normal' );\n\n\t}",
"public function quiz_custom_fields_options_page_box( $post ) {\n\t\t\t$this->init_quiz_edit( $post );\n\t\t\tif ( ( $this->pro_quiz_edit ) && is_a( $this->pro_quiz_edit, 'WpProQuiz_View_QuizEdit' ) ) {\n\t\t\t\t$this->pro_quiz_edit->form( $this->_get );\n\t\t\t}\n\t\t}",
"function MRP_add_custom_box() {\n\tforeach( MRP_get_supported_post_types() as $post_type ) {\n\t add_meta_box( 'MRP_sectionid', __( 'Related items', 'microkids-related-posts' ), 'MRP_inner_custom_box', $post_type, 'normal' );\n\t}\n }",
"public function wpe_bsp_post_interface(){\n\t\t$this->post_types = get_post_types(array('public' => true), 'names');\n\t\tforeach ( $this->post_types as $screen ) {\n\t\t\tadd_meta_box( \n\t\t\t'wpe-bsp-inline-box',\n\t\t\t'BSP Inline Script & Styles',\n\t\t\tarray($this, 'wpe_bsp_inline_post_box'),\n\t\t\t$screen,\n\t\t\t'advanced',\n\t\t\t'high'\n\t\t\t);\n\t\t\tadd_meta_box( \n\t\t\t'wpe-bsp-qi-box',\n\t\t\t'Blog Styles Pro Quick Insert',\n\t\t\tarray($this, 'wpe_bsp_quick_insert_menu'),\n\t\t\t$screen,\n\t\t\t'side',\n\t\t\t'high'\n\t\t\t);\n\t\t}\n\t}",
"public static function polylangMetaBox($post_type, $context)\n {\n $pll_meta_box = new Polylang\\MetaBox();\n $pll_meta_box->registerMetaBox($post_type, $context);\n }",
"function add_meta_boxes($post_type, $post)\n {\n }",
"function addMetaBoxes(){\n\tglobal $metaBoxes;\n\tif(isset($metaBoxes[\"template\"])){\n\t\t$C = new core();\n\t\tif($C->pageTemplate() != $metaBoxes[\"template\"]){\n\t\t\treturn false;\n\t\t}\n\t}\n\tif(!isset($metaBoxes[\"title\"])){\n\t\t$metaBoxes[\"title\"] = \"Custom Meta\";\n\t}\n\tif(!isset($meta[\"type\"])){\n\t\tadd_meta_box(\"custom_meta\",$metaBoxes[\"title\"],\"addCustomMeta\",\"page\",\"normal\",\"high\"); \n\t\tadd_meta_box(\"custom_meta\",$metaBoxes[\"title\"],\"addCustomMeta\",\"post\",\"normal\",\"high\"); \n\t}else{\n\t\tif($meta[\"type\"] == \"page\"){\n\t\t\tadd_meta_box(\"custom_meta\",$metaBoxes[\"title\"],\"addCustomMeta\",\"page\",\"normal\",\"high\"); \n\t\t}elseif(($meta[\"type\"] == \"post\")){\n\t\t\tadd_meta_box(\"custom_meta\",$metaBoxes[\"title\"],\"addCustomMeta\",\"post\",\"normal\",\"high\"); \n\t\t}\n\t}\n}",
"function custom_post_types() {\n\tregister_post_type( 'question_answer', \n\t\tarray(\n\t\t\t'labels' \t\t=> array(\n\t\t\t\t'name' \t\t\t\t=> __('Q&A\\'s'),\n\t\t\t\t'singular_name' \t=> __('Q&A'),\n\t\t\t\t'add_new_item'\t\t=> __('Add New Q&A')\n\t\t\t),\n\t\t\t'public' \t\t=> true,\n\t\t\t'taxonomies' \t=> array( 'question_answer_categories' ),\n\t\t\t'supports'\t\t=> array( 'title', 'thumbnail', 'custom-fields'),\n\t\t\t'has_archive'\t=> true,\n\t\t\t'menu_position'\t=> 20,\n\t\t\t'description'\t=> 'Helping understand and estimate your carbon footprint. Answers provided by Greenometry',\n\t\t\t'menu_icon'\t\t=> 'dashicons-editor-help'\n\t\t) \n\t);\n\tregister_post_type('videos', \n\t\tarray(\n\t\t\t'labels'\t\t=> array(\n\t\t\t\t'name'\t\t\t\t=> __('Videos'),\n\t\t\t\t'singular_name'\t\t=> __('Video'),\n\t\t\t\t'add_new_item'\t\t=> __('Add New Video')\n\t\t\t),\n\t\t\t'public'\t\t=> true,\n\t\t\t'taxonomies'\t=> array('category', 'post_tag'),\n\t\t\t'supports'\t\t=> array('title', 'editor', 'thumbnail', 'custom-fields'),\n\t\t\t'has_archive'\t=> true,\n\t\t\t'menu_position'\t=> 20,\n\t\t\t'menu_icon'\t\t=> 'dashicons-video-alt',\n\t\t\t'description'\t=> 'Relevant Videos and Presentations'\n\n\t\t)\n\t);\n\tregister_post_type('team_members', \n\t\tarray(\n\t\t\t'labels'\t\t=> array(\n\t\t\t'name'\t\t\t\t=> __('Our Team'),\n\t\t\t'singular_name'\t\t=> __('Team Member'),\n\t\t\t'add_new_item'\t\t=> __('Add New Team Member')\n\t\t),\n\t\t'public'\t\t=> true,\n\t\t'taxonomies'\t=> array('category', 'post_tag'),\n\t\t'supports'\t\t=> array('title', 'editor', 'thumbnail', 'custom-fields'),\n\t\t'has_archive'\t=> true,\n\t\t'menu_position'\t=> 20,\n\t\t'menu_icon'\t\t=> 'dashicons-groups'\n\n\t\t)\n\t);\n\tregister_post_type('publications', \n\tarray(\n\t\t'labels'\t\t=> array(\n\t\t'name'\t\t\t\t=> __('Publications'),\n\t\t'singular_name'\t\t=> __('Publication'),\n\t\t'add_new_item'\t\t=> __('Add New Publication')\n\t),\n\t'public'\t\t=> true,\n\t'supports'\t\t=> array('title'),\n\t'has_archive'\t=> true,\n\t'menu_position'\t=> 20,\n\t'menu_icon'\t\t=> 'dashicons-media-document'\n\n\t)\n);\n}",
"function wdm_add_meta_box() {\n\n add_meta_box(\n 'wdm_sectionid', 'Rank for slider video', 'wdm_meta_box_callback', 'post'\n ); //you can change the 4th paramter i.e. post to custom post type name, if you want it for something else\n\n}",
"public function add_status_metabox(){\n\t\tadd_meta_box( 'dwqa-post-status', __( 'Question Meta Data','dwqa' ), 'dwqa_question_status_box_html', 'dwqa-question', 'side', 'high' );\n\t}",
"public function add_meta_box( $post_type ) {\n\t\t// Register custom meta box if post format has custom settings\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test that the viewer permissions returned are false if not enabled. | public function test_viewer_permissions_false_if_not_enabled() {
$this->resetAfterTest();
set_config('turnitinviewerviewfullsource', 0, 'plagiarism_turnitinsim');
set_config('turnitinviewermatchsubinfo', 0, 'plagiarism_turnitinsim');
// Create assign module.
$record = new stdClass();
$record->course = $this->course;
$module = $this->getDataGenerator()->create_module('assign', $record);
// Get course module data.
$cm = get_coursemodule_from_instance('assign', $module->id);
// Create submission object.
$tssubmission = new plagiarism_turnitinsim_submission();
$tssubmission->setcm($cm->id);
// Verify that viewer permissions are false as the config values are set to false.
$permissions = $tssubmission->create_report_viewer_permissions();
$this->assertEquals(false, $permissions['may_view_submission_full_source']);
$this->assertEquals(false, $permissions['may_view_match_submission_info']);
} | [
"protected function canShowPermissionsModule() : bool {}",
"public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}",
"public function checkPermissions()\n {\n return $this->modx->context->checkPolicy(['redactor_configurator' => true, 'redactor_sets_export' => true]);\n }",
"function isViewable()\n {\n \n if (sfContext::getInstance()->getUser()->hasCredential(\"viewallcontent\"))\n { \r\n \tsfContext::getInstance()->getLogger()->info(\"You have the fu, you can see me.\");\n \treturn true;\n } \n\n // Access to approved artork is for anyone\n if ($this->isApproved()) \n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is approved, so it is viewable\");\n \treturn true;\n }\n\n // Access to removed artwork is only for admin (returned true above)\n if ($this->isRemoved())\n {\n sfContext::getInstance()->getLogger()->info(\"This artwork is removed, and cannot be seen\");\n \treturn false;\n }\n \n // also allow access to owner of artwork - unless they have removed it\n if (sfContext::getInstance()->getUser()->isAuthenticated()\n && $this->getUserId() == sfContext::getInstance()->getUser()->getGuardUser()->getId())\n {\n sfContext::getInstance()->getLogger()->info(\"You can see this artwork since you are the owner\");\n \treturn true;\n }\n\n sfContext::getInstance()->getLogger()->info(\"This artwork is not approved, and cannot be seen\");\n return false;\n }",
"public function isAllowed() {\n\t\t# Users who cannot edit or review the page cannot set this\n\t\treturn ( $this->page\n\t\t\t&& $this->page->userCan( 'stablesettings' )\n\t\t\t&& $this->page->userCan( 'edit' )\n\t\t\t&& $this->page->userCan( 'review' )\n\t\t);\n\t}",
"private function canShowManagePanel() {\n module_load_include('inc','islandora_xacml_api','Xacml');\n module_load_include('inc','islandora_xacml_api','XacmlException');\n global $user;\n\n if ($user->uid == 1 || in_array('administrator', $user->roles)) {\n $show = TRUE;\n }\n else {\n try {\n $xacml = Xacml::constructFromPid($this->pid);\n if($xacml->managementRule->isPopulated()) {\n $show = $xacml->managementRule->hasPermission($user->name, $user->roles);\n }\n else {\n $show = FALSE;\n }\n }\n catch (XacmlException $e) {\n $show = FALSE;\n }\n }\n\n $show &= user_access('purge objects and datastreams')\n || user_access('add fedora datastreams')\n || user_access('edit fedora meta data');\n\n return $show;\n }",
"public function user_has_access() {\n\t\treturn current_user_can( 'pvm_edit_projects' );\n\t}",
"function canSeePrivate() {\n \treturn $this->isProjectManager() || (boolean) $this->getSystemPermission('can_see_private_objects');\n }",
"function p8i_user_can_see_test_drive() {\n if (current_user_can('edit_theme_options')) {\n return true;\n }\n\n if (p8i_is_tech_front_view()) {\n return true;\n }\n\n return false;\n}",
"function checkAccessRight(){\r\n \t$res = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*',$this->personTable,'feuser_id='.intval($GLOBALS['TSFE']->fe_user->user['uid']));\r\n \tif($res[0]['publadmin'] || $this->person['feuser_id']==intval($GLOBALS['TSFE']->fe_user->user['uid'])){\r\n \t\treturn true;\r\n \t}else{\r\n \t\treturn false;\r\n \t}\r\n }",
"function testAccessPerm() {\n $view = $this->view_access_perm();\n\n $view->set_display('default');\n $access_plugin = $view->display_handler->get_plugin('access');\n\n $this->assertTrue($view->display_handler->access($this->admin_user), t('Admin-Account should be able to access the view everytime'));\n $this->assertFalse($view->display_handler->access($this->web_user));\n $this->assertTrue($view->display_handler->access($this->normal_user));\n }",
"private function isAuthorisedDisplayDebug()\n\t{\n\t\tstatic $result = null;\n\n\t\tif ($result !== null)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t// If the user is not allowed to view the output then end here.\n\t\t$filterGroups = (array) $this->params->get('filter_groups', array());\n\n\t\tif (!empty($filterGroups))\n\t\t{\n\t\t\t$userGroups = JFactory::getUser()->get('groups');\n\n\t\t\tif (!array_intersect($filterGroups, $userGroups))\n\t\t\t{\n\t\t\t\t$result = false;\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$result = true;\n\n\t\treturn true;\n\t}",
"function checkAccess () {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) return true;\n else { return false; }\n }",
"public function getIsExemptFromFieldLevelPermissions() {\n return Yii::app()->params->isAdmin || empty(Yii::app()->params->roles);\n }",
"public function isViewAllowed() {\n\t\treturn $this->mSettingInfo->config_is_allowed();\n\t}",
"function CheckPermissions()\n {\n $env = $_SERVER[\"HTTP_X_DEKISCRIPT_ENV\"];\n \n if (!strlen($env)) return false;\n \n if (strstr($env, 'user.anonymous=\"false\"')) return true;\n \n return false;\n }",
"public function checkViewPermission()\r\n\t{\r\n\t\t$session = $this->session->all_userdata();\t\r\n\t\t$role_id = $session[0]->user_role_id;\r\n\t\t$TabAsPerRole = $this->home_model->getAllTabAsPerRole($role_id);\r\n\r\n\t\tforeach($TabAsPerRole as $tab_list)\r\n\t\t{\r\n\t\t\tif($tab_list->controller_name == $this->uri->segment(2))\r\n\t\t\t{\r\n\t\t\t\tif($tab_list->userView == '1')\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function hasPanelAccess();",
"public function viewAny()\n {\n return auth()->user()->can('permission_access');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all modules data. | public function getModulesData()
{
return collect(File::directories($this->modulePath))
->mapWithKeys(function ($directory) {
$module = $this->getModuleByPath(basename($directory));
return [$module->alias => $module];
});
} | [
"protected function getModulesData() {}",
"static function getAllModules(){\n\t\tself::init();\n\t\treturn self::$we_available_modules;\n\t}",
"public static function getAllModule()\n {\n \n }",
"public function getModules();",
"public function all()\n {\n if ($this->moduleLoaded === false) {\n $this->loadModules();\n }\n\n return $this->moduleList;\n }",
"public function listAll() {\n $ml = new moduleloader();\n $modules = $ml->getAllModules();\n print_r($modules);\n }",
"protected function getAllModules()\n {\n return $this->container->metaDataHelper->getAllEnabledModules();\n }",
"function getAll()\n {\n $this->dbInit();\n\n $return_array = array();\n $module_array = array();\n\n $this->Database->array_query( $module_array, \"SELECT ID FROM eZUser_Module ORDER By Name\" );\n\n for ( $i=0; $i<count ( $module_array ); $i++ )\n {\n $return_array[$i] = new eZModule( $module_array[$i][ \"ID\" ], 0 );\n }\n\n return $return_array;\n }",
"function module_list_all () {\n $ml = new moduleloader();\n $modules = $ml->getAllModules();\n print_r($modules);\n}",
"public function getAllModules()\n {\n $modules = array();\n foreach (\\Mage::getConfig()->getNode('modules')->children() as $moduleName => $data) {\n $modules[] = $moduleName;\n }\n return $modules;\n }",
"public function getRawModuleData() {}",
"public function getModuleInfo(): array\n {\n return $this->_cachedData['moduleInfo'] ?? [];\n }",
"function get_all_modules() {\r\n static $modules = null;\r\n // Return result if cached.\r\n if ($modules !== null)\r\n return $modules;\r\n // Scan modules.\r\n $modules = array();\r\n $app_modules = @scandir(APP_DIR . \"/modules\");\r\n if (!is_array($app_modules))\r\n $app_modules = array();\r\n foreach ($app_modules as $module) {\r\n if ($module[0] === \".\")\r\n continue;\r\n $modules[$module] = array(\"melt\\\\$module\\\\\" . underline_to_cased($module) . \"Module\", APP_DIR . \"/modules/$module\");\r\n }\r\n foreach (scandir(APP_CORE_DIR) as $module) {\r\n if ($module[0] === \".\" || is_file($module))\r\n continue;\r\n $modules[$module] = array(\"melt\\\\$module\\\\\" . underline_to_cased($module) . \"Module\", APP_CORE_DIR . \"/$module\");\r\n }\r\n return $modules;\r\n}",
"public function modules()\n {\n return $this->newQuery('getModules');\n }",
"public static function all()\n {\n return self::$data;\n }",
"public function getAppModules();",
"protected function loadCoreModulesList()\n {\n return $this->readFile('core.modules.php');\n }",
"public function getModules()\n {\n if ($_SERVER['REQUEST_METHOD'] != 'GET')\n return;\n \n $dbConnection = new MySqlPDODatabase();\n \n $modulesDAO = new ModulesDAO($dbConnection);\n echo json_encode($modulesDAO->getFromCourse((int)$_GET['id_course']));\n }",
"public static function getAllModuleConfig()\n {\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the account balance to a new value in UK Pounds. | public function updateAccountBalance($newBalance){
$expectedExceptions = array();
$expectedExceptions["\\Kinikit\\MVC\\Exception\\RateLimitExceededException"] = "\Netistrar\ClientAPI\Exception\RateLimitExceededException";
parent::callMethod("updateBalance/$newBalance", "GET", array(),null,null,$expectedExceptions);
} | [
"function balanceUpdate()\n\t{\n\t\t// Get Current Balance\n\t\t$x = SQL::fetch_one('SELECT sum(amount) AS balance_update FROM account_ledger WHERE account_id = ?', array($this->_data['id']));\n\t\t$balance = floatval($x);\n\n\t\t// Sum the Child Accounts\n\t\t// $rs = $this->child_accounts;\n\t\t// foreach ($rs as $a) {\n\t\t//\t $x = $db->fetchOne(\"select sum(amount) from account_ledger where account_id=$a->id\");\n\t\t//\t $balance += floatval($x);\n\t\t// }\n\n\t\t// Update Account\n\t\tSQL::query(\"UPDATE account SET balance = ? WHERE id = ?\", array($balance, $this->_data['id']));\n\t\treturn $balance;\n\t}",
"function updateBalance(): void {\n\t}",
"private function _updateBalance()\n\t{\n\t\t$id = $this->_data['id'];\n\n\t\t$sql = 'update workorder set ';\n\t\t$sql.= 'bill_amount = (';\n\t\t\t$sql.= \"select sum(a_quantity * a_rate) from workorder_item \";\n\t\t\t$sql.= \" where workorder_id=$id and status = 'Billed' ) \";\n\t\t$sql.= ',';\n\t\t$sql.= 'open_amount = (';\n\t\t\t$sql.= 'select sum(a_quantity * a_rate) from workorder_item ';\n\t\t\t$sql.= \" where workorder_id = $id and status in ('Active','Complete') \";\n\t\t$sql.= \") where id=$id\";\n\t\tSQL::query($sql);\n\n\t\t$this->bill_amount = SQL::fetch_one(\"SELECT bill_amount FROM workorder WHERE id = $id\");\n\t\t$this->open_amount = SQL::fetch_one(\"SELECT open_amount FROM workorder WHERE id = $id\");\n\t}",
"private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }",
"private function _updateBalance()\n\t{\n\t\t$id = intval($this->_data['id']);\n\t\t\n\t\t$sql = 'UPDATE invoice SET';\n\t\t$sql.= ' sub_total = ( SELECT SUM ( quantity * rate * (1 + tax_rate)) FROM invoice_item WHERE invoice_id = ?)';;\n\t\t$sql.= ', tax_total = ( SELECT SUM ( quantity * rate * tax_rate) FROM invoice_item WHERE invoice_id = ?)';\n\t\t$sql.= ', bill_amount = ( SELECT SUM ( quantity * rate * (1 + tax_rate)) FROM invoice_item WHERE invoice_id = ?) ';\n\t\t// $sql.= ', paid_amount =\n\t\t$sql.= ' WHERE id = ? ';\n\t\tSQL::query($sql, array($id, $id, $id, $id));\n\t\t// die(SQL::lastError());\n\n\t\t// $r = array();\n\t\t// $r['sub_total'] = floatval($d->fetchOne(\"select sum( quantity * rate ) as sub_total from invoice_item where invoice_id={$id}\"));\n\t\t// $r['tax_total'] = floatval($d->fetchOne(\"select sum( quantity * rate * tax_rate) as tax_total from invoice_item where invoice_id={$id}\"));\n\t\t// $sql.= ' sub_total = ?, ';\n\t\t// $arg[] = floatval(SQL::fetch_one(\"select sum( quantity * rate * tax_rate) as tax_total from invoice_item where invoice_id={$id}\"));\n\t\t// // $r['bill_amount'] = $r['sub_total'] + $r['tax_total'];\n\t\t// $sql.= ' bill_amount = ?, ';\n\t\t// $arg[] = $r['sub_total'] + $r['tax_total'];\n\t\t// // $r['paid_amount'] = $this->getTransactionSum();\n\t\t// $sql.= ' paid_amount = ? ';\n\t\t// $arg[] = $this->getTransactionSum();\n\n\t\t// @todo Force Marking as Paid Amount Full?\n\t\t// if ($this->status == 'Paid') {\n\t\t//\t $r['paid_amount'] = $r['bill_amount'];\n\t\t// }\n\t\t// $w = array('id = ?'=>$this->id);\n\t\t// $t = new Zend_Db_Table(array('name'=>'invoice'));\n\t\t// $t->update($r,$w);\n\n\t\t// @todo Save to Object Data?\n\t\t// $this->bill_amount = $r['bill_amount'];\n\t\t// $this->paid_amount = $r['paid_amount'];\n\t\t// $this->sub_total = $r['sub_total'];\n\t\t// $this->tax_total = $r['tax_total'];\n\n\t}",
"public static function updateBalance($id, $value){\n \t$account = Account::findOrFail($id);\n\n\t\t$account->balance += $value;\n\t\t$account->save();\n }",
"function updateCustomerBalance($id, $value) {\n\t\t$DB = LMSDB::getInstance();\n\n\t\t$DB->Execute('UPDATE voipaccounts SET balance = balance - ? WHERE id = ?', array($value, $id));\n\t}",
"public function testUpdateBankAccount()\n {\n }",
"public function updatefund() {\n $this->layout = \"adminLayout\";\n\n if ($this->request->is('post')) {\n\n $tangocard = new Sourcefuse\\TangoCard(PLATFORM_ID, PLATFORM_KEY);\n\n $tangocard->setAppMode(TANGO_MODE);\n\n //fetch the tango fund using tango api.\n $response = $tangocard->getAccountInfo($_POST['customer'], $_POST['identifier']);\n if ($response->success == '1') {\n $av_bal=$response->account->available_balance / 100;\n $this->TangoAccount->query('update tango_accounts set available_balance=' . $av_bal . ' where customer=\"' . $_POST['customer'] . '\"');\n echo $av_bal;\n } else {\n echo 0;\n }\n }\n die;\n }",
"public function updateBalance(Split $split);",
"public function setBalance($newBalance)\r\n {\r\n \tif (is_numeric($newBalance)){\r\n\t if ($newBalance <= 0) {\r\n\t return false;\r\n\t } \r\n\t else\r\n\t \t$newBalance = round($newBalance, 2); //round function to set the balance to 2 decimal places. means we can accept values with more than 2 decimal points\r\n\t return $this -> balance = $newBalance;;\r\n\t }\r\n }",
"public function testUpdateCurrency()\n {\n }",
"public function updateWallet(){\n //'pending','preparing','ready','enroute','delivered','failed','cancelled'\n if( in_array($this->status, ['failed', 'cancelled'] ) && $this->payment_method->slug != \"cash\" ){\n\n //update user wallet\n $wallet = Wallet::firstOrCreate(\n ['user_id' => $this->user_id],\n ['balance' => 0]\n );\n\n //\n $wallet->balance += $this->total;\n $wallet->save();\n\n }\n }",
"public function testUpdateBankAccount(){\n\t\t\n\t\t$parameters = PayUTestUtil::buildParametersBankAccount();\n\t\t$customer = PayUCustomers::create(PayUTestUtil::buildSubscriptionParametersCustomer());\n\t\t$this->assertNotNull($customer);\n\t\t$this->assertNotNull($customer->id);\n\t\t\n\t\t$parameters[PayUParameters::CUSTOMER_ID] = $customer->id;\n\t\t\n\t\t$createdAccount = PayUBankAccounts::create($parameters);\n\t\t$this->assertNotNull($createdAccount);\n\t\t$this->assertNotNull($createdAccount->id);\n\t\t\n\t\t$parameters[PayUParameters::BANK_ACCOUNT_ID] = $createdAccount->id;\n\t\t$foundAccount = PayUBankAccounts::find($parameters);\n\t\t\n\t\t//Update bank account data\n\t\t$parametersToEdit = array(\n\t\t\t\tPayUParameters::BANK_ACCOUNT_CUSTOMER_NAME => 'Test Johan Navarrete',\n\t\t\t\tPayUParameters::BANK_ACCOUNT_DOCUMENT_NUMBER => '99999999',\n\t\t\t\tPayUParameters::BANK_ACCOUNT_DOCUMENT_NUMBER_TYPE => 'TI',\n\t\t\t\tPayUParameters::BANK_ACCOUNT_BANK_NAME => 'CITIBANK',\n\t\t\t\tPayUParameters::BANK_ACCOUNT_NUMBER => '7777777777',\n\t\t\t\tPayUParameters::BANK_ACCOUNT_ID => $foundAccount->id\n\t\t);\n\t\t\n\t\t$editedAccount = PayUBankAccounts::update($parametersToEdit);\n\t\t\n\t\t$this->assertNotNull($editedAccount);\n\t\t$this->assertEquals($parametersToEdit->bankAccountId,$editedAccount->bankAccountId);\n\t\t$this->assertEquals($parametersToEdit->name,$editedAccount->name);\n\t\t$this->assertEquals($parametersToEdit->documentNumber,$editedAccount->documentNumber);\n\t\t$this->assertEquals($parametersToEdit->documentNumberType,$editedAccount->documentNumberType);\n\t\t$this->assertEquals($parametersToEdit->bank,$editedAccount->bank);\n\t}",
"public function testUpdateBankAccountState()\n {\n }",
"public function updateByAddressAndCoin(string $address, string $coin, string $value): Balance;",
"public function update_balance($return_credit,$user_id)\n\t{\t\t\n\t\t//get user current balance\n\t\t$this->db->select('balance');\n\t\t$query = $this->db->get_where('members', array('id'=>$user_id));\n\t\t$user_balance = $query->row();\n\t\t\n\t\t$user_total_balance = $user_balance->balance+$return_credit;\n\t\t\n\t\t//update user balance\n\t\t$data=array('balance'=>$user_total_balance);\n\t\t$this->db->where('id',$user_id);\n\t\t$this->db->update('members', $data);\n\t}",
"public function update_user_coins_final_balance($user_id,$final_gift_coins){\n\t\t\n\t\t $sql_123=\"update users set gift_coins=gift_coins+'$final_gift_coins' where id='$user_id'\";\n\t\t\t\t\tmysqli_query($this->_con, $sql_123);\n\t\t\t\t\t\n\t\t\n\t}",
"function setBalance(){\n foreach($this->_withdrawals as $withdrawal){\n $this->_balance = $this->_balance - $withdrawal;\n }\n\n foreach($this->_deposits as $deposit){\n $this->_deposits = $this->_deposits + $deposit;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get's data parse format for column(%d, %f, %s) | private function get_parse_format($col_name){
// Get format type from inventory column(default string)
$parse_format_type = $this->inventory_columns[$col_name]['data']['parse_type'];
if(empty($parse_format_type)){ $parse_format_type = '%s'; }
return $parse_format_type;
} | [
"abstract public function get_formatter(GlueDB_Column $column);",
"function getRespondentColumnFormat()\r\n\t{\r\n\t\treturn \"{name}\";\r\n\t}",
"public function getColumnFormat()\n {\n return $this->columnFormat;\n }",
"function formatColumn($column,$data)\n {\n switch ($this->customization[\"data_type\"][$column])\n {\n case 'string':\n break;\n case 'date':\n\t\t\t\tif(trim($data) != '')\n \t$data=$this->showDate($data,$this->customization[\"format_details\"][$column]);\n break;\n case 'number':\n\t\t\t\tlist($decimals,$decimal_separator,$thousand_separator) = explode(\"-\",$this->customization[\"format_details\"][$column]);\n $data=number_format($data,$decimals,$decimal_separator,$thousand_separator);\n break;\n }\n //the data of the column is to be changed if set in customization\n if($this->customization[\"custom_change_details\"][$column])\n {\n $eq_value_array=explode(\",\",$this->customization[\"custom_change_details\"][$column]);\n foreach($eq_value_array as $equivalent_value)\n {\n list($display_value, $replace_value)=explode(\"=\",$equivalent_value);\n $data=(trim($display_value)==trim($data))?$replace_value:$data;\n }\n }\n //return nl2br($data);\n return $data;\n }",
"public function get_formatter(GlueDB_Column $column) {\n\t\t// Extract first word from type (MySQL may return things like \"float unsigned\" sometimes) :\n\t\tif (preg_match('/^\\S+/', $column->dbtype(), $matches))\n\t\t\t$dbtype = $matches[0];\n\n\t\t// Convert type to upper case :\n\t\t$dbtype = strtoupper($dbtype);\n\n\t\t// Create appropriate formatter :\n\t\tswitch ($dbtype) {\n\t\t\t// Integer types :\n\t\t\tcase 'TINYINT'; case 'SMALLINT'; case 'MEDIUMINT'; case 'INT'; case 'BIGINT';\n\t\t\t\t$formatter = new GlueDB_Formatter_Integer;\n\t\t\t\tbreak;\n\n\t\t\t// Real types :\n\t\t\tcase 'FLOAT'; case 'DOUBLE'; case 'DECIMAL';\n\t\t\t\t$formatter = new GlueDB_Formatter_Float;\n\t\t\t\tbreak;\n\n\t\t\t// Boolean types :\n\t\t\tcase 'BIT';\n\t\t\t\t$formatter = new GlueDB_Formatter_Boolean;\n\t\t\t\tbreak;\n\n\t\t\t// String types :\n\t\t\tcase 'CHAR'; case 'VARCHAR'; case 'TINYTEXT'; case 'TEXT';\n\t\t\tcase 'MEDIUMTEXT'; case 'LONGTEXT'; case 'ENUM'; case 'SET';\n\t\t\t\t$formatter = new GlueDB_Formatter_String;\n\t\t\t\tbreak;\n\n\t\t\t// Binary types :\n\t\t\tcase 'BINARY'; case 'VARBINARY'; case 'TINYBLOB'; case 'BLOB';\n\t\t\tcase 'MEDIUMBLOB'; case 'LONGBLOB';\n\t\t\t\t$formatter = new GlueDB_Formatter_String; // TODO Is this the right thing to do ?\n\t\t\t\tbreak;\n\n\t\t\t// Date and time types :\n\t\t\tcase 'DATE'; case 'DATETIME'; case 'TIME'; case 'TIMESTAMP'; case 'YEAR';\n\t\t\t\t$formatter = new GlueDB_Formatter_String; // TODO Is this the right thing to do ?\n\t\t\t\tbreak;\n\n\t\t\t// Default :\n\t\t\tdefault;\n\t\t\t\tthrow new Kohana_Exception(\"Unknown MySQL data type : \" . $dbtype);\n\t\t}\n\n\t\treturn $formatter;\n\t}",
"public function getParsedFieldColumn(): string\n\t{\n\t\t$field = Collection::make(array());\n\t\t$initialPosition = $this->getTextColumnPosition();\n\t\t$this->setTextColumnPosition($this->getTextFieldPosition());\n\n\t\tforeach ($this->data as $fieldName => $rows) {\n\t\t\t$text = $this->getTextColumnOn($fieldName, ucwords($fieldName), $this->data);\n\t\t\t$field->push($text->get($fieldName));\n\t\t}\n\t\t\n\t\t$rowLine = '';\n\t\t$rowLine .= $this->appendSeparator();\n\t\t$rowLine .= $this->getFlattenString($field->all()).PHP_EOL;\n\t\t$rowLine .= $this->appendSeparator();\n\t\t\n\t\t$this->setTextColumnPosition($initialPosition);\n\n\t\treturn $rowLine;\n\t}",
"public function get_column_formatter(GlueDB_Column $column) {\n\t\treturn $this->db()->get_formatter($column);\n\t}",
"function SetColFormatFloat($col, $width=-1, $precision=-1){}",
"protected static function column_format( $column ) {\n\t\t$columns = array(\n\t\t\t'id' => '%d',\n\t\t\t'site' => '%d',\n\t\t\t'hook' => '%s',\n\t\t\t'args' => '%s',\n\t\t\t'start' => '%s',\n\t\t\t'nextrun' => '%s',\n\t\t\t'interval' => '%d',\n\t\t\t'status' => '%s',\n\t\t);\n\n\t\tif ( isset( $columns[ $column ] ) ) {\n\t\t\treturn $columns[ $column ];\n\t\t}\n\n\t\treturn '%s';\n\t}",
"function sql_format($format, $field) {\n switch ($this->db_type) {\n case 'mysql':\n $replace = array(\n 'Y' => '%Y',\n 'y' => '%y',\n 'M' => '%b',\n 'm' => '%m',\n 'n' => '%c',\n 'F' => '%M',\n 'D' => '%a',\n 'd' => '%d',\n 'l' => '%W',\n 'j' => '%e',\n 'W' => '%v',\n 'H' => '%H',\n 'h' => '%h',\n 'i' => '%i',\n 's' => '%s',\n 'A' => '%p',\n '\\WW' => 'W%U',\n );\n $format = strtr($format, $replace);\n return \"DATE_FORMAT($field, '$format')\";\n case 'pgsql':\n $replace = array(\n 'Y' => 'YYYY',\n 'y' => 'YY',\n 'M' => 'Mon',\n 'm' => 'MM',\n // No format for Numeric representation of a month, without leading\n // zeros.\n 'n' => 'MM',\n 'F' => 'Month',\n 'D' => 'Dy',\n 'd' => 'DD',\n 'l' => 'Day',\n // No format for Day of the month without leading zeros.\n 'j' => 'DD',\n 'W' => 'WW',\n 'H' => 'HH24',\n 'h' => 'HH12',\n 'i' => 'MI',\n 's' => 'SS',\n 'A' => 'AM',\n '\\T' => '\"T\"',\n // '\\W' => // TODO, what should this be?\n );\n $format = strtr($format, $replace);\n return \"TO_CHAR($field, '$format')\";\n case 'sqlite':\n $replace = array(\n // 4 digit year number.\n 'Y' => '%Y',\n // No format for 2 digit year number.\n 'y' => '%Y',\n // No format for 3 letter month name.\n 'M' => '%m',\n // Month number with leading zeros.\n 'm' => '%m',\n // No format for month number without leading zeros.\n 'n' => '%m',\n // No format for full month name.\n 'F' => '%m',\n // No format for 3 letter day name.\n 'D' => '%d',\n // Day of month number with leading zeros.\n 'd' => '%d',\n // No format for full day name.\n 'l' => '%d',\n // No format for day of month number without leading zeros.\n 'j' => '%d',\n // ISO week number.\n 'W' => '%W',\n // 24 hour hour with leading zeros.\n 'H' => '%H',\n // No format for 12 hour hour with leading zeros.\n 'h' => '%H',\n // Minutes with leading zeros.\n 'i' => '%M',\n // Seconds with leading zeros.\n 's' => '%S',\n // No format for AM/PM.\n 'A' => '',\n // Week number.\n '\\WW' => '',\n );\n $format = strtr($format, $replace);\n return \"strftime('$format', $field)\";\n case 'sqlsrv':\n $replace = array(\n // 4 digit year number.\n 'Y' => \"' + CAST(DATEPART(year, $field) AS nvarchar) + '\",\n // 2 digit year number.\n 'y' => \"' + RIGHT(DATEPART(year, $field), 2) + '\",\n // 3 letter month name.\n 'M' => \"' + LEFT(DATENAME(month, $field), 3) + '\",\n // Month number with leading zeros.\n 'm' => \"' + RIGHT('0' + CAST(DATEPART(month, $field) AS nvarchar), 2) + '\",\n // Month number without leading zeros.\n 'n' => \"' + CAST(DATEPART(month, $field) AS nvarchar) + '\",\n // Full month name.\n 'F' => \"' + DATENAME(month, $field) + '\",\n // 3 letter day name.\n 'D' => \"' + LEFT(DATENAME(day, $field), 3) + '\",\n // Day of month number with leading zeros.\n 'd' => \"' + RIGHT('0' + CAST(DATEPART(day, $field) AS nvarchar), 2) + '\",\n // Full day name.\n 'l' => \"' + DATENAME(day, $field) + '\",\n // Day of month number without leading zeros.\n 'j' => \"' + CAST(DATEPART(day, $field) AS nvarchar) + '\",\n // ISO week number.\n 'W' => \"' + CAST(DATEPART(iso_week, $field) AS nvarchar) + '\",\n // 24 hour with leading zeros.\n 'H' => \"' + RIGHT('0' + CAST(DATEPART(hour, $field) AS nvarchar), 2) + '\",\n // 12 hour with leading zeros.\n // Conversion to 'mon dd yyyy hh:miAM/PM' format (corresponds to style\n // 100 in MSSQL).\n // Hour position is fixed, so we use SUBSTRING to extract it.\n 'h' => \"' + RIGHT('0' + LTRIM(SUBSTRING(CONVERT(nvarchar, $field, 100), 13, 2)), 2) + '\",\n // Minutes with leading zeros.\n 'i' => \"' + RIGHT('0' + CAST(DATEPART(minute, $field) AS nvarchar), 2) + '\",\n // Seconds with leading zeros.\n 's' => \"' + RIGHT('0' + CAST(DATEPART(second, $field) AS nvarchar), 2) + '\",\n // AM/PM.\n // Conversion to 'mon dd yyyy hh:miAM/PM' format (corresponds to style\n // 100 in MSSQL).\n 'A' => \"' + RIGHT(CONVERT(nvarchar, $field, 100), 2) + '\",\n // Week number.\n '\\WW' => \"' + CAST(DATEPART(week, $field) AS nvarchar) + '\",\n '\\T' => 'T',\n // MS SQL uses single quote as escape symbol.\n '\\'' => '\\'\\'',\n );\n $format = strtr($format, $replace);\n $format = \"'$format'\";\n return $format;\n }\n }",
"function getFloat($column_name) {}",
"public function numberFormatDataProvider() {}",
"function format_cell($cell): string\n{\n return preg_replace('#(\\d{3})(\\d{3})(\\d{4})#', '($1) $2-$3', $cell);\n}",
"protected function _prepareColumnFormats(){\n\t\t$this->_columnFormats = $this->getColumnFormats();\n\t}",
"public function column_format( $column ) {\n\t\t$formats = $this->columns();\n\n\t\treturn isset( $formats[ $column ] )\n\t\t\t? $formats[ $column ]\n\t\t\t: false;\n\t}",
"public function getValueFormat($value);",
"public function format($sql);",
"private function buildFormatters()\n {\n $output = '';\n $columns = $this->chart->getDataTable()->getFormattedColumns();\n\n foreach ($columns as $index => $column) {\n $format = $column->getFormat();\n\n $output .= sprintf(\n '$this.formats[\"col%1$s\"] = new google.visualization.%2$s(%3$s);' .\n '$this.formats[\"col%1$s\"].format($this.data, %1$s);',\n $index,\n $format->getType(),\n json_encode($format)\n ).PHP_EOL;\n }\n\n return $output;\n }",
"function numfmt_format($fmt, $value, $type){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns if the extension is disabled. | public function isDisabled()
{
return ( ! $this->isEnabled());
} | [
"public function is_disabled()\n {\n return $this->disabled;\n }",
"public function isDisabled()\n {\n return $this->disabled;\n }",
"public function isDisabled(): bool\n {\n return in_array($this->hook, Whisky::readConfig('hooks.disabled'));\n }",
"public function isDisabled();",
"public function is_disabled($name)\n\t{\n\t\treturn isset($this->extensions[$name]['ext_active']) && !$this->extensions[$name]['ext_active'];\n\t}",
"public function isDisabled () {}",
"public static function can_be_disabled() {\n return true;\n }",
"public function get_disabled()\r\n\t{\r\n\t\treturn $this->get_attr('disabled') === 'disabled';\r\n\t}",
"public function isDisabled() {\n\t\treturn $this->path === null ? \n\t\t\t\t($this->directory->path === null || !$this->searchConfigFile())\n\t\t\t\t: file_exists($this->path . 'disabled');\n\t}",
"public function isDisabled(): bool\n {\n return config('olark.enable', true) === false;\n }",
"public function is_disabled()\n\t{\n\t\treturn $this->bit_state( 'userAccountControl', Enums\\UAC::AccountDisable );\n\t}",
"public function isModeSecurityDisabled()\n {\n $checking_result = true;\n\n ob_start();\n phpinfo(INFO_MODULES);\n $_info = ob_get_contents();\n ob_end_clean();\n\n if (strpos($_info, 'mod_security') !== false) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_mod_security'), true, 'validator');\n $checking_result = false;\n }\n\n return $checking_result;\n }",
"public function isDisabled()\n {\n return $this->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED;\n }",
"function isDisabled() {\n\t\treturn ($this->getActive() == self::PROFILE_DISABLED);\n\t}",
"public function getIsDisabled(){\n return Mage::getStoreConfigFlag('easylife_gridenhancer/disable/'.$this->getGridIdentifier());\n }",
"public function get_disabled() {\n return $this->disabled;\n }",
"public static function isDisablePluginInformationActive() {\n\t\t$extensionConfiguration = self::getExtensionConfiguration();\n\t\treturn $extensionConfiguration['disablePluginInformation'] === '1';\n\t}",
"function _jr_addon_disabled( $addon ){\n\tglobal $jr_options;\n\treturn empty( $jr_options->addons[ $addon ]['enabled'] );\n}",
"public function get_disabled()\n {\n return $this->_disabled;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getMenuStoreNames [PRIVATE API]Get menus store names | public function getMenuStoreNames($menu_id)
{
list($response) = $this->getMenuStoreNamesWithHttpInfo($menu_id);
return $response;
} | [
"public function getMenuStoreNamesWithHttpInfo($menu_id)\n {\n $returnType = '\\Flipdish\\\\Client\\Models\\RestApiArrayResultMenuStoreNames';\n $request = $this->getMenuStoreNamesRequest($menu_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Flipdish\\\\Client\\Models\\RestApiArrayResultMenuStoreNames',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Flipdish\\\\Client\\Models\\RestApiErrorResult',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Flipdish\\\\Client\\Models\\RestApiUnauthorizedResult',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Flipdish\\\\Client\\Models\\RestApiForbiddenResult',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 409:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Flipdish\\\\Client\\Models\\RestApiErrorResult',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"private function getStoreList()\n {\n $result = [\n '0' => (string) __('All'),\n ];\n\n foreach ($this->storeManager->getStores() as $id => $store) {\n $result[(string)$id] = sprintf(\n '%s.[%s]',\n str_replace(' ', ' ', str_pad($store->getName(), 20, '.')),\n $store->getCode()\n );\n }\n\n return $result;\n }",
"public function getStoreName();",
"public function getShopNames()\n\t{\n\t\t$shopNames = Yii::app()->db->createCommand()\n\t\t\t->select('name')\n\t\t\t->from('shop')\n\t\t\t->queryAll();\n\t\treturn $shopNames;\n\t}",
"public function getStoreName(): string\n\t{\n\t\tif (!isset(self::$storeNameList[$this->storeId]))\n\t\t{\n\t\t\tself::loadStoreName($this->storeId);\n\t\t}\n\n\t\treturn self::$storeNameList[$this->storeId];\n\t}",
"public function getManagerNames();",
"private function getAllStoreIds()\n {\n return array_keys($this->storeManager->getStores());\n }",
"public static function EtsyStoreNameList($user_id)\n {\n $usr = self::find($user_id);\n $names = array();\n foreach ($usr->EtsyStoresAll as $store) {\n $names[] = $store->name;\n }\n return $names;\n }",
"public function getStores();",
"public function getStoreIds();",
"public function englishStore() {\r\n\t\t$storeDetails = $this->storeInfo();\r\n\t\tforeach ($storeDetails as $key => $store) {\r\n\t\t\t$lang = \"en\";\r\n\t\t\tif ($lang == \"en\") {\r\n\t\t\t\t$storeIds[] = $key;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $storeIds;\r\n\t}",
"public function getStoreLabels();",
"public function getStoreName()\n {\n return $this->store_name;\n }",
"public function get_all_stores()\n\t{\n\t $this->db->select('S.*');\n\t $this->db->from('store S');\n\t \n\t $query = $this->db->get();\n\t \n\t return $query->result_array();\t \n\t}",
"public function get_store_name($store_id)\n {\n $result_store = mysqli_query($this->conn, \"select name from stores where id=$store_id\");\n while ($name = mysqli_fetch_array($result_store)) {\n $store_name = $name['name'];\n }\n return $store_name;\n }",
"public function getStoreName()\n {\n return $this->storeName;\n }",
"public static function getStoreName()\n {\n return self::$storeName;\n }",
"public function getStoreIds()\n {\n if (!$this->hasStoreIds()) {\n $storeIds = [];\n if ($stores = $this->_storeManager->getStores()) {\n $storeIds = array_keys($stores);\n }\n $this->setStoreIds($storeIds);\n }\n return $this->getData('store_ids');\n }",
"public function getStoreInfo();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Start vbmail vBulletin wrapper for PHP's 'mail()' function | function vbmail($toemail, $subject, $message, $from = '', $headers = '', $username = '') {
global $bbtitle, $webmasteremail;
$toemail = trim($toemail);
if ($toemail) {
$subject = trim($subject);
$message = preg_replace("/(\r\n|\r|\n)/s", "\r\n", trim($message));
$from = trim($from);
$username = trim($username);
// work out the 'From' header
if ($from == '') {
$headers = "From: \"$bbtitle Mailer\" <$webmasteremail>\r\n" . $headers;
} else {
$headers = 'From: "' . iif($username, "$username @ $bbtitle", $from) . "\" <$from>\r\n" . $headers;
}
// actually send the email message
mail($toemail, $subject, $message, trim($headers));
return true;
} else {
return false;
}
} | [
"function hw_send_mail() {\r\n\r\n}",
"abstract protected function _sendmail();",
"function mail()\n {\n if (atkconfig(\"mail_enabled\", true))\n {\n $args = func_get_args();\n return call_user_func_array(\"mail\", $args);\n } \n else return true;\n }",
"public function guiMail()\n {\n $getContent = $this->Email->findById(3);\n $getContent['Email']['content'];\n $name = 'Name Company';\n $newContent = str_replace('#USER_NAME#', $name, $getContent['Email']['content']);\n $this->send_email('thanhle111@gmail.com', 'thanhle1286@gmail.com', 'Test Mail', $newContent);\n die;\n }",
"public function startCollectingMail();",
"public function cmdMail( $from )\n {\n parent::cmdMail( $from );\n }",
"public function send() {\n $email_subject = escapeshellarg($this->params['subject']);\n $email_body = escapeshellarg($this->params['body']);\n $email_tos = escapeshellarg(json_encode($this->params['tos']));\n $email_ccs = escapeshellarg(null);\n\t\tif(array_key_exists('ccs', $this->params)) {\n $email_ccs = escapeshellarg(json_encode($this->params['ccs']));\n\t\t}\n\n $cmd = \"python /opt/send_mail.py --to $email_tos --email_subject $email_subject --email_body $email_body --cc $email_ccs\";\n echo $cmd;\n exec($cmd);\n return true;\n }",
"function _mail() {\n\t\tApp::import('Vendor', 'Core.Swift_Connection_NativeMail', array('file' => 'Swift'.DS.'lib'.DS.'Swift'.DS.'Connection'.DS.'NativeMail.php'));\n\n\t\t// Return the swift mailer object.\n\t\t$this->Swift = new Swift(new Swift_Connection_NativeMail()); \n\t}",
"function send () {\r\n $this->_buildMail();\r\n\r\n $to_str = ($this->apply_windows_bugfix) ? implode(',', $this->all_emails) : $this->xheaders['To'];\r\n\r\n\t\t\t// Поддержка safe mode\r\n\t\t\t// Автор: Холодий Андрей\r\n\t\t\t// Дата изменения: 02.09.2005 18:59\r\n if (ini_get('safe_mode')) {\r\n \treturn mail($to_str, $this->xheaders['Subject'], $this->fullBody, $this->headers);\r\n } else {\r\n\t return mail($to_str, $this->xheaders['Subject'], $this->fullBody, $this->headers, \"-odb\");\r\n }\r\n }",
"function SendEmail($to,$subject,$message){ \n\t// adapted from http://phpmailer.worxware.com/?pg=examplebgmail\n\t$config = Config::get('sendEmailConfig', 'execEngine');\n\t$from = $config['from'];\n\t$username = $config['username'];\n\t$password = $config['password'];\n\n\tNotifications::addLog('Username = '.$username, 'ExecEngine');\n\t\n\t$mail = new PHPMailer;\n\n\t$mail->IsSMTP();\t\t\t\t// Set mailer to use SMTP\n\t// $mail->SMTPDebug = 1;\n\t$mail->Host = 'smtp.gmail.com';\t// Specify main and backup server\n\t$mail->SMTPSecure = 'ssl';\t\t// Enable encryption, 'ssl' also accepted\n\t$mail->Port = 465;\n\t$mail->SMTPAuth = true;\t\t\t// Enable SMTP authentication\n\t\n\t$mail->Username = $username;\t// SMTP username (for GMAIL)\n\t$mail->Password = $password;\t// SMTP password\n\t\n\t$mail->From = $from;\n\t$mail->FromName = 'Ampersand Prototype';\n\t\n\t$mail->AddAddress($to);\t\t\t// Add a recipient, e.g. $to = 'rieks.joosten@tno.nl', 'Rieks Joosten'\n\t$mail->Subject = $subject;\n\t$mail->Body = $message;\n\t\n\t$mail->WordWrap = 50;\t\t\t// Set word wrap to 50 characters\n\t\n\tif(!$mail->Send()){\n\t\tNotifications::addError('Mailer Error: ' . $mail->ErrorInfo);\n\t}else{\n\t\tNotifications::addSuccess('Email message sent.');\n\t}\n}",
"public function createSendMailCmd( $iListContextId, $iMailingId );",
"public function sendMail()\n {\n }",
"public function sendMail()\n {\n }",
"function churchdb_send_mail($subject, $message, $to) {\n churchcore_systemmail($to, $subject, $message, true);\n}",
"protected function sendMail(){\r\n $to = $this->settings['email'];\r\n\t\t$subject = \"Deploy\";\r\n\t\t$body = $this->emailLog;\r\n\t\tmail($to, $subject, $body);\r\n }",
"function test_email()\n { \n global $IN, $DB, $REGX, $LANG, $TMPL, $FNS, $PREFS, $LOC;\n\n \n\t\t\t\tif ( ! class_exists('EEmail'))\n\t\t\t\t{\n\t\t\t\t\trequire PATH_CORE.'core.email'.EXT;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$email_msg = 'Cron executed at '. date(\"M d, Y H:i\", ($LOC->server_now) );;\n \n \n\t\t\t\t$email = new EEmail;\n\n\t\t\t\t$email->initialize();\t\n\t\t\t\t$email->wordwrap = true;\n\t\t\t\t$email->from($PREFS->ini('webmaster_email'), $PREFS->ini('webmaster_name'));\t\n\t\t\t\t$email->to('musa@bglobalsourcing.com');\n\t\t\t\t$email->reply_to($PREFS->ini('webmaster_email'));\t\t\t\t\t \n\t\t\t\t$email->subject('cron works');\t\n\t\t\t\t$email->message($REGX->entities_to_ascii($email_msg));\t\t\n\t\t\t\t$email->Send();\n }",
"function sendmail($title='') {\n $sFormErr = GetGlobal('sFormErr');\t\n \n $myaction = seturl(\"t=mail&a=&g=\"); \n\t \n //read selected mail if any\n $this->Readselectedmail();\n //navigation status \n $out = setNavigator(localize('MAILCRACKER_DPC',getlocal()));\n\t \n $out .= \"<FORM action=\". \"$myaction\" . \" method=post>\"; \t\n\t \t \n //error message\n $out .= setError($sFormErr);\t\t \n //commands \n $out .= $this->mboxcom(); \n\t \n\t //FROM..\n if (seclevel('ADMINMAIL_',$this->userLevelID)) {\n $from[] = \"<B>\" . localize('_FROM',getlocal()) . \":</B>\";\n\t\t$fromattr[] = \"right;30%;\";\n\t\t$from[] = \"<input type=\\\"text\\\" name=\\\"from\\\" maxlenght=\\\"20\\\" value=\\\"$this->from\\\">\";\n\t\t$fromattr[] = \"left;70%;\";\t\t\n }\n else {\n $usermail = $this->user. \"@\" . $this->domain;\t \n\t $from[] = \"<B>\" . localize('_FROM',getlocal()) . \":</B>\";\n\t\t$fromattr[] = \"right;30%;\";\t\t \n $from[] = $usermail; \n\t\t$fromattr[] = \"left;70%;\";\n\t\t//set from value as hidden field\n\t\t$from[] = \"<input type=\\\"hidden\\\" name=\\\"from\\\" value=\\\"$usermail\\\">\";\n\t\t$fromattr[] = \"left\";\t\t\t\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;30%;\";\t \n\t $totext = \"<input type=\\\"text\\\" name=\\\"to\\\" maxlenght=\\\"20\\\" value=\\\"$this->to\\\">\";\t\n\t \n if ( (defined('SUBSCRIBE_DPC')) && (seclevel('SUBSCRIBERSMAIL_',$this->userLevelID)) ) {\t\n\t $totext .= \"<B>\" . localize('_INCLSUBS',getlocal()) . \" <input type=\\\"checkbox\\\" name=\\\"includesubs\\\">\";\t\t\n } \n\t $to[] = $totext;\n \t $toattr[] = \"left;70%;\";\t\n\t \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);\n \n\t //SUBJECT..\n $subt[] = \"<B>\" . localize('_SUBJECT',getlocal()) . \":</B>\";\n \t $subattr[] = \"right;30%;\";\t \n $subt[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"subject\\\" maxlenght=\\\"30\\\" value=\\\"$this->subject\\\">\"; \n \t $subattr[] = \"left;70%;\";\n\t \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 \n\t //ATTACHED FILES \n\t if ($this->attachments) {\n\t $winout .= $this->viewAttachments();\t \n\t }\n\t \n\t //HTML ADD\n\t if ($this->htmladd) {\n\t $hwin = new window('','>HTML contents added succsessfully !');\n\t $winout .= $hwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($hwin);\t\t \n\t }\t \n\t \t \t \n\t //MAIL BODY..\t\t \n $form .= \"Text :<br>\"; \t \n\t if (!defined('HTMLAREA_DPC')) { \n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=16 cols=50 wrap=\\\"virtual\\\">\";\n $mbody .= $this->mailbody; \n $mbody .= \"</TEXTAREA>\";\n\t }\n\t else {\n\t $ta = new htmlarea();\n\t $mbody = $ta->show('mail_text',$this->mailbody,16,50,'virtual');\n\t unset ($ta);\n\t } \n\t $mb[] = $mbody;\n\t $mbattr[] = \"center\";\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 //main window\n\t $mymwin = new window($title,$winout);\n\t $out .= $mymwin->render();\t\n\t unset ($mymwin);\t \n\t \n\t \n\t //BUTTONS\n $cmd = \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"FormAction\\\" value=\\\"\" . $this->com1 . \"\\\"> \"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"FormAction\\\" value=\\\"\" . $this->com2 . \"\\\"> \";\n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"FormAction\\\" value=\\\"\" . $this->com3 . \"\\\">\";\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 \n if ($this->mattach) {\n if (seclevel('ATTACHMENTS_',$this->userLevelID)) {\t \t\n //mail attachments form\n\t\t \n\t\t //$aform .= $this->viewAttachments();\n\t\t \n $aform .= \"<FORM action=\". \"$myaction\" . \" method=post ENCTYPE=\\\"multipart/form-data\\\">\";\n\t\t $aform .= localize('_ATTACHMENTS',getlocal());\n $aform .= \"<input type=\\\"hidden\\\" name=\\\"MAX_FILE_SIZE\\\" VALUE=\\\"\". $this->capacity .\"\\\">\"; //max file size option in bytes \t\t\t \t \n $aform .= \"<input type=FILE name=\\\"attachedfile\\\">\";\t\t \n $aform .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"AttachFiles\\\">\"; \t\n $aform .= \"<input type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"attach\\\"> \";\t\t\n $aform .= \"<input type=\\\"submit\\\" name=\\\"Submit2\\\" value=\\\"\" . localize('_ATTACH',getlocal()) . \"\\\">\";\t\t\n $aform .= \"</FORM>\"; \t\n\t\n $data1[] = $aform;\n $attr1[] = \"left\";\n\t $awin = new window('',$data1,$attr1);\n\t $out .= $awin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($awin);\t\n\t }\n } \n\t \t\n return ($out);\n }",
"public function compileMail() \r\n\t{\r\n\t\tif (empty($this->headers['From']))\r\n \t\t\t$this->setSender(SLS_Generic::getInstance()->getMailConfig('defaultSender').'@'.SLS_Generic::getInstance()->getMailConfig('defaultDomain'), SLS_Generic::getInstance()->getMailConfig('defaultNameSender'));\r\n \t\tif (empty($this->headers['Reply-To']))\r\n \t\t\t$this->setReply(SLS_Generic::getInstance()->getMailConfig('defaultReply').'@'.SLS_Generic::getInstance()->getMailConfig('defaultDomain'), SLS_Generic::getInstance()->getMailConfig('defaultNameReply'));\r\n \t\tif (empty($this->headers['Return-Path']))\r\n \t\t\t$this->setReply(SLS_Generic::getInstance()->getMailConfig('defaultReturn').'@'.SLS_Generic::getInstance()->getMailConfig('defaultDomain'), SLS_Generic::getInstance()->getMailConfig('defaultNameReturn'));\r\n\t\t\r\n\t\tif((empty($this->headers['To']) && empty($this->headers['Cc']) && empty($this->headers['Bcc'])) || (empty($this->headers['From']) && empty($this->headers['Return-Path'])))\r\n\t\t\treturn $this->error(\"Some required headers are missing.\");\r\n\r\n\t\tif($this->versionplain == \"\" && $this->versionhtml != \"\")\r\n\t\t\t$this->versionplain = strip_tags(str_replace(\"<br />\", \"\\n\", $this->versionhtml));\r\n\r\n\t\tif(!empty($this->attachments)) \r\n\t\t{\r\n\t\t\t$this->headers['Content-type'] = \"multipart/mixed; boundary=\\\"Part-{$this->boundary['mixed']}\\\"\";\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['mixed']}\\r\\n\";\r\n\t\t}\r\n\t\telse if(!empty($this->files))\r\n\t\t\t$this->headers['Content-type'] = \"multipart/related; boundary=\\\"Part-{$this->boundary['related']}\\\"\";\r\n\t\telse if(!empty($this->versionhtml))\r\n\t\t\t$this->headers['Content-type'] = \"multipart/alternative; boundary=\\\"Part-{$this->boundary['alternative']}\\\"\";\r\n\t\telse\r\n\t\t\t$this->headers['Content-type'] = \"text/plain; charset=\\\"us-ascii\\\"\";\r\n\r\n\t\tif(!empty($this->files) && !empty($this->attachments))\r\n\t\t\t$this->message .= $this->wrapHeader(\"Content-type: multipart/related; boundary=\\\"Part-{$this->boundary['related']}\\\"\\r\\n\\r\\n\");\r\n\r\n\t\tif(!empty($this->files))\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['related']}\\r\\n\";\r\n\r\n\t\tif(!empty($this->versionhtml) && (!empty($this->files) || !empty($this->attachments)))\r\n\t\t\t$this->message .= $this->wrapHeader(\"Content-type: multipart/alternative; boundary=\\\"Part-{$this->boundary['alternative']}\\\"\\r\\n\\r\\n\");\r\n\r\n\t\tif(!empty($this->versionhtml))\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['alternative']}\\r\\n\";\r\n\r\n\t\tif(!empty($this->versionhtml) || !empty($this->files) || !empty($this->attachments)) \r\n\t\t{\r\n\t\t\t$this->message .= \"Content-type: text/plain; charset=\\\"us-ascii\\\"\\r\\n\";\r\n\t\t\t$this->message .= \"Content-transfer-encoding: 7bit\\r\\n\\r\\n\";\r\n\t\t\t$this->message .= $this->versionplain.\"\\r\\n\\r\\n\";\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->message = $this->versionplain;\r\n\r\n\t\tif(!empty($this->versionhtml)) \r\n\t\t{\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['alternative']}\\r\\n\";\r\n\t\t\t$this->message .= \"Content-type: text/html; charset=\\\"{$this->charset}\\\"\\r\\n\";\r\n\t\t\t$this->message .= \"Content-transfer-encoding: quoted-printable\\r\\n\\r\\n\";\r\n\t\t\t$this->message .= $this->versionhtml.\"\\r\\n\\r\\n\";\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['alternative']}--\\r\\n\";\r\n\t\t}\r\n\r\n\t\tif(!empty($this->files)) \r\n\t\t{\r\n\t\t\t$this->compileEmbedded();\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['related']}--\\r\\n\";\r\n\t\t}\r\n\r\n\t\tif(!empty($this->attachments)) \r\n\t\t{\r\n\t\t\t$this->compileAttachments();\r\n\t\t\t$this->message .= \"--Part-{$this->boundary['mixed']}--\\r\\n\";\r\n\t\t}\r\n\r\n\t\t$headers = array();\r\n\t\tforeach($this->headers as $k => $v) \r\n\t\t{\r\n\t\t\tif(is_array($v) && !empty($v))\r\n\t\t\t\t$headers[$k] = $v;\r\n\t\t\telse if($v != \"\" && !empty($v))\r\n\t\t\t{\r\n\t\t\t\tif (substr($v,0,strlen(\"$k:\")) != \"$k:\" )\r\n \t\t\t$headers[$k] = wordwrap(\"$k: $v\",75,\"\\r\\n \"); \t\t\r\n \t\telse \t\t\r\n\t\t\t\t \t$headers[$k] = $v; \t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->headers = $headers;\r\n\t\t$this->compiled = true;\t\t\r\n\t}",
"function sendEmail(){\r\n\tglobal $taskTimer;\r\n\t//mail functionality\t\t\r\n\tout( \"[SENDING EMAIL]\\n\");\r\n\t$msg = \r\n\"Hi All,\r\nThis is an automatic email from the AEU Web Server\r\n\r\nThe webserver has not receved any messages from the aeu in \". (time() - $taskTimer[\"lastmessage\"]). \"s \r\nand may be unpluged consider plugging it in\r\n\r\ncheers,\r\n-AEU Webserver.\\n\";\r\n\r\n\t$headers = \"From: stewbertgrant@gmail.com\" . \"\\r\\n\" .\r\n\t\t\t\"CC: davis@dccnet.com , stewbertgrant@gmail.com\";\r\n\t$msg = wordwrap($msg,70);\r\n\t$sent = mail(\"xerwnexa@sharklasers.com\",\"web server email test\",$msg,$headers);\r\n\tif ($sent === false){\r\n\t\tout( \"[Email not sent]\\n\");\r\n\t}\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the record as inactive and return an activation token | public function setInactive()
{
$this->isActive = false;
$this->save(); // make sure the record is saved
} | [
"public function setInactive()\n {\n $this->isActive = false;\n $this->save(); // make sure the record is saved\n\n $token = random_text(5);\n $query = sprintf('INSERT INTO %sPENDING (USER_ID, TOKEN) ' . \n 'VALUES (%d, \"%s\")',\n DB_TBL_PREFIX,\n $this->uid,\n $token);\n mysql_query($query, $GLOBALS['DB']);\n\n return $token;\n }",
"public function setInactive()\n {\n $this->isActive = false;\n $this->save(); // make sure the record is saved\n\n $token = random_text(5);\n $query = sprintf('INSERT INTO PENDING_CONFIRMATIONS (USER_ID, TOKEN) ' . \n 'VALUES (%d, \"%s\")',\n $this->id,\n $token);\n mysql_query($query, $GLOBALS['DB']);\n\n return $token;\n }",
"public function setInactive($token)\n {\n $this-> isActive = fales;\n $this-> save();\n $token = random_text(5);\n $query = sprintf('INSERT INTO %sPENDING (USER_ID, TOKEN) VALUES (%d, \"%s\")', DB_TBL_PREFIX, $this-> uid, $token);\n return (mysqli_query($query, $GLOBALS['DB'])) ? $token : false;\n }",
"public function deactivate()\n {\n $this->setActive(false);\n $this->save();\n }",
"public function deactivate() {\n $token = $this->input->get_post('token');\n \n // Check parameters\n if ($this->helperlib->hasEmptyParams(array($token))) {\n $this->outputlib->error($this->lang->line('error_missing_parameters'));\n return;\n }\n \n // Update user status to deactivated\n $query = \"\n UPDATE \".TABLE_USERS.\"\n SET status = 0\n WHERE token = ?\n \";\n $data = array($token);\n $this->db->query($query, $data);\n $this->outputlib->output(STATUS_OK, '', array());\n }",
"public function markAsInactive() {\n\t\t$this->active = false;\n\t}",
"public function setInactive()\n {\n $this->isActive = false;\n }",
"public function deactivateUser(){\n\n\t\tglobal $db;\n\t\t\n\t\t$db->SQL = \"UPDATE ebb_users SET active='0' WHERE Username='\".$this->user.\"' LIMIT 1\";\n\t\t$db->query();\n\t}",
"public function resend_activation_token($identity) \n\t{\n\t\t// Get primary identity.\n\t\t$identity = $this->CI->flexi_auth_model->get_primary_identity($identity);\n\t\t\n\t\tif (empty($identity))\n\t\t{\n\t\t\t$this->CI->flexi_auth_model->set_error_message('activation_email_unsuccessful', 'config');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t// Get user information.\n\t\t$sql_select = array(\n\t\t\t$this->CI->auth->tbl_col_user_account['id'],\n\t\t\t$this->CI->auth->tbl_col_user_account['active']\n\t\t);\n\t\t\n\t\t$sql_where[$this->CI->auth->primary_identity_col] = $identity;\n\t\t\n\t\t$user = $this->CI->flexi_auth_model->get_users($sql_select, $sql_where)->row();\n\n\t\t$user_id = $user->{$this->CI->auth->database_config['user_acc']['columns']['id']};\n\t\t$active_status = $user->{$this->CI->auth->database_config['user_acc']['columns']['active']};\t\t\n\t\t\n\t\t// If account is already activated.\n\t\tif ($active_status == 1)\n\t\t{\n\t\t\t$this->CI->flexi_auth_model->set_status_message('account_already_activated', 'config');\n\t\t\treturn TRUE;\n\t\t}\n\t\t// Else, run the deactivate_user() function to reset the users activation token.\n\t\telse if ($this->CI->flexi_auth_model->deactivate_user($user_id))\n\t\t{\n\t\t\t// Get user information.\n\t\t\t$sql_select = array(\n\t\t\t\t$this->CI->auth->primary_identity_col,\n\t\t\t\t$this->CI->auth->tbl_col_user_account['activation_token'],\n\t\t\t\t$this->CI->auth->tbl_col_user_account['email']\n\t\t\t);\n\t\t\t$sql_where[$this->CI->auth->primary_identity_col] = $identity;\n\t\t\t$user = $this->CI->flexi_auth_model->get_users($sql_select, $sql_where)->row();\n\t\t\t\n\t\t\t$email = $user->{$this->CI->auth->database_config['user_acc']['columns']['email']}; \n\t\t\t$activation_token = $user->{$this->CI->auth->database_config['user_acc']['columns']['activation_token']};\n\t\t\t\n\t\t\t// Set email data.\n\t\t\t$email_to = $email;\n\t\t\t$email_title = ' - Account Activation';\n\t\t\n\t\t\t$user_data = array(\n\t\t\t\t'user_id' => $user_id,\n\t\t\t\t'identity' => $identity,\n\t\t\t\t'activation_token' => $activation_token\n\t\t\t);\n\t\t\t$template = $this->CI->auth->email_settings['email_template_directory'].$this->CI->auth->email_settings['email_template_activate'];\n\n\t\t\tif ($this->CI->flexi_auth_model->send_email($email_to, $email_title, $user_data, $template))\n\t\t\t{\n\t\t\t\t$this->CI->flexi_auth_model->set_status_message('activation_email_successful', 'config');\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->CI->flexi_auth_model->set_error_message('activation_email_unsuccessful', 'config');\n\t\treturn FALSE;\n\t}",
"public function deactivate() {\n $this->update(['active' => false]);\n }",
"public function deactivate()\n\t{\n\t\t$data = array(\n\t\t\t'active' => 0\n\t\t);\n\t\t$this->db->where('id', $this->input->post('id'));\n\t\t$this->db->update('users', $data);\n\t}",
"function setInactive( )\n\t{\n\t\t$sql = \"UPDATE \" .DB_tbl_booking_user_import .\" SET status='inactive' WHERE status='tempactive'\";\n\t\t$res = dbSqlRows( $sql );\n\t}",
"public function unblock()\n\t{\n\t\t$this->status = User::STATUS_ACTIVE;\n\n\t\tif ($this->save(FALSE))\n\t\t\treturn TRUE;\n\n\t\treturn FALSE;\n\t}",
"public function deactivate()\n {\n $this->checkCSRFForm();\n $user = $this->getUser();\n $this->checkCurrentUser($user);\n\n $this->userModel->update(array(\n 'id' => $user['id'],\n 'twofactor_activated' => 0,\n 'twofactor_secret' => '',\n ));\n\n // Allow the user to test or disable the feature\n $this->userSession->disablePostAuthentication();\n\n $this->flash->success(t('User updated successfully.'));\n $this->response->redirect($this->helper->url->to('TwoFactorController', 'index', array('user_id' => $user['id'])), true);\n }",
"public function inactive(): \\Inertia\\Response\n {\n $pageTitle = 'Inactive account';\n\n $token = $this->activation->findTokenByEmail(session('inactive_email'));\n\n return $this->response(\n compact('pageTitle', 'token'),\n 'auth.activation.inactive'\n );\n }",
"public function deactivateEmployee()\n\t{\n\t\t$this->load->database();\n\t\t$info = $this->db->query(\"UPDATE employees SET employee_status='inactive' WHERE employee_id = $this->employee_id\");\n\t\treturn $info;\n\t}",
"public function deactivateAccount(){\n $userid = $this->input->post('userId');\n $data = $this->dbUpdate('user',array('status'=>0),array('userId'=>$userid));\n if($data){\n return true;\n }else{\n return false;\n }\n \n }",
"function activeInactive()\n\t{\n\t\t$sQuery\t = \t\"UPDATE \".DB_PREFIX.\"race_group SET race_group_active = 'n' WHERE race_group_id =\".$this->race_group_id;\n\t\treturn $this->runquery($sQuery);\n\t}",
"public function deactivateaccount() {\n\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->reason_type) && !empty($request_data->password): // && !empty($request_data->other_reason) && !empty($request_data->email_opt_out):\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } elseif (md5($request_data->password) != $data[0]['User']['password']) { // User password is matching or not.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Password did not match';\n } else {\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['reason_type'] = $request_data->reason_type;\n $dataArray['User']['is_active'] = 'no';\n $dataArray['User']['other_reason'] = !empty($request_data->other_reason) ? trim($request_data->other_reason) : '';\n $flag = $this->User->save($dataArray);\n\n if ($flag) {\n // send email to user's email address..\n if (!empty($request_data->email_opt_out) && $request_data->email_opt_out == 'yes') {\n App::uses('CakeEmail', 'Network/Email');\n $Email = new CakeEmail('default');\n $Email->from(array(SUPPORT_SENDER_EMAIL => SUPPORT_SENDER_EMAIL_NAME));\n $Email->to(strtolower(trim($data[0]['User']['email'])));\n $Email->subject('Clickin | Account Deactivation');\n $Email->emailFormat('html');\n $messageEmail = '';\n $messageEmail .= \"Hi \" . trim($data[0]['User']['name']) . ',<br><br> You have deactivated clickin account. You can reactivate your account\n by signing in again.<br><br>Regards,<br>Clickin\\' Team';\n $Email->send($messageEmail);\n }\n\n $success = true;\n $status = SUCCESS;\n $message = 'Your account has been deactivated.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Reason type blank in request\n case!empty($request_data) && empty($request_data->reason_type):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Reason type cannot be blank.';\n break;\n // Password blank in request\n case!empty($request_data) && empty($request_data->password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Password cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[1] => Array ( [name] => TELEVISIONS [category_id] => 2 [depth] => 1 ) | public function actionArr() {
// [2] => Array ( [name] => PORTABLE ELECTRONICS [category_id] => 6 [depth] => 1
$root = Array ( 0 => Array ( "name" => "ELECTRONICS", "category_id" => 1, "depth" => 0 ),
1 => Array ( "name" => "TELEVISIONS", "category_id" => 2, "depth" => 1 ),
2 => Array ( "name" => "PORTABLE ELECTRONICS", "category_id" => 6, "depth" => 1) );
foreach ($root as $v1) {
foreach ($v1 as $k => $v ) {
echo $v . " ";
}
}
} | [
"function cfGetNestedCategorias(){\n global $wpdb;\n $conn = new FieldsFormModel($wpdb);\n $categorias = $conn->getActividadesCat();\n $object = Array();\n //print_r($categorias);die();\n \n foreach($categorias as $a){\n \n if ($a->parent==0){\n $o = [];\n $o['id'] = $a->term_id;\n $o['name'] = $a->name;\n $o['subs'] = [];\n $object[$a->term_id] = $o;\n //array_push($object,$o);\n }\n }\n\n foreach($categorias as $a){\n \n if ($a->parent!=0){\n if (array_key_exists($a->parent,$object))\n $o = [];\n $o['sub_id'] = $a->term_id;\n $o['sub_name'] = $a->name;\n array_push( $object[$a->parent]['subs'],$o);\n //array_push($object,$o);\n }\n }\n\n return $object;\n\n //print_r($object);die();\n}",
"function build_categories_tree() {\n $categories_tree = array();\n $categories_query = $this->get_categories_query();\n while ($category = tep_db_fetch_array($categories_query)) {\n $categories_tree[$category['categories_id']] = array(\n 'name' => $category['categories_name'],\n 'parent_id' => $category['parent_id']);\n }\n return $categories_tree;\n }",
"function _recursiveGetCategoryCList( $parent, $level, $expcat, $_indexType = 'NUM', $cprod = false, $ccat = true)\n{\nglobal $fc, $mc;\n\n $rcat = array_keys ($mc, (int)$parent);\n $result = array(); //parents\n\n $crcat = count($rcat);\n for ($i=0; $i<$crcat; $i++) {\n\n $row = $fc[(int)$rcat[$i]];\n if (!file_exists(\"data/category/\".$row[\"picture\"])) $row[\"picture\"] = \"\";\n $row[\"level\"] = $level;\n $row[\"ExpandedCategory\"] = false;\n if ( $expcat != null )\n {\n foreach( $expcat as $categoryID )\n {\n if ( (int)$categoryID == (int)$row[\"categoryID\"] )\n {\n $row[\"ExpandedCategory\"] = true;\n break;\n }\n }\n }\n else\n $row[\"ExpandedCategory\"] = true;\n\n if ($ccat) {$row[\"products_count_category\"] = catGetCategoryProductCount( $row[\"categoryID\"], $cprod );}\n\n $row[\"ExistSubCategories\"] = ( $row[\"subcount\"] != 0 );\n\n if($_indexType=='NUM')\n $result[] = $row;\n elseif ($_indexType=='ASSOC')\n $result[$row['categoryID']] = $row;\n\n\n if ( $row[\"ExpandedCategory\"] )\n {\n //process subcategories\n $subcategories = _recursiveGetCategoryCList( $row[\"categoryID\"],\n $level+1, $expcat, $_indexType, $cprod, $ccat);\n\n if($_indexType=='NUM'){\n\n //add $subcategories[] to the end of $result[]\n for ($j=0; $j<count($subcategories); $j++)\n $result[] = $subcategories[$j];\n }\n elseif ($_indexType=='ASSOC'){\n\n //add $subcategories[] to the end of $result[]\n foreach ($subcategories as $_sub){\n\n $result[$_sub['categoryID']] = $_sub;\n }\n }\n\n }\n }\n return $result;\n}",
"function generateCategoryIndexes() \n{\n\tglobal $menu; \n\t\n\t$categoryArray = array();\n\tarray_push($categoryArray,'menu');\n foreach($menu->children() as $category) { \n \tarray_push($categoryArray,$category->getName());\n\t} \n\treturn $categoryArray; \n}",
"function create_array_subcategories($data)\r\n {\r\n foreach($data as $key)\r\n {\r\n $p[$key->id] = $key->nombre;\r\n }\r\n return $p;\r\n }",
"function dsf_create_up_cat_tree() {\n\tglobal $cat_parent_array;\n\t\n\t\tif (!isset($cat_parent_array) || !is_array($cat_parent_array)){\n\t\t\t$cat_parent_array = array();\n\t\t}\n\t\t\n\t\t$categories = dsf_db_query(\"select categories_id from \" . DS_DB_SHOP . \".categories order by categories_id\");\n\t\twhile ($results = dsf_db_fetch_array($categories)){\n\t\t\t$cat_id = $results['categories_id'];\n\t\t\t\n\t\t\t\n\t\t\t$info = dsf_get_up_cat_tree($results['categories_id'], 1);\n\t\t\t\t\n\t\t\t\t\t$items = explode(':' , $info);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($items as $id){\n\t\t\t\t\t\t\tif (isset($id) && (int)$id > 0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (isset($cat_parent_array[$id])){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// check to see there is some products in that category, if there are not, we are not interested\n\t\t\t\t\t\t\t\t\t\t$pr_query = dsf_db_query(\"select products_id from \" . DS_DB_SHOP . \".products_to_categories where categories_id='\" . (int)$cat_id . \"'\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (dsf_db_num_rows($pr_query) > 0){\n\t\t\t\t\t\t\t\t\t\t\t// only add if there are products found\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cat_parent_array[$id] = $cat_parent_array[$id] . ':' . $cat_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$cat_parent_array[$id] = $cat_id;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\n// we do not need to return anything, other than for consistancy. all of the results\n// have been put into the global variable $cat_parent_array()\n\nreturn true;\t\t\n\t\n}",
"function getAllCategories($mode) {\n\t if ($mode == 1) {\n\t\t $query = \"SELECT * FROM ref_category;\";\n\t\t\tmysql_query($query) or die(mysql_error());\n\t\t $numResults=mysql_query($query);\n\t\t\t$numRows=mysql_num_rows($numResults);\n\t\t\t$categories=array();\n\t\t $i=0;\n\t\t\twhile($i < $numRows) {\n\t\t\t $row = mysql_fetch_array($numResults);\n\t\t\t array_push($categories, array(\"id\"=>$row['id'], \"name\"=>$row['name']));\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $categories;\n\t\t} else if ($mode == 2) {\n\t\t $query = \"SELECT root.id AS root_id, root.name AS root_name, down1.id AS down1_id, down1.name AS down1_name, down2.id AS down2_id, down2.name AS down2_name FROM ref_category AS root LEFT OUTER JOIN ref_category AS down1 ON down1.parent_id = root.id LEFT OUTER JOIN ref_category AS down2 ON down2.parent_id = down1.id WHERE root.parent_id IS NULL ORDER BY root_name, down1_name, down2_name\";\n\t\t\tmysql_query($query) or die(mysql_error());\n\t\t $numResults=mysql_query($query);\n\t\t\t$numRows=mysql_num_rows($numResults);\n\t\t\t$categories=array();\n\t\t $i=0;\n\t\t\t$level0Id = 0;\n\t\t\t$level1Id = 0;\n\t\t\t$level2Id = 0;\n\t\t\t$categoriesTree = array();\n\t\t\t$level1Children = array();\n\t\t\t$rootChildren = array();\n\t\t\t$leafArr = array();\n\t\t\twhile($i < $numRows) {\n\t\t\t $row = mysql_fetch_array($numResults);\n\t\t\t\t$leafArr = array();\n\t\t\t\tif ($row['down2_id'] != null) {\n\t\t\t\t $leafArr = array(\"id\"=>$row['down2_id'], \"text\"=>$row['down2_name']);\n\t\t\t\t}\n\t\t\t\tif ($level1Id == 0 || $level1Id == $row['down1_id']) {\n\t\t\t\t if (sizeof($leafArr) > 0) {\n\t\t\t\t array_push($level1Children, $leafArr);\n\t\t\t\t\t}\n\t\t\t\t\t$level1Id = $row['down1_id'];\n\t\t\t\t\t$level1Name = $row['down1_name'];\n\t\t\t\t} else {\n\t\t\t\t array_push($rootChildren, array(\"id\"=>$level1Id, \"text\"=>$level1Name, \"children\"=>$level1Children));\n\t\t\t\t\t// Reset level 1 children as level 1 element has changed.\n\t\t\t\t\t$level1Children = array();\n\t\t\t\t\t// Add leaf node (level 2) from current (level 1 changed) DB row.\n\t\t\t\t\tif (sizeof($leafArr) > 0) {\n\t\t\t\t\t array_push($level1Children, $leafArr);\n\t\t\t\t\t}\n\t\t\t\t\t// read new ID/Name of level 1.\n\t\t\t\t\t$level1Id = $row['down1_id'];\n\t\t\t\t\t$level1Name = $row['down1_name'];\n\t\t\t\t}\n\t\t\t\tif ($rootId != $row['root_id']) {\n\t\t\t\t if ($rootId == 0) {\n\t\t\t\t\t $rootId = $row['root_id'];\n\t\t\t\t\t\t$rootName = $row['root_name'];\n\t\t\t\t\t} else {\n\t\t\t\t\t array_push($categoriesTree, array(\"id\"=>$rootId, \"text\"=>$rootName, \"children\"=>$rootChildren));\n\t\t\t\t\t\t$rootChildren = array();\n\t\t\t\t\t\t$rootId = $row['root_id'];\n\t\t\t\t\t\t$rootName = $row['root_name'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\tif ($numRows > 0) {\n\t\t\t if (sizeOf($level1Children) > 0) {\n\t\t\t array_push($rootChildren, array(\"id\"=>$level1Id, \"text\"=>$level1Name, \"children\"=>$level1Children));\n\t\t\t }\n\t\t array_push($categoriesTree, array(\"id\"=>$rootId, \"text\"=>$rootName, \"children\"=>$rootChildren));\n\t\t\t}\n\t\t\treturn $categoriesTree;\n\t\t}\n\t}",
"function GetCatalogCatInArr($level = NULL, $front_back = 'back') {\n $arr = array();\n $rrr = $this->GetTreeCatLevel($level);\n //echo '<br>$level='.$level;print_r($rrr);\n if(is_array($rrr)){\n $keys = array_keys($rrr);\n $rows = count($rrr);\n //echo '<br> $rows='.$rows;\n for ($i = 0; $i < $rows; $i++) {\n $data = $this->GetTreeCatData($keys[$i]);\n if($data['id']==0){\n continue;\n }\n if($front_back=='front' AND $data['visible']!=2){\n continue;\n }\n $arr[$data['level']][$data['id']] = $data;\n $arr = $arr + $this->GetCatalogCatInArr($data['id'], $front_back);\n }\n }\n return $arr;\n }",
"public function findLevelDataProvider() {\n\t\treturn array(\n\t\t\t'top-level' => array(\n\t\t\t\tnull,\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'ShopCategory' => array(\n\t\t\t\t\t\t\t'id' => 'active',\n\t\t\t\t\t\t\t'name' => 'active',\n\t\t\t\t\t\t\t'slug' => 'active',\n\t\t\t\t\t\t\t'parent_id' => NULL,\n\t\t\t\t\t\t\t'lft' => '1',\n\t\t\t\t\t\t\t'rght' => '2',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'ShopImage' => array(\n\t\t\t\t\t\t\t'id' => NULL,\n\t\t\t\t\t\t\t'image' => NULL,\n\t\t\t\t\t\t\t'image_full' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_large' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_medium' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_small' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_thumb' => '/filemanager/img/no-image.png',\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'ShopCategory' => array(\n\t\t\t\t\t\t\t'id' => 'another',\n\t\t\t\t\t\t\t'name' => 'another',\n\t\t\t\t\t\t\t'slug' => 'another',\n\t\t\t\t\t\t\t'parent_id' => NULL,\n\t\t\t\t\t\t\t'lft' => '7',\n\t\t\t\t\t\t\t'rght' => '8',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'ShopImage' => array(\n\t\t\t\t\t\t\t'id' => NULL,\n\t\t\t\t\t\t\t'image' => NULL,\n\t\t\t\t\t\t\t'image_full' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_large' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_medium' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_small' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_thumb' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t),\n\t\t\t'inactive' => array(\n\t\t\t\t'inactive',\n\t\t\t\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'ShopCategory' => array(\n\t\t\t\t\t\t\t'id' => 'inactive-parent',\n\t\t\t\t\t\t\t'name' => 'inactive-parent',\n\t\t\t\t\t\t\t'slug' => 'inactive-parent',\n\t\t\t\t\t\t\t'parent_id' => 'inactive',\n\t\t\t\t\t\t\t'lft' => '4',\n\t\t\t\t\t\t\t'rght' => '5',\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'ShopImage' => array(\n\t\t\t\t\t\t\t'id' => NULL,\n\t\t\t\t\t\t\t'image' => NULL,\n\t\t\t\t\t\t\t'image_full' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_large' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_medium' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_small' => '/filemanager/img/no-image.png',\n\t\t\t\t\t\t\t'image_thumb' => '/filemanager/img/no-image.png',\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 buildTree($selected_cat = 0)\n\t{\n\t\t//Save the origin dataset category_id\n\t\t$this->_dataset_stored_category_id = $selected_cat;\n\t\n\t\tif ($selected_cat=='' || $selected_cat==0)\n\t\t{\n\t\t\t$cat_array = array(\n\t\t\t\t\t\t'text'=>'eBay',\n\t\t\t\t\t\t'id'=>'1',\n\t\t\t\t\t\t'path'=>'1',\n\t\t\t\t\t\t'cls'=>'folder active-category',\n\t\t\t\t\t\t'children' => $this->_addChildren(null)\n\t\t\t\t\t\t);\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cat_array = $this->_buildRecursiveTree($selected_cat);\n\t\t}\t\n\t\t\n\t\treturn $cat_array;\t\t\n\t}",
"function px_get_top_level_categories()\r\n{\r\n $categories = array();\r\n\r\n $response = px_api_call('buyat.affiliate.content.categories.listtoplevel', PX_API_KEY, array('version' => PX_VERSION));\r\n\r\n if(array_key_exists('categories', $response))\r\n {\r\n foreach($response['categories'] AS $index => $category)\r\n {\r\n if(!is_array($category) || !(array_key_exists('value', $category)) ||\r\n !is_array($category['value']) ||(!array_key_exists('category_id', $category['value']) ||\r\n !array_key_exists('category_name', $category['value'])))\r\n {\r\n continue;\r\n }\r\n\r\n $categories[$category['value']['category_id']]=$category['value']['category_name'];\r\n }\r\n }\r\n\r\n return $categories;\r\n}",
"function _decorize_tree_names($father,$categs,$level='',$array_key='id',$array_value='name') {\r\n\t/*\r\n\t\t<ul>\r\n\t<li>Index <></i>*/\r\n\t$res = array();\r\n\tif (!isset($categs[$father])) {\r\n\t\treturn $res;\r\n\t}\r\n\t\r\n\t//if ($level != '') $level=substr($level,2); // ugly hack\r\n\t\r\n\tforeach($categs[$father] AS $categI=>$categV) {\r\n\t\t$res[] = array( $array_key => $categV[$array_key], $array_value => $level . $categV[$array_value], 'checkable'=>@$categV['checkable'] );\r\n\t\t\r\n\t\t$res_level = _decorize_tree_names($categV['id'],$categs,$level.'--');\r\n\t\t$res = array_merge($res,$res_level);\r\n\t}\r\n\treturn $res;\r\n}",
"function npfrGetSubCategoriesTree( Category $category )\n{\n static $out = [];\n\n if ( !$category ) {\n return $out;\n }\n\n if ( $subcategories = $category->childrenCategories()->get() ) {\n $out[ $category->id ] = Arr::pluck( $subcategories, 'id' );\n }\n return $out;\n}",
"static function getCategoriesTree()\r\n\t{\r\n\t\tglobal $globalcats;\r\n\t\t$db = JFactory::getDBO();\r\n\t\t$ROOT_CATEGORY_ID = FLEXI_J16GE ? 1 : 0;\r\n\r\n\t\t// get the category tree and append the ancestors to each node\r\n\t\tif (FLEXI_J16GE) {\r\n\t\t\t$query\t= 'SELECT id, parent_id, published, access, title, level, lft, rgt, language,'\r\n\t\t\t\t. ' CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\\':\\', id, alias) ELSE id END as slug'\r\n\t\t\t\t. ' FROM #__categories as c'\r\n\t\t\t\t. ' WHERE c.extension=\"'.FLEXI_CAT_EXTENSION.'\" AND lft > ' . FLEXI_LFT_CATEGORY . ' AND rgt < ' . FLEXI_RGT_CATEGORY\r\n\t\t\t\t. ' ORDER BY parent_id, lft'\r\n\t\t\t\t;\r\n\t\t} else {\r\n\t\t\t$query\t= 'SELECT id, parent_id, published, access, title,'\r\n\t\t\t\t. ' CASE WHEN CHAR_LENGTH(alias) THEN CONCAT_WS(\\':\\', id, alias) ELSE id END as slug'\r\n\t\t\t\t. ' FROM #__categories'\r\n\t\t\t\t. ' WHERE section = ' . FLEXI_SECTION\r\n\t\t\t\t. ' ORDER BY parent_id, ordering'\r\n\t\t\t\t;\r\n\t\t}\r\n\t\t$db->setQuery($query);\r\n\t\t$cats = $db->loadObjectList();\r\n\r\n\t\t//establish the hierarchy of the categories\r\n\t\t$children = array();\r\n\t\t$parents = array();\r\n\t\t\r\n\t\t//set depth limit\r\n\t\t$levellimit = 30;\r\n\t\t\r\n\t\tforeach ($cats as $child) {\r\n\t\t\t$parent = $child->parent_id;\r\n\t\t\tif ($parent) $parents[] = $parent;\r\n\t\t\t$list \t= @$children[$parent] ? $children[$parent] : array();\r\n\t\t\tarray_push($list, $child);\r\n\t\t\t$children[$parent] = $list;\r\n\t\t}\r\n\t\t\r\n\t\t$parents = array_unique($parents);\r\n\r\n\t\t//get list of the items\r\n\t\t$globalcats = plgSystemFlexisystem::_getCatAncestors($ROOT_CATEGORY_ID, '', array(), $children, true, max(0, $levellimit-1));\r\n\r\n\t\tforeach ($globalcats as $cat) {\r\n\t\t\t$cat->ancestorsonlyarray = $cat->ancestors;\r\n\t\t\t$cat->ancestorsonly = implode(',', $cat->ancestors);\r\n\t\t\t$cat->ancestors[] = $cat->id;\r\n\t\t\t$cat->ancestorsarray = $cat->ancestors;\r\n\t\t\t$cat->ancestors = implode(',', $cat->ancestors);\r\n\t\t\t$cat->descendantsarray = plgSystemFlexisystem::_getDescendants($cat);\r\n\t\t\t$cat->descendants = implode(',', $cat->descendantsarray);\r\n\t\t\t$cat->language = isset($cat->language) ? $cat->language : '';\r\n\t\t}\r\n\t\t\r\n\t\treturn $globalcats;\r\n\t}",
"function levels_to_tree($a) {\n $tree = array();\n foreach($a as $k => $v) {\n $b = &$tree;\n foreach(explode('.', $k) as $n) {\n $a = &$b;\n $b = &$b[$n]['sub'];\n }\n $a[$n]['title'] = $v;\n }\n return $tree;\n}",
"function flatten_category_tree(&$categories, $id, $depth = 0, $nochildrenof = -1) {\n\n // Indent the name of this category.\n $newcategories = array();\n $newcategories[$id] = $categories[$id];\n $newcategories[$id]->indentedname = str_repeat(' ', $depth) . $categories[$id]->name;\n\n // Recursively indent the children.\n foreach ($categories[$id]->childids as $childid) {\n if ($childid != $nochildrenof){\n $newcategories = $newcategories + flatten_category_tree($categories, $childid, $depth + 1, $nochildrenof);\n }\n }\n\n // Remove the childids array that were temporarily added.\n unset($newcategories[$id]->childids);\n\n return $newcategories;\n}",
"public function depth($data)\r\r\n {\r\r\n try{\r\r\n if(array_key_exists('cat_id',$data)) {\r\r\n $node = $data['cat_id'];\r\r\n $constant = \"CAT_ID\";\r\r\n }elseif(array_key_exists('cat_name',$data)){\r\r\n $node = $data['cat_name'];\r\r\n $constant = \"CAT_NAME\";\r\r\n }elseif(array_key_exists('cat_link',$data)){\r\r\n $node = $data['cat_link'];\r\r\n $constant = \"CAT_LINK\";\r\r\n }\r\r\n $sql = sprintf(\"SELECT node.%s, node.%s, node.%s,\r\r\n (COUNT(parent.%s) - 1) AS depth\r\r\n FROM %s AS node,\r\r\n %s AS parent\r\r\n WHERE node.%s BETWEEN parent.%s AND parent.%s\r\r\n AND node.%s = '%s'\r\r\n GROUP BY node.%s\r\r\n ORDER BY node.%s\",CAT_NAME,CAT_LINK,CAT_ID,CAT_NAME,TABLE_NAME,\r\r\n TABLE_NAME,LEFT,LEFT,RIGHT,constant($constant),$node,CAT_NAME,'order');\r\r\n $query = mysql_query($sql); if(!$query) throw new cat_Exception(mysql_error());\r\r\n $row = mysql_fetch_assoc($query);\r\r\n return $row;\r\r\n //exception end\r\r\n }catch(Exception $e) {echo $e;}\r\r\n }",
"function depth($level);",
"function ShowLevelsNameShort(&$tree, $cols = 5)\n {\n if( !is_array($tree)) return;\n\n $settings = $this->settings;\n switch($cols){\n case '1':\n $width = 'width100';\n break;\n case '2':\n $width = 'width50';\n break;\n case '3':\n $width = 'width32';\n break;\n case '4':\n $width = 'width25';\n break;\n case '5':\n $width = 'width20';\n break;\n\n }\n ?>\n <div class=\"listCategoryItemShort\">\n <?\n $rows =count($tree);\n $keys = array_keys($tree);\n for($i=0; $i<$rows; $i++){\n $id_cat = $keys[$i];\n //echo '<br />$id_cat='.$id_cat;\n $cat_data = $this->GetTreeCatData($id_cat);\n $name = stripslashes($cat_data['name']);\n $img_cat = stripslashes($cat_data['img_cat']);\n //$descr = stripslashes($cat_data['descr']);\n //$descr2 = stripslashes($row['descr2']);\n ?>\n <!-- show Name of the category -->\n <?\n if(!empty($cat_data['href'])) $link = _LINK.$cat_data['href'];\n else $link = $this->getUrlByTranslit($cat_data['path'], NULL);\n ?>\n <div class=\"item floatToLeft <?=$width;?>\">\n <a href=\"<?=$link;?>\" title=\"<?=addslashes($name);?>\"><?=$name;?></a>\n </div>\n <!-- show Image of the category -->\n <?//if (!empty($img_cat)) { echo $this->ShowCurrentImage($settings['img_path'].\"/categories/\".$img_cat, 'size_auto=75', 85, NULL, \"border=0\");}?>\n <!-- show Description of the category -->\n <?//=$descr;?>\n <?\n }// end for\n ?>\n </div>\n <?\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Read MacAddresses from HP 18Series Switches | function readmacHP18($switchf,$macarrayf){
$a = snmp2_walk("$switchf", "public", ".1.3.6.1.2.1.17.4.3.1.1.0");
foreach ($a as $val) {
$mac_ = substr($val, 12,-1);
$pattern = '/([A-F0-9]*)\ ([A-F0-9]*)\ ([A-F0-9]*)\ ([A-F0-9]*)\ ([A-F0-9]*)\ ([A-F0-9]*)$/';
preg_match( $pattern, $mac_, &$mac ) ;
$rmac = $mac[1].":".$mac[2].":".$mac[3].":".$mac[4].":".$mac[5].":".$mac[6];
$ip_ = $switchf;
$npattern = '/([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)$/';
preg_match( $npattern, $ip_, &$ip ) ;
$network = $ip[2].".".$ip[3];
if ($network == "43.128"){$network = "43.28";}
if ($network == "43.126"){$network = "43.26";}
$macarrayf[] = "".$rmac.";".$network."";
}
return($macarrayf);
} | [
"public function getMacAddresses() {\n\t\t$addresses = [];\n\t\t$lsInterfaces = $this->commandManager->send('ls /sys/class/net | awk \\'{ print $0 }\\'', true);\n\t\t$interfaces = explode(PHP_EOL, $lsInterfaces);\n\t\tforeach ($interfaces as $interface) {\n\t\t\tif ($interface === 'lo') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cmd = 'cat /sys/class/net/' . $interface . '/address';\n\t\t\t$addresses[$interface] = $this->commandManager->send($cmd, true);\n\t\t}\n\t\treturn $addresses;\n\t}",
"public function getMacAddresses() {\n return $this->callSyncStrip('get_macs', array($this->vmName));\n }",
"public function macAddresses(){\n\t\treturn $this->macAddresses;\n\t}",
"function getMacsToConnect() {\n return $this->portMacs;\n }",
"function readmac6248($switchf,$macarrayf){\n $a = snmp2_real_walk(\"$switchf\", \"public\", \"SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.1\");\n foreach (array_keys($a) as $val) {\n $pattern = '/([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)$/';\n preg_match( $pattern, $val, &$mac ) ; \n $rmac = sprintf(\"%02X:%02X:%02X:%02X:%02X:%02X\", $mac[1], $mac[2], $mac[3],\n $mac[4], $mac[5], $mac[6]);\n \n $ip_ = $switchf;\n $npattern = '/([0-9]*)\\.([0-9]*)\\.([0-9]*)\\.([0-9]*)$/';\n preg_match( $npattern, $ip_, &$ip ) ;\n $network = $ip[2].\".\".$ip[3];\n if ($network == \"43.128\"){$network = \"43.28\";}\n if ($network == \"43.126\"){$network = \"43.26\";}\n $macarrayf[] = \"\".$rmac.\";\".$network.\"\";\n }\n return($macarrayf);\n}",
"public function getMacAddress()\n\t\t{\n\n\t\t\treturn shell_exec(\"cat /sys/class/net/$(ip route show default | awk '/default/ {print $5}')/address\");\n\n\t\t}",
"function get_mac($ip) {\r\n $ip = trim($ip);\r\n shell_exec($GLOBALS[\"ping\"].\" \".$ip);\r\n $arp = shell_exec($GLOBALS[\"arp\"]);\r\n $arp = explode(\"\\n\", $arp);\r\n foreach($arp as $line) {\r\n if(ereg(\": $ip ---\", $line)) { return(\"This is your adapter, to find MAC try \\\"ipconfig /all\\\"\"); }\r\n if(ereg(\" $ip \", $line)) {\r\n //echo($line.\"\\n\"); //Debug\r\n $line = explode($ip, $line);\r\n $line = trim($line[1]);\r\n $line = explode(\"dynamic\", $line);\r\n $line = trim($line[0]);\r\n //echo($line.\"\\n\"); //Debug\r\n return($line);\r\n }\r\n }\r\n return(\"Not found. Couldn't broadcast to IP.\");\r\n}",
"public function get_mac_via_ssh($ip) {\n // Copy over getmac.vbs\n $command = \"if WScript.Arguments.Count = 0 Then Wscript.Quit 2001 \\n\";\n $command .= \"Dim ObjWMI: Set ObjWMI = GetObject(\\\"winmgmts:{impersonationLevel=impersonate}!\\\\\\\\.\\\\root\\\\cimv2\\\") \\n\";\n $command .= \"Dim colItems : Set NICS = ObjWMI.ExecQuery(\\\"Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True\\\") \\n\";\n $command .= \"Dim adapterCFG, IPaddr \\n\";\n $command .= \"For each adapterCFG in NICS 'Loop through adapters and get needed information.... \\n\";\n $command .= \" For Each IPaddr in adapterCFG.IPAddress \\n\";\n $command .= \" if WScript.Arguments.Item(0) = IPaddr Then \\n\";\n $command .= \" WScript.Echo adapterCFG.MACAddress \\n\";\n $command .= \" End if \\n\";\n $command .= \" Next \\n\";\n $command .= \"Next \\n\";\n $command .= \"WScript.Quit 2001 \\n\";\n\n $file = './uploads/getmac.vbs';\n\n file_put_contents($file, $command);\n\n $output = array(\n 'status' => \"Sending getmac.vbs to: \".$ip,\n 'output' => shell_exec('scp -i ./certs/labmgr -o StrictHostKeyChecking=no -o ConnectTimeout=1 '.$file.' IBM_USER@' . $ip. ':/cygdrive/c/temp/'),\n 'cmd' => $file,\n 'exit_status' => ''\n );\n unlink($file);\n \n $output = array(\n 'status' => \"ssh to machine to get MAC address: \".$ip,\n 'output' => exec('ssh -i ./certs/labmgr -o \"StrictHostKeyChecking no\" -o \"ConnectTimeout = 1\" IBM_USER@' . $ip .' \"cscript //nologo C:/temp/getmac.vbs ' . $ip.'\"', $cmd_output, $exit_status),\n 'cmd_output' => $cmd_output,\n 'exit_status' => $exit_status\n );\n\n if(!empty($cmd_output[0]) && $cmd_output[0] != 'entries') {\n return $cmd_output[0];\n } else {\n return 'Unable to get MAC Address.';\n }\n\n }",
"private static function get_mac_classic()\n {\n ob_start();\n // Turn on output buffering\n system('ipconfig/all');\n //Execute external program to display output\n $mycom = ob_get_contents();\n // Capture the output into a variable\n ob_clean();\n // Clean (erase) the output buffer\n $pmac = strpos($mycom, 'Physical');\n // Find the position of Physical text\n $mac = substr($mycom, ($pmac + 36), 17);\n // Get Physical Address\n return $mac;\n }",
"function getClientMac($clientIP)\n{\n return trim(exec(\"grep \" . escapeshellarg($clientIP) . \" /tmp/dhcp.leases | awk '{print $2}'\"));\n}",
"function dlinkReadMacList ($text)\n{\n\t$result = array();\n\tforeach (preg_split (\"/\\n\\r?/\", $text) as $line)\n\t{\n\t\tif (! preg_match ('/^\\s*\\d+\\s+/', $line))\n\t\t\tcontinue;\n\t\t$w = preg_split ('/\\s+/', $line);\n\t\tif (count ($w) != 5)\n\t\t\tcontinue;\n\t\t$result[$w[3]][] = array\n\t\t(\n\t\t\t'mac' => $w[2],\n\t\t\t'vid' => $w[0],\n\t\t);\n\t}\n\tforeach ($result as $portname => &$maclist)\n\t\tusort ($maclist, 'maclist_sort');\n\treturn $result;\n}",
"public static function macAddressWindows()\n {\n ob_start(); // Turn on output buffering\n system('ipconfig /all'); //Execute external program to display output\n $mycom=ob_get_contents(); // Capture the output into a variable\n ob_clean(); // Clean (erase) the output buffer\n $findme = \"Physical\";\n $pmac = strpos($mycom, $findme); // Find the position of Physical text\n $mac=substr($mycom,($pmac+36),17); // Get Physical Address\n $hasil = strtolower(str_replace('-',':',$mac));\n $hasil = Afis::enkripsi($hasil);\n return $hasil;\n }",
"public function mac_address(){\n\t\t // Turn on output buffering \n\t\t // ob_start(); \n\t\t // //mendapatkan detail ipconfing menggunakan CMD \n\t\t // system('ipconfig /all'); \n\t\t // // mendapatkan output kedalam variable \n\t\t // $mycom=ob_get_contents(); \n\t\t // // membersihkan output buffer \n\t\t // ob_clean(); \n\t\t // $findme = \"Physical\"; \n\t\t // // mencari perangkat fisik | menemukan posisi text perangkat fisik \n\t\t // //Search the \"Physical\" | Find the position of Physical text \n\t\t // $pmac = strpos($mycom, $findme); \n\t\t // // mendapatkan alamat peragkat fisik \n\t\t // $mac=substr($mycom,($pmac+36),17); \n\t\t // //menampilkan Mac Address \n\t\t // return $mac; \n\n \t\n\nob_start();\n system('getmac');\n $Content = ob_get_contents();\n ob_clean();\n return substr($Content, strpos($Content,'\\\\')-20, 17);\n\n\t}",
"public function getMaclist()\n {\n $result = $this->client->GetMaclist();\n if ($this->errorHandling($result, 'Could not get MAC list from FRITZ!Box')) {\n return;\n }\n\n return $result;\n }",
"function load_mac_manufacturer_table() {\n /* load MAC-Manufacture data from the file */\n $macs = false;\n if (file_exists(\"/usr/local/share/nmap/nmap-mac-prefixes\")) {\n $macs=file(\"/usr/local/share/nmap/nmap-mac-prefixes\");\n }\n if ($macs){\n foreach ($macs as $line){\n if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){\n /* store values like this $mac_man['000C29']='VMware' */\n $mac_man[\"$matches[1]\"]=$matches[2];\n }\n }\n return $mac_man;\n } else {\n return -1;\n }\n\n}",
"private function getConnectionToSwitchIndex() {\n global $DB;\n\n $macs='';\n $ptp = new PluginFusioninventoryPort;\n foreach($this->portsToConnect as $index=>$portConnection) {\n if ($macs!='') $macs.=', ';\n $ptp->load($portConnection);\n $macs.=\"'\".$ptp->getValue('ifmac').\"'\";\n $ifmac[$index]=$ptp->getValue('ifmac');\n }\n if ($macs!='') {\n $query = \"SELECT `ifmac`\n FROM `glpi_networking`\n WHERE `ifmac` IN (\".$macs.\");\";\n $result=$DB->query($query);\n if ($DB->numrows($result) == 1) {\n $switch = $DB->fetch_assoc($result);\n return array_search($switch['ifmac'], $ifmac);\n }\n }\n return '';\n }",
"private function extract_unique_mac_address()\n {\n $l_return = [];\n if (isset($this->m_data[C__CATG__NETWORK]) && count($this->m_data[C__CATG__NETWORK]))\n {\n foreach ($this->m_data[C__CATG__NETWORK] AS $l_port)\n {\n if (!array_search($l_port['mac'], $l_return)) $l_return[] = $l_port['mac'];\n } // foreach\n } // if\n return $l_return;\n }",
"function getMac( $what ) {\n$what = &strtolower( $what );\nif( $what == 'server' ) {\nreturn $this->__server_macaddress();\n}\nelseif( $what == 'client' ) {\nreturn $this->__client_macaddress();\n}\nelse {\nreturn '\\'client\\' or \\'server\\' ?';\n}\n}",
"private function getConnectionToSwitchIndex() {\n global $DB;\n\n $macs='';\n $ptp = new PluginFusinvsnmpNetworkPort;\n $mac = array();\n foreach($this->portsToConnect as $index=>$portConnection) {\n if ($macs!='') $macs.=', ';\n $ptp->load($portConnection);\n $macs.=\"'\".$ptp->getValue('mac').\"'\";\n $mac[$index]=$ptp->getValue('mac');\n }\n if ($macs!='') {\n $query = \"SELECT `mac`\n FROM `glpi_networkequipments`\n WHERE `mac` IN (\".$macs.\");\";\n $result=$DB->query($query);\n if ($DB->numrows($result) == 1) {\n $switch = $DB->fetch_assoc($result);\n return array_search($switch['mac'], $mac);\n }\n }\n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a new blog folder | public function addBlog($blogName) {
mkdir($this->path . DIRECTORY_SEPARATOR . basename($blogName));
} | [
"public function createBlogDirectory($blog_dir)\n\t{\n\t\t@mkdir($blog_dir , 0777, true );\n\t\t$this->config = $this->configContent( $blog_dir );\n\t\t@mkdir( $this->config['dir']['post'], 0777, true );\n\t\t@mkdir( $this->config['dir']['page'], 0777, true );\n\t\t@mkdir( $this->config['dir']['site'], 0777, true );\n\t\t@mkdir( $this->config['dir']['asset'], 0777, true );\n\t\t@mkdir( $this->config['dir']['layout'], 0777, true );\t\n\t}",
"public function createBlog();",
"function createDirectory();",
"function make_post_directories($post, $post_index) {\n if($post->isDraft())\n return;\n\n $path_info = pathinfo($post->getTargetFn());\n\n // create directory if required\n $dir = $path_info['dirname'];\n\n if($dir != '.') {\n // create directory if it doesn't already exists\n if (!file_exists($dir)) {\n writeln('Creating directory: ' . $dir);\n mkdir($dir, 0755, true);\n }\n }\n}",
"function createDirectory($name) {}",
"public function create_content_directory () {\n\n\t\tif(!is_dir(WP_CONTENT_DIR.'/et-content')) {\n\t\t\tmkdir(WP_CONTENT_DIR.'/et-content', 0755);\n\t\t\t$fh = fopen(WP_CONTENT_DIR.'/et-content/index.html', 'w');\n\t\t}\n\n\t\tif(!is_dir(WP_CONTENT_DIR.'/et-content/'.THEME_NAME )) {\n\t\t\tmkdir( WP_CONTENT_DIR.'/et-content/'. THEME_NAME , 0755);\n\t\t\t$fh = fopen(WP_CONTENT_DIR.'/et-content/'. THEME_NAME.'/index.html', 'w');\n\t\t}\n\n\t\tif(!is_dir(WP_CONTENT_DIR.'/et-content/'.THEME_NAME.'/lang/' )) {\n\t\t\tmkdir( WP_CONTENT_DIR.'/et-content/'. THEME_NAME .'/lang/' , 0755);\n\t\t\t$fh = fopen(WP_CONTENT_DIR.'/et-content/'. THEME_NAME.'/lang/index.html', 'w');\n\t\t}\n\t}",
"function createDirectory($name);",
"function insert_blog($domain, $path, $site_id)\n {\n }",
"public function newfolderAction()\n {\n $params = $this->initParams();\n $makeDirParams = $this->getRequest()->getPost();\n if (isset($makeDirParams['nf'])) {\n try {\n $fs = new \\Mcwork\\Model\\Fs\\Directory($this->worker->getStorage(), $this->initFsEntity(), $this->area);\n $fs->setFsCurrent($makeDirParams['cd']);\n $fs->setNewDirectory($makeDirParams['nf']);\n $message = $fs->mkdir();\n echo Json::encode(array(\n 'messages' => $message\n ));\n } catch (\\Exception $e) {\n echo Json::encode(array(\n 'error' => $e->getMessage()\n ));\n }\n } else {\n echo Json::encode(array(\n 'error' => 'wrong_param_to_create_folder'\n ));\n }\n exit();\n }",
"function createFolder(string $foldername);",
"public function create()\n {\n if(!Security::isAuthenticated())\n {\n header(\"Location: /\");\n exit();\n }\n $this->doCreate();\n\n $view = new View('blog_create');\n $view->title = 'Create Blog';\n $view->heading = 'Create Blog';\n $view->display();\n }",
"function createBookmarkFolder()\n\t{\n\t\tif(!$this->tree->isInTree($this->id))\n\t\t{\n\t\t\t$this->ctrl->setParameter($this, 'bmf_id', '');\n\t\t\t$this->ctrl->redirect($this);\n\t\t}\n\n\t\t// check title\n\t\tif(empty($_POST[\"title\"]))\n\t\t{\n\t\t\tilUtil::sendFailure($this->lng->txt(\"please_enter_title\"));\n\t\t\t$this->newFormBookmarkFolder();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// create bookmark folder\n\t\t\t$bmf = new ilBookmarkFolder();\n\t\t\t$bmf->setTitle(ilUtil::stripSlashes($_POST[\"title\"]));\n\t\t\t$bmf->setParent($this->id);\n\t\t\t$bmf->create();\n\n\t\t\tglobal $ilCtrl;\n\t\t\t$ilCtrl->saveParameter($this, 'bmf_id');\n\t\t\t$ilCtrl->redirect($this, 'view');\n\t\t}\n\t}",
"function add_blogpost() {\n $post = $this->posts->create();\n $this->present_blogpost($post);\n }",
"abstract function createDirectory($path);",
"protected static function createDir() {\n\t\tself::$upload_dir = wp_upload_dir();\n\t\tself::$upload_dir['basedir'] .= '/freshizer';\n\t\tself::$upload_dir['baseurl'] .='/freshizer';\n\t\t// if this directory does not exists, create it;\n\t\tif( !is_dir(self::$upload_dir['basedir']))\n\t\t\tmkdir( self::$upload_dir['basedir']);\n\t}",
"private function createFolders()\n\t{\n\t\t$mediaConfig = $this->getServiceLocator()->get('config')['media'];\n\t\t$saveDir = rtrim($mediaConfig['save_path'], '\\\\/');\n\n\t\tif ( ! file_exists($saveDir))\n\t\t{\n\t\t\tmkdir($saveDir, 0755, true);\n\t\t}\n\t}",
"protected function createMediaChronopostFolder() {\n $path = 'media/chronopost';\n if(!is_dir($path)) {\n mkdir($path,0777);\n }\n }",
"function knowledgebank_master_upload_directory( $dir, $post_id){\n $dir = \"/node/$post_id\";\n if(!file_exists($dir)){\n mkdir($dir);\n }\n $dir .= \"/master\";\n if(!file_exists($dir)){\n mkdir($dir);\n }\n\n return $dir;\n}",
"public function blogcreateActionPost() : object\n {\n $response = $this->app->response;\n $request = $this->app->request;\n\n $blogTitle = $request->getPost(\"blogTitle\") ?: $request->getGet(\"title\");\n\n $this->blogAdminClass->createBlog($blogTitle);\n\n $blogId = $this->blogAdminClass->getIdBlogByTitle($blogTitle);\n $blogId = json_encode($blogId[0]);\n $blogId = substr($blogId, 6, -1);\n\n return $response->redirect(\"admin/blogedit?id=$blogId\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add Shortcode stampused adds Stampin Up products to your post | function stempeltier_stampused_sc( $atts , $content = null ) {
// Attributes
extract( shortcode_atts(
array(
'size' => 'small',
'style' => 'stampused',
), $atts )
);
switch( true ) {
case strtolower($size) === "small":
$imgsize = "s";
break;
case strtolower($size) === "big":
$imgsize = "g";
break;
default:
$size = "s";
}
$size = sanitize_text_field( $size );
$style = sanitize_text_field( $style );
$products = sanitize_text_field( $products );
// Content
$products = explode(" ", $content, 20);
// DemoID from DB
$demoid = get_option( 'stampinup-demoid' );
// HOSTCODE from DB
$hostcode = get_option( 'stampinup-hostcode' );
if ( $hostcode != '' ) {
$hostcode = "&hostcode=$hostcode";
}
// Code
$return = "<div class=\"$style $style-wrap\">\n";
//$return.= "<!-- $content :".count($products)." -->\n";
foreach ($products as $product) {
//$return.= "<!-- $product -->\n";
if ( preg_match( "/^[0-9]{6}$/", $product) ) {
$return.= " <div class=\"$style-item $style-item-$size\">\n";
$return.= " <a href=\"https://www.stampinup.de/products/$product?dbwsdemoid=$demoid$hostcode\"
alt=\"Stampin Up Product $product\" title=\"Stampin Up Online Shop Product $product\" target=\"_blank\">
<img src=\"//www2.stampinup.com/images/EC/$product$imgsize.jpg\" alt=\"Stampin Up Product $product\"></a>";
/*$return.= " <a href=\"http://www2.stampinup.com/ECWeb/ProductDetails.aspx?productID=$product&dbwsdemoid=$demoid\"
alt=\"Stampin Up Product $product\" title=\"Stampin Up Online Shop Product $product\" target=\"_blank\">
<img src=\"//www2.stampinup.com/images/EC/$product$imgsize.jpg\" alt=\"Stampin Up Product $product\"></a>";*/
$return.= " </div>\n";
}
}
$return.= "</div>\n";
return $return;
} | [
"abstract public function addShortcode();",
"function darrylspa_products_shortcode($products){\n\t$args = array(\n\t\t'posts_per_page' => $products['number'],\n\t\t'post_type' => 'store',\n\t\t'orderby' => 'menu_order',\n\t\t'order' => 'ASC'\n\t);\n\t$query = new WP_Query($args);\n\twhile($query->have_posts()) : $query->the_post(); ?>\n\n\t\t<div class=\"col-lg-3 col-md-6 col-12 mb-md-3 mb-5\">\n\t\t\t<div class=\"card\">\n\t\t\t\t<a href=\"<?php the_permalink(); ?>\">\n\t\t\t\t\t<?php the_post_thumbnail('product_thumb', array('class' => 'card-img-top img-fluid')) ?>\n\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t<h3 class=\"card-title text-center text-uppercase mb-0\"><?php the_title(); ?></h3>\n\t\t\t\t\t\t<p class=\"card-text text-uppercase\"><?php echo get_field('short_description'); ?></p>\n\t\t\t\t\t\t<p class=\"text-center price mb-0\">$<?php echo get_field('price'); ?></p>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php\t\n\tendwhile; wp_reset_query();\n}",
"function tourcms_wp_shortcode($atts, $content, $code) {\n\t\tglobal $post;\n\t\t\n\t\t//error_log($tag);\n\t\t// Support tourcms_ prefixed shortcodes\n\t\t// added due to conflicts with other plugins/themes\n\t\tif(substr($code, 0, 8) == 'tourcms_') {\n\t\t\t$code = str_replace('tourcms_', '', $code);\n\t\t}\n\t\t\n\t\t//error_log($tag);\n\t\t\n\t\t$text = get_post_meta( $post->ID, 'tourcms_wp_'.$code, true );\n\t\t\n\t\tif($code==\"from_price\")\n\t\t\t$text = round(get_post_meta( $post->ID, 'tourcms_wp_'.$code, true ));\n\t\t\t\n\t\treturn $text;\n\t}",
"function spasite_products_shortcode($products){\n $args = array(\n 'post_per_page' => $products['number'],\n 'post_type' => 'our_products',\n 'orderby' => 'name',\n 'order' => 'ASC',\n\n );\n\n $products = new WP_Query($args); ?>\n <div class=\"container productos pt-5\">\n <div class=\"row\">\n\n <?php while($products->have_posts()): $products->the_post(); ?>\n\n <div class=\"col-6 col-md-3 mb-4 mb-md-0\">\n <div class=\"card\">\n <a href=\"<?php the_permalink();?>\">\n <?php the_post_thumbnail( 'product_thumb', array('class' => 'card-img-top img-fluid') );?>\n <div class=\"card-body\">\n <h3 class=\"card-title text-center text-uppercase\">\n <?php the_title();?>\n </h3>\n <p class=\"card-text text-uppercase\">\n <?php the_field('short_description');?>\n </p>\n <p class=\"precio lead text-center mb-0\">\n $ <?php the_field('price');?>\n\n </p>\n </div>\n </a>\n </div>\n </div>\n\n <?php endwhile; wp_reset_postdata(); ?>\n\n </div>\n </div>\n\n <?php\n}",
"function give_add_shortcode_to_publish_metabox() {\n\n\tif ( 'give_forms' !== get_post_type() ) {\n\t\treturn false;\n\t}\n\tglobal $post;\n\n\t//Only enqueue scripts for CPT on post type screen\n\tif ( 'give_forms' === $post->post_type ) {\n\t\t//Shortcode column with select all input\n\t\t$shortcode = sprintf( '[give_form id=\"%s\"]', absint( $post->ID ) );\n\t\tprintf(\n\t\t\t'<div class=\"misc-pub-section\"><button type=\"button\" class=\"button hint-tooltip hint--top js-give-shortcode-button\" aria-label=\"%1$s\" data-give-shortcode=\"%2$s\"><span class=\"dashicons dashicons-admin-page\"></span> %3$s</button></div>',\n\t\t\tesc_attr( $shortcode ),\n\t\t\tesc_attr( $shortcode ),\n\t\t\tesc_html__( 'Copy Shortcode', 'give' )\n\t\t);\n\t}\n\n}",
"function SYN_register_product_pillar_shortcode( $atts, $content = '' ) {\n\t$a = shortcode_atts( array(\n\t\t'icon' => '',\n 'title' => ''\n\t), $atts );\n\n // map of available icon names\n $icon_map = array(\n 'DESKTOP' => 'svg-desktop-computer',\n 'MOBILE' => 'svg-mobile-phone',\n 'SERVER' => 'svg-server-stack',\n 'CLIENT' => 'svg-person',\n 'RESEARCHER' => 'svg-researcher',\n 'PLUS' => 'svg-icon-plus',\n 'CLOUD' => 'svg-icon-cloud'\n );\n\n ob_start(); ?>\n <div class=\"product-pillar-feature\">\n <?php if (isset($icon_map[$a['icon']])): ?>\n <<?php echo $icon_map[$a['icon']]; ?>></<?php echo $icon_map[$a['icon']]; ?>>\n <?php endif; ?>\n <div class=\"feature-description\">\n <div class=\"title\"><?php echo $a['title']; ?></div>\n <div class=\"content\"><?php echo custom_filter_shortcode_text($content); ?></div>\n </div>\n </div>\n <?php\n\n\treturn ob_get_clean();\n}",
"function storms_wc_shipping_calculator_in_product_add_shortcode( $atts, $content = '' ) {\n\t\tif( !is_product() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( 'shortcode' !== get_option('wscip_position') ) {\n\t\t\treturn;\n\t\t}\n\n\t\tob_start();\n\t\tstorms_wc_shipping_calculator_in_product_load_html();\n\t\treturn ob_get_clean();\n\t}",
"function dm_product_news_shortcode($atts, $content = null) {\n\tglobal $post;\n\textract(shortcode_atts(array(\n\t\t'post_id' => ($post ? $post->ID : ''),\n\t\t'title' => \"In the News\",\n\t\t'limit' => 1,\n\t), $atts));\n\n\tif (!$post_id) {\n\t\treturn '';\n\t}\n\n\t$term_ids = dm_get_post_term_ids($post_id, 'products');\n\n\tif (empty($term_ids)) return '';\n\n\t$args = array(\n\t\t'post_status' => 'publish',\n\t\t'post_type' => 'post',\n\t\t'posts_per_page' => $limit,\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC',\n\t\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy' => 'products',\n\t\t\t\t'field' => 'id',\n\t\t\t\t'terms' => $term_ids,\n\t\t\t)\n\t\t),\n\t);\n\t$query = new WP_Query($args);\n\n\tif (!$query->have_posts()) return '';\n\n\tob_start();\n?>\n\t<div class=\"sidebar_news_excerpt\">\n\t\t<?php while($query->have_posts()): $query->the_post(); ?>\n\t\t\t<p>\n\t\t\t\t<strong><?php echo $title; ?>:</strong>\n\t\t\t\t<?php the_title(); ?>\n\t\t\t\t<a href=\"<?php the_permalink(); ?>\">READ MORE »</a>\n\t\t\t</p>\n\t\t<?php endwhile; ?>\n\t</div>\n<?php\n\t$output = ob_get_clean();\n\treturn $output;\n}",
"function bbp_register_shortcodes()\n{\n}",
"protected function register_shortcodes() {}",
"private function add_shortcodes() {\n\t\t// TODO: set tag in a constant\n \tadd_shortcode( 'obf_display_claimable_badge', array( $this, 'display_claimable_badge' ) );\n\t}",
"function su_widget_shortcode_support() {\n\n\tadd_filter('widget_text', 'do_shortcode');\n\n}",
"function sm_shortcode( $atts ) {\n\t$a = shortcode_atts( array(\n\t\t'post-id' => get_the_ID() ,\n\t\t'key' => '',\n\t\t'single' => false,\n ), $atts );\t\n \n return get_post_meta( $a[\"post-id\"], $a[\"key\"], $a[\"post-id\"] ) ;\n\n}",
"public function post_add_shortcode_button() {\r\n \r\n // Popup Variablese\r\n $pTitle = 'Add Shortcode';\r\n\r\n $buttonMarkup = '\r\n <a href=\"#TB_inline?width=400&inlineId='.$this->popupID.'&class=testest\" id=\"mssc-button\" class=\"button mssc-button thickbox\" title=\"'.$pTitle.'\">\r\n <span class=\"mssc-button-icon\"></span>\r\n Add Shortcode\r\n </a>\r\n ';\r\n \r\n return $buttonMarkup;\r\n }",
"public function wfc_shortcode_widget(){\n add_filter( 'widget_text', 'do_shortcode' );\n }",
"function Smart_AddOn_ShortcodeRegister() {\n require_once USAEV_SHORTCODES . 'smart-shortcodes.php';\n }",
"function hybrid_addons_add_shortcodes() {\n \n\tadd_shortcode( 'sidebar', 'hybrid_addons_get_sidebar' );\n\tadd_shortcode( 'widget','hybrid_addons_widget' );\n\n\tadd_shortcode( 'site-title','hybrid_addons_site_title' );\n\tadd_shortcode( 'rss','hybrid_addons_subscribe_rss' );\n\t\n\t// Allow [SHORTCODES] in Widgets\n\tadd_filter( 'widget_text', 'do_shortcode' );\n}",
"function show_additional_shortcode_help_for_form(){\r\n ?><span class=\"description\"><?php printf(__('%s - show cost hint for full booking in real time, depending on number of days selected and form elements.' ,'booking'),'<code>[cost_hint]</code>');?></span>\r\n <span class=\"description example-code\"><?php printf(__('Example: %sThe full cost of payment: %s' ,'booking'),'<div style=\"text-align:left;line-height:28px;\"><p>', '[cost_hint]</p></div>');?> </span><br/><?php\r\n ?><span class=\"description\"><?php printf(__('%s - show hint of original booking cost without additional costs for full booking in real time, depends only from days selection.' ,'booking'),'<code>[original_cost_hint]</code>');?></span>\r\n <span class=\"description example-code\"><?php printf(__('Example: %sThe original cost for payment: %s ' ,'booking'),'<div style=\"text-align:left;line-height:28px;\"><p>', '[original_cost_hint]</p></div>');?></span><br/><?php\r\n ?><span class=\"description\"><?php printf(__('%s - show cost hint of additional booking cost, which depends from selection of form elements.' ,'booking'),'<code>[additional_cost_hint]</code>');?></span>\r\n <span class=\"description example-code\"><?php printf(__('Example: %sThe additional cost for payment: %s ' ,'booking'),'<div style=\"text-align:left;line-height:28px;\"><p>', '[additional_cost_hint]</p></div>');?></span><br/><?php\r\n ?><span class=\"description\"><?php printf(__('%s - enter direct cost at admin panel at page: ' ,'booking'),'<code>[cost_corrections]</code>'); echo '\"'; _e(\"Add booking\" ,'booking'); echo '\". '; ?></span>\r\n <span class=\"description example-code\"><?php printf(__('Example: %s' ,'booking'), '[cost_corrections]');?></span><br/><?php\r\n //TODO: descriptin about these shortcodes: \r\n /*\r\n [deposit_hint] - show deposit cost, \r\n [balance_hint] - show balance cost, \r\n [check_in_date_hint] - check in date, \r\n [check_out_date_hint] - cehck out date, \r\n [start_time_hint] - start time, \r\n [end_time_hint] - end time, \r\n [selected_dates_hint] - all dates, \r\n [selected_timedates_hint] - all dates with times, \r\n [selected_short_dates_hint] - dates in \"short\" format, \r\n [selected_short_timedates_hint] - dates in \"short\" format with times,\r\n [days_number_hint] - number of selected days, \r\n [nights_number_hint] - number of selected nights (Business Medium/Large, MultiUser)\r\n */\r\n }",
"function m4_shortcode_init(){\n add_shortcode( 'm4_item', 'm4_shortcode_register' );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns description of get_dashboard_blocks result values. | public static function get_dashboard_blocks_returns() {
return new external_single_structure(
array(
'blocks' => new external_multiple_structure(self::get_block_structure(), 'List of blocks in the dashboard.'),
'warnings' => new external_warnings(),
)
);
} | [
"public static function get_blocks_returns() {\n return new external_multiple_structure(new external_value(PARAM_ALPHANUMEXT, 'A list of blocks.'));\n }",
"public function getBlocksData()\n {\n return $this->blocks_data;\n }",
"public function getBlocks();",
"public static function get_course_blocks_returns() {\n\n return new external_single_structure(\n array(\n 'blocks' => new external_multiple_structure(self::get_block_structure(), 'List of blocks in the course.'),\n 'warnings' => new external_warnings(),\n )\n );\n }",
"public function getBlocks() {\r\n $ret = array();\r\n $groups = array(0);\r\n try {\r\n $roles = Zoo::getService('user')->getCurrentUser()->getGroups();\r\n $groups = array_keys($roles);\r\n }\r\n catch (Zoo_Exception_Service $e) {\r\n // Do nothing\r\n }\r\n \r\n $cacheid = str_replace(array(\"/\", \"?\", \"=\", \"&\", \"-\", '.'), \"_\", \"Flex_blocks_page\".Zend_Controller_Front::getInstance()->getRequest()->getRequestUri().\"_\".implode(\"_\", $groups));\r\n try {\r\n $ret = Zoo::getService(\"cache\")->load($cacheid);\r\n }\r\n catch (Zoo_Exception_Service $e) {\r\n // @todo: Remove this comment: I'm beginning to tire of writing try-catch for services\r\n }\r\n if (!$ret) {\r\n $ret = $this->fetchFromDb();\r\n try {\r\n Zoo::getService('cache')->save($ret, $cacheid, array(), null);\r\n }\r\n catch (Zoo_Exception_Service $e) {\r\n // No caching available\r\n }\r\n }\r\n // Return array ordered by block position\r\n return $ret;\r\n }",
"public function get_block()\n {\n \tglobal $charset;\n \t$column = 2;\n \t$data = array();\n $content = $this->get_content_html();\n \t$html = '\n \t <div class=\"panel panel-default\" id=\"intro\">\n \t <div class=\"panel-heading\">'.get_lang('GlobalPlatformInformation').'\n \t <div class=\"pull-right\"><a class=\"btn btn-danger btn-xs\" onclick=\"javascript:if(!confirm(\\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\\')) return false;\" href=\"index.php?action=disable_block&path='.$this->path.'\">\n \t <em class=\"fa fa-times\"></em>\n \t </a></div>\n \t </div>\n \t <div class=\"panel-body\">\n \t '.$content.'\n \t </div>\n \t </div>\n \t\t\t';\n \t$data['column'] = $column;\n \t$data['content_html'] = $html;\n\n \treturn $data;\n }",
"public function availableBlocks(): array\n {\n return Billingo::get('invoices/blocks');\n }",
"public function get_block()\n {\n\n global $charset;\n $column = 2;\n $data = array();\n $content = $this->get_content_html();\n $html = '<div class=\"panel panel-default\" id=\"intro\">\n\t\t <div class=\"panel-heading\">' . get_lang('GradebookAndAttendances') . '\n\t\t <div class=\"pull-right\"><a class=\"btn btn-danger btn-xs\" onclick=\"javascript:if(!confirm(\\'' . addslashes(\n api_htmlentities(\n get_lang('ConfirmYourChoice'),\n ENT_QUOTES,\n $charset\n )\n ) . '\\')) return false;\" href=\"index.php?action=disable_block&path=' . $this->path . '\">\n <em class=\"fa fa-times\"></em>\n </a></div>\n\t\t </div>\n\t\t <div class=\"panel-body\">\n\t\t ' . $content . '\n\t\t </div>\n\t\t </div>\n\t\t\t\t';\n $data['column'] = $column;\n $data['content_html'] = $html;\n\n return $data;\n }",
"public function getBlockDescriptions()\n {\n return $this->blockDescriptions;\n }",
"public function dataProviderForTestGetBlocks()\n {\n return [\n [\n 1,\n 1,\n null,\n true\n ],\n [\n 1,\n 1,\n 0,\n true\n ],\n [\n 1,\n 1,\n 1,\n true\n ],\n [\n 1,\n 1,\n 999,\n false\n ],\n [\n 999,\n 1,\n null,\n false\n ],\n [\n 1,\n 999,\n null,\n false\n ],\n ];\n }",
"public function get_block() {\n \t\n \tglobal $charset;\n \t \t\n \t$column = 1;\n \t$data = array();\n\t\t\n\t\t/*if (api_is_platform_admin()) {\n\t\t\t$teacher_content_html = $this->get_teachers_content_html_for_platform_admin();\n\t\t} else if (api_is_drh()) {*/\n\t\t\t$teacher_information_graph = $this->get_teachers_information_graph();\n\t\t//}\n\t\t\n\t\t$html = ' \t\t\n\t\t\t <li class=\"widget color-blue\" id=\"intro\">\n\t\t\t <div class=\"widget-head\">\n\t\t\t <h3>'.get_lang('TeachersInformationsGraph').'</h3>\n\t\t\t <div class=\"widget-actions\"><a onclick=\"javascript:if(!confirm(\\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\\')) return false;\" href=\"index.php?action=disable_block&path='.$this->path.'\">'.Display::return_icon('close.gif',get_lang('Close')).'</a></div>\n\t\t\t </div>\n\t\t\t <div class=\"widget-content\" align=\"center\">\n\t\t\t \t<div style=\"padding:10px;\"><strong>'.get_lang('TimeSpentOnThePlatformLastWeekByDay').'</strong></div>\n\t\t\t\t\t\t\t\t'.$teacher_information_graph.'\n\t\t\t </div>\n\t\t\t </li>\t\t \t\t\t \n\t\t\t\t'; \n \t\n \t$data['column'] = $column;\n \t$data['content_html'] = $html;\n \t \t \t \t\n \treturn $data; \t \t\n \t\n }",
"function _dvbanner_block_list () {\n // we stored our block region at {dvbanner_block}\n $q = db_query (\n \"SELECT delta, title FROM {dvbanner_block} ORDER BY delta\"\n );\n\n while ($v = db_fetch_object ($q)) {\n $blocks[$v->delta] = array (\n 'info' => '[BANNER] '.$v->title\n );\n }\n\n return $blocks;\n}",
"function clleague_block_info() {\n\t// This hook returns an array, each component of which is an array of block\n\t// information. The array keys are the 'delta' values used in other block\n\t// hooks.\n\n\t// The required block information is a block description, which is shown\n\t// to the site administrator in the list of possible blocks. You can also\n\t// provide initial settings for block weight, status, etc.\n\n\t// This sample shows how to provide default settings. In this case we'll\n\t// enable the block in the first sidebar and make it visible only on\n\t// 'node/*' pages. See the hook_block_info() documentation for these.\n \n\t$blocks['user_menu'] = array(\n\t\t'info' => t('User menu'),\n\t);\n \t\n\treturn $blocks;\n}",
"public function getBlocksJson()\r\n {\r\n $blocks = Mage::helper('mageworx_ordersedit/edit')->getAvailableBlocks();\r\n return Zend_Json::encode($blocks);\r\n }",
"public function getBlocks() : array\n\t{\n\t\tstatic $blocks = [];\n\n\t\tif (!$blocks) {\n\t\t\t$blocks = $this->app->cache->get('blocks');\n\t\t}\n\n\t\treturn $blocks;\n\t}",
"public function getPageBlocksData()\n {\n $initialLanguage = $this->language;\n\n // remove the already rendered blocks\n $this->shortcodeParser->resetRenderedBlocks();\n\n // create the structure of page blocks data for each language\n $pageBlocks = [];\n foreach (phpb_active_languages() as $languageCode => $languageTranslation) {\n $this->setLanguage($languageCode);\n\n // for the current language build up a structure of rendered versions and use the stored data for the other languages\n if ($languageCode === $initialLanguage) {\n $this->renderBody();\n $pageBlocks[$languageCode] = $this->shortcodeParser->getRenderedBlocks()[$languageCode] ?? [];\n } else {\n $pageBlocks[$languageCode] = $this->pageBlocksData;\n }\n\n if (empty($pageBlocks[$languageCode])) {\n $pageBlocks[$languageCode] = null;\n }\n }\n\n // revert to initial language\n $this->setLanguage($initialLanguage);\n\n // return the rendered html and settings for each block\n return $pageBlocks;\n }",
"public function get_block()\n {\n \tglobal $charset;\n \t$column = 1;\n \t$data = array();\n\n $student_content_html = $this->get_students_content_html_for_drh();\n\t\t$html = '<div class=\"panel panel-default\" id=\"intro\">\n <div class=\"panel-heading\">\n '.get_lang('StudentsInformationsList').'\n <div class=\"pull-right\"><a class=\"btn btn-danger btn-xs\" onclick=\"javascript:if(!confirm(\\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\\')) return false;\" href=\"index.php?action=disable_block&path='.$this->path.'\">\n <em class=\"fa fa-times\"></em>\n </a>\n </div>\n </div>\n <div class=\"panel-body\">\n '.$student_content_html.'\n </div>\n </div>';\n \t$data['column'] = $column;\n \t$data['content_html'] = $html;\n \treturn $data;\n }",
"function getBlocks()\n {\n global $application;\n\n $blocks = $this->YAMLblocks2array($this->getData(PATH_SYSTEM_DATA.'system_blocks.yml'));\n $mm = &$application->getInstance('Modules_Manager');\n $mmBlocks = $mm->getYAMLBlocksList();\n if(empty($mmBlocks))\n {\n // just for trunk\n _fatal('YAML blocks are not found. Clear all cache and reinstall all modules.');\n }\n else\n {\n foreach($mmBlocks as $path)\n foreach($this->YAMLblocks2array($this->getData($path)) as $mmb)\n $blocks[] = $mmb;\n }\n\n return $blocks;\n }",
"public static function get_dashboard_blocks($userid = 0, $returncontents = false) {\n global $CFG, $USER, $PAGE;\n\n require_once($CFG->dirroot . '/my/lib.php');\n\n $warnings = array();\n $params = self::validate_parameters(self::get_dashboard_blocks_parameters(),\n ['userid' => $userid, 'returncontents' => $returncontents]);\n\n $userid = $params['userid'];\n if (empty($userid)) {\n $userid = $USER->id;\n }\n\n if ($USER->id != $userid) {\n // We must check if the current user can view other users dashboard.\n require_capability('moodle/site:config', context_system::instance());\n $user = core_user::get_user($userid, '*', MUST_EXIST);\n core_user::require_active_user($user);\n }\n\n $context = context_user::instance($userid);;\n self::validate_context($context);\n\n // Get the My Moodle page info. Should always return something unless the database is broken.\n if (!$currentpage = my_get_page($userid, MY_PAGE_PRIVATE)) {\n throw new moodle_exception('mymoodlesetup');\n }\n\n $PAGE->set_context($context);\n $PAGE->set_pagelayout('mydashboard');\n $PAGE->set_pagetype('my-index');\n $PAGE->blocks->add_region('content'); // Need to add this special regition to retrieve the central blocks.\n $PAGE->set_subpage($currentpage->id);\n\n // Load the block instances in the current $PAGE for all the regions.\n $returninvisible = has_capability('moodle/my:manageblocks', $context) ? true : false;\n $allblocks = self::get_all_current_page_blocks($returninvisible, $params['returncontents']);\n\n return array(\n 'blocks' => $allblocks,\n 'warnings' => $warnings\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restores the where conditions which may have been overwritten by previous db layer operations | private function restoreWhere($where){
if(is_array($where)){
foreach($where as $condition){
if($condition[0] == 'AND')
$this->dbobject->where($condition[2], $condition[1]);
elseif($condition[0] == 'OR')
$this->dbobject->where($condition[2], $condition[1]);
}
}
} | [
"public function reset_where()\n\t{\n\t\tlist ( $this->wheres, $this->bindings ) = array (\n\t\t\t\t[ ],\n\t\t\t\t[ ]\n\t\t);\n\t}",
"public function resetWhere()\n\t{\n\t\t$this->wheres = array();\n\t\t$this->bindings = array();\n\t}",
"function clearFilters() {\n $this->_query->reset('where');\n }",
"public function cleanForcedWhereClauses() {\n $this->_clauses = [];\n $this->_clausesRaw = [];\n return $this;\n }",
"public function resetWhere()\n {\n $this->where = array();\n return $this;\n }",
"public function unset_where()\n\t{\n\t\t$this->where = null;\n\t}",
"private function applyWhereClauses() {\n if (!count($this->whereClauses)) {\n return;\n }\n\n $whereStrings = [];\n foreach ($this->whereClauses as $clause) {\n $placeholder = is_null($clause[2]) ? 'null' : '?';\n $whereStrings[] = \"$this->table.$clause[0] $clause[1] $placeholder\";\n if (!is_null($clause[2])) {\n $this->bindingParams[] = $clause[2];\n }\n }\n\n $this->query .= ' where '.implode(' and ', $whereStrings);\n }",
"public function db_where() { return null; }",
"public function clearConditions() {\n $this->conditions = array();\n }",
"public function resetConditions() {\n $this->conditions = array();\n $this->relationConditions = array();\n $this->queryConditions = array();\n $this->conditionPriceFrom = null;\n $this->conditionPriceTo = null;\n $this->products = null;\n }",
"public function clear_sql_values(){\r\n $this->where_conditions=NULL;\r\n $this->table =NULL;\r\n $this->cols = NULL;\r\n return true;\r\n}",
"protected function _prepareWhere()\n\t{\n\t\tif ($this->_where) {\n\t\t\t$where = $this->_where->prepare($this, 'where', array(), $this->_sql, $this->_resultHandler);\n\t\t\tif ($where->hasValue()) {\n\t\t\t\t$this->_sql->addCondition($where->sql());\n\t\t\t}\n\t\t}\n\t}",
"public function clearWhere() {\n $this->where = '';\n return $this;\n }",
"protected function resetQuery()\n {\n $this->select = null;\n $this->join = null;\n $this->where = null;\n $this->filter = null;\n $this->orderBy = null;\n $this->groupBy = null;\n $this->withCount = null;\n $this->limit = null;\n //do NOT reset ->with here, we do it in mergeWiths properly\n }",
"protected function setConditions()\n {\n\n $this->model = $this->model->where(function ($q) {\n foreach ($this->columns as $key => $column) {\n\n $columnName = $column['data'];\n $modelColumn = $this->modelColumns[$columnName] ?? null;\n\n if ($modelColumn) {\n $finalColumn = [\n 'condition' => $modelColumn['condition'] ?? self::WHERE_CONDITION,\n 'operator' => $modelColumn['operator'] ?? self::EQ_OPERATOR,\n 'search_type' => $modelColumn['search_type'] ?? self::SEARCH_TEXT,\n 'model_column' => $modelColumn['model_column'],\n ];\n\n //Sets order by columns\n $this->setOrder($key, $finalColumn);\n\n if (!empty($column['searchable']) && $column['searchable'] == 'true' && !empty($this->searchValue)) {\n\n $date = $this->getDate();\n\n $searchValue = $this->filterSearchValue($finalColumn['operator']);\n $operator = $this->getMatchingOperator($finalColumn['operator']);\n\n //Check the type of condition\n switch ($finalColumn['condition']) {\n\n case self::WHERE_CONDITION:\n //Verify is the column name is in the name of date accepted array\n if ($date && in_array($columnName, self::DATE_NAME_LIST)) {\n $q->orWhereBetween($finalColumn['model_column'], $date);\n } elseif (!$date) {\n $q->orWhere($finalColumn['model_column'], $operator,\n $searchValue);\n }\n break;\n\n case self::HAVING_CONDITION:\n\n $q->having($finalColumn['model_column'], $operator, $searchValue);\n\n break;\n }\n\n }\n\n }\n }\n\n if (!empty($this->filters)) {\n\n foreach ($this->filters as $key => $filter) {\n $condition = $filter['condition'] ?? self::WHERE_CONDITION;\n\n //Check the type of condition\n if ($condition === self::WHERE_CONDITION) {\n\n switch ($filter['operator']) {\n case DataTableAdapter::BETWEEN_OPERATOR:\n $q->whereBetween($filter['column'], $filter['value']);\n break;\n case DataTableAdapter::IS_NULL:\n $q->whereNull($filter['column']);\n break;\n\n case DataTableAdapter::IS_NOT_NULL:\n $q->whereNotNull($filter['column']);\n break;\n\n case DataTableAdapter::LIKE_LOOSE_OPERATOR:\n $value = '%' . $filter['value'] . '%';\n $q->where($filter['column'], 'LIKE', $value);\n break;\n default:\n $q->where($filter['column'], $filter['value']);\n break;\n }\n\n unset($this->filters[$key]);\n }\n }\n }\n\n return $q;\n });\n\n //adding having conditions\n foreach ($this->filters as $key => $filter) {\n\n if (isset($filter['condition']) && $filter['condition'] === self::HAVING_CONDITION) {\n $this->model = $this->model->having($filter['column'], $filter['operator'] ?? self::EQ_OPERATOR,\n $filter['value']);\n }\n\n unset($this->filters[$key]);\n }\n }",
"protected function setWhereValues()\n {\n $translator = $this->connection->getTypeTranslator();\n \n foreach ($this->whereClauses->getArrayReference() as $whereClause)\n {\n $value = $whereClause->getValue();\n \n if (is_array($value))\n {\n foreach ($value as $singleValue)\n $this->sqlCommand->addParam($whereClause->getIdentifier(), $translator->getSqlParameterDataType($singleValue), $singleValue);\n }\n else\n {\n $this->sqlCommand->addParam($whereClause->getIdentifier(), $translator->getSqlParameterDataType($value), $value);\n }\n }\n \n $this->whereClauses = new IndexedCollection();\n }",
"protected function removeFirstWhereClause()\n {\n $first = array_shift ( $this->getBaseQuery ()->wheres );\n return $this->removeWhereBinding ( $first );\n }",
"protected function getGeneralWhereClause() {}",
"protected function prepareQueryWithObjectsNeedingUpdate()\n {\n return $this->obj->newQuery()\n ->where($this->getSequenceConfig('fieldName'), '>', $this->obj->{$this->getSequenceConfig('fieldName')});\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the DOMXPath query string used to retrieve the url n value from the results | protected function getUrlNQuery()
{
return $this->urlNQuery;
} | [
"public function getUrlN()\n {\n if (! isset($this->urlN)) {\n $this->urlN = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getUrlNQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->urlN;\n }",
"public function getUrlQ();",
"function urlToXpath($query, $query_parts, $isGet) {\r\n\tforeach(range(0,sizeof($query_parts)-2+$isGet) as $i){\r\n\t\t\r\n\t\tif (is_numeric($query_parts[$i]) or preg_match('/^%22.*%22$/', $query_parts[$i])){\r\n\t\t\t$query = urlToXpathPart($query, \"=\", $query_parts, $i);\r\n\t\t\t\r\n\t\t\t$queryPart = explode($query_parts[$i-1],$query)[0];\r\n\t\t\t$pos = strpos($query, '/', strlen($queryPart)-1);\r\n\t\t\t$query[$pos] = \"[\";\r\n\t\t}\r\n\t\telse if(preg_match('/.*%3E.*/', $query_parts[$i]))\r\n\t\t\t$query = urlToXpathPart($query, \"[\", $query_parts, $i);\r\n\t\telse if(preg_match('/.*%3C.*/', $query_parts[$i]))\r\n\t\t\t$query = urlToXpathPart($query, \"[\", $query_parts, $i);\r\n\t}\r\n\t$query = str_replace(\"%22\",\"\\\"\",$query);\r\n\t$query = str_replace(\"%20\",\" \",$query);\r\n\t$query = str_replace(\"%3E\",\">\",$query);\r\n\t$query = str_replace(\"%3C\",\"<\",$query);\r\n\t\r\n return $query;\r\n}",
"function getURLQuery($xmlFile){\n\tif($xmlFile == \"\")\treturn \"\";\n\t$xmlFile = simplexml_load_file($xmlFile);\n\t$data = array();\n\tforeach ($xmlFile->Parameter as $parameter)\n\t\t$data[(string)$parameter['id']] = (string)$parameter;\n\t$query = http_build_query($data);\n\tif($query == false && count($xmlFile->Parameter) > 0){\n\t\techo \"ERROR: Failed to build query. Most likely something wrong with XML File.\\n\";\n\t\tdie;\n\t}\n\treturn $xmlFile->URL . '?' . $query;\n}",
"public function getQueryURL() {\n return $this->QUERY_URL;\n }",
"public function getUrl()\n {\n $separator = Mage::helper('oggetto_filter/data')->getSeparator();\n\n $requestVarName = $this->getFilter()->getRequestVar();\n $requestValue = $this->getValue();\n $requestValueFromUrl = Mage::app()->getRequest()->getParam($requestVarName);\n if ($requestValueFromUrl) {\n $requestVarValue = $requestValueFromUrl . $separator . $requestValue;\n } else {\n $requestVarValue = $requestValue;\n }\n\n $query = array(\n $requestVarName => $requestVarValue,\n Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls\n );\n return Mage::getUrl('*/*/*',\n array('_current' => true, '_use_rewrite' => true, '_query' => $query));\n }",
"protected function getUrlCQuery()\n {\n return $this->urlCQuery;\n }",
"protected function createQueryUrlString() {\n $storeId = $this->getStoreId();\n $checkoutSessionId = $this->getCheckoutSessionId();\n $urlQuery = '?d='.$storeId.'&s='.$checkoutSessionId;\n\n return $urlQuery;\n }",
"public function getQueryUrl()\n {\n\n $uri = Zend_Gdata_Gapps::APPS_BASE_FEED_URI;\n $uri .= Zend_Gdata_Gapps::APPS_GROUP_PATH;\n $uri .= '/' . $this->_domain;\n\n if ($this->_groupId !== null) {\n $uri .= '/' . $this->_groupId;\n }\n\n if(array_key_exists('member', $this->_params)) {\n $uri .= '/';\n }\n\n $uri .= $this->getQueryString();\n return $uri;\n }",
"public function getSearchResultsPageUrl()\n {\n return $this->getBaseUrl() . $this->getFaqRoute() . '/' . self::FAQ_SEARCH_ROUTE;\n }",
"public function getXpath()\n {\n return $this->xpath;\n }",
"public function getUrlElement($index, $retval = NULL) {\n $index = (int)$index;\n\n if (isset($this->url_elements[$index])) {\n $retval = $this->url_elements[$index];\n }\n\n return $retval;\n }",
"public function getPageURL($number);",
"public function getPageUrl();",
"public function getURLQuery()\n\t\t{\n\t\t\treturn $this->urlQuery;\n\t\t}",
"function get_request_url() {\n $endpoint = $this->get_endpoint();\n if (is_null($endpoint) || $enpoint = '') {\n throw new EndpointNuloException(\"Falta endpoint para Consulta\", 1);\n }\n\n //PDF return $endpoint . 'numerodocumento=' . str_replace(' ', '+', $_GET['id']) . '-I.pdf';\n $urlconsulta = $endpoint . '&numero_documento=' . str_replace(' ', '+', $_GET['numerodocumento'].'-APN-'.str_replace('#', '%23',$_GET['filtroc']));\n\n return $urlconsulta;\n\n }",
"function getURL() {\n if ($this->getSQLname()!=\"\")\n $ret=$this->name.\"=\".$this->getValue();\n else $ret=\"\"; //getSQLName returns a null value when the element isn't to be stored in the db. I.e.: a preview button\n return $ret;\n }",
"private function get_next_url($dom) {\n $xpath = new DOMXPath($dom);\n $xpath->registerNamespace('atom', self::$ATOM_NS);\n return $xpath->evaluate('string(/atom:feed/atom:link[@rel=\"next\"]/@href)');\n }",
"function queryString($medium, $titleType, $venue, $authorType, $pid){\n if ($venue != \"\"){\n return \"//dblpperson/r/{$medium}[{$titleType}/text()=\\\"{$venue}\\\"]/{$authorType}[@pid=\\\"{$pid}\\\"]\";\n }\n else {\n return \"//dblpperson/r/{$medium}/{$authorType}[@pid=\\\"{$pid}\\\"]\";\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new reversalIndicator If true, indicates a request to reverse a credit authorization. | public function setReversalIndicator($reversalIndicator)
{
$this->reversalIndicator = $reversalIndicator;
return $this;
} | [
"public function setReversal($reversal)\n {\n $this->reversal = $reversal;\n\n return $this;\n }",
"public function setTransferReversal(?string $transferReversal): self\n {\n $this->transferReversal = $transferReversal;\n\n return $this;\n }",
"public function setRefrigerationIndicator($refrigerationIndicator)\n {\n $this->refrigerationIndicator = $refrigerationIndicator;\n return $this;\n }",
"public function setRefrigerationIndicator($value)\n {\n if (!is_bool($value)) {\n throw new \\Exception('Cannot set the refrigeration indicator without a boolean type value.');\n }\n\n $this->refrigerationIndicator = $value;\n }",
"public function setIsOriginalIndicator($isOriginalIndicator)\n {\n $this->isOriginalIndicator = $isOriginalIndicator;\n return $this;\n }",
"public function setIndicator($indicator)\n {\n $this->indicator = $indicator;\n return $this;\n }",
"public function setRoutedExportTransactionIndicator($routedExportTransactionIndicator)\n {\n $this->routedExportTransactionIndicator = $routedExportTransactionIndicator;\n return $this;\n }",
"public function reversalType()\n {\n $value = ReversalType::RT_CREDIT;\n $this->payment->setReversaltype($value);\n\n $this->assertEquals($value, $this->payment->getReversaltype());\n }",
"public function setReverse($var)\n {\n GPBUtil::checkBool($var);\n $this->reverse = $var;\n\n return $this;\n }",
"public function reverse($flag = true) {\n\t\t$this->reverse = (boolean) $flag;\n\t\treturn $this;\n\t}",
"public function setReverse(bool $value = TRUE) : self\r\n {\r\n $this->reverse = $value;\r\n return $this;\r\n }",
"public function setBackOrderAllowedIndicator($backOrderAllowedIndicator)\n {\n $this->backOrderAllowedIndicator = $backOrderAllowedIndicator;\n return $this;\n }",
"public function payment_status_canceled_reversal()\n {\n do_action(\n 'wc_paypal_plus__ipn_payment_update',\n 'canceled_reversal',\n $this->settingRepository\n );\n }",
"public function setResidentialAddressIndicator($value)\n {\n if (!is_bool($value)) {\n throw new \\Exception('The residential address indicator expects a boolean value.');\n }\n\n $this->residentialAddressIndicator = $value;\n }",
"public function setIteneraryNonRefundableIndicator(bool $value): self\n {\n $this->IteneraryNonRefundableIndicator = $value;\n\n return $this;\n }",
"public function setIndicatorString($indicatorString)\n {\n $this->indicatorString = $indicatorString;\n return $this;\n }",
"public function setRateIndicator($rateIndicator)\n {\n $this->rateIndicator = $rateIndicator;\n return $this;\n }",
"public function setOneWayIndicator($oneWayIndicator)\n {\n $this->oneWayIndicator = $oneWayIndicator;\n return $this;\n }",
"public function setNonRefundableIndicator($nonRefundableIndicator)\n {\n $this->nonRefundableIndicator = $nonRefundableIndicator;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
addValues_Data adds values from a given data array | public function addValues_Data($data)
{
// data array keys are actual field names
foreach ($this->options['FIELDS'] as $key=>$value)
{
if (isset($value['DB_FIELD']))
{
if (isset($data[$value['DB_FIELD']]))
{
$this->options['FIELDS'][$key]['VALUE'] = $data[$value['DB_FIELD']];
}
else
{
// When there is a NULL value in the field
$this->options['FIELDS'][$key]['VALUE'] = '';
}
}
}
} | [
"public function insertValuesArray($data)\n {\n \tif (is_array($data))\n \t{\n\t \tforeach ($data as $name=>$value)\n\t \t{\n\t\t \t$this->insertValue($name,$value);\n\t \t}\n \t}\n }",
"public function add_values(array $xvalues) {\n \n }",
"public function addData($data) ;",
"public function addAll($data);",
"public function add_data();",
"public function addPostFieldArray($data)\n\t{\n\t\t$this->fmxFieldDataArray = array_merge($this->fmxFieldDataArray, $data);\n\t}",
"public function addData($data){\n $this->data[] = $data;\n }",
"public function addData($chartdata){\n if(!is_array($chartdata)){\n die(\"HighRoller::addData() - data format must be an array.\");\n }\n $this->series = array($chartdata);\n }",
"public function add($data)\n\t{\n\t\t$tmpData = array();\n\t\t\n\t\t// Check for every field to handle empty ones\n\t\tforeach($this->tableFields as $field)\n\t\t{\n\t\t\tif(!empty($data[$field]))\n\t\t\t\t$tmpData[$field] = $data[$field];\n\t\t\telse\n\t\t\t\t$tmpData[$field] = null; // May change later?\t\t\t\n\t\t}\n\t\t\n\t\t// Auto Increment ID\n\t\t$tmpData['id'] = $this->data[count($this->data)-1]['id'] + 1; // Latest id + 1\n\t\t\n\t\t$this->data[] = $tmpData;\n\t\t\n\t\t$this->save();\n\t}",
"protected function addFieldsToData () {\n\t\t$addFields = array_flip(t3lib_div::trimExplode(',', $this->conf['addFieldsToData']));\n\t\t$this->cObj->data = t3lib_div::array_merge_recursive_overrule(\n\t\t\t$this->cObj->data,\n\t\t\t$addFields\n\t\t);\n\t}",
"public function add($data){\n $this->data[] = $data;\n }",
"function addChartDataFromArray($dataArray, $dataCatArray=\"\"){\r\n\t\tif(is_array($dataArray)){\r\n\t\t\tif ($this->seriesType==1){\r\n\t\t\t # Array for Single series charts\r\n\t\t\t # aa[..][..]=\"label\" aa[..][..]=\"Value\"\r\n\t\t\t foreach($dataArray as $arrayvalue){\r\n\t\t\t\t if(is_array($arrayvalue)){\r\n\t\t\t\t $this->addChartData($arrayvalue[1],\"label=\" . $arrayvalue[0] );\t \r\n\t\t\t\t }\r\n\t\t\t } \t\t\r\n\t\t\t}else{\r\n\t\t\t # Array for Multi series charts\r\n\t\t\t if(is_array($dataCatArray)){\r\n\t\t\t\t foreach($dataCatArray as $value){\r\n\t\t\t\t \t # Add category\r\n\t\t\t\t\t $this->addCategory($value);\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t # Add data to the chart by creating Datasets\r\n\t\t\t foreach($dataArray as $arrayvalue){\r\n\t\t\t if(is_array($arrayvalue)){\r\n\t\t\t\t $i=0;\r\n\t\t\t\t $aaa[0]=\"\"; $aaa[1]=\"\";\r\n\t\t\t\t foreach($arrayvalue as $value){\r\n\t\t\t\t if($i>=2){\r\n\t\t\t\t\t \t$this->addChartData($value);\r\n\t\t\t\t\t }else{\r\n\t\t\t\t\t $aaa[$i]=$value;\r\n\t\t\t\t\t }\t\t\t\t \t\t\t\t\t\r\n\t\t\t\t if($i==1){\r\n\t\t\t\t\t $this->addDataset($aaa[0],$aaa[1]);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t $i++;\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t } \r\n\t\t\t }\r\n\t\t\t}\r\n\t\t}\t\r\n\t }",
"public function addSolarData($data) \n\t{\n\t\tif (is_array($data)) {\n\t\t\t$this->data_array = $data;\n\t\t\t$this->bool_data = true;\n\t\t}\n\t\telse {\n\t\t\t$this->error[] = \"addSolarData: Invalid solar data added.\";\n\t\t\treturn;\n\t\t}\n\t}",
"private function add_data($table, $data)\n\t{\n\t\t// Deal with data\n\t\tif( ! is_array($data) )\n\t\t{\n\t\t\texit($table . ': data must be defined as an associative array');\n\t\t}\n\n\t\tforeach($data as $d_id => $d)\n\t\t{\n\t\t\tif( ! is_array($d) )\n\t\t\t{\n\t\t\t\techo \"Oops, you data must be defined as an array...\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\n\t\t\t$columns = $this->db->list_fields($table);\n\n\t\t\t$is_assoc = (is_array($d) AND ( ! count($d) OR count(array_filter(array_keys($d),'is_string')) == count($d)));\n\n\t\t\t// Handle associative arrays\n\t\t\tif($is_assoc)\n\t\t\t{\n\t\t\t\t$d['id'] = $d_id;\n\t\t\t\t\n\t\t\t\t// serialize nested arrays\n\t\t\t\tforeach($d as $k => & $v) if(is_array($v)) $v = serialize($v);\n\t\t\t\t\n\t\t\t\t$this->db->insert($table, $d);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Handle non-associative arrays\n\n\t\t\t$insert = array();\n\n\t\t\tforeach($columns as $i => $k)\n\t\t\t{\n\t\t\t\tif($k == 'id')\n\t\t\t\t{\n\t\t\t\t\tunset($columns[$i]);\n\t\t\t\t\t$insert['id'] = $d_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$columns = array_values($columns);\n\n\t\t\tforeach($columns as $i => $k)\n\t\t\t{\n\t\t\t\tif(isset($d[$i]))\n\t\t\t\t{\n\t\t\t\t\t$insert[$k] = $d[$i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->db->insert($table, $insert);\n\n\t\t}\n\t}",
"protected function addValues($source)\r\n {\r\n $s = $source[0];\r\n\r\n if($this->isValidSourceOf($s))\r\n {\r\n $this->beginUpdate();// $this->before $this->Clear\r\n $this->clear();\r\n\r\n if($this->function == null)\r\n {\r\n // \"Copy Function\", copy values...\r\n if($this->yMandatory != $s->yMandatory)// $Dec03 #1274\r\n {\r\n $this->vxValues->dateTime = $s->vyValues->dateTime;\r\n $this->vyValues->dateTime = $s->vxValues->dateTime;\r\n }\r\n else\r\n {\r\n $this->vxValues->dateTime = $s->vxValues->dateTime;\r\n $this->vyValues->dateTime = $s->vyValues->dateTime;\r\n }\r\n\r\n $this->addValuesFrom($s);\r\n }\r\n else\r\n {\r\n $this->vxValues->dateTime = $s->vxValues->dateTime;\r\n $this->vyValues->dateTime = $s->vyValues->dateTime;\r\n $this->function->addPoints($source);// $this->calculate $this->function\r\n }\r\n\r\n $this->endUpdate();\r\n }\r\n }",
"protected function addData($array)\n\t\t{\n\t\t\tif (is_array($array))\n\t\t\t{\n\t\t\t\tif ($this->is_single($array)&& is_array($this->dataView))\n\t\t\t\t{\n\t\t\t\t\t$this->dataView=array_merge($this->dataView,$array);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->dataTable=$array;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dataView=$array;\n\t\t\t}\n\t\t}",
"public static function batchAdd($data)\n {\n if (empty($data)) {\n return false;\n }\n\n $command = Yii::$app->db->createCommand();\n\n $fields = ['statistical_data_set_id', 'attr_1_val', 'attr_2_val', 'attr_3_val', 'attr_4_val', 'attr_5_val', 'timestamp'];\n $values = [];\n\n $attrs = ['attr_1_val', 'attr_2_val', 'attr_3_val', 'attr_4_val', 'attr_5_val'];\n\n foreach ($data as $statData) {\n if (!isset($statData['_data_set']) || !isset($statData['_timestamp'])) {\n continue;\n }\n\n $value = [];\n $value[] = $statData['_data_set'];\n foreach ($attrs as $attr) {\n if (isset($statData[$attr])) {\n $value[] = $statData[$attr];\n } else {\n $value[] = null;\n }\n }\n $value[] = $statData['_timestamp'];\n $values[] = $value;\n }\n\n return $command->batchInsert(self::tableName(), $fields, $values)->execute();\n }",
"function add_rows($data,$params=array())\n\t{\n\t\tfor($d=0;$d<count($data);$d++)\n\t\t{\n\t\t\t$this->add_row($data[$d]);\n\t\t}\n\t}",
"function intarray_add(&$intarray, $value) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test invalid algorithm gagal. | public function testInvalidAlgorithm()
{
try {
$encoded = JWT::encode(['foo' => 'bar'], 'secret', 'RS256'); // unsupported algo
} catch (\Throwable $e) {
$this->assertTrue(false !== strpos($e->getMessage(), 'Only these algorithm are supported:'));
} catch (\Exception $e) {
$this->assertTrue(false !== strpos($e->getMessage(), 'Only these algorithm are supported:'));
}
} | [
"public function testRejectsUnencodedGridDuringStaticCheck(): void\n\t{\n\t\t$this->expectException(GRidException::class);\n\t\tGRid::checkGRid($this->goodGRidsUnencoded()[0]);\n\t}",
"function check_ElG_correctness($lambda, $r) {\n\t//Generate a somewhat proper parameter q, with |q| >= lambda\n\t$safe_primes = get_safe_primes(pow(2, $lambda+1), $r);\n\t$q = $safe_primes[count($safe_primes)-1][1];\n\n\t$Zq = range(0, $q-1);\n\tforeach($Zq as $x) {\n\t\tif(_DEBUG >= 2) echo \"Testing ElGamal with q = $q and x = $x : \";\n\t\t$keys = ElG_PubKeyGen($r, $q, $x);\n\t\tif(!$keys) {\n\t\t\tif(_DEBUG >= 1) echo \"\\nERROR : failure during key generation for q = $q and x = $x\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($pk, $sk) = array_values($keys);\n\t\tif(!check_ElGEncDec_correctness($pk, $sk)) {\n\t\t\tif(_DEBUG >= 1) echo \"\\nERROR : check_ElGEncDec_correctness failed with sk = x = $x\\n\";\n\t\t\treturn false;\n\t\t} else if(_DEBUG >= 2) echo \"EncDec : OK\";\n\n\t\tif(!check_ElGRerand_correctness($pk, $sk)) {\n\t\t\tif(_DEBUG >= 1) echo \"\\nERROR : check_ElGRerand_correctness failed with sk = x = $x\\n\";\n\t\t\treturn false;\n\t\t} else if(_DEBUG >= 2) echo \", Rerand : OK\";\n\t\t\t\n\t\tif(!check_ElGMult_correctness($pk, $sk)) {\n\t\t\tif(_DEBUG >= 1) echo \"\\nERROR : check_ElGMult_correctness failed with sk = x = $x\\n\";\n\t\t\treturn false;\n\t\t} else if(_DEBUG >= 2) echo \", Mult : OK\"; \n\t\t\t\n\t\tif(!check_ElGPlainMult_correctness($pk, $sk)) {\n\t\t\tif(_DEBUG >= 1) echo \"\\nERROR : check_ElGPlainMult_correctness failed with sk = x = $x\\n\";\n\t\t\treturn false;\n\t\t} else if(_DEBUG >= 2) echo \", PlainMult : OK\";\n\t\t\t\n\t\tif(!check_ElGScalarExp_correctness($pk, $sk)) {\n\t\t\tif(_DEBUG >= 1) echo \"\\nERROR : check_ElGScalarExp_correctness failed with sk = x = $x\\n\";\n\t\t\treturn false;\n\t\t} else if(_DEBUG >= 2) echo \", ScalarExp : OK\";\n\n\t\tif(_DEBUG >= 2) echo \"\\n\";\n\n\t}\n\treturn true;\n}",
"public function testCheckingForUnsupportedAlgorithm()\n {\n $this->assertFalse(Algorithms::has('foo'));\n }",
"public function validate(Gamble $gamble);",
"public function testRejectsSetCodeFromBadlyFormattedGrids():void {\n\t\t$grid = new GRid($this->goodGRidsEncoded()[0]);\n\t\tforeach($this->badlyFormattedGRids() as $code){\n\t\t\t$this->expectException(GRidException::class);\n\t\t\t$grid->setCode($code);\n\t\t}\n\n\t}",
"public function testSetAlgorithmFailure(): void\n {\n $bag = Bag::create($this->tmpdir);\n $bag->addAlgorithm('sha1');\n $bag->addAlgorithm('SHA-224');\n $this->assertArrayEquals(['sha512', 'sha1', 'sha224'], $bag->getAlgorithms());\n $this->expectException(BagItException::class);\n $this->expectExceptionMessage(\"Algorithm bad-algorithm is not supported.\");\n $bag->setAlgorithm(\"bad-algorithm\");\n }",
"public function testInvalidNoCapacity(){\n \t$graph = new Graph();\n \n \t$graph->createVertex()->createEdgeTo($graph->createVertex())->setFlow(1);\n \n \t$alg = new ResidualGraph($graph);\n \t$alg->createGraph();\n }",
"public function testUnsupportedAlgorithm()\n {\n $this->expectException(Exception::class);\n new Ubiq\\Algorithm('unsupported-algorithm');\n }",
"public function testWrongValidation()\n {\n $validator = new TelFr();\n\n foreach($this->badNumbers as $number) {\n $this->assertFalse($validator->isValid($number), 'Number ' . $number . ' is valid');\n }\n }",
"public function testInvalidNoCapacity()\n {\n $graph = new Graph();\n\n $graph->createEdgeDirected($graph->createVertex(), $graph->createVertex())->setFlow(1);\n\n $alg = new ResidualGraph($graph);\n\n $this->setExpectedException('UnexpectedValueException');\n $alg->createGraph();\n }",
"public function testFooWhenExample1MultiplyByGlobalPiThrowBadInputException()\n {\n // ... Put your test code here ...\n\n // ... Put your assertions here ...\n $this->assertTrue(false);\n $this->markTestIncomplete();\n }",
"public function testFooWhenExample1MultiplyByGlobalPiThrowBadGlobalException()\n {\n // ... Put your test code here ...\n\n // ... Put your assertions here ...\n $this->assertTrue(false);\n $this->markTestIncomplete();\n }",
"public function testInvalidMinInput(): void\n {\n $numerics = new Numerics();\n $this->expectException('TypeError');\n $numerics->rand('should fail', 1.2, 0);\n }",
"public function testInvalidMaxInput(): void\n {\n $numerics = new Numerics();\n $this->expectException('TypeError');\n $numerics->rand(1.2, 'should fail', 0);\n }",
"public function testIfInproperReturnsFalse() : void\n {\n\n $this->assertFalse(GeoProgression::has(2, 129));\n }",
"public function isInvalid(): bool;",
"public function testCanStaticallyValidateGridCodes(): void\n\t{\n\t\tforeach($this->goodGRidsEncoded() as $code) {\n\t\t\t$this->assertTrue(GRid::checkGRid($code));\n\t\t}\n\t}",
"public function invalid()\n {\n //\n }",
"public function testInvalidUndirected(){\n $graph = new Graph();\n \n $graph->createVertex()->createEdge($graph->createVertex())->setFlow(1)\n ->setCapacity(2);\n \n $alg = new ResidualGraph($graph);\n $alg->createGraph();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the UserAuthInfo SoapHeader param | public function setSoapHeaderUserAuthInfo(\mdlutz24\realpagepanda\FloorPlan\StructType\UserAuthInfo $userAuthInfo, $nameSpace = 'http://realpage.com/webservices', $mustUnderstand = false, $actor = null)
{
return $this->setSoapHeader($nameSpace, 'UserAuthInfo', $userAuthInfo, $mustUnderstand, $actor);
} | [
"public function setAuthInfo(&$var)\n {\n GPBUtil::checkMessage($var, \\POGOProtos\\Networking\\Envelopes\\RequestEnvelope_AuthInfo::class);\n $this->auth_info = $var;\n }",
"protected function authentication_header()\n\t{\n\t\t$timestamp = date(\"c\");\n\t\t$encrypt_string = $timestamp . $this->user_id;\n\t\t$signature = hash_hmac('sha1', $encrypt_string, $this->encryption_key);\n\n\t\t$data = new stdClass;\n\t\t$data->mktowsUserId = $this->user_id;\n\t\t$data->requestSignature = $signature;\n\t\t$data->requestTimestamp = $timestamp;\n\n\t\t$header = new SoapHeader('http://www.marketo.com/mktows/', 'AuthenticationHeader', $data);\n\n\t\treturn $header;\n\t}",
"private function siteminderSetUserInfo() {\r\n\t\t\t$this->sid = array_key_exists($this->sidHeaderKey, $_SERVER) ? $_SERVER[$this->sidHeaderKey]: FALSE;\r\n\t\t\t$this->username = array_key_exists($this->usernameHeaderKey, $_SERVER) ? $_SERVER[$this->usernameHeaderKey]: NULL;\r\n\t\t\t$this->email = array_key_exists($this->emailHeaderKey, $_SERVER) ? $_SERVER[$this->emailHeaderKey]: NULL;\r\n\t\t\t$this->location = array_key_exists($this->locationHeaderKey, $_SERVER) ? $_SERVER[$this->locationHeaderKey]: NULL;\r\n\t\t}",
"public function setAuthInfo($var)\n {\n GPBUtil::checkString($var, True);\n $this->auth_info = $var;\n\n return $this;\n }",
"public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }",
"public function setUserInfo($info)\r\n {\r\n $this->userInfo = $info;\r\n $this->message .= \" [User Info: \" .$this->userInfo . \"]\";\r\n }",
"private function addAuthenticationInfo($doc) {\n\t\t$securityContext = $doc->header->securityContext;\n $securityContext->webExID = $this->account_name;\n $securityContext->password = $this->account_password;\n $siteName = substr($this->account_url, 0, strpos($this->account_url, '.'));\n $securityContext->siteName = $siteName;\n\t}",
"private function prepare_auth_header() {\r\n $this->headers = array();\r\n uksort($this->auth_params, 'strcmp');\r\n foreach ($this->auth_params as $k => $v) {\r\n $kv[] = \"{$k}=\\\"{$v}\\\"\";\r\n }\r\n $this->auth_header = 'OAuth ' . implode(', ', $kv);\r\n $this->headers[] = 'Authorization: ' . $this->auth_header;\r\n }",
"public function setUserinfo($userinfo, $password = false)\r\n {\r\n $this->_userinfo = $userinfo;\r\n if ($password !== false) {\r\n $this->_userinfo .= ':' . $password;\r\n }\r\n }",
"function setAuthInfo($user, $pass = false) {\r\n if(is_array($user)) {\r\n $this->authInfo = $user;\r\n } else {\r\n $this->authInfo = array($user, $pass);\r\n }\r\n }",
"public function setRequestUserinfo(Up_RequestUserinfo $value)\n {\n return $this->set(self::_REQUEST_USERINFO, $value);\n }",
"private function setAuthData()\n {\n $identity = $this->Authentication->getIdentity();\n\n if ($identity === null) {\n return null;\n }\n\n $this->set('auth', [\n 'user' => [\n 'id' => $identity->get('id'),\n 'first_name' => $identity->get('first_name'),\n 'last_name' => $identity->get('last_name'),\n 'email' => $identity->get('email'),\n 'account' => [\n // Set account name dynamically\n 'name' => 'test',\n ],\n ],\n ]);\n }",
"function setCustomHeader($name, $value);",
"protected function setCurlHeaderElement() {\n // set header for cur\n $this->header[] = 'Content-type: application/json';\n $this->header[] = 'Authorization: Bearer '.$this->accessToken;\n }",
"function putAuthAttributes()\n {\n if (isset($this->username)) {\n $this->putAttribute(RADIUS_USER_NAME, $this->username);\n }\n if (isset($this->response)) {\n $response = pack('C', $this->chapid) . $this->response;\n $this->putAttribute(RADIUS_CHAP_PASSWORD, $response);\n }\n if (isset($this->challenge)) {\n $this->putAttribute(RADIUS_CHAP_CHALLENGE, $this->challenge);\n }\n }",
"protected function setAuth ()\n {\n if ($this->authentication && $this->auth_name !== null && $this->auth_pass !== null)\n {\n $this->useAuth(true);\n $this->opt(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);\n $this->opt(CURLOPT_USERPWD, $this->auth_name . ':' . $this->auth_pass);\n }\n }",
"public function setSnsUserInfo(\\SnsUserInfo $value=null)\n {\n return $this->set(self::SNSUSERINFO, $value);\n }",
"function http_auth_headers() {\n\t\tif($this->http_user || $this->http_pass):\n\t\t\t$this->http_headers_add('Authorization', \" Basic \".base64_encode($this->http_user . \":\" . $this->http_pass));\n\t\tendif;\n\t}",
"protected function setBasicAuthHeader(): void\n {\n $this->setRequestHeader(\n 'Authorization',\n 'Basic ' . base64_encode($this->appId . ':' . $this->appPassword)\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sigmoid function calculator, also does derivatives Used as an activation function | function sigmoid($x, $deriv = false)
{
if ($deriv)
return $x * (1 - $x);
return 1 / (1 + exp(-$x));
} | [
"private function sigmoid($sum){\n $y1=1/(1+exp(-$sum));\n return $y1;\n }",
"public static function sigmoid(float $x): float {\n return 1 / (1 + exp(-$x));\n }",
"public static function derivativeSigmoid(float $x): float {\n return NetworkUtils::sigmoid($x) * (1 - NetworkUtils::sigmoid($x));\n }",
"public function derivativeActivationFunction(float $x): float {\n return NetworkUtils::derivativeSigmoid($x);\n }",
"public static function derivative($x) {\r\n die('Activation function derivative not implemented');\r\n }",
"public function testItLearnsXORFunctionWithFourHiddenUnitsUsingHyperbolicTangent()\r\n {\r\n $network = new FeedForward([2, 4, 1], new HyperbolicTangent());\r\n $ann = new Backpropagation($network, 0.7, 0.3);\r\n $trainingSet = [\r\n [-1,-1,-1],\r\n [-1,1,1],\r\n [1,-1,1],\r\n [1,1,-1]\r\n ];\r\n\r\n do {\r\n $ann->initialise();\r\n $result = $ann->train($trainingSet);\r\n } while (!$result);\r\n \r\n $network->activate([-1, -1]);\r\n $output = $network->getOutputs();\r\n $this->assertTrue($output[0] < -0.9);\r\n \r\n $network->activate([-1, 1]);\r\n $output = $network->getOutputs();\r\n $this->assertTrue($output[0] > 0.9);\r\n \r\n $network->activate([1, -1]);\r\n $output = $network->getOutputs();\r\n $this->assertTrue($output[0] > 0.9);\r\n \r\n $network->activate([1, 1]);\r\n $output = $network->getOutputs();\r\n $this->assertTrue($output[0] < -0.9);\r\n }",
"public function tan();",
"public function sigmoid(Image $image, float $contrast): Image\n {\n // If true increase the contrast, if false decrease the contrast.\n $sharpen = $contrast > 0;\n\n // Midpoint of the contrast (typically 0.5).\n $midpoint = 0.5;\n\n $contrast = (float) abs($contrast);\n\n $ushort = $image->format === BandFormat::USHORT;\n\n /**\n * Make a identity LUT, that is, a lut where each pixel has the value of\n * its index ... if you map an image through the identity, you get the\n * same image back again.\n *\n * LUTs in libvips are just images with either the width or height set\n * to 1, and the 'interpretation' tag set to HISTOGRAM.\n *\n * If 'ushort' is TRUE, we make a 16-bit LUT, ie. 0 - 65535 values;\n * otherwise it's 8-bit (0 - 255)\n */\n $lut = Image::identity(['ushort' => $ushort]);\n\n // Rescale so each element is in [0, 1]\n $range = $lut->max();\n $lut = $lut->divide($range);\n\n /**\n * The sigmoidal equation, see\n *\n * http://www.imagemagick.org/Usage/color_mods/#sigmoidal\n *\n * and\n *\n * http://osdir.com/ml/video.image-magick.devel/2005-04/msg00006.html\n *\n * Though that's missing a term -- it should be\n *\n * (1/(1+exp(β*(α-u))) - 1/(1+exp(β*α))) /\n * (1/(1+exp(β*(α-1))) - 1/(1+exp(β*α)))\n *\n * ie. there should be an extra α in the second term\n */\n if ($sharpen) {\n $x = $lut->multiply(-1)->add($midpoint)->multiply($contrast)->exp()->add(1)->pow(-1);\n $min = $x->min();\n $max = $x->max();\n $result = $x->subtract($min)->divide($max - $min);\n } else {\n $min = 1 / (1 + exp($contrast * $midpoint));\n $max = 1 / (1 + exp($contrast * ($midpoint - 1)));\n $x = $lut->multiply($max - $min)->add($min);\n $result = $x->multiply(-1)->add(1)->divide($x)->log()->divide($contrast)->multiply(-1)->add($midpoint);\n }\n\n // Rescale back to 0 - 255 or 0 - 65535\n $result = $result->multiply($range);\n\n /**\n * And get the format right ... $result will be a float image after all\n * that maths, but we want uchar or ushort\n */\n $result = $result->cast($ushort ? BandFormat::USHORT : BandFormat::UCHAR);\n\n return $image->maplut($result);\n }",
"public function activate()\n {\n $sum = 0;\n for ($i = 0; $i < $this->getInputSize() + 1; $i ++){\n $sum += $this->getInput($i) * $this->getWeight($i);\n }\n $this->setOutput($this->sigmoid($sum));\n return $this;\n }",
"function logisticFunction($x) {\r\n\t\treturn (exp($x) / (1 + exp($x))) ;\r\n\t}",
"function mse_loss_deriv_one( $y_true, $y_pred ){\n\treturn -2 * ($y_true - $y_pred);\n}",
"function fann_set_activation_function_output($ann, $activation_function)\n{\n}",
"public function calculate($input)\n {\n // Put the input vector into the input nodes.\n foreach ($input as $index => $value) {\n $this->nodeValue[0][$index] = $value;\n }\n\n // Iterate the hidden layers.\n for ($layer = 1; $layer < $this->layerCount; $layer++) {\n\n // Iterate over each node in this layer.\n $previousLayer = $layer - 1;\n for ($node = 0; $node < ($this->nodeCount[$layer]); $node++) {\n\n /* Each node in the previous layer has a connection to this node. On the basis of this, calculate this\n * node's value. */\n $nodeValue = 0.0;\n for ($previousNode = 0; $previousNode < ($this->nodeCount[$previousLayer]); $previousNode++) {\n $inputNodeValue = $this->nodeValue[$previousLayer][$previousNode];\n $edgeWeight = $this->edgeWeight[$previousLayer][$previousNode][$node];\n $nodeValue = $nodeValue + ($inputNodeValue * $edgeWeight);\n }\n\n // Apply the threshold.\n $nodeValue = $nodeValue - $this->nodeThreshold[$layer][$node];\n\n // Apply the activation function.\n $nodeValue = $this->activation($nodeValue);\n\n // Remember the outcome.\n $this->nodeValue[$layer][$node] = $nodeValue;\n }\n }\n\n // Return the values of the last layer (the output layer).\n return $this->nodeValue[$this->layerCount - 1];\n }",
"function fann_set_activation_steepness_hidden($ann, $activation_steepness)\n{\n}",
"function feedForwardDompet1($x1, $x2, $x3, $x4, $t, $bx1h1, $bx2h1, $bx3h1, $bx4h1, $bx1h2, $bx2h2, $bx3h2, $bx4h2, $bbiash1, $bbiash2, $bh1, $bh2, $bbiaso)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$maxIn = max($x1, $x2, $x3, $x4, $t);\n\t\t\t\t\t\t\t\t$minIn = min($x1, $x2, $x3, $x4, $t);\n\n\t\t\t\t\t\t\t\t//normalisasi data input\n\t\t\t\t\t\t\t\t$x1Nor = 0.8 * ($x1 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$x2Nor = 0.8 * ($x2 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$x3Nor = 0.8 * ($x3 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$x4Nor = 0.8 * ($x4 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$targetNor = 0.8 * ($t - $minIn) / ($maxIn - $minIn) + 0.1;\n\n\t\t\t\t\t\t\t\t//hitung nilai pada hidden layer\n\t\t\t\t\t\t\t\t$h1 = $bbiash1 + ($x1Nor * $bx1h1) + ($x2Nor * $bx2h1) + ($x3Nor * $bx3h1) + ($x4Nor * $bx4h1);\n\t\t\t\t\t\t\t\t$h2 = $bbiash2 + ($x1Nor * $bx1h2) + ($x2Nor * $bx2h2) + ($x3Nor * $bx3h2) + ($x4Nor * $bx4h2);\n\t\t\t\t\t\t\t\t$h1Sig = 1 / (1 + exp($h1 * -1));\n\t\t\t\t\t\t\t\t$h2Sig = 1 / (1 + exp($h2 * -1));\n\n\t\t\t\t\t\t\t\t//hitung nilai output\n\t\t\t\t\t\t\t\t$out = $bbiaso + ($h1Sig * $bh1) + ($h2Sig * $bh2);\n\t\t\t\t\t\t\t\t$outSig = 1 / (1 + exp($out * -1));\n\t\t\t\t\t\t\t\t$err = ($targetNor - $outSig);\n\t\t\t\t\t\t\t\t$error = pow($err, 2);\n\t\t\t\t\t\t\t\t$te = 0.3;\n\t\t\t\t\t\t\t\tglobal $dnf;\n\t\t\t\t\t\t\t\t$dn1 = ($maxIn - $minIn);\n\t\t\t\t\t\t\t\t$dn = $outSig * $dn1;\n\t\t\t\t\t\t\t\t$dnf = $dn + $minIn;\n\t\t\t\t\t\t\t\tif ($error > $te) {\n\t\t\t\t\t\t\t\t\tbackpropagationDompet1($outSig, $targetNor, $h1Sig, $h2Sig, $bh1, $bh2, $x1Nor, $x2Nor, $x3Nor, $x4Nor, $bx1h1, $bx2h1, $bx3h1, $bx4h1, $bx1h2, $bx2h2, $bx3h2, $bx4h2, $bbiash1, $bbiash2, $bbiaso, $x1, $x2, $x3, $x4, $t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// echo \"Target =\" . $targetNor . \"<br>\";\n\t\t\t\t\t\t\t\t\t// echo \"Output =\" . $outSig . \"<br>\";\n\t\t\t\t\t\t\t\t\t// $err = ($targetNor - $outSig);\n\t\t\t\t\t\t\t\t\t// $error = pow($err, 2);\n\t\t\t\t\t\t\t\t\t// echo \"Error = \" . $error . \"<br><br>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}",
"function feedForwardTas1($x1, $x2, $x3, $x4, $t, $bx1h1, $bx2h1, $bx3h1, $bx4h1, $bx1h2, $bx2h2, $bx3h2, $bx4h2, $bbiash1, $bbiash2, $bh1, $bh2, $bbiaso)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$maxIn = max($x1, $x2, $x3, $x4, $t);\n\t\t\t\t\t\t\t\t$minIn = min($x1, $x2, $x3, $x4, $t);\n\n\t\t\t\t\t\t\t\t//normalisasi data input\n\t\t\t\t\t\t\t\t$x1Nor = 0.8 * ($x1 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$x2Nor = 0.8 * ($x2 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$x3Nor = 0.8 * ($x3 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$x4Nor = 0.8 * ($x4 - $minIn) / ($maxIn - $minIn) + 0.1;\n\t\t\t\t\t\t\t\t$targetNor = 0.8 * ($t - $minIn) / ($maxIn - $minIn) + 0.1;\n\n\t\t\t\t\t\t\t\t//hitung nilai pada hidden layer\n\t\t\t\t\t\t\t\t$h1 = $bbiash1 + ($x1Nor * $bx1h1) + ($x2Nor * $bx2h1) + ($x3Nor * $bx3h1) + ($x4Nor * $bx4h1);\n\t\t\t\t\t\t\t\t$h2 = $bbiash2 + ($x1Nor * $bx1h2) + ($x2Nor * $bx2h2) + ($x3Nor * $bx3h2) + ($x4Nor * $bx4h2);\n\t\t\t\t\t\t\t\t$h1Sig = 1 / (1 + exp($h1 * -1));\n\t\t\t\t\t\t\t\t$h2Sig = 1 / (1 + exp($h2 * -1));\n\n\t\t\t\t\t\t\t\t//hitung nilai output\n\t\t\t\t\t\t\t\t$out = $bbiaso + ($h1Sig * $bh1) + ($h2Sig * $bh2);\n\t\t\t\t\t\t\t\t$outSig = 1 / (1 + exp($out * -1));\n\t\t\t\t\t\t\t\t$err = ($targetNor - $outSig);\n\t\t\t\t\t\t\t\t$error = pow($err, 2);\n\t\t\t\t\t\t\t\t$te = 0.3;\n\t\t\t\t\t\t\t\tglobal $dnf;\n\t\t\t\t\t\t\t\t$dn1 = ($maxIn - $minIn);\n\t\t\t\t\t\t\t\t$dn = $outSig * $dn1;\n\t\t\t\t\t\t\t\t$dnf = $dn + $minIn;\n\t\t\t\t\t\t\t\tif ($error > $te) {\n\t\t\t\t\t\t\t\t\tbackpropagationTas1($outSig, $targetNor, $h1Sig, $h2Sig, $bh1, $bh2, $x1Nor, $x2Nor, $x3Nor, $x4Nor, $bx1h1, $bx2h1, $bx3h1, $bx4h1, $bx1h2, $bx2h2, $bx3h2, $bx4h2, $bbiash1, $bbiash2, $bbiaso, $x1, $x2, $x3, $x4, $t);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// echo \"Target =\" . $targetNor . \"<br>\";\n\t\t\t\t\t\t\t\t\t// echo \"Output =\" . $outSig . \"<br>\";\n\t\t\t\t\t\t\t\t\t// $err = ($targetNor - $outSig);\n\t\t\t\t\t\t\t\t\t// $error = pow($err, 2);\n\t\t\t\t\t\t\t\t\t// echo \"Error = \" . $error . \"<br><br>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}",
"function BackPropagate($inputs, $expected, $weights, $learning_rate) {\n // Feed forward\n $feed_forward = FeedForward($inputs, $weights);\n $hidden = $feed_forward['hidden'];\n $output = $feed_forward['output'];\n unset($feed_forward); // Free up some random access memories\n\n // Calculate error\n $output_error = $expected - $output;\n $output_delta = $output_error * SigmoidDerivative($output);\n\n // Calculate hidden layer error and delta\n $hidden_error = array();\n $hidden_delta = array();\n $hidden_error[0] = $output_delta * $weights[6];\n $hidden_delta[0] = $hidden_error[0] * SigmoidDerivative($hidden[0]);\n $hidden_error[1] = $output_delta * $weights[7];\n $hidden_delta[1] = $hidden_error[1] * SigmoidDerivative($hidden[1]);\n\n // Update weights\n $weights[0] += $learning_rate * $inputs[0] * $hidden_delta[0];\n $weights[1] += $learning_rate * $inputs[1] * $hidden_delta[0];\n $weights[2] += $learning_rate * $hidden_delta[0];\n $weights[3] += $learning_rate * $inputs[0] * $hidden_delta[1];\n $weights[4] += $learning_rate * $inputs[1] * $hidden_delta[1];\n $weights[5] += $learning_rate * $hidden_delta[1];\n $weights[6] += $learning_rate * $hidden[0] * $output_delta;\n $weights[7] += $learning_rate * $hidden[1] * $output_delta;\n $weights[8] += $learning_rate * $output_delta;\n\n return $weights; // Return the updated weights\n}",
"function feedForward($input){\n\n\t\tglobal $numLayers;\n\t\tglobal $layerSize;\n\t\tglobal $alpha;\n\t\tglobal $beta;\n\t\tglobal $weight;\n\t\tglobal $prevWeight;\n\t\tglobal $out;\n\n\t\t//Assign input to 0th layer\n\t\tforeach ($input as $key => $value) {\n\t\t\t$out[0][$key] = $value;\n\t\t}\n\n\t\t//Assign output for each neuron using sigmoid function\n\t\tfor($i = 1; $i < $numLayers; $i++){\n\t\t\tfor($j = 0; $j < $layerSize[$i]; $j++){\n\t\t\t\t$sum = 0;\n\t\t\t\tif($i == 1){\n\t\t\t\t\t$k = 0;\n\t\t\t\t\tforeach ($out[0] as $key => $value) {\n\t\t\t\t\t\t$sum += $value * $weight[$i][$j][$k++];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor($k = 0; $k < $layerSize[$i-1]; $k++){\n\t\t\t\t\t\t$sum += $out[$i-1][$k] * $weight[$i][$j][$k];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Apply bias\n\t\t\t\t$sum += $weight[$i][$j][$layerSize[$i - 1]];\n\n\t\t\t\t//Finally\n\t\t\t\t$out[$i][$j] = sigmoid($sum);\n\t\t\t}\n\t\t}\n\t}",
"public function tan(): Image\n {\n return $this->math(OperationMath::TAN);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if an exception is shown on the page | public function iShouldSeeAnException()
{
$this->assertElementOnPage('.error-message');
} | [
"public function isErrorPage(): bool\n {\n return $this->id() === $this->site()->errorPageId();\n }",
"public function isErrorPage() {\n return $this->uri === $this->kirby->options['error'];\n }",
"protected function isPageAddWithError(): bool\n {\n return 'edit' === $this->display and !$this->getValue($this->identifier);\n }",
"public function hasException()\n {\n return $this->getResponse()->hasException();\n }",
"public function isErrorPage()\n {\n try {\n $el = $this->webdriver->findElement(WebDriverBy::xpath($this->locators['errorBodyTag']));\n if ($el) {\n return true;\n }\n } catch (NoSuchElementException $e) {\n return false;\n }\n\n return false;\n }",
"public function showPageNotFound()\n\t\t{\t\t\t\n\t\t\tif($this->templateExists($this->istrNotFoundTemplate))\n\t\t\t{\n\t\t\t\t$this->renderTemplate($this->istrNotFoundTemplate, 404);\n\t\t\t}\n\t\t\t\n\t\t\texit();\n\t\t}",
"public function FrontControllerIsVisitedOrDie() {\n\t\t\n\t\tglobal $gPage; // Always defined in frontcontroller\n\t\t\n\t\tif(!isset($gPage)) {\n\t\t\tdie('No direct access to pagecontroller is allowed.');\n\t\t}\n\t}",
"protected function displayFailure(){\n\t\t$back_trace = array('Inicio', 'Movimientos', 'Recibos');\n\t\t$msg = 'Usuario no cuenta con los suficientes privilegios.';\n\t\tPage::display(array('module_title' => INVENTORY_TITLE, 'main_menu' => 'main_menu_inventory_html.tpl',\n\t\t\t\t'back_trace' => $back_trace, 'second_menu' => 'movements_menu_html.tpl',\n\t\t\t\t'content' => 'document_menu_html.tpl', 'document_name' => 'Recibo',\n\t\t\t\t'create_link' => 'index.php?cmd=create_receipt', 'get_link' => 'index.php?cmd=get_receipt',\n\t\t\t\t'search_link' => 'index.php?cmd=search_receipt&page=1', 'notify' => '1', 'type' => 'error',\n\t\t\t\t'message' => $msg), 'site_html.tpl');\n\t}",
"public function isDueToElementMissingOrInvisible()\n {\n return in_array($this->getCode(), array(self::NoSuchElement, self::ElementNotVisible));\n }",
"public function DisplayException()\n\t{\n\t\t//Todo add your modification here.\n\t\tparent::DisplayException();\n\t}",
"public function validatePage()\r\n {\r\n if ($this->crawler->filter('.descriere_titlu span')->count() <= 0) {\r\n throw new InvalidPage();\r\n }\r\n }",
"private function checkException() {\n return in_array(strtolower($this->program_name), $this->exceptions);\n }",
"public function ooops()\r\n\t{\r\n\t\t$this->template->view('utilities/404.php');\r\n\t}",
"public function pageNotFound()\n {\n $this->renderHeader();\n include 'views/templates/404.php';\n }",
"public function seeWpDiePage()\n {\n $this->seeElement('body#error-page');\n }",
"public function ooops()\n\t{\n\t\t$this->template->view('utilities/404.php');\n\t}",
"public function iShouldNotSeeAnErrorBox()\n {\n $this->assertElementNotOnPage('.notification-1');\n }",
"public function testRenderingNonHttpExceptionWithoutViewInDevelopmentEnvironment()\n {\n $this->setViewComponents();\n $ex = new Exception(\"foo\");\n $this->viewFactory->expects($this->once())\n ->method(\"has\")\n ->with(\"errors/500\")\n ->willReturn(false);\n $this->renderer->render($ex);\n $this->assertEquals($ex->getMessage(), $this->renderer->getResponse()->getContent());\n $this->assertEquals(500, $this->renderer->getResponse()->getStatusCode());\n }",
"public function isException()\n {\n return $this->type === Type::EXCEPTION;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure the rate limiters for the application. | protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(1000);
});
} | [
"protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60);\n });\n }",
"private function configureRateLimiting()\n {\n /** @var RateLimiter $rateLimiter */\n $rateLimiter = $this->app->make(RateLimiter::class);\n\n $rateLimiter->for('spa_login_lock', function (Request $request) {\n return new Limit($this->resolveRequestSignature($request), 15, 5);\n });\n\n $rateLimiter->for('spa_invitation_lock', function (Request $request) {\n return new Limit($this->resolveRequestSignature($request), 15, 5);\n });\n\n $rateLimiter->for('spa_password_reset_lock', function (Request $request) {\n return new Limit($this->resolveRequestSignature($request), 15, 5);\n });\n }",
"protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }",
"private function configureRateLimiting(): void\n {\n RateLimiter::for('messenger-api', function (Request $request) {\n return Messenger::getApiRateLimit() > 0\n ? Limit::perMinute(Messenger::getApiRateLimit())->by(optional($request->user())->getKey() ?: $request->ip())\n : Limit::none();\n });\n\n RateLimiter::for('messenger-message', function (Request $request) {\n return Messenger::getMessageRateLimit() > 0\n ? Limit::perMinute(Messenger::getMessageRateLimit())->by(\n $request->route()->originalParameter('thread').'.'.optional($request->user())->getKey() ?: $request->ip()\n )\n : Limit::none();\n });\n\n RateLimiter::for('messenger-attachment', function (Request $request) {\n return Messenger::getAttachmentRateLimit() > 0\n ? Limit::perMinute(Messenger::getAttachmentRateLimit())->by(\n $request->route()->originalParameter('thread').'.'.optional($request->user())->getKey() ?: $request->ip()\n )\n : Limit::none();\n });\n\n RateLimiter::for('messenger-search', function (Request $request) {\n return Messenger::getSearchRateLimit() > 0\n ? Limit::perMinute(Messenger::getSearchRateLimit())->by(optional($request->user())->getKey() ?: $request->ip())\n : Limit::none();\n });\n }",
"protected function registerRateLimiting()\n {\n $this->app->singleton('api.limiting', function ($app) {\n return new RateLimitHandler($app, $app['cache'], $this->config('throttling'));\n });\n }",
"protected function limiter(): RateLimiter\n {\n return app(RateLimiter::class);\n }",
"protected function registerRateLimiting()\n {\n $this->app->singleton('api.limiting', function ($app) {\n $config = $app['config']['api'];\n\n return new Http\\RateLimit\\Handler($app, $app['cache'], $this->prepareConfigValues($config['throttling']));\n });\n }",
"protected function limiter()\n {\n return app(RateLimiter::class);\n }",
"private function initiateThrotller()\n {\n $this->ThrottlerRules = new GuzzleAdvancedThrottle\\RequestLimitRuleset([\n $this->_sApiUrl => [\n [\n 'max_requests' => $this->_sApiMaxRequest,\n 'request_interval' => $this->_sApiRequestInterval\n ]\n ]\n ]);\n }",
"public function __construct()\n {\n $this->rateLimit = new RateLimit(0, 0, 0, 0, false, false, 0, 0);\n }",
"function simpay_custom_rate_limiting_max_rate_count() {\n return 30;\n}",
"protected function configureImagickSettings()\n {\n if (!isset($this->settings['driverSpecific']['Imagick'])) {\n return;\n }\n\n $limits = $this->settings['driverSpecific']['Imagick']['limits'] ? $this->settings['driverSpecific']['Imagick']['limits'] : [];\n foreach ($limits as $resourceType => $limit) {\n \\Imagick::setResourceLimit($resourceType, $limit);\n }\n }",
"public function enableRateLimit(): self\n {\n $this->rateLimitEnabled = true;\n\n return $this;\n }",
"private function parseRateLimitAndCache() {\n\n $rateLimited = false;\n $rateLimit = null;\n $rateLimitMultiplier = null;\n $cached = false;\n $cacheTime = null;\n\n foreach ($this->interceptors as $interceptor) {\n $inspector = $this->classInspectorProvider->getClassInspector(get_class($interceptor));\n $annotations = $inspector->getClassAnnotations();\n\n // Derive rate limit config\n $rateLimited = $rateLimited || isset($annotations[\"rateLimited\"]);\n if (!$rateLimit) $rateLimit = isset($annotations[\"rateLimit\"][0]) ? $annotations[\"rateLimit\"][0]->getValue() : null;\n if (!$rateLimitMultiplier) $rateLimitMultiplier = isset($annotations[\"rateLimitMultiplier\"][0]) ? $annotations[\"rateLimitMultiplier\"][0]->getValue() : null;\n\n // Derive cache config\n $cached = $cached || isset($annotations[\"cached\"]);\n if (!$cacheTime) $cacheTime = isset($annotations[\"cacheTime\"][0]) ? $annotations[\"cacheTime\"][0]->getValue() : null;\n\n }\n\n // Only set the cache and ratelimit configs if any exist.\n if ($cached || $cacheTime) $this->contentCacheConfig = new ContentCacheConfig($cacheTime);\n if ($rateLimited || $rateLimit || $rateLimitMultiplier) $this->rateLimiterConfig = new RateLimiterConfig($rateLimit, $rateLimitMultiplier);\n }",
"protected function limiter()\n {\n return $this->limiter ?? $this->limiter = app(RateLimiter::class);\n }",
"public function __construct() {\n $this->setLimits();\n }",
"public function setRateLimit(int $value): void\n {\n $this->rateLimit = $value;\n }",
"protected function setupThrottler($rate)\n\t{\n\t\tinclude_once sfConfig::get('sf_lib_dir') . DIRECTORY_SEPARATOR . 'Throttle.class.php';\n\t\t\n\t\t$config = new ThrottleConfig();\n\t\t$config->burstTimeout = 0;\t\t\t\t\t// Turn off burst timeout\n\t\t$config->burstLimit = $rate;\t\t\t\t// Set burst and standard rates to the same\n\t\t$config->rateLimit = $config->burstLimit;\n\n\t\t$throttler = new Throttle($config);\n\t}",
"public function rateLimiters()\n {\n return $this->hasMany('App\\Models\\RateLimiter');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation getDocumentFolderPath Get path (all parent folders) of this folder | public function getDocumentFolderPath($id)
{
list($response) = $this->getDocumentFolderPathWithHttpInfo($id);
return $response;
} | [
"public function getDocFolder() {\n return Yii::getAlias(self::ROOT_FOLDER) . DIRECTORY_SEPARATOR;\n }",
"static function getInvoiceDocsFolder() {\n\t\treturn self::getWebResourcesFolder().system::getDirSeparator().self::FOLDER_INVOICE_DOCS.system::getDirSeparator();\n\t}",
"public function getParentFolderPath() : string\n {\n return $this->getProperty()->parentFolderPath;\n }",
"public function getCurrentFolderPath()\n {\n return $this->currentFolder;\n }",
"public function getDocumentPath()\r\n {\r\n\r\n if (!$this->documentPath) {\r\n return '/';\r\n }\r\n\r\n return $this->documentPath;\r\n }",
"public function getParentFolder() {\n $explodedKey = explode(\"/\", $this->getKey());\n array_pop($explodedKey);\n return join(\"/\", $explodedKey);\n }",
"public function getRootLevelFolder()\n {\n $this->writeLog('getRootLevelFolder()');\n return $this->configuration['rootIdentifier'];\n }",
"public function getPath() {\n return $this->document->_id;\n }",
"public function getImageFolderPath()\n {\n\t return $this->imageFolderPath;\n }",
"function getFolderList() { /* {{{ */\n\t\t$db = $this->_dms->getDB();\n\n\t\t$queryStr = \"SELECT `folderList` FROM `tblDocuments` where id = \".$this->_id;\n\t\t$resArr = $db->getResultArray($queryStr);\n\t\tif (is_bool($resArr) && !$resArr)\n\t\t\treturn false;\n\n\t\treturn $resArr[0]['folderList'];\n\t}",
"public function getParentFolder()\n {\n return $this->getPath();\n }",
"public function getParentFolderId()\n {\n return $this->getProperty(\"ParentFolderId\");\n }",
"public function getClientFolderPath($clientId)\n {\n $clientPath = $this->_rootPathCloud . self::PS . $clientId;\n return $clientPath;\n }",
"private function getContentFolder() {\n\t $folder = sprintf(\n\t\t\t\"%s/data/user-generated/%s\",\n\t\t\tdirname(__DIR__),\n\t\t\t$this->contentId\n\t\t);\n\n\t if (!is_dir($folder)) {\n\t $this->responseMsg(\"Content folder not found.\", true);\n\t }\n\n\t\treturn $folder;\n\t}",
"public function getFolder(){\n if(!$this->isPropertyAvailable('Folder')){\n $this->setProperty(\"Folder\", new Folder($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(), \"Folder\")),false);\n }\n return $this->getProperty(\"Folder\");\n }",
"public function getFolder()\n {\n return $this->folder;\n }",
"public function getDocPath()\r\n\r\n\t{\r\n\r\n\t\treturn $this->docPath;\r\n\r\n \t}",
"public static function getContextFolder()\n\t{\n\t\tif (!isset($_SESSION['context']['folder']))\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$serializedObject = $_SESSION['context']['folder'];\n\n\t\tif (isset($serializedObject))\n\t\t{\n\t\t\t$folder = unserialize($serializedObject);\n\n\t\t\treturn $folder;\n\t\t}\n\t}",
"public function getPathToDocument()\n\t{\n\t\treturn $this->_config['pathToDocument'];\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new CountryCollectionManager object. | public function __construct(\Traversable $namespaces, CacheBackendInterface $cacheBackend, ModuleHandlerInterface $moduleHandler) {
parent::__construct('Plugin/iso3166/CountryCollection', $namespaces, $moduleHandler, 'Drupal\iso3166\Plugin\Iso3166\CountryCollection\CountryCollectionPluginInterface', 'Drupal\iso3166\Annotation\CountryCollection');
$this->alterInfo('iso3166_country_collection_info');
$this->setCacheBackend($cacheBackend, 'iso3166_country_collection_plugins');
} | [
"public function getCountriesCollection()\n {\n if (null !== $this->countriesCollection) {\n return $this->countriesCollection;\n }\n\n $countriesEntitiesArray = array_filter((new CountLang())->getCountries()->getEntities(), function($country) {\n /** @var Country $country */\n return in_array(\n $this->getAlpha3TCode(),\n array_column($country->getLanguages(), 'languageCode'),\n true\n );\n });\n\n $countriesCollection = new CollectionDecorator(new CountryCollection());\n $countriesCollection->addEntities($countriesEntitiesArray);\n\n return $this->countriesCollection = $countriesCollection->getCollection();\n }",
"public function getCountryManager()\n {\n return $this->countryManager;\n }",
"public function __construct()\n\t{\n\t\t$this->country = new Country();\n\t}",
"public function getCountriesCollection()\n {\n if (null !== $this->countriesCollection) {\n return $this->countriesCollection;\n }\n\n return $this->countriesCollection = (new CountLang())->getCountries(\n ['currencies', $this->getAlphaCode(), Filter::OPERATOR_HAS]\n );\n }",
"protected function getCountryManager() {\n return \\Drupal::service('plugin.manager.country');\n }",
"public function getCountriesCollection()\n {\n if (null !== $this->countriesCollection) {\n return $this->countriesCollection;\n }\n\n return $this->countriesCollection = (new CountLang())->getCountries(['subRegionCode', $this->getCode()]);\n }",
"private function getCollectionFactory()\n {\n return CollectionFactory::getInstance();\n }",
"protected function getSonata_Classification_Manager_CollectionService()\n {\n return $this->services['sonata.classification.manager.collection'] = new \\Sonata\\ClassificationBundle\\Entity\\CollectionManager('AppBundle\\\\Entity\\\\Classification\\\\Collection', ${($_ = isset($this->services['doctrine']) ? $this->services['doctrine'] : $this->get('doctrine')) && false ?: '_'});\n }",
"protected function createCollectionLoader()\n {\n return new CollectionLoader([\n 'logger' => $this->logger,\n 'factory' => $this->modelFactory(),\n ]);\n }",
"protected function _initCollection()\n {\n $entity = ucfirst($this->_getRequestData('entity'));\n $className = str_replace(self::ENTITY_PLACEHOLDER, $entity, self::COLLECTION_CLASS_TEMPLATE);\n $collection = new $className($this->_getDataContainer(self::DC_MODEL));\n $this->_addDataContainer(self::DC_COLLECTION, $collection);\n }",
"protected function _initCountryRegions()\n {\n /** @var $region \\Magento\\Directory\\Model\\Region */\n foreach ($this->_regionCollection as $region) {\n $countryNormalized = strtolower($region->getCountryId());\n $regionCode = strtolower($region->getCode());\n $regionName = strtolower($region->getDefaultName());\n $this->_countryRegions[$countryNormalized][$regionCode] = $region->getId();\n $this->_countryRegions[$countryNormalized][$regionName] = $region->getId();\n $this->_regions[$region->getId()] = $region->getDefaultName();\n }\n return $this;\n }",
"public function __construct()\n {\n $this->geoImageMaps = new ArrayCollection();\n }",
"public function __construct() {\r\n $this->geoJson = array(\r\n 'type' => 'FeatureCollection',\r\n 'features' => array()\r\n );\r\n }",
"public function sourceCollectionFactory() : SourceCollectionFactory {\n return SourceCollectionFactory::instance();\n }",
"public function byLanguageCode(string $languageCode): CountryCollection;",
"protected function _createCollection()\n {\n return Mage::getModel('cminds_multiwishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }",
"public function __construct()\n {\n// $this->mainLanguage = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }",
"protected function _getLocalityCollection()\n {\n if (is_null($this->_localityCollection)) {\n $this->_localityCollection = Mage::getResourceModel(\n 'innobyte_emag_marketplace/locality_collection'\n );\n }\n return $this->_localityCollection;\n }",
"public static function create(): CryptionDataSetCollection\n {\n return new static();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the database key | public function getDatabaseKey()
{
return $this->_databaseKey;
} | [
"public function getDatabaseKey()\n {\n return $this->getDbAdapter()->getDatabaseKey();\n }",
"function dbKey($tabla)\n{\n\tglobal $db;\n\t$datos = $db->fetchRow(\"SHOW KEYS FROM {$tabla} WHERE Key_name = 'PRIMARY'\");\n\t$key = $datos['Column_name'];\n\treturn $key;\n}",
"public function fetchKey(): string;",
"public static function get_primary_key();",
"public function getDatabaseSqlKey(): array;",
"public function getIDKey(){\n\t\treturn $this->ID_key;\n\t}",
"public function getPrimaryKey(): string\n {\n return $this->getMetadata()['primaryKey'];\n }",
"public function getKey() {\n return $this->keyString;\n }",
"public function getKey() {}",
"public function getIdKey(): string {}",
"public function getInstanceKey(): mixed\n {\n return $this->instance->getKey();\n }",
"function dbmfirstkey($dbm_identifier) {}",
"public function getKey()\n {\n return $this->tableKey;\n }",
"public function key()\n {\n return $this->entry->getDn();\n }",
"public function getKey()\n {\n return self::$binUserKey;\n }",
"function get_databse_version_key() {\n return get_databse_table_name( false ) . '_db_version';\n}",
"public function getKeyAsString()\n {\n return $this->getKey();\t\n }",
"final static public function key() {\n return static::$key;\n }",
"public function getKey() {\n return sprintf('%d:%d', $this->row, $this->column);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all modules that handle administration. | public function getAdministrationModules()
{
return array_filter($this->getModules(), function (ModuleInterface $module) {
return $module instanceof AdministrationModuleInterface;
});
} | [
"public static function getModules() {\r\n\t\tTodoyuExtensions::loadAllAdmin();\r\n\r\n\t\tif( is_array( Todoyu::$CONFIG['EXT']['admin']['modules'] ) ) {\r\n\t\t\treturn TodoyuArray::sortByLabel(Todoyu::$CONFIG['EXT']['admin']['modules']);\r\n\t\t} else {\r\n\t\t\treturn array();\r\n\t\t}\r\n\t}",
"static function getAllModules(){\n\t\tself::init();\n\t\treturn self::$we_available_modules;\n\t}",
"public function getModules();",
"public function getAdmins(): array\n {\n $admins = [];\n $modulePath = $this->getPath();\n $path = implode(DIRECTORY_SEPARATOR, [$modulePath, $this->adminFolder]);\n if (is_dir($path)) {\n foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename)\n {\n if ($filename->isDir()) continue;\n $name = $filename->getBasename('.php');\n $class = implode('\\\\', [static::classNamespace(), $this->adminFolder, $name]);\n $admins[$name] = $this->createAdmin($class, $name);\n }\n }\n return $admins;\n }",
"protected function getAllModules()\n {\n return $this->container->metaDataHelper->getAllEnabledModules();\n }",
"protected function getAdminModulesAttribute() : array\n {\n $modules = [ ];\n\n foreach ($this->modules()->get() as $module) {\n if ($module->isAdminModule()) {\n $modules[ ] = $module;\n }\n }\n\n return $modules;\n }",
"public function getAppModules();",
"function findAllAdministrators() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM admins;'));\r\n\r\n\t}",
"protected function getModulesVisibleInMenu()\n {\n // Detect what sort of link to add in the menu (admin or not admin) and load the related modules\n if ($this->isAdminEnv()) {\n $modules = $this->domain->adminModules;\n } else {\n $modules = $this->domain->notAdminModules;\n }\n\n return $modules;\n }",
"public function listAll() {\n $ml = new moduleloader();\n $modules = $ml->getAllModules();\n print_r($modules);\n }",
"public function getAllUserModules()\n {\n $userModules = new Webdesktop_Model_ModuleSet;\n FOREACH($this->getAllModules(TRUE) AS $obj) {\n $rights = array();\n\n FOREACH($obj->getModuleActions() AS $action) {\n $rights[$action] = $this->acl->isAllowed($obj->getModuleId(), $action) === TRUE ? TRUE : FALSE;\n }\n\n IF(in_array(TRUE, $rights, TRUE)) {\n $obj->setUserPriviligesActions($rights);\n $userModules->add($obj);\n }\n\n }\n\n RETURN $userModules;\n }",
"function modules_admin_list()\n{\n return modules_admin_view();\n}",
"function get_all_modules() {\r\n static $modules = null;\r\n // Return result if cached.\r\n if ($modules !== null)\r\n return $modules;\r\n // Scan modules.\r\n $modules = array();\r\n $app_modules = @scandir(APP_DIR . \"/modules\");\r\n if (!is_array($app_modules))\r\n $app_modules = array();\r\n foreach ($app_modules as $module) {\r\n if ($module[0] === \".\")\r\n continue;\r\n $modules[$module] = array(\"melt\\\\$module\\\\\" . underline_to_cased($module) . \"Module\", APP_DIR . \"/modules/$module\");\r\n }\r\n foreach (scandir(APP_CORE_DIR) as $module) {\r\n if ($module[0] === \".\" || is_file($module))\r\n continue;\r\n $modules[$module] = array(\"melt\\\\$module\\\\\" . underline_to_cased($module) . \"Module\", APP_CORE_DIR . \"/$module\");\r\n }\r\n return $modules;\r\n}",
"public function all()\n {\n if ($this->moduleLoaded === false) {\n $this->loadModules();\n }\n\n return $this->moduleList;\n }",
"public function getAdmins()\n {\n }",
"public function getModules()\n {\n return $this->modules;\n }",
"public function modules()\n {\n return $this->newQuery('getModules');\n }",
"function module_list_all () {\n $ml = new moduleloader();\n $modules = $ml->getAllModules();\n print_r($modules);\n}",
"public function getAdminAccessModulesList()\n {\n $ADMIN_GROUP_NAME = $this->config->item('ADMIN_GROUP_NAME');\n $group_code = $this->session->userdata('vGroupCode');\n $group_id = $this->session->userdata('iGroupId');\n $group_menu_ids = array();\n $is_admin_group = FALSE;\n $db_group_assoc_rights = array();\n if ($group_code == $ADMIN_GROUP_NAME) {\n $is_admin_group = TRUE;\n } else {\n $extra_cond = $this->db->protect(\"mgr.iGroupId\") . \" = \" . $this->db->escape($group_id) . \" AND (IF(mam.eMenuType = 'Module', mgr.eList = 'Yes', 1))\";\n $db_group_assoc_rights = $this->getAdminGroupAccessRights($extra_cond, \"\", \"\", \"\", \"\", \"iAdminMenuId\");\n $group_menu_ids = (is_array($db_group_assoc_rights)) ? array_keys($db_group_assoc_rights) : array();\n }\n\n return array(\n 'is_admin' => $is_admin_group,\n 'menu_ids' => $group_menu_ids\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the value of the Platform property. | public function setPlatform($value)
{
$this->_fields['Platform']['FieldValue'] = $value;
return $this;
} | [
"public function setPlatform(?string $platform);",
"public function setPlatform($platform);",
"private function setPlatform() {\n\t\t$this->platform = $this->path[1];\n\t}",
"public function setTargetPlatform($value)\n {\n $this->targetPlatform = $value;\n }",
"public function setPlatform(?Platform $value): void {\n $this->getBackingStore()->set('platform', $value);\n }",
"public function setPlatform(AbstractPlatform $platform)\n {\n $this->platform = $platform;\n }",
"public function setPlatform($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\MigrationCenter\\V1\\PlatformDetails::class);\n $this->platform = $var;\n\n return $this;\n }",
"public function setPlatformType($val)\n {\n $this->_propDict[\"platformType\"] = $val;\n return $this;\n }",
"public function setPlatform(?PayloadDeliveryPlatform $value): void {\n $this->getBackingStore()->set('platform', $value);\n }",
"public function __construct($platform = 'base')\n {\n $this->platform = $platform;\n }",
"public function setPlatformName($name);",
"public function setPlatformType($var)\n {\n GPBUtil::checkEnum($var, \\Ad\\PlatformType::class);\n $this->platform_type = $var;\n\n return $this;\n }",
"public function setPlatforms(?DeviceManagementConfigurationPlatforms $value): void {\n $this->getBackingStore()->set('platforms', $value);\n }",
"public function withPlatform($value)\n {\n $this->setPlatform($value);\n return $this;\n }",
"public function setPlatformVersion($val)\n {\n $this->_propDict[\"platformVersion\"] = $val;\n return $this;\n }",
"public function getPlatform() {\n return $this->attributes['platform'];\n }",
"protected function getPlatform()\n {\n if (null === $this->platform) {\n $this->platform = new DefaultPlatform();\n }\n\n return $this->platform;\n }",
"public function setPlatforms(?array $value): void {\n $this->getBackingStore()->set('platforms', $value);\n }",
"public function setPlatformVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->platform_version = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a function which replaces markers in the dqlPart WHERE so we can add a grouping after the whole credentials have been added | public function replaceCredentialMarkers()
{
$foundstart = null;
$result = array();
for($i=0; $i < count($this->_dqlParts["where"]); $i++) {
$part = $this->_dqlParts["where"][$i];
if($part == "[[CREDEND]]") {
if ($foundstart !== null) {
$result[] = ")";
}
}
// skip first part after CREDSTART
else if($foundstart === $i-1) {
continue;
}
else if($part == "[[CREDSTART]]") {
$foundstart = $i;
// is the next one not already END?
if(isset($this->_dqlParts["where"][$i+1]) && $this->_dqlParts["where"][$i+1] != "[[CREDEND]]") {
// do we already had other parts?
if(!empty($result)) {
$result[] = "AND";
}
$result[] = "(";
}
else {
// skip it
$i++;
}
}
else {
$result[] = $part;
}
}
$this->_dqlParts["where"] = $result;
} | [
"function ecv_format_data_query($base_query, $entity_id, $group_admin_id){\n\t$results_query = $base_query . '%20AND%20entity_type:' .$entity_id;\n\tif(!isset($_REQUEST['include_admin'])){\n\t\t$results_query .= '%20AND%20-author_entity_id:' . $group_admin_id;\n\t}\t\n\treturn $results_query;\n}",
"protected function buildGroupClause() {\r\n\t\t$sql = '';\r\n\t\tif (count($this->_salt_groups) > 0) {\r\n\t\t\t$sql.=' GROUP BY '.implode(', ', $this->_salt_groups);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}",
"protected function buildAdditionalPartToWhereClause()\n {\n $tableName = $this->getFieldConfigurationAttribute('tableName');\n $uid = $this->getUidForPostProcessor();\n $whereClausePart = ' AND ' . $tableName . '.uid=' . intval($uid);\n\n return $whereClausePart;\n }",
"protected function getGeneralWhereClause() {}",
"private function applyGroupBy() {\n if (!count($this->groupByStatements)) {\n return;\n }\n\n $this->query .= ' group by '.implode(',', $this->groupByStatements);\n }",
"protected function compilePartGroupBy(): string\n {\n if (! empty($this->query['groupBy'])) {\n // Add sorting\n return ' GROUP BY ' . implode(separator: ', ', array: array_map(callback: [$this, 'quoteIdentifier'], array: $this->query['groupBy']));\n }\n\n return '';\n }",
"protected function getGroupWhere()\n\t{\n\t\t$ar = $this->getOwner();\n\n\t\t$where = '';\n\t\tif (!is_array($this->groupDetect)) $this->groupDetect = array($this->groupDetect);\n\n\t\tforeach ($this->groupDetect as $fieldName) {\n\t\t\tassert('is_string($fieldName)');\n\n\t\t\t$value = $ar->$fieldName;\n\n\t\t\tif (is_null($value)) {\n\t\t\t\t$where[] = \"({$fieldName} IS NULL)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$where[] = sprintf(\"{$fieldName} = '%s'\", addslashes($value));\n\t\t}\n\n\t\treturn '(' . implode(' AND ', $where) . ')';\n\t}",
"private function getDistrictWhereClausePart() {\n\t\tif ($this->filterFormData['district'] == 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn ' AND ' . REALTY_TABLE_OBJECTS . '.district = ' .\n\t\t\t$this->filterFormData['district'];\n\t}",
"function _getGroupBy() {\n $groupByClause = $this->scMain['tb_alias'] . '.' . $this->scMain['id'];\n return $groupByClause;\n }",
"protected function _compileLikeSQLStatement()\n\t{\n\t\tif ( $this->_is_grouped === FALSE )\n\t\t{\n\n\t\t\tif ( ! empty( $this->_like ) )\n\t\t\t{\n\t\t\t\tif ( count( $this->_like ) == 1 )\n\t\t\t\t{\n\t\t\t\t\t$this->_where[] = implode( static::$newLineString, $this->_like );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->_where[] = '(' . static::$newLineString . implode( static::$newLineString, $this->_like ) . static::$newLineString . ')';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->_or_like ) )\n\t\t\t{\n\t\t\t\tif ( count( $this->_or_like ) == 1 )\n\t\t\t\t{\n\t\t\t\t\t$this->_or_where[] = implode( static::$newLineString, $this->_or_like );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->_or_where[] = '(' . static::$newLineString . implode( static::$newLineString, $this->_or_like ) . static::$newLineString . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function addGroupQuery(string $value): \\SolrQuery {}",
"private function buildGroupBy(): void {\r\n\r\n if(count($this -> groupBy) > 0) {\r\n\r\n $this -> query[] = 'GROUP BY';\r\n $this -> query[] = implode(', ', $this -> groupBy);\r\n }\r\n }",
"function SqlKeyFilter() {\n\t\treturn \"`id` = '@id@' AND `angsuran` = @angsuran@\";\n\t}",
"abstract protected function beginWhereGroup();",
"private function buildGroupBySection()\n {\n if (count($this->groupBy)) {\n $this->sqlQuery .= \"\\n\" . static::QB_GROUPBY . ' ' . implode(', ', $this->groupBy);\n }\n }",
"private function _createGroupQuery()\n\t{\n\t\treturn craft()->db->createCommand()\n\t\t\t->select('id, fieldId, name, sortOrder')\n\t\t\t->from('neogroups')\n\t\t\t->order('sortOrder');\n\t}",
"function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t\t$sql .= \" AND engine=\".intval($SF[\"engine\"]).\" \\r\\n\";\n\t\treturn substr($sql, 0, -3);\n\t}",
"private function _createGroupQuery()\n\t{\n\t\treturn craft()->db->createCommand()\n\t\t\t->select('id, name')\n\t\t\t->from('fieldgroups')\n\t\t\t->order('name');\n\t}",
"function in_group($column_name, $value, $delim = '.') {\n return \"CONCAT($column_name, '$delim') like '%$value%' \";\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback for Contact Information metabox | function contact_information() {
echo '<p>Online Application URL:<br />';
echo '<input type="text" name="' . $this->get_field_name( 'application_url' ) . '" id="' . $this->get_field_id( 'application_url' ) . '" value="' . esc_attr( $this->get_field_value( 'application_url' ) ) . '" size="50" />';
echo '</p>';
echo '<p>Company NMLS:<br />';
echo '<input type="text" name="' . $this->get_field_name( 'company_nmls' ) . '" id="' . $this->get_field_id( 'company_nmls' ) . '" value="' . esc_attr( $this->get_field_value( 'company_nmls' ) ) . '" size="50" />';
echo '</p>';
echo '<p>Individual NMLS:<br />';
echo '<input type="text" name="' . $this->get_field_name( 'individual_nmls' ) . '" id="' . $this->get_field_id( 'individual_nmls' ) . '" value="' . esc_attr( $this->get_field_value( 'individual_nmls' ) ) . '" size="50" />';
echo '</p>';
echo '<p>Address:<br />';
echo '<textarea name="' . $this->get_field_name( 'address' ) . '" cols="78" rows="8">' . esc_textarea( $this->get_field_value( 'address' ) ) . '</textarea>';
echo '</p>';
echo '<p>Phone Number:<br />';
echo '<input type="text" name="' . $this->get_field_name( 'phone' ) . '" id="' . $this->get_field_id( 'phone' ) . '" value="' . esc_attr( $this->get_field_value( 'phone' ) ) . '" size="50" /><br />';
echo '<input type="checkbox" name="' . $this->get_field_name( 'phone_checkbox' ) . '" id="' . $this->get_field_id( 'phone_checkbox' ) . '" value="1"' . checked( 1, $this->get_field_value( 'phone_checkbox' ), false ) . '" /><label for' . $this->get_field_name( 'phone_checkbox' ) . '>Check to Include in Header</label>';
echo '</p>';
echo '<p>Link to Locations Page:<br />';
echo '<input type="text" name="' . $this->get_field_name( 'locations_page' ) . '" id="' . $this->get_field_id( 'locations_page' ) . '" value="' . esc_attr( $this->get_field_value( 'locations_page' ) ) . '" size="50" /><br />';
echo '<input type="checkbox" name="' . $this->get_field_name( 'locations_checkbox' ) . '" id="' . $this->get_field_id( 'locations_checkbox' ) . '" value="1"' . checked( 1, $this->get_field_value( 'locations_checkbox' ), false ) . '" /><label for' . $this->get_field_name( 'location_checkbox' ) . '>Check to Include in Header</label>';
echo '</p>';
echo '<p>Disclaimer:<br />';
echo '<textarea name="' . $this->get_field_name( 'disclaimer' ) . '" cols="78" rows="8">' . esc_textarea( $this->get_field_value( 'disclaimer' ) ) . '</textarea>';
echo '</p>';
} | [
"public static function add_contact_metabox() {\n\t\tadd_meta_box( 'c2c_last_contacted_info', 'Contact Info', array( __CLASS__, 'display_contact_metabox' ), self::$contact_post_type, 'side', 'default' );\n\t}",
"function ganesh_contact_add_meta_box(){\r\n\tadd_meta_box('contact_email', 'User Email', 'ganesh_contact_email_callback', 'ganesh-contact', 'normal', 'high');\t\r\n}",
"function meta_box_contact_details( $post )\n\t{\n\t\t$agency_name = get_post_meta($post->ID, 'bb-jobs-name', true);\n\t\t$agency_email = get_post_meta($post->ID, 'bb-jobs-email', true);\n\t\t$agency_phone = get_post_meta($post->ID, 'bb-jobs-phone', true);\n\t\t?>\n\n\t<input type=\"hidden\" name=\"bb-jobs_contact_details_nonce\" value=\"<?php echo wp_create_nonce(basename(__FILE__)); ?>\"/>\n\t<div class=\"wrap\">\n\t\t<label for=\"bb-jobs-name\">Name</label>\n\t\t<input type=\"text\" name=\"bb-jobs-name\" id=\"bb-jobs-name\" value=\"<?php echo esc_attr($agency_name); ?>\" class=\"field\"/>\n\t</div>\n\n\t<div class=\"wrap\">\n\t\t<label for=\"bb-jobs-email\">Email</label>\n\t\t<input type=\"text\" name=\"bb-jobs-email\" id=\"bb-jobs-email\" value=\"<?php echo esc_attr($agency_email); ?>\" class=\"field\"/>\n\t</div>\n\n\t<div class=\"wrap\">\n\t\t<label for=\"bb-jobs-phone\">Phone</label>\n\t\t<input type=\"text\" name=\"bb-jobs-phone\" id=\"bb-jobs-phone\" value=\"<?php echo esc_attr($agency_phone); ?>\" class=\"field\"/>\n\t</div>\n\n\t<?php\n\n\t}",
"function ls_contact_add_meta_box(){\n add_meta_box('contact_email', 'User Email', 'ls_contact_email_cb', 'lightsaber-contact', 'side', 'high');\n}",
"function loccontact_meta_box() {\n\t\tglobal $post;\n\t\techo '<table class=\"form-table\">\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_telephone\">' . __( 'Telephone', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_telephone\" type=\"text\" id=\"location_contact_telephone\" value=\"' . get_post_meta( $post->ID, '_location_contact_telephone', true ) . '\" class=\"regular-text\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_email\">' . __( 'Email', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_email\" type=\"text\" id=\"location_contact_email\" value=\"' . get_post_meta( $post->ID, '_location_contact_email', true ) . '\" class=\"regular-text\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t<th scope=\"row\"><label for=\"location_contact_web\">' . __( 'Web', 'locations' ) . '</label></th>\n\t\t\t\t\t\t<td><input name=\"location_contact_web\" type=\"text\" id=\"location_contact_web\" value=\"' . get_post_meta( $post->ID, '_location_contact_web', true ) . '\" class=\"regular-text\" placeholder=\"http://\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>';\n\t\twp_nonce_field( 'update_location_contact', '_nonce_location_contact' );\n\t}",
"function foucs_contact_add_meta_box() {\n\tadd_meta_box(\n\t\t'contact_email', \n\t\t'User Email', \n\t\t'foucs_contact_email_callback', \n\t\t'foucs-contact', \n\t\t'side' \n\t);\n}",
"function register_widget_contact_info() {\n register_widget( 'Widget_Contact_Info' );\n}",
"public function check_infos_contact()\n {\n }",
"function customize_contact_info( $wp_customize ) {\n\n // Add a section for the contact info settings\n $wp_customize->add_section( 'contact_info',\n [\n 'title' => __( 'Contact Info', 'blueleaf' ),\n 'priority' => 30,\n ]\n );\n\n //Add a setting\n $wp_customize->add_setting( 'quick_contact_url',\n [\n 'url' => '',\n 'transport' => 'postMessage',\n 'type' => 'option',\n 'sanitize_callback' => 'absint',\n ]\n );\n\n //Add all the input fields\n $wp_customize->add_control( 'quick_contact_url_control',\n [\n 'label' => __( 'Quick Contact Button Link', 'blueleaf' ),\n 'section' => 'contact_info',\n 'settings' => 'quick_contact_url',\n 'type' => 'dropdown-pages',\n ]\n );\n\n}",
"function displayContactInformation ($settings) {\n\tif ($settings->site_contact->address) {\n\t\techo \"<div class='contact-item'>\";\n\t\t\techo \"<div class='icon fas fa-map-marker-alt'></div>\";\n\t\t\techo \"<div class='title'>Address</div>\";\n\t\t\techo \"<div class='value'>{$settings->site_contact->address1}<br />{$settings->site_contact->address2}</div>\";\n\t\techo \"</div>\";\n\t}\n\tif ($settings->site_contact->email) {\n\t\techo \"<div class='contact-item'>\";\n\t\t\techo \"<div class='icon fas fa-envelope'></div>\";\n\t\t\techo \"<div class='title'>Email</div>\";\n\t\t\techo \"<div class='value'><a href='mailto:{$settings->site_contact->email}'>{$settings->site_contact->email}</a></div>\";\n\t\techo \"</div>\";\n\t}\n\tif ($settings->site_contact->phone) {\n\t\techo \"<div class='contact-item'>\";\n\t\t\techo \"<div class='icon fas fa-phone'></div>\";\n\t\t\techo \"<div class='title'>Phone</div>\";\n\t\t\techo \"<div class='value'>{$settings->site_contact->phone}</div>\";\n\t\techo \"</div>\";\n\t}\n\tif ($settings->site_contact->fax) {\n\t\techo \"<div class='contact-item'>\";\n\t\t\techo \"<div class='icon fas fa-fax'></div>\";\n\t\t\techo \"<div class='title'>Fax</div>\";\n\t\t\techo \"<div class='value'>{$settings->site_contact->fax}</div>\";\n\t\techo \"</div>\";\n\t}\n}",
"public function getContactInfo();",
"function theme_acquia_topbar_contact_info($vars) {\n $out = '';\n if (isset($vars['info']) && !empty($vars['info'])) {\n\tacquia_include('options');\n\t$info = $vars['info'];\n\tif (isset($info['skype']) && !empty($info['skype'])) {\n\t $info['skype'] = '<a href=\"skype:'.$info['skype'].'?call\">' .$info['skype'] .'</a>';\n\t}\n\t$items = array();\n\tforeach($info as $key => $title) {\n\t $item = '<li class=\"ac-'.$key.'-detail detail\">';\n\t $item .= '\t<span class=\"font-icon icon-'.$key.'\"></span>';\n\t $item .= '\t'.$title;\n\t $item .= '</li>';\n\t $items[] = $item;\n\t}\n\n\t$out .= '<section class=\"block ac-topbar-contact-info\">';\n\t$out .= '<ul class=\"ac-s-li\">';\n\t$out .= implode('', $items);\n\t$out .= '</ul>';\n\t$out .= '</section>';\n }\n return $out;\n}",
"public function getContactInformation();",
"public function mwContactPage( $atts ) {\n\t\t\n\t\t\t// company details\n\t\t\t$defaultName = get_bloginfo( \"name\" );\n\t\t\t$companyName = get_option( \"company_name\" );\n\t\t\t\n\t\t\tif ( $companyName ) {\n\n\t\t\t\t$defaultName = $companyName;\n\n\t\t\t};\n\n\t\t\t// other \n\t\t\t$businessType = get_option( \"businessType\" );\n\t\t\t$contactPageText = get_option( \"mw-contact-text\" );\n\t\t\t\n\t\t\tif ( isset( $atts['title'] ) ) {\n\n\t\t\t\t$mwTitle = $atts['title'];\n\n\t\t\t}\n\n\t\t\t// address\n\t\t\t$businessType = get_option( \"businessType\" );\n\t\t\t$streetAddress = get_option( \"street_address\" );\n\t\t\t$streetAddressTwo = get_option( \"street_address_two\" );\n\t\t\t$addressLocality = get_option( \"address_locality\" );\n\t\t\t$addressRegion = get_option( \"address_region\" );\n\t\t\t$postCode = get_option( \"post_code\" );\n\n\n\t\t\t// contact numbers\n\t\t\t$mainNumber = get_option( \"tel_no\" );\n\t\t\t$mainNumberNoSpace = preg_replace(\"/[\\s-]+/\", \"\", $mainNumber);\n\t\t\t$mainNumberNoBrackets = str_replace( array( '(', ')' ), '', $mainNumberNoSpace);\n\t\t\t$faxNumber = get_option( \"fax_no\" );\n\t\t\t$altNumber = get_option( \"alt_no\" );\n\t\t\t$altNoSpace = preg_replace(\"/[\\s-]+/\", \"\", $altNumber);\n\t\t\t$emailAddress = get_option( \"e-mail_address\" );\n\n\t\t\t$html = ' ';\n\t\t\t\t\n\t\t\t$html = '<div id=\"'.$atts[\"id\"].'-address\" class=\"mw-business-details\" itemscope=\"\" itemtype=\"http://schema.org/'.$businessType.'\">';\n\n\t\t\t\t// telephones\n\t\t\t\tif ( $mainNumber || $altNumber || $faxNumber ) {\n\n\t\t\t\t\tif ( isset($mwTitle) ) {\n\n\t\t\t\t\t\t$html .= '<p class=\"schemaTitle h3\">'.$mwTitle.'</p>';\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$html .= '<div class=\"mw-business-details contact-details\"><ul class=\"numbers\">';\n\n\t\t\t\t\t$html .= '<li><a itemprop=\"telephone\" href=\"tel:'.$mainNumberNoBrackets.'\" title=\"Call Today\" id=\"contact-phone\">'.$mainNumber.'</a></li>';\n\t\t\t\t\n\t\t\t\t\tif ($faxNumber) {\n\n\t\t\t\t\t\t$html .= '<li>'.$faxNumber.'</li>';\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif ($altNumber) {\n\t\t\t\t\t\n\t\t\t\t\t\t$html .= '<li><a href=\"tel:'.$altNoSpace.'\" title=\"Call Today\" id=\"contact-mobile-phone\">'.$altNumber.'</a></li>';\n\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($emailAddress) {\n\t\t\t\t\t\n\t\t\t\t\t\t$html .= '<li><a href=\"mailto:'.$emailAddress.'\" title=\"E-Mail Us Today\" id=\"email\">' .$emailAddress.'</a></li>';\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$html .= '</ul></div>';\n\n\t\t\t\t}\n\n\t\t\t\t// address\n\t\t\t\t$html .= '<div itemprop=\"address\" itemscope itemtype=\"http://schema.org/PostalAddress\">';\n\t\t\t\t\n\t\t\t\t\t$html .= '<p class=\"h3 schemaTitle\">Address</p>';\n\t\t\t\t\t$html .= '<p itemprop=\"name\"><strong>'.$defaultName.'</strong></p>';\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<ul class=\"address\">';\n\t\t\t\t\t$html .= '<li itemprop=\"streetAddress\">'.$streetAddress.'</li>';\n\t\t\t\t\t$html .= '<li itemprop=\"streetAddress\">'.$streetAddressTwo.'</li>';\n\t\t\t\t\t$html .= '<li itemprop=\"addressLocality\">'.$addressLocality.'</li>';\n\t\t\t\t\t$html .= '<li itemprop=\"addressRegion\">'.$addressRegion.'</li>';\n\t\t\t\t\t$html .= '<li itemprop=\"postalCode\">'.$postCode.'</li>';\n\t\t\t\t\t$html .= '</ul>';\n\n\t\t\t\t$html .= '</div>';\n\n\t\t\t\t// social\n\t\t\t\t$html .= $this->mwSocialLinks( $atts=array( 'title' => 'Socialise', 'id' => $atts['id'], 'class' => 'social-methods' ) );\n\n\t\t\t\t// opening times\n\t\t\t\t$html .= $this->mwOpeningTimes( $atts=array( 'title' => 'Opening Times', 'schema' => 'hide' ) );\n\n\t\t\t// closing div\n\t\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t\t\n\t}",
"public function display_contact_meta_box( $post ) {\n\t\t$contacts = wp_get_object_terms( $post->ID, 'gs-contact' );\n\t\t$data['contacts'] = array();\n\t\tif ( ! is_wp_error( $contacts ) ) {\n\t\t\tforeach ( $contacts as $contact ) {\n\t\t\t\t$contact_meta = WSUWP_Graduate_Degree_Contact_Taxonomy::get_all_term_meta( $contact->term_id );\n\t\t\t\t$contact_meta['term_id'] = $contact->term_id;\n\t\t\t\t$data['contacts'][] = $contact_meta;\n\t\t\t}\n\t\t}\n\n\t\techo '<div class=\"factsheet-contact-wrapper\">';\n\n\t\tforeach ( $data['contacts'] as $contact ) {\n\t\t\tif ( empty( $contact ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t?>\n\t\t\t<div class=\"factsheet-contact\">\n\t\t\t\t<input type=\"hidden\" name=\"contacts[]\" value=\"<?php echo esc_attr( $contact['term_id'] ); ?>\" />\n\t\t\t\t<address>\n\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_name'][0] ) ) : ?>\n\t\t\t\t\t\t<div><?php echo esc_html( $contact['gs_contact_name'][0] ); ?></div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_address_one'][0] ) ) : ?>\n\t\t\t\t\t\t\t<div><?php echo esc_html( $contact['gs_contact_address_one'][0] ); ?></div>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_address_two'][0] ) ) : ?>\n\t\t\t\t\t\t\t<div><?php echo esc_html( $contact['gs_contact_address_two'][0] ); ?></div>\n\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_city'][0] ) && ! empty( $contact['gs_contact_state'][0] ) ) : ?>\n\t\t\t\t\t\t\t\t<span><?php echo esc_html( $contact['gs_contact_city'][0] ); ?>, <?php echo esc_html( $contact['gs_contact_state'][0] ); ?></span>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_postal'][0] ) ) : ?>\n\t\t\t\t\t\t\t\t<span><?php echo esc_html( $contact['gs_contact_postal'][0] ); ?></span>\n\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_phone'][0] ) ) : ?>\n\t\t\t\t\t\t<div><?php echo esc_html( $contact['gs_contact_phone'][0] ); ?></div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_fax'][0] ) ) : ?>\n\t\t\t\t\t\t<div><?php echo esc_html( $contact['gs_contact_fax'][0] ); ?></div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<?php if ( ! empty( $contact['gs_contact_email'][0] ) ) : ?>\n\t\t\t\t\t\t<div><a href=\"mailto:<?php echo esc_attr( $contact['gs_contact_email'][0] ); ?>\"><?php echo esc_html( $contact['gs_contact_email'][0] ); ?></a></div>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t</address>\n\t\t\t\t<span class=\"remove-factsheet-contact\">Remove</span>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\n\t\techo '</div>' // End factsheet-contact-wrapper.\n\n\t\t// @codingStandardsIgnoreStart\n\t\t?>\n\t\t<script type=\"text/template\" id=\"factsheet-contact-template\">\n\t\t\t<div class=\"factsheet-contact\">\n\t\t\t\t<input type=\"hidden\" name=\"contacts[]\" value=\"<%= contact_term_id %>\" />\n\t\t\t\t<address>\n\t\t\t\t\t<div><%= contact_name %></div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div><%= contact_address_one %></div>\n\t\t\t\t\t\t<div><%= contact_address_two %></div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<span><%= contact_city %>, <%= contact_state %></span>\n\t\t\t\t\t\t\t<span><%= contact_postal %></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div><%= contact_phone %></div>\n\t\t\t\t\t<div><%= contact_fax %></div>\n\t\t\t\t\t<div><%= contact_email %></div>\n\t\t\t\t</address>\n\t\t\t\t<span class=\"remove-factsheet-contact\">Remove</span>\n\t\t\t</div>\n\t\t</script>\n\t\t<div class=\"add-contact-wrapper\">\n\t\t\t<label for=\"contact-entry\">Add Contact:</label>\n\t\t\t<input type=\"text\" id=\"contact-entry\" value=\"\" />\n\t\t</div>\n\t\t<?php\n\t\t// @codingStandardsIgnoreEnd\n\t}",
"function mardiio_add_contact_form_meta_box() {\n add_meta_box( 'mardiio-user-email', 'User Email', 'mardiio_add_user_email', 'mardiio-contact-form', 'side' );\n}",
"function add_cafe_meta_boxes() {\r\n\tadd_meta_box(\"cafe_contact_meta\", \"Members Info\", \"add_contact_details_cafe_meta_box\", \"team\", \"normal\", \"low\");\r\n}",
"public function contact_info( $args ) {\n\t\t$args = shortcode_atts(\n\t\t\t[\n\t\t\t\t'show' => 'all',\n\t\t\t\t'class' => '',\n\t\t\t],\n\t\t\t$args,\n\t\t\t'contact-info'\n\t\t);\n\n\t\t$allowed = $this->get_allowed_info( $args );\n\n\t\twp_enqueue_style( 'rank-math-contact-info', rank_math()->assets() . 'css/rank-math-contact-info.css', null, rank_math()->version );\n\n\t\tob_start();\n\t\techo '<div class=\"' . $this->get_contact_classes( $allowed, $args['class'] ) . '\">';\n\n\t\tforeach ( $allowed as $element ) {\n\t\t\t$method = 'display_' . $element;\n\t\t\tif ( method_exists( $this, $method ) ) {\n\t\t\t\techo '<div class=\"rank-math-contact-section rank-math-contact-' . esc_attr( $element ) . '\">';\n\t\t\t\t$this->$method();\n\t\t\t\techo '</div>';\n\t\t\t}\n\t\t}\n\n\t\techo '</div>';\n\t\techo '<div class=\"clear\"></div>';\n\n\t\treturn ob_get_clean();\n\t}",
"public function city_callback() {\n\t\t\n\t\t$settings = (array) get_option( 'prop-contact-info' );\n $city = esc_attr( $settings['prop-city'] );\n\t\techo \"<input type='text' name='prop-contact-info[prop-city]' value='$city' />\";\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
_getLocale: renvoi un label dans la langue | public function _getLocale($aLabel)
{
if ( empty($aLabel) ) return $aLabel;
if (!is_string($aLabel)) return $aLabel;
$str = $aLabel;
if (!strchr($str, '::') && defined($aLabel))
{
$str = constant($aLabel);
}
return nl2br(htmlentities($str, NULL, 'UTF-8'));
} | [
"public function translateLabel($locale = NULL);",
"public function localize($lang = null);",
"public function translateLabel($label){\n // echo $label . $this->terms[$label][\"Translated\"] . $this->lang;\n if(key_exists($label, $this->terms) && $this->terms->$label->Translated){\n $lang = $this->lang;\n return $this->terms->$label->$lang;\n }else\n return $label;\n }",
"function atrans($label, $locale = null)\n {\n return app('aalberts-translate')->translate($label, $locale);\n }",
"public function getTranslatedLabel()\n {\n return $this->translatedLabel;\n }",
"function locale_get_display_language($locale, $in_locale){}",
"abstract public function getLocaleName();",
"public static function getDisplayLanguage($locale, $in_locale){}",
"function setLanguage(/*...*/);",
"private function set_locale()\n {\n // Setup localization from referer\n if (Arr::get($this->request->headers(), 'referer') !== null)\n {\n I18n::$lang = substr(ltrim(Arr::get($this->request->headers(), 'referer'), 'http://'), 0, 2);\n }\n // Setup localization from GET if exists\n if ($this->request->param('lang') !== null)\n {\n I18n::$lang = $this->request->param('lang');\n\n Cookie::set('lang', I18n::$lang);\n $this->redirect($this->request->referrer());\n }\n // or form Cookie\n elseif (Cookie::get('lang') !== null)\n {\n I18n::$lang = Cookie::get('lang');\n }\n // or from headers\n else\n {\n I18n::$lang = substr(Arr::get($this->request->headers(), 'accept-language'), 0, 2);\n Cookie::set('lang', I18n::$lang);\n }\n }",
"public function getTranslationByOriginalLabel($originalLabel, Locale $locale, $pluralForm = null, $sourceName = 'Main', $packageKey = 'Neos.Flow');",
"protected function _label_translation($label) {\n if (!$this->is_translated()) {\n return (string)$label;\n }\n \n // The @ref attribute will look like:\n // jr:itext('/survey_7_xls/section1/q11_other:label')\n $ref = (string)$label['ref'];\n \n // Extract path: /survey_7_xls/section1/q11_other:label\n if (!preg_match(\"/jr:itext\\\\(\\'(.*)\\'\\\\)/\", $ref, $matches)) {\n return NULL;\n }\n // Translation path will be the first captured result.\n $translation_path = $matches[1];\n \n $translations = array();\n foreach ($this->languages as $lang) {\n $translation_value = $this->xform->xpath(sprintf('//d:itext/d:translation[@lang=\"%s\"]//*[@id=\"%s\"]/d:value', $lang, $translation_path));\n $translations[$lang] = empty($translation_value) ? NULL : (string)$translation_value[0];\n }\n \n return $translations;\n }",
"private function set_locale() {\n\n\t\t$plugin_i18n = new WP_Carousel_Pro_I18n();\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}",
"public static function getPrimaryLanguage($locale){}",
"function localization() {\n load_plugin_textdomain( 'cynetique-labels', false, dirname( plugin_basename( __FILE__ ) ) . '/language/' );\n}",
"public function setLocalization( $value );",
"public function GetLocalization ();",
"function localize_on_ajax(){\n\t\tglobal $sitepress;\n\n\t\t$current_language = $sitepress->get_current_language();\n\n\t\t$sitepress->switch_lang( $current_language, true );\n\t}",
"function switch_to_locale($locale)\n{\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Sqlite database size in bytes | public function getDatabaseSize()
{
return DB_DRIVER === 'sqlite' ? filesize(DB_FILENAME) : 0;
} | [
"public static function get_database_size() {}",
"public function dbSize() {}",
"private function get_DB_size() {\n global $DB;\n $sql = \"SELECT table_name AS table_name,\n ROUND(((data_length + index_length) / 1024 / 1024), 2) AS table_size\n FROM information_schema.TABLES\n WHERE table_schema = :databasename\n ORDER BY (data_length + index_length) DESC;\";\n\n $params = ['databasename' => $this->get_DB_name()];\n $records = $DB->get_records_sql($sql, $params);\n $total = 0;\n\n foreach ($records as $record) {\n $total += (float) $record->table_size;\n }\n return $total . \" MB\"; // Total is in MB\n }",
"public function databaseSize() {\n $selfRecord = $this->siteAliasManager()->getSelf();\n\n /** @var \\Consolidation\\SiteProcess\\SiteProcess $process */\n $process = $this->processManager()->drush($selfRecord, 'core-status', [], [\n 'fields' => 'db-name',\n 'format' => 'json',\n ]);\n\n $process->run();\n $result = $process->getOutputAsJson();\n\n if (isset($result['db-name'])) {\n $db = $result['db-name'];\n $args = [\"SELECT SUM(ROUND(((data_length + index_length) / 1024 / 1024), 2)) AS \\\"Size\\\" FROM information_schema.TABLES WHERE table_schema = \\\"$db\\\";\"];\n $options = ['yes' => TRUE];\n $process = $this->processManager()->drush($selfRecord, 'sql:query', $args, $options);\n $process->mustRun();\n $output = trim($process->getOutput());\n return \"{$output} MB\";\n }\n }",
"public function db_size(string $database = '');",
"public function db_size(){\n return $this->redis->dbSize();\n }",
"public function size()\n {\n $sql = <<<SQL\nselect round(sum(data_length + index_length) / 1024 / 1024, 1) \"size_mb\"\nfrom information_schema.tables where table_schema = :db\nSQL;\n $result = $this->db->exec($sql, [\n ':db'=>$this->db->name(),\n ]);\n\n return $result?$result[0]['size_mb']:0;\n }",
"public function tamanhoDatabase()\n {\n $objDB = $this->getAdapter();\n $coInfo = $objDB->getConfig();\n $sql = \"select * from pg_database_size('{$coInfo['dbname']}')\";\n return $objDB->query($sql)->fetchObject();\n }",
"public function getDbSizeInUse()\n {\n return $this->dbSizeInUse;\n }",
"function db_size( $opt_val_db = 10, $spacecalc_db = 1024 ) {\r\n\t\t$rows = mysql_query( \"SHOW table STATUS\" );\r\n\t\t$dbsize = 0;\r\n\t\t\r\n\t\twhile ( $row = mysql_fetch_array( $rows ) ) {\r\n\t\t\t$dbsize += $row['Data_length'] + $row['Index_length'];\r\n\t\t}\r\n\t\t\r\n\t\tif ( $opt_val_db )\r\n\t\t\tif ( $dbsize > $opt_val_db * $spacecalc_db ) {\r\n\t\t\t\t$color = \"red\";\r\n\t\t\t} else {\r\n\t\t\t\t$color = \"green\";\r\n\t\t\t}\r\n\t\t\r\n\t\t$dbsize = file_size_info( $dbsize );\r\n\t\t\r\n\t\treturn \"{$dbsize ['size']} {$dbsize['type']}\";\r\n\t}",
"protected function getSqliteTableSize(ConnectionInterface $connection, string $table)\n {\n try {\n $result = $connection->selectOne('SELECT SUM(pgsize) AS size FROM dbstat WHERE name=?', [\n $table,\n ]);\n\n return Arr::wrap((array) $result)['size'];\n } catch (QueryException) {\n return null;\n }\n }",
"public function DBsize();",
"public function get_current_db_size() {\n\n\t\t$wp_optimize = WP_Optimize();\n\n\t\t$wpdb = $GLOBALS['wpdb'];\n\t\t$total_gain = 0;\n\t\t$total_size = 0;\n\t\t$no = 0;\n\t\t$row_usage = 0;\n\t\t$data_usage = 0;\n\t\t$index_usage = 0;\n\t\t$overhead_usage = 0;\n\t\t\n\t\t$tablesstatus = $this->get_tables();\n\n\t\tforeach ($tablesstatus as $tablestatus) {\n\t\t\t$row_usage += $tablestatus->Rows;\n\t\t\t$data_usage += $tablestatus->Data_length;\n\t\t\t$index_usage += $tablestatus->Index_length;\n\n\t\t\tif ('InnoDB' != $tablestatus->Engine) {\n\t\t\t\t$overhead_usage += $tablestatus->Data_free;\n\t\t\t\t$total_gain += $tablestatus->Data_free;\n\t\t\t}\n\t\t}\n\n\t\t$total_size = ($data_usage + $index_usage);\n\t\treturn array($wp_optimize->format_size($total_size), $wp_optimize->format_size($total_gain));\n\t}",
"public function getTableSizeBytes()\n {\n return $this->tableSizeBytes;\n }",
"function dbFieldSize()\n {\n return $this->hasFlag(AF_IP_STORENUMERIC) ? 32 : 15;\n }",
"function DB_size($database) {\r\n\t$sql = \"SHOW TABLE STATUS FROM \".$database;\r\n\t$result = mysql_query($sql);\r\n\tif ($result) {\r\n\t\t$size = 0;\r\n\t\twhile ($data = mysql_fetch_array($result)) {\r\n\t\t\t$size = $size + $data[\"Data_length\"] + $data[\"Index_length\"];\r\n\t\t}\r\n\t\treturn $size;\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}",
"public function getSizeBytes()\n {\n return $this->size_bytes;\n }",
"public function getLocalStorageSize()\n {\n return $this->driverCommand(BaseConstants::$GET, '/local_storage/size');\n }",
"function qa_db_table_size()\n{\n\tif (defined('QA_MYSQL_USERS_PREFIX')) { // check if one of the prefixes is a prefix itself of the other\n\t\tif (stripos(QA_MYSQL_USERS_PREFIX, QA_MYSQL_TABLE_PREFIX) === 0)\n\t\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX);\n\t\telseif (stripos(QA_MYSQL_TABLE_PREFIX, QA_MYSQL_USERS_PREFIX) === 0)\n\t\t\t$prefixes = array(QA_MYSQL_USERS_PREFIX);\n\t\telse\n\t\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX, QA_MYSQL_USERS_PREFIX);\n\n\t} else\n\t\t$prefixes = array(QA_MYSQL_TABLE_PREFIX);\n\n\t$size = 0;\n\tforeach ($prefixes as $prefix) {\n\t\t$statuses = qa_db_read_all_assoc(qa_db_query_raw(\n\t\t\t\"SHOW TABLE STATUS LIKE '\" . $prefix . \"%'\"\n\t\t));\n\n\t\tforeach ($statuses as $status)\n\t\t\t$size += $status['Data_length'] + $status['Index_length'];\n\t}\n\n\treturn $size;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================ Retourne des infos sur l'admin ldap | function get_infos_admin_ldap(){
//global $dn;
global $ldap_base_dn;
$adminLdap=array();
// Etablir la connexion au serveur et la selection de la base?
$sql="SELECT value FROM params WHERE name='adminRdn'";
$res1=mysqli_query($GLOBALS["___mysqli_ston"], $sql);
if(mysqli_num_rows($res1)==1){
$lig_tmp=mysqli_fetch_object($res1);
$adminLdap["adminDn"]=$lig_tmp->value.",".$ldap_base_dn;
}
$sql="SELECT value FROM params WHERE name='adminPw'";
$res2=mysqli_query($GLOBALS["___mysqli_ston"], $sql);
if(mysqli_num_rows($res2)==1){
$lig_tmp=mysqli_fetch_object($res2);
$adminLdap["adminPw"]=$lig_tmp->value;
}
return $adminLdap;
} | [
"public function get_details_from_ldap() {\n\t\tglobal $config;\n\t\t$attributes = array();\n\t\t$attributes[] = 'dn';\n\t\t$attributes[] = $config['ldap']['user_id'];\n\t\t$attributes[] = $config['ldap']['user_name'];\n\t\t$attributes[] = $config['ldap']['user_email'];\n\t\t$attributes[] = $config['ldap']['group_member_value'];\n\t\tif(isset($config['ldap']['user_active'])) {\n\t\t\t$attributes[] = $config['ldap']['user_active'];\n\t\t}\n\t\t$ldapusers = $this->ldap->search($config['ldap']['dn_user'], LDAP::escape($config['ldap']['user_id']).'='.LDAP::escape($this->uid), array_keys(array_flip($attributes)));\n\t\tif($ldapuser = reset($ldapusers)) {\n\t\t\t$this->auth_realm = 'LDAP';\n\t\t\t$this->uid = $ldapuser[strtolower($config['ldap']['user_id'])];\n\t\t\t$this->name = $ldapuser[strtolower($config['ldap']['user_name'])];\n\t\t\t$this->email = $ldapuser[strtolower($config['ldap']['user_email'])];\n\t\t\tif(isset($config['ldap']['user_active'])) {\n\t\t\t\t$this->active = 0;\n\t\t\t\tif(isset($config['ldap']['user_active_true'])) {\n\t\t\t\t\t$this->active = intval($ldapuser[strtolower($config['ldap']['user_active'])] == $config['ldap']['user_active_true']);\n\t\t\t\t} elseif(isset($config['ldap']['user_active_false'])) {\n\t\t\t\t\t$this->active = intval($ldapuser[strtolower($config['ldap']['user_active'])] != $config['ldap']['user_active_false']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->active = 1;\n\t\t\t}\n\t\t\t$this->admin = 0;\n\t\t\t$group_member = $ldapuser[strtolower($config['ldap']['group_member_value'])];\n\t\t\t$ldapgroups = $this->ldap->search($config['ldap']['dn_group'], LDAP::escape($config['ldap']['group_member']).'='.LDAP::escape($group_member), array('cn'));\n\t\t\tforeach($ldapgroups as $ldapgroup) {\n\t\t\t\tif($ldapgroup['cn'] == $config['ldap']['admin_group_cn']) $this->admin = 1;\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new UserNotFoundException('User does not exist in LDAP.');\n\t\t}\n\t}",
"private function getAdminInformation()\n {\n global $db;\n $userQry = 'SELECT email,firstname,lastname \r\n\t \t\t\t\t FROM ' . DB_PREFIX . '_acl_user As usr\r\n\t\t\t\t\t\t\tINNER JOIN (SELECT MIN(user_id) AS usr_id FROM ' . DB_PREFIX . '_acl_user) AS users ON (usr_id = usr.user_id)\r\n\t\t\t\t\t\t\tWHERE user_id = (SELECT c.group_id FROM ' . DB_PREFIX\n . '_acl_groups As c INNER JOIN (SELECT MIN(user_id) AS id FROM ' . DB_PREFIX\n . '_acl_user) AS custId ON (custId.id = c.group_id))';\n $result = $db->Execute($userQry);\n\n return $result->fields;\n }",
"public function _load_ldap_info()\n\t{\n // phpcs:enable\n\t\tglobal $conf,$langs;\n\n\t\t$info=array();\n\t\t$keymodified=false;\n\n\t\t// Object classes\n\t\t$info[\"objectclass\"]=explode(',', $conf->global->LDAP_USER_OBJECT_CLASS);\n\n\t\t$this->fullname=$this->getFullName($langs);\n\n\t\t// Possible LDAP KEY (constname => varname)\n\t\t$ldapkey = array(\n\t\t\t'LDAP_FIELD_FULLNAME'\t=> 'fullname',\n\t\t\t'LDAP_FIELD_NAME'\t\t=> 'lastname',\n\t\t\t'LDAP_FIELD_FIRSTNAME'\t=> 'firstname',\n\t\t\t'LDAP_FIELD_LOGIN'\t\t=> 'login',\n\t\t\t'LDAP_FIELD_LOGIN_SAMBA'=> 'login',\n\t\t\t'LDAP_FIELD_PHONE'\t\t=> 'office_phone',\n\t\t\t'LDAP_FIELD_MOBILE'\t\t=> 'user_mobile',\n\t\t\t'LDAP_FIELD_FAX'\t\t=> 'office_fax',\n\t\t\t'LDAP_FIELD_MAIL'\t\t=> 'email',\n\t\t\t'LDAP_FIELD_SID'\t\t=> 'ldap_sid',\n\t\t\t'LDAP_FIELD_SKYPE'\t\t=> 'skype',\n\t\t\t'LDAP_FIELD_TWITTER'\t=> 'twitter',\n\t\t\t'LDAP_FIELD_FACEBOOK'\t=> 'facebook',\n 'LDAP_FIELD_LINKEDIN'\t=> 'linkedin'\n\t\t);\n\n\t\t// Champs\n\t\tforeach ($ldapkey as $constname => $varname)\n\t\t{\n\t\t\tif (! empty($this->$varname) && ! empty($conf->global->$constname))\n\t\t\t{\n\t\t\t\t$info[$conf->global->$constname] = $this->$varname;\n\n\t\t\t\t// Check if it is the LDAP key and if its value has been changed\n\t\t\t\tif (! empty($conf->global->LDAP_KEY_USERS) && $conf->global->LDAP_KEY_USERS == $conf->global->$constname)\n\t\t\t\t{\n\t\t\t\t\tif (! empty($this->oldcopy) && $this->$varname != $this->oldcopy->$varname) $keymodified=true; // For check if LDAP key has been modified\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($this->address && ! empty($conf->global->LDAP_FIELD_ADDRESS))\t\t\t$info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address;\n\t\tif ($this->zip && ! empty($conf->global->LDAP_FIELD_ZIP))\t\t\t\t\t$info[$conf->global->LDAP_FIELD_ZIP] = $this->zip;\n\t\tif ($this->town && ! empty($conf->global->LDAP_FIELD_TOWN))\t\t\t\t\t$info[$conf->global->LDAP_FIELD_TOWN] = $this->town;\n\t\tif ($this->note_public && ! empty($conf->global->LDAP_FIELD_DESCRIPTION))\t$info[$conf->global->LDAP_FIELD_DESCRIPTION] = dol_string_nohtmltag($this->note_public, 2);\n\t\tif ($this->socid > 0)\n\t\t{\n\t\t\t$soc = new Societe($this->db);\n\t\t\t$soc->fetch($this->socid);\n\n\t\t\t$info[$conf->global->LDAP_FIELD_COMPANY] = $soc->name;\n\t\t\tif ($soc->client == 1) $info[\"businessCategory\"] = \"Customers\";\n\t\t\tif ($soc->client == 2) $info[\"businessCategory\"] = \"Prospects\";\n\t\t\tif ($soc->fournisseur == 1) $info[\"businessCategory\"] = \"Suppliers\";\n\t\t}\n\n\t\t// When password is modified\n\t\tif (! empty($this->pass))\n\t\t{\n\t\t\tif (! empty($conf->global->LDAP_FIELD_PASSWORD))\t\t\t\t$info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass;\t// this->pass = mot de passe non crypte\n\t\t\tif (! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED))\t\t$info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)\n\t\t}\n\t\t// Set LDAP password if possible\n\t\telseif ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password\n\t\t{\n\t\t\tif (! empty($conf->global->DATABASE_PWD_ENCRYPTED))\n\t\t\t{\n\t\t\t\t// Just for the default MD5 !\n\t\t\t\tif (empty($conf->global->MAIN_SECURITY_HASH_ALGO))\n\t\t\t\t{\n\t\t\t\t\tif ($this->pass_indatabase_crypted && ! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED))\t{\n\t\t\t\t\t\t$info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase_crypted, 5); // Create OpenLDAP MD5 password from ERP MD5 password\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Use $this->pass_indatabase value if exists\n\t\t\telseif (! empty($this->pass_indatabase))\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->LDAP_FIELD_PASSWORD))\t\t\t\t$info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass_indatabase;\t// $this->pass_indatabase = mot de passe non crypte\n\t\t\t\tif (! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED))\t\t$info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption\n\t\t\t}\n\t\t}\n\n\t\tif ($conf->global->LDAP_SERVER_TYPE == 'egroupware')\n\t\t{\n\t\t\t$info[\"objectclass\"][4] = \"phpgwContact\"; // compatibilite egroupware\n\n\t\t\t$info['uidnumber'] = $this->id;\n\n\t\t\t$info['phpgwTz'] = 0;\n\t\t\t$info['phpgwMailType'] = 'INTERNET';\n\t\t\t$info['phpgwMailHomeType'] = 'INTERNET';\n\n\t\t\t$info[\"phpgwContactTypeId\"] = 'n';\n\t\t\t$info[\"phpgwContactCatId\"] = 0;\n\t\t\t$info[\"phpgwContactAccess\"] = \"public\";\n\n\t\t\tif (dol_strlen($this->egroupware_id) == 0)\n\t\t\t{\n\t\t\t\t$this->egroupware_id = 1;\n\t\t\t}\n\n\t\t\t$info[\"phpgwContactOwner\"] = $this->egroupware_id;\n\n\t\t\tif ($this->email) $info[\"rfc822Mailbox\"] = $this->email;\n\t\t\tif ($this->phone_mobile) $info[\"phpgwCellTelephoneNumber\"] = $this->phone_mobile;\n\t\t}\n\n\t\treturn $info;\n\t}",
"protected function getLdapAccountDetails()\n\t{\n\t\t$ldap = new ZendLdap($this->config['LdapAuthentication']);\n\t\t\n\t\t//try binding to access-management-management more user details if a password has been provided\n\t\tif($this->password !== null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$ldap->bind($this->user->getUsername(),$this->password);\n\t\t\t} // if bind fails we can still fallback to anon access-management-management\n\t\t\tcatch(LdapException $e){}\n\t\t}\n\t\t\n\t\treturn $ldap->getEntry('uid='.$this->user->getUsername().','.$this->config['LdapAuthentication']['username']);\n\t}",
"public function ldapUsers(){\n\t\t// get all ldap users..\n\t\t\t \n\t\t// Get varaibles from config..\n\t\t$ldapURL = config('ldap.server') ;\n\t\t$ldaprdn = config('ldap.ldaprdn');\n\t\t$ldappass = config('ldap.ldappass');\n\t\n\t\t$ldapconn = ldap_connect($ldapURL );\n\t\t\n\t\tif(!$ldapconn){\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\tif ($ldapconn) {\n\t\t\t$ldapbind = @ldap_bind($ldapconn, $ldaprdn, $ldappass);\n\t\t}\n\t\t\t\n\t\t// Variables to request from ldap \t\t\n\t\t$attrs = array(\"description\", \"name\", \"mail\",\"givenName\",\"sn\",\"telephoneNumber\",\"initials\",\"ou\");\n\t\n\t\t// May tweak for diferent ldap integration.\n\t\t$result = ldap_search($ldapconn, 'ou=Users,ou=CAD,ou=Enterprise,DC=PBCGOV,DC=ORG',\"(&(|(memberOf=CN=CAD-Users,OU=Groups,OU=Users,OU=CAD,OU=Enterprise,DC=pbcgov,DC=org)(memberOf=CN=CAD-ALL COURT ADMINISTRATION,OU=Distribution Lists,OU=Users,OU=CAD,OU=Enterprise,DC=pbcgov,DC=org))(!(sAMAccountName=CAD-*))(!(sAMAccountName=2*)) (!(sAMAccountName=\\$*)))\", $attrs);\n\t\t$info = ldap_get_entries($ldapconn, $result);\n\t \n\t \n\t\tforeach($info as $key=>$value ){\n\t\t\t$name = $info[$key]['givenname'][0];\n\t\t\t$lastname = $info[$key]['sn'][0];\n\t\t\t\n\t\t\tif(isset( $info[$key]['mail'][0])){\n\t\t\t\t$email = $info[$key]['mail'][0];\n\t\t\t}else{\n\t\t\t\t$email = '';\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($info[$key]['telephonenumber'][0])){\n\t\t\t\t$phone = $info[$key]['telephonenumber'][0];\n\t\t\t}else{\n\t\t\t\t$phone = '';\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($info[$key]['initials'][0] )){\n\t\t\t\t$initial = $info[$key]['initials'][0];\n\t\t\t}else{\n\t\t\t\t$initial = '';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(trim($email) != ''){\n\t\t\t\t$username = trim(strtolower(str_replace('@pbcgov.org','',$email))); \n\t\t\t\t\n\t\t\t\t$activeDirectoryUsers[] = array(\n\t\t\t\t\t'name'=>$name,\n\t\t\t\t\t'initial'=>$initial,\n\t\t\t\t\t'lastname'=>$lastname,\n\t\t\t\t\t'email'=>$email,\n\t\t\t\t\t'phone'=>$phone,\n\t\t\t\t\t'username'=>$username\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $activeDirectoryUsers;\n\t\t\n\t\t\n\t}",
"function ldap_admin_connect() {\n global $ldap;\n $stderr = fopen('php://stderr', 'w');\n $try=0;\n\n ldap_set_option($ldap['conn'], LDAP_OPT_PROTOCOL_VERSION, 3);\n\n do {\n $try++;\n\n // Get admin password for LDAP, connect\n system(\"stty -echo\");\n fputs($stderr, \"LDAP Admin password: \");\n $admin_passwd=fscanf(STDIN, \"%s\");\n $admin_passwd=$admin_passwd[0];\n fputs($stderr, \"\\n\");\n system(\"stty echo\");\n\n @$result=ldap_bind($ldap['conn'], \"cn={$ldap['admin_name']},{$ldap['basedn']}\", $admin_passwd);\n\n if(!$result)\n fputs($stderr, \"Error connecting to LDAP: \".ldap_error($ldap['conn']).\"\\n\");\n\n } while((!$result)&&($try<3));\n\n if(!$result) {\n fputs($stderr, \"!! Connecting to LDAP as admin failed.\\n\");\n exit();\n }\n\n return $result;\n}",
"function SERVER_LDAPInfo()\n{\n\t//Get the status about open ports of the LDAP server\n\t$ldapPortStatus = SERVER_runInBackground('ldapPortStatus', \"lsof -i | grep slapd | tr -s '[:blank:]'\", \"root\", false);\n\n\treturn(nl2br($ldapPortStatus));\n}",
"function user_search_dn ( $login ,$dn ) {\n global $error, $ldap_server, $ldap_port, $ldap_base_dn, $ldap_login_attr,$peopleRdn;\n global $adminDn,$adminPw;\n\n $ret = false;\n echo $peopleDn;\n $ds = @ldap_connect ( $ldap_server, $ldap_port );\n if ( $ds ) {\n if ( $adminDn != \"\") {\n $r = @ldap_bind ( $ds, $adminDn, $adminPw ); // bind as administrator\n\n } else {\n $r = @ldap_bind ( $ds ); // bind as anonymous\n }\n if (!$r) {\n $error = \"Invalid Admin's login for LDAP Server\";\n } else {\n $sr = @ldap_search ( $ds, \"$peopleRdn,$ldap_base_dn\", \"($ldap_login_attr=$login)\");\n if (!$sr) {\n $error = \"Error searching LDAP server: \" . ldap_error($ds);\n } else {\n $info = @ldap_get_entries ( $ds, $sr );\n if ( $info[\"count\"] != 1 ) {\n $error = \"Invalid login\";\n } else {\n $ret = true;\n $dn = $info[0][\"dn\"];\n // echo \"Found dn : $dn\\n\";\n }\n @ldap_free_result ( $sr );\n }\n @ldap_close ( $ds );\n }\n } else {\n $error = \"Error connecting to LDAP server\";\n $ret = false;\n }\n return $ret;\n}",
"function auth_get_userinfo($username){\n global $CFG;\n $ldapconnection=auth_ldap_connect();\n $config = (array)$CFG;\n $attrmap = auth_ldap_attributes();\n \n $result = array();\n $search_attribs = array();\n \n foreach ($attrmap as $key=>$values) {\n if (!is_array($values)) {\n $values = array($values);\n }\n foreach ($values as $value) {\n if (!in_array($value, $search_attribs)) {\n array_push($search_attribs, $value);\n } \n }\n }\n\n $user_dn = auth_ldap_find_userdn($ldapconnection, $username);\n\n if (empty($CFG->ldap_objectclass)) { // Can't send empty filter\n $CFG->ldap_objectclass=\"objectClass=*\";\n }\n \n $user_info_result = ldap_read($ldapconnection,$user_dn,$CFG->ldap_objectclass, $search_attribs);\n\n if ($user_info_result) {\n $user_entry = ldap_get_entries($ldapconnection, $user_info_result);\n foreach ($attrmap as $key=>$values){\n if (!is_array($values)) {\n $values = array($values);\n }\n $ldapval = NULL;\n foreach ($values as $value) {\n if(is_array($user_entry[0][strtolower($value)])) {\n $newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)][0])));\n }\n else {\n $newval = addslashes(stripslashes(utf8_decode($user_entry[0][strtolower($value)])));\n }\n if (!empty($newval)) { // favour ldap entries that are set\n $ldapval = $newval;\n } \n }\n $result[$key] = $ldapval;\n }\n }\n\n @ldap_close($ldapconnection);\n \n return $result;\n}",
"public function get_server_list()\n {\n if (!defined('C__MODULE__LDAP') || !defined('C__MODULE__SYSTEM')) {\n return false;\n }\n $l_ldap = new isys_ldap_dao(isys_application::instance()->database);\n\n $l_data = $l_ldap->get_data();\n\n if ($l_data->num_rows() > 0) {\n $objectListLink = isys_helper_link::create_url([\n C__GET__MODULE_ID => C__MODULE__SYSTEM,\n C__GET__MODULE_SUB_ID => C__MODULE__LDAP,\n C__GET__TREE_NODE => $_GET[C__GET__TREE_NODE],\n C__GET__SETTINGS_PAGE => C__LDAPPAGE__CONFIG,\n 'id' => '[{isys_ldap__id}]'\n ]);\n\n $l_objList = new isys_component_list(null, $l_data);\n $l_objList->config(\n [\n 'isys_ldap__id' => 'ID',\n 'isys_ldap_directory__title' => 'Directory',\n 'isys_ldap__hostname' => 'Host',\n 'isys_ldap__port' => 'Port',\n 'isys_ldap__dn' => 'Login',\n 'isys_ldap__user_search' => 'Search',\n 'isys_ldap__filter' => 'Filter',\n 'isys_ldap__active' => 'Active',\n ],\n $objectListLink,\n '[{isys_ldap__id}]'\n );\n\n $l_objList->createTempTable();\n\n return $l_objList->getTempTableHtml();\n }\n\n return false;\n }",
"function checkLoginDataInActiveDirectory($username = NULL, $password = NULL){\n\n // username or password can't be empty\n if(empty($username) || empty($password)){\n return NULL;\n }\n\n // details of the connection\n $adServer = 'ldap://bp-dc1.as.local';\n $ldap = ldap_connect($adServer);\n $ldaprdn = 'as' . '\\\\' . $username;\n\n ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);\n ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);\n\n $bind = @ldap_bind($ldap, $ldaprdn, $password);\n\n if ($bind) {\n $filter=\"(sAMAccountName=$username)\";\n $result = ldap_search($ldap,'dc=as,dc=local',$filter);\n\n ldap_sort($ldap,$result,'sn');\n $info = ldap_get_entries($ldap, $result);\n\n for ($i=0; $i<$info['count']; $i++){\n if($info['count'] > 1) break;\n\n $data = [];\n $data['fullname'] = $info[$i]['givenname'][0] . ' ' . $info[$i]['sn'][0];\n $data['firstname'] = $info[$i]['sn'][0];\n $data['lastname'] = $info[$i]['givenname'][0];\n $data['email'] = $info[$i]['mail'][0];\n $data['company'] = $info[$i]['company'][0];\n $data['permission'] = [];\n $data['permission']['write'] = NULL;\n $data['permission']['read'] = NULL;\n\n // check the group\n foreach($info[$i]['memberof'] AS $group){\n $groupDetail = explode(',', $group);\n\n if($groupDetail[0] == 'CN=Rejtveny_RW'){\n $data['permission']['read'] = TRUE;\n $data['permission']['write'] = TRUE;\n }\n\n if($groupDetail[0] == 'CN=Rejtveny_R'){\n $data['permission']['read'] = TRUE;\n }\n\n }\n }\n print_r($data);\n\n @ldap_close($ldap);\n\n } else {\n $data = NULL;\n }\n\n return $data;\n}",
"public function getLdap() {\n return $this->ldap;\n }",
"function getGroupDNsFromSAM($ldap_conn, $baseOU, $groupList)\n{\n\n //needed in case user searches from the root of the domain\n ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);\n ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);\n $groupDNList = array();\n //grab only the DN\n $attributes = array(\"dn\");\n\n if (bind_to_server($ldap_conn, APP_LDAP_USER, APP_LDAP_PASS)) {\n foreach ($groupList as $group) {\n $filter = \"(&(objectCategory=Group)(sAMAccountName=\" . $group . \"))\";\n $result = ldap_search($ldap_conn, $baseOU, $filter, $attributes);\n $entries = ldap_get_entries($ldap_conn, $result);\n\n if ($entries['count'] > 0) {\n array_push($groupDNList, $entries[0]['dn']);\n }\n }\n }\n\n return $groupDNList;\n\n}",
"function ldap_user_info($user){\n\t$ds=ldap_connect(\"ldap.mycompany.com\");\n\tif ($ds) { \n\t\t$ldapbind=ldap_bind($ds, 'CTLINT\\zz_ldap', 'Q36buCA$');\n if ($ldapbind) {\n\t\t\t$filter=\"sAMAccountName=\".$user;\n\t\t\t$dn = \"OU=community,DC=mycompany,DC=com\";\n\t\t\t$LDAPFieldsToFind = array(\"mail\",\"givenname\", \"sn\",\"company\");\n\t\t\t$sr=ldap_search($ds, $dn, $filter, $LDAPFieldsToFind);\n\t\t\t$info = ldap_get_entries($ds, $sr);\n\t\t\treturn $info;\n\t\t}\n\t\telse \n\t\t\treturn false;\n\t}\n\telse\n\t\treturn false;\n}",
"function ldap_config()\n{\n return [\n 'enabled' => Settings::get('ldap-enabled', false),\n 'hosts' => Settings::get('ldap-hosts', []),\n 'bind_user' => Settings::get('ldap-bind-user', ''),\n 'bind_password' => Settings::get('ldap-bind-password', ''),\n 'tree_base' => Settings::get('ldap-tree-base', ''),\n 'base_user_ou_dn' => Settings::get('ldap-base-user-dn', ''),\n 'base_group_ou_dn' => Settings::get('ldap-base-group-dn', ''),\n 'delete_users' => Settings::get('ldap-delete-users', false),\n 'duties_map_to_ou' => Settings::get('ldap-duties-map-to-ou', true),\n 'home_drive_letter' => Settings::get('ldap-home-drive-letter', ''),\n 'home_drive_path_pattern' => Settings::get('ldap-home-drive-path-pattern', ''),\n 'email_domain' => Settings::get('ldap-email-domain', ''),\n 'use_trash_ou' => Settings::get('ldap-use-trash-ou', true)\n ];\n}",
"function ldap_find_user_info ($login) {\n //error_log('Entering ldap_find_user_info('.$login.')',0);\n global $ldap_host, $ldap_port, $ldap_basedn, $ldap_rdn, $ldap_pass, $ldap_search_dn;\n // basic sequence with LDAP is connect, bind, search,\n // interpret search result, close connection\n\n //echo \"Connecting ...\";\n $ldap_connect = ldap_connect( $ldap_host, $ldap_port);\n ldap_set_version($ldap_connect);\n if ($ldap_connect) {\n //echo \" Connect to LDAP server successful \";\n //echo \"Binding ...\";\n $ldap_bind = false;\n $ldap_bind_res = ldap_handle_bind($ldap_connect,$ldap_bind);\n if ($ldap_bind_res) {\n //echo \" LDAP bind successful... \";\n //echo \" Searching for uid... \";\n // Search surname entry\n //OLD: $sr=ldap_search($ldapconnect,\"dc=rug, dc=ac, dc=be\", \"uid=$login\");\n //echo \"<p> ldapDc = '$LDAPbasedn' </p>\";\n if(!empty($ldap_search_dn)) {\n $sr=ldap_search($ldap_connect, $ldap_search_dn, \"uid=$login\");\n } else {\n $sr=ldap_search($ldap_connect, $ldap_basedn, \"uid=$login\");\n }\n //echo \" Search result is \".$sr;\n //echo \" Number of entries returned is \".ldap_count_entries($ldapconnect,$sr);\n //echo \" Getting entries ...\";\n $info = ldap_get_entries($ldap_connect, $sr);\n //echo \"Data for \".$info[\"count\"].\" items returned:<p>\";\n } else {\n //echo \"LDAP bind failed...\";\n }\n //echo \"Closing LDAP connection<hr>\";\n ldap_close($ldap_connect);\n } else {\n //echo \"<h3>Unable to connect to LDAP server</h3>\";\n }\n //DEBUG: $result[\"firstname\"] = \"Jan\"; $result[\"name\"] = \"De Test\"; $result[\"email\"] = \"email@ugent.be\";\n $result[\"firstname\"] = $info[0][\"cn\"][0];\n $result[\"name\"] = $info[0][\"sn\"][0];\n $result[\"email\"] = $info[0][\"mail\"][0];\n $tutor_field = api_get_setting('ldap_filled_tutor_field');\n $result[$tutor_field] = $info[0][$tutor_field]; //employeenumber by default\n\n return $result;\n}",
"function LDAP_checkphpLdapAdminConfiguration()\n{\nif (file_exists(\"/m23/data+scripts/m23admin/phpldapadmin/config.php\"))\n\treturn;\n\n$file=fopen(\"/m23/data+scripts/m23admin/phpldapadmin/config.php\",\"w\");\nfwrite($file,\"\n<?php\n\\$blowfish_secret = '';\n\n\\$i=0;\n\\$servers = array();\n//['unique_attrs_dn_pass']\n\\$jpeg_temp_dir = \\\"/tmp\\\"; // Example for Unix systems\n\\$date_format = \\\"%A %e %B %Y\\\";\n\\$hide_configuration_management = false;\n\\$tree_display_format = '%rdn';\n\\$search_deref = LDAP_DEREF_ALWAYS;\n\\$tree_deref = LDAP_DEREF_NEVER;\n\\$export_deref = LDAP_DEREF_NEVER;\n\\$view_deref = LDAP_DEREF_NEVER;\n\\$language = 'auto';\n\\$enable_mass_delete = false;\n\\$anonymous_bind_implies_read_only = true;\n\\$anonymous_bind_redirect_no_tree = false;\n\\$cookie_time = 0; // seconds\n\\$tree_width = 320; // pixels\n\\$jpeg_tmp_keep_time = 120; // seconds\n\\$show_hints = true; // set to false to disable hints\n\\$search_result_size_limit = 50;\n\\$default_search_display = 'list';\n\\$obfuscate_password_display = false;\n\\$search_attributes = \\\"uid, cn, gidNumber, objectClass, telephoneNumber, mail, street\\\";\n\\$search_attributes_display = \\\"User Name, Common Name, Group ID, Object Class, Phone Number, Email, Address\\\";\n\\$search_result_attributes = \\\"cn, sn, uid, postalAddress, telephoneNumber\\\";\n\\$search_criteria_options = array( \\\"equals\\\", \\\"starts with\\\", \\\"contains\\\", \\\"ends with\\\", \\\"sounds like\\\" );\n\\$multi_line_attributes = array( \\\"postalAddress\\\", \\\"homePostalAddress\\\", \\\"personalSignature\\\" );\n\\$multi_line_syntax_oids = array(\n // octet string syntax OID:\n \\\"1.3.6.1.4.1.1466.115.121.1.40\\\",\n // postal address syntax OID:\n \\\"1.3.6.1.4.1.1466.115.121.1.41\\\" );\n\\$friendly_attrs = array();\n\\$friendly_attrs[ 'facsimileTelephoneNumber' ] = 'Fax';\n\\$friendly_attrs[ 'telephoneNumber' ] = 'Phone';\n\\$q=0;\n\\$queries = array();\n\\$queries[\\$q]['name'] = 'Samba Users'; /* The name that will appear in the simple search form */\n\\$queries[\\$q]['server'] = '0'; /* The ldap server to query, must be defined in the \\$queries[\\$q]['base'] = 'dc=example,dc=com'; /* The base to search on */\n\\$queries[\\$q]['scope'] = 'sub'; /* The search scope (sub, base, one) */\n\\$queries[\\$q]['filter'] = '(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*\\$)))';\n\\$queries[\\$q]['attributes'] = 'uid, smbHome, uidNumber';\n\\$q++;\n\\$queries[\\$q]['name'] = 'Samba Computers';\n\\$queries[\\$q]['server'] = '0';\n\\$queries[\\$q]['base'] = 'dc=example,dc=com';\n\\$queries[\\$q]['scope'] = 'sub';\n\\$queries[\\$q]['filter'] = '(&(objectClass=sambaAccount)(uid=*\\$))';\n\\$queries[\\$q]['attributes'] = 'uid, homeDirectory';\n?>\n\");\nfclose($file);\n}",
"function LDAP_addServerTophpLdapAdmin($name,$host,$base,$pwd,$port=389)\n{\n\nLDAP_checkphpLdapAdminConfiguration();\n\n$cmd=\nEDIT_searchLastLineNumber(PHPLDAPADMIN_CONFIG, \"new Datastore();\").\nEDIT_insertAfterLineNumber(PHPLDAPADMIN_CONFIG, SED_foundLine, \"\n\\$servers->newServer('ldap_pla');\n\\$servers->setValue('server','name','$name');\n\\$servers->setValue('server','host','$host');\n\\$servers->setValue('server','port',$port);\n\\$servers->setValue('server','base',array('$base'));\n\\$servers->setValue('login','auth_type','config');\n\\$servers->setValue('login','bind_id','cn=admin,$base');\n\\$servers->setValue('login','bind_pass','$pwd');\n\\$servers->setValue('server','tls',false);\n\\$servers->setValue('server','read_only',false);\n\\$servers->setValue('auto_number','enable',false);\n\\$servers->setValue('auto_number','mechanism','search');\n\\$servers->setValue('auto_number','search_base','ou=People,$base');\n\\$servers->setValue('auto_number','min',array('uidNumber'=>1000,'gidNumber'=>1000));\n\\$servers->setValue('server','visible',true);\n\");\n\nsystem($cmd);\n}",
"function LDAP_addServerTophpLdapAdmin($name,$host,$base,$pwd,$port=389)\n{\n$confFile=\"/m23/data+scripts/m23admin/phpldapadmin/config.php\";\nLDAP_checkphpLdapAdminConfiguration();\n\n$cmd=\nEDIT_searchLastLineNumber($confFile,\"'unique_attrs_dn_pass']\").\nEDIT_insertAfterLineNumber($confFile, SED_foundLine, \"\n\\$i++;\n\\$servers[\\$i]['name'] = '$name';\n\\$servers[\\$i]['host'] = '$host';\n\\$servers[\\$i]['base'] = '$base';\n\\$servers[\\$i]['port'] = $port;\n\\$servers[\\$i]['auth_type'] = 'config';\n\\$servers[\\$i]['login_dn'] = 'cn=admin,$base';\n\\$servers[\\$i]['login_pass'] = '$pwd';\n\\$servers[\\$i]['tls'] = false;\n\\$servers[\\$i]['low_bandwidth'] = false;\n\\$servers[\\$i]['default_hash'] = 'crypt';\n\\$servers[\\$i]['login_attr'] = 'dn';\n\\$servers[\\$i]['login_class'] = '';\n\\$servers[\\$i]['read_only'] = false;\n\\$servers[\\$i]['show_create'] = true;\n\\$servers[\\$i]['enable_auto_uid_numbers'] = false;\n\\$servers[\\$i]['auto_uid_number_mechanism'] = 'search';\n\\$servers[\\$i]['auto_uid_number_search_base'] = 'ou=People,dc=example,dc=com';\n\\$servers[\\$i]['auto_uid_number_min'] = 1000;\n\\$servers[\\$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';\n\\$servers[\\$i]['unique_attrs_dn'] = '';\n\\$servers[\\$i]['unique_attrs_dn_pass'] = '';\n\");\n\nsystem($cmd);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
File aggregation by type , taking care not to take content from the same url, that is, counting it only once. Each identical occurrence is seen only once | public function countByTypeAllPage()
{
$statementSelect = $this->db->prepare("SELECT COUNT(id) AS cid, file_type FROM " . FILES_TABLE . " WHERE downloaded_time IS NOT NULL GROUP BY file_type");
if(!$statementSelect->execute()){
$this->log->m_log('countByTypeAllPage MySql function error');
}
$tmp = $statementSelect->fetchAll();
foreach ($tmp as $item) {
$this->result[$item['file_type']] = $item['cid'];
}
} | [
"protected function aggregateFiles($files, $type)\n{\n\t// Construct an array of filenames, and get the maximum last modifiction time of all the files.\n\t$filenames = array();\n\t$lastModTime = 0;\n\tforeach ($files as $filename) {\n\t\t$filenames[] = str_replace(\".\", \"\", pathinfo($filename, PATHINFO_FILENAME));\n\t\t$lastModTime = max($lastModTime, filemtime(PATH_ROOT.\"/\".$filename));\n\t}\n\n\t// Construct a filename for the aggregation file based on the individual filenames.\n\t$file = PATH_ROOT.\"/cache/$type/\".implode(\",\", $filenames).\".$type\";\n\n\t// If this file doesn't exist, or if it is out of date, generate and write it.\n\tif (!file_exists($file) or filemtime($file) < $lastModTime) {\n\t\t$contents = \"\";\n\n\t\t// Get the contents of each of the files, fixing up image URL paths for CSS files.\n\t\tforeach ($files as $f) {\n\t\t\t$content = file_get_contents(PATH_ROOT.\"/\".$f);\n\t\t\tif ($type == \"css\") $content = preg_replace(\"/url\\(('?)/i\", \"url($1\".getResource(pathinfo($f, PATHINFO_DIRNAME).\"/\"), $content);\n\t\t\t$contents .= $content.\" \";\n\t\t}\n\n\t\t// Minify and write the contents.\n\t\tfile_force_contents($file, $type == \"css\" ? minifyCSS($contents) : minifyJS($contents));\n\t}\n\n\treturn array($file);\n}",
"public function countFileElement($id)\r\n {\r\n $this->result = array();\r\n $data['id'] = $id; \r\n $statementSelect = $this->db->prepare(\"SELECT COUNT(path) AS cp FROM \" . CONTENTS_TABLE . \" WHERE url_id = :id AND download_time IS NOT NULL\");\r\n if(!$statementSelect->execute($data)){\r\n $this->log->m_log('countFileElement pages MySql function error');\r\n }\r\n $this->result['page'] = $statementSelect->fetch(PDO::FETCH_OBJ)->cp;\r\n \r\n $this->allCount = $this->result['page'];\r\n \r\n $statementSelect = $this->db->prepare(\"SELECT COUNT(id) AS cid, file_type FROM \" . FILES_TABLE . \" WHERE url_id = :id AND downloaded_time IS NOT NULL GROUP BY file_type\");\r\n if(!$statementSelect->execute($data)){\r\n $this->log->m_log('countFileElement pages MySql function error');\r\n }\r\n $tmp = $statementSelect->fetchAll();\r\n \r\n foreach ($tmp as $item) {\r\n $this->result[$item['file_type']] = $item['cid'];\r\n $this->allCount += $item['cid'];\r\n }\r\n }",
"function file_usage_add(stdClass $file, $module, $type, $id, $count = 1) {\n db_merge('file_usage')\n ->key(array(\n 'fid' => $file->fid,\n 'module' => $module,\n 'type' => $type,\n 'id' => $id,\n ))\n ->fields(array('count' => $count))\n ->expression('count', 'count + :count', array(':count' => $count))\n ->execute();\n}",
"function advagg_generate_filenames($groups, $type) {\n $files = array();\n foreach ($groups as $key => $data) {\n foreach ($data as $files_with_meta_data) {\n\n // Get the aggregate filename & info about each file.\n $aggregate_info = advagg_get_aggregate_info_from_files($type, $files_with_meta_data);\n $values['files'] = $aggregate_info[1];\n $values['aggregate_filenames_hash'] = $aggregate_info[2];\n $values['aggregate_contents_hash'] = $aggregate_info[3];\n\n // Add information to the files array.\n $files[$aggregate_info[0]] = $values;\n }\n }\n return $files;\n}",
"function thumbnailsCount() {\n $counter = 0;\n foreach ($this->jsonData->{'entry'}->{'media$group'}->{'media$thumbnail'} as $t) {\n $counter++;\n }\n return $counter;\n }",
"function pubdlcnt_check_duplicate($url, $name, $nid) {\n // get the settings\n $result = db_query(\"SELECT value FROM {variable} \n\t\t\t\t\t\tWHERE name = :name\", array(':name' => 'pubdlcnt_skip_duplicate'))->fetchField();\n $skip_duplicate = unserialize($result);\n if(!$skip_duplicate) return 0; // OK\n\n // OK, we should check the duplicate download\n $ip = $_SERVER['REMOTE_ADDR'];\n if (!preg_match(\"/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\", $ip)) {\n return 1; // NG (Invalid IPv4 IP-addresss)\n }\n $today = mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\")); // Unix timestamp\n\n // obtain fid \n $fid = db_query(\"SELECT fid FROM {pubdlcnt} WHERE name=:name\", array(':name' => $name))->fetchField();\n if ($fid) {\n $result = db_query(\"SELECT * FROM {pubdlcnt_ip} WHERE fid=:fid AND ip=:ip AND utime=:utime\", array(':fid' => $fid, ':ip' => $ip, ':utime' => $today));\n if ($result->rowCount()) {\n return 1; // found duplicate!\n }\n else {\n // add IP address to the database\n db_insert('pubdlcnt_ip')\n ->fields(array(\n 'fid' => $fid,\n 'ip' => $ip,\n 'utime' => $today))\n ->execute();\n }\n }\n else {\n // no file record -> create file record first\n $fid = db_insert('pubdlcnt')\n ->fields(array(\n 'nid' => $nid,\n 'name' => $name,\n 'url' => $url,\n 'count' => 1,\n 'utime' => $today))\n ->execute();\n // next, add IP address to the database\n db_insert('pubdlcnt_ip')\n ->fields(array(\n 'fid' => $fid,\n 'ip' => $ip,\n 'utime' => $today))\n ->execute();\n }\n return 0;\n}",
"function getPublishableFiles(array $datatype) {\n //initiallize variables\n $block_json=\"{}\";\n $files = array();\n\t// Find user files with the given allowed datatype/s\n\n\t//get path of the user workspace\n\t$proj_name_active = basename(getAttr_fromGSFileId($_SESSION['User']['dataDir'], \n \"path\"));\n\n\t// get list of user files with the allowed datatypes\n\tif (is_array($datatype)){\n $file_filter = array(\n \"data_type\" => array('$in' => $datatype),\n \"project\" => $proj_name_active);\n\t}else {\n $file_filter = array(\n \"data_type\" => $datatype,\n \"project\" => $proj_name_active);\n\t}\n $filteredFiles = getGSFiles_filteredBy($file_filter);\n\n\t// apply further filters to the files based on OEB metadata\n\tforeach ($filteredFiles as $key => $value) {\n //check if file is already requested \n $filters = array(\"filesIds\" => array('$in'=> array($value['_id'])));\n $found = OEBDataPetition::selectAllOEBPetitions($filters);\n\n if(count($found) !== 0 || !is_null($found)) {\n $value['current_status'] = $found[0]['current_status'];\n $value['req_id'] = $found[0]['_id'];\n if (isset($found[0]['dataset_OEBid'])){\n $value['oeb_id'] = getAttr_fromGSFileId($value['_id'], \n \"OEB_dataset_id\");\n }\n\n }\n\n //get both files: consolidated and participant\n $value['files']['participant']['id'] = $value['input_files'][0];\n $value['files']['participant']['path'] = $value['sources'][0];\n $value['files']['consolidated']['id'] = $value['_id'];\n $value['files']['consolidated']['path'] = $value['path'];\n\n //get challenge names\n\t\tif ($value['data_type'] != \"participant\"){\n\t\t\t// if \"consolidated\" or \"metrics\", fetch run metadata\n\t\t\t$value['oeb_challenges'] = getChallenges_associated_to_outfile($value['_id']);\n\t\t}\n\n\t\tif (isset($value['tool'])){\n\t\t\t$tool = getTool_fromId($value['tool'],1);\n if (isset($tool['community-specific_metadata'])){\n if (isset($tool['community-specific_metadata']['benchmarking_event_id'])){\n $value['benchmarking_event']['be_id'] = \n $tool['community-specific_metadata']['benchmarking_event_id'];\n $value['benchmarking_event']['be_name'] = \n getBenchmarkingEvents($value['benchmarking_event']['be_id'],\"name\");\n }else{\n $value['benchmarking_event'] = $value['tool'];\n }\n $value['benchmarking_event']['workflow_id'] = \n $tool['community-specific_metadata']['workflow_id'];\n } \n\t\t}else{\n\t\t\t// file is not the result of a VRE run. No 'tool'/event associated\n\t\t\t$value['benchmarking_event']=\"NA\";\n\t\t}\n array_push($files, $value);\n }\n\n $block_json = json_encode($files, JSON_PRETTY_PRINT);\n\n return $block_json;\n}",
"public function getFilesCount();",
"public function countUniqueImages( $pageContent ) {\n\n // Grab live page html content\n $myhtml = <<<EOF\n $pageContent\nEOF;\n\n // Create a new DOM Document to hold page structure\n $doc = new DOMDocument();\n $doc->loadHTML($myhtml);\n\n $tags = $doc->getElementsByTagName('img');\n\n // Create an empty array to hold the results\n $array = array(); \n\n // Store each value in an array\n foreach ($tags as $tag) { \n $array[] = $tag->getAttribute('src'); \n } \n\n // print_r(array_unique($array)); (to print the array for reference -- commented out)\n\n // count unique elements in the array \n $uniq = count(array_unique($array));\n return $uniq;\n }",
"function _detectImage($url) {\n\t\t$c = _new(\"cache\");\n\t\tif($res = $c->get(\"clog_image_\".$url))\n\t\tif($res == 'true') return true; else return false;\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$out = explode(\"\\n\",$out);\n\t\tforeach($out as $ln)\n\t\tif(substr($ln,0,strlen(\"Content-Type: \")) == \"Content-Type: \") {\n\t\t\tif(strstr($ln,\"image\")) {\n\t\t\t\t$c->set(\"clog_image_\".$url,\"true\",time()+YEAR);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$c->set(\"clog_image_\".$url,\"false\",time()+YEAR);\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak; }\n\n\t\treturn false;\n\t}",
"function getFileNumbers($directory, $fileType){\n $files = glob($directory .\"/\". $fileType);\n if ( $files !== false ){\n $filecount = count( $files );\n }\n else{\n $filecount = 0;\n }\n return $filecount;\n }",
"function thrive_social_fetch_count_t_share( $url ) {\n\treturn 0;\n}",
"function calculateTotalFileUploadUsage()\n{\n global $uploaddir;\n $sQuery = 'select sid from {{surveys}}';\n $oResult = dbExecuteAssoc($sQuery); //checked\n $aRows = $oResult->readAll();\n $iTotalSize = 0.0;\n foreach ($aRows as $aRow) {\n $sFilesPath = $uploaddir.'/surveys/'.$aRow['sid'].'/files';\n if (file_exists($sFilesPath)) {\n $iTotalSize += (float) getDirectorySize($sFilesPath);\n }\n }\n return (float) $iTotalSize / 1024 / 1024;\n}",
"function compareFile($files, $sizeOfFiles, $size) {\n $result = array();\n $count = 0;\n\n foreach($sizeOfFiles as $key => $file)\n {\n if ($file == $size)\n {\n $result[] = file_get_contents($files[$key], NULL);\n }\n }\n\n $duplication = array_count_values($result);\n foreach($duplication as $d)\n {\n $count += $d > 1 ? $d : 0;\n }\n return $count;\n }",
"function nextCount($today, $type){\n\t\t$d = dir($this->_store);\n\t\t$files = 0;\n\t\twhile(($entry = $d->read()) !== false){\n\t\t\tif($entry !== '.' && $entry !== '..'){\n\t\t\t\tif(strstr($entry, 'backup_'.$today)){\n\t\t\t\t\t$files++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t\treturn $files;\n\t}",
"public function calculateContentTypeRatio(){\n $content_typesTable = \\Lava::DataTable();\n $corpus = Corpus::all();\n $content_types = array();\n $contentTypesCounter = array();\n foreach($corpus as $c){\n $content_types = Corpus::getAllContentTypesArray($c);\n foreach ($content_types as $type){\n if(array_key_exists($type,$contentTypesCounter)){\n $contentTypesCounter[$type] += 1;\n }else{\n $contentTypesCounter[$type] = 1;\n }\n }\n }\n $content_typesTable->addStringColumn('Reasons')\n ->addNumberColumn('Percent');\n foreach ($contentTypesCounter as $type => $num){\n $content_typesTable->addRow([$type, $num]);\n }\n return $content_typesTable;\n }",
"function calculateTotalFileUploadUsage() {\n global $uploaddir;\n $sQuery = 'select sid from {{surveys}}';\n $oResult = dbExecuteAssoc($sQuery); //checked\n $aRows = $oResult->readAll();\n $iTotalSize = 0.0;\n foreach ($aRows as $aRow) {\n $sFilesPath = $uploaddir . '/surveys/' . $aRow['sid'] . '/files';\n if (file_exists($sFilesPath)) {\n $iTotalSize+=(float) getDirectorySize($sFilesPath);\n }\n }\n return (float) $iTotalSize / 1024 / 1024;\n}",
"function addToFiles($key = null, $url)\n{\n $tempName = tempnam('/tmp', 'php_files');\n $originalName = basename(parse_url($url, PHP_URL_PATH));\n\n $imgRawData = file_get_contents($url);\n file_put_contents($tempName, $imgRawData);\n \n if ($key) {\n $_FILES[$key] = array(\n 'name' => $originalName,\n 'type' => mime_content_type($tempName),\n 'tmp_name' => $tempName,\n 'error' => 0,\n 'size' => strlen($imgRawData),\n );\n } else {\n $_FILES[] = array(\n 'name' => $originalName,\n 'type' => mime_content_type($tempName),\n 'tmp_name' => $tempName,\n 'error' => 0,\n 'size' => strlen($imgRawData),\n ); \n }\n}",
"public function getFileTypes();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a HAVING ... NOT IN clause to your query. | public function having_not_in($column_name, $values = null)
{
} | [
"public function setHaving(array $having = array());",
"private function _query_having( &$query ) {\n\t\tif ( $this->having ) {\n\t\t\t$query .= ' HAVING ' . $this->having;\n\t\t}\n\t}",
"public function addHaving(Clause $having);",
"function walkHavingClause($havingClause);",
"public function addNotIn($column, $params, $operand = 'AND');",
"public function sqlHaving($sql)\n {\n }",
"public function getHaving(): array;",
"protected function where_not_in($where)\n\t{\n\t\t$parameters = $this->parameterize($where['values']);\n\n\t\treturn $this->wrap($where['column']).' NOT IN ('.$parameters.')';\n\t}",
"public function havingNotIn(\n Closure | string $column,\n Closure | float | int | string | null $value,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->having($column, 'NOT IN', ...[$value, ...$values]);\n }",
"public function where_not_in($column_name, $values_count) {\n $column_name = $this->_quote_identifier($column_name);\n $placeholders = $this->_create_placeholders($values_count);\n return $this->_add_where(\"{$column_name} NOT IN ({$placeholders})\");\n }",
"protected function whereNotInSub(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' not in (' . $this->compileSelect($where['query']) . ')';\n }",
"protected function makeHavingSQL() {\n if($this->group && $this->having) {\n $this->sql .= ' HAVING ' . $this->having;\n }\n }",
"public static function get_having_sql() { \n\n\t\t$sql = self::$_state['having'][self::$type]; \n\n\t\treturn $sql; \n\n\t}",
"public function &appendNot() {\n\t\tif ($this->current_conditions == 'where') {\n\t\t\t$this->where[] = $this->adapter->opNOT();\n\t\t}\n\t\tif ($this->current_conditions == 'having') {\n\t\t\t$this->having[] = $this->adapter->opNOT();\n\t\t}\n\t\treturn $this;\t\t\n\t}",
"public function where_not_in($column_name, $values)\n {\n }",
"public function HavingClause()\n {\n $this->match(Lexer::T_HAVING);\n\n return new AST\\HavingClause($this->ConditionalExpression());\n }",
"public function walkHavingClause($havingClause);",
"public function having_not_like($column_name, $value = null)\n {\n }",
"public function scopeExcludeSpecificWhitelisted($query)\n {\n return $query->whereDoesntHave('tags', function ($query) {\n $query->whereIn('tag', config('telescope-pruning.specific_tags', []));\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if the field is auto incremental | public function isAutoIncremental()
{
return $this->_autoIncrement;
} | [
"public function hasAutoIncrement()\n {\n foreach ($this->getFields() as $field) {\n if ($field->isAutoIncrement()) {\n return true;\n }\n }\n\n return false;\n }",
"public function isAutoIncrement()/*# : bool */;",
"public function isAutoIncrement(): bool;",
"public function hasAutoincrement(): bool;",
"public function isAutoIncrement();",
"private function hasAutoIncrement ()\n {\n return $this->table_desc->hasAutoIncrement(); \n }",
"public static function isAutoIncremented()\n {\n return count(static::getPrimaryKeyVars()) > 1 ? false : static::$autoIncrement;\n }",
"function usesAutoIncrement()\n{\n $found = false;\n foreach($this->PKFields as $PKField){\n $moduleField = $this->ModuleFields[$PKField];\n if(false !== strpos($moduleField->dbFlags, \"auto_increment\")){\n $found = true;\n }\n }\n return $found;\n}",
"public function isAutoPrimaryKey()\r\n {\r\n return $this->isPrimaryKey() && $this->getExtra() === \\Db\\Model::DB_AUTO_INCREMENT;\r\n }",
"protected function isColumnAutoIncremental($column)\n {\n\n return $column->autoIncrement;\n }",
"public function isAutoNumbering() {\n return $this->isAutoNumbering;\n }",
"public static function is_auto_incremented() {\n\t\treturn (count(static::primary_key()) === 1);\n\t}",
"public function isIncremental();",
"public function isAutoincrement($property)\n {\n return $this->getPropertyInfo($property, 'isAutoincrement');\n }",
"function isAutoIncrement($alias) {\r\n\t\t\t$autoIncArray = $this->privateVars[\"autoIncColumns\"];\r\n\t\t\treturn in_array($alias, $autoIncArray);\r\n\t\t}",
"public function isPrimaryKeyAutoIncrement(): bool\n {\n return $this->primaryKeyAutoIncrement;\n }",
"public function isPrimaryAutoIncrement(): bool { return $this->primaryKey['auto_increment']; }",
"public function isAutoPrimary();",
"public function setIsAutoIncrement(bool $autoIncrement): void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepends (appends first in the list) a DOMElement. | public function prepend(DOMElement &$parent, &$child); | [
"function newItemBefore()\n\t{\n\t\t$li =& $this->getNode();\n\t\t$new_li =& $this->dom->create_element(\"ListItem\");\n\t\t$new_li =& $li->insert_before($new_li, $li);\n\t}",
"public function prepend ($content) {\r\n\t\t\r\n\t\tif ($this->length < 1) return null;\r\n\t\t\r\n\t\t$args = func_get_args();\r\n\t\tforeach ($args as $offset => $value) \r\n\t\t\tif ($value = $this->process($value)) \r\n\t\t\t\tforeach ($this as $node) \r\n\t\t\t\t\tif (get_class($value) === 'XDTNodeList') $node->insertBefore($value[0], $node->firstChild);\r\n\t\t\t\t\telse $node->insertBefore($value, $node->firstChild);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}",
"public function prepend(DOMElement &$parent, &$child)\n {\n if (empty($child)) {\n throw new InvalidArgumentException('You are trying to prepend an empty element.');\n }\n\n // Append before first child\n if ($parent->childNodes->length > 0) {\n $parent->insertBefore($child, $parent->childNodes->item(0));\n } else {\n $this->append($parent, $child);\n }\n\n // Return the DOMElement\n return $parent;\n }",
"function domtools_add_elements($elements)\n{\n foreach ($elements as $el) {\n try {\n if ($el['next_sibling']) {\n try {\n $el['parent']->insertBefore($el['element'], $el['next_sibling']);\n } catch (\\Exception $e) {\n $el['parent']->appendChild($el['element']);\n }\n } else {\n $el['parent']->appendChild($el['element']);\n }\n } catch (\\Exception $e) {\n trigger_error('could not append element: ' . $e->getMessage());\n }\n }\n}",
"public function prepend($element) {\r\n\t\tarray_unshift($this->identity['contents'], $element);\r\n\t}",
"public function testPrepend()\n {\n $dom = new DomQuery('<a>X</a>');\n $dom->find('a')->prepend('<span></span>', '<i></i>');\n $this->assertEquals('<a><i></i><span></span>X</a>', (string) $dom);\n $this->assertEquals(1, $dom->find('span')->length);\n }",
"public function prepend(XMLNode $value)\n\t\t{\n\t\t\treturn array_unshift($this->nodes, $value);\n\t\t}",
"public function prependChild(DOMNode $node)\n {\n if (is_null($this->firstChild)) {\n $this->appendChild($node);\n }\n\n else {\n $this->insertBefore($node, $this->firstChild);\n }\n }",
"public function insertBefore($element, $new);",
"public function insertBefore (DOMNode $newnode , $refnode = null) {}",
"public function addToStart(Domino $domino): void\n {\n array_unshift($this->elements, $domino);\n }",
"public function prepend($item);",
"public function addFirst($element);",
"function prepend($data) {\n\t\tif ($this->firstNode == null) {\n\t\t\t$this->firstNode = new Node($data);\n\t\t} else {\n\t\t\t$node = new Node($data);\n\t\t\t$aux = $this->firstNode;\n\t\t\t$this->firstNode = $node;\n\n\t\t\t$node->setNextNode($aux); \n\t\t}\n\n\t}",
"function InsertChild(wxXmlNode &$child, wxXmlNode &$followingNode){}",
"public function appendChild($node);",
"public function insertBefore (DOMNode $newnode, DOMNode $refnode = null) {}",
"public function prepend($to, $element, $immediatly = false) {\n\t\treturn $this->_genericCallElement ( 'prepend', $to, $element, $immediatly );\n\t}",
"public function appendChildCopy($item) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns all FilesystemFile instances in folder when $extension is specified, only files with extension are returned | public function getFiles(string $extension = null): array
{
$result = [];
$glob = $this->path . '*';
if($extension !== null) {
$glob .= '.' . $extension;
}
foreach(array_filter(glob($glob), 'is_file') as $f) {
$result[] = FilesystemFile::getInstance($f);
}
return $result;
} | [
"public function getFilesByTypeRecursively($folder, $extension)\n {\n return $this->getFilesByType($folder, $extension, true);\n }",
"public function findFilesWithExtension($directory, $extension);",
"function get_files_by_extension($directory, $extensions)\n{\n\tif (is_string($extensions))\n\t\t$extensions = array($extensions);\n\n\t$files = array();\n\tforeach (scandir($directory) as $entry)\n\t\tif (is_file(\"$directory/$entry\") && in_array(pathinfo(\"$directory/$entry\", PATHINFO_EXTENSION), $extensions))\n\t\t\t$files[] = $entry;\n\n\treturn $files;\n}",
"function getAllFiles($directory, $extension) {\n $names = array_diff(scandir($directory), array(\".\", \"..\")); \n $files = array();\n foreach($names as $name) {\n if (strpos($name, $extension)) {\n $files[] = $directory . DIRECTORY_SEPARATOR . $name;\n }\n else if(strpos($name, \".\") === false){\n $subdirectoryFiles = getAllFiles($directory .DIRECTORY_SEPARATOR . $name, $extension);\n foreach ($subdirectoryFiles as $file) {\n $files[] = $file;\n }\n }\n }\n return $files;\n}",
"private function collectExtensionFiles() {\n\n\n\n $this->collectLookingFilenames();\n\n $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->OCpath));\n\n foreach ($rii as $file) {\n\n if ($file->isDir()){\n continue;\n }\n\n if ($file->isFile()){\n\n foreach ( $this->lookingFilenames as $lookingFilename ) {\n\n if( strpos($file->getPathname(), $lookingFilename) !== false ) {\n $this->extensionFilenames[] = $file->getPathname();\n }\n\n }\n\n }\n }\n return $this->extensionFilenames;\n\n //var_dump($this->extensionFilenames);\n }",
"protected function _findFiles($extensions = '') {\n\t\t$this->_files = [];\n\t\tforeach ($this->_paths as $path) {\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$Iterator = new RegexIterator(\n\t\t\t\tnew RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)),\n\t\t\t\t'/^.+\\.(' . $extensions . ')$/i',\n\t\t\t\tRegexIterator::MATCH\n\t\t\t);\n\t\t\tforeach ($Iterator as $file) {\n\t\t\t\t$excludes = ['Config'];\n\t\t\t\t//Iterator processes plugins even if not asked to\n\t\t\t\tif (empty($this->params['plugin'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Plugin', 'plugins']);\n\t\t\t\t}\n\t\t\t\tif (empty($this->params['vendor'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Vendor', 'vendors']);\n\t\t\t\t}\n\t\t\t\tif (!empty($excludes)) {\n\t\t\t\t\t$isIllegalPluginPath = false;\n\t\t\t\t\tforeach ($excludes as $exclude) {\n\t\t\t\t\t\tif (strpos($file, $path . $exclude . DS) === 0) {\n\t\t\t\t\t\t\t$isIllegalPluginPath = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($isIllegalPluginPath) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($file->isFile()) {\n\t\t\t\t\t$this->_files[] = $file->getPathname();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function getDirectoryFilesFilterExtension($theDirectory, $theExtensionsArray){\n\t\n\t$files = scandir($theDirectory);\n\t$arrayFiles = array();\n\t$idx = 0;\t\n\tforeach($files as $file){\n\t\t\n\t if (is_file($theDirectory.\"/\".$file)){\n $theFileExtension = pathinfo($theDirectory.\"/\".strtolower($file), PATHINFO_EXTENSION);\n if (in_array(strtolower($theFileExtension), $theExtensionsArray)){\n $arrayFiles[$idx] = $file;\n $idx ++; \n }\t \n\t }\t\n\t}\n\treturn $arrayFiles;\n\t\n}",
"public function getfiles($recursive = false) {\n\t\treturn $this->getfilesbyextension('*', $recursive);\n\t}",
"public function retrieveYamlFilesFromExtensionFolders() : array {}",
"public function getAllFiles() {\n $filesFilter = array(\n 'maxResults'=> '1000',\n 'q' => 'mimeType != \"application/vnd.google-apps.folder\" and trashed=false'\n );\n $files = $this->retrieveFilesFromDrive($filesFilter);\n return $files;\n }",
"public static function get_files($folder,$fileType='*',$levels=3){\n $files = [];\n if (empty($folder)) return $files;\n if ($levels>0) {\n $folder=rtrim($folder,'/');\n $files=glob($folder.'/*.'.$fileType);\n if (empty($files)) $files=[];\n $has_folder=glob($folder.'/*',GLOB_ONLYDIR);\n if ($has_folder) {\n $folder=$folder.'/*';\n $levels--;\n $files=array_merge($files,self::get_files($folder,$fileType,$levels));\n }\n }\n return $files;\n }",
"protected function findFiles() {\n $files = [];\n foreach ($this->directories as $provider => $directory) {\n $file = $directory . '/' . $provider . '.extend.gql';\n if (file_exists($file)) {\n $files[$provider] = $file;\n }\n }\n return $files;\n }",
"public function findByExtension() {\n $value = func_get_args();\n return $this->findBy('extension', $value);\n }",
"public function getFiles()\n {\n if ($this->follow_symlinks) {\n $this->finder->followLinks();\n }\n\n $patterns = $this->getIgnorePatterns();\n if (empty($patterns)) {\n $patterns = '';\n } else {\n foreach ($patterns as &$pattern) {\n $this->convertToPregCompliant($pattern);\n }\n $patterns = '/('.implode('|', $patterns).')$/';\n }\n\n // restrict names to those ending in the given extensions\n $this->finder\n ->name('/\\.('.implode('|', $this->allowed_extensions).')$/')\n ->ignoreDotFiles($this->getIgnoreHidden())\n ->filter(\n function(SplFileInfo $file) use ($patterns) {\n if (!$patterns) {\n return true;\n }\n\n // apply ignore list on path instead of file, finder\n // can't do that by default\n return !preg_match($patterns, $file->getPathname());\n }\n );\n\n try {\n /** @var SplFileInfo $file */\n foreach ($this->finder as $file) {\n $this->files[] = $file->getRealPath();\n }\n } catch(\\LogicException $e)\n {\n // if a logic exception is thrown then no folders were included\n // for phpDocumentor this is not an issue since we accept separate\n // files as well\n }\n\n return $this->files;\n }",
"public function findAllClassFiles($extension = NULL) {\n $classmap = [];\n $namespaces = $this->registerTestNamespaces();\n if (isset($extension)) {\n // Include tests in the \\Drupal\\Tests\\{$extension} namespace.\n $pattern = \"/Drupal\\\\\\(Tests\\\\\\)?$extension\\\\\\/\";\n $namespaces = array_intersect_key($namespaces, array_flip(preg_grep($pattern, array_keys($namespaces))));\n }\n foreach ($namespaces as $namespace => $paths) {\n foreach ($paths as $path) {\n if (!is_dir($path)) {\n continue;\n }\n $classmap += static::scanDirectory($namespace, $path);\n }\n }\n return $classmap;\n }",
"private function getCacheFiles()\n {\n if (!($files = @scandir($this->directory, 1))) {\n return false;\n }\n\n $negExtLen = -1 * strlen($this->extension);\n $return = [];\n foreach ($files as $file) {\n if (substr($file, $negExtLen) === $this->extension) {\n $return[] = $this->directory . '/' . $file;\n }\n }\n return $return;\n }",
"function getFilesInDirByExt($subdir, $ext) {\n\t\t$paths = array();\n\t\t\n\t\t$files = scandir($this->FullPath . $subdir);\n \t\tforeach ($files as $file) {\n\t\t\tif ($file == \".\" || $file == \"..\") continue;\n\t\t\tif (substr($file, -1*strlen($ext)) != $ext) continue;\n\t\t\t$paths[] = $this->Filename . $subdir . \"/\" . $file;\n\t\t}\n\t\treturn $paths;\n\t}",
"public function justFiles() {\n return $this->filter(function ($item) {\n return $item->getType() === FilePath::TYPE_FILE;\n })->values();\n }",
"function find_files(&$matches, $directory, $filename=null, $extension=null, $limit=null,\n $case_sensitive=true, $subdirs=true) {\n // File system objects\n $fsos = scandir($directory);\n foreach ($fsos as $fso) {\n $fso_full = $directory . DS . $fso; \n $parts = pathinfo($fso_full); \n if (is_file($fso_full)\n && (empty($filename)\n || ($case_sensitive && $filename == $parts['filename'])\n || (!$case_sensitive && strcasecmp($filename, $parts['filename'])))\n && (empty($extension)\n || ($case_sensitive && $extension == $parts['extension'])\n || (!$case_sensitive && strcasecmp($extension, $parts['extension'])))) { \n $matches[] = $fso_full;\n if ($limit > 0 && count($matches) >= $limit) return;\n } \n else if (is_dir($fso_full) && $subdirs && $fso != '.' && $fso != '..') {\n find_files($matches, $fso_full, $filename, $extension, $limit, $case_sensitive, $subdirs);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return global tokens for output regarding this profile. | public function getTokens(): array {
$tokens = [];
$tokens['@profile_name'] = $this->label;
return $tokens;
} | [
"public function get_tokens(){\n\t\t\t\n\t\t\t$tokens = get_tokens( $this->name );\n\t\t\t\n\t\t\treturn $tokens;\n\t\t\t\n\t\t}",
"public function getTokens();",
"public function getAllTokens();",
"public function getTokens()\n {\n return $this->command->getTokens();\n }",
"public function getTokens()\n {\n return $this->tokens;\n }",
"public function getTokens() : array {\n return $this->tokens;\n }",
"public function listTokens()\n {\n return $this->getRowsOfFields($this->session()->getUser()->getMachineTokens());\n }",
"public function getProviderTokens()\n {\n return $this->provider_tokens;\n }",
"public function &get_tokens() {\n if ($this->tokens === null) {\n $source = file_get_contents($this->get_full_path());\n $this->tokens = token_get_all($source);\n $this->tokenscount = count($this->tokens);\n $inquotes = -1;\n for ($tid = 0; $tid < $this->tokenscount; $tid++) {\n if (is_string($this->tokens[$tid])) {\n // Simple 1-character token.\n $this->tokens[$tid] = array(-1, $this->tokens[$tid]);\n }\n // And now, for the purpose of this project we don't need strings with variables inside to be parsed\n // so when we find string in double quotes that is split into several tokens and combine all content in one token.\n if ($this->tokens[$tid][0] == -1 && $this->tokens[$tid][1] == '\"') {\n if ($inquotes == -1) {\n $inquotes = $tid;\n $this->tokens[$tid][0] = T_STRING;\n } else {\n $this->tokens[$inquotes][1] .= $this->tokens[$tid][1];\n $this->tokens[$tid] = array(T_WHITESPACE, '');\n $inquotes = -1;\n }\n } else if ($inquotes > -1) {\n $this->tokens[$inquotes][1] .= $this->tokens[$tid][1];\n $this->tokens[$tid] = array(T_WHITESPACE, '');\n }\n }\n }\n return $this->tokens;\n }",
"public function gameTokens();",
"public function getTokens(){\r\n\t\t\t$contToken=0;\r\n\t\t\t//Variavel auxiliar para imprimir de 10 em 10\r\n\t\t\t$de10 =1;\r\n\t\t\tforeach($this->tokens as $c => $t){\r\n\t\t\t\t\t//Exibir tag e lexeme\r\n\t\t\t\t\t//echo '{'.$t->tag.','.$t->toString().'} , ';\r\n\t\t\t\t\t//Exibir apenas lexeme\r\n\t\t\t\t\techo $t->toString().' , ';\r\n\t\t\t\t\t//Quebrar linha a cada eol (a cada quebra de linha do codigo)\r\n\t\t\t\t\tif($t->toString() == 'eol'){\r\n\t\t\t\t\t\techo '<br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$de10++;\t\r\n\t\t\t\t}\r\n\t\t\treturn $this->tokens;\r\n\t\t}",
"public function getTokenCommon()\n {\n return $this->tokenCommon;\n }",
"function getAllTokens() : array\r\n {\r\n $tokens = [];\r\n $t = $this->nextToken();\r\n while ($t && $t->type !== Token::EOF)\r\n {\r\n $tokens[] = $t;\r\n $t = $this->nextToken();\r\n }\r\n return $tokens;\r\n }",
"public function instanceTokens() {\n return array_keys($this->settings->get('instances', []));\n }",
"public function getTokenString()\n {\n return $this->tokenString;\n }",
"public function getTokenList();",
"protected function getTokens(): array\n {\n return $this->forbiddenTokens;\n }",
"public function getToken()\n {\n return $this->tokens->current();\n }",
"public function getTokens(Context $context);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load roles from Facebook with Graph API or else. | function loadRoles(\BaseFacebook $facebook, array $roleMappings); | [
"protected function _loadRoles()\n {\n $this->role->load($this->auth->handle);\n }",
"private function loadRoles()\r\n {\r\n $db = Sweia::getInstance()->getDB();\r\n\r\n $roles = $db->query(\"SELECT ur.rid, r.role FROM \" . SystemTables::DB_TBL_USER_ROLE . \" ur LEFT JOIN role r ON (r.rid = ur.rid) WHERE uid='$this->uid'\");\r\n while ($role = $db->fetchObject($roles))\r\n {\r\n $this->roles[$role->rid] = $role->role;\r\n }\r\n\r\n /* If the currently logged in user is this user, add the authenticated user role to this user */\r\n if (Session::loggedInUid() == $this->uid)\r\n {\r\n $this->roles[2] = \"authenticated\";\r\n }\r\n \r\n return $this->roles;\r\n }",
"public function loadRoles()\n {\n $this->roles = array();\n $db = Codeli::getInstance()->getDB();\n\n $sql = \"SELECT ur.rid, r.* FROM \" . SystemTables::USER_ROLE\n . \" ur LEFT JOIN \" . SystemTables::ROLE . \" r ON (r.rid = ur.rid) WHERE uid=':uid'\";\n $roles = $db->query($sql, array(\":uid\" => $this->user->getId()));\n while ($row = $db->fetchObject($roles))\n {\n $role = new Role();\n $role->loadFromMap($row);\n $this->roles[$row->rid] = $role;\n }\n\n return $this->roles;\n }",
"public static function loadRoles(){\n $roles = new self();\n $select = $roles->select();\n $select->order('role asc');\n $result = $roles->fetchAll($select);\n return $result;\n }",
"public function loadRoles() {\n $allRoles = $this->getRoles();\n foreach ($allRoles as $role) {\n // if (!empty($role->id_parent)) {\n //$this->_acl->addRole(new Zend_Acl_Role($role->id),$role->id_parent);\n // } else {\n //***if not place the role\n if (!in_array($role->id,$this->_acl->getRoles())) \n $this->_acl->addRole(new Zend_Acl_Role($role->id));\n // }\n }\n return true;\n }",
"abstract public function loadRole();",
"function load_roles()\n\t{\n\t\t$CI =& get_instance();\n\t\t\n\t\t$CI->load->model('role_model');\n\t\t\n\t\tif ($this->usr_id !== NULL)\n\t\t{\n\t\t\t$this->set_roles(Role_model::get_by_user($this->usr_id));\n\t\t}\n\t}",
"protected function _loadUserroles( )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\t$userroles = new zgUserroles( );\r\n\t\t$this->userroles = $userroles->loadUserroles( $this->getUserID( ) );\r\n\r\n\t\tif ( !is_array( $this->userroles ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem getting userroles for a user: could not load userroles', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem getting userroles for a user: could not load userroles', 'warning' );\r\n\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$this->userrolesLoaded = true;\r\n\t\t$this->debug->unguard( true );\r\n\t\treturn true;\r\n\t}",
"public function loadRoleRolesAction()\n {\n $return = array();\n $roleModel = new Admin_Model_DbTable_Acl_Role;\n $roleMemberModel = new Admin_Model_DbTable_Acl_RoleMember;\n $roleInheritModel = new Admin_Model_DbTable_Acl_RoleInherit;\n $roles = $roleModel->fetchAll();\n\n FOREACH($roles AS $roleRow) {\n $users = $groups = $inherits = array();\n $role = new Admin_Model_DbRow_Role($roleRow);\n\n FOREACH($roleMemberModel->getRoleUsers($roleRow['uar_id']) AS $userRow) {\n $user = new Admin_Model_DbRow_User($userRow);\n $users[] = $user->toJsonArray();\n }\n FOREACH($roleMemberModel->getRoleGroups($roleRow['uar_id']) AS $groupRow) {\n $group = new Admin_Model_DbRow_Group($groupRow);\n $groups[] = $group->toJsonArray();\n }\n FOREACH($roleInheritModel->getRoleInheritance($roleRow['uar_id']) AS $inheritRow) {\n $inherit = new Admin_Model_DbRow_Role($inheritRow);\n $inherits[] = $inherit->toJsonArray();\n }\n\n $return[] = array_merge($role->toJsonArray(), array(\n 'users' => $users,\n 'groups' => $groups,\n 'inherits' => $inherits\n ));\n }\n\n RETURN $this->responseSuccess(array(\n 'roles' => $return\n ));\n }",
"private function loadUserRoles()\n {\n $this->userRoles = [];\n\n $roles = Yaml::parse(file_get_contents($this->configFilePath));\n if (is_array($roles) && !empty($roles['user_roles'])) {\n foreach ($roles['user_roles'] as $role => $ids) {\n !empty($this->userRoles[$role]) ? $this->userRoles[$role] += $ids : $this->userRoles[$role] = $ids;\n }\n }\n }",
"public function getUserRoles();",
"public function ApiGetUserRoles(): void {\r\n if ($this->sections === null) {\r\n $this->uiSection = null;\r\n $this->sections = array();\r\n // The following call returns an array of sections to which the current user has access.\r\n // The API call returns an array of objects, one for each section to which the logged-in user\r\n // has access. The contents of each object are described in method\r\n // Section->ApiUseGetUserRoles\r\n $apiSections = $this->PostAPI( 'api.php?action=getUserRoles' );\r\n if (is_array( $apiSections )) {\r\n foreach ($apiSections as $apiSection) {\r\n $section = $this->Section( intval( $apiSection->sectionid ) );\r\n $section->ApiUseGetUserRoles( $apiSection );\r\n $this->sections[ $section->id ] = $section;\r\n if ($this->uiSection == null || $apiSection->isDefault)\r\n $this->uiSection = $section;\r\n }\r\n }\r\n }\r\n }",
"protected function load_required_roles() {\n /// Get all roles\n $this->roles = role_fix_names(get_all_roles(), context_system::instance(), ROLENAME_ORIGINAL);\n }",
"protected function getRoles()\n\t{\n\t\tif ($this->session !== null || $this->config->getAuthenticationType() == Config::AUTH_USER)\n\t\t{\n\t\t\t$actor_type = 'user';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$actor_type = 'application';\n\t\t}\n\t\t\n\t\t$roles = $this->loadRolesFromCache($actor_type);\n\t\t\n\t\tif ($roles === false)\n\t\t{\n\t\t\t$roles = $this->loadRolesFromApi($actor_type);\n\t\t\t\n\t\t\t// Store it in the cache\n\t\t\t$this->token_cache->set($this->rolesCacheKey($actor_type), $roles);\n\t\t}\n\t\t\n\t\treturn $roles;\n\t}",
"protected function get_roles_data()\n {\n }",
"public function rolesForUser();",
"private function setRolesFromDB(){\n $connection = new Connection();\n $link = $connection->connect();\n $result = $link->query(\"SELECT role_id FROM user_has_role WHERE user_id = '$this->id'\");\n $roles = new UserRoles();\n foreach ($result as $record){\n $roles[] = new Role('id', $record['role_id']);\n }\n $this->setRoles($roles);\n $connection = null;\n }",
"protected function initRoles()\n {\n $this->roles = CAT_Roles::getInstance()->getRoles(\n array('for'=>'user','user'=>$this->user['user_id'])\n );\n }",
"protected function _initRoles () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aRoleListing = $oAclCache->load(self::CACHE_IDENTIFIER_ROLES)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Roles from the Database\r\n\t\t\t$oDaoRole = Kwgl_Db_Table::factory('System_Role'); /* @var $oDaoRole Dao_System_Role */\r\n\t\t\t//$aRoleListing = $oDaoRole->fetchAll();\r\n\t\t\t$aRoleListing = $oDaoRole->getRoles();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aRoleListing, self::CACHE_IDENTIFIER_ROLES);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aRoleListing as $aRoleDetail) {\r\n\t\t\t$sRoleName = $aRoleDetail['name'];\r\n\t\t\tif (is_null($aRoleDetail['parent'])) {\r\n\t\t\t\t// Add the Role if it hasn't been defined yet\r\n\t\t\t\tif (!$this->hasRole($sRoleName)) {\r\n\t\t\t\t\t$this->addRole(new Zend_Acl_Role($sRoleName));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Parent Role assigned\r\n\t\t\t\t$sRoleParentName = $aRoleDetail['parent'];\r\n\t\t\t\t// Add the Parent Role if the Parent Role hasn't been defined yet\r\n\t\t\t\tif (!$this->hasRole($sRoleParentName)) {\r\n\t\t\t\t\t$this->addRole(new Zend_Acl_Role($sRoleParentName));\r\n\t\t\t\t}\r\n\t\t\t\t$this->addRole(new Zend_Acl_Role($sRoleName), $sRoleParentName);\r\n\t\t\t}\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns list of doctors info for a given zipcode and category (speciality). | protected function _processList($zip, $cat) {
$results = array();
$response = array();
for ($i = 0; $i <= 90; $i += 10) {
$body = $this->_executeRequest('search', Helper::searchUrl($zip, $cat, $i));
$search = json_decode($this->_filterResult($body));
$ids = $search->ids;
if (!empty($ids)) {
$body = $this->_executeRequest('doctors', Helper::doctorsList($ids));
}
else {
$body = false;
}
if ($body) {
$result = json_decode($this->_filterResult($body));
foreach ($result->doctor_locations as $doc) {
$results[] = $doc;
}
}
else {
break;
}
}
return $results;
} | [
"public function getDoctorHospital(Request $request)\n\t{\n\t\t$doctors = HealthcareProvider::confirmed()->where(function ($query) use ($request) {\n\t\t\t\t$query\n\t\t\t\t\t->where('name', 'like', '%'. $request->input('query') . '%')\n\t\t\t\t\t// ->orWhere( DB::raw('concat_ws(\" \", first_name,middle_name,last_name)') , 'like', '%' .$request->input('query') . '%' )\n\t\t\t\t\t->orWhere('state', 'like', $request->input('query') . '%')\n\t\t\t\t\t->orWhere('affiliations', 'like', $request->input('query') . '%')\n\t\t\t\t\t->orWhere('city', 'like', $request->input('query') . '%')\n\t\t\t\t\t->orWhere('street', 'like', '%'.$request->input('query'). '%')\n\t\t\t\t\t->orWhere('county', 'like', $request->input('query') . '%');\n\t\t});\n\t\tif ($request->has('zip_code')) {\n\t\t\t$location = Location::where('zip_code', $request->input('zip_code'))->first();\n\t\t\t$clonedDoctors = clone $doctors;\n\t\t\tif ($clonedDoctors->where('state', $location->state_abbr)->take(25)->get()->count())\n\t\t\t\treturn $clonedDoctors->where('state', $location->state_abbr)->take(25)->get();\n\t\t}\n\t\treturn $doctors->take(25)->get();\n\t}",
"function get_uc_schools_by_zip_code( $zip, $post_status = 'publish' ) {\n\t$wp_posts = get_posts(array(\n\t\t'post_type' => 'uc_school',\n\t\t'post_status' => $post_status,\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'zip',\n\t\t\t\t'value' => $zip,\n\t\t\t),\n\t\t),\n\t));\n\n\t$result = array();\n\tforeach ($wp_posts as $post) {\n\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t}\n\treturn $result;\n}",
"public function getHospitalsByDistance($postcode) {\n //Get the request and load it as variables\n $request = \\Request::all();\n $procedureId = $request['procedure_id'] ?? '';\n $radius = $request['radius'] ?? 50; //50 miles as default\n\n $hospitals = Hospital::getHospitalsWithParams($postcode, $procedureId, $radius);\n\n $this->returnedData['success'] = true;\n $this->returnedData['data'] = $hospitals;\n\n return $this->returnedData;\n }",
"public function getZipCodeData(string $zipcode): array;",
"public function getDoctors()\n {\n //todo get from DB, using stub for now\n return [\n 5 => 'Катаева В. Р.',\n 24 => 'Воронин М. В.'\n ];\n }",
"public function getDawidKruiperCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '183'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function getDikgatlongCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '160'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"function get_uc_schools_by_zip_code_and_country( $zip, $country, $post_status = 'publish' ) {\n\t$wp_posts = get_posts(array(\n\t\t'post_type' => 'uc_school',\n\t\t'post_status' => $post_status,\n\t\t'posts_per_page' => -1,\n\t\t'meta_query' => array(\n\t\t\tarray(\n\t\t\t\t'key' => 'zip',\n\t\t\t\t'value' => $zip,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'country',\n\t\t\t\t'value' => $country,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'key' => 'school_verified',\n\t\t\t\t'value' => 1,\n\t\t\t),\n\t\t),\n\t));\n\n\t$result = array();\n\tforeach ($wp_posts as $post) {\n\t\t$result[] = array('value' => $post->ID, 'label' => $post->post_title);\n\t}\n\treturn $result;\n}",
"public function getSwartlandCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '120'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"function getCities($databaseLink, $district)\n{\n $response = [];\n $district = intval($district);\n\n // $sql = \"\n // select t.name name_city,t.term_id term_city_id\n // ,(select meta_value from wpc_termmeta mklat where mklat.meta_key ='latitude' and mklat.term_id=tt.term_id) latitude_city\n // ,(select meta_value from wpc_termmeta mklng where mklng.meta_key ='longitude' and mklng.term_id=tt.term_id) longitude_city\n // from wpc_terms as t\n // join wpc_term_taxonomy as tt on tt.term_id=t.term_id\n // and tt.taxonomy='administrative-units'\n // and parent='{$district}';\n // \";\n $sql = \"\n select p.*,t.name name_city,t.term_id term_city_id\n ,(select meta_value from wpc_postmeta tma where tma.meta_key ='address_ru' and tma.post_id=p.id) address\n ,(select meta_value from wpc_postmeta tmlat where tmlat.meta_key ='latitude' and tmlat.post_id=p.id) latitude\n ,(select meta_value from wpc_postmeta tmlng where tmlng.meta_key ='longitude' and tmlng.post_id=p.id) longitude\n ,(select meta_value from wpc_termmeta mklat where mklat.meta_key ='latitude' and mklat.term_id=tt.term_id) latitude_city\n ,(select meta_value from wpc_termmeta mklng where mklng.meta_key ='longitude' and mklng.term_id=tt.term_id) longitude_city\n ,(select meta_value from wpc_termmeta status where status.meta_key ='status' and status.term_id=tt.term_id) status_city\n ,(select meta_value from wpc_postmeta phone where phone.meta_key ='phone' and phone.post_id=p.id) phone\n ,(select meta_value from wpc_postmeta email where email.meta_key ='email' and email.post_id=p.id) email\n ,(select meta_value from wpc_postmeta site where site.meta_key ='site_url' and site.post_id=p.id) site\n ,(select meta_value from wpc_postmeta rabbi where rabbi.meta_key ='name_ru' and rabbi.post_id=p.id) rabbi\n from wpc_posts p\n join wpc_term_relationships as tr on tr.object_id = p.id\n join wpc_term_taxonomy as tt on tt.term_taxonomy_id=tr.term_taxonomy_id\n join wpc_terms as t on t.term_id=tt.term_id\n where p.post_type='organizations'\n and p.post_status='publish'\n and tt.taxonomy='administrative-units'\n and parent='{$district}';\n \";\n\n // $stmt = mysqli_prepare($databaseLink, $sql);\n // mysqli_stmt_bind_param($stmt, 'd', $district);\n // $response = mysqli_stmt_execute($stmt);\n\n if ($res = mysqli_query($databaseLink, $sql)) {\n $response = mysqli_fetch_all($res, MYSQLI_ASSOC);\n }\n return $response;\n}",
"private function getCategoryData()\n\t{\n\t\treturn $this->findByIndex($this->category);\n\t}",
"public function getOudtshoornCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '102'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function getHantamCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '167'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function getTheewaterskloofCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '115'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function cities()\n\t{\n\t\treturn $this->_address->city->collections($this->_address->subject->code.$this->_address->district->code);\n\t}",
"public function getGeorgeCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '108'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"public function getCapeAgulhasCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '112'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}",
"function retrieve_addressbook_categories(){\n\t\n\t\tglobal $connection;\n\t\t$params = array('id', 'Client_category_name');\n\t\treturn AppModel::grab_db_function_class()->result_to_array_for_few_fields(AppModel::grab_db_function_class()->execute_query(\"SELECT id, Client_category_name FROM pfa__addbook_categories\"), $params);\t\t\n\t}",
"public function getMatzikamaCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '118'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get login history count | public function getLoginHistoryCount():int
{
$history = Di::make(LoginHistory::class);
return $history->getCountUuid($this->uuid);
} | [
"public function getLoginHistoryCount():int;",
"public function loginlogsCount(){\n return $this->loginlogs()->count();\n }",
"public function getLoginCount(): int;",
"public function getLoginCountAttribute(): int\n {\n $logins = $this->activity()->get();\n $logins->filter(function ($e) {\n return 1 == $e->action_id;\n });\n\n return count($logins);\n }",
"public function getLoginCount()\n {\n return $this->loginCount;\n }",
"public function getHistoryCount() {\n return count($this->getHistory());\n }",
"public function countAccount_sessions(){\n\t\t\t\t\t return count($this->listeAccount_sessions());\n\t\t\t\t\t }",
"public function monitoringLoginNumber()\n {\n $message = 'LOGINS';\n $result = 0;\n \n try {\n $filter = new Tinebase_Model_AccessLogFilter(array(\n array('field' => 'li', 'operator' => 'after', 'value' => Tinebase_DateTime::now()->subMinute(5))\n ));\n $accesslogs = Tinebase_AccessLog::getInstance()->search($filter, NULL, FALSE, TRUE);\n $valueString = ' | count=' . count($accesslogs) . ';;;;';\n $message .= ' OK' . $valueString;\n } catch (Exception $e) {\n $message .= ' FAIL: ' . $e->getMessage();\n $result = 2;\n }\n \n echo $message . \"\\n\";\n return $result;\n }",
"public function getloginCount() {\n /*\n commented by jkm on 5 november 14\n $startTime = date('Y-m-d', strtotime(\"yesterday\")) . ' ' . '00:00:00';\n $endTime = date('Y-m-d', strtotime(\"yesterday\")) . ' ' . '24:59:59';\n $db = $this->getAdapter();\n $query = $db->select()\n ->from(array('on' => 'mybb_user_online'), array('on.*'))\n ->where(\"on.datetime >= '$startTime' and on.datetime <= '$endTime'\");\n $select = count($db->fetchAll($query));\n return $select; */\n\n /* @ **********added by jkm on 5 november********** */\n $startTime = date('Y-m-d', strtotime(\"yesterday\")) . ' ' . '00:00:00';\n $endTime = date('Y-m-d', strtotime(\"yesterday\")) . ' ' . '24:59:59';\n $db = $this->getAdapter();\n $query = $db->select()\n ->from(array('on' => 'mybb_login_logout_details'), array('on.*'))\n ->where(\"on.login_time >= '$startTime' and on.login_time <= '$endTime'\");\n $select = count($db->fetchAll($query));\n return $select;\n }",
"public function getLoginCount()\n {\n return $this->getFieldValue('loginCount');\n }",
"public function getSessionsCount();",
"public function getFailedLoginCount();",
"public function auth_count() {\n return $this->_preload_counts(\n 'auth_count',\n 'Neoform\\Auth',\n 'user_id'\n );\n }",
"public function getLogEntryCount() {\n return $this->getCountByKey('date','log');\n }",
"public function getAuthHistory()\n {\n return $this->conn->getAll(\"SELECT user_name,user_login,user_ip,login_date,login_time FROM ?n LEFT JOIN ?n USING(user_id) ORDER BY login_date,login_time\", $this->history_table, $this->table);\n }",
"static function getLogCount() {\r\n\t\ttry {\r\n\t\t\t$stmt = getDB ()->query ( \"SELECT COUNT(*) FROM log\" );\r\n\t\t\treturn $stmt->fetch ()[\"COUNT(*)\"];\r\n\t\t} catch ( Exception $ex ) {\r\n\t\t\tsetSession ( \"error\", $ex->getMessage () );\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"public function getlastLoginsInfo() {\n $criteria = new CDbCriteria();\n $criteria->compare('user_id', $this->id);\n $criteria->order = 'createTime DESC';\n $criteria->limit = 3;\n return UserLoginHistory::model()->findAll($criteria);\n }",
"function countSessions()\n {\n $timestamp = strftime(\"%Y/%m/%d %H:%M\", time() - intval($this->Configuration->visitor_time_threshold));\n $query = $this->fMain->PDO->prepare(\"SELECT sessionid FROM sessions WHERE lastactivity >= :timestamp;\");\n $query->bindParam(':timestamp', $timestamp);\n $query->execute();\n return $query->rowCount();\n }",
"public function getCount()\n {\n return count($this->sessionData);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gravity Forms not installed | function template() {
if ( !$this->is_plugin_active() ) {
?><em><?php _e('Please install Gravity Forms plugin', 'crb'); ?></em><?php
return;
}
// No forms have been found
if ( empty($this->options) ) {
?><em><?php _e('No Gravity Forms have been found.', 'crb'); ?></em><?php
return;
}
parent::template();
} | [
"public function init_gravityform() {\n if (class_exists('GFForms')) {\n // Allow hiding Graviy Form field labels so that fields can use\n // placeholders only.\n add_filter('gform_enable_field_label_visibility_settings', '__return_true');\n\n // Gravityform forces these.\n if (get_option('rg_gforms_key') && get_option('gform_pending_installation')) {\n delete_option('gform_pending_installation');\n delete_option('gform_enable_background_updates');\n }\n }\n }",
"public function check_gravity_forms() {\n\n /* Gravity Forms version not compatible */\n if ( ! class_exists( 'GFCommon' ) || ! version_compare( GFCommon::$version, $this->required_gf_version, '>=' ) ) {\n $this->notices[] = sprintf( esc_html__( '%sGravity Forms%s Version %s is required. %sGet more info%s.', 'gravity-forms-pdf-extended' ), '<a href=\"https://www.e-junkie.com/ecom/gb.php?cl=54585&c=ib&aff=235154\">', '</a>', $this->required_gf_version, '<a href=\"https://gravitypdf.com/documentation/v4/user-activation-errors/#gravityforms-version\">', '</a>' );\n\n return false;\n }\n\n return true;\n }",
"public static function is_gravityforms_installed() {\n\t\t\treturn ( class_exists( 'GFForms' ) || class_exists( 'RGForms' ) );\n\t\t}",
"function displayGravityForm($form_object) {\n//displays the form selected in Page and created in Forms \n gravity_form_enqueue_scripts($form_object['id'], true);\n\tgravity_form($form_object['id'], false, false, false, '', true, 1);\n}",
"function displayGravityForm($form_object) {\n//displays the form selected in Page and created in Forms \n\tif(is_array($form_object)){\n\t\t$form_object=$form_object['id'];\n\t}\n gravity_form_enqueue_scripts($form_object, true);\n\tgravity_form($form_object, false, false, false, null, true, 1,true);\n}",
"function render() {\r\n\t\tif ( !$this->is_plugin_active() ) {\r\n\t\t\t?><em><?php _e('Please install Gravity Forms plugin', 'crb'); ?></em><?php\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->set_options( apply_filters( 'crb_gravity_form_options', $this->options ) );\r\n\r\n\t\t// No forms have been found\r\n\t\tif ( empty($this->options) ) {\r\n\t\t\t?><em><?php _e('No Gravity Forms have been found.', 'crb'); ?></em><?php\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tparent::render();\r\n\t}",
"function gf_fusedesk_load() {\n // This should only ever be called by Gravity Forms, but just in case, let's make sure that our class and method exist\n if (!class_exists('GFForms')\n || !method_exists( 'GFForms', 'include_addon_framework')\n ) {\n return;\n }\n\n require_once( 'fusedesk-gfaddon.php' );\n\n GFAddOn::register( 'FuseDeskGfAddon' );\n}",
"public static function is_gravityforms_supported( $min_version ) {\n\t\t\treturn self::check_gravityforms_version( $min_version, '>=' );\n\t\t}",
"function GDForm()\n{\n return \\GDForm\\GDForm::instance();\n}",
"function hw_wpcf7_default_gform() {\r\n return '1GzynAtb3hiv6E0mFE0KhxMwARSYGdGSY8oJ5ImGM7m4';\r\n}",
"function check_gravity_forms_plugin_activate(){\n // check of Gravity form active plugin\n if( !is_plugin_active( 'gravityforms/gravityforms.php' ) ){\n echo('<h2 style=\"max-width: 960px; margin: 0 auto; color: red\">Sorry! For use plugin Tracking-paid-traffic in your site</h2>');\n echo('<h2 style=\"max-width: 960px; margin: 0 auto;\">you can activated gravityforms plugin in your site!</h2>');\n return;\n }\n add_action( 'plugins_loaded', 'init_tracking_traffic_paid' ); //LOAD PLUGIN\n }",
"function setup_gravity_form_options() {\r\n\t\tif ( !$this->is_plugin_active() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$forms = RGFormsModel::get_forms(null, 'title');\r\n\r\n\t\tif ( !is_array($forms) || empty($forms) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$options = array(\r\n\t\t\t'0' => __('No form', 'crb'),\r\n\t\t);\r\n\r\n\t\tforeach ($forms as $form) {\r\n\t\t\t$options[$form->id] = $form->title;\r\n\t\t}\r\n\r\n\t\t$this->set_options($options);\r\n\t}",
"function disable_gravity_forms_css() {\n \n if ( ! get_option ( 'rg_gforms_disable_css' ) ) {\n update_option( 'rg_gforms_disable_css', TRUE );\n }\n\n}",
"function enqueue_gform_assets( $form, $is_ajax = true )\n{\n}",
"public function importGravityForms() {\n\t\tif (!class_exists('UserFormFieldEditorExtension')) {\n\t\t\tthrow new WordpressImportException(__FUNCTION__.' requires User Defined Forms 3.0+');\n\t\t}\n\t\t//$list = ElementContent::get()->filter(array('HTML:PartialMatch' => '[gravityform'));\n\n\t\t// Get existing gravity form items\n\t\t$existingWpRecords = array();\n\t\t$list = $this->applyWordpressFilter(UserDefinedForm::get(), array('posts', 'rg_form'));\n\t\tforeach ($list as $record) {\n\t\t\tif (isset($record->WordpressData['gravityform'])) {\n\t\t\t\t// Handle case where a Page was the only one using a Gravity Form, so\n\t\t\t\t// the gravity form data was just attached to that existing data.\n\t\t\t\t$gfData = $record->WordpressData['gravityform'];\n\t\t\t\tif (!isset($gfData['id'])) {\n\t\t\t\t\tthrow new Exception('Missing \"id\" in \"gravityform\" data on #'.$record->ID.' in its \"WordpressData\" column.');\n\t\t\t\t}\n\t\t\t\t$id = $gfData['id'];\n\t\t\t\t$existingWpRecords[$id] = $record;\n\t\t\t} else {\n\t\t\t\t// Handle case where Gravity form was used in multiple locations, wherein\n\t\t\t\t// a new page was created.\n\t\t\t\t$existingWpRecords[$record->WordpressID] = $record;\n\t\t\t}\n\t\t}\n\n\t\t$gfDB = new WordpressGravityForms($this->_db);\n\t\tforeach ($gfDB->getForms() as $gfData) {\n\t\t\t$gfID = (int)$gfData['id'];\n\t\t\tif ($existingWpRecords && isset($existingWpRecords[$gfID])) {\n\t\t\t\t// Skip existing imported gravity forms\n\t\t\t\t$this->log($record, 'nochange');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$gfMeta = $gfDB->attachAndGetFormMeta($gfData);\n\t\t\tif (!isset($gfMeta['display_meta']['fields'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Create array of EditableFormField's\n\t\t\t$fields = array();\n\t\t\t$fieldsData = $gfMeta['display_meta']['fields'];\n\t\t\tforeach ($fieldsData as $i => $fieldData) {\n\t\t\t\tif (!isset($fieldData['type'])) {\n\t\t\t\t\tthrow new WordpressImportException('Gravity Form field is missing \"type\"');\n\t\t\t\t}\n\t\t\t\t$type = $fieldData['type'];\n\t\t\t\t$label = isset($fieldData['label']) ? $fieldData['label'] : null;\n\t\t\t\t$field = null;\n\t\t\t\tswitch ($type)\n\t\t\t\t{\n\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\t$field = EditableTextField::create();\n\t\t\t\t\t\t$field->Rows = 4;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'name':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'phone':\n\t\t\t\t\t\t$field = EditableTextField::create();\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t$field = EditableEmailField::create();\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'number':\n\t\t\t\t\t\t$field = EditableNumericField::create();\n\t\t\t\t\t\t$field->MinValue = isset($fieldData['rangeMin']) ? $fieldData['rangeMin'] : 0;\n\t\t\t\t\t\t$field->MaxValue = isset($fieldData['rangeMax']) ? $fieldData['rangeMax'] : 0;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'radio':\n\t\t\t\t\t\t$field = EditableRadioField::create();\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t$choices = isset($fieldData['choices']) ? $fieldData['choices'] : false;\n\t\t\t\t\t\tif (!$choices) {\n\t\t\t\t\t\t\tthrow new WordpressImportException('Cannot find \"choices\" on '.$type);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($choices) == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$field = EditableCheckbox::create();\n\t\t\t\t\t\t\tforeach ($choices as $choiceData)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$label = $choiceData['text'];\n\t\t\t\t\t\t\t\tbreak;\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$field = EditableCheckboxGroupField::create();\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'select':\n\t\t\t\t\t\t$field = EditableDropdown::create();\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'captcha':\n\t\t\t\t\t\t// No Captcha field comes with User Defined Forms.\n\t\t\t\t\t\t$field = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'html':\n\t\t\t\t\t\t// Ignore literal field\n\t\t\t\t\t\t$field = EditableLiteralField::create();\n\t\t\t\t\t\t$field->Content = isset($fieldData['content']) ? $fieldData['content'] : '';\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//Debug::dump($fieldData);\n\t\t\t\t\t\tthrow new WordpressImportException('Gravity Form field is unhandled type \"'.$type.'\".');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ($field === null)\n\t\t\t\t{\n\t\t\t\t\tthrow new WordpressImportException('Gravity Form field is mishandled type \"'.$type.'\" $field isn\\'t set.');\n\t\t\t\t}\n\t\t\t\tif ($field)\n\t\t\t\t{\n\t\t\t\t\t/*$descriptionPlacement = isset($fieldData['descriptionPlacement']) ? $fieldData['descriptionPlacement'] : 'above';\n\t\t\t\t\tif ($descriptionPlacement === 'above') {\n\t\t\t\t\t\t$field->Title = $label;\n\t\t\t\t\t} else if ($descriptionPlacement === 'below') {\n\t\t\t\t\t\t$field->RightTitle = $label;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new WordpressImportException('Invalid \"descriptionPlacement\" value \"'.$descriptionPlacement.'\"');\n\t\t\t\t\t}*/\n\t\t\t\t\t$field->Title = $label;\n\t\t\t\t\t$field->Placeholder = isset($fieldData['placeholder']) ? $fieldData['placeholder'] : null;\n\t\t\t\t\t$field->CustomErrorMessage = isset($fieldData['errorMessage']) ? $fieldData['errorMessage'] : null;\n\t\t\t\t\t$field->Required = isset($fieldData['isRequired']) ? $fieldData['isRequired'] : false;\n\t\t\t\t\t$field->Sort = $i + 1;\n\n\t\t\t\t\t$choices = isset($fieldData['choices']) ? $fieldData['choices'] : false;\n\t\t\t\t\tif ($choices && $field->hasMethod('Options')) {\n\t\t\t\t\t\tforeach ($choices as $choiceData) {\n\t\t\t\t\t\t\t$choice = EditableOption::create();\n\t\t\t\t\t\t\t$choice->Title = $choiceData['value'];\n\t\t\t\t\t\t\t$field->Options()->add($choice);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$fields[] = $field;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get existing page record if only a single page is using a gravity form.\n\t\t\t$oneGravityFormPageRecord = null;\n\t\t\t$pageContent = null;\n\t\t\tif (isset($this->_classes_using_elemental['SiteTree']) || isset($this->_classes_using_elemental['Page'])) {\n\t\t\t\t$list = ElementContent::get()->filter(array('HTML:PartialMatch' => '[gravityform id=\"'.$gfID.'\"'));\n\t\t\t\t$list = $list->toArray();\n\t\t\t\tif (count($list) == 1) {\n\t\t\t\t\t$elementContent = $list[0];\n\t\t\t\t\t$oneGravityFormPageRecord = $elementContent->Parent();\n\t\t\t\t\t$pageContent = $elementContent->HTML;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$list = SiteTree::get()->filter(array('Content:PartialMatch' => '[gravityform id=\"'.$gfID.'\"'));\n\t\t\t\t$list = $list->toArray();\n\t\t\t\tif (count($list) == 1) {\n\t\t\t\t\t$oneGravityFormPageRecord = $list[0];\n\t\t\t\t\t$pageContent = $oneGravityFormPageRecord->Content;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (substr_count($pageContent, '[gravityform') > 1) {\n\t\t\t\t// If two gravity forms exist on the single page, don't make it write the UserDefinedForm\n\t\t\t\t// to an existing page.\n\t\t\t\t$oneGravityFormPageRecord = null;\n\t\t\t}\n\t\t\t/*if ($oneGravityFormPageRecord && $existingWpRecords && isset($existingWpRecords[$oneGravityFormPageRecord->WordpressID])) {\n\t\t\t\t// Skip existing imported gravity forms\n\t\t\t\t$this->log($record, 'nochange');\n\t\t\t\tcontinue;\n\t\t\t}*/\n\n\t\t\t// Create UDF\n\t\t\tif ($oneGravityFormPageRecord) {\n\t\t\t\t// If only one page is using a Gravity Form, transform it into a UserDefinedForm page.\n\t\t\t\t$record = $oneGravityFormPageRecord->newClassInstance('UserDefinedForm');\n\t\t\t\t$wordpressData = $record->WordpressData;\n\t\t\t\t$wordpressData['gravityform'] = $gfData;\n\t\t\t\t$record->WordpressData = $wordpressData;\n\t\t\t} else {\n\t\t\t\t// If multiple pages are using the same Gravity Form, just create the UserDefinedForm page.\n\t\t\t\t$record = UserDefinedForm::create();\n\t\t\t\tif (!isset($gfData['title'])) {\n\t\t\t\t\tthrow new WordpressImportException('Gravity Form missing \"title\" field.');\n\t\t\t\t}\n\t\t\t\t$record->Title = $gfData['title'];\n\t\t\t\tif (!isset($gfData['date_created'])) {\n\t\t\t\t\tthrow new WordpressImportException('Gravity Form missing \"date_created\" field.');\n\t\t\t\t}\n\t\t\t\t$record->Created = $gfData['date_created'];\n\t\t\t\t$record->WordpressData = $gfData;\n\t\t\t}\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t$record->Fields()->add($field);\n\t\t\t}\n\t\t\t//Debug::dump($record->toMap()); \n\t\t\ttry {\n\t\t\t\t$isPublished = ((isset($gfData['is_active']) && $gfData['is_active']) || $record->isPublished());\n\t\t\t\t$this->writeAndPublishRecord($record, $isPublished);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->log($record, 'error', $e);\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t}",
"function GRAVITY_module( )\n{\n\t$directories = glob(get_stylesheet_directory() . '/modules/*' , GLOB_ONLYDIR);\n\tforeach ($directories as $filename) {\n\t\tinclude_once ($filename.'/init.php');\n\t}\n\n\tclass ET_Builder_Module_Gravity extends ET_Builder_Module {\n\n\t\t/*Initialize Gravity Module*/\n\t\tfunction init() {\n\t\t\t$this->name = esc_html__( 'Gravity Forms', 'et_builder' ); // Name of the module\n\t\t\t$this->slug = 'et_pb_gravity'; // slug of module\n\t\t\t// General tab options\n\t\t\t$this->whitelisted_fields = array(\n\t\t\t\t'select_form',\n\t\t\t\t'admin_label',\n\t\t\t\t'module_id',\n\t\t\t\t'module_class',\n\t\t\t\t'max_width',\n\t\t\t\t'max_width_tablet',\n\t\t\t\t'max_width_phone',\n\t\t\t\t'other_options',\n\t\t\t);\n\t\t\t$this->main_css_element = '%%order_class%%';\n\t\t\t// Advanced tab options\n\t\t\t$this->advanced_options = array(\n\t\t\t\t'custom_margin_padding' => array(\n\t\t\t\t\t'css' => array(\n\t\t\t\t\t\t'important' => 'all',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\t// To display the fields on front end\n\t\tfunction get_fields() {\n\t\t\t$fields = array(\n\t\t\t\t'select_form' => array(\n\t\t\t\t\t'label' => esc_html__( 'Select a Form', 'et_builder' ),\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'option_category' => 'configuration',\n\t\t\t\t\t'renderer'\t\t\t=> 'et_builder_gravity_forms',\n\t\t\t\t\t'description' => esc_html__( 'Select a form below to add it to your post or page.', 'et_builder' ),\n\n\t\t\t\t),\n\t\t\t\t'other_options' => array(\n\t\t\t\t\t'label' => esc_html__( 'Other Options', 'et_builder' ),\n\t\t\t\t\t'type' => 'multiple_checkboxes',\n\t\t\t\t\t'option_category' => 'configuration',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'display' => esc_html__( 'Display ', 'et_builder' ),\n\t\t\t\t\t\t'displaydescription' => esc_html__( 'Display from description', 'et_builder' ),\n\t\t\t\t\t\t'enableajax' => esc_html__( 'Enable Ajax', 'et_builder' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'max_width' => array(\n\t\t\t\t\t'label' => esc_html__( 'Max Width', 'et_builder' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'option_category' => 'layout',\n\t\t\t\t\t'mobile_options' => true,\n\t\t\t\t\t'tab_slug' => 'advanced',\n\t\t\t\t\t'validate_unit' => true,\n\t\t\t\t),\n\t\t\t\t'max_width_tablet' => array(\n\t\t\t\t\t'type' => 'skip',\n\t\t\t\t),\n\t\t\t\t'max_width_phone' => array(\n\t\t\t\t\t'type' => 'skip',\n\t\t\t\t),\n\t\t\t\t'disabled_on' => array(\n\t\t\t\t\t'label' => esc_html__( 'Disable on', 'et_builder' ),\n\t\t\t\t\t'type' => 'multiple_checkboxes',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'phone' => esc_html__( 'Phone', 'et_builder' ),\n\t\t\t\t\t\t'tablet' => esc_html__( 'Tablet', 'et_builder' ),\n\t\t\t\t\t\t'desktop' => esc_html__( 'Desktop', 'et_builder' ),\n\t\t\t\t\t),\n\t\t\t\t\t'additional_att' => 'disable_on',\n\t\t\t\t\t'option_category' => 'configuration',\n\t\t\t\t\t'description' => esc_html__( 'This will disable the module on selected devices', 'et_builder' ),\n\t\t\t\t),\n\t\t\t\t'admin_label' => array(\n\t\t\t\t\t'label' => esc_html__( 'Admin Label', 'et_builder' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'description' => esc_html__( 'This will change the label of the module in the builder for easy identification.', 'et_builder' ),\n\t\t\t\t),\n\t\t\t\t'module_id' => array(\n\t\t\t\t\t'label' => esc_html__( 'CSS ID', 'et_builder' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'option_category' => 'configuration',\n\t\t\t\t\t'tab_slug' => 'custom_css',\n\t\t\t\t\t'option_class' => 'et_pb_custom_css_regular',\n\t\t\t\t),\n\t\t\t\t'module_class' => array(\n\t\t\t\t\t'label' => esc_html__( 'CSS Class', 'et_builder' ),\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'option_category' => 'configuration',\n\t\t\t\t\t'tab_slug' => 'custom_css',\n\t\t\t\t\t'option_class' => 'et_pb_custom_css_regular',\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn $fields;\n\t\t}\n\t\t// to store the value of fields in database and display the form at front end\n\t\tfunction shortcode_callback( $atts, $content = null, $function_name ) {\n\t\t\t// storing the values in databse\n\t\t\t$module_id = $this->shortcode_atts['module_id'];\n\t\t\t$module_class = $this->shortcode_atts['module_class'];\n\t\t\t$other_options = $this->shortcode_atts['other_options'];\n\t\t\t$select_form = $this->shortcode_atts['select_form'];\n\t\t\t$max_width = $this->shortcode_atts['max_width'];\n\t\t\t$max_width_tablet = $this->shortcode_atts['max_width_tablet'];\n\t\t\t$max_width_phone = $this->shortcode_atts['max_width_phone'];\n\t\t\t// storing process finish\n\n\t\t\t$module_class = ET_Builder_Element::add_module_order_class( $module_class, $function_name );\n\n\n\t\t\t$this->shortcode_content = et_builder_replace_code_content_entities( $this->shortcode_content );\n\n\t\t\t// Getting values of the options for gravity form\n\t\t\tif ( isset( $this->shortcode_atts['other_options'] ) && '' !== $this->shortcode_atts['other_options'] ) {\n\t\t\t\t$other_options_array = explode( '|', $this->shortcode_atts['other_options'] );\n\t\t\t\tif($other_options_array[0] == 'on'){\n\t\t\t\t\t$title = 'true';\n\t\t\t\t}else{\n\t\t\t\t\t$title = 'false';\n\t\t\t\t}\n\t\t\t\tif($other_options_array[1] == 'on'){\n\t\t\t\t\t$description = 'true';\n\t\t\t\t}else{\n\t\t\t\t\t$description = 'false';\n\t\t\t\t}\n\t\t\t\tif($other_options_array[2] == 'on'){\n\t\t\t\t\t$ajax = 'true';\n\t\t\t\t}else{\n\t\t\t\t\t$ajax = 'false';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// creating the shortcode for gravity form\n\t\t\t$result = do_shortcode('[gravityform id=\"'.$select_form.'\" title=\"'.$title.'\" description=\"'.$description.'\" ajax=\"'.$ajax.'\"]');\n\t\t\t// Setting the width for different platforms\n\t\t\tif ( '' !== $max_width_tablet || '' !== $max_width_phone || '' !== $max_width ) {\n\t\t\t\t$max_width_values = array(\n\t\t\t\t\t'desktop' => $max_width,\n\t\t\t\t\t'tablet' => $max_width_tablet,\n\t\t\t\t\t'phone' => $max_width_phone,\n\t\t\t\t);\n\t\t\t\tet_pb_generate_responsive_css( $max_width_values, '%%order_class%%', 'max-width', $function_name );\n\t\t\t}\n\t\t\t// define the class values of the div displaying the gravity form\n\t\t\t$class = \"et_pb_select_form_{select_form}\";\n\t\t\t// setting the output to display the gravity form\n\t\t\t$output = sprintf(\n\t\t\t\t'<div%3$s class=\"et_pb_gravity%2$s%4$s\">\n\t\t\t\t\t%1$s\n\t\t\t\t</div> <!-- .et_pb_gravity -->',\n\t\t\t\t$result,\n\t\t\t\tesc_attr( $class ),\n\t\t\t\t( '' !== $module_id ? sprintf( ' id=\"%1$s\"', esc_attr( $module_id ) ) : '' ),\n\t\t\t\t( '' !== $module_class ? sprintf( ' %1$s', esc_attr( $module_class ) ) : '' )\n\t\t\t);\n\n\t\t\treturn $output;\n\t\t}\n\t}\nnew ET_Builder_Module_Gravity;\n}",
"function gloggi_dependencies() {\n if( ! function_exists('gloggi_dependencies_satisfied') )\n echo '<div class=\"error\"><p>' . __( 'Fehler: Das Gloggi-Theme benötigt das Gloggi-Plugin um zu funktionieren!', 'gloggi' ) . '</p></div>';\n}",
"public function zgpbld_requirements_error() {\n global $wp_version;\n require_once dirname(__FILE__) . '/views/requirements-error.php';\n }",
"public static function isGfActive()\n {\n return class_exists('RGForms');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enregistre la modification d'un article | public function modifierArticleSave($idArticle){
require_once(dirname(__DIR__, 1).'/includes/TwigConfig.php');
require_once(dirname(__DIR__, 1).'/database.php');
$articleRepository=$entityManager->getRepository('Article');
$article = $articleRepository->find($idArticle);
$userRepository=$entityManager->getRepository('User');
$user = $userRepository->find($_POST['auteurID']);
if (!empty($_POST['contenu']) AND !ctype_space($_POST['contenu']) )
{
$article->setTitre($_POST['titre']);
$article->setChapo($_POST['chapo']);
$article->setContenu($_POST['contenu']);
$article->setUser($user);
$article->setDateDerniereModif(new \DateTime(date('Y-m-d H:i:s')));
$entityManager->persist($article);
$entityManager->flush();
//Définition du message d'information
$_SESSION['flashmessage']='Article modifié avec succès';
}
header('Location: /clementsblog/admin/gestionArticles');
} | [
"function save()\n\t\t{\n\t\t\tif(!$this->isWritable)\n\t\t\t\tthrow new SERIA_Exception(\"Article is not writable. Use ->writable() to enable.\");\n\t\t\tif(!$this->isDirty)\n\t\t\t\tthrow new SERIA_Exception(\"Article has not changed.\");\n\n\t\t\t$this->validateData();\n\n\t\t\t$this->clearFromCache();\n\n\t\t\tif($this->row[\"id\"])\n\t\t\t{ // update an existing article\n\t\t\t\t$data = $this->prepareForDB();\n\t\t\t\t$sql = \"UPDATE \".SERIA_PREFIX.\"_articles SET \";\n\t\t\t\t$parts = array();\n\t\t\t\tunset($data[\"id\"]);\n\t\t\t\tforeach($data as $k => $v)\n\t\t\t\t\t$parts[] = $k.\"=\".$v;\n\t\t\t\t$sql .= implode(\",\", $parts);\n\t\t\t\t$sql .= \" WHERE id=\".$this->row[\"id\"];\n\n\t\t\t\tif($this->isDirtyCategories)\n\t\t\t\t\t$this->saveCategories();\n\n\n\t\t\t\t$this->db->exec(\"UPDATE \".SERIA_PREFIX.\"_articles_fts SET ft=\".$data[\"ft\"].\" WHERE id=\".$this->db->quote($this->row[\"id\"]));\n\t\t\t\t$res = $this->db->exec($sql);\n\t\t\t}\n\t\t\telse\n\t\t\t{ // insert a new article\n\t\t\t\t$this->row[\"id\"] = SERIA_Base::guid('article');\n\t\t\t\tif(!$this->row[\"content_id\"])\n\t\t\t\t\t$this->row[\"content_id\"] = $this->row[\"id\"];\n\t\t\t\t$data = $this->prepareForDB();\n\n\t\t\t\t$sql = \"INSERT INTO \".SERIA_PREFIX.\"_articles (\";\n\t\t\t\t$keyParts = array();\n\t\t\t\t$valueParts = array();\n\t\t\t\tforeach($data as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t$keyParts[] = $k;\n\t\t\t\t\t$valueParts[] = $v;\n\t\t\t\t}\n\n\t\t\t\t$sql .= implode(\",\", $keyParts).\") VALUES (\";\n\t\t\t\t$sql .= implode(\",\", $valueParts).\")\";\n\n\t\t\t\t$res = $this->db->exec($sql);\n\n\t\t\t\tif($this->isDirtyCategories)\n\t\t\t\t\t$this->saveCategories();\n\n\t\t\t\t$this->db->exec(\"INSERT INTO \".SERIA_PREFIX.\"_articles_fts (id, ft) VALUES (\".$this->db->quote($this->row[\"id\"]).\",\".$data[\"ft\"].\")\");\n\n\t\t\t\t$this->isDirty = false;\n\t\t\t}\n\n\t\t\t// update table *_files counter for files referenced by this article\n\t\t\tforeach($this->fields as $fieldName => $fieldDef)\n\t\t\t{\n\t\t\t\tif(!is_array($fieldDef))\n\t\t\t\t{\n\t\t\t\t\t$defs = array_flip(explode(\",\", $fieldDef));\n\t\t\t\t\tif(isset($defs[\"file\"]))\n\t\t\t\t\t{ // this is a file id field\n\t\t\t\t\t\tif(isset($defs[\"array\"]))\n\t\t\t\t\t\t{ // this is a multiple files field, update for all files\n\t\t\t\t\t\t\tforeach($this->row as $subFieldName => $value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(strpos($subFieldName, $fieldName.\"|\")===0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($this->originalExtra[$subFieldName])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tSERIA_File::createObject($this->originalExtra[$subFieldName])->decreaseReferrers();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($this->extra[$subFieldName])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tSERIA_File::createObject($this->extra[$subFieldName])->increaseReferrers();\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\telse\n\t\t\t\t\t\t{ // this is a single file field\n\t\t\t\t\t\t\tif($this->originalExtra[$fieldName] != $this->extra[$fieldName])\n\t\t\t\t\t\t\t{ // value has changed. decrease counter for old file, increase counter for new file\n\n\t\t\t\t\t\t\t\tif($this->originalExtra[$fieldName])\n\t\t\t\t\t\t\t\t{ // there was an old file\n\t\t\t\t\t\t\t\t\tSERIA_File::createObject($this->originalExtra[$fieldName])->decreaseReferrers();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif($this->extra[$fieldName])\n\t\t\t\t\t\t\t\t{ // there is a new file\n\t\t\t\t\t\t\t\t\tSERIA_File::createObject($this->extra[$fieldName])->increaseReferrers();\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\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->originalRow = $this->row;\n\t\t\t$this->originalExtra = $this->extra;\n\t\t\t\n\t\t\tif ($this->publishEvent) {\n\t\t\t\t$this->throwEvent('PUBLISH');\n\t\t\t}\n\t\t\tif ($this->unpublishEvent) {\n\t\t\t\t$this->throwEvent('UNPUBLISH');\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn $res;\n\t\t}",
"public function actionSave()\n {\n $this->articleService->saveChanges();\n }",
"public function save()\n {\n $soxId = $this->getEditObjectId();\n $aParams = oxConfig::getParameter( \"editval\" );\n\n $oArticle = oxNew( \"oxarticle\");\n $oArticle->setLanguage($this->_iEditLang);\n $oArticle->loadInLang( $this->_iEditLang, $soxId);\n $oArticle->setLanguage(0);\n\n $oArticle->assign( $aParams );\n $oArticle->setLanguage($this->_iEditLang);\n $oArticle->save();\n\n $this->setEditObjectId( $oArticle->getId() );\n }",
"protected abstract function saveArticle(TyposArticle $article);",
"function add_article(){\n $article = $this->articles->create();\n $this->present_article($article);\n }",
"function saveArticle() {\n\t $title = empty($_POST['title']) ? '' : htmlspecialchars($_POST['title']);\n\t $category = empty($_POST['category']) ? '' : $_POST['category'];\n\t\t$body = handleTextFormat($body);\n\t $authorid = getAuthorID();\n\t\t$image = getImage();\n\t \t$is_draft = 1;\n\t \t$is_submitted = 0;\n\n\t \tif(isset($_POST['article_id'])) {\n\t\t\t$db = dbConnect();\n\t\t\t$stmt = $db->stmt_init();\n\t\t \t$articleData = getArticleByID($_POST['article_id'], $db);\n\t\t \t$isAuthor = ($articleData['UserID'] && $_SESSION['userid'] ? TRUE : FALSE);\n\t \t}\n\t\tif($articleData['ArticleID'] || $isAuthor) {\n\t\t\tupdateArticle($articleData['ArticleID'], $title, $body, $category, $image, $is_submitted, $db, $stmt);\n\t\t} else {\n\t\t\tinsertArticle($authorid, $title, $body, $category, $image, $is_draft, $is_submitted);\n\t \t}\n\t}",
"function admin_saveRemark(){\r\n \r\n \t$this->__requireRole(ROLE_TUTOR);\r\n \t$remark = $this->data['Article']['remark'];\r\n \t$data = $this->Article->findById($this->data['Article']['id']);\r\n \t\r\n \tunset($this->data['Article']['remark']);\r\n \t$data['Article']['remark'] = $remark;\r\n //debug($data);exit;\r\n if (!$this->Article->save($data)){\r\n $this->Session->setFlash('There was an error saving the remark.');\r\n } else {\r\n $this->Session->setFlash('The remark was saved.<br />');\r\n }\r\n \r\n unset($this->data);\r\n $this->redirect('approvals');\r\n exit;\r\n }",
"function modifierArticle() {\n\t}",
"public function saveArticle($article, $id=0){\n if($id==0){\n DBHelper::insert(\"mvc_articles\", $article);\n }\n else{\n DBHelper::update(\"mvc_articles\", $article, \"WHERE article_id = ?\", array($id));\n }\n }",
"protected function updateAndPersistBlog() {}",
"abstract protected function modify(News $news);",
"public function saveAction()\n {\n\n $this->loggerStdout->log('ArticleController: Save and edited article');\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"articles\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n if (!$this->security->checkToken()) {\n $this->flash->error(\"Token not OK\"); \n return;\n }\n //check sql\n parent::checkRequest($this->request);\n\n $id = $this->request->getPost(\"id\");\n $article = Articles::findFirstByid($id);\n\n if (!$article) {\n $this->flash->error(\"article does not exist \" . $id);\n $this->loggerStderr->error('Article does not exists (id='.$id.')');\n\n $this->dispatcher->forward([\n 'controller' => \"articles\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $article->id = $this->request->getPost(\"id\");\n $article->titre = $this->request->getPost(\"titre\");\n $article->contenu = $this->request->getPost(\"contenu\");\n $article->datePublication = $this->request->getPost(\"date_publication\");\n $article->tagId = $this->request->getPost(\"tagId\");\n $article->userId = $this->request->getPost(\"userId\");\n \n\n if (!$article->save()) {\n\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"articles\",\n 'action' => 'edit',\n 'params' => [$article->id]\n ]);\n\n return;\n }\n\n $this->loggerStdout->log('article was updated successfully (id='.$id.')');\n $this->flash->success(\"article was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"articles\",\n 'action' => 'index'\n ]);\n }",
"function insertArticle(&$article) {\n\t\t$article->stampModified();\n\t\t$this->update(\n\t\tsprintf('INSERT INTO articles\n\t\t\t\t(locale, user_id, journal_id, section_id, language, comments_to_ed, citations, date_submitted, date_status_modified, last_modified, status, submission_progress, current_round, submission_file_id, revised_file_id, review_file_id, editor_file_id, pages, fast_tracked, hide_author, comments_status, doi)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, ?, ?, ?, %s, %s, %s, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',\n\t\t$this->datetimeToDB($article->getDateSubmitted()), $this->datetimeToDB($article->getDateStatusModified()), $this->datetimeToDB($article->getLastModified())),\n\t\tarray(\n\t\t$article->getLocale(),\n\t\t$article->getUserId(),\n\t\t$article->getJournalId(),\n\t\t$article->getSectionId(),\n\t\t$article->getLanguage(),\n\t\t$article->getCommentsToEditor(),\n\t\t$article->getCitations(),\n\t\t$article->getStatus() === null ? STATUS_QUEUED : $article->getStatus(),\n\t\t$article->getSubmissionProgress() === null ? 1 : $article->getSubmissionProgress(),\n\t\t$article->getCurrentRound() === null ? 1 : $article->getCurrentRound(),\n\t\t$article->getSubmissionFileId(),\n\t\t$article->getRevisedFileId(),\n\t\t$article->getReviewFileId(),\n\t\t$article->getEditorFileId(),\n\t\t$article->getPages(),\n\t\t$article->getFastTracked()?1:0,\n\t\t$article->getHideAuthor() === null ? 0 : $article->getHideAuthor(),\n\t\t$article->getCommentsStatus() === null ? 0 : $article->getCommentsStatus(),\n\t\t$article->getStoredDOI()\n\t\t)\n\t\t);\n\n\t\t$article->setId($this->getInsertArticleId());\n\t\t$this->updateLocaleFields($article);\n\n\t\t// Insert authors for this article\n\t\t$authors =& $article->getAuthors();\n\t\tfor ($i=0, $count=count($authors); $i < $count; $i++) {\n\t\t\t$authors[$i]->setSubmissionId($article->getId());\n\t\t\t$this->authorDao->insertAuthor($authors[$i]);\n\t\t}\n\n\t\treturn $article->getId();\n\t}",
"public function testUpdateContent()\n {\n\n }",
"function afficherArticle() {\n\t}",
"private function _sportal_admin_article_edit_save()\n\t{\n\t\tglobal $context, $txt, $modSettings;\n\n\t\tcheckSession();\n\n\t\t// Use our standard validation functions in a few spots\n\t\trequire_once(SUBSDIR . '/DataValidator.class.php');\n\t\t$validator = new Data_Validator();\n\n\t\t// If it exists, load the current data\n\t\tif ($this->_is_aid)\n\t\t{\n\t\t\t$_POST['article_id'] = $this->_is_aid;\n\t\t\t$context['article'] = sportal_get_articles($this->_is_aid);\n\t\t}\n\n\t\t// Clean and Review the post data for compliance\n\t\t$validator->sanitation_rules(array(\n\t\t\t'title' => 'trim|Util::htmlspecialchars',\n\t\t\t'namespace' => 'trim|Util::htmlspecialchars',\n\t\t\t'article_id' => 'intval',\n\t\t\t'category_id' => 'intval',\n\t\t\t'permissions' => 'intval',\n\t\t\t'styles' => 'intval',\n\t\t\t'type' => 'trim',\n\t\t\t'content' => 'trim'\n\t\t));\n\t\t$validator->validation_rules(array(\n\t\t\t'title' => 'required',\n\t\t\t'namespace' => 'alpha_numeric|required',\n\t\t\t'type' => 'required',\n\t\t\t'content' => 'required'\n\t\t));\n\t\t$validator->text_replacements(array(\n\t\t\t'title' => $txt['sp_admin_articles_col_title'],\n\t\t\t'namespace' => $txt['sp_admin_articles_col_namespace'],\n\t\t\t'content' => $txt['sp_admin_articles_col_body']\n\t\t));\n\n\t\t// If you messed this up, tell them why\n\t\tif (!$validator->validate($_POST))\n\t\t{\n\t\t\tforeach ($validator->validation_errors() as $id => $error)\n\t\t\t{\n\t\t\t\t$this->article_errors->addError($error);\n\t\t\t}\n\t\t}\n\n\t\t// Lets make sure this namespace (article id) is unique\n\t\t$has_duplicate = sp_duplicate_articles($validator->article_id, $validator->namespace);\n\t\tif (!empty($has_duplicate))\n\t\t{\n\t\t\t$this->article_errors->addError('sp_error_article_namespace_duplicate');\n\t\t}\n\n\t\t// And we can't have just a numeric namespace (article id)\n\t\tif (preg_replace('~[0-9]+~', '', $validator->namespace) === '')\n\t\t{\n\t\t\t$this->article_errors->addError('sp_error_article_namespace_numeric');\n\t\t}\n\n\t\t// Posting some PHP code, and allowed? Then we need to validate it will run\n\t\tif ($_POST['type'] === 'php' && !empty($_POST['content']) && empty($modSettings['sp_disable_php_validation']))\n\t\t{\n\t\t\t$validator_php = new Data_Validator();\n\t\t\t$validator_php->validation_rules(array('content' => 'php_syntax'));\n\n\t\t\t// Bad PHP code\n\t\t\tif (!$validator_php->validate(array('content' => $_POST['content'])))\n\t\t\t{\n\t\t\t\t$this->article_errors->addError($validator_php->validation_errors());\n\t\t\t}\n\t\t}\n\n\t\t// Check / Prep attachments\n\t\t$this->processArticleAttachments();\n\n\t\t// None shall pass ... with errors\n\t\tif ($this->article_errors->hasErrors() || $this->attach_errors->hasErrors())\n\t\t{\n\t\t\tunset($_POST['submit']);\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// No errors then, prepare the data for saving\n\t\t$article_info = array(\n\t\t\t'id' => $validator->article_id,\n\t\t\t'id_category' => $validator->category_id,\n\t\t\t'namespace' => $validator->namespace,\n\t\t\t'title' => $validator->title,\n\t\t\t'body' => Util::htmlspecialchars($_POST['content'], ENT_QUOTES),\n\t\t\t'type' => in_array($validator->type, array('bbc', 'html', 'php', 'markdown')) ? $_POST['type'] : 'bbc',\n\t\t\t'permissions' => $validator->permissions,\n\t\t\t'styles' => $validator->styles,\n\t\t\t'status' => !empty($_POST['status']) ? 1 : 0,\n\t\t);\n\n\t\tif ($article_info['type'] === 'bbc')\n\t\t{\n\t\t\tPreparseCode::instance()->preparsecode($article_info['body'], false);\n\t\t}\n\n\t\t// Bind attachments to the article if existing, create any needed thumbnails,\n\t\t// move them to the sp attachment directory\n\t\t$attachIDs = $this->finalizeArticleAttachments($article_info);\n\n\t\t// Save the article\n\t\t$this->_is_aid = sp_save_article($article_info, empty($this->_is_aid));\n\n\t\t// If this was a new article, with attachments, bind them to one another.\n\t\tif (empty($validator->article_id) && !empty($attachIDs))\n\t\t{\n\t\t\tbindArticleAttachments($this->_is_aid, $attachIDs);\n\t\t}\n\n\t\t// And return to the listing\n\t\tredirectexit('action=admin;area=portalarticles');\n\t}",
"function enregistrer(){\r\n\t$fichier = serialize($this);\r\n\t$djnfile = fopen('./dungeon/'.$this->nom.'.djn', 'w');\r\n\tfseek($djnfile, 0); // On remet le curseur au début du fichier\r\n\tfputs($djnfile, $fichier); // On écrit le nouveau nombre de pages vues\r\n\tfclose($djnfile);\r\n}",
"function saveUpdate($manager)\r\n{\r\n //!isset($_GET['id']) ? $id=1 : $id=$_GET['id'];// ternaire\r\n //$modif=$manager->Save(News $news); \r\n if(isset($_POST['modifierNews'])){\r\n if(isset($_POST['titre']) && isset( $_POST['auteur']) && isset($_POST['contenu']) && isset($_POST['listeImages']) )\r\n {\r\n //affectation des variables du formulaire modifierNews\r\n $id=$_POST['id'];//le fomulaire etant hidden sur l'id il devrait toujors etre !isset\r\n // $id=3;\r\n $titre=$_POST['titre'];\r\n $auteur=$_POST['auteur'];\r\n $contenu=$_POST['contenu']; \r\n $image=$_POST['listeImages'];\r\n //creation d'un objet tableau $news de la classe News avec les données du formulaire,\r\n // les index correspondent aux noms des attributs de la classe news\r\n $news = new News(\r\n array(\r\n 'auteur' => $auteur,\r\n 'titre' => $titre,\r\n 'contenu' => $contenu,\r\n 'image' =>$image\r\n )\r\n );\r\n //on verifie l'id du post pour savoir si il existe deja dans la bdr\r\n// if (isset($_POST['id'])) \r\n// {\r\n $news->setId($_POST['id']);\r\n \r\n// }\r\n //setter de l'id de la classe news \r\n //public function setId($id) {\r\n // $this->id = (int) $id;\r\n\r\n if ($news->isValid()) \r\n {\r\n $manager->save($news);\r\n $message = $news->isNew() ? 'La news a bien été ajoutée !' : 'La news a bien été modifiée !';\r\n } else {\r\n //$erreurs = $news->erreurs();\r\n // echo \"erreur dans le traitement\";\r\n }\r\n var_dump($id); \r\n var_dump($image);\r\n var_dump($contenu);\r\n var_dump($titre);\r\n var_dump($auteur);\r\n }\r\n } // echo \"vous avez oublié de remplir un champ\";\r\n}",
"function save(){\n $jinput = JFactory::getApplication()->input;\n $app = JFactory::getApplication();\t\t\n $user = JFactory::getUser();\n if(!JRequest::checkToken()){\n $this->setRedirect('index.php?option=com_jresearch');\n return;\n }\n\n $model = $this->getModel('Publication', 'JResearchModel');\n $task = $jinput->get('task');\t\t\n $form = $jinput->get('jform', array(), 'ARRAY'); \n $canDoPubs = JResearchAccessHelper::getActions();\n $canProceed = false;\t\n $params = JComponentHelper::getParams('com_jresearch');\n\n // Permissions check\n if (empty($form['id'])) {\n $canProceed = $canDoPubs->get('core.publications.create');\n if(!isset($form['published'])){\n $form['published'] = $params->get('publications_default_published_status', 1);\n }\n \n if(!isset($form['internal'])){\n $form['internal'] = $params->get('publications_default_internal_status', 1);\t\t\t\n }\n } else {\n $canProceed = $canDoPubs->get('core.publications.edit') ||\n ($canDoPubs->get('core.publications.edit.own') \n && $publication->created_by == $user->get('id'));\n }\n \n if (!$canProceed) {\n JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));\t\t\t\n return;\n } \n \n $app->triggerEvent('OnBeforeSaveJResearchEntity', array($form, 'publication'));\n $success = true;\n if ($task == 'changeType') {\n $success = $model->changeType();\n } else {\n $sucess = $model->save();\n }\n\n if ($success) {\n if ($task == 'changeType') {\n $publication = $model->getItem(); \t\n $app->triggerEvent('OnAfterSaveJResearchEntity', array($publication, 'publication'));\n $this->setRedirect('index.php?option=com_jresearch&view=publication&layout=edit&id='\n .$publication->id.'&pubtype='.$publication->pubtype\n .'&Itemid='.JRequest::getInt('Itemid', 0), JText::_('JRESEARCH_ITEM_SUCCESSFULLY_SAVED'));\n } else if($task == 'save'){\n $this->setRedirect('index.php?option=com_jresearch&view=publication&layout=new&Itemid='\n .$publication->id.'&pubtype='.$publication->pubtype\n .JRequest::getInt('Itemid', 0), JText::_('JRESEARCH_ITEM_SUCCESSFULLY_SAVED'));\n $app->setUserState('com_jresearch.edit.publication.data', array());\n }elseif($task == 'apply'){\n $this->setRedirect('index.php?option=com_jresearch&view=publication&layout=edit&id='\n .$publication->id.'&pubtype='.$publication->pubtype\n .'&Itemid='.JRequest::getInt('Itemid', 0), JText::_('JRESEARCH_ITEM_SUCCESSFULLY_SAVED'));\n }\n } else {\n $msg = JText::_('JRESEARCH_SAVE_FAILED').': '.implode(\"<br />\", $model->getErrors());\n $type = 'error';\n $app->enqueueMessage($msg, $type); \n $view = $this->getView('Publication','html', 'JResearchView');\n $view->setLayout('edit');\n $view->setModel($model, true);\n $view->display();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.